@mccaskie-labs/workbench-nudges 0.6.0 → 0.7.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/CHANGELOG.md +6 -0
- package/dist/samples.d.ts +18 -0
- package/dist/samples.js +56 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @mccaskie-labs/workbench-nudges
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Samples at `./samples` for the style guide (docs/look-studio.md §5.1): the Waiting for you list, full and empty, drawn by the tool's own renderers with made-up data.
|
|
8
|
+
|
|
3
9
|
## 0.6.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** One sample: a part of the tool, or one of its layouts. */
|
|
2
|
+
interface ToolSample {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
layout?: string;
|
|
6
|
+
html: () => string;
|
|
7
|
+
}
|
|
8
|
+
/** Every sample of one tool (workbench-ui's ToolSamples). */
|
|
9
|
+
export interface ToolSamples {
|
|
10
|
+
format: 1;
|
|
11
|
+
package: string;
|
|
12
|
+
title: string;
|
|
13
|
+
prefix: string;
|
|
14
|
+
samples: readonly ToolSample[];
|
|
15
|
+
}
|
|
16
|
+
/** Every sample of the nudges tool. */
|
|
17
|
+
export declare const NUDGE_SAMPLES: ToolSamples;
|
|
18
|
+
export {};
|
package/dist/samples.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// The follow-up nudges tool's samples (docs/look-studio.md §5.1): the Waiting
|
|
2
|
+
// for you list, with made-up data, for the project's style guide, the look
|
|
3
|
+
// previewer and the visual check. Drawn by the tool's own renderers.
|
|
4
|
+
import { NUDGE_STYLES } from "./styles.js";
|
|
5
|
+
import { renderNudgeList } from "./ui.js";
|
|
6
|
+
const due = [
|
|
7
|
+
{
|
|
8
|
+
id: "n1",
|
|
9
|
+
rule: "enquiry",
|
|
10
|
+
subject: { type: "enquiry", id: "e1" },
|
|
11
|
+
step: 1,
|
|
12
|
+
steps: 2,
|
|
13
|
+
after: "3d",
|
|
14
|
+
due_at: "2026-11-23T00:00:00.000Z",
|
|
15
|
+
made_due_at: "2026-11-23T00:00:00.000Z",
|
|
16
|
+
reason: "No reply in 3 days",
|
|
17
|
+
reason_code: "no_reply",
|
|
18
|
+
draft: {
|
|
19
|
+
text: "Hi Maria, just checking in about the private class on Saturday 12 December. Shall I hold the 9:00 AM spot for your group?",
|
|
20
|
+
language: "en",
|
|
21
|
+
asked: [],
|
|
22
|
+
answered: [],
|
|
23
|
+
needs_human_check: false,
|
|
24
|
+
check_reasons: [],
|
|
25
|
+
workbench: { request_id: "sample", cost_usd: 0, model: "sample", alias: "sample" },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "n2",
|
|
30
|
+
rule: "enquiry",
|
|
31
|
+
subject: { type: "enquiry", id: "e2" },
|
|
32
|
+
step: 2,
|
|
33
|
+
steps: 2,
|
|
34
|
+
after: "7d",
|
|
35
|
+
due_at: "2026-11-22T00:00:00.000Z",
|
|
36
|
+
made_due_at: "2026-11-22T00:00:00.000Z",
|
|
37
|
+
reason: "No reply in 7 days",
|
|
38
|
+
reason_code: "draft_failed",
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const labels = { n1: "Maria · Sat 12 Dec", n2: "Jordan · Beginners' course" };
|
|
42
|
+
/** Every sample of the nudges tool. */
|
|
43
|
+
export const NUDGE_SAMPLES = {
|
|
44
|
+
format: 1,
|
|
45
|
+
package: NUDGE_STYLES.package,
|
|
46
|
+
title: "Follow-up nudges",
|
|
47
|
+
prefix: NUDGE_STYLES.prefix,
|
|
48
|
+
samples: [
|
|
49
|
+
{
|
|
50
|
+
id: "list",
|
|
51
|
+
title: "Waiting for you, one just stopped with Undo",
|
|
52
|
+
html: () => renderNudgeList(due, { endpoint: "/admin/nudges", label: (n) => labels[n.id], dismissed: [{ id: "n0", title: "Sam · Drop-in" }] }),
|
|
53
|
+
},
|
|
54
|
+
{ id: "empty", title: "Waiting for you, with nothing waiting", html: () => renderNudgeList([], { endpoint: "/admin/nudges" }) },
|
|
55
|
+
],
|
|
56
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mccaskie-labs/workbench-nudges",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Follow-up nudges for Workbench apps: remind the business to follow up when a conversation goes quiet (\"no reply in 3 days\"), with the follow-up already drafted by the reply drafter when it comes due. One scan from the app's cron, quiet hours, at most three steps, and a daily email digest to the owner. Never messages the business's customer.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./dist/styles.d.ts",
|
|
23
23
|
"default": "./dist/styles.js"
|
|
24
24
|
},
|
|
25
|
+
"./samples": {
|
|
26
|
+
"types": "./dist/samples.d.ts",
|
|
27
|
+
"default": "./dist/samples.js"
|
|
28
|
+
},
|
|
25
29
|
"./package.json": "./package.json"
|
|
26
30
|
},
|
|
27
31
|
"bin": {
|