@confidencesystemsinc/sdk 1.0.0 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@confidencesystemsinc/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "main": "dist/sdk.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,6 +8,7 @@ import { cn } from "../../utils/cn";
8
8
  import { ConfidenceTask } from "../task/confidence-task";
9
9
  import { PlaybookHeader } from "./playbook-header";
10
10
  import { initiatePlaybook } from "../../services/initiate-playbook.service";
11
+ import { ConfidencePlaybookButton } from "../playbook-button/ConfidencePlaybookButton";
11
12
 
12
13
  const ConfidencePlaybookInternal = ({
13
14
  playbookInstanceId,
@@ -187,7 +188,30 @@ const AutoInstantiated = ({
187
188
  );
188
189
  };
189
190
 
191
+ const WithInstantiateButton = ({ playbookId }: { playbookId: string }) => {
192
+ const [playbookInstanceId, setPlaybookInstanceId] = useState<number | null>(
193
+ null,
194
+ );
195
+
196
+ if (playbookInstanceId) {
197
+ return (
198
+ <ConfidencePlaybook
199
+ playbookInstanceId={playbookInstanceId}
200
+ viewMode="list"
201
+ />
202
+ );
203
+ }
204
+ return (
205
+ <>
206
+ <ConfidencePlaybookButton
207
+ playbookId={playbookId}
208
+ onInitiated={setPlaybookInstanceId}
209
+ />
210
+ </>
211
+ );
212
+ };
190
213
  ConfidencePlaybook.Context = Context;
191
214
  ConfidencePlaybook.View = PlaybookView;
192
215
  ConfidencePlaybook.TasksContainer = TasksContainer;
193
216
  ConfidencePlaybook.AutoInstantiated = AutoInstantiated;
217
+ ConfidencePlaybook.WithInstantiateButton = WithInstantiateButton;
@@ -45,6 +45,7 @@ export const ConfidencePlaybookButton = ({
45
45
 
46
46
  onInitiated(playbookInstanceId);
47
47
  };
48
+
48
49
  return (
49
50
  <>
50
51
  {buttonNode ? (