@flowgram.ai/form-core 0.1.0
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/esm/index.js +835 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +677 -0
- package/dist/index.d.ts +677 -0
- package/dist/index.js +909 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,909 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
30
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
31
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
32
|
+
if (decorator = decorators[i])
|
|
33
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
34
|
+
if (kind && result) __defProp(target, key, result);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// src/index.ts
|
|
39
|
+
var src_exports = {};
|
|
40
|
+
__export(src_exports, {
|
|
41
|
+
DecoratorAbility: () => DecoratorAbility,
|
|
42
|
+
DefaultAbility: () => DefaultAbility,
|
|
43
|
+
EffectAbility: () => EffectAbility,
|
|
44
|
+
ErrorContainerModule: () => ErrorContainerModule,
|
|
45
|
+
FORM_VOID: () => FORM_VOID,
|
|
46
|
+
FlowNodeErrorData: () => FlowNodeErrorData,
|
|
47
|
+
FlowNodeFormData: () => FlowNodeFormData,
|
|
48
|
+
FormAbilityExtensionRegistry: () => FormAbilityExtensionRegistry,
|
|
49
|
+
FormContextMaker: () => FormContextMaker,
|
|
50
|
+
FormContribution: () => FormContribution,
|
|
51
|
+
FormCoreContainerModule: () => FormCoreContainerModule,
|
|
52
|
+
FormItem: () => FormItem,
|
|
53
|
+
FormItemEventName: () => FormItemEventName,
|
|
54
|
+
FormManager: () => FormManager,
|
|
55
|
+
FormMeta: () => FormMeta,
|
|
56
|
+
FormModel: () => FormModel,
|
|
57
|
+
FormModelEntity: () => FormModelEntity,
|
|
58
|
+
FormModelFactory: () => FormModelFactory,
|
|
59
|
+
FormPathService: () => FormPathService,
|
|
60
|
+
MATERIAL_KEY: () => MATERIAL_KEY,
|
|
61
|
+
MaterialRenderKey: () => MaterialRenderKey,
|
|
62
|
+
NodeContainerModule: () => NodeContainerModule,
|
|
63
|
+
NodeContribution: () => NodeContribution,
|
|
64
|
+
NodeEngine: () => NodeEngine,
|
|
65
|
+
NodeEngineContext: () => NodeEngineContext,
|
|
66
|
+
NodeEngineReactContext: () => NodeEngineReactContext,
|
|
67
|
+
NodeManager: () => NodeManager,
|
|
68
|
+
NodeRender: () => NodeRender,
|
|
69
|
+
PLUGIN_KEY: () => PLUGIN_KEY,
|
|
70
|
+
SetterAbility: () => SetterAbility,
|
|
71
|
+
ValidationAbility: () => ValidationAbility,
|
|
72
|
+
VisibilityAbility: () => VisibilityAbility,
|
|
73
|
+
createNodeContainerModules: () => createNodeContainerModules,
|
|
74
|
+
createNodeEntityDatas: () => createNodeEntityDatas,
|
|
75
|
+
getFormModel: () => getFormModel,
|
|
76
|
+
getNodeError: () => getNodeError,
|
|
77
|
+
isNodeFormReady: () => isNodeFormReady,
|
|
78
|
+
registerNodeErrorRender: () => registerNodeErrorRender,
|
|
79
|
+
registerNodePlaceholderRender: () => registerNodePlaceholderRender,
|
|
80
|
+
useFormItem: () => useFormItem,
|
|
81
|
+
useNodeEngineContext: () => useNodeEngineContext
|
|
82
|
+
});
|
|
83
|
+
module.exports = __toCommonJS(src_exports);
|
|
84
|
+
|
|
85
|
+
// src/node/node-contribution.ts
|
|
86
|
+
var NodeContribution = Symbol("NodeContribution");
|
|
87
|
+
|
|
88
|
+
// src/node/node-container-module.ts
|
|
89
|
+
var import_inversify4 = require("inversify");
|
|
90
|
+
|
|
91
|
+
// src/node/node-manager.ts
|
|
92
|
+
var import_lodash = require("lodash");
|
|
93
|
+
var import_inversify = require("inversify");
|
|
94
|
+
var MaterialRenderKey = /* @__PURE__ */ ((MaterialRenderKey2) => {
|
|
95
|
+
MaterialRenderKey2["CustomNodeError"] = "Material_CustomNodeError";
|
|
96
|
+
return MaterialRenderKey2;
|
|
97
|
+
})(MaterialRenderKey || {});
|
|
98
|
+
var NodeManager = class {
|
|
99
|
+
constructor() {
|
|
100
|
+
this.materialRenderRegistry = /* @__PURE__ */ new Map();
|
|
101
|
+
this.pluginRenderRegistry = /* @__PURE__ */ new Map();
|
|
102
|
+
this.nodeRenderHocs = [];
|
|
103
|
+
this.nodeContributions = [];
|
|
104
|
+
}
|
|
105
|
+
registerMaterialRender(key, render) {
|
|
106
|
+
this.materialRenderRegistry.set(key, render);
|
|
107
|
+
}
|
|
108
|
+
getMaterialRender(key) {
|
|
109
|
+
return this.materialRenderRegistry.get(key);
|
|
110
|
+
}
|
|
111
|
+
registerPluginRender(key, render) {
|
|
112
|
+
this.pluginRenderRegistry.set(key, render);
|
|
113
|
+
}
|
|
114
|
+
getPluginRender(key) {
|
|
115
|
+
return this.pluginRenderRegistry.get(key);
|
|
116
|
+
}
|
|
117
|
+
registerNodeErrorRender(render) {
|
|
118
|
+
this.registerMaterialRender("Material_CustomNodeError" /* CustomNodeError */, render);
|
|
119
|
+
}
|
|
120
|
+
get nodeRenderHoc() {
|
|
121
|
+
return (0, import_lodash.flow)(this.nodeRenderHocs);
|
|
122
|
+
}
|
|
123
|
+
registerNodeRenderHoc(hoc) {
|
|
124
|
+
this.nodeRenderHocs.push(hoc);
|
|
125
|
+
}
|
|
126
|
+
get nodeErrorRender() {
|
|
127
|
+
return this.materialRenderRegistry.get("Material_CustomNodeError" /* CustomNodeError */);
|
|
128
|
+
}
|
|
129
|
+
init() {
|
|
130
|
+
this.nodeContributions.forEach((contrib) => contrib.onRegister?.(this));
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
__decorateClass([
|
|
134
|
+
(0, import_inversify.multiInject)(NodeContribution),
|
|
135
|
+
(0, import_inversify.optional)()
|
|
136
|
+
], NodeManager.prototype, "nodeContributions", 2);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
(0, import_inversify.postConstruct)()
|
|
139
|
+
], NodeManager.prototype, "init", 1);
|
|
140
|
+
NodeManager = __decorateClass([
|
|
141
|
+
(0, import_inversify.injectable)()
|
|
142
|
+
], NodeManager);
|
|
143
|
+
|
|
144
|
+
// src/node/node-engine-context.ts
|
|
145
|
+
var import_inversify2 = require("inversify");
|
|
146
|
+
var import_utils = require("@flowgram.ai/utils");
|
|
147
|
+
var NodeEngineContext = class {
|
|
148
|
+
constructor() {
|
|
149
|
+
this.onChangeEmitter = new import_utils.Emitter();
|
|
150
|
+
this.onChange = this.onChangeEmitter.event;
|
|
151
|
+
this._readonly = NodeEngineContext.DEFAULT_READONLY;
|
|
152
|
+
this._json = NodeEngineContext.DEFAULT_JSON;
|
|
153
|
+
}
|
|
154
|
+
get json() {
|
|
155
|
+
return this._json;
|
|
156
|
+
}
|
|
157
|
+
get readonly() {
|
|
158
|
+
return this._readonly;
|
|
159
|
+
}
|
|
160
|
+
set readonly(value) {
|
|
161
|
+
this._readonly = value;
|
|
162
|
+
this.fireChange();
|
|
163
|
+
}
|
|
164
|
+
fireChange() {
|
|
165
|
+
this.updateJSON();
|
|
166
|
+
this.onChangeEmitter.fire(this);
|
|
167
|
+
}
|
|
168
|
+
updateJSON() {
|
|
169
|
+
this._json = {
|
|
170
|
+
readonly: this._readonly
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
NodeEngineContext.DEFAULT_READONLY = false;
|
|
175
|
+
NodeEngineContext.DEFAULT_JSON = { readonly: NodeEngineContext.DEFAULT_READONLY };
|
|
176
|
+
NodeEngineContext = __decorateClass([
|
|
177
|
+
(0, import_inversify2.injectable)()
|
|
178
|
+
], NodeEngineContext);
|
|
179
|
+
|
|
180
|
+
// src/node/node-engine.ts
|
|
181
|
+
var import_inversify3 = require("inversify");
|
|
182
|
+
var NodeEngine = class {
|
|
183
|
+
};
|
|
184
|
+
__decorateClass([
|
|
185
|
+
(0, import_inversify3.inject)(NodeManager)
|
|
186
|
+
], NodeEngine.prototype, "nodeManager", 2);
|
|
187
|
+
__decorateClass([
|
|
188
|
+
(0, import_inversify3.inject)(NodeEngineContext)
|
|
189
|
+
], NodeEngine.prototype, "context", 2);
|
|
190
|
+
NodeEngine = __decorateClass([
|
|
191
|
+
(0, import_inversify3.injectable)()
|
|
192
|
+
], NodeEngine);
|
|
193
|
+
|
|
194
|
+
// src/node/node-container-module.ts
|
|
195
|
+
var NodeContainerModule = new import_inversify4.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
196
|
+
bind(NodeEngine).toSelf().inSingletonScope();
|
|
197
|
+
bind(NodeManager).toSelf().inSingletonScope();
|
|
198
|
+
bind(NodeEngineContext).toSelf().inSingletonScope();
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// src/node/core-plugins.ts
|
|
202
|
+
var PLUGIN_KEY = {
|
|
203
|
+
FORM: "Plugin_Form",
|
|
204
|
+
ERROR: "Plugin_Error"
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/node/core-materials.ts
|
|
208
|
+
var MATERIAL_KEY = {
|
|
209
|
+
NODE_ERROR_RENDER: "node_error_render",
|
|
210
|
+
NODE_PLACEHOLDER_RENDER: "node_placeholder_render"
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/error/flow-node-error-data.ts
|
|
214
|
+
var import_core = require("@flowgram.ai/core");
|
|
215
|
+
var FlowNodeErrorData = class extends import_core.EntityData {
|
|
216
|
+
getDefaultData() {
|
|
217
|
+
return { error: null };
|
|
218
|
+
}
|
|
219
|
+
setError(e) {
|
|
220
|
+
this.update({ error: e });
|
|
221
|
+
}
|
|
222
|
+
getError() {
|
|
223
|
+
return this.data.error;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
FlowNodeErrorData.type = "FlowNodeErrorData";
|
|
227
|
+
|
|
228
|
+
// src/error/error-container-module.ts
|
|
229
|
+
var import_inversify6 = require("inversify");
|
|
230
|
+
var import_utils2 = require("@flowgram.ai/utils");
|
|
231
|
+
|
|
232
|
+
// src/error/error-node-contribution.ts
|
|
233
|
+
var import_inversify5 = require("inversify");
|
|
234
|
+
|
|
235
|
+
// src/error/renders/error-render.tsx
|
|
236
|
+
var import_react2 = __toESM(require("react"));
|
|
237
|
+
var import_core2 = require("@flowgram.ai/core");
|
|
238
|
+
|
|
239
|
+
// src/error/renders/default-error-render.tsx
|
|
240
|
+
var import_react = __toESM(require("react"));
|
|
241
|
+
var ERROR_STYLE = {
|
|
242
|
+
color: "#f54a45"
|
|
243
|
+
};
|
|
244
|
+
var defaultErrorRender = ({ error }) => /* @__PURE__ */ import_react.default.createElement("div", { style: ERROR_STYLE }, error.message);
|
|
245
|
+
|
|
246
|
+
// src/error/renders/error-render.tsx
|
|
247
|
+
var ErrorRender = ({ node, playgroundContext }) => {
|
|
248
|
+
const refresh = (0, import_core2.useRefresh)();
|
|
249
|
+
const nodeErrorData = node.getData(FlowNodeErrorData);
|
|
250
|
+
const nodeError = nodeErrorData.getError();
|
|
251
|
+
const nodeManager = (0, import_core2.useService)(NodeManager);
|
|
252
|
+
const nodeErrorRender = nodeManager.getMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER);
|
|
253
|
+
const renderError = (0, import_react2.useCallback)(() => {
|
|
254
|
+
if (!nodeErrorRender) {
|
|
255
|
+
return defaultErrorRender({
|
|
256
|
+
error: nodeError,
|
|
257
|
+
context: { node, playgroundContext }
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return nodeErrorRender({
|
|
261
|
+
error: nodeError,
|
|
262
|
+
context: { node, playgroundContext }
|
|
263
|
+
});
|
|
264
|
+
}, [nodeError, node, playgroundContext]);
|
|
265
|
+
(0, import_react2.useEffect)(() => {
|
|
266
|
+
const disposable = nodeErrorData.onDataChange(() => {
|
|
267
|
+
refresh();
|
|
268
|
+
});
|
|
269
|
+
return () => {
|
|
270
|
+
disposable.dispose();
|
|
271
|
+
};
|
|
272
|
+
}, []);
|
|
273
|
+
return nodeError ? renderError() : null;
|
|
274
|
+
};
|
|
275
|
+
var errorPluginRender = (props) => /* @__PURE__ */ import_react2.default.createElement(ErrorRender, { ...props });
|
|
276
|
+
|
|
277
|
+
// src/error/error-node-contribution.ts
|
|
278
|
+
var ErrorNodeContribution = class {
|
|
279
|
+
onRegister(nodeManager) {
|
|
280
|
+
nodeManager.registerPluginRender(PLUGIN_KEY.ERROR, errorPluginRender);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
ErrorNodeContribution = __decorateClass([
|
|
284
|
+
(0, import_inversify5.injectable)()
|
|
285
|
+
], ErrorNodeContribution);
|
|
286
|
+
|
|
287
|
+
// src/error/error-container-module.ts
|
|
288
|
+
var ErrorContainerModule = new import_inversify6.ContainerModule((bind) => {
|
|
289
|
+
(0, import_utils2.bindContributions)(bind, ErrorNodeContribution, [NodeContribution]);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// src/error/client.ts
|
|
293
|
+
function getNodeError(node) {
|
|
294
|
+
return node.getData(FlowNodeErrorData).getError();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// src/form/form-core-container-module.ts
|
|
298
|
+
var import_inversify13 = require("inversify");
|
|
299
|
+
var import_utils7 = require("@flowgram.ai/utils");
|
|
300
|
+
|
|
301
|
+
// src/form/services/form-context-maker.ts
|
|
302
|
+
var import_inversify7 = require("inversify");
|
|
303
|
+
var import_core3 = require("@flowgram.ai/core");
|
|
304
|
+
var FormContextMaker = class {
|
|
305
|
+
makeFormItemMaterialContext(formItem, options) {
|
|
306
|
+
return {
|
|
307
|
+
meta: formItem.meta,
|
|
308
|
+
path: formItem.path,
|
|
309
|
+
readonly: this.nodeEngineContext.readonly,
|
|
310
|
+
getFormItemValueByPath: formItem.formModel.getFormItemValueByPath.bind(formItem.formModel),
|
|
311
|
+
onFormValidate: formItem.formModel.onValidate.bind(formItem.formModel),
|
|
312
|
+
form: formItem.formModel,
|
|
313
|
+
node: formItem.formModel.flowNodeEntity,
|
|
314
|
+
playgroundContext: this.playgroundContext,
|
|
315
|
+
index: options?.getIndex()
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
__decorateClass([
|
|
320
|
+
(0, import_inversify7.inject)(NodeEngineContext)
|
|
321
|
+
], FormContextMaker.prototype, "nodeEngineContext", 2);
|
|
322
|
+
__decorateClass([
|
|
323
|
+
(0, import_core3.injectPlaygroundContext)()
|
|
324
|
+
], FormContextMaker.prototype, "playgroundContext", 2);
|
|
325
|
+
FormContextMaker = __decorateClass([
|
|
326
|
+
(0, import_inversify7.injectable)()
|
|
327
|
+
], FormContextMaker);
|
|
328
|
+
|
|
329
|
+
// src/form/services/form-path-service.ts
|
|
330
|
+
var import_inversify8 = require("inversify");
|
|
331
|
+
var FormPathService = class {
|
|
332
|
+
static normalize(path) {
|
|
333
|
+
if (path === FormPathService.ROOT) {
|
|
334
|
+
return path;
|
|
335
|
+
}
|
|
336
|
+
if (path.endsWith(FormPathService.DIVIDER)) {
|
|
337
|
+
path = path.slice(0, -1);
|
|
338
|
+
}
|
|
339
|
+
return path;
|
|
340
|
+
}
|
|
341
|
+
static join(paths) {
|
|
342
|
+
if (paths[1].startsWith(FormPathService.ROOT)) {
|
|
343
|
+
throw new Error(
|
|
344
|
+
`FormPathService Error: join failed, invalid paths[1], paths[1]= ${paths[1]}`
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
if (paths[0].endsWith(FormPathService.DIVIDER)) {
|
|
348
|
+
return `${paths[0]}${paths[1]}`;
|
|
349
|
+
}
|
|
350
|
+
return paths.join(FormPathService.DIVIDER);
|
|
351
|
+
}
|
|
352
|
+
static toArrayPath(path) {
|
|
353
|
+
return FormPathService.join([path, FormPathService.ARRAY]);
|
|
354
|
+
}
|
|
355
|
+
static parseArrayItemPath(path) {
|
|
356
|
+
const names = path.split("/");
|
|
357
|
+
let i = 0;
|
|
358
|
+
while (i < names.length) {
|
|
359
|
+
const itemIndex = parseInt(names[i]);
|
|
360
|
+
if (!isNaN(itemIndex)) {
|
|
361
|
+
const arrayPath = FormPathService.toArrayPath(
|
|
362
|
+
names.slice(0, i).join(FormPathService.DIVIDER)
|
|
363
|
+
);
|
|
364
|
+
const restPath = names.slice(i + 1).join(FormPathService.DIVIDER);
|
|
365
|
+
const itemMetaPath = FormPathService.join([arrayPath, restPath]);
|
|
366
|
+
return { itemIndex, arrayPath, itemMetaPath };
|
|
367
|
+
}
|
|
368
|
+
i = i + 1;
|
|
369
|
+
}
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
simplify(path) {
|
|
373
|
+
const segments = path.split(FormPathService.DIVIDER);
|
|
374
|
+
const resSegments = [];
|
|
375
|
+
for (let i = 0; i < segments.length; i++) {
|
|
376
|
+
if (!segments[i]) {
|
|
377
|
+
throw new Error("FormPathService: join failed");
|
|
378
|
+
}
|
|
379
|
+
if (segments[i] === FormPathService.RELATIVE_CURRENT) {
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
if (segments[i] === FormPathService.RELATIVE_PARENT) {
|
|
383
|
+
resSegments.pop();
|
|
384
|
+
}
|
|
385
|
+
resSegments.push(segments[i]);
|
|
386
|
+
}
|
|
387
|
+
return resSegments.join(FormPathService.DIVIDER);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
FormPathService.ROOT = "/";
|
|
391
|
+
FormPathService.DIVIDER = "/";
|
|
392
|
+
FormPathService.RELATIVE_PARENT = "..";
|
|
393
|
+
FormPathService.RELATIVE_CURRENT = ".";
|
|
394
|
+
FormPathService.ARRAY = "[]";
|
|
395
|
+
FormPathService = __decorateClass([
|
|
396
|
+
(0, import_inversify8.injectable)()
|
|
397
|
+
], FormPathService);
|
|
398
|
+
|
|
399
|
+
// src/form/services/form-manager.ts
|
|
400
|
+
var import_lodash2 = require("lodash");
|
|
401
|
+
var import_inversify11 = require("inversify");
|
|
402
|
+
var import_core4 = require("@flowgram.ai/core");
|
|
403
|
+
|
|
404
|
+
// src/form/models/form-model.ts
|
|
405
|
+
var import_inversify9 = require("inversify");
|
|
406
|
+
var import_utils3 = require("@flowgram.ai/utils");
|
|
407
|
+
var FormModelFactory = Symbol("FormModelFactory");
|
|
408
|
+
var FormModelEntity = Symbol("FormModelEntity");
|
|
409
|
+
var FormModel = class {
|
|
410
|
+
constructor() {
|
|
411
|
+
this.toDispose = new import_utils3.DisposableCollection();
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
FormModel = __decorateClass([
|
|
415
|
+
(0, import_inversify9.injectable)()
|
|
416
|
+
], FormModel);
|
|
417
|
+
|
|
418
|
+
// src/form/models/form-item.ts
|
|
419
|
+
var import_utils4 = require("@flowgram.ai/utils");
|
|
420
|
+
var FormItem = class {
|
|
421
|
+
constructor(meta, path, formModel) {
|
|
422
|
+
this.onInitEventEmitter = new import_utils4.Emitter();
|
|
423
|
+
this.onInit = this.onInitEventEmitter.event;
|
|
424
|
+
this.toDispose = new import_utils4.DisposableCollection();
|
|
425
|
+
this.onDispose = this.toDispose.onDispose;
|
|
426
|
+
this.meta = meta;
|
|
427
|
+
this.path = path;
|
|
428
|
+
this.formModel = formModel;
|
|
429
|
+
this.toDispose.push(this.onInitEventEmitter);
|
|
430
|
+
}
|
|
431
|
+
set domRef(domRef) {
|
|
432
|
+
this._domRef = domRef;
|
|
433
|
+
}
|
|
434
|
+
get domRef() {
|
|
435
|
+
return this._domRef;
|
|
436
|
+
}
|
|
437
|
+
dispose() {
|
|
438
|
+
this.toDispose.dispose();
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
// src/form/models/form-meta.ts
|
|
443
|
+
var FormMeta = class {
|
|
444
|
+
constructor(root, options) {
|
|
445
|
+
this._root = root;
|
|
446
|
+
this._options = options;
|
|
447
|
+
}
|
|
448
|
+
get root() {
|
|
449
|
+
return this._root;
|
|
450
|
+
}
|
|
451
|
+
get options() {
|
|
452
|
+
return this._options;
|
|
453
|
+
}
|
|
454
|
+
static traverse({ formItemMeta, parentPath = "", handle }) {
|
|
455
|
+
if (!formItemMeta) {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
const isRoot = !parentPath;
|
|
459
|
+
const path = isRoot ? FormPathService.ROOT : formItemMeta.name ? FormPathService.join([parentPath, formItemMeta.name]) : parentPath;
|
|
460
|
+
handle({ formItemMeta, path });
|
|
461
|
+
if (formItemMeta.items) {
|
|
462
|
+
this.traverse({
|
|
463
|
+
formItemMeta: formItemMeta.items,
|
|
464
|
+
handle,
|
|
465
|
+
parentPath: FormPathService.toArrayPath(path)
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
if (formItemMeta.children && formItemMeta.children.length) {
|
|
469
|
+
formItemMeta.children.forEach((child) => {
|
|
470
|
+
this.traverse({ formItemMeta: child, handle, parentPath: path });
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
// src/form/models/form-ability-extension-registry.ts
|
|
477
|
+
var import_inversify10 = require("inversify");
|
|
478
|
+
var FormAbilityExtensionRegistry = class {
|
|
479
|
+
constructor() {
|
|
480
|
+
this.registry = /* @__PURE__ */ new Map();
|
|
481
|
+
}
|
|
482
|
+
register(extension) {
|
|
483
|
+
this.registry.set(extension.key, extension);
|
|
484
|
+
}
|
|
485
|
+
get(key) {
|
|
486
|
+
return this.registry.get(key);
|
|
487
|
+
}
|
|
488
|
+
get objectMap() {
|
|
489
|
+
return Object.fromEntries(this.registry);
|
|
490
|
+
}
|
|
491
|
+
get collection() {
|
|
492
|
+
return Array.from(this.registry.values());
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
FormAbilityExtensionRegistry = __decorateClass([
|
|
496
|
+
(0, import_inversify10.injectable)()
|
|
497
|
+
], FormAbilityExtensionRegistry);
|
|
498
|
+
|
|
499
|
+
// src/form/form-contribution.ts
|
|
500
|
+
var FormContribution = Symbol("FormContribution");
|
|
501
|
+
|
|
502
|
+
// src/form/abilities/setter-ability/setter-ability.ts
|
|
503
|
+
var _SetterAbility = class _SetterAbility {
|
|
504
|
+
get type() {
|
|
505
|
+
return _SetterAbility.type;
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
_SetterAbility.type = "setter";
|
|
509
|
+
var SetterAbility = _SetterAbility;
|
|
510
|
+
|
|
511
|
+
// src/form/abilities/decorator-ability/decorator-ability.ts
|
|
512
|
+
var _DecoratorAbility = class _DecoratorAbility {
|
|
513
|
+
get type() {
|
|
514
|
+
return _DecoratorAbility.type;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
_DecoratorAbility.type = "decorator";
|
|
518
|
+
var DecoratorAbility = _DecoratorAbility;
|
|
519
|
+
|
|
520
|
+
// src/form/abilities/visibility-ability/visibility-ability.ts
|
|
521
|
+
var _VisibilityAbility = class _VisibilityAbility {
|
|
522
|
+
get type() {
|
|
523
|
+
return _VisibilityAbility.type;
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
_VisibilityAbility.type = "visibility";
|
|
527
|
+
var VisibilityAbility = _VisibilityAbility;
|
|
528
|
+
|
|
529
|
+
// src/form/abilities/effect-ability/effect-ability.ts
|
|
530
|
+
var _EffectAbility = class _EffectAbility {
|
|
531
|
+
get type() {
|
|
532
|
+
return _EffectAbility.type;
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
_EffectAbility.type = "effect";
|
|
536
|
+
var EffectAbility = _EffectAbility;
|
|
537
|
+
|
|
538
|
+
// src/form/abilities/default-ability/default-ability.ts
|
|
539
|
+
var _DefaultAbility = class _DefaultAbility {
|
|
540
|
+
get type() {
|
|
541
|
+
return _DefaultAbility.type;
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
_DefaultAbility.type = "default";
|
|
545
|
+
var DefaultAbility = _DefaultAbility;
|
|
546
|
+
|
|
547
|
+
// src/form/abilities/validation-ability/validation-ability.ts
|
|
548
|
+
var _ValidationAbility = class _ValidationAbility {
|
|
549
|
+
get type() {
|
|
550
|
+
return _ValidationAbility.type;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
_ValidationAbility.type = "validation";
|
|
554
|
+
var ValidationAbility = _ValidationAbility;
|
|
555
|
+
|
|
556
|
+
// src/form/services/form-manager.ts
|
|
557
|
+
var FormManager = class {
|
|
558
|
+
constructor() {
|
|
559
|
+
this.abilityRegistry = /* @__PURE__ */ new Map();
|
|
560
|
+
this.setterHocs = [];
|
|
561
|
+
this.extensionRegistryMap = /* @__PURE__ */ new Map();
|
|
562
|
+
this.formContributions = [];
|
|
563
|
+
}
|
|
564
|
+
get components() {
|
|
565
|
+
return (0, import_lodash2.mapValues)(
|
|
566
|
+
this.extensionRegistryMap.get(SetterAbility.type)?.objectMap || {},
|
|
567
|
+
(setter) => setter.component
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
get decorators() {
|
|
571
|
+
return (0, import_lodash2.mapValues)(
|
|
572
|
+
this.extensionRegistryMap.get(DecoratorAbility.type)?.objectMap || {},
|
|
573
|
+
(decorator) => decorator.component
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
registerAbilityExtension(type, extension) {
|
|
577
|
+
if (!this.extensionRegistryMap.get(type)) {
|
|
578
|
+
this.extensionRegistryMap.set(type, new FormAbilityExtensionRegistry());
|
|
579
|
+
}
|
|
580
|
+
const registry = this.extensionRegistryMap.get(type);
|
|
581
|
+
if (!registry) {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
registry.register(extension);
|
|
585
|
+
}
|
|
586
|
+
getAbilityExtension(abilityType, extensionKey) {
|
|
587
|
+
return this.extensionRegistryMap.get(abilityType)?.get(extensionKey);
|
|
588
|
+
}
|
|
589
|
+
registerAbility(Ability) {
|
|
590
|
+
const ability = new Ability();
|
|
591
|
+
this.abilityRegistry.set(ability.type, ability);
|
|
592
|
+
}
|
|
593
|
+
registerAbilities(Abilities) {
|
|
594
|
+
Abilities.forEach(this.registerAbility.bind(this));
|
|
595
|
+
}
|
|
596
|
+
getAbility(type) {
|
|
597
|
+
return this.abilityRegistry.get(type);
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* @deprecated
|
|
601
|
+
* Setter Hoc and setter are no longer supported in NodeEngineV2
|
|
602
|
+
* @param hoc
|
|
603
|
+
*/
|
|
604
|
+
registerSetterHoc(hoc) {
|
|
605
|
+
this.setterHocs.push(hoc);
|
|
606
|
+
}
|
|
607
|
+
init() {
|
|
608
|
+
this.formContributions.forEach((contrib) => contrib.onRegister?.(this));
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
__decorateClass([
|
|
612
|
+
(0, import_inversify11.inject)(FormPathService)
|
|
613
|
+
], FormManager.prototype, "pathManager", 2);
|
|
614
|
+
__decorateClass([
|
|
615
|
+
(0, import_inversify11.inject)(FormContextMaker)
|
|
616
|
+
], FormManager.prototype, "formContextMaker", 2);
|
|
617
|
+
__decorateClass([
|
|
618
|
+
(0, import_core4.injectPlaygroundContext)()
|
|
619
|
+
], FormManager.prototype, "playgroundContext", 2);
|
|
620
|
+
__decorateClass([
|
|
621
|
+
(0, import_inversify11.multiInject)(FormContribution),
|
|
622
|
+
(0, import_inversify11.optional)()
|
|
623
|
+
], FormManager.prototype, "formContributions", 2);
|
|
624
|
+
__decorateClass([
|
|
625
|
+
(0, import_inversify11.postConstruct)()
|
|
626
|
+
], FormManager.prototype, "init", 1);
|
|
627
|
+
FormManager = __decorateClass([
|
|
628
|
+
(0, import_inversify11.injectable)()
|
|
629
|
+
], FormManager);
|
|
630
|
+
|
|
631
|
+
// src/form/form-node-contribution.ts
|
|
632
|
+
var import_inversify12 = require("inversify");
|
|
633
|
+
|
|
634
|
+
// src/form/form-render.tsx
|
|
635
|
+
var import_react3 = __toESM(require("react"));
|
|
636
|
+
var import_utils6 = require("@flowgram.ai/utils");
|
|
637
|
+
|
|
638
|
+
// src/form/flow-node-form-data.ts
|
|
639
|
+
var import_utils5 = require("@flowgram.ai/utils");
|
|
640
|
+
var import_core5 = require("@flowgram.ai/core");
|
|
641
|
+
var FlowNodeFormData = class extends import_core5.EntityData {
|
|
642
|
+
constructor(entity, opts) {
|
|
643
|
+
super(entity);
|
|
644
|
+
/**
|
|
645
|
+
* @deprecated rehaje 版表单form Values change 事件
|
|
646
|
+
* @protected
|
|
647
|
+
*/
|
|
648
|
+
this.onDetailChangeEmitter = new import_utils5.Emitter();
|
|
649
|
+
/**
|
|
650
|
+
* @deprecated 该方法为旧版引擎(rehaje)表单数据变更事件, 新版节点引擎请使用
|
|
651
|
+
* this.getFormModel<FormModelV2>().onFormValuesChange.
|
|
652
|
+
* @protected
|
|
653
|
+
*/
|
|
654
|
+
this.onDetailChange = this.onDetailChangeEmitter.event;
|
|
655
|
+
this.flowNodeEntity = entity;
|
|
656
|
+
this.formModel = opts.formModelFactory(entity);
|
|
657
|
+
this.toDispose.push(this.onDetailChangeEmitter);
|
|
658
|
+
this.toDispose.push(
|
|
659
|
+
import_utils5.Disposable.create(() => {
|
|
660
|
+
this.formModel.dispose();
|
|
661
|
+
})
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
getFormModel() {
|
|
665
|
+
return this.formModel;
|
|
666
|
+
}
|
|
667
|
+
getDefaultData() {
|
|
668
|
+
return {};
|
|
669
|
+
}
|
|
670
|
+
createForm(formMetaOrFormMetaGenerator, initialValue) {
|
|
671
|
+
const errorData = this.flowNodeEntity.getData(FlowNodeErrorData);
|
|
672
|
+
errorData.setError(null);
|
|
673
|
+
try {
|
|
674
|
+
this.formModel.init(formMetaOrFormMetaGenerator, initialValue);
|
|
675
|
+
} catch (e) {
|
|
676
|
+
errorData.setError(e);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
recreateForm(formMetaOrFormMetaGenerator, initialValue) {
|
|
680
|
+
this.createForm(formMetaOrFormMetaGenerator, initialValue);
|
|
681
|
+
}
|
|
682
|
+
toJSON() {
|
|
683
|
+
return this.formModel.toJSON();
|
|
684
|
+
}
|
|
685
|
+
dispose() {
|
|
686
|
+
super.dispose();
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* @deprecated rehaje 版表单form Values change 事件触发函数
|
|
690
|
+
* @protected
|
|
691
|
+
*/
|
|
692
|
+
fireDetaiChange(detailChangeEvent) {
|
|
693
|
+
this.onDetailChangeEmitter.fire(detailChangeEvent);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
FlowNodeFormData.type = "FlowNodeEntityFormData";
|
|
697
|
+
|
|
698
|
+
// src/form/form-render.tsx
|
|
699
|
+
function getFormModelFromNode(node) {
|
|
700
|
+
return node.getData(FlowNodeFormData)?.getFormModel();
|
|
701
|
+
}
|
|
702
|
+
function FormRender({ node }) {
|
|
703
|
+
const refresh = (0, import_utils6.useRefresh)();
|
|
704
|
+
const formModel = getFormModelFromNode(node);
|
|
705
|
+
(0, import_react3.useEffect)(() => {
|
|
706
|
+
const disposable = formModel?.onInitialized(() => {
|
|
707
|
+
refresh();
|
|
708
|
+
});
|
|
709
|
+
return () => {
|
|
710
|
+
disposable.dispose();
|
|
711
|
+
};
|
|
712
|
+
}, [formModel]);
|
|
713
|
+
return formModel?.initialized ? formModel.render() : null;
|
|
714
|
+
}
|
|
715
|
+
var formPluginRender = (props) => /* @__PURE__ */ import_react3.default.createElement(FormRender, { ...props });
|
|
716
|
+
|
|
717
|
+
// src/form/form-node-contribution.ts
|
|
718
|
+
var FormNodeContribution = class {
|
|
719
|
+
onRegister(nodeManager) {
|
|
720
|
+
nodeManager.registerPluginRender(PLUGIN_KEY.FORM, formPluginRender);
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
FormNodeContribution = __decorateClass([
|
|
724
|
+
(0, import_inversify12.injectable)()
|
|
725
|
+
], FormNodeContribution);
|
|
726
|
+
|
|
727
|
+
// src/form/form-core-container-module.ts
|
|
728
|
+
var FormCoreContainerModule = new import_inversify13.ContainerModule((bind) => {
|
|
729
|
+
bind(FormManager).toSelf().inSingletonScope();
|
|
730
|
+
bind(FormPathService).toSelf().inSingletonScope();
|
|
731
|
+
bind(FormContextMaker).toSelf().inSingletonScope();
|
|
732
|
+
(0, import_utils7.bindContributions)(bind, FormNodeContribution, [NodeContribution]);
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
// src/form/types/form-model.types.ts
|
|
736
|
+
var FormItemEventName = /* @__PURE__ */ ((FormItemEventName2) => {
|
|
737
|
+
FormItemEventName2["onFormValueChange"] = "onFormValueChange";
|
|
738
|
+
FormItemEventName2["onFormItemInit"] = "onFormItemInit";
|
|
739
|
+
return FormItemEventName2;
|
|
740
|
+
})(FormItemEventName || {});
|
|
741
|
+
|
|
742
|
+
// src/form/types/form-meta.types.ts
|
|
743
|
+
var FORM_VOID = "form-void";
|
|
744
|
+
|
|
745
|
+
// src/form/client/index.ts
|
|
746
|
+
function isNodeFormReady(node) {
|
|
747
|
+
return node.getData(FlowNodeFormData).getFormModel().initialized;
|
|
748
|
+
}
|
|
749
|
+
function getFormModel(node) {
|
|
750
|
+
return node.getData(FlowNodeFormData).formModel;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// src/client/create-node-container-modules.ts
|
|
754
|
+
function createNodeContainerModules() {
|
|
755
|
+
return [NodeContainerModule, FormCoreContainerModule, ErrorContainerModule];
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// src/client/node-render.tsx
|
|
759
|
+
var import_react7 = __toESM(require("react"));
|
|
760
|
+
var import_core8 = require("@flowgram.ai/core");
|
|
761
|
+
|
|
762
|
+
// src/node-react/context/node-engine-react-context.ts
|
|
763
|
+
var import_react4 = __toESM(require("react"));
|
|
764
|
+
var NodeEngineReactContext = import_react4.default.createContext(
|
|
765
|
+
NodeEngineContext.DEFAULT_JSON
|
|
766
|
+
);
|
|
767
|
+
|
|
768
|
+
// src/node-react/hooks/use-node-engine-context.ts
|
|
769
|
+
var import_react5 = require("react");
|
|
770
|
+
var import_core6 = require("@flowgram.ai/core");
|
|
771
|
+
function useNodeEngineContext() {
|
|
772
|
+
const refresh = (0, import_core6.useRefresh)();
|
|
773
|
+
const nodeEngineContext = (0, import_core6.useService)(NodeEngineContext);
|
|
774
|
+
(0, import_react5.useEffect)(() => {
|
|
775
|
+
const disposable = nodeEngineContext.onChange(() => {
|
|
776
|
+
refresh();
|
|
777
|
+
});
|
|
778
|
+
return () => {
|
|
779
|
+
disposable.dispose();
|
|
780
|
+
};
|
|
781
|
+
}, []);
|
|
782
|
+
return nodeEngineContext;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// src/node-react/hooks/use-form-Item.ts
|
|
786
|
+
var import_react6 = require("react");
|
|
787
|
+
var import_core7 = require("@flowgram.ai/core");
|
|
788
|
+
function useFormItem(path) {
|
|
789
|
+
const refresh = (0, import_core7.useRefresh)();
|
|
790
|
+
const node = (0, import_core7.useEntityFromContext)();
|
|
791
|
+
const formData = node.getData(FlowNodeFormData);
|
|
792
|
+
const formItem = formData.getFormModel().getFormItemByPath(path);
|
|
793
|
+
(0, import_react6.useEffect)(() => {
|
|
794
|
+
const disposable = formData.onDataChange(() => {
|
|
795
|
+
refresh();
|
|
796
|
+
});
|
|
797
|
+
return () => {
|
|
798
|
+
disposable.dispose();
|
|
799
|
+
};
|
|
800
|
+
}, []);
|
|
801
|
+
return formItem;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// src/client/node-render.tsx
|
|
805
|
+
var PureNodeRender = ({ node }) => {
|
|
806
|
+
const refresh = (0, import_core8.useRefresh)();
|
|
807
|
+
const nodeErrorData = node.getData(FlowNodeErrorData);
|
|
808
|
+
const formModel = getFormModel(node);
|
|
809
|
+
const isNodeError = !!getNodeError(node);
|
|
810
|
+
const isFormReady = isNodeFormReady(node);
|
|
811
|
+
const playgroundContext = (0, import_core8.useService)(import_core8.PlaygroundContext);
|
|
812
|
+
const nodeManager = (0, import_core8.useService)(NodeManager);
|
|
813
|
+
const nodeFormRender = nodeManager.getPluginRender(PLUGIN_KEY.FORM);
|
|
814
|
+
const nodeErrorRender = nodeManager.getPluginRender(PLUGIN_KEY.ERROR);
|
|
815
|
+
const nodePlaceholderRender = nodeManager.getMaterialRender(MATERIAL_KEY.NODE_PLACEHOLDER_RENDER);
|
|
816
|
+
const nodeEngineContext = useNodeEngineContext();
|
|
817
|
+
(0, import_react7.useEffect)(() => {
|
|
818
|
+
const errorDisposable = nodeErrorData.onDataChange(() => {
|
|
819
|
+
refresh();
|
|
820
|
+
});
|
|
821
|
+
const formDisposable = formModel.onInitialized(() => {
|
|
822
|
+
refresh();
|
|
823
|
+
});
|
|
824
|
+
return () => {
|
|
825
|
+
errorDisposable.dispose();
|
|
826
|
+
formDisposable.dispose();
|
|
827
|
+
};
|
|
828
|
+
}, []);
|
|
829
|
+
const renderContent = (0, import_react7.useCallback)(() => {
|
|
830
|
+
if (!formModel.formMeta) {
|
|
831
|
+
return null;
|
|
832
|
+
}
|
|
833
|
+
if (isNodeError) {
|
|
834
|
+
return nodeErrorRender({ node, playgroundContext });
|
|
835
|
+
}
|
|
836
|
+
if (isFormReady) {
|
|
837
|
+
return nodeFormRender({ node, playgroundContext });
|
|
838
|
+
}
|
|
839
|
+
return nodePlaceholderRender?.({ node, playgroundContext }) || null;
|
|
840
|
+
}, [
|
|
841
|
+
isNodeError,
|
|
842
|
+
isFormReady,
|
|
843
|
+
nodeErrorRender,
|
|
844
|
+
nodeFormRender,
|
|
845
|
+
nodePlaceholderRender,
|
|
846
|
+
node,
|
|
847
|
+
playgroundContext
|
|
848
|
+
]);
|
|
849
|
+
return /* @__PURE__ */ import_react7.default.createElement(NodeEngineReactContext.Provider, { value: nodeEngineContext.json }, nodeManager.nodeRenderHoc(renderContent)());
|
|
850
|
+
};
|
|
851
|
+
var NodeRender = (0, import_react7.memo)(PureNodeRender);
|
|
852
|
+
|
|
853
|
+
// src/client/node-material-client.ts
|
|
854
|
+
function registerNodeErrorRender(nodeManager, render) {
|
|
855
|
+
nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_ERROR_RENDER, render);
|
|
856
|
+
}
|
|
857
|
+
function registerNodePlaceholderRender(nodeManager, render) {
|
|
858
|
+
nodeManager.registerMaterialRender(MATERIAL_KEY.NODE_PLACEHOLDER_RENDER, render);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
// src/client/create-node-entity-datas.ts
|
|
862
|
+
function createNodeEntityDatas() {
|
|
863
|
+
return [FlowNodeFormData, FlowNodeErrorData];
|
|
864
|
+
}
|
|
865
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
866
|
+
0 && (module.exports = {
|
|
867
|
+
DecoratorAbility,
|
|
868
|
+
DefaultAbility,
|
|
869
|
+
EffectAbility,
|
|
870
|
+
ErrorContainerModule,
|
|
871
|
+
FORM_VOID,
|
|
872
|
+
FlowNodeErrorData,
|
|
873
|
+
FlowNodeFormData,
|
|
874
|
+
FormAbilityExtensionRegistry,
|
|
875
|
+
FormContextMaker,
|
|
876
|
+
FormContribution,
|
|
877
|
+
FormCoreContainerModule,
|
|
878
|
+
FormItem,
|
|
879
|
+
FormItemEventName,
|
|
880
|
+
FormManager,
|
|
881
|
+
FormMeta,
|
|
882
|
+
FormModel,
|
|
883
|
+
FormModelEntity,
|
|
884
|
+
FormModelFactory,
|
|
885
|
+
FormPathService,
|
|
886
|
+
MATERIAL_KEY,
|
|
887
|
+
MaterialRenderKey,
|
|
888
|
+
NodeContainerModule,
|
|
889
|
+
NodeContribution,
|
|
890
|
+
NodeEngine,
|
|
891
|
+
NodeEngineContext,
|
|
892
|
+
NodeEngineReactContext,
|
|
893
|
+
NodeManager,
|
|
894
|
+
NodeRender,
|
|
895
|
+
PLUGIN_KEY,
|
|
896
|
+
SetterAbility,
|
|
897
|
+
ValidationAbility,
|
|
898
|
+
VisibilityAbility,
|
|
899
|
+
createNodeContainerModules,
|
|
900
|
+
createNodeEntityDatas,
|
|
901
|
+
getFormModel,
|
|
902
|
+
getNodeError,
|
|
903
|
+
isNodeFormReady,
|
|
904
|
+
registerNodeErrorRender,
|
|
905
|
+
registerNodePlaceholderRender,
|
|
906
|
+
useFormItem,
|
|
907
|
+
useNodeEngineContext
|
|
908
|
+
});
|
|
909
|
+
//# sourceMappingURL=index.js.map
|