@flowgram.ai/history-node-plugin 0.4.6 → 0.4.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/esm/index.js CHANGED
@@ -15,7 +15,7 @@ import { bindContributions, definePluginCreator } from "@flowgram.ai/core";
15
15
  import { HistoryContainerModule, HistoryService, OperationContribution } from "@flowgram.ai/history";
16
16
 
17
17
  // src/utils/index.ts
18
- import { get } from "lodash";
18
+ import { get } from "lodash-es";
19
19
  import { isFormModelV2 } from "@flowgram.ai/node";
20
20
  import { FlowNodeFormData } from "@flowgram.ai/form-core";
21
21
  function getFormModelV2(node) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/create-history-node-plugin.ts","../../src/utils/index.ts","../../src/history-node-registers.ts","../../src/operation-metas/change-form-values.ts","../../src/operation-metas/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { bindContributions, definePluginCreator } from '@flowgram.ai/core';\nimport { HistoryContainerModule, HistoryService, OperationContribution } from '@flowgram.ai/history';\n\nimport { attachFormValuesChange, getFormModelV2 } from './utils';\nimport { HistoryNodeRegisters } from './history-node-registers';\n\n/**\n * 表单历史插件\n */\nexport const createHistoryNodePlugin = definePluginCreator({\n onBind: ({ bind }) => {\n bindContributions(bind, HistoryNodeRegisters, [OperationContribution]);\n },\n onInit: (ctx, _opts) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const historyService = ctx.get<HistoryService>(HistoryService);\n\n document.onNodeCreate(({ node }) => {\n const formModel = getFormModelV2(node);\n\n if (!formModel) {\n return;\n }\n\n attachFormValuesChange(formModel, node, historyService);\n });\n },\n containerModules: [HistoryContainerModule],\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { get } from 'lodash';\nimport { FormModelV2, isFormModelV2 } from '@flowgram.ai/node';\nimport { HistoryService, Operation } from '@flowgram.ai/history';\nimport { StackOperation } from '@flowgram.ai/history';\nimport { FlowNodeFormData } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\n\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 获取v2版本的formModel\n * @param node 节点\n * @returns\n */\nexport function getFormModelV2(node: FlowNodeEntity | undefined): FormModelV2 | undefined {\n if (!node) {\n return undefined;\n }\n\n const formModel = node?.getData(FlowNodeFormData)?.getFormModel<FormModelV2>();\n\n if (!formModel || !isFormModelV2(formModel)) {\n return undefined;\n }\n\n return formModel;\n}\n\n/**\n * 表单合并策略\n * @param op 操作\n * @param prev 上一个操作\n * @param element 操作栈元素\n * @returns\n */\nexport function shouldChangeFormValuesMerge(\n op: Operation<ChangeFormValuesOperationValue | undefined>,\n prev: Operation<ChangeFormValuesOperationValue | undefined>,\n element: StackOperation\n) {\n if (!prev) {\n return false;\n }\n\n if (Date.now() - element.getTimestamp() < 500) {\n if (\n op.type === prev.type && // 相同类型\n op.value?.id === prev.value?.id && // 相同节点\n op.value?.path === prev.value?.path // 相同路径\n ) {\n return {\n type: op.type,\n value: {\n ...op.value,\n value: op.value?.value,\n oldValue: prev.value?.oldValue,\n },\n };\n }\n return true;\n }\n return false;\n}\n\n/**\n * 监听表单值变化\n * @param formModel 表单模型\n * @param node 节点\n * @param historyService 历史服务\n */\nexport function attachFormValuesChange(\n formModel: FormModelV2,\n node: FlowNodeEntity,\n historyService: HistoryService\n) {\n formModel.onFormValuesChange((event) => {\n historyService.pushOperation(\n {\n type: NodeOperationType.changeFormValues,\n value: {\n id: node.id,\n path: event.name,\n value: event.name ? get(event.values, event.name) : event.values,\n oldValue: event.name ? get(event.prevValues, event.name) : event.prevValues,\n },\n },\n { noApply: true }\n );\n });\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { type OperationContribution, type OperationRegistry } from '@flowgram.ai/history';\n\nimport { operationMetas } from './operation-metas';\n\n/**\n * 表单历史操作\n */\n@injectable()\nexport class HistoryNodeRegisters implements OperationContribution {\n registerOperationMeta(operationRegistry: OperationRegistry): void {\n operationMetas.forEach(operationMeta => {\n operationRegistry.registerOperationMeta(operationMeta);\n });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type OperationMeta } from '@flowgram.ai/history';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { type PluginContext } from '@flowgram.ai/core';\n\nimport { getFormModelV2, shouldChangeFormValuesMerge } from '../utils';\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 表单修改操作\n */\nexport const changeFormValueOperationMeta: OperationMeta<\n ChangeFormValuesOperationValue,\n PluginContext,\n void\n> = {\n type: NodeOperationType.changeFormValues,\n inverse: (op) => ({\n ...op,\n value: {\n ...op.value,\n value: op.value.oldValue,\n oldValue: op.value.value,\n },\n }),\n apply: ({ value: { value, path, id } }, ctx: PluginContext) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const formModel = getFormModelV2(document.getNode(id));\n\n if (!formModel) {\n return;\n }\n if (!path) {\n formModel.updateFormValues(value);\n } else {\n formModel.setValueIn(path, value);\n }\n },\n shouldMerge: shouldChangeFormValuesMerge as OperationMeta['shouldMerge'],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { OperationMeta } from '@flowgram.ai/history';\n\nimport { changeFormValueOperationMeta } from './change-form-values';\n\nexport const operationMetas: OperationMeta[] = [changeFormValueOperationMeta];\n"],"mappings":";;;;;;;;;;;;AAKA,SAAS,gBAAAA,qBAAoB;AAC7B,SAAS,mBAAmB,2BAA2B;AACvD,SAAS,wBAAwB,gBAAgB,6BAA6B;;;ACF9E,SAAS,WAAW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in.ts","../../src/utils/index.ts","../../src/history-node-registers.ts","../../src/operation-metas/change-form-values.ts","../../src/operation-metas/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { bindContributions, definePluginCreator } from '@flowgram.ai/core';\nimport { HistoryContainerModule, HistoryService, OperationContribution } from '@flowgram.ai/history';\n\nimport { attachFormValuesChange, getFormModelV2 } from './utils';\nimport { HistoryNodeRegisters } from './history-node-registers';\n\n/**\n * 表单历史插件\n */\nexport const createHistoryNodePlugin = definePluginCreator({\n onBind: ({ bind }) => {\n bindContributions(bind, HistoryNodeRegisters, [OperationContribution]);\n },\n onInit: (ctx, _opts) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const historyService = ctx.get<HistoryService>(HistoryService);\n\n document.onNodeCreate(({ node }) => {\n const formModel = getFormModelV2(node);\n\n if (!formModel) {\n return;\n }\n\n attachFormValuesChange(formModel, node, historyService);\n });\n },\n containerModules: [HistoryContainerModule],\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { get } from 'lodash-es';\nimport { FormModelV2, isFormModelV2 } from '@flowgram.ai/node';\nimport { HistoryService, Operation } from '@flowgram.ai/history';\nimport { StackOperation } from '@flowgram.ai/history';\nimport { FlowNodeFormData } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\n\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 获取v2版本的formModel\n * @param node 节点\n * @returns\n */\nexport function getFormModelV2(node: FlowNodeEntity | undefined): FormModelV2 | undefined {\n if (!node) {\n return undefined;\n }\n\n const formModel = node?.getData(FlowNodeFormData)?.getFormModel<FormModelV2>();\n\n if (!formModel || !isFormModelV2(formModel)) {\n return undefined;\n }\n\n return formModel;\n}\n\n/**\n * 表单合并策略\n * @param op 操作\n * @param prev 上一个操作\n * @param element 操作栈元素\n * @returns\n */\nexport function shouldChangeFormValuesMerge(\n op: Operation<ChangeFormValuesOperationValue | undefined>,\n prev: Operation<ChangeFormValuesOperationValue | undefined>,\n element: StackOperation\n) {\n if (!prev) {\n return false;\n }\n\n if (Date.now() - element.getTimestamp() < 500) {\n if (\n op.type === prev.type && // 相同类型\n op.value?.id === prev.value?.id && // 相同节点\n op.value?.path === prev.value?.path // 相同路径\n ) {\n return {\n type: op.type,\n value: {\n ...op.value,\n value: op.value?.value,\n oldValue: prev.value?.oldValue,\n },\n };\n }\n return true;\n }\n return false;\n}\n\n/**\n * 监听表单值变化\n * @param formModel 表单模型\n * @param node 节点\n * @param historyService 历史服务\n */\nexport function attachFormValuesChange(\n formModel: FormModelV2,\n node: FlowNodeEntity,\n historyService: HistoryService\n) {\n formModel.onFormValuesChange((event) => {\n historyService.pushOperation(\n {\n type: NodeOperationType.changeFormValues,\n value: {\n id: node.id,\n path: event.name,\n value: event.name ? get(event.values, event.name) : event.values,\n oldValue: event.name ? get(event.prevValues, event.name) : event.prevValues,\n },\n },\n { noApply: true }\n );\n });\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { type OperationContribution, type OperationRegistry } from '@flowgram.ai/history';\n\nimport { operationMetas } from './operation-metas';\n\n/**\n * 表单历史操作\n */\n@injectable()\nexport class HistoryNodeRegisters implements OperationContribution {\n registerOperationMeta(operationRegistry: OperationRegistry): void {\n operationMetas.forEach(operationMeta => {\n operationRegistry.registerOperationMeta(operationMeta);\n });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type OperationMeta } from '@flowgram.ai/history';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { type PluginContext } from '@flowgram.ai/core';\n\nimport { getFormModelV2, shouldChangeFormValuesMerge } from '../utils';\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 表单修改操作\n */\nexport const changeFormValueOperationMeta: OperationMeta<\n ChangeFormValuesOperationValue,\n PluginContext,\n void\n> = {\n type: NodeOperationType.changeFormValues,\n inverse: (op) => ({\n ...op,\n value: {\n ...op.value,\n value: op.value.oldValue,\n oldValue: op.value.value,\n },\n }),\n apply: ({ value: { value, path, id } }, ctx: PluginContext) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const formModel = getFormModelV2(document.getNode(id));\n\n if (!formModel) {\n return;\n }\n if (!path) {\n formModel.updateFormValues(value);\n } else {\n formModel.setValueIn(path, value);\n }\n },\n shouldMerge: shouldChangeFormValuesMerge as OperationMeta['shouldMerge'],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { OperationMeta } from '@flowgram.ai/history';\n\nimport { changeFormValueOperationMeta } from './change-form-values';\n\nexport const operationMetas: OperationMeta[] = [changeFormValueOperationMeta];\n"],"mappings":";;;;;;;;;;;;AAKA,SAAS,gBAAAA,qBAAoB;AAC7B,SAAS,mBAAmB,2BAA2B;AACvD,SAAS,wBAAwB,gBAAgB,6BAA6B;;;ACF9E,SAAS,WAAW;AACpB,SAAsB,qBAAqB;AAG3C,SAAS,wBAAwB;AAU1B,SAAS,eAAe,MAA2D;AACxF,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,MAAM,QAAQ,gBAAgB,GAAG,aAA0B;AAE7E,MAAI,CAAC,aAAa,CAAC,cAAc,SAAS,GAAG;AAC3C,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AASO,SAAS,4BACd,IACA,MACA,SACA;AACA,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,MAAI,KAAK,IAAI,IAAI,QAAQ,aAAa,IAAI,KAAK;AAC7C,QACE,GAAG,SAAS,KAAK;AAAA,IACjB,GAAG,OAAO,OAAO,KA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AAAA,EACA,aAAa;AACf;;;AClCO,IAAM,iBAAkC,CAAC,4BAA4B;;;AFKrE,IAAM,uBAAN,MAA4D;AAAA,EACjE,sBAAsB,mBAA4C;AAChE,mBAAe,QAAQ,mBAAiB;AACtC,wBAAkB,sBAAsB,aAAa;AAAA,IACvD,CAAC;AAAA,EACH;AACF;AANa,uBAAN;AAAA,EADN,WAAW;AAAA,GACC;;;AFCN,IAAM,0BAA0B,oBAAoB;AAAA,EACzD,QAAQ,CAAC,EAAE,KAAK,MAAM;AACpB,sBAAkB,MAAM,sBAAsB,CAAC,qBAAqB,CAAC;AAAA,EACvE;AAAA,EACA,QAAQ,CAAC,KAAK,UAAU;AACtB,UAAM,WAAW,IAAI,IAAkBC,aAAY;AACnD,UAAM,iBAAiB,IAAI,IAAoB,cAAc;AAE7D,aAAS,aAAa,CAAC,EAAE,KAAK,MAAM;AAClC,YAAM,YAAY,eAAe,IAAI;AAErC,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAEA,6BAAuB,WAAW,MAAM,cAAc;AAAA,IACxD,CAAC;AAAA,EACH;AAAA,EACA,kBAAkB,CAAC,sBAAsB;AAC3C,CAAC;","names":["FlowDocument","FlowDocument"]}
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ var import_core = require("@flowgram.ai/core");
38
38
  var import_history = require("@flowgram.ai/history");
39
39
 
40
40
  // src/utils/index.ts
41
- var import_lodash = require("lodash");
41
+ var import_lodash_es = require("lodash-es");
42
42
  var import_node = require("@flowgram.ai/node");
43
43
  var import_form_core = require("@flowgram.ai/form-core");
44
44
  function getFormModelV2(node) {
@@ -80,8 +80,8 @@ function attachFormValuesChange(formModel, node, historyService) {
80
80
  value: {
81
81
  id: node.id,
82
82
  path: event.name,
83
- value: event.name ? (0, import_lodash.get)(event.values, event.name) : event.values,
84
- oldValue: event.name ? (0, import_lodash.get)(event.prevValues, event.name) : event.prevValues
83
+ value: event.name ? (0, import_lodash_es.get)(event.values, event.name) : event.values,
84
+ oldValue: event.name ? (0, import_lodash_es.get)(event.prevValues, event.name) : event.prevValues
85
85
  }
86
86
  },
87
87
  { noApply: true }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/create-history-node-plugin.ts","../src/utils/index.ts","../src/history-node-registers.ts","../src/operation-metas/change-form-values.ts","../src/operation-metas/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './create-history-node-plugin';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { bindContributions, definePluginCreator } from '@flowgram.ai/core';\nimport { HistoryContainerModule, HistoryService, OperationContribution } from '@flowgram.ai/history';\n\nimport { attachFormValuesChange, getFormModelV2 } from './utils';\nimport { HistoryNodeRegisters } from './history-node-registers';\n\n/**\n * 表单历史插件\n */\nexport const createHistoryNodePlugin = definePluginCreator({\n onBind: ({ bind }) => {\n bindContributions(bind, HistoryNodeRegisters, [OperationContribution]);\n },\n onInit: (ctx, _opts) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const historyService = ctx.get<HistoryService>(HistoryService);\n\n document.onNodeCreate(({ node }) => {\n const formModel = getFormModelV2(node);\n\n if (!formModel) {\n return;\n }\n\n attachFormValuesChange(formModel, node, historyService);\n });\n },\n containerModules: [HistoryContainerModule],\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { get } from 'lodash';\nimport { FormModelV2, isFormModelV2 } from '@flowgram.ai/node';\nimport { HistoryService, Operation } from '@flowgram.ai/history';\nimport { StackOperation } from '@flowgram.ai/history';\nimport { FlowNodeFormData } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\n\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 获取v2版本的formModel\n * @param node 节点\n * @returns\n */\nexport function getFormModelV2(node: FlowNodeEntity | undefined): FormModelV2 | undefined {\n if (!node) {\n return undefined;\n }\n\n const formModel = node?.getData(FlowNodeFormData)?.getFormModel<FormModelV2>();\n\n if (!formModel || !isFormModelV2(formModel)) {\n return undefined;\n }\n\n return formModel;\n}\n\n/**\n * 表单合并策略\n * @param op 操作\n * @param prev 上一个操作\n * @param element 操作栈元素\n * @returns\n */\nexport function shouldChangeFormValuesMerge(\n op: Operation<ChangeFormValuesOperationValue | undefined>,\n prev: Operation<ChangeFormValuesOperationValue | undefined>,\n element: StackOperation\n) {\n if (!prev) {\n return false;\n }\n\n if (Date.now() - element.getTimestamp() < 500) {\n if (\n op.type === prev.type && // 相同类型\n op.value?.id === prev.value?.id && // 相同节点\n op.value?.path === prev.value?.path // 相同路径\n ) {\n return {\n type: op.type,\n value: {\n ...op.value,\n value: op.value?.value,\n oldValue: prev.value?.oldValue,\n },\n };\n }\n return true;\n }\n return false;\n}\n\n/**\n * 监听表单值变化\n * @param formModel 表单模型\n * @param node 节点\n * @param historyService 历史服务\n */\nexport function attachFormValuesChange(\n formModel: FormModelV2,\n node: FlowNodeEntity,\n historyService: HistoryService\n) {\n formModel.onFormValuesChange((event) => {\n historyService.pushOperation(\n {\n type: NodeOperationType.changeFormValues,\n value: {\n id: node.id,\n path: event.name,\n value: event.name ? get(event.values, event.name) : event.values,\n oldValue: event.name ? get(event.prevValues, event.name) : event.prevValues,\n },\n },\n { noApply: true }\n );\n });\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { type OperationContribution, type OperationRegistry } from '@flowgram.ai/history';\n\nimport { operationMetas } from './operation-metas';\n\n/**\n * 表单历史操作\n */\n@injectable()\nexport class HistoryNodeRegisters implements OperationContribution {\n registerOperationMeta(operationRegistry: OperationRegistry): void {\n operationMetas.forEach(operationMeta => {\n operationRegistry.registerOperationMeta(operationMeta);\n });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type OperationMeta } from '@flowgram.ai/history';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { type PluginContext } from '@flowgram.ai/core';\n\nimport { getFormModelV2, shouldChangeFormValuesMerge } from '../utils';\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 表单修改操作\n */\nexport const changeFormValueOperationMeta: OperationMeta<\n ChangeFormValuesOperationValue,\n PluginContext,\n void\n> = {\n type: NodeOperationType.changeFormValues,\n inverse: (op) => ({\n ...op,\n value: {\n ...op.value,\n value: op.value.oldValue,\n oldValue: op.value.value,\n },\n }),\n apply: ({ value: { value, path, id } }, ctx: PluginContext) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const formModel = getFormModelV2(document.getNode(id));\n\n if (!formModel) {\n return;\n }\n if (!path) {\n formModel.updateFormValues(value);\n } else {\n formModel.setValueIn(path, value);\n }\n },\n shouldMerge: shouldChangeFormValuesMerge as OperationMeta['shouldMerge'],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { OperationMeta } from '@flowgram.ai/history';\n\nimport { changeFormValueOperationMeta } from './change-form-values';\n\nexport const operationMetas: OperationMeta[] = [changeFormValueOperationMeta];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,mBAA6B;AAC7B,kBAAuD;AACvD,qBAA8E;;;ACF9E,oBAAoB;AACpB,kBAA2C;AAG3C,uBAAiC;AAU1B,SAAS,eAAe,MAA2D;AACxF,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,MAAM,QAAQ,iCAAgB,GAAG,aAA0B;AAE7E,MAAI,CAAC,aAAa,KAAC,2BAAc,SAAS,GAAG;AAC3C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kB,4BAAY;AACnD,UAAM,YAAY,eAAe,SAAS,QAAQ,EAAE,CAAC;AAErD,QAAI,CAAC,WAAW;AACd;AAAA,IACF;AACA,QAAI,CAAC,MAAM;AACT,gBAAU,iBAAiB,KAAK;AAAA,IAClC,OAAO;AACL,gBAAU,WAAW,MAAM,KAAK;AAAA,IAClC;AAAA,EACF;AAAA,EACA,aAAa;AACf;;;AClCO,IAAM,iBAAkC,CAAC,4BAA4B;;;AFKrE,IAAM,uBAAN,MAA4D;AAAA,EACjE,sBAAsB,mBAA4C;AAChE,mBAAe,QAAQ,mBAAiB;AACtC,wBAAkB,sBAAsB,aAAa;AAAA,IACvD,CAAC;AAAA,EACH;AACF;AANa,uBAAN;AAAA,MADN,6BAAW;AAAA,GACC;;;AFCN,IAAM,8BAA0B,iCAAoB;AAAA,EACzD,QAAQ,CAAC,EAAE,KAAK,MAAM;AACpB,uCAAkB,MAAM,sBAAsB,CAAC,oCAAqB,CAAC;AAAA,EACvE;AAAA,EACA,QAAQ,CAAC,KAAK,UAAU;AACtB,UAAM,WAAW,IAAI,IAAkB,6BAAY;AACnD,UAAM,iBAAiB,IAAI,IAAoB,6BAAc;AAE7D,aAAS,aAAa,CAAC,EAAE,KAAK,MAAM;AAClC,YAAM,YAAY,eAAe,IAAI;AAErC,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAEA,6BAAuB,WAAW,MAAM,cAAc;AAAA,IACxD,CAAC;AAAA,EACH;AAAA,EACA,kBAAkB,CAAC,qCAAsB;AAC3C,CAAC;","names":["import_document"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/create-history-node-plugin.ts","../src/utils/index.ts","../src/history-node-registers.ts","../src/operation-metas/change-form-values.ts","../src/operation-metas/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './create-history-node-plugin';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { bindContributions, definePluginCreator } from '@flowgram.ai/core';\nimport { HistoryContainerModule, HistoryService, OperationContribution } from '@flowgram.ai/history';\n\nimport { attachFormValuesChange, getFormModelV2 } from './utils';\nimport { HistoryNodeRegisters } from './history-node-registers';\n\n/**\n * 表单历史插件\n */\nexport const createHistoryNodePlugin = definePluginCreator({\n onBind: ({ bind }) => {\n bindContributions(bind, HistoryNodeRegisters, [OperationContribution]);\n },\n onInit: (ctx, _opts) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const historyService = ctx.get<HistoryService>(HistoryService);\n\n document.onNodeCreate(({ node }) => {\n const formModel = getFormModelV2(node);\n\n if (!formModel) {\n return;\n }\n\n attachFormValuesChange(formModel, node, historyService);\n });\n },\n containerModules: [HistoryContainerModule],\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { get } from 'lodash-es';\nimport { FormModelV2, isFormModelV2 } from '@flowgram.ai/node';\nimport { HistoryService, Operation } from '@flowgram.ai/history';\nimport { StackOperation } from '@flowgram.ai/history';\nimport { FlowNodeFormData } from '@flowgram.ai/form-core';\nimport { FlowNodeEntity } from '@flowgram.ai/document';\n\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 获取v2版本的formModel\n * @param node 节点\n * @returns\n */\nexport function getFormModelV2(node: FlowNodeEntity | undefined): FormModelV2 | undefined {\n if (!node) {\n return undefined;\n }\n\n const formModel = node?.getData(FlowNodeFormData)?.getFormModel<FormModelV2>();\n\n if (!formModel || !isFormModelV2(formModel)) {\n return undefined;\n }\n\n return formModel;\n}\n\n/**\n * 表单合并策略\n * @param op 操作\n * @param prev 上一个操作\n * @param element 操作栈元素\n * @returns\n */\nexport function shouldChangeFormValuesMerge(\n op: Operation<ChangeFormValuesOperationValue | undefined>,\n prev: Operation<ChangeFormValuesOperationValue | undefined>,\n element: StackOperation\n) {\n if (!prev) {\n return false;\n }\n\n if (Date.now() - element.getTimestamp() < 500) {\n if (\n op.type === prev.type && // 相同类型\n op.value?.id === prev.value?.id && // 相同节点\n op.value?.path === prev.value?.path // 相同路径\n ) {\n return {\n type: op.type,\n value: {\n ...op.value,\n value: op.value?.value,\n oldValue: prev.value?.oldValue,\n },\n };\n }\n return true;\n }\n return false;\n}\n\n/**\n * 监听表单值变化\n * @param formModel 表单模型\n * @param node 节点\n * @param historyService 历史服务\n */\nexport function attachFormValuesChange(\n formModel: FormModelV2,\n node: FlowNodeEntity,\n historyService: HistoryService\n) {\n formModel.onFormValuesChange((event) => {\n historyService.pushOperation(\n {\n type: NodeOperationType.changeFormValues,\n value: {\n id: node.id,\n path: event.name,\n value: event.name ? get(event.values, event.name) : event.values,\n oldValue: event.name ? get(event.prevValues, event.name) : event.prevValues,\n },\n },\n { noApply: true }\n );\n });\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\nimport { type OperationContribution, type OperationRegistry } from '@flowgram.ai/history';\n\nimport { operationMetas } from './operation-metas';\n\n/**\n * 表单历史操作\n */\n@injectable()\nexport class HistoryNodeRegisters implements OperationContribution {\n registerOperationMeta(operationRegistry: OperationRegistry): void {\n operationMetas.forEach(operationMeta => {\n operationRegistry.registerOperationMeta(operationMeta);\n });\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type OperationMeta } from '@flowgram.ai/history';\nimport { FlowDocument } from '@flowgram.ai/document';\nimport { type PluginContext } from '@flowgram.ai/core';\n\nimport { getFormModelV2, shouldChangeFormValuesMerge } from '../utils';\nimport { ChangeFormValuesOperationValue, NodeOperationType } from '../types';\n\n/**\n * 表单修改操作\n */\nexport const changeFormValueOperationMeta: OperationMeta<\n ChangeFormValuesOperationValue,\n PluginContext,\n void\n> = {\n type: NodeOperationType.changeFormValues,\n inverse: (op) => ({\n ...op,\n value: {\n ...op.value,\n value: op.value.oldValue,\n oldValue: op.value.value,\n },\n }),\n apply: ({ value: { value, path, id } }, ctx: PluginContext) => {\n const document = ctx.get<FlowDocument>(FlowDocument);\n const formModel = getFormModelV2(document.getNode(id));\n\n if (!formModel) {\n return;\n }\n if (!path) {\n formModel.updateFormValues(value);\n } else {\n formModel.setValueIn(path, value);\n }\n },\n shouldMerge: shouldChangeFormValuesMerge as OperationMeta['shouldMerge'],\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { OperationMeta } from '@flowgram.ai/history';\n\nimport { changeFormValueOperationMeta } from './change-form-values';\n\nexport const operationMetas: OperationMeta[] = [changeFormValueOperationMeta];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,mBAA6B;AAC7B,kBAAuD;AACvD,qBAA8E;;;ACF9E,uBAAoB;AACpB,kBAA2C;AAG3C,uBAAiC;AAU1B,SAAS,eAAe,MAA2D;AACxF,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,MAAM,QAAQ,iCAAgB,GAAG,aAA0B;AAE7E,MAAI,CAAC,aAAa,KAAC,2BAAc,SAAS,GAAG;AAC3C,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AASO,SAAS,4BACd,IACA,MACA,SACA;AACA,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,MAAI,KAAK,IAAI,IAAI,QAAQ,aAAa,IAAI,KAAK;AAC7C,QACE,GAAG,SAAS,KAAK;AAAA,IACjB,GAAG,OAAO,OAAO,KAAK,OAAO;AAAA,IAC7B,GAAG,OAAO,SAAS,KAAK,OAAO,MAC/B;AACA,aAAO;AAAA,QACL,MAAM,GAAG;AAAA,QACT,OAAO;AAAA,UACL,GAAG,GAAG;AAAA,UACN,OAAO,GAAG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AAsB,aAAa;AAAA,IACvD,CAAC;AAAA,EACH;AACF;AANa,uBAAN;AAAA,MADN,6BAAW;AAAA,GACC;;;AFCN,IAAM,8BAA0B,iCAAoB;AAAA,EACzD,QAAQ,CAAC,EAAE,KAAK,MAAM;AACpB,uCAAkB,MAAM,sBAAsB,CAAC,oCAAqB,CAAC;AAAA,EACvE;AAAA,EACA,QAAQ,CAAC,KAAK,UAAU;AACtB,UAAM,WAAW,IAAI,IAAkB,6BAAY;AACnD,UAAM,iBAAiB,IAAI,IAAoB,6BAAc;AAE7D,aAAS,aAAa,CAAC,EAAE,KAAK,MAAM;AAClC,YAAM,YAAY,eAAe,IAAI;AAErC,UAAI,CAAC,WAAW;AACd;AAAA,MACF;AAEA,6BAAuB,WAAW,MAAM,cAAc;AAAA,IACxD,CAAC;AAAA,EACH;AAAA,EACA,kBAAkB,CAAC,qCAAsB;AAC3C,CAAC;","names":["import_document"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowgram.ai/history-node-plugin",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "homepage": "https://flowgram.ai/",
5
5
  "repository": "https://github.com/bytedance/flowgram.ai",
6
6
  "license": "MIT",
@@ -18,18 +18,18 @@
18
18
  "dependencies": {
19
19
  "inversify": "^6.0.1",
20
20
  "reflect-metadata": "~0.2.2",
21
- "lodash": "^4.17.21",
22
- "@flowgram.ai/core": "0.4.6",
23
- "@flowgram.ai/form": "0.4.6",
24
- "@flowgram.ai/document": "0.4.6",
25
- "@flowgram.ai/history": "0.4.6",
26
- "@flowgram.ai/form-core": "0.4.6",
27
- "@flowgram.ai/node": "0.4.6",
28
- "@flowgram.ai/utils": "0.4.6"
21
+ "lodash-es": "^4.17.21",
22
+ "@flowgram.ai/core": "0.4.8",
23
+ "@flowgram.ai/document": "0.4.8",
24
+ "@flowgram.ai/form": "0.4.8",
25
+ "@flowgram.ai/node": "0.4.8",
26
+ "@flowgram.ai/utils": "0.4.8",
27
+ "@flowgram.ai/form-core": "0.4.8",
28
+ "@flowgram.ai/history": "0.4.8"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/bezier-js": "4.1.3",
32
- "@types/lodash": "^4.14.137",
32
+ "@types/lodash-es": "^4.17.12",
33
33
  "@types/react": "^18",
34
34
  "@types/react-dom": "^18",
35
35
  "@types/styled-components": "^5",
@@ -41,8 +41,8 @@
41
41
  "tsup": "^8.0.1",
42
42
  "typescript": "^5.8.3",
43
43
  "vitest": "^0.34.6",
44
- "@flowgram.ai/eslint-config": "0.4.6",
45
- "@flowgram.ai/ts-config": "0.4.6"
44
+ "@flowgram.ai/eslint-config": "0.4.8",
45
+ "@flowgram.ai/ts-config": "0.4.8"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8",