@absolutejs/absolute 0.20.0-beta.56 → 0.20.0-beta.58

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 (58) hide show
  1. package/dist/angular/browser.js +1 -45
  2. package/dist/angular/browser.js.map +2 -2
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +1 -17
  6. package/dist/angular/index.js.map +2 -2
  7. package/dist/build.js +8 -2
  8. package/dist/build.js.map +3 -3
  9. package/dist/cli/index.js +21 -3
  10. package/dist/client/chunks/angularPatch-arh4sr68.js +157 -0
  11. package/dist/client/chunks/angularPatch-arh4sr68.js.map +10 -0
  12. package/dist/client/chunks/index-5py90ctf.js +87 -0
  13. package/dist/client/chunks/index-5py90ctf.js.map +10 -0
  14. package/dist/client/chunks/index-m35nbkdp.js +374 -0
  15. package/dist/client/chunks/index-m35nbkdp.js.map +12 -0
  16. package/dist/client/chunks/index-qxjc7kc5.js +12 -0
  17. package/dist/client/chunks/index-qxjc7kc5.js.map +9 -0
  18. package/dist/client/chunks/islands-xj2n8nwf.js +281 -0
  19. package/dist/client/chunks/islands-xj2n8nwf.js.map +14 -0
  20. package/dist/client/chunks/react-pdg4325x.js +65 -0
  21. package/dist/client/chunks/react-pdg4325x.js.map +10 -0
  22. package/dist/client/chunks/svelte-s0c964kb.js +19 -0
  23. package/dist/client/chunks/svelte-s0c964kb.js.map +10 -0
  24. package/dist/client/chunks/vue-rdskrnyg.js +24 -0
  25. package/dist/client/chunks/vue-rdskrnyg.js.map +10 -0
  26. package/dist/client/index.js +56 -947
  27. package/dist/client/index.js.map +7 -22
  28. package/dist/index.js +8 -2
  29. package/dist/index.js.map +3 -3
  30. package/dist/islands/browser.js +1 -17
  31. package/dist/islands/browser.js.map +2 -2
  32. package/dist/islands/index.js +1 -17
  33. package/dist/islands/index.js.map +2 -2
  34. package/dist/mobile/browser.js +264 -2
  35. package/dist/mobile/browser.js.map +5 -4
  36. package/dist/mobile/index.js +276 -4
  37. package/dist/mobile/index.js.map +7 -6
  38. package/dist/mobile/remoteMacAgentEntry.js +13 -3
  39. package/dist/mobile/shellBootstrap.js +368 -29
  40. package/dist/mobile/uiPrimitives.js +264 -0
  41. package/dist/react/browser.js +1 -45
  42. package/dist/react/browser.js.map +2 -2
  43. package/dist/react/hooks/index.js +1 -17
  44. package/dist/react/hooks/index.js.map +2 -2
  45. package/dist/react/index.js +1 -17
  46. package/dist/react/index.js.map +2 -2
  47. package/dist/src/mobile/browser.d.ts +1 -0
  48. package/dist/src/mobile/index.d.ts +1 -0
  49. package/dist/src/mobile/uiPrimitives.d.ts +37 -0
  50. package/dist/svelte/browser.js +1 -17
  51. package/dist/svelte/browser.js.map +2 -2
  52. package/dist/svelte/index.js +1 -17
  53. package/dist/svelte/index.js.map +2 -2
  54. package/dist/vue/browser.js +84 -121
  55. package/dist/vue/browser.js.map +4 -4
  56. package/dist/vue/index.js +84 -121
  57. package/dist/vue/index.js.map +4 -4
  58. package/package.json +13 -7
@@ -8610,6 +8610,11 @@ const bridgeBootstrap = (path: string, safeAreaInsets: { bottom: number; left: n
8610
8610
  send({ format: 3, kind: 'event', event: 'navigation', path });
8611
8611
  }
8612
8612
  };
