@dryui/wizard 0.0.2

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.
Files changed (35) hide show
  1. package/dist/app/_app/env.js +1 -0
  2. package/dist/app/_app/immutable/assets/0.DuShIRXe.css +1 -0
  3. package/dist/app/_app/immutable/chunks/CtGZ12rY.js +1 -0
  4. package/dist/app/_app/immutable/chunks/CylA_QuH.js +301 -0
  5. package/dist/app/_app/immutable/chunks/DOlHNFLc.js +3 -0
  6. package/dist/app/_app/immutable/chunks/Di6zslmw.js +1 -0
  7. package/dist/app/_app/immutable/chunks/DslunMlz.js +1 -0
  8. package/dist/app/_app/immutable/chunks/RHaY3jvT.js +1 -0
  9. package/dist/app/_app/immutable/chunks/cUpOkCva.js +1 -0
  10. package/dist/app/_app/immutable/chunks/mKsxY4vH.js +1 -0
  11. package/dist/app/_app/immutable/entry/app.CiOBuL1e.js +2 -0
  12. package/dist/app/_app/immutable/entry/start.BxD3Cl0i.js +1 -0
  13. package/dist/app/_app/immutable/nodes/0.B2K_dGeT.js +1 -0
  14. package/dist/app/_app/immutable/nodes/1.Br47VULm.js +1 -0
  15. package/dist/app/_app/immutable/nodes/2.BIQmDbKj.js +5 -0
  16. package/dist/app/_app/immutable/nodes/3.DYEEY9dv.js +1 -0
  17. package/dist/app/_app/immutable/nodes/4.Dz0Fgkf9.js +2 -0
  18. package/dist/app/_app/immutable/nodes/5.DD7T7i0r.js +7 -0
  19. package/dist/app/_app/immutable/nodes/6.DAnKIGNq.js +1 -0
  20. package/dist/app/_app/immutable/nodes/7.vjgrswDV.js +7 -0
  21. package/dist/app/_app/version.json +1 -0
  22. package/dist/app/follow-up.html +183 -0
  23. package/dist/app/index.html +1 -0
  24. package/dist/app/step-1.html +189 -0
  25. package/dist/app/step-2.html +183 -0
  26. package/dist/app/step-3.html +201 -0
  27. package/dist/cli.js +25935 -0
  28. package/dist/components.js +25245 -0
  29. package/dist/index.js +25804 -0
  30. package/dist/layouts.js +53 -0
  31. package/dist/protocol.js +44 -0
  32. package/dist/server.js +25774 -0
  33. package/dist/state.js +25486 -0
  34. package/dist/types.js +14 -0
  35. package/package.json +59 -0
@@ -0,0 +1,53 @@
1
+ // @bun
2
+ // src/layouts.ts
3
+ var SIDEBAR = {
4
+ id: "sidebar",
5
+ label: "Sidebar",
6
+ description: "Supporting navigation, filters, and secondary context."
7
+ };
8
+ var HEADER = {
9
+ id: "header",
10
+ label: "Header",
11
+ description: "Title, summary, and top-level actions."
12
+ };
13
+ var MAIN = {
14
+ id: "main",
15
+ label: "Main",
16
+ description: "Primary page content and the main workflow."
17
+ };
18
+ var FOOTER = {
19
+ id: "footer",
20
+ label: "Footer",
21
+ description: "Supporting actions, notes, or low-priority content."
22
+ };
23
+ var WIZARD_LAYOUTS = [
24
+ {
25
+ id: "sidebar-main",
26
+ name: "Sidebar + Main",
27
+ description: "Dashboard or admin surfaces with a persistent side rail and a primary content pane.",
28
+ regions: [SIDEBAR, MAIN]
29
+ },
30
+ {
31
+ id: "header-content-footer",
32
+ name: "Header + Content + Footer",
33
+ description: "Marketing, landing pages, and narrative pages with a clear content stack.",
34
+ regions: [HEADER, MAIN, FOOTER]
35
+ },
36
+ {
37
+ id: "header-sidebar-main",
38
+ name: "Header + Sidebar + Main",
39
+ description: "App shells and SaaS surfaces with a top bar, side navigation, and main workspace.",
40
+ regions: [HEADER, SIDEBAR, MAIN]
41
+ }
42
+ ];
43
+ function getWizardLayout(id) {
44
+ const layout = WIZARD_LAYOUTS.find((entry) => entry.id === id);
45
+ if (!layout) {
46
+ throw new Error(`Unknown wizard layout: ${id}`);
47
+ }
48
+ return layout;
49
+ }
50
+ export {
51
+ getWizardLayout,
52
+ WIZARD_LAYOUTS
53
+ };
@@ -0,0 +1,44 @@
1
+ // @bun
2
+ // src/protocol.ts
3
+ function encodeWizardMessage(message) {
4
+ return JSON.stringify(message);
5
+ }
6
+ function decodeWizardMessage(payload) {
7
+ const text = typeof payload === "string" ? payload : new TextDecoder().decode(new Uint8Array(payload));
8
+ return JSON.parse(text);
9
+ }
10
+ function normalizeQuestionInput(input, id) {
11
+ const questionType = input.type ?? input.questionType ?? (input.options?.length ? "multi-choice" : "text");
12
+ const options = normalizeQuestionOptions(input.options);
13
+ return {
14
+ id,
15
+ prompt: input.prompt,
16
+ questionType,
17
+ ...options.length > 0 ? { options } : {}
18
+ };
19
+ }
20
+ function normalizeQuestionOptions(options) {
21
+ if (!options?.length) {
22
+ return [];
23
+ }
24
+ return options.map((option) => {
25
+ if (typeof option === "string") {
26
+ return { label: option, value: option };
27
+ }
28
+ return {
29
+ label: option.label ?? option.value,
30
+ value: option.value,
31
+ ...option.description ? { description: option.description } : {}
32
+ };
33
+ });
34
+ }
35
+ function isWizardQuestionType(value) {
36
+ return value === "multi-choice" || value === "text" || value === "confirm";
37
+ }
38
+ export {
39
+ normalizeQuestionOptions,
40
+ normalizeQuestionInput,
41
+ isWizardQuestionType,
42
+ encodeWizardMessage,
43
+ decodeWizardMessage
44
+ };