@g9tm/lynxcontrols 1.4.11 → 1.6.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 (146) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/anchor/context.d.ts +15 -0
  3. package/dist/anchor/context.d.ts.map +1 -0
  4. package/dist/anchor/context.jsx +10 -0
  5. package/dist/anchor/context.jsx.map +1 -0
  6. package/dist/anchor/hooks.d.ts +72 -0
  7. package/dist/anchor/hooks.d.ts.map +1 -0
  8. package/dist/anchor/hooks.jsx +147 -0
  9. package/dist/anchor/hooks.jsx.map +1 -0
  10. package/dist/anchor/index.d.ts +6 -0
  11. package/dist/anchor/index.d.ts.map +1 -0
  12. package/dist/anchor/index.jsx +5 -0
  13. package/dist/anchor/measure.d.ts +22 -0
  14. package/dist/anchor/measure.d.ts.map +1 -0
  15. package/dist/anchor/measure.jsx +110 -0
  16. package/dist/anchor/measure.jsx.map +1 -0
  17. package/dist/anchor/registry.d.ts +108 -0
  18. package/dist/anchor/registry.d.ts.map +1 -0
  19. package/dist/anchor/registry.jsx +142 -0
  20. package/dist/anchor/registry.jsx.map +1 -0
  21. package/dist/anchor/scroll.d.ts +34 -0
  22. package/dist/anchor/scroll.d.ts.map +1 -0
  23. package/dist/anchor/scroll.jsx +255 -0
  24. package/dist/anchor/scroll.jsx.map +1 -0
  25. package/dist/base/control.d.ts +10 -3
  26. package/dist/base/control.d.ts.map +1 -1
  27. package/dist/base/control.jsx +17 -2
  28. package/dist/base/control.jsx.map +1 -1
  29. package/dist/base/pressable.d.ts.map +1 -1
  30. package/dist/base/pressable.jsx +7 -1
  31. package/dist/base/pressable.jsx.map +1 -1
  32. package/dist/button/button.d.ts.map +1 -1
  33. package/dist/button/button.jsx +11 -1
  34. package/dist/button/button.jsx.map +1 -1
  35. package/dist/button/header-action-button.d.ts.map +1 -1
  36. package/dist/button/header-action-button.jsx +10 -1
  37. package/dist/button/header-action-button.jsx.map +1 -1
  38. package/dist/button/icon-button.d.ts.map +1 -1
  39. package/dist/button/icon-button.jsx +11 -1
  40. package/dist/button/icon-button.jsx.map +1 -1
  41. package/dist/button/nav-card.d.ts.map +1 -1
  42. package/dist/button/nav-card.jsx +10 -1
  43. package/dist/button/nav-card.jsx.map +1 -1
  44. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  45. package/dist/button/vertical-icon-text-button.jsx +10 -1
  46. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  47. package/dist/expander/expander.d.ts.map +1 -1
  48. package/dist/expander/expander.jsx +14 -1
  49. package/dist/expander/expander.jsx.map +1 -1
  50. package/dist/fields/editor.d.ts.map +1 -1
  51. package/dist/fields/editor.jsx +17 -1
  52. package/dist/fields/editor.jsx.map +1 -1
  53. package/dist/fields/outlined-field.d.ts +6 -0
  54. package/dist/fields/outlined-field.d.ts.map +1 -1
  55. package/dist/fields/outlined-field.jsx +14 -3
  56. package/dist/fields/outlined-field.jsx.map +1 -1
  57. package/dist/fields/text-entry.d.ts.map +1 -1
  58. package/dist/fields/text-entry.jsx +17 -1
  59. package/dist/fields/text-entry.jsx.map +1 -1
  60. package/dist/fields/use-text-input.d.ts +1 -1
  61. package/dist/guide/confirm-sheet.d.ts +26 -0
  62. package/dist/guide/confirm-sheet.d.ts.map +1 -0
  63. package/dist/guide/confirm-sheet.jsx +146 -0
  64. package/dist/guide/confirm-sheet.jsx.map +1 -0
  65. package/dist/guide/guide.css +428 -0
  66. package/dist/guide/guide.css.map +1 -0
  67. package/dist/guide/index.d.ts +5 -0
  68. package/dist/guide/index.d.ts.map +1 -0
  69. package/dist/guide/index.jsx +4 -0
  70. package/dist/guide/journey.d.ts +46 -0
  71. package/dist/guide/journey.d.ts.map +1 -0
  72. package/dist/guide/journey.jsx +462 -0
  73. package/dist/guide/journey.jsx.map +1 -0
  74. package/dist/guide/placement.d.ts +44 -0
  75. package/dist/guide/placement.d.ts.map +1 -0
  76. package/dist/guide/placement.jsx +119 -0
  77. package/dist/guide/placement.jsx.map +1 -0
  78. package/dist/guide/service.d.ts +95 -0
  79. package/dist/guide/service.d.ts.map +1 -0
  80. package/dist/guide/service.jsx +566 -0
  81. package/dist/guide/service.jsx.map +1 -0
  82. package/dist/guide/settings.d.ts +68 -0
  83. package/dist/guide/settings.d.ts.map +1 -0
  84. package/dist/guide/settings.jsx +66 -0
  85. package/dist/guide/settings.jsx.map +1 -0
  86. package/dist/host/host.d.ts +5 -1
  87. package/dist/host/host.d.ts.map +1 -1
  88. package/dist/host/host.jsx +12 -0
  89. package/dist/host/host.jsx.map +1 -1
  90. package/dist/host/layers.d.ts +3 -1
  91. package/dist/host/layers.d.ts.map +1 -1
  92. package/dist/host/layers.jsx +4 -2
  93. package/dist/host/layers.jsx.map +1 -1
  94. package/dist/host/registry.d.ts +3 -0
  95. package/dist/host/registry.d.ts.map +1 -1
  96. package/dist/host/registry.jsx.map +1 -1
  97. package/dist/index.d.ts +3 -0
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/provider/contexts.d.ts +3 -0
  100. package/dist/provider/contexts.d.ts.map +1 -1
  101. package/dist/provider/contexts.jsx.map +1 -1
  102. package/dist/provider/provider.d.ts.map +1 -1
  103. package/dist/provider/provider.jsx +24 -17
  104. package/dist/provider/provider.jsx.map +1 -1
  105. package/dist/provider/settings.d.ts +4 -0
  106. package/dist/provider/settings.d.ts.map +1 -1
  107. package/dist/provider/settings.jsx +3 -2
  108. package/dist/provider/settings.jsx.map +1 -1
  109. package/dist/route/hooks.d.ts +34 -0
  110. package/dist/route/hooks.d.ts.map +1 -0
  111. package/dist/route/hooks.jsx +147 -0
  112. package/dist/route/hooks.jsx.map +1 -0
  113. package/dist/route/index.d.ts +3 -0
  114. package/dist/route/index.d.ts.map +1 -0
  115. package/dist/route/index.jsx +2 -0
  116. package/dist/route/router.d.ts +201 -0
  117. package/dist/route/router.d.ts.map +1 -0
  118. package/dist/route/router.jsx +810 -0
  119. package/dist/route/router.jsx.map +1 -0
  120. package/dist/sheet/frame.d.ts +3 -1
  121. package/dist/sheet/frame.d.ts.map +1 -1
  122. package/dist/sheet/frame.jsx +67 -25
  123. package/dist/sheet/frame.jsx.map +1 -1
  124. package/dist/sheet/options.d.ts +10 -0
  125. package/dist/sheet/options.d.ts.map +1 -1
  126. package/dist/sheet/options.jsx.map +1 -1
  127. package/dist/sheet/service.d.ts +5 -0
  128. package/dist/sheet/service.d.ts.map +1 -1
  129. package/dist/sheet/service.jsx +14 -2
  130. package/dist/sheet/service.jsx.map +1 -1
  131. package/dist/sheet/sheet.css +9 -0
  132. package/dist/sheet/sheet.css.map +1 -1
  133. package/dist/tabs/tab-view.d.ts +14 -0
  134. package/dist/tabs/tab-view.d.ts.map +1 -1
  135. package/dist/tabs/tab-view.jsx +59 -3
  136. package/dist/tabs/tab-view.jsx.map +1 -1
  137. package/dist/toggle/checkbox.d.ts.map +1 -1
  138. package/dist/toggle/checkbox.jsx +15 -1
  139. package/dist/toggle/checkbox.jsx.map +1 -1
  140. package/dist/toggle/chip-group.d.ts.map +1 -1
  141. package/dist/toggle/chip-group.jsx +12 -1
  142. package/dist/toggle/chip-group.jsx.map +1 -1
  143. package/dist/toggle/switch.d.ts.map +1 -1
  144. package/dist/toggle/switch.jsx +15 -1
  145. package/dist/toggle/switch.jsx.map +1 -1
  146. package/package.json +17 -2
