@absolutejs/absolute 0.19.0-beta.707 → 0.19.0-beta.708

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.
Files changed (61) hide show
  1. package/dist/angular/browser.js +1 -19
  2. package/dist/angular/browser.js.map +3 -3
  3. package/dist/angular/index.js +85 -28
  4. package/dist/angular/index.js.map +4 -4
  5. package/dist/angular/server.js +85 -28
  6. package/dist/angular/server.js.map +4 -4
  7. package/dist/build.js +224 -137
  8. package/dist/build.js.map +10 -10
  9. package/dist/cli/index.js +44 -25
  10. package/dist/client/index.js +85 -28
  11. package/dist/client/index.js.map +4 -4
  12. package/dist/core/streamingSlotRegistrar.js +1 -19
  13. package/dist/core/streamingSlotRegistrar.js.map +2 -2
  14. package/dist/core/streamingSlotRegistry.js +1 -19
  15. package/dist/core/streamingSlotRegistry.js.map +2 -2
  16. package/dist/dev/client/handlers/angular.ts +41 -35
  17. package/dist/dev/client/handlers/angularRuntime.ts +8 -3
  18. package/dist/dev/client/hmrClient.ts +1 -1
  19. package/dist/dev/client/reactRefreshSetup.ts +0 -1
  20. package/dist/index.js +254 -155
  21. package/dist/index.js.map +13 -13
  22. package/dist/islands/browser.js +1 -19
  23. package/dist/islands/browser.js.map +2 -2
  24. package/dist/islands/index.js +75 -19
  25. package/dist/islands/index.js.map +3 -3
  26. package/dist/react/browser.js +1 -19
  27. package/dist/react/browser.js.map +2 -2
  28. package/dist/react/components/index.js +1 -19
  29. package/dist/react/components/index.js.map +3 -3
  30. package/dist/react/hooks/index.js +1 -19
  31. package/dist/react/hooks/index.js.map +2 -2
  32. package/dist/react/index.js +85 -28
  33. package/dist/react/index.js.map +4 -4
  34. package/dist/react/jsxDevRuntimeCompat.js +1 -19
  35. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  36. package/dist/react/server.js +11 -28
  37. package/dist/react/server.js.map +3 -3
  38. package/dist/src/client/streamSwap.d.ts +0 -10
  39. package/dist/src/dev/rebuildTrigger.d.ts +1 -1
  40. package/dist/src/svelte/renderToPipeableStream.d.ts +2 -2
  41. package/dist/src/svelte/renderToReadableStream.d.ts +2 -2
  42. package/dist/src/svelte/renderToString.d.ts +2 -2
  43. package/dist/src/vue/components/Image.d.ts +3 -3
  44. package/dist/svelte/browser.js +1 -19
  45. package/dist/svelte/browser.js.map +2 -2
  46. package/dist/svelte/index.js +87 -29
  47. package/dist/svelte/index.js.map +5 -5
  48. package/dist/svelte/server.js +13 -29
  49. package/dist/svelte/server.js.map +4 -4
  50. package/dist/types/globals.d.ts +10 -2
  51. package/dist/vue/browser.js +1 -19
  52. package/dist/vue/browser.js.map +2 -2
  53. package/dist/vue/components/Image.js +1 -19
  54. package/dist/vue/components/Image.js.map +3 -3
  55. package/dist/vue/components/index.js +1 -19
  56. package/dist/vue/components/index.js.map +3 -3
  57. package/dist/vue/index.js +85 -28
  58. package/dist/vue/index.js.map +5 -5
  59. package/dist/vue/server.js +11 -28
  60. package/dist/vue/server.js.map +3 -3
  61. package/package.json +1 -1
@@ -3,7 +3,6 @@ var __create = Object.create;
3
3
  var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
