@orieljs/inertia-solid 0.1.0-alpha.4 → 0.1.0-alpha.5

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 CHANGED
@@ -168,8 +168,16 @@ var LINK_KEYS = [
168
168
  "onPrefetching",
169
169
  "onPrefetched"
170
170
  ];
171
+ function classProps(classes) {
172
+ if ("classList" in classes) return classes;
173
+ return {
174
+ get "attr:class"() {
175
+ return classes.class;
176
+ }
177
+ };
178
+ }
171
179
  function Link(props) {
172
- const [own, attributes] = splitProps(props, LINK_KEYS);
180
+ const [own, classes, attributes] = splitProps(props, LINK_KEYS, ["class", "classList"]);
173
181
  const method = createMemo2(() => (own.method ?? "get").toLowerCase());
174
182
  const tag = createMemo2(() => {
175
183
  const as = (own.as ?? "a").toLowerCase();
@@ -220,7 +228,7 @@ function Link(props) {
220
228
  onCleanup(() => clearTimeout(hoverTimer));
221
229
  return createComponent3(
222
230
  Dynamic,
223
- mergeProps2(attributes, {
231
+ mergeProps2(attributes, classProps(classes), {
224
232
  get component() {
225
233
  return tag();
226
234
  },
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts","../usePage.ts","../context.ts","../App.ts","../createInertiaApp.ts","../Link.ts","../useForm.ts","../Deferred.ts","../show.ts","../WhenVisible.ts","../Head.ts"],"sourcesContent":["export { router } from '@inertiajs/core'\nexport {\n currentRoute,\n hasRoute,\n isCurrentRoute,\n route,\n RouteError,\n type ErrorBags,\n type Errors,\n type PageName,\n type PageProps,\n type Pages,\n type RouteList,\n type RouteName,\n type SharedProps,\n type TypedPage,\n} from '@orieljs/inertia-client'\nexport { usePage } from './usePage'\nexport { App, type InertiaAppProps, type LayoutComponent, type PageComponent, type PageModule, type PageResolver, type ResolvedPage } from './App'\nexport { createInertiaApp, type CreateInertiaAppOptions, type InertiaApp, type RenderPage, type SetupOptions } from './createInertiaApp'\nexport { Link, type LinkProps } from './Link'\nexport { useForm, type SolidForm } from './useForm'\nexport { Deferred, type DeferredProps } from './Deferred'\nexport { WhenVisible, type WhenVisibleProps } from './WhenVisible'\nexport { Head, type HeadProps } from './Head'\n","import type { PageName, TypedPage } from '@orieljs/inertia-client'\nimport { useContext } from 'solid-js'\nimport { PageContext } from './context'\n\n/**\n * The current page, typed by name: `usePage<'Posts/Index'>().props.posts`. The page is a store: read its fields\n * inside JSX, an effect or a memo to react to visits. Call it inside a component rendered by the Inertia app.\n */\nexport function usePage<N extends PageName = PageName>(): TypedPage<N> {\n const page = useContext(PageContext)\n if (page === undefined) throw new Error('usePage() must be called inside a component rendered by createInertiaApp().')\n return page as unknown as TypedPage<N>\n}\n","import type { HeadManager, Page } from '@inertiajs/core'\nimport { createContext } from 'solid-js'\n\n/** The current page: a Solid store, so reading `page.props.x` inside JSX or an effect is reactive. */\nexport const PageContext = createContext<Page>()\n\n/** The head manager of the running app (core's createHeadManager), used by Head. */\nexport const HeadContext = createContext<HeadManager>()\n","import { createHeadManager, router, type Page } from '@inertiajs/core'\nimport { batch, createComponent, createMemo, createSignal, mergeProps, untrack, type Component, type JSX } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport { isServer } from 'solid-js/web'\nimport { HeadContext, PageContext } from './context'\n\n// Page and layout props are the page's props, which each page types itself (PageProps<'Posts/Index'>).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyProps = any\n\n/** A persistent layout: it gets the page props, and the page (or the next layout) as `children`. */\nexport type LayoutComponent = Component<AnyProps>\n\n/** A page component. `Home.layout = AppLayout` (or `[Outer, Inner]`) wraps it in layouts that survive visits. */\nexport type PageComponent = Component<AnyProps> & { layout?: LayoutComponent | LayoutComponent[] }\n\n/** What a resolver returns: the component, or its module (`{ default, layout? }`, e.g. `import('./pages/Home.tsx')`). */\nexport type PageModule = PageComponent | { default: PageComponent; layout?: LayoutComponent | LayoutComponent[] }\n\n/** Finds the page component for a name: `(name) => import(`./pages/${name}.tsx`)`. */\nexport type PageResolver = (name: string, page: Page) => PageModule | Promise<PageModule>\n\n/** A page ready to render: its component and its layouts, outermost first. */\nexport interface ResolvedPage {\n readonly component: PageComponent\n readonly layouts: readonly LayoutComponent[]\n}\n\n/** Resolves a page name to its component and layouts (a module's `layout` export wins over the component's). */\nexport async function resolvePage(resolve: PageResolver, name: string, page: Page): Promise<ResolvedPage> {\n // Nothing at all for an unknown name too, from a hand-written resolver such as `(name) => pages[name]`.\n const module: PageModule | null | undefined = await resolve(name, page)\n const component = typeof module === 'function' ? module : module?.default\n if (typeof component !== 'function') throw new Error(`The page [${name}] did not resolve to a Solid component.`)\n const layout = (typeof module === 'function' ? undefined : module?.layout) ?? component.layout\n return { component, layouts: layout === undefined ? [] : Array.isArray(layout) ? layout : [layout] }\n}\n\nexport interface InertiaAppProps {\n initialPage: Page\n initialComponent: ResolvedPage\n resolveComponent: (name: string, page?: Page) => Promise<ResolvedPage>\n /** Formats every page title (`(title) => `${title} - My App``). */\n titleCallback?: (title: string) => string\n /** Receives the head tags on the server (SSR collects them into `head`). */\n onHeadUpdate?: (elements: string[]) => void\n}\n\n/**\n * The Inertia root: owns the current page (a store, read through usePage()), lets the router swap pages, and\n * renders the page inside its layouts. A visit to another component, or one without preserveState, remounts the\n * page; layouts that stay the same between two pages are kept, with their state.\n */\nexport function App(props: InertiaAppProps): JSX.Element {\n // The store gets its own copy: reconcile() updates it in place, and core's page objects (history, prefetch cache)\n // must not change under it.\n const [page, setPage] = createStore<Page>(structuredClone({ ...props.initialPage, flash: props.initialPage.flash ?? {} }))\n const [view, setView] = createSignal<ResolvedPage>(props.initialComponent)\n const titleCallback = props.titleCallback ?? ((title: string) => title)\n const headManager = createHeadManager(isServer, titleCallback, props.onHeadUpdate ?? (() => undefined))\n\n if (!isServer) {\n router.init<ResolvedPage>({\n initialPage: props.initialPage,\n resolveComponent: props.resolveComponent as never,\n swapComponent: async ({ component, page: next, preserveState }) => {\n batch(() => {\n setPage(reconcile(structuredClone({ ...next, flash: next.flash ?? {} })))\n if (!preserveState || component.component !== view().component) setView(component)\n })\n },\n onFlash: (flash) => setPage('flash', reconcile(structuredClone(flash))),\n })\n }\n\n // One memo per layout level: a level is rebuilt only when its layout changes, so a shared layout persists.\n // Components get their props as a function source, not as `page.props` itself: reconcile() replaces the props\n // object (instead of merging into it) when the top-level `id` differs, and a held reference would go stale.\n const level = (index: number): JSX.Element => {\n const layout = createMemo(() => view().layouts[index])\n return createMemo(() => {\n const Layout = layout()\n if (Layout === undefined) {\n return createMemo(() => {\n const { component } = view()\n return untrack(() => createComponent(component, mergeProps(() => page.props)))\n }) as unknown as JSX.Element\n }\n // A layout gets the page props and the next level as children.\n const children = { get children() { return level(index + 1) } }\n return untrack(() => createComponent(Layout, mergeProps(() => page.props, children)))\n }) as unknown as JSX.Element\n }\n\n return createComponent(HeadContext.Provider, {\n value: headManager,\n get children() {\n return createComponent(PageContext.Provider, {\n value: page,\n get children() {\n return level(0)\n },\n })\n },\n })\n}\n","import {\n buildSSRBody,\n getInitialPageFromDOM,\n setupProgress,\n type CreateInertiaAppOptions as CoreAppOptions,\n type InertiaAppSSRResponse,\n type Page,\n type ProgressOptions,\n} from '@inertiajs/core'\nimport { createComponent } from 'solid-js'\nimport { generateHydrationScript, hydrate, isServer, render, renderToString } from 'solid-js/web'\nimport { App, resolvePage, type InertiaAppProps, type PageResolver } from './App'\n\n/** Renders one page on the server: what the SSR entry exports and `createServer()` serves. */\nexport type RenderPage = (page: Page) => Promise<InertiaAppSSRResponse>\n\n/** In the browser: unmounts the app. On the server: renders a page (see RenderPage). */\nexport type InertiaApp = (() => void) | RenderPage\n\nexport interface SetupOptions {\n el: HTMLElement\n App: typeof App\n props: InertiaAppProps\n}\n\nexport interface CreateInertiaAppOptions {\n /** The id of the root element and of the page script (default `app`). */\n id?: string\n /** Finds a page component by name: `(name) => import(`./pages/${name}.tsx`)`. */\n resolve?: PageResolver\n /** The @inertiajs/vite shorthand (`pages: './pages'`), which the plugin turns into `resolve` at build time. */\n pages?: CoreAppOptions<unknown, unknown, unknown, unknown>['pages']\n /** Mounts the app yourself (browser only); return a function that unmounts it. */\n setup?: (options: SetupOptions) => (() => void) | void\n /** Formats every page title. */\n title?: (title: string) => string\n /** The progress bar (core's NProgress-style bar); false turns it off. */\n progress?: ProgressOptions | false\n}\n\n/**\n * Starts the Inertia app. In the browser it reads the page script (`<script data-page=\"app\">`), resolves the page\n * and mounts App on `#app` (hydrating server-rendered markup), then resolves to a function that unmounts it. On the\n * server (Solid's server build) it resolves to the page renderer @inertiajs/vite's SSR entry exports.\n */\nexport async function createInertiaApp(options: CreateInertiaAppOptions = {}): Promise<InertiaApp> {\n const { id = 'app', resolve, setup, title, progress = {} } = options\n if (resolve === undefined) throw new Error('createInertiaApp() needs a `resolve` function (or `pages` with @inertiajs/vite).')\n const resolveComponent = (name: string, page: Page) => resolvePage(resolve, name, page)\n\n if (isServer) {\n return async (page: Page): Promise<InertiaAppSSRResponse> => {\n let head: string[] = []\n const props: InertiaAppProps = {\n initialPage: page,\n initialComponent: await resolveComponent(page.component, page),\n resolveComponent: (name, next) => resolveComponent(name, next ?? page),\n titleCallback: title,\n onHeadUpdate: (elements) => {\n head = elements\n },\n }\n const html = renderToString(() => createComponent(App, props))\n return { head: [...head, generateHydrationScript()], body: buildSSRBody(id, page, html) }\n }\n }\n\n const initialPage = getInitialPageFromDOM<Page>(id)\n const el = document.getElementById(id)\n if (initialPage === null || el === null) throw new Error(`No Inertia page found: expected <script data-page=\"${id}\"> and an element with id \"${id}\".`)\n const props: InertiaAppProps = {\n initialPage,\n initialComponent: await resolveComponent(initialPage.component, initialPage),\n resolveComponent: (name, page) => resolveComponent(name, page ?? initialPage),\n titleCallback: title,\n }\n if (progress !== false) setupProgress(progress)\n if (setup !== undefined) return setup({ el, App, props }) ?? (() => undefined)\n const app = () => createComponent(App, props)\n return el.hasAttribute('data-server-rendered') ? hydrate(app, el) : render(app, el)\n}\n","import {\n config,\n mergeDataIntoQueryString,\n router,\n shouldIntercept,\n type Method,\n type PrefetchOptions,\n type RequestPayload,\n type VisitOptions,\n} from '@inertiajs/core'\nimport type { LinkProps as OrielLinkProps } from '@orieljs/inertia-client'\nimport { createComponent, createMemo, mergeProps, onCleanup, onMount, splitProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\n\n/** Link's props: Oriel's LinkProps, Inertia's visit callbacks and options, any attribute of the element, and children. */\nexport type LinkProps = OrielLinkProps &\n Pick<\n VisitOptions,\n | 'onCancelToken'\n | 'onBefore'\n | 'onStart'\n | 'onProgress'\n | 'onFinish'\n | 'onCancel'\n | 'onSuccess'\n | 'onError'\n | 'onPrefetching'\n | 'onPrefetched'\n | 'preserveUrl'\n | 'async'\n | 'queryStringArrayFormat'\n | 'viewTransition'\n > &\n Partial<PrefetchOptions> & {\n children?: JSX.Element\n onClick?: (event: MouseEvent) => void\n onMouseEnter?: (event: MouseEvent) => void\n onMouseLeave?: (event: MouseEvent) => void\n onMouseDown?: (event: MouseEvent) => void\n [attribute: string]: unknown\n }\n\nconst LINK_KEYS = [\n 'href',\n 'method',\n 'data',\n 'replace',\n 'preserveScroll',\n 'preserveState',\n 'preserveUrl',\n 'only',\n 'except',\n 'headers',\n 'queryStringArrayFormat',\n 'async',\n 'viewTransition',\n 'as',\n 'prefetch',\n 'cacheFor',\n 'cacheTags',\n 'children',\n 'onClick',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseDown',\n 'onCancelToken',\n 'onBefore',\n 'onStart',\n 'onProgress',\n 'onFinish',\n 'onCancel',\n 'onSuccess',\n 'onError',\n 'onPrefetching',\n 'onPrefetched',\n] as const\n\n/**\n * An Inertia link: `<Link href={route('posts.show', { post: 1 })}>`. A plain left click visits through the router\n * instead of loading the page; modified clicks (new tab) are left to the browser. A non-GET link renders a button.\n * `prefetch` (`true` = `'hover'`, `'click'`, `'mount'`) loads the page into core's prefetch cache ahead of the visit.\n * The visit callbacks (`onBefore`, `onSuccess`, …) and options (`preserveUrl`, `async`, …) go to the router.\n */\nexport function Link(props: LinkProps): JSX.Element {\n const [own, attributes] = splitProps(props, LINK_KEYS)\n const method = createMemo(() => (own.method ?? 'get').toLowerCase() as Method)\n const tag = createMemo(() => {\n const as = (own.as ?? 'a').toLowerCase()\n return as === 'a' && method() !== 'get' ? 'button' : as\n })\n const target = createMemo(() =>\n mergeDataIntoQueryString(method(), own.href, (own.data ?? {}) as RequestPayload, own.queryStringArrayFormat ?? 'brackets'),\n )\n const baseOptions = (): VisitOptions => ({\n data: target()[1] as VisitOptions['data'],\n method: method(),\n preserveScroll: own.preserveScroll ?? false,\n preserveState: own.preserveState ?? method() !== 'get',\n preserveUrl: own.preserveUrl ?? false,\n replace: own.replace ?? false,\n only: own.only ?? [],\n except: own.except ?? [],\n headers: own.headers ?? {},\n async: own.async ?? false,\n })\n const visitOptions = (): VisitOptions => ({\n ...baseOptions(),\n viewTransition: own.viewTransition ?? false,\n onCancelToken: own.onCancelToken,\n onBefore: own.onBefore,\n onStart: own.onStart,\n onProgress: own.onProgress,\n onFinish: own.onFinish,\n onCancel: own.onCancel,\n onSuccess: own.onSuccess,\n onError: own.onError,\n })\n const modes = createMemo(() => (own.prefetch === true ? ['hover'] : own.prefetch ? [own.prefetch] : []))\n // A click-only prefetch is used by the click that follows it, never cached for later.\n const cacheFor = () => {\n const value = own.cacheFor ?? 0\n if (value !== 0) return value\n return modes().length === 1 && modes()[0] === 'click' ? 0 : config.get('prefetch.cacheFor')\n }\n const prefetch = () => {\n if (method() !== 'get') return\n const options = { ...baseOptions(), onPrefetching: own.onPrefetching, onPrefetched: own.onPrefetched }\n router.prefetch(target()[0], options, { cacheFor: cacheFor(), cacheTags: own.cacheTags ?? [] })\n }\n let hoverTimer: ReturnType<typeof setTimeout> | undefined\n onMount(() => {\n if (modes().includes('mount')) prefetch()\n })\n onCleanup(() => clearTimeout(hoverTimer))\n\n return createComponent(\n Dynamic,\n mergeProps(attributes, {\n get component() {\n return tag()\n },\n get href() {\n return tag() === 'a' ? target()[0] : undefined\n },\n get type() {\n return tag() === 'button' ? 'button' : undefined\n },\n get children() {\n return own.children\n },\n onClick: (event: MouseEvent) => {\n // A click within the hover delay visits now: no prefetch after it.\n clearTimeout(hoverTimer)\n own.onClick?.(event)\n if (!shouldIntercept(event)) return\n event.preventDefault()\n router.visit(target()[0], visitOptions())\n },\n onMouseEnter: (event: MouseEvent) => {\n own.onMouseEnter?.(event)\n if (!modes().includes('hover')) return\n clearTimeout(hoverTimer)\n hoverTimer = setTimeout(prefetch, config.get('prefetch.hoverDelay'))\n },\n onMouseLeave: (event: MouseEvent) => {\n own.onMouseLeave?.(event)\n clearTimeout(hoverTimer)\n },\n onMouseDown: (event: MouseEvent) => {\n own.onMouseDown?.(event)\n if (modes().includes('click') && shouldIntercept(event)) prefetch()\n },\n }),\n )\n}\n","import { createForm, type FormHelper } from '@orieljs/inertia-client'\nimport { createSignal, getOwner, onCleanup } from 'solid-js'\n\n/** The form helper as a Solid signal source: reading a field inside JSX or an effect tracks it. */\nexport type SolidForm<T extends object> = Omit<FormHelper<T>, 'subscribe'>\n\nconst STATE = ['data', 'defaults', 'errors', 'hasErrors', 'isDirty', 'processing', 'progress', 'wasSuccessful', 'recentlySuccessful'] as const\n\n/**\n * A form bound to the Inertia router: `const form = useForm({ title: '' })`, then `form.data.title`,\n * `form.setData('title', value)`, `form.post(route('posts.store'))`, `form.errors.title`, `form.processing`.\n * Built on @orieljs/inertia-client's createForm (no remember, no Precognition). Reading a field is reactive.\n */\nexport function useForm<T extends object>(initial: T | (() => T)): SolidForm<T> {\n const helper = createForm(initial)\n const [version, bump] = createSignal(undefined, { equals: false })\n const unsubscribe = helper.subscribe(() => bump())\n if (getOwner() !== null) onCleanup(unsubscribe)\n\n const form = {} as Record<string, unknown>\n for (const key of STATE) {\n Object.defineProperty(form, key, {\n enumerable: true,\n get() {\n version()\n return helper[key]\n },\n })\n }\n for (const key of ['setData', 'setDefaults', 'reset', 'clearErrors', 'resetAndClearErrors', 'setError', 'transform', 'submit', 'get', 'post', 'put', 'patch', 'delete', 'cancel'] as const) {\n form[key] = helper[key]\n }\n return form as unknown as SolidForm<T>\n}\n","import { createComponent, createMemo, type JSX } from 'solid-js'\nimport { When } from './show'\nimport { usePage } from './usePage'\n\nexport interface DeferredProps {\n /** The deferred prop (or props) to wait for. */\n data: string | string[]\n /** Shown until every prop has arrived. */\n fallback: JSX.Element\n children?: JSX.Element\n}\n\n/** Renders `fallback` until the deferred props in `data` have loaded, then the children. */\nexport function Deferred(props: DeferredProps): JSX.Element {\n const page = usePage()\n const keys = createMemo(() => (Array.isArray(props.data) ? props.data : [props.data]))\n return createComponent(When, {\n get when() {\n return keys().every((key) => (page.props as Record<string, unknown>)[key] !== undefined)\n },\n get fallback() {\n return props.fallback\n },\n get children() {\n return props.children\n },\n })\n}\n","import { Show, type Component, type JSX } from 'solid-js'\n\n/** Show without its keyed overload, for createComponent() (the package has no JSX). */\nexport const When = Show as Component<{ when: boolean; fallback?: JSX.Element; children?: JSX.Element }>\n","import { router, type ReloadOptions } from '@inertiajs/core'\nimport { createComponent, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'\nimport { Dynamic, isServer } from 'solid-js/web'\nimport { When } from './show'\nimport { usePage } from './usePage'\n\nexport interface WhenVisibleProps {\n /** The props to load (a partial reload with `only`) when the element scrolls into view. */\n data?: string | string[]\n /** Extra reload options. */\n params?: ReloadOptions\n /** Pixels around the viewport that count as visible (default 0). */\n buffer?: number\n /** The placeholder element's tag (default `div`). */\n as?: string\n /** Reload every time it becomes visible, not only the first time. */\n always?: boolean\n /** Shown until the props have loaded. */\n fallback?: JSX.Element\n children?: JSX.Element\n}\n\n/** Loads props when a placeholder scrolls into view (IntersectionObserver), showing `fallback` until then. */\nexport function WhenVisible(props: WhenVisibleProps): JSX.Element {\n const page = usePage()\n const keys = createMemo(() => (props.data === undefined ? [] : Array.isArray(props.data) ? props.data : [props.data]))\n const arrived = () => keys().length > 0 && keys().every((key) => (page.props as Record<string, unknown>)[key] !== undefined)\n const [loaded, setLoaded] = createSignal(false)\n let fetching = false\n let observer: IntersectionObserver | undefined\n onCleanup(() => observer?.disconnect())\n\n const observe = (element: Element) => {\n if (isServer) return\n observer?.disconnect()\n observer = new window.IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting !== true || fetching) return\n if (props.always !== true) observer?.disconnect()\n fetching = true\n const params = props.params ?? {}\n // Validation errors stay: the response's (empty) errors must not clear the page's.\n router.reload({\n preserveErrors: true,\n ...params,\n ...(keys().length > 0 ? { only: keys() } : {}),\n onFinish: (visit) => {\n fetching = false\n setLoaded(true)\n params.onFinish?.(visit)\n },\n })\n },\n { rootMargin: `${props.buffer ?? 0}px` },\n )\n observer.observe(element)\n }\n\n const visible = () => loaded() || arrived()\n return [\n createComponent(When, {\n get when() {\n return props.always === true || !visible()\n },\n get children() {\n return createComponent(Dynamic, {\n get component() {\n return props.as ?? 'div'\n },\n ref: observe,\n })\n },\n }),\n createComponent(When, {\n get when() {\n return visible()\n },\n get fallback() {\n return props.fallback\n },\n get children() {\n return props.children\n },\n }),\n ] as unknown as JSX.Element\n}\n","import { children as resolveChildren, createRenderEffect, getOwner, onCleanup, runWithOwner, sharedConfig, useContext, type JSX } from 'solid-js'\nimport { insert, isServer, resolveSSRNode } from 'solid-js/web'\nimport { HeadContext } from './context'\n\nexport interface HeadProps {\n /** The page title (passed through createInertiaApp's `title` callback). */\n title?: string\n /** Head tags: `<meta>`, `<link>`, … A `head-key` attribute replaces the tag with the same key from a layout. */\n children?: JSX.Element\n}\n\nconst escapeHtml = (value: string) => value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;')\n\n// A tag's name and attributes. Values are double-quoted (Solid's server output, outerHTML), so they may hold `>`.\nconst OPENING_TAG = /^<([a-zA-Z][\\w-]*)((?:\\s+[^\\s\"'>/=]+(?:=\"[^\"]*\")?)*)/\nconst ATTRIBUTE = /\\s+([^\\s\"'>/=]+)(?:=\"([^\"]*)\")?/g\n\n/** One tag as the head manager wants it: marked `data-inertia` (the `head-key`, or empty), no hydration key. */\nfunction markTag(html: string): string {\n const tag = OPENING_TAG.exec(html)\n if (tag === null) return html\n let key: string | undefined\n let marked = false\n const attributes = (tag[2] ?? '').replace(ATTRIBUTE, (attribute, name: string, value: string | undefined) => {\n if (name === 'data-hk') return ''\n if (name === 'head-key') {\n key = value ?? ''\n return ''\n }\n if (name === 'data-inertia') marked = true\n return attribute\n })\n const mark = key !== undefined ? ` data-inertia=\"${key}\"` : marked ? '' : ' data-inertia=\"\"'\n return `<${tag[1]}${mark}${attributes}${html.slice(tag[0].length)}`\n}\n\n/**\n * Sets the document title and head tags for the current page through core's head manager:\n * `<Head title=\"Posts\"><meta name=\"description\" content=\"…\" /></Head>`. On the server the tags go into the SSR\n * response's `head`; in the browser they replace the previous page's tags.\n */\nexport function Head(props: HeadProps): JSX.Element {\n const manager = useContext(HeadContext)\n if (manager === undefined) throw new Error('<Head> must be rendered inside the Inertia app (createInertiaApp).')\n const provider = manager.createProvider()\n // Not on the server: disposing the render root would run this and wipe the head before the response reads it.\n if (!isServer) onCleanup(() => provider.disconnect())\n const title = () => (props.title === undefined ? [] : [`<title data-inertia=\"\">${escapeHtml(props.title)}</title>`])\n\n if (isServer) {\n const tags = resolveChildren(() => props.children)\n .toArray()\n .map((node) => resolveSSRNode(node))\n .filter((html) => html.startsWith('<'))\n provider.update([...title(), ...tags.map(markTag)])\n return null\n }\n\n // In the browser the tags render into a detached element, so Solid keeps their attributes up to date; every\n // change is sent to the head manager. Never while hydrating: the server sent no markup for them.\n const owner = getOwner()\n const start = () => {\n const container = document.createElement('div')\n const commit = () => provider.update([...title(), ...Array.from(container.children, (element) => markTag(element.outerHTML))])\n const observer = new window.MutationObserver(commit)\n observer.observe(container, { subtree: true, childList: true, attributes: true, characterData: true })\n onCleanup(() => observer.disconnect())\n insert(container, () => props.children)\n createRenderEffect(commit)\n }\n if (sharedConfig.context) queueMicrotask(() => runWithOwner(owner, start))\n else start()\n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AAM,WAAW,QAAQ,eAAe;AAExC,MAAI,CAACC,UAAU,CAAAC,WAAU,MAAM,SAAS,WAAW,CAAC;AACpD,QAAM,QAAQ,MAAO,MAAM,UAAU,SAAY,CAAC,IAAI,CAAC,0BAA0B,WAAW,MAAM,KAAK,CAAC,UAAU;AAElH,MAAID,WAAU;AACZ,UAAM,OAAO,gBAAgB,MAAM,MAAM,QAAQ,EAC9C,QAAQ,EACR,IAAI,CAAC,SAAS,eAAe,IAAI,CAAC,EAClC,OAAO,CAAC,SAAS,KAAK,WAAW,GAAG,CAAC;AACxC,aAAS,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC;AAClD,WAAO;AAAA,EACT;AAIA,QAAM,QAAQE,UAAS;AACvB,QAAM,QAAQ,MAAM;AAClB,UAAM,YAAY,SAAS,cAAc,KAAK;AAC9C,UAAM,SAAS,MAAM,SAAS,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM,KAAK,UAAU,UAAU,CAAC,YAAY,QAAQ,QAAQ,SAAS,CAAC,CAAC,CAAC;AAC7H,UAAM,WAAW,IAAI,OAAO,iBAAiB,MAAM;AACnD,aAAS,QAAQ,WAAW,EAAE,SAAS,MAAM,WAAW,MAAM,YAAY,MAAM,eAAe,KAAK,CAAC;AACrG,IAAAD,WAAU,MAAM,SAAS,WAAW,CAAC;AACrC,WAAO,WAAW,MAAM,MAAM,QAAQ;AACtC,uBAAmB,MAAM;AAAA,EAC3B;AACA,MAAI,aAAa,QAAS,gBAAe,MAAM,aAAa,OAAO,KAAK,CAAC;AAAA,MACpE,OAAM;AACX,SAAO;AACT;","names":["router","createComponent","isServer","isServer","props","createComponent","router","createComponent","createMemo","mergeProps","createSignal","onCleanup","createComponent","createMemo","createMemo","createComponent","router","createComponent","createMemo","createSignal","onCleanup","Dynamic","isServer","createMemo","createSignal","onCleanup","isServer","router","createComponent","Dynamic","getOwner","onCleanup","useContext","isServer","useContext","isServer","onCleanup","getOwner"]}
1
+ {"version":3,"sources":["../index.ts","../usePage.ts","../context.ts","../App.ts","../createInertiaApp.ts","../Link.ts","../useForm.ts","../Deferred.ts","../show.ts","../WhenVisible.ts","../Head.ts"],"sourcesContent":["export { router } from '@inertiajs/core'\nexport {\n currentRoute,\n hasRoute,\n isCurrentRoute,\n route,\n RouteError,\n type ErrorBags,\n type Errors,\n type PageName,\n type PageProps,\n type Pages,\n type RouteList,\n type RouteName,\n type SharedProps,\n type TypedPage,\n} from '@orieljs/inertia-client'\nexport { usePage } from './usePage'\nexport { App, type InertiaAppProps, type LayoutComponent, type PageComponent, type PageModule, type PageResolver, type ResolvedPage } from './App'\nexport { createInertiaApp, type CreateInertiaAppOptions, type InertiaApp, type RenderPage, type SetupOptions } from './createInertiaApp'\nexport { Link, type LinkProps } from './Link'\nexport { useForm, type SolidForm } from './useForm'\nexport { Deferred, type DeferredProps } from './Deferred'\nexport { WhenVisible, type WhenVisibleProps } from './WhenVisible'\nexport { Head, type HeadProps } from './Head'\n","import type { PageName, TypedPage } from '@orieljs/inertia-client'\nimport { useContext } from 'solid-js'\nimport { PageContext } from './context'\n\n/**\n * The current page, typed by name: `usePage<'Posts/Index'>().props.posts`. The page is a store: read its fields\n * inside JSX, an effect or a memo to react to visits. Call it inside a component rendered by the Inertia app.\n */\nexport function usePage<N extends PageName = PageName>(): TypedPage<N> {\n const page = useContext(PageContext)\n if (page === undefined) throw new Error('usePage() must be called inside a component rendered by createInertiaApp().')\n return page as unknown as TypedPage<N>\n}\n","import type { HeadManager, Page } from '@inertiajs/core'\nimport { createContext } from 'solid-js'\n\n/** The current page: a Solid store, so reading `page.props.x` inside JSX or an effect is reactive. */\nexport const PageContext = createContext<Page>()\n\n/** The head manager of the running app (core's createHeadManager), used by Head. */\nexport const HeadContext = createContext<HeadManager>()\n","import { createHeadManager, router, type Page } from '@inertiajs/core'\nimport { batch, createComponent, createMemo, createSignal, mergeProps, untrack, type Component, type JSX } from 'solid-js'\nimport { createStore, reconcile } from 'solid-js/store'\nimport { isServer } from 'solid-js/web'\nimport { HeadContext, PageContext } from './context'\n\n// Page and layout props are the page's props, which each page types itself (PageProps<'Posts/Index'>).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyProps = any\n\n/** A persistent layout: it gets the page props, and the page (or the next layout) as `children`. */\nexport type LayoutComponent = Component<AnyProps>\n\n/** A page component. `Home.layout = AppLayout` (or `[Outer, Inner]`) wraps it in layouts that survive visits. */\nexport type PageComponent = Component<AnyProps> & { layout?: LayoutComponent | LayoutComponent[] }\n\n/** What a resolver returns: the component, or its module (`{ default, layout? }`, e.g. `import('./pages/Home.tsx')`). */\nexport type PageModule = PageComponent | { default: PageComponent; layout?: LayoutComponent | LayoutComponent[] }\n\n/** Finds the page component for a name: `(name) => import(`./pages/${name}.tsx`)`. */\nexport type PageResolver = (name: string, page: Page) => PageModule | Promise<PageModule>\n\n/** A page ready to render: its component and its layouts, outermost first. */\nexport interface ResolvedPage {\n readonly component: PageComponent\n readonly layouts: readonly LayoutComponent[]\n}\n\n/** Resolves a page name to its component and layouts (a module's `layout` export wins over the component's). */\nexport async function resolvePage(resolve: PageResolver, name: string, page: Page): Promise<ResolvedPage> {\n // Nothing at all for an unknown name too, from a hand-written resolver such as `(name) => pages[name]`.\n const module: PageModule | null | undefined = await resolve(name, page)\n const component = typeof module === 'function' ? module : module?.default\n if (typeof component !== 'function') throw new Error(`The page [${name}] did not resolve to a Solid component.`)\n const layout = (typeof module === 'function' ? undefined : module?.layout) ?? component.layout\n return { component, layouts: layout === undefined ? [] : Array.isArray(layout) ? layout : [layout] }\n}\n\nexport interface InertiaAppProps {\n initialPage: Page\n initialComponent: ResolvedPage\n resolveComponent: (name: string, page?: Page) => Promise<ResolvedPage>\n /** Formats every page title (`(title) => `${title} - My App``). */\n titleCallback?: (title: string) => string\n /** Receives the head tags on the server (SSR collects them into `head`). */\n onHeadUpdate?: (elements: string[]) => void\n}\n\n/**\n * The Inertia root: owns the current page (a store, read through usePage()), lets the router swap pages, and\n * renders the page inside its layouts. A visit to another component, or one without preserveState, remounts the\n * page; layouts that stay the same between two pages are kept, with their state.\n */\nexport function App(props: InertiaAppProps): JSX.Element {\n // The store gets its own copy: reconcile() updates it in place, and core's page objects (history, prefetch cache)\n // must not change under it.\n const [page, setPage] = createStore<Page>(structuredClone({ ...props.initialPage, flash: props.initialPage.flash ?? {} }))\n const [view, setView] = createSignal<ResolvedPage>(props.initialComponent)\n const titleCallback = props.titleCallback ?? ((title: string) => title)\n const headManager = createHeadManager(isServer, titleCallback, props.onHeadUpdate ?? (() => undefined))\n\n if (!isServer) {\n router.init<ResolvedPage>({\n initialPage: props.initialPage,\n resolveComponent: props.resolveComponent as never,\n swapComponent: async ({ component, page: next, preserveState }) => {\n batch(() => {\n setPage(reconcile(structuredClone({ ...next, flash: next.flash ?? {} })))\n if (!preserveState || component.component !== view().component) setView(component)\n })\n },\n onFlash: (flash) => setPage('flash', reconcile(structuredClone(flash))),\n })\n }\n\n // One memo per layout level: a level is rebuilt only when its layout changes, so a shared layout persists.\n // Components get their props as a function source, not as `page.props` itself: reconcile() replaces the props\n // object (instead of merging into it) when the top-level `id` differs, and a held reference would go stale.\n const level = (index: number): JSX.Element => {\n const layout = createMemo(() => view().layouts[index])\n return createMemo(() => {\n const Layout = layout()\n if (Layout === undefined) {\n return createMemo(() => {\n const { component } = view()\n return untrack(() => createComponent(component, mergeProps(() => page.props)))\n }) as unknown as JSX.Element\n }\n // A layout gets the page props and the next level as children.\n const children = { get children() { return level(index + 1) } }\n return untrack(() => createComponent(Layout, mergeProps(() => page.props, children)))\n }) as unknown as JSX.Element\n }\n\n return createComponent(HeadContext.Provider, {\n value: headManager,\n get children() {\n return createComponent(PageContext.Provider, {\n value: page,\n get children() {\n return level(0)\n },\n })\n },\n })\n}\n","import {\n buildSSRBody,\n getInitialPageFromDOM,\n setupProgress,\n type CreateInertiaAppOptions as CoreAppOptions,\n type InertiaAppSSRResponse,\n type Page,\n type ProgressOptions,\n} from '@inertiajs/core'\nimport { createComponent } from 'solid-js'\nimport { generateHydrationScript, hydrate, isServer, render, renderToString } from 'solid-js/web'\nimport { App, resolvePage, type InertiaAppProps, type PageResolver } from './App'\n\n/** Renders one page on the server: what the SSR entry exports and `createServer()` serves. */\nexport type RenderPage = (page: Page) => Promise<InertiaAppSSRResponse>\n\n/** In the browser: unmounts the app. On the server: renders a page (see RenderPage). */\nexport type InertiaApp = (() => void) | RenderPage\n\nexport interface SetupOptions {\n el: HTMLElement\n App: typeof App\n props: InertiaAppProps\n}\n\nexport interface CreateInertiaAppOptions {\n /** The id of the root element and of the page script (default `app`). */\n id?: string\n /** Finds a page component by name: `(name) => import(`./pages/${name}.tsx`)`. */\n resolve?: PageResolver\n /** The @inertiajs/vite shorthand (`pages: './pages'`), which the plugin turns into `resolve` at build time. */\n pages?: CoreAppOptions<unknown, unknown, unknown, unknown>['pages']\n /** Mounts the app yourself (browser only); return a function that unmounts it. */\n setup?: (options: SetupOptions) => (() => void) | void\n /** Formats every page title. */\n title?: (title: string) => string\n /** The progress bar (core's NProgress-style bar); false turns it off. */\n progress?: ProgressOptions | false\n}\n\n/**\n * Starts the Inertia app. In the browser it reads the page script (`<script data-page=\"app\">`), resolves the page\n * and mounts App on `#app` (hydrating server-rendered markup), then resolves to a function that unmounts it. On the\n * server (Solid's server build) it resolves to the page renderer @inertiajs/vite's SSR entry exports.\n */\nexport async function createInertiaApp(options: CreateInertiaAppOptions = {}): Promise<InertiaApp> {\n const { id = 'app', resolve, setup, title, progress = {} } = options\n if (resolve === undefined) throw new Error('createInertiaApp() needs a `resolve` function (or `pages` with @inertiajs/vite).')\n const resolveComponent = (name: string, page: Page) => resolvePage(resolve, name, page)\n\n if (isServer) {\n return async (page: Page): Promise<InertiaAppSSRResponse> => {\n let head: string[] = []\n const props: InertiaAppProps = {\n initialPage: page,\n initialComponent: await resolveComponent(page.component, page),\n resolveComponent: (name, next) => resolveComponent(name, next ?? page),\n titleCallback: title,\n onHeadUpdate: (elements) => {\n head = elements\n },\n }\n const html = renderToString(() => createComponent(App, props))\n return { head: [...head, generateHydrationScript()], body: buildSSRBody(id, page, html) }\n }\n }\n\n const initialPage = getInitialPageFromDOM<Page>(id)\n const el = document.getElementById(id)\n if (initialPage === null || el === null) throw new Error(`No Inertia page found: expected <script data-page=\"${id}\"> and an element with id \"${id}\".`)\n const props: InertiaAppProps = {\n initialPage,\n initialComponent: await resolveComponent(initialPage.component, initialPage),\n resolveComponent: (name, page) => resolveComponent(name, page ?? initialPage),\n titleCallback: title,\n }\n if (progress !== false) setupProgress(progress)\n if (setup !== undefined) return setup({ el, App, props }) ?? (() => undefined)\n const app = () => createComponent(App, props)\n return el.hasAttribute('data-server-rendered') ? hydrate(app, el) : render(app, el)\n}\n","import {\n config,\n mergeDataIntoQueryString,\n router,\n shouldIntercept,\n type Method,\n type PrefetchOptions,\n type RequestPayload,\n type VisitOptions,\n} from '@inertiajs/core'\nimport type { LinkProps as OrielLinkProps } from '@orieljs/inertia-client'\nimport { createComponent, createMemo, mergeProps, onCleanup, onMount, splitProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\n\n/** Link's props: Oriel's LinkProps, Inertia's visit callbacks and options, any attribute of the element, and children. */\nexport type LinkProps = OrielLinkProps &\n Pick<\n VisitOptions,\n | 'onCancelToken'\n | 'onBefore'\n | 'onStart'\n | 'onProgress'\n | 'onFinish'\n | 'onCancel'\n | 'onSuccess'\n | 'onError'\n | 'onPrefetching'\n | 'onPrefetched'\n | 'preserveUrl'\n | 'async'\n | 'queryStringArrayFormat'\n | 'viewTransition'\n > &\n Partial<PrefetchOptions> & {\n children?: JSX.Element\n onClick?: (event: MouseEvent) => void\n onMouseEnter?: (event: MouseEvent) => void\n onMouseLeave?: (event: MouseEvent) => void\n onMouseDown?: (event: MouseEvent) => void\n [attribute: string]: unknown\n }\n\nconst LINK_KEYS = [\n 'href',\n 'method',\n 'data',\n 'replace',\n 'preserveScroll',\n 'preserveState',\n 'preserveUrl',\n 'only',\n 'except',\n 'headers',\n 'queryStringArrayFormat',\n 'async',\n 'viewTransition',\n 'as',\n 'prefetch',\n 'cacheFor',\n 'cacheTags',\n 'children',\n 'onClick',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseDown',\n 'onCancelToken',\n 'onBefore',\n 'onStart',\n 'onProgress',\n 'onFinish',\n 'onCancel',\n 'onSuccess',\n 'onError',\n 'onPrefetching',\n 'onPrefetched',\n] as const\n\n/**\n * The element's class props. Solid's server rendering of a spread `class` appends a space (\"nav-link \"), so a class\n * on its own is set as the attribute; with a classList, both are spread as given.\n */\nfunction classProps(classes: { class?: unknown; classList?: unknown }): object {\n if ('classList' in classes) return classes\n return {\n get 'attr:class'() {\n return classes.class\n },\n }\n}\n\n/**\n * An Inertia link: `<Link href={route('posts.show', { post: 1 })}>`. A plain left click visits through the router\n * instead of loading the page; modified clicks (new tab) are left to the browser. A non-GET link renders a button.\n * `prefetch` (`true` = `'hover'`, `'click'`, `'mount'`) loads the page into core's prefetch cache ahead of the visit.\n * The visit callbacks (`onBefore`, `onSuccess`, …) and options (`preserveUrl`, `async`, …) go to the router.\n */\nexport function Link(props: LinkProps): JSX.Element {\n const [own, classes, attributes] = splitProps(props, LINK_KEYS, ['class', 'classList'])\n const method = createMemo(() => (own.method ?? 'get').toLowerCase() as Method)\n const tag = createMemo(() => {\n const as = (own.as ?? 'a').toLowerCase()\n return as === 'a' && method() !== 'get' ? 'button' : as\n })\n const target = createMemo(() =>\n mergeDataIntoQueryString(method(), own.href, (own.data ?? {}) as RequestPayload, own.queryStringArrayFormat ?? 'brackets'),\n )\n const baseOptions = (): VisitOptions => ({\n data: target()[1] as VisitOptions['data'],\n method: method(),\n preserveScroll: own.preserveScroll ?? false,\n preserveState: own.preserveState ?? method() !== 'get',\n preserveUrl: own.preserveUrl ?? false,\n replace: own.replace ?? false,\n only: own.only ?? [],\n except: own.except ?? [],\n headers: own.headers ?? {},\n async: own.async ?? false,\n })\n const visitOptions = (): VisitOptions => ({\n ...baseOptions(),\n viewTransition: own.viewTransition ?? false,\n onCancelToken: own.onCancelToken,\n onBefore: own.onBefore,\n onStart: own.onStart,\n onProgress: own.onProgress,\n onFinish: own.onFinish,\n onCancel: own.onCancel,\n onSuccess: own.onSuccess,\n onError: own.onError,\n })\n const modes = createMemo(() => (own.prefetch === true ? ['hover'] : own.prefetch ? [own.prefetch] : []))\n // A click-only prefetch is used by the click that follows it, never cached for later.\n const cacheFor = () => {\n const value = own.cacheFor ?? 0\n if (value !== 0) return value\n return modes().length === 1 && modes()[0] === 'click' ? 0 : config.get('prefetch.cacheFor')\n }\n const prefetch = () => {\n if (method() !== 'get') return\n const options = { ...baseOptions(), onPrefetching: own.onPrefetching, onPrefetched: own.onPrefetched }\n router.prefetch(target()[0], options, { cacheFor: cacheFor(), cacheTags: own.cacheTags ?? [] })\n }\n let hoverTimer: ReturnType<typeof setTimeout> | undefined\n onMount(() => {\n if (modes().includes('mount')) prefetch()\n })\n onCleanup(() => clearTimeout(hoverTimer))\n\n return createComponent(\n Dynamic,\n mergeProps(attributes, classProps(classes), {\n get component() {\n return tag()\n },\n get href() {\n return tag() === 'a' ? target()[0] : undefined\n },\n get type() {\n return tag() === 'button' ? 'button' : undefined\n },\n get children() {\n return own.children\n },\n onClick: (event: MouseEvent) => {\n // A click within the hover delay visits now: no prefetch after it.\n clearTimeout(hoverTimer)\n own.onClick?.(event)\n if (!shouldIntercept(event)) return\n event.preventDefault()\n router.visit(target()[0], visitOptions())\n },\n onMouseEnter: (event: MouseEvent) => {\n own.onMouseEnter?.(event)\n if (!modes().includes('hover')) return\n clearTimeout(hoverTimer)\n hoverTimer = setTimeout(prefetch, config.get('prefetch.hoverDelay'))\n },\n onMouseLeave: (event: MouseEvent) => {\n own.onMouseLeave?.(event)\n clearTimeout(hoverTimer)\n },\n onMouseDown: (event: MouseEvent) => {\n own.onMouseDown?.(event)\n if (modes().includes('click') && shouldIntercept(event)) prefetch()\n },\n }),\n )\n}\n","import { createForm, type FormHelper } from '@orieljs/inertia-client'\nimport { createSignal, getOwner, onCleanup } from 'solid-js'\n\n/** The form helper as a Solid signal source: reading a field inside JSX or an effect tracks it. */\nexport type SolidForm<T extends object> = Omit<FormHelper<T>, 'subscribe'>\n\nconst STATE = ['data', 'defaults', 'errors', 'hasErrors', 'isDirty', 'processing', 'progress', 'wasSuccessful', 'recentlySuccessful'] as const\n\n/**\n * A form bound to the Inertia router: `const form = useForm({ title: '' })`, then `form.data.title`,\n * `form.setData('title', value)`, `form.post(route('posts.store'))`, `form.errors.title`, `form.processing`.\n * Built on @orieljs/inertia-client's createForm (no remember, no Precognition). Reading a field is reactive.\n */\nexport function useForm<T extends object>(initial: T | (() => T)): SolidForm<T> {\n const helper = createForm(initial)\n const [version, bump] = createSignal(undefined, { equals: false })\n const unsubscribe = helper.subscribe(() => bump())\n if (getOwner() !== null) onCleanup(unsubscribe)\n\n const form = {} as Record<string, unknown>\n for (const key of STATE) {\n Object.defineProperty(form, key, {\n enumerable: true,\n get() {\n version()\n return helper[key]\n },\n })\n }\n for (const key of ['setData', 'setDefaults', 'reset', 'clearErrors', 'resetAndClearErrors', 'setError', 'transform', 'submit', 'get', 'post', 'put', 'patch', 'delete', 'cancel'] as const) {\n form[key] = helper[key]\n }\n return form as unknown as SolidForm<T>\n}\n","import { createComponent, createMemo, type JSX } from 'solid-js'\nimport { When } from './show'\nimport { usePage } from './usePage'\n\nexport interface DeferredProps {\n /** The deferred prop (or props) to wait for. */\n data: string | string[]\n /** Shown until every prop has arrived. */\n fallback: JSX.Element\n children?: JSX.Element\n}\n\n/** Renders `fallback` until the deferred props in `data` have loaded, then the children. */\nexport function Deferred(props: DeferredProps): JSX.Element {\n const page = usePage()\n const keys = createMemo(() => (Array.isArray(props.data) ? props.data : [props.data]))\n return createComponent(When, {\n get when() {\n return keys().every((key) => (page.props as Record<string, unknown>)[key] !== undefined)\n },\n get fallback() {\n return props.fallback\n },\n get children() {\n return props.children\n },\n })\n}\n","import { Show, type Component, type JSX } from 'solid-js'\n\n/** Show without its keyed overload, for createComponent() (the package has no JSX). */\nexport const When = Show as Component<{ when: boolean; fallback?: JSX.Element; children?: JSX.Element }>\n","import { router, type ReloadOptions } from '@inertiajs/core'\nimport { createComponent, createMemo, createSignal, onCleanup, type JSX } from 'solid-js'\nimport { Dynamic, isServer } from 'solid-js/web'\nimport { When } from './show'\nimport { usePage } from './usePage'\n\nexport interface WhenVisibleProps {\n /** The props to load (a partial reload with `only`) when the element scrolls into view. */\n data?: string | string[]\n /** Extra reload options. */\n params?: ReloadOptions\n /** Pixels around the viewport that count as visible (default 0). */\n buffer?: number\n /** The placeholder element's tag (default `div`). */\n as?: string\n /** Reload every time it becomes visible, not only the first time. */\n always?: boolean\n /** Shown until the props have loaded. */\n fallback?: JSX.Element\n children?: JSX.Element\n}\n\n/** Loads props when a placeholder scrolls into view (IntersectionObserver), showing `fallback` until then. */\nexport function WhenVisible(props: WhenVisibleProps): JSX.Element {\n const page = usePage()\n const keys = createMemo(() => (props.data === undefined ? [] : Array.isArray(props.data) ? props.data : [props.data]))\n const arrived = () => keys().length > 0 && keys().every((key) => (page.props as Record<string, unknown>)[key] !== undefined)\n const [loaded, setLoaded] = createSignal(false)\n let fetching = false\n let observer: IntersectionObserver | undefined\n onCleanup(() => observer?.disconnect())\n\n const observe = (element: Element) => {\n if (isServer) return\n observer?.disconnect()\n observer = new window.IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting !== true || fetching) return\n if (props.always !== true) observer?.disconnect()\n fetching = true\n const params = props.params ?? {}\n // Validation errors stay: the response's (empty) errors must not clear the page's.\n router.reload({\n preserveErrors: true,\n ...params,\n ...(keys().length > 0 ? { only: keys() } : {}),\n onFinish: (visit) => {\n fetching = false\n setLoaded(true)\n params.onFinish?.(visit)\n },\n })\n },\n { rootMargin: `${props.buffer ?? 0}px` },\n )\n observer.observe(element)\n }\n\n const visible = () => loaded() || arrived()\n return [\n createComponent(When, {\n get when() {\n return props.always === true || !visible()\n },\n get children() {\n return createComponent(Dynamic, {\n get component() {\n return props.as ?? 'div'\n },\n ref: observe,\n })\n },\n }),\n createComponent(When, {\n get when() {\n return visible()\n },\n get fallback() {\n return props.fallback\n },\n get children() {\n return props.children\n },\n }),\n ] as unknown as JSX.Element\n}\n","import { children as resolveChildren, createRenderEffect, getOwner, onCleanup, runWithOwner, sharedConfig, useContext, type JSX } from 'solid-js'\nimport { insert, isServer, resolveSSRNode } from 'solid-js/web'\nimport { HeadContext } from './context'\n\nexport interface HeadProps {\n /** The page title (passed through createInertiaApp's `title` callback). */\n title?: string\n /** Head tags: `<meta>`, `<link>`, … A `head-key` attribute replaces the tag with the same key from a layout. */\n children?: JSX.Element\n}\n\nconst escapeHtml = (value: string) => value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;')\n\n// A tag's name and attributes. Values are double-quoted (Solid's server output, outerHTML), so they may hold `>`.\nconst OPENING_TAG = /^<([a-zA-Z][\\w-]*)((?:\\s+[^\\s\"'>/=]+(?:=\"[^\"]*\")?)*)/\nconst ATTRIBUTE = /\\s+([^\\s\"'>/=]+)(?:=\"([^\"]*)\")?/g\n\n/** One tag as the head manager wants it: marked `data-inertia` (the `head-key`, or empty), no hydration key. */\nfunction markTag(html: string): string {\n const tag = OPENING_TAG.exec(html)\n if (tag === null) return html\n let key: string | undefined\n let marked = false\n const attributes = (tag[2] ?? '').replace(ATTRIBUTE, (attribute, name: string, value: string | undefined) => {\n if (name === 'data-hk') return ''\n if (name === 'head-key') {\n key = value ?? ''\n return ''\n }\n if (name === 'data-inertia') marked = true\n return attribute\n })\n const mark = key !== undefined ? ` data-inertia=\"${key}\"` : marked ? '' : ' data-inertia=\"\"'\n return `<${tag[1]}${mark}${attributes}${html.slice(tag[0].length)}`\n}\n\n/**\n * Sets the document title and head tags for the current page through core's head manager:\n * `<Head title=\"Posts\"><meta name=\"description\" content=\"…\" /></Head>`. On the server the tags go into the SSR\n * response's `head`; in the browser they replace the previous page's tags.\n */\nexport function Head(props: HeadProps): JSX.Element {\n const manager = useContext(HeadContext)\n if (manager === undefined) throw new Error('<Head> must be rendered inside the Inertia app (createInertiaApp).')\n const provider = manager.createProvider()\n // Not on the server: disposing the render root would run this and wipe the head before the response reads it.\n if (!isServer) onCleanup(() => provider.disconnect())\n const title = () => (props.title === undefined ? [] : [`<title data-inertia=\"\">${escapeHtml(props.title)}</title>`])\n\n if (isServer) {\n const tags = resolveChildren(() => props.children)\n .toArray()\n .map((node) => resolveSSRNode(node))\n .filter((html) => html.startsWith('<'))\n provider.update([...title(), ...tags.map(markTag)])\n return null\n }\n\n // In the browser the tags render into a detached element, so Solid keeps their attributes up to date; every\n // change is sent to the head manager. Never while hydrating: the server sent no markup for them.\n const owner = getOwner()\n const start = () => {\n const container = document.createElement('div')\n const commit = () => provider.update([...title(), ...Array.from(container.children, (element) => markTag(element.outerHTML))])\n const observer = new window.MutationObserver(commit)\n observer.observe(container, { subtree: true, childList: true, attributes: true, characterData: true })\n onCleanup(() => observer.disconnect())\n insert(container, () => props.children)\n createRenderEffect(commit)\n }\n if (sharedConfig.context) queueMicrotask(() => runWithOwner(owner, start))\n else start()\n return null\n}\n"],"mappings":";AAAA,SAAS,UAAAA,eAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAUK;;;ACfP,SAAS,kBAAkB;;;ACA3B,SAAS,qBAAqB;AAGvB,IAAM,cAAc,cAAoB;AAGxC,IAAM,cAAc,cAA2B;;;ADC/C,SAAS,UAAuD;AACrE,QAAM,OAAO,WAAW,WAAW;AACnC,MAAI,SAAS,OAAW,OAAM,IAAI,MAAM,6EAA6E;AACrH,SAAO;AACT;;;AEZA,SAAS,mBAAmB,cAAyB;AACrD,SAAS,OAAO,iBAAiB,YAAY,cAAc,YAAY,eAAyC;AAChH,SAAS,aAAa,iBAAiB;AACvC,SAAS,gBAAgB;AA0BzB,eAAsB,YAAY,SAAuB,MAAc,MAAmC;AA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,SAAS,KAAK,WAAW,GAAG,CAAC;AACxC,aAAS,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC;AAClD,WAAO;AAAA,EACT;AAIA,QAAM,QAAQE,UAAS;AACvB,QAAM,QAAQ,MAAM;AAClB,UAAM,YAAY,SAAS,cAAc,KAAK;AAC9C,UAAM,SAAS,MAAM,SAAS,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM,KAAK,UAAU,UAAU,CAAC,YAAY,QAAQ,QAAQ,SAAS,CAAC,CAAC,CAAC;AAC7H,UAAM,WAAW,IAAI,OAAO,iBAAiB,MAAM;AACnD,aAAS,QAAQ,WAAW,EAAE,SAAS,MAAM,WAAW,MAAM,YAAY,MAAM,eAAe,KAAK,CAAC;AACrG,IAAAD,WAAU,MAAM,SAAS,WAAW,CAAC;AACrC,WAAO,WAAW,MAAM,MAAM,QAAQ;AACtC,uBAAmB,MAAM;AAAA,EAC3B;AACA,MAAI,aAAa,QAAS,gBAAe,MAAM,aAAa,OAAO,KAAK,CAAC;AAAA,MACpE,OAAM;AACX,SAAO;AACT;","names":["router","createComponent","isServer","isServer","props","createComponent","router","createComponent","createMemo","mergeProps","createSignal","onCleanup","createComponent","createMemo","createMemo","createComponent","router","createComponent","createMemo","createSignal","onCleanup","Dynamic","isServer","createMemo","createSignal","onCleanup","isServer","router","createComponent","Dynamic","getOwner","onCleanup","useContext","isServer","useContext","isServer","onCleanup","getOwner"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orieljs/inertia-solid",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "The Oriel Solid adapter for Inertia: createInertiaApp, Link, Head, useForm and typed pages, with SSR and hydration.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -35,13 +35,13 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@inertiajs/core": "3.7.1",
38
- "@orieljs/inertia-client": "0.1.0-alpha.4"
38
+ "@orieljs/inertia-client": "0.1.0-alpha.5"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "solid-js": "^1.9.0"
42
42
  },
43
43
  "devDependencies": {
44
- "solid-js": "1.9.15"
44
+ "solid-js": "1.9.16"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsup && node ../../../scripts/copy-license.mjs"