@fluixi/dom 1.0.0-alpha.83 → 1.0.0-alpha.85
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/cdn/dom-client.cjs +1427 -1
- package/dist/cdn/dom-client.d.ts +2 -2
- package/dist/cdn/dom-client.global.js +2 -1
- package/dist/cdn/dom-client.js +3 -3
- package/dist/cdn/dom-client.mjs +1430 -1
- package/dist/cdn/dom.cjs +3127 -1
- package/dist/cdn/dom.d.ts +2 -2
- package/dist/cdn/dom.global.js +2 -1
- package/dist/cdn/dom.js +4 -4
- package/dist/cdn/dom.mjs +3133 -1
- package/dist/index.cjs +3155 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3149 -1
- package/dist/lib/component/index.cjs +128 -1
- package/dist/lib/component/index.mjs +105 -1
- package/dist/lib/component/modifiers.cjs +126 -1
- package/dist/lib/component/modifiers.d.ts +12 -0
- package/dist/lib/component/modifiers.d.ts.map +1 -1
- package/dist/lib/component/modifiers.js +12 -84
- package/dist/lib/component/modifiers.mjs +105 -1
- package/dist/lib/dom/delegate.cjs +60 -1
- package/dist/lib/dom/delegate.js +1 -1
- package/dist/lib/dom/delegate.mjs +39 -1
- package/dist/lib/dom/dynamic-element.cjs +949 -1
- package/dist/lib/dom/dynamic-element.d.ts +3 -3
- package/dist/lib/dom/dynamic-element.js +2 -2
- package/dist/lib/dom/dynamic-element.mjs +928 -1
- package/dist/lib/dom/hydration-state.cjs +93 -1
- package/dist/lib/dom/hydration-state.d.ts +1 -1
- package/dist/lib/dom/hydration-state.js +1 -1
- package/dist/lib/dom/hydration-state.mjs +72 -1
- package/dist/lib/dom/hydration.cjs +685 -1
- package/dist/lib/dom/hydration.js +8 -8
- package/dist/lib/dom/hydration.mjs +664 -1
- package/dist/lib/dom/index.cjs +2040 -1
- package/dist/lib/dom/index.js +1 -1
- package/dist/lib/dom/index.mjs +2020 -1
- package/dist/lib/dom/integration.cjs +71 -1
- package/dist/lib/dom/integration.js +3 -3
- package/dist/lib/dom/integration.mjs +51 -1
- package/dist/lib/dom/island.cjs +790 -1
- package/dist/lib/dom/island.d.ts +1 -1
- package/dist/lib/dom/island.js +11 -11
- package/dist/lib/dom/island.mjs +769 -1
- package/dist/lib/dom/runtime.cjs +1432 -1
- package/dist/lib/dom/runtime.d.ts +60 -17
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +122 -79
- package/dist/lib/dom/runtime.mjs +1414 -1
- package/dist/lib/dom/server/fx-data.cjs +53 -1
- package/dist/lib/dom/server/fx-data.d.ts +5 -5
- package/dist/lib/dom/server/fx-data.js +6 -6
- package/dist/lib/dom/server/fx-data.mjs +32 -1
- package/dist/lib/dom/server/host.cjs +66 -1
- package/dist/lib/dom/server/host.d.ts +6 -0
- package/dist/lib/dom/server/host.d.ts.map +1 -1
- package/dist/lib/dom/server/host.js +7 -1
- package/dist/lib/dom/server/host.mjs +45 -1
- package/dist/lib/dom/server/index.cjs +759 -1
- package/dist/lib/dom/server/index.d.ts +1 -1
- package/dist/lib/dom/server/index.js +1 -1
- package/dist/lib/dom/server/index.mjs +743 -1
- package/dist/lib/dom/server/nodes.cjs +302 -1
- package/dist/lib/dom/server/nodes.d.ts +2 -2
- package/dist/lib/dom/server/nodes.d.ts.map +1 -1
- package/dist/lib/dom/server/nodes.js +4 -4
- package/dist/lib/dom/server/nodes.mjs +279 -1
- package/dist/lib/dom/server/parse-template.cjs +395 -1
- package/dist/lib/dom/server/parse-template.d.ts +1 -1
- package/dist/lib/dom/server/parse-template.js +4 -4
- package/dist/lib/dom/server/parse-template.mjs +372 -1
- package/dist/lib/dom/server/render.cjs +691 -1
- package/dist/lib/dom/server/render.d.ts +9 -1
- package/dist/lib/dom/server/render.d.ts.map +1 -1
- package/dist/lib/dom/server/render.js +23 -15
- package/dist/lib/dom/server/render.mjs +677 -1
- package/dist/lib/dom/server/request-context.cjs +110 -1
- package/dist/lib/dom/server/request-context.d.ts +29 -9
- package/dist/lib/dom/server/request-context.d.ts.map +1 -1
- package/dist/lib/dom/server/request-context.js +28 -8
- package/dist/lib/dom/server/request-context.mjs +89 -1
- package/dist/lib/dom/server/serialize.cjs +187 -1
- package/dist/lib/dom/server/serialize.js +3 -3
- package/dist/lib/dom/server/serialize.mjs +164 -1
- package/dist/lib/dom/server-renderer.cjs +760 -1
- package/dist/lib/dom/server-renderer.js +1 -1
- package/dist/lib/dom/server-renderer.mjs +745 -1
- package/dist/lib/dom/types.cjs +18 -1
- package/dist/lib/dom/utils.cjs +381 -1
- package/dist/lib/dom/utils.d.ts +1 -88
- package/dist/lib/dom/utils.d.ts.map +1 -1
- package/dist/lib/dom/utils.js +2 -99
- package/dist/lib/dom/utils.mjs +361 -1
- package/dist/lib/dom/versions.cjs +60 -1
- package/dist/lib/dom/versions.d.ts +3 -3
- package/dist/lib/dom/versions.d.ts.map +1 -1
- package/dist/lib/dom/versions.js +17 -5
- package/dist/lib/dom/versions.mjs +37 -1
- package/dist/lib/element/attributes.cjs +19 -1
- package/dist/lib/element/attributes.d.ts +7 -7
- package/dist/lib/element/attributes.js +1 -1
- package/dist/lib/element/attributes.mjs +1 -0
- package/dist/lib/element/index.cjs +19 -1
- package/dist/lib/element/index.mjs +1 -0
- package/dist/lib/element/types.cjs +18 -1
- package/dist/lib/element/types.d.ts +4 -5
- package/dist/lib/element/types.d.ts.map +1 -1
- package/dist/lib/element/types.js +0 -1
- package/dist/lib/flow/class-map.cjs +38 -1
- package/dist/lib/flow/class-map.d.ts +3 -3
- package/dist/lib/flow/class-map.js +2 -2
- package/dist/lib/flow/class-map.mjs +17 -1
- package/dist/lib/flow/client-only.cjs +57 -1
- package/dist/lib/flow/client-only.d.ts +4 -4
- package/dist/lib/flow/client-only.js +3 -3
- package/dist/lib/flow/client-only.mjs +36 -1
- package/dist/lib/flow/dynamic.cjs +53 -1
- package/dist/lib/flow/dynamic.d.ts +2 -2
- package/dist/lib/flow/dynamic.js +3 -3
- package/dist/lib/flow/dynamic.mjs +32 -1
- package/dist/lib/flow/error-boundary.cjs +43 -1
- package/dist/lib/flow/error-boundary.d.ts +2 -2
- package/dist/lib/flow/error-boundary.js +3 -3
- package/dist/lib/flow/error-boundary.mjs +22 -1
- package/dist/lib/flow/for.cjs +66 -1
- package/dist/lib/flow/for.d.ts +9 -9
- package/dist/lib/flow/for.d.ts.map +1 -1
- package/dist/lib/flow/for.js +2 -2
- package/dist/lib/flow/for.mjs +45 -1
- package/dist/lib/flow/index-flow.cjs +67 -1
- package/dist/lib/flow/index-flow.d.ts +5 -5
- package/dist/lib/flow/index-flow.js +4 -4
- package/dist/lib/flow/index-flow.mjs +46 -1
- package/dist/lib/flow/index.cjs +805 -1
- package/dist/lib/flow/index.mjs +792 -1
- package/dist/lib/flow/portal.cjs +538 -1
- package/dist/lib/flow/portal.mjs +519 -1
- package/dist/lib/flow/show.cjs +81 -1
- package/dist/lib/flow/show.d.ts +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +4 -115
- package/dist/lib/flow/show.mjs +67 -1
- package/dist/lib/flow/style-map.cjs +43 -1
- package/dist/lib/flow/style-map.d.ts +3 -3
- package/dist/lib/flow/style-map.js +3 -3
- package/dist/lib/flow/style-map.mjs +22 -1
- package/dist/lib/flow/switch.cjs +91 -1
- package/dist/lib/flow/switch.d.ts +3 -3
- package/dist/lib/flow/switch.d.ts.map +1 -1
- package/dist/lib/flow/switch.js +6 -6
- package/dist/lib/flow/switch.mjs +70 -1
- package/dist/lib/flow/utils.cjs +44 -1
- package/dist/lib/flow/utils.d.ts +1 -1
- package/dist/lib/flow/utils.js +1 -1
- package/dist/lib/flow/utils.mjs +23 -1
- package/dist/lib/html.cjs +32 -1
- package/dist/lib/html.d.ts +6 -6
- package/dist/lib/html.js +5 -5
- package/dist/lib/html.mjs +11 -1
- package/dist/lib/index.cjs +3104 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -3
- package/dist/lib/index.mjs +3097 -1
- package/dist/lib/shared/types.cjs +18 -1
- package/dist/lib/shared/types.d.ts +8 -8
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +26 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +2 -2
- package/dist/version.generated.mjs +5 -1
- package/package.json +7 -6
- package/dist/lib/jsx/control-flow/flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/flow.js +0 -627
- package/dist/lib/jsx/control-flow/flow.mjs +0 -0
- package/dist/lib/jsx/control-flow/for-flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/for-flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/for-flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/for-flow.js +0 -1
- package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
|
@@ -1 +1,93 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lib/dom/hydration-state.ts
|
|
21
|
+
var hydration_state_exports = {};
|
|
22
|
+
__export(hydration_state_exports, {
|
|
23
|
+
ascendPast: () => ascendPast,
|
|
24
|
+
captureHydrationCursor: () => captureHydrationCursor,
|
|
25
|
+
getHydrationWalker: () => getHydrationWalker,
|
|
26
|
+
hydrateAdvancePast: () => hydrateAdvancePast,
|
|
27
|
+
hydration: () => hydration,
|
|
28
|
+
isAdopted: () => isAdopted,
|
|
29
|
+
registerHydrationWalker: () => registerHydrationWalker,
|
|
30
|
+
runHydrationAt: () => runHydrationAt,
|
|
31
|
+
runWithoutHydration: () => runWithoutHydration
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(hydration_state_exports);
|
|
34
|
+
var hydration = {
|
|
35
|
+
active: false,
|
|
36
|
+
cursor: null,
|
|
37
|
+
parents: []
|
|
38
|
+
};
|
|
39
|
+
var _walker = null;
|
|
40
|
+
function registerHydrationWalker(walker) {
|
|
41
|
+
_walker = walker;
|
|
42
|
+
}
|
|
43
|
+
function getHydrationWalker() {
|
|
44
|
+
return _walker;
|
|
45
|
+
}
|
|
46
|
+
function isAdopted(parent, node) {
|
|
47
|
+
return hydration.active && node.parentNode === parent;
|
|
48
|
+
}
|
|
49
|
+
function ascendPast(node) {
|
|
50
|
+
const idx = hydration.parents.lastIndexOf(node);
|
|
51
|
+
if (idx !== -1) hydration.parents.length = idx;
|
|
52
|
+
hydration.cursor = node.nextSibling;
|
|
53
|
+
}
|
|
54
|
+
function captureHydrationCursor() {
|
|
55
|
+
return hydration.active ? hydration.cursor : null;
|
|
56
|
+
}
|
|
57
|
+
function runHydrationAt(cursor, fn) {
|
|
58
|
+
if (!cursor || cursor.parentNode == null) return fn();
|
|
59
|
+
const prevActive = hydration.active;
|
|
60
|
+
const prevCursor = hydration.cursor;
|
|
61
|
+
const prevParents = hydration.parents;
|
|
62
|
+
hydration.active = true;
|
|
63
|
+
hydration.cursor = cursor;
|
|
64
|
+
hydration.parents = [];
|
|
65
|
+
try {
|
|
66
|
+
return fn();
|
|
67
|
+
} finally {
|
|
68
|
+
hydration.active = prevActive;
|
|
69
|
+
hydration.cursor = prevCursor;
|
|
70
|
+
hydration.parents = prevParents;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function runWithoutHydration(fn) {
|
|
74
|
+
if (!hydration.active) return fn();
|
|
75
|
+
const prevCursor = hydration.cursor;
|
|
76
|
+
const prevParents = hydration.parents;
|
|
77
|
+
hydration.active = false;
|
|
78
|
+
hydration.parents = [];
|
|
79
|
+
try {
|
|
80
|
+
return fn();
|
|
81
|
+
} finally {
|
|
82
|
+
hydration.active = true;
|
|
83
|
+
hydration.cursor = prevCursor;
|
|
84
|
+
hydration.parents = prevParents;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function hydrateAdvancePast(rendered) {
|
|
88
|
+
if (!hydration.active || rendered == null) return;
|
|
89
|
+
const last = Array.isArray(rendered) ? rendered[rendered.length - 1] : rendered;
|
|
90
|
+
if (last && typeof last.nodeType === "number") {
|
|
91
|
+
ascendPast(last);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -35,7 +35,7 @@ export declare function captureHydrationCursor(): Node | null;
|
|
|
35
35
|
export declare function runHydrationAt<T>(cursor: Node | null, fn: () => T): T;
|
|
36
36
|
/**
|
|
37
37
|
* Run `fn` with DOM-reuse hydration temporarily OFF, restoring the cursor afterwards.
|
|
38
|
-
* For a detached subtree mid-hydration that must
|
|
38
|
+
* For a detached subtree mid-hydration that must not consume the cursor (e.g. an eagerly
|
|
39
39
|
* instantiated Suspense fallback that isn't showing).
|
|
40
40
|
*/
|
|
41
41
|
export declare function runWithoutHydration<T>(fn: () => T): T;
|
|
@@ -61,7 +61,7 @@ export function runHydrationAt(cursor, fn) {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Run `fn` with DOM-reuse hydration temporarily OFF, restoring the cursor afterwards.
|
|
64
|
-
* For a detached subtree mid-hydration that must
|
|
64
|
+
* For a detached subtree mid-hydration that must not consume the cursor (e.g. an eagerly
|
|
65
65
|
* instantiated Suspense fallback that isn't showing).
|
|
66
66
|
*/
|
|
67
67
|
export function runWithoutHydration(fn) {
|
|
@@ -1 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/dom/hydration-state.ts
|
|
2
|
+
var hydration = {
|
|
3
|
+
active: false,
|
|
4
|
+
cursor: null,
|
|
5
|
+
parents: []
|
|
6
|
+
};
|
|
7
|
+
var _walker = null;
|
|
8
|
+
function registerHydrationWalker(walker) {
|
|
9
|
+
_walker = walker;
|
|
10
|
+
}
|
|
11
|
+
function getHydrationWalker() {
|
|
12
|
+
return _walker;
|
|
13
|
+
}
|
|
14
|
+
function isAdopted(parent, node) {
|
|
15
|
+
return hydration.active && node.parentNode === parent;
|
|
16
|
+
}
|
|
17
|
+
function ascendPast(node) {
|
|
18
|
+
const idx = hydration.parents.lastIndexOf(node);
|
|
19
|
+
if (idx !== -1) hydration.parents.length = idx;
|
|
20
|
+
hydration.cursor = node.nextSibling;
|
|
21
|
+
}
|
|
22
|
+
function captureHydrationCursor() {
|
|
23
|
+
return hydration.active ? hydration.cursor : null;
|
|
24
|
+
}
|
|
25
|
+
function runHydrationAt(cursor, fn) {
|
|
26
|
+
if (!cursor || cursor.parentNode == null) return fn();
|
|
27
|
+
const prevActive = hydration.active;
|
|
28
|
+
const prevCursor = hydration.cursor;
|
|
29
|
+
const prevParents = hydration.parents;
|
|
30
|
+
hydration.active = true;
|
|
31
|
+
hydration.cursor = cursor;
|
|
32
|
+
hydration.parents = [];
|
|
33
|
+
try {
|
|
34
|
+
return fn();
|
|
35
|
+
} finally {
|
|
36
|
+
hydration.active = prevActive;
|
|
37
|
+
hydration.cursor = prevCursor;
|
|
38
|
+
hydration.parents = prevParents;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function runWithoutHydration(fn) {
|
|
42
|
+
if (!hydration.active) return fn();
|
|
43
|
+
const prevCursor = hydration.cursor;
|
|
44
|
+
const prevParents = hydration.parents;
|
|
45
|
+
hydration.active = false;
|
|
46
|
+
hydration.parents = [];
|
|
47
|
+
try {
|
|
48
|
+
return fn();
|
|
49
|
+
} finally {
|
|
50
|
+
hydration.active = true;
|
|
51
|
+
hydration.cursor = prevCursor;
|
|
52
|
+
hydration.parents = prevParents;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function hydrateAdvancePast(rendered) {
|
|
56
|
+
if (!hydration.active || rendered == null) return;
|
|
57
|
+
const last = Array.isArray(rendered) ? rendered[rendered.length - 1] : rendered;
|
|
58
|
+
if (last && typeof last.nodeType === "number") {
|
|
59
|
+
ascendPast(last);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
ascendPast,
|
|
64
|
+
captureHydrationCursor,
|
|
65
|
+
getHydrationWalker,
|
|
66
|
+
hydrateAdvancePast,
|
|
67
|
+
hydration,
|
|
68
|
+
isAdopted,
|
|
69
|
+
registerHydrationWalker,
|
|
70
|
+
runHydrationAt,
|
|
71
|
+
runWithoutHydration
|
|
72
|
+
};
|