craft-native 0.0.126 → 0.0.127

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/cli.js CHANGED
@@ -3303,7 +3303,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3303
3303
  `);
3304
3304
  }
3305
3305
  // package.json
3306
- var version = "0.0.126";
3306
+ var version = "0.0.127";
3307
3307
 
3308
3308
  // bin/cli.ts
3309
3309
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -310,7 +310,7 @@ function craftBinaryNotFoundMessage(triedPath) {
310
310
  `);
311
311
  }
312
312
  // package.json
313
- var version = "0.0.126";
313
+ var version = "0.0.127";
314
314
 
315
315
  // src/sdk-version.ts
316
316
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ function craftBinaryNotFoundMessage(triedPath) {
58
58
  `);
59
59
  }
60
60
  // package.json
61
- var version = "0.0.126";
61
+ var version = "0.0.127";
62
62
 
63
63
  // src/sdk-version.ts
64
64
  var SDK_VERSION = version;
@@ -402,12 +402,17 @@ final class CraftHybrid: NSObject {
402
402
  navigate = function () { return own.apply(router, arguments); };
403
403
  // A forward navigation to a native path is the shell's to show; the
404
404
  // page draws nothing. Back (pushState false), tab switches and the
405
- // shell's own navigations go through untouched.
405
+ // shell's own navigations go through untouched. A redirect (replace),
406
+ // as after signing in, is the page leaving where it was: the shell
407
+ // shows the native screen and the page follows it there behind it,
408
+ // or it stayed on the sign-in page and the next screen pushed from it
409
+ // came up blank.
406
410
  router.navigate = router.navigateTo = function (url, pushState, force) {
407
411
  var path = local(url);
408
412
  if (path !== null && pushState !== false && pushState !== 'tab' && hostNav === null && match(path)) {
409
413
  var replace = pushState === 'replace' || !!(pushState && typeof pushState === 'object' && pushState.replace);
410
414
  post({ type: 'navigateNative', path: path, replace: replace });
415
+ if (replace) return own.apply(router, arguments);
411
416
  return Promise.resolve(false);
412
417
  }
413
418
  return own.apply(router, arguments);
@@ -441,6 +446,16 @@ final class CraftHybrid: NSObject {
441
446
  if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
442
447
  var link = event.target && event.target.closest ? event.target.closest('a[href]') : null;
443
448
  if (!link) return;
449
+ // The bar's Back (data-native-back). Its href is only where to go
450
+ // without history, often a native path like the calendar; at the
451
+ // entry a native screen opened, Back is that screen.
452
+ if (link.hasAttribute('data-native-back')) {
453
+ if (!atBase()) return;
454
+ event.preventDefault();
455
+ event.stopPropagation();
456
+ post({ type: 'back' });
457
+ return;
458
+ }
444
459
  if ((link.target && link.target !== '_self') || link.hasAttribute('download') || link.hasAttribute('data-native-tab')
445
460
  || link.getAttribute('data-stx-nav') === 'tab' || link.hasAttribute('data-craft-web')) return;
446
461
  var path = local(link.href);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.126",
3
+ "version": "0.0.127",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",