@confidencesystemsinc/sdk 2.0.18 → 2.1.0
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/SelfShadowComponent.d.ts +2 -2
- package/dist/components/embedded-layout/EmbeddedLayout.d.ts +7 -3
- package/dist/components/playbook/ConfidencePlaybook.d.ts +22 -5
- package/dist/config.d.ts +14 -0
- package/dist/constants/settings.constants.d.ts +2 -2
- package/dist/context/confidence-context.d.ts +5 -1
- package/dist/context/embedded-layout-context.d.ts +3 -0
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5251 -5167
- package/dist/types/task.types.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfidencePlaybook } from './components/playbook/ConfidencePlaybook';
|
|
2
2
|
import { EmbeddedLayout } from './components/embedded-layout/EmbeddedLayout';
|
|
3
3
|
export declare const SelfPlaybookShadowComponent: {
|
|
4
|
-
(props: React.ComponentProps<typeof ConfidencePlaybook>): import(
|
|
5
|
-
AutoInstantiated: (props: React.ComponentProps<typeof ConfidencePlaybook.AutoInstantiated>) => import(
|
|
4
|
+
(props: React.ComponentProps<typeof ConfidencePlaybook>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
AutoInstantiated: (props: React.ComponentProps<typeof ConfidencePlaybook.AutoInstantiated>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
WithInstantiateButton: (props: React.ComponentProps<typeof ConfidencePlaybook.WithInstantiateButton>) => import('react').ReactPortal;
|
|
7
7
|
EmbeddedLayout: EmbeddedLayoutShadowComponent;
|
|
8
8
|
AutoInstantiatedEmbeddedLayout: (props: React.ComponentProps<typeof EmbeddedLayout.AutoInstantiated>) => import('react').ReactPortal;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { ConfidencePlaybookStyleConfiguration } from '../playbook/ConfidencePlaybook';
|
|
2
2
|
import { ConfidencePlaybookButtonColor } from '../playbook-button/ConfidencePlaybookButton';
|
|
3
|
+
import { TaskEvent } from '../../types/task.types';
|
|
3
4
|
export declare const EmbeddedLayout: {
|
|
4
|
-
({ username, playbookMode, playbookStyle, }: {
|
|
5
|
+
({ username, playbookMode, playbookStyle, onTaskEvent, }: {
|
|
5
6
|
username: string;
|
|
6
7
|
playbookMode?: "list" | "card";
|
|
7
8
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
9
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
8
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, btnLabel, btnColor, persistKey, }: {
|
|
11
|
+
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, btnLabel, btnColor, persistKey, onTaskEvent, }: {
|
|
10
12
|
playbookId: string;
|
|
11
13
|
playbookMode?: "list" | "card";
|
|
12
14
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
13
15
|
btnLabel?: string;
|
|
14
16
|
btnColor?: ConfidencePlaybookButtonColor;
|
|
15
17
|
persistKey?: string;
|
|
18
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
16
19
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
AutoInstantiated: ({ playbookId, playbookMode, playbookStyle, persistKey, username, bank, timezone, }: {
|
|
20
|
+
AutoInstantiated: ({ playbookId, playbookMode, playbookStyle, persistKey, onTaskEvent, username, bank, timezone, }: {
|
|
18
21
|
playbookId: string;
|
|
19
22
|
playbookMode?: "list" | "card";
|
|
20
23
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
@@ -22,5 +25,6 @@ export declare const EmbeddedLayout: {
|
|
|
22
25
|
username: string;
|
|
23
26
|
bank?: string;
|
|
24
27
|
timezone?: string;
|
|
28
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
25
29
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
30
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { TaskButton } from '../../hooks/useTaskButtons';
|
|
3
3
|
import { Playbook } from '../../types/playbook.types';
|
|
4
|
+
import { TaskEvent } from '../../types/task.types';
|
|
4
5
|
import { ConfidencePlaybookButtonColor } from '../playbook-button/ConfidencePlaybookButton';
|
|
5
6
|
export interface ConfidencePlaybookStyleConfiguration {
|
|
6
7
|
overlay?: {
|
|
@@ -14,6 +15,18 @@ export interface ConfidencePlaybookStyleConfiguration {
|
|
|
14
15
|
right?: CSSProperties["right"];
|
|
15
16
|
left?: CSSProperties["left"];
|
|
16
17
|
};
|
|
18
|
+
/** Hide the round logo open/close toggle button. */
|
|
19
|
+
hideToggle?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Render the playbook inline filling its parent container — no overlay
|
|
23
|
+
* positioning, no portal to document.body, no toggle button. Use when
|
|
24
|
+
* embedding inside a fixed-size container such as a Chrome side panel or
|
|
25
|
+
* iframe. Mutually exclusive with `overlay`; if both are set, `panel` wins.
|
|
26
|
+
*/
|
|
27
|
+
panel?: {
|
|
28
|
+
/** Hide the title bar. */
|
|
29
|
+
hideHeader?: boolean;
|
|
17
30
|
};
|
|
18
31
|
whiteLabel?: {
|
|
19
32
|
titleBackgroundColor?: CSSProperties["backgroundColor"];
|
|
@@ -22,24 +35,26 @@ export interface ConfidencePlaybookStyleConfiguration {
|
|
|
22
35
|
};
|
|
23
36
|
}
|
|
24
37
|
export declare const ConfidencePlaybook: {
|
|
25
|
-
({ playbookInstanceId, playbookMode, playbookStyle, username, defaultExpanded, }: {
|
|
38
|
+
({ playbookInstanceId, playbookMode, playbookStyle, username, defaultExpanded, onTaskEvent, }: {
|
|
26
39
|
playbookInstanceId: string | number;
|
|
27
40
|
playbookMode: "list" | "card";
|
|
28
41
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
29
42
|
username: string | undefined;
|
|
30
43
|
/** Whether the playbook starts expanded. Defaults to true. */
|
|
31
44
|
defaultExpanded?: boolean;
|
|
45
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
32
46
|
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
Context: ({ children, }: {
|
|
47
|
+
Context: ({ children, onTaskEvent, }: {
|
|
34
48
|
children: React.ReactNode;
|
|
49
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
35
50
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
51
|
View: ({ playbook, playbookMode, onTaskButtonClick, playbookStyle, }: {
|
|
37
52
|
playbookMode: "list" | "card";
|
|
38
53
|
playbook: Playbook;
|
|
39
|
-
onTaskButtonClick: (btn: TaskButton, taskId: number) => Promise<void>;
|
|
54
|
+
onTaskButtonClick: (btn: TaskButton, taskInstanceId: number, taskId: number) => Promise<void>;
|
|
40
55
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
41
56
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
-
AutoInstantiated: ({ email, playbookId, playbookMode, playbookStyle, bank, timezone, persistKey, playbookInstanceId: externalPlaybookInstanceId, defaultExpanded, }: {
|
|
57
|
+
AutoInstantiated: ({ email, playbookId, playbookMode, playbookStyle, bank, timezone, persistKey, playbookInstanceId: externalPlaybookInstanceId, defaultExpanded, onTaskEvent, }: {
|
|
43
58
|
email: string;
|
|
44
59
|
playbookId: string;
|
|
45
60
|
playbookMode: "list" | "card";
|
|
@@ -50,8 +65,9 @@ export declare const ConfidencePlaybook: {
|
|
|
50
65
|
playbookInstanceId?: number | null;
|
|
51
66
|
/** Whether the playbook starts expanded. Defaults to true. */
|
|
52
67
|
defaultExpanded?: boolean;
|
|
68
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
53
69
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, btnLabel, btnColor, persistKey, onSetUsername, onSetPlaybookInstanceId, playbookInstanceId: externalPlaybookInstanceId, username: externalUsername, defaultExpanded, renderPlaybook, }: {
|
|
70
|
+
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, btnLabel, btnColor, persistKey, onSetUsername, onSetPlaybookInstanceId, playbookInstanceId: externalPlaybookInstanceId, username: externalUsername, defaultExpanded, renderPlaybook, onTaskEvent, }: {
|
|
55
71
|
playbookId: string;
|
|
56
72
|
playbookMode?: "list" | "card";
|
|
57
73
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
@@ -67,5 +83,6 @@ export declare const ConfidencePlaybook: {
|
|
|
67
83
|
defaultExpanded?: boolean;
|
|
68
84
|
/** When set (e.g. embedded layout), only the playbook node is wrapped; the instantiate button stays a sibling outside that wrapper. */
|
|
69
85
|
renderPlaybook?: (playbook: ReactNode | null) => ReactNode;
|
|
86
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
70
87
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
71
88
|
};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SdkStorageAdapter {
|
|
2
|
+
get(key: string): string | null;
|
|
3
|
+
set(key: string, value: string, options?: {
|
|
4
|
+
expiresInDays?: number;
|
|
5
|
+
}): void;
|
|
6
|
+
remove(key: string): void;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfigureSdkOptions {
|
|
9
|
+
apiBaseUrl?: string;
|
|
10
|
+
storage?: SdkStorageAdapter;
|
|
11
|
+
}
|
|
12
|
+
export declare function configureSdk(options: ConfigureSdkOptions): void;
|
|
13
|
+
export declare function getApiBaseUrl(): string;
|
|
14
|
+
export declare function getStorage(): SdkStorageAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const getConfidenceApiEndpoint: () => string;
|
|
2
|
+
export declare const getDropboxApiEndpoint: () => string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { TaskEvent } from '../types/task.types';
|
|
2
3
|
export declare const ConfidenceProvider: import('react').Provider<{
|
|
3
4
|
queryClient: QueryClient;
|
|
5
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
4
6
|
}>;
|
|
5
7
|
export declare const useConfidenceContext: () => {
|
|
6
8
|
queryClient: QueryClient;
|
|
9
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
7
10
|
};
|
|
8
|
-
export declare const ConfidenceContext: ({ children, }: {
|
|
11
|
+
export declare const ConfidenceContext: ({ children, onTaskEvent, }: {
|
|
9
12
|
children: React.ReactNode;
|
|
13
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
10
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { TaskEvent } from '../types/task.types';
|
|
1
2
|
export declare const EmbeddedLayoutProvider: import('react').Provider<{
|
|
2
3
|
isEmbedded: boolean;
|
|
4
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
3
5
|
}>;
|
|
4
6
|
export declare const useEmbeddedLayoutContext: () => {
|
|
5
7
|
isEmbedded: boolean;
|
|
8
|
+
onTaskEvent?: (event: TaskEvent, taskId: number) => void;
|
|
6
9
|
};
|