defuss 3.4.7 → 3.4.9
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-BMM8gF0l.cjs +2691 -0
- package/dist/{dom-DIfHWdHZ.cjs → dom-D--m76Im.cjs} +24 -0
- package/dist/{dom-DhkFpQzW.mjs → dom-_OdBXxSy.mjs} +24 -1
- package/dist/dom-nGC6cuXP.mjs +2617 -0
- package/dist/{index-CDeQTFKH.d.ts → index-CeFAHwJi.d.ts} +35 -30
- package/dist/index-D5JUP0KJ.d.ts +1339 -0
- package/dist/index.cjs +79 -2
- package/dist/index.d.ts +89 -4
- package/dist/index.mjs +78 -4
- package/dist/{mount-C9aDnSHs.cjs → mount-BN642QJz.cjs} +1 -1
- package/dist/{mount-0BKlcRFL.mjs → mount-BcFWqQDc.mjs} +1 -1
- package/dist/mount-CN-P1rpv.mjs +26 -0
- package/dist/mount-CY0wDye_.cjs +29 -0
- package/dist/render/client.cjs +2 -2
- package/dist/render/client.d.ts +2 -2
- package/dist/render/client.mjs +3 -3
- package/dist/render/dev/index.cjs +1 -1
- package/dist/render/dev/index.d.ts +1 -1
- package/dist/render/dev/index.mjs +1 -1
- package/dist/render/index.cjs +2 -2
- package/dist/render/index.d.ts +2 -2
- package/dist/render/index.mjs +2 -2
- package/dist/render/server.cjs +2 -2
- package/dist/render/server.d.ts +2 -2
- package/dist/render/server.mjs +3 -3
- package/package.json +10 -5
|
@@ -271,6 +271,20 @@ function unregisterComponent(el) {
|
|
|
271
271
|
componentRegistry.delete(el);
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
function reactive(config, target) {
|
|
275
|
+
const stores = Array.isArray(config.store) ? config.store : [config.store];
|
|
276
|
+
const ref = target instanceof HTMLElement ? { current: target } : target;
|
|
277
|
+
const update = () => {
|
|
278
|
+
dequery(ref).jsx(config.render());
|
|
279
|
+
};
|
|
280
|
+
update();
|
|
281
|
+
const unsubscribes = stores.map((s) => s.subscribe(update));
|
|
282
|
+
return () => {
|
|
283
|
+
unsubscribes.forEach((unsub) => unsub());
|
|
284
|
+
config.cleanup?.();
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
274
288
|
const emptyImpl = (nodes) => {
|
|
275
289
|
nodes.forEach((el) => {
|
|
276
290
|
const element = el;
|
|
@@ -1040,6 +1054,15 @@ class CallChainImpl {
|
|
|
1040
1054
|
}
|
|
1041
1055
|
return this;
|
|
1042
1056
|
}
|
|
1057
|
+
// --- Reactive ---
|
|
1058
|
+
reactive(config) {
|
|
1059
|
+
this._nodes.forEach((el) => {
|
|
1060
|
+
if (el instanceof HTMLElement) {
|
|
1061
|
+
reactive(config, el);
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
return this;
|
|
1065
|
+
}
|
|
1043
1066
|
}
|
|
1044
1067
|
function dequery(selectorRefOrEl, options = getDefaultDequeryOptions()) {
|
|
1045
1068
|
if (typeof selectorRefOrEl === "function") {
|
|
@@ -2598,6 +2621,7 @@ exports.parseEventPropName = parseEventPropName;
|
|
|
2598
2621
|
exports.performTransition = performTransition;
|
|
2599
2622
|
exports.processAllFormElements = processAllFormElements;
|
|
2600
2623
|
exports.queueCallback = queueCallback;
|
|
2624
|
+
exports.reactive = reactive;
|
|
2601
2625
|
exports.registerComponent = registerComponent;
|
|
2602
2626
|
exports.registerDelegatedEvent = registerDelegatedEvent;
|
|
2603
2627
|
exports.removeDelegatedEvent = removeDelegatedEvent;
|
|
@@ -269,6 +269,20 @@ function unregisterComponent(el) {
|
|
|
269
269
|
componentRegistry.delete(el);
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
function reactive(config, target) {
|
|
273
|
+
const stores = Array.isArray(config.store) ? config.store : [config.store];
|
|
274
|
+
const ref = target instanceof HTMLElement ? { current: target } : target;
|
|
275
|
+
const update = () => {
|
|
276
|
+
dequery(ref).jsx(config.render());
|
|
277
|
+
};
|
|
278
|
+
update();
|
|
279
|
+
const unsubscribes = stores.map((s) => s.subscribe(update));
|
|
280
|
+
return () => {
|
|
281
|
+
unsubscribes.forEach((unsub) => unsub());
|
|
282
|
+
config.cleanup?.();
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
272
286
|
const emptyImpl = (nodes) => {
|
|
273
287
|
nodes.forEach((el) => {
|
|
274
288
|
const element = el;
|
|
@@ -1038,6 +1052,15 @@ class CallChainImpl {
|
|
|
1038
1052
|
}
|
|
1039
1053
|
return this;
|
|
1040
1054
|
}
|
|
1055
|
+
// --- Reactive ---
|
|
1056
|
+
reactive(config) {
|
|
1057
|
+
this._nodes.forEach((el) => {
|
|
1058
|
+
if (el instanceof HTMLElement) {
|
|
1059
|
+
reactive(config, el);
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
return this;
|
|
1063
|
+
}
|
|
1041
1064
|
}
|
|
1042
1065
|
function dequery(selectorRefOrEl, options = getDefaultDequeryOptions()) {
|
|
1043
1066
|
if (typeof selectorRefOrEl === "function") {
|
|
@@ -2542,4 +2565,4 @@ function htmlStringToVNodes(html, Parser) {
|
|
|
2542
2565
|
return vNodes;
|
|
2543
2566
|
}
|
|
2544
2567
|
|
|
2545
|
-
export { $,
|
|
2568
|
+
export { $, getTransitionStyles as A, globalScopeDomApis as B, CAPTURE_ONLY_EVENTS as C, DANGEROUSLY_SET_INNER_HTML_ATTRIBUTE as D, handleLifecycleEventsForOnMount as E, Fragment as F, htmlStringToVNodes as G, isComponentRoot as H, isDequery as I, isDequeryOptionsObject as J, isHTML as K, isJSX as L, isMarkup as M, isRef as N, isSVG as O, jsx as P, jsxDEV as Q, REF_ATTRIBUTE_NAME as R, jsxs as S, nsMap as T, observeUnmount as U, parseDOM as V, parseEventPropName as W, XLINK_ATTRIBUTE_NAME as X, performTransition as Y, processAllFormElements as Z, queueCallback as _, CLASS_ATTRIBUTE_NAME as a, reactive as a0, registerComponent as a1, registerDelegatedEvent as a2, removeDelegatedEvent as a3, removeDelegatedEventByKey as a4, removeElementEvent as a5, render as a6, renderInto as a7, renderIsomorphicAsync as a8, renderIsomorphicSync as a9, renderMarkup as aa, replaceDomWithVdom as ab, scrollHelper as ac, shallowEquals as ad, unregisterComponent as ae, updateDom as af, updateDomWithVdom as ag, waitForDOM as ah, webstorage as ai, CallChainImpl as b, DEFAULT_TRANSITION_CONFIG as c, XMLNS_ATTRIBUTE_NAME as d, addElementEvent as e, applyStyles as f, areDomNodesEqual as g, checkElementVisibility as h, clearDelegatedEvents as i, clearDelegatedEventsDeep as j, clearElementEvents as k, createInPlaceErrorMessageVNode as l, createRef as m, createStore as n, deepEquals as o, dequery as p, domNodeToVNode as q, emptyImpl as r, getAllFormValues as s, getComponentInstance as t, getDefaultDequeryOptions as u, getEventMap as v, getMimeType as w, getRegisteredEventKeys as x, getRegisteredEventTypes as y, getRenderer as z };
|