@fictjs/runtime 0.16.0 → 0.17.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/advanced.cjs +9 -9
- package/dist/advanced.js +4 -4
- package/dist/{chunk-CBRGOLTR.cjs → chunk-5FVWBK4M.cjs} +40 -40
- package/dist/{chunk-CBRGOLTR.cjs.map → chunk-5FVWBK4M.cjs.map} +1 -1
- package/dist/{chunk-BADX4WTQ.cjs → chunk-6DNYVH5U.cjs} +17 -17
- package/dist/{chunk-BADX4WTQ.cjs.map → chunk-6DNYVH5U.cjs.map} +1 -1
- package/dist/{chunk-MAHWGB55.js → chunk-CFAWL76V.js} +5 -5
- package/dist/{chunk-MAHWGB55.js.map → chunk-CFAWL76V.js.map} +1 -1
- package/dist/{chunk-WJMZ7X46.cjs → chunk-ECKYFH5Q.cjs} +5 -5
- package/dist/{chunk-WJMZ7X46.cjs.map → chunk-ECKYFH5Q.cjs.map} +1 -1
- package/dist/{chunk-ZJZ6LMDN.js → chunk-F5SDRX4J.js} +2 -2
- package/dist/{chunk-ZJZ6LMDN.js.map → chunk-F5SDRX4J.js.map} +1 -1
- package/dist/{chunk-4P4DYWLQ.js → chunk-IIWHTV23.js} +3 -3
- package/dist/{chunk-AR2T7JEX.cjs → chunk-INYTG4NG.cjs} +174 -174
- package/dist/{chunk-AR2T7JEX.cjs.map → chunk-INYTG4NG.cjs.map} +1 -1
- package/dist/{chunk-RK2WSQYL.js → chunk-M42N54LG.js} +3 -3
- package/dist/{chunk-ZWQLXWSV.js → chunk-UQTWIV3S.js} +3 -3
- package/dist/{chunk-ECNK25S4.cjs → chunk-WY4LI5PB.cjs} +8 -8
- package/dist/{chunk-ECNK25S4.cjs.map → chunk-WY4LI5PB.cjs.map} +1 -1
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/internal-list.cjs +4 -4
- package/dist/internal-list.js +3 -3
- package/dist/internal.cjs +5 -5
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +4 -4
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +46 -0
- package/dist/jsx-dev-runtime.d.ts +46 -0
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.cjs.map +1 -1
- package/dist/jsx-runtime.d.cts +46 -0
- package/dist/jsx-runtime.d.ts +46 -0
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/loader.cjs +143 -26
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +122 -5
- package/dist/loader.js.map +1 -1
- package/dist/{props-DabFQwLR.d.ts → props-C04ScJgm.d.ts} +46 -0
- package/dist/{props-tImUZAty.d.cts → props-CdmuXCiu.d.cts} +46 -0
- package/dist/{resume-C5IKAIdh.d.ts → resume-C166aAVg.d.ts} +2 -2
- package/dist/{resume-DPZxmA95.d.cts → resume-C20cRVj9.d.cts} +2 -2
- package/package.json +1 -1
- package/src/jsx.ts +46 -0
- package/src/loader.ts +153 -4
- package/src/resume.ts +5 -5
- /package/dist/{chunk-4P4DYWLQ.js.map → chunk-IIWHTV23.js.map} +0 -0
- /package/dist/{chunk-RK2WSQYL.js.map → chunk-M42N54LG.js.map} +0 -0
- /package/dist/{chunk-ZWQLXWSV.js.map → chunk-UQTWIV3S.js.map} +0 -0
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/loader.ts"],"sourcesContent":["import { DelegatedEvents } from './constants'\nimport {\n FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n type SSRState,\n __fictEnableResumable,\n __fictEnsureScope,\n __fictGetResume,\n __fictGetSSRScope,\n __fictMergeSSRState,\n __fictSetSSRState,\n __fictUseLexicalScope,\n} from './resume'\n\n// ============================================================================\n// Module Resolution\n// ============================================================================\n\n/**\n * Resolve a module URL through the manifest if available.\n * In production, virtual module URLs (virtual:fict-handler:...) are mapped\n * to their built chunk URLs through the manifest.\n */\nfunction resolveModuleUrl(url: string): string {\n const manifest = (globalThis as Record<string, unknown>).__FICT_MANIFEST__ as\n | Record<string, string>\n | undefined\n\n if (manifest) {\n // Check if the URL (without #fragment) is in the manifest\n const resolved = manifest[url]\n if (resolved) {\n return resolved\n }\n }\n\n return url\n}\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface PrefetchStrategy {\n /**\n * Enable visibility-based prefetch using IntersectionObserver.\n * Prefetches modules when interactive elements come into view.\n * @default true\n */\n visibility?: boolean\n /**\n * Root margin for IntersectionObserver (e.g., '200px' to prefetch earlier).\n * @default '200px'\n */\n visibilityMargin?: string\n /**\n * Enable hover-based prefetch using pointerover events.\n * Prefetches modules when user hovers over interactive elements.\n * @default true\n */\n hover?: boolean\n /**\n * Delay in ms before prefetching on hover (debounce rapid movements).\n * @default 50\n */\n hoverDelay?: number\n}\n\nexport interface ResumableLoaderOptions {\n document?: Document\n snapshotScriptId?: string\n events?: string[]\n /**\n * Receives structured snapshot/resume issues detected by the loader.\n * Useful for telemetry and fail-safe fallback orchestration.\n */\n onSnapshotIssue?: (issue: SnapshotIssue) => void\n /**\n * Prefetch strategy configuration.\n * Set to false to disable all prefetching.\n * @default { visibility: true, hover: true }\n */\n prefetch?: PrefetchStrategy | false\n}\n\nexport type SnapshotIssueCode =\n | 'snapshot_parse_error'\n | 'snapshot_invalid_shape'\n | 'snapshot_unsupported_version'\n | 'scope_snapshot_missing'\n\nexport interface SnapshotIssue {\n code: SnapshotIssueCode\n message: string\n source: string\n expectedVersion: number\n actualVersion?: number\n scopeId?: string\n}\n\n// ============================================================================\n// State\n// ============================================================================\n\nconst hydratedScopes = new Set<string>()\nconst prefetchedUrls = new Set<string>()\nlet prefetchCleanup: (() => void) | null = null\nlet eventListenerCleanup: (() => void) | null = null\nlet snapshotObserver: MutationObserver | null = null\nconst processedSnapshots = new Set<HTMLScriptElement>()\nlet snapshotIssueHandler: ((issue: SnapshotIssue) => void) | null = null\nconst emittedIssueKeys = new Set<string>()\n\n/**\n * Reset the hydrated scopes set. Useful for testing.\n */\nexport function resetHydratedScopes(): void {\n hydratedScopes.clear()\n}\n\n/**\n * Reset the prefetched URLs set. Useful for testing.\n */\nexport function resetPrefetchedUrls(): void {\n prefetchedUrls.clear()\n}\n\n/**\n * Set of pending handler promises. Used for testing to wait for all handlers to complete.\n */\nconst pendingHandlers = new Set<Promise<void>>()\n\n/**\n * Wait for all pending event handlers to complete. Useful for testing.\n */\nexport async function waitForPendingHandlers(): Promise<void> {\n if (pendingHandlers.size === 0) return\n await Promise.allSettled([...pendingHandlers])\n}\n\n/**\n * Clean up all registered event listeners. Useful for testing.\n */\nexport function cleanupEventListeners(): void {\n if (eventListenerCleanup) {\n eventListenerCleanup()\n eventListenerCleanup = null\n }\n}\n\n// ============================================================================\n// Main Entry Point\n// ============================================================================\n\nexport function installResumableLoader(options: ResumableLoaderOptions = {}): void {\n const doc = options.document ?? window.document\n const scriptId = options.snapshotScriptId ?? '__FICT_SNAPSHOT__'\n snapshotIssueHandler = options.onSnapshotIssue ?? null\n\n // Reset hydrated scopes for fresh loader installation\n hydratedScopes.clear()\n prefetchedUrls.clear()\n processedSnapshots.clear()\n emittedIssueKeys.clear()\n __fictSetSSRState(null)\n\n // Clean up previous event listeners\n if (eventListenerCleanup) {\n eventListenerCleanup()\n eventListenerCleanup = null\n }\n\n // Clean up previous prefetch handlers\n if (prefetchCleanup) {\n prefetchCleanup()\n prefetchCleanup = null\n }\n\n if (snapshotObserver) {\n snapshotObserver.disconnect()\n snapshotObserver = null\n }\n\n const snapshotEl = doc.getElementById(scriptId)\n if (snapshotEl?.textContent) {\n const state = parseSnapshotText(snapshotEl.textContent, `#${scriptId}`)\n if (state) {\n __fictSetSSRState(state)\n }\n }\n\n const snapshotScripts = doc.querySelectorAll(\n 'script[type=\"application/json\"][data-fict-snapshot]',\n )\n for (const script of Array.from(snapshotScripts)) {\n parseSnapshotScript(script as HTMLScriptElement)\n }\n\n if (typeof MutationObserver !== 'undefined') {\n snapshotObserver = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const node of Array.from(mutation.addedNodes)) {\n if (!(node instanceof Element)) continue\n if (node.tagName === 'SCRIPT') {\n const script = node as HTMLScriptElement\n if (isSnapshotScript(script)) {\n parseSnapshotScript(script)\n }\n }\n const nested = node.querySelectorAll?.(\n 'script[type=\"application/json\"][data-fict-snapshot]',\n )\n if (nested && nested.length) {\n for (const script of Array.from(nested)) {\n parseSnapshotScript(script as HTMLScriptElement)\n }\n }\n }\n }\n })\n snapshotObserver.observe(doc.documentElement ?? doc, { childList: true, subtree: true })\n }\n\n __fictEnableResumable()\n\n const events = options.events ?? Array.from(DelegatedEvents)\n for (const eventName of events) {\n doc.addEventListener(eventName, handleResumableEvent, true)\n }\n\n // Store cleanup function for event listeners\n eventListenerCleanup = () => {\n for (const eventName of events) {\n doc.removeEventListener(eventName, handleResumableEvent, true)\n }\n }\n\n // Setup prefetch if enabled\n if (options.prefetch !== false) {\n prefetchCleanup = setupPrefetch(doc, options.prefetch ?? {})\n }\n}\n\nfunction isSnapshotScript(script: HTMLScriptElement): boolean {\n return script.type === 'application/json' && script.hasAttribute('data-fict-snapshot')\n}\n\nfunction parseSnapshotScript(script: HTMLScriptElement): void {\n if (processedSnapshots.has(script)) return\n processedSnapshots.add(script)\n const text = script.textContent\n if (!text) return\n const source = script.id ? `#${script.id}` : '<script[data-fict-snapshot]>'\n const state = parseSnapshotText(text, source)\n if (state) {\n __fictMergeSSRState(state)\n }\n}\n\nfunction parseSnapshotText(text: string, source: string): SSRState | null {\n let parsed: unknown\n try {\n parsed = JSON.parse(text)\n } catch {\n emitSnapshotIssue({\n code: 'snapshot_parse_error',\n message: '[fict/loader] Failed to parse SSR snapshot JSON.',\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n })\n return null\n }\n\n return normalizeSnapshotState(parsed, source)\n}\n\nfunction normalizeSnapshotState(value: unknown, source: string): SSRState | null {\n if (!isRecord(value)) {\n emitSnapshotIssue({\n code: 'snapshot_invalid_shape',\n message: '[fict/loader] Snapshot payload must be an object.',\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n })\n return null\n }\n\n const rawVersion = value.v\n const version = rawVersion === undefined ? FICT_SSR_SNAPSHOT_SCHEMA_VERSION : rawVersion\n if (!Number.isInteger(version) || version !== FICT_SSR_SNAPSHOT_SCHEMA_VERSION) {\n const versionIssue: SnapshotIssue = {\n code: 'snapshot_unsupported_version',\n message: `[fict/loader] Snapshot schema version ${String(version)} is not supported by this runtime.`,\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n }\n if (typeof version === 'number') {\n versionIssue.actualVersion = version\n }\n emitSnapshotIssue({\n ...versionIssue,\n })\n return null\n }\n\n const scopes = value.scopes\n if (!isRecord(scopes)) {\n emitSnapshotIssue({\n code: 'snapshot_invalid_shape',\n message: '[fict/loader] Snapshot payload is missing a valid `scopes` object.',\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n })\n return null\n }\n\n return { v: FICT_SSR_SNAPSHOT_SCHEMA_VERSION, scopes: scopes as SSRState['scopes'] }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction emitSnapshotIssue(issue: SnapshotIssue): void {\n const key =\n `${issue.code}|${issue.source}|${issue.scopeId ?? ''}|` +\n `${issue.actualVersion ?? ''}|${issue.expectedVersion}`\n if (emittedIssueKeys.has(key)) return\n emittedIssueKeys.add(key)\n\n snapshotIssueHandler?.(issue)\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n console.warn(issue.message)\n }\n}\n\n// ============================================================================\n// Prefetch Implementation\n// ============================================================================\n\nfunction setupPrefetch(doc: Document, strategy: PrefetchStrategy): () => void {\n const cleanupFns: (() => void)[] = []\n\n // Visibility-based prefetch\n if (strategy.visibility !== false) {\n const cleanup = setupVisibilityPrefetch(doc, strategy.visibilityMargin ?? '200px')\n cleanupFns.push(cleanup)\n }\n\n // Hover-based prefetch\n if (strategy.hover !== false) {\n const cleanup = setupHoverPrefetch(doc, strategy.hoverDelay ?? 50)\n cleanupFns.push(cleanup)\n }\n\n return () => {\n for (const cleanup of cleanupFns) {\n cleanup()\n }\n }\n}\n\nfunction setupVisibilityPrefetch(doc: Document, rootMargin: string): () => void {\n // Check if IntersectionObserver is available\n if (typeof IntersectionObserver === 'undefined') {\n return () => {}\n }\n\n const observer = new IntersectionObserver(\n entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n const el = entry.target as Element\n prefetchElementQrls(el)\n // Stop observing after prefetch\n observer.unobserve(el)\n }\n }\n },\n { rootMargin },\n )\n\n // Observe all elements with on:* attributes\n const interactiveElements = doc.querySelectorAll(\n '[on\\\\:click], [on\\\\:input], [on\\\\:change], [on\\\\:submit], [on\\\\:keydown], [on\\\\:keyup]',\n )\n interactiveElements.forEach(el => observer.observe(el))\n\n // Also observe elements with data-fict-h (resumable components)\n const resumableHosts = doc.querySelectorAll('[data-fict-h]')\n resumableHosts.forEach(el => observer.observe(el))\n\n return () => {\n observer.disconnect()\n }\n}\n\nfunction setupHoverPrefetch(doc: Document, delay: number): () => void {\n let hoverTimeout: ReturnType<typeof setTimeout> | null = null\n let lastHoveredElement: Element | null = null\n\n const handlePointerOver = (event: Event) => {\n const target = event.target\n if (!(target instanceof Element)) return\n\n // Find the closest element with interactive attributes\n const interactiveEl =\n target.closest('[on\\\\:click]') ||\n target.closest('[on\\\\:input]') ||\n target.closest('[on\\\\:change]') ||\n target.closest('[on\\\\:submit]') ||\n target.closest('[data-fict-h]')\n\n if (!interactiveEl || interactiveEl === lastHoveredElement) return\n\n lastHoveredElement = interactiveEl\n\n // Clear previous timeout\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n }\n\n // Debounce prefetch\n hoverTimeout = setTimeout(() => {\n prefetchElementQrls(interactiveEl)\n }, delay)\n }\n\n const handlePointerOut = () => {\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n hoverTimeout = null\n }\n lastHoveredElement = null\n }\n\n doc.addEventListener('pointerover', handlePointerOver, { passive: true })\n doc.addEventListener('pointerout', handlePointerOut, { passive: true })\n\n return () => {\n doc.removeEventListener('pointerover', handlePointerOver)\n doc.removeEventListener('pointerout', handlePointerOut)\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n }\n }\n}\n\nfunction prefetchElementQrls(el: Element): void {\n const ownerDocument = el.ownerDocument ?? (typeof document !== 'undefined' ? document : undefined)\n // Prefetch event handler QRLs\n const eventAttrs = ['on:click', 'on:input', 'on:change', 'on:submit', 'on:keydown', 'on:keyup']\n for (const attr of eventAttrs) {\n const qrl = el.getAttribute(attr)\n if (qrl) {\n prefetchQrl(qrl, ownerDocument)\n }\n }\n\n // Prefetch resume handler QRL\n const resumeQrl = el.getAttribute('data-fict-h')\n if (resumeQrl) {\n prefetchQrl(resumeQrl, ownerDocument)\n }\n\n // Also check children for nested QRLs\n const children = el.querySelectorAll(\n '[on\\\\:click], [on\\\\:input], [on\\\\:change], [on\\\\:submit], [data-fict-h]',\n )\n children.forEach(child => {\n for (const attr of eventAttrs) {\n const qrl = child.getAttribute(attr)\n if (qrl) {\n prefetchQrl(qrl, ownerDocument)\n }\n }\n const childResumeQrl = child.getAttribute('data-fict-h')\n if (childResumeQrl) {\n prefetchQrl(childResumeQrl, ownerDocument)\n }\n })\n}\n\nfunction prefetchQrl(qrl: string, ownerDocument?: Document): void {\n const { url } = parseQrl(qrl)\n if (!url || prefetchedUrls.has(url)) return\n\n prefetchedUrls.add(url)\n\n // Resolve through manifest for production builds\n const resolvedUrl = resolveModuleUrl(url)\n\n // Use modulepreload link for best browser support\n const doc = ownerDocument ?? (typeof document !== 'undefined' ? document : undefined)\n if (doc) {\n const link = doc.createElement('link')\n link.rel = 'modulepreload'\n link.href = resolvedUrl\n link.crossOrigin = 'anonymous'\n doc.head?.appendChild(link)\n }\n}\n\n// ============================================================================\n\n/**\n * Wrapper that tracks the async handler promise for testing.\n */\nfunction handleResumableEvent(event: Event): void {\n const promise = handleResumableEventAsync(event)\n pendingHandlers.add(promise)\n void promise\n .catch(error => {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error('[fict/loader] Failed to handle resumable event.', error)\n }\n })\n .finally(() => {\n pendingHandlers.delete(promise)\n })\n}\n\nasync function handleResumableEventAsync(event: Event): Promise<void> {\n const path =\n typeof event.composedPath === 'function' ? event.composedPath() : buildEventPath(event)\n\n for (const node of path) {\n if (!(node instanceof Element)) continue\n const qrl = node.getAttribute(`on:${event.type}`)\n if (!qrl) continue\n\n const host = node.closest('[data-fict-s]') as Element | null\n if (!host) continue\n const scopeId = host.getAttribute('data-fict-s')\n if (!scopeId) continue\n\n const snapshot = __fictGetSSRScope(scopeId)\n if (!snapshot) {\n emitSnapshotIssue({\n code: 'scope_snapshot_missing',\n message: `[fict/loader] Missing scope snapshot for ${scopeId}; skipping resumable handler execution.`,\n source: 'event',\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n scopeId,\n })\n continue\n }\n __fictEnsureScope(scopeId, host, snapshot)\n\n const { url, exportName } = parseQrl(qrl)\n\n // Pre-emptively prevent default on navigations/forms while we await modules\n if (event.cancelable && (event.type === 'click' || event.type === 'submit')) {\n const tag = node.tagName.toLowerCase()\n if (tag === 'a' || tag === 'form') {\n event.preventDefault()\n }\n }\n\n // Resume FIRST to set up reactive bindings BEFORE the handler runs\n if (!hydratedScopes.has(scopeId)) {\n const resumeQrl = host.getAttribute('data-fict-h')\n if (resumeQrl) {\n const { url: resumeUrl, exportName: resumeExport } = parseQrl(resumeQrl)\n const resolvedResumeUrl = resolveModuleUrl(resumeUrl)\n // Load the module to ensure resume functions are registered\n await import(/* @vite-ignore */ resolvedResumeUrl)\n // Get resume function from registry (not module exports)\n const resumeFn = __fictGetResume(resumeExport)\n if (typeof resumeFn === 'function') {\n await (resumeFn as (scopeId: string, host: Element) => unknown)(scopeId, host)\n hydratedScopes.add(scopeId)\n }\n }\n }\n\n // THEN run the handler - now signal updates will trigger DOM updates\n const resolvedUrl = resolveModuleUrl(url)\n const mod = await import(/* @vite-ignore */ resolvedUrl)\n const handler = (mod as Record<string, unknown>)[exportName]\n if (typeof handler === 'function') {\n await (handler as (scopeId: string, ev: Event, el: Element) => unknown)(scopeId, event, node)\n }\n\n return\n }\n}\n\nfunction parseQrl(qrl: string): { url: string; exportName: string } {\n const [ref] = qrl.split('[')\n if (!ref) {\n return { url: '', exportName: 'default' }\n }\n const hashIndex = ref.lastIndexOf('#')\n if (hashIndex === -1) {\n return { url: ref, exportName: 'default' }\n }\n return { url: ref.slice(0, hashIndex), exportName: ref.slice(hashIndex + 1) }\n}\n\nfunction buildEventPath(event: Event): EventTarget[] {\n const path: EventTarget[] = []\n let node: EventTarget | null = event.target\n while (node) {\n path.push(node)\n node = (node as Node).parentNode\n }\n path.push(window)\n return path\n}\n\n// Re-export for handler authors (optional)\nexport { __fictUseLexicalScope } from './resume'\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAS,iBAAiB,KAAqB;AAC7C,QAAM,WAAY,WAAuC;AAIzD,MAAI,UAAU;AAEZ,UAAM,WAAW,SAAS,GAAG;AAC7B,QAAI,UAAU;AACZ,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAmEA,IAAM,iBAAiB,oBAAI,IAAY;AACvC,IAAM,iBAAiB,oBAAI,IAAY;AACvC,IAAI,kBAAuC;AAC3C,IAAI,uBAA4C;AAChD,IAAI,mBAA4C;AAChD,IAAM,qBAAqB,oBAAI,IAAuB;AACtD,IAAI,uBAAgE;AACpE,IAAM,mBAAmB,oBAAI,IAAY;AAKlC,SAAS,sBAA4B;AAC1C,iBAAe,MAAM;AACvB;AAKO,SAAS,sBAA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AAK;AACR,WAAO,EAAE,KAAK,IAAI,YAAY,UAAU;AAAA,EAC1C;AACA,QAAM,YAAY,IAAI,YAAY,GAAG;AACrC,MAAI,cAAc,IAAI;AACpB,WAAO,EAAE,KAAK,KAAK,YAAY,UAAU;AAAA,EAC3C;AACA,SAAO,EAAE,KAAK,IAAI,MAAM,GAAG,SAAS,GAAG,YAAY,IAAI,MAAM,YAAY,CAAC,EAAE;AAC9E;AAEA,SAAS,eAAe,OAA6B;AACnD,QAAM,OAAsB,CAAC;AAC7B,MAAI,OAA2B,MAAM;AACrC,SAAO,MAAM;AACX,SAAK,KAAK,IAAI;AACd,WAAQ,KAAc;AAAA,EACxB;AACA,OAAK,KAAK,MAAM;AAChB,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/loader.ts"],"sourcesContent":["import { DelegatedEvents } from './constants'\nimport {\n FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n type SSRState,\n __fictEnableResumable,\n __fictEnsureScope,\n __fictGetResume,\n __fictGetSSRScope,\n __fictMergeSSRState,\n __fictSetSSRState,\n __fictUseLexicalScope,\n} from './resume'\n\n// ============================================================================\n// Module Resolution\n// ============================================================================\n\n/**\n * Resolve a module URL through the manifest if available.\n * In production, virtual module URLs (virtual:fict-handler:...) are mapped\n * to their built chunk URLs through the manifest.\n */\nfunction resolveModuleUrl(url: string): string {\n const manifest = (globalThis as Record<string, unknown>).__FICT_MANIFEST__ as\n | Record<string, string>\n | undefined\n\n if (manifest) {\n // Check if the URL (without #fragment) is in the manifest\n const resolved = manifest[url]\n if (resolved) {\n return resolved\n }\n }\n\n return url\n}\n\nfunction resolveAbsoluteModuleUrl(url: string, ownerDocument?: Document): string {\n const baseUrl =\n ownerDocument?.baseURI ?? (typeof document !== 'undefined' ? document.baseURI : undefined)\n if (!baseUrl) return url\n\n try {\n return new URL(url, baseUrl).href\n } catch {\n return url\n }\n}\n\nfunction normalizeImportUrl(url: string): string {\n if (!url.startsWith('data:')) {\n return url\n }\n\n const dataSeparatorIndex = url.indexOf(',')\n if (dataSeparatorIndex === -1) {\n return url\n }\n\n const metadata = url.slice(0, dataSeparatorIndex)\n const payload = url.slice(dataSeparatorIndex + 1)\n if (metadata.includes(';base64')) {\n return url\n }\n\n try {\n return `${metadata},${encodeURIComponent(decodeURIComponent(payload))}`\n } catch {\n return `${metadata},${encodeURIComponent(payload)}`\n }\n}\n\ninterface PreservedControlState {\n value?: string\n checked?: boolean\n selectedIndex?: number\n selectedValues?: string[]\n}\n\nfunction captureControlState(node: Element, event: Event): PreservedControlState | null {\n if (event.type !== 'input' && event.type !== 'change') return null\n\n if (node instanceof HTMLInputElement) {\n if (node.type === 'file') return null\n if (node.type === 'checkbox' || node.type === 'radio') {\n return { checked: node.checked }\n }\n return { value: node.value }\n }\n\n if (node instanceof HTMLTextAreaElement) {\n return { value: node.value }\n }\n\n if (node instanceof HTMLSelectElement) {\n return node.multiple\n ? {\n selectedValues: Array.from(node.selectedOptions).map(option => option.value),\n }\n : {\n value: node.value,\n selectedIndex: node.selectedIndex,\n }\n }\n\n return null\n}\n\nfunction restoreControlState(node: Element, state: PreservedControlState | null): void {\n if (!state) return\n\n if (node instanceof HTMLInputElement) {\n if (typeof state.checked === 'boolean') {\n node.checked = state.checked\n }\n if (typeof state.value === 'string' && node.type !== 'file') {\n node.value = state.value\n }\n return\n }\n\n if (node instanceof HTMLTextAreaElement) {\n if (typeof state.value === 'string') {\n node.value = state.value\n }\n return\n }\n\n if (node instanceof HTMLSelectElement) {\n if (Array.isArray(state.selectedValues) && node.multiple) {\n const selected = new Set(state.selectedValues)\n for (const option of Array.from(node.options)) {\n option.selected = selected.has(option.value)\n }\n return\n }\n\n if (typeof state.selectedIndex === 'number') {\n node.selectedIndex = state.selectedIndex\n }\n if (typeof state.value === 'string') {\n node.value = state.value\n }\n }\n}\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface PrefetchStrategy {\n /**\n * Enable visibility-based prefetch using IntersectionObserver.\n * Prefetches modules when interactive elements come into view.\n * @default true\n */\n visibility?: boolean\n /**\n * Root margin for IntersectionObserver (e.g., '200px' to prefetch earlier).\n * @default '200px'\n */\n visibilityMargin?: string\n /**\n * Enable hover-based prefetch using pointerover events.\n * Prefetches modules when user hovers over interactive elements.\n * @default true\n */\n hover?: boolean\n /**\n * Delay in ms before prefetching on hover (debounce rapid movements).\n * @default 50\n */\n hoverDelay?: number\n}\n\nexport interface ResumableLoaderOptions {\n document?: Document\n snapshotScriptId?: string\n events?: string[]\n /**\n * Receives structured snapshot/resume issues detected by the loader.\n * Useful for telemetry and fail-safe fallback orchestration.\n */\n onSnapshotIssue?: (issue: SnapshotIssue) => void\n /**\n * Prefetch strategy configuration.\n * Set to false to disable all prefetching.\n * @default { visibility: true, hover: true }\n */\n prefetch?: PrefetchStrategy | false\n}\n\nexport type SnapshotIssueCode =\n | 'snapshot_parse_error'\n | 'snapshot_invalid_shape'\n | 'snapshot_unsupported_version'\n | 'scope_snapshot_missing'\n\nexport interface SnapshotIssue {\n code: SnapshotIssueCode\n message: string\n source: string\n expectedVersion: number\n actualVersion?: number\n scopeId?: string\n}\n\n// ============================================================================\n// State\n// ============================================================================\n\nconst hydratedScopes = new Set<string>()\nconst prefetchedUrls = new Set<string>()\nlet prefetchCleanup: (() => void) | null = null\nlet eventListenerCleanup: (() => void) | null = null\nlet snapshotObserver: MutationObserver | null = null\nconst processedSnapshots = new Set<HTMLScriptElement>()\nlet snapshotIssueHandler: ((issue: SnapshotIssue) => void) | null = null\nconst emittedIssueKeys = new Set<string>()\n\n/**\n * Reset the hydrated scopes set. Useful for testing.\n */\nexport function resetHydratedScopes(): void {\n hydratedScopes.clear()\n}\n\n/**\n * Reset the prefetched URLs set. Useful for testing.\n */\nexport function resetPrefetchedUrls(): void {\n prefetchedUrls.clear()\n}\n\n/**\n * Set of pending handler promises. Used for testing to wait for all handlers to complete.\n */\nconst pendingHandlers = new Set<Promise<void>>()\n\n/**\n * Wait for all pending event handlers to complete. Useful for testing.\n */\nexport async function waitForPendingHandlers(): Promise<void> {\n if (pendingHandlers.size === 0) return\n await Promise.allSettled([...pendingHandlers])\n}\n\n/**\n * Clean up all registered event listeners. Useful for testing.\n */\nexport function cleanupEventListeners(): void {\n if (eventListenerCleanup) {\n eventListenerCleanup()\n eventListenerCleanup = null\n }\n}\n\n// ============================================================================\n// Main Entry Point\n// ============================================================================\n\nexport function installResumableLoader(options: ResumableLoaderOptions = {}): void {\n const doc = options.document ?? window.document\n const scriptId = options.snapshotScriptId ?? '__FICT_SNAPSHOT__'\n snapshotIssueHandler = options.onSnapshotIssue ?? null\n\n // Reset hydrated scopes for fresh loader installation\n hydratedScopes.clear()\n prefetchedUrls.clear()\n processedSnapshots.clear()\n emittedIssueKeys.clear()\n __fictSetSSRState(null)\n\n // Clean up previous event listeners\n if (eventListenerCleanup) {\n eventListenerCleanup()\n eventListenerCleanup = null\n }\n\n // Clean up previous prefetch handlers\n if (prefetchCleanup) {\n prefetchCleanup()\n prefetchCleanup = null\n }\n\n if (snapshotObserver) {\n snapshotObserver.disconnect()\n snapshotObserver = null\n }\n\n const snapshotEl = doc.getElementById(scriptId)\n if (snapshotEl?.textContent) {\n const state = parseSnapshotText(snapshotEl.textContent, `#${scriptId}`)\n if (state) {\n __fictSetSSRState(state)\n }\n }\n\n const snapshotScripts = doc.querySelectorAll(\n 'script[type=\"application/json\"][data-fict-snapshot]',\n )\n for (const script of Array.from(snapshotScripts)) {\n parseSnapshotScript(script as HTMLScriptElement)\n }\n\n if (typeof MutationObserver !== 'undefined') {\n snapshotObserver = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n for (const node of Array.from(mutation.addedNodes)) {\n if (!(node instanceof Element)) continue\n if (node.tagName === 'SCRIPT') {\n const script = node as HTMLScriptElement\n if (isSnapshotScript(script)) {\n parseSnapshotScript(script)\n }\n }\n const nested = node.querySelectorAll?.(\n 'script[type=\"application/json\"][data-fict-snapshot]',\n )\n if (nested && nested.length) {\n for (const script of Array.from(nested)) {\n parseSnapshotScript(script as HTMLScriptElement)\n }\n }\n }\n }\n })\n snapshotObserver.observe(doc.documentElement ?? doc, { childList: true, subtree: true })\n }\n\n __fictEnableResumable()\n\n const events = options.events ?? Array.from(DelegatedEvents)\n for (const eventName of events) {\n doc.addEventListener(eventName, handleResumableEvent, true)\n }\n\n // Store cleanup function for event listeners\n eventListenerCleanup = () => {\n for (const eventName of events) {\n doc.removeEventListener(eventName, handleResumableEvent, true)\n }\n }\n\n // Setup prefetch if enabled\n if (options.prefetch !== false) {\n prefetchCleanup = setupPrefetch(doc, options.prefetch ?? {})\n }\n}\n\nfunction isSnapshotScript(script: HTMLScriptElement): boolean {\n return script.type === 'application/json' && script.hasAttribute('data-fict-snapshot')\n}\n\nfunction parseSnapshotScript(script: HTMLScriptElement): void {\n if (processedSnapshots.has(script)) return\n processedSnapshots.add(script)\n const text = script.textContent\n if (!text) return\n const source = script.id ? `#${script.id}` : '<script[data-fict-snapshot]>'\n const state = parseSnapshotText(text, source)\n if (state) {\n __fictMergeSSRState(state)\n }\n}\n\nfunction parseSnapshotText(text: string, source: string): SSRState | null {\n let parsed: unknown\n try {\n parsed = JSON.parse(text)\n } catch {\n emitSnapshotIssue({\n code: 'snapshot_parse_error',\n message: '[fict/loader] Failed to parse SSR snapshot JSON.',\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n })\n return null\n }\n\n return normalizeSnapshotState(parsed, source)\n}\n\nfunction normalizeSnapshotState(value: unknown, source: string): SSRState | null {\n if (!isRecord(value)) {\n emitSnapshotIssue({\n code: 'snapshot_invalid_shape',\n message: '[fict/loader] Snapshot payload must be an object.',\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n })\n return null\n }\n\n const rawVersion = value.v\n const version = rawVersion === undefined ? FICT_SSR_SNAPSHOT_SCHEMA_VERSION : rawVersion\n if (!Number.isInteger(version) || version !== FICT_SSR_SNAPSHOT_SCHEMA_VERSION) {\n const versionIssue: SnapshotIssue = {\n code: 'snapshot_unsupported_version',\n message: `[fict/loader] Snapshot schema version ${String(version)} is not supported by this runtime.`,\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n }\n if (typeof version === 'number') {\n versionIssue.actualVersion = version\n }\n emitSnapshotIssue({\n ...versionIssue,\n })\n return null\n }\n\n const scopes = value.scopes\n if (!isRecord(scopes)) {\n emitSnapshotIssue({\n code: 'snapshot_invalid_shape',\n message: '[fict/loader] Snapshot payload is missing a valid `scopes` object.',\n source,\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n })\n return null\n }\n\n return { v: FICT_SSR_SNAPSHOT_SCHEMA_VERSION, scopes: scopes as SSRState['scopes'] }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction emitSnapshotIssue(issue: SnapshotIssue): void {\n const key =\n `${issue.code}|${issue.source}|${issue.scopeId ?? ''}|` +\n `${issue.actualVersion ?? ''}|${issue.expectedVersion}`\n if (emittedIssueKeys.has(key)) return\n emittedIssueKeys.add(key)\n\n snapshotIssueHandler?.(issue)\n\n if (typeof console !== 'undefined' && typeof console.warn === 'function') {\n console.warn(issue.message)\n }\n}\n\n// ============================================================================\n// Prefetch Implementation\n// ============================================================================\n\nfunction setupPrefetch(doc: Document, strategy: PrefetchStrategy): () => void {\n const cleanupFns: (() => void)[] = []\n\n // Visibility-based prefetch\n if (strategy.visibility !== false) {\n const cleanup = setupVisibilityPrefetch(doc, strategy.visibilityMargin ?? '200px')\n cleanupFns.push(cleanup)\n }\n\n // Hover-based prefetch\n if (strategy.hover !== false) {\n const cleanup = setupHoverPrefetch(doc, strategy.hoverDelay ?? 50)\n cleanupFns.push(cleanup)\n }\n\n return () => {\n for (const cleanup of cleanupFns) {\n cleanup()\n }\n }\n}\n\nfunction setupVisibilityPrefetch(doc: Document, rootMargin: string): () => void {\n // Check if IntersectionObserver is available\n if (typeof IntersectionObserver === 'undefined') {\n return () => {}\n }\n\n const observer = new IntersectionObserver(\n entries => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n const el = entry.target as Element\n prefetchElementQrls(el)\n // Stop observing after prefetch\n observer.unobserve(el)\n }\n }\n },\n { rootMargin },\n )\n\n // Observe all elements with on:* attributes\n const interactiveElements = doc.querySelectorAll(\n '[on\\\\:click], [on\\\\:input], [on\\\\:change], [on\\\\:submit], [on\\\\:keydown], [on\\\\:keyup]',\n )\n interactiveElements.forEach(el => observer.observe(el))\n\n // Also observe elements with data-fict-h (resumable components)\n const resumableHosts = doc.querySelectorAll('[data-fict-h]')\n resumableHosts.forEach(el => observer.observe(el))\n\n return () => {\n observer.disconnect()\n }\n}\n\nfunction setupHoverPrefetch(doc: Document, delay: number): () => void {\n let hoverTimeout: ReturnType<typeof setTimeout> | null = null\n let lastHoveredElement: Element | null = null\n\n const handlePointerOver = (event: Event) => {\n const target = event.target\n if (!(target instanceof Element)) return\n\n // Find the closest element with interactive attributes\n const interactiveEl =\n target.closest('[on\\\\:click]') ||\n target.closest('[on\\\\:input]') ||\n target.closest('[on\\\\:change]') ||\n target.closest('[on\\\\:submit]') ||\n target.closest('[data-fict-h]')\n\n if (!interactiveEl || interactiveEl === lastHoveredElement) return\n\n lastHoveredElement = interactiveEl\n\n // Clear previous timeout\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n }\n\n // Debounce prefetch\n hoverTimeout = setTimeout(() => {\n prefetchElementQrls(interactiveEl)\n }, delay)\n }\n\n const handlePointerOut = () => {\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n hoverTimeout = null\n }\n lastHoveredElement = null\n }\n\n doc.addEventListener('pointerover', handlePointerOver, { passive: true })\n doc.addEventListener('pointerout', handlePointerOut, { passive: true })\n\n return () => {\n doc.removeEventListener('pointerover', handlePointerOver)\n doc.removeEventListener('pointerout', handlePointerOut)\n if (hoverTimeout) {\n clearTimeout(hoverTimeout)\n }\n }\n}\n\nfunction prefetchElementQrls(el: Element): void {\n const ownerDocument = el.ownerDocument ?? (typeof document !== 'undefined' ? document : undefined)\n // Prefetch event handler QRLs\n const eventAttrs = ['on:click', 'on:input', 'on:change', 'on:submit', 'on:keydown', 'on:keyup']\n for (const attr of eventAttrs) {\n const qrl = el.getAttribute(attr)\n if (qrl) {\n prefetchQrl(qrl, ownerDocument)\n }\n }\n\n // Prefetch resume handler QRL\n const resumeQrl = el.getAttribute('data-fict-h')\n if (resumeQrl) {\n prefetchQrl(resumeQrl, ownerDocument)\n }\n\n // Also check children for nested QRLs\n const children = el.querySelectorAll(\n '[on\\\\:click], [on\\\\:input], [on\\\\:change], [on\\\\:submit], [data-fict-h]',\n )\n children.forEach(child => {\n for (const attr of eventAttrs) {\n const qrl = child.getAttribute(attr)\n if (qrl) {\n prefetchQrl(qrl, ownerDocument)\n }\n }\n const childResumeQrl = child.getAttribute('data-fict-h')\n if (childResumeQrl) {\n prefetchQrl(childResumeQrl, ownerDocument)\n }\n })\n}\n\nfunction prefetchQrl(qrl: string, ownerDocument?: Document): void {\n const { url } = parseQrl(qrl)\n if (!url || prefetchedUrls.has(url)) return\n\n prefetchedUrls.add(url)\n\n // Resolve through manifest for production builds\n const resolvedUrl = resolveModuleUrl(url)\n\n // Use modulepreload link for best browser support\n const doc = ownerDocument ?? (typeof document !== 'undefined' ? document : undefined)\n if (doc) {\n const link = doc.createElement('link')\n link.rel = 'modulepreload'\n link.href = resolvedUrl\n link.crossOrigin = 'anonymous'\n doc.head?.appendChild(link)\n }\n}\n\n// ============================================================================\n\n/**\n * Wrapper that tracks the async handler promise for testing.\n */\nfunction handleResumableEvent(event: Event): void {\n const promise = handleResumableEventAsync(event)\n pendingHandlers.add(promise)\n void promise\n .catch(error => {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error('[fict/loader] Failed to handle resumable event.', error)\n }\n })\n .finally(() => {\n pendingHandlers.delete(promise)\n })\n}\n\nasync function handleResumableEventAsync(event: Event): Promise<void> {\n const path =\n typeof event.composedPath === 'function' ? event.composedPath() : buildEventPath(event)\n\n for (const node of path) {\n if (!(node instanceof Element)) continue\n const qrl = node.getAttribute(`on:${event.type}`)\n if (!qrl) continue\n\n const host = node.closest('[data-fict-s]') as Element | null\n if (!host) continue\n const scopeId = host.getAttribute('data-fict-s')\n if (!scopeId) continue\n\n const snapshot = __fictGetSSRScope(scopeId)\n if (!snapshot) {\n emitSnapshotIssue({\n code: 'scope_snapshot_missing',\n message: `[fict/loader] Missing scope snapshot for ${scopeId}; skipping resumable handler execution.`,\n source: 'event',\n expectedVersion: FICT_SSR_SNAPSHOT_SCHEMA_VERSION,\n scopeId,\n })\n continue\n }\n __fictEnsureScope(scopeId, host, snapshot)\n\n const { url, exportName } = parseQrl(qrl)\n\n // Pre-emptively prevent default on navigations/forms while we await modules\n if (event.cancelable && (event.type === 'click' || event.type === 'submit')) {\n const tag = node.tagName.toLowerCase()\n if (tag === 'a' || tag === 'form') {\n event.preventDefault()\n }\n }\n\n const preservedControlState = captureControlState(node, event)\n let resumedDuringEvent = false\n\n // Resume FIRST to set up reactive bindings BEFORE the handler runs\n if (!hydratedScopes.has(scopeId)) {\n const resumeQrl = host.getAttribute('data-fict-h')\n if (resumeQrl) {\n const { url: resumeUrl, exportName: resumeExport } = parseQrl(resumeQrl)\n const resolvedResumeUrl = resolveModuleUrl(resumeUrl)\n const resolvedAbsoluteResumeUrl = resolveAbsoluteModuleUrl(\n resolvedResumeUrl,\n host.ownerDocument ?? undefined,\n )\n const resolvedResumeQrl = `${resolvedResumeUrl}#${resumeExport}`\n const resolvedAbsoluteResumeQrl = `${resolvedAbsoluteResumeUrl}#${resumeExport}`\n const normalizedResumeImportUrl = normalizeImportUrl(resolvedResumeUrl)\n // Load the module to ensure resume functions are registered\n await import(/* @vite-ignore */ normalizedResumeImportUrl)\n // Get resume function from registry (not module exports)\n const resumeFn =\n __fictGetResume(resumeQrl) ??\n __fictGetResume(resolvedResumeQrl) ??\n __fictGetResume(resolvedAbsoluteResumeQrl) ??\n __fictGetResume(resumeExport)\n if (typeof resumeFn === 'function') {\n await (resumeFn as (scopeId: string, host: Element) => unknown)(scopeId, host)\n hydratedScopes.add(scopeId)\n resumedDuringEvent = true\n }\n }\n }\n\n if (resumedDuringEvent) {\n restoreControlState(node, preservedControlState)\n }\n\n // THEN run the handler - now signal updates will trigger DOM updates\n const resolvedUrl = resolveModuleUrl(url)\n const normalizedImportUrl = normalizeImportUrl(resolvedUrl)\n const mod = await import(/* @vite-ignore */ normalizedImportUrl)\n const handler = (mod as Record<string, unknown>)[exportName]\n if (typeof handler === 'function') {\n const originalCurrentTarget = event.currentTarget\n Object.defineProperty(event, 'currentTarget', {\n configurable: true,\n get() {\n return node\n },\n })\n try {\n await (handler as (scopeId: string, ev: Event, el: Element) => unknown)(\n scopeId,\n event,\n node,\n )\n } finally {\n Object.defineProperty(event, 'currentTarget', {\n configurable: true,\n get() {\n return originalCurrentTarget\n },\n })\n }\n }\n\n return\n }\n}\n\nfunction parseQrl(qrl: string): { url: string; exportName: string } {\n const [ref] = qrl.split('[')\n if (!ref) {\n return { url: '', exportName: 'default' }\n }\n const hashIndex = ref.lastIndexOf('#')\n if (hashIndex === -1) {\n return { url: ref, exportName: 'default' }\n }\n return { url: ref.slice(0, hashIndex), exportName: ref.slice(hashIndex + 1) }\n}\n\nfunction buildEventPath(event: Event): EventTarget[] {\n const path: EventTarget[] = []\n let node: EventTarget | null = event.target\n while (node) {\n path.push(node)\n node = (node as Node).parentNode\n }\n path.push(window)\n return path\n}\n\n// Re-export for handler authors (optional)\nexport { __fictUseLexicalScope } from './resume'\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAS,iBAAiB,KAAqB;AAC7C,QAAM,WAAY,WAAuC;AAIzD,MAAI,UAAU;AAEZ,UAAM,WAAW,SAAS,GAAG;AAC7B,QAAI,UAAU;AACZ,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,yBAAyB,KAAa,eAAkC;AAC/E,QAAM,UACJ,e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A,UAAM,cAAc,iBAAiB,GAAG;AACxC,UAAM,sBAAsB,mBAAmB,WAAW;AAC1D,UAAM,MAAM,MAAM;AAAA;AAAA,MAA0B;AAAA;AAC5C,UAAM,UAAW,IAAgC,UAAU;AAC3D,QAAI,OAAO,YAAY,YAAY;AACjC,YAAM,wBAAwB,MAAM;AACpC,aAAO,eAAe,OAAO,iBAAiB;AAAA,QAC5C,cAAc;AAAA,QACd,MAAM;AACJ,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AACD,UAAI;AACF,cAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF,UAAE;AACA,eAAO,eAAe,OAAO,iBAAiB;AAAA,UAC5C,cAAc;AAAA,UACd,MAAM;AACJ,mBAAO;AAAA,UACT;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAEA;AAAA,EACF;AACF;AAEA,SAAS,SAAS,KAAkD;AAClE,QAAM,CAAC,GAAG,IAAI,IAAI,MAAM,GAAG;AAC3B,MAAI,CAAC,KAAK;AACR,WAAO,EAAE,KAAK,IAAI,YAAY,UAAU;AAAA,EAC1C;AACA,QAAM,YAAY,IAAI,YAAY,GAAG;AACrC,MAAI,cAAc,IAAI;AACpB,WAAO,EAAE,KAAK,KAAK,YAAY,UAAU;AAAA,EAC3C;AACA,SAAO,EAAE,KAAK,IAAI,MAAM,GAAG,SAAS,GAAG,YAAY,IAAI,MAAM,YAAY,CAAC,EAAE;AAC9E;AAEA,SAAS,eAAe,OAA6B;AACnD,QAAM,OAAsB,CAAC;AAC7B,MAAI,OAA2B,MAAM;AACrC,SAAO,MAAM;AACX,SAAK,KAAK,IAAI;AACd,WAAQ,KAAc;AAAA,EACxB;AACA,OAAK,KAAK,MAAM;AAChB,SAAO;AACT;","names":[]}
|
|
@@ -157,51 +157,97 @@ interface HTMLAttributes<T> {
|
|
|
157
157
|
slot?: string;
|
|
158
158
|
accessKey?: string;
|
|
159
159
|
onClick?: (e: MouseEvent) => void;
|
|
160
|
+
onClick$?: (e: MouseEvent) => void;
|
|
160
161
|
onDblClick?: (e: MouseEvent) => void;
|
|
162
|
+
onDblClick$?: (e: MouseEvent) => void;
|
|
161
163
|
onMouseDown?: (e: MouseEvent) => void;
|
|
164
|
+
onMouseDown$?: (e: MouseEvent) => void;
|
|
162
165
|
onMouseUp?: (e: MouseEvent) => void;
|
|
166
|
+
onMouseUp$?: (e: MouseEvent) => void;
|
|
163
167
|
onMouseMove?: (e: MouseEvent) => void;
|
|
168
|
+
onMouseMove$?: (e: MouseEvent) => void;
|
|
164
169
|
onMouseEnter?: (e: MouseEvent) => void;
|
|
170
|
+
onMouseEnter$?: (e: MouseEvent) => void;
|
|
165
171
|
onMouseLeave?: (e: MouseEvent) => void;
|
|
172
|
+
onMouseLeave$?: (e: MouseEvent) => void;
|
|
166
173
|
onMouseOver?: (e: MouseEvent) => void;
|
|
174
|
+
onMouseOver$?: (e: MouseEvent) => void;
|
|
167
175
|
onMouseOut?: (e: MouseEvent) => void;
|
|
176
|
+
onMouseOut$?: (e: MouseEvent) => void;
|
|
168
177
|
onContextMenu?: (e: MouseEvent) => void;
|
|
178
|
+
onContextMenu$?: (e: MouseEvent) => void;
|
|
169
179
|
onInput?: (e: InputEvent) => void;
|
|
180
|
+
onInput$?: (e: InputEvent) => void;
|
|
170
181
|
onChange?: (e: Event) => void;
|
|
182
|
+
onChange$?: (e: Event) => void;
|
|
171
183
|
onSubmit?: (e: SubmitEvent) => void;
|
|
184
|
+
onSubmit$?: (e: SubmitEvent) => void;
|
|
172
185
|
onReset?: (e: Event) => void;
|
|
186
|
+
onReset$?: (e: Event) => void;
|
|
173
187
|
onKeyDown?: (e: KeyboardEvent) => void;
|
|
188
|
+
onKeyDown$?: (e: KeyboardEvent) => void;
|
|
174
189
|
onKeyUp?: (e: KeyboardEvent) => void;
|
|
190
|
+
onKeyUp$?: (e: KeyboardEvent) => void;
|
|
175
191
|
onKeyPress?: (e: KeyboardEvent) => void;
|
|
192
|
+
onKeyPress$?: (e: KeyboardEvent) => void;
|
|
176
193
|
onFocus?: (e: FocusEvent) => void;
|
|
194
|
+
onFocus$?: (e: FocusEvent) => void;
|
|
177
195
|
onBlur?: (e: FocusEvent) => void;
|
|
196
|
+
onBlur$?: (e: FocusEvent) => void;
|
|
178
197
|
onScroll?: (e: Event) => void;
|
|
198
|
+
onScroll$?: (e: Event) => void;
|
|
179
199
|
onWheel?: (e: WheelEvent) => void;
|
|
200
|
+
onWheel$?: (e: WheelEvent) => void;
|
|
180
201
|
onLoad?: (e: Event) => void;
|
|
202
|
+
onLoad$?: (e: Event) => void;
|
|
181
203
|
onError?: (e: Event) => void;
|
|
204
|
+
onError$?: (e: Event) => void;
|
|
182
205
|
onDrag?: (e: DragEvent) => void;
|
|
206
|
+
onDrag$?: (e: DragEvent) => void;
|
|
183
207
|
onDragStart?: (e: DragEvent) => void;
|
|
208
|
+
onDragStart$?: (e: DragEvent) => void;
|
|
184
209
|
onDragEnd?: (e: DragEvent) => void;
|
|
210
|
+
onDragEnd$?: (e: DragEvent) => void;
|
|
185
211
|
onDragEnter?: (e: DragEvent) => void;
|
|
212
|
+
onDragEnter$?: (e: DragEvent) => void;
|
|
186
213
|
onDragLeave?: (e: DragEvent) => void;
|
|
214
|
+
onDragLeave$?: (e: DragEvent) => void;
|
|
187
215
|
onDragOver?: (e: DragEvent) => void;
|
|
216
|
+
onDragOver$?: (e: DragEvent) => void;
|
|
188
217
|
onDrop?: (e: DragEvent) => void;
|
|
218
|
+
onDrop$?: (e: DragEvent) => void;
|
|
189
219
|
onTouchStart?: (e: TouchEvent) => void;
|
|
220
|
+
onTouchStart$?: (e: TouchEvent) => void;
|
|
190
221
|
onTouchMove?: (e: TouchEvent) => void;
|
|
222
|
+
onTouchMove$?: (e: TouchEvent) => void;
|
|
191
223
|
onTouchEnd?: (e: TouchEvent) => void;
|
|
224
|
+
onTouchEnd$?: (e: TouchEvent) => void;
|
|
192
225
|
onTouchCancel?: (e: TouchEvent) => void;
|
|
226
|
+
onTouchCancel$?: (e: TouchEvent) => void;
|
|
193
227
|
onAnimationStart?: (e: AnimationEvent) => void;
|
|
228
|
+
onAnimationStart$?: (e: AnimationEvent) => void;
|
|
194
229
|
onAnimationEnd?: (e: AnimationEvent) => void;
|
|
230
|
+
onAnimationEnd$?: (e: AnimationEvent) => void;
|
|
195
231
|
onAnimationIteration?: (e: AnimationEvent) => void;
|
|
232
|
+
onAnimationIteration$?: (e: AnimationEvent) => void;
|
|
196
233
|
onTransitionEnd?: (e: TransitionEvent) => void;
|
|
234
|
+
onTransitionEnd$?: (e: TransitionEvent) => void;
|
|
197
235
|
onPointerDown?: (e: PointerEvent) => void;
|
|
236
|
+
onPointerDown$?: (e: PointerEvent) => void;
|
|
198
237
|
onPointerUp?: (e: PointerEvent) => void;
|
|
238
|
+
onPointerUp$?: (e: PointerEvent) => void;
|
|
199
239
|
onPointerMove?: (e: PointerEvent) => void;
|
|
240
|
+
onPointerMove$?: (e: PointerEvent) => void;
|
|
200
241
|
onPointerEnter?: (e: PointerEvent) => void;
|
|
242
|
+
onPointerEnter$?: (e: PointerEvent) => void;
|
|
201
243
|
onPointerLeave?: (e: PointerEvent) => void;
|
|
244
|
+
onPointerLeave$?: (e: PointerEvent) => void;
|
|
202
245
|
onPointerOver?: (e: PointerEvent) => void;
|
|
246
|
+
onPointerOver$?: (e: PointerEvent) => void;
|
|
203
247
|
onPointerOut?: (e: PointerEvent) => void;
|
|
248
|
+
onPointerOut$?: (e: PointerEvent) => void;
|
|
204
249
|
onPointerCancel?: (e: PointerEvent) => void;
|
|
250
|
+
onPointerCancel$?: (e: PointerEvent) => void;
|
|
205
251
|
ref?: ((el: T | null) => void) | {
|
|
206
252
|
current: T | null;
|
|
207
253
|
};
|
|
@@ -157,51 +157,97 @@ interface HTMLAttributes<T> {
|
|
|
157
157
|
slot?: string;
|
|
158
158
|
accessKey?: string;
|
|
159
159
|
onClick?: (e: MouseEvent) => void;
|
|
160
|
+
onClick$?: (e: MouseEvent) => void;
|
|
160
161
|
onDblClick?: (e: MouseEvent) => void;
|
|
162
|
+
onDblClick$?: (e: MouseEvent) => void;
|
|
161
163
|
onMouseDown?: (e: MouseEvent) => void;
|
|
164
|
+
onMouseDown$?: (e: MouseEvent) => void;
|
|
162
165
|
onMouseUp?: (e: MouseEvent) => void;
|
|
166
|
+
onMouseUp$?: (e: MouseEvent) => void;
|
|
163
167
|
onMouseMove?: (e: MouseEvent) => void;
|
|
168
|
+
onMouseMove$?: (e: MouseEvent) => void;
|
|
164
169
|
onMouseEnter?: (e: MouseEvent) => void;
|
|
170
|
+
onMouseEnter$?: (e: MouseEvent) => void;
|
|
165
171
|
onMouseLeave?: (e: MouseEvent) => void;
|
|
172
|
+
onMouseLeave$?: (e: MouseEvent) => void;
|
|
166
173
|
onMouseOver?: (e: MouseEvent) => void;
|
|
174
|
+
onMouseOver$?: (e: MouseEvent) => void;
|
|
167
175
|
onMouseOut?: (e: MouseEvent) => void;
|
|
176
|
+
onMouseOut$?: (e: MouseEvent) => void;
|
|
168
177
|
onContextMenu?: (e: MouseEvent) => void;
|
|
178
|
+
onContextMenu$?: (e: MouseEvent) => void;
|
|
169
179
|
onInput?: (e: InputEvent) => void;
|
|
180
|
+
onInput$?: (e: InputEvent) => void;
|
|
170
181
|
onChange?: (e: Event) => void;
|
|
182
|
+
onChange$?: (e: Event) => void;
|
|
171
183
|
onSubmit?: (e: SubmitEvent) => void;
|
|
184
|
+
onSubmit$?: (e: SubmitEvent) => void;
|
|
172
185
|
onReset?: (e: Event) => void;
|
|
186
|
+
onReset$?: (e: Event) => void;
|
|
173
187
|
onKeyDown?: (e: KeyboardEvent) => void;
|
|
188
|
+
onKeyDown$?: (e: KeyboardEvent) => void;
|
|
174
189
|
onKeyUp?: (e: KeyboardEvent) => void;
|
|
190
|
+
onKeyUp$?: (e: KeyboardEvent) => void;
|
|
175
191
|
onKeyPress?: (e: KeyboardEvent) => void;
|
|
192
|
+
onKeyPress$?: (e: KeyboardEvent) => void;
|
|
176
193
|
onFocus?: (e: FocusEvent) => void;
|
|
194
|
+
onFocus$?: (e: FocusEvent) => void;
|
|
177
195
|
onBlur?: (e: FocusEvent) => void;
|
|
196
|
+
onBlur$?: (e: FocusEvent) => void;
|
|
178
197
|
onScroll?: (e: Event) => void;
|
|
198
|
+
onScroll$?: (e: Event) => void;
|
|
179
199
|
onWheel?: (e: WheelEvent) => void;
|
|
200
|
+
onWheel$?: (e: WheelEvent) => void;
|
|
180
201
|
onLoad?: (e: Event) => void;
|
|
202
|
+
onLoad$?: (e: Event) => void;
|
|
181
203
|
onError?: (e: Event) => void;
|
|
204
|
+
onError$?: (e: Event) => void;
|
|
182
205
|
onDrag?: (e: DragEvent) => void;
|
|
206
|
+
onDrag$?: (e: DragEvent) => void;
|
|
183
207
|
onDragStart?: (e: DragEvent) => void;
|
|
208
|
+
onDragStart$?: (e: DragEvent) => void;
|
|
184
209
|
onDragEnd?: (e: DragEvent) => void;
|
|
210
|
+
onDragEnd$?: (e: DragEvent) => void;
|
|
185
211
|
onDragEnter?: (e: DragEvent) => void;
|
|
212
|
+
onDragEnter$?: (e: DragEvent) => void;
|
|
186
213
|
onDragLeave?: (e: DragEvent) => void;
|
|
214
|
+
onDragLeave$?: (e: DragEvent) => void;
|
|
187
215
|
onDragOver?: (e: DragEvent) => void;
|
|
216
|
+
onDragOver$?: (e: DragEvent) => void;
|
|
188
217
|
onDrop?: (e: DragEvent) => void;
|
|
218
|
+
onDrop$?: (e: DragEvent) => void;
|
|
189
219
|
onTouchStart?: (e: TouchEvent) => void;
|
|
220
|
+
onTouchStart$?: (e: TouchEvent) => void;
|
|
190
221
|
onTouchMove?: (e: TouchEvent) => void;
|
|
222
|
+
onTouchMove$?: (e: TouchEvent) => void;
|
|
191
223
|
onTouchEnd?: (e: TouchEvent) => void;
|
|
224
|
+
onTouchEnd$?: (e: TouchEvent) => void;
|
|
192
225
|
onTouchCancel?: (e: TouchEvent) => void;
|
|
226
|
+
onTouchCancel$?: (e: TouchEvent) => void;
|
|
193
227
|
onAnimationStart?: (e: AnimationEvent) => void;
|
|
228
|
+
onAnimationStart$?: (e: AnimationEvent) => void;
|
|
194
229
|
onAnimationEnd?: (e: AnimationEvent) => void;
|
|
230
|
+
onAnimationEnd$?: (e: AnimationEvent) => void;
|
|
195
231
|
onAnimationIteration?: (e: AnimationEvent) => void;
|
|
232
|
+
onAnimationIteration$?: (e: AnimationEvent) => void;
|
|
196
233
|
onTransitionEnd?: (e: TransitionEvent) => void;
|
|
234
|
+
onTransitionEnd$?: (e: TransitionEvent) => void;
|
|
197
235
|
onPointerDown?: (e: PointerEvent) => void;
|
|
236
|
+
onPointerDown$?: (e: PointerEvent) => void;
|
|
198
237
|
onPointerUp?: (e: PointerEvent) => void;
|
|
238
|
+
onPointerUp$?: (e: PointerEvent) => void;
|
|
199
239
|
onPointerMove?: (e: PointerEvent) => void;
|
|
240
|
+
onPointerMove$?: (e: PointerEvent) => void;
|
|
200
241
|
onPointerEnter?: (e: PointerEvent) => void;
|
|
242
|
+
onPointerEnter$?: (e: PointerEvent) => void;
|
|
201
243
|
onPointerLeave?: (e: PointerEvent) => void;
|
|
244
|
+
onPointerLeave$?: (e: PointerEvent) => void;
|
|
202
245
|
onPointerOver?: (e: PointerEvent) => void;
|
|
246
|
+
onPointerOver$?: (e: PointerEvent) => void;
|
|
203
247
|
onPointerOut?: (e: PointerEvent) => void;
|
|
248
|
+
onPointerOut$?: (e: PointerEvent) => void;
|
|
204
249
|
onPointerCancel?: (e: PointerEvent) => void;
|
|
250
|
+
onPointerCancel$?: (e: PointerEvent) => void;
|
|
205
251
|
ref?: ((el: T | null) => void) | {
|
|
206
252
|
current: T | null;
|
|
207
253
|
};
|
|
@@ -66,12 +66,12 @@ declare function __fictQrl(moduleId: string, exportName: string): string;
|
|
|
66
66
|
* Register a resume function to prevent it from being tree-shaken.
|
|
67
67
|
* This is called at module load time by compiled component code.
|
|
68
68
|
*/
|
|
69
|
-
declare function __fictRegisterResume(
|
|
69
|
+
declare function __fictRegisterResume(key: string, fn: (...args: unknown[]) => unknown): void;
|
|
70
70
|
/**
|
|
71
71
|
* Get a registered resume function by name.
|
|
72
72
|
* Used by the loader to find resume functions.
|
|
73
73
|
*/
|
|
74
|
-
declare function __fictGetResume(
|
|
74
|
+
declare function __fictGetResume(key: string): ((...args: unknown[]) => unknown) | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* Serialize a value with support for complex types.
|
|
77
77
|
* Handles: Date, Map, Set, RegExp, undefined, NaN, Infinity, -Infinity, BigInt, circular references
|
|
@@ -66,12 +66,12 @@ declare function __fictQrl(moduleId: string, exportName: string): string;
|
|
|
66
66
|
* Register a resume function to prevent it from being tree-shaken.
|
|
67
67
|
* This is called at module load time by compiled component code.
|
|
68
68
|
*/
|
|
69
|
-
declare function __fictRegisterResume(
|
|
69
|
+
declare function __fictRegisterResume(key: string, fn: (...args: unknown[]) => unknown): void;
|
|
70
70
|
/**
|
|
71
71
|
* Get a registered resume function by name.
|
|
72
72
|
* Used by the loader to find resume functions.
|
|
73
73
|
*/
|
|
74
|
-
declare function __fictGetResume(
|
|
74
|
+
declare function __fictGetResume(key: string): ((...args: unknown[]) => unknown) | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* Serialize a value with support for complex types.
|
|
77
77
|
* Handles: Date, Map, Set, RegExp, undefined, NaN, Infinity, -Infinity, BigInt, circular references
|
package/package.json
CHANGED
package/src/jsx.ts
CHANGED
|
@@ -207,59 +207,105 @@ interface HTMLAttributes<T> {
|
|
|
207
207
|
|
|
208
208
|
// Event handlers
|
|
209
209
|
onClick?: (e: MouseEvent) => void
|
|
210
|
+
onClick$?: (e: MouseEvent) => void
|
|
210
211
|
onDblClick?: (e: MouseEvent) => void
|
|
212
|
+
onDblClick$?: (e: MouseEvent) => void
|
|
211
213
|
onMouseDown?: (e: MouseEvent) => void
|
|
214
|
+
onMouseDown$?: (e: MouseEvent) => void
|
|
212
215
|
onMouseUp?: (e: MouseEvent) => void
|
|
216
|
+
onMouseUp$?: (e: MouseEvent) => void
|
|
213
217
|
onMouseMove?: (e: MouseEvent) => void
|
|
218
|
+
onMouseMove$?: (e: MouseEvent) => void
|
|
214
219
|
onMouseEnter?: (e: MouseEvent) => void
|
|
220
|
+
onMouseEnter$?: (e: MouseEvent) => void
|
|
215
221
|
onMouseLeave?: (e: MouseEvent) => void
|
|
222
|
+
onMouseLeave$?: (e: MouseEvent) => void
|
|
216
223
|
onMouseOver?: (e: MouseEvent) => void
|
|
224
|
+
onMouseOver$?: (e: MouseEvent) => void
|
|
217
225
|
onMouseOut?: (e: MouseEvent) => void
|
|
226
|
+
onMouseOut$?: (e: MouseEvent) => void
|
|
218
227
|
onContextMenu?: (e: MouseEvent) => void
|
|
228
|
+
onContextMenu$?: (e: MouseEvent) => void
|
|
219
229
|
onInput?: (e: InputEvent) => void
|
|
230
|
+
onInput$?: (e: InputEvent) => void
|
|
220
231
|
onChange?: (e: Event) => void
|
|
232
|
+
onChange$?: (e: Event) => void
|
|
221
233
|
onSubmit?: (e: SubmitEvent) => void
|
|
234
|
+
onSubmit$?: (e: SubmitEvent) => void
|
|
222
235
|
onReset?: (e: Event) => void
|
|
236
|
+
onReset$?: (e: Event) => void
|
|
223
237
|
onKeyDown?: (e: KeyboardEvent) => void
|
|
238
|
+
onKeyDown$?: (e: KeyboardEvent) => void
|
|
224
239
|
onKeyUp?: (e: KeyboardEvent) => void
|
|
240
|
+
onKeyUp$?: (e: KeyboardEvent) => void
|
|
225
241
|
onKeyPress?: (e: KeyboardEvent) => void
|
|
242
|
+
onKeyPress$?: (e: KeyboardEvent) => void
|
|
226
243
|
onFocus?: (e: FocusEvent) => void
|
|
244
|
+
onFocus$?: (e: FocusEvent) => void
|
|
227
245
|
onBlur?: (e: FocusEvent) => void
|
|
246
|
+
onBlur$?: (e: FocusEvent) => void
|
|
228
247
|
onScroll?: (e: Event) => void
|
|
248
|
+
onScroll$?: (e: Event) => void
|
|
229
249
|
onWheel?: (e: WheelEvent) => void
|
|
250
|
+
onWheel$?: (e: WheelEvent) => void
|
|
230
251
|
onLoad?: (e: Event) => void
|
|
252
|
+
onLoad$?: (e: Event) => void
|
|
231
253
|
onError?: (e: Event) => void
|
|
254
|
+
onError$?: (e: Event) => void
|
|
232
255
|
|
|
233
256
|
// Drag events
|
|
234
257
|
onDrag?: (e: DragEvent) => void
|
|
258
|
+
onDrag$?: (e: DragEvent) => void
|
|
235
259
|
onDragStart?: (e: DragEvent) => void
|
|
260
|
+
onDragStart$?: (e: DragEvent) => void
|
|
236
261
|
onDragEnd?: (e: DragEvent) => void
|
|
262
|
+
onDragEnd$?: (e: DragEvent) => void
|
|
237
263
|
onDragEnter?: (e: DragEvent) => void
|
|
264
|
+
onDragEnter$?: (e: DragEvent) => void
|
|
238
265
|
onDragLeave?: (e: DragEvent) => void
|
|
266
|
+
onDragLeave$?: (e: DragEvent) => void
|
|
239
267
|
onDragOver?: (e: DragEvent) => void
|
|
268
|
+
onDragOver$?: (e: DragEvent) => void
|
|
240
269
|
onDrop?: (e: DragEvent) => void
|
|
270
|
+
onDrop$?: (e: DragEvent) => void
|
|
241
271
|
|
|
242
272
|
// Touch events
|
|
243
273
|
onTouchStart?: (e: TouchEvent) => void
|
|
274
|
+
onTouchStart$?: (e: TouchEvent) => void
|
|
244
275
|
onTouchMove?: (e: TouchEvent) => void
|
|
276
|
+
onTouchMove$?: (e: TouchEvent) => void
|
|
245
277
|
onTouchEnd?: (e: TouchEvent) => void
|
|
278
|
+
onTouchEnd$?: (e: TouchEvent) => void
|
|
246
279
|
onTouchCancel?: (e: TouchEvent) => void
|
|
280
|
+
onTouchCancel$?: (e: TouchEvent) => void
|
|
247
281
|
|
|
248
282
|
// Animation events
|
|
249
283
|
onAnimationStart?: (e: AnimationEvent) => void
|
|
284
|
+
onAnimationStart$?: (e: AnimationEvent) => void
|
|
250
285
|
onAnimationEnd?: (e: AnimationEvent) => void
|
|
286
|
+
onAnimationEnd$?: (e: AnimationEvent) => void
|
|
251
287
|
onAnimationIteration?: (e: AnimationEvent) => void
|
|
288
|
+
onAnimationIteration$?: (e: AnimationEvent) => void
|
|
252
289
|
onTransitionEnd?: (e: TransitionEvent) => void
|
|
290
|
+
onTransitionEnd$?: (e: TransitionEvent) => void
|
|
253
291
|
|
|
254
292
|
// Pointer events
|
|
255
293
|
onPointerDown?: (e: PointerEvent) => void
|
|
294
|
+
onPointerDown$?: (e: PointerEvent) => void
|
|
256
295
|
onPointerUp?: (e: PointerEvent) => void
|
|
296
|
+
onPointerUp$?: (e: PointerEvent) => void
|
|
257
297
|
onPointerMove?: (e: PointerEvent) => void
|
|
298
|
+
onPointerMove$?: (e: PointerEvent) => void
|
|
258
299
|
onPointerEnter?: (e: PointerEvent) => void
|
|
300
|
+
onPointerEnter$?: (e: PointerEvent) => void
|
|
259
301
|
onPointerLeave?: (e: PointerEvent) => void
|
|
302
|
+
onPointerLeave$?: (e: PointerEvent) => void
|
|
260
303
|
onPointerOver?: (e: PointerEvent) => void
|
|
304
|
+
onPointerOver$?: (e: PointerEvent) => void
|
|
261
305
|
onPointerOut?: (e: PointerEvent) => void
|
|
306
|
+
onPointerOut$?: (e: PointerEvent) => void
|
|
262
307
|
onPointerCancel?: (e: PointerEvent) => void
|
|
308
|
+
onPointerCancel$?: (e: PointerEvent) => void
|
|
263
309
|
|
|
264
310
|
// Ref
|
|
265
311
|
ref?: ((el: T | null) => void) | { current: T | null }
|