@g9tm/lynxcontrols 2.5.7 → 2.5.8

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 (251) hide show
  1. package/catalog/cards/G9AppearancePage.md +17 -0
  2. package/catalog/cards/G9Badge.md +1 -1
  3. package/catalog/cards/G9Button.md +2 -2
  4. package/catalog/cards/G9Card.md +1 -1
  5. package/catalog/cards/G9Chip.md +1 -1
  6. package/catalog/cards/G9ChipStrip.md +16 -0
  7. package/catalog/cards/G9CodeBlock.md +17 -0
  8. package/catalog/cards/G9CommandPalette.md +3 -1
  9. package/catalog/cards/G9ConnectionBanner.md +1 -1
  10. package/catalog/cards/G9ContrastPanel.md +15 -0
  11. package/catalog/cards/G9DashboardCustomizeSheet.md +17 -0
  12. package/catalog/cards/G9DashboardGrid.md +17 -0
  13. package/catalog/cards/G9DragList.md +4 -2
  14. package/catalog/cards/G9Editor.md +1 -1
  15. package/catalog/cards/G9ErrorBoundary.md +3 -2
  16. package/catalog/cards/G9Menu.md +1 -1
  17. package/catalog/cards/G9MenuList.md +2 -0
  18. package/catalog/cards/G9NotificationCenter.md +17 -0
  19. package/catalog/cards/G9NotificationCenterPanel.md +17 -0
  20. package/catalog/cards/G9PathNavigator.md +13 -0
  21. package/catalog/cards/G9PersonalThemeSheet.md +17 -0
  22. package/catalog/cards/G9Popover.md +1 -1
  23. package/catalog/cards/G9Provider.md +1 -1
  24. package/catalog/cards/G9ReaderSheet.md +17 -0
  25. package/catalog/cards/G9ReaderView.md +17 -0
  26. package/catalog/cards/G9SafeButton.md +2 -2
  27. package/catalog/cards/G9SearchEntry.md +1 -1
  28. package/catalog/cards/G9SecretValue.md +17 -0
  29. package/catalog/cards/G9ShortcutList.md +4 -0
  30. package/catalog/cards/G9ShortcutsSheet.md +3 -1
  31. package/catalog/cards/G9StatusPill.md +1 -1
  32. package/catalog/cards/G9Tag.md +1 -1
  33. package/catalog/cards/G9TextEntry.md +1 -1
  34. package/catalog/cards/G9VirtualList.md +1 -1
  35. package/catalog/cards/G9WallpaperSwatch.md +16 -0
  36. package/catalog/cards/G9WidgetSkeleton.md +9 -0
  37. package/catalog/cards/G9WidgetSlot.md +13 -0
  38. package/catalog/cards/PopupFrame.md +2 -2
  39. package/catalog/catalog.json +6947 -479
  40. package/catalog/index.md +18 -2
  41. package/dist/.tsbuildinfo +1 -1
  42. package/dist/appearance/appearance.css +264 -0
  43. package/dist/appearance/appearance.css.map +1 -0
  44. package/dist/appearance/appearance.d.ts +148 -0
  45. package/dist/appearance/appearance.d.ts.map +1 -0
  46. package/dist/appearance/appearance.jsx +604 -0
  47. package/dist/appearance/index.d.ts +2 -0
  48. package/dist/appearance/index.d.ts.map +1 -0
  49. package/dist/appearance/index.jsx +1 -0
  50. package/dist/base/control.d.ts +15 -0
  51. package/dist/base/control.d.ts.map +1 -1
  52. package/dist/base/control.jsx +13 -1
  53. package/dist/base/index.d.ts +1 -1
  54. package/dist/base/index.d.ts.map +1 -1
  55. package/dist/base/index.jsx +1 -1
  56. package/dist/button/button.css +4 -0
  57. package/dist/button/button.css.map +1 -1
  58. package/dist/cascade/cascade.css +2 -0
  59. package/dist/cascade/cascade.css.map +1 -1
  60. package/dist/commands/commands.css +46 -0
  61. package/dist/commands/commands.css.map +1 -1
  62. package/dist/commands/index.d.ts +2 -2
  63. package/dist/commands/index.d.ts.map +1 -1
  64. package/dist/commands/index.jsx +2 -2
  65. package/dist/commands/keys.d.ts +15 -1
  66. package/dist/commands/keys.d.ts.map +1 -1
  67. package/dist/commands/keys.jsx +20 -1
  68. package/dist/commands/palette.d.ts +73 -7
  69. package/dist/commands/palette.d.ts.map +1 -1
  70. package/dist/commands/palette.jsx +174 -20
  71. package/dist/dashboard/dashboard.css +101 -0
  72. package/dist/dashboard/dashboard.css.map +1 -0
  73. package/dist/dashboard/dashboard.d.ts +73 -0
  74. package/dist/dashboard/dashboard.d.ts.map +1 -0
  75. package/dist/dashboard/dashboard.jsx +297 -0
  76. package/dist/dashboard/index.d.ts +3 -0
  77. package/dist/dashboard/index.d.ts.map +1 -0
  78. package/dist/dashboard/index.jsx +2 -0
  79. package/dist/dashboard/model.d.ts +53 -0
  80. package/dist/dashboard/model.d.ts.map +1 -0
  81. package/dist/dashboard/model.jsx +76 -0
  82. package/dist/display/code.css +109 -0
  83. package/dist/display/code.css.map +1 -0
  84. package/dist/display/code.d.ts +43 -0
  85. package/dist/display/code.d.ts.map +1 -0
  86. package/dist/display/code.jsx +101 -0
  87. package/dist/display/extras.d.ts +7 -2
  88. package/dist/display/extras.d.ts.map +1 -1
  89. package/dist/display/extras.jsx +13 -4
  90. package/dist/display/index.d.ts +1 -0
  91. package/dist/display/index.d.ts.map +1 -1
  92. package/dist/display/index.jsx +1 -0
  93. package/dist/display/motion-figures.css +2 -0
  94. package/dist/display/motion-figures.css.map +1 -1
  95. package/dist/display/motion-figures.d.ts.map +1 -1
  96. package/dist/display/motion-figures.jsx +14 -7
  97. package/dist/display/theme-preview.css +4 -0
  98. package/dist/display/theme-preview.css.map +1 -1
  99. package/dist/fields/extra-entries.css +1 -0
  100. package/dist/fields/extra-entries.css.map +1 -1
  101. package/dist/fields/extra-entries.d.ts +2 -0
  102. package/dist/fields/extra-entries.d.ts.map +1 -1
  103. package/dist/fields/extra-entries.jsx +3 -2
  104. package/dist/header/header.css +2 -0
  105. package/dist/header/header.css.map +1 -1
  106. package/dist/host/carry-contexts.d.ts.map +1 -1
  107. package/dist/host/carry-contexts.jsx +22 -8
  108. package/dist/index.d.ts +4 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/layout/layout.css +2 -0
  111. package/dist/layout/layout.css.map +1 -1
  112. package/dist/list/gestures.d.ts +39 -6
  113. package/dist/list/gestures.d.ts.map +1 -1
  114. package/dist/list/gestures.jsx +284 -89
  115. package/dist/list/index.d.ts +3 -2
  116. package/dist/list/index.d.ts.map +1 -1
  117. package/dist/list/index.jsx +2 -1
  118. package/dist/list/keyboard.d.ts +50 -0
  119. package/dist/list/keyboard.d.ts.map +1 -0
  120. package/dist/list/keyboard.jsx +117 -0
  121. package/dist/list/list.css +28 -5
  122. package/dist/list/list.css.map +1 -1
  123. package/dist/list/rows.d.ts.map +1 -1
  124. package/dist/list/rows.jsx +3 -3
  125. package/dist/list/virtual-list.d.ts +27 -1
  126. package/dist/list/virtual-list.d.ts.map +1 -1
  127. package/dist/list/virtual-list.jsx +49 -4
  128. package/dist/notifications/index.d.ts +3 -0
  129. package/dist/notifications/index.d.ts.map +1 -0
  130. package/dist/notifications/index.jsx +2 -0
  131. package/dist/notifications/model.d.ts +47 -0
  132. package/dist/notifications/model.d.ts.map +1 -0
  133. package/dist/notifications/model.jsx +51 -0
  134. package/dist/notifications/notification-center.d.ts +98 -0
  135. package/dist/notifications/notification-center.d.ts.map +1 -0
  136. package/dist/notifications/notification-center.jsx +424 -0
  137. package/dist/notifications/notifications.css +266 -0
  138. package/dist/notifications/notifications.css.map +1 -0
  139. package/dist/orb/orb.css +2 -0
  140. package/dist/orb/orb.css.map +1 -1
  141. package/dist/pickers/pickers.css +15 -0
  142. package/dist/pickers/pickers.css.map +1 -1
  143. package/dist/plus-button/plus-button.css +2 -0
  144. package/dist/plus-button/plus-button.css.map +1 -1
  145. package/dist/plus-button/plus-button.d.ts.map +1 -1
  146. package/dist/plus-button/plus-button.jsx +2 -1
  147. package/dist/popover/popover.css +23 -1
  148. package/dist/popover/popover.css.map +1 -1
  149. package/dist/popover/popover.d.ts +14 -0
  150. package/dist/popover/popover.d.ts.map +1 -1
  151. package/dist/popover/popover.jsx +73 -12
  152. package/dist/popover/position.d.ts +6 -2
  153. package/dist/popover/position.d.ts.map +1 -1
  154. package/dist/popover/position.jsx +15 -4
  155. package/dist/popup/popup.css +3 -0
  156. package/dist/popup/popup.css.map +1 -1
  157. package/dist/provider/provider.d.ts +6 -1
  158. package/dist/provider/provider.d.ts.map +1 -1
  159. package/dist/provider/provider.jsx +22 -2
  160. package/dist/reader/index.d.ts +2 -0
  161. package/dist/reader/index.d.ts.map +1 -0
  162. package/dist/reader/index.jsx +1 -0
  163. package/dist/reader/reader.css +74 -0
  164. package/dist/reader/reader.css.map +1 -0
  165. package/dist/reader/reader.d.ts +76 -0
  166. package/dist/reader/reader.d.ts.map +1 -0
  167. package/dist/reader/reader.jsx +149 -0
  168. package/dist/route/index.d.ts +2 -0
  169. package/dist/route/index.d.ts.map +1 -1
  170. package/dist/route/index.jsx +2 -0
  171. package/dist/route/path-navigator.css +42 -0
  172. package/dist/route/path-navigator.css.map +1 -0
  173. package/dist/route/path-navigator.d.ts +25 -0
  174. package/dist/route/path-navigator.d.ts.map +1 -0
  175. package/dist/route/path-navigator.jsx +98 -0
  176. package/dist/route/path-router.d.ts +162 -0
  177. package/dist/route/path-router.d.ts.map +1 -0
  178. package/dist/route/path-router.jsx +327 -0
  179. package/dist/selection/selection.css +2 -0
  180. package/dist/selection/selection.css.map +1 -1
  181. package/dist/sheet/frame.d.ts.map +1 -1
  182. package/dist/sheet/frame.jsx +9 -8
  183. package/dist/sheet/options.d.ts +6 -1
  184. package/dist/sheet/options.d.ts.map +1 -1
  185. package/dist/sheet/options.jsx +2 -1
  186. package/dist/sheet/panel-frame.d.ts.map +1 -1
  187. package/dist/sheet/panel-frame.jsx +5 -4
  188. package/dist/sheet/sizing.d.ts +3 -3
  189. package/dist/sheet/sizing.d.ts.map +1 -1
  190. package/dist/sheet/sizing.jsx +1 -0
  191. package/dist/shell/shell.css +12 -1
  192. package/dist/shell/shell.css.map +1 -1
  193. package/dist/shell/shell.d.ts.map +1 -1
  194. package/dist/shell/shell.jsx +7 -5
  195. package/dist/survey/survey.d.ts.map +1 -1
  196. package/dist/survey/survey.jsx +9 -6
  197. package/dist/swipe/swipe.css +2 -0
  198. package/dist/swipe/swipe.css.map +1 -1
  199. package/dist/tab-bar/flat.jsx +5 -4
  200. package/dist/tab-bar/tab-bar.css +2 -0
  201. package/dist/tab-bar/tab-bar.css.map +1 -1
  202. package/dist/toast/index.d.ts +1 -1
  203. package/dist/toast/index.d.ts.map +1 -1
  204. package/dist/toast/service.d.ts.map +1 -1
  205. package/dist/toast/service.jsx +18 -5
  206. package/dist/toast/store.d.ts +22 -0
  207. package/dist/toast/store.d.ts.map +1 -1
  208. package/dist/toast/store.jsx +35 -3
  209. package/dist/toast/toast.css +22 -0
  210. package/dist/toast/toast.css.map +1 -1
  211. package/dist/toggle/choice.css +27 -0
  212. package/dist/toggle/choice.css.map +1 -1
  213. package/dist/toggle/choice.d.ts +36 -0
  214. package/dist/toggle/choice.d.ts.map +1 -1
  215. package/dist/toggle/choice.jsx +77 -13
  216. package/dist/toggle/index.d.ts +1 -1
  217. package/dist/toggle/index.d.ts.map +1 -1
  218. package/dist/toggle/index.jsx +1 -1
  219. package/package.json +22 -2
  220. package/skills/g9-lynx-app/references/catalog-index.md +22 -6
  221. package/skills/g9-lynx-app/references/components/appearance.md +70 -0
  222. package/skills/g9-lynx-app/references/components/barcode.md +1 -1
  223. package/skills/g9-lynx-app/references/components/button.md +4 -4
  224. package/skills/g9-lynx-app/references/components/calendar-1.md +205 -0
  225. package/skills/g9-lynx-app/references/components/calendar-2.md +36 -0
  226. package/skills/g9-lynx-app/references/components/canvas.md +33 -0
  227. package/skills/g9-lynx-app/references/components/chat-1.md +199 -0
  228. package/skills/g9-lynx-app/references/components/chat-2.md +119 -0
  229. package/skills/g9-lynx-app/references/components/commands.md +10 -2
  230. package/skills/g9-lynx-app/references/components/dashboard.md +61 -0
  231. package/skills/g9-lynx-app/references/components/display-1.md +22 -21
  232. package/skills/g9-lynx-app/references/components/display-2.md +36 -39
  233. package/skills/g9-lynx-app/references/components/display-3.md +41 -2
  234. package/skills/g9-lynx-app/references/components/fields.md +3 -3
  235. package/skills/g9-lynx-app/references/components/layout-1.md +1 -1
  236. package/skills/g9-lynx-app/references/components/list.md +5 -3
  237. package/skills/g9-lynx-app/references/components/media-1.md +203 -0
  238. package/skills/g9-lynx-app/references/components/media-2.md +66 -0
  239. package/skills/g9-lynx-app/references/components/notifications.md +37 -0
  240. package/skills/g9-lynx-app/references/components/popover.md +4 -2
  241. package/skills/g9-lynx-app/references/components/popup.md +2 -2
  242. package/skills/g9-lynx-app/references/components/projects.md +73 -0
  243. package/skills/g9-lynx-app/references/components/provider.md +1 -1
  244. package/skills/g9-lynx-app/references/components/reader.md +37 -0
  245. package/skills/g9-lynx-app/references/components/richtext.md +54 -0
  246. package/skills/g9-lynx-app/references/components/route.md +14 -0
  247. package/skills/g9-lynx-app/references/components/shell.md +1 -1
  248. package/skills/g9-lynx-app/references/components/toggle.md +18 -1
  249. package/skills/g9-lynx-app/references/components/calendar.md +0 -128
  250. package/skills/g9-lynx-app/references/components/chat.md +0 -98
  251. package/skills/g9-lynx-app/references/components/media.md +0 -115
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAElB,KAAK,YAAY,EACjB,KAAK,UAAU,EAEf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EAWrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAA8D,MAAM,gBAAgB,CAAC;AAqB5G,OAAO,EAAE,KAAK,UAAU,EAA4C,MAAM,YAAY,CAAC;AAEvF,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,8GAA8G;IAC9G,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,8HAA8H;IAC9H,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CA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,SAAS,GAAG,MAAM,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IAC/C,kHAAkH;IAClH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,kHAAkH;IAClH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9C,wHAAwH;IACxH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpF;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpF,gEAAgE;IAChE,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAyDD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAiX5D"}
@@ -250,19 +250,39 @@ function G9Provider(props) {
250
250
  const aliasVariables = useMemo(()=>props.tokenAliases ? aliasCssVariables(props.tokenAliases.map, props.tokenAliases.prefix) : {}, [
251
251
  aliasKey
252
252
  ]);
253
+ const extras = useRef(props.themeExtras);
254
+ extras.current = props.themeExtras;
255
+ const extraVariables = (theme)=>{
256
+ const make = extras.current;
257
+ if (!make) return {};
258
+ try {
259
+ return make(theme);
260
+ } catch (error) {
261
+ diagnostics.log({
262
+ level: 'warning',
263
+ message: 'themeExtras failed.',
264
+ source: 'G9Provider',
265
+ error
266
+ });
267
+ return {};
268
+ }
269
+ };
253
270
  const [initialVariables] = useState(()=>({
254
271
  ...aliasVariables,
255
- ...toRootCssVariables(themeStore.getSnapshot(), shapeStore.get(), culture.direction)
272
+ ...toRootCssVariables(themeStore.getSnapshot(), shapeStore.get(), culture.direction),
273
+ ...extraVariables(themeStore.getSnapshot())
256
274
  }));
257
275
  const [initialScheme] = useState(()=>themeStore.getSnapshot().scheme);
258
276
  const applied = useRef({});
259
277
  const [fallbackVariables, setFallbackVariables] = useState(null);
260
278
  useEffect(()=>{
261
279
  const apply = ()=>{
280
+ const snapshot = themeStore.getSnapshot();
262
281
  const next = {
263
282
  ...initialVariables,
264
283
  ...applied.current,
265
- ...themeVariables(themeStore.getSnapshot())
284
+ ...themeVariables(snapshot),
285
+ ...extraVariables(snapshot)
266
286
  };
267
287
  const diff = changedVariables(applied.current, next);
268
288
  applied.current = next;
@@ -0,0 +1,2 @@
1
+ export { G9ReaderSheet, type G9ReaderSheetProps, type G9ReaderSize, type G9ReaderTextStyle, G9ReaderView, type G9ReaderViewProps, g9ReaderLineHeight, g9ReaderSizes, g9ReadingMinutes, g9StepReaderSize, } from './reader.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ export { G9ReaderSheet, G9ReaderView, g9ReaderLineHeight, g9ReaderSizes, g9ReadingMinutes, g9StepReaderSize } from "./reader.jsx";
@@ -0,0 +1,74 @@
1
+ .g9-reader {
2
+ flex-direction: column;
3
+ align-items: center;
4
+ width: 100%;
5
+ padding-top: 8px;
6
+ padding-bottom: 32px;
7
+ display: flex;
8
+ }
9
+
10
+ .g9-reader__measure {
11
+ flex-direction: column;
12
+ width: 100%;
13
+ display: flex;
14
+ }
15
+
16
+ .g9-reader__text {
17
+ font-family: var(--g9-font-text);
18
+ color: var(--g9-text-primary);
19
+ }
20
+
21
+ .g9-reader__sheet {
22
+ flex-direction: column;
23
+ width: 100%;
24
+ display: flex;
25
+ }
26
+
27
+ .g9-reader__header {
28
+ align-items: flex-start;
29
+ column-gap: 2px;
30
+ padding-top: 8px;
31
+ padding-bottom: 8px;
32
+ display: flex;
33
+ }
34
+
35
+ .g9-reader__titles {
36
+ flex-direction: column;
37
+ flex: 1;
38
+ min-width: 0;
39
+ display: flex;
40
+ }
41
+
42
+ .g9-reader__title {
43
+ font-size: 18px;
44
+ font-weight: 600;
45
+ font-family: var(--g9-font-text-600);
46
+ color: var(--g9-text-primary);
47
+ }
48
+
49
+ .g9-reader__meta {
50
+ flex-wrap: wrap;
51
+ align-items: center;
52
+ column-gap: 8px;
53
+ margin-top: 2px;
54
+ display: flex;
55
+ }
56
+
57
+ .g9-reader__time {
58
+ align-items: center;
59
+ column-gap: 4px;
60
+ display: flex;
61
+ }
62
+
63
+ .g9-reader__fact {
64
+ font-size: 13px;
65
+ font-family: var(--g9-font-text);
66
+ color: var(--g9-text-secondary);
67
+ }
68
+
69
+ .g9-reader__fact--quiet {
70
+ color: var(--g9-text-tertiary);
71
+ }
72
+
73
+
74
+ /*# sourceMappingURL=reader.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://./src/reader/reader.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,mBAAmB;EACnB,WAAW;EACX,gBAAgB;EAChB,oBAAoB;EACpB,aAAa;AACf;;AAGA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,gCAAgC;EAChC,6BAA6B;AAC/B;;AAGA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,eAAe;EACf,gBAAgB;EAChB,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,gBAAgB;EAChB,oCAAoC;EACpC,6BAA6B;AAC/B;;AAGA;EAAE,eAAe;EACf,mBAAmB;EACnB,eAAe;EACf,eAAe;EACf,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;AACjC;;AAGA;EAAE,8BAA8B;AAChC","sourcesContent":["/* G9ReaderView and G9ReaderSheet (2.5.8). */\n.g9-reader {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n padding-top: 8px;\n padding-bottom: 32px;\n}\n\n.g9-reader__measure {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-reader__text {\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-reader__sheet {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-reader__header {\n display: flex;\n align-items: flex-start;\n padding-top: 8px;\n padding-bottom: 8px;\n column-gap: 2px;\n}\n\n.g9-reader__titles {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-reader__title {\n font-size: 18px;\n font-weight: 600;\n font-family: var(--g9-font-text-600);\n color: var(--g9-text-primary);\n}\n\n.g9-reader__meta {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 8px;\n margin-top: 2px;\n}\n\n.g9-reader__time {\n display: flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.g9-reader__fact {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-reader__fact--quiet {\n color: var(--g9-text-tertiary);\n}\n"],"sourceRoot":""}
@@ -0,0 +1,76 @@
1
+ import { type ReactNode } from '@lynx-js/react';
2
+ import type { G9IconInput } from '../icon/icon.js';
3
+ import type { G9SheetOptions } from '../sheet/options.js';
4
+ import './reader.css';
5
+ /** One text size of the reader. */
6
+ export interface G9ReaderSize {
7
+ readonly key: string;
8
+ /** Font size (dp). */
9
+ readonly px: number;
10
+ }
11
+ /** The reader's sizes, smallest first (Hub's normal 16, large 18, larger 21). */
12
+ export declare const g9ReaderSizes: readonly G9ReaderSize[];
13
+ /** Reading time in whole minutes (at least 1) at `wordsPerMinute` (default 200). */
14
+ export declare function g9ReadingMinutes(text: string, wordsPerMinute?: number): number;
15
+ /** The size one step smaller (-1) or larger (+1) than `current` (an unknown one counts as the first). */
16
+ export declare function g9StepReaderSize(sizes: readonly G9ReaderSize[], current: string, delta: number): string;
17
+ /** Line height for a size: ×1.85 left to right, ×2.05 right to left (rounded), unless the app gives its factors. */
18
+ export declare function g9ReaderLineHeight(px: number, direction: 'ltr' | 'rtl', factors?: {
19
+ readonly ltr?: number;
20
+ readonly rtl?: number;
21
+ }): number;
22
+ /** How the text is drawn (what `renderText` is given). */
23
+ export interface G9ReaderTextStyle {
24
+ readonly direction: 'ltr' | 'rtl';
25
+ readonly fontSize: number;
26
+ readonly lineHeight: number;
27
+ readonly align: 'left' | 'right';
28
+ }
29
+ /** Props of {@link G9ReaderView}. */
30
+ export interface G9ReaderViewProps {
31
+ readonly id?: string;
32
+ readonly text: string;
33
+ /** `'auto'` (default): the first strong letter's direction, else the app's. */
34
+ readonly direction?: 'auto' | 'ltr' | 'rtl';
35
+ /** The size key (`sizes`); default the second size (or the first). */
36
+ readonly size?: string;
37
+ readonly sizes?: readonly G9ReaderSize[];
38
+ readonly lineHeightFactors?: {
39
+ readonly ltr?: number;
40
+ readonly rtl?: number;
41
+ };
42
+ /** The measure (dp). Default 680. */
43
+ readonly maxWidth?: number;
44
+ /** Draws the text (links, mentions, formatting); default a plain selectable text. */
45
+ readonly renderText?: (text: string, style: G9ReaderTextStyle) => ReactNode;
46
+ readonly accessibilityLabel?: string;
47
+ }
48
+ /** The text alone at the reader's size, measure and direction (inside any page or sheet). */
49
+ export declare function G9ReaderView(props: G9ReaderViewProps): ReactNode;
50
+ /** Props of {@link G9ReaderSheet}. */
51
+ export interface G9ReaderSheetProps extends Omit<G9ReaderViewProps, 'size'> {
52
+ readonly open: boolean;
53
+ readonly onClose: () => void;
54
+ /** The sheet's title (a channel's name); none: no title line. */
55
+ readonly title?: string;
56
+ /** Small facts under the title (the author, the time). */
57
+ readonly meta?: readonly string[];
58
+ /** The reading time's words («۳ دقیقه»); without it the time is not shown. */
59
+ readonly minutesLabel?: (minutes: number) => string;
60
+ readonly wordsPerMinute?: number;
61
+ /** The size (controlled); with `onSizeChange` the app keeps it (per device). */
62
+ readonly size?: string;
63
+ readonly defaultSize?: string;
64
+ readonly onSizeChange?: (size: string) => void;
65
+ readonly smallerLabel?: string;
66
+ readonly largerLabel?: string;
67
+ readonly closeLabel?: string;
68
+ /** The size buttons' icons (default the letters A− / A+). */
69
+ readonly smallerIcon?: G9IconInput;
70
+ readonly largerIcon?: G9IconInput;
71
+ /** More of the sheet (its height, route, presentation). */
72
+ readonly options?: G9SheetOptions;
73
+ }
74
+ /** A long text read in a sheet: title, author and reading time, A− / A+ and close, then the {@link G9ReaderView}. */
75
+ export declare function G9ReaderSheet(props: G9ReaderSheetProps): ReactNode;
76
+ //# sourceMappingURL=reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/reader/reader.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,WA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Q,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;IAClC,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;CACnC;AAED,qHAAqH;AACrH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAuFlE"}
@@ -0,0 +1,149 @@
1
+ import { firstStrongDirection } from "@g9tm/lynxcontrols-foundation";
2
+ import { useState } from "@lynx-js/react";
3
+ import { g9IdProps } from "../base/control.jsx";
4
+ import { G9IconButton } from "../button/icon-button.jsx";
5
+ import { G9Icon } from "../icon/icon.jsx";
6
+ import { useG9Direction } from "../provider/hooks.jsx";
7
+ import { G9Sheet } from "../sheet/sheet.jsx";
8
+ import "./reader.css";
9
+ const g9ReaderSizes = [
10
+ {
11
+ key: 'normal',
12
+ px: 16
13
+ },
14
+ {
15
+ key: 'large',
16
+ px: 18
17
+ },
18
+ {
19
+ key: 'larger',
20
+ px: 21
21
+ }
22
+ ];
23
+ function g9ReadingMinutes(text1, wordsPerMinute = 200) {
24
+ const words = text1.trim().split(/\s+/).filter(Boolean).length;
25
+ return Math.max(1, Math.round(words / Math.max(1, wordsPerMinute)));
26
+ }
27
+ function g9StepReaderSize(sizes, current, delta) {
28
+ if (!sizes.length) return current;
29
+ const at = Math.max(0, sizes.findIndex((s)=>s.key === current));
30
+ return sizes[Math.max(0, Math.min(sizes.length - 1, at + delta))].key;
31
+ }
32
+ function g9ReaderLineHeight(px, direction, factors = {}) {
33
+ var _factors_rtl, _factors_ltr;
34
+ return Math.round(px * ('rtl' === direction ? null != (_factors_rtl = factors.rtl) ? _factors_rtl : 2.05 : null != (_factors_ltr = factors.ltr) ? _factors_ltr : 1.85));
35
+ }
36
+ function resolveSize(sizes, key) {
37
+ var _ref, _ref1, _sizes_find;
38
+ return null != (_ref = null != (_ref1 = null != (_sizes_find = sizes.find((s)=>s.key === key)) ? _sizes_find : sizes[1]) ? _ref1 : sizes[0]) ? _ref : {
39
+ key: 'normal',
40
+ px: 16
41
+ };
42
+ }
43
+ function G9ReaderView(props) {
44
+ var _props_sizes, _firstStrongDirection, _props_maxWidth;
45
+ const ui = useG9Direction();
46
+ const sizes = null != (_props_sizes = props.sizes) ? _props_sizes : g9ReaderSizes;
47
+ const size = resolveSize(sizes, props.size);
48
+ const direction = props.direction && 'auto' !== props.direction ? props.direction : null != (_firstStrongDirection = firstStrongDirection(props.text)) ? _firstStrongDirection : ui;
49
+ const lineHeight = g9ReaderLineHeight(size.px, direction, props.lineHeightFactors);
50
+ const style = {
51
+ direction,
52
+ fontSize: size.px,
53
+ lineHeight,
54
+ align: 'rtl' === direction ? 'right' : 'left'
55
+ };
56
+ return <view className="g9-reader" {...g9IdProps(props.id)} flatten={false} accessibility-element={true} {...props.accessibilityLabel ? {
57
+ 'accessibility-label': props.accessibilityLabel
58
+ } : {}}>
59
+ <view className="g9-reader__measure" style={{
60
+ maxWidth: `${null != (_props_maxWidth = props.maxWidth) ? _props_maxWidth : 680}px`
61
+ }}>
62
+ {props.renderText ? props.renderText(props.text, style) : <text className="g9-reader__text" text-selection={true} style={{
63
+ fontSize: `${size.px}px`,
64
+ lineHeight: `${lineHeight}px`,
65
+ direction,
66
+ textAlign: style.align
67
+ }}>
68
+ {props.text}
69
+ </text>}
70
+ </view>
71
+ </view>;
72
+ }
73
+ function G9ReaderSheet(props) {
74
+ var _props_sizes, _props_size, _props_meta, _props_smallerLabel, _props_largerLabel, _props_closeLabel;
75
+ var _sizes_, _sizes_1;
76
+ const sizes = null != (_props_sizes = props.sizes) ? _props_sizes : g9ReaderSizes;
77
+ const [own, setOwn] = useState(()=>resolveSize(sizes, props.defaultSize).key);
78
+ const current = resolveSize(sizes, null != (_props_size = props.size) ? _props_size : own).key;
79
+ const rtl = 'rtl' === useG9Direction();
80
+ const first = null == (_sizes_ = sizes[0]) ? void 0 : _sizes_.key;
81
+ const last = null == (_sizes_1 = sizes[sizes.length - 1]) ? void 0 : _sizes_1.key;
82
+ const step = (delta)=>{
83
+ var _props_onSizeChange;
84
+ const next = g9StepReaderSize(sizes, current, delta);
85
+ if (void 0 === props.size) setOwn(next);
86
+ null == (_props_onSizeChange = props.onSizeChange) || _props_onSizeChange.call(props, next);
87
+ };
88
+ const idPart = (part)=>props.id ? {
89
+ id: `${props.id}_${part}`
90
+ } : {};
91
+ const meta = [
92
+ ...null != (_props_meta = props.meta) ? _props_meta : []
93
+ ];
94
+ const minutes = props.minutesLabel ? props.minutesLabel(g9ReadingMinutes(props.text, props.wordsPerMinute)) : null;
95
+ const header = <view className="g9-reader__header" style={{
96
+ flexDirection: rtl ? 'row-reverse' : 'row',
97
+ direction: 'ltr'
98
+ }}>
99
+ <view className="g9-reader__titles">
100
+ {props.title ? <text className="g9-reader__title" text-maxline="1" style={{
101
+ textAlign: rtl ? 'right' : 'left'
102
+ }}>
103
+ {props.title}
104
+ </text> : null}
105
+ {meta.length || minutes ? <view className="g9-reader__meta" style={{
106
+ flexDirection: rtl ? 'row-reverse' : 'row',
107
+ direction: 'ltr'
108
+ }}>
109
+ {meta.map((m, i)=><text key={`m${i}`} className="g9-reader__fact">
110
+ {m}
111
+ </text>)}
112
+ {minutes ? <view className="g9-reader__time" style={{
113
+ flexDirection: rtl ? 'row-reverse' : 'row',
114
+ direction: 'ltr'
115
+ }}>
116
+ <G9Icon icon="clock" size={13} color="var(--g9-text-tertiary)"/>
117
+ <text className="g9-reader__fact g9-reader__fact--quiet">{minutes}</text>
118
+ </view> : null}
119
+ </view> : null}
120
+ </view>
121
+ <G9IconButton {...idPart('Smaller')} {...props.smallerIcon ? {
122
+ icon: props.smallerIcon
123
+ } : {
124
+ emoji: 'A−'
125
+ }} size="sm" isGhost disabled={current === first} accessibilityText={null != (_props_smallerLabel = props.smallerLabel) ? _props_smallerLabel : 'A−'} pressGuardMs={0} onPress={()=>step(-1)}/>
126
+ <G9IconButton {...idPart('Larger')} {...props.largerIcon ? {
127
+ icon: props.largerIcon
128
+ } : {
129
+ emoji: 'A+'
130
+ }} size="sm" isGhost disabled={current === last} accessibilityText={null != (_props_largerLabel = props.largerLabel) ? _props_largerLabel : 'A+'} pressGuardMs={0} onPress={()=>step(1)}/>
131
+ <G9IconButton {...idPart('Close')} icon="close" size="sm" isGhost accessibilityText={null != (_props_closeLabel = props.closeLabel) ? _props_closeLabel : '×'} onPress={props.onClose}/>
132
+ </view>;
133
+ const { open: _open, onClose: _close, title: _title, meta: _meta, options: _options, ...view1 } = props;
134
+ return <G9Sheet open={props.open} onOpenChange={(open)=>{
135
+ if (!open) props.onClose();
136
+ }} options={{
137
+ states: [
138
+ 'large'
139
+ ],
140
+ showToolbar: false,
141
+ ...props.options
142
+ }}>
143
+ <view className="g9-reader__sheet">
144
+ {header}
145
+ <G9ReaderView {...view1} {...idPart('Text')} size={current}/>
146
+ </view>
147
+ </G9Sheet>;
148
+ }
149
+ export { G9ReaderSheet, G9ReaderView, g9ReaderLineHeight, g9ReaderSizes, g9ReadingMinutes, g9StepReaderSize };
@@ -1,3 +1,5 @@
1
1
  export { G9Place, type G9PlaceProps, type G9PlaceSpec, sheetSegmentOf, useG9Location, useG9Place, useG9Router, useG9RouteSink, } from './hooks.js';
2
+ export { G9PathNavigator, type G9PathNavigatorProps, g9LazyPage, useG9PathRouter } from './path-navigator.js';
3
+ export { createG9PathRouter, type G9GotoOptions, type G9MasterOptions, type G9Navigation, type G9NavKind, type G9PageUrl, type G9PathEntry, type G9PathPageProps, type G9PathRoute, type G9PathRouter, type G9PathRouterOptions, type G9PathRouterState, g9CompilePattern, g9ParsePath, } from './path-router.js';
2
4
  export { createG9Router, type G9Excursion, type G9GoOptions, type G9GoResult, type G9GoSource, type G9Location, type G9ReadableStore, type G9RouteEvent, type G9Router, type G9RouterOptions, type G9RouterTexts, type G9TrailEntry, type G9Walk, type G9WalkOptions, type G9WalkPresenter, type G9WalkStep, isG9Router, } from './router.js';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,UAAU,GACX,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EACL,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,UAAU,GACX,MAAM,UAAU,CAAC"}
@@ -1,2 +1,4 @@
1
1
  export { G9Place, sheetSegmentOf, useG9Location, useG9Place, useG9RouteSink, useG9Router } from "./hooks.jsx";
2
+ export { G9PathNavigator, g9LazyPage, useG9PathRouter } from "./path-navigator.jsx";
3
+ export { createG9PathRouter, g9CompilePattern, g9ParsePath } from "./path-router.jsx";
2
4
  export { createG9Router, isG9Router } from "./router.jsx";
@@ -0,0 +1,42 @@
1
+ .g9-pathnav {
2
+ flex-direction: column;
3
+ flex: 1;
4
+ min-height: 0;
5
+ display: flex;
6
+ position: relative;
7
+ }
8
+
9
+ .g9-pathnav__page {
10
+ flex-direction: column;
11
+ flex: 1;
12
+ min-height: 0;
13
+ display: flex;
14
+ }
15
+
16
+ .g9-pathnav__page--parked {
17
+ display: none;
18
+ }
19
+
20
+ .g9-pathnav__split {
21
+ flex-direction: row;
22
+ flex: 1;
23
+ min-height: 0;
24
+ display: flex;
25
+ }
26
+
27
+ .g9-pathnav__master {
28
+ flex-direction: column;
29
+ min-height: 0;
30
+ display: flex;
31
+ }
32
+
33
+ .g9-pathnav__detail {
34
+ flex-direction: column;
35
+ flex: 1;
36
+ min-width: 0;
37
+ min-height: 0;
38
+ display: flex;
39
+ }
40
+
41
+
42
+ /*# sourceMappingURL=path-navigator.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://./src/route/path-navigator.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,aAAa;AACf;;AAGA;EAAE,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,OAAO;EACP,aAAa;EACb,aAAa;AACf;;AAGA;EAAE,sBAAsB;EACtB,aAAa;EACb,aAAa;AACf;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;EACb,aAAa;AACf","sourcesContent":["/* G9PathNavigator (2.5.8). */\n.g9-pathnav {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0px;\n position: relative;\n}\n\n.g9-pathnav__page {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0px;\n}\n\n.g9-pathnav__page--parked {\n display: none;\n}\n\n.g9-pathnav__split {\n display: flex;\n flex-direction: row;\n flex: 1;\n min-height: 0px;\n}\n\n.g9-pathnav__master {\n display: flex;\n flex-direction: column;\n min-height: 0px;\n}\n\n.g9-pathnav__detail {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n min-height: 0px;\n}\n"],"sourceRoot":""}
@@ -0,0 +1,25 @@
1
+ import { type ComponentType, type ReactNode } from '@lynx-js/react';
2
+ import { type G9PathEntry, type G9PathPageProps, type G9PathRouter, type G9PathRouterState } from './path-router.js';
3
+ import './path-navigator.css';
4
+ /** The router's state (re-renders on every navigation). */
5
+ export declare function useG9PathRouter(router: G9PathRouter): G9PathRouterState;
6
+ /** A page loaded on demand (its own lazy bundle); `preload()` fetches it ahead (the tab roots after the first frame). */
7
+ export declare function g9LazyPage(load: () => Promise<{
8
+ readonly default: ComponentType<G9PathPageProps>;
9
+ }>, fallback?: ComponentType<G9PathPageProps>): ComponentType<G9PathPageProps> & {
10
+ preload: () => Promise<unknown>;
11
+ };
12
+ /** Props of {@link G9PathNavigator}. */
13
+ export interface G9PathNavigatorProps {
14
+ readonly router: G9PathRouter;
15
+ /** Lists beside their details (default the provider's layout: wide windows). */
16
+ readonly wide?: boolean;
17
+ /** Wraps each page (the app's frame for `route.layout`, a motion by `kind`). */
18
+ readonly renderPage?: (entry: G9PathEntry, page: ReactNode, pane: G9PathPageProps['pane']) => ReactNode;
19
+ /** How long a popped page takes to leave (ms) before the router forgets it. Default 0. */
20
+ readonly leaveMs?: number;
21
+ readonly id?: string;
22
+ }
23
+ /** Draws the router: the top page (and the one parked under it), or a list and its detail side by side. */
24
+ export declare function G9PathNavigator(props: G9PathNavigatorProps): ReactNode;
25
+ //# sourceMappingURL=path-navigator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-navigator.d.ts","sourceRoot":"","sources":["../../src/route/path-navigator.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,SAAS,EAIf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AACvB,OAAO,sBAAsB,CAAC;AAE9B,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB,CAKvE;AAED,yHAAyH;AACzH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,OAAO,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;CAAE,CAAC,EACzE,QAAQ,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,GACxC,aAAa,CAAC,eAAe,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAUtE;AAED,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;IACxG,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAoEtE"}
@@ -0,0 +1,98 @@
1
+ import { Suspense, createElement, lazy, useEffect, useSyncExternalStore } from "@lynx-js/react";
2
+ import { useG9Direction, useG9Layout } from "../provider/hooks.jsx";
3
+ import { g9ParsePath } from "./path-router.jsx";
4
+ import "./path-navigator.css";
5
+ function useG9PathRouter(router) {
6
+ return useSyncExternalStore((l)=>router.subscribe(l), ()=>router.get());
7
+ }
8
+ function g9LazyPage(load, fallback) {
9
+ let pending = null;
10
+ const once = ()=>{
11
+ null != pending || (pending = load());
12
+ return pending;
13
+ };
14
+ const Lazy = lazy(once);
15
+ const Page = (props)=>createElement(Suspense, {
16
+ fallback: fallback ? createElement(fallback, props) : null
17
+ }, createElement(Lazy, props));
18
+ return Object.assign(Page, {
19
+ preload: once
20
+ });
21
+ }
22
+ function draw(props, entry, pane) {
23
+ const page = createElement(entry.route.component, {
24
+ params: entry.params,
25
+ url: entry.url,
26
+ pane,
27
+ state: entry.state
28
+ });
29
+ return props.renderPage ? props.renderPage(entry, page, pane) : page;
30
+ }
31
+ function G9PathNavigator(props) {
32
+ var _props_wide;
33
+ const state = useG9PathRouter(props.router);
34
+ const layout = useG9Layout();
35
+ const rtl = 'rtl' === useG9Direction();
36
+ const wide = null != (_props_wide = props.wide) ? _props_wide : layout.wide;
37
+ const leaving = state.leaving;
38
+ useEffect(()=>{
39
+ var _props_leaveMs;
40
+ if (!leaving) return;
41
+ const timer = setTimeout(()=>props.router.clearLeaving(leaving.key), null != (_props_leaveMs = props.leaveMs) ? _props_leaveMs : 0);
42
+ return ()=>clearTimeout(timer);
43
+ }, [
44
+ null == leaving ? void 0 : leaving.key
45
+ ]);
46
+ const top = state.stack[state.stack.length - 1];
47
+ const root = {
48
+ className: `g9-pathnav g9-pathnav--${state.kind}`,
49
+ ...props.id ? {
50
+ id: props.id
51
+ } : {}
52
+ };
53
+ if (!top) return <view {...root}/>;
54
+ const masterPattern = top.route.master ? top.route.pattern : top.route.detailOf;
55
+ const masterRoute = masterPattern ? props.router.routeByPattern(masterPattern) : null;
56
+ if (wide && (null == masterRoute ? void 0 : masterRoute.master)) {
57
+ var _masterRoute_master_width;
58
+ const below = [
59
+ ...state.stack
60
+ ].reverse().find((e)=>e.route.pattern === masterRoute.pattern);
61
+ const master = null != below ? below : {
62
+ key: -1,
63
+ url: g9ParsePath(masterRoute.pattern),
64
+ params: {},
65
+ route: masterRoute,
66
+ state: {}
67
+ };
68
+ const Empty = masterRoute.master.empty;
69
+ return <view {...root}>
70
+ <view className="g9-pathnav__split" style={{
71
+ flexDirection: rtl ? 'row-reverse' : 'row',
72
+ direction: 'ltr'
73
+ }}>
74
+ <view key={`m${master.key}`} className="g9-pathnav__master" style={{
75
+ width: `${null != (_masterRoute_master_width = masterRoute.master.width) ? _masterRoute_master_width : 320}px`,
76
+ [rtl ? 'borderLeft' : 'borderRight']: '1px solid var(--g9-divider)'
77
+ }}>
78
+ {draw(props, master, 'master')}
79
+ </view>
80
+ <view className="g9-pathnav__detail">
81
+ {top.route.master ? Empty ? <Empty/> : null : <view key={`d${top.key}`} className="g9-pathnav__page">
82
+ {draw(props, top, 'detail')}
83
+ </view>}
84
+ </view>
85
+ </view>
86
+ </view>;
87
+ }
88
+ const parked = state.stack.length > 1 ? state.stack[state.stack.length - 2] : null;
89
+ return <view {...root}>
90
+ {parked ? <view key={`p${parked.key}`} className="g9-pathnav__page g9-pathnav__page--parked">
91
+ {draw(props, parked, 'full')}
92
+ </view> : null}
93
+ <view key={`p${top.key}`} className="g9-pathnav__page">
94
+ {draw(props, top, 'full')}
95
+ </view>
96
+ </view>;
97
+ }
98
+ export { G9PathNavigator, g9LazyPage, useG9PathRouter };