@flowgram.ai/form-materials 0.4.4 → 0.4.5
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 +129 -76
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +131 -76
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/code-editor/theme/dark.ts +49 -30
- package/src/components/code-editor/theme/light.ts +56 -32
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +4 -3
- package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +10 -18
- package/src/shared/index.ts +1 -0
- package/src/shared/polyfill-create-root/index.tsx +33 -0
package/dist/index.d.mts
CHANGED
|
@@ -814,6 +814,17 @@ declare namespace FlowValueUtils {
|
|
|
814
814
|
function inferJsonSchema(values: any, scope: Scope): IJsonSchema | undefined;
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
+
/**
|
|
818
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
819
|
+
* SPDX-License-Identifier: MIT
|
|
820
|
+
*/
|
|
821
|
+
interface IPolyfillRoot {
|
|
822
|
+
render(children: React.ReactNode): void;
|
|
823
|
+
unmount(): void;
|
|
824
|
+
}
|
|
825
|
+
declare function polyfillCreateRoot(dom: HTMLElement): IPolyfillRoot;
|
|
826
|
+
declare function unstableSetCreateRoot(createRoot: (dom: HTMLElement) => IPolyfillRoot): void;
|
|
827
|
+
|
|
817
828
|
/**
|
|
818
829
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
819
830
|
* SPDX-License-Identifier: MIT
|
|
@@ -888,4 +899,4 @@ declare function useObjectList<ValueType>({ value, onChange, sortIndexKey, }: {
|
|
|
888
899
|
remove: (itemId: string) => void;
|
|
889
900
|
};
|
|
890
901
|
|
|
891
|
-
export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|
|
902
|
+
export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, type IPolyfillRoot, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|
package/dist/index.d.ts
CHANGED
|
@@ -814,6 +814,17 @@ declare namespace FlowValueUtils {
|
|
|
814
814
|
function inferJsonSchema(values: any, scope: Scope): IJsonSchema | undefined;
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
+
/**
|
|
818
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
819
|
+
* SPDX-License-Identifier: MIT
|
|
820
|
+
*/
|
|
821
|
+
interface IPolyfillRoot {
|
|
822
|
+
render(children: React.ReactNode): void;
|
|
823
|
+
unmount(): void;
|
|
824
|
+
}
|
|
825
|
+
declare function polyfillCreateRoot(dom: HTMLElement): IPolyfillRoot;
|
|
826
|
+
declare function unstableSetCreateRoot(createRoot: (dom: HTMLElement) => IPolyfillRoot): void;
|
|
827
|
+
|
|
817
828
|
/**
|
|
818
829
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
819
830
|
* SPDX-License-Identifier: MIT
|
|
@@ -888,4 +899,4 @@ declare function useObjectList<ValueType>({ value, onChange, sortIndexKey, }: {
|
|
|
888
899
|
remove: (itemId: string) => void;
|
|
889
900
|
};
|
|
890
901
|
|
|
891
|
-
export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|
|
902
|
+
export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, type IPolyfillRoot, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|
package/dist/index.js
CHANGED
|
@@ -78,10 +78,12 @@ __export(src_exports, {
|
|
|
78
78
|
listenRefSchemaChange: () => listenRefSchemaChange,
|
|
79
79
|
listenRefValueChange: () => listenRefValueChange,
|
|
80
80
|
parseTypeSelectValue: () => parseTypeSelectValue,
|
|
81
|
+
polyfillCreateRoot: () => polyfillCreateRoot,
|
|
81
82
|
provideBatchInputEffect: () => provideBatchInputEffect,
|
|
82
83
|
provideBatchOutputsEffect: () => provideBatchOutputsEffect,
|
|
83
84
|
provideJsonSchemaOutputs: () => provideJsonSchemaOutputs,
|
|
84
85
|
syncVariableTitle: () => syncVariableTitle,
|
|
86
|
+
unstableSetCreateRoot: () => unstableSetCreateRoot,
|
|
85
87
|
useObjectList: () => useObjectList,
|
|
86
88
|
useTypeManager: () => useTypeManager,
|
|
87
89
|
useVariableTree: () => useVariableTree,
|
|
@@ -337,6 +339,23 @@ var FlowValueUtils;
|
|
|
337
339
|
FlowValueUtils2.inferJsonSchema = inferJsonSchema;
|
|
338
340
|
})(FlowValueUtils || (FlowValueUtils = {}));
|
|
339
341
|
|
|
342
|
+
// src/shared/polyfill-create-root/index.tsx
|
|
343
|
+
var ReactDOM = __toESM(require("react-dom"));
|
|
344
|
+
var unstableCreateRoot = (dom) => ({
|
|
345
|
+
render(children) {
|
|
346
|
+
ReactDOM.render(children, dom);
|
|
347
|
+
},
|
|
348
|
+
unmount() {
|
|
349
|
+
ReactDOM.unmountComponentAtNode(dom);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
function polyfillCreateRoot(dom) {
|
|
353
|
+
return unstableCreateRoot(dom);
|
|
354
|
+
}
|
|
355
|
+
function unstableSetCreateRoot(createRoot) {
|
|
356
|
+
unstableCreateRoot = createRoot;
|
|
357
|
+
}
|
|
358
|
+
|
|
340
359
|
// src/components/variable-selector/use-variable-tree.tsx
|
|
341
360
|
var import_react12 = __toESM(require("react"));
|
|
342
361
|
var import_json_schema5 = require("@flowgram.ai/json-schema");
|
|
@@ -449,54 +468,55 @@ var import_preset_code4 = require("@coze-editor/editor/preset-code");
|
|
|
449
468
|
// src/components/code-editor/theme/light.ts
|
|
450
469
|
var import_preset_code2 = require("@coze-editor/editor/preset-code");
|
|
451
470
|
var colors = {
|
|
452
|
-
background: "#
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
string: "#
|
|
457
|
-
number: "#
|
|
458
|
-
boolean: "#
|
|
459
|
-
null: "#
|
|
460
|
-
separator: "#
|
|
471
|
+
background: "#FFFFFF",
|
|
472
|
+
comment: "#6B7280",
|
|
473
|
+
key: "#2563EB",
|
|
474
|
+
variable: "#DC2626",
|
|
475
|
+
string: "#059669",
|
|
476
|
+
number: "#EA580C",
|
|
477
|
+
boolean: "#7C3AED",
|
|
478
|
+
null: "#7C3AED",
|
|
479
|
+
separator: "#374151"
|
|
461
480
|
};
|
|
462
481
|
var lightTheme = (0, import_preset_code2.createTheme)({
|
|
463
482
|
variant: "light",
|
|
464
483
|
settings: {
|
|
465
|
-
background: "#
|
|
466
|
-
foreground: "#
|
|
467
|
-
caret: "#
|
|
468
|
-
selection: "#
|
|
469
|
-
gutterBackground: "#
|
|
470
|
-
gutterForeground: "#
|
|
484
|
+
background: "#FFFFFF",
|
|
485
|
+
foreground: "#1F2937",
|
|
486
|
+
caret: "#2563EB",
|
|
487
|
+
selection: "#E5E7EB",
|
|
488
|
+
gutterBackground: "#F9FAFB",
|
|
489
|
+
gutterForeground: "#6B7280",
|
|
471
490
|
gutterBorderColor: "transparent",
|
|
472
491
|
gutterBorderWidth: 0,
|
|
473
|
-
lineHighlight: "#
|
|
474
|
-
bracketColors: ["#
|
|
492
|
+
lineHighlight: "#F3F4F680",
|
|
493
|
+
bracketColors: ["#F59E0B", "#8B5CF6", "#06B6D4"],
|
|
475
494
|
tooltip: {
|
|
476
|
-
backgroundColor: "#
|
|
477
|
-
color: "#
|
|
478
|
-
border: "1px solid #
|
|
495
|
+
backgroundColor: "#FFFFFF",
|
|
496
|
+
color: "#1F2937",
|
|
497
|
+
border: "1px solid #E5E7EB",
|
|
498
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"
|
|
479
499
|
},
|
|
480
500
|
link: {
|
|
481
|
-
color: "#
|
|
501
|
+
color: "#2563EB"
|
|
482
502
|
},
|
|
483
503
|
completionItemHover: {
|
|
484
|
-
backgroundColor: "#
|
|
504
|
+
backgroundColor: "#F3F4F6"
|
|
485
505
|
},
|
|
486
506
|
completionItemSelected: {
|
|
487
|
-
backgroundColor: "#
|
|
507
|
+
backgroundColor: "#E5E7EB"
|
|
488
508
|
},
|
|
489
509
|
completionItemIcon: {
|
|
490
|
-
color: "#
|
|
510
|
+
color: "#4B5563"
|
|
491
511
|
},
|
|
492
512
|
completionItemLabel: {
|
|
493
|
-
color: "#
|
|
513
|
+
color: "#1F2937"
|
|
494
514
|
},
|
|
495
515
|
completionItemInfo: {
|
|
496
|
-
color: "#
|
|
516
|
+
color: "#4B5563"
|
|
497
517
|
},
|
|
498
518
|
completionItemDetail: {
|
|
499
|
-
color: "#
|
|
519
|
+
color: "#6B7280"
|
|
500
520
|
}
|
|
501
521
|
},
|
|
502
522
|
styles: [
|
|
@@ -509,6 +529,10 @@ var lightTheme = (0, import_preset_code2.createTheme)({
|
|
|
509
529
|
tag: [import_preset_code2.tags.propertyName],
|
|
510
530
|
color: colors.key
|
|
511
531
|
},
|
|
532
|
+
{
|
|
533
|
+
tag: [import_preset_code2.tags.variableName],
|
|
534
|
+
color: colors.variable
|
|
535
|
+
},
|
|
512
536
|
{
|
|
513
537
|
tag: [import_preset_code2.tags.string],
|
|
514
538
|
color: colors.string
|
|
@@ -532,27 +556,44 @@ var lightTheme = (0, import_preset_code2.createTheme)({
|
|
|
532
556
|
// markdown
|
|
533
557
|
{
|
|
534
558
|
tag: [import_preset_code2.tags.heading],
|
|
535
|
-
color: "#
|
|
559
|
+
color: "#2563EB"
|
|
536
560
|
},
|
|
537
561
|
{
|
|
538
562
|
tag: [import_preset_code2.tags.processingInstruction],
|
|
539
|
-
color: "#
|
|
563
|
+
color: "#2563EB"
|
|
564
|
+
},
|
|
565
|
+
// js
|
|
566
|
+
{
|
|
567
|
+
tag: [import_preset_code2.tags.definitionKeyword],
|
|
568
|
+
color: "#9333EA"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
tag: [import_preset_code2.tags.modifier],
|
|
572
|
+
color: "#9333EA"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
tag: [import_preset_code2.tags.controlKeyword],
|
|
576
|
+
color: "#9333EA"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
tag: [import_preset_code2.tags.operatorKeyword],
|
|
580
|
+
color: "#9333EA"
|
|
540
581
|
},
|
|
541
582
|
// shell
|
|
542
583
|
// curl
|
|
543
584
|
{
|
|
544
585
|
tag: [import_preset_code2.tags.standard(import_preset_code2.tags.variableName)],
|
|
545
|
-
color: "#
|
|
586
|
+
color: "#059669"
|
|
546
587
|
},
|
|
547
588
|
// -X
|
|
548
589
|
{
|
|
549
590
|
tag: [import_preset_code2.tags.attributeName],
|
|
550
|
-
color: "#
|
|
591
|
+
color: "#EA580C"
|
|
551
592
|
},
|
|
552
593
|
// url in string (includes quotes), e.g. "https://..."
|
|
553
594
|
{
|
|
554
595
|
tag: [import_preset_code2.tags.special(import_preset_code2.tags.string)],
|
|
555
|
-
color: "#
|
|
596
|
+
color: "#2563EB"
|
|
556
597
|
}
|
|
557
598
|
]
|
|
558
599
|
});
|
|
@@ -560,54 +601,55 @@ var lightTheme = (0, import_preset_code2.createTheme)({
|
|
|
560
601
|
// src/components/code-editor/theme/dark.ts
|
|
561
602
|
var import_preset_code3 = require("@coze-editor/editor/preset-code");
|
|
562
603
|
var colors2 = {
|
|
563
|
-
background: "#
|
|
564
|
-
// syntax
|
|
565
|
-
comment: "#
|
|
566
|
-
key: "#
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
604
|
+
background: "#0D1117",
|
|
605
|
+
// syntax - 现代化暗色主题配色
|
|
606
|
+
comment: "#8B949E",
|
|
607
|
+
key: "#7DD3FC",
|
|
608
|
+
variable: "#F472B6",
|
|
609
|
+
string: "#34D399",
|
|
610
|
+
number: "#FBBF24",
|
|
611
|
+
boolean: "#A78BFA",
|
|
612
|
+
null: "#A78BFA",
|
|
613
|
+
separator: "#E6EDF3"
|
|
572
614
|
};
|
|
573
615
|
var darkTheme = (0, import_preset_code3.createTheme)({
|
|
574
616
|
variant: "dark",
|
|
575
617
|
settings: {
|
|
576
618
|
background: colors2.background,
|
|
577
|
-
foreground: "#
|
|
578
|
-
caret: "#
|
|
579
|
-
selection: "#
|
|
619
|
+
foreground: "#E6EDF3",
|
|
620
|
+
caret: "#7DD3FC",
|
|
621
|
+
selection: "#264F7833",
|
|
580
622
|
gutterBackground: colors2.background,
|
|
581
|
-
gutterForeground: "#
|
|
623
|
+
gutterForeground: "#6E7681",
|
|
582
624
|
gutterBorderColor: "transparent",
|
|
583
625
|
gutterBorderWidth: 0,
|
|
584
|
-
lineHighlight: "#
|
|
585
|
-
bracketColors: ["#
|
|
626
|
+
lineHighlight: "#21262D",
|
|
627
|
+
bracketColors: ["#FBBF24", "#A78BFA", "#7DD3FC"],
|
|
586
628
|
tooltip: {
|
|
587
|
-
backgroundColor: "#
|
|
588
|
-
color: "#
|
|
589
|
-
border: "
|
|
629
|
+
backgroundColor: "#21262D",
|
|
630
|
+
color: "#E6EDF3",
|
|
631
|
+
border: "1px solid #30363D"
|
|
590
632
|
},
|
|
591
633
|
link: {
|
|
592
|
-
color: "#
|
|
634
|
+
color: "#58A6FF"
|
|
593
635
|
},
|
|
594
636
|
completionItemHover: {
|
|
595
|
-
backgroundColor: "#
|
|
637
|
+
backgroundColor: "#21262D"
|
|
596
638
|
},
|
|
597
639
|
completionItemSelected: {
|
|
598
|
-
backgroundColor: "#
|
|
640
|
+
backgroundColor: "#1F6EEB"
|
|
599
641
|
},
|
|
600
642
|
completionItemIcon: {
|
|
601
|
-
color: "#
|
|
643
|
+
color: "#8B949E"
|
|
602
644
|
},
|
|
603
645
|
completionItemLabel: {
|
|
604
|
-
color: "#
|
|
646
|
+
color: "#E6EDF3"
|
|
605
647
|
},
|
|
606
648
|
completionItemInfo: {
|
|
607
|
-
color: "#
|
|
649
|
+
color: "#8B949E"
|
|
608
650
|
},
|
|
609
651
|
completionItemDetail: {
|
|
610
|
-
color: "#
|
|
652
|
+
color: "#6E7681"
|
|
611
653
|
}
|
|
612
654
|
},
|
|
613
655
|
styles: [
|
|
@@ -640,30 +682,47 @@ var darkTheme = (0, import_preset_code3.createTheme)({
|
|
|
640
682
|
tag: [import_preset_code3.tags.separator],
|
|
641
683
|
color: colors2.separator
|
|
642
684
|
},
|
|
685
|
+
// js
|
|
686
|
+
{
|
|
687
|
+
tag: [import_preset_code3.tags.definitionKeyword],
|
|
688
|
+
color: "#C084FC"
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
tag: [import_preset_code3.tags.modifier],
|
|
692
|
+
color: "#C084FC"
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
tag: [import_preset_code3.tags.controlKeyword],
|
|
696
|
+
color: "#C084FC"
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
tag: [import_preset_code3.tags.operatorKeyword],
|
|
700
|
+
color: "#C084FC"
|
|
701
|
+
},
|
|
643
702
|
// markdown
|
|
644
703
|
{
|
|
645
704
|
tag: [import_preset_code3.tags.heading],
|
|
646
|
-
color: "#
|
|
705
|
+
color: "#7DD3FC"
|
|
647
706
|
},
|
|
648
707
|
{
|
|
649
708
|
tag: [import_preset_code3.tags.processingInstruction],
|
|
650
|
-
color: "#
|
|
709
|
+
color: "#7DD3FC"
|
|
651
710
|
},
|
|
652
711
|
// shell
|
|
653
712
|
// curl
|
|
654
713
|
{
|
|
655
714
|
tag: [import_preset_code3.tags.standard(import_preset_code3.tags.variableName)],
|
|
656
|
-
color: "#
|
|
715
|
+
color: "#34D399"
|
|
657
716
|
},
|
|
658
717
|
// -X
|
|
659
718
|
{
|
|
660
719
|
tag: [import_preset_code3.tags.attributeName],
|
|
661
|
-
color: "#
|
|
720
|
+
color: "#FBBF24"
|
|
662
721
|
},
|
|
663
722
|
// url in string (includes quotes), e.g. "https://..."
|
|
664
723
|
{
|
|
665
724
|
tag: [import_preset_code3.tags.special(import_preset_code3.tags.string)],
|
|
666
|
-
color: "#
|
|
725
|
+
color: "#7DD3FC"
|
|
667
726
|
}
|
|
668
727
|
]
|
|
669
728
|
});
|
|
@@ -2500,7 +2559,6 @@ function VariableTree() {
|
|
|
2500
2559
|
}
|
|
2501
2560
|
|
|
2502
2561
|
// src/components/prompt-editor-with-variables/extensions/variable-tag.tsx
|
|
2503
|
-
var import_react_dom = __toESM(require("react-dom"));
|
|
2504
2562
|
var import_react39 = __toESM(require("react"));
|
|
2505
2563
|
var import_lodash5 = require("lodash");
|
|
2506
2564
|
var import_editor23 = require("@flowgram.ai/editor");
|
|
@@ -2560,36 +2618,32 @@ var VariableTagWidget = class extends import_view4.WidgetType {
|
|
|
2560
2618
|
this.keyPath = keyPath;
|
|
2561
2619
|
this.scope = scope;
|
|
2562
2620
|
}
|
|
2563
|
-
renderReact(jsx) {
|
|
2564
|
-
import_react_dom.default.render(jsx, this.rootDOM);
|
|
2565
|
-
}
|
|
2566
2621
|
renderVariable(v) {
|
|
2567
2622
|
if (!v) {
|
|
2568
|
-
this.
|
|
2623
|
+
this.root.render(
|
|
2569
2624
|
/* @__PURE__ */ import_react39.default.createElement(UITag2, { prefixIcon: /* @__PURE__ */ import_react39.default.createElement(import_semi_icons7.IconIssueStroked, null), color: "amber" }, "Unknown")
|
|
2570
2625
|
);
|
|
2571
2626
|
return;
|
|
2572
2627
|
}
|
|
2573
|
-
const rootField = (0, import_lodash5.last)(v.parentFields)
|
|
2574
|
-
const
|
|
2575
|
-
const rootTitle = /* @__PURE__ */ import_react39.default.createElement(UIRootTitle2, null, rootField?.meta.title ? `${rootField.meta.title} ${isRoot ? "" : "-"} ` : "");
|
|
2628
|
+
const rootField = (0, import_lodash5.last)(v.parentFields);
|
|
2629
|
+
const rootTitle = /* @__PURE__ */ import_react39.default.createElement(UIRootTitle2, null, rootField?.meta.title ? `${rootField.meta.title} -` : "");
|
|
2576
2630
|
const rootIcon = this.renderIcon(rootField?.meta.icon);
|
|
2577
|
-
this.
|
|
2631
|
+
this.root.render(
|
|
2578
2632
|
/* @__PURE__ */ import_react39.default.createElement(
|
|
2579
2633
|
import_semi_ui17.Popover,
|
|
2580
2634
|
{
|
|
2581
2635
|
content: /* @__PURE__ */ import_react39.default.createElement(UIPopoverContent2, null, rootIcon, rootTitle, /* @__PURE__ */ import_react39.default.createElement(UIVarName2, null, v?.keyPath.slice(1).join(".")))
|
|
2582
2636
|
},
|
|
2583
|
-
/* @__PURE__ */ import_react39.default.createElement(UITag2, { prefixIcon: rootIcon }, rootTitle,
|
|
2637
|
+
/* @__PURE__ */ import_react39.default.createElement(UITag2, { prefixIcon: rootIcon }, rootTitle, /* @__PURE__ */ import_react39.default.createElement(UIVarName2, null, v?.key))
|
|
2584
2638
|
)
|
|
2585
2639
|
);
|
|
2586
2640
|
}
|
|
2587
2641
|
toDOM(view) {
|
|
2588
2642
|
const dom = document.createElement("span");
|
|
2589
|
-
this.
|
|
2643
|
+
this.root = polyfillCreateRoot(dom);
|
|
2590
2644
|
this.toDispose.push(
|
|
2591
2645
|
import_editor23.Disposable.create(() => {
|
|
2592
|
-
|
|
2646
|
+
this.root.unmount();
|
|
2593
2647
|
})
|
|
2594
2648
|
);
|
|
2595
2649
|
this.toDispose.push(
|
|
@@ -2866,7 +2920,6 @@ function VariableTree2() {
|
|
|
2866
2920
|
|
|
2867
2921
|
// src/components/json-editor-with-variables/extensions/variable-tag.tsx
|
|
2868
2922
|
var import_react48 = __toESM(require("react"));
|
|
2869
|
-
var import_client = require("react-dom/client");
|
|
2870
2923
|
var import_lodash7 = require("lodash");
|
|
2871
2924
|
var import_editor25 = require("@flowgram.ai/editor");
|
|
2872
2925
|
var import_semi_ui22 = require("@douyinfe/semi-ui");
|
|
@@ -2947,7 +3000,7 @@ var VariableTagWidget2 = class extends import_view5.WidgetType {
|
|
|
2947
3000
|
}
|
|
2948
3001
|
toDOM(view) {
|
|
2949
3002
|
const dom = document.createElement("span");
|
|
2950
|
-
this.root = (
|
|
3003
|
+
this.root = polyfillCreateRoot(dom);
|
|
2951
3004
|
this.toDispose.push(
|
|
2952
3005
|
import_editor25.Disposable.create(() => {
|
|
2953
3006
|
this.root.unmount();
|
|
@@ -4276,10 +4329,12 @@ function validateFlowValue(value, ctx) {
|
|
|
4276
4329
|
listenRefSchemaChange,
|
|
4277
4330
|
listenRefValueChange,
|
|
4278
4331
|
parseTypeSelectValue,
|
|
4332
|
+
polyfillCreateRoot,
|
|
4279
4333
|
provideBatchInputEffect,
|
|
4280
4334
|
provideBatchOutputsEffect,
|
|
4281
4335
|
provideJsonSchemaOutputs,
|
|
4282
4336
|
syncVariableTitle,
|
|
4337
|
+
unstableSetCreateRoot,
|
|
4283
4338
|
useObjectList,
|
|
4284
4339
|
useTypeManager,
|
|
4285
4340
|
useVariableTree,
|