defuss 2.0.1 → 2.0.3
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/dom-11AL5tu8.cjs +2121 -0
- package/dist/dom-77kNwui3.mjs +2028 -0
- package/dist/dom-8PVikEgj.cjs +2102 -0
- package/dist/dom-B0seF_6L.mjs +2095 -0
- package/dist/dom-B1I0Ntr-.cjs +2128 -0
- package/dist/dom-B2s8h2Oe.cjs +2102 -0
- package/dist/dom-B3MC1bVG.mjs +2034 -0
- package/dist/dom-B3OUXCES.mjs +2070 -0
- package/dist/dom-BBBIovzv.mjs +2034 -0
- package/dist/dom-BEu4Sfd-.cjs +2117 -0
- package/dist/dom-BEzo1MUJ.cjs +2117 -0
- package/dist/dom-BJERuZjE.mjs +2090 -0
- package/dist/dom-BMlw6puj.mjs +2034 -0
- package/dist/dom-BUDmDmgY.cjs +2102 -0
- package/dist/dom-BawwQ--f.mjs +2049 -0
- package/dist/dom-Bei2KSCq.cjs +2142 -0
- package/dist/dom-BfPMu0dJ.mjs +2057 -0
- package/dist/dom-BxWLR_CU.mjs +2034 -0
- package/dist/dom-C-4x7pHa.cjs +2124 -0
- package/dist/dom-C1NIQBAt.cjs +2117 -0
- package/dist/dom-CCyoKmdi.mjs +2049 -0
- package/dist/dom-CDGc8hoY.mjs +2058 -0
- package/dist/dom-CFT2GRw6.mjs +2034 -0
- package/dist/dom-CNKp2T-z.cjs +2126 -0
- package/dist/dom-CSWaOL3c.mjs +2099 -0
- package/dist/dom-CfWHCMus.cjs +2164 -0
- package/dist/dom-Co1NqlV6.mjs +2059 -0
- package/dist/dom-CxRqR3pd.cjs +2102 -0
- package/dist/dom-D3TRLsDS.cjs +2102 -0
- package/dist/dom-DHKdnUMm.cjs +2118 -0
- package/dist/dom-DKQ6CnRq.mjs +2050 -0
- package/dist/dom-DLIPg3QY.mjs +1977 -0
- package/dist/dom-DLKmVfPz.mjs +2057 -0
- package/dist/dom-DNGWHS7t.cjs +2159 -0
- package/dist/dom-DPbGY8oU.mjs +2073 -0
- package/dist/dom-DTo7fRwx.mjs +2055 -0
- package/dist/dom-Daho4GPR.mjs +2053 -0
- package/dist/dom-Db15rsM1.mjs +2049 -0
- package/dist/dom-DgoG3lqb.cjs +2117 -0
- package/dist/dom-DmGkOplK.cjs +2127 -0
- package/dist/dom-DvHgqwJh.mjs +2046 -0
- package/dist/dom-EqEVp0-C.cjs +2033 -0
- package/dist/dom-NjCYLgPw.cjs +2126 -0
- package/dist/dom-UHntoboN.cjs +2139 -0
- package/dist/dom-Z-gE5GK8.cjs +2168 -0
- package/dist/dom-mlV6havt.mjs +2048 -0
- package/dist/dom-x3xpYktC.cjs +2114 -0
- package/dist/dom-yD0xCNhJ.cjs +2096 -0
- package/dist/index-B2aNqkPk.d.ts +1440 -0
- package/dist/index-B_CgmZnk.d.ts +1433 -0
- package/dist/index-CEtCW1xG.d.ts +1433 -0
- package/dist/index-CfTsJbfE.d.ts +1432 -0
- package/dist/{index-S3MRf--S.d.ts → index-Co0eiBV7.d.ts} +270 -198
- package/dist/index-CtUAjHuo.d.ts +1433 -0
- package/dist/index-CuzRXgFf.d.ts +1439 -0
- package/dist/index-DFuY8uu9.d.ts +1431 -0
- package/dist/index-Dhj90n6u.d.ts +1433 -0
- package/dist/index-DjCdylRj.d.ts +1438 -0
- package/dist/index-DyKry_9r.d.ts +1439 -0
- package/dist/index-FWrGRiCX.d.ts +1431 -0
- package/dist/index-wIzDVlFz.d.ts +1439 -0
- package/dist/index.cjs +397 -3
- package/dist/index.d.cts +27 -151
- package/dist/index.d.ts +27 -151
- package/dist/index.mjs +328 -3
- package/dist/render/client.cjs +97 -2
- package/dist/render/client.d.cts +2 -2
- package/dist/render/client.d.ts +2 -2
- package/dist/render/client.mjs +79 -2
- package/dist/render/index.cjs +21 -2
- package/dist/render/index.d.cts +1 -1
- package/dist/render/index.d.ts +1 -1
- package/dist/render/index.mjs +2 -2
- package/dist/render/server.cjs +94 -2
- package/dist/render/server.d.cts +2 -2
- package/dist/render/server.d.ts +2 -2
- package/dist/render/server.mjs +55 -2
- package/package.json +10 -17
- package/dist/dom-BWzRM0Rn.mjs +0 -2
- package/dist/dom-BWzRM0Rn.mjs.map +0 -1
- package/dist/dom-C5mY2MSs.cjs +0 -2
- package/dist/dom-C5mY2MSs.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/render/client.cjs.map +0 -1
- package/dist/render/client.mjs.map +0 -1
- package/dist/render/index.cjs.map +0 -1
- package/dist/render/index.mjs.map +0 -1
- package/dist/render/server.cjs.map +0 -1
- package/dist/render/server.mjs.map +0 -1
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/common/devmode.ts","../src/webstorage/isomporphic/memory.ts","../src/webstorage/client/index.ts","../src/webstorage/server/index.ts","../src/webstorage/runtime.ts","../src/webstorage/index.ts","../src/i18n/i18n.tsx","../src/i18n/trans.tsx","../src/net/fetch.ts","../src/dom-router/router.ts","../src/dom-router/Route.tsx","../src/dom-router/Redirect.tsx","../src/dom-router/RouterSlot.tsx","../src/async/Async.tsx"],"sourcesContent":["export const inDevMode = true;","import type { PersistenceProviderImpl } from '../provider.js'\nimport type { GenericLocalStorage } from './generic.js'\nimport type { MiddlewareFn } from '../provider.js'\n\nexport type MemoryProviderOptions = {}\n\nexport const newInMemoryGenericStorageBackend = <T = string>(): GenericLocalStorage<T> => {\n const cache = new Map<string, T>()\n return {\n clear: (): void => {\n cache.clear()\n },\n\n getItem: (key: string): T | null => {\n return cache.get(String(key)) ?? null\n },\n\n removeItem: (key: string): void => {\n cache.delete(String(key))\n },\n\n setItem: (key: string, value: T): void => {\n cache.set(String(key), value)\n },\n }\n}\n\n/** global in-memory storage backend */\nexport const memory = newInMemoryGenericStorageBackend()\n\n/** a simple, serverless and high-performance key/value storage engine */\nexport class WebStorageProvider<T> implements PersistenceProviderImpl<T> {\n protected storage: GenericLocalStorage<string>;\n\n constructor(storage?: GenericLocalStorage<string>) {\n this.storage = storage || memory;\n }\n\n get(key: string, defaultValue: T, middlewareFn?: MiddlewareFn<T>): T {\n const rawValue = this.storage.getItem(key);\n\n if (rawValue === null) return defaultValue;\n\n let value: T = JSON.parse(rawValue);\n\n if (middlewareFn) {\n value = middlewareFn(key, value);\n }\n return value;\n }\n\n set(key: string, value: T, middlewareFn?: MiddlewareFn<T>): void {\n if (middlewareFn) {\n value = middlewareFn(key, value);\n }\n this.storage.setItem(key, JSON.stringify(value));\n }\n\n remove(key: string): void {\n this.storage.removeItem(key);\n }\n\n removeAll(): void {\n this.storage.clear();\n }\n\n get backendApi(): GenericLocalStorage<string> {\n return this.storage;\n }\n}\n\nexport interface MemoryStorage<T> extends PersistenceProviderImpl<T> {\n backendApi: Omit<Omit<Storage, 'key'>, 'length'>\n}\n\nexport interface WebStorage<T> extends PersistenceProviderImpl<T> {\n backendApi: Storage\n}\n","import { WebStorageProvider } from '../isomporphic/memory.js'\nimport type { PersistenceProvider, PersistenceProviderImpl, PersistenceProviderOptions } from '../provider.js'\n\n/** returns the default persistence provider for each runtime environment */\nexport const getPersistenceProvider = <T>(\n provider: PersistenceProvider,\n _options?: PersistenceProviderOptions,\n): PersistenceProviderImpl<T> => {\n switch (provider) {\n case 'session':\n return new WebStorageProvider<T>(window.sessionStorage)\n case 'local':\n return new WebStorageProvider<T>(window.localStorage)\n }\n return new WebStorageProvider<T>() // memory\n}\n","import { WebStorageProvider } from '../isomporphic/memory.js'\nimport type { PersistenceProvider, PersistenceProviderImpl, PersistenceProviderOptions } from '../provider.js'\n\n/** returns the default persistence provider for each runtime environment */\nexport const getPersistenceProvider = <T>(\n _provider: PersistenceProvider,\n _options?: PersistenceProviderOptions,\n): PersistenceProviderImpl<T> => {\n return new WebStorageProvider<T>()\n}\n","//export const isBrowser = (): boolean => typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nexport const isServer = (): boolean => typeof window === \"undefined\" || typeof window.document === \"undefined\";\n\n//export const isWebWorker = (): boolean => typeof self === \"object\" && self.constructor?.name === \"DedicatedWorkerGlobalScope\";","import type { PersistenceProvider, PersistenceProviderImpl, PersistenceProviderOptions } from './provider.js'\nimport { getPersistenceProvider as getPersistenceProviderClient } from './client/index.js'\nimport { getPersistenceProvider as getPersistenceProviderServer } from './server/index.js'\nimport { isServer } from './runtime.js'\n\n/** returns the persistence provider (isomorphic) */\nexport const webstorage = <T>(\n provider: PersistenceProvider = 'local',\n options?: PersistenceProviderOptions,\n): PersistenceProviderImpl<T> => {\n if (isServer()) {\n return getPersistenceProviderServer(provider, options)\n } else {\n return getPersistenceProviderClient(provider, options)\n }\n}\n\nexport * from './provider.js'\n","import type { VNode } from '@/render/types.js';\nimport { createStore, type Store } from '@/store/index.js';\n\nexport type TranslationObject = { [key: string]: string|VNode|TranslationObject };\nexport type Translations = { [language: string]: TranslationObject };\nexport type OnLanguageChangeListener = (newLanguage: string) => void;\nexport type Replacements = Record<string, string>;\n\nexport interface I18nStore {\n language: string;\n changeLanguage: (language: string) => void;\n t: (path: string, options?: Record<string, string>) => string;\n load: (language: string, translations: TranslationObject) => void;\n subscribe: (onLanguageChange: OnLanguageChangeListener) => void;\n}\n\n// example of placeholders: {name}, {age}, {city}\nconst VARIABLE_REGEX = /{([^}]*)}/g;\n\nconst interpolate = (template: string, replacements: Replacements): string =>\n template.replace(VARIABLE_REGEX, (_, key) => replacements[key] || `{${key}}`);\n\nexport const createI18n = (): I18nStore => {\n const translationsStore: Store<Translations> = createStore({});\n let language = 'en';\n\n const onLanguageChangeCallbacks: Array<OnLanguageChangeListener> = [];\n\n return {\n language,\n\n changeLanguage(newLanguage: string) {\n language = newLanguage;\n onLanguageChangeCallbacks.forEach(callback => callback(newLanguage));\n },\n\n // example usage of the t function with placeholders:\n // const translatedString = t('greeting', { name: 'John', age: '30' }, 'common');\n // this would replace placeholders {name} and {age} in the translation string with 'John' and '30' respectively.\n t(path: string, replacements: Record<string, string> = {}) {\n\n const template = translationsStore.get<string>(`${language}.${path}`) || path\n\n // VDOM (VNode)\n if (typeof template !== 'string') {\n return template;\n }\n // plaintext string or HTML\n return interpolate(template, replacements);\n },\n\n load(newLanguage: string, namespaceTranslations: TranslationObject) {\n translationsStore.set(newLanguage, {\n ...translationsStore.get<TranslationObject>(newLanguage),\n ...namespaceTranslations,\n });\n },\n\n subscribe(onLanguageChange: OnLanguageChangeListener) {\n onLanguageChangeCallbacks.push(onLanguageChange);\n return () => {\n const index = onLanguageChangeCallbacks.indexOf(onLanguageChange);\n if (index >= 0) onLanguageChangeCallbacks.splice(index, 1);\n };\n }\n };\n};\n\n// export singleton\nexport const i18n = createI18n();\n","import type { Props, VNodeChild } from \"@/render/types.js\";\nimport { type Replacements, i18n } from \"./i18n.js\";\n\nexport interface TransProps extends Props { \n path: string, \n tag?: string,\n replacements?: Replacements,\n class?: string,\n className?: string,\n style?: string,\n} \n\nexport const Trans = ({ path, replacements, tag, ...attrs }: TransProps): VNodeChild => {\n\n const ref = {}\n\n // re-render component on language change\n i18n.subscribe(() => {\n const value = i18n.t(path, replacements);\n console.log('new val', value);\n //$(ref).html(value);\n });\n\n return {\n tag: tag || 'span',\n attributes: {\n ref,\n ...attrs,\n },\n // initially render\n children: i18n.t(path, replacements),\n }\n}\n","\n/**\n * custom headers class to manage HTTP headers with case-insensitive keys.\n * simplifies header manipulation by providing utility methods.\n */\nexport class Headers {\n // internal map to store headers\n private map: Map<string, string>;\n\n /**\n * initializes the Headers instance with provided headers or another Headers object.\n * ensures all header keys are stored in lowercase for consistent access.\n * @param init initial headers as a record or another Headers instance\n */\n constructor(init: Record<string, string> | Headers = {}) {\n this.map = new Map();\n\n if (init instanceof Headers) {\n init.forEach((value, key) => this.map.set(key, value));\n } else {\n Object.entries(init).forEach(([key, value]) =>\n this.map.set(key.toLowerCase(), value)\n );\n }\n }\n\n /**\n * appends or sets the value for a specific header key.\n * stores the key in lowercase to maintain case-insensitivity.\n * @param key header name\n * @param value header value\n */\n append(key: string, value: string): void {\n this.map.set(key.toLowerCase(), value);\n }\n\n /**\n * retrieves the value of a specific header key.\n * @param key header name\n * @returns the header value or null if not found\n */\n get(key: string): string | null {\n return this.map.get(key.toLowerCase()) || null;\n }\n\n /**\n * checks if a specific header key exists.\n * @param key header name\n * @returns boolean indicating existence of the header\n */\n has(key: string): boolean {\n return this.map.has(key.toLowerCase());\n }\n\n /**\n * iterates over all headers and executes the provided callback for each.\n * @param callback function to execute for each header\n */\n forEach(callback: (value: string, key: string) => void): void {\n this.map.forEach((value, key) => callback(value, key));\n }\n}\n\n/**\n * ProgressSignal extends EventTarget to dispatch and track progress events.\n * useful for monitoring the progress of network requests.\n */\nexport class ProgressSignal extends EventTarget {\n // internal progress state\n private _progress: { loaded: number; total: number };\n\n /**\n * initializes the ProgressSignal with zero progress.\n */\n constructor() {\n super();\n this._progress = { loaded: 0, total: 0 };\n }\n\n /**\n * retrieves the current progress.\n * @returns an object containing loaded and total bytes\n */\n get progress(): { loaded: number; total: number } {\n return this._progress;\n }\n\n /**\n * dispatches a progress event with updated loaded and total bytes.\n * updates the internal progress state.\n * @param event the ProgressEvent containing progress information\n */\n dispatchProgress(event: ProgressEvent): void {\n this._progress = { loaded: event.loaded, total: event.total };\n this.dispatchEvent(\n new ProgressEvent('progress', { loaded: event.loaded, total: event.total })\n );\n }\n}\n\n/**\n * ProgressController manages a ProgressSignal for tracking request progress.\n * provides a centralized way to handle progress events.\n */\nexport class ProgressController {\n signal: ProgressSignal;\n\n /**\n * initializes the ProgressController with a new ProgressSignal.\n */\n constructor() {\n this.signal = new ProgressSignal();\n }\n}\n\n/**\n * serializes the request body into a format suitable for XMLHttpRequest.\n * handles various body types including JSON objects and FormData.\n * @param body the body to serialize\n * @returns the serialized body or null if no body is provided\n */\nexport function serializeBody(\n body: BodyInit | Record<string, unknown> | null | undefined\n): XMLHttpRequestBodyInit | Document | null {\n if (!body) return null;\n\n if (\n body instanceof FormData ||\n body instanceof Blob ||\n body instanceof URLSearchParams ||\n body instanceof ArrayBuffer ||\n ArrayBuffer.isView(body) ||\n typeof body === \"string\"\n ) {\n return body;\n }\n\n if (typeof body === \"object\") {\n return JSON.stringify(body); // convert object to JSON string for transmission\n }\n\n return String(body); // ensure fallback to string for unsupported types\n}\n\n/**\n * parses a raw header string from an XMLHttpRequest into a Headers instance.\n * @param headerStr the raw header string\n * @returns a Headers instance containing parsed headers\n */\nexport function parseHeaders(headerStr: string): Headers {\n const headers = new Headers();\n headerStr.split('\\r\\n').forEach((line) => {\n const [key, ...rest] = line.split(': ');\n if (key) headers.append(key, rest.join(': '));\n });\n return headers;\n}\n\n/**\n * extends the standard RequestInit to include an optional ProgressSignal.\n * allows tracking the progress of the network request.\n */\nexport interface FetchWithControllersInit extends RequestInit {\n progressSignal?: ProgressSignal;\n}\n\n/**\n * represents the response from a fetch operation, mirroring the native Response interface.\n * includes methods to access the response body in various formats.\n */\nexport interface FetchResponse {\n ok: boolean;\n status: number;\n statusText: string;\n headers: Headers;\n url: string;\n text: () => Promise<string>;\n json: () => Promise<unknown>;\n blob: () => Promise<Blob>;\n}\n\n/**\n * performs a network fetch request with support for progress tracking using XMLHttpRequest.\n * falls back to the native fetch implementation if no ProgressSignal is provided.\n * @param input the resource to fetch, typically a URL string\n * @param init optional configuration for the request, including method, headers, body, credentials, and progressSignal\n * @returns a promise resolving to a FetchResponse containing the response details\n */\nexport async function fetch(\n input: string | URL,\n init: FetchWithControllersInit = {}\n): Promise<FetchResponse> {\n // use native fetch if ProgressSignal is not provided for simplicity and efficiency\n if (!init.progressSignal && typeof globalThis.fetch === \"function\") {\n return fetch(input, init) as unknown as FetchResponse;\n }\n\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n const method = (init.method || 'GET').toUpperCase();\n const body = serializeBody(init.body || null);\n const progressSignal = init.progressSignal;\n const abortSignal = init.signal;\n\n // handle abort events to allow request cancellation\n if (abortSignal) {\n const abortHandler = () => {\n xhr.abort();\n reject(new DOMException('The operation was aborted.', 'AbortError'));\n };\n abortSignal.addEventListener('abort', abortHandler, { once: true });\n }\n\n xhr.open(method, input.toString(), true);\n\n // set credentials based on the init configuration\n if (init.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (init.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n // set request headers using the custom Headers class or raw headers\n if (init.headers instanceof Headers) {\n init.headers.forEach((value, key) => xhr.setRequestHeader(key, value));\n } else if (init.headers) {\n Object.entries(init.headers).forEach(([key, value]) => {\n xhr.setRequestHeader(key, value as string);\n });\n }\n\n // attach progress listeners if a ProgressSignal is provided\n if (progressSignal) {\n if (xhr.upload) {\n xhr.upload.onprogress = (event) => progressSignal.dispatchProgress(event);\n }\n xhr.onprogress = (event) => progressSignal.dispatchProgress(event);\n }\n\n // handle the response once the request is completed\n xhr.onload = () => {\n const response: FetchResponse = {\n ok: xhr.status >= 200 && xhr.status < 300,\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders()),\n url: xhr.responseURL,\n text: () => Promise.resolve(xhr.responseText),\n json: () => Promise.resolve(JSON.parse(xhr.responseText)),\n blob: () => Promise.resolve(new Blob([xhr.response])),\n };\n resolve(response);\n };\n\n // handle network errors\n xhr.onerror = () => reject(new TypeError('Network request failed'));\n xhr.ontimeout = () => reject(new TypeError('Network request timed out'));\n xhr.onabort = () => reject(new DOMException('The operation was aborted.', 'AbortError'));\n\n // send the serialized request body\n xhr.send(body);\n });\n}\n\n\n/*\n // example usage of fetch with upload tracking\n async function exampleFetchWithUploadTracking() {\n const url = 'https://example.com/upload';\n const data = new FormData();\n data.append('file', new Blob(['file content'], { type: 'text/plain' }), 'example.txt');\n\n const { signal: progressSignal } = new ProgressController();\n\n progressSignal.addEventListener('progress', (event: ProgressEvent) => {\n console.log(`Uploaded ${event.loaded} of ${event.total} bytes`);\n });\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n body: data,\n headers: {\n 'Accept': 'application/json'\n },\n credentials: 'include',\n progressSignal\n });\n\n if (response.ok) {\n const jsonResponse = await response.json();\n console.log('Upload successful:', jsonResponse);\n } else {\n console.error('Upload failed:', response.statusText);\n }\n } catch (error) {\n console.error('Error during fetch:', error);\n }\n }\n \n */","export type OnHandleRouteChangeFn = (newRoute: string, oldRoute: string) => void;\nexport type OnRouteChangeFn = (cb: OnHandleRouteChangeFn) => void;\nexport type RouterStrategy = 'page-refresh' | 'slot-refresh';\n\nexport interface Router {\n listeners: Array<OnHandleRouteChangeFn>;\n strategy: RouterStrategy;\n add(registration: RouteRegistration): Router;\n match(path?: string): RouteRequest | false;\n getRoutes(): Array<RouteRegistration>;\n tokenizePath(path: string): TokenizedPath;\n navigate(path: string): void;\n onRouteChange: OnRouteChangeFn;\n}\n\nexport interface RouterConfig {\n strategy?: RouterStrategy;\n}\n\ninterface RouteMatchGroups {\n [matchName: string]: number;\n}\n\nexport interface RouteParams {\n [name: string]: string;\n}\n\nexport interface RouteRegistration {\n path: string;\n exact?: boolean;\n tokenizedPath?: TokenizedPath;\n handler?: RouteHandler;\n}\n\nexport interface RouteRequest {\n url: string;\n params: RouteParams;\n}\n\nexport interface TokenizedPath {\n regexp: RegExp;\n groups: RouteMatchGroups;\n}\n\nexport type RouteHandler = (request: RouteRequest) => void;\n\nexport const tokenizePath = (path: string): TokenizedPath => {\n const paramNameRegexp = /:([^\\/\\.\\\\]+)/g;\n const groups: RouteMatchGroups = {};\n let groupIndex = 1;\n\n // Replace parameters with capturing groups and store the parameter names.\n const pattern = path.replace(paramNameRegexp, (_, paramName) => {\n groups[paramName] = groupIndex++;\n return '([^/\\.\\\\]+)';\n });\n\n return {\n groups,\n regexp: new RegExp(`^${pattern}$`),\n };\n};\n\nexport const matchRouteRegistrations = (\n routeRegistrations: Array<RouteRegistration>,\n actualPathName: string,\n haystackPathName?: string\n): RouteRequest | false => {\n for (const route of routeRegistrations) {\n // Check if path is set and route.path matches it\n if (haystackPathName && route.path !== haystackPathName) {\n //console.warn(`Skipped path: Looking for ${haystackPathName}, but found ${route.path}`);\n continue;\n }\n\n // Check if exact match is required and if the match is exact\n if (route.exact && route.path !== actualPathName) {\n //console.warn(`Exact match required, but found ${actualPathName} instead of ${route.path}`);\n continue;\n }\n\n const match = route.tokenizedPath!.regexp.exec(actualPathName);\n if (!match) continue;\n\n //console.log(`Route matched: ${route.path} for URL: ${actualPathName}`);\n\n const params: RouteParams = {};\n\n // Extract each parameter using the stored capturing group index.\n for (const [paramName, groupIndex] of Object.entries(route.tokenizedPath!.groups)) {\n params[paramName] = match[groupIndex];\n }\n\n const request: RouteRequest = { url: actualPathName, params };\n\n if (typeof route.handler === 'function') {\n route.handler(request);\n }\n return request;\n }\n return false;\n};\n\nexport const setupRouter = (config: RouterConfig = {\n strategy: 'page-refresh', // default\n}, windowImpl?: Window): Router => {\n const routeRegistrations: Array<RouteRegistration> = [];\n\n // safe SSR rendering, and fine default for client side\n if (typeof window !== 'undefined' && !windowImpl) {\n windowImpl = globalThis.__defuss_window /** for SSR support */ || window;\n }\n\n if (!windowImpl) {\n console.warn('Router requires a Window API implementation!');\n }\n\n const api = {\n ...config,\n listeners: [] as Array<OnHandleRouteChangeFn>,\n onRouteChange: (cb: OnHandleRouteChangeFn) => {\n api.listeners.push(cb);\n },\n tokenizePath,\n add(registration: RouteRegistration): Router {\n const isAlreadyRegistered = routeRegistrations.some(\n (registeredRoute) => registeredRoute.path === registration.path\n );\n\n if (!isAlreadyRegistered) {\n routeRegistrations.push({\n ...registration,\n tokenizedPath: tokenizePath(registration.path)\n });\n }\n return api as Router;\n },\n match(path?: string) {\n return matchRouteRegistrations(routeRegistrations, windowImpl!.document.location.pathname, path);\n },\n navigate(newPath: string) {\n const strategy = api.strategy || 'page-refresh';\n const oldPath = windowImpl ? windowImpl.document.location.pathname : '';\n\n if (strategy === 'page-refresh') {\n document.location.href = newPath;\n } else if (strategy === 'slot-refresh') {\n // show new path in the address bar\n if (typeof windowImpl !== 'undefined') {\n windowImpl!.history.pushState({}, '', newPath);\n }\n\n for (const listener of api.listeners) {\n listener(newPath, oldPath);\n }\n }\n },\n getRoutes() {\n return routeRegistrations;\n },\n };\n return api as Router;\n};\n\nexport const Router = setupRouter();\n","import type { Props, VNodeChild } from \"@/render/types.js\";\nimport { Router } from \"./router.js\";\n\nexport interface RouteProps extends Props { \n path: string\n router?: Router,\n exact?: boolean\n} \n\nexport const Route = ({ path, exact, children, router = Router }: RouteProps): VNodeChild => {\n // make sure the router knows the path to be matched\n router.add({\n path,\n exact: exact || false,\n });\n return router.match(path) ? children![0] : null;\n} ","import type { VNodeChild } from \"@/render/types.js\";\nimport type { RouteProps } from \"./Route.js\";\nimport { Route } from \"./Route.js\";\nimport { Router } from \"./router.js\";\n\nexport interface RedirectProps extends RouteProps { \n to: string\n}\n\nexport const Redirect = ({ path, to, router = Router, exact }: RedirectProps): VNodeChild => {\n requestAnimationFrame(() => {\n if (Route({ path, router, exact, children: [true] })) {\n //console.log(\"Redirect\", to);\n router.navigate(to); \n }\n });\n return null;\n} ","import type { Props, VNodeChild } from \"@/render/types.js\";\nimport { createRef, type Ref } from \"@/render/client.js\";\nimport { Router } from \"./router.js\";\nimport { $, type NodeType } from '@/dequery/index.js';\n\nexport const RouterSlotId = \"router-slot\";\n\nexport interface RouterSlotProps extends Props {\n\n /** to override the tag name used for the router slot */\n tag?: string;\n\n /** to identify/select the root DOM element or style it, W3C naming */\n class?: string;\n\n /** to identify/select the root DOM element or style it, React naming */\n className?: string;\n\n /** to override the default global router */\n router?: Router;\n\n /** A component reference that returns many <Route />, <Redirect ... /> etc. components */\n RouterOutlet?: any\n}\n\n/**\n * RouterSlot registers a slot refresh handler with the global router configuration\n * and renders its default children (RouterOutlet). Whenever the route changes, it re-renders dynamically.\n * This decouples the slot refresh logic from route registration.\n */\nexport const RouterSlot = ({ router = Router, children, RouterOutlet, ...attributes }: RouterSlotProps): VNodeChild => {\n \n const { tag, ...attributesWithoutTag } = attributes;\n const ref: Ref<NodeType> = createRef();\n\n // by using this component, we automatically switch to slot-refresh strategy\n router.strategy = 'slot-refresh';\n\n router.onRouteChange(() => {\n //console.log(\"<RouterSlot> RouterSlot.onRouteChange\", newPath, oldPath, ref.current);\n $(ref).update(RouterOutlet());\n });\n\n if (document.getElementById(RouterSlotId)) {\n console.warn(`It seems there's more than one <RouterSlot /> components defined as an element with id #${RouterSlotId} already exists in the DOM.`);\n }\n\n return {\n children: RouterOutlet() || [],\n type: attributes.tag || \"div\", \n attributes: {\n ...attributesWithoutTag,\n id: RouterSlotId,\n ref,\n },\n };\n};\n","import type { RenderInput, VNodeChildren, VNode, Ref, Props } from '@/render/types.js'\nimport { createRef, isRef } from \"@/render/index.js\";\nimport { $ } from \"@/dequery/index.js\";\nimport { inDevMode } from \"@/common/index.js\";\n\nexport type AsyncState = 'loading' | 'loaded' | 'error'\n\nexport interface AsyncStateRef extends Ref<HTMLElement> { \n /** The state of the async content */\n state?: AsyncState;\n\n /** Error details are available here in case the state changes to \"error\" */\n error?: unknown;\n}\n\nexport interface AsyncProps extends Props {\n\n /** to uniquely identify the root DOM element without using a ref */\n id?: string;\n\n /** to identify/select the root DOM element or style it, W3C naming */\n class?: string;\n\n /** to identify/select the root DOM element or style it, React naming */\n className?: string;\n\n /** The fallback content to display while the async content is loading */\n fallback?: VNode;\n\n /** Store this with createRef() to update() the Suspense state */\n ref?: AsyncStateRef;\n\n /** The async content to display when loaded */\n render?: () => Promise<RenderInput>;\n\n /** to override the name of the .suspense-loading transition CSS class name */\n loadingClassName?: string;\n\n /** to override the name of the .suspense-loaded transition CSS class name */\n loadedClassName?: string;\n\n /** to override the name of the .suspense-error transition CSS class name */\n errorClassName?: string;\n}\n\nexport const Async = ({ \n fallback, ref, children, class: _class, className, id, loadingClassName, loadedClassName, errorClassName, onError\n}: AsyncProps) => {\n\n let childrenToRender: VNodeChildren | undefined = children;\n\n const containerRef: AsyncStateRef = createRef<AsyncState>(function onSuspenseUpdate(state: AsyncState) {\n\n try {\n\n if (!containerRef.current) {\n if (inDevMode) {\n console.warn(\"Suspense container is not mounted yet, but a state update demands a render. State is:\", state);\n }\n return;\n }\n\n // to allow for beautiful CSS state transitions\n $(containerRef.current).removeClass(loadingClassName || \"suspense-loading\");\n $(containerRef.current).removeClass(loadedClassName || \"suspense-loaded\");\n $(containerRef.current).removeClass(errorClassName || \"suspense-error\");\n\n if (!children || state === 'error') {\n $(containerRef.current).addClass(errorClassName || \"suspense-error\");\n $(containerRef).jsx({\n type: 'div',\n children: [\"Loading error!\"]\n });\n } else if (state === 'loading') {\n $(containerRef.current).addClass(loadingClassName || \"suspense-loading\");\n $(containerRef).jsx(fallback);\n } else if (state === 'loaded') {\n $(containerRef.current).addClass(loadedClassName || \"suspense-loaded\");\n\n console.log(\"[Async render] start\")\n $(containerRef).jsx(childrenToRender as RenderInput);\n console.log(\"[Async render] finished\")\n }\n } catch (error) {\n containerRef.update(\"error\");\n containerRef.error = error;\n\n if (typeof onError === 'function') {\n // pass the error up to the parent component\n onError(error);\n }\n }\n }, \"loading\");\n\n if (isRef(ref)) {\n\n // for the initial state synchronization between outer and inner scope\n // we don't want to trigger the suspense state to render,\n // as the DOM element is not yet mounted (rendered in DOM)\n let isInitial = true;\n\n // when the suspense state is updated in outer scope\n // we bridge the update to the internal containerRef\n ref.update = (state: AsyncState) => {\n if (!isInitial) {\n containerRef.update(state);\n }\n }\n // let's tell the outer scope the initial state\n ref.update(\"loading\");\n\n isInitial = false; // render any outer scope updates from now on\n }\n\n // resolve async children\n const promisedChildren = (children || []).map((vnode) => {\n\n try {\n if (!vnode || (vnode && !(vnode as VNode).type)) {\n return Promise.resolve(''); // becomes a Text node\n }\n\n // <Async><SomeAsyncComponent /></Async>\n if ((vnode as VNode).type.constructor.name === 'AsyncFunction') {\n // construct the props object\n const props = { ...(vnode as VNode).attributes, children: (vnode as VNode).children };\n // yield the Promise objects\n return (vnode as VNode).type(props);\n }\n\n // all the other synchronous cases\n return Promise.resolve(vnode);\n } catch (error) {\n containerRef.update(\"error\");\n containerRef.error = error;\n\n if (typeof onError === 'function') {\n // pass the error up to the parent component\n onError(error);\n }\n }\n })\n\n const onMount = () => {\n\n if (promisedChildren.length) {\n\n containerRef.update(\"loading\");\n\n Promise.all(promisedChildren)\n .then((awaitedVnodes) => {\n childrenToRender = awaitedVnodes.flatMap((vnode: VNode) =>\n vnode?.type === 'Fragment' ? vnode.children : vnode\n );\n containerRef.update(\"loaded\");\n })\n .catch((error) => {\n containerRef.update(\"error\");\n containerRef.error = error;\n\n if (inDevMode) {\n console.error(\"SuspenseLoadingError\", error);\n }\n $(containerRef).jsx(`SuspenseLoadingError: ${error}`);\n\n if (typeof onError === 'function') {\n onError(error);\n }\n });\n }\n }\n\n return {\n type: 'div',\n attributes: { id, class: _class, className, ref: containerRef, onMount },\n children: fallback ? [fallback] : []\n }\n}\n\n// React-mimicing alias\nexport const Suspense = Async;"],"names":["getPersistenceProvider","getPersistenceProviderServer","getPersistenceProviderClient","createStore","createRef","$","isRef"],"mappings":";;;;AACY,MAAC,SAAS,GAAG;;ACAlB,MAAM,gCAAgC,GAAG,MAAM;AACtD,EAAE,MAAM,KAAK,mBAAmB,IAAI,GAAG,EAAE;AACzC,EAAE,OAAO;AACT,IAAI,KAAK,EAAE,MAAM;AACjB,MAAM,KAAK,CAAC,KAAK,EAAE;AACnB,KAAK;AACL,IAAI,OAAO,EAAE,CAAC,GAAG,KAAK;AACtB,MAAM,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI;AAC3C,KAAK;AACL,IAAI,UAAU,EAAE,CAAC,GAAG,KAAK;AACzB,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,KAAK;AACL,IAAI,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK;AAC7B,MAAM,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;AACnC;AACA,GAAG;AACH,CAAC;AACM,MAAM,MAAM,GA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AI,IAAI,EAAE,KAAK;AACf,IAAI,UAAU,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE;AAC5E,IAAI,QAAQ,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG;AACtC,GAAG;AACH;AACY,MAAC,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/common/devmode.ts","../src/webstorage/isomporphic/memory.ts","../src/webstorage/client/index.ts","../src/webstorage/server/index.ts","../src/webstorage/runtime.ts","../src/webstorage/index.ts","../src/i18n/i18n.tsx","../src/i18n/trans.tsx","../src/net/fetch.ts","../src/dom-router/router.ts","../src/dom-router/Route.tsx","../src/dom-router/Redirect.tsx","../src/dom-router/RouterSlot.tsx","../src/async/Async.tsx"],"sourcesContent":["export const inDevMode = true;","import type { PersistenceProviderImpl } from '../provider.js'\nimport type { GenericLocalStorage } from './generic.js'\nimport type { MiddlewareFn } from '../provider.js'\n\nexport type MemoryProviderOptions = {}\n\nexport const newInMemoryGenericStorageBackend = <T = string>(): GenericLocalStorage<T> => {\n const cache = new Map<string, T>()\n return {\n clear: (): void => {\n cache.clear()\n },\n\n getItem: (key: string): T | null => {\n return cache.get(String(key)) ?? null\n },\n\n removeItem: (key: string): void => {\n cache.delete(String(key))\n },\n\n setItem: (key: string, value: T): void => {\n cache.set(String(key), value)\n },\n }\n}\n\n/** global in-memory storage backend */\nexport const memory = newInMemoryGenericStorageBackend()\n\n/** a simple, serverless and high-performance key/value storage engine */\nexport class WebStorageProvider<T> implements PersistenceProviderImpl<T> {\n protected storage: GenericLocalStorage<string>;\n\n constructor(storage?: GenericLocalStorage<string>) {\n this.storage = storage || memory;\n }\n\n get(key: string, defaultValue: T, middlewareFn?: MiddlewareFn<T>): T {\n const rawValue = this.storage.getItem(key);\n\n if (rawValue === null) return defaultValue;\n\n let value: T = JSON.parse(rawValue);\n\n if (middlewareFn) {\n value = middlewareFn(key, value);\n }\n return value;\n }\n\n set(key: string, value: T, middlewareFn?: MiddlewareFn<T>): void {\n if (middlewareFn) {\n value = middlewareFn(key, value);\n }\n this.storage.setItem(key, JSON.stringify(value));\n }\n\n remove(key: string): void {\n this.storage.removeItem(key);\n }\n\n removeAll(): void {\n this.storage.clear();\n }\n\n get backendApi(): GenericLocalStorage<string> {\n return this.storage;\n }\n}\n\nexport interface MemoryStorage<T> extends PersistenceProviderImpl<T> {\n backendApi: Omit<Omit<Storage, 'key'>, 'length'>\n}\n\nexport interface WebStorage<T> extends PersistenceProviderImpl<T> {\n backendApi: Storage\n}\n","import { WebStorageProvider } from '../isomporphic/memory.js'\nimport type { PersistenceProvider, PersistenceProviderImpl, PersistenceProviderOptions } from '../provider.js'\n\n/** returns the default persistence provider for each runtime environment */\nexport const getPersistenceProvider = <T>(\n provider: PersistenceProvider,\n _options?: PersistenceProviderOptions,\n): PersistenceProviderImpl<T> => {\n switch (provider) {\n case 'session':\n return new WebStorageProvider<T>(window.sessionStorage)\n case 'local':\n return new WebStorageProvider<T>(window.localStorage)\n }\n return new WebStorageProvider<T>() // memory\n}\n","import { WebStorageProvider } from '../isomporphic/memory.js'\nimport type { PersistenceProvider, PersistenceProviderImpl, PersistenceProviderOptions } from '../provider.js'\n\n/** returns the default persistence provider for each runtime environment */\nexport const getPersistenceProvider = <T>(\n _provider: PersistenceProvider,\n _options?: PersistenceProviderOptions,\n): PersistenceProviderImpl<T> => {\n return new WebStorageProvider<T>()\n}\n","//export const isBrowser = (): boolean => typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nexport const isServer = (): boolean => typeof window === \"undefined\" || typeof window.document === \"undefined\";\n\n//export const isWebWorker = (): boolean => typeof self === \"object\" && self.constructor?.name === \"DedicatedWorkerGlobalScope\";","import type { PersistenceProvider, PersistenceProviderImpl, PersistenceProviderOptions } from './provider.js'\nimport { getPersistenceProvider as getPersistenceProviderClient } from './client/index.js'\nimport { getPersistenceProvider as getPersistenceProviderServer } from './server/index.js'\nimport { isServer } from './runtime.js'\n\n/** returns the persistence provider (isomorphic) */\nexport const webstorage = <T>(\n provider: PersistenceProvider = 'local',\n options?: PersistenceProviderOptions,\n): PersistenceProviderImpl<T> => {\n if (isServer()) {\n return getPersistenceProviderServer(provider, options)\n } else {\n return getPersistenceProviderClient(provider, options)\n }\n}\n\nexport * from './provider.js'\n","import type { VNode } from '@/render/types.js';\nimport { createStore, type Store } from '@/store/index.js';\n\nexport type TranslationObject = { [key: string]: string|VNode|TranslationObject };\nexport type Translations = { [language: string]: TranslationObject };\nexport type OnLanguageChangeListener = (newLanguage: string) => void;\nexport type Replacements = Record<string, string>;\n\nexport interface I18nStore {\n language: string;\n changeLanguage: (language: string) => void;\n t: (path: string, options?: Record<string, string>) => string;\n load: (language: string, translations: TranslationObject) => void;\n subscribe: (onLanguageChange: OnLanguageChangeListener) => void;\n}\n\n// example of placeholders: {name}, {age}, {city}\nconst VARIABLE_REGEX = /{([^}]*)}/g;\n\nconst interpolate = (template: string, replacements: Replacements): string =>\n template.replace(VARIABLE_REGEX, (_, key) => replacements[key] || `{${key}}`);\n\nexport const createI18n = (): I18nStore => {\n const translationsStore: Store<Translations> = createStore({});\n let language = 'en';\n\n const onLanguageChangeCallbacks: Array<OnLanguageChangeListener> = [];\n\n return {\n language,\n\n changeLanguage(newLanguage: string) {\n language = newLanguage;\n onLanguageChangeCallbacks.forEach(callback => callback(newLanguage));\n },\n\n // example usage of the t function with placeholders:\n // const translatedString = t('greeting', { name: 'John', age: '30' }, 'common');\n // this would replace placeholders {name} and {age} in the translation string with 'John' and '30' respectively.\n t(path: string, replacements: Record<string, string> = {}) {\n\n const template = translationsStore.get<string>(`${language}.${path}`) || path\n\n // VDOM (VNode)\n if (typeof template !== 'string') {\n return template;\n }\n // plaintext string or HTML\n return interpolate(template, replacements);\n },\n\n load(newLanguage: string, namespaceTranslations: TranslationObject) {\n translationsStore.set(newLanguage, {\n ...translationsStore.get<TranslationObject>(newLanguage),\n ...namespaceTranslations,\n });\n },\n\n subscribe(onLanguageChange: OnLanguageChangeListener) {\n onLanguageChangeCallbacks.push(onLanguageChange);\n return () => {\n const index = onLanguageChangeCallbacks.indexOf(onLanguageChange);\n if (index >= 0) onLanguageChangeCallbacks.splice(index, 1);\n };\n }\n };\n};\n\n// export singleton\nexport const i18n = createI18n();\n","import type { Props, VNodeChild } from \"@/render/types.js\";\nimport { type Replacements, i18n } from \"./i18n.js\";\n\nexport interface TransProps extends Props { \n path: string, \n tag?: string,\n replacements?: Replacements,\n class?: string,\n className?: string,\n style?: string,\n} \n\nexport const Trans = ({ path, replacements, tag, ...attrs }: TransProps): VNodeChild => {\n\n const ref = {}\n\n // re-render component on language change\n i18n.subscribe(() => {\n const value = i18n.t(path, replacements);\n console.log('new val', value);\n //$(ref).html(value);\n });\n\n return {\n tag: tag || 'span',\n attributes: {\n ref,\n ...attrs,\n },\n // initially render\n children: i18n.t(path, replacements),\n }\n}\n","\n/**\n * custom headers class to manage HTTP headers with case-insensitive keys.\n * simplifies header manipulation by providing utility methods.\n */\nexport class Headers {\n // internal map to store headers\n private map: Map<string, string>;\n\n /**\n * initializes the Headers instance with provided headers or another Headers object.\n * ensures all header keys are stored in lowercase for consistent access.\n * @param init initial headers as a record or another Headers instance\n */\n constructor(init: Record<string, string> | Headers = {}) {\n this.map = new Map();\n\n if (init instanceof Headers) {\n init.forEach((value, key) => this.map.set(key, value));\n } else {\n Object.entries(init).forEach(([key, value]) =>\n this.map.set(key.toLowerCase(), value)\n );\n }\n }\n\n /**\n * appends or sets the value for a specific header key.\n * stores the key in lowercase to maintain case-insensitivity.\n * @param key header name\n * @param value header value\n */\n append(key: string, value: string): void {\n this.map.set(key.toLowerCase(), value);\n }\n\n /**\n * retrieves the value of a specific header key.\n * @param key header name\n * @returns the header value or null if not found\n */\n get(key: string): string | null {\n return this.map.get(key.toLowerCase()) || null;\n }\n\n /**\n * checks if a specific header key exists.\n * @param key header name\n * @returns boolean indicating existence of the header\n */\n has(key: string): boolean {\n return this.map.has(key.toLowerCase());\n }\n\n /**\n * iterates over all headers and executes the provided callback for each.\n * @param callback function to execute for each header\n */\n forEach(callback: (value: string, key: string) => void): void {\n this.map.forEach((value, key) => callback(value, key));\n }\n}\n\n/**\n * ProgressSignal extends EventTarget to dispatch and track progress events.\n * useful for monitoring the progress of network requests.\n */\nexport class ProgressSignal extends EventTarget {\n // internal progress state\n private _progress: { loaded: number; total: number };\n\n /**\n * initializes the ProgressSignal with zero progress.\n */\n constructor() {\n super();\n this._progress = { loaded: 0, total: 0 };\n }\n\n /**\n * retrieves the current progress.\n * @returns an object containing loaded and total bytes\n */\n get progress(): { loaded: number; total: number } {\n return this._progress;\n }\n\n /**\n * dispatches a progress event with updated loaded and total bytes.\n * updates the internal progress state.\n * @param event the ProgressEvent containing progress information\n */\n dispatchProgress(event: ProgressEvent): void {\n this._progress = { loaded: event.loaded, total: event.total };\n this.dispatchEvent(\n new ProgressEvent('progress', { loaded: event.loaded, total: event.total })\n );\n }\n}\n\n/**\n * ProgressController manages a ProgressSignal for tracking request progress.\n * provides a centralized way to handle progress events.\n */\nexport class ProgressController {\n signal: ProgressSignal;\n\n /**\n * initializes the ProgressController with a new ProgressSignal.\n */\n constructor() {\n this.signal = new ProgressSignal();\n }\n}\n\n/**\n * serializes the request body into a format suitable for XMLHttpRequest.\n * handles various body types including JSON objects and FormData.\n * @param body the body to serialize\n * @returns the serialized body or null if no body is provided\n */\nexport function serializeBody(\n body: BodyInit | Record<string, unknown> | null | undefined\n): XMLHttpRequestBodyInit | Document | null {\n if (!body) return null;\n\n if (\n body instanceof FormData ||\n body instanceof Blob ||\n body instanceof URLSearchParams ||\n body instanceof ArrayBuffer ||\n ArrayBuffer.isView(body) ||\n typeof body === \"string\"\n ) {\n return body;\n }\n\n if (typeof body === \"object\") {\n return JSON.stringify(body); // convert object to JSON string for transmission\n }\n\n return String(body); // ensure fallback to string for unsupported types\n}\n\n/**\n * parses a raw header string from an XMLHttpRequest into a Headers instance.\n * @param headerStr the raw header string\n * @returns a Headers instance containing parsed headers\n */\nexport function parseHeaders(headerStr: string): Headers {\n const headers = new Headers();\n headerStr.split('\\r\\n').forEach((line) => {\n const [key, ...rest] = line.split(': ');\n if (key) headers.append(key, rest.join(': '));\n });\n return headers;\n}\n\n/**\n * extends the standard RequestInit to include an optional ProgressSignal.\n * allows tracking the progress of the network request.\n */\nexport interface FetchWithControllersInit extends RequestInit {\n progressSignal?: ProgressSignal;\n}\n\n/**\n * represents the response from a fetch operation, mirroring the native Response interface.\n * includes methods to access the response body in various formats.\n */\nexport interface FetchResponse {\n ok: boolean;\n status: number;\n statusText: string;\n headers: Headers;\n url: string;\n text: () => Promise<string>;\n json: () => Promise<unknown>;\n blob: () => Promise<Blob>;\n}\n\n/**\n * performs a network fetch request with support for progress tracking using XMLHttpRequest.\n * falls back to the native fetch implementation if no ProgressSignal is provided.\n * @param input the resource to fetch, typically a URL string\n * @param init optional configuration for the request, including method, headers, body, credentials, and progressSignal\n * @returns a promise resolving to a FetchResponse containing the response details\n */\nexport async function fetch(\n input: string | URL,\n init: FetchWithControllersInit = {}\n): Promise<FetchResponse> {\n // use native fetch if ProgressSignal is not provided for simplicity and efficiency\n if (!init.progressSignal && typeof globalThis.fetch === \"function\") {\n return fetch(input, init) as unknown as FetchResponse;\n }\n\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n const method = (init.method || 'GET').toUpperCase();\n const body = serializeBody(init.body || null);\n const progressSignal = init.progressSignal;\n const abortSignal = init.signal;\n\n // handle abort events to allow request cancellation\n if (abortSignal) {\n const abortHandler = () => {\n xhr.abort();\n reject(new DOMException('The operation was aborted.', 'AbortError'));\n };\n abortSignal.addEventListener('abort', abortHandler, { once: true });\n }\n\n xhr.open(method, input.toString(), true);\n\n // set credentials based on the init configuration\n if (init.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (init.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n // set request headers using the custom Headers class or raw headers\n if (init.headers instanceof Headers) {\n init.headers.forEach((value, key) => xhr.setRequestHeader(key, value));\n } else if (init.headers) {\n Object.entries(init.headers).forEach(([key, value]) => {\n xhr.setRequestHeader(key, value as string);\n });\n }\n\n // attach progress listeners if a ProgressSignal is provided\n if (progressSignal) {\n if (xhr.upload) {\n xhr.upload.onprogress = (event) => progressSignal.dispatchProgress(event);\n }\n xhr.onprogress = (event) => progressSignal.dispatchProgress(event);\n }\n\n // handle the response once the request is completed\n xhr.onload = () => {\n const response: FetchResponse = {\n ok: xhr.status >= 200 && xhr.status < 300,\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders()),\n url: xhr.responseURL,\n text: () => Promise.resolve(xhr.responseText),\n json: () => Promise.resolve(JSON.parse(xhr.responseText)),\n blob: () => Promise.resolve(new Blob([xhr.response])),\n };\n resolve(response);\n };\n\n // handle network errors\n xhr.onerror = () => reject(new TypeError('Network request failed'));\n xhr.ontimeout = () => reject(new TypeError('Network request timed out'));\n xhr.onabort = () => reject(new DOMException('The operation was aborted.', 'AbortError'));\n\n // send the serialized request body\n xhr.send(body);\n });\n}\n\n\n/*\n // example usage of fetch with upload tracking\n async function exampleFetchWithUploadTracking() {\n const url = 'https://example.com/upload';\n const data = new FormData();\n data.append('file', new Blob(['file content'], { type: 'text/plain' }), 'example.txt');\n\n const { signal: progressSignal } = new ProgressController();\n\n progressSignal.addEventListener('progress', (event: ProgressEvent) => {\n console.log(`Uploaded ${event.loaded} of ${event.total} bytes`);\n });\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n body: data,\n headers: {\n 'Accept': 'application/json'\n },\n credentials: 'include',\n progressSignal\n });\n\n if (response.ok) {\n const jsonResponse = await response.json();\n console.log('Upload successful:', jsonResponse);\n } else {\n console.error('Upload failed:', response.statusText);\n }\n } catch (error) {\n console.error('Error during fetch:', error);\n }\n }\n \n */","export type OnHandleRouteChangeFn = (newRoute: string, oldRoute: string) => void;\nexport type OnRouteChangeFn = (cb: OnHandleRouteChangeFn) => void;\nexport type RouterStrategy = 'page-refresh' | 'slot-refresh';\n\nexport interface Router {\n listeners: Array<OnHandleRouteChangeFn>;\n strategy: RouterStrategy;\n add(registration: RouteRegistration): Router;\n match(path?: string): RouteRequest | false;\n getRoutes(): Array<RouteRegistration>;\n tokenizePath(path: string): TokenizedPath;\n navigate(path: string): void;\n onRouteChange: OnRouteChangeFn;\n}\n\nexport interface RouterConfig {\n strategy?: RouterStrategy;\n}\n\ninterface RouteMatchGroups {\n [matchName: string]: number;\n}\n\nexport interface RouteParams {\n [name: string]: string;\n}\n\nexport interface RouteRegistration {\n path: string;\n exact?: boolean;\n tokenizedPath?: TokenizedPath;\n handler?: RouteHandler;\n}\n\nexport interface RouteRequest {\n url: string;\n params: RouteParams;\n}\n\nexport interface TokenizedPath {\n regexp: RegExp;\n groups: RouteMatchGroups;\n}\n\nexport type RouteHandler = (request: RouteRequest) => void;\n\nexport const tokenizePath = (path: string): TokenizedPath => {\n const paramNameRegexp = /:([^\\/\\.\\\\]+)/g;\n const groups: RouteMatchGroups = {};\n let groupIndex = 1;\n\n // Replace parameters with capturing groups and store the parameter names.\n const pattern = path.replace(paramNameRegexp, (_, paramName) => {\n groups[paramName] = groupIndex++;\n return '([^/\\.\\\\]+)';\n });\n\n return {\n groups,\n regexp: new RegExp(`^${pattern}$`),\n };\n};\n\nexport const matchRouteRegistrations = (\n routeRegistrations: Array<RouteRegistration>,\n actualPathName: string,\n haystackPathName?: string\n): RouteRequest | false => {\n for (const route of routeRegistrations) {\n // Check if path is set and route.path matches it\n if (haystackPathName && route.path !== haystackPathName) {\n //console.warn(`Skipped path: Looking for ${haystackPathName}, but found ${route.path}`);\n continue;\n }\n\n // Check if exact match is required and if the match is exact\n if (route.exact && route.path !== actualPathName) {\n //console.warn(`Exact match required, but found ${actualPathName} instead of ${route.path}`);\n continue;\n }\n\n const match = route.tokenizedPath!.regexp.exec(actualPathName);\n if (!match) continue;\n\n //console.log(`Route matched: ${route.path} for URL: ${actualPathName}`);\n\n const params: RouteParams = {};\n\n // Extract each parameter using the stored capturing group index.\n for (const [paramName, groupIndex] of Object.entries(route.tokenizedPath!.groups)) {\n params[paramName] = match[groupIndex];\n }\n\n const request: RouteRequest = { url: actualPathName, params };\n\n if (typeof route.handler === 'function') {\n route.handler(request);\n }\n return request;\n }\n return false;\n};\n\nexport const setupRouter = (config: RouterConfig = {\n strategy: 'page-refresh', // default\n}, windowImpl?: Window): Router => {\n const routeRegistrations: Array<RouteRegistration> = [];\n\n // safe SSR rendering, and fine default for client side\n if (typeof window !== 'undefined' && !windowImpl) {\n windowImpl = globalThis.__defuss_window /** for SSR support */ || window;\n }\n\n if (!windowImpl) {\n console.warn('Router requires a Window API implementation!');\n }\n\n const api = {\n ...config,\n listeners: [] as Array<OnHandleRouteChangeFn>,\n onRouteChange: (cb: OnHandleRouteChangeFn) => {\n api.listeners.push(cb);\n },\n tokenizePath,\n add(registration: RouteRegistration): Router {\n const isAlreadyRegistered = routeRegistrations.some(\n (registeredRoute) => registeredRoute.path === registration.path\n );\n\n if (!isAlreadyRegistered) {\n routeRegistrations.push({\n ...registration,\n tokenizedPath: tokenizePath(registration.path)\n });\n }\n return api as Router;\n },\n match(path?: string) {\n return matchRouteRegistrations(routeRegistrations, windowImpl!.document.location.pathname, path);\n },\n navigate(newPath: string) {\n const strategy = api.strategy || 'page-refresh';\n const oldPath = windowImpl ? windowImpl.document.location.pathname : '';\n\n if (strategy === 'page-refresh') {\n document.location.href = newPath;\n } else if (strategy === 'slot-refresh') {\n // show new path in the address bar\n if (typeof windowImpl !== 'undefined') {\n windowImpl!.history.pushState({}, '', newPath);\n }\n\n for (const listener of api.listeners) {\n listener(newPath, oldPath);\n }\n }\n },\n getRoutes() {\n return routeRegistrations;\n },\n };\n return api as Router;\n};\n\nexport const Router = setupRouter();\n","import type { Props, VNodeChild } from \"@/render/types.js\";\nimport { Router } from \"./router.js\";\n\nexport interface RouteProps extends Props { \n path: string\n router?: Router,\n exact?: boolean\n} \n\nexport const Route = ({ path, exact, children, router = Router }: RouteProps): VNodeChild => {\n // make sure the router knows the path to be matched\n router.add({\n path,\n exact: exact || false,\n });\n return router.match(path) ? children![0] : null;\n} ","import type { VNodeChild } from \"@/render/types.js\";\nimport type { RouteProps } from \"./Route.js\";\nimport { Route } from \"./Route.js\";\nimport { Router } from \"./router.js\";\n\nexport interface RedirectProps extends RouteProps { \n to: string\n}\n\nexport const Redirect = ({ path, to, router = Router, exact }: RedirectProps): VNodeChild => {\n requestAnimationFrame(() => {\n if (Route({ path, router, exact, children: [true] })) {\n //console.log(\"Redirect\", to);\n router.navigate(to); \n }\n });\n return null;\n} ","import type { Props, VNodeChild } from \"@/render/types.js\";\nimport { createRef, type Ref } from \"@/render/client.js\";\nimport { Router } from \"./router.js\";\nimport { $, type NodeType } from '@/dequery/index.js';\n\nexport const RouterSlotId = \"router-slot\";\n\nexport interface RouterSlotProps extends Props {\n\n /** to override the tag name used for the router slot */\n tag?: string;\n\n /** to identify/select the root DOM element or style it, W3C naming */\n class?: string;\n\n /** to identify/select the root DOM element or style it, React naming */\n className?: string;\n\n /** to override the default global router */\n router?: Router;\n\n /** A component reference that returns many <Route />, <Redirect ... /> etc. components */\n RouterOutlet?: any\n}\n\n/**\n * RouterSlot registers a slot refresh handler with the global router configuration\n * and renders its default children (RouterOutlet). Whenever the route changes, it re-renders dynamically.\n * This decouples the slot refresh logic from route registration.\n */\nexport const RouterSlot = ({ router = Router, children, RouterOutlet, ...attributes }: RouterSlotProps): VNodeChild => {\n \n const { tag, ...attributesWithoutTag } = attributes;\n const ref: Ref<NodeType> = createRef();\n\n // by using this component, we automatically switch to slot-refresh strategy\n router.strategy = 'slot-refresh';\n\n router.onRouteChange(() => {\n //console.log(\"<RouterSlot> RouterSlot.onRouteChange\", newPath, oldPath, ref.current);\n $(ref).update(RouterOutlet());\n });\n\n if (document.getElementById(RouterSlotId)) {\n console.warn(`It seems there's more than one <RouterSlot /> components defined as an element with id #${RouterSlotId} already exists in the DOM.`);\n }\n\n return {\n children: RouterOutlet() || [],\n type: attributes.tag || \"div\", \n attributes: {\n ...attributesWithoutTag,\n id: RouterSlotId,\n ref,\n },\n };\n};\n","import type { RenderInput, VNodeChildren, VNode, Ref, Props } from '@/render/types.js'\nimport { createRef, isRef } from \"@/render/index.js\";\nimport { $ } from \"@/dequery/index.js\";\nimport { inDevMode } from \"@/common/index.js\";\n\nexport type AsyncState = 'loading' | 'loaded' | 'error'\n\nexport interface AsyncStateRef extends Ref<HTMLElement> { \n /** The state of the async content */\n state?: AsyncState;\n\n /** Error details are available here in case the state changes to \"error\" */\n error?: unknown;\n}\n\nexport interface AsyncProps extends Props {\n\n /** to uniquely identify the root DOM element without using a ref */\n id?: string;\n\n /** to identify/select the root DOM element or style it, W3C naming */\n class?: string;\n\n /** to identify/select the root DOM element or style it, React naming */\n className?: string;\n\n /** The fallback content to display while the async content is loading */\n fallback?: VNode;\n\n /** Store this with createRef() to update() the Suspense state */\n ref?: AsyncStateRef;\n\n /** The async content to display when loaded */\n render?: () => Promise<RenderInput>;\n\n /** to override the name of the .suspense-loading transition CSS class name */\n loadingClassName?: string;\n\n /** to override the name of the .suspense-loaded transition CSS class name */\n loadedClassName?: string;\n\n /** to override the name of the .suspense-error transition CSS class name */\n errorClassName?: string;\n}\n\nexport const Async = ({ \n fallback, ref, children, class: _class, className, id, loadingClassName, loadedClassName, errorClassName, onError\n}: AsyncProps) => {\n\n let childrenToRender: VNodeChildren | undefined = children;\n\n const containerRef: AsyncStateRef = createRef<AsyncState>(function onSuspenseUpdate(state: AsyncState) {\n\n try {\n\n if (!containerRef.current) {\n if (inDevMode) {\n console.warn(\"Suspense container is not mounted yet, but a state update demands a render. State is:\", state);\n }\n return;\n }\n\n // to allow for beautiful CSS state transitions\n $(containerRef.current).removeClass(loadingClassName || \"suspense-loading\");\n $(containerRef.current).removeClass(loadedClassName || \"suspense-loaded\");\n $(containerRef.current).removeClass(errorClassName || \"suspense-error\");\n\n if (!children || state === 'error') {\n $(containerRef.current).addClass(errorClassName || \"suspense-error\");\n $(containerRef).jsx({\n type: 'div',\n children: [\"Loading error!\"]\n });\n } else if (state === 'loading') {\n $(containerRef.current).addClass(loadingClassName || \"suspense-loading\");\n $(containerRef).jsx(fallback);\n } else if (state === 'loaded') {\n $(containerRef.current).addClass(loadedClassName || \"suspense-loaded\");\n\n console.log(\"[Async render] start\")\n $(containerRef).jsx(childrenToRender as RenderInput);\n console.log(\"[Async render] finished\")\n }\n } catch (error) {\n containerRef.update(\"error\");\n containerRef.error = error;\n\n if (typeof onError === 'function') {\n // pass the error up to the parent component\n onError(error);\n }\n }\n }, \"loading\");\n\n if (isRef(ref)) {\n\n // for the initial state synchronization between outer and inner scope\n // we don't want to trigger the suspense state to render,\n // as the DOM element is not yet mounted (rendered in DOM)\n let isInitial = true;\n\n // when the suspense state is updated in outer scope\n // we bridge the update to the internal containerRef\n ref.update = (state: AsyncState) => {\n if (!isInitial) {\n containerRef.update(state);\n }\n }\n // let's tell the outer scope the initial state\n ref.update(\"loading\");\n\n isInitial = false; // render any outer scope updates from now on\n }\n\n // resolve async children\n const promisedChildren = (children || []).map((vnode) => {\n\n try {\n if (!vnode || (vnode && !(vnode as VNode).type)) {\n return Promise.resolve(''); // becomes a Text node\n }\n\n // <Async><SomeAsyncComponent /></Async>\n if ((vnode as VNode).type.constructor.name === 'AsyncFunction') {\n // construct the props object\n const props = { ...(vnode as VNode).attributes, children: (vnode as VNode).children };\n // yield the Promise objects\n return (vnode as VNode).type(props);\n }\n\n // all the other synchronous cases\n return Promise.resolve(vnode);\n } catch (error) {\n containerRef.update(\"error\");\n containerRef.error = error;\n\n if (typeof onError === 'function') {\n // pass the error up to the parent component\n onError(error);\n }\n }\n })\n\n const onMount = () => {\n\n if (promisedChildren.length) {\n\n containerRef.update(\"loading\");\n\n Promise.all(promisedChildren)\n .then((awaitedVnodes) => {\n childrenToRender = awaitedVnodes.flatMap((vnode: VNode) =>\n vnode?.type === 'Fragment' ? vnode.children : vnode\n );\n containerRef.update(\"loaded\");\n })\n .catch((error) => {\n containerRef.update(\"error\");\n containerRef.error = error;\n\n if (inDevMode) {\n console.error(\"SuspenseLoadingError\", error);\n }\n $(containerRef).jsx(`SuspenseLoadingError: ${error}`);\n\n if (typeof onError === 'function') {\n onError(error);\n }\n });\n }\n }\n\n return {\n type: 'div',\n attributes: { id, class: _class, className, ref: containerRef, onMount },\n children: fallback ? [fallback] : []\n }\n}\n\n// React-mimicing alias\nexport const Suspense = Async;"],"names":["getPersistenceProvider","getPersistenceProviderServer","getPersistenceProviderClient"],"mappings":";;;AACY,MAAC,SAAS,GAAG;;ACAlB,MAAM,gCAAgC,GAAG,MAAM;AACtD,EAAE,MAAM,KAAK,mBAAmB,IAAI,GAAG,EAAE;AACzC,EAAE,OAAO;AACT,IAAI,KAAK,EAAE,MAAM;AACjB,MAAM,KAAK,CAAC,KAAK,EAAE;AACnB,KAAK;AACL,IAAI,OAAO,EAAE,CAAC,GAAG,KAAK;AACtB,MAAM,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI;AAC3C,KAAK;AACL,IAAI,UAAU,EAAE,CAAC,GAAG,KAAK;AACzB,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,KAAK;AACL,IAAI,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK;AAC7B,MAAM,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;AACnC;AACA,GAAG;AACH,CAAC;AACM,MAAM,MAAM,GAAG,gCAAgC,EAAE;AACjD,MAAM,kBAAkB,CAAC;AAChC,EAAE,OAAO;AACT,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,IAAI,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O,EAAE;AAC5E,IAAI,QAAQ,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG;AACtC,GAAG;AACH;AACY,MAAC,QAAQ,GAAG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","sources":["../../src/render/client.ts"],"sourcesContent":["import { observeUnmount, renderIsomorphicSync, renderIsomorphicAsync, type ParentElementInput, type ParentElementInputAsync, globalScopeDomApis } from '@/render/isomorph.js'\nimport type { RenderInput, RenderResult, VNode } from '@/render/types.js'\n\nexport const renderSync = <T extends RenderInput>(\n virtualNode: T,\n parentDomElement: ParentElementInput = document.documentElement,\n): RenderResult<T> => {\n globalScopeDomApis(window, document)\n return renderIsomorphicSync(virtualNode, parentDomElement, window) as any\n}\n\nexport const render = async<T extends RenderInput>(\n virtualNode: T | Promise<T>,\n parentDomElement: ParentElementInputAsync = document.documentElement,\n): Promise<RenderResult<T>> => {\n globalScopeDomApis(window, document)\n return renderIsomorphicAsync(virtualNode, parentDomElement, window) as any\n}\n\nexport const renderToString = (el: Node) => new XMLSerializer().serializeToString(el)\n\nexport const hydrate = (\n nodes: Array<VNode | string | null>,\n parentElements: Array<HTMLElement | Text | Node>,\n debug?: boolean\n) => {\n let elementIndex = 0\n\n for (const node of nodes) {\n if (typeof node === 'string' || node === null) {\n // for text nodes or null, skip DOM elements that are not elements\n while (\n elementIndex < parentElements.length &&\n parentElements[elementIndex].nodeType !== Node.ELEMENT_NODE &&\n parentElements[elementIndex].nodeType !== Node.TEXT_NODE\n ) {\n elementIndex++\n }\n // optionally, you can add validation here to match text content if necessary\n elementIndex++\n continue\n }\n\n // find the next relevant DOM element\n while (\n elementIndex < parentElements.length &&\n parentElements[elementIndex].nodeType !== Node.ELEMENT_NODE\n ) {\n elementIndex++\n }\n\n if ((elementIndex >= parentElements.length) && debug) {\n console.warn(\n '[defuss] Hydration warning: Not enough DOM elements to match VNodes.'\n );\n break;\n }\n\n const vnode = node as VNode\n const element = parentElements[elementIndex] as HTMLElement\n\n // update ref.current if ref is provided\n if (vnode.attributes!.ref) {\n vnode.attributes!.ref.current = element\n }\n\n // attach event listeners\n for (const key of Object.keys(vnode.attributes!)) {\n if (key === 'ref') continue; // don't override ref.current with [object Object] again\n\n // TODO: refactor: this maybe can be unified with isomorph render logic\n if (key.startsWith('on') && typeof vnode.attributes![key] === 'function') {\n let eventName = key.substring(2).toLowerCase();\n let capture = false;\n\n // check for specific suffixes to set event options\n if (eventName.endsWith('capture')) {\n capture = true;\n eventName = eventName.replace(/capture$/, '');\n }\n\n element.addEventListener(\n eventName,\n vnode.attributes![key],\n capture\n );\n }\n }\n\n // --- element lifecycle ---\n\n // TODO: this should be refactored to re-use logic in lifecycle.js!\n\n // call onMount if provided\n if (vnode?.attributes?.onMount) {\n vnode.attributes.onMount(element);\n }\n\n if (vnode?.attributes?.onUnmount) {\n observeUnmount(element, vnode.attributes.onUnmount);\n }\n\n // recursively hydrate children\n if (vnode?.children && vnode?.children?.length > 0) {\n hydrate(\n vnode.children as Array<VNode | string | null>,\n Array.from(element.childNodes)\n );\n }\n elementIndex++;\n }\n\n // Optionally, warn if there are unmatched DOM elements\n if ((elementIndex < parentElements.length) && debug) {\n console.warn(\n '[defuss] Hydration warning: There are more DOM elements than VNodes.'\n );\n }\n};\n\nexport * from './index.js'\n"],"names":["globalScopeDomApis","renderIsomorphicSync","renderIsomorphicAsync","observeUnmount"],"mappings":";;;;AAEY,MAAC,UAAU,GAAG,CAAC,WAAW,EAAE,gBAAgB,GAAG,QAAQ,CAAC,eAAe,KAAK;AACxF,EAAEA,wBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtC,EAAE,OAAOC,0BAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,MAAM,CAAC;AACpE;AACY,MAAC,MAAM,GAAG,OAAO,WAAW,EAAE,gBAAgB,GAAG,QAAQ,CAAC,eAAe,KAAK;AAC1F,EAAED,wBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC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;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","sources":["../../src/render/client.ts"],"sourcesContent":["import { observeUnmount, renderIsomorphicSync, renderIsomorphicAsync, type ParentElementInput, type ParentElementInputAsync, globalScopeDomApis } from '@/render/isomorph.js'\nimport type { RenderInput, RenderResult, VNode } from '@/render/types.js'\n\nexport const renderSync = <T extends RenderInput>(\n virtualNode: T,\n parentDomElement: ParentElementInput = document.documentElement,\n): RenderResult<T> => {\n globalScopeDomApis(window, document)\n return renderIsomorphicSync(virtualNode, parentDomElement, window) as any\n}\n\nexport const render = async<T extends RenderInput>(\n virtualNode: T | Promise<T>,\n parentDomElement: ParentElementInputAsync = document.documentElement,\n): Promise<RenderResult<T>> => {\n globalScopeDomApis(window, document)\n return renderIsomorphicAsync(virtualNode, parentDomElement, window) as any\n}\n\nexport const renderToString = (el: Node) => new XMLSerializer().serializeToString(el)\n\nexport const hydrate = (\n nodes: Array<VNode | string | null>,\n parentElements: Array<HTMLElement | Text | Node>,\n debug?: boolean\n) => {\n let elementIndex = 0\n\n for (const node of nodes) {\n if (typeof node === 'string' || node === null) {\n // for text nodes or null, skip DOM elements that are not elements\n while (\n elementIndex < parentElements.length &&\n parentElements[elementIndex].nodeType !== Node.ELEMENT_NODE &&\n parentElements[elementIndex].nodeType !== Node.TEXT_NODE\n ) {\n elementIndex++\n }\n // optionally, you can add validation here to match text content if necessary\n elementIndex++\n continue\n }\n\n // find the next relevant DOM element\n while (\n elementIndex < parentElements.length &&\n parentElements[elementIndex].nodeType !== Node.ELEMENT_NODE\n ) {\n elementIndex++\n }\n\n if ((elementIndex >= parentElements.length) && debug) {\n console.warn(\n '[defuss] Hydration warning: Not enough DOM elements to match VNodes.'\n );\n break;\n }\n\n const vnode = node as VNode\n const element = parentElements[elementIndex] as HTMLElement\n\n // update ref.current if ref is provided\n if (vnode.attributes!.ref) {\n vnode.attributes!.ref.current = element\n }\n\n // attach event listeners\n for (const key of Object.keys(vnode.attributes!)) {\n if (key === 'ref') continue; // don't override ref.current with [object Object] again\n\n // TODO: refactor: this maybe can be unified with isomorph render logic\n if (key.startsWith('on') && typeof vnode.attributes![key] === 'function') {\n let eventName = key.substring(2).toLowerCase();\n let capture = false;\n\n // check for specific suffixes to set event options\n if (eventName.endsWith('capture')) {\n capture = true;\n eventName = eventName.replace(/capture$/, '');\n }\n\n element.addEventListener(\n eventName,\n vnode.attributes![key],\n capture\n );\n }\n }\n\n // --- element lifecycle ---\n\n // TODO: this should be refactored to re-use logic in lifecycle.js!\n\n // call onMount if provided\n if (vnode?.attributes?.onMount) {\n vnode.attributes.onMount(element);\n }\n\n if (vnode?.attributes?.onUnmount) {\n observeUnmount(element, vnode.attributes.onUnmount);\n }\n\n // recursively hydrate children\n if (vnode?.children && vnode?.children?.length > 0) {\n hydrate(\n vnode.children as Array<VNode | string | null>,\n Array.from(element.childNodes)\n );\n }\n elementIndex++;\n }\n\n // Optionally, warn if there are unmatched DOM elements\n if ((elementIndex < parentElements.length) && debug) {\n console.warn(\n '[defuss] Hydration warning: There are more DOM elements than VNodes.'\n );\n }\n};\n\nexport * from './index.js'\n"],"names":[],"mappings":";;;AAEY,MAAC,UAAU,GAAG,CAAC,WAAW,EAAE,gBAAgB,GAAG,QAAQ,CAAC,eAAe,KAAK;AACxF,EAAE,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtC,EAAE,OAAO,oBAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,MAAM,CAAC;AACpE;AACY,MAAC,MAAM,GAAG,OAAO,WAAW,EAAE,gBAAgB,GAAG,QAAQ,CAAC,eAAe,KAAK;AAC1F,EAAE,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtC,EAAE,OAAO,qBAAqB,CAAC,WAAW,EAAE,gBAAgB,EAAE,MAAM,CAAC;AACrE;AACY,MAAC,cAAc,GAAG,CAAC,EAAE,KAAK,IAAI,aAAa,EAAE,CAAC,iBAAiB,C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file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","sources":["../../src/render/server.ts"],"sourcesContent":["import * as HappyDom from 'happy-dom'\nimport { renderIsomorphicSync, renderIsomorphicAsync, globalScopeDomApis, type ParentElementInput, type ParentElementInputAsync } from '@/render/isomorph.js'\nimport type { RenderInput, RenderResult, Globals } from '@/render/types.js'\nimport serializeHtml from 'w3c-xmlserializer'\n\nexport interface RenderOptions {\n /** choose an arbitrary server-side DOM / Document implementation; this library defaults to 'linkedom'; default: undefined */\n browserGlobals?: Globals\n\n /** creates a synthetic <html> root element in case you want to render in isolation; default: false; also happens when parentDomElement isn't present */\n createRoot?: boolean\n}\n\nconst setupDomApis = (options: RenderOptions = {}) => {\n const browserGlobals = options.browserGlobals ? options.browserGlobals : getBrowserGlobals()\n const document = getDocument(options.createRoot, browserGlobals)\n globalScopeDomApis(browserGlobals, document)\n return { browserGlobals, document }\n}\n\nexport const renderSync = <T extends RenderInput>(\n virtualNode: T,\n parentDomElement?: ParentElementInput,\n options: RenderOptions = {},\n): RenderResult<T> => {\n const { browserGlobals, document } = setupDomApis(options)\n if (!parentDomElement) {\n parentDomElement = document.documentElement\n }\n return renderIsomorphicSync(virtualNode, parentDomElement, browserGlobals) as any\n}\n\nexport const render = <T extends RenderInput>(\n virtualNode: T,\n parentDomElement?: ParentElementInputAsync,\n options: RenderOptions = {},\n): Promise<RenderResult<T>> => {\n const { browserGlobals, document } = setupDomApis(options)\n if (!parentDomElement) {\n parentDomElement = document.documentElement\n }\n return renderIsomorphicAsync(virtualNode, parentDomElement, browserGlobals) as any\n}\n\nexport const createRoot = (document: Document): Element => {\n const htmlElement = document.createElement('html')\n document.appendChild(htmlElement)\n return document.documentElement\n}\n\nexport const getBrowserGlobals = (): Globals => {\n return new HappyDom.Window({ url: \"http://localhost/\" }) as unknown as (Window & typeof globalThis)\n}\n\nexport const getDocument = (shouldCreateRoot = false, browserGlobals?: Globals): Document => {\n const document = (browserGlobals || getBrowserGlobals()).document\n if (shouldCreateRoot) {\n createRoot(document)\n return document\n }\n return document\n}\n\nexport const renderToString = (el: Node) => serializeHtml(el).replaceAll(' xmlns=\"http://www.w3.org/1999/xhtml\"', '')\n\nexport * from './index.js'"],"names":["globalScopeDomApis","renderIsomorphicSync","renderIsomorphicAsync","HappyDom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,YAAY,GAAG,CAAC,OAAO,GAAG,EAAE,KAAK;AACvC,EAAE,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,iBAAiB,EAAE;AAC9F,EAAE,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC;AAClE,EAAEA,wBAAkB,CAAC,cAAc,EAAE,QAAQ,CAAC;AAC9C,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE;AACrC,CAAC;AACW,MAAC,UAAU,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,GAAG,EAAE,KAAK;AAC3E,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC;AAC5D,EAAE,IAAI,CAAC,gBAAgB,EAAE;AACzB,IAAI,gBAAgB,GAAG,QAAQ,CAAC,eAAe;AAC/C;AACA,EAAE,OAAOC,0BAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,cAAc,CAAC;AAC5E;AACY,MAAC,MAAM,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,GAAG,EAAE,KAAK;AACvE,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC;AAC5D,EAAE,IAAI,CAAC,gBAAgB,EAAE;AACzB,IAAI,gBAAgB,GAAG,QAAQ,CAAC,eAAe;AAC/C;AACA,EAAE,OAAOC,2BAAqB,CAAC,WAAW,EAAE,gBAAgB,EAAE,cAAc,CAAC;AAC7E;AACY,MAAC,UAAU,GAAG,CAAC,QAAQ,KAAK;AACxC,EAAE,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;AACpD,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC;AACnC,EAAE,OAAO,QAAQ,CAAC,eAAe;AACjC;AACY,MAAC,iBAAiB,GAAG,MAAM;AACvC,EAAE,OAAO,IAAIC,mBAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC;AAC1D;AACY,MAAC,WAAW,GAAG,CAAC,gBAAgB,GAAG,KAAK,EAAE,cAAc,KAAK;AACzE,EAAE,MAAM,QAAQ,GAAG,CAAC,cAAc,IAAI,iBAAiB,EAAE,EAAE,QAAQ;AACnE,EAAE,IAAI,gBAAgB,EAAE;AACxB,IAAI,UAAU,CAAC,QAAQ,CAAC;AACxB,IAAI,OAAO,QAAQ;AACnB;AACA,EAAE,OAAO,QAAQ;AACjB;AACY,MAAC,cAAc,GAAG,CAAC,EAAE,KAAK,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,uCAAuC,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","sources":["../../src/render/server.ts"],"sourcesContent":["import * as HappyDom from 'happy-dom'\nimport { renderIsomorphicSync, renderIsomorphicAsync, globalScopeDomApis, type ParentElementInput, type ParentElementInputAsync } from '@/render/isomorph.js'\nimport type { RenderInput, RenderResult, Globals } from '@/render/types.js'\nimport serializeHtml from 'w3c-xmlserializer'\n\nexport interface RenderOptions {\n /** choose an arbitrary server-side DOM / Document implementation; this library defaults to 'linkedom'; default: undefined */\n browserGlobals?: Globals\n\n /** creates a synthetic <html> root element in case you want to render in isolation; default: false; also happens when parentDomElement isn't present */\n createRoot?: boolean\n}\n\nconst setupDomApis = (options: RenderOptions = {}) => {\n const browserGlobals = options.browserGlobals ? options.browserGlobals : getBrowserGlobals()\n const document = getDocument(options.createRoot, browserGlobals)\n globalScopeDomApis(browserGlobals, document)\n return { browserGlobals, document }\n}\n\nexport const renderSync = <T extends RenderInput>(\n virtualNode: T,\n parentDomElement?: ParentElementInput,\n options: RenderOptions = {},\n): RenderResult<T> => {\n const { browserGlobals, document } = setupDomApis(options)\n if (!parentDomElement) {\n parentDomElement = document.documentElement\n }\n return renderIsomorphicSync(virtualNode, parentDomElement, browserGlobals) as any\n}\n\nexport const render = <T extends RenderInput>(\n virtualNode: T,\n parentDomElement?: ParentElementInputAsync,\n options: RenderOptions = {},\n): Promise<RenderResult<T>> => {\n const { browserGlobals, document } = setupDomApis(options)\n if (!parentDomElement) {\n parentDomElement = document.documentElement\n }\n return renderIsomorphicAsync(virtualNode, parentDomElement, browserGlobals) as any\n}\n\nexport const createRoot = (document: Document): Element => {\n const htmlElement = document.createElement('html')\n document.appendChild(htmlElement)\n return document.documentElement\n}\n\nexport const getBrowserGlobals = (): Globals => {\n return new HappyDom.Window({ url: \"http://localhost/\" }) as unknown as (Window & typeof globalThis)\n}\n\nexport const getDocument = (shouldCreateRoot = false, browserGlobals?: Globals): Document => {\n const document = (browserGlobals || getBrowserGlobals()).document\n if (shouldCreateRoot) {\n createRoot(document)\n return document\n }\n return document\n}\n\nexport const renderToString = (el: Node) => serializeHtml(el).replaceAll(' xmlns=\"http://www.w3.org/1999/xhtml\"', '')\n\nexport * from './index.js'"],"names":[],"mappings":";;;;;AAIA,MAAM,YAAY,GAAG,CAAC,OAAO,GAAG,EAAE,KAAK;AACvC,EAAE,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,iBAAiB,EAAE;AAC9F,EAAE,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC;AAClE,EAAE,kBAAkB,CAAC,cAAc,EAAE,QAAQ,CAAC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