@@ -0,0 +1,68 @@
1
+ import { type G9ConfirmTiming, type G9JourneySource } from '@g9tm/lynxcontrols-foundation';
2
+ import type { G9SheetOptions } from '../sheet/options.js';
3
+ /** The guide's words (the app gives them in the person's language; defaults are English). */
4
+ export interface G9GuideTexts {
5
+ readonly next: string;
6
+ readonly done: string;
7
+ readonly skip: string;
8
+ readonly endGuide: string;
9
+ readonly cancel: string;
10
+ /** The confirm button while counting down: `{0}` = seconds left. */
11
+ readonly confirmIn: string;
12
+ readonly confirm: string;
13
+ readonly changesTitle: string;
14
+ /** Who asked for the change, by journey source. */
15
+ readonly sources: Readonly<Record<G9JourneySource, string>>;
16
+ /** A change line's verb, by action. */
17
+ readonly actions: Readonly<Record<'create' | 'update' | 'delete' | 'send' | 'other', string>>;
18
+ /** Shown when a place could not say what will change. */
19
+ readonly undescribed: string;
20
+ /** Added to a link's confirmation. */
21
+ readonly linkWarning: string;
22
+ /**
23
+ * Where a press stands in a journey that presses more than one control: `{0}` = this press, `{1}` = how many the
24
+ * journey presses.
25
+ */
26
+ readonly confirmProgress: string;
27
+ }
28
+ /** App-wide guide settings (`G9Settings.guide`). */
29
+ /** The guide's words an app supplies (any subset). */
30
+ export type G9GuideTextOverrides = Partial<Omit<G9GuideTexts, 'sources' | 'actions'>> & {
31
+ readonly sources?: Partial<G9GuideTexts['sources']>;
32
+ readonly actions?: Partial<G9GuideTexts['actions']>;
33
+ };
34
+ /** App-wide guide settings (`G9Settings.guide`): words, countdowns, tracking and typing speed. */
35
+ export interface G9GuideSettings {
36
+ /** The words, or a function read at every render (so a language switch shows at once). */
37
+ readonly texts?: G9GuideTextOverrides | (() => G9GuideTextOverrides);
38
+ /** Countdown lengths of the guided-save confirmation. */
39
+ readonly confirm?: Partial<G9ConfirmTiming>;
40
+ /** How often a shown mark re-measures its target while nothing else told it to (ms). Default 250. */
41
+ readonly trackMs?: number;
42
+ /** Per character of a value the guide types in front of the person (ms). Default 30, capped at 1200 per field. */
43
+ readonly typeMsPerChar?: number;
44
+ /**
45
+ * The confirmation sheet's options over the guide's own (a fit-to-content sheet up to 75 % of the screen, the title in
46
+ * the header, the close button): an app gives its own sheet look here — a background, the close icon. The title, the
47
+ * footer buttons and the body are the guide's. A function is read at every confirmation (a colour that follows the
48
+ * theme).
49
+ */
50
+ readonly confirmSheet?: G9SheetOptions | (() => G9SheetOptions);
51
+ /** The text size of the confirmation's two footer buttons (the app's footer buttons). Default the hero button's. */
52
+ readonly confirmButtonFontSize?: number;
53
+ }
54
+ /** The guide settings with every default filled in. */
55
+ export interface G9ResolvedGuideSettings {
56
+ readonly texts: G9GuideTexts;
57
+ readonly confirm: G9ConfirmTiming;
58
+ readonly trackMs: number;
59
+ readonly typeMsPerChar: number;
60
+ /** The app's sheet options for the confirmation, read when one opens. */
61
+ readonly confirmSheet: () => G9SheetOptions;
62
+ readonly confirmButtonFontSize: number | null;
63
+ }
64
+ /** The guide settings with their defaults. */
65
+ export declare function resolveGuideSettings(s: G9GuideSettings | undefined): G9ResolvedGuideSettings;
66
+ /** `{0}`, `{1}`… replaced by the values in order. */
67
+ export declare function formatGuideText(template: string, ...values: ReadonlyArray<string | number>): string;
68
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/guide/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAA2B,MAAM,+BAA+B,CAAC;AACpH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,6FAA6F;AAC7F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IA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B,yEAAyE;IACzE,QAAQ,CAAC,YAAY,EAAE,MAAM,cAAc,CAAC;IAC5C,QAAQ,CAAC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C;AAwBD,8CAA8C;AAC9C,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,eAAe,GAAG,SAAS,GAAG,uBAAuB,CAuB5F;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAEnG"}
@@ -0,0 +1,66 @@
1
+ import { g9ConfirmTimingDefaults } from "@g9tm/lynxcontrols-foundation";
2
+ const ENGLISH = {
3
+ next: 'Next',
4
+ done: 'Done',
5
+ skip: 'Skip',
6
+ endGuide: 'End guide',
7
+ cancel: 'Cancel',
8
+ confirmIn: 'Confirm ({0})',
9
+ confirm: 'Confirm',
10
+ changesTitle: 'What will change',
11
+ sources: {
12
+ bundled: 'The app’s guide',
13
+ assistant: 'The assistant',
14
+ link: 'A link from outside the app',
15
+ tester: 'A test',
16
+ qa: 'Automation'
17
+ },
18
+ actions: {
19
+ create: 'New',
20
+ update: 'Change',
21
+ delete: 'Delete',
22
+ send: 'Send',
23
+ other: 'Other'
24
+ },
25
+ undescribed: 'The changes of this form will be saved.',
26
+ linkWarning: 'This request came from outside the app. Confirm only if you expected it.',
27
+ confirmProgress: 'Press {0} of {1} in this journey'
28
+ };
29
+ function resolveGuideSettings(s) {
30
+ const source = null == s ? void 0 : s.texts;
31
+ const merge = (t)=>({
32
+ ...ENGLISH,
33
+ ...t,
34
+ sources: {
35
+ ...ENGLISH.sources,
36
+ ...t.sources
37
+ },
38
+ actions: {
39
+ ...ENGLISH.actions,
40
+ ...t.actions
41
+ }
42
+ });
43
+ const fixed = 'function' == typeof source ? null : merge(null != source ? source : {});
44
+ return {
45
+ get texts () {
46
+ return null != fixed ? fixed : merge(source());
47
+ },
48
+ confirm: {
49
+ ...g9ConfirmTimingDefaults,
50
+ ...null == s ? void 0 : s.confirm
51
+ },
52
+ trackMs: (null == s ? void 0 : s.trackMs) && s.trackMs > 0 ? s.trackMs : 250,
53
+ typeMsPerChar: (null == s ? void 0 : s.typeMsPerChar) !== void 0 && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30,
54
+ confirmSheet: (()=>{
55
+ const own = null == s ? void 0 : s.confirmSheet;
56
+ return 'function' == typeof own ? own : ()=>null != own ? own : {};
57
+ })(),
58
+ confirmButtonFontSize: (null == s ? void 0 : s.confirmButtonFontSize) !== void 0 && s.confirmButtonFontSize > 0 ? s.confirmButtonFontSize : null
59
+ };
60
+ }
61
+ function formatGuideText(template, ...values) {
62
+ return values.reduce((t, v, i)=>t.split(`{${i}}`).join(String(v)), template);
63
+ }
64
+ export { formatGuideText, resolveGuideSettings };
65
+
66
+ //# sourceMappingURL=settings.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide/settings.jsx","sources":["../../src/guide/settings.ts"],"sourcesContent":["import { type G9ConfirmTiming, type G9JourneySource, g9ConfirmTimingDefaults } from '@g9tm/lynxcontrols-foundation';\nimport type { G9SheetOptions } from '../sheet/options';\n\n/** The guide's words (the app gives them in the person's language; defaults are English). */\nexport interface G9GuideTexts {\n readonly next: string;\n readonly done: string;\n readonly skip: string;\n readonly endGuide: string;\n readonly cancel: string;\n /** The confirm button while counting down: `{0}` = seconds left. */\n readonly confirmIn: string;\n readonly confirm: string;\n readonly changesTitle: string;\n /** Who asked for the change, by journey source. */\n readonly sources: Readonly<Record<G9JourneySource, string>>;\n /** A change line's verb, by action. */\n readonly actions: Readonly<Record<'create' | 'update' | 'delete' | 'send' | 'other', string>>;\n /** Shown when a place could not say what will change. */\n readonly undescribed: string;\n /** Added to a link's confirmation. */\n readonly linkWarning: string;\n /**\n * Where a press stands in a journey that presses more than one control: `{0}` = this press, `{1}` = how many the\n * journey presses.\n */\n readonly confirmProgress: string;\n}\n\n/** App-wide guide settings (`G9Settings.guide`). */\n/** The guide's words an app supplies (any subset). */\nexport type G9GuideTextOverrides = Partial<Omit<G9GuideTexts, 'sources' | 'actions'>> & {\n readonly sources?: Partial<G9GuideTexts['sources']>;\n readonly actions?: Partial<G9GuideTexts['actions']>;\n};\n\n/** App-wide guide settings (`G9Settings.guide`): words, countdowns, tracking and typing speed. */\nexport interface G9GuideSettings {\n /** The words, or a function read at every render (so a language switch shows at once). */\n readonly texts?: G9GuideTextOverrides | (() => G9GuideTextOverrides);\n /** Countdown lengths of the guided-save confirmation. */\n readonly confirm?: Partial<G9ConfirmTiming>;\n /** How often a shown mark re-measures its target while nothing else told it to (ms). Default 250. */\n readonly trackMs?: number;\n /** Per character of a value the guide types in front of the person (ms). Default 30, capped at 1200 per field. */\n readonly typeMsPerChar?: number;\n /**\n * The confirmation sheet's options over the guide's own (a fit-to-content sheet up to 75 % of the screen, the title in\n * the header, the close button): an app gives its own sheet look here — a background, the close icon. The title, the\n * footer buttons and the body are the guide's. A function is read at every confirmation (a colour that follows the\n * theme).\n */\n readonly confirmSheet?: G9SheetOptions | (() => G9SheetOptions);\n /** The text size of the confirmation's two footer buttons (the app's footer buttons). Default the hero button's. */\n readonly confirmButtonFontSize?: number;\n}\n\n/** The guide settings with every default filled in. */\nexport interface G9ResolvedGuideSettings {\n readonly texts: G9GuideTexts;\n readonly confirm: G9ConfirmTiming;\n readonly trackMs: number;\n readonly typeMsPerChar: number;\n /** The app's sheet options for the confirmation, read when one opens. */\n readonly confirmSheet: () => G9SheetOptions;\n readonly confirmButtonFontSize: number | null;\n}\n\nconst ENGLISH: G9GuideTexts = {\n next: 'Next',\n done: 'Done',\n skip: 'Skip',\n endGuide: 'End guide',\n cancel: 'Cancel',\n confirmIn: 'Confirm ({0})',\n confirm: 'Confirm',\n changesTitle: 'What will change',\n sources: {\n bundled: 'The app’s guide',\n assistant: 'The assistant',\n link: 'A link from outside the app',\n tester: 'A test',\n qa: 'Automation',\n },\n actions: { create: 'New', update: 'Change', delete: 'Delete', send: 'Send', other: 'Other' },\n undescribed: 'The changes of this form will be saved.',\n linkWarning: 'This request came from outside the app. Confirm only if you expected it.',\n confirmProgress: 'Press {0} of {1} in this journey',\n};\n\n/** The guide settings with their defaults. */\nexport function resolveGuideSettings(s: G9GuideSettings | undefined): G9ResolvedGuideSettings {\n const source = s?.texts;\n const merge = (t: G9GuideTextOverrides): G9GuideTexts => ({\n ...ENGLISH,\n ...t,\n sources: { ...ENGLISH.sources, ...t.sources },\n actions: { ...ENGLISH.actions, ...t.actions },\n });\n const fixed = typeof source === 'function' ? null : merge(source ?? {});\n return {\n get texts() {\n return fixed ?? merge((source as () => G9GuideTextOverrides)());\n },\n confirm: { ...g9ConfirmTimingDefaults, ...s?.confirm },\n trackMs: s?.trackMs && s.trackMs > 0 ? s.trackMs : 250,\n typeMsPerChar: s?.typeMsPerChar !== undefined && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30,\n confirmSheet: (() => {\n const own = s?.confirmSheet;\n return typeof own === 'function' ? own : () => own ?? {};\n })(),\n confirmButtonFontSize:\n s?.confirmButtonFontSize !== undefined && s.confirmButtonFontSize > 0 ? s.confirmButtonFontSize : null,\n };\n}\n\n/** `{0}`, `{1}`… replaced by the values in order. */\nexport function formatGuideText(template: string, ...values: ReadonlyArray<string | number>): string {\n return values.reduce<string>((t, v, i) => t.split(`{${i}}`).join(String(v)), template);\n}\n"],"names":["ENGLISH","resolveGuideSettings","s","source","merge","t","fixed","g9ConfirmTimingDefaults","undefined","own","formatGuideText","template","values","v","i","String"],"mappings":";AAoEA,MAAMA,UAAwB;IAC5B,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,QAAQ;IACR,WAAW;IACX,SAAS;IACT,cAAc;IACd,SAAS;QACP,SAAS;QACT,WAAW;QACX,MAAM;QACN,QAAQ;QACR,IAAI;IACN;IACA,SAAS;QAAE,QAAQ;QAAO,QAAQ;QAAU,QAAQ;QAAU,MAAM;QAAQ,OAAO;IAAQ;IAC3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AO,MAAM,CAAS,CAACP,GAAGQ,GAAGC,IAAMT,EAAE,KAAK,CAAC,CAAC,CAAC,EAAES,EAAE,CAAC,CAAC,EAAE,IAAI,CAACC,OAAOF,KAAKF;AAC/E"}
@@ -1,4 +1,4 @@
1
- import { type G9AbortSignal } from '@g9tm/lynxcontrols-foundation';
1
+ import { type G9AbortSignal, type G9SegmentInput } from '@g9tm/lynxcontrols-foundation';
2
2
  import { type ReactNode } from '@lynx-js/react';
3
3
  import { type G9BackResult } from './back.js';
4
4
  import { type G9OverlayLayer } from './layers.js';
@@ -50,6 +50,10 @@ export interface G9HostProps {
50
50
  /** The colour behind the content, shown when a sheet recedes the page (MAUI `BackdropHost`). Default black. */
51
51
  readonly backdropColor?: string;
52
52
  readonly className?: string;
53
+ /** The page's place in the navigation (`@g9tm/lynxcontrols/route`), declared while the host is active. */
54
+ readonly route?: G9SegmentInput;
55
+ /** How the router leaves the page (pop it). Without it the router cannot close the page. */
56
+ readonly routeClose?: () => void;
53
57
  }
54
58
  /** The nearest host, for hooks. */
55
59
  export declare const G9HostContext: import("react").Context<G9HostHandle | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/host/host.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAIL,KAAK,SAAS,EAOf,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAuC,KAAK,cAAc,EAAgB,MAAM,UAAU,CAAC;AAElG,OAAO,EAAuB,KAAK,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAA4B,KAAK,YAAY,EAAE,KAAK,YAAY,EAAgB,MAAM,YAAY,CAAC;AAC1G,OAAO,YAAY,CAAC;AAEpB,oHAAoH;AACpH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;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,8CAA2C,CAAC;AACtE,iCAAiC;AACjC,eAAO,MAAM,mBAAmB,8CAA2C,CAAC;AAC5E,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB,2DAAwD,CAAC;AA+B5F;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAyNpD"}
