@g9tm/lynxcontrols 2.5.7 → 2.5.9

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 (254) 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 +17 -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 +6987 -446
  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/keep-alive.d.ts +2 -0
  158. package/dist/provider/keep-alive.d.ts.map +1 -1
  159. package/dist/provider/keep-alive.jsx +3 -1
  160. package/dist/provider/provider.d.ts +6 -1
  161. package/dist/provider/provider.d.ts.map +1 -1
  162. package/dist/provider/provider.jsx +22 -2
  163. package/dist/reader/index.d.ts +2 -0
  164. package/dist/reader/index.d.ts.map +1 -0
  165. package/dist/reader/index.jsx +1 -0
  166. package/dist/reader/reader.css +74 -0
  167. package/dist/reader/reader.css.map +1 -0
  168. package/dist/reader/reader.d.ts +76 -0
  169. package/dist/reader/reader.d.ts.map +1 -0
  170. package/dist/reader/reader.jsx +149 -0
  171. package/dist/route/index.d.ts +2 -0
  172. package/dist/route/index.d.ts.map +1 -1
  173. package/dist/route/index.jsx +2 -0
  174. package/dist/route/path-navigator.css +219 -0
  175. package/dist/route/path-navigator.css.map +1 -0
  176. package/dist/route/path-navigator.d.ts +49 -0
  177. package/dist/route/path-navigator.d.ts.map +1 -0
  178. package/dist/route/path-navigator.jsx +176 -0
  179. package/dist/route/path-router.d.ts +185 -0
  180. package/dist/route/path-router.d.ts.map +1 -0
  181. package/dist/route/path-router.jsx +369 -0
  182. package/dist/selection/selection.css +2 -0
  183. package/dist/selection/selection.css.map +1 -1
  184. package/dist/sheet/frame.d.ts.map +1 -1
  185. package/dist/sheet/frame.jsx +9 -8
  186. package/dist/sheet/options.d.ts +6 -1
  187. package/dist/sheet/options.d.ts.map +1 -1
  188. package/dist/sheet/options.jsx +2 -1
  189. package/dist/sheet/panel-frame.d.ts.map +1 -1
  190. package/dist/sheet/panel-frame.jsx +5 -4
  191. package/dist/sheet/sizing.d.ts +3 -3
  192. package/dist/sheet/sizing.d.ts.map +1 -1
  193. package/dist/sheet/sizing.jsx +1 -0
  194. package/dist/shell/shell.css +12 -1
  195. package/dist/shell/shell.css.map +1 -1
  196. package/dist/shell/shell.d.ts.map +1 -1
  197. package/dist/shell/shell.jsx +7 -5
  198. package/dist/survey/survey.d.ts.map +1 -1
  199. package/dist/survey/survey.jsx +9 -6
  200. package/dist/swipe/swipe.css +2 -0
  201. package/dist/swipe/swipe.css.map +1 -1
  202. package/dist/tab-bar/flat.jsx +5 -4
  203. package/dist/tab-bar/tab-bar.css +2 -0
  204. package/dist/tab-bar/tab-bar.css.map +1 -1
  205. package/dist/toast/index.d.ts +1 -1
  206. package/dist/toast/index.d.ts.map +1 -1
  207. package/dist/toast/service.d.ts.map +1 -1
  208. package/dist/toast/service.jsx +18 -5
  209. package/dist/toast/store.d.ts +22 -0
  210. package/dist/toast/store.d.ts.map +1 -1
  211. package/dist/toast/store.jsx +35 -3
  212. package/dist/toast/toast.css +22 -0
  213. package/dist/toast/toast.css.map +1 -1
  214. package/dist/toggle/choice.css +27 -0
  215. package/dist/toggle/choice.css.map +1 -1
  216. package/dist/toggle/choice.d.ts +36 -0
  217. package/dist/toggle/choice.d.ts.map +1 -1
  218. package/dist/toggle/choice.jsx +77 -13
  219. package/dist/toggle/index.d.ts +1 -1
  220. package/dist/toggle/index.d.ts.map +1 -1
  221. package/dist/toggle/index.jsx +1 -1
  222. package/package.json +22 -2
  223. package/skills/g9-lynx-app/references/catalog-index.md +22 -6
  224. package/skills/g9-lynx-app/references/components/appearance.md +70 -0
  225. package/skills/g9-lynx-app/references/components/barcode.md +1 -1
  226. package/skills/g9-lynx-app/references/components/button.md +4 -4
  227. package/skills/g9-lynx-app/references/components/calendar-1.md +205 -0
  228. package/skills/g9-lynx-app/references/components/calendar-2.md +36 -0
  229. package/skills/g9-lynx-app/references/components/canvas.md +33 -0
  230. package/skills/g9-lynx-app/references/components/chat-1.md +199 -0
  231. package/skills/g9-lynx-app/references/components/chat-2.md +119 -0
  232. package/skills/g9-lynx-app/references/components/commands.md +10 -2
  233. package/skills/g9-lynx-app/references/components/dashboard.md +61 -0
  234. package/skills/g9-lynx-app/references/components/display-1.md +22 -21
  235. package/skills/g9-lynx-app/references/components/display-2.md +36 -39
  236. package/skills/g9-lynx-app/references/components/display-3.md +41 -2
  237. package/skills/g9-lynx-app/references/components/fields.md +3 -3
  238. package/skills/g9-lynx-app/references/components/layout-1.md +1 -1
  239. package/skills/g9-lynx-app/references/components/list.md +5 -3
  240. package/skills/g9-lynx-app/references/components/media-1.md +203 -0
  241. package/skills/g9-lynx-app/references/components/media-2.md +66 -0
  242. package/skills/g9-lynx-app/references/components/notifications.md +37 -0
  243. package/skills/g9-lynx-app/references/components/popover.md +4 -2
  244. package/skills/g9-lynx-app/references/components/popup.md +2 -2
  245. package/skills/g9-lynx-app/references/components/projects.md +73 -0
  246. package/skills/g9-lynx-app/references/components/provider.md +1 -1
  247. package/skills/g9-lynx-app/references/components/reader.md +37 -0
  248. package/skills/g9-lynx-app/references/components/richtext.md +54 -0
  249. package/skills/g9-lynx-app/references/components/route.md +18 -0
  250. package/skills/g9-lynx-app/references/components/shell.md +1 -1
  251. package/skills/g9-lynx-app/references/components/toggle.md +18 -1
  252. package/skills/g9-lynx-app/references/components/calendar.md +0 -128
  253. package/skills/g9-lynx-app/references/components/chat.md +0 -98
  254. package/skills/g9-lynx-app/references/components/media.md +0 -115
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/layout/layout.css"],"names":[],"mappings":"AAEA;EADE,oCAAoC;EACpC,sBAAsB;EACtB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAIA;EADE,2CAA2C;EAC3C,sDAAsD;EACtD,mBAAmB;EACnB,iBAAiB;EACjB,mCAAmC;AACrC;;AAKA;EAFE,6CAA6C;EAC7C,wDAAwD;AAC1D;;AAMA;EAHE,yCAAyC;EACzC,oDAAoD;EACpD,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;AACzC;;AAOA;EAJE,yCAAyC;EACzC,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;AACzC;;AAOA;EAJE,YAAY;EACZ,0DAA0D;EAC1D,sBAAsB;AACxB;;AASA;EANE,8DAA8D;AAChE;;AASA;EANE;IACE,UAAU;IACV,2BAA2B;EAC7B;;EAEA;IACE,UAAU;IACV,wBAAwB;EAC1B;AACF;;AAQA;EALE,UAAU;EACV,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AASA;EANE,OAAO;A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AASA;EANE,eAAe;EACf,gCAAgC;EAChC,mCAAmC;EACnC,OAAO;AACT;;AASA;EANE,mBAAmB;EACnB,gBAAgB;EAChB,cAAc;EACd,aAAa;AACf;;AASA;EANE,eAAe;EACf,oCAAoC;EACpC,mCAAmC;EACnC,gBAAgB;AAClB;;AASA;EANE,2CAA2C;EAC3C,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,eAAe;EACf,aAAa;AACf;;AASA;EANE,WAAW;AACb;;AASA;EANE,eAAe;EACf,oCAAoC;EACpC,gCAAgC;EAChC,gBAAgB;AAClB;;AASA;EANE,aAAa;EACb,kBAAkB;AACpB;;AASA;EANE,eAAe;EACf,aAAa;AACf;;AASA;EANE,cAAc;EACd,mBAAmB;EACnB,aAAa;AACf;;AASA;EANE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AASA;EANE,OAAO;AACT;;AASA;EANE,sBAAsB;EACtB,aAAa;AACf;;AASA;EANE,OAAO;EACP,aAAa;EACb,aAAa;AACf;;AASA;EANE,sBAAsB;AACxB;;AASA;EANE,sBAAsB;EACtB,cAAc;EACd,aAAa;EACb,aAAa;AACf;;AASA;EANE,mCAAmC;EACnC,UAAU;AACZ;;AASA;EANE,UAAU;EACV,uBAAuB;EACvB,mBAAmB;EACnB,UAAU;EACV,cAAc;EACd,aAAa;AACf;;AASA;EANE,mCAAmC;EACnC,UAAU;EACV,YAAY;AACd;;AASA;EANE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;EACb,aAAa;AACf;;AASA;EANE,sCAAsC;EACtC,iDAAiD;EACjD,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,aAAa;EACb,kBAAkB;AACpB;;AAUA;EAPE,OAAO;EACP,aAAa;AACf;;AAUA;EAPE,sBAAsB;EACtB,kBAAkB;EAClB,WAAW;EACX,aAAa;AACf;;AAWA;EARE,sBAAsB;EACtB,aAAa;AACf;;AAWA;EARE,OAAO;EACP,aAAa;AACf;;AAWA;EARE,sBAAsB;EACtB,cAAc;EACd,aAAa;AACf;;AAYA;EATE,cAAc;AAChB;;AAaA;EAVE,cAAc;EACd,WAAW;AACb;;AAaA;EAVE,eAAe;EACf,iBAAiB;EACjB,aAAa;AACf","sourcesContent":["/* Layout: G9Card, G9Section(Header), G9Columns, G9Bento, G9ActionRow, G9UnsavedBar, G9HScroll, G9PlaceScroll,\n G9SplitPane, G9Page. Single-class selectors only; display: flex written out (Lynx). */\n.g9-card {\n display: flex;\n flex-direction: column;\n position: relative;\n border-radius: var(--g9-radius-card);\n overflow: hidden;\n}\n\n.g9-card--outlined {\n background-color: var(--g9-card-background);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-card-background);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n}\n\n.g9-card--filled {\n background-color: var(--g9-surface-container);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface-container);\n}\n\n.g9-card--elevated {\n background-color: var(--g9-card-elevated);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-card-elevated);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-card--glass {\n background-color: var(--g9-overlay-light);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-card--down {\n transform: scale(0.985);\n opacity: 0.92;\n transition:\n transform 90ms ease-out,\n opacity 90ms ease-out;\n}\n\n.g9-card--enter {\n animation: g9-card-rise 320ms cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n\n@keyframes g9-card-rise {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0px);\n }\n}\n\n.g9-card__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-card__edge--ltr {\n left: 0px;\n}\n\n.g9-card__edge--rtl {\n right: 0px;\n}\n\n.g9-section {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n}\n\n.g9-section--card {\n border-radius: var(--g9-radius-card);\n background-color: var(--g9-card-background);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-card-background);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n}\n\n.g9-section__body {\n display: flex;\n flex-direction: column;\n}\n\n.g9-section-header {\n display: flex;\n align-items: center;\n column-gap: 10px;\n min-height: 32px;\n}\n\n.g9-section-header__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 10px;\n background-color: var(--g9-primary-container);\n}\n\n.g9-section-header__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-section-header__title {\n font-size: var(--g9-type-section-size);\n font-family: var(--g9-font-text-700);\n line-height: var(--g9-type-section-line);\n font-weight: 700;\n color: var(--g9-text-primary);\n}\n\n.g9-section-header__subtitle {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 20px;\n color: var(--g9-text-secondary);\n}\n\n.g9-section-header__action {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 32px;\n padding: 0px 6px;\n}\n\n.g9-section-header__action-text {\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-primary);\n}\n\n.g9-columns {\n display: flex;\n flex-direction: column;\n}\n\n.g9-columns__cell {\n display: flex;\n flex-direction: column;\n min-width: 0px;\n}\n\n.g9-bento {\n display: flex;\n flex-direction: column;\n}\n\n.g9-bento__cell {\n display: flex;\n flex-direction: column;\n min-width: 0px;\n}\n\n.g9-action-row {\n display: flex;\n justify-content: flex-start;\n column-gap: 10px;\n}\n\n.g9-action-row--phone {\n flex-direction: column;\n align-items: stretch;\n row-gap: 10px;\n}\n\n.g9-unsaved {\n display: flex;\n align-items: center;\n column-gap: 10px;\n padding: 10px 14px;\n border-radius: 16px;\n background-color: var(--g9-inverse-surface);\n animation: g9-unsaved-in 240ms cubic-bezier(0.2, 0, 0, 1);\n}\n\n@keyframes g9-unsaved-in {\n from {\n transform: translateY(24px);\n opacity: 0;\n }\n to {\n transform: translateY(0px);\n opacity: 1;\n }\n}\n\n.g9-unsaved__message {\n flex: 1;\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-inverse-on-surface);\n}\n\n.g9-unsaved__discard {\n display: flex;\n align-items: center;\n min-height: 36px;\n padding: 0px 8px;\n}\n\n.g9-unsaved__discard-text {\n font-size: 13px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-inverse-on-surface);\n}\n\n.g9-unsaved__save {\n display: flex;\n align-items: center;\n min-height: 36px;\n padding: 0px 14px;\n border-radius: 12px;\n background-color: var(--g9-inverse-primary);\n}\n\n.g9-unsaved__save--busy {\n opacity: 0.6;\n}\n\n.g9-unsaved__save-text {\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-inverse-surface);\n}\n\n.g9-hscroll {\n display: flex;\n position: relative;\n}\n\n.g9-hscroll-wrap {\n display: flex;\n flex-wrap: wrap;\n}\n\n.g9-hscroll__row {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n.g9-hscroll__fade {\n position: absolute;\n top: 0px;\n bottom: 0px;\n width: 32px;\n}\n\n.g9-place-scroll {\n flex: 1;\n}\n\n.g9-place-scroll__content {\n display: flex;\n flex-direction: column;\n}\n\n.g9-split {\n display: flex;\n flex: 1;\n min-height: 0px;\n}\n\n.g9-split--single {\n flex-direction: column;\n}\n\n.g9-split__start {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n min-height: 0px;\n}\n\n.g9-split__divider {\n width: 1px;\n background-color: var(--g9-divider);\n}\n\n.g9-split__handle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 9px;\n margin: 0px -4px;\n z-index: 2;\n}\n\n.g9-split__grip {\n width: 1px;\n height: 100%;\n background-color: var(--g9-divider);\n}\n\n.g9-split__detail {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n min-height: 0px;\n}\n\n.g9-page {\n display: flex;\n flex-direction: column;\n flex: 1;\n position: relative;\n min-height: 0px;\n background-color: var(--g9-background);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-background);\n}\n\n.g9-page__body {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-page__content {\n display: flex;\n flex-direction: column;\n align-self: center;\n width: 100%;\n}\n\n/* a page that does not scroll gives its height to its content (a list, a map, a chat fills it) */\n.g9-page__body--fixed {\n display: flex;\n flex-direction: column;\n}\n\n.g9-page__content--fill {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-page__footer {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n}\n\n/* G9Page safeBottom: the bottom safe-area inset under the footer (its height inline) */\n.g9-page__safe-bottom {\n flex-shrink: 0;\n}\n\n/* G9ScrollSpyBar */\n.g9-spy {\n width: 100%;\n flex-shrink: 0;\n}\n\n.g9-spy__row {\n display: flex;\n column-gap: 6px;\n padding: 8px 12px;\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/layout/layout.css"],"names":[],"mappings":"AAEA;EADE,oCAAoC;EACpC,sBAAsB;EACtB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAIA;EADE,2CAA2C;EAC3C,sDAAsD;EACtD,mBAAmB;EACnB,iBAAiB;EACjB,mCAAmC;AACrC;;AAKA;EAFE,6CAA6C;EAC7C,wDAAwD;AAC1D;;AAMA;EAHE,yCAAyC;EACzC,oDAAoD;EACpD,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;AACzC;;AAOA;EAJE,yCAAyC;EACzC,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;AACzC;;AAOA;EAJE,YAAY;EACZ,0DAA0D;EAC1D,sB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AAUA;EAPE,sCAAsC;EACtC,iDAAiD;EACjD,sBAAsB;EACtB,OAAO;EACP,aAAa;EACb,aAAa;EACb,kBAAkB;AACpB;;AAWA;EARE,OAAO;EACP,aAAa;AACf;;AAWA;EARE,sBAAsB;EACtB,kBAAkB;EAClB,WAAW;EACX,aAAa;AACf;;AAYA;EATE,sBAAsB;EACtB,aAAa;AACf;;AAYA;EATE,OAAO;EACP,aAAa;AACf;;AAYA;EATE,sBAAsB;EACtB,cAAc;EACd,aAAa;AACf;;AAaA;EAVE,cAAc;AAChB;;AAcA;EAXE,cAAc;EACd,WAAW;AACb;;AAcA;EAXE,eAAe;EACf,iBAAiB;EACjB,aAAa;AACf","sourcesContent":["/* Layout: G9Card, G9Section(Header), G9Columns, G9Bento, G9ActionRow, G9UnsavedBar, G9HScroll, G9PlaceScroll,\n G9SplitPane, G9Page. Single-class selectors only; display: flex written out (Lynx). */\n.g9-card {\n display: flex;\n flex-direction: column;\n position: relative;\n border-radius: var(--g9-radius-card);\n overflow: hidden;\n}\n\n.g9-card--outlined {\n background-color: var(--g9-card-background);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-card-background);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n}\n\n.g9-card--filled {\n background-color: var(--g9-surface-container);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface-container);\n}\n\n.g9-card--elevated {\n background-color: var(--g9-card-elevated);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-card-elevated);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-card--glass {\n background-color: var(--g9-overlay-light);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-card--down {\n transform: scale(0.985);\n opacity: 0.92;\n transition:\n transform 90ms ease-out,\n opacity 90ms ease-out;\n}\n\n.g9-card--enter {\n animation: g9-card-rise 320ms cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n\n@keyframes g9-card-rise {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0px);\n }\n}\n\n.g9-card__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-card__edge--ltr {\n left: 0px;\n}\n\n.g9-card__edge--rtl {\n right: 0px;\n}\n\n.g9-section {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n}\n\n.g9-section--card {\n border-radius: var(--g9-radius-card);\n background-color: var(--g9-card-background);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-card-background);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n}\n\n.g9-section__body {\n display: flex;\n flex-direction: column;\n}\n\n.g9-section-header {\n display: flex;\n align-items: center;\n column-gap: 10px;\n min-height: 32px;\n}\n\n.g9-section-header__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 10px;\n background-color: var(--g9-primary-container);\n}\n\n.g9-section-header__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-section-header__title {\n font-size: var(--g9-type-section-size);\n font-family: var(--g9-font-text-700);\n line-height: var(--g9-type-section-line);\n font-weight: 700;\n color: var(--g9-text-primary);\n}\n\n.g9-section-header__subtitle {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 20px;\n color: var(--g9-text-secondary);\n}\n\n.g9-section-header__action {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 32px;\n padding: 0px 6px;\n}\n\n.g9-section-header__action-text {\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-primary);\n}\n\n.g9-columns {\n display: flex;\n flex-direction: column;\n}\n\n.g9-columns__cell {\n display: flex;\n flex-direction: column;\n min-width: 0px;\n}\n\n.g9-bento {\n display: flex;\n flex-direction: column;\n}\n\n.g9-bento__cell {\n display: flex;\n flex-direction: column;\n min-width: 0px;\n}\n\n.g9-action-row {\n display: flex;\n justify-content: flex-start;\n column-gap: 10px;\n}\n\n.g9-action-row--phone {\n flex-direction: column;\n align-items: stretch;\n row-gap: 10px;\n}\n\n.g9-unsaved {\n display: flex;\n align-items: center;\n column-gap: 10px;\n padding: 10px 14px;\n border-radius: 16px;\n background-color: var(--g9-inverse-surface);\n animation: g9-unsaved-in 240ms cubic-bezier(0.2, 0, 0, 1);\n}\n\n@keyframes g9-unsaved-in {\n from {\n transform: translateY(24px);\n opacity: 0;\n }\n to {\n transform: translateY(0px);\n opacity: 1;\n }\n}\n\n.g9-unsaved__message {\n flex: 1;\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-inverse-on-surface);\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-unsaved__discard {\n display: flex;\n align-items: center;\n min-height: 36px;\n padding: 0px 8px;\n}\n\n.g9-unsaved__discard-text {\n font-size: 13px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-inverse-on-surface);\n}\n\n.g9-unsaved__save {\n display: flex;\n align-items: center;\n min-height: 36px;\n padding: 0px 14px;\n border-radius: 12px;\n background-color: var(--g9-inverse-primary);\n}\n\n.g9-unsaved__save--busy {\n opacity: 0.6;\n}\n\n.g9-unsaved__save-text {\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-inverse-surface);\n}\n\n.g9-hscroll {\n display: flex;\n position: relative;\n}\n\n.g9-hscroll-wrap {\n display: flex;\n flex-wrap: wrap;\n}\n\n.g9-hscroll__row {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n.g9-hscroll__fade {\n position: absolute;\n top: 0px;\n bottom: 0px;\n width: 32px;\n}\n\n.g9-place-scroll {\n flex: 1;\n}\n\n.g9-place-scroll__content {\n display: flex;\n flex-direction: column;\n}\n\n.g9-split {\n display: flex;\n flex: 1;\n min-height: 0px;\n}\n\n.g9-split--single {\n flex-direction: column;\n}\n\n.g9-split__start {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n min-height: 0px;\n}\n\n.g9-split__divider {\n width: 1px;\n background-color: var(--g9-divider);\n}\n\n.g9-split__handle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 9px;\n margin: 0px -4px;\n z-index: 2;\n}\n\n.g9-split__grip {\n width: 1px;\n height: 100%;\n background-color: var(--g9-divider);\n}\n\n.g9-split__detail {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n min-height: 0px;\n}\n\n.g9-page {\n display: flex;\n flex-direction: column;\n flex: 1;\n position: relative;\n min-height: 0px;\n background-color: var(--g9-background);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-background);\n}\n\n.g9-page__body {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-page__content {\n display: flex;\n flex-direction: column;\n align-self: center;\n width: 100%;\n}\n\n/* a page that does not scroll gives its height to its content (a list, a map, a chat fills it) */\n.g9-page__body--fixed {\n display: flex;\n flex-direction: column;\n}\n\n.g9-page__content--fill {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-page__footer {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n}\n\n/* G9Page safeBottom: the bottom safe-area inset under the footer (its height inline) */\n.g9-page__safe-bottom {\n flex-shrink: 0;\n}\n\n/* G9ScrollSpyBar */\n.g9-spy {\n width: 100%;\n flex-shrink: 0;\n}\n\n.g9-spy__row {\n display: flex;\n column-gap: 6px;\n padding: 8px 12px;\n}\n"],"sourceRoot":""}
@@ -15,26 +15,59 @@ export interface G9PullToRefreshProps {
15
15
  readonly children?: ReactNode;
16
16
  readonly disabled?: boolean;
17
17
  }
18
+ /** How far the content follows a finger that travelled `dy` (half of it, never past 1.6 × the threshold). */
19
+ export declare function pullDistance(dy: number, threshold: number): number;
20
+ /**
21
+ * Whether a touch that moved `dx`, `dy` is a pull (`'pull'`), something else (`'other'`: sideways — a carousel —,
22
+ * upward), or not yet known (`null`, under the 6 dp slop).
23
+ */
24
+ export declare function pullIntent(dx: number, dy: number): 'pull' | 'other' | null;
18
25
  /**
19
26
  * A vertical scroller that refreshes when pulled down from the top. The pull resists (half the finger's travel), the
20
- * spinner turns in as it nears the threshold, a haptic marks the point of no return.
27
+ * spinner turns in as it nears the threshold, a haptic marks the point of no return. The gesture runs on the main
28
+ * thread (2.5.8, G9Hub on the A21s): the content and the spinner move by transform there, nothing crosses to the
29
+ * background thread while the finger moves, a sideways or a two-finger drag is left alone.
21
30
  */
22
31
  export declare function G9PullToRefresh(props: G9PullToRefreshProps): ReactNode;
32
+ /** How far the row at `i` slides aside while the row at `from` is held over `target` (the lifted row's height). */
33
+ export declare function dragOffset(i: number, from: number | null, target: number, liftedHeight: number): number;
34
+ /** What a row of a {@link G9DragList} is handed besides its item (2.5.8). */
35
+ export interface G9DragRowControls {
36
+ readonly index: number;
37
+ /**
38
+ * The drag handle (with `handle`): put it where the row wants it; a touch on it lifts the row at once, the rest of
39
+ * the row keeps its own controls (a switch, a width picker). `null` without `handle`.
40
+ */
41
+ readonly handle: ReactNode;
42
+ /** One place up or down: the accessible way to reorder (a menu, a screen reader action, buttons). */
43
+ moveUp(): void;
44
+ moveDown(): void;
45
+ readonly canMoveUp: boolean;
46
+ readonly canMoveDown: boolean;
47
+ }
23
48
  /** Props of {@link G9DragList}. */
24
49
  export interface G9DragListProps<T> {
25
50
  readonly id?: string;
26
51
  readonly items: readonly T[];
27
52
  readonly getKey: (item: T) => string;
28
- readonly renderItem: (item: T, dragging: boolean) => ReactNode;
29
- /** The new order, once, on drop. */
53
+ readonly renderItem: (item: T, dragging: boolean, controls: G9DragRowControls) => ReactNode;
54
+ /** The new order, once, on drop (or on a move up / down). */
30
55
  readonly onReorder: (items: T[]) => void;
31
- /** Row height (dp); the rows are this tall. Default 56. */
56
+ /** A row's height until it is measured (dp). Default 56; rows of any height are measured. */
32
57
  readonly rowHeight?: number;
33
58
  readonly disabled?: boolean;
59
+ /** A handle starts the drag (instant) instead of a long press on the whole row. Default false (2.5.8). */
60
+ readonly handle?: boolean;
61
+ /** The handle's spoken name. Default «Reorder». */
62
+ readonly handleLabel?: string;
63
+ /** When a row lifts (a haptic is played already). */
64
+ readonly onStart?: (item: T, index: number) => void;
34
65
  }
35
66
  /**
36
- * Reorder by dragging (G9Hub board columns, ShopManager menu order): long-press lifts a row, it follows the finger,
37
- * the rows it passes slide aside, release drops it. For short lists (it lays out every row).
67
+ * Reorder by dragging (G9Hub's home customising, ShopManager menu order): a long press — or a touch on the row's handle
68
+ * (`handle`) — lifts a row, it follows the finger on the main thread, the rows it passes slide aside, release drops
69
+ * it. Rows of any height (measured). `renderItem`'s controls also move a row one place up or down, the accessible way.
70
+ * For short lists (it lays out every row).
38
71
  */
39
72
  export declare function G9DragList<T>(props: G9DragListProps<T>): ReactNode;
40
73
  //# sourceMappingURL=gestures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../src/list/gestures.tsx"],"names":[],"mappings":"AAGA,OAAO,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAIlE,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,EAAE,CAO7E;AAED,0GAA0G;AAC1G,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAetF;AAQD,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,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from "@g9tm/lynxcontrols-foundation";
3
- import { useRef, useState } from "@lynx-js/react";
3
+ import { runOnBackground, runOnMainThread, useEffect, useMainThreadRef, useRef, useState } from "@lynx-js/react";
4
4
  import { g9IdProps } from "../base/control.jsx";
5
5
  import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
6
6
  function moveItem(list, from, to) {
@@ -31,112 +31,307 @@ function dropIndex(heights, from, dy) {
31
31
  }
32
32
  return i;
33
33
  }
34
- const touchY = (e)=>{
35
- var _ref, _ref1;
36
- var _e_touches_, _e_touches, _e_detail;
37
- return null != (_ref = null != (_ref1 = null == (_e_touches = e.touches) ? void 0 : null == (_e_touches_ = _e_touches[0]) ? void 0 : _e_touches_.clientY) ? _ref1 : null == (_e_detail = e.detail) ? void 0 : _e_detail.y) ? _ref : 0;
38
- };
34
+ function pullDistance(dy, threshold) {
35
+ return Math.min(Math.max(0, dy / 2), 1.6 * threshold);
36
+ }
37
+ function pullDistanceMT(dy, threshold) {
38
+ 'main thread';
39
+ return Math.min(Math.max(0, dy / 2), 1.6 * threshold);
40
+ }
41
+ function pullIntent(dx, dy) {
42
+ if (Math.abs(dx) < 6 && Math.abs(dy) < 6) return null;
43
+ return dy > 0 && dy >= Math.abs(dx) ? 'pull' : 'other';
44
+ }
45
+ function pullIntentMT(dx, dy) {
46
+ 'main thread';
47
+ if (Math.abs(dx) < 6 && Math.abs(dy) < 6) return null;
48
+ return dy > 0 && dy >= Math.abs(dx) ? 'pull' : 'other';
49
+ }
39
50
  function G9PullToRefresh(props) {
40
51
  var _props_threshold;
41
52
  const threshold = null != (_props_threshold = props.threshold) ? _props_threshold : 72;
42
- const [pull, setPull] = useState(0);
43
53
  const [busy, setBusy] = useState(false);
44
- const top = useRef(0);
45
- const start = useRef(null);
46
- const armed = useRef(false);
47
- const shown = busy ? threshold : pull;
48
- const end = ()=>{
49
- if (null === start.current) return;
50
- start.current = null;
51
- if (pull >= threshold && !busy) {
52
- setBusy(true);
53
- setPull(threshold);
54
- Promise.resolve(props.onRefresh()).catch(()=>void 0).then(()=>{
55
- setBusy(false);
56
- setPull(0);
57
- });
58
- } else if (!busy) setPull(0);
59
- armed.current = false;
54
+ const blocked = true === props.disabled || busy;
55
+ const scroll = useMainThreadRef(null);
56
+ const indicator = useMainThreadRef(null);
57
+ const gesture = useMainThreadRef({
58
+ x: 0,
59
+ y: 0,
60
+ top: 0,
61
+ active: false,
62
+ intent: null,
63
+ distance: 0,
64
+ armed: false
65
+ });
66
+ const latest = useRef(props.onRefresh);
67
+ latest.current = props.onRefresh;
68
+ const refresh = ()=>{
69
+ setBusy(true);
70
+ Promise.resolve().then(()=>latest.current()).catch(()=>void 0).then(()=>setBusy(false));
60
71
  };
72
+ const armedHaptic = ()=>g9Haptic('impact');
73
+ function place(d, animated) {
74
+ 'main thread';
75
+ var _scroll_current, _indicator_current;
76
+ const transition = animated ? 'transform 220ms ease-out' : 'none';
77
+ null == (_scroll_current = scroll.current) || _scroll_current.setStyleProperties({
78
+ transition,
79
+ transform: `translateY(${d}px)`
80
+ });
81
+ null == (_indicator_current = indicator.current) || _indicator_current.setStyleProperties({
82
+ transition: animated ? 'transform 220ms ease-out, opacity 220ms ease-out' : 'none',
83
+ transform: `translateY(${d - 44}px)`,
84
+ opacity: String(Math.min(1, d / threshold))
85
+ });
86
+ }
87
+ function scrollMT(e) {
88
+ 'main thread';
89
+ var _ref;
90
+ var _e_detail;
91
+ gesture.current.top = null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.scrollTop) ? _ref : 0;
92
+ }
93
+ function startMT(e) {
94
+ 'main thread';
95
+ var _ref, _ref1, _ref2;
96
+ var _e_touches, _e_detail, _e_detail1;
97
+ const g = gesture.current;
98
+ if ((null != (_ref = null == (_e_touches = e.touches) ? void 0 : _e_touches.length) ? _ref : 1) > 1) {
99
+ if (g.active && 'pull' === g.intent) place(0, true);
100
+ g.active = false;
101
+ return;
102
+ }
103
+ if (blocked || g.top > 0) return;
104
+ g.x = null != (_ref1 = null == (_e_detail = e.detail) ? void 0 : _e_detail.x) ? _ref1 : 0;
105
+ g.y = null != (_ref2 = null == (_e_detail1 = e.detail) ? void 0 : _e_detail1.y) ? _ref2 : 0;
106
+ g.active = true;
107
+ g.intent = null;
108
+ g.distance = 0;
109
+ g.armed = false;
110
+ }
111
+ function moveMT(e) {
112
+ 'main thread';
113
+ var _ref, _ref1, _ref2;
114
+ var _e_touches, _e_detail, _e_detail1;
115
+ const g = gesture.current;
116
+ if (!g.active) return;
117
+ if ((null != (_ref = null == (_e_touches = e.touches) ? void 0 : _e_touches.length) ? _ref : 1) > 1) {
118
+ if ('pull' === g.intent) place(0, true);
119
+ g.active = false;
120
+ return;
121
+ }
122
+ const dx = (null != (_ref1 = null == (_e_detail = e.detail) ? void 0 : _e_detail.x) ? _ref1 : 0) - g.x;
123
+ const dy = (null != (_ref2 = null == (_e_detail1 = e.detail) ? void 0 : _e_detail1.y) ? _ref2 : 0) - g.y;
124
+ if (null === g.intent) {
125
+ g.intent = pullIntentMT(dx, dy);
126
+ if ('other' === g.intent) {
127
+ g.active = false;
128
+ return;
129
+ }
130
+ if (null === g.intent) return;
131
+ }
132
+ g.distance = pullDistanceMT(dy, threshold);
133
+ if (g.distance >= threshold && !g.armed) {
134
+ g.armed = true;
135
+ runOnBackground(armedHaptic)();
136
+ }
137
+ place(g.distance, false);
138
+ }
139
+ function endMT() {
140
+ 'main thread';
141
+ const g = gesture.current;
142
+ if (!g.active) return;
143
+ g.active = false;
144
+ if ('pull' !== g.intent) return;
145
+ if (g.distance >= threshold) {
146
+ place(threshold, true);
147
+ runOnBackground(refresh)();
148
+ } else place(0, true);
149
+ }
150
+ const wasBusy = useRef(false);
151
+ useEffect(()=>{
152
+ if (wasBusy.current && !busy) runOnMainThread((d)=>{
153
+ 'main thread';
154
+ place(d, true);
155
+ })(0);
156
+ wasBusy.current = busy;
157
+ }, [
158
+ busy
159
+ ]);
61
160
  return <view className={`g9-ptr${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)}>
62
- <view className="g9-ptr__indicator" style={{
63
- transform: `translateY(${shown - 44}px)`,
64
- opacity: Math.min(1, shown / threshold)
161
+ <view className="g9-ptr__indicator" main-thread:ref={indicator} style={{
162
+ transform: `translateY(${busy ? threshold - 44 : -44}px)`,
163
+ opacity: busy ? 1 : 0
65
164
  }}>
66
- <G9ActivityIndicator running={busy || shown >= 0.6 * threshold} size={22}/>
165
+ <G9ActivityIndicator running={busy} size={22}/>
67
166
  </view>
68
- <scroll-view className="g9-ptr__scroll" scroll-orientation="vertical" style={{
69
- transform: `translateY(${shown}px)`,
70
- transition: null === start.current ? 'transform 220ms ease-out' : 'none'
71
- }} bindscroll={(e)=>{
72
- top.current = e.detail.scrollTop;
73
- }} bindtouchstart={(e)=>{
74
- if (props.disabled || busy || top.current > 0) return;
75
- start.current = touchY(e);
76
- }} bindtouchmove={(e)=>{
77
- if (null === start.current) return;
78
- const d = Math.max(0, (touchY(e) - start.current) / 2);
79
- if (d >= threshold && !armed.current) {
80
- armed.current = true;
81
- g9Haptic('impact');
82
- }
83
- setPull(Math.min(d, 1.6 * threshold));
84
- }} bindtouchend={end} bindtouchcancel={end}>
167
+ <scroll-view className="g9-ptr__scroll" scroll-orientation="vertical" main-thread:ref={scroll} main-thread:bindscroll={scrollMT} main-thread:bindtouchstart={startMT} main-thread:bindtouchmove={moveMT} main-thread:bindtouchend={endMT} main-thread:bindtouchcancel={endMT}>
85
168
  {props.children}
86
169
  </scroll-view>
87
170
  </view>;
88
171
  }
172
+ function dropIndexMT(heights, from, dy) {
173
+ 'main thread';
174
+ let i = from;
175
+ let moved = dy;
176
+ if (moved > 0) {
177
+ var _heights_;
178
+ while(i < heights.length - 1 && moved > (null != (_heights_ = heights[i + 1]) ? _heights_ : 0) / 2){
179
+ var _heights_1;
180
+ moved -= null != (_heights_1 = heights[i + 1]) ? _heights_1 : 0;
181
+ i++;
182
+ }
183
+ } else {
184
+ var _heights_2;
185
+ while(i > 0 && -moved > (null != (_heights_2 = heights[i - 1]) ? _heights_2 : 0) / 2){
186
+ var _heights_3;
187
+ moved += null != (_heights_3 = heights[i - 1]) ? _heights_3 : 0;
188
+ i--;
189
+ }
190
+ }
191
+ return i;
192
+ }
193
+ function dragOffset(i, from, target, liftedHeight) {
194
+ if (null === from || i === from) return 0;
195
+ if (from < i && i <= target) return -liftedHeight;
196
+ if (target <= i && i < from) return liftedHeight;
197
+ return 0;
198
+ }
199
+ const DRAG_ICON = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="9" cy="6" r="1.6" fill="#8a8f98"/><circle cx="15" cy="6" r="1.6" fill="#8a8f98"/><circle cx="9" cy="12" r="1.6" fill="#8a8f98"/><circle cx="15" cy="12" r="1.6" fill="#8a8f98"/><circle cx="9" cy="18" r="1.6" fill="#8a8f98"/><circle cx="15" cy="18" r="1.6" fill="#8a8f98"/></svg>';
200
+ function DragRow(props) {
201
+ const { index, heights } = props;
202
+ const inner = useMainThreadRef(null);
203
+ const gesture = useMainThreadRef({
204
+ active: false,
205
+ startY: 0,
206
+ target: index
207
+ });
208
+ const disabled = props.disabled;
209
+ const onLift = props.onLift;
210
+ const onTarget = props.onTarget;
211
+ const onDrop = props.onDrop;
212
+ function beginMT(y) {
213
+ 'main thread';
214
+ var _inner_current;
215
+ gesture.current = {
216
+ active: true,
217
+ startY: y,
218
+ target: index
219
+ };
220
+ null == (_inner_current = inner.current) || _inner_current.setStyleProperties({
221
+ transition: 'none',
222
+ transform: 'translateY(0px)'
223
+ });
224
+ }
225
+ function handleStartMT(e) {
226
+ 'main thread';
227
+ var _ref, _ref1;
228
+ var _e_detail, _e_touches_, _e_touches;
229
+ if (disabled) return;
230
+ beginMT(null != (_ref = null != (_ref1 = null == (_e_detail = e.detail) ? void 0 : _e_detail.y) ? _ref1 : null == (_e_touches = e.touches) ? void 0 : null == (_e_touches_ = _e_touches[0]) ? void 0 : _e_touches_.clientY) ? _ref : 0);
231
+ runOnBackground(onLift)(index);
232
+ }
233
+ function moveMT(e) {
234
+ 'main thread';
235
+ var _ref, _ref1;
236
+ var _e_detail, _e_touches_, _e_touches, _inner_current;
237
+ const g = gesture.current;
238
+ if (!g.active) return;
239
+ const dy = (null != (_ref = null != (_ref1 = null == (_e_detail = e.detail) ? void 0 : _e_detail.y) ? _ref1 : null == (_e_touches = e.touches) ? void 0 : null == (_e_touches_ = _e_touches[0]) ? void 0 : _e_touches_.clientY) ? _ref : 0) - g.startY;
240
+ null == (_inner_current = inner.current) || _inner_current.setStyleProperties({
241
+ transform: `translateY(${dy}px)`
242
+ });
243
+ const to = dropIndexMT(heights, index, dy);
244
+ if (to !== g.target) {
245
+ g.target = to;
246
+ runOnBackground(onTarget)(to);
247
+ }
248
+ }
249
+ function endMT() {
250
+ 'main thread';
251
+ var _inner_current;
252
+ const g = gesture.current;
253
+ if (!g.active) return;
254
+ g.active = false;
255
+ null == (_inner_current = inner.current) || _inner_current.setStyleProperties({
256
+ transition: 'none',
257
+ transform: 'translateY(0px)'
258
+ });
259
+ runOnBackground(onDrop)(g.target);
260
+ }
261
+ const handleNode = props.handle ? <view className="g9-drag-list__handle" main-thread:bindtouchstart={handleStartMT} accessibility-element={true} accessibility-traits="button" accessibility-label={props.handleLabel}>
262
+ <svg className="g9-drag-list__handle-icon" content={DRAG_ICON}/>
263
+ </view> : null;
264
+ return <view className={`g9-drag-list__row${props.lifted ? ' g9-drag-list__row--lifted' : ''}`} style={{
265
+ transform: `translateY(${props.offset}px)`,
266
+ transition: props.lifted ? 'none' : 'transform 160ms ease-out'
267
+ }} bindlayoutchange={(e)=>props.onHeight(index, Math.round(e.detail.height))} {...props.handle ? {} : {
268
+ bindlongpress: (e)=>{
269
+ var _ref, _ref1;
270
+ var _e_detail, _e_touches_, _e_touches;
271
+ if (disabled) return;
272
+ const y = null != (_ref = null != (_ref1 = null == (_e_detail = e.detail) ? void 0 : _e_detail.y) ? _ref1 : null == (_e_touches = e.touches) ? void 0 : null == (_e_touches_ = _e_touches[0]) ? void 0 : _e_touches_.clientY) ? _ref : 0;
273
+ runOnMainThread(beginMT)(y);
274
+ onLift(index);
275
+ }
276
+ }} main-thread:bindtouchmove={moveMT} main-thread:bindtouchend={endMT} main-thread:bindtouchcancel={endMT}>
277
+ <view className="g9-drag-list__inner" main-thread:ref={inner}>
278
+ {props.render(handleNode)}
279
+ </view>
280
+ </view>;
281
+ }
89
282
  function G9DragList(props) {
90
283
  var _props_rowHeight;
91
- const h = null != (_props_rowHeight = props.rowHeight) ? _props_rowHeight : 56;
92
- const [drag, setDrag] = useState(null);
93
- const startY = useRef(0);
94
- const heights = props.items.map(()=>h);
95
- const target = drag ? dropIndex(heights, drag.from, drag.dy) : -1;
96
- const offsetOf = (i)=>{
97
- if (!drag || i === drag.from) return 0;
98
- if (drag.from < i && i <= target) return -h;
99
- if (target <= i && i < drag.from) return h;
100
- return 0;
284
+ const est = null != (_props_rowHeight = props.rowHeight) ? _props_rowHeight : 56;
285
+ const [lift, setLift] = useState(null);
286
+ const [measured, setMeasured] = useState({});
287
+ const keys = props.items.map((item)=>props.getKey(item));
288
+ const heights = keys.map((k)=>{
289
+ var _measured_k;
290
+ return null != (_measured_k = measured[k]) ? _measured_k : est;
291
+ });
292
+ const latest = useRef(props);
293
+ latest.current = props;
294
+ const reorder = (from, to)=>{
295
+ if (to === from || to < 0 || to >= latest.current.items.length) return;
296
+ g9Haptic('select');
297
+ latest.current.onReorder(moveItem(latest.current.items, from, to));
101
298
  };
102
- const drop = ()=>{
103
- if (!drag) return;
104
- const to = dropIndex(heights, drag.from, drag.dy);
105
- setDrag(null);
106
- if (to !== drag.from) {
107
- g9Haptic('select');
108
- props.onReorder(moveItem(props.items, drag.from, to));
109
- }
110
- };
111
- return <view className="g9-drag-list" {...g9IdProps(props.id)} style={{
112
- height: `${props.items.length * h}px`
113
- }}>
299
+ return <view className="g9-drag-list" {...g9IdProps(props.id)}>
114
300
  {props.items.map((item, i)=>{
115
- var _ref;
116
- const lifted = (null == drag ? void 0 : drag.from) === i;
117
- return <view key={props.getKey(item)} className={`g9-drag-list__row${lifted ? ' g9-drag-list__row--lifted' : ''}`} style={{
118
- top: `${i * h}px`,
119
- height: `${h}px`,
120
- transform: `translateY(${lifted ? null != (_ref = null == drag ? void 0 : drag.dy) ? _ref : 0 : offsetOf(i)}px)`,
121
- transition: lifted ? 'none' : 'transform 160ms ease-out'
122
- }} bindlongpress={(e)=>{
123
- if (props.disabled) return;
124
- g9Haptic('impact');
125
- startY.current = touchY(e);
126
- setDrag({
127
- from: i,
128
- dy: 0
301
+ var _heights_lift_from, _props_handleLabel;
302
+ const key = keys[i];
303
+ const lifted = (null == lift ? void 0 : lift.from) === i;
304
+ const controls = (handle)=>({
305
+ index: i,
306
+ handle,
307
+ moveUp: ()=>reorder(i, i - 1),
308
+ moveDown: ()=>reorder(i, i + 1),
309
+ canMoveUp: i > 0,
310
+ canMoveDown: i < props.items.length - 1
129
311
  });
130
- }} bindtouchmove={(e)=>{
131
- if ((null == drag ? void 0 : drag.from) !== i) return;
132
- setDrag({
133
- from: i,
134
- dy: touchY(e) - startY.current
312
+ return <DragRow key={key} index={i} count={props.items.length} heights={heights} lifted={lifted} offset={lift ? dragOffset(i, lift.from, lift.target, null != (_heights_lift_from = heights[lift.from]) ? _heights_lift_from : est) : 0} handle={true === props.handle} handleLabel={null != (_props_handleLabel = props.handleLabel) ? _props_handleLabel : 'Reorder'} disabled={true === props.disabled} onLift={(from)=>{
313
+ var _latest_current_onStart, _latest_current;
314
+ g9Haptic('impact');
315
+ setLift({
316
+ from,
317
+ target: from
135
318
  });
136
- }} bindtouchend={drop} bindtouchcancel={drop}>
137
- {props.renderItem(item, lifted)}
138
- </view>;
319
+ const it = latest.current.items[from];
320
+ if (void 0 !== it) null == (_latest_current_onStart = (_latest_current = latest.current).onStart) || _latest_current_onStart.call(_latest_current, it, from);
321
+ }} onTarget={(to)=>setLift((l)=>l ? {
322
+ ...l,
323
+ target: to
324
+ } : l)} onDrop={(to)=>{
325
+ const from = i;
326
+ setLift(null);
327
+ reorder(from, to);
328
+ }} onHeight={(_, h)=>{
329
+ if (h > 0 && measured[key] !== h) setMeasured((m)=>({
330
+ ...m,
331
+ [key]: h
332
+ }));
333
+ }} render={(handle)=>props.renderItem(item, lifted, controls(handle))}/>;
139
334
  })}
140
335
  </view>;
141
336
  }
142
- export { G9DragList, G9PullToRefresh, dropIndex, moveItem };
337
+ export { G9DragList, G9PullToRefresh, dragOffset, dropIndex, moveItem, pullDistance, pullIntent };
@@ -1,4 +1,5 @@
1
- export { dropIndex, G9DragList, type G9DragListProps, G9PullToRefresh, type G9PullToRefreshProps, moveItem, } from './gestures.js';
1
+ export { dragOffset, dropIndex, G9DragList, type G9DragListProps, type G9DragRowControls, G9PullToRefresh, type G9PullToRefreshProps, moveItem, } from './gestures.js';
2
+ export { type G9ListKeyAction, type G9ListKeyOptions, type G9UseListKeyboardOptions, listKeyAction, typeAheadIndex, useG9ListKeyboard, } from './keyboard.js';
2
3
  export { G9ListRow, type G9ListRowProps, G9Pager, type G9PagerProps, G9SettingsGroup, type G9SettingsGroupProps, G9SwitchRow, type G9SwitchRowProps, } from './rows.js';
3
- export { G9VirtualList, type G9VirtualListHandle, type G9VirtualListProps, g9LastRowWatcher, g9ListFirstBatch, g9ListNextBatch, g9ListProgressiveFrom, g9ReadableLanding, } from './virtual-list.js';
4
+ export { G9VirtualList, type G9VirtualListHandle, type G9VirtualListKeyboard, type G9VirtualListProps, type G9VirtualRowState, g9LastRowWatcher, g9ListFirstBatch, g9ListNextBatch, g9ListProgressiveFrom, g9ReadableLanding, } from './virtual-list.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,eAAe,EACpB,eAAe,EACf,KAAK,oBAAoB,EACzB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,OAAO,EACP,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,oBAAoB,EACzB,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,oBAAoB,EACzB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,aAAa,EACb,cAAc,EACd,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,OAAO,EACP,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,oBAAoB,EACzB,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"}
@@ -1,3 +1,4 @@
1
- export { G9DragList, G9PullToRefresh, dropIndex, moveItem } from "./gestures.jsx";
1
+ export { G9DragList, G9PullToRefresh, dragOffset, dropIndex, moveItem } from "./gestures.jsx";
2
+ export { listKeyAction, typeAheadIndex, useG9ListKeyboard } from "./keyboard.jsx";
2
3
  export { G9ListRow, G9Pager, G9SettingsGroup, G9SwitchRow } from "./rows.jsx";
3
4
  export { G9VirtualList, g9LastRowWatcher, g9ListFirstBatch, g9ListNextBatch, g9ListProgressiveFrom, g9ReadableLanding } from "./virtual-list.jsx";
@@ -0,0 +1,50 @@
1
+ import type { G9KeyEvent } from '@g9tm/lynxcontrols-foundation';
2
+ /** What a key does to the active row (pure). */
3
+ export type G9ListKeyAction = {
4
+ readonly kind: 'move';
5
+ readonly index: number;
6
+ } | {
7
+ readonly kind: 'activate';
8
+ readonly index: number;
9
+ } | {
10
+ readonly kind: 'none';
11
+ };
12
+ /** Options of {@link listKeyAction}. */
13
+ export interface G9ListKeyOptions {
14
+ /** J and K move too (G9Hub's lists, mail-style). Default true. */
15
+ readonly vim?: boolean;
16
+ /** The list is horizontal: the left and right arrows move (mirrored in RTL). Default false. */
17
+ readonly horizontal?: boolean;
18
+ readonly rtl?: boolean;
19
+ /** Past the last row comes the first. Default false. */
20
+ readonly wrap?: boolean;
21
+ /** Rows that cannot be active (a heading, a disabled entry). */
22
+ readonly skip?: (index: number) => boolean;
23
+ }
24
+ /** The action of `e` on a list of `count` rows whose active row is `active` (-1: none yet). */
25
+ export declare function listKeyAction(e: G9KeyEvent, active: number, count: number, o?: G9ListKeyOptions): G9ListKeyAction;
26
+ /**
27
+ * The next row whose label starts with `typed` (the search key: Persian spelling variants and case fold), after
28
+ * `active` and around; -1 when none.
29
+ */
30
+ export declare function typeAheadIndex(labels: readonly string[], typed: string, active: number): number;
31
+ /** Options of {@link useG9ListKeyboard}. */
32
+ export interface G9UseListKeyboardOptions extends G9ListKeyOptions {
33
+ readonly count: number;
34
+ /** Enter on the active row. */
35
+ readonly onActivate: (index: number) => void;
36
+ /** A row's words, for type-ahead; without it type-ahead is off. */
37
+ readonly labelOf?: (index: number) => string;
38
+ /** After the active row changed (scroll it into view). */
39
+ readonly onActiveChange?: (index: number) => void;
40
+ /** Default true. */
41
+ readonly enabled?: boolean;
42
+ /** The row active at first. Default none (-1): the first key picks the first or last row. */
43
+ readonly initial?: number;
44
+ }
45
+ /** Keyboard navigation of a list: the active row's index (-1 none) and a setter (a pointer hover may move it). */
46
+ export declare function useG9ListKeyboard(o: G9UseListKeyboardOptions): {
47
+ readonly active: number;
48
+ setActive(i: number): void;
49
+ };
50
+ //# sourceMappingURL=keyboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/list/keyboard.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAKhE,gDAAgD;AAChD,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9B,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C;AAeD,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,GAAE,gBAAqB,GAAG,eAAe,CAgBrH;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,MAAM,EA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