app-v3-scripts-editor 1.22.2 → 1.22.3

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.
Files changed (33) hide show
  1. package/dist/app-v3-scripts-editor.css +1 -1
  2. package/dist/app-v3-scripts-editor.es.js +65742 -47030
  3. package/dist/app-v3-scripts-editor.umd.js +311 -164
  4. package/dist/src/lib/components/Blocks/AIAgent/types.d.ts +2 -7
  5. package/dist/src/lib/components/Blocks/Notification/types.d.ts +1 -4
  6. package/dist/src/lib/components/Blocks/Schedule/types.d.ts +3 -7
  7. package/dist/src/lib/components/Shared/GroupCondition/ConditionPropertySelect.d.ts +1 -0
  8. package/dist/src/lib/components/Shared/NodeActionButton/index.d.ts +2 -0
  9. package/dist/src/lib/components/Shared/NodeOrderNumber/index.css.d.ts +1 -0
  10. package/dist/src/lib/components/Shared/NodeOrderNumber/index.d.ts +7 -0
  11. package/dist/src/lib/components/Shared/SuggestVariableNode/dropdownTypeList.d.ts +26 -0
  12. package/dist/src/lib/components/Shared/SuggestVariableNode/flatten.d.ts +1 -1
  13. package/dist/src/lib/components/Shared/SuggestVariableNode/index.css.d.ts +4 -0
  14. package/dist/src/lib/components/Shared/SuggestVariableNode/index.d.ts +1 -2
  15. package/dist/src/lib/components/Shared/SuggestVariableNode/type.d.ts +18 -1
  16. package/dist/src/lib/components/Shared/SuggestVariableNode/utils.d.ts +6 -0
  17. package/dist/src/lib/components/Shared/Tiptap/index.css.d.ts +4 -0
  18. package/dist/src/lib/components/Shared/Tiptap/index.d.ts +2 -0
  19. package/dist/src/lib/components/Shared/Tiptap/use-variable-suggest-tiptap.d.ts +15 -0
  20. package/dist/src/lib/components/Shared/Tiptap/variable-extension.d.ts +2 -0
  21. package/dist/src/lib/components/Shared/Tiptap/variableNodeView.d.ts +2 -0
  22. package/dist/src/lib/components/Shared/VariableTag/index.css.d.ts +1 -0
  23. package/dist/src/lib/components/Shared/VariableTag/index.d.ts +11 -0
  24. package/dist/src/lib/constants/block-types.d.ts +4 -0
  25. package/dist/src/lib/constants/common.d.ts +2 -0
  26. package/dist/src/lib/hooks/use-get-variable-tip-tap-editor/index.d.ts +3 -0
  27. package/dist/src/lib/hooks/use-up-stream-node/index.d.ts +5 -1
  28. package/dist/src/lib/hooks/use-variable-suggest/index.d.ts +5 -4
  29. package/dist/src/lib/provider/node-base/index.d.ts +11 -0
  30. package/dist/src/lib/provider/variable-suggest-checkbox/CheckboxItems.d.ts +9 -0
  31. package/dist/src/lib/provider/variable-suggest-checkbox/CheckedMapContext.d.ts +10 -0
  32. package/dist/src/services/types.d.ts +6 -1
  33. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { Node, NodeProps } from '@xyflow/react';
2
+ import { INodeBaseType } from '../../../../services';
2
3
  import { BlockTypeProps } from '../../../constants';
