@fictjs/runtime 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.cjs +8 -8
- package/dist/advanced.js +3 -3
- package/dist/{chunk-7EAEROZ5.cjs → chunk-3A4VW6AK.cjs} +7 -7
- package/dist/{chunk-7EAEROZ5.cjs.map → chunk-3A4VW6AK.cjs.map} +1 -1
- package/dist/{chunk-MWI3USXB.cjs → chunk-3U7EBKEU.cjs} +5 -3
- package/dist/chunk-3U7EBKEU.cjs.map +1 -0
- package/dist/{chunk-7TPCESQS.js → chunk-LU2LD2WJ.js} +2 -2
- package/dist/{chunk-VVNMIER7.js → chunk-TEYUDPTA.js} +2 -2
- package/dist/{chunk-Z5WRKD7Y.cjs → chunk-URDFDRHR.cjs} +16 -16
- package/dist/{chunk-Z5WRKD7Y.cjs.map → chunk-URDFDRHR.cjs.map} +1 -1
- package/dist/{chunk-FOLRR3NZ.js → chunk-YVS4WJ2W.js} +5 -3
- package/dist/{chunk-FOLRR3NZ.js.map → chunk-YVS4WJ2W.js.map} +1 -1
- package/dist/index.cjs +38 -38
- package/dist/index.dev.js +4 -2
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/internal.cjs +34 -34
- package/dist/internal.js +2 -2
- package/package.json +1 -1
- package/src/dom.ts +4 -1
- package/dist/chunk-MWI3USXB.cjs.map +0 -1
- /package/dist/{chunk-7TPCESQS.js.map → chunk-LU2LD2WJ.js.map} +0 -0
- /package/dist/{chunk-VVNMIER7.js.map → chunk-TEYUDPTA.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkURDFDRHRcjs = require('./chunk-URDFDRHR.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -34,7 +34,7 @@ var _chunkZ5WRKD7Ycjs = require('./chunk-Z5WRKD7Y.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk3U7EBKEUcjs = require('./chunk-3U7EBKEU.cjs');
|
|
38
38
|
|
|
39
39
|
// src/ref.ts
|
|
40
40
|
function createRef() {
|
|
@@ -46,7 +46,7 @@ function ErrorBoundary(props) {
|
|
|
46
46
|
const fragment = document.createDocumentFragment();
|
|
47
47
|
const marker = document.createComment("fict:error-boundary");
|
|
48
48
|
fragment.appendChild(marker);
|
|
49
|
-
const hostRoot =
|
|
49
|
+
const hostRoot = _chunk3U7EBKEUcjs.getCurrentRoot.call(void 0, );
|
|
50
50
|
let cleanup;
|
|
51
51
|
let activeNodes = [];
|
|
52
52
|
let renderingFallback = false;
|
|
@@ -64,25 +64,25 @@ function ErrorBoundary(props) {
|
|
|
64
64
|
cleanup = void 0;
|
|
65
65
|
}
|
|
66
66
|
if (activeNodes.length) {
|
|
67
|
-
|
|
67
|
+
_chunk3U7EBKEUcjs.removeNodes.call(void 0, activeNodes);
|
|
68
68
|
activeNodes = [];
|
|
69
69
|
}
|
|
70
70
|
if (value == null || value === false) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const root =
|
|
74
|
-
const prev =
|
|
73
|
+
const root = _chunk3U7EBKEUcjs.createRootContext.call(void 0, hostRoot);
|
|
74
|
+
const prev = _chunk3U7EBKEUcjs.pushRoot.call(void 0, root);
|
|
75
75
|
let nodes = [];
|
|
76
76
|
try {
|
|
77
|
-
const output =
|
|
78
|
-
nodes =
|
|
77
|
+
const output = _chunk3U7EBKEUcjs.createElement.call(void 0, value);
|
|
78
|
+
nodes = _chunk3U7EBKEUcjs.toNodeArray.call(void 0, output);
|
|
79
79
|
const parentNode = marker.parentNode;
|
|
80
80
|
if (parentNode) {
|
|
81
|
-
|
|
81
|
+
_chunk3U7EBKEUcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
|
|
82
82
|
}
|
|
83
83
|
} catch (err) {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
_chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
|
|
85
|
+
_chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
|
|
86
86
|
if (renderingFallback) {
|
|
87
87
|
throw err;
|
|
88
88
|
}
|
|
@@ -97,11 +97,11 @@ function ErrorBoundary(props) {
|
|
|
97
97
|
}
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
_chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
|
|
101
|
+
_chunk3U7EBKEUcjs.flushOnMount.call(void 0, root);
|
|
102
102
|
cleanup = () => {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
_chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
|
|
104
|
+
_chunk3U7EBKEUcjs.removeNodes.call(void 0, nodes);
|
|
105
105
|
};
|
|
106
106
|
activeNodes = nodes;
|
|
107
107
|
};
|
|
@@ -110,7 +110,7 @@ function ErrorBoundary(props) {
|
|
|
110
110
|
renderValue(toView(null));
|
|
111
111
|
};
|
|
112
112
|
renderValue(_nullishCoalesce(props.children, () => ( null)));
|
|
113
|
-
|
|
113
|
+
_chunk3U7EBKEUcjs.registerErrorHandler.call(void 0, (err) => {
|
|
114
114
|
renderValue(toView(err));
|
|
115
115
|
_optionalChain([props, 'access', _5 => _5.onError, 'optionalCall', _6 => _6(err)]);
|
|
116
116
|
return true;
|
|
@@ -119,7 +119,7 @@ function ErrorBoundary(props) {
|
|
|
119
119
|
const isGetter = typeof props.resetKeys === "function" && props.resetKeys.length === 0;
|
|
120
120
|
const getter = isGetter ? props.resetKeys : void 0;
|
|
121
121
|
let prev = isGetter ? getter() : props.resetKeys;
|
|
122
|
-
|
|
122
|
+
_chunk3U7EBKEUcjs.createEffect.call(void 0, () => {
|
|
123
123
|
const next = getter ? getter() : props.resetKeys;
|
|
124
124
|
if (prev !== next) {
|
|
125
125
|
prev = next;
|
|
@@ -148,10 +148,10 @@ function createSuspenseToken() {
|
|
|
148
148
|
}
|
|
149
149
|
var isThenable = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
|
|
150
150
|
function Suspense(props) {
|
|
151
|
-
const pending =
|
|
151
|
+
const pending = _chunk3U7EBKEUcjs.signal.call(void 0, 0);
|
|
152
152
|
let resolvedOnce = false;
|
|
153
153
|
let epoch = 0;
|
|
154
|
-
const hostRoot =
|
|
154
|
+
const hostRoot = _chunk3U7EBKEUcjs.getCurrentRoot.call(void 0, );
|
|
155
155
|
const toFallback = (err) => typeof props.fallback === "function" ? props.fallback(err) : props.fallback;
|
|
156
156
|
const renderView = (view) => {
|
|
157
157
|
if (cleanup) {
|
|
@@ -159,41 +159,41 @@ function Suspense(props) {
|
|
|
159
159
|
cleanup = void 0;
|
|
160
160
|
}
|
|
161
161
|
if (activeNodes.length) {
|
|
162
|
-
|
|
162
|
+
_chunk3U7EBKEUcjs.removeNodes.call(void 0, activeNodes);
|
|
163
163
|
activeNodes = [];
|
|
164
164
|
}
|
|
165
165
|
if (view == null || view === false) {
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
const root =
|
|
169
|
-
const prev =
|
|
168
|
+
const root = _chunk3U7EBKEUcjs.createRootContext.call(void 0, hostRoot);
|
|
169
|
+
const prev = _chunk3U7EBKEUcjs.pushRoot.call(void 0, root);
|
|
170
170
|
let nodes = [];
|
|
171
171
|
try {
|
|
172
|
-
const output =
|
|
173
|
-
nodes =
|
|
172
|
+
const output = _chunk3U7EBKEUcjs.createElement.call(void 0, view);
|
|
173
|
+
nodes = _chunk3U7EBKEUcjs.toNodeArray.call(void 0, output);
|
|
174
174
|
const suspendedAttempt = root.suspended || nodes.length > 0 && nodes.every((node) => node instanceof Comment && node.data === "fict:suspend");
|
|
175
175
|
if (suspendedAttempt) {
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
_chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
|
|
177
|
+
_chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
180
|
const parentNode = marker.parentNode;
|
|
181
181
|
if (parentNode) {
|
|
182
|
-
|
|
182
|
+
_chunk3U7EBKEUcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
|
|
183
183
|
}
|
|
184
184
|
} catch (err) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (!
|
|
185
|
+
_chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
|
|
186
|
+
_chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
|
|
187
|
+
if (!_chunk3U7EBKEUcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
|
|
188
188
|
throw err;
|
|
189
189
|
}
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
_chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
|
|
193
|
+
_chunk3U7EBKEUcjs.flushOnMount.call(void 0, root);
|
|
194
194
|
cleanup = () => {
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
_chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
|
|
196
|
+
_chunk3U7EBKEUcjs.removeNodes.call(void 0, nodes);
|
|
197
197
|
};
|
|
198
198
|
activeNodes = nodes;
|
|
199
199
|
};
|
|
@@ -208,7 +208,7 @@ function Suspense(props) {
|
|
|
208
208
|
_optionalChain([props, 'access', _7 => _7.onResolve, 'optionalCall', _8 => _8()]);
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
|
-
|
|
211
|
+
_chunk3U7EBKEUcjs.registerSuspenseHandler.call(void 0, (token) => {
|
|
212
212
|
const tokenEpoch = epoch;
|
|
213
213
|
pending(pending() + 1);
|
|
214
214
|
renderView(toFallback());
|
|
@@ -233,7 +233,7 @@ function Suspense(props) {
|
|
|
233
233
|
const newPending = Math.max(0, pending() - 1);
|
|
234
234
|
pending(newPending);
|
|
235
235
|
_optionalChain([props, 'access', _9 => _9.onReject, 'optionalCall', _10 => _10(err)]);
|
|
236
|
-
if (!
|
|
236
|
+
if (!_chunk3U7EBKEUcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
|
|
237
237
|
throw err;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -247,7 +247,7 @@ function Suspense(props) {
|
|
|
247
247
|
const isGetter = typeof props.resetKeys === "function" && props.resetKeys.length === 0;
|
|
248
248
|
const getter = isGetter ? props.resetKeys : void 0;
|
|
249
249
|
let prev = isGetter ? getter() : props.resetKeys;
|
|
250
|
-
|
|
250
|
+
_chunk3U7EBKEUcjs.createEffect.call(void 0, () => {
|
|
251
251
|
const next = getter ? getter() : props.resetKeys;
|
|
252
252
|
if (prev !== next) {
|
|
253
253
|
prev = next;
|
|
@@ -284,5 +284,5 @@ function Suspense(props) {
|
|
|
284
284
|
|
|
285
285
|
|
|
286
286
|
|
|
287
|
-
exports.ErrorBoundary = ErrorBoundary; exports.Fragment =
|
|
287
|
+
exports.ErrorBoundary = ErrorBoundary; exports.Fragment = _chunk3U7EBKEUcjs.Fragment; exports.Suspense = Suspense; exports.batch = _chunk3U7EBKEUcjs.batch2; exports.createContext = _chunkURDFDRHRcjs.createContext; exports.createEffect = _chunk3U7EBKEUcjs.createEffect; exports.createElement = _chunk3U7EBKEUcjs.createElement; exports.createMemo = _chunk3U7EBKEUcjs.createMemo; exports.createPortal = _chunk3U7EBKEUcjs.createPortal; exports.createRef = createRef; exports.createRoot = _chunk3U7EBKEUcjs.createRoot; exports.createSuspenseToken = createSuspenseToken; exports.hasContext = _chunkURDFDRHRcjs.hasContext; exports.mergeProps = _chunk3U7EBKEUcjs.mergeProps; exports.onCleanup = _chunk3U7EBKEUcjs.onCleanup; exports.onDestroy = _chunk3U7EBKEUcjs.onDestroy; exports.onMount = _chunk3U7EBKEUcjs.onMount; exports.prop = _chunk3U7EBKEUcjs.prop; exports.render = _chunk3U7EBKEUcjs.render; exports.startTransition = _chunk3U7EBKEUcjs.startTransition; exports.untrack = _chunk3U7EBKEUcjs.untrack2; exports.useContext = _chunkURDFDRHRcjs.useContext; exports.useDeferredValue = _chunk3U7EBKEUcjs.useDeferredValue; exports.useTransition = _chunk3U7EBKEUcjs.useTransition;
|
|
288
288
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.dev.js
CHANGED
|
@@ -2601,8 +2601,10 @@ var setProperty = (el, key, value) => {
|
|
|
2601
2601
|
el[key] = value;
|
|
2602
2602
|
};
|
|
2603
2603
|
var setInnerHTML = (el, _key, value) => {
|
|
2604
|
-
;
|
|
2605
|
-
|
|
2604
|
+
const next = value == null ? "" : String(value);
|
|
2605
|
+
const node = el;
|
|
2606
|
+
if (node.innerHTML === next) return;
|
|
2607
|
+
node.innerHTML = next;
|
|
2606
2608
|
};
|
|
2607
2609
|
var setBoolAttribute = (el, key, value) => {
|
|
2608
2610
|
if (value) {
|