@flowgram.ai/variable-plugin 0.2.16 → 0.2.18
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 +13 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/esm/index.js
CHANGED
|
@@ -53,10 +53,21 @@ var createVariablePlugin = definePluginCreator({
|
|
|
53
53
|
|
|
54
54
|
// src/index.ts
|
|
55
55
|
export * from "@flowgram.ai/variable-core";
|
|
56
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
FlowNodeVariableData as FlowNodeVariableData2,
|
|
58
|
+
GlobalScope,
|
|
59
|
+
ScopeChainTransformService as ScopeChainTransformService2,
|
|
60
|
+
getNodeScope,
|
|
61
|
+
getNodePrivateScope,
|
|
62
|
+
FlowNodeScopeType
|
|
63
|
+
} from "@flowgram.ai/variable-layout";
|
|
57
64
|
export {
|
|
65
|
+
FlowNodeScopeType,
|
|
58
66
|
FlowNodeVariableData2 as FlowNodeVariableData,
|
|
59
67
|
GlobalScope,
|
|
60
|
-
|
|
68
|
+
ScopeChainTransformService2 as ScopeChainTransformService,
|
|
69
|
+
createVariablePlugin,
|
|
70
|
+
getNodePrivateScope,
|
|
71
|
+
getNodeScope
|
|
61
72
|
};
|
|
62
73
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create-variable-plugin.ts","../../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/create-variable-plugin.ts","../../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowNodeVariableData,\n FreeLayoutScopeChain,\n FixedLayoutScopeChain,\n VariableLayoutConfig,\n bindGlobalScope,\n ScopeChainTransformService,\n} from '@flowgram.ai/variable-layout';\nimport {\n VariableContainerModule,\n ASTNodeRegistry,\n ASTRegisters,\n VariableEngine,\n ScopeChain,\n} from '@flowgram.ai/variable-core';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { PluginContext, definePluginCreator } from '@flowgram.ai/core';\nimport { EntityManager } from '@flowgram.ai/core';\n\n/**\n * @deprecated 请使用 @injectToAst(XXXService) declare xxxService: XXXService 实现外部依赖注入\n */\ntype Injector = (ctx: PluginContext) => Record<string, any>;\n\nexport interface VariablePluginOptions {\n enable?: boolean;\n // 业务扩展 AST 节点\n extendASTNodes?: (ASTNodeRegistry | [ASTNodeRegistry] | [ASTNodeRegistry, Injector])[];\n // 布局方式\n layout?: 'fixed' | 'free';\n // 布局配置\n layoutConfig?: VariableLayoutConfig;\n}\n\nexport const createVariablePlugin = definePluginCreator<VariablePluginOptions>({\n onBind({ bind }, opts) {\n const { layout, layoutConfig } = opts;\n\n bind(ScopeChainTransformService).toSelf().inSingletonScope();\n\n if (layout === 'free') {\n bind(ScopeChain).to(FreeLayoutScopeChain).inSingletonScope();\n }\n if (layout === 'fixed') {\n bind(ScopeChain).to(FixedLayoutScopeChain).inSingletonScope();\n }\n if (layoutConfig) {\n bind(VariableLayoutConfig).toConstantValue(layoutConfig || {});\n }\n\n bindGlobalScope(bind);\n },\n onInit(ctx, opts) {\n const { extendASTNodes } = opts || {};\n\n const variableEngine = ctx.get<VariableEngine>(VariableEngine);\n const astRegisters = ctx.get<ASTRegisters>(ASTRegisters);\n const entityManager = ctx.get<EntityManager>(EntityManager);\n const document = ctx.get<FlowDocument>(FlowDocument);\n\n /**\n * 注册扩展 AST 节点\n */\n (extendASTNodes || []).forEach((info) => {\n if (Array.isArray(info)) {\n const [extendASTNode, injector] = info;\n\n astRegisters.registerAST(extendASTNode, injector ? () => injector(ctx) : undefined);\n\n return;\n }\n\n astRegisters.registerAST(info);\n });\n\n /**\n * 扩展 FlowNodeVariableData\n */\n entityManager.registerEntityData(FlowNodeVariableData, () => ({ variableEngine } as any));\n document.registerNodeDatas(FlowNodeVariableData);\n },\n containerModules: [VariableContainerModule],\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './create-variable-plugin';\nexport * from '@flowgram.ai/variable-core';\nexport {\n FlowNodeVariableData,\n GlobalScope,\n ScopeChainTransformService,\n getNodeScope,\n getNodePrivateScope,\n FlowNodeScopeType,\n type FlowNodeScopeMeta,\n type FlowNodeScope,\n} from '@flowgram.ai/variable-layout';\n"],"mappings":";AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAwB,2BAA2B;AACnD,SAAS,qBAAqB;AAiBvB,IAAM,uBAAuB,oBAA2C;AAAA,EAC7E,OAAO,EAAE,KAAK,GAAG,MAAM;AACrB,UAAM,EAAE,QAAQ,aAAa,IAAI;AAEjC,SAAK,0BAA0B,EAAE,OAAO,EAAE,iBAAiB;AAE3D,QAAI,WAAW,QAAQ;AACrB,WAAK,UAAU,EAAE,GAAG,oBAAoB,EAAE,iBAAiB;AAAA,IAC7D;AACA,QAAI,WAAW,SAAS;AACtB,WAAK,UAAU,EAAE,GAAG,qBAAqB,EAAE,iBAAiB;AAAA,IAC9D;AACA,QAAI,cAAc;AAChB,WAAK,oBAAoB,EAAE,gBAAgB,gBAAgB,CAAC,CAAC;AAAA,IAC/D;AAEA,oBAAgB,IAAI;AAAA,EACtB;AAAA,EACA,OAAO,KAAK,MAAM;AAChB,UAAM,EAAE,eAAe,IAAI,QAAQ,CAAC;AAEpC,UAAM,iBAAiB,IAAI,IAAoB,cAAc;AAC7D,UAAM,eAAe,IAAI,IAAkB,YAAY;AACvD,UAAM,gBAAgB,IAAI,IAAmB,aAAa;AAC1D,UAAM,WAAW,IAAI,IAAkB,YAAY;AAKnD,KAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,SAAS;AACvC,UAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,cAAM,CAAC,eAAe,QAAQ,IAAI;AAElC,qBAAa,YAAY,eAAe,WAAW,MAAM,SAAS,GAAG,IAAI,MAAS;AAElF;AAAA,MACF;AAEA,mBAAa,YAAY,IAAI;AAAA,IAC/B,CAAC;AAKD,kBAAc,mBAAmB,sBAAsB,OAAO,EAAE,eAAe,EAAS;AACxF,aAAS,kBAAkB,oBAAoB;AAAA,EACjD;AAAA,EACA,kBAAkB,CAAC,uBAAuB;AAC5C,CAAC;;;ACjFD,cAAc;AACd;AAAA,EACE,wBAAAA;AAAA,EACA;AAAA,EACA,8BAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;","names":["FlowNodeVariableData","ScopeChainTransformService"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
2
2
|
import { PluginContext } from '@flowgram.ai/core';
|
|
3
3
|
import { VariableLayoutConfig } from '@flowgram.ai/variable-layout';
|
|
4
|
-
export { FlowNodeVariableData, GlobalScope } from '@flowgram.ai/variable-layout';
|
|
4
|
+
export { FlowNodeScope, FlowNodeScopeMeta, FlowNodeScopeType, FlowNodeVariableData, GlobalScope, ScopeChainTransformService, getNodePrivateScope, getNodeScope } from '@flowgram.ai/variable-layout';
|
|
5
5
|
import { ASTNodeRegistry } from '@flowgram.ai/variable-core';
|
|
6
6
|
export * from '@flowgram.ai/variable-core';
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
2
2
|
import { PluginContext } from '@flowgram.ai/core';
|
|
3
3
|
import { VariableLayoutConfig } from '@flowgram.ai/variable-layout';
|
|
4
|
-
export { FlowNodeVariableData, GlobalScope } from '@flowgram.ai/variable-layout';
|
|
4
|
+
export { FlowNodeScope, FlowNodeScopeMeta, FlowNodeScopeType, FlowNodeVariableData, GlobalScope, ScopeChainTransformService, getNodePrivateScope, getNodeScope } from '@flowgram.ai/variable-layout';
|
|
5
5
|
import { ASTNodeRegistry } from '@flowgram.ai/variable-core';
|
|
6
6
|
export * from '@flowgram.ai/variable-core';
|
|
7
7
|
|
package/dist/index.js
CHANGED
|
@@ -21,9 +21,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
// src/index.ts
|
|
22
22
|
var src_exports = {};
|
|
23
23
|
__export(src_exports, {
|
|
24
|
+
FlowNodeScopeType: () => import_variable_layout2.FlowNodeScopeType,
|
|
24
25
|
FlowNodeVariableData: () => import_variable_layout2.FlowNodeVariableData,
|
|
25
26
|
GlobalScope: () => import_variable_layout2.GlobalScope,
|
|
26
|
-
|
|
27
|
+
ScopeChainTransformService: () => import_variable_layout2.ScopeChainTransformService,
|
|
28
|
+
createVariablePlugin: () => createVariablePlugin,
|
|
29
|
+
getNodePrivateScope: () => import_variable_layout2.getNodePrivateScope,
|
|
30
|
+
getNodeScope: () => import_variable_layout2.getNodeScope
|
|
27
31
|
});
|
|
28
32
|
module.exports = __toCommonJS(src_exports);
|
|
29
33
|
|
|
@@ -73,9 +77,13 @@ __reExport(src_exports, require("@flowgram.ai/variable-core"), module.exports);
|
|
|
73
77
|
var import_variable_layout2 = require("@flowgram.ai/variable-layout");
|
|
74
78
|
// Annotate the CommonJS export names for ESM import in node:
|
|
75
79
|
0 && (module.exports = {
|
|
80
|
+
FlowNodeScopeType,
|
|
76
81
|
FlowNodeVariableData,
|
|
77
82
|
GlobalScope,
|
|
83
|
+
ScopeChainTransformService,
|
|
78
84
|
createVariablePlugin,
|
|
85
|
+
getNodePrivateScope,
|
|
86
|
+
getNodeScope,
|
|
79
87
|
...require("@flowgram.ai/variable-core")
|
|
80
88
|
});
|
|
81
89
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/create-variable-plugin.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/create-variable-plugin.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './create-variable-plugin';\nexport * from '@flowgram.ai/variable-core';\nexport {\n FlowNodeVariableData,\n GlobalScope,\n ScopeChainTransformService,\n getNodeScope,\n getNodePrivateScope,\n FlowNodeScopeType,\n type FlowNodeScopeMeta,\n type FlowNodeScope,\n} from '@flowgram.ai/variable-layout';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n FlowNodeVariableData,\n FreeLayoutScopeChain,\n FixedLayoutScopeChain,\n VariableLayoutConfig,\n bindGlobalScope,\n ScopeChainTransformService,\n} from '@flowgram.ai/variable-layout';\nimport {\n VariableContainerModule,\n ASTNodeRegistry,\n ASTRegisters,\n VariableEngine,\n ScopeChain,\n} from '@flowgram.ai/variable-core';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { PluginContext, definePluginCreator } from '@flowgram.ai/core';\nimport { EntityManager } from '@flowgram.ai/core';\n\n/**\n * @deprecated 请使用 @injectToAst(XXXService) declare xxxService: XXXService 实现外部依赖注入\n */\ntype Injector = (ctx: PluginContext) => Record<string, any>;\n\nexport interface VariablePluginOptions {\n enable?: boolean;\n // 业务扩展 AST 节点\n extendASTNodes?: (ASTNodeRegistry | [ASTNodeRegistry] | [ASTNodeRegistry, Injector])[];\n // 布局方式\n layout?: 'fixed' | 'free';\n // 布局配置\n layoutConfig?: VariableLayoutConfig;\n}\n\nexport const createVariablePlugin = definePluginCreator<VariablePluginOptions>({\n onBind({ bind }, opts) {\n const { layout, layoutConfig } = opts;\n\n bind(ScopeChainTransformService).toSelf().inSingletonScope();\n\n if (layout === 'free') {\n bind(ScopeChain).to(FreeLayoutScopeChain).inSingletonScope();\n }\n if (layout === 'fixed') {\n bind(ScopeChain).to(FixedLayoutScopeChain).inSingletonScope();\n }\n if (layoutConfig) {\n bind(VariableLayoutConfig).toConstantValue(layoutConfig || {});\n }\n\n bindGlobalScope(bind);\n },\n onInit(ctx, opts) {\n const { extendASTNodes } = opts || {};\n\n const variableEngine = ctx.get<VariableEngine>(VariableEngine);\n const astRegisters = ctx.get<ASTRegisters>(ASTRegisters);\n const entityManager = ctx.get<EntityManager>(EntityManager);\n const document = ctx.get<FlowDocument>(FlowDocument);\n\n /**\n * 注册扩展 AST 节点\n */\n (extendASTNodes || []).forEach((info) => {\n if (Array.isArray(info)) {\n const [extendASTNode, injector] = info;\n\n astRegisters.registerAST(extendASTNode, injector ? () => injector(ctx) : undefined);\n\n return;\n }\n\n astRegisters.registerAST(info);\n });\n\n /**\n * 扩展 FlowNodeVariableData\n */\n entityManager.registerEntityData(FlowNodeVariableData, () => ({ variableEngine } as any));\n document.registerNodeDatas(FlowNodeVariableData);\n },\n containerModules: [VariableContainerModule],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,6BAOO;AACP,2BAMO;AACP,sBAA6B;AAC7B,kBAAmD;AACnD,IAAAA,eAA8B;AAiBvB,IAAM,2BAAuB,iCAA2C;AAAA,EAC7E,OAAO,EAAE,KAAK,GAAG,MAAM;AACrB,UAAM,EAAE,QAAQ,aAAa,IAAI;AAEjC,SAAK,iDAA0B,EAAE,OAAO,EAAE,iBAAiB;AAE3D,QAAI,WAAW,QAAQ;AACrB,WAAK,+BAAU,EAAE,GAAG,2CAAoB,EAAE,iBAAiB;AAAA,IAC7D;AACA,QAAI,WAAW,SAAS;AACtB,WAAK,+BAAU,EAAE,GAAG,4CAAqB,EAAE,iBAAiB;AAAA,IAC9D;AACA,QAAI,cAAc;AAChB,WAAK,2CAAoB,EAAE,gBAAgB,gBAAgB,CAAC,CAAC;AAAA,IAC/D;AAEA,gDAAgB,IAAI;AAAA,EACtB;AAAA,EACA,OAAO,KAAK,MAAM;AAChB,UAAM,EAAE,eAAe,IAAI,QAAQ,CAAC;AAEpC,UAAM,iBAAiB,IAAI,IAAoB,mCAAc;AAC7D,UAAM,eAAe,IAAI,IAAkB,iCAAY;AACvD,UAAM,gBAAgB,IAAI,IAAmB,0BAAa;AAC1D,UAAM,WAAW,IAAI,IAAkB,4BAAY;AAKnD,KAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,SAAS;AACvC,UAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,cAAM,CAAC,eAAe,QAAQ,IAAI;AAElC,qBAAa,YAAY,eAAe,WAAW,MAAM,SAAS,GAAG,IAAI,MAAS;AAElF;AAAA,MACF;AAEA,mBAAa,YAAY,IAAI;AAAA,IAC/B,CAAC;AAKD,kBAAc,mBAAmB,6CAAsB,OAAO,EAAE,eAAe,EAAS;AACxF,aAAS,kBAAkB,2CAAoB;AAAA,EACjD;AAAA,EACA,kBAAkB,CAAC,4CAAuB;AAC5C,CAAC;;;ADjFD,wBAAc,uCANd;AAOA,IAAAC,0BASO;","names":["import_core","import_variable_layout"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowgram.ai/variable-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"homepage": "https://flowgram.ai/",
|
|
5
5
|
"repository": "https://github.com/bytedance/flowgram.ai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"inversify": "^6.0.1",
|
|
20
20
|
"reflect-metadata": "~0.2.2",
|
|
21
21
|
"styled-components": "^5",
|
|
22
|
-
"@flowgram.ai/core": "0.2.
|
|
23
|
-
"@flowgram.ai/document": "0.2.
|
|
24
|
-
"@flowgram.ai/free-layout-core": "0.2.
|
|
25
|
-
"@flowgram.ai/utils": "0.2.
|
|
26
|
-
"@flowgram.ai/variable-core": "0.2.
|
|
27
|
-
"@flowgram.ai/variable-layout": "0.2.
|
|
22
|
+
"@flowgram.ai/core": "0.2.18",
|
|
23
|
+
"@flowgram.ai/document": "0.2.18",
|
|
24
|
+
"@flowgram.ai/free-layout-core": "0.2.18",
|
|
25
|
+
"@flowgram.ai/utils": "0.2.18",
|
|
26
|
+
"@flowgram.ai/variable-core": "0.2.18",
|
|
27
|
+
"@flowgram.ai/variable-layout": "0.2.18"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@vitest/coverage-v8": "^0.32.0",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"tsup": "^8.0.1",
|
|
33
33
|
"typescript": "^5.0.4",
|
|
34
34
|
"vitest": "^0.34.6",
|
|
35
|
-
"@flowgram.ai/eslint-config": "0.2.
|
|
36
|
-
"@flowgram.ai/ts-config": "0.2.
|
|
35
|
+
"@flowgram.ai/eslint-config": "0.2.18",
|
|
36
|
+
"@flowgram.ai/ts-config": "0.2.18"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public",
|