GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add types for shell, and move functions in types to utils · strogo/lowcode-engine@55c3fc9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/docs/api
    • project.md
  • modules/code-generator/src/plugins/component/rax
    • jsx.ts
  • packages
    • designer
      • src
        • builtin-simulator
          • bem-tools
            • border-container.tsx
            • border-selecting.tsx
          • host.ts
        • component-meta.ts
        • designer
          • designer.ts
          • dragon.ts
          • setting
            • setting-field.ts
            • setting-prop-entry.ts
            • setting-top-entry.ts
            • utils.ts
        • document
          • document-model.ts
          • node
            • node-children.ts
            • node.ts
            • props
              • prop.ts
        • plugin
          • plugin-types.ts
        • project
          • project.ts
        • types
          • index.ts
      • tests
        • bugs
          • prop-variable-jse.test.ts
        • builtin-simulator
          • host.test.ts
        • designer
          • designer.test.ts
          • dragon.test.ts
          • scroller.test.ts
    • editor-core/src
      • di
        • setter.ts
      • hotkey.ts
      • intl
        • index.ts
      • widgets/title
        • index.tsx
    • editor-skeleton/src
      • components
        • settings
          • settings-pane.tsx
        • stage-box
          • stage.tsx
      • skeleton.ts
      • transducers
        • parse-func.ts
      • types.ts
      • widget
        • utils.ts
    • engine/src
      • engine-core.ts
      • modules
        • designer-types.ts
        • editor-types.ts
        • live-editing.ts
    • plugin-outline-pane/src
      • tree-node.ts
      • views
        • tree.tsx
    • rax-simulator-renderer/src
      • renderer.ts
    • renderer-core/src
      • renderer
        • base.tsx
      • utils
        • common.ts
        • data-helper.ts
        • is-use-loop.ts
    • shell/src
      • canvas.ts
      • common.tsx
      • component-meta.ts
      • detecting.ts
      • document-model.ts
      • drag-object.ts
      • dragon.ts
      • drop-location.ts
      • event.ts
      • history.ts
      • hotkey.ts
      • locate-event.ts
      • material.ts
      • modal-nodes-manager.ts
      • node-children.ts
      • node.ts
      • project.ts
      • prop.ts
      • props.ts
      • selection.ts
      • setters.ts
      • setting-prop-entry.ts
      • setting-top-entry.ts
      • simulator-host.ts
      • skeleton.ts
    • types/src
      • deprecated
        • index.ts
        • isActionContentObject.ts
        • isCustomView.ts
        • isDOMText.ts
        • isDynamicSetter.ts
        • isI18nData.ts
        • isJSBlock.ts
        • isJSExpression.ts
        • isJSFunction.ts
        • isJSSlot.ts
        • isLowCodeComponentType.ts
        • isNodeSchema.ts
        • isPlainObject.ts
        • isProCodeComponentType.ts
        • isProjectSchema.ts
        • isReactClass.ts
        • isReactComponent.ts
        • isSetterConfig.ts
        • isTitleConfig.ts
      • designer.ts
      • dragon.ts
      • editor-skeleton.ts
      • editor.ts
      • i18n.ts
      • index.ts
      • metadata.ts
      • npm.ts
      • props-transducer.ts
      • schema.ts
      • setter-config.ts
      • shell
        • api
          • common.ts
          • event.ts
          • hotkey.ts
          • index.ts
          • material.ts
          • project.ts
          • setters.ts
          • simulator-host.ts
          • skeleton.ts
        • index.ts
        • model
          • canvas.ts
          • component-meta.ts
          • detecting.ts
          • document-model.ts
          • drag-object.ts
          • dragon.ts
          • drop-location.ts
          • history.ts
          • index.ts
          • locate-event.ts
          • modal-nodes-manager.ts
          • node-children.ts
          • node.ts
          • prop.ts
          • props.ts
          • selection.ts
          • setting-prop-entry.ts
          • setting-top-entry.ts
      • title.ts
      • value-type.ts
    • utils/src
      • check-types
        • index.ts
        • is-action-content-object.ts
        • is-custom-view.ts
        • is-dom-text.ts
        • is-dynamic-setter.ts
        • is-i18n-data.ts
        • is-isfunction.ts
        • is-jsblock.ts
        • is-jsexpression.ts
        • is-jsslot.ts
        • is-lowcode-component-type.ts
        • is-node-schema.ts
        • is-procode-component-type.ts
        • is-project-schema.ts
        • is-setter-config.ts
        • is-title-config.ts
      • index.ts
      • schema.ts

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/docs/api/project.md‎

