app-v3-scripts-editor 1.2.3 → 1.2.6

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 (61) hide show
  1. package/dist/app-v3-scripts-editor.css +1 -1
  2. package/dist/app-v3-scripts-editor.es.js +42118 -27413
  3. package/dist/app-v3-scripts-editor.umd.js +158 -124
  4. package/dist/index.d.ts +2 -2
  5. package/dist/lib/components/Blocks/Speak/block.d.ts +3 -0
  6. package/dist/{components → lib/components}/Blocks/Speak/index.css.d.ts +1 -3
  7. package/dist/lib/components/Blocks/Speak/index.settings.d.ts +3 -0
  8. package/dist/lib/components/Blocks/Speak/node.d.ts +3 -0
  9. package/dist/lib/components/Blocks/Speak/settings/AudioPlayback.d.ts +8 -0
  10. package/dist/lib/components/Blocks/Speak/settings/UploadAudioButton.d.ts +8 -0
  11. package/dist/lib/components/Blocks/Speak/types.d.ts +26 -0
  12. package/dist/lib/components/Blocks/Speak/use-alerts/index.d.ts +6 -0
  13. package/dist/lib/components/Scripts/index.d.ts +2 -0
  14. package/dist/{components → lib/components}/Scripts/scripts.css.d.ts +0 -1
  15. package/dist/lib/components/Shared/AudioRecorder/AudioVisualizer.d.ts +7 -0
  16. package/dist/lib/components/Shared/AudioRecorder/index.d.ts +6 -0
  17. package/dist/lib/components/Shared/ConfirmDeleteButton/index.d.ts +7 -0
  18. package/dist/lib/components/Shared/EditBlockTitleButton/index.d.ts +7 -0
  19. package/dist/lib/constants/initial-script.d.ts +36 -0
  20. package/dist/{constants → lib/constants}/node-types.d.ts +1 -1
  21. package/dist/lib/hooks/use-selected-node/index.d.ts +7 -0
  22. package/dist/lib/hooks/use-update-node/index.d.ts +8 -0
  23. package/dist/lib/index.d.ts +2 -0
  24. package/dist/lib/provider/instance-context/index.d.ts +18 -0
  25. package/dist/{provider → lib/provider}/settings-modal-provider/components/SettingsModal/index.css.d.ts +0 -1
  26. package/dist/{styles → lib/styles}/colors.d.ts +5 -1
  27. package/dist/services/client.d.ts +2 -0
  28. package/dist/services/upload-audio/useUploadAudio.d.ts +5 -0
  29. package/package.json +1 -1
  30. package/dist/components/Blocks/Speak/block.d.ts +0 -9
  31. package/dist/components/Blocks/Speak/index.settings.d.ts +0 -1
  32. package/dist/components/Blocks/Speak/node.d.ts +0 -9
  33. package/dist/components/Scripts/index.d.ts +0 -1
  34. package/dist/constants/initial-script.d.ts +0 -15
  35. /package/dist/{components → lib/components}/Blocks/Listen/block.d.ts +0 -0
  36. /package/dist/{components → lib/components}/Blocks/Listen/index.d.ts +0 -0
  37. /package/dist/{components → lib/components}/Blocks/Listen/node.d.ts +0 -0
  38. /package/dist/{components → lib/components}/Blocks/Speak/index.d.ts +0 -0
  39. /package/dist/{components → lib/components}/Blocks/Speak/settings/MachineFields.d.ts +0 -0
  40. /package/dist/{components → lib/components}/Blocks/Speak/settings/PromptFields.d.ts +0 -0
  41. /package/dist/{components → lib/components}/Blocks/Speak/settings/RecordFields.d.ts +0 -0
  42. /package/dist/{components → lib/components}/Blocks/Speak/settings/index.css.d.ts +0 -0
  43. /package/dist/{components → lib/components}/Blocks/Start/block.d.ts +0 -0
  44. /package/dist/{components → lib/components}/Blocks/Start/index.css.d.ts +0 -0
  45. /package/dist/{components → lib/components}/Blocks/Start/index.d.ts +0 -0
  46. /package/dist/{components → lib/components}/Blocks/Start/node.d.ts +0 -0
  47. /package/dist/{components → lib/components}/Scripts/types.d.ts +0 -0
  48. /package/dist/{components → lib/components}/Sidebar/index.d.ts +0 -0
  49. /package/dist/{components → lib/components}/Sidebar/sidebar.css.d.ts +0 -0
  50. /package/dist/{components → lib/components}/index.d.ts +0 -0
  51. /package/dist/{constants → lib/constants}/block-types.d.ts +0 -0
  52. /package/dist/{constants → lib/constants}/index.d.ts +0 -0
  53. /package/dist/{constants → lib/constants}/sidebar-buttons.d.ts +0 -0
  54. /package/dist/{hooks → lib/hooks}/use-disclosure/index.d.ts +0 -0
  55. /package/dist/{provider → lib/provider}/DnDContext.d.ts +0 -0
  56. /package/dist/{provider → lib/provider}/settings-modal-provider/components/SettingsModal/index.d.ts +0 -0
  57. /package/dist/{provider → lib/provider}/settings-modal-provider/index.css.d.ts +0 -0
  58. /package/dist/{provider → lib/provider}/settings-modal-provider/index.d.ts +0 -0
  59. /package/dist/{storybook-utils.d.ts → lib/storybook-utils.d.ts} +0 -0
  60. /package/dist/{styles → lib/styles}/borders.d.ts +0 -0
  61. /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 { BlockSpeakProps } from './types';
