@lightspeed-js/core 0.2.0 → 0.3.1
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/index.js +5 -2
- package/dist/ssg.js +1312 -14
- package/dist/types/src/marker.d.ts +2 -0
- package/dist/types/src/project/component-ids.d.ts +47 -0
- package/dist/types/src/project/components.d.ts +61 -0
- package/dist/types/src/ssg/fragment.d.ts +61 -0
- package/dist/types/src/ssg/index.d.ts +2 -0
- package/dist/types/src/vite/plugin.d.ts +16 -0
- package/dist/types/test/fragment.test.d.ts +1 -0
- package/dist/vite.js +3979 -3911
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1269,10 +1269,13 @@ function findMarkerEnd(nodes, start) {
|
|
|
1269
1269
|
}
|
|
1270
1270
|
return -1;
|
|
1271
1271
|
}
|
|
1272
|
+
function isSlotStash(node) {
|
|
1273
|
+
return node.nodeType === 1 && node.tagName === "TEMPLATE" && node.hasAttribute("data-lsp-slot");
|
|
1274
|
+
}
|
|
1272
1275
|
function slotNodesFor(payload, between) {
|
|
1273
1276
|
if (!payload.ssr)
|
|
1274
1277
|
return between;
|
|
1275
|
-
const stash = between.find(
|
|
1278
|
+
const stash = between.find(isSlotStash);
|
|
1276
1279
|
return stash ? Array.from(stash.content.childNodes) : [];
|
|
1277
1280
|
}
|
|
1278
1281
|
|
|
@@ -2061,7 +2064,7 @@ class Mounter {
|
|
|
2061
2064
|
return islands;
|
|
2062
2065
|
}
|
|
2063
2066
|
async mountRange(range, props, slotNodes) {
|
|
2064
|
-
const child = await this.mount(range.payload.c, null, props, slotNodes, undefined, range.payload.ssr ? nodesBetween(range.start, range.end) : undefined, range.payload.ssr ? () => this.rescueRendered(range) : undefined);
|
|
2067
|
+
const child = await this.mount(range.payload.c, null, props, slotNodes, undefined, range.payload.ssr ? nodesBetween(range.start, range.end).filter((node) => !isSlotStash(node)) : undefined, range.payload.ssr ? () => this.rescueRendered(range) : undefined);
|
|
2065
2068
|
if (!child)
|
|
2066
2069
|
return null;
|
|
2067
2070
|
const root = child.rootNodes.find((node) => node.nodeType === 1);
|