@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.
Files changed (273) hide show
  1. package/dist/comment-renderer/renderer.d.ts +32 -0
  2. package/dist/comment-renderer/renderer.d.ts.map +1 -0
  3. package/dist/controllers/base.d.ts +39 -0
  4. package/dist/controllers/base.d.ts.map +1 -0
  5. package/dist/controllers/wasd.d.ts +33 -0
  6. package/dist/controllers/wasd.d.ts.map +1 -0
  7. package/dist/events/comment-drag-handle.d.ts +2 -0
  8. package/dist/events/comment-drag-handle.d.ts.map +1 -0
  9. package/dist/events/comment-input.d.ts +4 -0
  10. package/dist/events/comment-input.d.ts.map +1 -0
  11. package/dist/events/connection-line.d.ts +2 -0
  12. package/dist/events/connection-line.d.ts.map +1 -0
  13. package/dist/events/connector.d.ts +2 -0
  14. package/dist/events/connector.d.ts.map +1 -0
  15. package/dist/events/draggable.d.ts +2 -0
  16. package/dist/events/draggable.d.ts.map +1 -0
  17. package/{events/events.ts → dist/events/events.d.ts} +8 -7
  18. package/dist/events/events.d.ts.map +1 -0
  19. package/dist/events/input-box.d.ts +2 -0
  20. package/dist/events/input-box.d.ts.map +1 -0
  21. package/dist/events/node-x-btn.d.ts +2 -0
  22. package/dist/events/node-x-btn.d.ts.map +1 -0
  23. package/dist/kabel.js +2 -0
  24. package/dist/kabel.js.map +1 -0
  25. package/dist/renderers/apollo/apollo.d.ts +12 -0
  26. package/dist/renderers/apollo/apollo.d.ts.map +1 -0
  27. package/dist/renderers/apollo/constants.d.ts +21 -0
  28. package/dist/renderers/apollo/constants.d.ts.map +1 -0
  29. package/dist/renderers/apollo/renderer.d.ts +97 -0
  30. package/dist/renderers/apollo/renderer.d.ts.map +1 -0
  31. package/{renderers/atlas/atlas.ts → dist/renderers/atlas/atlas.d.ts} +6 -15
  32. package/dist/renderers/atlas/atlas.d.ts.map +1 -0
  33. package/dist/renderers/constants.d.ts +51 -0
  34. package/dist/renderers/constants.d.ts.map +1 -0
  35. package/dist/renderers/renderer.d.ts +470 -0
  36. package/dist/renderers/renderer.d.ts.map +1 -0
  37. package/dist/renderers/representer-node.d.ts +27 -0
  38. package/dist/renderers/representer-node.d.ts.map +1 -0
  39. package/dist/renderers/representer.d.ts +13 -0
  40. package/dist/renderers/representer.d.ts.map +1 -0
  41. package/dist/src/category.d.ts +48 -0
  42. package/dist/src/category.d.ts.map +1 -0
  43. package/{src/colors.ts → dist/src/colors.d.ts} +21 -20
  44. package/dist/src/colors.d.ts.map +1 -0
  45. package/dist/src/comment.d.ts +88 -0
  46. package/dist/src/comment.d.ts.map +1 -0
  47. package/dist/src/connection.d.ts +52 -0
  48. package/dist/src/connection.d.ts.map +1 -0
  49. package/dist/src/context-menu.d.ts +76 -0
  50. package/dist/src/context-menu.d.ts.map +1 -0
  51. package/dist/src/coordinates.d.ts +52 -0
  52. package/dist/src/coordinates.d.ts.map +1 -0
  53. package/dist/src/core.d.ts +153 -0
  54. package/dist/src/core.d.ts.map +1 -0
  55. package/dist/src/ctx-menu-registry.d.ts +22 -0
  56. package/dist/src/ctx-menu-registry.d.ts.map +1 -0
  57. package/dist/src/dropdown-menu.d.ts +87 -0
  58. package/dist/src/dropdown-menu.d.ts.map +1 -0
  59. package/dist/src/field.d.ts +305 -0
  60. package/dist/src/field.d.ts.map +1 -0
  61. package/dist/src/flyout.d.ts +41 -0
  62. package/dist/src/flyout.d.ts.map +1 -0
  63. package/dist/src/fonts-manager.d.ts +6 -0
  64. package/dist/src/fonts-manager.d.ts.map +1 -0
  65. package/dist/src/grid.d.ts +60 -0
  66. package/dist/src/grid.d.ts.map +1 -0
  67. package/dist/src/headless-node.d.ts +11 -0
  68. package/dist/src/headless-node.d.ts.map +1 -0
  69. package/dist/src/index.d.ts +38 -0
  70. package/dist/src/index.d.ts.map +1 -0
  71. package/dist/src/inject-headless.d.ts +4 -0
  72. package/dist/src/inject-headless.d.ts.map +1 -0
  73. package/{src/inject.ts → dist/src/inject.d.ts} +142 -213
  74. package/dist/src/inject.d.ts.map +1 -0
  75. package/{src/main-workspace.ts → dist/src/main-workspace.d.ts} +31 -51
  76. package/dist/src/main-workspace.d.ts.map +1 -0
  77. package/dist/src/mutator.d.ts +2 -0
  78. package/dist/src/mutator.d.ts.map +1 -0
  79. package/{src/node-types.ts → dist/src/node-types.d.ts} +26 -27
  80. package/dist/src/node-types.d.ts.map +1 -0
  81. package/dist/src/nodesvg.d.ts +266 -0
  82. package/dist/src/nodesvg.d.ts.map +1 -0
  83. package/{src/prototypes.ts → dist/src/prototypes.d.ts} +10 -9
  84. package/dist/src/prototypes.d.ts.map +1 -0
  85. package/{src/renderer-map.ts → dist/src/renderer-map.d.ts} +51 -86
  86. package/dist/src/renderer-map.d.ts.map +1 -0
  87. package/dist/src/toolbox.d.ts +51 -0
  88. package/dist/src/toolbox.d.ts.map +1 -0
  89. package/{src/types.ts → dist/src/types.d.ts} +159 -205
  90. package/dist/src/types.d.ts.map +1 -0
  91. package/dist/src/undo-redo.d.ts +15 -0
  92. package/dist/src/undo-redo.d.ts.map +1 -0
  93. package/{src/visual-types.ts → dist/src/visual-types.d.ts} +34 -29
  94. package/dist/src/visual-types.d.ts.map +1 -0
  95. package/dist/src/widget-prototypes.d.ts +10 -0
  96. package/dist/src/widget-prototypes.d.ts.map +1 -0
  97. package/dist/src/widget.d.ts +62 -0
  98. package/dist/src/widget.d.ts.map +1 -0
  99. package/{src/workspace-coords.ts → dist/src/workspace-coords.d.ts} +10 -14
  100. package/dist/src/workspace-coords.d.ts.map +1 -0
  101. package/dist/src/workspace-svg.d.ts +371 -0
  102. package/dist/src/workspace-svg.d.ts.map +1 -0
  103. package/dist/src/workspace.d.ts +50 -0
  104. package/dist/src/workspace.d.ts.map +1 -0
  105. package/dist/themes/dark.d.ts +4 -0
  106. package/dist/themes/dark.d.ts.map +1 -0
  107. package/dist/themes/default.d.ts +4 -0
  108. package/dist/themes/default.d.ts.map +1 -0
  109. package/dist/themes/themes.d.ts +6 -0
  110. package/dist/themes/themes.d.ts.map +1 -0
  111. package/dist/util/emitter.d.ts +10 -0
  112. package/dist/util/emitter.d.ts.map +1 -0
  113. package/dist/util/env.d.ts +7 -0
  114. package/dist/util/env.d.ts.map +1 -0
  115. package/{util/escape-html.ts → dist/util/escape-html.d.ts} +16 -22
  116. package/dist/util/escape-html.d.ts.map +1 -0
  117. package/dist/util/eventer.d.ts +29 -0
  118. package/dist/util/eventer.d.ts.map +1 -0
  119. package/dist/util/has-prop.d.ts +2 -0
  120. package/dist/util/has-prop.d.ts.map +1 -0
  121. package/dist/util/parse-color.d.ts +6 -0
  122. package/dist/util/parse-color.d.ts.map +1 -0
  123. package/dist/util/path.d.ts +25 -0
  124. package/dist/util/path.d.ts.map +1 -0
  125. package/dist/util/styler.d.ts +12 -0
  126. package/dist/util/styler.d.ts.map +1 -0
  127. package/dist/util/uid.d.ts +42 -0
  128. package/dist/util/uid.d.ts.map +1 -0
  129. package/{util/unescape-html.ts → dist/util/unescape-html.d.ts} +16 -22
  130. package/dist/util/unescape-html.d.ts.map +1 -0
  131. package/dist/util/user-state.d.ts +37 -0
  132. package/dist/util/user-state.d.ts.map +1 -0
  133. package/{util/wait-anim-frames.ts → dist/util/wait-anim-frames.d.ts} +11 -24
  134. package/dist/util/wait-anim-frames.d.ts.map +1 -0
  135. package/dist/util/window-listeners.d.ts +8 -0
  136. package/dist/util/window-listeners.d.ts.map +1 -0
  137. package/package.json +4 -1
  138. package/(1.0.7)kabel.md +0 -18
  139. package/_READ_ME_MEDIA_/documentation/docs.md +0 -293
  140. package/_READ_ME_MEDIA_/workspace.png +0 -0
  141. package/comment-renderer/renderer.ts +0 -228
  142. package/controllers/base.ts +0 -186
  143. package/controllers/wasd.ts +0 -132
  144. package/docs/README.md +0 -98
  145. package/docs/_media/docs.md +0 -289
  146. package/docs/_media/workspace.png +0 -0
  147. package/docs/classes/CommentModel.md +0 -271
  148. package/docs/classes/CommentRenderer.md +0 -457
  149. package/docs/classes/ConnectableField.md +0 -597
  150. package/docs/classes/Connection.md +0 -191
  151. package/docs/classes/ContextMenuHTML.md +0 -163
  152. package/docs/classes/Coordinates.md +0 -187
  153. package/docs/classes/DropdownContainer.md +0 -300
  154. package/docs/classes/DummyField.md +0 -393
  155. package/docs/classes/Eventer.md +0 -185
  156. package/docs/classes/Field.md +0 -461
  157. package/docs/classes/InjectMsg.md +0 -85
  158. package/docs/classes/NodeSvg.md +0 -1011
  159. package/docs/classes/NumberField.md +0 -559
  160. package/docs/classes/OptConnectField.md +0 -624
  161. package/docs/classes/Renderer.md +0 -1636
  162. package/docs/classes/RendererConstants.md +0 -343
  163. package/docs/classes/Representer.md +0 -95
  164. package/docs/classes/RepresenterNode.md +0 -175
  165. package/docs/classes/TextField.md +0 -559
  166. package/docs/classes/Toolbox.md +0 -172
  167. package/docs/classes/WASDController.md +0 -616
  168. package/docs/classes/Widget.md +0 -195
  169. package/docs/classes/WorkspaceController.md +0 -385
  170. package/docs/classes/WorkspaceCoords.md +0 -218
  171. package/docs/classes/WorkspaceSvg.md +0 -1380
  172. package/docs/functions/clearMainWorkspace.md +0 -20
  173. package/docs/functions/getMainWorkspace.md +0 -19
  174. package/docs/functions/inject.md +0 -35
  175. package/docs/functions/setMainWorkspace.md +0 -28
  176. package/docs/globals.md +0 -95
  177. package/docs/interfaces/ColorStyle.md +0 -43
  178. package/docs/interfaces/ConnectorToFrom.md +0 -57
  179. package/docs/interfaces/DrawState.md +0 -81
  180. package/docs/interfaces/FieldConnectionData.md +0 -25
  181. package/docs/interfaces/FieldOptions.md +0 -63
  182. package/docs/interfaces/FieldRawBoxData.md +0 -25
  183. package/docs/interfaces/FieldVisualInfo.md +0 -65
  184. package/docs/interfaces/GridOptions.md +0 -61
  185. package/docs/interfaces/InjectOptions.md +0 -133
  186. package/docs/interfaces/InputFieldJson.md +0 -50
  187. package/docs/interfaces/KabelCommentRendering.md +0 -31
  188. package/docs/interfaces/KabelInterface.md +0 -469
  189. package/docs/interfaces/KabelNodeRendering.md +0 -77
  190. package/docs/interfaces/KabelUIX.md +0 -105
  191. package/docs/interfaces/KabelUtils.md +0 -215
  192. package/docs/interfaces/NodeEvents.md +0 -42
  193. package/docs/interfaces/NodeJson.md +0 -104
  194. package/docs/interfaces/NodePrototype.md +0 -82
  195. package/docs/interfaces/RegisteredEl.md +0 -53
  196. package/docs/interfaces/SerializedNode.md +0 -128
  197. package/docs/interfaces/TblxCategoryStruct.md +0 -41
  198. package/docs/interfaces/TblxFieldStruct.md +0 -28
  199. package/docs/interfaces/TblxNodeStruct.md +0 -35
  200. package/docs/interfaces/WidgetOptions.md +0 -115
  201. package/docs/interfaces/WidgetPrototypeList.md +0 -15
  202. package/docs/type-aliases/AnyField.md +0 -13
  203. package/docs/type-aliases/AnyFieldCls.md +0 -13
  204. package/docs/type-aliases/Color.md +0 -13
  205. package/docs/type-aliases/Connectable.md +0 -13
  206. package/docs/type-aliases/EventArgs.md +0 -11
  207. package/docs/type-aliases/EventSetupFn.md +0 -25
  208. package/docs/type-aliases/Hex.md +0 -13
  209. package/docs/type-aliases/RGBObject.md +0 -37
  210. package/docs/type-aliases/RGBString.md +0 -13
  211. package/docs/type-aliases/RGBTuple.md +0 -13
  212. package/docs/type-aliases/TblxObjStruct.md +0 -52
  213. package/docs/variables/CategoryColors.md +0 -29
  214. package/docs/variables/FieldMap.md +0 -41
  215. package/docs/variables/NodePrototypes.md +0 -18
  216. package/docs/variables/default.md +0 -11
  217. package/events/comment-drag-handle.ts +0 -61
  218. package/events/comment-input.ts +0 -291
  219. package/events/connection-line.ts +0 -68
  220. package/events/connector.ts +0 -116
  221. package/events/draggable.ts +0 -119
  222. package/events/input-box.ts +0 -213
  223. package/events/node-x-btn.ts +0 -25
  224. package/index.d.ts +0 -4
  225. package/renderers/apollo/apollo.ts +0 -21
  226. package/renderers/apollo/constants.ts +0 -40
  227. package/renderers/apollo/renderer.ts +0 -331
  228. package/renderers/constants.ts +0 -87
  229. package/renderers/renderer.ts +0 -1288
  230. package/renderers/representer-node.ts +0 -52
  231. package/renderers/representer.ts +0 -25
  232. package/src/category.ts +0 -107
  233. package/src/comment.ts +0 -142
  234. package/src/connection.ts +0 -114
  235. package/src/context-menu.ts +0 -194
  236. package/src/coordinates.ts +0 -74
  237. package/src/core.ts +0 -202
  238. package/src/ctx-menu-registry.ts +0 -143
  239. package/src/dropdown-menu.ts +0 -215
  240. package/src/field.ts +0 -595
  241. package/src/flyout.ts +0 -165
  242. package/src/fonts-manager.ts +0 -38
  243. package/src/grid.ts +0 -162
  244. package/src/headless-node.ts +0 -27
  245. package/src/index.ts +0 -115
  246. package/src/inject-headless.ts +0 -18
  247. package/src/mutator.ts +0 -40
  248. package/src/nodesvg.ts +0 -756
  249. package/src/styles.css +0 -224
  250. package/src/toolbox.ts +0 -125
  251. package/src/undo-redo.ts +0 -87
  252. package/src/widget-prototypes.ts +0 -11
  253. package/src/widget.ts +0 -139
  254. package/src/workspace-svg.ts +0 -736
  255. package/src/workspace.ts +0 -155
  256. package/test-server.js +0 -61
  257. package/themes/dark.ts +0 -32
  258. package/themes/default.ts +0 -28
  259. package/themes/themes.ts +0 -9
  260. package/tsconfig.json +0 -25
  261. package/typedoc.json +0 -10
  262. package/util/emitter.ts +0 -33
  263. package/util/env.ts +0 -11
  264. package/util/eventer.ts +0 -108
  265. package/util/has-prop.ts +0 -4
  266. package/util/parse-color.ts +0 -42
  267. package/util/path.ts +0 -99
  268. package/util/styler.ts +0 -41
  269. package/util/uid.ts +0 -184
  270. package/util/user-state.ts +0 -68
  271. package/util/window-listeners.ts +0 -62
  272. package/webpack.config.js +0 -80
  273. /package/{docs/_media → dist}/index.html +0 -0
