@ng-native/router 0.3.0 → 0.5.0

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 (38) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/native-back.d.ts +24 -0
  5. package/dist/native-back.js +29 -0
  6. package/dist/native-back.js.map +1 -1
  7. package/dist/native-bar-defaults.d.ts +7 -0
  8. package/dist/native-bar-defaults.js.map +1 -1
  9. package/dist/native-header.d.ts +21 -1
  10. package/dist/native-header.js +45 -8
  11. package/dist/native-header.js.map +1 -1
  12. package/dist/native-navigation.d.ts +19 -0
  13. package/dist/native-navigation.js +81 -10
  14. package/dist/native-navigation.js.map +1 -1
  15. package/dist/native-stack-outlet.d.ts +50 -4
  16. package/dist/native-stack-outlet.js +202 -12
  17. package/dist/native-stack-outlet.js.map +1 -1
  18. package/dist/native-stack-reuse-strategy.d.ts +18 -6
  19. package/dist/native-stack-reuse-strategy.js +71 -19
  20. package/dist/native-stack-reuse-strategy.js.map +1 -1
  21. package/dist/native-tabs-outlet.d.ts +13 -0
  22. package/dist/native-tabs-outlet.js +52 -3
  23. package/dist/native-tabs-outlet.js.map +1 -1
  24. package/dist/presented-route.d.ts +27 -0
  25. package/dist/presented-route.js +184 -0
  26. package/dist/presented-route.js.map +1 -0
  27. package/dist/screen-header.d.ts +10 -0
  28. package/dist/screen-header.js +11 -0
  29. package/dist/screen-header.js.map +1 -0
  30. package/dist/screen-safe-area-view.d.ts +18 -0
  31. package/dist/screen-safe-area-view.js +74 -0
  32. package/dist/screen-safe-area-view.js.map +1 -0
  33. package/dist/screens.js +3 -2
  34. package/dist/screens.js.map +1 -1
  35. package/dist/tab-safe-area-view.d.ts +4 -11
  36. package/dist/tab-safe-area-view.js +8 -43
  37. package/dist/tab-safe-area-view.js.map +1 -1
  38. package/package.json +3 -3
@@ -1,15 +1,8 @@
1
+ import { ScreenSafeAreaView, type ScreenSafeAreaEdge } from './screen-safe-area-view.ts';
1
2
  import * as i0 from "@angular/core";
2
3
  /** The edges of the screen. */
