@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
@@ -0,0 +1,117 @@
1
+ import { searchKey } from "@g9tm/lynxcontrols-foundation";
2
+ import { useRef, useState } from "@lynx-js/react";
3
+ import { useG9Keys } from "../commands/keys.jsx";
4
+ function step(from, by, count, o) {
5
+ let i = from;
6
+ for(let n = 0; n < count; n++){
7
+ var _o_skip;
8
+ i += by;
9
+ if (i < 0 || i >= count) {
10
+ if (!o.wrap) return from;
11
+ i = (i + count) % count;
12
+ }
13
+ if (!(null == (_o_skip = o.skip) ? void 0 : _o_skip.call(o, i))) return i;
14
+ }
15
+ return from;
16
+ }
17
+ function listKeyAction(e, active, count, o = {}) {
18
+ if (count <= 0 || e.ctrl || e.meta || e.alt) return {
19
+ kind: 'none'
20
+ };
21
+ const k = 1 === e.key.length ? e.key.toLowerCase() : e.key;
22
+ const vim = false !== o.vim;
23
+ const forward = o.horizontal ? o.rtl ? 'ArrowLeft' : 'ArrowRight' : 'ArrowDown';
24
+ const back = o.horizontal ? o.rtl ? 'ArrowRight' : 'ArrowLeft' : 'ArrowUp';
25
+ const first = ()=>step(-1, 1, count, {
26
+ ...o,
27
+ wrap: false
28
+ });
29
+ const last = ()=>step(count, -1, count, {
30
+ ...o,
31
+ wrap: false
32
+ });
33
+ if (k === forward || vim && 'j' === k) return {
34
+ kind: 'move',
35
+ index: active < 0 ? first() : step(active, 1, count, o)
36
+ };
37
+ if (k === back || vim && 'k' === k) return {
38
+ kind: 'move',
39
+ index: active < 0 ? last() : step(active, -1, count, o)
40
+ };
41
+ if ('Home' === k) return {
42
+ kind: 'move',
43
+ index: first()
44
+ };
45
+ if ('End' === k) return {
46
+ kind: 'move',
47
+ index: last()
48
+ };
49
+ if (('Enter' === k || ' ' === k) && active >= 0) return {
50
+ kind: 'activate',
51
+ index: active
52
+ };
53
+ return {
54
+ kind: 'none'
55
+ };
56
+ }
57
+ function typeAheadIndex(labels, typed, active) {
58
+ const q = searchKey(typed);
59
+ if (!q) return -1;
60
+ const n = labels.length;
61
+ for(let d = 1; d <= n; d++){
62
+ var _labels_i;
63
+ const i = (Math.max(-1, active) + d) % n;
64
+ if (searchKey(null != (_labels_i = labels[i]) ? _labels_i : '').startsWith(q)) return i;
65
+ }
66
+ return -1;
67
+ }
68
+ function useG9ListKeyboard(o) {
69
+ var _o_initial;
70
+ const [active, setActiveState] = useState(null != (_o_initial = o.initial) ? _o_initial : -1);
71
+ const typed = useRef({
72
+ text: '',
73
+ at: 0
74
+ });
75
+ const setActive = (i)=>{
76
+ var _o_onActiveChange;
77
+ setActiveState(i);
78
+ null == (_o_onActiveChange = o.onActiveChange) || _o_onActiveChange.call(o, i);
79
+ };
80
+ const current = active >= o.count ? -1 : active;
81
+ useG9Keys((e)=>{
82
+ const action = listKeyAction(e, current, o.count, o);
83
+ if ('move' === action.kind) {
84
+ if (action.index !== current) setActive(action.index);
85
+ return true;
86
+ }
87
+ if ('activate' === action.kind) {
88
+ o.onActivate(action.index);
89
+ return true;
90
+ }
91
+ if (o.labelOf && 1 === e.key.length && !e.ctrl && !e.meta && !e.alt && ' ' !== e.key) {
92
+ const now = Date.now();
93
+ const text = now - typed.current.at < 700 ? typed.current.text + e.key : e.key;
94
+ typed.current = {
95
+ text,
96
+ at: now
97
+ };
98
+ const labels = Array.from({
99
+ length: o.count
100
+ }, (_, i)=>o.labelOf(i));
101
+ const from = text.length > 1 ? current - 1 : current;
102
+ const i = typeAheadIndex(labels, text, from);
103
+ if (i >= 0) {
104
+ if (i !== current) setActive(i);
105
+ return true;
106
+ }
107
+ }
108
+ return false;
109
+ }, {
110
+ enabled: false !== o.enabled && o.count > 0
111
+ });
112
+ return {
113
+ active: current,
114
+ setActive
115
+ };
116
+ }
117
+ export { listKeyAction, typeAheadIndex, useG9ListKeyboard };
@@ -74,7 +74,9 @@
74
74
  font-size: 15px;
75
75
  font-family: var(--g9-font-text);
76
76
  color: var(--g9-text-primary);
77
+ text-overflow: ellipsis;
77
78
  line-height: 24px;
79
+ overflow: hidden;
78
80
  }
79
81
 
