@kabel-project/kabel 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comment-renderer/renderer.d.ts +32 -0
- package/dist/comment-renderer/renderer.d.ts.map +1 -0
- package/dist/controllers/base.d.ts +39 -0
- package/dist/controllers/base.d.ts.map +1 -0
- package/dist/controllers/wasd.d.ts +33 -0
- package/dist/controllers/wasd.d.ts.map +1 -0
- package/dist/events/comment-drag-handle.d.ts +2 -0
- package/dist/events/comment-drag-handle.d.ts.map +1 -0
- package/dist/events/comment-input.d.ts +4 -0
- package/dist/events/comment-input.d.ts.map +1 -0
- package/dist/events/connection-line.d.ts +2 -0
- package/dist/events/connection-line.d.ts.map +1 -0
- package/dist/events/connector.d.ts +2 -0
- package/dist/events/connector.d.ts.map +1 -0
- package/dist/events/draggable.d.ts +2 -0
- package/dist/events/draggable.d.ts.map +1 -0
- package/{events/events.ts → dist/events/events.d.ts} +8 -7
- package/dist/events/events.d.ts.map +1 -0
- package/dist/events/input-box.d.ts +2 -0
- package/dist/events/input-box.d.ts.map +1 -0
- package/dist/events/node-x-btn.d.ts +2 -0
- package/dist/events/node-x-btn.d.ts.map +1 -0
- package/dist/kabel.js +2 -0
- package/dist/kabel.js.map +1 -0
- package/dist/renderers/apollo/apollo.d.ts +12 -0
- package/dist/renderers/apollo/apollo.d.ts.map +1 -0
- package/dist/renderers/apollo/constants.d.ts +21 -0
- package/dist/renderers/apollo/constants.d.ts.map +1 -0
- package/dist/renderers/apollo/renderer.d.ts +97 -0
- package/dist/renderers/apollo/renderer.d.ts.map +1 -0
- package/{renderers/atlas/atlas.ts → dist/renderers/atlas/atlas.d.ts} +6 -15
- package/dist/renderers/atlas/atlas.d.ts.map +1 -0
- package/dist/renderers/constants.d.ts +51 -0
- package/dist/renderers/constants.d.ts.map +1 -0
- package/dist/renderers/renderer.d.ts +470 -0
- package/dist/renderers/renderer.d.ts.map +1 -0
- package/dist/renderers/representer-node.d.ts +27 -0
- package/dist/renderers/representer-node.d.ts.map +1 -0
- package/dist/renderers/representer.d.ts +13 -0
- package/dist/renderers/representer.d.ts.map +1 -0
- package/dist/src/category.d.ts +48 -0
- package/dist/src/category.d.ts.map +1 -0
- package/{src/colors.ts → dist/src/colors.d.ts} +21 -20
- package/dist/src/colors.d.ts.map +1 -0
- package/dist/src/comment.d.ts +88 -0
- package/dist/src/comment.d.ts.map +1 -0
- package/dist/src/connection.d.ts +52 -0
- package/dist/src/connection.d.ts.map +1 -0
- package/dist/src/context-menu.d.ts +76 -0
- package/dist/src/context-menu.d.ts.map +1 -0
- package/dist/src/coordinates.d.ts +52 -0
- package/dist/src/coordinates.d.ts.map +1 -0
- package/dist/src/core.d.ts +153 -0
- package/dist/src/core.d.ts.map +1 -0
- package/dist/src/ctx-menu-registry.d.ts +22 -0
- package/dist/src/ctx-menu-registry.d.ts.map +1 -0
- package/dist/src/dropdown-menu.d.ts +87 -0
- package/dist/src/dropdown-menu.d.ts.map +1 -0
- package/dist/src/field.d.ts +305 -0
- package/dist/src/field.d.ts.map +1 -0
- package/dist/src/flyout.d.ts +41 -0
- package/dist/src/flyout.d.ts.map +1 -0
- package/dist/src/fonts-manager.d.ts +6 -0
- package/dist/src/fonts-manager.d.ts.map +1 -0
- package/dist/src/grid.d.ts +60 -0
- package/dist/src/grid.d.ts.map +1 -0
- package/dist/src/headless-node.d.ts +11 -0
- package/dist/src/headless-node.d.ts.map +1 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/inject-headless.d.ts +4 -0
- package/dist/src/inject-headless.d.ts.map +1 -0
- package/{src/inject.ts → dist/src/inject.d.ts} +142 -213
- package/dist/src/inject.d.ts.map +1 -0
- package/{src/main-workspace.ts → dist/src/main-workspace.d.ts} +31 -51
- package/dist/src/main-workspace.d.ts.map +1 -0
- package/dist/src/mutator.d.ts +2 -0
- package/dist/src/mutator.d.ts.map +1 -0
- package/{src/node-types.ts → dist/src/node-types.d.ts} +26 -27
- package/dist/src/node-types.d.ts.map +1 -0
- package/dist/src/nodesvg.d.ts +266 -0
- package/dist/src/nodesvg.d.ts.map +1 -0
- package/{src/prototypes.ts → dist/src/prototypes.d.ts} +10 -9
- package/dist/src/prototypes.d.ts.map +1 -0
- package/{src/renderer-map.ts → dist/src/renderer-map.d.ts} +51 -86
- package/dist/src/renderer-map.d.ts.map +1 -0
- package/dist/src/toolbox.d.ts +51 -0
- package/dist/src/toolbox.d.ts.map +1 -0
- package/{src/types.ts → dist/src/types.d.ts} +159 -205
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/undo-redo.d.ts +15 -0
- package/dist/src/undo-redo.d.ts.map +1 -0
- package/{src/visual-types.ts → dist/src/visual-types.d.ts} +34 -29
- package/dist/src/visual-types.d.ts.map +1 -0
- package/dist/src/widget-prototypes.d.ts +10 -0
- package/dist/src/widget-prototypes.d.ts.map +1 -0
- package/dist/src/widget.d.ts +62 -0
- package/dist/src/widget.d.ts.map +1 -0
- package/{src/workspace-coords.ts → dist/src/workspace-coords.d.ts} +10 -14
- package/dist/src/workspace-coords.d.ts.map +1 -0
- package/dist/src/workspace-svg.d.ts +371 -0
- package/dist/src/workspace-svg.d.ts.map +1 -0
- package/dist/src/workspace.d.ts +50 -0
- package/dist/src/workspace.d.ts.map +1 -0
- package/dist/themes/dark.d.ts +4 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/default.d.ts +4 -0
- package/dist/themes/default.d.ts.map +1 -0
- package/dist/themes/themes.d.ts +6 -0
- package/dist/themes/themes.d.ts.map +1 -0
- package/dist/util/emitter.d.ts +10 -0
- package/dist/util/emitter.d.ts.map +1 -0
- package/dist/util/env.d.ts +7 -0
- package/dist/util/env.d.ts.map +1 -0
- package/{util/escape-html.ts → dist/util/escape-html.d.ts} +16 -22
- package/dist/util/escape-html.d.ts.map +1 -0
- package/dist/util/eventer.d.ts +29 -0
- package/dist/util/eventer.d.ts.map +1 -0
- package/dist/util/has-prop.d.ts +2 -0
- package/dist/util/has-prop.d.ts.map +1 -0
- package/dist/util/parse-color.d.ts +6 -0
- package/dist/util/parse-color.d.ts.map +1 -0
- package/dist/util/path.d.ts +25 -0
- package/dist/util/path.d.ts.map +1 -0
- package/dist/util/styler.d.ts +12 -0
- package/dist/util/styler.d.ts.map +1 -0
- package/dist/util/uid.d.ts +42 -0
- package/dist/util/uid.d.ts.map +1 -0
- package/{util/unescape-html.ts → dist/util/unescape-html.d.ts} +16 -22
- package/dist/util/unescape-html.d.ts.map +1 -0
- package/dist/util/user-state.d.ts +37 -0
- package/dist/util/user-state.d.ts.map +1 -0
- package/{util/wait-anim-frames.ts → dist/util/wait-anim-frames.d.ts} +11 -24
- package/dist/util/wait-anim-frames.d.ts.map +1 -0
- package/dist/util/window-listeners.d.ts +8 -0
- package/dist/util/window-listeners.d.ts.map +1 -0
- package/package.json +4 -1
- package/(1.0.7)kabel.md +0 -18
- package/_READ_ME_MEDIA_/documentation/docs.md +0 -293
- package/_READ_ME_MEDIA_/workspace.png +0 -0
- package/comment-renderer/renderer.ts +0 -228
- package/controllers/base.ts +0 -186
- package/controllers/wasd.ts +0 -132
- package/docs/README.md +0 -98
- package/docs/_media/docs.md +0 -289
- package/docs/_media/workspace.png +0 -0
- package/docs/classes/CommentModel.md +0 -271
- package/docs/classes/CommentRenderer.md +0 -457
- package/docs/classes/ConnectableField.md +0 -597
- package/docs/classes/Connection.md +0 -191
- package/docs/classes/ContextMenuHTML.md +0 -163
- package/docs/classes/Coordinates.md +0 -187
- package/docs/classes/DropdownContainer.md +0 -300
- package/docs/classes/DummyField.md +0 -393
- package/docs/classes/Eventer.md +0 -185
- package/docs/classes/Field.md +0 -461
- package/docs/classes/InjectMsg.md +0 -85
- package/docs/classes/NodeSvg.md +0 -1011
- package/docs/classes/NumberField.md +0 -559
- package/docs/classes/OptConnectField.md +0 -624
- package/docs/classes/Renderer.md +0 -1636
- package/docs/classes/RendererConstants.md +0 -343
- package/docs/classes/Representer.md +0 -95
- package/docs/classes/RepresenterNode.md +0 -175
- package/docs/classes/TextField.md +0 -559
- package/docs/classes/Toolbox.md +0 -172
- package/docs/classes/WASDController.md +0 -616
- package/docs/classes/Widget.md +0 -195
- package/docs/classes/WorkspaceController.md +0 -385
- package/docs/classes/WorkspaceCoords.md +0 -218
- package/docs/classes/WorkspaceSvg.md +0 -1380
- package/docs/functions/clearMainWorkspace.md +0 -20
- package/docs/functions/getMainWorkspace.md +0 -19
- package/docs/functions/inject.md +0 -35
- package/docs/functions/setMainWorkspace.md +0 -28
- package/docs/globals.md +0 -95
- package/docs/interfaces/ColorStyle.md +0 -43
- package/docs/interfaces/ConnectorToFrom.md +0 -57
- package/docs/interfaces/DrawState.md +0 -81
- package/docs/interfaces/FieldConnectionData.md +0 -25
- package/docs/interfaces/FieldOptions.md +0 -63
- package/docs/interfaces/FieldRawBoxData.md +0 -25
- package/docs/interfaces/FieldVisualInfo.md +0 -65
- package/docs/interfaces/GridOptions.md +0 -61
- package/docs/interfaces/InjectOptions.md +0 -133
- package/docs/interfaces/InputFieldJson.md +0 -50
- package/docs/interfaces/KabelCommentRendering.md +0 -31
- package/docs/interfaces/KabelInterface.md +0 -469
- package/docs/interfaces/KabelNodeRendering.md +0 -77
- package/docs/interfaces/KabelUIX.md +0 -105
- package/docs/interfaces/KabelUtils.md +0 -215
- package/docs/interfaces/NodeEvents.md +0 -42
- package/docs/interfaces/NodeJson.md +0 -104
- package/docs/interfaces/NodePrototype.md +0 -82
- package/docs/interfaces/RegisteredEl.md +0 -53
- package/docs/interfaces/SerializedNode.md +0 -128
- package/docs/interfaces/TblxCategoryStruct.md +0 -41
- package/docs/interfaces/TblxFieldStruct.md +0 -28
- package/docs/interfaces/TblxNodeStruct.md +0 -35
- package/docs/interfaces/WidgetOptions.md +0 -115
- package/docs/interfaces/WidgetPrototypeList.md +0 -15
- package/docs/type-aliases/AnyField.md +0 -13
- package/docs/type-aliases/AnyFieldCls.md +0 -13
- package/docs/type-aliases/Color.md +0 -13
- package/docs/type-aliases/Connectable.md +0 -13
- package/docs/type-aliases/EventArgs.md +0 -11
- package/docs/type-aliases/EventSetupFn.md +0 -25
- package/docs/type-aliases/Hex.md +0 -13
- package/docs/type-aliases/RGBObject.md +0 -37
- package/docs/type-aliases/RGBString.md +0 -13
- package/docs/type-aliases/RGBTuple.md +0 -13
- package/docs/type-aliases/TblxObjStruct.md +0 -52
- package/docs/variables/CategoryColors.md +0 -29
- package/docs/variables/FieldMap.md +0 -41
- package/docs/variables/NodePrototypes.md +0 -18
- package/docs/variables/default.md +0 -11
- package/events/comment-drag-handle.ts +0 -61
- package/events/comment-input.ts +0 -291
- package/events/connection-line.ts +0 -68
- package/events/connector.ts +0 -116
- package/events/draggable.ts +0 -119
- package/events/input-box.ts +0 -213
- package/events/node-x-btn.ts +0 -25
- package/index.d.ts +0 -4
- package/renderers/apollo/apollo.ts +0 -21
- package/renderers/apollo/constants.ts +0 -40
- package/renderers/apollo/renderer.ts +0 -331
- package/renderers/constants.ts +0 -87
- package/renderers/renderer.ts +0 -1288
- package/renderers/representer-node.ts +0 -52
- package/renderers/representer.ts +0 -25
- package/src/category.ts +0 -107
- package/src/comment.ts +0 -142
- package/src/connection.ts +0 -114
- package/src/context-menu.ts +0 -194
- package/src/coordinates.ts +0 -74
- package/src/core.ts +0 -202
- package/src/ctx-menu-registry.ts +0 -143
- package/src/dropdown-menu.ts +0 -215
- package/src/field.ts +0 -595
- package/src/flyout.ts +0 -165
- package/src/fonts-manager.ts +0 -38
- package/src/grid.ts +0 -162
- package/src/headless-node.ts +0 -27
- package/src/index.ts +0 -115
- package/src/inject-headless.ts +0 -18
- package/src/mutator.ts +0 -40
- package/src/nodesvg.ts +0 -756
- package/src/styles.css +0 -224
- package/src/toolbox.ts +0 -125
- package/src/undo-redo.ts +0 -87
- package/src/widget-prototypes.ts +0 -11
- package/src/widget.ts +0 -139
- package/src/workspace-svg.ts +0 -736
- package/src/workspace.ts +0 -155
- package/test-server.js +0 -61
- package/themes/dark.ts +0 -32
- package/themes/default.ts +0 -28
- package/themes/themes.ts +0 -9
- package/tsconfig.json +0 -25
- package/typedoc.json +0 -10
- package/util/emitter.ts +0 -33
- package/util/env.ts +0 -11
- package/util/eventer.ts +0 -108
- package/util/has-prop.ts +0 -4
- package/util/parse-color.ts +0 -42
- package/util/path.ts +0 -99
- package/util/styler.ts +0 -41
- package/util/uid.ts +0 -184
- package/util/user-state.ts +0 -68
- package/util/window-listeners.ts +0 -62
- package/webpack.config.js +0 -80
- /package/{docs/_media → dist}/index.html +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import Connection from "./connection";
|
|
2
|
+
import { G, Path, Rect, Svg, Text } from '@svgdotjs/svg.js';
|
|
3
|
+
import NodeSvg from "./nodesvg";
|
|
4
|
+
import { ConnectorToFrom } from "../renderers/renderer";
|
|
5
|
+
import WorkspaceSvg from "./workspace-svg";
|
|
6
|
+
/**
|
|
7
|
+
* Options used to initialize a Field.
|
|
8
|
+
*/
|
|
9
|
+
export interface FieldOptions {
|
|
10
|
+
name: string;
|
|
11
|
+
/** Human-readable label for the field */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Key used to identify the field type in FieldTypesMap */
|
|
14
|
+
type: string;
|
|
15
|
+
/** Field value (optional) */
|
|
16
|
+
value?: any;
|
|
17
|
+
/** Only used by OptConnectField to determine internal value type */
|
|
18
|
+
fld_type?: "number" | "string";
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}
|
|
21
|
+
export interface FieldVisualInfo {
|
|
22
|
+
measuredWidth: number;
|
|
23
|
+
measuredHeight: number;
|
|
24
|
+
background: Rect;
|
|
25
|
+
svg: Svg;
|
|
26
|
+
nodeGroup: G;
|
|
27
|
+
fieldGroup: G;
|
|
28
|
+
xUsed: number;
|
|
29
|
+
}
|
|
30
|
+
export interface FieldRawBoxData {
|
|
31
|
+
box: Rect;
|
|
32
|
+
txt: Text;
|
|
33
|
+
}
|
|
34
|
+
export interface FieldConnectionData {
|
|
35
|
+
connector: Path;
|
|
36
|
+
connState: ConnectorToFrom;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Base class for all fields.
|
|
40
|
+
* @template T The type of the value stored in the field
|
|
41
|
+
*/
|
|
42
|
+
declare class Field<T = any> {
|
|
43
|
+
label: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
node?: NodeSvg;
|
|
47
|
+
editable: boolean;
|
|
48
|
+
svgGroup?: G;
|
|
49
|
+
protected value: T | null;
|
|
50
|
+
static register(name: string, cls: Function): void;
|
|
51
|
+
static unregister(name: string): void;
|
|
52
|
+
constructor();
|
|
53
|
+
onDraw(rawBox?: FieldRawBoxData, connectionBubble?: FieldConnectionData): void;
|
|
54
|
+
canEditConnector(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Set whether or not you can edit this field.
|
|
57
|
+
* @param val - The value to set to.
|
|
58
|
+
*/
|
|
59
|
+
setEditable(val: boolean): void;
|
|
60
|
+
/**
|
|
61
|
+
* Ask whether or not we can edit this field.
|
|
62
|
+
*/
|
|
63
|
+
canEdit(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Set field name to something else.
|
|
66
|
+
* @param name string
|
|
67
|
+
* @returns the new name.
|
|
68
|
+
*/
|
|
69
|
+
setName(name: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Initialize the field from JSON options.
|
|
72
|
+
* @param json FieldOptions object
|
|
73
|
+
*/
|
|
74
|
+
fromJson(json: FieldOptions, workspace?: WorkspaceSvg): void;
|
|
75
|
+
/** @returns The field's name/key */
|
|
76
|
+
getName(): string;
|
|
77
|
+
/** @returns The human-readable label */
|
|
78
|
+
getLabel(): string;
|
|
79
|
+
/**
|
|
80
|
+
* Set the human-readable label
|
|
81
|
+
* @param label New label
|
|
82
|
+
* @returns The updated label
|
|
83
|
+
*/
|
|
84
|
+
setLabel(label: string): string;
|
|
85
|
+
/** @returns Whether this field is a raw value field (text/number) */
|
|
86
|
+
hasRaw(): boolean;
|
|
87
|
+
/** @returns Whether this field supports connections */
|
|
88
|
+
hasConnectable(): boolean;
|
|
89
|
+
/** @returns Whether we have a custom editor/input look */
|
|
90
|
+
isCustomEditor(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Make the input's custom look.
|
|
93
|
+
* @param fieldVisualInfo - The visual info of the field, mutate this if needed.
|
|
94
|
+
*/
|
|
95
|
+
drawMyself(fieldVisualInfo: FieldVisualInfo): void;
|
|
96
|
+
/** Return width & height of your field's custom editor */
|
|
97
|
+
measureMyself(): {
|
|
98
|
+
width: null;
|
|
99
|
+
height: null;
|
|
100
|
+
};
|
|
101
|
+
/** @returns The stored value */
|
|
102
|
+
getValue(): T | null;
|
|
103
|
+
/**
|
|
104
|
+
* Set the stored value
|
|
105
|
+
* @param val New value
|
|
106
|
+
*/
|
|
107
|
+
setValue(val: T): void;
|
|
108
|
+
/** @returns The value as it should be displayed (can differ from internal value) */
|
|
109
|
+
getDisplayValue(): T | null;
|
|
110
|
+
toJson(deep: boolean, alreadyProcessed: {
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}): FieldOptions;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Used when you want just a label with no actual value. Any value related methods are no-op.
|
|
116
|
+
*/
|
|
117
|
+
export declare class DummyField {
|
|
118
|
+
label: string;
|
|
119
|
+
name: string;
|
|
120
|
+
type: string;
|
|
121
|
+
node?: NodeSvg;
|
|
122
|
+
editable: boolean;
|
|
123
|
+
svgGroup?: G;
|
|
124
|
+
constructor();
|
|
125
|
+
onDraw(rawBox?: FieldRawBoxData, connectionBubble?: FieldConnectionData): void;
|
|
126
|
+
canEditConnector(): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Set whether or not you can edit this field.
|
|
129
|
+
* @param val - The value to set to.
|
|
130
|
+
*/
|
|
131
|
+
setEditable(val: boolean): void;
|
|
132
|
+
/**
|
|
133
|
+
* Ask whether or not we can edit this field.
|
|
134
|
+
*/
|
|
135
|
+
canEdit(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Set field name to something else.
|
|
138
|
+
* @param name string
|
|
139
|
+
* @returns the new name.
|
|
140
|
+
*/
|
|
141
|
+
setName(name: string): string;
|
|
142
|
+
/**
|
|
143
|
+
* Initialize the field from JSON options.
|
|
144
|
+
* @param json FieldOptions object
|
|
145
|
+
*/
|
|
146
|
+
fromJson(json: FieldOptions): void;
|
|
147
|
+
/** @returns Whether this field is a raw value field (text/number) */
|
|
148
|
+
hasRaw(): boolean;
|
|
149
|
+
/** @returns Whether this field supports connections */
|
|
150
|
+
hasConnectable(): boolean;
|
|
151
|
+
/** @returns The field's name/key */
|
|
152
|
+
getName(): string;
|
|
153
|
+
/** @returns The human-readable label */
|
|
154
|
+
getLabel(): string;
|
|
155
|
+
/**
|
|
156
|
+
* Set the human-readable label
|
|
157
|
+
* @param label New label
|
|
158
|
+
* @returns The updated label
|
|
159
|
+
*/
|
|
160
|
+
setLabel(label: string): string;
|
|
161
|
+
/** @returns Whether we have a custom editor/input look */
|
|
162
|
+
isCustomEditor(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Make the input's custom look.
|
|
165
|
+
* @param fieldVisualInfo - The visual info of the field, mutate this if needed.
|
|
166
|
+
*/
|
|
167
|
+
drawMyself(fieldVisualInfo: FieldVisualInfo): void;
|
|
168
|
+
/** Return width & height of your field's custom editor */
|
|
169
|
+
measureMyself(): {
|
|
170
|
+
width: number;
|
|
171
|
+
height: number;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Dummy fields have no value.
|
|
175
|
+
* @returns {null}
|
|
176
|
+
*/
|
|
177
|
+
getValue(): null;
|
|
178
|
+
/**
|
|
179
|
+
* No-op for dummy fields
|
|
180
|
+
*/
|
|
181
|
+
setValue(_: any): void;
|
|
182
|
+
/** @returns The value as it should be displayed (can differ from internal value) */
|
|
183
|
+
getDisplayValue(): null;
|
|
184
|
+
toJson(deep: boolean, alreadyProcessed: {
|
|
185
|
+
[key: string]: any;
|
|
186
|
+
}): FieldOptions;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Base class for fields that can be connected to other fields.
|
|
190
|
+
* @template T The type of the value stored in the field
|
|
191
|
+
*/
|
|
192
|
+
export declare class ConnectableField<T = any> extends Field<T> {
|
|
193
|
+
connection: Connection;
|
|
194
|
+
constructor();
|
|
195
|
+
hasConnectable(): boolean;
|
|
196
|
+
hasRaw(): boolean;
|
|
197
|
+
/** Disconnect this field from any connected Connectable */
|
|
198
|
+
disconnect(): void;
|
|
199
|
+
fromJson(json: FieldOptions, workspace?: WorkspaceSvg): this;
|
|
200
|
+
toJson(deep: boolean, alreadyProcessed: {
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
}): FieldOptions;
|
|
203
|
+
}
|
|
204
|
+
/** Field storing a numeric value */
|
|
205
|
+
export declare class NumberField extends Field<number> {
|
|
206
|
+
constructor();
|
|
207
|
+
fromJson(json: FieldOptions): void;
|
|
208
|
+
setValue(val: number): void;
|
|
209
|
+
}
|
|
210
|
+
/** Field storing a string value */
|
|
211
|
+
export declare class TextField extends Field<string> {
|
|
212
|
+
constructor();
|
|
213
|
+
fromJson(json: FieldOptions): void;
|
|
214
|
+
setValue(val: string): void;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Optional connectable field.
|
|
218
|
+
* Can store either a number or string depending on fld_type.
|
|
219
|
+
*/
|
|
220
|
+
export declare class OptConnectField extends ConnectableField<number | string | NodeSvg> {
|
|
221
|
+
fldType: "number" | "string";
|
|
222
|
+
constructor();
|
|
223
|
+
canEditConnector(): boolean;
|
|
224
|
+
canEdit(): boolean;
|
|
225
|
+
getValue(): string | number | NodeSvg | null;
|
|
226
|
+
hasRaw(): boolean;
|
|
227
|
+
hasConnectable(): boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Set field type.
|
|
230
|
+
* @param type "number"|"string"
|
|
231
|
+
*/
|
|
232
|
+
setFieldType(type: "number" | "string"): void;
|
|
233
|
+
/**
|
|
234
|
+
* Initialize from JSON, respecting fld_type
|
|
235
|
+
* @param json FieldOptions
|
|
236
|
+
*/
|
|
237
|
+
fromJson(json: FieldOptions, workspace?: WorkspaceSvg): this;
|
|
238
|
+
/**
|
|
239
|
+
* Set the value, converting to number or string depending on fld_type
|
|
240
|
+
* @param val The new value
|
|
241
|
+
*/
|
|
242
|
+
setValue(val: number | string): void;
|
|
243
|
+
/**
|
|
244
|
+
* @returns Display value for UI purposes (never null)
|
|
245
|
+
*/
|
|
246
|
+
getDisplayValue(): string;
|
|
247
|
+
toJson(deep: boolean, alreadyProcessed: {
|
|
248
|
+
[key: string]: any;
|
|
249
|
+
}): FieldOptions;
|
|
250
|
+
}
|
|
251
|
+
export type DropdownItem = {
|
|
252
|
+
text: string;
|
|
253
|
+
value: string;
|
|
254
|
+
} | string;
|
|
255
|
+
export declare class DropdownField extends Field<string> {
|
|
256
|
+
options: DropdownItem[] | null;
|
|
257
|
+
_selected: DropdownItem | null;
|
|
258
|
+
_isOpen: boolean;
|
|
259
|
+
constructor();
|
|
260
|
+
onDraw(rawBox?: FieldRawBoxData): void;
|
|
261
|
+
private toggleDropdown;
|
|
262
|
+
private openDropdown;
|
|
263
|
+
private closeDropdown;
|
|
264
|
+
canEdit(): boolean;
|
|
265
|
+
getSelected(): DropdownItem | null;
|
|
266
|
+
fromJson(json: FieldOptions): void;
|
|
267
|
+
/**
|
|
268
|
+
* Display value of dropdowns.
|
|
269
|
+
* @returns - Display value
|
|
270
|
+
*/
|
|
271
|
+
getDisplayValue(): string;
|
|
272
|
+
/**
|
|
273
|
+
* Set options on this dropdown
|
|
274
|
+
* @param options - List of options
|
|
275
|
+
*/
|
|
276
|
+
setOptions(options: DropdownItem[]): void;
|
|
277
|
+
/**
|
|
278
|
+
*
|
|
279
|
+
* @param deep - Whether to recursive it.
|
|
280
|
+
* @param alreadyProcessed - Map of already serialized nodes.
|
|
281
|
+
* @returns - Json of this field.
|
|
282
|
+
*/
|
|
283
|
+
toJson(deep: boolean, alreadyProcessed: {
|
|
284
|
+
[key: string]: any;
|
|
285
|
+
}): FieldOptions;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Any field instance type
|
|
289
|
+
*/
|
|
290
|
+
export type AnyField = Field | OptConnectField | NumberField | TextField | DummyField | ConnectableField;
|
|
291
|
+
/**
|
|
292
|
+
* Any field class type
|
|
293
|
+
*/
|
|
294
|
+
export type AnyFieldCls = typeof Field | typeof OptConnectField | typeof ConnectableField | typeof NumberField | typeof TextField | typeof DummyField;
|
|
295
|
+
export declare const FieldMap: {
|
|
296
|
+
field_both: typeof OptConnectField;
|
|
297
|
+
field_string: typeof TextField;
|
|
298
|
+
field_num: typeof NumberField;
|
|
299
|
+
field_dummy: typeof DummyField;
|
|
300
|
+
field_str: typeof TextField;
|
|
301
|
+
connection: typeof ConnectableField;
|
|
302
|
+
[key: string]: AnyFieldCls;
|
|
303
|
+
};
|
|
304
|
+
export default Field;
|
|
305
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,UAA2B,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAO,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,oEAAoE;IACpE,QAAQ,CAAC,EAAE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AAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,YAAY;CAGhF;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,gBAAgB,CAAC;AACzG;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,KAAK,GAAG,OAAO,eAAe,GAAG,OAAO,gBAAgB,GAAG,OAAO,WAAW,GAAG,OAAO,SAAS,GAAG,OAAO,UAAU,CAAC;AACtJ,eAAO,MAAM,QAAQ,EAAE;IACnB,UAAU,EAAE,OAAO,eAAe,CAAC;IACnC,YAAY,EAAE,OAAO,SAAS,CAAC;IAC/B,SAAS,EAAE,OAAO,WAAW,CAAC;IAC9B,WAAW,EAAE,OAAO,UAAU,CAAC;IAC/B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,UAAU,EAAE,OAAO,gBAAgB,CAAC;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CAS9B,CAAA;AAGD,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TblxNodeStruct } from "./inject";
|
|
2
|
+
import Toolbox from "./toolbox";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a flyout menu for a toolbox in Kabel.
|
|
5
|
+
* Displays a list of nodes that can be dragged into a workspace.
|
|
6
|
+
*/
|
|
7
|
+
declare class Flyout {
|
|
8
|
+
container: HTMLDivElement;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
toolbox?: Toolbox | undefined;
|
|
11
|
+
constructor(toolbox?: Toolbox);
|
|
12
|
+
/**
|
|
13
|
+
* Populates the flyout with a list of nodes.
|
|
14
|
+
*/
|
|
15
|
+
fill(nodes: TblxNodeStruct[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a DOM element for a node with event listeners attached.
|
|
18
|
+
*/
|
|
19
|
+
private createNodeElement;
|
|
20
|
+
/**
|
|
21
|
+
* Applies consistent styling to a node element.
|
|
22
|
+
*/
|
|
23
|
+
private applyNodeStyles;
|
|
24
|
+
/**
|
|
25
|
+
* Handles starting a drag operation for a node.
|
|
26
|
+
*/
|
|
27
|
+
private onNodeMouseDown;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a ghost element that follows the mouse during drag.
|
|
30
|
+
*/
|
|
31
|
+
private createGhostNode;
|
|
32
|
+
/**
|
|
33
|
+
* Handles dropping a node into the workspace if the mouse is over it.
|
|
34
|
+
*/
|
|
35
|
+
private dropNode;
|
|
36
|
+
show(): void;
|
|
37
|
+
hide(): void;
|
|
38
|
+
clear(): void;
|
|
39
|
+
}
|
|
40
|
+
export default Flyout;
|
|
41
|
+
//# sourceMappingURL=flyout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flyout.d.ts","sourceRoot":"","sources":["../../src/flyout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,OAAO,MAAM,WAAW,CAAC;AAIhC;;;GAGG;AACH,cAAM,MAAM;IACX,SAAS,EAAE,cAAc,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,GAAC,SAAS,CAAC;gBAEhB,OAAO,CAAC,EAAE,OAAO;IAe7B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE;IAa5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAWzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAavB;;OAEG;IACH,OAAO,CAAC,eAAe;IA0BvB;;OAEG;IACH,OAAO,CAAC,eAAe;IAWvB;;OAEG;IACH,OAAO,CAAC,QAAQ;IA2BhB,IAAI;IAKJ,IAAI;IAKJ,KAAK;CAGL;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts-manager.d.ts","sourceRoot":"","sources":["../../src/fonts-manager.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAM,EAAe,GAC5B,OAAO,CAAC,IAAI,CAAC,CAwBf"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Svg } from "@svgdotjs/svg.js";
|
|
2
|
+
import WorkspaceSvg from "./workspace-svg";
|
|
3
|
+
/**
|
|
4
|
+
* Options for configuring the workspace grid.
|
|
5
|
+
* @typedef {Object} GridOptions
|
|
6
|
+
* @property {"dotted"|"celled"} [type="dotted"] - The type of grid to render.
|
|
7
|
+
* @property {number} [spacing=40] - The spacing between grid dots or cells.
|
|
8
|
+
* @property {number} [dotSize=2] - The radius of the dots (only for dotted type).
|
|
9
|
+
* @property {number} [strokeWidth=2] - Stroke width of the cells (only for celled type).
|
|
10
|
+
* @property {string} [color="#bebebeff"] - Color of the grid.
|
|
11
|
+
*/
|
|
12
|
+
export interface GridOptions {
|
|
13
|
+
type?: "dotted" | "celled";
|
|
14
|
+
spacing?: number;
|
|
15
|
+
dotSize?: number;
|
|
16
|
+
strokeWidth?: number;
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Handles drawing and managing a workspace background grid.
|
|
21
|
+
*/
|
|
22
|
+
export default class Grid {
|
|
23
|
+
private ws;
|
|
24
|
+
private svg;
|
|
25
|
+
private pattern?;
|
|
26
|
+
private rect?;
|
|
27
|
+
/** Cached + normalized grid values */
|
|
28
|
+
private grid;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new Grid instance and attaches it to the given workspace SVG.
|
|
31
|
+
* @param {WorkspaceSvg} ws - The workspace this grid belongs to.
|
|
32
|
+
* @param {Svg} svg - The SVG element to draw the grid into.
|
|
33
|
+
* @param {GridOptions} opts - Initial options for the grid.
|
|
34
|
+
*/
|
|
35
|
+
constructor(ws: WorkspaceSvg, svg: Svg, opts: GridOptions);
|
|
36
|
+
/**
|
|
37
|
+
* Initializes the grid pattern, background rect, and attaches resize listener.
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
private init;
|
|
41
|
+
/**
|
|
42
|
+
* Resizes the grid background rect to fit the workspace size.
|
|
43
|
+
*/
|
|
44
|
+
resize(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Updates the grid pattern transform according to zoom and camera position.
|
|
47
|
+
* Scales the dots/cells to match zoom and repositions them based on camera.
|
|
48
|
+
*/
|
|
49
|
+
updateTransform(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Updates internal grid options from the workspace configuration.
|
|
52
|
+
*/
|
|
53
|
+
updateOptions(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Dynamically sets new grid options and rebuilds the grid pattern.
|
|
56
|
+
* @param {Partial<GridOptions>} newOpts - New options to apply.
|
|
57
|
+
*/
|
|
58
|
+
setOptions(newOpts: Partial<GridOptions>): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAiB,MAAM,kBAAkB,CAAC;AACtD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAG3C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,OAAO,CAAC,CAAU;IAC1B,OAAO,CAAC,IAAI,CAAC,CAAO;IAEpB,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAwB;IAEpC;;;;;OAKG;gBACS,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW;IAezD;;;OAGG;IACH,OAAO,CAAC,IAAI;IAgCZ;;OAEG;IACH,MAAM;IAON;;;OAGG;IACH,eAAe;IAgCf;;OAEG;IACH,aAAa;IAYb;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;CAM3C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import NodeSvg from "./nodesvg";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new headless NodeSvg instance without attaching it to a workspace.
|
|
4
|
+
* This is useful for programmatic node generation, testing, or serialization.
|
|
5
|
+
*
|
|
6
|
+
* @param type - The type of node to create. Must exist in NodePrototypes.
|
|
7
|
+
* @returns The initialized NodeSvg instance, or `undefined` if the prototype does not exist.
|
|
8
|
+
*/
|
|
9
|
+
declare function newHeadlessNode(type: string): NodeSvg | undefined;
|
|
10
|
+
export default newHeadlessNode;
|
|
11
|
+
//# sourceMappingURL=headless-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless-node.d.ts","sourceRoot":"","sources":["../../src/headless-node.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,WAAW,CAAC;AAGhC;;;;;;GAMG;AACH,iBAAS,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAa1D;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kabel Core Export Module
|
|
3
|
+
* ------------------------
|
|
4
|
+
* Aggregates all core Kabel modules, types, utilities, and components,
|
|
5
|
+
* and exports them under a single namespace.
|
|
6
|
+
*/
|
|
7
|
+
import RendererConstants from "../renderers/constants";
|
|
8
|
+
import Renderer, { DrawState, ConnectorToFrom } from "../renderers/renderer";
|
|
9
|
+
import CategoryColors from "./colors";
|
|
10
|
+
import Connection, { Connectable } from "./connection";
|
|
11
|
+
import Coordinates from "./coordinates";
|
|
12
|
+
import Field, { FieldOptions, FieldVisualInfo, AnyFieldCls, AnyField, DummyField, FieldMap, NumberField, OptConnectField, TextField, ConnectableField, FieldRawBoxData, FieldConnectionData } from "./field";
|
|
13
|
+
import inject, { InjectMsg, InjectOptions, TblxCategoryStruct, TblxObjStruct, TblxFieldStruct, TblxNodeStruct, GridOptions } from "./inject";
|
|
14
|
+
import { clearMainWorkspace, getMainWorkspace, setMainWorkspace } from "./main-workspace";
|
|
15
|
+
import NodeSvg, { NodeJson, NodeEvents, InputFieldJson, SerializedNode } from "./nodesvg";
|
|
16
|
+
import NodePrototypes from "./prototypes";
|
|
17
|
+
import WorkspaceSvg from "./workspace-svg";
|
|
18
|
+
import WorkspaceCoords from "./workspace-coords";
|
|
19
|
+
import { NodePrototype } from "./node-types";
|
|
20
|
+
import { Color, ColorStyle, Hex, RGBObject, RGBString, RGBTuple } from "./visual-types";
|
|
21
|
+
import { Eventer, EventSetupFn, EventArgs, RegisteredEl } from "../util/eventer";
|
|
22
|
+
import { WidgetOptions } from "./widget";
|
|
23
|
+
import { WidgetPrototypeList } from "./widget-prototypes";
|
|
24
|
+
import Showable, { KabelInterface, KabelCommentRendering, KabelNodeRendering, KabelUIX, KabelUtils } from "./types";
|
|
25
|
+
declare const Kabel: KabelInterface;
|
|
26
|
+
export default Kabel;
|
|
27
|
+
export { KabelInterface, TblxCategoryStruct, TblxNodeStruct, TblxFieldStruct, TblxObjStruct, RendererConstants, Renderer, CategoryColors, Connection, Coordinates, Field, DummyField, FieldMap, NumberField, OptConnectField, TextField, FieldOptions, FieldVisualInfo, AnyFieldCls, AnyField, ConnectableField, FieldRawBoxData, FieldConnectionData, inject, InjectMsg, InjectOptions, clearMainWorkspace, getMainWorkspace, setMainWorkspace, NodeSvg, NodePrototypes, WorkspaceSvg, WorkspaceCoords, NodePrototype, Color, ColorStyle, Hex, RGBObject, RGBString, RGBTuple, NodeJson, NodeEvents, InputFieldJson, SerializedNode, Eventer, EventSetupFn, EventArgs, Connectable, DrawState, ConnectorToFrom, WidgetOptions, WidgetPrototypeList, KabelCommentRendering, KabelNodeRendering, KabelUIX, KabelUtils, Showable, RegisteredEl, GridOptions };
|
|
28
|
+
export { default as CommentModel } from './comment';
|
|
29
|
+
export { default as Toolbox } from './toolbox';
|
|
30
|
+
export { default as ContextMenuHTML } from './context-menu';
|
|
31
|
+
export { default as Widget } from './widget';
|
|
32
|
+
export { DropdownContainer } from './dropdown-menu';
|
|
33
|
+
export { RepresenterNode } from '../renderers/representer-node';
|
|
34
|
+
export { default as CommentRenderer } from '../comment-renderer/renderer';
|
|
35
|
+
export { default as Representer } from '../renderers/representer';
|
|
36
|
+
export { default as WorkspaceController } from '../controllers/base';
|
|
37
|
+
export { default as WASDController } from '../controllers/wasd';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,QAAQ,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,cAAc,MAAM,UAAU,CAAC;AACtC,OAAO,UAAU,EAAE,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,EACV,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAChE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EACnE,eAAe,EAAE,mBAAmB,EACvC,MAAM,SAAS,CAAC;AACjB,OAAO,MAAM,EAAE,EACX,SAAS,EAAE,aAAa,EA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