defuss 2.0.5 → 2.0.8
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/README.md +1 -1
- package/dist/dom-B1dLisH1.mjs +2076 -0
- package/dist/dom-BAzK3Vx0.cjs +2139 -0
- package/dist/dom-BHDjOwCH.cjs +2058 -0
- package/dist/dom-BM7yyeiL.cjs +2113 -0
- package/dist/dom-BODEuMW4.mjs +2033 -0
- package/dist/dom-BQCqcLJ_.mjs +2053 -0
- package/dist/dom-BS13a21g.mjs +1999 -0
- package/dist/dom-BUqSncLm.mjs +2033 -0
- package/dist/dom-B_M0CfLs.mjs +2050 -0
- package/dist/dom-BbgJsup1.cjs +2094 -0
- package/dist/dom-Bdh1oHkL.cjs +2134 -0
- package/dist/dom-Bkn4aKgS.cjs +2112 -0
- package/dist/dom-BwZ6opl4.cjs +2132 -0
- package/dist/dom-C0uO7s3X.mjs +2073 -0
- package/dist/dom-C97kq5qk.cjs +2056 -0
- package/dist/dom-CA2M2r6M.cjs +2138 -0
- package/dist/dom-CEjSlC-i.cjs +2109 -0
- package/dist/dom-CKoP42sX.mjs +2073 -0
- package/dist/dom-CUosB5rS.mjs +2054 -0
- package/dist/dom-CZ_THi-B.cjs +2094 -0
- package/dist/dom-CfkqBJ1D.cjs +2134 -0
- package/dist/dom-Cpvpcy1m.mjs +2078 -0
- package/dist/dom-Cqzc2_-K.mjs +2015 -0
- package/dist/dom-DIImES-I.mjs +2076 -0
- package/dist/dom-DN8BPCn_.mjs +1997 -0
- package/dist/dom-DP77Lp5s.cjs +2054 -0
- package/dist/dom-DQ-4wDZ_.mjs +2069 -0
- package/dist/dom-DREcMGES.cjs +2136 -0
- package/dist/dom-Dh7tpDg6.mjs +1977 -0
- package/dist/dom-DoyVaQky.mjs +2070 -0
- package/dist/dom-H4DPWQ4G.cjs +2137 -0
- package/dist/dom-I-NMKeYP.cjs +2072 -0
- package/dist/dom-JFNzXTKt.mjs +2001 -0
- package/dist/dom-KRcHcrS2.mjs +2075 -0
- package/dist/dom-Ndm2FOzd.mjs +2070 -0
- package/dist/dom-eP3TSA_V.cjs +2132 -0
- package/dist/dom-gYw7ZafB.cjs +2130 -0
- package/dist/index-6ueP8K6K.d.ts +1449 -0
- package/dist/index-B2A5HvPZ.d.ts +1449 -0
- package/dist/index-B3DwvT_m.d.ts +1449 -0
- package/dist/index-B8pQcXQL.d.ts +1441 -0
- package/dist/index-BCeAZiaJ.d.ts +1441 -0
- package/dist/index-BEckAOnS.d.ts +1443 -0
- package/dist/index-BIKeyAG3.d.ts +1441 -0
- package/dist/index-BahUCdlr.d.ts +1449 -0
- package/dist/index-Br17H0Aq.d.ts +1444 -0
- package/dist/index-BrWqIiZ8.d.ts +1443 -0
- package/dist/index-CjNhjXK0.d.ts +1443 -0
- package/dist/index-CsXc0vY1.d.ts +1449 -0
- package/dist/index-D0Gy87_L.d.ts +1449 -0
- package/dist/index-DB0bpFun.d.ts +1441 -0
- package/dist/index-Zbp2D6Fm.d.ts +1449 -0
- package/dist/index.cjs +14 -5
- package/dist/index.d.cts +15 -10
- package/dist/index.d.ts +15 -10
- package/dist/index.mjs +10 -5
- package/dist/render/client.cjs +2 -1
- package/dist/render/client.d.cts +2 -2
- package/dist/render/client.d.ts +2 -2
- package/dist/render/client.mjs +2 -2
- package/dist/render/index.cjs +2 -1
- package/dist/render/index.d.cts +1 -1
- package/dist/render/index.d.ts +1 -1
- package/dist/render/index.mjs +1 -1
- package/dist/render/server.cjs +2 -1
- package/dist/render/server.d.cts +2 -2
- package/dist/render/server.d.ts +2 -2
- package/dist/render/server.mjs +2 -2
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dom = require('./dom-
|
|
3
|
+
var dom = require('./dom-CZ_THi-B.cjs');
|
|
4
4
|
require('defuss-runtime');
|
|
5
5
|
|
|
6
6
|
const inDevMode = true;
|
|
@@ -157,12 +157,17 @@ const setupRouter = (config = {
|
|
|
157
157
|
};
|
|
158
158
|
const Router = setupRouter();
|
|
159
159
|
|
|
160
|
-
const Route = ({
|
|
160
|
+
const Route = ({
|
|
161
|
+
path,
|
|
162
|
+
exact,
|
|
163
|
+
children,
|
|
164
|
+
router = Router
|
|
165
|
+
}) => {
|
|
161
166
|
router.add({
|
|
162
167
|
path,
|
|
163
168
|
exact: exact || false
|
|
164
169
|
});
|
|
165
|
-
return router.match(path) ? children[0] : null;
|
|
170
|
+
return router.match(path) ? Array.isArray(children) ? children[0] : null : null;
|
|
166
171
|
};
|
|
167
172
|
|
|
168
173
|
const Redirect = ({
|
|
@@ -285,7 +290,7 @@ const Async = ({
|
|
|
285
290
|
ref.updateState("loading");
|
|
286
291
|
isInitial = false;
|
|
287
292
|
}
|
|
288
|
-
const promisedChildren = (children
|
|
293
|
+
const promisedChildren = (Array.isArray(children) ? children : children ? [children] : []).map((vnode) => {
|
|
289
294
|
try {
|
|
290
295
|
if (!vnode || vnode && !vnode.type) {
|
|
291
296
|
return Promise.resolve("");
|
|
@@ -342,8 +347,8 @@ exports.Call = dom.Call;
|
|
|
342
347
|
exports.CallChainImpl = dom.CallChainImpl;
|
|
343
348
|
exports.CallChainImplThenable = dom.CallChainImplThenable;
|
|
344
349
|
exports.Fragment = dom.Fragment;
|
|
345
|
-
exports.NonChainedReturnCallNames = dom.NonChainedReturnCallNames;
|
|
346
350
|
exports.addElementEvent = dom.addElementEvent;
|
|
351
|
+
exports.addNonChainedReturnCallNames = dom.addNonChainedReturnCallNames;
|
|
347
352
|
exports.areDomNodesEqual = dom.areDomNodesEqual;
|
|
348
353
|
exports.checkElementVisibility = dom.checkElementVisibility;
|
|
349
354
|
exports.clearElementEvents = dom.clearElementEvents;
|
|
@@ -355,19 +360,23 @@ exports.createStore = dom.createStore;
|
|
|
355
360
|
exports.createSubChain = dom.createSubChain;
|
|
356
361
|
exports.delayedAutoStart = dom.delayedAutoStart;
|
|
357
362
|
exports.dequery = dom.dequery;
|
|
363
|
+
exports.domNodeToVNode = dom.domNodeToVNode;
|
|
358
364
|
exports.emptyImpl = dom.emptyImpl;
|
|
359
365
|
exports.getAllFormValues = dom.getAllFormValues;
|
|
360
366
|
exports.getDefaultDequeryOptions = dom.getDefaultDequeryOptions;
|
|
361
367
|
exports.getEventMap = dom.getEventMap;
|
|
362
368
|
exports.getMimeType = dom.getMimeType;
|
|
369
|
+
exports.getNonChainedReturnCallNames = dom.getNonChainedReturnCallNames;
|
|
363
370
|
exports.getRenderer = dom.getRenderer;
|
|
364
371
|
exports.globalScopeDomApis = dom.globalScopeDomApis;
|
|
365
372
|
exports.handleLifecycleEventsForOnMount = dom.handleLifecycleEventsForOnMount;
|
|
373
|
+
exports.htmlStringToVNodes = dom.htmlStringToVNodes;
|
|
366
374
|
exports.isDequery = dom.isDequery;
|
|
367
375
|
exports.isDequeryOptionsObject = dom.isDequeryOptionsObject;
|
|
368
376
|
exports.isHTML = dom.isHTML;
|
|
369
377
|
exports.isJSX = dom.isJSX;
|
|
370
378
|
exports.isMarkup = dom.isMarkup;
|
|
379
|
+
exports.isNonChainedReturnCall = dom.isNonChainedReturnCall;
|
|
371
380
|
exports.isRef = dom.isRef;
|
|
372
381
|
exports.isSVG = dom.isSVG;
|
|
373
382
|
exports.jsx = dom.jsx;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { T as PersistenceProviderType, U as PersistenceProviderOptions, W as PersistenceProviderImpl, h as VNode, g as VNodeAttributes, R as RenderInput, G as Globals, N as NodeType, s as Props, n as VNodeChild, f as Ref } from './index-Zbp2D6Fm.js';
|
|
2
|
+
export { a7 as $, A as AllHTMLElements, C as CSSProperties, X as Call, a0 as CallChainImpl, a1 as CallChainImplThenable, p as Children, ao as DOMPropValue, a5 as Dequery, ap as DequeryOptions, ar as DequerySyncMethodReturnType, am as Dimensions, D as DomAbstractionImpl, aq as ElementCreationOptions, F as FontFaceProperties, ak as FormFieldValue, al as FormKeyValues, I as Fragment, K as KeyFrameProperties, av as Listener, at as MemoryStorage, as as MiddlewareFn, P as ParentElementInput, b as ParentElementInputAsync, an as Position, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, q as RenderNodeInput, a as RenderResult, r as RenderResultNode, aw as Store, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, au as WebStorage, Y as addNonChainedReturnCallNames, ac as createCall, ad as createGetterSetterCall, t as createInPlaceErrorMessageVNode, Q as createRef, ax as createStore, ae as createSubChain, a4 as delayedAutoStart, a6 as dequery, $ as emptyImpl, a3 as getAllFormValues, aa as getDefaultDequeryOptions, Z as getNonChainedReturnCallNames, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, a8 as isDequery, a9 as isDequeryOptionsObject, H as isJSX, _ as isNonChainedReturnCall, O as isRef, u as jsx, L as jsxDEV, J as jsxs, ab as mapArrayIndexAccess, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, ah as renderNode, ai as resolveNodes, ag as runWithTimeGuard, a2 as scrollHelper, af as subChainForNextAwait, aj as traverse, M as updateDom } from './index-Zbp2D6Fm.js';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
export { CSS };
|
|
5
5
|
|
|
@@ -16,11 +16,6 @@ declare const webstorage: <T>(provider?: PersistenceProviderType, options?: Pers
|
|
|
16
16
|
* 4. For Text nodes, compares text content.
|
|
17
17
|
*/
|
|
18
18
|
declare const areDomNodesEqual: (oldNode: Node, newNode: Node) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Partially updates a DOM subtree by comparing `targetElement` to
|
|
21
|
-
* newly parsed HTML. No `.innerHTML` is used here; we parse via DOMParser.
|
|
22
|
-
*/
|
|
23
|
-
declare const updateDom: (targetElement: Element, newHTML: string, Parser: typeof DOMParser) => void;
|
|
24
19
|
/********************************************************
|
|
25
20
|
* 1) Define a "valid" child type & utility
|
|
26
21
|
********************************************************/
|
|
@@ -52,6 +47,16 @@ declare function getEventMap(element: HTMLElement): Map<string, Set<EventListene
|
|
|
52
47
|
declare function addElementEvent(element: HTMLElement, eventType: string, handler: EventListener): void;
|
|
53
48
|
declare function removeElementEvent(element: HTMLElement, eventType: string, handler?: EventListener): void;
|
|
54
49
|
declare function clearElementEvents(element: HTMLElement): void;
|
|
50
|
+
/**
|
|
51
|
+
* Converts a DOM node to a VNode structure for use with updateDomWithVdom.
|
|
52
|
+
* This allows us to leverage the sophisticated partial update system even for Node inputs.
|
|
53
|
+
*/
|
|
54
|
+
declare function domNodeToVNode(node: Node): VNode<VNodeAttributes> | string;
|
|
55
|
+
/**
|
|
56
|
+
* Converts an HTML string to VNode structure for use with updateDomWithVdom.
|
|
57
|
+
* This allows markup strings to benefit from the intelligent partial update system.
|
|
58
|
+
*/
|
|
59
|
+
declare function htmlStringToVNodes(html: string, Parser: typeof DOMParser): (VNode<VNodeAttributes> | string)[];
|
|
55
60
|
|
|
56
61
|
type TranslationObject = {
|
|
57
62
|
[key: string]: string | VNode | TranslationObject;
|
|
@@ -128,7 +133,7 @@ interface RouteProps extends Props {
|
|
|
128
133
|
router?: Router;
|
|
129
134
|
exact?: boolean;
|
|
130
135
|
}
|
|
131
|
-
declare const Route: ({ path, exact, children, router }: RouteProps) => VNodeChild;
|
|
136
|
+
declare const Route: ({ path, exact, children, router, }: RouteProps) => VNodeChild;
|
|
132
137
|
|
|
133
138
|
interface RedirectProps extends RouteProps {
|
|
134
139
|
to: string;
|
|
@@ -156,7 +161,7 @@ interface RouterSlotProps extends Props {
|
|
|
156
161
|
declare const RouterSlot: ({ router, children, RouterOutlet, ...attributes }: RouterSlotProps) => VNodeChild;
|
|
157
162
|
|
|
158
163
|
type AsyncState = "loading" | "loaded" | "error";
|
|
159
|
-
interface AsyncStateRef extends Ref<HTMLElement> {
|
|
164
|
+
interface AsyncStateRef extends Ref<AsyncState, HTMLElement> {
|
|
160
165
|
/** The state of the async content */
|
|
161
166
|
state?: AsyncState;
|
|
162
167
|
/** Error details are available here in case the state changes to "error" */
|
|
@@ -205,4 +210,4 @@ declare const Suspense: ({ fallback, ref, children, class: _class, className, id
|
|
|
205
210
|
children: VNode<VNodeAttributes>[];
|
|
206
211
|
};
|
|
207
212
|
|
|
208
|
-
export { Async, type AsyncProps, type AsyncState, type AsyncStateRef, Globals, type I18nStore, NodeType, type OnHandleRouteChangeFn, type OnLanguageChangeListener, type OnRouteChangeFn, PersistenceProviderImpl, PersistenceProviderOptions, PersistenceProviderType, Props, Redirect, type RedirectProps, Ref, RenderInput, type Replacements, Route, type RouteHandler, type RouteParams, type RouteProps, type RouteRegistration, type RouteRequest, Router, type RouterConfig, RouterSlot, RouterSlotId, type RouterSlotProps, type RouterStrategy, Suspense, type TokenizedPath, Trans, type TransProps, type TranslationObject, type Translations, VNode, VNodeAttributes, VNodeChild, type ValidChild, addElementEvent, areDomNodesEqual, checkElementVisibility, clearElementEvents, createI18n, getEventMap, getMimeType, i18n, inDevMode, isHTML, isMarkup, isSVG, matchRouteRegistrations, parseDOM, processAllFormElements, removeElementEvent, renderMarkup, replaceDomWithVdom, setupRouter, tokenizePath,
|
|
213
|
+
export { Async, type AsyncProps, type AsyncState, type AsyncStateRef, Globals, type I18nStore, NodeType, type OnHandleRouteChangeFn, type OnLanguageChangeListener, type OnRouteChangeFn, PersistenceProviderImpl, PersistenceProviderOptions, PersistenceProviderType, Props, Redirect, type RedirectProps, Ref, RenderInput, type Replacements, Route, type RouteHandler, type RouteParams, type RouteProps, type RouteRegistration, type RouteRequest, Router, type RouterConfig, RouterSlot, RouterSlotId, type RouterSlotProps, type RouterStrategy, Suspense, type TokenizedPath, Trans, type TransProps, type TranslationObject, type Translations, VNode, VNodeAttributes, VNodeChild, type ValidChild, addElementEvent, areDomNodesEqual, checkElementVisibility, clearElementEvents, createI18n, domNodeToVNode, getEventMap, getMimeType, htmlStringToVNodes, i18n, inDevMode, isHTML, isMarkup, isSVG, matchRouteRegistrations, parseDOM, processAllFormElements, removeElementEvent, renderMarkup, replaceDomWithVdom, setupRouter, tokenizePath, updateDomWithVdom, waitForDOM, webstorage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { T as PersistenceProviderType, U as PersistenceProviderOptions, W as PersistenceProviderImpl, h as VNode, g as VNodeAttributes, R as RenderInput, G as Globals, N as NodeType, s as Props, n as VNodeChild, f as Ref } from './index-Zbp2D6Fm.js';
|
|
2
|
+
export { a7 as $, A as AllHTMLElements, C as CSSProperties, X as Call, a0 as CallChainImpl, a1 as CallChainImplThenable, p as Children, ao as DOMPropValue, a5 as Dequery, ap as DequeryOptions, ar as DequerySyncMethodReturnType, am as Dimensions, D as DomAbstractionImpl, aq as ElementCreationOptions, F as FontFaceProperties, ak as FormFieldValue, al as FormKeyValues, I as Fragment, K as KeyFrameProperties, av as Listener, at as MemoryStorage, as as MiddlewareFn, P as ParentElementInput, b as ParentElementInputAsync, an as Position, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, q as RenderNodeInput, a as RenderResult, r as RenderResultNode, aw as Store, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, au as WebStorage, Y as addNonChainedReturnCallNames, ac as createCall, ad as createGetterSetterCall, t as createInPlaceErrorMessageVNode, Q as createRef, ax as createStore, ae as createSubChain, a4 as delayedAutoStart, a6 as dequery, $ as emptyImpl, a3 as getAllFormValues, aa as getDefaultDequeryOptions, Z as getNonChainedReturnCallNames, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, a8 as isDequery, a9 as isDequeryOptionsObject, H as isJSX, _ as isNonChainedReturnCall, O as isRef, u as jsx, L as jsxDEV, J as jsxs, ab as mapArrayIndexAccess, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, ah as renderNode, ai as resolveNodes, ag as runWithTimeGuard, a2 as scrollHelper, af as subChainForNextAwait, aj as traverse, M as updateDom } from './index-Zbp2D6Fm.js';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
export { CSS };
|
|
5
5
|
|
|
@@ -16,11 +16,6 @@ declare const webstorage: <T>(provider?: PersistenceProviderType, options?: Pers
|
|
|
16
16
|
* 4. For Text nodes, compares text content.
|
|
17
17
|
*/
|
|
18
18
|
declare const areDomNodesEqual: (oldNode: Node, newNode: Node) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Partially updates a DOM subtree by comparing `targetElement` to
|
|
21
|
-
* newly parsed HTML. No `.innerHTML` is used here; we parse via DOMParser.
|
|
22
|
-
*/
|
|
23
|
-
declare const updateDom: (targetElement: Element, newHTML: string, Parser: typeof DOMParser) => void;
|
|
24
19
|
/********************************************************
|
|
25
20
|
* 1) Define a "valid" child type & utility
|
|
26
21
|
********************************************************/
|
|
@@ -52,6 +47,16 @@ declare function getEventMap(element: HTMLElement): Map<string, Set<EventListene
|
|
|
52
47
|
declare function addElementEvent(element: HTMLElement, eventType: string, handler: EventListener): void;
|
|
53
48
|
declare function removeElementEvent(element: HTMLElement, eventType: string, handler?: EventListener): void;
|
|
54
49
|
declare function clearElementEvents(element: HTMLElement): void;
|
|
50
|
+
/**
|
|
51
|
+
* Converts a DOM node to a VNode structure for use with updateDomWithVdom.
|
|
52
|
+
* This allows us to leverage the sophisticated partial update system even for Node inputs.
|
|
53
|
+
*/
|
|
54
|
+
declare function domNodeToVNode(node: Node): VNode<VNodeAttributes> | string;
|
|
55
|
+
/**
|
|
56
|
+
* Converts an HTML string to VNode structure for use with updateDomWithVdom.
|
|
57
|
+
* This allows markup strings to benefit from the intelligent partial update system.
|
|
58
|
+
*/
|
|
59
|
+
declare function htmlStringToVNodes(html: string, Parser: typeof DOMParser): (VNode<VNodeAttributes> | string)[];
|
|
55
60
|
|
|
56
61
|
type TranslationObject = {
|
|
57
62
|
[key: string]: string | VNode | TranslationObject;
|
|
@@ -128,7 +133,7 @@ interface RouteProps extends Props {
|
|
|
128
133
|
router?: Router;
|
|
129
134
|
exact?: boolean;
|
|
130
135
|
}
|
|
131
|
-
declare const Route: ({ path, exact, children, router }: RouteProps) => VNodeChild;
|
|
136
|
+
declare const Route: ({ path, exact, children, router, }: RouteProps) => VNodeChild;
|
|
132
137
|
|
|
133
138
|
interface RedirectProps extends RouteProps {
|
|
134
139
|
to: string;
|
|
@@ -156,7 +161,7 @@ interface RouterSlotProps extends Props {
|
|
|
156
161
|
declare const RouterSlot: ({ router, children, RouterOutlet, ...attributes }: RouterSlotProps) => VNodeChild;
|
|
157
162
|
|
|
158
163
|
type AsyncState = "loading" | "loaded" | "error";
|
|
159
|
-
interface AsyncStateRef extends Ref<HTMLElement> {
|
|
164
|
+
interface AsyncStateRef extends Ref<AsyncState, HTMLElement> {
|
|
160
165
|
/** The state of the async content */
|
|
161
166
|
state?: AsyncState;
|
|
162
167
|
/** Error details are available here in case the state changes to "error" */
|
|
@@ -205,4 +210,4 @@ declare const Suspense: ({ fallback, ref, children, class: _class, className, id
|
|
|
205
210
|
children: VNode<VNodeAttributes>[];
|
|
206
211
|
};
|
|
207
212
|
|
|
208
|
-
export { Async, type AsyncProps, type AsyncState, type AsyncStateRef, Globals, type I18nStore, NodeType, type OnHandleRouteChangeFn, type OnLanguageChangeListener, type OnRouteChangeFn, PersistenceProviderImpl, PersistenceProviderOptions, PersistenceProviderType, Props, Redirect, type RedirectProps, Ref, RenderInput, type Replacements, Route, type RouteHandler, type RouteParams, type RouteProps, type RouteRegistration, type RouteRequest, Router, type RouterConfig, RouterSlot, RouterSlotId, type RouterSlotProps, type RouterStrategy, Suspense, type TokenizedPath, Trans, type TransProps, type TranslationObject, type Translations, VNode, VNodeAttributes, VNodeChild, type ValidChild, addElementEvent, areDomNodesEqual, checkElementVisibility, clearElementEvents, createI18n, getEventMap, getMimeType, i18n, inDevMode, isHTML, isMarkup, isSVG, matchRouteRegistrations, parseDOM, processAllFormElements, removeElementEvent, renderMarkup, replaceDomWithVdom, setupRouter, tokenizePath,
|
|
213
|
+
export { Async, type AsyncProps, type AsyncState, type AsyncStateRef, Globals, type I18nStore, NodeType, type OnHandleRouteChangeFn, type OnLanguageChangeListener, type OnRouteChangeFn, PersistenceProviderImpl, PersistenceProviderOptions, PersistenceProviderType, Props, Redirect, type RedirectProps, Ref, RenderInput, type Replacements, Route, type RouteHandler, type RouteParams, type RouteProps, type RouteRegistration, type RouteRequest, Router, type RouterConfig, RouterSlot, RouterSlotId, type RouterSlotProps, type RouterStrategy, Suspense, type TokenizedPath, Trans, type TransProps, type TranslationObject, type Translations, VNode, VNodeAttributes, VNodeChild, type ValidChild, addElementEvent, areDomNodesEqual, checkElementVisibility, clearElementEvents, createI18n, domNodeToVNode, getEventMap, getMimeType, htmlStringToVNodes, i18n, inDevMode, isHTML, isMarkup, isSVG, matchRouteRegistrations, parseDOM, processAllFormElements, removeElementEvent, renderMarkup, replaceDomWithVdom, setupRouter, tokenizePath, updateDomWithVdom, waitForDOM, webstorage };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as createStore, m as isServer, k as createRef, $, f as isRef } from './dom-
|
|
2
|
-
export {
|
|
1
|
+
import { l as createStore, m as isServer, k as createRef, $, f as isRef } from './dom-BODEuMW4.mjs';
|
|
2
|
+
export { J as Call, O as CallChainImpl, P as CallChainImplThenable, F as Fragment, D as addElementEvent, K as addNonChainedReturnCallNames, n as areDomNodesEqual, B as checkElementVisibility, G as clearElementEvents, Y as createCall, Z as createGetterSetterCall, c as createInPlaceErrorMessageVNode, _ as createSubChain, S as delayedAutoStart, T as dequery, H as domNodeToVNode, N as emptyImpl, R as getAllFormValues, W as getDefaultDequeryOptions, C as getEventMap, z as getMimeType, L as getNonChainedReturnCallNames, g as getRenderer, b as globalScopeDomApis, h as handleLifecycleEventsForOnMount, I as htmlStringToVNodes, U as isDequery, V as isDequeryOptionsObject, v as isHTML, i as isJSX, x as isMarkup, M as isNonChainedReturnCall, t as isSVG, j as jsx, e as jsxDEV, d as jsxs, X as mapArrayIndexAccess, o as observeUnmount, s as parseDOM, A as processAllFormElements, E as removeElementEvent, a as renderIsomorphicAsync, r as renderIsomorphicSync, y as renderMarkup, a2 as renderNode, q as replaceDomWithVdom, a3 as resolveNodes, a1 as runWithTimeGuard, Q as scrollHelper, a0 as subChainForNextAwait, a4 as traverse, u as updateDom, p as updateDomWithVdom, w as waitForDOM, a5 as webstorage } from './dom-BODEuMW4.mjs';
|
|
3
3
|
import 'defuss-runtime';
|
|
4
4
|
|
|
5
5
|
const inDevMode = true;
|
|
@@ -156,12 +156,17 @@ const setupRouter = (config = {
|
|
|
156
156
|
};
|
|
157
157
|
const Router = setupRouter();
|
|
158
158
|
|
|
159
|
-
const Route = ({
|
|
159
|
+
const Route = ({
|
|
160
|
+
path,
|
|
161
|
+
exact,
|
|
162
|
+
children,
|
|
163
|
+
router = Router
|
|
164
|
+
}) => {
|
|
160
165
|
router.add({
|
|
161
166
|
path,
|
|
162
167
|
exact: exact || false
|
|
163
168
|
});
|
|
164
|
-
return router.match(path) ? children[0] : null;
|
|
169
|
+
return router.match(path) ? Array.isArray(children) ? children[0] : null : null;
|
|
165
170
|
};
|
|
166
171
|
|
|
167
172
|
const Redirect = ({
|
|
@@ -284,7 +289,7 @@ const Async = ({
|
|
|
284
289
|
ref.updateState("loading");
|
|
285
290
|
isInitial = false;
|
|
286
291
|
}
|
|
287
|
-
const promisedChildren = (children
|
|
292
|
+
const promisedChildren = (Array.isArray(children) ? children : children ? [children] : []).map((vnode) => {
|
|
288
293
|
try {
|
|
289
294
|
if (!vnode || vnode && !vnode.type) {
|
|
290
295
|
return Promise.resolve("");
|
package/dist/render/client.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dom = require('../dom-
|
|
3
|
+
var dom = require('../dom-CZ_THi-B.cjs');
|
|
4
4
|
require('defuss-runtime');
|
|
5
5
|
|
|
6
6
|
const renderSync = (virtualNode, parentDomElement = document.documentElement) => {
|
|
@@ -91,6 +91,7 @@ exports.jsxs = dom.jsxs;
|
|
|
91
91
|
exports.observeUnmount = dom.observeUnmount;
|
|
92
92
|
exports.renderIsomorphicAsync = dom.renderIsomorphicAsync;
|
|
93
93
|
exports.renderIsomorphicSync = dom.renderIsomorphicSync;
|
|
94
|
+
exports.updateDom = dom.updateDom;
|
|
94
95
|
exports.hydrate = hydrate;
|
|
95
96
|
exports.render = render;
|
|
96
97
|
exports.renderSync = renderSync;
|
package/dist/render/client.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync, h as VNode } from '../index-
|
|
2
|
-
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType,
|
|
1
|
+
import { R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync, h as VNode } from '../index-Zbp2D6Fm.js';
|
|
2
|
+
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType, s as Props, f as Ref, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, q as RenderNodeInput, r as RenderResultNode, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, g as VNodeAttributes, n as VNodeChild, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, t as createInPlaceErrorMessageVNode, Q as createRef, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, H as isJSX, O as isRef, u as jsx, L as jsxDEV, J as jsxs, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, M as updateDom } from '../index-Zbp2D6Fm.js';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
export { CSS };
|
|
5
5
|
|
package/dist/render/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync, h as VNode } from '../index-
|
|
2
|
-
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType,
|
|
1
|
+
import { R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync, h as VNode } from '../index-Zbp2D6Fm.js';
|
|
2
|
+
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType, s as Props, f as Ref, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, q as RenderNodeInput, r as RenderResultNode, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, g as VNodeAttributes, n as VNodeChild, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, t as createInPlaceErrorMessageVNode, Q as createRef, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, H as isJSX, O as isRef, u as jsx, L as jsxDEV, J as jsxs, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, M as updateDom } from '../index-Zbp2D6Fm.js';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
export { CSS };
|
|
5
5
|
|
package/dist/render/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as globalScopeDomApis, r as renderIsomorphicSync, a as renderIsomorphicAsync, o as observeUnmount } from '../dom-
|
|
2
|
-
export { F as Fragment, c as createInPlaceErrorMessageVNode, k as createRef, g as getRenderer, h as handleLifecycleEventsForOnMount, i as isJSX, f as isRef, j as jsx, e as jsxDEV, d as jsxs } from '../dom-
|
|
1
|
+
import { b as globalScopeDomApis, r as renderIsomorphicSync, a as renderIsomorphicAsync, o as observeUnmount } from '../dom-BODEuMW4.mjs';
|
|
2
|
+
export { F as Fragment, c as createInPlaceErrorMessageVNode, k as createRef, g as getRenderer, h as handleLifecycleEventsForOnMount, i as isJSX, f as isRef, j as jsx, e as jsxDEV, d as jsxs, u as updateDom } from '../dom-BODEuMW4.mjs';
|
|
3
3
|
import 'defuss-runtime';
|
|
4
4
|
|
|
5
5
|
const renderSync = (virtualNode, parentDomElement = document.documentElement) => {
|
package/dist/render/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dom = require('../dom-
|
|
3
|
+
var dom = require('../dom-CZ_THi-B.cjs');
|
|
4
4
|
require('defuss-runtime');
|
|
5
5
|
|
|
6
6
|
|
|
@@ -19,3 +19,4 @@ exports.jsxs = dom.jsxs;
|
|
|
19
19
|
exports.observeUnmount = dom.observeUnmount;
|
|
20
20
|
exports.renderIsomorphicAsync = dom.renderIsomorphicAsync;
|
|
21
21
|
exports.renderIsomorphicSync = dom.renderIsomorphicSync;
|
|
22
|
+
exports.updateDom = dom.updateDom;
|
package/dist/render/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType, P as ParentElementInput, b as ParentElementInputAsync,
|
|
1
|
+
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType, P as ParentElementInput, b as ParentElementInputAsync, s as Props, f as Ref, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, R as RenderInput, q as RenderNodeInput, a as RenderResult, r as RenderResultNode, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, h as VNode, g as VNodeAttributes, n as VNodeChild, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, t as createInPlaceErrorMessageVNode, Q as createRef, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, H as isJSX, O as isRef, u as jsx, L as jsxDEV, J as jsxs, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, M as updateDom } from '../index-Zbp2D6Fm.js';
|
|
2
2
|
import * as CSS from 'csstype';
|
|
3
3
|
export { CSS };
|
package/dist/render/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType, P as ParentElementInput, b as ParentElementInputAsync,
|
|
1
|
+
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, G as Globals, K as KeyFrameProperties, N as NodeType, P as ParentElementInput, b as ParentElementInputAsync, s as Props, f as Ref, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, R as RenderInput, q as RenderNodeInput, a as RenderResult, r as RenderResultNode, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, h as VNode, g as VNodeAttributes, n as VNodeChild, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, t as createInPlaceErrorMessageVNode, Q as createRef, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, H as isJSX, O as isRef, u as jsx, L as jsxDEV, J as jsxs, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, M as updateDom } from '../index-Zbp2D6Fm.js';
|
|
2
2
|
import * as CSS from 'csstype';
|
|
3
3
|
export { CSS };
|
package/dist/render/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { F as Fragment, c as createInPlaceErrorMessageVNode, k as createRef, g as getRenderer, b as globalScopeDomApis, h as handleLifecycleEventsForOnMount, i as isJSX, f as isRef, j as jsx, e as jsxDEV, d as jsxs, o as observeUnmount, a as renderIsomorphicAsync, r as renderIsomorphicSync } from '../dom-
|
|
1
|
+
export { F as Fragment, c as createInPlaceErrorMessageVNode, k as createRef, g as getRenderer, b as globalScopeDomApis, h as handleLifecycleEventsForOnMount, i as isJSX, f as isRef, j as jsx, e as jsxDEV, d as jsxs, o as observeUnmount, a as renderIsomorphicAsync, r as renderIsomorphicSync, u as updateDom } from '../dom-BODEuMW4.mjs';
|
|
2
2
|
import 'defuss-runtime';
|
package/dist/render/server.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var HappyDom = require('happy-dom');
|
|
4
|
-
var dom = require('../dom-
|
|
4
|
+
var dom = require('../dom-CZ_THi-B.cjs');
|
|
5
5
|
var serializeHtml = require('w3c-xmlserializer');
|
|
6
6
|
require('defuss-runtime');
|
|
7
7
|
|
|
@@ -86,6 +86,7 @@ exports.jsxs = dom.jsxs;
|
|
|
86
86
|
exports.observeUnmount = dom.observeUnmount;
|
|
87
87
|
exports.renderIsomorphicAsync = dom.renderIsomorphicAsync;
|
|
88
88
|
exports.renderIsomorphicSync = dom.renderIsomorphicSync;
|
|
89
|
+
exports.updateDom = dom.updateDom;
|
|
89
90
|
exports.createRoot = createRoot;
|
|
90
91
|
exports.getBrowserGlobals = getBrowserGlobals;
|
|
91
92
|
exports.getDocument = getDocument;
|
package/dist/render/server.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as Globals, R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync } from '../index-
|
|
2
|
-
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, K as KeyFrameProperties, N as NodeType,
|
|
1
|
+
import { G as Globals, R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync } from '../index-Zbp2D6Fm.js';
|
|
2
|
+
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, K as KeyFrameProperties, N as NodeType, s as Props, f as Ref, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, q as RenderNodeInput, r as RenderResultNode, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, h as VNode, g as VNodeAttributes, n as VNodeChild, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, t as createInPlaceErrorMessageVNode, Q as createRef, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, H as isJSX, O as isRef, u as jsx, L as jsxDEV, J as jsxs, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, M as updateDom } from '../index-Zbp2D6Fm.js';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
export { CSS };
|
|
5
5
|
|
package/dist/render/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as Globals, R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync } from '../index-
|
|
2
|
-
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, K as KeyFrameProperties, N as NodeType,
|
|
1
|
+
import { G as Globals, R as RenderInput, P as ParentElementInput, a as RenderResult, b as ParentElementInputAsync } from '../index-Zbp2D6Fm.js';
|
|
2
|
+
export { A as AllHTMLElements, C as CSSProperties, p as Children, D as DomAbstractionImpl, F as FontFaceProperties, I as Fragment, K as KeyFrameProperties, N as NodeType, s as Props, f as Ref, d as RefUpdateFn, e as RefUpdateRenderFn, c as RefUpdateRenderFnInput, q as RenderNodeInput, r as RenderResultNode, S as SyncRenderInput, y as SyncRenderResult, V as VAttributes, h as VNode, g as VNodeAttributes, n as VNodeChild, o as VNodeChildren, j as VNodeKey, m as VNodeRef, l as VNodeRefCallback, k as VNodeRefObject, i as VNodeType, t as createInPlaceErrorMessageVNode, Q as createRef, x as getRenderer, E as globalScopeDomApis, w as handleLifecycleEventsForOnMount, H as isJSX, O as isRef, u as jsx, L as jsxDEV, J as jsxs, v as observeUnmount, B as renderIsomorphicAsync, z as renderIsomorphicSync, M as updateDom } from '../index-Zbp2D6Fm.js';
|
|
3
3
|
import * as CSS from 'csstype';
|
|
4
4
|
export { CSS };
|
|
5
5
|
|
package/dist/render/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as HappyDom from 'happy-dom';
|
|
2
|
-
import { r as renderIsomorphicSync, a as renderIsomorphicAsync, b as globalScopeDomApis } from '../dom-
|
|
3
|
-
export { F as Fragment, c as createInPlaceErrorMessageVNode, k as createRef, g as getRenderer, h as handleLifecycleEventsForOnMount, i as isJSX, f as isRef, j as jsx, e as jsxDEV, d as jsxs, o as observeUnmount } from '../dom-
|
|
2
|
+
import { r as renderIsomorphicSync, a as renderIsomorphicAsync, b as globalScopeDomApis } from '../dom-BODEuMW4.mjs';
|
|
3
|
+
export { F as Fragment, c as createInPlaceErrorMessageVNode, k as createRef, g as getRenderer, h as handleLifecycleEventsForOnMount, i as isJSX, f as isRef, j as jsx, e as jsxDEV, d as jsxs, o as observeUnmount, u as updateDom } from '../dom-BODEuMW4.mjs';
|
|
4
4
|
import serializeHtml from 'w3c-xmlserializer';
|
|
5
5
|
import 'defuss-runtime';
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "defuss",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -84,14 +84,15 @@
|
|
|
84
84
|
"pkgroll": "^2.6.0",
|
|
85
85
|
"tsx": "^4.19.2",
|
|
86
86
|
"typescript": "^5.7.2",
|
|
87
|
-
"vitest": "^3.1.3"
|
|
87
|
+
"vitest": "^3.1.3",
|
|
88
|
+
"jsdom": "^26.1.0"
|
|
88
89
|
},
|
|
89
90
|
"dependencies": {
|
|
90
91
|
"@types/w3c-xmlserializer": "^2.0.4",
|
|
91
92
|
"csstype": "^3.1.3",
|
|
92
93
|
"happy-dom": "^15.11.7",
|
|
93
94
|
"w3c-xmlserializer": "^5.0.0",
|
|
94
|
-
"defuss-runtime": "1.0.
|
|
95
|
+
"defuss-runtime": "1.0.4"
|
|
95
96
|
},
|
|
96
97
|
"scripts": {
|
|
97
98
|
"clean": "rm -rf ./coverage && rm -rf ./node_modules/.pnpm && rm -rf ./node_modules/.vite",
|