@daltonr/pathwrite-solid 0.14.0 → 0.14.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../src/index.tsx"],"sourcesContent":["import {\n createSignal,\n createMemo,\n untrack,\n onCleanup,\n onMount,\n createContext,\n useContext,\n createEffect,\n on,\n For,\n Show,\n type Component,\n type JSX,\n type Accessor,\n} from \"solid-js\";\nimport {\n PathData,\n PathDefinition,\n PathEngine,\n PathEvent,\n PathSnapshot,\n SerializedPathState,\n ProgressLayout,\n RootProgress,\n formatFieldKey,\n errorPhaseMessage,\n} from \"@daltonr/pathwrite-core\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface UsePathOptions<TData extends PathData = PathData> {\n /**\n * An externally-managed `PathEngine` to subscribe to — for example, the engine\n * returned by `restoreOrStart()` from `@daltonr/pathwrite-store`.\n *\n * When provided:\n * - `usePath` will **not** create its own engine.\n * - The snapshot is seeded immediately from the engine's current state.\n * - The engine lifecycle (start / cleanup) is the **caller's responsibility**.\n * - `PathShell` will skip its own `autoStart` call.\n */\n /**\n * An externally managed engine — a plain engine or an accessor. With an\n * accessor the hook tracks it, so an engine that arrives later (e.g. from an\n * async `restoreOrStart()`) or is swapped is adopted — the hook\n * re-subscribes and re-seeds its snapshot from the new engine.\n */\n engine?: PathEngine<TData> | Accessor<PathEngine<TData> | undefined>;\n /** Called for every engine event (stateChanged, completed, cancelled, resumed). */\n onEvent?: (event: PathEvent<TData>) => void;\n}\n\nexport interface UsePathReturn<TData extends PathData = PathData> {\n /**\n * Reactive snapshot accessor. Call `snapshot()` to read the current value.\n * Automatically tracked as a reactive dependency when read inside JSX or effects.\n */\n snapshot: Accessor<PathSnapshot<TData> | null>;\n /** Start (or restart) a path. */\n start: (path: PathDefinition<TData>, initialData?: Partial<TData>) => Promise<void>;\n /** Push a sub-path onto the stack. Requires an active path. A sub-path has its own data, so any definition is accepted. Pass an optional `meta` object for correlation — it is returned unchanged to the parent step's `onSubPathComplete` / `onSubPathCancel` hooks. */\n startSubPath: (\n path: PathDefinition,\n initialData?: PathData,\n meta?: Record<string, unknown>\n ) => Promise<void>;\n /** Advance one step. Completes the path on the last step. */\n next: () => Promise<void>;\n /** Go back one step. No-op when already on the first step of a top-level path. Pops back to the parent path when on the first step of a sub-path. */\n previous: () => Promise<void>;\n /** Cancel the active path (or sub-path). */\n cancel: () => Promise<void>;\n /** Jump directly to a step by ID. Calls onLeave / onEnter but bypasses guards and shouldSkip. Pass `{ validateOnLeave: true }` to mark the departing step as attempted before navigating. */\n goToStep: (stepId: string, options?: { validateOnLeave?: boolean }) => Promise<void>;\n /** Jump directly to a step by ID, checking the current step's canMoveNext (forward) or canMovePrevious (backward) guard first. Navigation is blocked if the guard returns false. */\n goToStepChecked: (stepId: string, options?: { validateOnLeave?: boolean }) => Promise<void>;\n /** Update a single data value; triggers re-renders via stateChanged. When `TData` is specified, `key` and `value` are type-checked against your data shape. */\n setData: <K extends string & keyof TData>(key: K, value: TData[K]) => Promise<void>;\n /** Reset the current step's data to what it was when the step was entered. Useful for \"Clear\" or \"Reset\" buttons. */\n resetStep: () => Promise<void>;\n /**\n * Tear down any active path (without firing hooks) and immediately restart\n * the root path with the `initialData` from the original `start()` call.\n * Takes no arguments; rejects if the engine has never been started.\n * Use for \"Start over\" / retry flows without remounting the component.\n */\n restart: () => Promise<void>;\n /** Re-runs the operation that set `snapshot().error`. Increments `retryCount` on repeated failure. No-op when there is no pending error. */\n retry: () => Promise<void>;\n /** Pauses the path with intent to return. Emits `suspended`. All state is preserved. */\n suspend: () => Promise<void>;\n /** Trigger inline validation on all steps without navigating. Sets `snapshot().hasValidated`. */\n validate: () => void;\n}\n\n// ---------------------------------------------------------------------------\n// usePath composable\n// ---------------------------------------------------------------------------\n\nexport function usePath<TData extends PathData = PathData>(\n options?: UsePathOptions<TData>\n): UsePathReturn<TData> {\n let ownEngine: PathEngine<TData> | null = null;\n const resolveEngine = (): PathEngine<TData> => {\n const external = typeof options?.engine === \"function\" ? options.engine() : options?.engine;\n return external ?? (ownEngine ??= new PathEngine<TData>());\n };\n let engine = resolveEngine();\n\n const [snapshot, setSnapshot] = createSignal<PathSnapshot<TData> | null>(\n engine.snapshot(),\n // always notify — PathEngine produces new snapshot objects on every event\n { equals: false }\n );\n\n const onEngineEvent = (event: PathEvent<TData>): void => {\n if (event.type === \"stateChanged\" || event.type === \"resumed\") {\n setSnapshot(event.snapshot);\n } else if (event.type === \"completed\" || event.type === \"cancelled\") {\n setSnapshot(engine.snapshot());\n }\n options?.onEvent?.(event);\n };\n let unsubscribe = engine.subscribe(onEngineEvent);\n\n // Adopt a late or swapped engine: re-subscribe and re-seed the snapshot.\n createEffect(\n on(\n resolveEngine,\n (next) => {\n if (next === engine) return;\n unsubscribe();\n engine = next;\n setSnapshot(engine.snapshot());\n unsubscribe = engine.subscribe(onEngineEvent);\n },\n { defer: true }\n )\n );\n\n onCleanup(() => unsubscribe());\n\n const start = (path: PathDefinition<TData>, initialData: Partial<TData> = {}): Promise<void> =>\n engine.start(path, initialData);\n\n const startSubPath = (\n path: PathDefinition,\n initialData: PathData = {},\n meta?: Record<string, unknown>\n ): Promise<void> => engine.startSubPath(path, initialData, meta);\n\n const next = (): Promise<void> => engine.next();\n const previous = (): Promise<void> => engine.previous();\n const cancel = (): Promise<void> => engine.cancel();\n const goToStep = (stepId: string, options?: { validateOnLeave?: boolean }): Promise<void> =>\n engine.goToStep(stepId, options);\n const goToStepChecked = (stepId: string, options?: { validateOnLeave?: boolean }): Promise<void> =>\n engine.goToStepChecked(stepId, options);\n\n const setData = <K extends string & keyof TData>(key: K, value: TData[K]): Promise<void> =>\n engine.setData(key, value);\n\n const resetStep = (): Promise<void> => engine.resetStep();\n const restart = (): Promise<void> => engine.restart();\n const retry = (): Promise<void> => engine.retry();\n const suspend = (): Promise<void> => engine.suspend();\n const validate = (): void => engine.validate();\n\n return {\n snapshot,\n start,\n startSubPath,\n next,\n previous,\n cancel,\n goToStep,\n goToStepChecked,\n setData,\n resetStep,\n restart,\n retry,\n suspend,\n validate,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Context — provide / useContext\n// ---------------------------------------------------------------------------\n\ninterface PathContextValue {\n path: UsePathReturn;\n services: unknown;\n}\n\nconst PathContext = createContext<PathContextValue | undefined>(undefined);\n\n/**\n * Access the nearest `PathShell`'s path instance and optional services object.\n * Throws if used outside of a PathShell component.\n *\n * Both generics are type-level assertions, not runtime guarantees:\n * - `TData` narrows `snapshot().data`\n * - `TServices` types the `services` value — must match what was passed to `PathShell`\n */\nexport function usePathContext<TData extends PathData = PathData, TServices = unknown>(): Omit<\n UsePathReturn<TData>,\n \"snapshot\"\n> & { snapshot: Accessor<PathSnapshot<TData>>; services: TServices } {\n const ctx = useContext(PathContext);\n if (!ctx) {\n throw new Error(\"usePathContext must be used within a PathShell component.\");\n }\n return {\n ...(ctx.path as unknown as Omit<UsePathReturn<TData>, \"snapshot\"> & {\n snapshot: Accessor<PathSnapshot<TData>>;\n }),\n services: ctx.services as TServices,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Default UI — PathShell\n// ---------------------------------------------------------------------------\n\nexport interface PathShellActions {\n next: () => Promise<void>;\n previous: () => Promise<void>;\n cancel: () => Promise<void>;\n goToStep: (stepId: string, options?: { validateOnLeave?: boolean }) => Promise<void>;\n goToStepChecked: (stepId: string, options?: { validateOnLeave?: boolean }) => Promise<void>;\n setData: (key: string, value: unknown) => Promise<void>;\n restart: () => Promise<void>;\n retry: () => Promise<void>;\n suspend: () => Promise<void>;\n}\n\nexport interface PathShellProps {\n /** The path to run. The shell is not typed over the path's data, so a definition of any data type is accepted. */\n path: PathDefinition;\n /**\n * An externally-managed engine — for example, the engine returned by\n * `restoreOrStart()` from `@daltonr/pathwrite-store`. When supplied, `PathShell` will skip its own\n * `start()` call and drive the UI from the provided engine instead.\n */\n engine?: PathEngine;\n initialData?: PathData;\n /**\n * When set, this shell automatically saves its state into the nearest outer `PathShell`'s\n * data under this key on every change, and restores from that stored state on remount.\n * No-op when used on a top-level shell with no outer `PathShell` ancestor.\n */\n restoreKey?: string;\n autoStart?: boolean;\n /**\n * Step render functions keyed by step ID (or `formId` for StepChoice steps).\n * ```tsx\n * <PathShell steps={{ details: (snap) => <DetailsStep snapshot={snap} />, review: (snap) => <ReviewStep snapshot={snap} /> }} />\n * ```\n * Each function is called once when its step becomes current, and the\n * component it returns lives until the path moves to a different step —\n * engine events that leave the step unchanged (`setData`, `validate`,\n * guard / hook status changes) do not re-create it, so inputs keep their\n * DOM node, focus and local state. The `snapshot` argument is live: its\n * properties read the current snapshot reactively, so\n * `createMemo(() => props.snapshot.data)` stays up to date. Reading\n * `usePathContext().snapshot()` inside the step works the same way.\n */\n steps?: Record<string, (snapshot: PathSnapshot) => ReturnType<Component>>;\n onComplete?: (data: PathData) => void;\n onCancel?: (data: PathData) => void;\n onEvent?: (event: PathEvent) => void;\n renderHeader?: (snapshot: PathSnapshot) => ReturnType<Component>;\n renderFooter?: (snapshot: PathSnapshot, actions: PathShellActions) => ReturnType<Component>;\n backLabel?: string;\n nextLabel?: string;\n completeLabel?: string;\n loadingLabel?: string;\n cancelLabel?: string;\n hideCancel?: boolean;\n hideProgress?: boolean;\n /** If true, hide the footer (navigation buttons). The error panel is still shown on async failure regardless of this prop. */\n hideFooter?: boolean;\n /**\n * Shell layout mode:\n * - `\"auto\"` (default): Uses \"form\" for single-step top-level paths, \"wizard\" otherwise.\n * - `\"wizard\"`: Progress header + Back button on left, Cancel and Submit together on right.\n * - `\"form\"`: Progress header + Cancel on left, Submit alone on right. Back button never shown.\n * - `\"tabs\"`: No progress header, no footer. Use for tabbed interfaces with a custom tab bar inside the step body.\n */\n layout?: \"wizard\" | \"form\" | \"auto\" | \"tabs\";\n /**\n * Controls whether the shell renders its auto-generated field-error summary box.\n * - `\"summary\"` (default): Shell renders the labeled error list below the step body.\n * - `\"inline\"`: Suppress the summary — handle errors inside the step component instead.\n * - `\"both\"`: Render the shell summary AND whatever the step renders.\n */\n validationDisplay?: \"summary\" | \"inline\" | \"both\";\n /**\n * Controls how progress bars are arranged when a sub-path is active.\n * - `\"merged\"` (default): Root and sub-path bars in one card.\n * - `\"split\"`: Root and sub-path bars as separate cards.\n * - `\"rootOnly\"`: Only the root bar — sub-path bar hidden.\n * - `\"activeOnly\"`: Only the active (sub-path) bar — root bar hidden.\n */\n progressLayout?: ProgressLayout;\n /**\n * Services object passed through context to all step components.\n * Step components access it via `usePathContext<TData, TServices>()`.\n */\n services?: object | null;\n /** When true, calls `validate()` on the engine so all steps show inline errors simultaneously. Useful when this shell is nested inside a step of an outer shell: bind to the outer snapshot's `hasAttemptedNext`. */\n validateWhen?: boolean;\n class?: string;\n /**\n * Content rendered when `snapshot.status === \"completed\"` (i.e. after the path\n * finishes with `completionBehaviour: \"stayOnFinal\"`). Defaults to a simple\n * \"All done.\" panel with a Restart button.\n */\n completionContent?: (snapshot: PathSnapshot) => JSX.Element;\n}\n\nexport const PathShell: Component<PathShellProps> = (props) => {\n // Read outer PathShell context BEFORE providing our own.\n const outerCtx = useContext(PathContext);\n\n // When remounting under restoreKey, rebuild the inner engine from the state the\n // previous instance exported, instead of starting the path and jumping to the\n // step (which re-ran onEnter/onLeave and lost attempted / visited state).\n const restoredEngine: PathEngine | null = (() => {\n if (props.engine || !props.restoreKey || !outerCtx) return null;\n const stored = outerCtx.path.snapshot()?.data[props.restoreKey] as\n { serializedState?: SerializedPathState } | undefined;\n if (!stored || typeof stored !== \"object\" || !stored.serializedState) return null;\n try {\n return PathEngine.fromState(stored.serializedState, { [props.path.id]: props.path });\n } catch {\n return null; // unusable state (e.g. the path definition changed): start fresh below\n }\n })();\n // The shell's own engine is created once; an `engine` prop — present at\n // mount or arriving later — always takes precedence and is adopted by usePath.\n const ownEngine = restoredEngine ?? new PathEngine();\n const currentEngine = (): PathEngine => props.engine ?? ownEngine;\n\n const pathReturn = usePath({\n engine: currentEngine,\n onEvent(event) {\n props.onEvent?.(event);\n if (event.type === \"completed\") props.onComplete?.(event.data as PathData);\n if (event.type === \"cancelled\") props.onCancel?.(event.data as PathData);\n if (props.restoreKey && outerCtx && event.type === \"stateChanged\") {\n void outerCtx.path.setData(props.restoreKey, {\n ...event.snapshot,\n serializedState: currentEngine().exportState(),\n });\n }\n },\n });\n\n const {\n snapshot,\n start,\n next,\n previous,\n cancel,\n goToStep,\n goToStepChecked,\n setData,\n restart,\n retry,\n suspend,\n validate,\n } = pathReturn;\n\n onMount(() => {\n if (props.autoStart !== false && !props.engine && !restoredEngine) {\n let startData: PathData = props.initialData ?? {};\n let restoreStepId: string | undefined;\n if (props.restoreKey && outerCtx) {\n const stored = outerCtx.path.snapshot()?.data[props.restoreKey] as PathSnapshot | undefined;\n if (stored != null && typeof stored === \"object\" && \"stepId\" in stored) {\n startData = stored.data as PathData;\n if (stored.stepIndex > 0) restoreStepId = stored.stepId as string;\n }\n }\n const p = start(props.path, startData);\n if (restoreStepId) {\n p.then(() => goToStep(restoreStepId!));\n }\n }\n });\n\n createEffect(() => {\n if (props.validateWhen) validate();\n });\n\n const contextValue: PathContextValue = { path: pathReturn, services: props.services ?? null };\n\n const actions: PathShellActions = {\n next,\n previous,\n cancel,\n goToStep,\n goToStepChecked,\n setData,\n restart: () => restart(),\n retry: () => retry(),\n suspend: () => suspend(),\n };\n\n // Convenience — non-null snapshot, only valid inside <Show when={snapshot()}>\n const snap = () => snapshot()!;\n\n const shellClass = () => {\n const base = \"pw-shell\";\n const layout = props.progressLayout;\n const mod = layout && layout !== \"merged\" ? ` pw-shell--progress-${layout}` : \"\";\n return props.class ? `${base}${mod} ${props.class}` : `${base}${mod}`;\n };\n\n const effectiveHideProgress = () => props.hideProgress || props.layout === \"tabs\";\n const effectiveHideFooter = () => props.hideFooter || props.layout === \"tabs\";\n const showRoot = () =>\n !effectiveHideProgress() && !!snap().rootProgress && props.progressLayout !== \"activeOnly\";\n // A custom header is the consumer's decision: show it whenever progress is\n // not hidden, even for a single-step path. Only the *default* header hides\n // for one step (same rule as the React / Vue shells).\n const showActive = () =>\n !effectiveHideProgress() &&\n (props.renderHeader\n ? true\n : (snap().stepCount > 1 || snap().nestingLevel > 0) && props.progressLayout !== \"rootOnly\");\n\n // The step render function must only run when the *step* changes. The\n // snapshot signal is `{ equals: false }` (a new object on every engine\n // event), so reading it in a tracked render position would tear the step\n // component down and re-create it on every setData — losing the input's\n // DOM node and focus on each keystroke. Key the rendered content on the\n // step's identity and create it untracked; live state reaches the step\n // through the reactive snapshot proxy below or `usePathContext()`.\n // Which key of `props.steps` renders the current step: the StepChoice's\n // inner step id (`formId`) when content is registered under it, otherwise\n // the slot's own id — the same fallback the React / Vue / Svelte shells use.\n const stepLookupKey = createMemo<string | null>(() => {\n const s = snapshot();\n if (!s) return null;\n if (s.formId && props.steps?.[s.formId]) return s.formId;\n return s.stepId;\n });\n const stepIdentity = createMemo<string | null>(() => {\n const s = snapshot();\n return s ? `${s.nestingLevel}:${s.pathId}:${s.formId ?? s.stepId}` : null;\n });\n\n // A snapshot whose property reads go through the signal, so a step that\n // received it as a prop (`(snap) => <Step snapshot={snap} />`) sees the\n // current values reactively even though the step itself is created once.\n const liveSnapshot = new Proxy({} as PathSnapshot, {\n get: (_target, key) => (snapshot() as unknown as Record<PropertyKey, unknown> | null)?.[key],\n has: (_target, key) => {\n const s = snapshot();\n return s ? key in s : false;\n },\n ownKeys: () => {\n const s = snapshot();\n return s ? Reflect.ownKeys(s) : [];\n },\n getOwnPropertyDescriptor: (_target, key) => {\n const s = snapshot();\n const d = s ? Object.getOwnPropertyDescriptor(s, key) : undefined;\n return d ? { ...d, configurable: true } : undefined;\n },\n });\n\n // Rendered inside <PathContext.Provider>, so the memo (and the step it\n // creates) is owned by the provider and `usePathContext()` resolves.\n const StepContent: Component = () => {\n const content = createMemo(() => {\n if (stepIdentity() === null) return null;\n const render = props.steps?.[untrack(stepLookupKey)!];\n return render ? untrack(() => render(liveSnapshot)) : null;\n });\n return <>{content()}</>;\n };\n\n const showValidation = () =>\n props.validationDisplay !== \"inline\" &&\n (snap().hasAttemptedNext || snap().hasValidated) &&\n Object.keys(snap().fieldErrors).length > 0;\n\n const showWarnings = () =>\n props.validationDisplay !== \"inline\" && Object.keys(snap().fieldWarnings).length > 0;\n\n const showBlockingError = () =>\n props.validationDisplay !== \"inline\" &&\n (snap().hasAttemptedNext || snap().hasValidated) &&\n !!snap().blockingError;\n\n const resolvedFooterLayout = () => {\n const fl = props.layout ?? \"auto\";\n if (fl !== \"auto\" && fl !== \"tabs\") return fl;\n return snap().stepCount === 1 && snap().nestingLevel === 0 ? \"form\" : \"wizard\";\n };\n\n return (\n <PathContext.Provider value={contextValue}>\n <Show\n when={snapshot()}\n fallback={\n <div class=\"pw-shell\">\n <div class=\"pw-shell__empty\">\n <p>No active path.</p>\n <Show when={props.autoStart === false}>\n <button\n type=\"button\"\n class=\"pw-shell__start-btn\"\n onClick={() => start(props.path, props.initialData ?? {})}\n >\n Start\n </button>\n </Show>\n </div>\n </div>\n }\n >\n <div class={shellClass()}>\n {/* Root progress — persistent top-level bar visible during sub-paths */}\n <Show when={showRoot()}>\n <SolidRootProgress root={snap().rootProgress!} />\n </Show>\n {/* Header — progress (active path) */}\n <Show when={showActive()}>\n {props.renderHeader ? props.renderHeader(snap()) : <SolidHeader snapshot={snap()} />}\n </Show>\n {/* Completion panel — shown when path finishes with stayOnFinal */}\n <Show when={snap().status === \"completed\"}>\n <div class=\"pw-shell__body\">\n {props.completionContent ? (\n props.completionContent(snap())\n ) : (\n <div class=\"pw-shell__completion\">\n <p class=\"pw-shell__completion-message\">All done.</p>\n <button type=\"button\" class=\"pw-shell__completion-restart\" onClick={() => restart()}>\n Start over\n </button>\n </div>\n )}\n </div>\n </Show>\n {/* Body — step content (hidden when completed) */}\n <Show when={snap().status !== \"completed\"}>\n <div class=\"pw-shell__body\">\n <StepContent />\n </div>\n {/* Validation messages */}\n <Show when={showValidation()}>\n <ul class=\"pw-shell__validation\">\n <For each={Object.entries(snap().fieldErrors)}>\n {([key, msg]) => (\n <li class=\"pw-shell__validation-item\">\n <Show when={key !== \"_\"}>\n <span class=\"pw-shell__validation-label\">{formatFieldKey(key)}</span>\n </Show>\n {msg}\n </li>\n )}\n </For>\n </ul>\n </Show>\n {/* Warning messages — non-blocking, shown immediately */}\n <Show when={showWarnings()}>\n <ul class=\"pw-shell__warnings\">\n <For each={Object.entries(snap().fieldWarnings)}>\n {([key, msg]) => (\n <li class=\"pw-shell__warnings-item\">\n <Show when={key !== \"_\"}>\n <span class=\"pw-shell__warnings-label\">{formatFieldKey(key)}</span>\n </Show>\n {msg}\n </li>\n )}\n </For>\n </ul>\n </Show>\n {/* Blocking error */}\n <Show when={showBlockingError()}>\n <p class=\"pw-shell__blocking-error\">{snap().blockingError}</p>\n </Show>\n {/* Error panel or footer */}\n <Show\n when={snap().status === \"error\" && snap().error}\n fallback={\n <Show when={!effectiveHideFooter()}>\n {props.renderFooter ? (\n props.renderFooter(snap(), actions)\n ) : (\n <SolidFooter\n snapshot={snap()}\n actions={actions}\n backLabel={props.backLabel ?? \"Previous\"}\n nextLabel={props.nextLabel ?? \"Next\"}\n completeLabel={props.completeLabel ?? \"Complete\"}\n loadingLabel={props.loadingLabel}\n cancelLabel={props.cancelLabel ?? \"Cancel\"}\n hideCancel={props.hideCancel ?? false}\n layout={resolvedFooterLayout()}\n />\n )}\n </Show>\n }\n >\n <SolidErrorPanel snapshot={snap()} actions={actions} />\n </Show>\n </Show>\n {/* end status !== completed */}\n </div>\n </Show>\n </PathContext.Provider>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Root progress\n// ---------------------------------------------------------------------------\n\nfunction SolidRootProgress(props: { root: RootProgress }) {\n return (\n <div class=\"pw-shell__root-progress\">\n <div class=\"pw-shell__steps\">\n <For each={props.root.steps}>\n {(step, i) => (\n <div class={`pw-shell__step pw-shell__step--${step.status}`}>\n <span class=\"pw-shell__step-dot\">{step.status === \"completed\" ? \"✓\" : String(i() + 1)}</span>\n <span class=\"pw-shell__step-label\">{step.title ?? step.id}</span>\n </div>\n )}\n </For>\n </div>\n <div class=\"pw-shell__track\">\n <div class=\"pw-shell__track-fill\" style={{ width: `${props.root.progress * 100}%` }} />\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Default header (progress indicator)\n// ---------------------------------------------------------------------------\n\nfunction SolidHeader(props: { snapshot: PathSnapshot }) {\n return (\n <div class=\"pw-shell__header\">\n <div class=\"pw-shell__steps\">\n <For each={props.snapshot.steps}>\n {(step, i) => (\n <div class={`pw-shell__step pw-shell__step--${step.status}`}>\n <span class=\"pw-shell__step-dot\">{step.status === \"completed\" ? \"✓\" : String(i() + 1)}</span>\n <span class=\"pw-shell__step-label\">{step.title ?? step.id}</span>\n </div>\n )}\n </For>\n </div>\n <div class=\"pw-shell__track\">\n <div class=\"pw-shell__track-fill\" style={{ width: `${props.snapshot.progress * 100}%` }} />\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Error panel\n// ---------------------------------------------------------------------------\n\nfunction SolidErrorPanel(props: { snapshot: PathSnapshot; actions: PathShellActions }) {\n const error = () => props.snapshot.error!;\n const escalated = () => error().retryCount >= 2;\n const title = () => (escalated() ? \"Still having trouble.\" : \"Something went wrong.\");\n const phaseMsg = () => errorPhaseMessage(error().phase);\n\n return (\n <div class=\"pw-shell__error\">\n <div class=\"pw-shell__error-title\">{title()}</div>\n <div class=\"pw-shell__error-message\">\n {phaseMsg()}\n {error().message ? ` ${error().message}` : \"\"}\n </div>\n <div class=\"pw-shell__error-actions\">\n <Show when={!escalated()}>\n <button type=\"button\" class=\"pw-shell__btn pw-shell__btn--retry\" onClick={props.actions.retry}>\n Try again\n </button>\n </Show>\n <Show when={props.snapshot.hasPersistence}>\n <button\n type=\"button\"\n class={`pw-shell__btn ${escalated() ? \"pw-shell__btn--retry\" : \"pw-shell__btn--suspend\"}`}\n onClick={props.actions.suspend}\n >\n Save and come back later\n </button>\n </Show>\n <Show when={escalated() && !props.snapshot.hasPersistence}>\n <button type=\"button\" class=\"pw-shell__btn pw-shell__btn--retry\" onClick={props.actions.retry}>\n Try again\n </button>\n </Show>\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Default footer (navigation buttons)\n// ---------------------------------------------------------------------------\n\nfunction SolidFooter(props: {\n snapshot: PathSnapshot;\n actions: PathShellActions;\n backLabel: string;\n nextLabel: string;\n completeLabel: string;\n loadingLabel?: string;\n cancelLabel: string;\n hideCancel: boolean;\n layout: \"wizard\" | \"form\";\n}) {\n const isFormMode = () => props.layout === \"form\";\n const isLoading = () => props.snapshot.status !== \"idle\";\n const submitLabel = () =>\n isLoading() && props.loadingLabel\n ? props.loadingLabel\n : props.snapshot.isLastStep\n ? props.completeLabel\n : props.nextLabel;\n\n return (\n <div class=\"pw-shell__footer\">\n <div class=\"pw-shell__footer-left\">\n {/* Form mode: Cancel on the left */}\n <Show when={isFormMode() && !props.hideCancel}>\n <button\n type=\"button\"\n class=\"pw-shell__btn pw-shell__btn--cancel\"\n disabled={isLoading()}\n onClick={props.actions.cancel}\n >\n {props.cancelLabel}\n </button>\n </Show>\n {/* Wizard mode: Back on the left */}\n <Show when={!isFormMode() && !props.snapshot.isFirstStep}>\n <button\n type=\"button\"\n class=\"pw-shell__btn pw-shell__btn--back\"\n disabled={isLoading() || !props.snapshot.canMovePrevious}\n onClick={props.actions.previous}\n >\n {props.backLabel}\n </button>\n </Show>\n </div>\n <div class=\"pw-shell__footer-right\">\n {/* Wizard mode: Cancel on the right */}\n <Show when={!isFormMode() && !props.hideCancel}>\n <button\n type=\"button\"\n class=\"pw-shell__btn pw-shell__btn--cancel\"\n disabled={isLoading()}\n onClick={props.actions.cancel}\n >\n {props.cancelLabel}\n </button>\n </Show>\n {/* Both modes: Submit on the right */}\n <button\n type=\"button\"\n class={`pw-shell__btn pw-shell__btn--next${isLoading() ? \" pw-shell__btn--loading\" : \"\"}`}\n disabled={isLoading()}\n onClick={props.actions.next}\n >\n {submitLabel()}\n </button>\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Re-export core types for convenience\n// ---------------------------------------------------------------------------\n\nexport type {\n PathData,\n FieldErrors,\n PathDefinition,\n PathEvent,\n PathSnapshot,\n StepStatus,\n PathStep,\n PathStepContext,\n ProgressLayout,\n RootProgress,\n SerializedPathState,\n} from \"@daltonr/pathwrite-core\";\n\nexport { PathEngine } from \"@daltonr/pathwrite-core\";\n"],"names":["usePath","options","ownEngine","resolveEngine","external","engine","PathEngine","snapshot","setSnapshot","createSignal","equals","onEngineEvent","event","type","onEvent","unsubscribe","subscribe","createEffect","on","next","defer","onCleanup","start","path","initialData","startSubPath","meta","previous","cancel","goToStep","stepId","goToStepChecked","setData","key","value","resetStep","restart","retry","suspend","validate","PathContext","createContext","undefined","usePathContext","ctx","useContext","Error","services","PathShell","props","outerCtx","restoredEngine","restoreKey","stored","data","serializedState","fromState","id","currentEngine","pathReturn","onComplete","onCancel","exportState","onMount","autoStart","startData","restoreStepId","stepIndex","p","then","validateWhen","contextValue","actions","snap","shellClass","base","layout","progressLayout","mod","class","effectiveHideProgress","hideProgress","effectiveHideFooter","hideFooter","showRoot","rootProgress","showActive","renderHeader","stepCount","nestingLevel","stepLookupKey","createMemo","s","formId","steps","stepIdentity","pathId","liveSnapshot","Proxy","get","_target","has","ownKeys","Reflect","getOwnPropertyDescriptor","d","Object","configurable","StepContent","content","render","untrack","showValidation","validationDisplay","hasAttemptedNext","hasValidated","keys","fieldErrors","length","showWarnings","fieldWarnings","showBlockingError","blockingError","resolvedFooterLayout","fl","_$createComponent","Provider","children","Show","when","fallback","_$ssr","_tmpl$7","_$ssrHydrationKey","_$escape","_tmpl$6","_tmpl$5","_$ssrAttribute","SolidRootProgress","root","SolidHeader","status","_tmpl$","completionContent","_tmpl$8","_tmpl$2","For","each","entries","msg","_tmpl$0","_tmpl$9","formatFieldKey","_tmpl$3","_tmpl$10","_tmpl$1","_tmpl$4","error","renderFooter","SolidFooter","backLabel","nextLabel","completeLabel","loadingLabel","cancelLabel","hideCancel","SolidErrorPanel","_tmpl$11","step","i","_tmpl$12","String","title","_$ssrStyleProperty","progress","_tmpl$13","escalated","retryCount","phaseMsg","errorPhaseMessage","phase","_tmpl$16","message","_tmpl$14","hasPersistence","_tmpl$15","isFormMode","isLoading","submitLabel","isLastStep","_tmpl$19","_tmpl$17","isFirstStep","_tmpl$18","canMovePrevious"],"mappings":";;;;;AAsGO,SAASA,QACdC,SACsB;AACtB,MAAIC,YAAsC;AAC1C,QAAMC,gBAAgBA,MAAyB;AAC7C,UAAMC,WAAW,OAAOH,SAASI,WAAW,aAAaJ,QAAQI,WAAWJ,SAASI;AACrF,WAAOD,aAAaF,cAAc,IAAII;EACxC;AACA,MAAID,SAASF,cAAAA;AAEb,QAAM,CAACI,UAAUC,WAAW,IAAIC;AAAAA,IAC9BJ,OAAOE,SAAAA;AAAAA;AAAAA,IAEP;AAAA,MAAEG,QAAQ;AAAA,IAAA;AAAA,EAAM;AAGlB,QAAMC,gBAAgBA,CAACC,UAAkC;AACvD,QAAIA,MAAMC,SAAS,kBAAkBD,MAAMC,SAAS,WAAW;AAC7DL,kBAAYI,MAAML,QAAQ;AAAA,IAC5B,WAAWK,MAAMC,SAAS,eAAeD,MAAMC,SAAS,aAAa;AACnEL,kBAAYH,OAAOE,UAAU;AAAA,IAC/B;AACAN,aAASa,UAAUF,KAAK;AAAA,EAC1B;AACA,MAAIG,cAAcV,OAAOW,UAAUL,aAAa;AAGhDM,eACEC,GACEf,eACCgB,CAAAA,UAAS;AACR,QAAIA,UAASd,OAAQ;AACrBU,gBAAAA;AACAV,aAASc;AACTX,gBAAYH,OAAOE,UAAU;AAC7BQ,kBAAcV,OAAOW,UAAUL,aAAa;AAAA,EAC9C,GACA;AAAA,IAAES,OAAO;AAAA,EAAA,CACX,CACF;AAEAC,YAAU,MAAMN,aAAa;AAE7B,QAAMO,QAAQA,CAACC,MAA6BC,cAA8B,CAAA,MACxEnB,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AA,aAAE,CAACyD,WAAAA,KAAgB,CAACzI,MAAMoH;AAAAA,IAAU;AAAA,IAAA,IAAAtC,WAAA;AAAA,aAAAI,IAAA4D,UAAA1D,gBAAAA,GAAAI,aAAA,YAIhCkD,UAAAA,GAAW,IAAA,GAAArD,OAGpBrF,MAAMmH,WAAW,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA,CAAA,GAMb,oCAAoCuB,UAAAA,IAAc,4BAA4B,EAAE,IAAElD,aAAA,YAC/EkD,aAAW,IAAA,GAAArD,OAGpBsD,YAAAA,CAAa,CAAA;AAKxB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daltonr/pathwrite-solid",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "SolidJS adapter for @daltonr/pathwrite-core — reactive usePath() composable and optional PathShell component.",
@@ -25,6 +25,9 @@
25
25
  "exports": {
26
26
  ".": {
27
27
  "types": "./dist/index.d.ts",
28
+ "solid": "./src/index.tsx",
29
+ "node": "./dist/server.js",
30
+ "browser": "./dist/index.js",
28
31
  "import": "./dist/index.js"
29
32
  },
30
33
  "./styles.css": "./dist/index.css",
@@ -39,7 +42,7 @@
39
42
  "LICENSE"
40
43
  ],
41
44
  "scripts": {
42
- "build": "tsc -p tsconfig.json && cp ../shell.css dist/index.css",
45
+ "build": "npm run clean && vite build && vite build --mode ssr && tsc -p tsconfig.json && cp ../shell.css dist/index.css",
43
46
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
44
47
  "prepublishOnly": "npm run clean && npm run build"
45
48
  },
@@ -47,7 +50,7 @@
47
50
  "solid-js": ">=1.8.0"
48
51
  },
49
52
  "dependencies": {
50
- "@daltonr/pathwrite-core": "^0.14.0"
53
+ "@daltonr/pathwrite-core": "^0.14.1"
51
54
  },
52
55
  "devDependencies": {
53
56
  "solid-js": "^1.9.0"