@daltonr/pathwrite-solid 0.11.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/dist/index.js ADDED
@@ -0,0 +1,157 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "solid-js/jsx-runtime";
2
+ import { createSignal, onCleanup, onMount, createContext, useContext, createEffect, For, Show, } from "solid-js";
3
+ import { PathEngine, formatFieldKey, errorPhaseMessage, } from "@daltonr/pathwrite-core";
4
+ // ---------------------------------------------------------------------------
5
+ // usePath composable
6
+ // ---------------------------------------------------------------------------
7
+ export function usePath(options) {
8
+ const engine = options?.engine ?? new PathEngine();
9
+ const [snapshot, setSnapshot] = createSignal(engine.snapshot(),
10
+ // always notify — PathEngine produces new snapshot objects on every event
11
+ { equals: false });
12
+ const unsubscribe = engine.subscribe((event) => {
13
+ if (event.type === "stateChanged" || event.type === "resumed") {
14
+ setSnapshot(event.snapshot);
15
+ }
16
+ else if (event.type === "completed" || event.type === "cancelled") {
17
+ setSnapshot(null);
18
+ }
19
+ options?.onEvent?.(event);
20
+ });
21
+ onCleanup(unsubscribe);
22
+ const start = (path, initialData = {}) => engine.start(path, initialData);
23
+ const startSubPath = (path, initialData = {}, meta) => engine.startSubPath(path, initialData, meta);
24
+ const next = () => engine.next();
25
+ const previous = () => engine.previous();
26
+ const cancel = () => engine.cancel();
27
+ const goToStep = (stepId) => engine.goToStep(stepId);
28
+ const goToStepChecked = (stepId) => engine.goToStepChecked(stepId);
29
+ const setData = ((key, value) => engine.setData(key, value));
30
+ const resetStep = () => engine.resetStep();
31
+ const restart = () => engine.restart();
32
+ const retry = () => engine.retry();
33
+ const suspend = () => engine.suspend();
34
+ const validate = () => engine.validate();
35
+ return { snapshot, start, startSubPath, next, previous, cancel, goToStep, goToStepChecked, setData, resetStep, restart, retry, suspend, validate };
36
+ }
37
+ const PathContext = createContext(undefined);
38
+ /**
39
+ * Access the nearest `PathShell`'s path instance and optional services object.
40
+ * Throws if used outside of a PathShell component.
41
+ *
42
+ * Both generics are type-level assertions, not runtime guarantees:
43
+ * - `TData` narrows `snapshot().data`
44
+ * - `TServices` types the `services` value — must match what was passed to `PathShell`
45
+ */
46
+ export function usePathContext() {
47
+ const ctx = useContext(PathContext);
48
+ if (!ctx) {
49
+ throw new Error("usePathContext must be used within a PathShell component.");
50
+ }
51
+ return {
52
+ ...ctx.path,
53
+ services: ctx.services,
54
+ };
55
+ }
56
+ export const PathShell = (props) => {
57
+ const pathReturn = usePath({
58
+ engine: props.engine,
59
+ onEvent(event) {
60
+ props.onEvent?.(event);
61
+ if (event.type === "completed")
62
+ props.onComplete?.(event.data);
63
+ if (event.type === "cancelled")
64
+ props.onCancel?.(event.data);
65
+ },
66
+ });
67
+ const { snapshot, start, next, previous, cancel, goToStep, goToStepChecked, setData, restart, retry, suspend, validate } = pathReturn;
68
+ onMount(() => {
69
+ if (props.autoStart !== false && !props.engine) {
70
+ start(props.path, props.initialData ?? {});
71
+ }
72
+ });
73
+ createEffect(() => {
74
+ if (props.validateWhen)
75
+ validate();
76
+ });
77
+ const contextValue = { path: pathReturn, services: props.services ?? null };
78
+ const actions = {
79
+ next, previous, cancel, goToStep, goToStepChecked,
80
+ setData: (key, value) => setData(key, value),
81
+ restart: () => restart(),
82
+ retry: () => retry(),
83
+ suspend: () => suspend(),
84
+ };
85
+ // Convenience — non-null snapshot, only valid inside <Show when={snapshot()}>
86
+ const snap = () => snapshot();
87
+ const shellClass = () => {
88
+ const base = "pw-shell";
89
+ const layout = props.progressLayout;
90
+ const mod = layout && layout !== "merged" ? ` pw-shell--progress-${layout}` : "";
91
+ return props.class ? `${base}${mod} ${props.class}` : `${base}${mod}`;
92
+ };
93
+ const showRoot = () => !props.hideProgress && !!snap().rootProgress && props.progressLayout !== "activeOnly";
94
+ const showActive = () => !props.hideProgress && (snap().stepCount > 1 || snap().nestingLevel > 0) && props.progressLayout !== "rootOnly";
95
+ const stepContent = () => {
96
+ const s = snap();
97
+ const key = s.formId ?? s.stepId;
98
+ const render = props.steps?.[key];
99
+ return render ? render(s) : null;
100
+ };
101
+ const showValidation = () => props.validationDisplay !== "inline" &&
102
+ (snap().hasAttemptedNext || snap().hasValidated) &&
103
+ Object.keys(snap().fieldErrors).length > 0;
104
+ const showWarnings = () => props.validationDisplay !== "inline" &&
105
+ Object.keys(snap().fieldWarnings).length > 0;
106
+ const showBlockingError = () => props.validationDisplay !== "inline" &&
107
+ (snap().hasAttemptedNext || snap().hasValidated) &&
108
+ !!snap().blockingError;
109
+ const resolvedFooterLayout = () => {
110
+ const fl = props.footerLayout ?? "auto";
111
+ if (fl !== "auto")
112
+ return fl;
113
+ return snap().stepCount === 1 && snap().nestingLevel === 0 ? "form" : "wizard";
114
+ };
115
+ return (_jsx(PathContext.Provider, { value: contextValue, children: _jsx(Show, { when: snapshot(), fallback: _jsx("div", { class: "pw-shell", children: _jsxs("div", { class: "pw-shell__empty", children: [_jsx("p", { children: "No active path." }), _jsx(Show, { when: props.autoStart === false, children: _jsx("button", { type: "button", class: "pw-shell__start-btn", onClick: () => start(props.path, props.initialData ?? {}), children: "Start" }) })] }) }), children: _jsxs("div", { class: shellClass(), children: [_jsx(Show, { when: showRoot(), children: _jsx(SolidRootProgress, { root: snap().rootProgress }) }), _jsx(Show, { when: showActive(), children: props.renderHeader
116
+ ? props.renderHeader(snap())
117
+ : _jsx(SolidHeader, { snapshot: snap() }) }), _jsx("div", { class: "pw-shell__body", children: stepContent() }), _jsx(Show, { when: showValidation(), children: _jsx("ul", { class: "pw-shell__validation", children: _jsx(For, { each: Object.entries(snap().fieldErrors), children: ([key, msg]) => (_jsxs("li", { class: "pw-shell__validation-item", children: [_jsx(Show, { when: key !== "_", children: _jsx("span", { class: "pw-shell__validation-label", children: formatFieldKey(key) }) }), msg] })) }) }) }), _jsx(Show, { when: showWarnings(), children: _jsx("ul", { class: "pw-shell__warnings", children: _jsx(For, { each: Object.entries(snap().fieldWarnings), children: ([key, msg]) => (_jsxs("li", { class: "pw-shell__warnings-item", children: [_jsx(Show, { when: key !== "_", children: _jsx("span", { class: "pw-shell__warnings-label", children: formatFieldKey(key) }) }), msg] })) }) }) }), _jsx(Show, { when: showBlockingError(), children: _jsx("p", { class: "pw-shell__blocking-error", children: snap().blockingError }) }), _jsx(Show, { when: snap().status === "error" && snap().error, fallback: _jsx(Show, { when: !props.hideFooter, children: props.renderFooter
118
+ ? props.renderFooter(snap(), actions)
119
+ : _jsx(SolidFooter, { snapshot: snap(), actions: actions, backLabel: props.backLabel ?? "Previous", nextLabel: props.nextLabel ?? "Next", completeLabel: props.completeLabel ?? "Complete", loadingLabel: props.loadingLabel, cancelLabel: props.cancelLabel ?? "Cancel", hideCancel: props.hideCancel ?? false, footerLayout: resolvedFooterLayout() }) }), children: _jsx(SolidErrorPanel, { snapshot: snap(), actions: actions }) })] }) }) }));
120
+ };
121
+ // ---------------------------------------------------------------------------
122
+ // Root progress
123
+ // ---------------------------------------------------------------------------
124
+ function SolidRootProgress(props) {
125
+ return (_jsxs("div", { class: "pw-shell__root-progress", children: [_jsx("div", { class: "pw-shell__steps", children: _jsx(For, { each: props.root.steps, children: (step, i) => (_jsxs("div", { class: `pw-shell__step pw-shell__step--${step.status}`, children: [_jsx("span", { class: "pw-shell__step-dot", children: step.status === "completed" ? "✓" : String(i() + 1) }), _jsx("span", { class: "pw-shell__step-label", children: step.title ?? step.id })] })) }) }), _jsx("div", { class: "pw-shell__track", children: _jsx("div", { class: "pw-shell__track-fill", style: { width: `${props.root.progress * 100}%` } }) })] }));
126
+ }
127
+ // ---------------------------------------------------------------------------
128
+ // Default header (progress indicator)
129
+ // ---------------------------------------------------------------------------
130
+ function SolidHeader(props) {
131
+ return (_jsxs("div", { class: "pw-shell__header", children: [_jsx("div", { class: "pw-shell__steps", children: _jsx(For, { each: props.snapshot.steps, children: (step, i) => (_jsxs("div", { class: `pw-shell__step pw-shell__step--${step.status}`, children: [_jsx("span", { class: "pw-shell__step-dot", children: step.status === "completed" ? "✓" : String(i() + 1) }), _jsx("span", { class: "pw-shell__step-label", children: step.title ?? step.id })] })) }) }), _jsx("div", { class: "pw-shell__track", children: _jsx("div", { class: "pw-shell__track-fill", style: { width: `${props.snapshot.progress * 100}%` } }) })] }));
132
+ }
133
+ // ---------------------------------------------------------------------------
134
+ // Error panel
135
+ // ---------------------------------------------------------------------------
136
+ function SolidErrorPanel(props) {
137
+ const error = () => props.snapshot.error;
138
+ const escalated = () => error().retryCount >= 2;
139
+ const title = () => escalated() ? "Still having trouble." : "Something went wrong.";
140
+ const phaseMsg = () => errorPhaseMessage(error().phase);
141
+ return (_jsxs("div", { class: "pw-shell__error", children: [_jsx("div", { class: "pw-shell__error-title", children: title() }), _jsxs("div", { class: "pw-shell__error-message", children: [phaseMsg(), error().message ? ` ${error().message}` : ""] }), _jsxs("div", { class: "pw-shell__error-actions", children: [_jsx(Show, { when: !escalated(), children: _jsx("button", { type: "button", class: "pw-shell__btn pw-shell__btn--retry", onClick: props.actions.retry, children: "Try again" }) }), _jsx(Show, { when: props.snapshot.hasPersistence, children: _jsx("button", { type: "button", class: `pw-shell__btn ${escalated() ? "pw-shell__btn--retry" : "pw-shell__btn--suspend"}`, onClick: props.actions.suspend, children: "Save and come back later" }) }), _jsx(Show, { when: escalated() && !props.snapshot.hasPersistence, children: _jsx("button", { type: "button", class: "pw-shell__btn pw-shell__btn--retry", onClick: props.actions.retry, children: "Try again" }) })] })] }));
142
+ }
143
+ // ---------------------------------------------------------------------------
144
+ // Default footer (navigation buttons)
145
+ // ---------------------------------------------------------------------------
146
+ function SolidFooter(props) {
147
+ const isFormMode = () => props.footerLayout === "form";
148
+ const isLoading = () => props.snapshot.status !== "idle";
149
+ const submitLabel = () => isLoading() && props.loadingLabel
150
+ ? props.loadingLabel
151
+ : props.snapshot.isLastStep
152
+ ? props.completeLabel
153
+ : props.nextLabel;
154
+ return (_jsxs("div", { class: "pw-shell__footer", children: [_jsxs("div", { class: "pw-shell__footer-left", children: [_jsx(Show, { when: isFormMode() && !props.hideCancel, children: _jsx("button", { type: "button", class: "pw-shell__btn pw-shell__btn--cancel", disabled: isLoading(), onClick: props.actions.cancel, children: props.cancelLabel }) }), _jsx(Show, { when: !isFormMode() && !props.snapshot.isFirstStep, children: _jsx("button", { type: "button", class: "pw-shell__btn pw-shell__btn--back", disabled: isLoading() || !props.snapshot.canMovePrevious, onClick: props.actions.previous, children: props.backLabel }) })] }), _jsxs("div", { class: "pw-shell__footer-right", children: [_jsx(Show, { when: !isFormMode() && !props.hideCancel, children: _jsx("button", { type: "button", class: "pw-shell__btn pw-shell__btn--cancel", disabled: isLoading(), onClick: props.actions.cancel, children: props.cancelLabel }) }), _jsx("button", { type: "button", class: `pw-shell__btn pw-shell__btn--next${isLoading() ? " pw-shell__btn--loading" : ""}`, disabled: isLoading(), onClick: props.actions.next, children: submitLabel() })] })] }));
155
+ }
156
+ export { PathEngine } from "@daltonr/pathwrite-core";
157
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,YAAY,EACZ,GAAG,EACH,IAAI,GAIL,MAAM,UAAU,CAAC;AAClB,OAAO,EAGL,UAAU,EAKV,cAAc,EACd,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AA4DjC,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,MAAM,UAAU,OAAO,CAAoC,OAAwB;IACjF,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;IAEnD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,YAAY,CAC1C,MAAM,CAAC,QAAQ,EAAgC;IAC/C,0EAA0E;IAC1E,EAAE,MAAM,EAAE,KAAK,EAAE,CAClB,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,CAA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AC,IAAI,IAAC,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,YACtD,iBACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,mCAAmC,EACzC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,EACxD,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,YAE9B,KAAK,CAAC,SAAS,GACT,GACJ,IACH,EACN,eAAK,KAAK,EAAC,wBAAwB,aAEjC,KAAC,IAAI,IAAC,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,YAC5C,iBACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,qCAAqC,EAC3C,QAAQ,EAAE,SAAS,EAAE,EACrB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,YAE5B,KAAK,CAAC,WAAW,GACX,GACJ,EAEP,iBACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,oCAAoC,SAAS,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,EACzF,QAAQ,EAAE,SAAS,EAAE,EACrB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,YAE1B,WAAW,EAAE,GACP,IACL,IACF,CACP,CAAC;AACJ,CAAC;AAmBD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@daltonr/pathwrite-solid",
3
+ "version": "0.11.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "description": "SolidJS adapter for @daltonr/pathwrite-core — reactive usePath() composable and optional PathShell component.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/richardadalton/pathwrite.git",
10
+ "directory": "packages/solid-adapter"
11
+ },
12
+ "keywords": [
13
+ "wizard",
14
+ "stepper",
15
+ "path",
16
+ "solid",
17
+ "solidjs",
18
+ "signals",
19
+ "multi-step",
20
+ "workflow"
21
+ ],
22
+ "sideEffects": [
23
+ "**/*.css"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./styles.css": "./dist/index.css",
31
+ "./dist/index.css": "./dist/index.css"
32
+ },
33
+ "main": "dist/index.js",
34
+ "types": "dist/index.d.ts",
35
+ "files": [
36
+ "dist",
37
+ "src",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "scripts": {
42
+ "build": "tsc -p tsconfig.json && cp ../shell.css dist/index.css",
43
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
44
+ "prepublishOnly": "test -d dist && echo 'dist already built, skipping' || (npm run clean && npm run build)"
45
+ },
46
+ "peerDependencies": {
47
+ "solid-js": ">=1.8.0"
48
+ },
49
+ "dependencies": {
50
+ "@daltonr/pathwrite-core": "^0.11.0"
51
+ },
52
+ "devDependencies": {
53
+ "solid-js": "^1.9.0"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ }
58
+ }