8613
+ globalThis.__absoluteRequestBack = () => {
8614
+ const event = new CustomEvent('absolute:back-request', { cancelable: true });
8615
+ if (!dispatchEvent(event)) return;
8616
+ send({ format: 3, kind: 'event', event: 'back-unhandled', path: currentPath });
8617
+ };
8613
8618
  if (\${DEV_ORIGIN ? 'true' : 'false'}) {
8614
8619
  const publishPath = () => {
8615
8620
  const path = location.pathname + location.search + location.hash;
@@ -8718,12 +8723,12 @@ export function AbsoluteWebHost() {
8718
8723
  }, [safeAreaInsets.bottom, safeAreaInsets.left, safeAreaInsets.right, safeAreaInsets.top]);
8719
8724
  useEffect(() => {
8720
8725
  const subscription = BackHandler.addEventListener('hardwareBackPress', () => {
8721
- if (!canGoBack) return false;
8722
- webView.current?.goBack();
8726
+ if (!indexUri) return false;
8727
+ webView.current?.injectJavaScript('globalThis.__absoluteRequestBack?.(); true;');
8723
8728
  return true;
8724
8729
  });
8725
8730
  return () => subscription.remove();
8726
- }, [canGoBack]);
8731
+ }, [indexUri]);
8727
8732
 
