@flowgram.ai/form-materials 0.4.7 → 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.
@@ -119,15 +119,33 @@ var integerRegistry = {
119
119
  )
120
120
  };
121
121
 
122
- // src/plugins/json-schema-preset/type-definition/boolean.tsx
122
+ // src/plugins/json-schema-preset/type-definition/date-time.tsx
123
123
  import React6 from "react";
124
+ import { DatePicker } from "@douyinfe/semi-ui";
125
+ var dateTimeRegistry = {
126
+ type: "date-time",
127
+ ConstantRenderer: (props) => /* @__PURE__ */ React6.createElement(
128
+ DatePicker,
129
+ {
130
+ size: "small",
131
+ type: "dateTime",
132
+ density: "compact",
133
+ style: { width: "100%", ...props.style || {} },
134
+ disabled: props.readonly,
135
+ ...props
136
+ }
137
+ )
138
+ };
139
+
140
+ // src/plugins/json-schema-preset/type-definition/boolean.tsx
141
+ import React7 from "react";
124
142
  import { I18n as I18n5 } from "@flowgram.ai/editor";
125
143
  import { Select } from "@douyinfe/semi-ui";
126
144
  var booleanRegistry = {
127
145
  type: "boolean",
128
146
  ConstantRenderer: (props) => {
129
147
  const { value, onChange, ...rest } = props;
130
- return /* @__PURE__ */ React6.createElement(
148
+ return /* @__PURE__ */ React7.createElement(
131
149
  Select,
132
150
  {
133
151
  placeholder: I18n5.t("Please Select Boolean"),
@@ -146,11 +164,11 @@ var booleanRegistry = {
146
164
  };
147
165
 
148
166
  // src/plugins/json-schema-preset/type-definition/array.tsx
149
- import React7 from "react";
167
+ import React8 from "react";
150
168
  import { I18n as I18n6 } from "@flowgram.ai/editor";
151
169
  var arrayRegistry = {
152
170
  type: "array",
153
- ConstantRenderer: (props) => /* @__PURE__ */ React7.createElement(
171
+ ConstantRenderer: (props) => /* @__PURE__ */ React8.createElement(
154
172
  CodeEditorMini,
155
173
  {
156
174
  value: props.value,
@@ -169,7 +187,8 @@ var jsonSchemaTypePreset = [
169
187
  numberRegistry,
170
188
  integerRegistry,
171
189
  booleanRegistry,
172
- arrayRegistry
190
+ arrayRegistry,
191
+ dateTimeRegistry
173
192
  ];
174
193
  jsonSchemaTypePreset.forEach((_type) => jsonSchemaTypeManager.register(_type));
175
194
 
@@ -185,7 +204,7 @@ var createTypePresetPlugin = definePluginCreator({
185
204
  });
186
205
 
187
206
  // src/plugins/json-schema-preset/index.tsx
188
- import React8 from "react";
207
+ import React9 from "react";
189
208
  import {
190
209
  JsonSchemaUtils,
191
210
  useTypeManager as useOriginTypeManager,
@@ -195,7 +214,7 @@ var useTypeManager = () => useOriginTypeManager();
195
214
  var JsonSchemaTypePresetProvider = ({
196
215
  types = [],
197
216
  children
198
- }) => /* @__PURE__ */ React8.createElement(OriginTypePresetProvider, { types: [...jsonSchemaTypePreset, ...types] }, children);
217
+ }) => /* @__PURE__ */ React9.createElement(OriginTypePresetProvider, { types: [...jsonSchemaTypePreset, ...types] }, children);
199
218
 
200
219
  // src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts
201
220
  import {
@@ -222,23 +241,23 @@ var createDisableDeclarationPlugin = definePluginCreator2({
222
241
  });
223
242
 
224
243
  // src/components/variable-selector/use-variable-tree.tsx
225
- import React9, { useCallback } from "react";
244
+ import React10, { useCallback } from "react";
226
245
  import { JsonSchemaUtils as JsonSchemaUtils2 } from "@flowgram.ai/json-schema";
227
246
  import { ASTMatch as ASTMatch2, useAvailableVariables } from "@flowgram.ai/editor";
228
247
  import { Icon } from "@douyinfe/semi-ui";
229
248
  function useVariableTree(params) {
230
- const { includeSchema, excludeSchema, customSkip } = params;
249
+ const { includeSchema, excludeSchema, skipVariable } = params;
231
250
  const typeManager = useTypeManager();
232
251
  const variables = useAvailableVariables();
233
252
  const getVariableTypeIcon = useCallback((variable) => {
234
253
  if (variable.meta?.icon) {
235
254
  if (typeof variable.meta.icon === "string") {
236
- return /* @__PURE__ */ React9.createElement("img", { style: { marginRight: 8 }, width: 12, height: 12, src: variable.meta.icon });
255
+ return /* @__PURE__ */ React10.createElement("img", { style: { marginRight: 8 }, width: 12, height: 12, src: variable.meta.icon });
237
256
  }
238
257
  return variable.meta.icon;
239
258
  }
240
259
  const schema = JsonSchemaUtils2.astToSchema(variable.type, { drilldownObject: false });
241
- return /* @__PURE__ */ React9.createElement(Icon, { size: "small", svg: typeManager.getDisplayIcon(schema || {}) });
260
+ return /* @__PURE__ */ React10.createElement(Icon, { size: "small", svg: typeManager.getDisplayIcon(schema || {}) });
242
261
  }, []);
243
262
  const renderVariable = (variable, parentFields = []) => {
244
263
  let type = variable?.type;
@@ -253,7 +272,7 @@ function useVariableTree(params) {
253
272
  const key = keyPath.join(".");
254
273
  const isSchemaInclude = includeSchema ? JsonSchemaUtils2.isASTMatchSchema(type, includeSchema) : true;
255
274
  const isSchemaExclude = excludeSchema ? JsonSchemaUtils2.isASTMatchSchema(type, excludeSchema) : false;
256
- const isCustomSkip = customSkip ? customSkip(variable) : false;
275
+ const isCustomSkip = skipVariable ? skipVariable(variable) : false;
257
276
  const isMetaDisabled = variable.meta?.disabled;
258
277
  const isSchemaMatch = isSchemaInclude && !isSchemaExclude && !isCustomSkip && !isMetaDisabled;
259
278
  if (!isSchemaMatch && !children?.length) {
@@ -274,8 +293,20 @@ function useVariableTree(params) {
274
293
  return [...variables.slice(0).reverse()].map((_variable) => renderVariable(_variable)).filter(Boolean);
275
294
  }
276
295
 
296
+ // src/components/variable-selector/context.tsx
297
+ import React11, { createContext, useContext, useMemo } from "react";
298
+ var VariableSelectorContext = createContext({});
299
+ var useVariableSelectorContext = () => useContext(VariableSelectorContext);
300
+ var VariableSelectorProvider = ({
301
+ children,
302
+ skipVariable
303
+ }) => {
304
+ const context = useMemo(() => ({ skipVariable }), [skipVariable]);
305
+ return /* @__PURE__ */ React11.createElement(VariableSelectorContext.Provider, { value: context }, children);
306
+ };
307
+
277
308
  // src/components/variable-selector/index.tsx
278
- import React10, { useMemo } from "react";
309
+ import React12, { useMemo as useMemo2 } from "react";
279
310
  import { I18n as I18n7 } from "@flowgram.ai/editor";
280
311
  import { Popover } from "@douyinfe/semi-ui";
281
312
  import { IconChevronDownStroked, IconIssueStroked } from "@douyinfe/semi-icons";
@@ -351,8 +382,13 @@ var VariableSelector = ({
351
382
  hasError,
352
383
  triggerRender
353
384
  }) => {
354
- const treeData = useVariableTree({ includeSchema, excludeSchema });
355
- const treeValue = useMemo(() => {
385
+ const { skipVariable } = useVariableSelectorContext();
386
+ const treeData = useVariableTree({
387
+ includeSchema,
388
+ excludeSchema,
389
+ skipVariable
390
+ });
391
+ const treeValue = useMemo2(() => {
356
392
  if (typeof value === "string") {
357
393
  console.warn(
358
394
  "The Value of VariableSelector is a string, it should be an ARRAY. \n",
@@ -364,11 +400,11 @@ var VariableSelector = ({
364
400
  }, [value]);
365
401
  const renderIcon = (icon) => {
366
402
  if (typeof icon === "string") {
367
- return /* @__PURE__ */ React10.createElement("img", { style: { marginRight: 8 }, width: 12, height: 12, src: icon });
403
+ return /* @__PURE__ */ React12.createElement("img", { style: { marginRight: 8 }, width: 12, height: 12, src: icon });
368
404
  }
369
405
  return icon;
370
406
  };
371
- return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
407
+ return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
372
408
  UITreeSelect,
373
409
  {
374
410
  dropdownMatchSelectWidth: false,
@@ -385,10 +421,10 @@ var VariableSelector = ({
385
421
  },
386
422
  renderSelectedItem: (_option) => {
387
423
  if (!_option?.keyPath) {
388
- return /* @__PURE__ */ React10.createElement(
424
+ return /* @__PURE__ */ React12.createElement(
389
425
  UITag,
390
426
  {
391
- prefixIcon: /* @__PURE__ */ React10.createElement(IconIssueStroked, null),
427
+ prefixIcon: /* @__PURE__ */ React12.createElement(IconIssueStroked, null),
392
428
  color: "amber",
393
429
  closable: !readonly,
394
430
  onClose: () => onChange(void 0)
@@ -397,13 +433,13 @@ var VariableSelector = ({
397
433
  );
398
434
  }
399
435
  const rootIcon = renderIcon(_option.rootMeta?.icon || _option?.icon);
400
- const rootTitle = /* @__PURE__ */ React10.createElement(UIRootTitle, null, _option.rootMeta?.title ? `${_option.rootMeta?.title} ${_option.isRoot ? "" : "-"} ` : null);
401
- return /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement(
436
+ const rootTitle = /* @__PURE__ */ React12.createElement(UIRootTitle, null, _option.rootMeta?.title ? `${_option.rootMeta?.title} ${_option.isRoot ? "" : "-"} ` : null);
437
+ return /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(
402
438
  Popover,
403
439
  {
404
- content: /* @__PURE__ */ React10.createElement(UIPopoverContent, null, rootIcon, rootTitle, /* @__PURE__ */ React10.createElement(UIVarName, null, _option.keyPath.slice(1).join(".")))
440
+ content: /* @__PURE__ */ React12.createElement(UIPopoverContent, null, rootIcon, rootTitle, /* @__PURE__ */ React12.createElement(UIVarName, null, _option.keyPath.slice(1).join(".")))
405
441
  },
406
- /* @__PURE__ */ React10.createElement(
442
+ /* @__PURE__ */ React12.createElement(
407
443
  UITag,
408
444
  {
409
445
  prefixIcon: rootIcon,
@@ -411,12 +447,12 @@ var VariableSelector = ({
411
447
  onClose: () => onChange(void 0)
412
448
  },
413
449
  rootTitle,
414
- !_option.isRoot && /* @__PURE__ */ React10.createElement(UIVarName, { $inSelector: true }, _option.label)
450
+ !_option.isRoot && /* @__PURE__ */ React12.createElement(UIVarName, { $inSelector: true }, _option.label)
415
451
  )
416
452
  ));
417
453
  },
418
454
  showClear: false,
419
- arrowIcon: /* @__PURE__ */ React10.createElement(IconChevronDownStroked, { size: "small" }),
455
+ arrowIcon: /* @__PURE__ */ React12.createElement(IconChevronDownStroked, { size: "small" }),
420
456
  triggerRender,
421
457
  placeholder: config?.placeholder ?? I18n7.t("Select Variable")
422
458
  }
@@ -434,7 +470,8 @@ export {
434
470
  JsonSchemaTypePresetProvider,
435
471
  createDisableDeclarationPlugin,
436
472
  useVariableTree,
473
+ VariableSelectorProvider,
437
474
  VariableSelector,
438
475
  InjectVariableSelector
439
476
  };
440
- //# sourceMappingURL=chunk-MFDEE4HB.js.map
477
+ //# sourceMappingURL=chunk-IHOHRV5V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/code-editor/index.tsx","../../src/components/code-editor-mini/index.tsx","../../src/plugins/json-schema-preset/create-type-preset-plugin.tsx","../../src/plugins/json-schema-preset/type-definition/index.tsx","../../src/plugins/json-schema-preset/type-definition/string.tsx","../../src/plugins/json-schema-preset/type-definition/object.tsx","../../src/plugins/json-schema-preset/type-definition/number.tsx","../../src/plugins/json-schema-preset/type-definition/integer.tsx","../../src/plugins/json-schema-preset/type-definition/date-time.tsx","../../src/plugins/json-schema-preset/type-definition/boolean.tsx","../../src/plugins/json-schema-preset/type-definition/array.tsx","../../src/plugins/json-schema-preset/index.tsx","../../src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts","../../src/components/variable-selector/use-variable-tree.tsx","../../src/components/variable-selector/context.tsx","../../src/components/variable-selector/index.tsx","../../src/components/variable-selector/styles.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { lazySuspense } from '@/shared';\n\nexport const CodeEditor = lazySuspense(() =>\n import('./editor').then((module) => ({ default: module.CodeEditor }))\n);\n\nexport type { CodeEditorPropsType } from './editor';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React from 'react';\n\nimport styled from 'styled-components';\n\nimport { CodeEditor, type CodeEditorPropsType } from '@/components/code-editor';\n\nconst UIMini = styled.div`\n .ͼ1 .cm-content {\n }\n`;\n\nexport function CodeEditorMini(props: CodeEditorPropsType) {\n return (\n <UIMini>\n <CodeEditor\n {...props}\n options={{\n lineNumbersGutter: false,\n foldGutter: false,\n minHeight: 24,\n ...(props.options || {}),\n }}\n />\n </UIMini>\n );\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n BaseTypeManager,\n jsonSchemaContainerModule,\n JsonSchemaTypeManager,\n} from '@flowgram.ai/json-schema';\nimport { definePluginCreator } from '@flowgram.ai/editor';\n\nimport { jsonSchemaTypePreset } from './type-definition';\nimport { JsonSchemaTypeRegistry } from './manager';\n\nexport const createTypePresetPlugin = definePluginCreator<{\n types?: Partial<JsonSchemaTypeRegistry> & Pick<JsonSchemaTypeRegistry, 'type'>[];\n unregisterTypes?: string[];\n}>({\n onInit(ctx, opts) {\n const typeManager = ctx.get(BaseTypeManager) as JsonSchemaTypeManager;\n jsonSchemaTypePreset.forEach((_type) => typeManager.register(_type));\n\n opts.types?.forEach((_type) => typeManager.register(_type));\n opts.unregisterTypes?.forEach((_type) => typeManager.unregister(_type));\n },\n containerModules: [jsonSchemaContainerModule],\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { jsonSchemaTypeManager } from '@flowgram.ai/json-schema';\n\nimport { stringRegistry } from './string';\nimport { objectRegistry } from './object';\nimport { numberRegistry } from './number';\nimport { integerRegistry } from './integer';\nimport { dateTimeRegistry } from './date-time';\nimport { booleanRegistry } from './boolean';\nimport { arrayRegistry } from './array';\n\nexport const jsonSchemaTypePreset = [\n stringRegistry,\n objectRegistry,\n numberRegistry,\n integerRegistry,\n booleanRegistry,\n arrayRegistry,\n dateTimeRegistry,\n];\n\njsonSchemaTypePreset.forEach((_type) => jsonSchemaTypeManager.register(_type));\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { I18n } from '@flowgram.ai/editor';\nimport { Input, TextArea } from '@douyinfe/semi-ui';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const stringRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'string',\n ConstantRenderer: (props) =>\n props?.enableMultiLineStr ? (\n <TextArea\n autosize\n rows={1}\n placeholder={I18n.t('Please Input String')}\n disabled={props.readonly}\n {...props}\n />\n ) : (\n <Input\n size=\"small\"\n placeholder={I18n.t('Please Input String')}\n disabled={props.readonly}\n {...props}\n />\n ),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { I18n } from '@flowgram.ai/editor';\n\nimport { CodeEditorMini } from '@/components/code-editor-mini';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const objectRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'object',\n ConstantRenderer: (props) => (\n <CodeEditorMini\n value={props.value}\n onChange={(v) => props.onChange?.(v)}\n languageId=\"json\"\n placeholder={I18n.t('Please Input Object')}\n readonly={props.readonly}\n />\n ),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { I18n } from '@flowgram.ai/editor';\nimport { InputNumber } from '@douyinfe/semi-ui';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const numberRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'number',\n ConstantRenderer: (props) => (\n <InputNumber\n placeholder={I18n.t('Please Input Number')}\n size=\"small\"\n disabled={props.readonly}\n hideButtons\n {...props}\n />\n ),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { I18n } from '@flowgram.ai/editor';\nimport { InputNumber } from '@douyinfe/semi-ui';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const integerRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'integer',\n ConstantRenderer: (props) => (\n <InputNumber\n placeholder={I18n.t('Please Input Integer')}\n size=\"small\"\n disabled={props.readonly}\n precision={0}\n {...props}\n />\n ),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { DatePicker } from '@douyinfe/semi-ui';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const dateTimeRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'date-time',\n ConstantRenderer: (props) => (\n <DatePicker\n size=\"small\"\n type=\"dateTime\"\n density=\"compact\"\n style={{ width: '100%', ...(props.style || {}) }}\n disabled={props.readonly}\n {...props}\n />\n ),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { I18n } from '@flowgram.ai/editor';\nimport { Select } from '@douyinfe/semi-ui';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const booleanRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'boolean',\n ConstantRenderer: (props) => {\n const { value, onChange, ...rest } = props;\n return (\n <Select\n placeholder={I18n.t('Please Select Boolean')}\n size=\"small\"\n disabled={props.readonly}\n optionList={[\n { label: I18n.t('True'), value: 1 },\n { label: I18n.t('False'), value: 0 },\n ]}\n value={value ? 1 : 0}\n onChange={(value) => onChange?.(!!value)}\n {...rest}\n />\n );\n },\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\n/* eslint-disable react/prop-types */\nimport React from 'react';\n\nimport { I18n } from '@flowgram.ai/editor';\n\nimport { CodeEditorMini } from '@/components/code-editor-mini';\n\nimport { type JsonSchemaTypeRegistry } from '../manager';\n\nexport const arrayRegistry: Partial<JsonSchemaTypeRegistry> = {\n type: 'array',\n ConstantRenderer: (props) => (\n <CodeEditorMini\n value={props.value}\n languageId=\"json\"\n onChange={(v) => props.onChange?.(v)}\n placeholder={I18n.t('Please Input Array')}\n readonly={props.readonly}\n />\n ),\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\nimport React from 'react';\n\nimport {\n type IJsonSchema,\n JsonSchemaUtils,\n useTypeManager as useOriginTypeManager,\n TypePresetProvider as OriginTypePresetProvider,\n JsonSchemaTypeManager,\n type JsonSchemaBasicType,\n} from '@flowgram.ai/json-schema';\n\nimport { jsonSchemaTypePreset } from './type-definition';\nimport { type JsonSchemaTypeRegistry, type ConstantRendererProps } from './manager';\nimport { createTypePresetPlugin } from './create-type-preset-plugin';\n\nconst useTypeManager = () =>\n useOriginTypeManager() as JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;\n\nconst JsonSchemaTypePresetProvider = ({\n types = [],\n children,\n}: React.PropsWithChildren<{ types: JsonSchemaTypeRegistry[] }>) => (\n <OriginTypePresetProvider types={[...jsonSchemaTypePreset, ...types]}>\n {children}\n </OriginTypePresetProvider>\n);\n\nexport {\n createTypePresetPlugin,\n useTypeManager,\n JsonSchemaTypePresetProvider,\n IJsonSchema,\n JsonSchemaUtils,\n JsonSchemaTypeRegistry,\n ConstantRendererProps,\n JsonSchemaBasicType,\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n ASTMatch,\n definePluginCreator,\n type GlobalEventActionType,\n VariableEngine,\n} from '@flowgram.ai/editor';\n\nexport const createDisableDeclarationPlugin = definePluginCreator<void>({\n onInit(ctx) {\n const variableEngine = ctx.get(VariableEngine);\n\n const handleEvent = (action: GlobalEventActionType) => {\n if (ASTMatch.isVariableDeclaration(action.ast)) {\n if (!action.ast.meta?.disabled) {\n action.ast.updateMeta({\n ...(action.ast.meta || {}),\n disabled: true,\n });\n }\n }\n };\n\n variableEngine.onGlobalEvent('NewAST', handleEvent);\n variableEngine.onGlobalEvent('UpdateAST', handleEvent);\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { useCallback } from 'react';\n\nimport { IJsonSchema, JsonSchemaUtils } from '@flowgram.ai/json-schema';\nimport { ASTMatch, BaseVariableField, useAvailableVariables } from '@flowgram.ai/editor';\nimport { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';\nimport { Icon } from '@douyinfe/semi-ui';\n\nimport { useTypeManager } from '@/plugins';\n\ntype VariableField = BaseVariableField<{\n icon?: string | JSX.Element;\n title?: string;\n disabled?: boolean;\n}>;\n\nexport function useVariableTree(params: {\n includeSchema?: IJsonSchema | IJsonSchema[];\n excludeSchema?: IJsonSchema | IJsonSchema[];\n skipVariable?: (variable: VariableField) => boolean;\n}): TreeNodeData[] {\n const { includeSchema, excludeSchema, skipVariable } = params;\n\n const typeManager = useTypeManager();\n const variables = useAvailableVariables();\n\n const getVariableTypeIcon = useCallback((variable: VariableField) => {\n if (variable.meta?.icon) {\n if (typeof variable.meta.icon === 'string') {\n return <img style={{ marginRight: 8 }} width={12} height={12} src={variable.meta.icon} />;\n }\n\n return variable.meta.icon;\n }\n\n const schema = JsonSchemaUtils.astToSchema(variable.type, { drilldownObject: false });\n\n return <Icon size=\"small\" svg={typeManager.getDisplayIcon(schema || {})} />;\n }, []);\n\n const renderVariable = (\n variable: VariableField,\n parentFields: VariableField[] = []\n ): TreeNodeData | null => {\n let type = variable?.type;\n\n if (!type) {\n return null;\n }\n\n let children: TreeNodeData[] | undefined;\n\n if (ASTMatch.isObject(type)) {\n children = (type.properties || [])\n .map((_property) => renderVariable(_property as VariableField, [...parentFields, variable]))\n .filter(Boolean) as TreeNodeData[];\n }\n\n const keyPath = [...parentFields.map((_field) => _field.key), variable.key];\n const key = keyPath.join('.');\n\n const isSchemaInclude = includeSchema\n ? JsonSchemaUtils.isASTMatchSchema(type, includeSchema)\n : true;\n const isSchemaExclude = excludeSchema\n ? JsonSchemaUtils.isASTMatchSchema(type, excludeSchema)\n : false;\n const isCustomSkip = skipVariable ? skipVariable(variable) : false;\n\n // disabled in meta when created\n const isMetaDisabled = variable.meta?.disabled;\n\n const isSchemaMatch = isSchemaInclude && !isSchemaExclude && !isCustomSkip && !isMetaDisabled;\n\n // If not match, and no children, return null\n if (!isSchemaMatch && !children?.length) {\n return null;\n }\n\n return {\n key: key,\n label: variable.meta?.title || variable.key,\n value: key,\n keyPath,\n icon: getVariableTypeIcon(variable),\n children,\n disabled: !isSchemaMatch,\n rootMeta: parentFields[0]?.meta || variable.meta,\n isRoot: !parentFields?.length,\n };\n };\n\n return [...variables.slice(0).reverse()]\n .map((_variable) => renderVariable(_variable as VariableField))\n .filter(Boolean) as TreeNodeData[];\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { createContext, useContext, useMemo } from 'react';\n\nimport { BaseVariableField } from '@flowgram.ai/editor';\n\nexport const VariableSelectorContext = createContext<{\n skipVariable?: (variable?: BaseVariableField) => boolean;\n}>({});\n\nexport const useVariableSelectorContext = () => useContext(VariableSelectorContext);\n\nexport const VariableSelectorProvider = ({\n children,\n skipVariable,\n}: {\n skipVariable?: (variable?: BaseVariableField) => boolean;\n children: React.ReactNode;\n}) => {\n const context = useMemo(() => ({ skipVariable }), [skipVariable]);\n\n return (\n <VariableSelectorContext.Provider value={context}>{children}</VariableSelectorContext.Provider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport React, { useMemo } from 'react';\n\nimport { IJsonSchema } from '@flowgram.ai/json-schema';\nimport { I18n } from '@flowgram.ai/editor';\nimport { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';\nimport { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';\nimport { Popover } from '@douyinfe/semi-ui';\nimport { IconChevronDownStroked, IconIssueStroked } from '@douyinfe/semi-icons';\n\nimport { createInjectMaterial } from '@/shared';\n\nimport { useVariableTree } from './use-variable-tree';\nimport { UIPopoverContent, UIRootTitle, UITag, UITreeSelect, UIVarName } from './styles';\nimport { useVariableSelectorContext } from './context';\n\nexport interface VariableSelectorProps {\n value?: string[];\n config?: {\n placeholder?: string;\n notFoundContent?: string;\n };\n onChange: (value?: string[]) => void;\n includeSchema?: IJsonSchema | IJsonSchema[];\n excludeSchema?: IJsonSchema | IJsonSchema[];\n readonly?: boolean;\n hasError?: boolean;\n style?: React.CSSProperties;\n triggerRender?: (props: TriggerRenderProps) => React.ReactNode;\n}\n\nexport { useVariableTree };\n\nexport const VariableSelector = ({\n value,\n config = {},\n onChange,\n style,\n readonly = false,\n includeSchema,\n excludeSchema,\n hasError,\n triggerRender,\n}: VariableSelectorProps) => {\n const { skipVariable } = useVariableSelectorContext();\n\n const treeData = useVariableTree({\n includeSchema,\n excludeSchema,\n skipVariable,\n });\n\n const treeValue = useMemo(() => {\n if (typeof value === 'string') {\n console.warn(\n 'The Value of VariableSelector is a string, it should be an ARRAY. \\n',\n 'Please check the value of VariableSelector \\n'\n );\n return value;\n }\n return value?.join('.');\n }, [value]);\n\n const renderIcon = (icon: string | JSX.Element) => {\n if (typeof icon === 'string') {\n return <img style={{ marginRight: 8 }} width={12} height={12} src={icon} />;\n }\n\n return icon;\n };\n\n return (\n <>\n <UITreeSelect\n dropdownMatchSelectWidth={false}\n disabled={readonly}\n treeData={treeData}\n size=\"small\"\n value={treeValue}\n clearIcon={null}\n $error={hasError}\n style={style}\n validateStatus={hasError ? 'error' : undefined}\n onChange={(_, _config) => {\n onChange((_config as TreeNodeData).keyPath as string[]);\n }}\n renderSelectedItem={(_option: TreeNodeData) => {\n if (!_option?.keyPath) {\n return (\n <UITag\n prefixIcon={<IconIssueStroked />}\n color=\"amber\"\n closable={!readonly}\n onClose={() => onChange(undefined)}\n >\n {config?.notFoundContent ?? 'Undefined'}\n </UITag>\n );\n }\n\n const rootIcon = renderIcon(_option.rootMeta?.icon || _option?.icon);\n\n const rootTitle = (\n <UIRootTitle>\n {_option.rootMeta?.title\n ? `${_option.rootMeta?.title} ${_option.isRoot ? '' : '-'} `\n : null}\n </UIRootTitle>\n );\n\n return (\n <div>\n <Popover\n content={\n <UIPopoverContent>\n {rootIcon}\n {rootTitle}\n <UIVarName>{_option.keyPath.slice(1).join('.')}</UIVarName>\n </UIPopoverContent>\n }\n >\n <UITag\n prefixIcon={rootIcon}\n closable={!readonly}\n onClose={() => onChange(undefined)}\n >\n {rootTitle}\n {!_option.isRoot && <UIVarName $inSelector>{_option.label}</UIVarName>}\n </UITag>\n </Popover>\n </div>\n );\n }}\n showClear={false}\n arrowIcon={<IconChevronDownStroked size=\"small\" />}\n triggerRender={triggerRender}\n placeholder={config?.placeholder ?? I18n.t('Select Variable')}\n />\n </>\n );\n};\n\nVariableSelector.renderKey = 'variable-selector-render-key';\nexport const InjectVariableSelector = createInjectMaterial(VariableSelector);\n\nexport { VariableSelectorProvider } from './context';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport styled, { css } from 'styled-components';\nimport { Tag, TreeSelect } from '@douyinfe/semi-ui';\n\nexport const UIRootTitle = styled.div`\n margin-right: 4px;\n min-width: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--semi-color-text-2);\n`;\n\nexport const UIVarName = styled.div<{ $inSelector?: boolean }>`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n ${({ $inSelector }) =>\n $inSelector &&\n css`\n min-width: 50%;\n `}\n`;\n\nexport const UITag = styled(Tag)`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n & .semi-tag-content-center {\n justify-content: flex-start;\n }\n\n &.semi-tag {\n margin: 0;\n height: 22px;\n }\n`;\n\nexport const UITreeSelect = styled(TreeSelect)<{ $error?: boolean }>`\n outline: ${({ $error }) => ($error ? '1px solid red' : 'none')};\n\n & .semi-tree-select-selection {\n padding: 0px;\n height: 22px;\n }\n\n & .semi-tree-select-selection-content {\n width: 100%;\n }\n\n & .semi-tree-select-selection-placeholder {\n padding-left: 10px;\n }\n`;\n\nexport const UIPopoverContent = styled.div`\n padding: 10px;\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n white-space: nowrap;\n`;\n"],"mappings":";;;;;;AAOO,IAAM,aAAa;AAAA,EAAa,MACrC,OAAO,sBAAU,EAAE,KAAK,CAAC,YAAY,EAAE,SAAS,OAAO,WAAW,EAAE;AACtE;;;ACJA,OAAO,WAAW;AAElB,OAAO,YAAY;AAInB,IAAM,SAAS,OAAO;AAAA;AAAA;AAAA;AAKf,SAAS,eAAe,OAA4B;AACzD,SACE,oCAAC,cACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,SAAS;AAAA,QACP,mBAAmB;AAAA,QACnB,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,GAAI,MAAM,WAAW,CAAC;AAAA,MACxB;AAAA;AAAA,EACF,CACF;AAEJ;;;ACzBA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,2BAA2B;;;ACLpC,SAAS,6BAA6B;;;ACCtC,OAAOA,YAAW;AAElB,SAAS,YAAY;AACrB,SAAS,OAAO,gBAAgB;AAIzB,IAAM,iBAAkD;AAAA,EAC7D,MAAM;AAAA,EACN,kBAAkB,CAAC,UACjB,OAAO,qBACL,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC,UAAQ;AAAA,MACR,MAAM;AAAA,MACN,aAAa,KAAK,EAAE,qBAAqB;AAAA,MACzC,UAAU,MAAM;AAAA,MACf,GAAG;AAAA;AAAA,EACN,IAEA,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAa,KAAK,EAAE,qBAAqB;AAAA,MACzC,UAAU,MAAM;AAAA,MACf,GAAG;AAAA;AAAA,EACN;AAEN;;;AC1BA,OAAOC,YAAW;AAElB,SAA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","React","I18n","React","I18n","React","React","definePluginCreator","React","JsonSchemaUtils","ASTMatch","React","JsonSchemaUtils","ASTMatch","React","React","useMemo","I18n","styled","useMemo","React","I18n"]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CodeEditor,
3
3
  useVariableTree
4
- } from "./chunk-MFDEE4HB.js";
4
+ } from "./chunk-IHOHRV5V.js";
5
5
  import {
6
6
  polyfillCreateRoot
7
7
  } from "./chunk-DEZUEMUM.js";
@@ -279,4 +279,4 @@ function JsonEditorWithVariables(props) {
279
279
  export {
280
280
  JsonEditorWithVariables
281
281
  };
282
- //# sourceMappingURL=editor-2YHACGQ2.js.map
282
+ //# sourceMappingURL=editor-4X7K477H.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-727SU246.js";
4
4
  import {
5
5
  useVariableTree
6
- } from "./chunk-MFDEE4HB.js";
6
+ } from "./chunk-IHOHRV5V.js";
7
7
  import {
8
8
  polyfillCreateRoot
9
9
  } from "./chunk-DEZUEMUM.js";
@@ -246,4 +246,4 @@ function PromptEditorWithVariables(props) {
246
246
  export {
247
247
  PromptEditorWithVariables
248
248
  };
249
- //# sourceMappingURL=editor-G63XGWH2.js.map
249
+ //# sourceMappingURL=editor-Z24WLBPO.js.map
package/dist/esm/index.js CHANGED
@@ -8,11 +8,12 @@ import {
8
8
  JsonSchemaTypePresetProvider,
9
9
  JsonSchemaUtils,
10
10
  VariableSelector,
11
+ VariableSelectorProvider,
11
12
  createDisableDeclarationPlugin,
12
13
  createTypePresetPlugin,
13
14
  useTypeManager,
14
15
  useVariableTree
15
- } from "./chunk-MFDEE4HB.js";
16
+ } from "./chunk-IHOHRV5V.js";
16
17
  import {
17
18
  FlowValueUtils,
18
19
  createInjectMaterial,
@@ -874,6 +875,14 @@ var defaultRules = {
874
875
  map: {
875
876
  ["is_empty" /* IS_EMPTY */]: null,
876
877
  ["is_not_empty" /* IS_NOT_EMPTY */]: null
878
+ },
879
+ ["date-time"]: {
880
+ ["eq" /* EQ */]: "date-time",
881
+ ["neq" /* NEQ */]: "date-time",
882
+ ["gt" /* GT */]: "date-time",
883
+ ["gte" /* GTE */]: "date-time",
884
+ ["lt" /* LT */]: "date-time",
885
+ ["lte" /* LTE */]: "date-time"
877
886
  }
878
887
  };
879
888
  var defaultOpConfigs = {
@@ -1373,7 +1382,7 @@ function BatchOutputs(props) {
1373
1382
 
1374
1383
  // src/components/prompt-editor-with-variables/index.tsx
1375
1384
  var PromptEditorWithVariables = lazySuspense(
1376
- () => import("./editor-G63XGWH2.js").then((module) => ({ default: module.PromptEditorWithVariables }))
1385
+ () => import("./editor-Z24WLBPO.js").then((module) => ({ default: module.PromptEditorWithVariables }))
1377
1386
  );
1378
1387
 
1379
1388
  // src/components/prompt-editor-with-inputs/index.tsx
@@ -1383,7 +1392,7 @@ var PromptEditorWithInputs = lazySuspense(
1383
1392
 
1384
1393
  // src/components/json-editor-with-variables/index.tsx
1385
1394
  var JsonEditorWithVariables = lazySuspense(
1386
- () => import("./editor-2YHACGQ2.js").then((module) => ({ default: module.JsonEditorWithVariables }))
1395
+ () => import("./editor-4X7K477H.js").then((module) => ({ default: module.JsonEditorWithVariables }))
1387
1396
  );
1388
1397
 
1389
1398
  // src/components/inputs-values/index.tsx
@@ -2624,6 +2633,7 @@ export {
2624
2633
  PromptEditorWithVariables,
2625
2634
  TypeSelector,
2626
2635
  VariableSelector,
2636
+ VariableSelectorProvider,
2627
2637
  autoRenameRefEffect,
2628
2638
  createBatchOutputsFormPlugin,
2629
2639
  createDisableDeclarationPlugin,