3
4
  export declare enum AI_AGENT_ACTION_TYPE {
4
5
  AI_AGENT = "AI_AGENT"
@@ -10,7 +11,7 @@ export declare const AIAgentTypeDescription: {
10
11
  AI_AGENT: string;
11
12
  };
12
13
  export declare const AIAgentTypeList: AI_AGENT_ACTION_TYPE[];
13
- export interface AIAgentNodeData extends Record<string, unknown> {
14
+ export interface AIAgentNodeData extends INodeBaseType, Record<string, unknown> {
14
15
  title: string;
15
16
  type: AI_AGENT_ACTION_TYPE;
16
17
  model?: string;
@@ -20,12 +21,6 @@ export interface AIAgentNodeData extends Record<string, unknown> {
20
21
  remember_recent?: number;
21
22
  knowledge?: boolean;
22
23
  output_format?: boolean;
23
- output?: {
24
- object: string;
25
- name: string;
26
- slug: string;
27
- type: string;
28
- }[];
29
24
  tool?: boolean;
30
25
  tool_list?: {
31
26
  name: string;
@@ -2,16 +2,13 @@ import { Node, NodeProps } from '@xyflow/react';
2
2
  import { INodeBaseType } from '../../../../services';
3
3
  import { BlockTypeProps } from '../../../constants';
4
4
  export declare enum NOTIFICATION_ACTION_TYPE {
5
- SEND_IN_APP_WEB = "SEND_IN_APP_WEB",
6
- TELEGRAM = "TELEGRAM"
5
+ SEND_IN_APP_WEB = "SEND_IN_APP_WEB"
7
6
  }
8
7
  export declare const NotificationTypeLabel: {
9
8
  SEND_IN_APP_WEB: string;
10
- TELEGRAM: string;
11
9
  };
12
10
  export declare const NotificationTypeDescription: {
13
11
  SEND_IN_APP_WEB: string;
14
- TELEGRAM: string;
15
12
  };
16
13
  export declare const NotificationTypeList: NOTIFICATION_ACTION_TYPE[];
17
14
  export interface NotificationNodeData extends INodeBaseType, Record<string, unknown> {
@@ -1,6 +1,7 @@
1
1
  import { Node, NodeProps } from '@xyflow/react';
2
- import { BlockTypeProps } from '../../../constants';
3
2
  import { default as dayjs } from 'dayjs';
3
+ import { INodeBaseType } from '../../../../services';
4
+ import { BlockTypeProps } from '../../../constants';
4
5
  export declare enum SCHEDULE_ACTION_TYPE {
5
6
  DAILY = "DAILY",
6
7
  WEEKLY = "WEEKLY",
@@ -70,7 +71,7 @@ export declare const IntervalUnitsLabel: {
70
71
  DAY: string;
71
72
  };
72
73
  export declare const IntervalUnitsList: INTERVAL_UNITS[];
73
- export interface ScheduleNodeData extends Record<string, unknown> {
74
+ export interface ScheduleNodeData extends INodeBaseType, Record<string, unknown> {
74
75
  title: string;
75
76
  type: SCHEDULE_ACTION_TYPE;
76
77
  config: {
@@ -85,11 +86,6 @@ export interface ScheduleNodeData extends Record<string, unknown> {
85
86
  validity_type: SCHEDULE_VALIDITY_TYPE;
86
87
  validity_end_date?: string | dayjs.Dayjs;
87
88
  };
88
- output: {
89
- object: string;
90
- slug: string;
91
- type: string;
92
- }[];
93
89
  }
94
90
  export type BlockScheduleProps = BlockTypeProps<ScheduleNodeData>;
95
91
  export type ScheduleNodeProps = NodeProps<Node<ScheduleNodeData>>;
@@ -4,6 +4,7 @@ interface Props {
4
4
  idOptionValue?: string;
5
5
  formItemName: (string | number)[];
6
6
  parentName?: string;
7
+ remove: (index: number | number[]) => void;
7
8
  }
8
9
  declare const ConditionPropertySelect: React.FC<Props>;
9
10
  export default ConditionPropertySelect;
@@ -1,6 +1,8 @@
1
1
  import { default as React } from 'react';
2
+ import { INodeBaseType } from '../../../../services';
2
3
  type NodeActionButtonContainerProps = {
3
4
  id: string;
5
+ data: INodeBaseType & Record<string, unknown>;
4
6
  };
5
7
  declare const NodeActionButtonContainer: React.FC<NodeActionButtonContainerProps>;
6
8
  export default NodeActionButtonContainer;
@@ -0,0 +1 @@
1
+ export declare const orderWrapperStyle: string;
@@ -0,0 +1,7 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+ type NodeOrderNumberContainerProps = {
3
+ order?: number;
4
+ style?: CSSProperties;
5
+ };
6
+ declare const NodeOrderNumberContainer: React.FC<NodeOrderNumberContainerProps>;
7
+ export default NodeOrderNumberContainer;
@@ -0,0 +1,26 @@
1
+ import { VariableGroupOption } from './type';
2
+ export declare const DropdownTypeList: (opt: VariableGroupOption) => {
3
+ key: string;
4
+ popupClassName: string;
5
+ label: import("react/jsx-runtime").JSX.Element;
6
+ children: ({
7
+ key: string;
8
+ label: import("react/jsx-runtime").JSX.Element;
9
+ children: {
10
+ key: string;
11
+ selectable: boolean;
12
+ label: import("react/jsx-runtime").JSX.Element;
13
+ }[];
14
+ popupClassName?: undefined;
15
+ } | {
16
+ key: string;
17
+ label: import("react/jsx-runtime").JSX.Element;
18
+ children: import('antd/es/menu/interface').ItemType[];
19
+ popupClassName: string;
20
+ } | {
21
+ key: string;
22
+ label: import("react/jsx-runtime").JSX.Element;
23
+ children?: undefined;
24
+ popupClassName?: undefined;
25
+ })[];
26
+ };
@@ -1,3 +1,3 @@
1
1
  import { IOutput } from '../../../../services';
2
2
  import { VariableAutoCompleteOption } from './type';
3
- export declare function buildVariableAutoCompleteOptions(nodes: IOutput["outputs"], parentObject?: string, parentPath?: string[]): VariableAutoCompleteOption[];
3
+ export declare function buildVariableAutoCompleteOptions(nodes: IOutput["outputs"]): VariableAutoCompleteOption[];
@@ -0,0 +1,4 @@
1
+ export declare const AutoCompleteStyled: string;
2
+ export declare const MenuStyled: string;
3
+ export declare const labelTextStyle: string;
4
+ export declare const slugLabelStyle: string;
@@ -1,4 +1,3 @@
1
1
  import { AutoCompleteProps } from 'antd';
2
2
  import { UseVariableSuggestOptions } from './type';
3
- declare const SuggestVariableNodeContainer: (props: UseVariableSuggestOptions & AutoCompleteProps) => import("react/jsx-runtime").JSX.Element;
4
- export default SuggestVariableNodeContainer;
3
+ export default function SuggestVariableNodeWithProvider(props: UseVariableSuggestOptions & AutoCompleteProps): import("react/jsx-runtime").JSX.Element;
@@ -1,25 +1,42 @@
1
- import { DATA_TYPE_PROPERTY } from '../../../constants/common';
1
+ import { BlockType } from '../../../constants';
2
+ import { DATA_TYPE_PROPERTY, OUTPUT_MODE } from '../../../constants/common';
2
3
  export interface VariableLeaf {
3
4
  object: string;
5
+ objectLabel?: string;
4
6
  type: DATA_TYPE_PROPERTY;
5
7
  slug: string;
6
8
  name?: string;
7
9
  fullPath: string;
8
10
  value: string;
11
+ order?: number;
12
+ node_type?: BlockType;
13
+ mode?: (typeof OUTPUT_MODE)[number];
9
14
  }
10
15
  export interface VariableOption {
11
16
  value: string;
12
17
  data: VariableLeaf;
13
18
  }
14
19
  export interface UseVariableSuggestOptions {
20
+ value?: string;
21
+ onChange?: (value: string) => void;
15
22
  isCheckPrefix?: boolean;
23
+ filterTypes?: DATA_TYPE_PROPERTY[];
24
+ placeholder?: string;
25
+ rows?: number;
26
+ onMultiSelect?: (value: string[]) => void;
16
27
  }
17
28
  export interface VariableGroupOption {
18
29
  label: string;
30
+ type: string;
31
+ node_type?: BlockType;
32
+ order?: number;
19
33
  options: VariableLeafOption[];
34
+ output_mode?: string[];
35
+ value?: string;
20
36
  }
21
37
  export interface VariableLeafOption {
22
38
  value: string;
23
39
  data: VariableLeaf;
40
+ output_mode?: string[];
24
41
  }
25
42
  export type VariableAutoCompleteOption = VariableGroupOption | VariableLeafOption;
@@ -0,0 +1,6 @@
1
+ import { MenuProps } from 'antd';
2
+ import { DATA_TYPE_PROPERTY } from '../../../constants/common';
3
+ import { VariableAutoCompleteOption, VariableLeafOption } from './type';
4
+ export declare function filterOptionTree(opt: VariableAutoCompleteOption, filterTypes?: DATA_TYPE_PROPERTY[]): VariableAutoCompleteOption | null;
5
+ export declare const buildMenuItem: (opt: VariableAutoCompleteOption, parentKey?: string) => MenuProps["items"][number];
6
+ export declare function collectLeafOptions(opt: VariableAutoCompleteOption, map: Map<string, VariableLeafOption>): void;
@@ -0,0 +1,4 @@
1
+ export declare const editorWrapper: string;
2
+ export declare const WrapperStyled: string;
3
+ export declare const MenuStyled: string;
4
+ export declare const tiptap: string;
@@ -0,0 +1,2 @@
1
+ import { UseVariableSuggestOptions } from '../SuggestVariableNode/type';
2
+ export default function SuggestVariableEditorWithProvider(props: UseVariableSuggestOptions): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { SuggestionKeyDownProps } from '@tiptap/suggestion';
2
+ import { VariableAutoCompleteOption } from '../SuggestVariableNode/type';
3
+ export interface TiptapSuggestionState {
4
+ items: VariableAutoCompleteOption[];
5
+ clientRect: (() => DOMRect) | null;
6
+ command: ((item: VariableAutoCompleteOption) => void) | null;
7
+ query: string;
8
+ }
9
+ export declare const tiptapSuggestionBridge: {
10
+ notify: (state: TiptapSuggestionState | null, editorId: string) => void;
11
+ setKeyDownHandler: (editorId: string, fn: (props: SuggestionKeyDownProps) => boolean) => void;
12
+ handleKeyDown: (props: SuggestionKeyDownProps, editorId: string) => boolean;
13
+ remove: (editorId: string) => void;
14
+ };
15
+ export declare function useTiptapVariableSuggest(editorId: string): TiptapSuggestionState;
@@ -0,0 +1,2 @@
1
+ import { Node } from '@tiptap/core';
2
+ export declare const Variable: Node<any, any>;
@@ -0,0 +1,2 @@
1
+ import { ReactNodeViewProps } from '@tiptap/react';
2
+ export declare function VariableNodeView({ node, deleteNode }: ReactNodeViewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { TagProps } from 'antd';
2
+ import { VariableLeaf } from '../SuggestVariableNode/type';
3
+ interface VariableTagProps {
4
+ data: VariableLeaf;
5
+ onClose?: () => void;
6
+ closable?: boolean;
7
+ }
8
+ export declare function VariableTag({ data, showTooltip, ...p }: VariableTagProps & TagProps & {
9
+ showTooltip?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -1,3 +1,5 @@
1
+ import { AntdIconProps } from '@ant-design/icons/lib/components/AntdIcon';
2
+ import { IconProps } from 'iconsax-reactjs';
1
3
  export declare enum BlockType {
2
4
  AGENT = "AGENT",
3
5
  START = "START",
@@ -41,3 +43,5 @@ export interface BlockTypeProps<T> {
41
43
  mini?: boolean;
42
44
  group?: boolean;
43
45
  }
46
+ export declare const BlockTypeLabels: Record<BlockType, string>;
47
+ export declare const BlockTypeIcons: Record<BlockType, React.ComponentType<IconProps | Omit<AntdIconProps, "ref">>>;
@@ -148,3 +148,5 @@ export declare const CAMPAIGN_TYPE_NAME: Record<string, string>;
148
148
  export declare const DATE_FORMAT_BY_OPERATOR: Record<string, string>;
149
149
  export declare const iconPropertyMap: Record<DATA_TYPE_PROPERTY | string, any>;
150
150
  export declare const operatorMap: Record<string, string>;
151
+ export declare const OUTPUT_MODE: string[];
152
+ export declare const OutputModeLabel: Record<(typeof OUTPUT_MODE)[number], string>;
@@ -0,0 +1,3 @@
1
+ import { Editor } from '@tiptap/core';
2
+ declare const useGetVariablesTipTapEditor: (editor: Editor) => string[];
3
+ export default useGetVariablesTipTapEditor;
@@ -1,2 +1,6 @@
1
- declare const useUpstreamNodes: (nodeId?: string) => any[];
1
+ import { VariableLeafOption } from '../../components/Shared/SuggestVariableNode/type';
2
+ declare const useUpstreamNodes: (nodeId?: string) => {
3
+ optionsData: import('../../components/Shared/SuggestVariableNode/type').VariableAutoCompleteOption[];
4
+ optionMap: Map<string, VariableLeafOption>;
5
+ };
2
6
  export default useUpstreamNodes;
@@ -1,9 +1,9 @@
1
1
  import { AutoCompleteProps } from 'antd';
2
- import { UseVariableSuggestOptions } from '../../components/Shared/SuggestVariableNode/type';
3
- export declare function useVariableSuggest(upstreamNodes: any[], options?: UseVariableSuggestOptions & AutoCompleteProps): {
2
+ import { UseVariableSuggestOptions, VariableAutoCompleteOption } from '../../components/Shared/SuggestVariableNode/type';
3
+ export declare function useVariableSuggest(optionsData: VariableAutoCompleteOption[], options?: UseVariableSuggestOptions & AutoCompleteProps): {
4
4
  value: any;
5
5
  open: boolean;
6
- options: import('../../components/Shared/SuggestVariableNode/type').VariableAutoCompleteOption[];
6
+ options: VariableAutoCompleteOption[];
7
7
  bindInput: {
8
8
  ref: import('react').RefObject<HTMLInputElement>;
9
9
  value: any;
@@ -11,7 +11,8 @@ export declare function useVariableSuggest(upstreamNodes: any[], options?: UseVa
11
11
  onClick: (e: any) => void;
12
12
  status: "" | "warning" | "error";
13
13
  onFocus: () => void;
14
- onBlurCapture: () => void;
15
14
  };
16
15
  onSelect: (text: string, option: any) => void;
16
+ setOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
17
+ updateValue: (next: string) => void;
17
18
  };
@@ -0,0 +1,11 @@
1
+ interface NodeBaseContextValue {
2
+ isHovered: boolean;
3
+ setIsHovered: React.Dispatch<React.SetStateAction<boolean>>;
4
+ isPopupDeleteOpen: boolean;
5
+ setIsPopupDeleteOption: React.Dispatch<React.SetStateAction<boolean>>;
6
+ }
7
+ export declare const NodeBaseProvider: ({ children, }: {
8
+ children: React.ReactNode;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const useNodeBase: () => NodeBaseContextValue;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const CheckAllCheckbox: ({ groupKey, allKeys, }: {
2
+ groupKey: string;
3
+ allKeys: string[];
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const CheckboxItem: ({ groupKey, uniqueKey, label, }: {
6
+ groupKey: string;
7
+ uniqueKey: string;
8
+ label: string;
9
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ interface CheckedMapContextValue {
2
+ checkedMap: Record<string, string[]>;
3
+ updateChecked: (groupKey: string, fn: (prev: string[]) => string[]) => void;
4
+ getCheckedKeys: (groupKey: string) => string[];
5
+ }
6
+ export declare const VariableSuggestCheckedProvider: ({ children, }: {
7
+ children: React.ReactNode;
8
+ }) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const useCheckedMap: () => CheckedMapContextValue;
10
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { Dayjs } from 'dayjs';
2
+ import { BlockType } from '../lib';
2
3
  import { AI_MODEL } from '../lib/constants/ai-model';
3
4
  import { DATA_TYPE_PROPERTY, DATA_TYPE_PROPERTY_V2 } from '../lib/constants/common';
4
5
  import { NODE_STATUS } from './../lib/constants/common';
@@ -11,6 +12,7 @@ export interface INodeBaseType {
11
12
  input_data?: Record<string, any>;
12
13
  output_data?: Record<string, any>;
13
14
  status?: NODE_STATUS;
15
+ order?: number;
14
16
  }
15
17
  export interface IPaginationInputs {
16
18
  pagination?: {
@@ -265,8 +267,11 @@ export interface IOutput {
265
267
  options: IOptionValue[];
266
268
  structure?: IOutput["outputs"];
267
269
  object?: string;
270
+ node_type?: BlockType;
271
+ order?: number;
272
+ output_mode?: string[];
268
273
  }[];
269
- unknown_types?: [];
274
+ output_mode?: string[];
270
275
  }
271
276
  export type IListTypeInputOption = {
272
277
  value?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "app-v3-scripts-editor",
3
3
  "private": false,
4
- "version": "1.22.2",
4
+ "version": "1.22.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ucall-asia/app-v3-scripts-editor.git"