8728
8733
  const respond = (message: Record<string, unknown>) => {
8729
8734
  const source = JSON.stringify(message).replaceAll('\\u2028', '\\\\u2028').replaceAll('\\u2029', '\\\\u2029');
@@ -8763,6 +8768,11 @@ export function AbsoluteWebHost() {
8763
8768
  else activeWebPath.current = message.path;
8764
8769
  return;
8765
8770
  }
8771
+ if (message.kind === 'event' && message.event === 'back-unhandled') {
8772
+ if (canGoBack) webView.current?.goBack();
8773
+ else BackHandler.exitApp();
8774
+ return;
8775
+ }
8766
8776
  if (message.kind !== 'request' || typeof message.id !== 'string' || message.path !== activeWebPath.current) return;
8767
8777
  try {
8768
8778
  if (typeof message.params !== 'object' || message.params === null || Array.isArray(message.params)) throw new Error('Expo bridge method params are invalid.');
@@ -12107,6 +12117,263 @@ var http = createAbsoluteHttpClient();
12107
12117
 
12108
12118
  // src/mobile/shellHttp.ts
12109
12119
  var installAbsoluteMobileShellHttp = (origin, fetch2 = globalThis.fetch) => installAbsoluteHttpTransport(createAbsoluteHttpTransport({ fetch: fetch2, origin, runtime: "native" }));
12120
+ // src/mobile/uiPrimitives.ts
12121
+ var STYLE_ID2 = "absolute-mobile-ui-primitives";
12122
+ var NAVIGATION_EVENT = "absolute:navigation-change";
12123
+ var SHEET_EVENT = "absolute:sheet-change";
12124
+ var BACK_EVENT = "absolute:back-request";
12125
+ var ACTIVE_SHEET_SELECTOR = "dialog[data-absolute-sheet][open]";
12126
+ var TAB_LINK_SELECTOR = "[data-absolute-tab-bar] a[href]";
12127
+ var UI_STYLE = `
12128
+ [data-absolute-app-shell] {
12129
+ display: grid;
12130
+ grid-template-rows: auto minmax(0, 1fr) auto;
12131
+ box-sizing: border-box;
12132
+ min-height: var(--absolute-available-height, 100dvh);
12133
+ padding-inline: var(--absolute-safe-area-inset-left, 0px) var(--absolute-safe-area-inset-right, 0px);
12134
+ }
12135
+ [data-absolute-app-header] {
12136
+ padding-top: var(--absolute-safe-area-inset-top, 0px);
12137
+ }
12138
+ [data-absolute-app-main], [data-absolute-navigation-stack] {
12139
+ min-width: 0;
12140
+ min-height: 0;
12141
+ }
12142
+ [data-absolute-app-main] {
12143
+ overflow: auto;
12144
+ overscroll-behavior-y: contain;
12145
+ }
12146
+ [data-absolute-navigation-stack] {
12147
+ view-transition-name: absolute-mobile-stack;
12148
+ }
12149
+ [data-absolute-tab-bar] {
12150
+ display: flex;
12151
+ align-items: stretch;
12152
+ justify-content: space-around;
12153
+ box-sizing: border-box;
12154
+ padding-bottom: var(--absolute-safe-area-inset-bottom, 0px);
12155
+ background: Canvas;
12156
+ color: CanvasText;
12157
+ }
12158
+ [data-absolute-tab-bar] > a {
12159
+ display: grid;
12160
+ flex: 1 1 0;
12161
+ min-width: 0;
12162
+ min-height: 2.75rem;
12163
+ place-items: center;
12164
+ padding: 0.375rem 0.5rem;
12165
+ color: inherit;
12166
+ text-align: center;
12167
+ text-decoration: none;
12168
+ touch-action: manipulation;
12169
+ }
12170
+ [data-absolute-tab-bar] > a[aria-current="page"] {
12171
+ font-weight: 700;
12172
+ }
12173
+ dialog[data-absolute-sheet] {
12174
+ box-sizing: border-box;
12175
+ width: min(100%, var(--absolute-sheet-max-width, 42rem));
12176
+ max-height: min(90dvh, var(--absolute-available-height, 90dvh));
12177
+ margin: auto auto 0;
12178
+ padding: 1rem max(1rem, var(--absolute-safe-area-inset-right, 0px)) max(1rem, var(--absolute-safe-area-inset-bottom, 0px)) max(1rem, var(--absolute-safe-area-inset-left, 0px));
12179
+ overflow: auto;
12180
+ border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
12181
+ border-radius: 1rem 1rem 0 0;
12182
+ background: Canvas;
12183
+ color: CanvasText;
12184
+ box-shadow: 0 -0.5rem 2rem color-mix(in srgb, CanvasText 18%, transparent);
12185
+ }
12186
+ dialog[data-absolute-sheet]::backdrop {
12187
+ background: color-mix(in srgb, CanvasText 38%, transparent);
12188
+ }
12189
+ @keyframes absolute-mobile-forward-old { to { opacity: 0; transform: translateX(-12%); } }
12190
+ @keyframes absolute-mobile-forward-new { from { opacity: 0; transform: translateX(12%); } }
12191
+ @keyframes absolute-mobile-back-old { to { opacity: 0; transform: translateX(12%); } }
12192
+ @keyframes absolute-mobile-back-new { from { opacity: 0; transform: translateX(-12%); } }
12193
+ html[data-absolute-navigation-direction="forward"]::view-transition-old(absolute-mobile-stack) { animation: 180ms ease both absolute-mobile-forward-old; }
12194
+ html[data-absolute-navigation-direction="forward"]::view-transition-new(absolute-mobile-stack) { animation: 180ms ease both absolute-mobile-forward-new; }
12195
+ html[data-absolute-navigation-direction="back"]::view-transition-old(absolute-mobile-stack) { animation: 180ms ease both absolute-mobile-back-old; }
12196
+ html[data-absolute-navigation-direction="back"]::view-transition-new(absolute-mobile-stack) { animation: 180ms ease both absolute-mobile-back-new; }
12197
+ html[data-absolute-reduced-motion="reduce"]::view-transition-old(absolute-mobile-stack),
12198
+ html[data-absolute-reduced-motion="reduce"]::view-transition-new(absolute-mobile-stack) { animation: none; }
12199
+ `;
12200
+ var currentPath = () => `${location.pathname}${location.search}${location.hash}`;
12201
+ var ensureStyle2 = () => {
12202
+ let style = document.getElementById(STYLE_ID2);
12203
+ if (!(style instanceof HTMLStyleElement)) {
12204
+ style = document.createElement("style");
12205
+ style.id = STYLE_ID2;
12206
+ style.textContent = UI_STYLE;
12207
+ document.head.append(style);
12208
+ }
12209
+ };
12210
+ var sheetById = (id) => {
12211
+ const target = document.getElementById(id);
12212
+ return target instanceof HTMLDialogElement && target.dataset.absoluteSheet !== undefined ? target : undefined;
12213
+ };
12214
+ var dispatchSheet = (sheet, open) => dispatchEvent(new CustomEvent(SHEET_EVENT, {
12215
+ detail: { id: sheet.id, open }
12216
+ }));
12217
+ var focusSheet = (sheet) => {
12218
+ const target = sheet.querySelector('[autofocus], button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
12219
+ (target ?? sheet).focus();
12220
+ };
12221
+ var sheetOpeners = new WeakMap;
12222
+ var closeAbsoluteMobileSheet = (target) => {
12223
+ const sheet = typeof target === "string" ? sheetById(target) : target;
12224
+ if (!sheet || !sheet.open)
12225
+ return false;
12226
+ if (typeof sheet.close === "function")
12227
+ sheet.close();
12228
+ else
12229
+ sheet.removeAttribute("open");
12230
+ sheet.removeAttribute("aria-modal");
12231
+ sheetOpeners.get(sheet)?.focus();
12232
+ sheetOpeners.delete(sheet);
12233
+ dispatchSheet(sheet, false);
12234
+ return true;
12235
+ };
12236
+ var openAbsoluteMobileSheet = (target, opener) => {
12237
+ const sheet = typeof target === "string" ? sheetById(target) : target;
12238
+ if (!sheet || sheet.dataset.absoluteSheet === undefined)
12239
+ return false;
12240
+ const active = document.querySelector(ACTIVE_SHEET_SELECTOR);
12241
+ if (active && active !== sheet)
12242
+ closeAbsoluteMobileSheet(active);
12243
+ if (opener)
12244
+ sheetOpeners.set(sheet, opener);
12245
+ if (!sheet.open) {
12246
+ if (typeof sheet.showModal === "function")
12247
+ sheet.showModal();
12248
+ else
12249
+ sheet.setAttribute("open", "");
12250
+ }
12251
+ sheet.setAttribute("aria-modal", "true");
12252
+ focusSheet(sheet);
12253
+ dispatchSheet(sheet, true);
12254
+ return true;
12255
+ };
12256
+ var readAbsoluteMobileLinkIntent = (anchor) => {
12257
+ const mode = anchor.dataset.absoluteLink;
12258
+ if (mode === "back")
12259
+ return { kind: "back" };
12260
+ if (mode === "external")
12261
+ return { kind: "external" };
12262
+ return { kind: "navigate", replace: mode === "replace" };
12263
+ };
12264
+ var requestAbsoluteMobileBack = () => {
12265
+ const event = new CustomEvent(BACK_EVENT, { cancelable: true });
12266
+ return !dispatchEvent(event);
12267
+ };
12268
+ var normalizePathname = (value) => {
12269
+ try {
12270
+ return new URL(value, location.href).pathname.replace(/\/$/u, "") || "/";
12271
+ } catch {
12272
+ return;
12273
+ }
12274
+ };
12275
+ var syncTabLinks = (path) => {
12276
+ const activePath = normalizePathname(path);
12277
+ if (!activePath)
12278
+ return;
12279
+ document.querySelectorAll(TAB_LINK_SELECTOR).forEach((anchor) => {
12280
+ const candidate = normalizePathname(anchor.href);
12281
+ const prefix = anchor.dataset.absoluteTabMatch === "prefix";
12282
+ const active = candidate !== undefined && (prefix ? activePath === candidate || candidate !== "/" && activePath.startsWith(`${candidate}/`) : activePath === candidate);
12283
+ if (active)
12284
+ anchor.setAttribute("aria-current", "page");
12285
+ else
12286
+ anchor.removeAttribute("aria-current");
12287
+ });
12288
+ };
12289
+ var installAbsoluteMobileUiPrimitives = () => {
12290
+ let disposed = false;
12291
+ let scheduled = false;
12292
+ let path = currentPath();
12293
+ const refreshDocument = (nextPath = path) => {
12294
+ if (disposed || !document.head || !document.body)
12295
+ return;
12296
+ path = nextPath;
12297
+ ensureStyle2();
12298
+ syncTabLinks(path);
12299
+ };
12300
+ const scheduleRefresh = () => {
12301
+ if (scheduled || disposed)
12302
+ return;
12303
+ scheduled = true;
12304
+ queueMicrotask(() => {
12305
+ scheduled = false;
12306
+ refreshDocument();
12307
+ });
12308
+ };
12309
+ const handleClick = (event) => {
12310
+ if (!(event.target instanceof Element))
12311
+ return;
12312
+ const opener = event.target.closest("[data-absolute-sheet-open]");
12313
+ if (opener?.dataset.absoluteSheetOpen) {
12314
+ if (openAbsoluteMobileSheet(opener.dataset.absoluteSheetOpen, opener))
12315
+ event.preventDefault();
12316
+ return;
12317
+ }
12318
+ const closer = event.target.closest("[data-absolute-sheet-close]");
12319
+ const sheet = closer?.closest("dialog[data-absolute-sheet]");
12320
+ if (sheet && closeAbsoluteMobileSheet(sheet)) {
12321
+ event.preventDefault();
12322
+ return;
12323
+ }
12324
+ if (event.target instanceof HTMLDialogElement && event.target.dataset.absoluteSheet !== undefined) {
12325
+ const rect = event.target.getBoundingClientRect();
12326
+ const outside = event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom;
12327
+ if (outside && closeAbsoluteMobileSheet(event.target))
12328
+ event.preventDefault();
12329
+ }
12330
+ };
12331
+ const handleCancel = (event) => {
12332
+ if (!(event.target instanceof HTMLDialogElement))
12333
+ return;
12334
+ if (event.target.dataset.absoluteSheet === undefined)
12335
+ return;
12336
+ event.preventDefault();
12337
+ closeAbsoluteMobileSheet(event.target);
12338
+ };
12339
+ const handleBack = (event) => {
12340
+ const active = document.querySelector(ACTIVE_SHEET_SELECTOR);
12341
+ if (!active)
12342
+ return;
12343
+ event.preventDefault();
12344
+ closeAbsoluteMobileSheet(active);
12345
+ };
12346
+ const observer = new MutationObserver(scheduleRefresh);
12347
+ observer.observe(document.documentElement, {
12348
+ childList: true,
12349
+ subtree: true
12350
+ });
12351
+ addEventListener("click", handleClick);
12352
+ addEventListener("cancel", handleCancel, true);
12353
+ addEventListener(BACK_EVENT, handleBack);
12354
+ refreshDocument();
12355
+ return {
12356
+ refreshDocument,
12357
+ requestBack: requestAbsoluteMobileBack,
12358
+ dispose: () => {
12359
+ if (disposed)
12360
+ return;
12361
+ disposed = true;
12362
+ observer.disconnect();
12363
+ removeEventListener("click", handleClick);
12364
+ removeEventListener("cancel", handleCancel, true);
12365
+ removeEventListener(BACK_EVENT, handleBack);
12366
+ },
12367
+ navigate: (detail) => {
12368
+ path = detail.to;
12369
+ document.documentElement.dataset.absoluteNavigationDirection = detail.direction;
12370
+ refreshDocument(path);
12371
+ dispatchEvent(new CustomEvent(NAVIGATION_EVENT, {
12372
+ detail
12373
+ }));
12374
+ }
12375
+ };
12376
+ };
12110
12377
  export {
12111
12378
  ABSOLUTE_ANDROID_RELEASE_FORMAT,
12112
12379
  ABSOLUTE_AUTH_PACKAGE,
@@ -12164,6 +12431,7 @@ export {
12164
12431
  captureAbsoluteRemoteMacCommand,
12165
12432
  carryForwardAbsoluteMobileCompatibilityReleases,
12166
12433
  cleanAbsoluteRemoteMacWorkspace,
12434
+ closeAbsoluteMobileSheet,
12167
12435
  createAbsoluteExpoBridgeError,
12168
12436
  createAbsoluteExpoBridgeResponse,
12169
12437
  createAbsoluteIosNativeWatcher,
@@ -12206,6 +12474,7 @@ export {
12206
12474
  installAbsoluteMobileAuthEnvironment,
12207
12475
  installAbsoluteMobileShellHttp,
12208
12476
  installAbsoluteMobileSyncRemediation,
12477
+ installAbsoluteMobileUiPrimitives,
12209
12478
  installAbsoluteRemoteMacAgent,
12210
12479
  isAbsoluteIosNativeRootInput,
12211
12480
  listAbsoluteRemoteMacProfiles,
@@ -12222,6 +12491,7 @@ export {
12222
12491
  normalizeAbsoluteIosDeviceHost,
12223
12492
  normalizeAbsoluteIosDeviceIdentifier,
12224
12493
  normalizeAbsoluteMobileConfig,
12494
+ openAbsoluteMobileSheet,
12225
12495
  pairAbsoluteRemoteMac,
12226
12496
  parseAbsoluteAndroidInstalledApp,
12227
12497
  parseAbsoluteExpoBridgeMessage,
@@ -12243,10 +12513,12 @@ export {
12243
12513
  projectUsesAbsoluteSync,
12244
12514
  publishAbsoluteAndroidRelease,
12245
12515
  publishAbsoluteIosRelease,
12516
+ readAbsoluteMobileLinkIntent,
12246
12517
  readAbsoluteMobileMaterializedReleases,
12247
12518
  redactAbsoluteIosLog,
12248
12519
  removeAbsoluteRemoteMacProfile,
12249
12520
  repairAbsoluteIosDevSession,
12521
+ requestAbsoluteMobileBack,
12250
12522
  requireAbsoluteIosReleaseMetadata,
12251
12523
  resolveAbsoluteDeviceCapabilityPlan,
12252
12524
  resolveAbsoluteIosXcodeProject,
@@ -12279,5 +12551,5 @@ export {
12279
12551
  writeAbsoluteMobileGithubWorkflow
12280
12552
  };
12281
12553
 
12282
- //# debugId=15034BCB4D45F19A64756E2164756E21
12554
+ //# debugId=26FC2C1F9CAA3EC464756E2164756E21
12283
12555
  //# sourceMappingURL=index.js.map