Copy file name to clipboardExpand all lines: docs/docs/api/project.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ onChangeNodeVisible(fn: (node: Node, visible: boolean) => void)
248248

249249
### onChangeNodeChildren
250250

251-
onChangeNodeChildren(fn: (info?: IOnChangeOptions) => void)
251+
onChangeNodeChildren(fn: (info?: IPublicOnChangeOptions) => void)
252252

253253
当前 document 的节点 children 变更事件
254254

Collapse file

‎modules/code-generator/src/plugins/component/rax/jsx.ts‎

Copy file name to clipboardExpand all lines: modules/code-generator/src/plugins/component/rax/jsx.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) =>
147147
function __$$eval(expr) {
148148
try {
149149
return expr();
150-
} catch (error) {
150+
} catch (error) {
151151
${evalErrorsHandler}
152152
}
153153
}
Collapse file

‎packages/designer/src/builtin-simulator/bem-tools/border-container.tsx‎

Copy file name to clipboardExpand all lines: packages/designer/src/builtin-simulator/bem-tools/border-container.tsx
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import * as React from 'react';
22
import { Component, Fragment, ReactElement, PureComponent } from 'react';
33
import classNames from 'classnames';
44
import { computed, observer, Title, globalLocale } from '@alilc/lowcode-editor-core';
5-
import { I18nData, isI18nData, TitleContent } from '@alilc/lowcode-types';
5+
import { I18nData, TitleContent } from '@alilc/lowcode-types';
6+
import { isI18nData } from '@alilc/lowcode-utils';
67
import { DropLocation } from '../../designer';
78
import { BuiltinSimulatorHost } from '../../builtin-simulator/host';
89
import { ParentalNode } from '../../document/node';
Collapse file

‎packages/designer/src/builtin-simulator/bem-tools/border-selecting.tsx‎

Copy file name to clipboardExpand all lines: packages/designer/src/builtin-simulator/bem-tools/border-selecting.tsx
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import {
99
ComponentType,
1010
} from 'react';
1111
import classNames from 'classnames';
12-
import { observer, computed, Tip, globalContext, makeObservable } from '@alilc/lowcode-editor-core';
13-
import { createIcon, isReactComponent } from '@alilc/lowcode-utils';
14-
import { ActionContentObject, isActionContentObject } from '@alilc/lowcode-types';
12+
import { observer, computed, Tip, globalContext } from '@alilc/lowcode-editor-core';
13+
import { createIcon, isReactComponent, isActionContentObject } from '@alilc/lowcode-utils';
14+
import { ActionContentObject } from '@alilc/lowcode-types';
1515
import { BuiltinSimulatorHost } from '../host';
1616
import { OffsetObserver } from '../../designer';
1717
import { Node } from '../../document';
Collapse file

‎packages/designer/src/builtin-simulator/host.ts‎