3
- export type TabSafeAreaEdge = 'top' | 'right' | 'bottom' | 'left';
4
- export declare class TabSafeAreaView {
5
- constructor();
6
- /** Which edges to inset: usually `['bottom']`. Absent insets all four. */
7
- readonly edges: import("@angular/core").InputSignal<readonly TabSafeAreaEdge[] | undefined>;
8
- /**
9
- * Native takes all four edges every time, as booleans; a partial record leaves the missing
10
- * ones at whatever they were.
11
- */
12
- protected readonly resolvedEdges: import("@angular/core").Signal<Record<TabSafeAreaEdge, boolean>>;
4
+ export type TabSafeAreaEdge = ScreenSafeAreaEdge;
5
+ export declare class TabSafeAreaView extends ScreenSafeAreaView {
13
6
  static ɵfac: i0.ɵɵFactoryDeclaration<TabSafeAreaView, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<TabSafeAreaView, "tab-safe-area-view", never, { "edges": { "alias": "edges"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabSafeAreaView, "tab-safe-area-view", never, {}, {}, never, ["*"], true, never>;
15
8
  }
@@ -8,56 +8,21 @@
8
8
  * </view>
9
9
  * ```
10
10
  *
11
- * `<safe-area-view>` cannot do this. Its insets come from the nearest `<safe-area-provider>`,
12
- * which sits at the root of the app, above the tab bar, and so measures only the window's own
13
- * unsafe areas: inside a tab its bottom inset is the home indicator, and anything pinned to the
14
- * bottom of a tab ends up under the bar. On iOS 26 the bar floats over the screen's content, and
15
- * on Android the bottom navigation bar overlays it, so there is no layout that avoids it either.
16
- *
17
- * This is react-native-screens' own `RNSSafeAreaView`, which asks the screen it is in instead.
18
- * On iOS that is the tab screen's `safeAreaInsets`, which UIKit extends by the tab bar - floating
19
- * or not, and with the gap under a floating one - on top of the home indicator; a stack inside a
20
- * tab passes the same insets down to its pages. On Android it is the larger of the bottom
21
- * navigation bar's height and the system bars. Both follow the bar as it changes, rotates, or is
22
- * hidden.
23
- *
24
- * **The insets are applied as margin, not padding.** Whatever is beneath the inset shows through
25
- * it, so a panel whose background has to reach the bottom of the screen puts that background on
26
- * a parent and this inside it, as above: the parent grows by the margin and paints behind the
27
- * bar, and the content ends where the bar begins.
28
- *
29
- * It has to be inside a tab, or a page of a stack inside one. On iOS, with no screen above it, it
30
- * insets by nothing.
11
+ * It is `<screen-safe-area-view>` under the name it has inside a tab, where the screen it asks is
12
+ * the tab's and the bar it clears is the tab bar. See `screen-safe-area-view.ts`.
31
13
  */
32
- import { Component, ElementRef, computed, inject, input } from '@angular/core';
33
- import { ownHost } from "./own-host.js";
14
+ import { Component } from '@angular/core';
15
+ import { ScreenSafeAreaView } from "./screen-safe-area-view.js";
34
16
  import * as i0 from "@angular/core";
35
- const ALL = ['top', 'right', 'bottom', 'left'];
36
- export class TabSafeAreaView {
37
- constructor() {
38
- ownHost(inject(ElementRef).nativeElement, this.constructor);
39
- }
40
- /** Which edges to inset: usually `['bottom']`. Absent insets all four. */
41
- edges = input(/* @ts-ignore */
42
- ...(ngDevMode ? [undefined, { debugName: "edges" }] : /* istanbul ignore next */ []));
43
- /**
44
- * Native takes all four edges every time, as booleans; a partial record leaves the missing
45
- * ones at whatever they were.
46
- */
47
- resolvedEdges = computed(() => {
48
- const edges = this.edges() ?? ALL;
49
- return Object.fromEntries(ALL.map((edge) => [edge, edges.includes(edge)]));
50
- }, /* @ts-ignore */
51
- ...(ngDevMode ? [{ debugName: "resolvedEdges" }] : /* istanbul ignore next */ []));
52
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: TabSafeAreaView, deps: [], target: i0.ɵɵFactoryTarget.Component });
53
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: TabSafeAreaView, isStandalone: true, selector: "tab-safe-area-view", inputs: { edges: { classPropertyName: "edges", publicName: "edges", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "edges": "resolvedEdges()" } }, ngImport: i0, template: '<ng-content />', isInline: true });
17
+ export class TabSafeAreaView extends ScreenSafeAreaView {
18
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: TabSafeAreaView, deps: null, target: i0.ɵɵFactoryTarget.Component });
19
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.0", type: TabSafeAreaView, isStandalone: true, selector: "tab-safe-area-view", usesInheritance: true, ngImport: i0, template: '<ng-content />', isInline: true });
54
20
  }
55
21
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: TabSafeAreaView, decorators: [{
56
22
  type: Component,
57
23
  args: [{
58
24
  selector: 'tab-safe-area-view',
59
25
  template: '<ng-content />',
60
- host: { '[edges]': 'resolvedEdges()' },
61
26
  }]
62
- }], ctorParameters: () => [], propDecorators: { edges: [{ type: i0.Input, args: [{ isSignal: true, alias: "edges", required: false }] }] } });
27
+ }] });
63
28
  //# sourceMappingURL=tab-safe-area-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-safe-area-view.js","sourceRoot":"","sources":["../src/tab-safe-area-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;;AAKxC,MAAM,GAAG,GAA+B,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAO3E,MAAM,OAAO,eAAe;IAC1B;QACE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,aAA2B,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5E,CAAC;IAED,0EAA0E;IACjE,KAAK,GAAG,KAAK;yFAA8B,CAAC;IAErD;;;OAGG;IACgB,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC;QAClC,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAGxE,CAAC;IACJ,CAAC;sFAAC,CAAC;uGAlBQ,eAAe;2FAAf,eAAe,wQAHhB,gBAAgB;;2FAGf,eAAe;kBAL3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE;iBACvC","sourcesContent":["/**\n * A view that keeps its content clear of the tab bar, as well as the home indicator and the\n * system bars.\n *\n * ```html\n * <view class=\"panel absolute bottom-0 left-0 right-0\">\n * <tab-safe-area-view [edges]=\"['bottom']\">…</tab-safe-area-view>\n * </view>\n * ```\n *\n * `<safe-area-view>` cannot do this. Its insets come from the nearest `<safe-area-provider>`,\n * which sits at the root of the app, above the tab bar, and so measures only the window's own\n * unsafe areas: inside a tab its bottom inset is the home indicator, and anything pinned to the\n * bottom of a tab ends up under the bar. On iOS 26 the bar floats over the screen's content, and\n * on Android the bottom navigation bar overlays it, so there is no layout that avoids it either.\n *\n * This is react-native-screens' own `RNSSafeAreaView`, which asks the screen it is in instead.\n * On iOS that is the tab screen's `safeAreaInsets`, which UIKit extends by the tab bar - floating\n * or not, and with the gap under a floating one - on top of the home indicator; a stack inside a\n * tab passes the same insets down to its pages. On Android it is the larger of the bottom\n * navigation bar's height and the system bars. Both follow the bar as it changes, rotates, or is\n * hidden.\n *\n * **The insets are applied as margin, not padding.** Whatever is beneath the inset shows through\n * it, so a panel whose background has to reach the bottom of the screen puts that background on\n * a parent and this inside it, as above: the parent grows by the margin and paints behind the\n * bar, and the content ends where the bar begins.\n *\n * It has to be inside a tab, or a page of a stack inside one. On iOS, with no screen above it, it\n * insets by nothing.\n */\nimport { Component, ElementRef, computed, inject, input } from '@angular/core';\nimport type { EngineNode } from '@ng-native/fabric';\nimport { ownHost } from './own-host.ts';\n\n/** The edges of the screen. */\nexport type TabSafeAreaEdge = 'top' | 'right' | 'bottom' | 'left';\n\nconst ALL: readonly TabSafeAreaEdge[] = ['top', 'right', 'bottom', 'left'];\n\n@Component({\n selector: 'tab-safe-area-view',\n template: '<ng-content />',\n host: { '[edges]': 'resolvedEdges()' },\n})\nexport class TabSafeAreaView {\n constructor() {\n ownHost(inject(ElementRef).nativeElement as EngineNode, this.constructor);\n }\n\n /** Which edges to inset: usually `['bottom']`. Absent insets all four. */\n readonly edges = input<readonly TabSafeAreaEdge[]>();\n\n /**\n * Native takes all four edges every time, as booleans; a partial record leaves the missing\n * ones at whatever they were.\n */\n protected readonly resolvedEdges = computed(() => {\n const edges = this.edges() ?? ALL;\n return Object.fromEntries(ALL.map((edge) => [edge, edges.includes(edge)])) as Record<\n TabSafeAreaEdge,\n boolean\n >;\n });\n}\n"]}
1
+ {"version":3,"file":"tab-safe-area-view.js","sourceRoot":"","sources":["../src/tab-safe-area-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAA2B,MAAM,4BAA4B,CAAC;;AASzF,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;uGAA1C,eAAe;2FAAf,eAAe,qGAFhB,gBAAgB;;2FAEf,eAAe;kBAJ3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE,gBAAgB;iBAC3B","sourcesContent":["/**\n * A view that keeps its content clear of the tab bar, as well as the home indicator and the\n * system bars.\n *\n * ```html\n * <view class=\"panel absolute bottom-0 left-0 right-0\">\n * <tab-safe-area-view [edges]=\"['bottom']\">…</tab-safe-area-view>\n * </view>\n * ```\n *\n * It is `<screen-safe-area-view>` under the name it has inside a tab, where the screen it asks is\n * the tab's and the bar it clears is the tab bar. See `screen-safe-area-view.ts`.\n */\nimport { Component } from '@angular/core';\nimport { ScreenSafeAreaView, type ScreenSafeAreaEdge } from './screen-safe-area-view.ts';\n\n/** The edges of the screen. */\nexport type TabSafeAreaEdge = ScreenSafeAreaEdge;\n\n@Component({\n selector: 'tab-safe-area-view',\n template: '<ng-content />',\n})\nexport class TabSafeAreaView extends ScreenSafeAreaView {}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/router",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "@angular/router over native navigation for Angular Native: stack and tab outlets, native headers and links.",
5
5
  "keywords": [
6
6
  "angular",
@@ -17,8 +17,8 @@
17
17
  "type": "module",
18
18
  "main": "dist/index.js",
19
19
  "dependencies": {
20
- "@ng-native/device": "0.3.0",
21
- "@ng-native/fabric": "0.3.0"
20
+ "@ng-native/device": "0.5.0",
21
+ "@ng-native/fabric": "0.5.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@angular/common": "^22.0.0",