@@ -0,0 +1,470 @@
1
+ import RendererConstants from "./constants";
2
+ import WorkspaceSvg from '../src/workspace-svg';
3
+ import NodeSvg from '../src/nodesvg';
4
+ import { G, Path as SvgPath, Svg, Rect } from "@svgdotjs/svg.js";
5
+ import { ColorStyle } from "../src/visual-types";
6
+ import { AnyField, FieldRawBoxData } from "../src/field";
7
+ import Connection, { Connectable } from "../src/connection";
8
+ import CommentRenderer from "../comment-renderer/renderer";
9
+ import type Representer from "./representer";
10
+ export interface ConnectorToFrom {
11
+ to: Connection;
12
+ from: Connection;
13
+ fromCircle?: SvgPath;
14
+ toCircle?: SvgPath;
15
+ originConn: Connection;
16
+ originCircle: SvgPath;
17
+ }
18
+ export interface DrawState {
19
+ id: string;
20
+ shadow?: SvgPath;
21
+ topbar?: SvgPath | null;
22
+ bg?: SvgPath | null;
23
+ group?: G | null;
24
+ fieldCol?: G | null;
25
+ fieldPosY?: number | null;
26
+ xButton?: G;
27
+ pendingConnections: ConnectorToFrom[];
28
+ }
29
+ export interface NodeMeasurements {
30
+ width: number;
31
+ height: number;
32
+ fields: {
33
+ width: number;
34
+ height: number;
35
+ }[];
36
+ }
37
+ declare class Renderer {
38
+ /**
39
+ * Set of constants the renderer uses for drawing nodes.
40
+ */
41
+ _constants: RendererConstants;
42
+ /**
43
+ * The current node being rendered.
44
+ */
45
+ _currentNode: NodeSvg | null;
46
+ /**
47
+ * The SVG group element for the current node.
48
+ */
49
+ _nodeGroup: G | null;
50
+ /**
51
+ * The current drawing state for the node.
52
+ */
53
+ _nodeDraw: DrawState | null;
54
+ /**
55
+ * The workspace this renderer is associated with.
56
+ */
57
+ _ws: WorkspaceSvg;
58
+ /**
59
+ * Array of stored draw states for rendered nodes.
60
+ */
61
+ _drawStates: DrawState[];
62
+ /**
63
+ * Comment renderer instance used for rendering comments.
64
+ */
65
+ _commentDrawer: CommentRenderer;
66
+ /**
67
+ * Representer instance used for building node representations.
68
+ */
69
+ representer: Representer;
70
+ /**
71
+ * Constant overrides provided during renderer instantiation.
72
+ */
73
+ constantOverrides: Partial<RendererConstants>;
74
+ /**
75
+ * Tag used for node group elements in the SVG.
76
+ */
77
+ static get NODE_G_TAG(): string;
78
+ /**
79
+ * Tag used for renderer elements in the SVG.
80
+ */
81
+ static get ELEMENT_TAG(): string;
82
+ /**
83
+ * Tag used for connection line elements in the SVG.
84
+ */
85
+ static get CONN_LINE_TAG(): string;
86
+ /**
87
+ * Tag used for connector elements in the SVG.
88
+ */
89
+ static get CONNECTOR_TAG(): string;
90
+ /**
91
+ * Tag used for line X mark elements in the SVG.
92
+ */
93
+ static get LINE_X_MARK_TAG(): string;
94
+ /**
95
+ * Tag used for background pattern elements in the SVG. This is constant, do not modify it in subclasses.
96
+ */
97
+ static get BACKGROUND_PATTERN(): string;
98
+ /**
99
+ * Name of the renderer.
100
+ */
101
+ static get NAME(): string;
102
+ /**
103
+ * Constructor for the Renderer class.
104
+ * @param workspace - The workspace associated with the renderer.
105
+ * @param overrides - Optional constant overrides for the renderer.
106
+ */
107
+ constructor(workspace: WorkspaceSvg, overrides?: Partial<RendererConstants>);
108
+ /**
109
+ * Initializes the renderer by setting up the comment renderer, representer, and constants.
110
+ */
111
+ init(): void;
112
+ /**
113
+ * Initializes the renderer constants with any provided overrides.
114
+ */
115
+ initConstants(): void;
116
+ /**
117
+ * Initializes the representer for the renderer.
118
+ */
119
+ initRepresenter(): void;
120
+ /**
121
+ * Initializes the comment renderer for the workspace.
122
+ */
123
+ initCommentRenderer(): void;
124
+ /**
125
+ * Sets the connection to be processed.
126
+ * @param c - The connection to set.
127
+ */
128
+ setConnect(c: ConnectorToFrom): void;
129
+ /**
130
+ * Sets the renderer constants.
131
+ * @param c - Partial constants to override.
132
+ * @returns The updated constants.
133
+ */
134
+ setConstants(c?: Partial<RendererConstants>): RendererConstants & Partial<RendererConstants>;
135
+ /**
136
+ * Gets the renderer constants, merging with node style if applicable.
137
+ */
138
+ get constants(): RendererConstants;
139
+ /**
140
+ * Sets the renderer constants.
141
+ */
142
+ set constants(c: Partial<RendererConstants>);
143
+ /**
144
+ * Gets the current node being rendered.
145
+ */
146
+ get node(): NodeSvg | null;
147
+ /**
148
+ * Gets the SVG.js instance from the workspace.
149
+ */
150
+ get svg(): Svg;
151
+ /**
152
+ * Gets the current drawing state.
153
+ */
154
+ get state(): null | undefined | DrawState;
155
+ /**
156
+ * Gets the workspace associated with the renderer.
157
+ * @returns The workspace instance.
158
+ */
159
+ getWs(): WorkspaceSvg;
160
+ /**
161
+ * Gets the base measurements for a node.
162
+ * @returns The base width and height of the node.
163
+ */
164
+ getNodeBaseMeasurements(): {
165
+ width: number;
166
+ height: number;
167
+ };
168
+ /**
169
+ * Measures the width of the given text.
170
+ * @param text - The text to measure.
171
+ * @param fontSize - The font size to use.
172
+ * @param fontFamily - The font family to use.
173
+ * @returns The width of the text.
174
+ */
175
+ measureTextWidth(text: string, fontSize?: number, fontFamily?: string): number;
176
+ /**
177
+ * Measures the height of the given text.
178
+ * @param text - The text to measure.
179
+ * @param fontSize - The font size to use.
180
+ * @param fontFamily - The font family to use.
181
+ * @returns The height of the text.
182
+ */
183
+ measureTextHeight(text: string, fontSize?: number, fontFamily?: string): number;
184
+ /**
185
+ * Measures the dimensions of a raw input field.
186
+ * @param text - The text content of the raw field.
187
+ * @returns The width and height of the raw field.
188
+ */
189
+ measureRawField(text?: string): {
190
+ width: number;
191
+ height: number;
192
+ };
193
+ /**
194
+ * Measures the label of a field.
195
+ * @param field - The field to measure the label for.
196
+ * @returns The width and height of the label.
197
+ */
198
+ measureLabel(field: AnyField): {
199
+ width: number;
200
+ height: number;
201
+ };
202
+ /**
203
+ * Measures the raw input of a field.
204
+ * @param field - The field to measure the raw input for.
205
+ * @returns The width and height of the raw input.
206
+ */
207
+ measureRaw(field: AnyField): {
208
+ width: number;
209
+ height: number;
210
+ };
211
+ /**
212
+ * Measures the custom editor of a field.
213
+ * @param field - The field to measure the custom editor for.
214
+ * @returns The width and height of the custom editor.
215
+ */
216
+ measureCustom(field: AnyField): {
217
+ width: number;
218
+ height: number;
219
+ };
220
+ /**
221
+ * Gets the padding to apply when measuring a field.
222
+ * @returns The width and height padding for the field.
223
+ */
224
+ getFieldMeasurementPadding(): {
225
+ width: number;
226
+ height: number;
227
+ };
228
+ /**
229
+ * Measures the overall dimensions of a field.
230
+ * @param field - The field to measure.
231
+ * @returns The width and height of the field.
232
+ */
233
+ measureField(field: AnyField): {
234
+ width: number;
235
+ height: number;
236
+ };
237
+ /**
238
+ * Measures the overall dimensions of the current node.
239
+ * @returns The measurements of the node including width, height, and field dimensions.
240
+ */
241
+ measureNodeDimensions(): NodeMeasurements | void | null;
242
+ /**
243
+ * Measures all fields of the current node.
244
+ * @param startY The starting Y position for the fields.
245
+ * @param startWidth The starting width of the node.
246
+ * @param startHeight The starting height of the node.
247
+ * @returns The width, height, and field dimensions.
248
+ */
249
+ measureFields(startY: number, startWidth: number, startHeight: number): {
250
+ width: number;
251
+ height: number;
252
+ fields: {
253
+ width: number;
254
+ height: number;
255
+ }[];
256
+ };
257
+ /**
258
+ * Measures the base dimensions of the current node including label.
259
+ * @returns The width and height of the node base and label.
260
+ */
261
+ private measureBaseAndLabel;
262
+ /**
263
+ * Renders the specified node by drawing it and building its representation.
264
+ * @param nodeIdOrNode The node or node ID to render.
265
+ * @returns Void.
266
+ */
267
+ renderNode(nodeIdOrNode: NodeSvg | string): void;
268
+ /**
269
+ * Starts rendering the specified node.
270
+ * @param nodeIdOrNode The node or node ID to start rendering.
271
+ */
272
+ startNode(nodeIdOrNode: NodeSvg | string): void;
273
+ /**
274
+ * Build a draw state for the given node group and ID.
275
+ * @param nodeGroup - The SVG group element for the node.
276
+ * @param id - The ID of the node.
277
+ * @returns - The constructed DrawState object.
278
+ */
279
+ drawState(nodeGroup: G, id: string): DrawState;
280
+ /**
281
+ * Stores the current draw state.
282
+ */
283
+ storeState(): void;
284
+ /**
285
+ * Draws a raw input field.
286
+ * @param fieldGroup - The SVG group element for the field.
287
+ * @param field - The field to draw.
288
+ * @param startX - The starting X position for the field.
289
+ * @returns The rectangle and text elements of the raw field.
290
+ */
291
+ drawFieldRaw(fieldGroup: G, field: AnyField, startX?: number): {
292
+ rect: Rect;
293
+ txt: import("@svgdotjs/svg.js", { with: { "resolution-mode": "import" } }).Text;
294
+ rawBox: FieldRawBoxData;
295
+ };
296
+ /**
297
+ * Draws the label of a field.
298
+ * @param fieldGroup - The SVG group element for the field.
299
+ * @param field - The field to draw the label for.
300
+ * @param startX - The starting X position for the label.
301
+ * @returns The width used by the label including spacing.
302
+ */
303
+ drawFieldLabel(fieldGroup: G, field: AnyField, startX?: number): number;
304
+ /**
305
+ * Draws the X button on the node's top bar.
306
+ * @returns Void.
307
+ */
308
+ drawNodeXButton(): void;
309
+ /**
310
+ * Draws a connector on the specified side of the node.
311
+ * @param nodeGroup - The SVG group element for the node.
312
+ * @param nodeBg - The background SVG path of the node.
313
+ * @param y - The Y position for the connector.
314
+ * @param side - The side to draw the connector on ('left' or 'right').
315
+ * @param color - The color of the connector.
316
+ * @returns The SVG path of the connector or null if not drawn.
317
+ */
318
+ drawConnector(nodeGroup: G, nodeBg: SvgPath, y: number, side: 'left' | 'right', color: string): SvgPath | void | undefined | null;
319
+ /**
320
+ * Draws the label on the node's top bar.
321
+ * @param nodeGroup - The SVG group element for the node.
322
+ * @returns Void.
323
+ */
324
+ drawNodeLabel(nodeGroup: G): void;
325
+ /**
326
+ * Draws the current node.
327
+ * @returns Void.
328
+ */
329
+ drawNode(): void;
330
+ /**
331
+ * Creates the SVG group for the given node.
332
+ * @param node - The node to create the group for.
333
+ * @returns The created SVG group element.
334
+ */
335
+ createNodeGroup(node: NodeSvg): G;
336
+ /**
337
+ * Draws the base and shadow of the node.
338
+ * @param state - The current drawing state.
339
+ * @param measurements - The measurements of the node.
340
+ */
341
+ drawNodeBase(state: DrawState, measurements: NodeMeasurements | null): void;
342
+ /**
343
+ * Draw the node's topbar
344
+ * @param state - The draw state
345
+ * @param colors - The colors of the node.
346
+ * @param measurements - The measurement data of the node.
347
+ */
348
+ drawNodeTopbar(state: DrawState, colors: ColorStyle, measurements: NodeMeasurements | null): void;
349
+ /**
350
+ * Make a node draggable.
351
+ * @param nodeGroup - The node group to make draggable
352
+ * @param dragHandle - The drag handle
353
+ * @param node - The nodesvg
354
+ */
355
+ makeNodeDraggable(nodeGroup: G, dragHandle: SvgPath, node: NodeSvg): void;
356
+ /** Create the field group for the node */
357
+ createFieldGroup(state: DrawState): void;
358
+ /**
359
+ * Draw a field on a node.
360
+ * @param field - The field to draw
361
+ * @param measurements - The node's measurements
362
+ * @param idx - Index of the field in the fieldColumn list
363
+ * @param y - the y position of the field
364
+ * @returns
365
+ */
366
+ drawFieldForNode(field: AnyField, measurements: NodeMeasurements, idx: number, y: number): void;
367
+ /**
368
+ * Draw all fields on a node
369
+ * @param nodeMeasurements - The node's measurements
370
+ * @returns The final Y position.
371
+ */
372
+ drawAllFieldsForNode(nodeMeasurements?: NodeMeasurements | null): number | undefined;
373
+ /**
374
+ * Draw the previous and next connections of a node.
375
+ * @param state - The draw-state
376
+ * @param node - The node-svg
377
+ * @param nodeGroup - the node's group
378
+ * @param measurements - the node's measurements
379
+ * @returns Void
380
+ */
381
+ drawPreviousNextConnections(state: DrawState, node: NodeSvg, nodeGroup: G, measurements?: {
382
+ width: number;
383
+ height: number;
384
+ } | null): void;
385
+ /**
386
+ * Refreshes the comment transforms.
387
+ * @returns Void.
388
+ */
389
+ refreshComments(): void;
390
+ /**
391
+ * Clears all comments from the workspace.
392
+ * @returns Void.
393
+ */
394
+ clearComments(): void;
395
+ /**
396
+ * Draws all comments in the workspace.
397
+ * @returns Void.
398
+ */
399
+ drawComments(): void;
400
+ /**
401
+ * Gets the current zoom level of the workspace.
402
+ * @returns The zoom level.
403
+ */
404
+ getZoom(): number;
405
+ /**
406
+ * Applies the current zoom level to the specified node group.
407
+ * @param nodeG - The SVG group element of the node.
408
+ * @param node - The node to apply zoom to.
409
+ */
410
+ applyZoomToNode(nodeG: G, node: NodeSvg): void;
411
+ /**
412
+ * Refreshes the transforms of all nodes in the workspace.
413
+ * @returns Void.
414
+ */
415
+ refreshNodeTransforms(): void;
416
+ /**
417
+ * Refreshes all connection lines in the workspace.
418
+ * @returns Void.
419
+ */
420
+ refreshConnectionLines(): void;
421
+ /**
422
+ * Gets the colors for the current node.
423
+ * @returns The color style of the node.
424
+ */
425
+ getNodeColors(): ColorStyle;
426
+ /**
427
+ * Fill every node's connector bubble data with the corresponding bubble its connected to on a sibling node.
428
+ */
429
+ fillAllNodeConnectorBubbles(): void;
430
+ /**
431
+ * Resolves the connectable to the appropriate connection based on the originating connection.
432
+ * @param connectable - The connectable entity (NodeSvg or Field).
433
+ * @param fromConn - The originating connection.
434
+ * @returns
435
+ */
436
+ resolveConnectable(connectable: Connectable, fromConn: Connection): Connection | null | undefined;
437
+ /**
438
+ * Fills in the connector circle for other nodes based on the given connection.
439
+ * @param conn - The connection to match.
440
+ * @param circle - The SVG path of the connector circle.
441
+ * @param isPrevious - Whether the connection is a previous connection.
442
+ */
443
+ _fillOtherNodeConnectorCircle(conn: Connection, circle: SvgPath, isPrevious: boolean): void;
444
+ /**
445
+ * Draw the connection lines between node's connector bubbles.
446
+ */
447
+ drawLinesForAllNodes(): void;
448
+ /**
449
+ * Clear connection lines and their X marks.
450
+ */
451
+ clearLines(): void;
452
+ /**
453
+ * Clear the entire screen.
454
+ */
455
+ clearScreen(): void;
456
+ /**
457
+ * Remove pending connections for a specific connection
458
+ * @param conn - The connection
459
+ */
460
+ undoPendingConnsFor(conn: ConnectorToFrom): void;
461
+ /**
462
+ * Called whenever a node must be visually rendered or rerendered.
463
+ * Implementations must be idempotent.
464
+ * @param node - The node to render/rerender
465
+ * @returns SVG group of the node.
466
+ */
467
+ rerenderNode(node: NodeSvg): G | null | undefined;
468
+ }
469
+ export default Renderer;
470
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../renderers/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,aAAa,CAAC;AAC5C,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,CAAC,EAAE,IAAI,IAAI,OAAO,EAAE,GAAG,EAA6B,IAAI,EAAE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AgB,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAwExF;;;;OAIG;IACH,oBAAoB,CAAC,gBAAgB,GAAE,gBAAgB,GAAG,IAAW;IAqBrE;;;;;;;OAOG;IACH,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,YAAY,GAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAW;IAsDxI;;;OAGG;IACH,eAAe;IAGf;;;OAGG;IACH,aAAa;IAGb;;;OAGG;IACH,YAAY;IAGZ;;;OAGG;IACH,OAAO;IAGP;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO;IAKvC;;;OAGG;IACH,qBAAqB;IAerB;;;OAGG;IACH,sBAAsB;IAItB;;;OAGG;IACH,aAAa,IAAI,UAAU;IAW3B;;OAEG;IACH,2BAA2B;IAuB3B;;;;;OAKG;IACH,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;IAkBjG;;;;;OAKG;IACH,6BAA6B,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO;IAmBpF;;OAEG;IACH,oBAAoB;IAmEpB;;OAEG;IACH,UAAU;IAQV;;OAEG;IACH,WAAW;IAeX;;;OAGG;IACH,mBAAmB,CAAC,IAAI,EAAE,eAAe;IAYzC;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO;CAwB7B;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,27 @@
1
+ import NodeSvg from '../src/nodesvg';
2
+ import Renderer, { DrawState } from './renderer';
3
+ import RendererConstants from './constants';
4
+ export declare class RepresenterNode {
5
+ node: NodeSvg;
6
+ state: DrawState;
7
+ renderer: Renderer;
8
+ constructor(node: NodeSvg, svgState: DrawState, renderer: Renderer);
9
+ getConstant(name: keyof RendererConstants): string | number | boolean | import("../src/visual-types").RGBObject | import("../src/visual-types").RGBTuple | {
10
+ [key: string]: {
11
+ PathMain: string;
12
+ Width: number;
13
+ Height: number;
14
+ };
15
+ };
16
+ /** Move node visually without changing its relativeCoords */
17
+ moveTo(x: number, y: number): void;
18
+ /** Scale node visually */
19
+ setScale(scale: number): void;
20
+ /** Apply raw transform string */
21
+ applyTransform(transform: string): void;
22
+ /** Access the raw SVG group */
23
+ getRaw(): import("@svgdotjs/svg.js", { with: { "resolution-mode": "import" } }).G | null | undefined;
24
+ /** Optional: highlight node */
25
+ highlight(color?: string): void;
26
+ }
27
+ //# sourceMappingURL=representer-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"representer-node.d.ts","sourceRoot":"","sources":["../../renderers/representer-node.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAGrC,OAAO,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,iBAAiB,MAAM,aAAa,CAAC;AAI5C,qBAAa,eAAe;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;gBACV,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;IAQ/D,WAAW,CAAC,IAAI,EAAE,MAAM,iBAAiB;;;;;;;IAG5C,6DAA6D;IAC7D,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAI3B,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,iCAAiC;IACjC,cAAc,CAAC,SAAS,EAAE,MAAM;IAIhC,+BAA+B;IAC/B,MAAM;IAIN,+BAA+B;IAC/B,SAAS,CAAC,KAAK,SAAS;CAOxB"}
@@ -0,0 +1,13 @@
1
+ import NodeSvg from '../src/nodesvg';
2
+ import Renderer, { DrawState } from './renderer';
3
+ import { RepresenterNode } from './representer-node';
4
+ export default class Representer {
5
+ nodes: Map<string, RepresenterNode>;
6
+ /** Build a representer node for a drawn node */
7
+ build(node: NodeSvg, renderer: Renderer, state: DrawState): RepresenterNode | undefined;
8
+ /** Get a representer node by node id */
9
+ get(nodeId: string): RepresenterNode | undefined;
10
+ /** Remove a node from the representer */
11
+ remove(nodeId: string): void;
12
+ }
13
+ //# sourceMappingURL=representer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"representer.d.ts","sourceRoot":"","sources":["../../renderers/representer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,OAAO,OAAO,WAAW;IAC/B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAa;IAEhD,gDAAgD;IAChD,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS;IAOzD,wCAAwC;IACxC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIhD,yCAAyC;IACzC,MAAM,CAAC,MAAM,EAAE,MAAM;CAGrB"}
@@ -0,0 +1,48 @@
1
+ import { TblxCategoryStruct, TblxNodeStruct } from "./inject";
2
+ import Toolbox from "./toolbox";
3
+ import { Color } from "./visual-types";
4
+ /**
5
+ * Represents a category in the toolbox, containing nodes and a label.
6
+ */
7
+ declare class Category {
8
+ /** Display label for the category */
9
+ label: string;
10
+ /** Category color */
11
+ color: Color;
12
+ /** Nodes contained in this category */
13
+ contents: TblxNodeStruct[];
14
+ /** HTML button element representing this category row */
15
+ _rowDiv: HTMLButtonElement;
16
+ /** Reference to parent toolbox */
17
+ _toolbox: Toolbox;
18
+ /**
19
+ * @param toolbox The parent Toolbox instance
20
+ * @param cData Category data (label, color, nodes)
21
+ */
22
+ constructor(toolbox: Toolbox, cData: TblxCategoryStruct);
23
+ /** Creates the category button in the UI and attaches click events */
24
+ _makeDiv(): void;
25
+ /**
26
+ * Refreshes the category UI with new data
27
+ * @param cData Partial data to update (name, color, contents)
28
+ */
29
+ refresh(cData: Partial<TblxCategoryStruct>): void;
30
+ /** Remove category row from the toolbox */
31
+ destroy(): void;
32
+ /** Hide this category from the UI */
33
+ hide(): void;
34
+ /** Show this category in the UI */
35
+ show(): void;
36
+ /**
37
+ * Enable or disable interaction with this category
38
+ * @param disabled True to disable, false to enable
39
+ */
40
+ setDisabled(disabled: boolean): void;
41
+ /**
42
+ * Returns a plain object representation of this category
43
+ * @returns JSON-compatible category object
44
+ */
45
+ toJSON(): TblxCategoryStruct;
46
+ }
47
+ export default Category;
48
+ //# sourceMappingURL=category.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/category.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;GAEG;AACH,cAAM,QAAQ;IACb,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,uCAAuC;IACvC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,yDAAyD;IACzD,OAAO,EAAG,iBAAiB,CAAC;IAC5B,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAElB;;;OAGG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB;IAQvD,sEAAsE;IACtE,QAAQ;IAkBR;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC;IAc1C,2CAA2C;IAC3C,OAAO;IAKP,qCAAqC;IACrC,IAAI;IAIJ,mCAAmC;IACnC,IAAI;IAIJ;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO;IAI7B;;;OAGG;IACH,MAAM,IAAI,kBAAkB;CAO5B;AAED,eAAe,QAAQ,CAAC"}
@@ -1,20 +1,21 @@
1
- import { Color, ColorStyle } from "./visual-types";
2
-
3
- /**
4
- * Stores color styles for node categories.
5
- *
6
- * Each key is a category name, and the value is a ColorStyle object
7
- * containing colors like primary, secondary, and tertiary.
8
- *
9
- * Example:
10
- * ```ts
11
- * CategoryColors["logic"] = {
12
- * primary: "#FF0000",
13
- * secondary: "#00FF00",
14
- * tertiary: "#0000FF"
15
- * };
16
- * ```
17
- */
18
- const CategoryColors: { [key: string]: ColorStyle } = {};
19
-
20
- export default CategoryColors;
1
+ import { ColorStyle } from "./visual-types";
2
+ /**
3
+ * Stores color styles for node categories.
4
+ *
5
+ * Each key is a category name, and the value is a ColorStyle object
6
+ * containing colors like primary, secondary, and tertiary.
7
+ *
8
+ * Example:
9
+ * ```ts
10
+ * CategoryColors["logic"] = {
11
+ * primary: "#FF0000",
12
+ * secondary: "#00FF00",
13
+ * tertiary: "#0000FF"
14
+ * };
15
+ * ```
16
+ */
17
+ declare const CategoryColors: {
18
+ [key: string]: ColorStyle;
19
+ };
20
+ export default CategoryColors;
21
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,cAAc,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAO,CAAC;AAEzD,eAAe,cAAc,CAAC"}