Copy file name to clipboardExpand all lines: packages/designer/src/builtin-simulator/host.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ import {
3939
transactionManager,
4040
} from '@alilc/lowcode-utils';
4141
import {
42-
DragObjectType,
43-
DragNodeObject,
4442
isShaken,
4543
LocateEvent,
4644
isDragAnyObject,
@@ -62,6 +60,8 @@ import {
6260
ComponentSchema,
6361
Package,
6462
TransitionType,
63+
DragObjectType,
64+
DragNodeObject,
6565
} from '@alilc/lowcode-types';
6666
import { BuiltinSimulatorRenderer } from './renderer';
6767
import clipboard from '../designer/clipboard';
Collapse file

‎packages/designer/src/component-meta.ts‎

Copy file name to clipboardExpand all lines: packages/designer/src/component-meta.ts
+7-19Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
TitleContent,
99
TransformedComponentMetadata,
1010
NestingFilter,
11-
isTitleConfig,
1211
I18nData,
1312
LiveTextEditingConfig,
1413
FieldConfig,
14+
MetadataTransducer,
1515
} from '@alilc/lowcode-types';
16-
import { deprecate, isRegExp } from '@alilc/lowcode-utils';
16+
import { deprecate, isRegExp, isTitleConfig } from '@alilc/lowcode-utils';
1717
import { computed, engineConfig } from '@alilc/lowcode-editor-core';
1818
import EventEmitter from 'events';
1919
import { componentDefaults, legacyIssues } from './transducers';
@@ -128,8 +128,8 @@ export class ComponentMeta {
128128

129129
private _isTopFixed?: boolean;
130130

131-
get isTopFixed() {
132-
return this._isTopFixed;
131+
get isTopFixed(): boolean {
132+
return !!(this._isTopFixed);
133133
}
134134

135135
private parentWhitelist?: NestingFilter | null;
@@ -279,7 +279,7 @@ export class ComponentMeta {
279279
return result as any;
280280
}
281281

282-
isRootComponent(includeBlock = true) {
282+
isRootComponent(includeBlock = true): boolean {
283283
return (
284284
this.componentName === 'Page' ||
285285
this.componentName === 'Component' ||
@@ -326,7 +326,7 @@ export class ComponentMeta {
326326
return true;
327327
}
328328

329-
checkNestingDown(my: Node, target: Node | NodeSchema | NodeSchema[]) {
329+
checkNestingDown(my: Node, target: Node | NodeSchema | NodeSchema[]): boolean {
330330
// 检查父子关系,直接约束型,在画布中拖拽直接掠过目标容器
331331
if (this.childWhitelist) {
332332
const _target: any = !Array.isArray(target) ? [target] : target;
@@ -375,19 +375,7 @@ function preprocessMetadata(metadata: ComponentMetadata): TransformedComponentMe
375375
};
376376
}
377377

378-
export interface MetadataTransducer {
379-
(prev: TransformedComponentMetadata): TransformedComponentMetadata;
380-
/**
381-
* 0 - 9 system
382-
* 10 - 99 builtin-plugin
383-
* 100 - app & plugin
384-
*/
385-
level?: number;
386-
/**
387-
* use to replace TODO
388-
*/
389-
id?: string;
390-
}
378+
391379
const metadataTransducers: MetadataTransducer[] = [];
392380

393381
export function registerMetadataTransducer(
Collapse file

‎packages/designer/src/designer/designer.ts‎

Copy file name to clipboardExpand all lines: packages/designer/src/designer/designer.ts
+6-13Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
IEditor,
99
CompositeObject,
1010
PropsList,
11-
isNodeSchema,
1211
NodeSchema,
12+
PropsTransducer,
1313
} from '@alilc/lowcode-types';
14-
import { megreAssets, AssetsJson } from '@alilc/lowcode-utils';
14+
import { megreAssets, AssetsJson, isNodeSchema } from '@alilc/lowcode-utils';
1515
import { Project } from '../project';
1616
import { Node, DocumentModel, insertChildren, ParentalNode, TransformStage } from '../document';
1717
import { ComponentMeta } from '../component-meta';
@@ -494,7 +494,7 @@ export class Designer {
494494
getComponentMeta(
495495
componentName: string,
496496
generateMetadata?: () => ComponentMetadata | null,
497-
): ComponentMeta {
497+
) {
498498
if (this._componentMetasMap.has(componentName)) {
499499
return this._componentMetasMap.get(componentName)!;
500500
}
@@ -536,7 +536,7 @@ export class Designer {
536536
return maps;
537537
}
538538

539-
private propsReducers = new Map<TransformStage, PropsReducer[]>();
539+
private propsReducers = new Map<TransformStage, PropsTransducer[]>();
540540

541541
transformProps(props: CompositeObject | PropsList, node: Node, stage: TransformStage) {
542542
if (Array.isArray(props)) {
@@ -560,7 +560,7 @@ export class Designer {
560560
}, props);
561561
}
562562

563-
addPropsReducer(reducer: PropsReducer, stage: TransformStage) {
563+
addPropsReducer(reducer: PropsTransducer, stage: TransformStage) {
564564
const reducers = this.propsReducers.get(stage);
565565
if (reducers) {
566566
reducers.push(reducer);
@@ -576,11 +576,4 @@ export class Designer {
576576
purge() {
577577
// TODO:
578578
}
579-
}
580-
581-
export type PropsReducerContext = { stage: TransformStage };
582-
export type PropsReducer = (
583-
props: CompositeObject,
584-
node: Node,
585-
ctx?: PropsReducerContext,
586-
) => CompositeObject;
579+
}
Collapse file

‎packages/designer/src/designer/dragon.ts‎

Copy file name to clipboardExpand all lines: packages/designer/src/designer/dragon.ts
+1-26Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EventEmitter } from 'events';
22
import { obx, makeObservable } from '@alilc/lowcode-editor-core';
3-
import { NodeSchema } from '@alilc/lowcode-types';
3+
import { DragNodeObject, DragAnyObject, DragObjectType, DragNodeDataObject, DragObject } from '@alilc/lowcode-types';
44
import { Node as ShellNode } from '@alilc/lowcode-shell';
55
import { setNativeSelection, cursor } from '@alilc/lowcode-utils';
66
import { DropLocation } from './location';
@@ -80,31 +80,6 @@ export interface ISensor {
8080
getNodeInstanceFromElement(e: Element | null): NodeInstance<ComponentInstance> | null;
8181
}
8282

83-
export type DragObject = DragNodeObject | DragNodeDataObject | DragAnyObject;
84-
85-
export enum DragObjectType {
86-
// eslint-disable-next-line no-shadow
87-
Node = 'node',
88-
NodeData = 'nodedata',
89-
}
90-
91-
export interface DragNodeObject {
92-
type: DragObjectType.Node;
93-
nodes: (Node | ShellNode)[];
94-
}
95-
export interface DragNodeDataObject {
96-
type: DragObjectType.NodeData;
97-
data: NodeSchema | NodeSchema[];
98-
thumbnail?: string;
99-
description?: string;
100-
[extra: string]: any;
101-
}
102-
103-
export interface DragAnyObject {
104-
type: string;
105-
[key: string]: any;
106-
}
107-
10883
export function isDragNodeObject(obj: any): obj is DragNodeObject {
10984
return obj && obj.type === DragObjectType.Node;
11085
}
Collapse file

‎packages/designer/src/designer/setting/setting-field.ts‎

Copy file name to clipboardExpand all lines: packages/designer/src/designer/setting/setting-field.ts
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { TitleContent, isDynamicSetter, SetterType, DynamicSetter, FieldExtraProps, FieldConfig, CustomView, isCustomView } from '@alilc/lowcode-types';
1+
import { TitleContent, SetterType, DynamicSetter, FieldExtraProps, FieldConfig, CustomView, ISetValueOptions } from '@alilc/lowcode-types';
22
import { Transducer } from './utils';
33
import { SettingPropEntry } from './setting-prop-entry';
44
import { SettingEntry } from './setting-entry';
55
import { computed, obx, makeObservable, action } from '@alilc/lowcode-editor-core';
6-
import { cloneDeep } from '@alilc/lowcode-utils';
7-
import type { ISetValueOptions } from '../../types';
6+
import { cloneDeep, isCustomView, isDynamicSetter } from '@alilc/lowcode-utils';
87

98
function getSettingFieldCollectorKey(parent: SettingEntry, config: FieldConfig) {
109
let cur = parent;
Collapse file

‎packages/designer/src/designer/setting/setting-prop-entry.ts‎

Copy file name to clipboardExpand all lines: packages/designer/src/designer/setting/setting-prop-entry.ts
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { obx, computed, makeObservable, runInAction } from '@alilc/lowcode-editor-core';
2-
import { GlobalEvent, IEditor, isJSExpression } from '@alilc/lowcode-types';
3-
import { uniqueId } from '@alilc/lowcode-utils';
2+
import { GlobalEvent, IEditor, ISetValueOptions } from '@alilc/lowcode-types';
3+
import { uniqueId, isJSExpression } from '@alilc/lowcode-utils';
44
import { SettingPropEntry as ShellSettingPropEntry } from '@alilc/lowcode-shell';
55
import { SettingEntry } from './setting-entry';
66
import { Node } from '../../document';
77
import { ComponentMeta } from '../../component-meta';
88
import { Designer } from '../designer';
99
import { EventEmitter } from 'events';
10-
import { ISetValueOptions } from '../../types';
1110
import { isSettingField } from './setting-field';
1211

1312
export class SettingPropEntry implements SettingEntry {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.