app-v3-scripts-editor 1.2.4 → 1.3.1

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 (74) hide show
  1. package/dist/app-v3-scripts-editor.css +1 -1
  2. package/dist/app-v3-scripts-editor.es.js +59765 -33788
  3. package/dist/app-v3-scripts-editor.umd.js +197 -145
  4. package/dist/index.d.ts +2 -2
  5. package/dist/lib/components/Blocks/Listen/block.d.ts +3 -0
  6. package/dist/lib/components/Blocks/Listen/components/DraggableItem.d.ts +5 -0
  7. package/dist/lib/components/Blocks/Listen/components/DraggableList.d.ts +10 -0
  8. package/dist/lib/components/Blocks/Listen/components/index.css.d.ts +12 -0
  9. package/dist/lib/components/Blocks/Listen/index.css.d.ts +7 -0
  10. package/dist/lib/components/Blocks/Listen/index.settings.d.ts +4 -0
  11. package/dist/lib/components/Blocks/Listen/node.d.ts +3 -0
  12. package/dist/lib/components/Blocks/Listen/settings/AddConditionButton.d.ts +2 -0
  13. package/dist/lib/components/Blocks/Listen/settings/ListenIntent.d.ts +8 -0
  14. package/dist/lib/components/Blocks/Listen/settings/ListenIntentDropdown.d.ts +6 -0
  15. package/dist/lib/components/Blocks/Listen/types.d.ts +19 -0
  16. package/dist/lib/components/Blocks/Speak/block.d.ts +3 -0
  17. package/dist/{components → lib/components}/Blocks/Speak/index.css.d.ts +1 -0
  18. package/dist/lib/components/Blocks/Speak/settings/AudioPlayback.d.ts +8 -0
  19. package/dist/lib/components/Blocks/Speak/settings/PersonalizeTranscriptField.d.ts +7 -0
  20. package/dist/lib/components/Blocks/Speak/settings/UploadAudioButton.d.ts +8 -0
  21. package/dist/{components → lib/components}/Blocks/Speak/types.d.ts +2 -5
  22. package/dist/lib/components/Blocks/Start/block.d.ts +4 -0
  23. package/dist/{components → lib/components}/Blocks/Start/index.css.d.ts +2 -0
  24. package/dist/{components → lib/components}/Blocks/Start/node.d.ts +3 -2
  25. package/dist/lib/components/Scripts/index.d.ts +2 -0
  26. package/dist/{components → lib/components}/Scripts/scripts.css.d.ts +0 -1
  27. package/dist/lib/components/Shared/AudioRecorder/AudioVisualizer.d.ts +7 -0
  28. package/dist/lib/components/Shared/AudioRecorder/index.d.ts +6 -0
  29. package/dist/lib/components/Shared/BlockRelationship/index.d.ts +5 -0
  30. package/dist/lib/components/Shared/NodeBase/index.d.ts +4 -0
  31. package/dist/{constants → lib/constants}/block-types.d.ts +5 -0
  32. package/dist/{constants → lib/constants}/initial-script.d.ts +20 -0
  33. package/dist/lib/constants/intents.d.ts +26 -0
  34. package/dist/{constants → lib/constants}/node-types.d.ts +2 -0
  35. package/dist/lib/index.d.ts +2 -0
  36. package/dist/lib/provider/instance-context/index.d.ts +18 -0
  37. package/dist/{provider → lib/provider}/settings-modal-provider/components/SettingsModal/index.css.d.ts +0 -1
  38. package/dist/{styles → lib/styles}/colors.d.ts +6 -1
  39. package/dist/services/client.d.ts +2 -0
  40. package/dist/services/upload-audio/useUploadAudio.d.ts +5 -0
  41. package/package.json +1 -1
  42. package/dist/components/Blocks/Listen/block.d.ts +0 -2
  43. package/dist/components/Blocks/Listen/node.d.ts +0 -9
  44. package/dist/components/Blocks/Speak/block.d.ts +0 -3
  45. package/dist/components/Blocks/Start/block.d.ts +0 -2
  46. package/dist/components/Scripts/index.d.ts +0 -1
  47. /package/dist/{components → lib/components}/Blocks/Listen/index.d.ts +0 -0
  48. /package/dist/{components → lib/components}/Blocks/Speak/index.d.ts +0 -0
  49. /package/dist/{components → lib/components}/Blocks/Speak/index.settings.d.ts +0 -0
  50. /package/dist/{components → lib/components}/Blocks/Speak/node.d.ts +0 -0
  51. /package/dist/{components → lib/components}/Blocks/Speak/settings/MachineFields.d.ts +0 -0
  52. /package/dist/{components → lib/components}/Blocks/Speak/settings/PromptFields.d.ts +0 -0
  53. /package/dist/{components → lib/components}/Blocks/Speak/settings/RecordFields.d.ts +0 -0
  54. /package/dist/{components → lib/components}/Blocks/Speak/settings/index.css.d.ts +0 -0
  55. /package/dist/{components → lib/components}/Blocks/Speak/use-alerts/index.d.ts +0 -0
  56. /package/dist/{components → lib/components}/Blocks/Start/index.d.ts +0 -0
  57. /package/dist/{components → lib/components}/Scripts/types.d.ts +0 -0
  58. /package/dist/{components → lib/components}/Shared/ConfirmDeleteButton/index.d.ts +0 -0
  59. /package/dist/{components → lib/components}/Shared/EditBlockTitleButton/index.d.ts +0 -0
  60. /package/dist/{components → lib/components}/Sidebar/index.d.ts +0 -0
  61. /package/dist/{components → lib/components}/Sidebar/sidebar.css.d.ts +0 -0
  62. /package/dist/{components → lib/components}/index.d.ts +0 -0
  63. /package/dist/{constants → lib/constants}/index.d.ts +0 -0
  64. /package/dist/{constants → lib/constants}/sidebar-buttons.d.ts +0 -0
  65. /package/dist/{hooks → lib/hooks}/use-disclosure/index.d.ts +0 -0
  66. /package/dist/{hooks → lib/hooks}/use-selected-node/index.d.ts +0 -0
  67. /package/dist/{hooks → lib/hooks}/use-update-node/index.d.ts +0 -0
  68. /package/dist/{provider → lib/provider}/DnDContext.d.ts +0 -0
  69. /package/dist/{provider → lib/provider}/settings-modal-provider/components/SettingsModal/index.d.ts +0 -0
  70. /package/dist/{provider → lib/provider}/settings-modal-provider/index.css.d.ts +0 -0
  71. /package/dist/{provider → lib/provider}/settings-modal-provider/index.d.ts +0 -0
  72. /package/dist/{storybook-utils.d.ts → lib/storybook-utils.d.ts} +0 -0
  73. /package/dist/{styles → lib/styles}/borders.d.ts +0 -0
  74. /package/dist/{styles → lib/styles}/paddings.d.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './components';
