@eintrek/erp-shell 0.1.75 → 0.1.76
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 +25 -0
- package/dist/chunks/{format-CVazK0hP.cjs → format-BVoVc7Yk.cjs} +510 -35
- package/dist/chunks/format-BVoVc7Yk.cjs.map +1 -0
- package/dist/chunks/{format-DCTuLpBU.esm.js → format-BWUKNKxg.esm.js} +509 -36
- package/dist/chunks/format-BWUKNKxg.esm.js.map +1 -0
- package/dist/guide/core.d.ts +2 -2
- package/dist/guide/guide-store.d.ts +18 -3
- package/dist/guide/guide-ui.d.ts +16 -2
- package/dist/guide/machine.d.ts +46 -7
- package/dist/guide/pages.d.ts +29 -1
- package/dist/guide/progress-sync.d.ts +1 -1
- package/dist/guide/progress.d.ts +5 -3
- package/dist/guide/types.d.ts +53 -0
- package/dist/guide-core.cjs +3 -1
- package/dist/guide-core.cjs.map +1 -1
- package/dist/guide-core.esm.js +1 -1
- package/dist/help/help-button.d.ts +4 -2
- package/dist/index.cjs +11 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +12 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/format-CVazK0hP.cjs.map +0 -1
- package/dist/chunks/format-DCTuLpBU.esm.js.map +0 -1
package/dist/guide/core.d.ts
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* The main entry re-exports the same modules, so a tour defined against
|
|
11
11
|
* either entry is the same data, and the bus and the "?" entry are shared.
|
|
12
12
|
*/
|
|
13
|
-
export type { GuideAbortAction, GuideAnchorKey, GuideApiFailure, GuideApiMatch, GuideAppId, GuideCaptureEvent, GuideConfig, GuideContext, GuideFacts, GuideGate, GuideMission, GuideNothingToSave, GuideOnMissing, GuidePage, GuideSection, GuideStep, GuideStepKind, GuideSuite, GuideText, GuideTrigger, } from "./types";
|
|
13
|
+
export type { GuideAbortAction, GuideAnchorKey, GuideApiFailure, GuideApiMatch, GuideAppId, GuideCaptureEvent, GuideConfig, GuideContext, GuideFacts, GuideFlow, GuideGate, GuideMission, GuideNothingToSave, GuideOnMissing, GuidePage, GuideSection, GuideStep, GuideStepKind, GuideSuite, GuideText, GuideTrigger, } from "./types";
|
|
14
14
|
export { API_EVENT as GUIDE_API_EVENT, GUIDE_EVENT_PREFIX, GUIDE_LAYER_ATTRIBUTE, apiCallDetail, emitGuideEvent, guideAnchor, reportApiCall, reportApiEvent, type ApiCallReport, type ApiEventDetail, type GuideAnchorProps, } from "./events";
|
|
15
|
-
export { guideMenuItems, guideMenuShown, openGuidePanel, openPageGuide, openPagesPanel, openSectionGuide, setSectionGuideValues, useGuideEntry, usePageGuideEntry, usePageGuides, useSectionGuideValues, type GuideEntry, type GuideMenuItem, type PageGuidesEntry, } from "./guide-store";
|
|
15
|
+
export { guideMenuItems, guideMenuShown, openGuidePanel, openPageGuide, openPagesPanel, openSectionGuide, openFlow, openFlowsPanel, setSectionGuideValues, useGuideEntry, usePageGuideEntry, usePageGuides, useSectionGuideValues, type GuideEntry, type GuideMenuItem, type PageGuidesEntry, } from "./guide-store";
|
|
16
16
|
export { SectionGuideButton, type SectionGuideButtonProps } from "./section-button";
|
|
17
17
|
export { THAI_MONTHS_SHORT, formatBaht, thaiMonth, thaiMonthYear } from "./format";
|
|
18
18
|
export { GuideRuntime, type GuideMenu, type GuideRouting, type GuideRuntimeProps, } from "./guide-runtime";
|
|
@@ -29,11 +29,22 @@ export interface PageGuidesEntry {
|
|
|
29
29
|
key: string;
|
|
30
30
|
title: string;
|
|
31
31
|
}>;
|
|
32
|
+
/** Flows that start on this page ("พาทำ · <title>"). Shell ≥ 0.1.76. */
|
|
33
|
+
flows?: ReadonlyArray<{
|
|
34
|
+
key: string;
|
|
35
|
+
title: string;
|
|
36
|
+
}>;
|
|
37
|
+
/** Flows this person has (the panel's "พาทำงาน" list). Shell ≥ 0.1.76. */
|
|
38
|
+
flowsListed?: number;
|
|
32
39
|
}
|
|
33
40
|
/** Called by the host: this page's guide, the listed count, the sections on screen, and how to open them. */
|
|
34
|
-
export declare function publishPageGuides(next: PageGuidesEntry | null, openPage: (() => void) | null, openPages: (() => void) | null, openSection?: ((key: string) => void) | null): void;
|
|
35
|
-
/**
|
|
36
|
-
|
|
41
|
+
export declare function publishPageGuides(next: PageGuidesEntry | null, openPage: (() => void) | null, openPages: (() => void) | null, openSection?: ((key: string) => void) | null, openFlow?: ((key: string) => void) | null, openFlows?: (() => void) | null): void;
|
|
42
|
+
/**
|
|
43
|
+
* The "?" menu's items, in order (pure: the menu and its tests share it).
|
|
44
|
+
* "sections": one entry per section guide; "flowsHere": one "พาทำ · <title>"
|
|
45
|
+
* per flow starting here; "flows": "พาทำงาน" (the panel's flows).
|
|
46
|
+
*/
|
|
47
|
+
export type GuideMenuItem = "page" | "sections" | "flowsHere" | "missions" | "pages" | "flows" | "help";
|
|
37
48
|
export declare function guideMenuItems(e: GuideEntry | null, p?: PageGuidesEntry): GuideMenuItem[];
|
|
38
49
|
/**
|
|
39
50
|
* Whether the "?" press opens a menu rather than the help dialog: a tour
|
|
@@ -69,6 +80,10 @@ export declare function usePageGuideEntry(): {
|
|
|
69
80
|
* (`useSectionGuideValues`).
|
|
70
81
|
*/
|
|
71
82
|
export declare function openSectionGuide(key: string): void;
|
|
83
|
+
/** Starts a flow that starts on this page ("พาทำ · <title>"). */
|
|
84
|
+
export declare function openFlow(key: string): void;
|
|
85
|
+
/** Opens the panel on the flows alone ("พาทำงาน"). */
|
|
86
|
+
export declare function openFlowsPanel(): void;
|
|
72
87
|
type Values = Readonly<Record<string, unknown>>;
|
|
73
88
|
/**
|
|
74
89
|
* Sets (or with undefined, clears) a section guide's live values. The
|
package/dist/guide/guide-ui.d.ts
CHANGED
|
@@ -191,7 +191,8 @@ export declare function PageOfferCard(p: {
|
|
|
191
191
|
title: string;
|
|
192
192
|
steps: number;
|
|
193
193
|
onStart: () => void;
|
|
194
|
-
onLater: () => void;
|
|
194
|
+
onLater: () => void; /** "คู่มือหน้านี้" by default; a flow's: "พาทำงาน". */
|
|
195
|
+
eyebrow?: string;
|
|
195
196
|
}): import("react/jsx-runtime").JSX.Element;
|
|
196
197
|
/** One page guide in the panel's "คู่มือแต่ละหน้า" list. */
|
|
197
198
|
export interface PageItem {
|
|
@@ -200,6 +201,14 @@ export interface PageItem {
|
|
|
200
201
|
/** This person has ended this version (ดูแล้ว); otherwise ใหม่. */
|
|
201
202
|
seen: boolean;
|
|
202
203
|
}
|
|
204
|
+
/** One flow in the panel's "พาทำงาน" list. Shell ≥ 0.1.76. */
|
|
205
|
+
export interface FlowItem {
|
|
206
|
+
key: string;
|
|
207
|
+
title: string;
|
|
208
|
+
minutes?: number;
|
|
209
|
+
/** This person has finished this version (ทำแล้ว). */
|
|
210
|
+
done: boolean;
|
|
211
|
+
}
|
|
203
212
|
export declare function QuestChip({ done, total, pulse, onOpen }: {
|
|
204
213
|
done: number;
|
|
205
214
|
total: number;
|
|
@@ -236,9 +245,14 @@ export declare function QuestPanel(p: {
|
|
|
236
245
|
* (shell ≥ 0.1.74). Omitted or empty: no section.
|
|
237
246
|
*/
|
|
238
247
|
pages?: PageItem[];
|
|
239
|
-
/** false:
|
|
248
|
+
/** false: no missions (none for this person, "คู่มือทุกหน้า" or "พาทำงาน"). */
|
|
240
249
|
showMissions?: boolean;
|
|
241
250
|
onOpenPage?: (key: string) => void;
|
|
251
|
+
/** The "พาทำงาน" section: the flows this person has (shell ≥ 0.1.76). */
|
|
252
|
+
flows?: FlowItem[];
|
|
253
|
+
onOpenFlow?: (key: string) => void;
|
|
254
|
+
/** Without missions: one list alone ("คู่มือทุกหน้า" → pages, "พาทำงาน" → flows). */
|
|
255
|
+
only?: "pages" | "flows";
|
|
242
256
|
}): import("react/jsx-runtime").JSX.Element;
|
|
243
257
|
export declare function GuideToast({ text }: {
|
|
244
258
|
text: string;
|
package/dist/guide/machine.d.ts
CHANGED
|
@@ -60,11 +60,14 @@ export type GuideScreen = {
|
|
|
60
60
|
page?: string;
|
|
61
61
|
/** A section guide's step: the section key (the mission is `section:<key>`). Shell ≥ 0.1.75. */
|
|
62
62
|
section?: string;
|
|
63
|
+
/** A flow's step: the flow key (the mission is `flow:<key>`). Shell ≥ 0.1.76. */
|
|
64
|
+
flow?: string;
|
|
63
65
|
}
|
|
64
66
|
/** The first-visit offer of this page's guide: a small card, not modal. */
|
|
65
67
|
| {
|
|
66
68
|
name: "pageOffer";
|
|
67
|
-
page: string;
|
|
69
|
+
page: string; /** The offer is a flow's (`page` is the flow key). Shell ≥ 0.1.76. */
|
|
70
|
+
flow?: boolean;
|
|
68
71
|
} | {
|
|
69
72
|
name: "celebrate";
|
|
70
73
|
mission: string;
|
|
@@ -102,6 +105,8 @@ export interface GuideState {
|
|
|
102
105
|
pages: Record<string, PageRow>;
|
|
103
106
|
/** Section rows by section key (`<app>.section.<key>`). Shell ≥ 0.1.75. */
|
|
104
107
|
sections: Record<string, PageRow>;
|
|
108
|
+
/** Flow rows by flow key (`<app>.flow.<key>`). Shell ≥ 0.1.76. */
|
|
109
|
+
flows: Record<string, PageRow>;
|
|
105
110
|
/**
|
|
106
111
|
* The page or section guide being played: `write` when its row is still
|
|
107
112
|
* to be written (the offer was taken, or this person has never ended this
|
|
@@ -111,9 +116,11 @@ export interface GuideState {
|
|
|
111
116
|
key: string;
|
|
112
117
|
write: boolean;
|
|
113
118
|
kind?: ReadKind;
|
|
119
|
+
/** A flow's: the tour's captured ids before it started, put back at its end. */
|
|
120
|
+
context?: Record<string, string>;
|
|
114
121
|
} | null;
|
|
115
|
-
/** What the panel shows: everything,
|
|
116
|
-
panelSection: "all" | "pages";
|
|
122
|
+
/** What the panel shows: everything, the page guides alone ("คู่มือทุกหน้า"), or the flows alone ("พาทำงาน"). */
|
|
123
|
+
panelSection: "all" | "pages" | "flows";
|
|
117
124
|
/**
|
|
118
125
|
* Steps of the mission being played that passed by themselves (a click
|
|
119
126
|
* whose outcome already held): not counted in "ขั้นที่ x/y". Shell ≥ 0.1.75.
|
|
@@ -129,9 +136,10 @@ export interface GuidePagesInit {
|
|
|
129
136
|
pagesMode: PagesMode;
|
|
130
137
|
pages: Record<string, PageRow>;
|
|
131
138
|
sections?: Record<string, PageRow>;
|
|
139
|
+
flows?: Record<string, PageRow>;
|
|
132
140
|
}
|
|
133
|
-
/** A
|
|
134
|
-
export type ReadKind = "page" | "section";
|
|
141
|
+
/** A guide with its own row: a page guide, a section guide or a flow. */
|
|
142
|
+
export type ReadKind = "page" | "section" | "flow";
|
|
135
143
|
export interface ReplayPage {
|
|
136
144
|
mission: string;
|
|
137
145
|
/** The mission's abort anchors that were on the page at the start. */
|
|
@@ -239,7 +247,7 @@ export type GuideAction = {
|
|
|
239
247
|
type: "dismissComplete";
|
|
240
248
|
} | {
|
|
241
249
|
type: "openPanel";
|
|
242
|
-
section?: "all" | "pages";
|
|
250
|
+
section?: "all" | "pages" | "flows";
|
|
243
251
|
} | {
|
|
244
252
|
type: "closePanel";
|
|
245
253
|
} | {
|
|
@@ -260,10 +268,11 @@ export type GuideAction = {
|
|
|
260
268
|
| {
|
|
261
269
|
type: "idleCelebrate";
|
|
262
270
|
}
|
|
263
|
-
/** The host found this page's guide
|
|
271
|
+
/** The host found this page's guide (or, with `flow`, a flow) due: show the offer card. */
|
|
264
272
|
| {
|
|
265
273
|
type: "pageOffer";
|
|
266
274
|
page: string;
|
|
275
|
+
flow?: boolean;
|
|
267
276
|
}
|
|
268
277
|
/** The offer's [เริ่ม]. */
|
|
269
278
|
| {
|
|
@@ -293,6 +302,19 @@ export type GuideAction = {
|
|
|
293
302
|
| {
|
|
294
303
|
type: "startSection";
|
|
295
304
|
section: string;
|
|
305
|
+
}
|
|
306
|
+
/** "พาทำ · <title>", or the panel's "พาทำงาน" (once on its start page). */
|
|
307
|
+
| {
|
|
308
|
+
type: "startFlow";
|
|
309
|
+
flow: string;
|
|
310
|
+
}
|
|
311
|
+
/** After a refresh, in the same session: back into a flow at its checkpoint. */
|
|
312
|
+
| {
|
|
313
|
+
type: "resumeFlow";
|
|
314
|
+
flow: string;
|
|
315
|
+
step: string;
|
|
316
|
+
context: Record<string, string>;
|
|
317
|
+
write: boolean;
|
|
296
318
|
};
|
|
297
319
|
export type GuideEffect = {
|
|
298
320
|
type: "save";
|
|
@@ -338,6 +360,7 @@ export declare const COPY: {
|
|
|
338
360
|
readonly aborted: "ไกด์ไปต่อไม่ได้ ลองอีกครั้งภายหลัง";
|
|
339
361
|
readonly pageDone: "จบคู่มือหน้านี้";
|
|
340
362
|
readonly sectionDone: "จบคำอธิบายส่วนนี้";
|
|
363
|
+
readonly flowDone: "พาทำงานเสร็จแล้ว";
|
|
341
364
|
readonly bridgeTitle: "กดปุ่มเมนู";
|
|
342
365
|
readonly bridgeWhy: (app: string) => string;
|
|
343
366
|
};
|
|
@@ -463,6 +486,22 @@ export declare function sectionRecorded(state: GuideState, section: {
|
|
|
463
486
|
key: string;
|
|
464
487
|
version: number;
|
|
465
488
|
}): boolean;
|
|
489
|
+
/** The flow's row says this person has ended this version of it. */
|
|
490
|
+
export declare function flowRecorded(state: GuideState, flow: {
|
|
491
|
+
key: string;
|
|
492
|
+
version: number;
|
|
493
|
+
}): boolean;
|
|
494
|
+
/** The flows this person has that start on this page ("พาทำ · <title>"). */
|
|
495
|
+
export declare function flowsAvailable(suite: GuideSuite, env: GuideEnv): string[];
|
|
496
|
+
/**
|
|
497
|
+
* The flow to offer now, or null: only in "offer" mode, only a flow that
|
|
498
|
+
* says `offer: true`, on its start page, with no row of this version, when
|
|
499
|
+
* nothing else is up and this page's own guide is not due (it comes first:
|
|
500
|
+
* no guide here, offer: false, or already recorded), its first step's
|
|
501
|
+
* target on screen, no app dialog open. The host adds the welcome and the
|
|
502
|
+
* idle wait, as for the page guide's offer.
|
|
503
|
+
*/
|
|
504
|
+
export declare function flowOfferDue(state: GuideState, suite: GuideSuite, env: GuideEnv): string | null;
|
|
466
505
|
/** The section guides on screen here that this person has (the "?" entries, the buttons). */
|
|
467
506
|
export declare function sectionsAvailable(suite: GuideSuite, env: GuideEnv): string[];
|
|
468
507
|
/** The step before this one that this person sees, or -1. */
|
package/dist/guide/pages.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* A page guide runs through the missions' machinery as a synthetic mission
|
|
7
7
|
* `page:<key>` in replay mode, so nothing it does writes tour progress.
|
|
8
8
|
*/
|
|
9
|
-
import type { GuideContext, GuideMission, GuidePage, GuideSection, GuideSuite } from "./types";
|
|
9
|
+
import type { GuideContext, GuideFlow, GuideMission, GuidePage, GuideSection, GuideSuite } from "./types";
|
|
10
10
|
/** The synthetic mission key of a page guide: `page:<key>`. */
|
|
11
11
|
export declare const PAGE_PREFIX = "page:";
|
|
12
12
|
export declare function isPageMissionKey(key: string | null | undefined): boolean;
|
|
@@ -77,3 +77,31 @@ export declare function sectionApplies(section: GuideSection, where: PageWhere):
|
|
|
77
77
|
export declare function sectionShown(section: GuideSection, ctx: GuideContext): boolean;
|
|
78
78
|
/** The section guides on screen here that this person has, in the suite's order. */
|
|
79
79
|
export declare function sectionsHere(suite: GuideSuite, where: PageWhere, ctx: GuideContext): GuideSection[];
|
|
80
|
+
/** The synthetic mission key of a flow: `flow:<key>`. */
|
|
81
|
+
export declare const FLOW_PREFIX = "flow:";
|
|
82
|
+
export declare function isFlowMissionKey(key: string | null | undefined): boolean;
|
|
83
|
+
export declare function flowKeyOf(missionKey: string | null | undefined): string | undefined;
|
|
84
|
+
/** Why a flow cannot run, or null when it can. */
|
|
85
|
+
export declare function flowProblem(app: string, flow: GuideFlow): string | null;
|
|
86
|
+
/** The suite's flows that can run (as validPages: the rest dropped, with a warning in development). */
|
|
87
|
+
export declare function validFlows(suite: GuideSuite): GuideFlow[];
|
|
88
|
+
export declare function findFlow(suite: GuideSuite, key: string | null | undefined): GuideFlow | undefined;
|
|
89
|
+
/** The flow as a mission the machine plays (in replay mode): `flow:<key>`, its steps as authored. */
|
|
90
|
+
export declare function flowMission(flow: GuideFlow): GuideMission;
|
|
91
|
+
/**
|
|
92
|
+
* The flow's chain: its start routes, every step's `route` and route
|
|
93
|
+
* trigger, and its `transit` routes. Leaving all of them ends the flow.
|
|
94
|
+
*/
|
|
95
|
+
export declare function flowChain(flow: GuideFlow): string[];
|
|
96
|
+
/** Whether the person is on one of the flow's pages. */
|
|
97
|
+
export declare function inFlowChain(flow: GuideFlow, where: Pick<PageWhere, "code" | "pathname">): boolean;
|
|
98
|
+
/** Whether the person is on the flow's start page. */
|
|
99
|
+
export declare function onFlowStart(flow: GuideFlow, where: Pick<PageWhere, "code" | "pathname" | "search">): boolean;
|
|
100
|
+
/** Whether this person has the flow: `visible` (only true) and `requires`. */
|
|
101
|
+
export declare function flowShown(flow: GuideFlow, ctx: GuideContext): boolean;
|
|
102
|
+
/** The flows this person has (the panel's "พาทำงาน" list), in the suite's order. */
|
|
103
|
+
export declare function shownFlows(suite: GuideSuite, ctx: GuideContext): GuideFlow[];
|
|
104
|
+
/** The flows this person has that start on this page ("พาทำ · <title>"). */
|
|
105
|
+
export declare function flowsHere(suite: GuideSuite, where: PageWhere, ctx: GuideContext): GuideFlow[];
|
|
106
|
+
/** Where the panel sends the person to start a flow, or null when it needs an id it does not have. */
|
|
107
|
+
export declare function flowHref(flow: GuideFlow, ctx: GuideContext): string | null;
|
|
@@ -74,4 +74,4 @@ export declare function storeGuides(adapter: GuideProgressAdapter, suite: GuideS
|
|
|
74
74
|
* an older version's row is replaced with its rev; a newer one stops. Returns
|
|
75
75
|
* the stored row, or null when it could not be saved.
|
|
76
76
|
*/
|
|
77
|
-
export declare function storePageRow(adapter: GuideProgressAdapter, app: string, key: string, version: number, status: "completed" | "skipped", rev: number, kind?: "page" | "section"): Promise<PageRow | null>;
|
|
77
|
+
export declare function storePageRow(adapter: GuideProgressAdapter, app: string, key: string, version: number, status: "completed" | "skipped", rev: number, kind?: "page" | "section" | "flow"): Promise<PageRow | null>;
|
package/dist/guide/progress.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ export interface GuidesAnswer {
|
|
|
57
57
|
pages: Record<string, PageRow>;
|
|
58
58
|
/** Section rows by section key (the part after `<app>.section.`). Shell ≥ 0.1.75. */
|
|
59
59
|
sections: Record<string, PageRow>;
|
|
60
|
+
/** Flow rows by flow key (the part after `<app>.flow.`). Shell ≥ 0.1.76. */
|
|
61
|
+
flows: Record<string, PageRow>;
|
|
60
62
|
/** The suite's row; a fresh one when the user has none or an older version. */
|
|
61
63
|
progress: GuideProgress;
|
|
62
64
|
/** The server holds a newer version than this app's tour: do not run. */
|
|
@@ -74,10 +76,10 @@ export declare function parseGuidesAnswer(payload: unknown, suite: {
|
|
|
74
76
|
version: number;
|
|
75
77
|
app: string;
|
|
76
78
|
}): GuidesAnswer | null;
|
|
77
|
-
/** The row key of a page guide
|
|
78
|
-
export declare function pageRowKey(app: string, key: string, kind?: "page" | "section"): string;
|
|
79
|
+
/** The row key of a page guide `<app>.page.<key>`, a section guide `<app>.section.<key>`, or a flow `<app>.flow.<key>`. */
|
|
80
|
+
export declare function pageRowKey(app: string, key: string, kind?: "page" | "section" | "flow"): string;
|
|
79
81
|
/** Page (or section) rows among the list's rows, by key. Off-shape rows are left out. */
|
|
80
|
-
export declare function parsePageRows(rows: unknown[], app: string, kind?: "page" | "section"): Record<string, PageRow>;
|
|
82
|
+
export declare function parsePageRows(rows: unknown[], app: string, kind?: "page" | "section" | "flow"): Record<string, PageRow>;
|
|
81
83
|
/** One page row (a list entry, a PUT answer, a 409's `current`); null when off-shape. */
|
|
82
84
|
export declare function parsePageRow(raw: unknown): PageRow | null;
|
|
83
85
|
/**
|
package/dist/guide/types.d.ts
CHANGED
|
@@ -423,6 +423,57 @@ export interface GuideSection {
|
|
|
423
423
|
*/
|
|
424
424
|
steps: GuideStep[];
|
|
425
425
|
}
|
|
426
|
+
/**
|
|
427
|
+
* A workflow guide ("พาทำงาน", shell ≥ 0.1.76): walks one job across pages —
|
|
428
|
+
* "เปิดใบขอซื้อจากบรรทัดงบ" — and stops before anything irreversible. Not a
|
|
429
|
+
* mission: never in "ไกด์เริ่มต้น n/N" or the welcome. Same switch and
|
|
430
|
+
* audience as page guides (`guides.<app>.pages` not off; every member,
|
|
431
|
+
* filtered by `visible` / `requires`). Listed under "?" → "พาทำงาน" and,
|
|
432
|
+
* on its start page, "พาทำ · <title>". One row per flow per person,
|
|
433
|
+
* `<app>.flow.<key>`, written once at the end (completed or skipped).
|
|
434
|
+
* Authors: _claude-work/guides-r4/GUIDE-PAGES.md §11.
|
|
435
|
+
*/
|
|
436
|
+
export interface GuideFlow {
|
|
437
|
+
/** Stable, [a-z0-9-]: the row key is `${suite.app}.flow.${key}` (≤ 64 characters). */
|
|
438
|
+
key: string;
|
|
439
|
+
/** Raise it to offer this flow again (only when `offer: true`). */
|
|
440
|
+
version: number;
|
|
441
|
+
/** "เปิดใบขอซื้อจากบรรทัดงบ": the "?" entries, the panel, the bubble. ≤ 30 characters. */
|
|
442
|
+
title: string;
|
|
443
|
+
/** Rough minutes, for "ประมาณ n นาที" in the panel. */
|
|
444
|
+
minutes?: number;
|
|
445
|
+
/** Only `true` shows it (as GuideMission.visible). */
|
|
446
|
+
visible?: (ctx: GuideContext) => boolean | undefined;
|
|
447
|
+
/** A policy key the flow needs (checked with `guides.can`). */
|
|
448
|
+
requires?: string;
|
|
449
|
+
/** Where it starts: "พาทำ · <title>" is in "?" there, and the offer (if any) only there. */
|
|
450
|
+
startRoute: string | string[];
|
|
451
|
+
/**
|
|
452
|
+
* Where the panel's "พาทำงาน" list sends the person to start it, when
|
|
453
|
+
* `startRoute` needs an id (`[code]` is filled in). Default: the first
|
|
454
|
+
* `startRoute` when it has no other params.
|
|
455
|
+
*/
|
|
456
|
+
href?: GuideText;
|
|
457
|
+
/**
|
|
458
|
+
* Pages the flow may pass through without ending (a redirect, a picker
|
|
459
|
+
* page), besides `startRoute` and its steps' routes.
|
|
460
|
+
*/
|
|
461
|
+
transit?: string[];
|
|
462
|
+
/** true: offered once on its start page in `offer` mode, after the missions and the page guide's offer. Default false. */
|
|
463
|
+
offer?: boolean;
|
|
464
|
+
/**
|
|
465
|
+
* true: the flow may save something harmless and reversible ("commit",
|
|
466
|
+
* "input" and "select" steps). Every commit step must name its `abort`.
|
|
467
|
+
* Default false: "view" and "click" steps only.
|
|
468
|
+
*/
|
|
469
|
+
allowCommit?: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* Steps as a mission's: `route`, checkpoints and resume across pages. The
|
|
472
|
+
* last step on an irreversible button is a "view" step (the app's
|
|
473
|
+
* deny-list test checks).
|
|
474
|
+
*/
|
|
475
|
+
steps: GuideStep[];
|
|
476
|
+
}
|
|
426
477
|
/** One app's whole tour: the welcome, the missions, the finish. */
|
|
427
478
|
export interface GuideSuite {
|
|
428
479
|
/** Progress key on the server, "<app>.<name>": "peoplx.first-run". */
|
|
@@ -470,6 +521,8 @@ export interface GuideSuite {
|
|
|
470
521
|
pages?: GuidePage[];
|
|
471
522
|
/** Section guides ("อธิบายส่วนนี้"), shell ≥ 0.1.75. */
|
|
472
523
|
sections?: GuideSection[];
|
|
524
|
+
/** Workflow guides ("พาทำงาน"), shell ≥ 0.1.76. */
|
|
525
|
+
flows?: GuideFlow[];
|
|
473
526
|
}
|
|
474
527
|
/** AppLayoutShell's `guides` prop. */
|
|
475
528
|
export interface GuideConfig {
|
package/dist/guide-core.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var format = require('./chunks/format-
|
|
4
|
+
var format = require('./chunks/format-BVoVc7Yk.cjs');
|
|
5
5
|
require('react/jsx-runtime');
|
|
6
6
|
require('react');
|
|
7
7
|
require('react-dom');
|
|
@@ -26,6 +26,8 @@ exports.guideMenuShown = format.guideMenuShown;
|
|
|
26
26
|
exports.loadGuides = format.loadGuides;
|
|
27
27
|
exports.matchApiPath = format.matchApiPath;
|
|
28
28
|
exports.matchRoute = format.matchRoute;
|
|
29
|
+
exports.openFlow = format.openFlow;
|
|
30
|
+
exports.openFlowsPanel = format.openFlowsPanel;
|
|
29
31
|
exports.openGuidePanel = format.openGuidePanel;
|
|
30
32
|
exports.openPageGuide = format.openPageGuide;
|
|
31
33
|
exports.openPagesPanel = format.openPagesPanel;
|
package/dist/guide-core.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-core.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guide-core.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/guide-core.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { A as GUIDE_API_EVENT, G as GUIDE_EVENT_PREFIX, a as GUIDE_LAYER_ATTRIBUTE, c as GuideProgressConflict, d as GuideRuntime, S as SectionGuideButton, T as THAI_MONTHS_SHORT, e as apiCallDetail, f as emitGuideEvent, g as fillRoute, h as formatBaht, i as guideAnchor, j as guideMenuItems, k as guideMenuShown, l as loadGuides, m as matchApiPath, n as matchRoute, o as
|
|
2
|
+
export { A as GUIDE_API_EVENT, G as GUIDE_EVENT_PREFIX, a as GUIDE_LAYER_ATTRIBUTE, c as GuideProgressConflict, d as GuideRuntime, S as SectionGuideButton, T as THAI_MONTHS_SHORT, e as apiCallDetail, f as emitGuideEvent, g as fillRoute, h as formatBaht, i as guideAnchor, j as guideMenuItems, k as guideMenuShown, l as loadGuides, m as matchApiPath, n as matchRoute, o as openFlow, p as openFlowsPanel, q as openGuidePanel, r as openPageGuide, s as openPagesPanel, t as openSectionGuide, u as reportApiCall, v as reportApiEvent, w as setSectionGuideValues, x as storeGuides, y as thaiMonth, z as thaiMonthYear, B as useGuideEntry, C as usePageGuideEntry, D as usePageGuides, E as useSectionGuideValues } from './chunks/format-BWUKNKxg.esm.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-dom';
|
|
@@ -7,8 +7,10 @@ export interface HelpButtonProps {
|
|
|
7
7
|
*
|
|
8
8
|
* When this user has something to open here, it opens a small menu:
|
|
9
9
|
* "คู่มือหน้านี้" (this page's guide), "อธิบายส่วนนี้ · <title>" for each
|
|
10
|
-
* section guide on screen, "
|
|
11
|
-
*
|
|
10
|
+
* section guide on screen, "พาทำ · <title>" for each flow starting here,
|
|
11
|
+
* "ไกด์เริ่มต้น n/N" (the quest
|
|
12
|
+
* panel), "คู่มือทุกหน้า" (the panel's page guides), "พาทำงาน" (the panel's
|
|
13
|
+
* flows) and "ติดต่อทีมช่วยเหลือ"
|
|
12
14
|
* (the help dialog), each only when it has something. Otherwise one press
|
|
13
15
|
* opens the help dialog, as before.
|
|
14
16
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var Link = require('next/link');
|
|
|
14
14
|
var reactDom = require('react-dom');
|
|
15
15
|
var nextThemes = require('next-themes');
|
|
16
16
|
var axios = require('axios');
|
|
17
|
-
var format = require('./chunks/format-
|
|
17
|
+
var format = require('./chunks/format-BVoVc7Yk.cjs');
|
|
18
18
|
var reactQueryDevtools = require('@tanstack/react-query-devtools');
|
|
19
19
|
require('@floating-ui/dom');
|
|
20
20
|
|
|
@@ -1740,7 +1740,7 @@ function platformApiBase(app) {
|
|
|
1740
1740
|
* This package's version, attached to help messages so the back office can
|
|
1741
1741
|
* tell which shell a report came from. Keep in step with package.json.
|
|
1742
1742
|
*/
|
|
1743
|
-
const SHELL_VERSION = "0.1.
|
|
1743
|
+
const SHELL_VERSION = "0.1.76";
|
|
1744
1744
|
|
|
1745
1745
|
const HELP_APP_LABEL = {
|
|
1746
1746
|
platform: "แพลตฟอร์ม",
|
|
@@ -2574,8 +2574,10 @@ const BUTTON_CLASS = "grid size-[34px] shrink-0 place-items-center rounded-lg te
|
|
|
2574
2574
|
*
|
|
2575
2575
|
* When this user has something to open here, it opens a small menu:
|
|
2576
2576
|
* "คู่มือหน้านี้" (this page's guide), "อธิบายส่วนนี้ · <title>" for each
|
|
2577
|
-
* section guide on screen, "
|
|
2578
|
-
*
|
|
2577
|
+
* section guide on screen, "พาทำ · <title>" for each flow starting here,
|
|
2578
|
+
* "ไกด์เริ่มต้น n/N" (the quest
|
|
2579
|
+
* panel), "คู่มือทุกหน้า" (the panel's page guides), "พาทำงาน" (the panel's
|
|
2580
|
+
* flows) and "ติดต่อทีมช่วยเหลือ"
|
|
2579
2581
|
* (the help dialog), each only when it has something. Otherwise one press
|
|
2580
2582
|
* opens the help dialog, as before.
|
|
2581
2583
|
*/
|
|
@@ -2601,7 +2603,9 @@ function HelpButton({ className }) {
|
|
|
2601
2603
|
}
|
|
2602
2604
|
}, children: [items.includes("page") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openPageGuide), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.BookOpen, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49" })] })) : null, items.includes("sections")
|
|
2603
2605
|
? (pages.sections ?? []).map(sec => (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(() => format.openSectionGuide(sec.key)), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Info, { className: "size-4" }), jsxRuntime.jsxs("span", { className: "flex-1", children: ["\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E2A\u0E48\u0E27\u0E19\u0E19\u0E35\u0E49 \u00B7 ", sec.title] })] }, sec.key)))
|
|
2604
|
-
: null, items.includes("
|
|
2606
|
+
: null, items.includes("flowsHere")
|
|
2607
|
+
? (pages.flows ?? []).map(f => (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(() => format.openFlow(f.key)), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Route, { className: "size-4" }), jsxRuntime.jsxs("span", { className: "flex-1", children: ["\u0E1E\u0E32\u0E17\u0E33 \u00B7 ", f.title] })] }, f.key)))
|
|
2608
|
+
: null, items.includes("missions") && guide ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openGuidePanel), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Flag, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E44\u0E01\u0E14\u0E4C\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19" }), jsxRuntime.jsxs("span", { className: "text-xs font-semibold text-primary tabular-nums", children: [guide.done, "/", guide.total] })] })) : null, items.includes("pages") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openPagesPanel), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Library, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E17\u0E38\u0E01\u0E2B\u0E19\u0E49\u0E32" })] })) : null, items.includes("flows") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openFlowsPanel), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Route, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E1E\u0E32\u0E17\u0E33\u0E07\u0E32\u0E19" })] })) : null, jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: () => setTimeout(openHelp, 0), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.MessageCircle, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E17\u0E35\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D" })] })] })] }));
|
|
2605
2609
|
}
|
|
2606
2610
|
|
|
2607
2611
|
const hasPaginationShape = (payload) => {
|
|
@@ -4457,6 +4461,8 @@ exports.formatBaht = format.formatBaht;
|
|
|
4457
4461
|
exports.guideAnchor = format.guideAnchor;
|
|
4458
4462
|
exports.guideMenuItems = format.guideMenuItems;
|
|
4459
4463
|
exports.guideMenuShown = format.guideMenuShown;
|
|
4464
|
+
exports.openFlow = format.openFlow;
|
|
4465
|
+
exports.openFlowsPanel = format.openFlowsPanel;
|
|
4460
4466
|
exports.openGuidePanel = format.openGuidePanel;
|
|
4461
4467
|
exports.openPageGuide = format.openPageGuide;
|
|
4462
4468
|
exports.openPagesPanel = format.openPagesPanel;
|