7
  function __accessProp(key) {
9
8
  return this[key];
@@ -30,23 +29,6 @@ var __toESM = (mod, isNodeMode, target) => {
30
29
  cache.set(mod, to);
31
30
  return to;
32
31
  };
33
- var __toCommonJS = (from) => {
34
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
35
- if (entry)
36
- return entry;
37
- entry = __defProp({}, "__esModule", { value: true });
38
- if (from && typeof from === "object" || typeof from === "function") {
39
- for (var key of __getOwnPropNames(from))
40
- if (!__hasOwnProp.call(entry, key))
41
- __defProp(entry, key, {
42
- get: __accessProp.bind(from, key),
43
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44
- });
45
- }
46
- __moduleCache.set(from, entry);
47
- return entry;
48
- };
49
- var __moduleCache;
50
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
51
33
  var __returnValue = (v) => v;
52
34
  function __exportSetter(name, newValue) {
@@ -251,6 +233,65 @@ var ensureHead = (doc) => {
251
233
  }
252
234
  const head = doc.createElement("head");
253
235
  doc.documentElement.insertBefore(head, doc.documentElement.firstChild);
236
+ }, SSR_LAYOUT_RECT, layoutPatchApplied = false, patchElementLayout = (doc) => {
237
+ if (layoutPatchApplied || !doc) {
238
+ return;
239
+ }
240
+ let element;
241
+ try {
242
+ element = doc.createElement("div");
243
+ } catch {
244
+ return;
245
+ }
246
+ const proto = Object.getPrototypeOf(element);
247
+ if (!proto)
248
+ return;
249
+ const define = (name, value) => {
250
+ if (typeof proto[name] !== "function") {
251
+ Object.defineProperty(proto, name, {
252
+ configurable: true,
253
+ value,
254
+ writable: true
255
+ });
256
+ }
257
+ };
258
+ define("getBoundingClientRect", function() {
259
+ return { ...SSR_LAYOUT_RECT };
260
+ });
261
+ define("getClientRects", function() {
262
+ return [];
263
+ });
264
+ define("scrollTo", function() {});
265
+ define("scrollBy", function() {});
266
+ define("scrollIntoView", function() {});
267
+ define("focus", function() {});
268
+ define("blur", function() {});
269
+ const numericProps = [
270
+ "clientWidth",
271
+ "clientHeight",
272
+ "clientLeft",
273
+ "clientTop",
274
+ "offsetWidth",
275
+ "offsetHeight",
276
+ "offsetLeft",
277
+ "offsetTop",
278
+ "scrollWidth",
279
+ "scrollHeight",
280
+ "scrollLeft",
281
+ "scrollTop"
282
+ ];
283
+ for (const prop of numericProps) {
284
+ const desc = Object.getOwnPropertyDescriptor(proto, prop);
285
+ if (desc)
286
+ continue;
287
+ Object.defineProperty(proto, prop, {
288
+ configurable: true,
289
+ get() {
290
+ return 0;
291
+ }
292
+ });
293
+ }
294
+ layoutPatchApplied = true;
254
295
  }, applyPatches = async () => {
255
296
  const { \u{275}DominoAdapter } = await import(resolveAngularPackage("@angular/platform-server"));
256
297
  if (!\u{275}DominoAdapter?.prototype) {
@@ -269,18 +310,33 @@ var ensureHead = (doc) => {
269
310
  proto.createHtmlDocument = function() {
270
311
  const doc = origCreateHtmlDocument.call(this);
271
312
  ensureHead(doc);
313
+ patchElementLayout(doc);
272
314
  return doc;
273
315
  };
274
316
  const origGetDefaultDocument = proto.getDefaultDocument;
275
317
  proto.getDefaultDocument = function() {
276
318
  const doc = origGetDefaultDocument.call(this);
277
319
  ensureHead(doc);
320
+ patchElementLayout(doc);
278
321
  return doc;
279
322
  };
280
323
  return true;
281
324
  };
282
325
  var init_angularPatch = __esm(() => {
283
326
  init_resolveAngularPackage();
327
+ SSR_LAYOUT_RECT = Object.freeze({
328
+ bottom: 0,
329
+ height: 0,
330
+ left: 0,
331
+ right: 0,
332
+ top: 0,
333
+ width: 0,
334
+ x: 0,
335
+ y: 0,
336
+ toJSON() {
337
+ return this;
338
+ }
339
+ });
284
340
  });
285
341
 
286
342
  // src/angular/angularDeps.ts
@@ -1724,14 +1780,15 @@ var init_devRouteRegistrationCallsite = __esm(() => {
1724
1780
 
1725
1781
  // src/client/streamSwap.ts
1726
1782
  var streamSwapRuntime = () => {
1783
+ const absoluteWindow = window;
1727
1784
  const SLOT_PATCH_EVENT = "absolutejs:slot-patch";
1728
- if (window.__ABS_SLOT_RUNTIME__ === true)
1785
+ if (absoluteWindow.__ABS_SLOT_RUNTIME__ === true)
1729
1786
  return;
1730
- window.__ABS_SLOT_RUNTIME__ = true;
1731
- window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
1732
- window.__ABS_SLOT_PENDING__ = window.__ABS_SLOT_PENDING__ ?? {};
1733
- const consumers = window.__ABS_SLOT_CONSUMERS__;
1734
- const pending = window.__ABS_SLOT_PENDING__;
1787
+ absoluteWindow.__ABS_SLOT_RUNTIME__ = true;
1788
+ absoluteWindow.__ABS_SLOT_CONSUMERS__ = absoluteWindow.__ABS_SLOT_CONSUMERS__ ?? {};
1789
+ absoluteWindow.__ABS_SLOT_PENDING__ = absoluteWindow.__ABS_SLOT_PENDING__ ?? {};
1790
+ const consumers = absoluteWindow.__ABS_SLOT_CONSUMERS__;
1791
+ const pending = absoluteWindow.__ABS_SLOT_PENDING__;
1735
1792
  const isObjectRecord4 = (value) => Boolean(value) && typeof value === "object";
1736
1793
  const isPatchedPendingEntry = (value) => {
1737
1794
  if (!isObjectRecord4(value))
@@ -1739,7 +1796,7 @@ var streamSwapRuntime = () => {
1739
1796
  return value.domPatched === true && "payload" in value;
1740
1797
  };
1741
1798
  const unwrapPendingPayload = (value) => isPatchedPendingEntry(value) ? value.payload : value;
1742
- const canApplyImmediately = () => window.__ABS_SLOT_HYDRATION_PENDING__ !== true;
1799
+ const canApplyImmediately = () => absoluteWindow.__ABS_SLOT_HYDRATION_PENDING__ !== true;
1743
1800
  const isAngularDeferPayload = (payload) => {
1744
1801
  if (!isObjectRecord4(payload))
1745
1802
  return false;
@@ -1809,8 +1866,8 @@ var streamSwapRuntime = () => {
1809
1866
  apply(id, pending[id] ?? "");
1810
1867
  }
1811
1868
  };
1812
- window.__ABS_SLOT_FLUSH__ = flush;
1813
- window.__ABS_SLOT_ENQUEUE__ = (id, payload) => {
1869
+ absoluteWindow.__ABS_SLOT_FLUSH__ = flush;
1870
+ absoluteWindow.__ABS_SLOT_ENQUEUE__ = (id, payload) => {
1814
1871
  apply(id, payload);
1815
1872
  };
1816
1873
  if (typeof MutationObserver === "function") {
@@ -4967,5 +5024,5 @@ export {
4967
5024
  handleAngularPageRequest
4968
5025
  };
4969
5026
 
4970
- //# debugId=930925549D03897164756E2164756E21
5027
+ //# debugId=945B90DFD8B0FE3464756E2164756E21
4971
5028
  //# sourceMappingURL=server.js.map