@absolutejs/absolute 0.19.0-beta.326 → 0.19.0-beta.327

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.
@@ -38313,6 +38313,13 @@ var getClaimMap = () => {
38313
38313
  window.__ABS_CLAIMED_ISLAND_MARKUP__ ??= new Map;
38314
38314
  return window.__ABS_CLAIMED_ISLAND_MARKUP__;
38315
38315
  };
38316
+ var getSnapshotMap = () => {
38317
+ if (typeof window === "undefined") {
38318
+ return null;
38319
+ }
38320
+ window.__ABS_SERVER_ISLAND_HTML__ ??= new Map;
38321
+ return window.__ABS_SERVER_ISLAND_HTML__;
38322
+ };
38316
38323
  var getIslandSignature = (props) => {
38317
38324
  const attributes = getIslandMarkerAttributes(props);
38318
38325
  return [
@@ -38329,6 +38336,30 @@ var isMatchingIslandElement = (element2, props) => {
38329
38336
  const attributes = getIslandMarkerAttributes(props);
38330
38337
  return element2.dataset.island === "true" && element2.dataset.component === attributes["data-component"] && element2.dataset.framework === attributes["data-framework"] && (element2.dataset.hydrate ?? "load") === attributes["data-hydrate"] && (element2.dataset.props ?? "{}") === attributes["data-props"];
38331
38338
  };
38339
+ var initializeIslandMarkupSnapshot = () => {
38340
+ if (typeof document === "undefined") {
38341
+ return;
38342
+ }
38343
+ const snapshotMap = getSnapshotMap();
38344
+ if (!snapshotMap || snapshotMap.size > 0) {
38345
+ return;
38346
+ }
38347
+ const elements = Array.from(document.querySelectorAll('[data-island="true"]'));
38348
+ for (const element2 of elements) {
38349
+ if (!(element2 instanceof HTMLElement)) {
38350
+ continue;
38351
+ }
38352
+ const signature = [
38353
+ element2.dataset.component,
38354
+ element2.dataset.framework,
38355
+ element2.dataset.hydrate ?? "load",
38356
+ element2.dataset.props ?? "{}"
38357
+ ].join("::");
38358
+ const existing = snapshotMap.get(signature) ?? [];
38359
+ existing.push(element2.innerHTML);
38360
+ snapshotMap.set(signature, existing);
38361
+ }
38362
+ };
38332
38363
  var preserveIslandMarkup = (props) => {
38333
38364
  if (typeof document === "undefined") {
38334
38365
  return {
@@ -38337,8 +38368,10 @@ var preserveIslandMarkup = (props) => {
38337
38368
  };
38338
38369
  }
38339
38370
  const claimMap = getClaimMap();
38371
+ const snapshotMap = getSnapshotMap();
38340
38372
  const signature = getIslandSignature(props);
38341
38373
  const claimedCount = claimMap?.get(signature) ?? 0;
38374
+ const snapshotCandidate = snapshotMap?.get(signature)?.[claimedCount];
38342
38375
  const candidates = Array.from(document.querySelectorAll('[data-island="true"]')).filter((element2) => isMatchingIslandElement(element2, props));
38343
38376
  const candidate = candidates[claimedCount];
38344
38377
  if (claimMap) {
@@ -38346,7 +38379,7 @@ var preserveIslandMarkup = (props) => {
38346
38379
  }
38347
38380
  return {
38348
38381
  attributes: getIslandMarkerAttributes(props),
38349
- innerHTML: candidate?.innerHTML ?? ""
38382
+ innerHTML: snapshotCandidate ?? candidate?.innerHTML ?? ""
38350
38383
  };
38351
38384
  };
38352
38385
 
@@ -38521,5 +38554,5 @@ export {
38521
38554
  Island
38522
38555
  };
38523
38556
 
38524
- //# debugId=6EBF9C003A02044964756E2164756E21
38557
+ //# debugId=BDD2A8F49709FCFA64756E2164756E21
38525
38558
  //# sourceMappingURL=browser.js.map