@confidencesystemsinc/sdk 1.2.4 → 1.2.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/README.md +100 -51
- package/dist/components/playbook/confidence-playbook.d.ts +2 -1
- package/dist/index.cjs +15 -15
- package/dist/index.js +977 -967
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,54 +1,103 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tsconfigRootDir: import.meta.dirname,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
})
|
|
1
|
+
# Confidence Playbook Component Library
|
|
2
|
+
|
|
3
|
+
This package provides a set of React components and utilities for embedding and managing Confidence Playbooks in your application. All exports are available from the `ConfidencePlaybook` module, with several specialized subcomponents for different integration scenarios.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Exports
|
|
8
|
+
|
|
9
|
+
### 1. `ConfidencePlaybook`
|
|
10
|
+
|
|
11
|
+
The main component for rendering a playbook instance by its ID.
|
|
12
|
+
|
|
13
|
+
**Props:**
|
|
14
|
+
- `playbookInstanceId` (string \| number): The unique instance ID of the playbook to display.
|
|
15
|
+
- `playbookMode` ("list" \| "card"): Display mode for tasks.
|
|
16
|
+
- `playbookStyle` (object, optional): White-label and overlay style configuration.
|
|
17
|
+
|
|
18
|
+
**Example:**
|
|
19
|
+
```tsx
|
|
20
|
+
<ConfidencePlaybook
|
|
21
|
+
playbookInstanceId={12345}
|
|
22
|
+
playbookMode="list"
|
|
23
|
+
playbookStyle={{
|
|
24
|
+
overlay: { position: "right", size: { width: 500 } },
|
|
25
|
+
whiteLabel: { primaryColor: "#007BFF" },
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
32
28
|
```
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
})
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### 2. `ConfidencePlaybook.AutoInstantiated`
|
|
33
|
+
|
|
34
|
+
Automatically initiates a playbook for a given user/email and playbook template, then renders the playbook UI once ready.
|
|
35
|
+
|
|
36
|
+
**Props:**
|
|
37
|
+
- `email` (string): The user's email to initiate the playbook for.
|
|
38
|
+
- `playbookId` (string): The playbook template ID.
|
|
39
|
+
- `playbookMode` ("list" \| "card"): Display mode for tasks.
|
|
40
|
+
|
|
41
|
+
**Example:**
|
|
42
|
+
```tsx
|
|
43
|
+
<ConfidencePlaybook.AutoInstantiated
|
|
44
|
+
email="user@example.com"
|
|
45
|
+
playbookId="YOUR_PLAYBOOK_ID"
|
|
46
|
+
playbookMode="list"
|
|
47
|
+
/>
|
|
54
48
|
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### 3. `ConfidencePlaybook.WithInstantiateButton`
|
|
53
|
+
|
|
54
|
+
Renders a button that, when clicked, prompts the user for their email and then instantiates and displays the playbook.
|
|
55
|
+
|
|
56
|
+
**Props:**
|
|
57
|
+
- `playbookId` (string): The playbook template ID.
|
|
58
|
+
- `playbookMode` ("list" \| "card", optional): Display mode for tasks (default: "list").
|
|
59
|
+
- `playbookStyle` (object, optional): White-label and overlay style configuration.
|
|
60
|
+
- `btnLabel` (string, optional): Button label (default: "Start Playbook").
|
|
61
|
+
|
|
62
|
+
**Example:**
|
|
63
|
+
```tsx
|
|
64
|
+
<ConfidencePlaybook.WithInstantiateButton
|
|
65
|
+
playbookId="YOUR_PLAYBOOK_ID"
|
|
66
|
+
btnLabel="Start Playbook"
|
|
67
|
+
playbookMode="card"
|
|
68
|
+
playbookStyle={{
|
|
69
|
+
overlay: { position: "right", size: { width: 500 } },
|
|
70
|
+
whiteLabel: { primaryColor: "#007BFF" },
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### 4. `ConfidencePlaybook.View`
|
|
78
|
+
|
|
79
|
+
A lower-level component for rendering a playbook UI given a playbook object. Useful for advanced scenarios or custom data sources.
|
|
80
|
+
|
|
81
|
+
**Props:**
|
|
82
|
+
- `playbook` (Playbook): The playbook data object.
|
|
83
|
+
- `playbookMode` ("list" \| "card"): Display mode for tasks.
|
|
84
|
+
- `onTaskButtonClick` (function): Handler for task button actions.
|
|
85
|
+
- `playbookStyle` (object, optional): White-label and overlay style configuration.
|
|
86
|
+
|
|
87
|
+
**Example:**
|
|
88
|
+
```tsx
|
|
89
|
+
<ConfidencePlaybook.View
|
|
90
|
+
playbook={playbookData}
|
|
91
|
+
playbookMode="list"
|
|
92
|
+
onTaskButtonClick={async (btn, taskId) => {
|
|
93
|
+
// handle action
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Notes
|
|
101
|
+
- All components are styled with TailwindCSS and scoped under `.confidence-ui`.
|
|
102
|
+
- For more details on the `playbookStyle` prop and available options, see the source code or type definitions.
|
|
103
|
+
- These exports are designed for flexibility: use the high-level components for quick integration, or the lower-level `View` for custom scenarios.
|
|
@@ -35,10 +35,11 @@ export declare const ConfidencePlaybook: {
|
|
|
35
35
|
onTaskButtonClick: (btn: TaskButton, taskId: number) => Promise<void>;
|
|
36
36
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
37
37
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
AutoInstantiated: ({ email, playbookId, playbookMode, }: {
|
|
38
|
+
AutoInstantiated: ({ email, playbookId, playbookMode, playbookStyle, }: {
|
|
39
39
|
email: string;
|
|
40
40
|
playbookId: string;
|
|
41
41
|
playbookMode: "list" | "card";
|
|
42
|
+
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
42
43
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
43
44
|
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, btnLabel, }: {
|
|
44
45
|
playbookId: string;
|