2
+ declare const BlockSpeak: ({ id, data }: BlockSpeakProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default BlockSpeak;
@@ -3,11 +3,9 @@ export declare const container: string;
3
3
  export declare const headContainer: string;
4
4
  export declare const icon: string;
5
5
  export declare const text: string;
6
- export declare const editBtn: string;
7
- export declare const editIcon: string;
8
6
  export declare const recordBtn: string;
9
- export declare const deleteBtn: string;
10
7
  export declare const deleteIcon: string;
11
8
  export declare const alertContainer: string;
12
9
  export declare const messageBox: string;
13
10
  export declare const settingsContainer: string;
11
+ export declare const alertGroup: string;
@@ -0,0 +1,3 @@
1
+ export declare const SpeakNodeSettings: ({ id }: {
2
+ id: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { SpeakNodeProps } from './types';
2
+ declare const SpeakNode: React.FC<SpeakNodeProps>;
3
+ export default SpeakNode;
@@ -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,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;
@@ -0,0 +1,26 @@
1
+ import { Node, NodeProps } from '@xyflow/react';
2
+ import { SPEAK_TYPE } from '../../../constants';
3
+ export interface SpeakNodeData extends Record<string, unknown> {
4
+ title: string;
5
+ type: SPEAK_TYPE;
6
+ record?: {
7
+ default_record: string;
8
+ transcript_with_timestamp?: string;
9
+ detect_gender: boolean;
10
+ male_record?: string;
11
+ female_record?: string;
12
+ transcript_original?: string;
13
+ transcript_personalize?: string;
14
+ };
15
+ machine?: {
16
+ content: string;
17
+ };
18
+ prompt?: {
19
+ content: string;
20
+ };
21
+ }
22
+ export interface BlockSpeakProps {
23
+ id: string;
24
+ data: SpeakNodeData;
25
+ }
26
+ export type SpeakNodeProps = NodeProps<Node<SpeakNodeData>>;
@@ -0,0 +1,6 @@
1
+ declare function useAlerts(id: string): {
2
+ infoAlerts: any[];
3
+ errorAlerts: any[];
4
+ hasAlert: boolean;
5
+ };
6
+ export default useAlerts;
@@ -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,7 @@
1
+ import { default as React } from 'react';
2
+ interface ConfirmDeleteButtonProps {
3
+ id: string;
4
+ deleteBtnColor?: string;
5
+ }
6
+ declare const ConfirmDeleteButton: React.FC<ConfirmDeleteButtonProps>;
7
+ export default ConfirmDeleteButton;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface EditBlockTitleButtonProps {
3
+ id: string;
4
+ color?: string;
5
+ }
6
+ declare const EditBlockTitleButton: React.FC<EditBlockTitleButtonProps>;
7
+ export default EditBlockTitleButton;
@@ -0,0 +1,36 @@
1
+ import { BlockType, SPEAK_TYPE } from './block-types';
2
+ export declare const initialTitles: {
3
+ SPEAK: string;
4
+ START: string;
5
+ };
6
+ export declare const initialData: {
7
+ START: {};
8
+ SPEAK: {
9
+ type: SPEAK_TYPE;
10
+ record: {
11
+ default_record: any;
12
+ transcript_with_timestamp: any;
13
+ detect_gender: boolean;
14
+ male_record: any;
15
+ female_record: any;
16
+ transcript_original: any;
17
+ transcript_personalize: any;
18
+ personalize: boolean;
19
+ };
20
+ machine: {};
21
+ prompt: {};
22
+ };
23
+ };
24
+ export declare const initialNodes: {
25
+ id: string;
26
+ type: BlockType;
27
+ position: {
28
+ x: number;
29
+ y: number;
30
+ };
31
+ data: {
32
+ title: string;
33
+ };
34
+ deletable: boolean;
35
+ }[];
36
+ export declare const initialEdges: any[];
@@ -1,5 +1,5 @@
1
1
  export declare const nodeTypes: {
2
- SPEAK: import('react').FC<import('../components/Blocks/Speak/node').SpeakNodeProps>;
2
+ SPEAK: import('react').FC<import('../components/Blocks/Speak/types').SpeakNodeProps>;
3
3
  START: import('react').FC<import('../components/Blocks/Start/node').StartNodeProps>;
4
4
  };
5
5
  export default nodeTypes;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Hook to get real-time data of a node by ID in React Flow.
3
+ * Usage:
4
+ * const node = useSelectedNode(id);
5
+ */
6
+ export declare function useSelectedNode(id: string): import('@xyflow/react').Node;
7
+ export default useSelectedNode;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Hook to update a node's data by id in React Flow.
3
+ * Usage:
4
+ * const updateNode = useUpdateNode();
5
+ * updateNode(id, newData);
6
+ */
7
+ export declare function useUpdateNode(): (id: any, newData: any) => void;
8
+ export default useUpdateNode;
@@ -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;
@@ -1,6 +1,7 @@
1
1
  declare const colors: {
2
2
  common: {
3
3
  red: string;
4
+ white: string;
4
5
  };
5
6
  sidebar: {
6
7
  background: string;
@@ -15,8 +16,11 @@ declare const colors: {
15
16
  };
16
17
  listenBlock: {
17
18
  indicator: string;
19
+ background: string;
20
+ border: string;
18
21
  };
19
22
  icon: {
23
+ speak: string;
20
24
  listen: string;
21
25
  transferCall: string;
22
26
  getData: string;
@@ -24,7 +28,7 @@ declare const colors: {
24
28
  addData: string;
25
29
  httpRequest: string;
26
30
  condition: string;
27
- note: string;
31
+ assignVariable: string;
28
32
  };
29
33
  speakBlock: {
30
34
  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.3",
4
+ "version": "1.2.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ucall-asia/app-v3-scripts-editor.git"
@@ -1,9 +0,0 @@
1
- export interface BlockSpeakProps {
2
- message: string;
3
- errorMessage?: {
4
- message: string;
5
- description?: string;
6
- };
7
- }
8
- declare const BlockSpeak: ({ message, errorMessage }: BlockSpeakProps) => import("react/jsx-runtime").JSX.Element;
9
- export default BlockSpeak;
@@ -1 +0,0 @@
1
- export declare const SpeakNodeSettings: () => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- export interface SpeakNodeData {
2
- label: string;
3
- blockType: string;
4
- }
5
- export interface SpeakNodeProps {
6
- data: SpeakNodeData;
7
- }
8
- declare const SpeakNode: React.FC<SpeakNodeProps>;
9
- export default SpeakNode;
@@ -1 +0,0 @@
1
- export declare const ScriptEditor: () => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- import { BlockType } from './block-types';
2
- export declare const initialNodes: {
3
- id: string;
4
- type: BlockType;
5
- position: {
6
- x: number;
7
- y: number;
8
- };
9
- data: {
10
- label: string;
11
- blockType: BlockType;
12
- };
13
- deletable: boolean;
14
- }[];
15
- export declare const initialEdges: any[];
File without changes
File without changes
File without changes
File without changes
File without changes