@kubb/react-fabric 0.0.0 → 0.1.0
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/devtools.cjs +154 -85
- package/dist/devtools.cjs.map +1 -1
- package/dist/devtools.js +154 -85
- package/dist/devtools.js.map +1 -1
- package/dist/{globals-C6rGETh5.d.ts → globals-BQ_tJj2b.d.ts} +3 -3
- package/dist/{globals-CnATk-Sl.d.cts → globals-C-9ezLk9.d.cts} +3 -3
- package/dist/globals.d.cts +2 -2
- package/dist/globals.d.ts +2 -2
- package/dist/index.cjs +47 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -52
- package/dist/index.d.ts +63 -52
- package/dist/index.js +47 -72
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.cjs +15 -7
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/{jsx-dev-runtime.d.ts → jsx-runtime.d.cts} +3 -3
- package/dist/{jsx-dev-runtime.d.cts → jsx-runtime.d.ts} +3 -3
- package/dist/jsx-runtime.js +12 -4
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/{types-C3p0Ljxf.d.cts → types-CUKR3KZn.d.cts} +1 -1
- package/dist/{types-DEroxUW0.d.ts → types-D9OfSq91.d.ts} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +9 -7
- package/src/ReactTemplate.tsx +22 -24
- package/src/components/Const.tsx +4 -17
- package/src/components/File.tsx +1 -1
- package/src/components/Function.tsx +6 -38
- package/src/components/Root.tsx +5 -9
- package/src/components/Type.tsx +1 -7
- package/src/{hooks → composables}/useApp.ts +2 -2
- package/src/createApp.ts +4 -9
- package/src/dom.ts +5 -3
- package/src/globals.ts +1 -1
- package/src/index.ts +3 -4
- package/src/utils/processFiles.ts +1 -1
- package/src/utils/squashExportNodes.ts +1 -1
- package/src/utils/squashImportNodes.ts +1 -1
- package/src/utils/squashSourceNodes.ts +1 -1
- package/dist/jsx-dev-runtime.cjs +0 -9
- package/dist/jsx-dev-runtime.js +0 -6
- package/dist/jsx-runtime-DmD5u6a-.js +0 -13
- package/dist/jsx-runtime-DmD5u6a-.js.map +0 -1
- package/dist/jsx-runtime-zKfRQHQD.cjs +0 -36
- package/dist/jsx-runtime-zKfRQHQD.cjs.map +0 -1
- package/src/components/Text.tsx +0 -31
- package/src/utils/throttle.ts +0 -30
- /package/src/{hooks → composables}/useFile.ts +0 -0
- /package/src/{hooks → composables}/useLifecycle.tsx +0 -0
package/dist/devtools.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as __commonJS, r as __toESM, t as require_react } from "./react-BBkwFtZV.js";
|
|
2
2
|
import { WebSocketServer } from "ws";
|
|
3
3
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/react-devtools-inline@7.0.
|
|
5
|
-
var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react-devtools-inline@7.0.
|
|
4
|
+
//#region ../../node_modules/.pnpm/react-devtools-inline@7.0.1/node_modules/react-devtools-inline/dist/backend.js
|
|
5
|
+
var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react-devtools-inline@7.0.1/node_modules/react-devtools-inline/dist/backend.js": ((exports, module) => {
|
|
6
6
|
(() => {
|
|
7
7
|
var __webpack_modules__ = {
|
|
8
8
|
3018: ((module$1, __unused_webpack_exports, __webpack_require__$1) => {
|
|
@@ -2076,6 +2076,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
2076
2076
|
return isReactNativeEnvironment() ? showOverlayNative(elements, agent$1) : showOverlayWeb(elements, componentName, agent$1, hideAfterTimeout);
|
|
2077
2077
|
}
|
|
2078
2078
|
let iframesListeningTo = /* @__PURE__ */ new Set();
|
|
2079
|
+
let inspectOnlySuspenseNodes = false;
|
|
2079
2080
|
function setupHighlighter(bridge$1, agent$1) {
|
|
2080
2081
|
bridge$1.addListener("clearHostInstanceHighlight", clearHostInstanceHighlight);
|
|
2081
2082
|
bridge$1.addListener("highlightHostInstance", highlightHostInstance);
|
|
@@ -2084,7 +2085,8 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
2084
2085
|
bridge$1.addListener("shutdown", stopInspectingHost);
|
|
2085
2086
|
bridge$1.addListener("startInspectingHost", startInspectingHost);
|
|
2086
2087
|
bridge$1.addListener("stopInspectingHost", stopInspectingHost);
|
|
2087
|
-
function startInspectingHost() {
|
|
2088
|
+
function startInspectingHost(onlySuspenseNodes) {
|
|
2089
|
+
inspectOnlySuspenseNodes = onlySuspenseNodes;
|
|
2088
2090
|
registerListenersOnWindow(window);
|
|
2089
2091
|
}
|
|
2090
2092
|
function registerListenersOnWindow(window$1) {
|
|
@@ -2267,16 +2269,32 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
2267
2269
|
}
|
|
2268
2270
|
} catch (error) {}
|
|
2269
2271
|
}
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
+
if (inspectOnlySuspenseNodes) {
|
|
2273
|
+
const match = agent$1.getIDForHostInstance(target, inspectOnlySuspenseNodes);
|
|
2274
|
+
if (match !== null) {
|
|
2275
|
+
const renderer = agent$1.rendererInterfaces[match.rendererID];
|
|
2276
|
+
if (renderer == null) {
|
|
2277
|
+
console.warn(`Invalid renderer id "${match.rendererID}" for element "${match.id}"`);
|
|
2278
|
+
return;
|
|
2279
|
+
}
|
|
2280
|
+
highlightHostInstance({
|
|
2281
|
+
displayName: renderer.getDisplayNameForElementID(match.id),
|
|
2282
|
+
hideAfterTimeout: false,
|
|
2283
|
+
id: match.id,
|
|
2284
|
+
openBuiltinElementsPanel: false,
|
|
2285
|
+
rendererID: match.rendererID,
|
|
2286
|
+
scrollIntoView: false
|
|
2287
|
+
});
|
|
2288
|
+
}
|
|
2289
|
+
} else showOverlay([target], null, agent$1, false);
|
|
2272
2290
|
}
|
|
2273
2291
|
function onPointerUp(event) {
|
|
2274
2292
|
event.preventDefault();
|
|
2275
2293
|
event.stopPropagation();
|
|
2276
2294
|
}
|
|
2277
2295
|
const selectElementForNode = (node) => {
|
|
2278
|
-
const
|
|
2279
|
-
if (
|
|
2296
|
+
const match = agent$1.getIDForHostInstance(node, inspectOnlySuspenseNodes);
|
|
2297
|
+
if (match !== null) bridge$1.send("selectElement", match.id);
|
|
2280
2298
|
};
|
|
2281
2299
|
function getEventTarget(event) {
|
|
2282
2300
|
if (event.composed) return event.composedPath()[0];
|
|
@@ -2766,7 +2784,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
2766
2784
|
else renderer.deletePath(type, id, hookID, path);
|
|
2767
2785
|
});
|
|
2768
2786
|
agent_defineProperty(this, "getBackendVersion", () => {
|
|
2769
|
-
this._bridge.send("backendVersion", "7.0.
|
|
2787
|
+
this._bridge.send("backendVersion", "7.0.1-3cde211b0c");
|
|
2770
2788
|
});
|
|
2771
2789
|
agent_defineProperty(this, "getBridgeProtocol", () => {
|
|
2772
2790
|
this._bridge.send("bridgeProtocol", currentBridgeProtocol);
|
|
@@ -3116,19 +3134,23 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
3116
3134
|
}
|
|
3117
3135
|
return renderer.getInstanceAndStyle(id);
|
|
3118
3136
|
}
|
|
3119
|
-
getIDForHostInstance(target) {
|
|
3137
|
+
getIDForHostInstance(target, onlySuspenseNodes) {
|
|
3120
3138
|
if (isReactNativeEnvironment() || typeof target.nodeType !== "number") {
|
|
3121
3139
|
for (const rendererID in this._rendererInterfaces) {
|
|
3122
3140
|
const renderer = this._rendererInterfaces[rendererID];
|
|
3123
3141
|
try {
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3142
|
+
const id = onlySuspenseNodes ? renderer.getSuspenseNodeIDForHostInstance(target) : renderer.getElementIDForHostInstance(target);
|
|
3143
|
+
if (id !== null) return {
|
|
3144
|
+
id,
|
|
3145
|
+
rendererID: +rendererID
|
|
3146
|
+
};
|
|
3126
3147
|
} catch (error) {}
|
|
3127
3148
|
}
|
|
3128
3149
|
return null;
|
|
3129
3150
|
} else {
|
|
3130
3151
|
let bestMatch = null;
|
|
3131
3152
|
let bestRenderer = null;
|
|
3153
|
+
let bestRendererID = 0;
|
|
3132
3154
|
for (const rendererID in this._rendererInterfaces) {
|
|
3133
3155
|
const renderer = this._rendererInterfaces[rendererID];
|
|
3134
3156
|
const nearestNode = renderer.getNearestMountedDOMNode(target);
|
|
@@ -3136,58 +3158,34 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
3136
3158
|
if (nearestNode === target) {
|
|
3137
3159
|
bestMatch = nearestNode;
|
|
3138
3160
|
bestRenderer = renderer;
|
|
3161
|
+
bestRendererID = +rendererID;
|
|
3139
3162
|
break;
|
|
3140
3163
|
}
|
|
3141
3164
|
if (bestMatch === null || bestMatch.contains(nearestNode)) {
|
|
3142
3165
|
bestMatch = nearestNode;
|
|
3143
3166
|
bestRenderer = renderer;
|
|
3167
|
+
bestRendererID = +rendererID;
|
|
3144
3168
|
}
|
|
3145
3169
|
}
|
|
3146
3170
|
}
|
|
3147
3171
|
if (bestRenderer != null && bestMatch != null) try {
|
|
3148
|
-
|
|
3172
|
+
const id = onlySuspenseNodes ? bestRenderer.getSuspenseNodeIDForHostInstance(bestMatch) : bestRenderer.getElementIDForHostInstance(bestMatch);
|
|
3173
|
+
if (id !== null) return {
|
|
3174
|
+
id,
|
|
3175
|
+
rendererID: bestRendererID
|
|
3176
|
+
};
|
|
3149
3177
|
} catch (error) {}
|
|
3150
3178
|
return null;
|
|
3151
3179
|
}
|
|
3152
3180
|
}
|
|
3153
3181
|
getComponentNameForHostInstance(target) {
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
try {
|
|
3158
|
-
const id = renderer.getElementIDForHostInstance(target);
|
|
3159
|
-
if (id) return renderer.getDisplayNameForElementID(id);
|
|
3160
|
-
} catch (error) {}
|
|
3161
|
-
}
|
|
3162
|
-
return null;
|
|
3163
|
-
} else {
|
|
3164
|
-
let bestMatch = null;
|
|
3165
|
-
let bestRenderer = null;
|
|
3166
|
-
for (const rendererID in this._rendererInterfaces) {
|
|
3167
|
-
const renderer = this._rendererInterfaces[rendererID];
|
|
3168
|
-
const nearestNode = renderer.getNearestMountedDOMNode(target);
|
|
3169
|
-
if (nearestNode !== null) {
|
|
3170
|
-
if (nearestNode === target) {
|
|
3171
|
-
bestMatch = nearestNode;
|
|
3172
|
-
bestRenderer = renderer;
|
|
3173
|
-
break;
|
|
3174
|
-
}
|
|
3175
|
-
if (bestMatch === null || bestMatch.contains(nearestNode)) {
|
|
3176
|
-
bestMatch = nearestNode;
|
|
3177
|
-
bestRenderer = renderer;
|
|
3178
|
-
}
|
|
3179
|
-
}
|
|
3180
|
-
}
|
|
3181
|
-
if (bestRenderer != null && bestMatch != null) try {
|
|
3182
|
-
const id = bestRenderer.getElementIDForHostInstance(bestMatch);
|
|
3183
|
-
if (id) return bestRenderer.getDisplayNameForElementID(id);
|
|
3184
|
-
} catch (error) {}
|
|
3185
|
-
return null;
|
|
3186
|
-
}
|
|
3182
|
+
const match = this.getIDForHostInstance(target);
|
|
3183
|
+
if (match !== null) return this._rendererInterfaces[match.rendererID].getDisplayNameForElementID(match.id);
|
|
3184
|
+
return null;
|
|
3187
3185
|
}
|
|
3188
3186
|
selectNode(target) {
|
|
3189
|
-
const
|
|
3190
|
-
if (
|
|
3187
|
+
const match = this.getIDForHostInstance(target);
|
|
3188
|
+
if (match !== null) this._bridge.send("selectElement", match.id);
|
|
3191
3189
|
}
|
|
3192
3190
|
registerRendererInterface(rendererID, rendererInterface) {
|
|
3193
3191
|
this._rendererInterfaces[rendererID] = rendererInterface;
|
|
@@ -3542,6 +3540,9 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
3542
3540
|
getElementIDForHostInstance() {
|
|
3543
3541
|
return null;
|
|
3544
3542
|
},
|
|
3543
|
+
getSuspenseNodeIDForHostInstance() {
|
|
3544
|
+
return null;
|
|
3545
|
+
},
|
|
3545
3546
|
getInstanceAndStyle() {
|
|
3546
3547
|
return {
|
|
3547
3548
|
instance: null,
|
|
@@ -4839,8 +4840,6 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
4839
4840
|
"--color-timeline-text-dim-color": "#ccc",
|
|
4840
4841
|
"--color-timeline-react-work-border": "#eeeeee",
|
|
4841
4842
|
"--color-timebar-background": "#f6f6f6",
|
|
4842
|
-
"--color-timespan-background": "#62bc6a",
|
|
4843
|
-
"--color-timespan-background-errored": "#d57066",
|
|
4844
4843
|
"--color-search-match": "yellow",
|
|
4845
4844
|
"--color-search-match-current": "#f7923b",
|
|
4846
4845
|
"--color-selected-tree-highlight-active": "rgba(0, 136, 250, 0.1)",
|
|
@@ -4858,6 +4857,13 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
4858
4857
|
"--color-warning-background-hover": "#f82042",
|
|
4859
4858
|
"--color-warning-text-color": "#ffffff",
|
|
4860
4859
|
"--color-warning-text-color-inverted": "#fd4d69",
|
|
4860
|
+
"--color-suspense-default": "#0088fa",
|
|
4861
|
+
"--color-transition-default": "#6a51b2",
|
|
4862
|
+
"--color-suspense-server": "#62bc6a",
|
|
4863
|
+
"--color-transition-server": "#3f7844",
|
|
4864
|
+
"--color-suspense-other": "#f3ce49",
|
|
4865
|
+
"--color-transition-other": "#917b2c",
|
|
4866
|
+
"--color-suspense-errored": "#d57066",
|
|
4861
4867
|
"--color-scroll-thumb": "#c2c2c2",
|
|
4862
4868
|
"--color-scroll-track": "#fafafa",
|
|
4863
4869
|
"--color-tooltip-background": "rgba(0, 0, 0, 0.9)",
|
|
@@ -4987,8 +4993,6 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
4987
4993
|
"--color-timeline-text-dim-color": "#555b66",
|
|
4988
4994
|
"--color-timeline-react-work-border": "#3d424a",
|
|
4989
4995
|
"--color-timebar-background": "#1d2129",
|
|
4990
|
-
"--color-timespan-background": "#62bc6a",
|
|
4991
|
-
"--color-timespan-background-errored": "#d57066",
|
|
4992
4996
|
"--color-search-match": "yellow",
|
|
4993
4997
|
"--color-search-match-current": "#f7923b",
|
|
4994
4998
|
"--color-selected-tree-highlight-active": "rgba(23, 143, 185, 0.15)",
|
|
@@ -5007,6 +5011,13 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
5007
5011
|
"--color-warning-background-hover": "#da1030",
|
|
5008
5012
|
"--color-warning-text-color": "#ffffff",
|
|
5009
5013
|
"--color-warning-text-color-inverted": "#ee1638",
|
|
5014
|
+
"--color-suspense-default": "#61dafb",
|
|
5015
|
+
"--color-transition-default": "#6a51b2",
|
|
5016
|
+
"--color-suspense-server": "#62bc6a",
|
|
5017
|
+
"--color-transition-server": "#3f7844",
|
|
5018
|
+
"--color-suspense-other": "#f3ce49",
|
|
5019
|
+
"--color-transition-other": "#917b2c",
|
|
5020
|
+
"--color-suspense-errored": "#d57066",
|
|
5010
5021
|
"--color-scroll-thumb": "#afb3b9",
|
|
5011
5022
|
"--color-scroll-track": "#313640",
|
|
5012
5023
|
"--color-tooltip-background": "rgba(255, 255, 255, 0.95)",
|
|
@@ -6418,7 +6429,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6418
6429
|
const numUnmountIDs = pendingRealUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1);
|
|
6419
6430
|
const numUnmountSuspenseIDs = pendingRealUnmountedSuspenseIDs.length;
|
|
6420
6431
|
const numSuspenderChanges = pendingSuspenderChanges.size;
|
|
6421
|
-
const operations = new Array(3 + pendingStringTableLength + (numUnmountSuspenseIDs > 0 ? 2 + numUnmountSuspenseIDs : 0) + (numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + pendingOperations.length + (numSuspenderChanges > 0 ? 2 + numSuspenderChanges *
|
|
6432
|
+
const operations = new Array(3 + pendingStringTableLength + (numUnmountSuspenseIDs > 0 ? 2 + numUnmountSuspenseIDs : 0) + (numUnmountIDs > 0 ? 2 + numUnmountIDs : 0) + pendingOperations.length + (numSuspenderChanges > 0 ? 2 + numSuspenderChanges * 3 : 0));
|
|
6422
6433
|
let i = 0;
|
|
6423
6434
|
operations[i++] = rendererID;
|
|
6424
6435
|
if (currentRoot === null) operations[i++] = -1;
|
|
@@ -6455,6 +6466,9 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6455
6466
|
if (suspense === void 0) throw new Error(`Could not send suspender changes for "${fiberIdWithChanges}" since the Fiber no longer exists.`);
|
|
6456
6467
|
operations[i++] = fiberIdWithChanges;
|
|
6457
6468
|
operations[i++] = suspense.hasUniqueSuspenders ? 1 : 0;
|
|
6469
|
+
const instance = suspense.instance;
|
|
6470
|
+
const isSuspended = (instance.kind === FIBER_INSTANCE || instance.kind === FILTERED_FIBER_INSTANCE) && instance.data.tag === SuspenseComponent && instance.data.memoizedState !== null;
|
|
6471
|
+
operations[i++] = isSuspended ? 1 : 0;
|
|
6458
6472
|
operations[i++] = suspense.environments.size;
|
|
6459
6473
|
suspense.environments.forEach((count, env) => {
|
|
6460
6474
|
operations[i++] = getStringID(env);
|
|
@@ -6472,7 +6486,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6472
6486
|
}
|
|
6473
6487
|
function measureHostInstance(instance) {
|
|
6474
6488
|
if (typeof instance !== "object" || instance === null) return null;
|
|
6475
|
-
if (typeof instance.getClientRects === "function") {
|
|
6489
|
+
if (typeof instance.getClientRects === "function" || instance.nodeType === 3) {
|
|
6476
6490
|
const doc = instance.ownerDocument;
|
|
6477
6491
|
if (instance === doc.documentElement) return [{
|
|
6478
6492
|
x: 0,
|
|
@@ -6484,7 +6498,14 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6484
6498
|
const win = doc && doc.defaultView;
|
|
6485
6499
|
const scrollX = win ? win.scrollX : 0;
|
|
6486
6500
|
const scrollY = win ? win.scrollY : 0;
|
|
6487
|
-
|
|
6501
|
+
let rects;
|
|
6502
|
+
if (instance.nodeType === 3) {
|
|
6503
|
+
if (typeof doc.createRange !== "function") return null;
|
|
6504
|
+
const range = doc.createRange();
|
|
6505
|
+
if (typeof range.getClientRects !== "function") return null;
|
|
6506
|
+
range.selectNodeContents(instance);
|
|
6507
|
+
rects = range.getClientRects();
|
|
6508
|
+
} else rects = instance.getClientRects();
|
|
6488
6509
|
for (let i = 0; i < rects.length; i++) {
|
|
6489
6510
|
const rect = rects[i];
|
|
6490
6511
|
result.push({
|
|
@@ -6655,23 +6676,26 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6655
6676
|
const unfilteredParentInstance = unfilteredParent !== null ? unfilteredParent.instance : null;
|
|
6656
6677
|
if (unfilteredParentInstance !== null && unfilteredParentInstance.kind === FILTERED_FIBER_INSTANCE) throw new Error("Should not have a filtered instance at this point. This is a bug.");
|
|
6657
6678
|
const parentID = unfilteredParentInstance === null ? 0 : unfilteredParentInstance.id;
|
|
6658
|
-
const
|
|
6659
|
-
const
|
|
6679
|
+
const fiber = fiberInstance.data;
|
|
6680
|
+
const props = fiber.memoizedProps;
|
|
6681
|
+
const nameStringID = getStringID(fiber.tag !== SuspenseComponent || props === null ? null : props.name || null);
|
|
6682
|
+
const isSuspended = fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
|
|
6660
6683
|
idToSuspenseNodeMap.set(fiberID, suspenseInstance);
|
|
6661
6684
|
pushOperation(SUSPENSE_TREE_OPERATION_ADD);
|
|
6662
6685
|
pushOperation(fiberID);
|
|
6663
6686
|
pushOperation(parentID);
|
|
6664
6687
|
pushOperation(nameStringID);
|
|
6688
|
+
pushOperation(isSuspended ? 1 : 0);
|
|
6665
6689
|
const rects = suspenseInstance.rects;
|
|
6666
6690
|
if (rects === null) pushOperation(-1);
|
|
6667
6691
|
else {
|
|
6668
6692
|
pushOperation(rects.length);
|
|
6669
6693
|
for (let i = 0; i < rects.length; ++i) {
|
|
6670
6694
|
const rect = rects[i];
|
|
6671
|
-
pushOperation(Math.round(rect.x));
|
|
6672
|
-
pushOperation(Math.round(rect.y));
|
|
6673
|
-
pushOperation(Math.round(rect.width));
|
|
6674
|
-
pushOperation(Math.round(rect.height));
|
|
6695
|
+
pushOperation(Math.round(rect.x * 1e3));
|
|
6696
|
+
pushOperation(Math.round(rect.y * 1e3));
|
|
6697
|
+
pushOperation(Math.round(rect.width * 1e3));
|
|
6698
|
+
pushOperation(Math.round(rect.height * 1e3));
|
|
6675
6699
|
}
|
|
6676
6700
|
}
|
|
6677
6701
|
}
|
|
@@ -6701,10 +6725,10 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6701
6725
|
pushOperation(rects.length);
|
|
6702
6726
|
for (let i = 0; i < rects.length; ++i) {
|
|
6703
6727
|
const rect = rects[i];
|
|
6704
|
-
pushOperation(Math.round(rect.x));
|
|
6705
|
-
pushOperation(Math.round(rect.y));
|
|
6706
|
-
pushOperation(Math.round(rect.width));
|
|
6707
|
-
pushOperation(Math.round(rect.height));
|
|
6728
|
+
pushOperation(Math.round(rect.x * 1e3));
|
|
6729
|
+
pushOperation(Math.round(rect.y * 1e3));
|
|
6730
|
+
pushOperation(Math.round(rect.width * 1e3));
|
|
6731
|
+
pushOperation(Math.round(rect.height * 1e3));
|
|
6708
6732
|
}
|
|
6709
6733
|
}
|
|
6710
6734
|
}
|
|
@@ -6742,7 +6766,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6742
6766
|
if (reconcilingParent === null || reconcilingParentSuspenseNode === null) throw new Error("It should not be possible to have suspended data outside the root. Even suspending at the first position is still a child of the root.");
|
|
6743
6767
|
const parentSuspenseNode = reconcilingParentSuspenseNode;
|
|
6744
6768
|
let parentInstance = reconcilingParent;
|
|
6745
|
-
while (parentInstance.kind === FILTERED_FIBER_INSTANCE && parentInstance.parent !== null) parentInstance = parentInstance.parent;
|
|
6769
|
+
while (parentInstance.kind === FILTERED_FIBER_INSTANCE && parentInstance.parent !== null && parentInstance !== parentSuspenseNode.instance) parentInstance = parentInstance.parent;
|
|
6746
6770
|
const suspenseNodeSuspendedBy = parentSuspenseNode.suspendedBy;
|
|
6747
6771
|
const ioInfo = asyncInfo.awaited;
|
|
6748
6772
|
let suspendedBySet = suspenseNodeSuspendedBy.get(ioInfo);
|
|
@@ -6907,8 +6931,15 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6907
6931
|
default: return false;
|
|
6908
6932
|
}
|
|
6909
6933
|
}
|
|
6934
|
+
function isSuspendedOffscreen(fiber) {
|
|
6935
|
+
switch (fiber.tag) {
|
|
6936
|
+
case LegacyHiddenComponent:
|
|
6937
|
+
case OffscreenComponent: return fiber.memoizedState !== null && fiber.return !== null && fiber.return.tag === SuspenseComponent;
|
|
6938
|
+
default: return false;
|
|
6939
|
+
}
|
|
6940
|
+
}
|
|
6910
6941
|
function unmountRemainingChildren() {
|
|
6911
|
-
if (reconcilingParent !== null && (reconcilingParent.kind === FIBER_INSTANCE || reconcilingParent.kind === FILTERED_FIBER_INSTANCE) &&
|
|
6942
|
+
if (reconcilingParent !== null && (reconcilingParent.kind === FIBER_INSTANCE || reconcilingParent.kind === FILTERED_FIBER_INSTANCE) && isSuspendedOffscreen(reconcilingParent.data) && !isInDisconnectedSubtree) {
|
|
6912
6943
|
isInDisconnectedSubtree = true;
|
|
6913
6944
|
try {
|
|
6914
6945
|
let child = remainingReconcilingChildren;
|
|
@@ -6956,15 +6987,17 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
6956
6987
|
}
|
|
6957
6988
|
function measureUnchangedSuspenseNodesRecursively(suspenseNode) {
|
|
6958
6989
|
if (isInDisconnectedSubtree) return;
|
|
6959
|
-
const
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
let parent = suspenseNode.instance.parent;
|
|
6990
|
+
const instance = suspenseNode.instance;
|
|
6991
|
+
if ((instance.kind === FIBER_INSTANCE || instance.kind === FILTERED_FIBER_INSTANCE) && instance.data.tag === SuspenseComponent && instance.data.memoizedState !== null) return;
|
|
6992
|
+
let parent = instance.parent;
|
|
6963
6993
|
while (parent !== null) {
|
|
6964
6994
|
if ((parent.kind === FIBER_INSTANCE || parent.kind === FILTERED_FIBER_INSTANCE) && isHiddenOffscreen(parent.data)) return;
|
|
6965
6995
|
if (parent.suspenseNode !== null) break;
|
|
6966
6996
|
parent = parent.parent;
|
|
6967
6997
|
}
|
|
6998
|
+
const nextRects = measureInstance(suspenseNode.instance);
|
|
6999
|
+
const prevRects = suspenseNode.rects;
|
|
7000
|
+
if (areEqualRects(prevRects, nextRects)) return;
|
|
6968
7001
|
for (let child = suspenseNode.firstChild; child !== null; child = child.nextSibling) measureUnchangedSuspenseNodesRecursively(child);
|
|
6969
7002
|
suspenseNode.rects = nextRects;
|
|
6970
7003
|
recordSuspenseResize(suspenseNode);
|
|
@@ -7293,7 +7326,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7293
7326
|
aquireHostInstance(nearestInstance, fiber.stateNode);
|
|
7294
7327
|
trackDebugInfoFromHostComponent(nearestInstance, fiber);
|
|
7295
7328
|
}
|
|
7296
|
-
if (
|
|
7329
|
+
if (isSuspendedOffscreen(fiber)) {
|
|
7297
7330
|
const stashedDisconnected = isInDisconnectedSubtree;
|
|
7298
7331
|
isInDisconnectedSubtree = true;
|
|
7299
7332
|
try {
|
|
@@ -7301,7 +7334,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7301
7334
|
} finally {
|
|
7302
7335
|
isInDisconnectedSubtree = stashedDisconnected;
|
|
7303
7336
|
}
|
|
7304
|
-
} else if (fiber.tag === SuspenseComponent && OffscreenComponent === -1) {
|
|
7337
|
+
} else if (isHiddenOffscreen(fiber)) {} else if (fiber.tag === SuspenseComponent && OffscreenComponent === -1) {
|
|
7305
7338
|
if (newSuspenseNode !== null) trackThrownPromisesFromRetryCache(newSuspenseNode, fiber.stateNode);
|
|
7306
7339
|
if (fiber.memoizedState !== null) {
|
|
7307
7340
|
const primaryChildFragment = fiber.child;
|
|
@@ -7694,8 +7727,14 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7694
7727
|
const nextDidTimeOut = isLegacySuspense && nextFiber.memoizedState !== null;
|
|
7695
7728
|
const prevWasHidden = isHiddenOffscreen(prevFiber);
|
|
7696
7729
|
const nextIsHidden = isHiddenOffscreen(nextFiber);
|
|
7730
|
+
const prevWasSuspended = isSuspendedOffscreen(prevFiber);
|
|
7731
|
+
const nextIsSuspended = isSuspendedOffscreen(nextFiber);
|
|
7697
7732
|
if (isLegacySuspense) {
|
|
7698
|
-
if (fiberInstance !== null && fiberInstance.suspenseNode !== null
|
|
7733
|
+
if (fiberInstance !== null && fiberInstance.suspenseNode !== null) {
|
|
7734
|
+
const suspenseNode = fiberInstance.suspenseNode;
|
|
7735
|
+
if (prevFiber.stateNode === null !== (nextFiber.stateNode === null)) trackThrownPromisesFromRetryCache(suspenseNode, nextFiber.stateNode);
|
|
7736
|
+
if (prevFiber.memoizedState === null !== (nextFiber.memoizedState === null)) recordSuspenseSuspenders(suspenseNode);
|
|
7737
|
+
}
|
|
7699
7738
|
}
|
|
7700
7739
|
if (prevDidTimeout && nextDidTimeOut) {
|
|
7701
7740
|
const nextFiberChild = nextFiber.child;
|
|
@@ -7721,8 +7760,8 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7721
7760
|
mountChildrenRecursively(nextFallbackChildSet, traceNearestHostComponentUpdate);
|
|
7722
7761
|
updateFlags |= ShouldResetChildren | ShouldResetSuspenseChildren;
|
|
7723
7762
|
}
|
|
7724
|
-
} else if (
|
|
7725
|
-
if (!
|
|
7763
|
+
} else if (nextIsSuspended) {
|
|
7764
|
+
if (!prevWasSuspended) {
|
|
7726
7765
|
if (fiberInstance !== null && !isInDisconnectedSubtree) disconnectChildrenRecursively(remainingReconcilingChildren);
|
|
7727
7766
|
}
|
|
7728
7767
|
const stashedDisconnected = isInDisconnectedSubtree;
|
|
@@ -7732,7 +7771,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7732
7771
|
} finally {
|
|
7733
7772
|
isInDisconnectedSubtree = stashedDisconnected;
|
|
7734
7773
|
}
|
|
7735
|
-
} else if (
|
|
7774
|
+
} else if (prevWasSuspended && !nextIsSuspended) {
|
|
7736
7775
|
const stashedDisconnected = isInDisconnectedSubtree;
|
|
7737
7776
|
isInDisconnectedSubtree = true;
|
|
7738
7777
|
try {
|
|
@@ -7746,7 +7785,8 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7746
7785
|
reconnectChildrenRecursively(fiberInstance);
|
|
7747
7786
|
updateFlags |= ShouldResetChildren | ShouldResetSuspenseChildren;
|
|
7748
7787
|
}
|
|
7749
|
-
} else if (
|
|
7788
|
+
} else if (nextIsHidden) if (prevWasHidden) {} else unmountRemainingChildren();
|
|
7789
|
+
else if (nextFiber.tag === SuspenseComponent && OffscreenComponent !== -1 && fiberInstance !== null && fiberInstance.suspenseNode !== null) {
|
|
7750
7790
|
const suspenseNode = fiberInstance.suspenseNode;
|
|
7751
7791
|
const prevContentFiber = prevFiber.child;
|
|
7752
7792
|
const nextContentFiber = nextFiber.child;
|
|
@@ -7755,6 +7795,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7755
7795
|
if (previousHydrated && nextHydrated) {
|
|
7756
7796
|
if (nextContentFiber === null || prevContentFiber === null) throw new Error("There should always be an Offscreen Fiber child in a hydrated Suspense boundary.");
|
|
7757
7797
|
if (prevFiber.stateNode === null !== (nextFiber.stateNode === null)) trackThrownPromisesFromRetryCache(suspenseNode, nextFiber.stateNode);
|
|
7798
|
+
if (prevFiber.memoizedState === null !== (nextFiber.memoizedState === null)) recordSuspenseSuspenders(suspenseNode);
|
|
7758
7799
|
shouldMeasureSuspenseNode = false;
|
|
7759
7800
|
updateFlags |= updateSuspenseChildrenRecursively(nextContentFiber, prevContentFiber, traceNearestHostComponentUpdate, stashedSuspenseParent, stashedSuspensePrevious, stashedSuspenseRemaining);
|
|
7760
7801
|
shouldPopSuspenseNode = false;
|
|
@@ -7762,6 +7803,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7762
7803
|
} else if (!previousHydrated && nextHydrated) {
|
|
7763
7804
|
if (nextContentFiber === null) throw new Error("There should always be an Offscreen Fiber child in a hydrated Suspense boundary.");
|
|
7764
7805
|
trackThrownPromisesFromRetryCache(suspenseNode, nextFiber.stateNode);
|
|
7806
|
+
recordSuspenseSuspenders(suspenseNode);
|
|
7765
7807
|
mountSuspenseChildrenRecursively(nextContentFiber, traceNearestHostComponentUpdate, stashedSuspenseParent, stashedSuspensePrevious, stashedSuspenseRemaining);
|
|
7766
7808
|
shouldPopSuspenseNode = false;
|
|
7767
7809
|
} else if (previousHydrated && !nextHydrated) throw new Error("Encountered a dehydrated Suspense boundary that was previously hydrated.");
|
|
@@ -7791,7 +7833,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7791
7833
|
}
|
|
7792
7834
|
if ((updateFlags & ShouldResetChildren) !== NoUpdate) {
|
|
7793
7835
|
if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
|
|
7794
|
-
if (!
|
|
7836
|
+
if (!nextIsSuspended && !isInDisconnectedSubtree) recordResetChildren(fiberInstance);
|
|
7795
7837
|
updateFlags &= ~ShouldResetChildren;
|
|
7796
7838
|
}
|
|
7797
7839
|
}
|
|
@@ -7841,7 +7883,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
7841
7883
|
}
|
|
7842
7884
|
function disconnectChildrenRecursively(firstChild) {
|
|
7843
7885
|
for (let child = firstChild; child !== null; child = child.nextSibling) {
|
|
7844
|
-
if ((child.kind === FIBER_INSTANCE || child.kind === FILTERED_FIBER_INSTANCE) &&
|
|
7886
|
+
if ((child.kind === FIBER_INSTANCE || child.kind === FILTERED_FIBER_INSTANCE) && isSuspendedOffscreen(child.data)) {} else disconnectChildrenRecursively(child.firstChild);
|
|
7845
7887
|
if (child.kind === FIBER_INSTANCE) recordDisconnect(child);
|
|
7846
7888
|
else if (child.kind === VIRTUAL_INSTANCE) recordVirtualDisconnect(child);
|
|
7847
7889
|
}
|
|
@@ -8020,8 +8062,18 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
8020
8062
|
function getDisplayNameForElementID(id) {
|
|
8021
8063
|
const devtoolsInstance = idToDevToolsInstanceMap.get(id);
|
|
8022
8064
|
if (devtoolsInstance === void 0) return null;
|
|
8023
|
-
if (devtoolsInstance.kind === FIBER_INSTANCE)
|
|
8024
|
-
|
|
8065
|
+
if (devtoolsInstance.kind === FIBER_INSTANCE) {
|
|
8066
|
+
const fiber = devtoolsInstance.data;
|
|
8067
|
+
if (fiber.tag === HostRoot) return "Initial Paint";
|
|
8068
|
+
if (fiber.tag === SuspenseComponent || fiber.tag === ActivityComponent) {
|
|
8069
|
+
const props = fiber.memoizedProps;
|
|
8070
|
+
if (props.name != null) return props.name;
|
|
8071
|
+
const owner = getUnfilteredOwner(fiber);
|
|
8072
|
+
if (owner != null) if (typeof owner.tag === "number") return getDisplayNameForFiber(owner);
|
|
8073
|
+
else return owner.name || "";
|
|
8074
|
+
}
|
|
8075
|
+
return getDisplayNameForFiber(fiber);
|
|
8076
|
+
} else return devtoolsInstance.data.name || "";
|
|
8025
8077
|
}
|
|
8026
8078
|
function getNearestSuspenseNode(instance) {
|
|
8027
8079
|
while (instance.suspenseNode === null) {
|
|
@@ -8043,6 +8095,18 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
8043
8095
|
}
|
|
8044
8096
|
return null;
|
|
8045
8097
|
}
|
|
8098
|
+
function getSuspenseNodeIDForHostInstance(publicInstance) {
|
|
8099
|
+
const instance = publicInstanceToDevToolsInstanceMap.get(publicInstance);
|
|
8100
|
+
if (instance !== void 0) {
|
|
8101
|
+
let suspenseInstance = instance;
|
|
8102
|
+
while (suspenseInstance.suspenseNode === null || suspenseInstance.kind === FILTERED_FIBER_INSTANCE) {
|
|
8103
|
+
if (suspenseInstance.parent === null) return null;
|
|
8104
|
+
suspenseInstance = suspenseInstance.parent;
|
|
8105
|
+
}
|
|
8106
|
+
return suspenseInstance.id;
|
|
8107
|
+
}
|
|
8108
|
+
return null;
|
|
8109
|
+
}
|
|
8046
8110
|
function getElementAttributeByPath(id, path) {
|
|
8047
8111
|
if (isMostRecentlyInspectedElement(id)) return utils_getInObject(mostRecentlyInspectedElement, path);
|
|
8048
8112
|
}
|
|
@@ -8191,7 +8255,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
8191
8255
|
}
|
|
8192
8256
|
}
|
|
8193
8257
|
const newIO = asyncInfo.awaited;
|
|
8194
|
-
if (newIO.name === "RSC stream" && newIO.value != null) {
|
|
8258
|
+
if ((newIO.name === "RSC stream" || newIO.name === "rsc stream") && newIO.value != null) {
|
|
8195
8259
|
const streamPromise = newIO.value;
|
|
8196
8260
|
const existingEntry = streamEntries.get(streamPromise);
|
|
8197
8261
|
if (existingEntry === void 0) streamEntries.set(streamPromise, {
|
|
@@ -8227,7 +8291,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
8227
8291
|
const ioInfo = asyncInfo.awaited;
|
|
8228
8292
|
if (foundIOEntries.has(ioInfo)) continue;
|
|
8229
8293
|
foundIOEntries.add(ioInfo);
|
|
8230
|
-
if (ioInfo.name === "RSC stream" && ioInfo.value != null) {
|
|
8294
|
+
if ((ioInfo.name === "RSC stream" || ioInfo.name === "rsc stream") && ioInfo.value != null) {
|
|
8231
8295
|
const streamPromise = ioInfo.value;
|
|
8232
8296
|
const existingEntry = streamEntries.get(streamPromise);
|
|
8233
8297
|
if (existingEntry === void 0) streamEntries.set(streamPromise, asyncInfo);
|
|
@@ -9374,6 +9438,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
9374
9438
|
getDisplayNameForElementID,
|
|
9375
9439
|
getNearestMountedDOMNode,
|
|
9376
9440
|
getElementIDForHostInstance,
|
|
9441
|
+
getSuspenseNodeIDForHostInstance,
|
|
9377
9442
|
getInstanceAndStyle,
|
|
9378
9443
|
getOwnersList,
|
|
9379
9444
|
getPathForElement,
|
|
@@ -9624,6 +9689,7 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
9624
9689
|
pushOperation(id);
|
|
9625
9690
|
pushOperation(parentID);
|
|
9626
9691
|
pushOperation(getStringID(null));
|
|
9692
|
+
pushOperation(0);
|
|
9627
9693
|
pushOperation(-1);
|
|
9628
9694
|
} else {
|
|
9629
9695
|
const type = getElementType(internalInstance);
|
|
@@ -10113,6 +10179,9 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
10113
10179
|
getDisplayNameForElementID,
|
|
10114
10180
|
getNearestMountedDOMNode,
|
|
10115
10181
|
getElementIDForHostInstance,
|
|
10182
|
+
getSuspenseNodeIDForHostInstance(id) {
|
|
10183
|
+
return null;
|
|
10184
|
+
},
|
|
10116
10185
|
getInstanceAndStyle,
|
|
10117
10186
|
findHostInstancesForElementID: (id) => {
|
|
10118
10187
|
const hostInstance = findHostInstanceForInternalID(id);
|
|
@@ -10799,8 +10868,8 @@ var require_backend$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/r
|
|
|
10799
10868
|
}) });
|
|
10800
10869
|
|
|
10801
10870
|
//#endregion
|
|
10802
|
-
//#region ../../node_modules/.pnpm/react-devtools-inline@7.0.
|
|
10803
|
-
var require_backend = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react-devtools-inline@7.0.
|
|
10871
|
+
//#region ../../node_modules/.pnpm/react-devtools-inline@7.0.1/node_modules/react-devtools-inline/backend.js
|
|
10872
|
+
var require_backend = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react-devtools-inline@7.0.1/node_modules/react-devtools-inline/backend.js": ((exports, module) => {
|
|
10804
10873
|
module.exports = require_backend$1();
|
|
10805
10874
|
}) });
|
|
10806
10875
|
|