2
- export * from './constants';
1
+ export * from './lib/index'
2
+ export {}
@@ -0,0 +1,3 @@
1
+ import { BlockListenProps } from './types';
2
+ declare const BlockListen: ({ id, data, mini }: BlockListenProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default BlockListen;
@@ -0,0 +1,5 @@
1
+ import { ListenCondition } from '../types';
2
+ declare const SortableItem: React.FC<{
3
+ item: ListenCondition;
4
+ }>;
5
+ export default SortableItem;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface DraggableItem {
3
+ id: string;
4
+ content: string;
5
+ }
6
+ export interface DraggableListProps {
7
+ NODE_ID: string;
8
+ }
9
+ declare const DraggableList: React.FC<DraggableListProps>;
10
+ export default DraggableList;
@@ -0,0 +1,12 @@
1
+ export declare const sortableItemContainer: string;
2
+ export declare const sortableItemContainerDragging: string;
3
+ export declare const draggableCard: string;
4
+ export declare const draggableCardDragging: string;
5
+ export declare const cardBody: string;
6
+ export declare const dragButton: string;
7
+ export declare const dragButtonHovered: string;
8
+ export declare const dragIcon: string;
9
+ export declare const itemText: string;
10
+ export declare const handle: string;
11
+ export declare const listCard: string;
12
+ export declare const listCardBody: string;
@@ -0,0 +1,7 @@
1
+ export declare const listenCard: string;
2
+ export declare const listenCardBody: string;
3
+ export declare const listenHeaderLeft: string;
4
+ export declare const listenHeader: string;
5
+ export declare const listenTitle: string;
6
+ export declare const listenContent: string;
7
+ export declare const listenText: string;
@@ -0,0 +1,4 @@
1
+ declare const ListenNodeSettings: ({ id }: {
2
+ id: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default ListenNodeSettings;
@@ -0,0 +1,3 @@
1
+ import { ListenNodeProps } from './types';
2
+ declare const ListenNode: React.FC<ListenNodeProps>;
3
+ export default ListenNode;
@@ -0,0 +1,2 @@
1
+ declare const AddConditionButton: () => import("react/jsx-runtime").JSX.Element;
2
+ export default AddConditionButton;
@@ -0,0 +1,8 @@
1
+ import { ListenCondition } from '../types';
2
+ interface ListenIntentProps {
3
+ field: any;
4
+ condition: ListenCondition;
5
+ onDelete: (conditionId: string) => void;
6
+ }
7
+ declare const ListenIntent: ({ field, condition, onDelete }: ListenIntentProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ListenIntent;
@@ -0,0 +1,6 @@
1
+ interface ListenIntentDropdownProps {
2
+ fieldName: number;
3
+ isConversion: boolean;
4
+ }
5
+ declare const ListenIntentDropdown: ({ fieldName, isConversion, }: ListenIntentDropdownProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default ListenIntentDropdown;
@@ -0,0 +1,19 @@
1
+ import { Node, NodeProps } from '@xyflow/react';
2
+ import { BlockTypeProps } from '../../../constants';
3
+ export interface ListenCondition {
4
+ id: string;
5
+ label: string;
6
+ description: string;
7
+ included_keywords: string[];
8
+ excluded_keywords: string[];
9
+ repeat_if_interrupted: boolean;
10
+ is_conversion: boolean;
11
+ }
12
+ export interface ListenNodeData extends Record<string, unknown> {
13
+ title?: string;
14
+ conditions?: ListenCondition[];
15
+ maximum_retry: number;
16
+ is_global_node: boolean;
17
+ }
18
+ export type BlockListenProps = BlockTypeProps<ListenNodeData>;
19
+ export type ListenNodeProps = NodeProps<Node<ListenNodeData>>;
@@ -0,0 +1,3 @@
1
+ import { BlockSpeakProps } from './types';
2
+ declare const BlockSpeak: ({ id, data, mini }: BlockSpeakProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default BlockSpeak;
@@ -1,4 +1,5 @@
1
1
  export declare const wrapper: string;
2
+ export declare const wrapperMini: string;
2
3
  export declare const container: string;
3
4
  export declare const headContainer: string;
4
5
  export declare const icon: string;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface AudioPlaybackProps {
3
+ url: string;
4
+ className?: string;
5
+ formPath?: string[][];
6
+ }
7
+ declare const AudioPlayback: React.FC<AudioPlaybackProps>;
8
+ export default AudioPlayback;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface PersonalizeTranscriptFieldProps {
3
+ placeholder?: string;
4
+ rows?: number;
5
+ }
6
+ declare const PersonalizeTranscriptField: React.FC<PersonalizeTranscriptFieldProps>;
7
+ export default PersonalizeTranscriptField;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface UploadAudioButtonProps {
3
+ onUploadSuccess?: (audioUrl: string, transcript: string) => void;
4
+ fieldName?: string;
5
+ disabled?: boolean;
6
+ }
7
+ declare const UploadAudioButton: React.FC<UploadAudioButtonProps>;
8
+ export default UploadAudioButton;
@@ -1,5 +1,5 @@
1
1
  import { Node, NodeProps } from '@xyflow/react';
2
- import { SPEAK_TYPE } from '../../../constants';
2
+ import { BlockTypeProps, SPEAK_TYPE } from '../../../constants';
3
3
  export interface SpeakNodeData extends Record<string, unknown> {
4
4
  title: string;
5
5
  type: SPEAK_TYPE;
@@ -19,8 +19,5 @@ export interface SpeakNodeData extends Record<string, unknown> {
19
19
  content: string;
20
20
  };
21
21
  }
22
- export interface BlockSpeakProps {
23
- id: string;
24
- data: SpeakNodeData;
25
- }
22
+ export type BlockSpeakProps = BlockTypeProps<SpeakNodeData>;
26
23
  export type SpeakNodeProps = NodeProps<Node<SpeakNodeData>>;
@@ -0,0 +1,4 @@
1
+ import { BlockTypeProps } from '../../../constants';
2
+ export type BlockStartProps = BlockTypeProps<{}>;
3
+ declare const BlockStart: ({ mini }: BlockStartProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default BlockStart;
@@ -1,4 +1,6 @@
1
1
  export declare const wrapper: string;
2
2
  export declare const container: string;
3
+ export declare const miniContainer: string;
3
4
  export declare const icon: string;
4
5
  export declare const text: string;
6
+ export declare const textMini: string;
@@ -1,9 +1,10 @@
1
+ import { BlockTypeProps } from '../../../constants';
1
2
  export interface StartNodeData {
2
3
  label: string;
3
4
  blockType: string;
4
5
  }
5
- export interface StartNodeProps {
6
+ export type StartNodeProps = BlockTypeProps<{
6
7
  data: StartNodeData;
7
- }
8
+ }>;
8
9
  declare const StartNode: React.FC<StartNodeProps>;
9
10
  export default StartNode;
@@ -0,0 +1,2 @@
1
+ import { InstanceScriptEditorProps } from '../../provider/instance-context';
2
+ export declare const ScriptEditor: (instanceProps: InstanceScriptEditorProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,5 +2,4 @@ export declare const container: string;
2
2
  export declare const layout: string;
3
3
  export declare const content: string;
4
4
  export declare const reactFlowContainer: string;
5
- export declare const sidebar: string;
6
5
  export declare const sidebarContainer: string;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface AudioVisualizerProps {
3
+ audioStream: MediaStream | null;
4
+ isRecording: boolean;
5
+ }
6
+ declare const AudioVisualizer: React.FC<AudioVisualizerProps>;
7
+ export default AudioVisualizer;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface AudioRecorderProps {
3
+ onFinishRecord?: (audioUrl: string, transcript?: string) => void;
4
+ }
5
+ declare const AudioRecorder: React.FC<AudioRecorderProps>;
6
+ export default AudioRecorder;
@@ -0,0 +1,5 @@
1
+ interface BlockRelationshipProps {
2
+ id: string;
3
+ }
4
+ declare const BlockRelationship: ({ id }: BlockRelationshipProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default BlockRelationship;
@@ -0,0 +1,4 @@
1
+ declare const NodeBase: ({ children }: {
2
+ children: React.ReactNode;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default NodeBase;
@@ -15,3 +15,8 @@ export declare enum SPEAK_TYPE {
15
15
  MACHINE = "MACHINE",
16
16
  PROMPT = "PROMPT"
17
17
  }
18
+ export interface BlockTypeProps<T> {
19
+ id: string;
20
+ data: T;
21
+ mini?: boolean;
22
+ }
@@ -2,6 +2,7 @@ import { BlockType, SPEAK_TYPE } from './block-types';
2
2
  export declare const initialTitles: {
3
3
  SPEAK: string;
4
4
  START: string;
5
+ LISTEN: string;
5
6
  };
6
7
  export declare const initialData: {
7
8
  START: {};
@@ -15,10 +16,24 @@ export declare const initialData: {
15
16
  female_record: any;
16
17
  transcript_original: any;
17
18
  transcript_personalize: any;
19
+ personalize: boolean;
18
20
  };
19
21
  machine: {};
20
22
  prompt: {};
21
23
  };
24
+ LISTEN: {
25
+ conditions: {
26
+ id: string;
27
+ label: string;
28
+ description: string;
29
+ included_keywords: any[];
30
+ excluded_keywords: any[];
31
+ repeat_if_interrupted: boolean;
32
+ is_conversion: boolean;
33
+ }[];
34
+ maximum_retry: number;
35
+ is_global_node: boolean;
36
+ };
22
37
  };
23
38
  export declare const initialNodes: {
24
39
  id: string;
@@ -33,3 +48,8 @@ export declare const initialNodes: {
33
48
  deletable: boolean;
34
49
  }[];
35
50
  export declare const initialEdges: any[];
51
+ export declare const initialNodeProps: {
52
+ LISTEN: {
53
+ dragHandle: string;
54
+ };
55
+ };
@@ -0,0 +1,26 @@
1
+ export declare const INTENTS: {
2
+ INTERESTED: {
3
+ label: string;
4
+ description: string;
5
+ included_keywords: string[];
6
+ excluded_keywords: string[];
7
+ };
8
+ NOT_INTERESTED: {
9
+ label: string;
10
+ description: string;
11
+ included_keywords: string[];
12
+ excluded_keywords: any[];
13
+ };
14
+ NOT_HEARD: {
15
+ label: string;
16
+ description: string;
17
+ included_keywords: string[];
18
+ excluded_keywords: any[];
19
+ };
20
+ BUSY: {
21
+ label: string;
22
+ description: string;
23
+ included_keywords: string[];
24
+ excluded_keywords: any[];
25
+ };
26
+ };
@@ -1,5 +1,7 @@
1
1
  export declare const nodeTypes: {
2
2
  SPEAK: import('react').FC<import('../components/Blocks/Speak/types').SpeakNodeProps>;
3
3
  START: import('react').FC<import('../components/Blocks/Start/node').StartNodeProps>;
4
+ LISTEN: import('react').FC<import('../components/Blocks/Listen/types').ListenNodeProps>;
4
5
  };
6
+ export declare const getNodeColor: (node: any) => string;
5
7
  export default nodeTypes;
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ export * from './constants';
@@ -0,0 +1,18 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { default as React, ReactNode } from 'react';
3
+ interface InstanceContextProps {
4
+ axiosInstance: AxiosInstance;
5
+ speechApiAxiosInstance: AxiosInstance;
6
+ }
7
+ export interface InstanceScriptEditorProps {
8
+ BASE_URL: string;
9
+ AUTHORIZATION_HEADER: string;
10
+ SPEECH_API_URL: string;
11
+ }
12
+ interface InstanceContextProviderProps extends InstanceScriptEditorProps {
13
+ children: ReactNode;
14
+ }
15
+ declare const InstanceContext: React.Context<InstanceContextProps>;
16
+ export declare const InstanceContextProvider: React.FC<InstanceContextProviderProps>;
17
+ export declare const useInstanceContext: () => InstanceContextProps;
18
+ export default InstanceContext;
@@ -1,4 +1,3 @@
1
- export declare const modalContainer: string;
2
1
  export declare const header: string;
3
2
  export declare const dragHandle: string;
4
3
  export declare const title: string;
@@ -2,6 +2,7 @@ declare const colors: {
2
2
  common: {
3
3
  red: string;
4
4
  white: string;
5
+ gray: string;
5
6
  };
6
7
  sidebar: {
7
8
  background: string;
@@ -15,9 +16,13 @@ declare const colors: {
15
16
  boxShadow: string;
16
17
  };
17
18
  listenBlock: {
19
+ focus: string;
18
20
  indicator: string;
21
+ background: string;
22
+ border: string;
19
23
  };
20
24
  icon: {
25
+ speak: string;
21
26
  listen: string;
22
27
  transferCall: string;
23
28
  getData: string;
@@ -25,7 +30,7 @@ declare const colors: {
25
30
  addData: string;
26
31
  httpRequest: string;
27
32
  condition: string;
28
- note: string;
33
+ assignVariable: string;
29
34
  };
30
35
  speakBlock: {
31
36
  background: string;
@@ -0,0 +1,2 @@
1
+ import { QueryClient } from '@tanstack/react-query';
2
+ export declare const queryClient: QueryClient;
@@ -0,0 +1,5 @@
1
+ interface UploadAudioParams {
2
+ audio: File;
3
+ }
4
+ declare const useUploadAudio: () => import('@tanstack/react-query').UseMutationResult<string, Error, UploadAudioParams, unknown>;
5
+ export default useUploadAudio;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "app-v3-scripts-editor",
3
3
  "private": false,
4
- "version": "1.2.4",
4
+ "version": "1.3.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ucall-asia/app-v3-scripts-editor.git"
@@ -1,2 +0,0 @@
1
- declare const BlockListen: () => import("react/jsx-runtime").JSX.Element;
2
- export default BlockListen;
@@ -1,9 +0,0 @@
1
- interface ListenNodeData {
2
- label: string;
3
- blockType: string;
4
- }
5
- interface ListenNodeProps {
6
- data: ListenNodeData;
7
- }
8
- declare const ListenNode: React.FC<ListenNodeProps>;
9
- export default ListenNode;
@@ -1,3 +0,0 @@
1
- import { BlockSpeakProps } from './types';
2
- declare const BlockSpeak: ({ id, data }: BlockSpeakProps) => import("react/jsx-runtime").JSX.Element;
3
- export default BlockSpeak;
@@ -1,2 +0,0 @@
1
- declare const BlockStart: () => import("react/jsx-runtime").JSX.Element;
2
- export default BlockStart;
@@ -1 +0,0 @@
1
- export declare const ScriptEditor: () => import("react/jsx-runtime").JSX.Element;
File without changes
File without changes
File without changes
File without changes
File without changes