@@ -4,6 +4,7 @@ import { Fragment, createContext, memo, useContext, useEffect, useMemo, useRef,
4
4
  import { useStableCallback } from "../base/use-stable-callback.jsx";
5
5
  import { G9KeyboardContext } from "../provider/contexts.jsx";
6
6
  import { useG9Core, useG9SafeInsets, useG9Settings } from "../provider/hooks.jsx";
7
+ import { useG9Place } from "../route/hooks.jsx";
7
8
  import { createBackStack } from "./back.jsx";
8
9
  import { isKeyboardTarget } from "./keyboard.jsx";
9
10
  import { createLayerStore, g9LayerOrder } from "./layers.jsx";
@@ -35,6 +36,16 @@ function G9Host(props) {
35
36
  const keyboard = useContext(G9KeyboardContext);
36
37
  const providerInsets = useG9SafeInsets();
37
38
  const active = null != (_props_active = props.active) ? _props_active : true;
39
+ const routeClose = props.routeClose;
40
+ useG9Place(props.route ? {
41
+ segment: props.route,
42
+ layer: 'page',
43
+ ...routeClose ? {
44
+ close: ()=>routeClose()
45
+ } : {}
46
+ } : null, {
47
+ active
48
+ });
38
49
  const name = null != (_props_name = props.name) ? _props_name : 'G9Host';
39
50
  const latest = useRef(props);
40
51
  latest.current = props;
@@ -93,6 +104,7 @@ function G9Host(props) {
93
104
  id,
94
105
  parent,
95
106
  services: core.services,
107
+ anchors: core.anchors,
96
108
  layers,
97
109
  registerLayerItem (layer, item) {
98
110
  if (released) return ()=>{};
@@ -1 +1 @@
1
- {"version":3,"file":"host/host.jsx","sources":["../../src/host/host.tsx"],"sourcesContent":["import { type G9AbortSignal, G9Error, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { OverlayView } from '@lynx-js/lynx-ui-overlay';\nimport {\n createContext,\n Fragment,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { G9KeyboardContext } from '../provider/contexts';\nimport { useG9Core, useG9SafeInsets, useG9Settings } from '../provider/hooks';\nimport { createBackStack, type G9BackResult } from './back';\nimport { isKeyboardTarget } from './keyboard';\nimport { createLayerStore, type G9LayerStore, type G9OverlayLayer, g9LayerOrder } from './layers';\nimport { G9PageLoadingOverlay } from './page-loading-overlay';\nimport { createHostReadiness, type G9HostReadinessController } from './readiness';\nimport { type G9HostContentEffect, type G9HostHandle, type G9HostInsets, hostRegistry } from './registry';\nimport './host.css';\n\n/** How a layer is mounted: in the page tree (default) or in a Lynx `<overlay>` above native views (maps, video). */\nexport type G9LayerContainer = 'tree' | 'overlay';\n\n/** Props of {@link G9Host}. */\nexport interface G9HostProps {\n readonly children?: ReactNode;\n /**\n * Whether the page is on screen (MAUI `Loaded`/`Unloaded`, tab activation). Default `true`. An inactive host stays\n * registered and becomes active again when set back to `true`; see `g9Hosts` for the resolution rule.\n */\n readonly active?: boolean;\n /** Names the page in diagnostics (the cover's busy activity is `page:<name>`). Default `'G9Host'`. */\n readonly name?: string;\n /**\n * The page's appearing work (MAUI `OnAppearingAfterParentAsync`), run through the provider's safe executor each time\n * the host becomes active; `signal` aborts when it stops being active or unmounts. On the first appearance the\n * loading cover waits for it (unless `manualRelease`).\n */\n readonly onAppearing?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Runs each time the host stops being active (MAUI `OnDisappearingAfterParentAsync`), guarded. */\n readonly onDisappearing?: () => void | Promise<void>;\n /** The page's own back handling (MAUI `TryHandleInAppBack`), asked after every overlay. */\n readonly onBack?: () => G9BackResult | boolean;\n /** Swallow every system back press before anything else runs (MAUI `IsHardwareBackSuppressed`). Default `false`. */\n readonly backSuppressed?: boolean;\n /** Show the page-loading cover until the page is ready (MAUI `G9PageLoadingOverlay`, always on). Default `true`. */\n readonly loadingCover?: boolean;\n /** The page releases the cover itself through `useG9HostReady().release()` (MAUI `PageLoadingManualRelease`). */\n readonly manualRelease?: boolean;\n /** Extra delay after ready (MAUI `PageLoadingDismissDelayMs`). Default `settings.pageLoading.dismissDelayMs` (369). */\n readonly dismissDelayMs?: number;\n /** Hard cap on the cover (MAUI `PageLoadingSafetyTimeoutMs`). Default `settings.pageLoading.safetyTimeoutMs` (5000). */\n readonly safetyTimeoutMs?: number;\n /** Dismiss the soft keyboard on a tap outside any keyboard target (MAUI `TapOutsideKeyboardDismisser`). Default `true`. */\n readonly dismissKeyboardOnTapOutside?: boolean;\n /** Per-layer container; a layer over a native view (map, video) needs `'overlay'`. Default `'tree'` for each. */\n readonly layerContainers?: Partial<Record<G9OverlayLayer, G9LayerContainer>>;\n /** MAUI `ComputeBottomSafeAreaWithTabBar`: the bottom inset plus the page's own tab bar. Default: the inset. */\n readonly computeBottomSafeAreaWithTabBar?: (bottomInset: number) => number;\n /** The page background (MAUI `ApplyThemedBackground`). Default `var(--g9-background)`. */\n readonly background?: string;\n /** The colour behind the content, shown when a sheet recedes the page (MAUI `BackdropHost`). Default black. */\n readonly backdropColor?: string;\n readonly className?: string;\n}\n\n/** The nearest host, for hooks. */\nexport const G9HostContext = createContext<G9HostHandle | null>(null);\n/** The nearest host's insets. */\nexport const G9HostInsetsContext = createContext<G9HostInsets | null>(null);\n/** The nearest host's readiness controller. */\nexport const G9HostReadinessContext = createContext<G9HostReadinessController | null>(null);\n\nconst OVERLAY_LAYERS = g9LayerOrder.filter((layer): layer is G9OverlayLayer => layer !== 'content');\nlet hostSequence = 0;\n\n// The inner name must differ from the binding: rslib renames `const X = memo(function X…)` with a module prefix and the\n// in-module `<X>` then compiles as an unknown intrinsic element (E20; scripts/check-dist-jsx.mjs).\nconst HostLayer = memo(function HostLayerRender(props: {\n readonly hostId: string;\n readonly store: G9LayerStore;\n readonly layer: G9OverlayLayer;\n readonly container: G9LayerContainer;\n}): ReactNode {\n const { hostId, store, layer, container } = props;\n const entries = useSyncExternalStore(\n (listener) => store.subscribe(layer, listener),\n () => store.getSnapshot(layer),\n );\n if (entries.length === 0) return null;\n const className = `g9-host__layer g9-host__layer--${layer}`;\n const items = entries.map((entry) => <Fragment key={entry.key}>{entry.element}</Fragment>);\n if (container === 'overlay') {\n return (\n <OverlayView container=\"window\" className={className} id={`${hostId}-${layer}`}>\n {items}\n </OverlayView>\n );\n }\n return <view className={className}>{items}</view>;\n});\n\n/**\n * The page frame (MAUI `G9PageBase` + `G9PageTemplate`): the content and the overlay layers in a fixed z-order\n * (`content` → `edgePanel` → `sheets` → `popups` → `feedback` → `floating`, then the loading cover), the page's back\n * stack, readiness and loading cover, safe-area insets, tap-outside keyboard dismissal, and its registration in\n * `g9Hosts` for code outside the tree. One per page; hosts may nest. Must be inside `G9Provider`.\n *\n * Layers are input-transparent (`pointer-events: none`), so empty areas pass touches to the layers below; each item\n * receives its own touches only when its root sets `pointer-events: auto` — Lynx inherits pointer-events, so an item\n * without it is transparent as well. An empty layer renders nothing.\n */\nexport function G9Host(props: G9HostProps): ReactNode {\n const core = useG9Core();\n const settings = useG9Settings();\n const parent = useContext(G9HostContext);\n const keyboard = useContext(G9KeyboardContext);\n const providerInsets = useG9SafeInsets();\n const active = props.active ?? true;\n const name = props.name ?? 'G9Host';\n\n const latest = useRef(props);\n latest.current = props;\n\n const bottomWithTabBar = props.computeBottomSafeAreaWithTabBar\n ? props.computeBottomSafeAreaWithTabBar(providerInsets.bottom)\n : providerInsets.bottom;\n const insets = useMemo<G9HostInsets>(\n () => Object.freeze({ ...providerInsets, bottomWithTabBar }),\n [providerInsets, bottomWithTabBar],\n );\n const insetsRef = useRef(insets);\n insetsRef.current = insets;\n\n const [state] = useState(() => {\n hostSequence += 1;\n const id = `g9-host-${hostSequence}`;\n const layers = createLayerStore();\n const back = createBackStack({\n isSuppressed: () => latest.current.backSuppressed === true,\n onHandlerError: (error) =>\n core.diagnostics.log({ level: 'error', message: 'A back handler threw.', source: name, error }),\n });\n const features = new Map<string, unknown>();\n let released = false;\n let contentEffect: G9HostContentEffect | null = null;\n const effectListeners = new Set<() => void>();\n const readiness = createHostReadiness({\n cover: props.loadingCover ?? true,\n manualRelease: props.manualRelease ?? false,\n dismissDelayMs: props.dismissDelayMs ?? settings.pageLoading.dismissDelayMs,\n safetyTimeoutMs: props.safetyTimeoutMs ?? settings.pageLoading.safetyTimeoutMs,\n startActivity: () => {\n const scope = core.diagnostics.activity(`page:${name}`);\n return () => scope.dispose();\n },\n runAppearing: async (signal) => {\n const onAppearing = latest.current.onAppearing;\n if (!onAppearing) return;\n await core.executor.run((context) => onAppearing({ signal: context.signal }), {\n source: name,\n throttleKey: `${id}.onAppearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n signal,\n });\n },\n });\n const handle: G9HostHandle = {\n id,\n parent,\n services: core.services,\n layers,\n registerLayerItem(layer, item) {\n if (released) return () => {};\n return layers.register(layer, item);\n },\n removeLayerItem: (layer, key) => layers.remove(layer, key),\n back,\n getInsets: () => insetsRef.current,\n readiness,\n attachFeature(key, value) {\n if (features.has(key)) throw new G9Error('host-feature', `Host feature '${String(key)}' is already attached.`);\n features.set(key, value);\n return () => {\n if (features.get(key) === value) features.delete(key);\n };\n },\n getFeature: (key) => features.get(key) as never,\n get released() {\n return released;\n },\n setContentEffect(effect) {\n if (released || contentEffect === effect) return;\n contentEffect = effect;\n for (const listener of [...effectListeners]) listener();\n },\n getContentEffect: () => contentEffect,\n };\n const effectStore = {\n subscribe(listener: () => void) {\n effectListeners.add(listener);\n return () => {\n effectListeners.delete(listener);\n };\n },\n getSnapshot: () => contentEffect,\n };\n return {\n handle,\n readiness,\n effectStore,\n release() {\n released = true;\n features.clear();\n },\n };\n });\n const { handle, readiness, effectStore } = state;\n\n // Unmount: synchronous unregistration and release of everything the host owns.\n useEffect(\n () => () => {\n hostRegistry.remove(handle);\n readiness.dispose();\n handle.layers.clear();\n handle.back.clear();\n state.release();\n },\n [handle, readiness, state],\n );\n\n // Visibility drives the registry and the appearing/disappearing lifecycle.\n const wasActive = useRef<boolean | null>(null);\n useEffect(() => {\n const previous = wasActive.current;\n wasActive.current = active;\n if (active) {\n hostRegistry.activate(handle);\n readiness.appear();\n return;\n }\n if (previous === null) {\n hostRegistry.register(handle);\n return;\n }\n hostRegistry.markOffScreen(handle);\n readiness.disappear();\n const onDisappearing = latest.current.onDisappearing;\n if (onDisappearing) {\n core.executor.runSafe(() => onDisappearing(), {\n source: name,\n throttleKey: `${handle.id}.onDisappearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n });\n }\n }, [active, handle, readiness, core, name]);\n\n // The page's own back handling sits in the content layer, below every overlay.\n const hasOnBack = props.onBack !== undefined;\n useEffect(\n () => (hasOnBack ? handle.back.push(() => latest.current.onBack?.() ?? 'pass') : undefined),\n [hasOnBack, handle],\n );\n\n const keyboardVisible = useRef(false);\n keyboardVisible.current = keyboard?.visible === true;\n const onCaptureTap = useStableCallback((event: { target?: { dataset?: Record<string, unknown> } }) => {\n if (!keyboardVisible.current || isKeyboardTarget(event.target)) return;\n core.services.host.hideKeyboard();\n });\n\n const cover = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot).cover;\n const effect = useSyncExternalStore(effectStore.subscribe, effectStore.getSnapshot);\n const containers = props.layerContainers ?? {};\n const tapOutside = props.dismissKeyboardOnTapOutside ?? true;\n\n return (\n <G9HostContext.Provider value={handle}>\n <G9HostInsetsContext.Provider value={insets}>\n <G9HostReadinessContext.Provider value={readiness}>\n <view\n className={`g9-host${props.className ? ` ${props.className}` : ''}`}\n {...(tapOutside ? { 'capture-bindtap': onCaptureTap } : {})}\n >\n <view\n className=\"g9-host__backdrop\"\n style={{ backgroundColor: effect?.backdropColor ?? props.backdropColor ?? '#000000' }}\n />\n <view\n className=\"g9-host__content\"\n style={{\n backgroundColor: props.background ?? 'var(--g9-background)',\n transform: effect\n ? `translateY(${effect.translateY}px) scale(${effect.scale})`\n : 'translateY(0px) scale(1)',\n transition: `transform ${g9Ms(effect?.durationMs ?? 300)}ms ease-out`,\n }}\n >\n {props.children}\n </view>\n {OVERLAY_LAYERS.map((layer) => (\n <HostLayer\n key={layer}\n hostId={handle.id}\n store={handle.layers}\n layer={layer}\n container={containers[layer] ?? 'tree'}\n />\n ))}\n {cover === 'hidden' ? null : (\n <G9PageLoadingOverlay\n exiting={cover === 'exiting'}\n backgroundColor={settings.pageLoading.backgroundColor}\n spinnerColor={settings.pageLoading.spinnerColor}\n />\n )}\n </view>\n </G9HostReadinessContext.Provider>\n </G9HostInsetsContext.Provider>\n </G9HostContext.Provider>\n );\n}\n"],"names":["G9HostContext","createContext","G9HostInsetsContext","G9HostReadinessContext","OVERLAY_LAYERS","g9LayerOrder","layer","hostSequence","HostLayer","memo","props","hostId","store","container","entries","useSyncExternalStore","listener","className","items","entry","Fragment","OverlayView","view","G9Host","_props_active","_props_name","_props_layerContainers","_props_dismissKeyboardOnTapOutside","_ref","_props_background","core","useG9Core","settings","useG9Settings","parent","useContext","keyboard","G9KeyboardContext","providerInsets","useG9SafeInsets","active","name","latest","useRef","bottomWithTabBar","insets","useMemo","Object","insetsRef","state","useState","_props_loadingCover","_props_manualRelease","_props_dismissDelayMs","_props_safetyTimeoutMs","id","layers","createLayerStore","back","createBackStack","error","features","Map","released","contentEffect","effectListeners","Set","readiness","createHostReadiness","scope","signal","onAppearing","context","handle","item","key","value","G9Error","String","effect","effectStore","useEffect","hostRegistry","wasActive","previous","onDisappearing","hasOnBack","undefined","_latest_current","keyboardVisible","onCaptureTap","useStableCallback","event","isKeyboardTarget","cover","containers","tapOutside","g9Ms","_containers_layer","G9PageLoadingOverlay"],"mappings":";;;;;;;;;;;;;AAwEO,MAAMA,gBAAgBC,cAAmC;AAEzD,MAAMC,sBAAsBD,cAAmC;AAE/D,MAAME,yBAAyBF,cAAgD;AAEtF,MAAMG,iBAAiBC,aAAa,MAAM,CAAC,CAACC,QAAmCA,AAAU,cAAVA;AAC/E,IAAIC,eAAe;AAInB,MAAMC,YAAYC,K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AA,IAAAA,OAAQ,UAAU,AAAD,IAAC,QAAI,KAAK,WAAW,CAAC;IACvE,GACD;cACC,CAACrE,MAAM,QAAQ,CAAC;YAClB,EAAEY,KAAK;YACP,CAAClB,eAAe,GAAG,CAAC,CAACE;YAMN4F;gBALZ1F,UACC,KAAKF,OACL,QAAQmE,OAAO,EAAE,EACjB,OAAOA,OAAO,MAAM,EACpB,OAAOnE,OACP,WAAW,QAAA4F,CAAAA,oBAAAA,UAAU,CAAC5F,MAAM,AAAD,IAAhB4F,oBAAqB;OAEjC;YACH,CAACJ,AAAU,aAAVA,QAAqB,QACnBK,qBACC,SAASL,AAAU,cAAVA,OACT,iBAAiB9D,SAAS,WAAW,CAAC,eAAe,EACrD,cAAcA,SAAS,WAAW,CAAC,YAAY,IAEjD;UACJ,EAAEV,KAAK;QACT,EAAEnB,uBAAuB,SAAS;MACpC,EAAED,oBAAoB,SAAS;IACjC,EAAEF,cAAc;AAEpB"}
1
+ {"version":3,"file":"host/host.jsx","sources":["../../src/host/host.tsx"],"sourcesContent":["import { type G9AbortSignal, G9Error, type G9SegmentInput, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { OverlayView } from '@lynx-js/lynx-ui-overlay';\nimport {\n createContext,\n Fragment,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { G9KeyboardContext } from '../provider/contexts';\nimport { useG9Core, useG9SafeInsets, useG9Settings } from '../provider/hooks';\nimport { useG9Place } from '../route/hooks';\nimport { createBackStack, type G9BackResult } from './back';\nimport { isKeyboardTarget } from './keyboard';\nimport { createLayerStore, type G9LayerStore, type G9OverlayLayer, g9LayerOrder } from './layers';\nimport { G9PageLoadingOverlay } from './page-loading-overlay';\nimport { createHostReadiness, type G9HostReadinessController } from './readiness';\nimport { type G9HostContentEffect, type G9HostHandle, type G9HostInsets, hostRegistry } from './registry';\nimport './host.css';\n\n/** How a layer is mounted: in the page tree (default) or in a Lynx `<overlay>` above native views (maps, video). */\nexport type G9LayerContainer = 'tree' | 'overlay';\n\n/** Props of {@link G9Host}. */\nexport interface G9HostProps {\n readonly children?: ReactNode;\n /**\n * Whether the page is on screen (MAUI `Loaded`/`Unloaded`, tab activation). Default `true`. An inactive host stays\n * registered and becomes active again when set back to `true`; see `g9Hosts` for the resolution rule.\n */\n readonly active?: boolean;\n /** Names the page in diagnostics (the cover's busy activity is `page:<name>`). Default `'G9Host'`. */\n readonly name?: string;\n /**\n * The page's appearing work (MAUI `OnAppearingAfterParentAsync`), run through the provider's safe executor each time\n * the host becomes active; `signal` aborts when it stops being active or unmounts. On the first appearance the\n * loading cover waits for it (unless `manualRelease`).\n */\n readonly onAppearing?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Runs each time the host stops being active (MAUI `OnDisappearingAfterParentAsync`), guarded. */\n readonly onDisappearing?: () => void | Promise<void>;\n /** The page's own back handling (MAUI `TryHandleInAppBack`), asked after every overlay. */\n readonly onBack?: () => G9BackResult | boolean;\n /** Swallow every system back press before anything else runs (MAUI `IsHardwareBackSuppressed`). Default `false`. */\n readonly backSuppressed?: boolean;\n /** Show the page-loading cover until the page is ready (MAUI `G9PageLoadingOverlay`, always on). Default `true`. */\n readonly loadingCover?: boolean;\n /** The page releases the cover itself through `useG9HostReady().release()` (MAUI `PageLoadingManualRelease`). */\n readonly manualRelease?: boolean;\n /** Extra delay after ready (MAUI `PageLoadingDismissDelayMs`). Default `settings.pageLoading.dismissDelayMs` (369). */\n readonly dismissDelayMs?: number;\n /** Hard cap on the cover (MAUI `PageLoadingSafetyTimeoutMs`). Default `settings.pageLoading.safetyTimeoutMs` (5000). */\n readonly safetyTimeoutMs?: number;\n /** Dismiss the soft keyboard on a tap outside any keyboard target (MAUI `TapOutsideKeyboardDismisser`). Default `true`. */\n readonly dismissKeyboardOnTapOutside?: boolean;\n /** Per-layer container; a layer over a native view (map, video) needs `'overlay'`. Default `'tree'` for each. */\n readonly layerContainers?: Partial<Record<G9OverlayLayer, G9LayerContainer>>;\n /** MAUI `ComputeBottomSafeAreaWithTabBar`: the bottom inset plus the page's own tab bar. Default: the inset. */\n readonly computeBottomSafeAreaWithTabBar?: (bottomInset: number) => number;\n /** The page background (MAUI `ApplyThemedBackground`). Default `var(--g9-background)`. */\n readonly background?: string;\n /** The colour behind the content, shown when a sheet recedes the page (MAUI `BackdropHost`). Default black. */\n readonly backdropColor?: string;\n readonly className?: string;\n /** The page's place in the navigation (`@g9tm/lynxcontrols/route`), declared while the host is active. */\n readonly route?: G9SegmentInput;\n /** How the router leaves the page (pop it). Without it the router cannot close the page. */\n readonly routeClose?: () => void;\n}\n\n/** The nearest host, for hooks. */\nexport const G9HostContext = createContext<G9HostHandle | null>(null);\n/** The nearest host's insets. */\nexport const G9HostInsetsContext = createContext<G9HostInsets | null>(null);\n/** The nearest host's readiness controller. */\nexport const G9HostReadinessContext = createContext<G9HostReadinessController | null>(null);\n\nconst OVERLAY_LAYERS = g9LayerOrder.filter((layer): layer is G9OverlayLayer => layer !== 'content');\nlet hostSequence = 0;\n\n// The inner name must differ from the binding: rslib renames `const X = memo(function X…)` with a module prefix and the\n// in-module `<X>` then compiles as an unknown intrinsic element (E20; scripts/check-dist-jsx.mjs).\nconst HostLayer = memo(function HostLayerRender(props: {\n readonly hostId: string;\n readonly store: G9LayerStore;\n readonly layer: G9OverlayLayer;\n readonly container: G9LayerContainer;\n}): ReactNode {\n const { hostId, store, layer, container } = props;\n const entries = useSyncExternalStore(\n (listener) => store.subscribe(layer, listener),\n () => store.getSnapshot(layer),\n );\n if (entries.length === 0) return null;\n const className = `g9-host__layer g9-host__layer--${layer}`;\n const items = entries.map((entry) => <Fragment key={entry.key}>{entry.element}</Fragment>);\n if (container === 'overlay') {\n return (\n <OverlayView container=\"window\" className={className} id={`${hostId}-${layer}`}>\n {items}\n </OverlayView>\n );\n }\n return <view className={className}>{items}</view>;\n});\n\n/**\n * The page frame (MAUI `G9PageBase` + `G9PageTemplate`): the content and the overlay layers in a fixed z-order\n * (`content` → `edgePanel` → `sheets` → `popups` → `feedback` → `floating`, then the loading cover), the page's back\n * stack, readiness and loading cover, safe-area insets, tap-outside keyboard dismissal, and its registration in\n * `g9Hosts` for code outside the tree. One per page; hosts may nest. Must be inside `G9Provider`.\n *\n * Layers are input-transparent (`pointer-events: none`), so empty areas pass touches to the layers below; each item\n * receives its own touches only when its root sets `pointer-events: auto` — Lynx inherits pointer-events, so an item\n * without it is transparent as well. An empty layer renders nothing.\n */\nexport function G9Host(props: G9HostProps): ReactNode {\n const core = useG9Core();\n const settings = useG9Settings();\n const parent = useContext(G9HostContext);\n const keyboard = useContext(G9KeyboardContext);\n const providerInsets = useG9SafeInsets();\n const active = props.active ?? true;\n const routeClose = props.routeClose;\n useG9Place(\n props.route ? { segment: props.route, layer: 'page', ...(routeClose ? { close: () => routeClose() } : {}) } : null,\n { active },\n );\n const name = props.name ?? 'G9Host';\n\n const latest = useRef(props);\n latest.current = props;\n\n const bottomWithTabBar = props.computeBottomSafeAreaWithTabBar\n ? props.computeBottomSafeAreaWithTabBar(providerInsets.bottom)\n : providerInsets.bottom;\n const insets = useMemo<G9HostInsets>(\n () => Object.freeze({ ...providerInsets, bottomWithTabBar }),\n [providerInsets, bottomWithTabBar],\n );\n const insetsRef = useRef(insets);\n insetsRef.current = insets;\n\n const [state] = useState(() => {\n hostSequence += 1;\n const id = `g9-host-${hostSequence}`;\n const layers = createLayerStore();\n const back = createBackStack({\n isSuppressed: () => latest.current.backSuppressed === true,\n onHandlerError: (error) =>\n core.diagnostics.log({ level: 'error', message: 'A back handler threw.', source: name, error }),\n });\n const features = new Map<string, unknown>();\n let released = false;\n let contentEffect: G9HostContentEffect | null = null;\n const effectListeners = new Set<() => void>();\n const readiness = createHostReadiness({\n cover: props.loadingCover ?? true,\n manualRelease: props.manualRelease ?? false,\n dismissDelayMs: props.dismissDelayMs ?? settings.pageLoading.dismissDelayMs,\n safetyTimeoutMs: props.safetyTimeoutMs ?? settings.pageLoading.safetyTimeoutMs,\n startActivity: () => {\n const scope = core.diagnostics.activity(`page:${name}`);\n return () => scope.dispose();\n },\n runAppearing: async (signal) => {\n const onAppearing = latest.current.onAppearing;\n if (!onAppearing) return;\n await core.executor.run((context) => onAppearing({ signal: context.signal }), {\n source: name,\n throttleKey: `${id}.onAppearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n signal,\n });\n },\n });\n const handle: G9HostHandle = {\n id,\n parent,\n services: core.services,\n anchors: core.anchors,\n layers,\n registerLayerItem(layer, item) {\n if (released) return () => {};\n return layers.register(layer, item);\n },\n removeLayerItem: (layer, key) => layers.remove(layer, key),\n back,\n getInsets: () => insetsRef.current,\n readiness,\n attachFeature(key, value) {\n if (features.has(key)) throw new G9Error('host-feature', `Host feature '${String(key)}' is already attached.`);\n features.set(key, value);\n return () => {\n if (features.get(key) === value) features.delete(key);\n };\n },\n getFeature: (key) => features.get(key) as never,\n get released() {\n return released;\n },\n setContentEffect(effect) {\n if (released || contentEffect === effect) return;\n contentEffect = effect;\n for (const listener of [...effectListeners]) listener();\n },\n getContentEffect: () => contentEffect,\n };\n const effectStore = {\n subscribe(listener: () => void) {\n effectListeners.add(listener);\n return () => {\n effectListeners.delete(listener);\n };\n },\n getSnapshot: () => contentEffect,\n };\n return {\n handle,\n readiness,\n effectStore,\n release() {\n released = true;\n features.clear();\n },\n };\n });\n const { handle, readiness, effectStore } = state;\n\n // Unmount: synchronous unregistration and release of everything the host owns.\n useEffect(\n () => () => {\n hostRegistry.remove(handle);\n readiness.dispose();\n handle.layers.clear();\n handle.back.clear();\n state.release();\n },\n [handle, readiness, state],\n );\n\n // Visibility drives the registry and the appearing/disappearing lifecycle.\n const wasActive = useRef<boolean | null>(null);\n useEffect(() => {\n const previous = wasActive.current;\n wasActive.current = active;\n if (active) {\n hostRegistry.activate(handle);\n readiness.appear();\n return;\n }\n if (previous === null) {\n hostRegistry.register(handle);\n return;\n }\n hostRegistry.markOffScreen(handle);\n readiness.disappear();\n const onDisappearing = latest.current.onDisappearing;\n if (onDisappearing) {\n core.executor.runSafe(() => onDisappearing(), {\n source: name,\n throttleKey: `${handle.id}.onDisappearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n });\n }\n }, [active, handle, readiness, core, name]);\n\n // The page's own back handling sits in the content layer, below every overlay.\n const hasOnBack = props.onBack !== undefined;\n useEffect(\n () => (hasOnBack ? handle.back.push(() => latest.current.onBack?.() ?? 'pass') : undefined),\n [hasOnBack, handle],\n );\n\n const keyboardVisible = useRef(false);\n keyboardVisible.current = keyboard?.visible === true;\n const onCaptureTap = useStableCallback((event: { target?: { dataset?: Record<string, unknown> } }) => {\n if (!keyboardVisible.current || isKeyboardTarget(event.target)) return;\n core.services.host.hideKeyboard();\n });\n\n const cover = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot).cover;\n const effect = useSyncExternalStore(effectStore.subscribe, effectStore.getSnapshot);\n const containers = props.layerContainers ?? {};\n const tapOutside = props.dismissKeyboardOnTapOutside ?? true;\n\n return (\n <G9HostContext.Provider value={handle}>\n <G9HostInsetsContext.Provider value={insets}>\n <G9HostReadinessContext.Provider value={readiness}>\n <view\n className={`g9-host${props.className ? ` ${props.className}` : ''}`}\n {...(tapOutside ? { 'capture-bindtap': onCaptureTap } : {})}\n >\n <view\n className=\"g9-host__backdrop\"\n style={{ backgroundColor: effect?.backdropColor ?? props.backdropColor ?? '#000000' }}\n />\n <view\n className=\"g9-host__content\"\n style={{\n backgroundColor: props.background ?? 'var(--g9-background)',\n transform: effect\n ? `translateY(${effect.translateY}px) scale(${effect.scale})`\n : 'translateY(0px) scale(1)',\n transition: `transform ${g9Ms(effect?.durationMs ?? 300)}ms ease-out`,\n }}\n >\n {props.children}\n </view>\n {OVERLAY_LAYERS.map((layer) => (\n <HostLayer\n key={layer}\n hostId={handle.id}\n store={handle.layers}\n layer={layer}\n container={containers[layer] ?? 'tree'}\n />\n ))}\n {cover === 'hidden' ? null : (\n <G9PageLoadingOverlay\n exiting={cover === 'exiting'}\n backgroundColor={settings.pageLoading.backgroundColor}\n spinnerColor={settings.pageLoading.spinnerColor}\n />\n )}\n </view>\n </G9HostReadinessContext.Provider>\n </G9HostInsetsContext.Provider>\n </G9HostContext.Provider>\n );\n}\n"],"names":["G9HostContext","createContext","G9HostInsetsContext","G9HostReadinessContext","OVERLAY_LAYERS","g9LayerOrder","layer","hostSequence","HostLayer","memo","props","hostId","store","container","entries","useSyncExternalStore","listener","className","items","entry","Fragment","OverlayView","view","G9Host","_props_active","_props_name","_props_layerContainers","_props_dismissKeyboardOnTapOutside","_ref","_props_background","core","useG9Core","settings","useG9Settings","parent","useContext","keyboard","G9KeyboardContext","providerInsets","useG9SafeInsets","active","routeClose","useG9Place","name","latest","useRef","bottomWithTabBar","insets","useMemo","Object","insetsRef","state","useState","_props_loadingCover","_props_manualRelease","_props_dismissDelayMs","_props_safetyTimeoutMs","id","layers","createLayerStore","back","createBackStack","error","features","Map","released","contentEffect","effectListeners","Set","readiness","createHostReadiness","scope","signal","onAppearing","context","handle","item","key","value","G9Error","String","effect","effectStore","useEffect","hostRegistry","wasActive","previous","onDisappearing","hasOnBack","undefined","_latest_current","keyboardVisible","onCaptureTap","useStableCallback","event","isKeyboardTarget","cover","containers","tapOutside","g9Ms","_containers_layer","G9PageLoadingOverlay"],"mappings":";;;;;;;;;;;;;;AA6EO,MAAMA,gBAAgBC,cAAmC;AAEzD,MAAMC,sBAAsBD,cAAmC;AAE/D,MAAME,yBAAyBF,cAAgD;AAEtF,MAAMG,iBAAiBC,aAAa,MAAM,CAAC,CAACC,QAAmCA,AAAU,cAAVA;AAC/E,IAAIC,eAAe;AAInB,MAAMC,YAAYC,KAAK,SAAyBC,KAK/C;IACC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEN,KAAK,EAAEO,SAAS,EAAE,GAAGH;IAC5C,MAAMI,UAAUC,qBACd,CAACC,WAAaJ,MAAM,SAAS,CAACN,OAAOU,WAC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C,UAAU,EAAEkB,KAAK,QAADA,CAAAA,QAAClB,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,UAAU,AAAD,IAAC,QAAI,KAAK,WAAW,CAAC;IACvE,GACD;cACC,CAACvE,MAAM,QAAQ,CAAC;YAClB,EAAEY,KAAK;YACP,CAAClB,eAAe,GAAG,CAAC,CAACE;YAMN8F;gBALZ5F,UACC,KAAKF,OACL,QAAQqE,OAAO,EAAE,EACjB,OAAOA,OAAO,MAAM,EACpB,OAAOrE,OACP,WAAW,QAAA8F,CAAAA,oBAAAA,UAAU,CAAC9F,MAAM,AAAD,IAAhB8F,oBAAqB;OAEjC;YACH,CAACJ,AAAU,aAAVA,QAAqB,QACnBK,qBACC,SAASL,AAAU,cAAVA,OACT,iBAAiBhE,SAAS,WAAW,CAAC,eAAe,EACrD,cAAcA,SAAS,WAAW,CAAC,YAAY,IAEjD;UACJ,EAAEV,KAAK;QACT,EAAEnB,uBAAuB,SAAS;MACpC,EAAED,oBAAoB,SAAS;IACjC,EAAEF,cAAc;AAEpB"}
@@ -11,8 +11,9 @@ import type { ReactNode } from '@lynx-js/react';
11
11
  * | `popups` | `G9PopupHost` | popups (WP07) |
12
12
  * | `feedback` | `ToastHost` | toasts, loaders, progress overlays: above sheets and popups |
13
13
  * | `floating` | `DevHost` | always-available floating affordances (developer FAB, QA pill) |
14
+ * | `guide` | (Lynx) | the guide's highlights, spotlight, finger, bubbles and its guided-save confirmation |
14
15
  *
15
- * Only the page-loading cover sits above `floating`.
16
+ * Only the page-loading cover sits above `guide`.
16
17
  */
17
18
  export declare const G9Layer: {
18
19
  readonly Content: "content";
@@ -21,6 +22,7 @@ export declare const G9Layer: {
21
22
  readonly Popups: "popups";
22
23
  readonly Feedback: "feedback";
23
24
  readonly Floating: "floating";
25
+ readonly Guide: "guide";
24
26
  };
25
27
  export type G9Layer = (typeof G9Layer)[keyof typeof G9Layer];
26
28
  /** Every layer, bottom to top. */
@@ -1 +1 @@
1
- {"version":3,"file":"layers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AC,KAAK,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;IAChE,4EAA4E;IAC5E,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IACnE;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC;IAC/D,gEAAgE;IAChE,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACpD,kCAAkC;IAClC,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAAC;IACrC,wDAAwD;IACxD,KAAK,IAAI,IAAI,CAAC;CACf;AAsBD,6CAA6C;AAC7C,wBAAgB,gBAAgB,IAAI,YAAY,CAsE/C"}
@@ -5,7 +5,8 @@ const G9Layer = {
5
5
  Sheets: 'sheets',
6
6
  Popups: 'popups',
7
7
  Feedback: 'feedback',
8
- Floating: 'floating'
8
+ Floating: 'floating',
9
+ Guide: 'guide'
9
10
  };
10
11
  const g9LayerOrder = Object.freeze([
11
12
  'content',
@@ -13,7 +14,8 @@ const g9LayerOrder = Object.freeze([
13
14
  'sheets',
14
15
  'popups',
15
16
  'feedback',
16
- 'floating'
17
+ 'floating',
18
+ 'guide'
17
19
  ]);
18
20
  function layerRank(layer) {
19
21
  const rank = g9LayerOrder.indexOf(layer);
@@ -1 +1 @@
1
- {"version":3,"file":"host/layers.jsx","sources":["../../src/host/layers.ts"],"sourcesContent":["import { G9Error } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\n\n/**\n * The page layers a `G9Host` owns, bottom to top (plan/specs/01 §5, MAUI `G9PageTemplate.xaml` z-stack). Sibling order\n * is the z-order; nothing relies on `z-index`.\n *\n * | Layer | MAUI template host | Holds |\n * | --- | --- | --- |\n * | `content` | `ContentHost` | the page itself (painted over `BackdropHost`) |\n * | `edgePanel` | (page content) | side panels sliding over the content (WP06) |\n * | `sheets` | `OverlayHost` | bottom sheets and their scrims (WP05) |\n * | `popups` | `G9PopupHost` | popups (WP07) |\n * | `feedback` | `ToastHost` | toasts, loaders, progress overlays: above sheets and popups |\n * | `floating` | `DevHost` | always-available floating affordances (developer FAB, QA pill) |\n *\n * Only the page-loading cover sits above `floating`.\n */\nexport const G9Layer = {\n Content: 'content',\n EdgePanel: 'edgePanel',\n Sheets: 'sheets',\n Popups: 'popups',\n Feedback: 'feedback',\n Floating: 'floating',\n} as const;\nexport type G9Layer = (typeof G9Layer)[keyof typeof G9Layer];\n\n/** Every layer, bottom to top. */\nexport const g9LayerOrder: readonly G9Layer[] = Object.freeze([\n 'content',\n 'edgePanel',\n 'sheets',\n 'popups',\n 'feedback',\n 'floating',\n]);\n\n/** The layers items can be registered into (`content` is the page's own children). */\nexport type G9OverlayLayer = Exclude<G9Layer, 'content'>;\n\n/** Position of `layer` in the z-stack (0 = bottom). */\nexport function layerRank(layer: G9Layer): number {\n const rank = g9LayerOrder.indexOf(layer);\n if (rank < 0) throw new G9Error('host-layer', `\"${String(layer)}\" is not a G9 layer.`);\n return rank;\n}\n\n/** One thing mounted into a layer. */\nexport interface G9LayerItem {\n /** Identity within the layer. Registering an existing key replaces its element and order in place. */\n readonly key: string;\n /** What to render. */\n readonly element: ReactNode;\n /** Ordering inside the layer: lower paints first (below). Ties keep registration order (later on top). Default 0. */\n readonly order?: number;\n}\n\n/** A registered item as the layer renders it. */\nexport interface G9LayerEntry {\n readonly key: string;\n readonly element: ReactNode;\n readonly order: number;\n /** Registration sequence; stable while the key stays registered. */\n readonly sequence: number;\n}\n\n/** The items of every overlay layer of one host. */\nexport interface G9LayerStore {\n /** The layer's items, bottom first. The same array until the layer changes. */\n getSnapshot(layer: G9OverlayLayer): ReadonlyArray<G9LayerEntry>;\n /** Called after each change of `layer`. Returns an unsubscribe function. */\n subscribe(layer: G9OverlayLayer, listener: () => void): () => void;\n /**\n * Mounts `item` into `layer` (or replaces the item with the same key). Returns a function that removes exactly this\n * registration: it does nothing once the key was removed or registered again by someone else.\n */\n register(layer: G9OverlayLayer, item: G9LayerItem): () => void;\n /** Removes the item with `key`; `false` when there was none. */\n remove(layer: G9OverlayLayer, key: string): boolean;\n /** Number of items in `layer`. */\n count(layer: G9OverlayLayer): number;\n /** Removes every item of every layer (host unmount). */\n clear(): void;\n}\n\nconst EMPTY: ReadonlyArray<G9LayerEntry> = Object.freeze([]);\n\nfunction checkLayer(layer: G9OverlayLayer): void {\n if (layer === ('content' as G9Layer)) {\n throw new G9Error('host-layer', 'The content layer holds the page itself; register items into an overlay layer.');\n }\n layerRank(layer);\n}\n\nfunction checkItem(item: G9LayerItem): number {\n if (typeof item?.key !== 'string' || item.key === '') {\n throw new G9Error('host-layer-item', 'A layer item needs a non-empty string key.');\n }\n const order = item.order ?? 0;\n if (typeof order !== 'number' || !Number.isFinite(order)) {\n throw new G9Error('host-layer-item', `Layer item \"${item.key}\" has an invalid order (${String(order)}).`);\n }\n return order;\n}\n\n/** Creates an empty {@link G9LayerStore}. */\nexport function createLayerStore(): G9LayerStore {\n const layers = new Map<G9OverlayLayer, Map<string, G9LayerEntry>>();\n const snapshots = new Map<G9OverlayLayer, ReadonlyArray<G9LayerEntry>>();\n const listeners = new Map<G9OverlayLayer, Set<() => void>>();\n let sequence = 0;\n\n function changed(layer: G9OverlayLayer): void {\n const entries = Array.from(layers.get(layer)?.values() ?? []);\n entries.sort((a, b) => a.order - b.order || a.sequence - b.sequence);\n snapshots.set(layer, entries.length ? Object.freeze(entries) : EMPTY);\n for (const listener of Array.from(listeners.get(layer) ?? [])) listener();\n }\n\n const store: G9LayerStore = {\n getSnapshot(layer) {\n return snapshots.get(layer) ?? EMPTY;\n },\n subscribe(layer, listener) {\n checkLayer(layer);\n let set = listeners.get(layer);\n if (!set) {\n set = new Set();\n listeners.set(layer, set);\n }\n set.add(listener);\n return () => {\n set.delete(listener);\n };\n },\n register(layer, item) {\n checkLayer(layer);\n const order = checkItem(item);\n let entries = layers.get(layer);\n if (!entries) {\n entries = new Map();\n layers.set(layer, entries);\n }\n const existing = entries.get(item.key);\n sequence += 1;\n const entry: G9LayerEntry = Object.freeze({\n key: item.key,\n element: item.element,\n order,\n sequence: existing ? existing.sequence : sequence,\n });\n entries.set(item.key, entry);\n changed(layer);\n return () => {\n if (layers.get(layer)?.get(item.key) === entry) store.remove(layer, item.key);\n };\n },\n remove(layer, key) {\n checkLayer(layer);\n const entries = layers.get(layer);\n if (!entries?.delete(key)) return false;\n changed(layer);\n return true;\n },\n count(layer) {\n return layers.get(layer)?.size ?? 0;\n },\n clear() {\n for (const [layer, entries] of Array.from(layers)) {\n if (entries.size === 0) continue;\n entries.clear();\n changed(layer);\n }\n },\n };\n return store;\n}\n"],"names":["G9Layer","g9LayerOrder","Object","layerRank","layer","rank","G9Error","String","EMPTY","checkLayer","checkItem","item","_item_order","order","Number","createLayerStore","layers","Map","snapshots","listeners","sequence","changed","_listeners_get","_layers_get","entries","Array","a","b","listener","store","_snapshots_get","set","Set","existing","entry","key"],"mappings":";AAkBO,MAAMA,UAAU;IACrB,SAAS;IACT,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;AACZ;AAIO,MAAMC,eAAmCC,OAAO,MAAM,CAAC;IAC5D;IACA;IACA;IACA;IACA;IACA;CACD;AAMM,SAASC,UAAUC,KAAc;IACtC,MAAMC,OAAOJ,aAAa,OAAO,CAACG;IAClC,IAAIC,OAAO,GAAG,MAAM,IAAIC,QAAQ,cAAc,CAAC,CAAC,EAAEC,OAAOH,OAAO,oBAAoB,CAAC;IACrF,OAAOC;AACT;AAwCA,MAAMG,QAAqCN,OAAO,MAAM,CAAC,EAAE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Cd,QAAQjB;YACR,OAAO;QACT;QACA,OAAMA,KAAK;;gBACFmB;YAAP,OAAO,QAAP,gBAAOA,CAAAA,cAAAA,OAAO,GAAG,CAACnB,MAAK,IAAhBmB,KAAAA,IAAAA,YAAmB,IAAI,AAAD,IAAC,OAAI;QACpC;QACA;YACE,KAAK,MAAM,CAACnB,OAAOoB,QAAQ,IAAIC,MAAM,IAAI,CAACT,QACxC,IAAIQ,AAAiB,MAAjBA,QAAQ,IAAI;gBAChBA,QAAQ,KAAK;gBACbH,QAAQjB;;QAEZ;IACF;IACA,OAAOyB;AACT"}
1
+ {"version":3,"file":"host/layers.jsx","sources":["../../src/host/layers.ts"],"sourcesContent":["import { G9Error } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\n\n/**\n * The page layers a `G9Host` owns, bottom to top (plan/specs/01 §5, MAUI `G9PageTemplate.xaml` z-stack). Sibling order\n * is the z-order; nothing relies on `z-index`.\n *\n * | Layer | MAUI template host | Holds |\n * | --- | --- | --- |\n * | `content` | `ContentHost` | the page itself (painted over `BackdropHost`) |\n * | `edgePanel` | (page content) | side panels sliding over the content (WP06) |\n * | `sheets` | `OverlayHost` | bottom sheets and their scrims (WP05) |\n * | `popups` | `G9PopupHost` | popups (WP07) |\n * | `feedback` | `ToastHost` | toasts, loaders, progress overlays: above sheets and popups |\n * | `floating` | `DevHost` | always-available floating affordances (developer FAB, QA pill) |\n * | `guide` | (Lynx) | the guide's highlights, spotlight, finger, bubbles and its guided-save confirmation |\n *\n * Only the page-loading cover sits above `guide`.\n */\nexport const G9Layer = {\n Content: 'content',\n EdgePanel: 'edgePanel',\n Sheets: 'sheets',\n Popups: 'popups',\n Feedback: 'feedback',\n Floating: 'floating',\n Guide: 'guide',\n} as const;\nexport type G9Layer = (typeof G9Layer)[keyof typeof G9Layer];\n\n/** Every layer, bottom to top. */\nexport const g9LayerOrder: readonly G9Layer[] = Object.freeze([\n 'content',\n 'edgePanel',\n 'sheets',\n 'popups',\n 'feedback',\n 'floating',\n 'guide',\n]);\n\n/** The layers items can be registered into (`content` is the page's own children). */\nexport type G9OverlayLayer = Exclude<G9Layer, 'content'>;\n\n/** Position of `layer` in the z-stack (0 = bottom). */\nexport function layerRank(layer: G9Layer): number {\n const rank = g9LayerOrder.indexOf(layer);\n if (rank < 0) throw new G9Error('host-layer', `\"${String(layer)}\" is not a G9 layer.`);\n return rank;\n}\n\n/** One thing mounted into a layer. */\nexport interface G9LayerItem {\n /** Identity within the layer. Registering an existing key replaces its element and order in place. */\n readonly key: string;\n /** What to render. */\n readonly element: ReactNode;\n /** Ordering inside the layer: lower paints first (below). Ties keep registration order (later on top). Default 0. */\n readonly order?: number;\n}\n\n/** A registered item as the layer renders it. */\nexport interface G9LayerEntry {\n readonly key: string;\n readonly element: ReactNode;\n readonly order: number;\n /** Registration sequence; stable while the key stays registered. */\n readonly sequence: number;\n}\n\n/** The items of every overlay layer of one host. */\nexport interface G9LayerStore {\n /** The layer's items, bottom first. The same array until the layer changes. */\n getSnapshot(layer: G9OverlayLayer): ReadonlyArray<G9LayerEntry>;\n /** Called after each change of `layer`. Returns an unsubscribe function. */\n subscribe(layer: G9OverlayLayer, listener: () => void): () => void;\n /**\n * Mounts `item` into `layer` (or replaces the item with the same key). Returns a function that removes exactly this\n * registration: it does nothing once the key was removed or registered again by someone else.\n */\n register(layer: G9OverlayLayer, item: G9LayerItem): () => void;\n /** Removes the item with `key`; `false` when there was none. */\n remove(layer: G9OverlayLayer, key: string): boolean;\n /** Number of items in `layer`. */\n count(layer: G9OverlayLayer): number;\n /** Removes every item of every layer (host unmount). */\n clear(): void;\n}\n\nconst EMPTY: ReadonlyArray<G9LayerEntry> = Object.freeze([]);\n\nfunction checkLayer(layer: G9OverlayLayer): void {\n if (layer === ('content' as G9Layer)) {\n throw new G9Error('host-layer', 'The content layer holds the page itself; register items into an overlay layer.');\n }\n layerRank(layer);\n}\n\nfunction checkItem(item: G9LayerItem): number {\n if (typeof item?.key !== 'string' || item.key === '') {\n throw new G9Error('host-layer-item', 'A layer item needs a non-empty string key.');\n }\n const order = item.order ?? 0;\n if (typeof order !== 'number' || !Number.isFinite(order)) {\n throw new G9Error('host-layer-item', `Layer item \"${item.key}\" has an invalid order (${String(order)}).`);\n }\n return order;\n}\n\n/** Creates an empty {@link G9LayerStore}. */\nexport function createLayerStore(): G9LayerStore {\n const layers = new Map<G9OverlayLayer, Map<string, G9LayerEntry>>();\n const snapshots = new Map<G9OverlayLayer, ReadonlyArray<G9LayerEntry>>();\n const listeners = new Map<G9OverlayLayer, Set<() => void>>();\n let sequence = 0;\n\n function changed(layer: G9OverlayLayer): void {\n const entries = Array.from(layers.get(layer)?.values() ?? []);\n entries.sort((a, b) => a.order - b.order || a.sequence - b.sequence);\n snapshots.set(layer, entries.length ? Object.freeze(entries) : EMPTY);\n for (const listener of Array.from(listeners.get(layer) ?? [])) listener();\n }\n\n const store: G9LayerStore = {\n getSnapshot(layer) {\n return snapshots.get(layer) ?? EMPTY;\n },\n subscribe(layer, listener) {\n checkLayer(layer);\n let set = listeners.get(layer);\n if (!set) {\n set = new Set();\n listeners.set(layer, set);\n }\n set.add(listener);\n return () => {\n set.delete(listener);\n };\n },\n register(layer, item) {\n checkLayer(layer);\n const order = checkItem(item);\n let entries = layers.get(layer);\n if (!entries) {\n entries = new Map();\n layers.set(layer, entries);\n }\n const existing = entries.get(item.key);\n sequence += 1;\n const entry: G9LayerEntry = Object.freeze({\n key: item.key,\n element: item.element,\n order,\n sequence: existing ? existing.sequence : sequence,\n });\n entries.set(item.key, entry);\n changed(layer);\n return () => {\n if (layers.get(layer)?.get(item.key) === entry) store.remove(layer, item.key);\n };\n },\n remove(layer, key) {\n checkLayer(layer);\n const entries = layers.get(layer);\n if (!entries?.delete(key)) return false;\n changed(layer);\n return true;\n },\n count(layer) {\n return layers.get(layer)?.size ?? 0;\n },\n clear() {\n for (const [layer, entries] of Array.from(layers)) {\n if (entries.size === 0) continue;\n entries.clear();\n changed(layer);\n }\n },\n };\n return store;\n}\n"],"names":["G9Layer","g9LayerOrder","Object","layerRank","layer","rank","G9Error","String","EMPTY","checkLayer","checkItem","item","_item_order","order","Number","createLayerStore","layers","Map","snapshots","listeners","sequence","changed","_listeners_get","_layers_get","entries","Array","a","b","listener","store","_snapshots_get","set","Set","existing","entry","key"],"mappings":";AAmBO,MAAMA,UAAU;IACrB,SAAS;IACT,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;IACV,OAAO;AACT;AAIO,MAAMC,eAAmCC,OAAO,MAAM,CAAC;IAC5D;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAMM,SAASC,UAAUC,KAAc;IACtC,MAAMC,OAAOJ,aAAa,OAAO,CAACG;IAClC,IAAIC,OAAO,GAAG,MAAM,IAAIC,QAAQ,cAAc,CAAC,CAAC,EAAEC,OAAOH,OAAO,oBAAoB,CAAC;IACrF,OAAOC;AACT;AAwCA,MAAMG,QAAqCN,OAAO,MAAM,CAAC,EAAE;AAE3D,SAASO,WAAWL,KAAqB;IACvC,IAAIA,AAAW,cAAXA,OACF,MAAM,IAAIE,QAAQ,cAAc;IAElCH,UAAUC;AACZ;AAEA,SAASM,UAAUC,IAAiB;QAIpBC;IAHd,IAAI,AAAqB,YAArB,OAAOD,CAAAA,QAAAA,OAAAA,KAAAA,IAAAA,KAAM,GAAG,AAAD,KAAkBA,AAAa,OAAbA,KAAK,GAAG,EAC3C,MAAM,IAAIL,QAAQ,mBAAmB;IAEvC,MAAMO,QAAQ,QAAAD,CAAAA,cAAAA,KAAK,KAAK,AAAD,IAATA,cAAc;IAC5B,IAAI,AAAiB,YAAjB,OAAOC,SAAsB,CAACC,OAAO,QAAQ,CAACD,QAChD,MAAM,IAAIP,QAAQ,mBAAmB,CAAC,YAAY,EAAEK,KAAK,GAAG,CAAC,wBAAwB,EAAEJ,OAAOM,OAAO,EAAE,CAAC;IAE1G,OAAOA;AACT;AAGO,SAASE;IACd,MAAMC,SAAS,IAAIC;IACnB,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rCS,YAAY;YACZ,MAAMc,QAAsBhC,OAAO,MAAM,CAAC;gBACxC,KAAKS,KAAK,GAAG;gBACb,SAASA,KAAK,OAAO;gBACrBE;gBACA,UAAUoB,WAAWA,SAAS,QAAQ,GAAGb;YAC3C;YACAI,QAAQ,GAAG,CAACb,KAAK,GAAG,EAAEuB;YACtBb,QAAQjB;YACR,OAAO;oBACDmB;gBAAJ,IAAIA,AAAAA,SAAAA,CAAAA,cAAAA,OAAO,GAAG,CAACnB,MAAK,IAAhBmB,KAAAA,IAAAA,YAAmB,GAAG,CAACZ,KAAK,GAAG,OAAMuB,OAAOL,MAAM,MAAM,CAACzB,OAAOO,KAAK,GAAG;YAC9E;QACF;QACA,QAAOP,KAAK,EAAE+B,GAAG;YACf1B,WAAWL;YACX,MAAMoB,UAAUR,OAAO,GAAG,CAACZ;YAC3B,IAAI,CAACoB,CAAAA,QAAAA,UAAAA,KAAAA,IAAAA,QAAS,MAAM,CAACW,IAAG,GAAG,OAAO;YAClCd,QAAQjB;YACR,OAAO;QACT;QACA,OAAMA,KAAK;;gBACFmB;YAAP,OAAO,QAAP,gBAAOA,CAAAA,cAAAA,OAAO,GAAG,CAACnB,MAAK,IAAhBmB,KAAAA,IAAAA,YAAmB,IAAI,AAAD,IAAC,OAAI;QACpC;QACA;YACE,KAAK,MAAM,CAACnB,OAAOoB,QAAQ,IAAIC,MAAM,IAAI,CAACT,QACxC,IAAIQ,AAAiB,MAAjBA,QAAQ,IAAI;gBAChBA,QAAQ,KAAK;gBACbH,QAAQjB;;QAEZ;IACF;IACA,OAAOyB;AACT"}
@@ -1,4 +1,5 @@
1
1
  import type { G9Capabilities } from '@g9tm/lynxcontrols-foundation';
2
+ import type { G9AnchorRegistry } from '../anchor/registry.js';
2
3
  import type { G9BackStack } from './back.js';
3
4
  import type { G9LayerItem, G9LayerStore, G9OverlayLayer } from './layers.js';
4
5
  import type { G9HostReadiness } from './readiness.js';
@@ -31,6 +32,8 @@ export interface G9HostHandle {
31
32
  readonly parent: G9HostHandle | null;
32
33
  /** The services of the provider this host lives in. */
33
34
  readonly services: G9Capabilities;
35
+ /** The provider's anchors (every control a guide or an automation can reach). */
36
+ readonly anchors: G9AnchorRegistry;
34
37
  /** The overlay layers (MAUI `OverlayLayer` = `sheets`, `ToastLayer` = `feedback`, `DevLayer` = `floating`). */
35
38
  readonly layers: G9LayerStore;
36
39
  /** Shorthand for `layers.register`. */
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/host/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,mGAAmG;AACnG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gHAAgH;IAChH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED;;;GAGG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG,MAAM,cAAc,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACpE,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAEpF;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,6C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undation';\nimport { G9Error } from '@g9tm/lynxcontrols-foundation';\nimport type { G9BackStack } from './back';\nimport type { G9LayerItem, G9LayerStore, G9OverlayLayer } from './layers';\nimport type { G9HostReadiness } from './readiness';\n\n/** Safe-area insets of a host, with the bottom inset that also reserves the page's own tab bar. */\nexport interface G9HostInsets {\n readonly top: number;\n readonly end: number;\n readonly bottom: number;\n readonly start: number;\n /** MAUI `BottomSafeAreaWithTabBar`: `bottom` unless the host's `computeBottomSafeAreaWithTabBar` adds a bar. */\n readonly bottomWithTabBar: number;\n}\n\n/**\n * Feature controllers later packages attach to a host (sheets, popups, toasts). Augment this interface to type them:\n * `declare module '@g9tm/lynxcontrols/host' { interface G9HostFeatures { sheets: G9SheetsController } }`.\n */\n// biome-ignore lint/suspicious/noEmptyInterface: augmentation point for later work packages\nexport interface G9HostFeatures {}\n\n/** A feature key: a declared {@link G9HostFeatures} key, or any string for untyped use. */\nexport type G9HostFeatureKey = keyof G9HostFeatures | (string & {});\ntype FeatureValue<K> = K extends keyof G9HostFeatures ? G9HostFeatures[K] : unknown;\n\n/**\n * One mounted `G9Host`, as code outside the component tree sees it (MAUI `IG9OverlayHost` plus the page's back and\n * readiness): the layers to mount into, the back stack, the insets, the services of its provider.\n */\nexport interface G9HostHandle {\n /** Unique per mounted host. */\n readonly id: string;\n /** The nearest enclosing host, or `null`. */\n readonly parent: G9HostHandle | null;\n /** The services of the provider this host lives in. */\n readonly services: G9Capabilities;\n /** The overlay layers (MAUI `OverlayLayer` = `sheets`, `ToastLayer` = `feedback`, `DevLayer` = `floating`). */\n readonly layers: G9LayerStore;\n /** Shorthand for `layers.register`. */\n registerLayerItem(layer: G9OverlayLayer, item: G9LayerItem): () => void;\n /** Shorthand for `layers.remove`. */\n removeLayerItem(layer: G9OverlayLayer, key: string): boolean;\n /** The host's back handlers. */\n readonly back: G9BackStack;\n /** Current insets (MAUI `Page.TopSafeAreaInset` and friends). */\n getInsets(): G9HostInsets;\n /** The page-loading cover and ready signal. */\n readonly readiness: G9HostReadiness;\n /** Attaches a feature controller; returns its detach function. Attaching a key twice throws. */\n attachFeature<K extends G9HostFeatureKey>(key: K, value: FeatureValue<K>): () => void;\n /** The attached feature, or `undefined`. */\n getFeature<K extends G9HostFeatureKey>(key: K): FeatureValue<K> | undefined;\n /** `true` once the host unmounted; a released handle refuses new layer items. */\n readonly released: boolean;\n /**\n * Transforms the page content (the sheets' backdrop-card recede, MAUI `BackdropHost`): `scale` and `translateY`\n * with a transition of `durationMs`; `null` restores it. The backdrop colour shows around the scaled page.\n */\n setContentEffect(effect: G9HostContentEffect | null): void;\n /** The current content effect (`null` = identity). */\n getContentEffect(): G9HostContentEffect | null;\n}\n\n/** A transform of the page content (see {@link G9HostHandle.setContentEffect}). */\nexport interface G9HostContentEffect {\n readonly scale: number;\n readonly translateY: number;\n readonly durationMs: number;\n /** Colour shown around the receded page. */\n readonly backdropColor?: string;\n}\n\n/** Listener of {@link G9HostRegistry.subscribe}. */\nexport type G9HostListener = (host: G9HostHandle | null) => void;\n\n/**\n * Finds the host for code that is not a component (MAUI `G9OverlayHosts`): view models, services, startup hooks.\n *\n * **Which host is active.** The registry is a most-recent-first stack of mounted hosts. A host is *on screen* while its\n * `active` prop is `true` (the default). The active host is the most recently activated host that is on screen —\n * except that a host never outranks a mounted, on-screen host nested inside it (the nested one is drawn on top of its\n * parent's content). When no host is on screen, the most recently registered one is active (app start, tab switch).\n * Unmounting a host removes it synchronously; the host beneath becomes active again. There is no \"last page\" leak.\n */\nexport interface G9HostRegistry {\n /** The active host, or `null` (MAUI `TryGetCurrent`): before the first host mounts and after the last unmounts. */\n active(): G9HostHandle | null;\n /** The active host, or throws `G9Error('host-missing')` (MAUI `GetCurrent`). For user-gesture code only. */\n require(): G9HostHandle;\n /**\n * Called when the active host changes (MAUI `CurrentChanged`), with the new host or `null`. Not called when a host\n * merely re-asserts what is already active. Returns an unsubscribe function.\n */\n subscribe(listener: G9HostListener): () => void;\n /** Number of mounted hosts. */\n readonly size: number;\n}\n\ninterface Slot {\n readonly host: G9HostHandle;\n onScreen: boolean;\n}\n\nconst slots: Slot[] = [];\nconst listeners = new Set<G9HostListener>();\n\nfunction isDescendant(host: G9HostHandle, ancestor: G9HostHandle): boolean {\n for (let p = host.parent; p; p = p.parent) if (p === ancestor) return true;\n return false;\n}\n\nfunction resolve(): G9HostHandle | null {\n const onScreen = slots.filter((slot) => slot.onScreen);\n let current = onScreen[0]?.host ?? slots[0]?.host ?? null;\n if (!current || onScreen.length === 0) return current;\n for (;;) {\n const parent: G9HostHandle = current;\n const nested = onScreen.find((slot) => isDescendant(slot.host, parent));\n if (!nested) return current;\n current = nested.host;\n }\n}\n\nfunction mutate(change: () => void): void {\n const before = resolve();\n change();\n const after = resolve();\n if (before === after) return;\n let failure: { error: unknown } | null = null;\n for (const listener of Array.from(listeners)) {\n if (!listeners.has(listener)) continue;\n try {\n listener(after);\n } catch (error) {\n failure ??= { error };\n }\n }\n if (failure) throw failure.error;\n}\n\nconst indexOf = (host: G9HostHandle) => slots.findIndex((slot) => slot.host === host);\n\n/** The process-wide host registry (the only mutable module-level state in the library, plan/specs/03 §6). */\nexport const g9Hosts: G9HostRegistry = {\n active: resolve,\n require() {\n const host = resolve();\n if (!host) {\n throw new G9Error(\n 'host-missing',\n 'No G9Host is mounted. Wrap the page in <G9Host> inside <G9Provider>; during startup or teardown use ' +\n 'g9Hosts.active() and handle null.',\n );\n }\n return host;\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n get size() {\n return slots.length;\n },\n};\n\n/**\n * Registry mutators used by `G9Host` (not exported from the package). `activate` puts a host on top and on screen;\n * `register` adds it below every on-screen host without displacing one; `markOffScreen` keeps the entry; `remove`\n * forgets it.\n */\nexport const hostRegistry = {\n activate(host: G9HostHandle): void {\n mutate(() => {\n const index = indexOf(host);\n if (index >= 0) slots.splice(index, 1);\n slots.unshift({ host, onScreen: true });\n });\n },\n register(host: G9HostHandle): void {\n mutate(() => {\n if (indexOf(host) >= 0) return;\n let index = 0;\n slots.forEach((slot, i) => {\n if (slot.onScreen) index = i + 1;\n });\n slots.splice(index, 0, { host, onScreen: false });\n });\n },\n markOffScreen(host: G9HostHandle): void {\n mutate(() => {\n const slot = slots[indexOf(host)];\n if (slot) slot.onScreen = false;\n });\n },\n remove(host: G9HostHandle): void {\n mutate(() => {\n const index = indexOf(host);\n if (index >= 0) slots.splice(index, 1);\n });\n },\n};\n"],"names":["slots","listeners","Set","isDescendant","host","ancestor","p","resolve","_ref","_slots_","onScreen","slot","current","parent","nested","mutate","change","before","after","failure","listener","Array","error","indexOf","g9Hosts","G9Error","hostRegistry","index","i"],"mappings":";AAyGA,MAAMA,QAAgB,EAAE;AACxB,MAAMC,YAAY,IAAIC;AAEtB,SAASC,aAAaC,IAAkB,EAAEC,QAAsB;IAC9D,IAAK,IAAIC,IAAIF,KAAK,MAAM,EAAEE,GAAGA,IAAIA,EAAE,MAAM,CAAE,IAAIA,MAAMD,UAAU,OAAO;IACtE,OAAO;AACT;AAEA,SAASE;QAEOC,MAAAA;QAAAA,YAAqBC;IADnC,MAAMC,WAAWV,MAAM,MAAM,CAAC,CAACW,OAASA,KAAK,QAAQ;IACrD,IAAIC,UAAU,QAAAJ,CAAAA,OAAAA,QAAAA,CAAAA,QAAAA,QAAAA,CAAAA,aAAAA,QAAQ,CAAC,EAAE,AAAD,IAAVA,KAAAA,IAAAA,WAAa,IAAI,AAAD,IAAC,gBAAIC,CAAAA,UAAAA,KAAK,CAAC,EAAE,AAAD,IAAPA,KAAAA,IAAAA,QAAU,IAAI,AAAD,IAAlCD,OAAuC;IACrD,IAAI,CAACI,WAAWF,AAAoB,MAApBA,SAAS,MAAM,EAAQ,OAAOE;IAC9C,OAAS;QACP,MAAMC,SAAuBD;QAC7B,MAAME,SAASJ,SAAS,IAAI,CAAC,CAACC,OAASR,aAAaQ,KAAK,IAAI,EAAEE;QAC/D,IAAI,CAACC,QAAQ,OAAOF;QACpBA,UAAUE,OAAO,IAAI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KAAK,CAACuB,QAAQnB,MAAM;YACjC,IAAIO,MAAMA,KAAK,QAAQ,GAAG;QAC5B;IACF;IACA,QAAOP,IAAkB;QACvBW,OAAO;YACL,MAAMY,QAAQJ,QAAQnB;YACtB,IAAIuB,SAAS,GAAG3B,MAAM,MAAM,CAAC2B,OAAO;QACtC;IACF;AACF"}
1
+ {"version":3,"file":"host/registry.jsx","sources":["../../src/host/registry.ts"],"sourcesContent":["import type { G9Capabilities } from '@g9tm/lynxcontrols-foundation';\nimport { G9Error } from '@g9tm/lynxcontrols-foundation';\nimport type { G9AnchorRegistry } from '../anchor/registry';\nimport type { G9BackStack } from './back';\nimport type { G9LayerItem, G9LayerStore, G9OverlayLayer } from './layers';\nimport type { G9HostReadiness } from './readiness';\n\n/** Safe-area insets of a host, with the bottom inset that also reserves the page's own tab bar. */\nexport interface G9HostInsets {\n readonly top: number;\n readonly end: number;\n readonly bottom: number;\n readonly start: number;\n /** MAUI `BottomSafeAreaWithTabBar`: `bottom` unless the host's `computeBottomSafeAreaWithTabBar` adds a bar. */\n readonly bottomWithTabBar: number;\n}\n\n/**\n * Feature controllers later packages attach to a host (sheets, popups, toasts). Augment this interface to type them:\n * `declare module '@g9tm/lynxcontrols/host' { interface G9HostFeatures { sheets: G9SheetsController } }`.\n */\n// biome-ignore lint/suspicious/noEmptyInterface: augmentation point for later work packages\nexport interface G9HostFeatures {}\n\n/** A feature key: a declared {@link G9HostFeatures} key, or any string for untyped use. */\nexport type G9HostFeatureKey = keyof G9HostFeatures | (string & {});\ntype FeatureValue<K> = K extends keyof G9HostFeatures ? G9HostFeatures[K] : unknown;\n\n/**\n * One mounted `G9Host`, as code outside the component tree sees it (MAUI `IG9OverlayHost` plus the page's back and\n * readiness): the layers to mount into, the back stack, the insets, the services of its provider.\n */\nexport interface G9HostHandle {\n /** Unique per mounted host. */\n readonly id: string;\n /** The nearest enclosing host, or `null`. */\n readonly parent: G9HostHandle | null;\n /** The services of the provider this host lives in. */\n readonly services: G9Capabilities;\n /** The provider's anchors (every control a guide or an automation can reach). */\n readonly anchors: G9AnchorRegistry;\n /** The overlay layers (MAUI `OverlayLayer` = `sheets`, `ToastLayer` = `feedback`, `DevLayer` = `floating`). */\n readonly layers: G9LayerStore;\n /** Shorthand for `layers.register`. */\n registerLayerItem(layer: G9OverlayLayer, item: G9LayerItem): () => void;\n /** Shorthand for `layers.remove`. */\n removeLayerItem(layer: G9OverlayLayer, key: string): boolean;\n /** The host's back handlers. */\n readonly back: G9BackStack;\n /** Current insets (MAUI `Page.TopSafeAreaInset` and friends). */\n getInsets(): G9HostInsets;\n /** The page-loading cover and ready signal. */\n readonly readiness: G9HostReadiness;\n /** Attaches a feature controller; returns its detach function. Attaching a key twice throws. */\n attachFeature<K extends G9HostFeatureKey>(key: K, value: FeatureValue<K>): () => void;\n /** The attached feature, or `undefined`. */\n getFeature<K extends G9HostFeatureKey>(key: K): FeatureValue<K> | undefined;\n /** `true` once the host unmounted; a released handle refuses new layer items. */\n readonly released: boolean;\n /**\n * Transforms the page content (the sheets' backdrop-card recede, MAUI `BackdropHost`): `scale` and `translateY`\n * with a transition of `durationMs`; `null` restores it. The backdrop colour shows around the scaled page.\n */\n setContentEffect(effect: G9HostContentEffect | null): void;\n /** The current content effect (`null` = identity). */\n getContentEffect(): G9HostContentEffect | null;\n}\n\n/** A transform of the page content (see {@link G9HostHandle.setContentEffect}). */\nexport interface G9HostContentEffect {\n readonly scale: number;\n readonly translateY: number;\n readonly durationMs: number;\n /** Colour shown around the receded page. */\n readonly backdropColor?: string;\n}\n\n/** Listener of {@link G9HostRegistry.subscribe}. */\nexport type G9HostListener = (host: G9HostHandle | null) => void;\n\n/**\n * Finds the host for code that is not a component (MAUI `G9OverlayHosts`): view models, services, startup hooks.\n *\n * **Which host is active.** The registry is a most-recent-first stack of mounted hosts. A host is *on screen* while its\n * `active` prop is `true` (the default). The active host is the most recently activated host that is on screen —\n * except that a host never outranks a mounted, on-screen host nested inside it (the nested one is drawn on top of its\n * parent's content). When no host is on screen, the most recently registered one is active (app start, tab switch).\n * Unmounting a host removes it synchronously; the host beneath becomes active again. There is no \"last page\" leak.\n */\nexport interface G9HostRegistry {\n /** The active host, or `null` (MAUI `TryGetCurrent`): before the first host mounts and after the last unmounts. */\n active(): G9HostHandle | null;\n /** The active host, or throws `G9Error('host-missing')` (MAUI `GetCurrent`). For user-gesture code only. */\n require(): G9HostHandle;\n /**\n * Called when the active host changes (MAUI `CurrentChanged`), with the new host or `null`. Not called when a host\n * merely re-asserts what is already active. Returns an unsubscribe function.\n */\n subscribe(listener: G9HostListener): () => void;\n /** Number of mounted hosts. */\n readonly size: number;\n}\n\ninterface Slot {\n readonly host: G9HostHandle;\n onScreen: boolean;\n}\n\nconst slots: Slot[] = [];\nconst listeners = new Set<G9HostListener>();\n\nfunction isDescendant(host: G9HostHandle, ancestor: G9HostHandle): boolean {\n for (let p = host.parent; p; p = p.parent) if (p === ancestor) return true;\n return false;\n}\n\nfunction resolve(): G9HostHandle | null {\n const onScreen = slots.filter((slot) => slot.onScreen);\n let current = onScreen[0]?.host ?? slots[0]?.host ?? null;\n if (!current || onScreen.length === 0) return current;\n for (;;) {\n const parent: G9HostHandle = current;\n const nested = onScreen.find((slot) => isDescendant(slot.host, parent));\n if (!nested) return current;\n current = nested.host;\n }\n}\n\nfunction mutate(change: () => void): void {\n const before = resolve();\n change();\n const after = resolve();\n if (before === after) return;\n let failure: { error: unknown } | null = null;\n for (const listener of Array.from(listeners)) {\n if (!listeners.has(listener)) continue;\n try {\n listener(after);\n } catch (error) {\n failure ??= { error };\n }\n }\n if (failure) throw failure.error;\n}\n\nconst indexOf = (host: G9HostHandle) => slots.findIndex((slot) => slot.host === host);\n\n/** The process-wide host registry (the only mutable module-level state in the library, plan/specs/03 §6). */\nexport const g9Hosts: G9HostRegistry = {\n active: resolve,\n require() {\n const host = resolve();\n if (!host) {\n throw new G9Error(\n 'host-missing',\n 'No G9Host is mounted. Wrap the page in <G9Host> inside <G9Provider>; during startup or teardown use ' +\n 'g9Hosts.active() and handle null.',\n );\n }\n return host;\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n get size() {\n return slots.length;\n },\n};\n\n/**\n * Registry mutators used by `G9Host` (not exported from the package). `activate` puts a host on top and on screen;\n * `register` adds it below every on-screen host without displacing one; `markOffScreen` keeps the entry; `remove`\n * forgets it.\n */\nexport const hostRegistry = {\n activate(host: G9HostHandle): void {\n mutate(() => {\n const index = indexOf(host);\n if (index >= 0) slots.splice(index, 1);\n slots.unshift({ host, onScreen: true });\n });\n },\n register(host: G9HostHandle): void {\n mutate(() => {\n if (indexOf(host) >= 0) return;\n let index = 0;\n slots.forEach((slot, i) => {\n if (slot.onScreen) index = i + 1;\n });\n slots.splice(index, 0, { host, onScreen: false });\n });\n },\n markOffScreen(host: G9HostHandle): void {\n mutate(() => {\n const slot = slots[indexOf(host)];\n if (slot) slot.onScreen = false;\n });\n },\n remove(host: G9HostHandle): void {\n mutate(() => {\n const index = indexOf(host);\n if (index >= 0) slots.splice(index, 1);\n });\n },\n};\n"],"names":["slots","listeners","Set","isDescendant","host","ancestor","p","resolve","_ref","_slots_","onScreen","slot","current","parent","nested","mutate","change","before","after","failure","listener","Array","error","indexOf","g9Hosts","G9Error","hostRegistry","index","i"],"mappings":";AA4GA,MAAMA,QAAgB,EAAE;AACxB,MAAMC,YAAY,IAAIC;AAEtB,SAASC,aAAaC,IAAkB,EAAEC,QAAsB;IAC9D,IAAK,IAAIC,IAAIF,KAAK,MAAM,EAAEE,GAAGA,IAAIA,EAAE,MAAM,CAAE,IAAIA,MAAMD,UAAU,OAAO;IACtE,OAAO;AACT;AAEA,SAASE;QAEOC,MAAAA;QAAAA,YAAqBC;IADnC,MAAMC,WAAWV,MAAM,MAAM,CAAC,CAACW,OAASA,KAAK,QAAQ;IACrD,IAAIC,UAAU,QAAAJ,CAAAA,OAAAA,QAAAA,CAAAA,QAAAA,QAAAA,CAAAA,aAAAA,QAAQ,CAAC,EA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AC2B,OAAO;YACpC3B,MAAM,OAAO,CAAC;gBAAEI;gBAAM,UAAU;YAAK;QACvC;IACF;IACA,UAASA,IAAkB;QACzBW,OAAO;YACL,IAAIQ,QAAQnB,SAAS,GAAG;YACxB,IAAIuB,QAAQ;YACZ3B,MAAM,OAAO,CAAC,CAACW,MAAMiB;gBACnB,IAAIjB,KAAK,QAAQ,EAAEgB,QAAQC,IAAI;YACjC;YACA5B,MAAM,MAAM,CAAC2B,OAAO,GAAG;gBAAEvB;gBAAM,UAAU;YAAM;QACjD;IACF;IACA,eAAcA,IAAkB;QAC9BW,OAAO;YACL,MAAMJ,OAAOX,KAAK,CAACuB,QAAQnB,MAAM;YACjC,IAAIO,MAAMA,KAAK,QAAQ,GAAG;QAC5B;IACF;IACA,QAAOP,IAAkB;QACvBW,OAAO;YACL,MAAMY,QAAQJ,QAAQnB;YACtB,IAAIuB,SAAS,GAAG3B,MAAM,MAAM,CAAC2B,OAAO;QACtC;IACF;AACF"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type * from './anchor/index.js';
1
2
  export type * from './base/index.js';
2
3
  export type * from './button/index.js';
3
4
  export type * from './cascade/index.js';
@@ -6,6 +7,7 @@ export type * from './display/index.js';
6
7
  export type * from './edge-panel/index.js';
7
8
  export type * from './expander/index.js';
8
9
  export type * from './fields/index.js';
10
+ export type * from './guide/index.js';
9
11
  export type * from './host/index.js';
10
12
  export type * from './icon/index.js';
11
13
  export type * from './pickers/index.js';
@@ -13,6 +15,7 @@ export type * from './plus-button/index.js';
13
15
  export type * from './popup/index.js';
14
16
  export type * from './provider/index.js';
15
17
  export type * from './range-slider/index.js';
18
+ export type * from './route/index.js';
16
19
  export type * from './selection/index.js';
17
20
  export type * from './sheet/index.js';
18
21
  export type * from './swipe/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,mBAAmB,QAAQ,CAAC;AAC5B,mBAAm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CAAC;AAC/B,mBAAmB,QAAQ,CAAC;AAC5B,mBAAmB,SAAS,CAAC;AAC7B,mBAAmB,UAAU,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { G9Capabilities, G9Culture, G9CultureStore, G9Diagnostics, G9Preferences, G9SafeExecutor, G9SafeInsets, G9Strings, G9ThemeStore } from '@g9tm/lynxcontrols-foundation';
2
+ import type { G9AnchorRegistry } from '../anchor/registry.js';
2
3
  import type { G9ResolvedSettings } from './settings.js';
3
4
  /** What `useG9Culture` and `useG9Strings` read: the snapshot and the strings built for it. */
4
5
  export interface G9CultureContextValue {
@@ -29,6 +30,8 @@ export interface G9ProviderCore {
29
30
  readonly executor: G9SafeExecutor;
30
31
  /** Id of the provider's root `<view>` (the element carrying the theme variables). */
31
32
  readonly rootId: string;
33
+ /** Every anchor of this LynxView (`@g9tm/lynxcontrols/anchor`): the controls a guide or an automation can reach. */
34
+ readonly anchors: G9AnchorRegistry;
32
35
  }
33
36
  export declare const G9CoreContext: import("react").Context<G9ProviderCore | null>;
34
37
  export declare const G9CultureContext: import("react").Context<G9CultureContextValue | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/provider/contexts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,8FAA8F;AAC9F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC;AAED,qHAAqH;AACrH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,OAA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":"provider/contexts.jsx","sources":["../../src/provider/contexts.ts"],"sourcesContent":["// React contexts behind G9Provider. One context per kind of change, so a consumer re-renders only for what it reads:\n// the theme store and services never change identity, culture changes re-render culture readers, keyboard and window\n// changes re-render only their readers (plan/specs/01 §5).\n\nimport type {\n G9Capabilities,\n G9Culture,\n G9CultureStore,\n G9Diagnostics,\n G9Preferences,\n G9SafeExecutor,\n G9SafeInsets,\n G9Strings,\n G9ThemeStore,\n} from '@g9tm/lynxcontrols-foundation';\nimport { createContext } from '@lynx-js/react';\nimport type { G9ResolvedSettings } from './settings';\n\n/** What `useG9Culture` and `useG9Strings` read: the snapshot and the strings built for it. */\nexport interface G9CultureContextValue {\n readonly culture: G9Culture;\n readonly strings: G9Strings;\n readonly store: G9CultureStore;\n}\n\n/** Soft-keyboard state (plan/specs/02 §4 `keyboardstatuschanged`). Heights are in the units the platform reports. */\nexport interface G9KeyboardState {\n /** `true` between a `'on'` and the next `'off'`. */\n readonly visible: boolean;\n /** Keyboard height; `0` while hidden. */\n readonly height: number;\n /** The platform's compatibility height (Lynx `compatHeight`); `0` while hidden or when not reported. */\n readonly compatHeight: number;\n}\n\n/** Window size in logical pixels (MAUI `G9ScreenHelper.WidthInDip` / `HeightInDip`). */\nexport interface G9WindowState {\n readonly width: number;\n readonly height: number;\n}\n\n/** Everything a provider shares that never changes identity while it is mounted. */\nexport interface G9ProviderCore {\n readonly services: G9Capabilities;\n readonly themeStore: G9ThemeStore;\n readonly preferences: G9Preferences;\n readonly diagnostics: G9Diagnostics;\n readonly executor: G9SafeExecutor;\n /** Id of the provider's root `<view>` (the element carrying the theme variables). */\n readonly rootId: string;\n}\n\nexport const G9CoreContext = createContext<G9ProviderCore | null>(null);\nexport const G9CultureContext = createContext<G9CultureContextValue | null>(null);\nexport const G9SettingsContext = createContext<G9ResolvedSettings | null>(null);\nexport const G9KeyboardContext = createContext<G9KeyboardState | null>(null);\nexport const G9WindowContext = createContext<G9WindowState | null>(null);\nexport const G9InsetsContext = createContext<G9SafeInsets | null>(null);\n/** The provider's diagnostics hub, or `null` outside a provider (base hooks fall back to `console`). */\nexport const G9DiagnosticsContext = createContext<G9Diagnostics | null>(null);\n"],"names":["G9CoreContext","createContext","G9CultureContext","G9SettingsContext","G9KeyboardContext","G9WindowContext","G9InsetsContext","G9DiagnosticsContext"],"mappings":";AAoDO,MAAMA,gBAAgBC,cAAqC;AAC3D,MAAMC,mBAAmBD,cAA4C;AACrE,MAAME,oBAAoBF,cAAyC;AACnE,MAAMG,oBAAoBH,cAAsC;AAChE,MAAMI,kBAAkBJ,cAAoC;AAC5D,MAAMK,kBAAkBL,cAAmC;AAE3D,MAAMM,uBAAuBN,cAAoC"}
1
+ {"version":3,"file":"provider/contexts.jsx","sources":["../../src/provider/contexts.ts"],"sourcesContent":["// React contexts behind G9Provider. One context per kind of change, so a consumer re-renders only for what it reads:\n// the theme store and services never change identity, culture changes re-render culture readers, keyboard and window\n// changes re-render only their readers (plan/specs/01 §5).\n\nimport type {\n G9Capabilities,\n G9Culture,\n G9CultureStore,\n G9Diagnostics,\n G9Preferences,\n G9SafeExecutor,\n G9SafeInsets,\n G9Strings,\n G9ThemeStore,\n} from '@g9tm/lynxcontrols-foundation';\nimport { createContext } from '@lynx-js/react';\nimport type { G9AnchorRegistry } from '../anchor/registry';\nimport type { G9ResolvedSettings } from './settings';\n\n/** What `useG9Culture` and `useG9Strings` read: the snapshot and the strings built for it. */\nexport interface G9CultureContextValue {\n readonly culture: G9Culture;\n readonly strings: G9Strings;\n readonly store: G9CultureStore;\n}\n\n/** Soft-keyboard state (plan/specs/02 §4 `keyboardstatuschanged`). Heights are in the units the platform reports. */\nexport interface G9KeyboardState {\n /** `true` between a `'on'` and the next `'off'`. */\n readonly visible: boolean;\n /** Keyboard height; `0` while hidden. */\n readonly height: number;\n /** The platform's compatibility height (Lynx `compatHeight`); `0` while hidden or when not reported. */\n readonly compatHeight: number;\n}\n\n/** Window size in logical pixels (MAUI `G9ScreenHelper.WidthInDip` / `HeightInDip`). */\nexport interface G9WindowState {\n readonly width: number;\n readonly height: number;\n}\n\n/** Everything a provider shares that never changes identity while it is mounted. */\nexport interface G9ProviderCore {\n readonly services: G9Capabilities;\n readonly themeStore: G9ThemeStore;\n readonly preferences: G9Preferences;\n readonly diagnostics: G9Diagnostics;\n readonly executor: G9SafeExecutor;\n /** Id of the provider's root `<view>` (the element carrying the theme variables). */\n readonly rootId: string;\n /** Every anchor of this LynxView (`@g9tm/lynxcontrols/anchor`): the controls a guide or an automation can reach. */\n readonly anchors: G9AnchorRegistry;\n}\n\nexport const G9CoreContext = createContext<G9ProviderCore | null>(null);\nexport const G9CultureContext = createContext<G9CultureContextValue | null>(null);\nexport const G9SettingsContext = createContext<G9ResolvedSettings | null>(null);\nexport const G9KeyboardContext = createContext<G9KeyboardState | null>(null);\nexport const G9WindowContext = createContext<G9WindowState | null>(null);\nexport const G9InsetsContext = createContext<G9SafeInsets | null>(null);\n/** The provider's diagnostics hub, or `null` outside a provider (base hooks fall back to `console`). */\nexport const G9DiagnosticsContext = createContext<G9Diagnostics | null>(null);\n"],"names":["G9CoreContext","createContext","G9CultureContext","G9SettingsContext","G9KeyboardContext","G9WindowContext","G9InsetsContext","G9DiagnosticsContext"],"mappings":";AAuDO,MAAMA,gBAAgBC,cAAqC;AAC3D,MAAMC,mBAAmBD,cAA4C;AACrE,MAAME,oBAAoBF,cAAyC;AACnE,MAAMG,oBAAoBH,cAAsC;AAChE,MAAMI,kBAAkBJ,cAAoC;AAC5D,MAAMK,kBAAkBL,cAAmC;AAE3D,MAAMM,uBAAuBN,cAAoC"}