@ogygia/core 0.11.2 → 0.11.3
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/server/reversible.js +12 -5
- package/package.json +1 -1
|
@@ -490,9 +490,11 @@ const attr_map = (attrs) => {
|
|
|
490
490
|
* gives (Svelte's children in the light DOM), never in the transform's server form only the
|
|
491
491
|
* component's first hydrate reads (that form, morphed into a live host, left the transform's tree in
|
|
492
492
|
* its light DOM: a site nav collapsed to one unstyled item after an in-place navigation). In a
|
|
493
|
-
* document loaded as one, every one in Svelte-owned markup, and every one with Svelte-owned markup
|
|
494
|
-
* below it (a server-owned host around an island: adopting it would reach into
|
|
495
|
-
*
|
|
493
|
+
* document loaded as one, every one in Svelte-owned markup, and every one with Svelte-owned markup or
|
|
494
|
+
* a hole below it (a server-owned host around an island or a hole: adopting it would reach into a
|
|
495
|
+
* region ogygia hydrates or swaps — a web component relocating its slotted children moved a hole's
|
|
496
|
+
* fallback twice, and its tabs kept a second copy of a document listener). A first pass, so the
|
|
497
|
+
* marking pass knows a host's plan before it reaches the host's children.
|
|
496
498
|
*/
|
|
497
499
|
function plan_hosts(html, kind, csr, answer) {
|
|
498
500
|
const planned = [];
|
|
@@ -507,13 +509,18 @@ function plan_hosts(html, kind, csr, answer) {
|
|
|
507
509
|
const parent = stack[stack.length - 1];
|
|
508
510
|
const foreign = name === "svg" || name === "math" || !!parent?.foreign;
|
|
509
511
|
let owned = name === "body" && kind === "document" && csr || (parent ? parent.owned : false);
|
|
510
|
-
|
|
512
|
+
let swapped = false;
|
|
513
|
+
if (name === "ogygia-region") {
|
|
514
|
+
const region = region_kind(parse_attrs(html, tok.name_end, tok.end - 1));
|
|
515
|
+
owned = region === "island";
|
|
516
|
+
swapped = region === "hole";
|
|
517
|
+
}
|
|
511
518
|
let host = -1;
|
|
512
519
|
if (in_body && is_custom(name, foreign)) {
|
|
513
520
|
host = planned.length;
|
|
514
521
|
planned.push(answer || kind !== "document" || owned);
|
|
515
522
|
}
|
|
516
|
-
if (owned && !(parent ? parent.owned : false)) {
|
|
523
|
+
if ((owned || swapped) && !(parent ? parent.owned : false)) {
|
|
517
524
|
for (const f of stack) if (f.host !== -1) planned[f.host] = true;
|
|
518
525
|
}
|
|
519
526
|
if (!(VOID.has(name) || tok.self && foreign)) push(stack, {
|