80
82
  .g9-list-row__title--plain {
@@ -108,15 +110,19 @@
108
110
  font-size: 12px;
109
111
  font-family: var(--g9-font-text);
110
112
  color: var(--g9-text-secondary);
113
+ text-overflow: ellipsis;
111
114
  line-height: 19px;
115
+ overflow: hidden;
112
116
  }
113
117
 
114
118
  .g9-list-row__value {
115
119
  font-size: 14px;
116
120
  font-family: var(--g9-font-text);
117
121
  color: var(--g9-text-secondary);
122
+ text-overflow: ellipsis;
118
123
  flex-shrink: 0;
119
124
  max-width: 45%;
125
+ overflow: hidden;
120
126
  }
121
127
 
122
128
  .g9-settings {
@@ -222,16 +228,29 @@
222
228
  min-height: 0;
223
229
  }
224
230
 
225
- .g9-drag-list {
231
+ .g9-drag-list, .g9-drag-list__row {
232
+ flex-direction: column;
233
+ display: flex;
226
234
  position: relative;
227
235
  }
228
236
 
229
- .g9-drag-list__row {
237
+ .g9-drag-list__inner {
230
238
  flex-direction: column;
231
239
  display: flex;
232
- position: absolute;
233
- left: 0;
234
- right: 0;
240
+ }
241
+
242
+ .g9-drag-list__handle {
243
+ flex-shrink: 0;
244
+ justify-content: center;
245
+ align-items: center;
246
+ width: 40px;
247
+ height: 40px;
248
+ display: flex;
249
+ }
250
+
251
+ .g9-drag-list__handle-icon {
252
+ width: 20px;
253
+ height: 20px;
235
254
  }
236
255
 
237
256
  .g9-drag-list__row--lifted {
@@ -247,5 +266,9 @@
247
266
  display: flex;
248
267
  }
249
268
 
269
+ .g9-vlist__item--active {
270
+ background-color: var(--g9-default-pressed);
271
+ }
272
+
250
273
 
251
274
  /*# sourceMappingURL=list.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/list/list.css"],"names":[],"mappings":"AACA;EAAE,mCAAmC;EACnC,8CAA8C;EAC9C,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;EACb,kBAAkB;AACpB;;AAIA;EADE,0BAA0B;EAC1B,wBAAwB;EACxB,sCAAsC;AACxC;;AAIA;EADE,0CAA0C;AAC5C;;AAKA;EAFE,2CAA2C;AAC7C;;AAMA;EAHE,oBAAoB;EACpB,YAAY;AACd;;AAMA;EAHE,mBAAmB;EACnB,gBAAgB;EAChB,aAAa;AACf;;AAMA;EAHE,sBAAsB;EACtB,aAAa;AACf;;AAMA;EAHE,UAAU;EACV,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AAOA;EAJE,OAAO;AACT;;AAOA;EAJE,QAAQ;AACV;;AAOA;EAJE,mBAAmB;EACnB,cAAc;EACd,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;EAC7B,iBAAiB;AACnB;;AAOA;EAJE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;EAC/B,iBAAiB;AACnB;;AAOA;EAJE,eAAe;EACf,oCAAoC;EACpC,iBAAiB;EACjB,iBAAiB;AACnB;;AAOA;EAJE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;EAC9B,eAAe;EACf,iBAAiB;AACnB;;AAOA;EAJE,sBAAsB;EACtB,gCAAgC;AAClC;;AAOA;EAJE,eAAe;EACf,gCAAgC;EA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;;AAWA;EARE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf","sourcesContent":["/* G9ListRow, G9SettingsGroup, G9Pager, G9VirtualList. */\n.g9-list-row {\n display: flex;\n align-items: center;\n position: relative;\n column-gap: 12px;\n padding: 8px 16px;\n background-color: var(--g9-surface);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface);\n}\n\n.g9-list-row--divider {\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: var(--g9-divider);\n}\n\n.g9-list-row--pressable {\n transition: background-color 120ms ease-out;\n}\n\n/* pressFeedback 'tint' (2.5.7): the state layer while the finger is down, drawn natively. */\n.g9-list-row--tint:active {\n background-color: var(--g9-default-pressed);\n}\n\n/* `below` (2.5.7): the row over full-width content, one block. */\n.g9-list-row--stacked {\n align-items: stretch;\n row-gap: 8px;\n}\n\n.g9-list-row__main {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n\n.g9-list-row__below {\n display: flex;\n flex-direction: column;\n}\n\n.g9-list-row__edge {\n position: absolute;\n top: 0px;\n bottom: 0px;\n width: 3px;\n}\n\n/* the reading direction, explicit: Lynx does not inherit `direction`, so a logical property inside a page reads LTR */\n.g9-list-row__edge--ltr {\n left: 0px;\n}\n\n.g9-list-row__edge--rtl {\n right: 0px;\n}\n\n.g9-list-row__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 11px;\n flex-shrink: 0;\n}\n\n.g9-list-row__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-list-row__title {\n font-size: 15px;\n font-family: var(--g9-font-text);\n line-height: 24px;\n color: var(--g9-text-primary);\n}\n\n.g9-list-row__title--plain {\n font-size: 14px;\n font-family: var(--g9-font-text);\n line-height: 20px;\n color: var(--g9-text-secondary);\n}\n\n.g9-list-row__title--strong {\n font-size: 14px;\n font-family: var(--g9-font-text-700);\n line-height: 21px;\n font-weight: bold;\n}\n\n.g9-list-row__hint {\n font-size: 11px;\n font-family: var(--g9-font-text);\n line-height: 16px;\n color: var(--g9-text-tertiary);\n margin-top: 2px;\n}\n\n.g9-list-row__title--danger {\n color: var(--g9-error);\n font-family: var(--g9-font-text);\n}\n\n.g9-list-row__subtitle {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-secondary);\n}\n\n.g9-list-row__value {\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n flex-shrink: 0;\n max-width: 45%;\n}\n\n.g9-settings {\n display: flex;\n flex-direction: column;\n row-gap: 6px;\n}\n\n.g9-settings__title {\n padding: 0px 4px;\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-text-secondary);\n}\n\n.g9-settings__description {\n padding: 0px 4px;\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-settings__card {\n display: flex;\n flex-direction: column;\n border-radius: var(--g9-radius-card);\n overflow: hidden;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n background-color: var(--g9-surface);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface);\n}\n\n.g9-settings__footer {\n display: flex;\n flex-direction: column;\n padding: 0px 4px;\n}\n\n.g9-pager {\n display: flex;\n align-items: center;\n justify-content: center;\n column-gap: 12px;\n padding: 8px 0px;\n}\n\n.g9-pager__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 20px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-pager__btn--off {\n opacity: 0.35;\n}\n\n.g9-pager__label {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-vlist {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-vlist--empty {\n display: flex;\n flex-direction: column;\n}\n\n/* G9PullToRefresh */\n.g9-ptr {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0px;\n overflow: hidden;\n}\n\n.g9-ptr__indicator {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-ptr__scroll {\n flex: 1;\n min-height: 0px;\n}\n\n/* G9DragList */\n.g9-drag-list {\n position: relative;\n}\n\n.g9-drag-list__row {\n position: absolute;\n left: 0px;\n right: 0px;\n display: flex;\n flex-direction: column;\n}\n\n.g9-drag-list__row--lifted {\n z-index: 2;\n opacity: 0.95;\n box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.22);\n background-color: var(--g9-surface);\n}\n\n/* A readable list's last row is measured through this wrapper (its height decides how it lands). */\n.g9-vlist__measure {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/list/list.css"],"names":[],"mappings":"AACA;EAAE,mCAAmC;EACnC,8CAA8C;EAC9C,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;EACb,kBAAkB;AACpB;;AAIA;EADE,0BAA0B;EAC1B,wBAAwB;EACxB,sCAAsC;AACxC;;AAIA;EADE,0CAA0C;AAC5C;;AAKA;EAFE,2CAA2C;AAC7C;;AAMA;EAHE,oBAAoB;EACpB,YAAY;AACd;;AAMA;EAHE,mBAAmB;EACnB,gBAAgB;EAChB,aAAa;AACf;;AAMA;EAHE,sBAAsB;EACtB,aAAa;AACf;;AAMA;EAHE,UAAU;EACV,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AAOA;EAJE,OAAO;AACT;;AAOA;EAJE,QAAQ;AACV;;AAOA;EAJE,mBAAmB;EACnB,cAAc;EACd,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAOA;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WA;EARE,sBAAsB;EACtB,aAAa;AACf;;AAYA;EATE,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAYA;EATE,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,QAAQ;AACV;;AAYA;EATE,OAAO;EACP,aAAa;AACf;;AAaA;EAVE,sBAAsB;EACtB,aAAa;EACb,kBAAkB;AACpB;;AAoBA;EAjBE,sBAAsB;EACtB,aAAa;AACf;;AAoBA;EAjBE,cAAc;EACd,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAoBA;EAjBE,WAAW;EACX,YAAY;AACd;;AAoBA;EAjBE,UAAU;EACV,YAAY;EACZ,mCAAmC;EACnC,gCAAgC;AAClC;;AAqBA;EAlBE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAsBA;EAnBE,2CAA2C;AAC7C","sourcesContent":["/* G9ListRow, G9SettingsGroup, G9Pager, G9VirtualList. */\n.g9-list-row {\n display: flex;\n align-items: center;\n position: relative;\n column-gap: 12px;\n padding: 8px 16px;\n background-color: var(--g9-surface);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface);\n}\n\n.g9-list-row--divider {\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: var(--g9-divider);\n}\n\n.g9-list-row--pressable {\n transition: background-color 120ms ease-out;\n}\n\n/* pressFeedback 'tint' (2.5.7): the state layer while the finger is down, drawn natively. */\n.g9-list-row--tint:active {\n background-color: var(--g9-default-pressed);\n}\n\n/* `below` (2.5.7): the row over full-width content, one block. */\n.g9-list-row--stacked {\n align-items: stretch;\n row-gap: 8px;\n}\n\n.g9-list-row__main {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n\n.g9-list-row__below {\n display: flex;\n flex-direction: column;\n}\n\n.g9-list-row__edge {\n position: absolute;\n top: 0px;\n bottom: 0px;\n width: 3px;\n}\n\n/* the reading direction, explicit: Lynx does not inherit `direction`, so a logical property inside a page reads LTR */\n.g9-list-row__edge--ltr {\n left: 0px;\n}\n\n.g9-list-row__edge--rtl {\n right: 0px;\n}\n\n.g9-list-row__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 11px;\n flex-shrink: 0;\n}\n\n.g9-list-row__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-list-row__title {\n font-size: 15px;\n font-family: var(--g9-font-text);\n line-height: 24px;\n color: var(--g9-text-primary);\n /* a text-maxline text on Android draws its other lines out of the box unless it clips (2.5.8) */\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-list-row__title--plain {\n font-size: 14px;\n font-family: var(--g9-font-text);\n line-height: 20px;\n color: var(--g9-text-secondary);\n}\n\n.g9-list-row__title--strong {\n font-size: 14px;\n font-family: var(--g9-font-text-700);\n line-height: 21px;\n font-weight: bold;\n}\n\n.g9-list-row__hint {\n font-size: 11px;\n font-family: var(--g9-font-text);\n line-height: 16px;\n color: var(--g9-text-tertiary);\n margin-top: 2px;\n}\n\n.g9-list-row__title--danger {\n color: var(--g9-error);\n font-family: var(--g9-font-text);\n}\n\n.g9-list-row__subtitle {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-secondary);\n /* a text-maxline text on Android draws its other lines out of the box unless it clips (2.5.8) */\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-list-row__value {\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n flex-shrink: 0;\n max-width: 45%;\n /* a text-maxline text on Android draws its other lines out of the box unless it clips (2.5.8) */\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-settings {\n display: flex;\n flex-direction: column;\n row-gap: 6px;\n}\n\n.g9-settings__title {\n padding: 0px 4px;\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-text-secondary);\n}\n\n.g9-settings__description {\n padding: 0px 4px;\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-settings__card {\n display: flex;\n flex-direction: column;\n border-radius: var(--g9-radius-card);\n overflow: hidden;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n background-color: var(--g9-surface);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface);\n}\n\n.g9-settings__footer {\n display: flex;\n flex-direction: column;\n padding: 0px 4px;\n}\n\n.g9-pager {\n display: flex;\n align-items: center;\n justify-content: center;\n column-gap: 12px;\n padding: 8px 0px;\n}\n\n.g9-pager__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 20px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-pager__btn--off {\n opacity: 0.35;\n}\n\n.g9-pager__label {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-vlist {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-vlist--empty {\n display: flex;\n flex-direction: column;\n}\n\n/* G9PullToRefresh */\n.g9-ptr {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0px;\n overflow: hidden;\n}\n\n.g9-ptr__indicator {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-ptr__scroll {\n flex: 1;\n min-height: 0px;\n}\n\n/* G9DragList */\n.g9-drag-list {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\n/* Rows in the flow (any height, measured); a lifted row moves on the main thread through its inner view (2.5.8). */\n.g9-drag-list__row {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\n.g9-drag-list__inner {\n display: flex;\n flex-direction: column;\n}\n\n.g9-drag-list__handle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n}\n\n.g9-drag-list__handle-icon {\n width: 20px;\n height: 20px;\n}\n\n.g9-drag-list__row--lifted {\n z-index: 2;\n opacity: 0.95;\n box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.22);\n background-color: var(--g9-surface);\n}\n\n/* A readable list's last row is measured through this wrapper (its height decides how it lands). */\n.g9-vlist__measure {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n/* The keyboard's active row of a G9VirtualList (2.5.8). */\n.g9-vlist__item--active {\n background-color: var(--g9-default-pressed);\n}\n"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/list/rows.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAOjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,cAAc,CAAC;AACvD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAOxD,kCAAkC;AAClC,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,QAAQ,C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AAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CA2BtE;AAID,gCAAgC;AAChC,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACtE;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAmDtD"}
@@ -1,7 +1,7 @@
1
1
  import "./list.css";
2
2
  import { G9Glyph } from "@g9tm/lynxcontrols-foundation";
3
3
  import { Children, cloneElement, isValidElement, memo } from "@lynx-js/react";
4
- import { g9ChildId, g9IdProps, g9RowStyle, g9TextStart, mergeStyle, useG9Control } from "../base/control.jsx";
4
+ import { g9ChildId, g9IdProps, g9Paragraph, g9RowStyle, g9TextStart, mergeStyle, useG9Control } from "../base/control.jsx";
5
5
  import { useG9Press } from "../base/press.jsx";
6
6
  import { toneColors } from "../base/tone.jsx";
7
7
  import { G9Icon } from "../icon/icon.jsx";
@@ -42,10 +42,10 @@ const G9ListRow = memo(function(props) {
42
42
  {props.title}
43
43
  </text>
44
44
  {props.subtitle ? <text className="g9-list-row__subtitle" text-maxline={String(null != (_props_subtitleLines = props.subtitleLines) ? _props_subtitleLines : 2)} style={g9TextStart(control.direction)}>
45
- {props.subtitle}
45
+ {g9Paragraph(props.subtitle, control.direction)}
46
46
  </text> : null}
47
47
  {props.hint ? <text className="g9-list-row__hint" style={g9TextStart(control.direction)}>
48
- {props.hint}
48
+ {g9Paragraph(props.hint, control.direction)}
49
49
  </text> : null}
50
50
  </view>
51
51
  {props.value ? <text className="g9-list-row__value" text-maxline="1">
@@ -9,7 +9,14 @@ export interface G9VirtualListProps<T> {
9
9
  readonly items: readonly T[];
10
10
  /** A stable, unique key per item (wrong or colliding keys make Lynx's recycler show the wrong cell). */
11
11
  readonly getKey: (item: T, index: number) => string;
12
- readonly renderItem: (item: T, index: number) => ReactNode;
12
+ /** A row. `state.active`: it is the keyboard's active row (`keyboard`). */
13
+ readonly renderItem: (item: T, index: number, state: G9VirtualRowState) => ReactNode;
14
+ /**
15
+ * Keyboard navigation on hosts with a keyboard (G9Hub's mail lists, 2.5.8): J/K and the arrows move an active row
16
+ * (drawn with a state layer, scrolled to the middle, said by its accessibility status), Home/End jump, Enter
17
+ * activates, typing jumps by `labelOf`.
18
+ */
19
+ readonly keyboard?: G9VirtualListKeyboard<T>;
13
20
  /**
14
21
  * Height (width when horizontal) of an item before it is measured, in px — the recycler sizes its scroll bar and jumps
15
22
  * with it. A number for all, or per item (headers vs rows). Default 56.
@@ -90,6 +97,25 @@ export interface G9VirtualListProps<T> {
90
97
  */
91
98
  readonly reuseKey?: (item: T, index: number) => string;
92
99
  }
100
+ /** What a row is told besides its item. */
101
+ export interface G9VirtualRowState {
102
+ readonly active: boolean;
103
+ }
104
+ /** {@link G9VirtualListProps.keyboard}. */
105
+ export interface G9VirtualListKeyboard<T> {
106
+ readonly onActivate: (item: T, index: number) => void;
107
+ /** A row's words for type-ahead. */
108
+ readonly labelOf?: (item: T, index: number) => string;
109
+ /** Default true. */
110
+ readonly enabled?: boolean;
111
+ /** J and K too. Default true. */
112
+ readonly vim?: boolean;
113
+ readonly wrap?: boolean;
114
+ /** Rows that cannot be active (headings). */
115
+ readonly skip?: (item: T, index: number) => boolean;
116
+ /** After the active row changed. */
117
+ readonly onActiveChange?: (item: T | undefined, index: number) => void;
118
+ }
93
119
  /** What {@link G9VirtualListProps.handleRef} receives. */
94
120
  export interface G9VirtualListHandle {
95
121
  /** Scrolls to the item with this key: its top (`'start'`, default) or bottom (`'end'`) at the list's edge. */
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../src/list/virtual-list.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,EAAQ,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,iBAAiB,CAAC;AAE1E,sCAAsC;AACtC,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,wGAAwG;IACxG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAC3D;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,E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,QAAQ,CAAC,OAAO,EAAE,KAAK,GAAG,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAIjE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE;IAClC,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAClD,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAqB5G;AAED,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,iJAAiJ;AACjJ,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,iGAAiG;AACjG,eAAO,MAAM,eAAe,KAAK,CAAC;AAmBlC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,SAAS,CA4RxE"}
@@ -1,6 +1,8 @@
1
1
  import "./list.css";
2
2
  import { memo, useEffect, useMemo, useRef, useState } from "@lynx-js/react";
3
3
  import { g9IdProps, mergeStyle } from "../base/control.jsx";
4
+ import { useG9Direction } from "../provider/hooks.jsx";
5
+ import { useG9ListKeyboard } from "./keyboard.jsx";
4
6
  function g9ReadableLanding(listHeight, itemHeight, gap) {
5
7
  return listHeight > 0 && itemHeight > listHeight - 2 * gap ? {
6
8
  alignTo: 'top',
@@ -40,6 +42,16 @@ const g9ListNextBatch = 96;
40
42
  const Cell = memo(function(props) {
41
43
  return props.render();
42
44
  });
45
+ const ACTIVE_ITEM = Object.freeze({
46
+ className: 'g9-vlist__item--active',
47
+ 'accessibility-status': 'selected'
48
+ });
49
+ const INACTIVE = Object.freeze({
50
+ active: false
51
+ });
52
+ const ACTIVE = Object.freeze({
53
+ active: true
54
+ });
43
55
  const DEFER_UNMOUNT = Object.freeze({
44
56
  unmountRecycled: true
45
57
  });
@@ -48,6 +60,36 @@ function G9VirtualList(props) {
48
60
  const est = null != (_props_estimatedSize = props.estimatedSize) ? _props_estimatedSize : 56;
49
61
  const render = useRef(props.renderItem);
50
62
  render.current = props.renderItem;
63
+ const rtl = 'rtl' === useG9Direction();
64
+ const kb = props.keyboard;
65
+ const nav = useG9ListKeyboard({
66
+ count: kb ? props.items.length : 0,
67
+ enabled: void 0 !== kb && false !== kb.enabled,
68
+ ...(null == kb ? void 0 : kb.vim) !== void 0 ? {
69
+ vim: kb.vim
70
+ } : {},
71
+ ...(null == kb ? void 0 : kb.wrap) !== void 0 ? {
72
+ wrap: kb.wrap
73
+ } : {},
74
+ ...props.horizontal ? {
75
+ horizontal: true,
76
+ rtl
77
+ } : {},
78
+ ...(null == kb ? void 0 : kb.skip) ? {
79
+ skip: (i)=>kb.skip(props.items[i], i)
80
+ } : {},
81
+ ...(null == kb ? void 0 : kb.labelOf) ? {
82
+ labelOf: (i)=>kb.labelOf(props.items[i], i)
83
+ } : {},
84
+ onActivate: (i)=>null == kb ? void 0 : kb.onActivate(props.items[i], i),
85
+ onActiveChange: (i)=>{
86
+ var _kb_onActiveChange, _scrollActive_current;
87
+ null == kb || null == (_kb_onActiveChange = kb.onActiveChange) || _kb_onActiveChange.call(kb, props.items[i], i);
88
+ if (i >= 0) null == (_scrollActive_current = scrollActive.current) || _scrollActive_current.call(scrollActive, i);
89
+ }
90
+ });
91
+ const scrollActive = useRef(null);
92
+ const activeKey = nav.active >= 0 && void 0 !== props.items[nav.active] ? props.getKey(props.items[nav.active], nav.active) : null;
51
93
  const initial = null != (_props_initialIndex = props.initialIndex) ? _props_initialIndex : props.startAtEnd ? Math.max(0, props.items.length - 1) : void 0;
52
94
  const columns = Math.max(1, null != (_props_columns = props.columns) ? _props_columns : 1);
53
95
  const listType = 'waterfall' === props.kind ? 'waterfall' : columns > 1 ? 'flow' : 'single';
@@ -108,6 +150,7 @@ function G9VirtualList(props) {
108
150
  return false;
109
151
  }
110
152
  };
153
+ scrollActive.current = (i)=>void scrollTo(i + (props.header ? 1 : 0), 'middle', 0, true);
111
154
  const atEnd = useRef(true);
112
155
  const landRef = useRef(null);
113
156
  const [watcher] = useState(()=>g9LastRowWatcher({
@@ -184,13 +227,14 @@ function G9VirtualList(props) {
184
227
  'full-span': true
185
228
  } : {};
186
229
  const reuse = props.reuseKey ? props.reuseKey(item, index) : void 0;
187
- const plain = <Cell item={item} render={()=>render.current(item, index)}/>;
230
+ const active = key === activeKey;
231
+ const plain = <Cell item={item} active={active} render={()=>render.current(item, index, active ? ACTIVE : INACTIVE)}/>;
188
232
  const cell = readable && index === lastIndex ? <view className="g9-vlist__measure" bindlayoutchange={onLastLayout}>
189
233
  {plain}
190
234
  </view> : plain;
191
- return defer ? <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span} defer={defer}>
235
+ return defer ? <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span} {...active ? ACTIVE_ITEM : {}} defer={defer}>
192
236
  {cell}
193
- </list-item> : <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span}>
237
+ </list-item> : <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span} {...active ? ACTIVE_ITEM : {}}>
194
238
  {cell}
195
239
  </list-item>;
196
240
  }), [
@@ -202,7 +246,8 @@ function G9VirtualList(props) {
202
246
  props.reuseKey,
203
247
  defer,
204
248
  readable,
205
- lastIndex
249
+ lastIndex,
250
+ activeKey
206
251
  ]);
207
252
  if (0 === props.items.length && props.empty) return <view className={`g9-vlist g9-vlist--empty${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)} style={mergeStyle(void 0, props.style)}>
208
253
  {props.header}
@@ -0,0 +1,3 @@
1
+ export { type G9NotificationEntry, type G9NotificationFilter, type G9NotificationGroup, type G9SnoozePreset, g9GroupNotifications, g9NotificationMatches, g9SnoozeUntil, g9UnreadByFilter, } from './model.js';
2
+ export { G9NotificationCenter, G9NotificationCenterPanel, type G9NotificationCenterPanelProps, type G9NotificationCenterProps, type G9NotificationCenterWords, type G9SnoozeChoice, type G9SnoozedNotification, g9SnoozeChoices, } from './notification-center.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { g9GroupNotifications, g9NotificationMatches, g9SnoozeUntil, g9UnreadByFilter } from "./model.jsx";
2
+ export { G9NotificationCenter, G9NotificationCenterPanel, g9SnoozeChoices } from "./notification-center.jsx";
@@ -0,0 +1,47 @@
1
+ import type { G9IconInput } from '../icon/icon.js';
2
+ /** One notification as the center shows it (the app words it: `text`, `time`). */
3
+ export interface G9NotificationEntry {
4
+ readonly id: string;
5
+ /** The app's kind (`mention`, `task_assigned`…): the group of entries without a source. */
6
+ readonly kind: string;
7
+ readonly text: string;
8
+ /** When, as the app says it («۵ دقیقه پیش»). */
9
+ readonly time?: string;
10
+ /** Orders the entries: the greater is the newer (an ISO time or a number). */
11
+ readonly sortKey: string | number;
12
+ readonly read?: boolean;
13
+ /** The filter the entry belongs to (`mentions`, `tasks`…); none: only under the filter that matches all. */
14
+ readonly category?: string;
15
+ /** Where it comes from (`c:<conversation>`, `e:<event>`): entries of one source are one group. */
16
+ readonly groupKey?: string | null;
17
+ /** The source's name (the group's title). */
18
+ readonly groupTitle?: string | null;
19
+ readonly icon?: G9IconInput;
20
+ }
21
+ /** A filter chip. Without `matches`: key `all` takes every entry, any other key the entries of that `category`. */
22
+ export interface G9NotificationFilter {
23
+ readonly key: string;
24
+ readonly label: string;
25
+ readonly matches?: (entry: G9NotificationEntry) => boolean;
26
+ }
27
+ /** Entries of one source (or of one kind). */
28
+ export interface G9NotificationGroup {
29
+ readonly key: string;
30
+ /** The source's name, or null (the view names it by the entries' filter or kind). */
31
+ readonly title: string | null;
32
+ readonly kind: string;
33
+ readonly category?: string;
34
+ readonly items: readonly G9NotificationEntry[];
35
+ readonly unread: number;
36
+ }
37
+ /** Whether the entry is under the filter. */
38
+ export declare function g9NotificationMatches(entry: G9NotificationEntry, filter: G9NotificationFilter | null | undefined): boolean;
39
+ /** The groups under the filter: newest group first, newest entry first inside. */
40
+ export declare function g9GroupNotifications(items: readonly G9NotificationEntry[], filter?: G9NotificationFilter | null): G9NotificationGroup[];
41
+ /** Unread entries under each filter (the chips' counts). */
42
+ export declare function g9UnreadByFilter(items: readonly G9NotificationEntry[], filters: readonly G9NotificationFilter[]): Record<string, number>;
43
+ /** A snooze preset. */
44
+ export type G9SnoozePreset = 'hour' | 'tomorrow' | 'week';
45
+ /** The instant a preset means: in an hour; tomorrow, or the same weekday next week, at `hour`:00 (default 9, local). */
46
+ export declare function g9SnoozeUntil(preset: G9SnoozePreset, now?: Date, hour?: number): Date;
47
+ //# sourceMappingURL=model.d.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AAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,6CAA6C;AAC7C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAC9C,OAAO,CAIT;AAUD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,GACnC,mBAAmB,EAAE,CAwBvB;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKxB;AAED,uBAAuB;AACvB,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAE1D,wHAAwH;AACxH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,GAAE,IAAiB,EAAE,IAAI,SAAI,GAAG,IAAI,CAM5F"}
@@ -0,0 +1,51 @@
1
+ function g9NotificationMatches(entry, filter) {
2
+ if (!filter) return true;
3
+ if (filter.matches) return filter.matches(entry);
4
+ return 'all' === filter.key || entry.category === filter.key;
5
+ }
6
+ function newerFirst(a, b) {
7
+ if ('number' == typeof a.sortKey && 'number' == typeof b.sortKey) return b.sortKey - a.sortKey;
8
+ const x = String(a.sortKey);
9
+ const y = String(b.sortKey);
10
+ return Number(x < y) - Number(x > y);
11
+ }
12
+ function g9GroupNotifications(items, filter) {
13
+ const groups = new Map();
14
+ const sorted = items.filter((item)=>g9NotificationMatches(item, filter)).sort(newerFirst);
15
+ for (const item of sorted){
16
+ const key = item.groupKey || `k:${item.kind || 'notice'}`;
17
+ let group = groups.get(key);
18
+ if (!group) {
19
+ var _item_groupTitle;
20
+ group = {
21
+ key,
22
+ title: item.groupKey ? null != (_item_groupTitle = item.groupTitle) ? _item_groupTitle : null : null,
23
+ kind: item.kind,
24
+ ...item.category ? {
25
+ category: item.category
26
+ } : {},
27
+ items: [],
28
+ unread: 0
29
+ };
30
+ groups.set(key, group);
31
+ }
32
+ group.items.push(item);
33
+ if (!item.read) group.unread++;
34
+ }
35
+ return [
36
+ ...groups.values()
37
+ ];
38
+ }
39
+ function g9UnreadByFilter(items, filters) {
40
+ const counts = {};
41
+ for (const filter of filters)counts[filter.key] = items.filter((item)=>!item.read && g9NotificationMatches(item, filter)).length;
42
+ return counts;
43
+ }
44
+ function g9SnoozeUntil(preset, now = new Date(), hour = 9) {
45
+ if ('hour' === preset) return new Date(now.getTime() + 3600000);
46
+ const next = new Date(now);
47
+ next.setDate(next.getDate() + ('tomorrow' === preset ? 1 : 7));
48
+ next.setHours(hour, 0, 0, 0);
49
+ return next;
50
+ }
51
+ export { g9GroupNotifications, g9NotificationMatches, g9SnoozeUntil, g9UnreadByFilter };
@@ -0,0 +1,98 @@
1
+ import { type ReactNode } from '@lynx-js/react';
2
+ import { type G9MenuItem } from '../popover/popover.js';
3
+ import type { G9Placement } from '../popover/position.js';
4
+ import type { G9SheetOptions } from '../sheet/options.js';
5
+ import { type G9NotificationEntry, type G9NotificationFilter, type G9NotificationGroup } from './model.js';
6
+ import './notifications.css';
7
+ /** A snoozed entry and when it comes back (as the app says it). */
8
+ export interface G9SnoozedNotification {
9
+ readonly entry: G9NotificationEntry;
10
+ readonly until: string;
11
+ }
12
+ /** A snooze choice (its key reaches `onSnooze`). */
13
+ export interface G9SnoozeChoice {
14
+ readonly key: string;
15
+ readonly label: string;
16
+ }
17
+ /** The center's words (English by default). */
18
+ export interface G9NotificationCenterWords {
19
+ readonly title?: string;
20
+ readonly more?: string;
21
+ readonly actions?: string;
22
+ readonly markRead?: string;
23
+ readonly markGroupRead?: string;
24
+ readonly markAllRead?: string;
25
+ readonly snoozeAll?: (when: string) => string;
26
+ readonly showMore?: (count: string) => string;
27
+ readonly showLess?: string;
28
+ readonly snoozed?: (count: string) => string;
29
+ readonly backAt?: (until: string) => string;
30
+ readonly unsnooze?: string;
31
+ readonly empty?: string;
32
+ readonly emptyHint?: string;
33
+ readonly emptyFilter?: string;
34
+ readonly failed?: string;
35
+ readonly unread?: string;
36
+ readonly groupActions?: (title: string) => string;
37
+ /** Numbers as the culture writes them (default: the provider culture's digits). */
38
+ readonly number?: (value: number) => string;
39
+ }
40
+ /** The default snooze choices. */
41
+ export declare const g9SnoozeChoices: readonly G9SnoozeChoice[];
42
+ /** Props of {@link G9NotificationCenter}. */
43
+ export interface G9NotificationCenterProps {
44
+ readonly id?: string;
45
+ readonly items: readonly G9NotificationEntry[];
46
+ /** The chips (default one, «all»). */
47
+ readonly filters?: readonly G9NotificationFilter[];
48
+ /** The chosen filter's key (controlled); `defaultFilter` alone: the center keeps it. */
49
+ readonly filter?: string;
50
+ readonly defaultFilter?: string;
51
+ readonly onFilterChange?: (key: string) => void;
52
+ readonly snoozed?: readonly G9SnoozedNotification[];
53
+ readonly snoozeChoices?: readonly G9SnoozeChoice[];
54
+ readonly onOpen?: (entry: G9NotificationEntry) => void;
55
+ readonly onMarkRead?: (ids: readonly string[]) => void;
56
+ readonly onMarkAllRead?: () => void;
57
+ readonly onSnooze?: (ids: readonly string[], choice: string) => void;
58
+ readonly onUnsnooze?: (id: string) => void;
59
+ /** More entries of the header's menu (a digest setting) and what they do. */
60
+ readonly menuItems?: readonly G9MenuItem[];
61
+ readonly onMenuItem?: (key: string) => void;
62
+ /** Shown under the chips (the digest's settings). */
63
+ readonly extra?: ReactNode;
64
+ /** The feed failed to load (the empty state says so). */
65
+ readonly failed?: boolean;
66
+ /** `'panel'` (default): its own title and a height limit; `'sheet'`: the sheet shows the title, the menu ends the chips. */
67
+ readonly variant?: 'panel' | 'sheet';
68
+ /** The panel's height limit (dp). Default 576. */
69
+ readonly maxHeight?: number;
70
+ /** Entries of a group shown before «show more». Default 3. */
71
+ readonly collapseAfter?: number;
72
+ /** Swipe an entry: from the start marks it read, from the end snoozes it (the first choice). Default true. */
73
+ readonly swipe?: boolean;
74
+ /** J/K, Enter, S and E on a keyboard. Default false. */
75
+ readonly keys?: boolean;
76
+ /** The name of a group without a source (default the label of its filter, else its kind). */
77
+ readonly groupTitle?: (group: G9NotificationGroup) => string;
78
+ readonly words?: G9NotificationCenterWords;
79
+ }
80
+ /** The notification center's content (inside a popover, a sheet or a page). */
81
+ export declare function G9NotificationCenter(props: G9NotificationCenterProps): ReactNode;
82
+ /** Props of {@link G9NotificationCenterPanel}. */
83
+ export interface G9NotificationCenterPanelProps extends Omit<G9NotificationCenterProps, 'variant'> {
84
+ readonly open: boolean;
85
+ readonly onClose: () => void;
86
+ /** The bell the popover opens beside (wide windows). */
87
+ readonly anchorId?: string;
88
+ /** Default `'end-end'` (beside a rail's bell). */
89
+ readonly placement?: G9Placement;
90
+ /** `'auto'` (default): a popover on wide windows, a sheet on phones. */
91
+ readonly mode?: 'auto' | 'popover' | 'sheet';
92
+ /** The popover's width (dp). Default 380. */
93
+ readonly width?: number;
94
+ readonly sheetOptions?: G9SheetOptions;
95
+ }
96
+ /** The center beside its bell (a popover) on wide windows, as a sheet on phones; opening an entry closes it. */
97
+ export declare function G9NotificationCenterPanel(props: G9NotificationCenterPanelProps): ReactNode;
98
+ //# sourceMappingURL=notification-center.d.ts.map