@mittwald/flow-react-components 1.6.0-next.5 → 1.6.0-next.50

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 (292) hide show
  1. package/AGENTS.md +132 -88
  2. package/USAGE.md +7 -2
  3. package/dist/assets/component-index.json +1 -1
  4. package/dist/assets/doc-properties.json +1 -1
  5. package/dist/css/all-layered.css +1 -1
  6. package/dist/css/all.css +1 -1
  7. package/dist/js/_virtual/_18.locale.mjs +14 -0
  8. package/dist/js/default.mjs +4 -3
  9. package/dist/js/flr-universal.mjs +2 -1
  10. package/dist/js/node_modules/.pnpm/{@lezer_lr@1.4.10 → @lezer_lr@1.4.11}/node_modules/@lezer/lr/dist/index.mjs +40 -28
  11. package/dist/js/node_modules/.pnpm/@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.mjs.map +1 -0
  12. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +3 -2
  13. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
  14. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +3 -2
  15. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
  16. package/dist/js/packages/components/src/components/Action/models/ActionState.mjs +2 -2
  17. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +3 -3
  18. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
  19. package/dist/js/packages/components/src/components/Activity/Activity.mjs +1 -1
  20. package/dist/js/packages/components/src/components/Activity/Activity.mjs.map +1 -1
  21. package/dist/js/packages/components/src/components/Alert/Alert.mjs +3 -2
  22. package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
  23. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.mjs +1 -1
  24. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.mjs.map +1 -1
  25. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.module.mjs.map +1 -1
  26. package/dist/js/packages/components/src/components/Badge/Badge.mjs +2 -2
  27. package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
  28. package/dist/js/packages/components/src/components/Badge/Badge.module.mjs.map +1 -1
  29. package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.mjs +1 -1
  30. package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -8
  31. package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
  32. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +23 -5
  33. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
  34. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs +67 -0
  35. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs.map +1 -0
  36. package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +2 -2
  37. package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
  38. package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +3 -3
  39. package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
  40. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +41 -12
  41. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
  42. package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs +29 -16
  43. package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs.map +1 -1
  44. package/dist/js/packages/components/src/components/CodeEditor/languages/dotEnv/dotEnv.mjs +1 -1
  45. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +3 -2
  46. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
  47. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +5 -1
  48. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
  49. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
  50. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
  51. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +2 -1
  52. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
  53. package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs +40 -8
  54. package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs.map +1 -1
  55. package/dist/js/packages/components/src/components/DonutChart/DonutChart.mjs.map +1 -1
  56. package/dist/js/packages/components/src/components/Heading/Heading.mjs +2 -0
  57. package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
  58. package/dist/js/packages/components/src/components/Heading/Heading.module.mjs.map +1 -1
  59. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
  60. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +3 -2
  61. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
  62. package/dist/js/packages/components/src/components/Label/Label.mjs +0 -4
  63. package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
  64. package/dist/js/packages/components/src/components/Link/Link.mjs.map +1 -1
  65. package/dist/js/packages/components/src/components/List/List.mjs +27 -23
  66. package/dist/js/packages/components/src/components/List/List.mjs.map +1 -1
  67. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +5 -2
  68. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
  69. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +2 -2
  70. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs.map +1 -1
  71. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +5 -3
  72. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
  73. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs +101 -0
  74. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs.map +1 -0
  75. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs +13 -0
  76. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs.map +1 -0
  77. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +16 -9
  78. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
  79. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs +6 -2
  80. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs.map +1 -1
  81. package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +4 -2
  82. package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
  83. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +27 -1
  84. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
  85. package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs +1 -1
  86. package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs.map +1 -1
  87. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +1 -2
  88. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
  89. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs +3 -0
  90. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs.map +1 -1
  91. package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs +46 -44
  92. package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
  93. package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs +25 -25
  94. package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs.map +1 -1
  95. package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs +5 -9
  96. package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs.map +1 -1
  97. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +29 -13
  98. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
  99. package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs +31 -0
  100. package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs.map +1 -0
  101. package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs +21 -0
  102. package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs.map +1 -0
  103. package/dist/js/packages/components/src/components/List/hooks/useListSelector.mjs +18 -0
  104. package/dist/js/packages/components/src/components/List/hooks/useListSelector.mjs.map +1 -0
  105. package/dist/js/packages/components/src/components/List/listContext.mjs +32 -2
  106. package/dist/js/packages/components/src/components/List/listContext.mjs.map +1 -1
  107. package/dist/js/packages/components/src/components/List/model/List.mjs +1 -0
  108. package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
  109. package/dist/js/packages/components/src/components/List/model/ListViewMode.mjs +2 -2
  110. package/dist/js/packages/components/src/components/List/model/ReactTable.mjs +2 -2
  111. package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +15 -2
  112. package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -1
  113. package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs +16 -0
  114. package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs.map +1 -0
  115. package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs +20 -7
  116. package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs.map +1 -1
  117. package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoaderState.mjs +2 -2
  118. package/dist/js/packages/components/src/components/List/model/table/Table.mjs +11 -1
  119. package/dist/js/packages/components/src/components/List/model/table/Table.mjs.map +1 -1
  120. package/dist/js/packages/components/src/components/List/model/table/TableBody.mjs +5 -1
  121. package/dist/js/packages/components/src/components/List/model/table/TableBody.mjs.map +1 -1
  122. package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs +1 -1
  123. package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs.map +1 -1
  124. package/dist/js/packages/components/src/components/List/model/table/TableColumn.mjs +4 -0
  125. package/dist/js/packages/components/src/components/List/model/table/TableColumn.mjs.map +1 -1
  126. package/dist/js/packages/components/src/components/List/model/table/TableHeader.mjs +8 -1
  127. package/dist/js/packages/components/src/components/List/model/table/TableHeader.mjs.map +1 -1
  128. package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs +28 -1
  129. package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs.map +1 -1
  130. package/dist/js/packages/components/src/components/Markdown/Markdown.mjs +25 -7
  131. package/dist/js/packages/components/src/components/Markdown/Markdown.mjs.map +1 -1
  132. package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs +1 -1
  133. package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs.map +1 -1
  134. package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs +8 -0
  135. package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs.map +1 -0
  136. package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +32 -3
  137. package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
  138. package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs +1 -3
  139. package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -1
  140. package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
  141. package/dist/js/packages/components/src/components/Modal/Modal.mjs +9 -2
  142. package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
  143. package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +1 -3
  144. package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +2 -3
  145. package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
  146. package/dist/js/packages/components/src/components/Option/Option.module.mjs +1 -3
  147. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +2 -1
  148. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
  149. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +3 -3
  150. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
  151. package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +1 -1
  152. package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
  153. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +4 -2
  154. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
  155. package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
  156. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs +5 -4
  157. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs.map +1 -1
  158. package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +2 -3
  159. package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
  160. package/dist/js/packages/components/src/components/Rating/Rating.mjs +12 -11
  161. package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
  162. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +2 -3
  163. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
  164. package/dist/js/packages/components/src/components/Section/Section.mjs +9 -5
  165. package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
  166. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +0 -4
  167. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
  168. package/dist/js/packages/components/src/components/Section/context.mjs +47 -0
  169. package/dist/js/packages/components/src/components/Section/context.mjs.map +1 -0
  170. package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +2 -3
  171. package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  172. package/dist/js/packages/components/src/components/Select/Select.mjs +2 -3
  173. package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
  174. package/dist/js/packages/components/src/components/Slider/Slider.mjs +47 -41
  175. package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
  176. package/dist/js/packages/components/src/components/Table/Table.mjs +3 -0
  177. package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
  178. package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
  179. package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs +5 -12
  180. package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs.map +1 -1
  181. package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs +4 -2
  182. package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map +1 -1
  183. package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs +7 -1
  184. package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs.map +1 -1
  185. package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs +14 -0
  186. package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs.map +1 -0
  187. package/dist/js/packages/components/src/components/Tabs/Tabs.mjs +6 -8
  188. package/dist/js/packages/components/src/components/Tabs/Tabs.mjs.map +1 -1
  189. package/dist/js/packages/components/src/components/Tabs/Tabs.module.mjs.map +1 -1
  190. package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map +1 -1
  191. package/dist/js/packages/components/src/components/Text/Text.module.mjs.map +1 -1
  192. package/dist/js/packages/components/src/components/TextField/TextField.mjs +11 -8
  193. package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
  194. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs +15 -2
  195. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs.map +1 -1
  196. package/dist/js/packages/components/src/components/Wrap/Wrap.mjs.map +1 -1
  197. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -1
  198. package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs +4 -1
  199. package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
  200. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormRootError/FormRootError.mjs +1 -1
  201. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.mjs.map +1 -1
  202. package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs +10 -158
  203. package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs.map +1 -1
  204. package/dist/js/packages/components/src/lib/controller/overlay/useCloseOverlayConfirmationController.mjs +1 -0
  205. package/dist/js/packages/components/src/lib/controller/overlay/useCloseOverlayConfirmationController.mjs.map +1 -1
  206. package/dist/js/packages/components/src/lib/hooks/dom/useVirtualKeyboardVisible.mjs +8 -4
  207. package/dist/js/packages/components/src/lib/hooks/dom/useVirtualKeyboardVisible.mjs.map +1 -1
  208. package/dist/js/packages/components/src/lib/object/isPlainObjectDeepEqual.mjs +29 -0
  209. package/dist/js/packages/components/src/lib/object/isPlainObjectDeepEqual.mjs.map +1 -0
  210. package/dist/js/packages/components/src/lib/propsContext/components/ClearPropsContext.mjs +2 -1
  211. package/dist/js/packages/components/src/lib/propsContext/components/ClearPropsContext.mjs.map +1 -1
  212. package/dist/js/packages/components/src/lib/propsContext/components/PropsContextProvider.mjs +14 -3
  213. package/dist/js/packages/components/src/lib/propsContext/components/PropsContextProvider.mjs.map +1 -1
  214. package/dist/js/packages/components/src/lib/slotContext/SlotContextProvider.mjs +9 -4
  215. package/dist/js/packages/components/src/lib/slotContext/SlotContextProvider.mjs.map +1 -1
  216. package/dist/js/packages/components/src/views/DatePickerView.mjs +16 -0
  217. package/dist/js/packages/components/src/views/DatePickerView.mjs.map +1 -0
  218. package/dist/js/packages/components/src/views/LabelView.mjs +16 -0
  219. package/dist/js/packages/components/src/views/LabelView.mjs.map +1 -0
  220. package/dist/js/packages/components/src/views/TimeFieldView.mjs +16 -0
  221. package/dist/js/packages/components/src/views/TimeFieldView.mjs.map +1 -0
  222. package/dist/js/packages/components-base/src/index.mjs +5 -2
  223. package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs +1 -0
  224. package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
  225. package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs +4 -1
  226. package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs.map +1 -1
  227. package/dist/js/packages/components-base/src/list/filter/dateRange.mjs +37 -13
  228. package/dist/js/packages/components-base/src/list/filter/dateRange.mjs.map +1 -1
  229. package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs +55 -0
  230. package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
  231. package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs +27 -0
  232. package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
  233. package/dist/js/packages/components-base/src/list/loading/ListLoaderState.mjs +10 -5
  234. package/dist/js/packages/components-base/src/list/loading/ListLoaderState.mjs.map +1 -1
  235. package/dist/js/packages/components-base/src/overlay/OverlayState.mjs +196 -0
  236. package/dist/js/packages/components-base/src/overlay/OverlayState.mjs.map +1 -0
  237. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +1 -1
  238. package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
  239. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +1 -1
  240. package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
  241. package/dist/types/_bundled/flow-components-base/index.d.ts +4 -1
  242. package/dist/types/_bundled/flow-components-base/list/filter/ListFilter.d.ts +2 -0
  243. package/dist/types/_bundled/flow-components-base/list/filter/dateRange.d.ts +24 -1
  244. package/dist/types/_bundled/flow-components-base/list/filter/dateTimeRangeFields.d.ts +34 -0
  245. package/dist/types/_bundled/flow-components-base/list/filter/formatDateRange.d.ts +7 -0
  246. package/dist/types/_bundled/flow-components-base/list/loading/ListLoaderState.d.ts +5 -0
  247. package/dist/types/_bundled/flow-components-base/overlay/OverlayState.d.ts +94 -0
  248. package/dist/types/components/AlertBadge/AlertBadge.d.ts +2 -2
  249. package/dist/types/components/Badge/Badge.d.ts +2 -2
  250. package/dist/types/components/CartesianChart/hooks/useTickLabelWidth.d.ts +1 -0
  251. package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
  252. package/dist/types/components/DonutChart/DonutChart.d.ts +1 -4
  253. package/dist/types/components/Link/Link.d.ts +1 -1
  254. package/dist/types/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.d.ts +8 -0
  255. package/dist/types/components/List/components/Items/components/Item/Item.d.ts +2 -0
  256. package/dist/types/components/List/components/Items/components/Item/hooks/useGridItemProps.d.ts +1 -0
  257. package/dist/types/components/List/components/ListSummary/ListSummary.d.ts +3 -2
  258. package/dist/types/components/List/components/Table/components/Row.d.ts +13 -0
  259. package/dist/types/components/List/hooks/useLatestOnAction.d.ts +7 -0
  260. package/dist/types/components/List/hooks/useListSelector.d.ts +6 -0
  261. package/dist/types/components/List/index.d.ts +2 -0
  262. package/dist/types/components/List/listContext.d.ts +16 -0
  263. package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +15 -8
  264. package/dist/types/components/List/model/filter/resolveDateRangeFilterValue.d.ts +11 -0
  265. package/dist/types/components/List/model/filter/types.d.ts +23 -1
  266. package/dist/types/components/List/model/item/ItemView.d.ts +34 -11
  267. package/dist/types/components/List/model/table/Table.d.ts +7 -0
  268. package/dist/types/components/List/model/table/TableBody.d.ts +1 -0
  269. package/dist/types/components/List/model/table/TableColumn.d.ts +1 -0
  270. package/dist/types/components/List/model/table/TableHeader.d.ts +1 -0
  271. package/dist/types/components/List/model/table/TableRow.d.ts +14 -0
  272. package/dist/types/components/List/model/table/types.d.ts +17 -1
  273. package/dist/types/components/List/typedList.d.ts +1 -0
  274. package/dist/types/components/Markdown/lib/isExternalHref.d.ts +1 -0
  275. package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -4
  276. package/dist/types/components/Rating/Rating.d.ts +5 -5
  277. package/dist/types/components/Section/context.d.ts +28 -0
  278. package/dist/types/components/Table/components/TableCell/TableCell.d.ts +4 -1
  279. package/dist/types/components/Table/components/TableHeader/context.d.ts +6 -0
  280. package/dist/types/components/Wrap/Wrap.d.ts +5 -0
  281. package/dist/types/index/flr-universal.d.ts +1 -1
  282. package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.d.ts +7 -1
  283. package/dist/types/lib/controller/overlay/OverlayController.d.ts +8 -74
  284. package/dist/types/lib/dev/hydrateServerMarkup.d.ts +2 -0
  285. package/dist/types/lib/hooks/dom/useVirtualKeyboardVisible.d.ts +4 -1
  286. package/dist/types/lib/object/isPlainObjectDeepEqual.d.ts +8 -0
  287. package/package.json +12 -12
  288. package/dist/js/node_modules/.pnpm/@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.mjs.map +0 -1
  289. package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +0 -10
  290. package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +0 -1
  291. package/dist/types/lib/date/transformDateValueToDateTime.d.ts +0 -3
  292. package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +0 -2
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { createElement } from "react";
4
+ import { isShallowEqual } from "remeda";
4
5
  //#region src/components/List/model/item/ItemView.ts
5
- var dependenciesAreEqual = (a, b) => a === b || !!a && !!b && a.length === b.length && a.every((dependency, index) => Object.is(dependency, b[index]));
6
6
  var ItemView = class ItemView {
7
7
  list;
8
8
  textValue;
@@ -13,10 +13,12 @@ var ItemView = class ItemView {
13
13
  showTiles;
14
14
  showList;
15
15
  tileMaxWidth;
16
+ renderDependencies;
16
17
  dependencies;
17
18
  renderFn;
19
+ lastComparison;
18
20
  constructor(list, shape = {}) {
19
- const { fallback, loadingView = fallback, textValue, href, target, defaultExpanded, renderFn, showTiles, showList = true, tileMaxWidth = 230, dependencies } = shape;
21
+ const { fallback, loadingView = fallback, textValue, href, target, defaultExpanded, renderFn, showTiles, showList = true, tileMaxWidth = 230, renderDependencies, dependencies } = shape;
20
22
  this.list = list;
21
23
  this.textValue = textValue;
22
24
  this.renderFn = renderFn;
@@ -27,16 +29,27 @@ var ItemView = class ItemView {
27
29
  this.showTiles = showTiles;
28
30
  this.showList = showList;
29
31
  this.tileMaxWidth = tileMaxWidth;
32
+ this.renderDependencies = renderDependencies;
30
33
  this.dependencies = dependencies;
31
34
  }
32
35
  static fallbackRenderItemFn = (item) => createElement("pre", void 0, JSON.stringify(item));
33
36
  /**
34
- * Whether `other` would render this item identically — i.e. all render
35
- * functions taken from the consumer's `ListItem` element are still the same,
36
- * and the dependencies it declared have not changed.
37
+ * Whether `other` would render the item holding `data` identically. The
38
+ * render function counts by its `renderDependencies` where given, otherwise
39
+ * by its identity and the deprecated `dependencies`. `textValue` and `href`
40
+ * count by what they return for `data`, so inline functions do not re-render
41
+ * the item. `defaultExpanded` is read on mount only, so it does not count at
42
+ * all.
37
43
  */
38
- rendersSameAs(other) {
39
- return !!other && dependenciesAreEqual(this.dependencies, other.dependencies) && this.renderFn === other.renderFn && this.textValue === other.textValue && this.href === other.href && this.target === other.target && this.defaultExpanded === other.defaultExpanded;
44
+ rendersSameFor(other, data) {
45
+ return !!other && this.rendersSameContentAs(other) && this.textValue?.(data) === other.textValue?.(data) && this.href?.(data) === other.href?.(data) && this.target === other.target;
46
+ }
47
+ rendersSameContentAs(other) {
48
+ if (this.lastComparison?.other !== other) this.lastComparison = {
49
+ other,
50
+ result: this.renderDependencies || other.renderDependencies ? isShallowEqual(this.renderDependencies, other.renderDependencies) : this.renderFn === other.renderFn && isShallowEqual(this.dependencies, other.dependencies)
51
+ };
52
+ return this.lastComparison.result;
40
53
  }
41
54
  render(data) {
42
55
  return (this.renderFn ?? ItemView.fallbackRenderItemFn)(data, this.list);
@@ -1 +1 @@
1
- {"version":3,"file":"ItemView.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/item/ItemView.ts"],"sourcesContent":["import type {\n DependencyList,\n HTMLAttributeAnchorTarget,\n ReactElement,\n ReactNode,\n} from \"react\";\nimport { createElement } from \"react\";\nimport type { RenderItemFn } from \"@/components/List/model/item/types\";\nimport type List from \"@/components/List/model/List\";\n\nexport interface ItemViewShape<T> {\n textValue?: (data: T) => string;\n href?: (data: T) => string;\n target?: HTMLAttributeAnchorTarget;\n defaultExpanded?: (data: T) => boolean;\n renderFn?: RenderItemFn<T>;\n /** @deprecated Use loadingView instead */\n fallback?: ReactElement;\n loadingView?: ReactElement;\n showList?: boolean;\n showTiles?: boolean;\n tileMaxWidth?: number;\n /**\n * Values this item's content depends on besides its own data.\n *\n * An item re-renders when its data changes, or when one of the render\n * functions on its `List.Item` changes identity — which a function written\n * inline in JSX does on every render of its parent. A render function with a\n * stable identity (hoisted out of the component, wrapped in `useCallback`, or\n * reading from an external store) has to list what it reads here, or the item\n * keeps the values it first saw.\n */\n dependencies?: DependencyList;\n}\n\nconst dependenciesAreEqual = (a?: DependencyList, b?: DependencyList) =>\n a === b ||\n (!!a &&\n !!b &&\n a.length === b.length &&\n a.every((dependency, index) => Object.is(dependency, b[index])));\n\nexport class ItemView<T> {\n public readonly list: List<T>;\n public readonly textValue?: (data: T) => string;\n public readonly href?: (data: T) => string;\n public readonly target?: HTMLAttributeAnchorTarget;\n public readonly defaultExpanded?: (data: T) => boolean;\n public readonly loadingView?: ReactElement;\n public readonly showTiles?: boolean;\n public readonly showList?: boolean;\n public readonly tileMaxWidth: number;\n public readonly dependencies?: DependencyList;\n private readonly renderFn?: RenderItemFn<T>;\n\n public constructor(list: List<T>, shape: ItemViewShape<T> = {}) {\n const {\n fallback,\n loadingView = fallback,\n textValue,\n href,\n target,\n defaultExpanded,\n renderFn,\n showTiles,\n showList = true,\n tileMaxWidth = 230,\n dependencies,\n } = shape;\n this.list = list;\n this.textValue = textValue;\n this.renderFn = renderFn;\n this.href = href;\n this.target = target;\n this.defaultExpanded = defaultExpanded;\n this.loadingView = loadingView;\n this.showTiles = showTiles;\n this.showList = showList;\n this.tileMaxWidth = tileMaxWidth;\n this.dependencies = dependencies;\n }\n\n private static fallbackRenderItemFn: RenderItemFn<never> = (item) =>\n createElement(\"pre\", undefined, JSON.stringify(item));\n\n /**\n * Whether `other` would render this item identically — i.e. all render\n * functions taken from the consumer's `ListItem` element are still the same,\n * and the dependencies it declared have not changed.\n */\n public rendersSameAs(other?: ItemView<T>): boolean {\n return (\n !!other &&\n dependenciesAreEqual(this.dependencies, other.dependencies) &&\n this.renderFn === other.renderFn &&\n this.textValue === other.textValue &&\n this.href === other.href &&\n this.target === other.target &&\n this.defaultExpanded === other.defaultExpanded\n );\n }\n\n public render(data: T): ReactNode {\n const renderFn = (this.renderFn ??\n ItemView.fallbackRenderItemFn) as RenderItemFn<T>;\n return renderFn(data as never, this.list);\n }\n}\n"],"mappings":";;;;AAmCA,IAAM,wBAAwB,GAAoB,MAChD,MAAM,KACL,CAAC,CAAC,KACD,CAAC,CAAC,KACF,EAAE,WAAW,EAAE,UACf,EAAE,OAAO,YAAY,UAAU,OAAO,GAAG,YAAY,EAAE,MAAM,CAAC;AAElE,IAAa,WAAb,MAAa,SAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAmB,MAAe,QAA0B,CAAC,GAAG;EAC9D,MAAM,EACJ,UACA,cAAc,UACd,WACA,MACA,QACA,iBACA,UACA,WACA,WAAW,MACX,eAAe,KACf,iBACE;EACJ,KAAK,OAAO;EACZ,KAAK,YAAY;EACjB,KAAK,WAAW;EAChB,KAAK,OAAO;EACZ,KAAK,SAAS;EACd,KAAK,kBAAkB;EACvB,KAAK,cAAc;EACnB,KAAK,YAAY;EACjB,KAAK,WAAW;EAChB,KAAK,eAAe;EACpB,KAAK,eAAe;CACtB;CAEA,OAAe,wBAA6C,SAC1D,cAAc,OAAO,KAAA,GAAW,KAAK,UAAU,IAAI,CAAC;;;;;;CAOtD,cAAqB,OAA8B;EACjD,OACE,CAAC,CAAC,SACF,qBAAqB,KAAK,cAAc,MAAM,YAAY,KAC1D,KAAK,aAAa,MAAM,YACxB,KAAK,cAAc,MAAM,aACzB,KAAK,SAAS,MAAM,QACpB,KAAK,WAAW,MAAM,UACtB,KAAK,oBAAoB,MAAM;CAEnC;CAEA,OAAc,MAAoB;EAGhC,QAFkB,KAAK,YACrB,SAAS,qBAAA,CACK,MAAe,KAAK,IAAI;CAC1C;AACF"}
1
+ {"version":3,"file":"ItemView.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/item/ItemView.ts"],"sourcesContent":["import type {\n DependencyList,\n HTMLAttributeAnchorTarget,\n ReactElement,\n ReactNode,\n} from \"react\";\nimport { createElement } from \"react\";\nimport type { RenderItemFn } from \"@/components/List/model/item/types\";\nimport type List from \"@/components/List/model/List\";\nimport { isShallowEqual } from \"remeda\";\n\nexport interface ItemViewShape<T> {\n /**\n * Runs on every render of the list to tell whether the item changed, so it\n * should be cheap and pure.\n */\n textValue?: (data: T) => string;\n /**\n * Runs on every render of the list to tell whether the item changed, so it\n * should be cheap and pure.\n */\n href?: (data: T) => string;\n target?: HTMLAttributeAnchorTarget;\n defaultExpanded?: (data: T) => boolean;\n renderFn?: RenderItemFn<T>;\n /** @deprecated Use loadingView instead */\n fallback?: ReactElement;\n loadingView?: ReactElement;\n showList?: boolean;\n showTiles?: boolean;\n tileMaxWidth?: number;\n /**\n * Everything the render function reads besides the item's data.\n *\n * With `renderDependencies`, an item re-renders only when its data or one of\n * these values changes. The render function's identity no longer counts, so a\n * function written inline in JSX keeps the item from re-rendering on every\n * render of its parent. List every value it reads from outside the item,\n * including state read through the `list` argument — one left out keeps the\n * item on the value it last rendered.\n *\n * Without it, an item re-renders whenever its render function changes\n * identity, which an inline function does on every render of its parent.\n */\n renderDependencies?: DependencyList;\n /**\n * @deprecated Use `renderDependencies` instead. `dependencies` only adds to\n * the render function's identity, so an inline render function still\n * re-renders the item on every render of its parent.\n */\n dependencies?: DependencyList;\n}\n\nexport class ItemView<T> {\n public readonly list: List<T>;\n public readonly textValue?: (data: T) => string;\n public readonly href?: (data: T) => string;\n public readonly target?: HTMLAttributeAnchorTarget;\n public readonly defaultExpanded?: (data: T) => boolean;\n public readonly loadingView?: ReactElement;\n public readonly showTiles?: boolean;\n public readonly showList?: boolean;\n public readonly tileMaxWidth: number;\n public readonly renderDependencies?: DependencyList;\n public readonly dependencies?: DependencyList;\n private readonly renderFn?: RenderItemFn<T>;\n private lastComparison?: { other: ItemView<T>; result: boolean };\n\n public constructor(list: List<T>, shape: ItemViewShape<T> = {}) {\n const {\n fallback,\n loadingView = fallback,\n textValue,\n href,\n target,\n defaultExpanded,\n renderFn,\n showTiles,\n showList = true,\n tileMaxWidth = 230,\n renderDependencies,\n dependencies,\n } = shape;\n this.list = list;\n this.textValue = textValue;\n this.renderFn = renderFn;\n this.href = href;\n this.target = target;\n this.defaultExpanded = defaultExpanded;\n this.loadingView = loadingView;\n this.showTiles = showTiles;\n this.showList = showList;\n this.tileMaxWidth = tileMaxWidth;\n this.renderDependencies = renderDependencies;\n this.dependencies = dependencies;\n }\n\n private static fallbackRenderItemFn: RenderItemFn<never> = (item) =>\n createElement(\"pre\", undefined, JSON.stringify(item));\n\n /**\n * Whether `other` would render the item holding `data` identically. The\n * render function counts by its `renderDependencies` where given, otherwise\n * by its identity and the deprecated `dependencies`. `textValue` and `href`\n * count by what they return for `data`, so inline functions do not re-render\n * the item. `defaultExpanded` is read on mount only, so it does not count at\n * all.\n */\n public rendersSameFor(other: ItemView<T> | undefined, data: T): boolean {\n return (\n !!other &&\n this.rendersSameContentAs(other) &&\n this.textValue?.(data) === other.textValue?.(data) &&\n this.href?.(data) === other.href?.(data) &&\n this.target === other.target\n );\n }\n\n // Every item of a render shares one item view, so the result is cached for\n // the last `other`.\n private rendersSameContentAs(other: ItemView<T>): boolean {\n if (this.lastComparison?.other !== other) {\n this.lastComparison = {\n other,\n result:\n this.renderDependencies || other.renderDependencies\n ? isShallowEqual(this.renderDependencies, other.renderDependencies)\n : this.renderFn === other.renderFn &&\n isShallowEqual(this.dependencies, other.dependencies),\n };\n }\n return this.lastComparison.result;\n }\n\n public render(data: T): ReactNode {\n const renderFn = (this.renderFn ??\n ItemView.fallbackRenderItemFn) as RenderItemFn<T>;\n return renderFn(data as never, this.list);\n }\n}\n"],"mappings":";;;;;AAqDA,IAAa,WAAb,MAAa,SAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAmB,MAAe,QAA0B,CAAC,GAAG;EAC9D,MAAM,EACJ,UACA,cAAc,UACd,WACA,MACA,QACA,iBACA,UACA,WACA,WAAW,MACX,eAAe,KACf,oBACA,iBACE;EACJ,KAAK,OAAO;EACZ,KAAK,YAAY;EACjB,KAAK,WAAW;EAChB,KAAK,OAAO;EACZ,KAAK,SAAS;EACd,KAAK,kBAAkB;EACvB,KAAK,cAAc;EACnB,KAAK,YAAY;EACjB,KAAK,WAAW;EAChB,KAAK,eAAe;EACpB,KAAK,qBAAqB;EAC1B,KAAK,eAAe;CACtB;CAEA,OAAe,wBAA6C,SAC1D,cAAc,OAAO,KAAA,GAAW,KAAK,UAAU,IAAI,CAAC;;;;;;;;;CAUtD,eAAsB,OAAgC,MAAkB;EACtE,OACE,CAAC,CAAC,SACF,KAAK,qBAAqB,KAAK,KAC/B,KAAK,YAAY,IAAI,MAAM,MAAM,YAAY,IAAI,KACjD,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,IAAI,KACvC,KAAK,WAAW,MAAM;CAE1B;CAIA,qBAA6B,OAA6B;EACxD,IAAI,KAAK,gBAAgB,UAAU,OACjC,KAAK,iBAAiB;GACpB;GACA,QACE,KAAK,sBAAsB,MAAM,qBAC7B,eAAe,KAAK,oBAAoB,MAAM,kBAAkB,IAChE,KAAK,aAAa,MAAM,YACxB,eAAe,KAAK,cAAc,MAAM,YAAY;EAC5D;EAEF,OAAO,KAAK,eAAe;CAC7B;CAEA,OAAc,MAAoB;EAGhC,QAFkB,KAAK,YACrB,SAAS,qBAAA,CACK,MAAe,KAAK,IAAI;CAC1C;AACF"}
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  /* */
3
- import useSelector from "../../../../lib/mobx/useSelector.mjs";
4
- import { useStatic } from "../../../../lib/hooks/useStatic.mjs";
5
3
  import { ListLoaderState } from "../../../../../../components-base/src/list/loading/ListLoaderState.mjs";
6
4
  import "../../../../../../components-base/src/index.mjs";
5
+ import useSelector from "../../../../lib/mobx/useSelector.mjs";
6
+ import { useStatic } from "../../../../lib/hooks/useStatic.mjs";
7
7
  //#region src/components/List/model/loading/IncrementalLoaderState.ts
8
8
  /**
9
9
  * React's view of the list's loading state.
@@ -2,6 +2,7 @@
2
2
  /* */
3
3
  import { TableHeader } from "./TableHeader.mjs";
4
4
  import { TableBody } from "./TableBody.mjs";
5
+ import { isShallowEqual } from "remeda";
5
6
  //#region src/components/List/model/table/Table.ts
6
7
  var Table = class {
7
8
  list;
@@ -9,12 +10,21 @@ var Table = class {
9
10
  body;
10
11
  componentProps;
11
12
  constructor(list, shape = {}) {
12
- const { header, body, ...restProps } = shape;
13
+ const { header, body, children: ignoredChildren, ...restProps } = shape;
13
14
  this.list = list;
14
15
  this.header = new TableHeader(this, header);
15
16
  this.body = new TableBody(this, body);
16
17
  this.componentProps = restProps;
17
18
  }
19
+ /**
20
+ * Whether `other` would render the table identically, rows aside. Like
21
+ * `TableRow.rendersSameAs`, it only holds for rows that declare
22
+ * `renderDependencies`. Props count by identity, one by one, including the
23
+ * list's own.
24
+ */
25
+ rendersSameAs(other) {
26
+ return !!other && isShallowEqual(this.list.componentProps, other.list.componentProps) && isShallowEqual(this.componentProps, other.componentProps) && this.header.rendersSameAs(other.header) && this.body.rendersSameAs(other.body);
27
+ }
18
28
  };
19
29
  //#endregion
20
30
  export { Table };
@@ -1 +1 @@
1
- {"version":3,"file":"Table.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/Table.ts"],"sourcesContent":["import type {\n TableShape,\n TableSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport type List from \"@/components/List/model/List\";\nimport { TableHeader } from \"@/components/List/model/table/TableHeader\";\nimport { TableBody } from \"@/components/List/model/table/TableBody\";\n\nexport class Table<T> {\n public readonly list: List<T>;\n public readonly header: TableHeader<T>;\n public readonly body: TableBody<T>;\n public readonly componentProps: TableSupportedComponentProps;\n\n public constructor(list: List<T>, shape: TableShape<T> = {}) {\n const { header, body, ...restProps } = shape;\n this.list = list;\n this.header = new TableHeader(this, header);\n this.body = new TableBody(this, body);\n this.componentProps = restProps;\n }\n}\n"],"mappings":";;;;;AAQA,IAAa,QAAb,MAAsB;CACpB;CACA;CACA;CACA;CAEA,YAAmB,MAAe,QAAuB,CAAC,GAAG;EAC3D,MAAM,EAAE,QAAQ,MAAM,GAAG,cAAc;EACvC,KAAK,OAAO;EACZ,KAAK,SAAS,IAAI,YAAY,MAAM,MAAM;EAC1C,KAAK,OAAO,IAAI,UAAU,MAAM,IAAI;EACpC,KAAK,iBAAiB;CACxB;AACF"}
1
+ {"version":3,"file":"Table.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/Table.ts"],"sourcesContent":["import type {\n TableShape,\n TableSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport type List from \"@/components/List/model/List\";\nimport { TableHeader } from \"@/components/List/model/table/TableHeader\";\nimport { TableBody } from \"@/components/List/model/table/TableBody\";\nimport { isShallowEqual } from \"remeda\";\n\nexport class Table<T> {\n public readonly list: List<T>;\n public readonly header: TableHeader<T>;\n public readonly body: TableBody<T>;\n public readonly componentProps: TableSupportedComponentProps;\n\n public constructor(list: List<T>, shape: TableShape<T> = {}) {\n // `children` holds the header and body elements, which arrive as `header`\n // and `body`.\n const { header, body, children: ignoredChildren, ...restProps } = shape;\n this.list = list;\n this.header = new TableHeader(this, header);\n this.body = new TableBody(this, body);\n this.componentProps = restProps;\n }\n\n /**\n * Whether `other` would render the table identically, rows aside. Like\n * `TableRow.rendersSameAs`, it only holds for rows that declare\n * `renderDependencies`. Props count by identity, one by one, including the\n * list's own.\n */\n public rendersSameAs(other?: Table<T>): boolean {\n return (\n !!other &&\n isShallowEqual(this.list.componentProps, other.list.componentProps) &&\n isShallowEqual(this.componentProps, other.componentProps) &&\n this.header.rendersSameAs(other.header) &&\n this.body.rendersSameAs(other.body)\n );\n }\n}\n"],"mappings":";;;;;;AASA,IAAa,QAAb,MAAsB;CACpB;CACA;CACA;CACA;CAEA,YAAmB,MAAe,QAAuB,CAAC,GAAG;EAG3D,MAAM,EAAE,QAAQ,MAAM,UAAU,iBAAiB,GAAG,cAAc;EAClE,KAAK,OAAO;EACZ,KAAK,SAAS,IAAI,YAAY,MAAM,MAAM;EAC1C,KAAK,OAAO,IAAI,UAAU,MAAM,IAAI;EACpC,KAAK,iBAAiB;CACxB;;;;;;;CAQA,cAAqB,OAA2B;EAC9C,OACE,CAAC,CAAC,SACF,eAAe,KAAK,KAAK,gBAAgB,MAAM,KAAK,cAAc,KAClE,eAAe,KAAK,gBAAgB,MAAM,cAAc,KACxD,KAAK,OAAO,cAAc,MAAM,MAAM,KACtC,KAAK,KAAK,cAAc,MAAM,IAAI;CAEtC;AACF"}
@@ -1,17 +1,21 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { TableRow } from "./TableRow.mjs";
4
+ import { isShallowEqual } from "remeda";
4
5
  //#region src/components/List/model/table/TableBody.ts
5
6
  var TableBody = class {
6
7
  table;
7
8
  componentProps;
8
9
  row;
9
10
  constructor(table, shape = {}) {
10
- const { row, ...rest } = shape;
11
+ const { row, children: ignoredChildren, ...rest } = shape;
11
12
  this.table = table;
12
13
  this.row = new TableRow(this, row);
13
14
  this.componentProps = rest;
14
15
  }
16
+ rendersSameAs(other) {
17
+ return isShallowEqual(this.componentProps, other.componentProps) && this.row.rendersSameAs(other.row);
18
+ }
15
19
  };
16
20
  //#endregion
17
21
  export { TableBody };
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableBody.ts"],"sourcesContent":["import type { Table } from \"@/components/List/model/table/Table\";\nimport type {\n TableBodyShape,\n TableBodySupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport { TableRow } from \"@/components/List/model/table/TableRow\";\n\nexport class TableBody<T> {\n public readonly table: Table<T>;\n public readonly componentProps: TableBodySupportedComponentProps;\n public readonly row: TableRow<T>;\n\n public constructor(table: Table<T>, shape: TableBodyShape<T> = {}) {\n const { row, ...rest } = shape;\n this.table = table;\n this.row = new TableRow(this, row);\n this.componentProps = rest;\n }\n}\n"],"mappings":";;;;AAOA,IAAa,YAAb,MAA0B;CACxB;CACA;CACA;CAEA,YAAmB,OAAiB,QAA2B,CAAC,GAAG;EACjE,MAAM,EAAE,KAAK,GAAG,SAAS;EACzB,KAAK,QAAQ;EACb,KAAK,MAAM,IAAI,SAAS,MAAM,GAAG;EACjC,KAAK,iBAAiB;CACxB;AACF"}
1
+ {"version":3,"file":"TableBody.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableBody.ts"],"sourcesContent":["import type { Table } from \"@/components/List/model/table/Table\";\nimport type {\n TableBodyShape,\n TableBodySupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport { TableRow } from \"@/components/List/model/table/TableRow\";\nimport { isShallowEqual } from \"remeda\";\n\nexport class TableBody<T> {\n public readonly table: Table<T>;\n public readonly componentProps: TableBodySupportedComponentProps;\n public readonly row: TableRow<T>;\n\n public constructor(table: Table<T>, shape: TableBodyShape<T> = {}) {\n // `children` holds the row element, which arrives as `row`.\n const { row, children: ignoredChildren, ...rest } = shape;\n this.table = table;\n this.row = new TableRow(this, row);\n this.componentProps = rest;\n }\n\n public rendersSameAs(other: TableBody<T>): boolean {\n return (\n isShallowEqual(this.componentProps, other.componentProps) &&\n this.row.rendersSameAs(other.row)\n );\n }\n}\n"],"mappings":";;;;;AAQA,IAAa,YAAb,MAA0B;CACxB;CACA;CACA;CAEA,YAAmB,OAAiB,QAA2B,CAAC,GAAG;EAEjE,MAAM,EAAE,KAAK,UAAU,iBAAiB,GAAG,SAAS;EACpD,KAAK,QAAQ;EACb,KAAK,MAAM,IAAI,SAAS,MAAM,GAAG;EACjC,KAAK,iBAAiB;CACxB;CAEA,cAAqB,OAA8B;EACjD,OACE,eAAe,KAAK,gBAAgB,MAAM,cAAc,KACxD,KAAK,IAAI,cAAc,MAAM,GAAG;CAEpC;AACF"}
@@ -7,7 +7,7 @@ var TableCell = class {
7
7
  componentProps;
8
8
  loadingView;
9
9
  constructor(row, shape = {}) {
10
- const { renderFn, loadingView, ...rest } = shape;
10
+ const { renderFn, loadingView, children: ignoredChildren, ...rest } = shape;
11
11
  this.row = row;
12
12
  this.renderFn = renderFn;
13
13
  this.componentProps = rest;
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableCell.ts"],"sourcesContent":["import type {\n TableCellShape,\n TableCellSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport type { TableRow } from \"@/components/List/model/table/TableRow\";\nimport type { RenderItemFn } from \"@/components/List\";\nimport type { ReactElement } from \"react\";\n\nexport class TableCell<T> {\n public readonly row: TableRow<T>;\n public readonly renderFn?: RenderItemFn<T>;\n public readonly componentProps: TableCellSupportedComponentProps;\n loadingView?: ReactElement;\n\n public constructor(row: TableRow<T>, shape: TableCellShape<T> = {}) {\n const { renderFn, loadingView, ...rest } = shape;\n this.row = row;\n this.renderFn = renderFn;\n this.componentProps = rest;\n this.loadingView = loadingView;\n }\n}\n"],"mappings":";;;AAQA,IAAa,YAAb,MAA0B;CACxB;CACA;CACA;CACA;CAEA,YAAmB,KAAkB,QAA2B,CAAC,GAAG;EAClE,MAAM,EAAE,UAAU,aAAa,GAAG,SAAS;EAC3C,KAAK,MAAM;EACX,KAAK,WAAW;EAChB,KAAK,iBAAiB;EACtB,KAAK,cAAc;CACrB;AACF"}
1
+ {"version":3,"file":"TableCell.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableCell.ts"],"sourcesContent":["import type {\n TableCellShape,\n TableCellSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport type { TableRow } from \"@/components/List/model/table/TableRow\";\nimport type { RenderItemFn } from \"@/components/List\";\nimport type { ReactElement } from \"react\";\n\nexport class TableCell<T> {\n public readonly row: TableRow<T>;\n public readonly renderFn?: RenderItemFn<T>;\n public readonly componentProps: TableCellSupportedComponentProps;\n loadingView?: ReactElement;\n\n public constructor(row: TableRow<T>, shape: TableCellShape<T> = {}) {\n // `children` is the render function, which arrives as `renderFn`.\n const {\n renderFn,\n loadingView,\n children: ignoredChildren,\n ...rest\n } = shape as TableCellShape<T> & { children?: unknown };\n this.row = row;\n this.renderFn = renderFn;\n this.componentProps = rest;\n this.loadingView = loadingView;\n }\n}\n"],"mappings":";;;AAQA,IAAa,YAAb,MAA0B;CACxB;CACA;CACA;CACA;CAEA,YAAmB,KAAkB,QAA2B,CAAC,GAAG;EAElE,MAAM,EACJ,UACA,aACA,UAAU,iBACV,GAAG,SACD;EACJ,KAAK,MAAM;EACX,KAAK,WAAW;EAChB,KAAK,iBAAiB;EACtB,KAAK,cAAc;CACrB;AACF"}
@@ -1,5 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
+ import { isShallowEqual } from "remeda";
3
4
  //#region src/components/List/model/table/TableColumn.ts
4
5
  var TableColumn = class {
5
6
  tableHeader;
@@ -8,6 +9,9 @@ var TableColumn = class {
8
9
  this.tableHeader = tableHeader;
9
10
  this.componentProps = shape;
10
11
  }
12
+ rendersSameAs(other) {
13
+ return isShallowEqual(this.componentProps, other.componentProps);
14
+ }
11
15
  };
12
16
  //#endregion
13
17
  export { TableColumn };
@@ -1 +1 @@
1
- {"version":3,"file":"TableColumn.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableColumn.ts"],"sourcesContent":["import type {\n TableColumnShape,\n TableColumnSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport type { TableHeader } from \"@/components/List/model/table/TableHeader\";\n\nexport class TableColumn<T> {\n public readonly tableHeader: TableHeader<T>;\n public readonly componentProps: TableColumnSupportedComponentProps;\n\n public constructor(\n tableHeader: TableHeader<T>,\n shape: TableColumnShape = {},\n ) {\n this.tableHeader = tableHeader;\n this.componentProps = shape;\n }\n}\n"],"mappings":";;;AAMA,IAAa,cAAb,MAA4B;CAC1B;CACA;CAEA,YACE,aACA,QAA0B,CAAC,GAC3B;EACA,KAAK,cAAc;EACnB,KAAK,iBAAiB;CACxB;AACF"}
1
+ {"version":3,"file":"TableColumn.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableColumn.ts"],"sourcesContent":["import type {\n TableColumnShape,\n TableColumnSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport type { TableHeader } from \"@/components/List/model/table/TableHeader\";\nimport { isShallowEqual } from \"remeda\";\n\nexport class TableColumn<T> {\n public readonly tableHeader: TableHeader<T>;\n public readonly componentProps: TableColumnSupportedComponentProps;\n\n public constructor(\n tableHeader: TableHeader<T>,\n shape: TableColumnShape = {},\n ) {\n this.tableHeader = tableHeader;\n this.componentProps = shape;\n }\n\n public rendersSameAs(other: TableColumn<T>): boolean {\n return isShallowEqual(this.componentProps, other.componentProps);\n }\n}\n"],"mappings":";;;;AAOA,IAAa,cAAb,MAA4B;CAC1B;CACA;CAEA,YACE,aACA,QAA0B,CAAC,GAC3B;EACA,KAAK,cAAc;EACnB,KAAK,iBAAiB;CACxB;CAEA,cAAqB,OAAgC;EACnD,OAAO,eAAe,KAAK,gBAAgB,MAAM,cAAc;CACjE;AACF"}
@@ -1,17 +1,24 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { TableColumn } from "./TableColumn.mjs";
4
+ import { isShallowEqual } from "remeda";
4
5
  //#region src/components/List/model/table/TableHeader.ts
5
6
  var TableHeader = class {
6
7
  table;
7
8
  componentProps;
8
9
  columns;
9
10
  constructor(table, shape = {}) {
10
- const { columns = [], ...rest } = shape;
11
+ const { columns = [], children: ignoredChildren, ...rest } = shape;
11
12
  this.table = table;
12
13
  this.columns = columns.map((colShape) => new TableColumn(this, colShape));
13
14
  this.componentProps = rest;
14
15
  }
16
+ rendersSameAs(other) {
17
+ return isShallowEqual(this.componentProps, other.componentProps) && this.columns.length === other.columns.length && this.columns.every((column, index) => {
18
+ const otherColumn = other.columns[index];
19
+ return !!otherColumn && column.rendersSameAs(otherColumn);
20
+ });
21
+ }
15
22
  };
16
23
  //#endregion
17
24
  export { TableHeader };
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableHeader.ts"],"sourcesContent":["import type { Table } from \"@/components/List/model/table/Table\";\nimport type {\n TableHeaderShape,\n TableHeaderSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport { TableColumn } from \"@/components/List/model/table/TableColumn\";\n\nexport class TableHeader<T> {\n public readonly table: Table<T>;\n public readonly componentProps: TableHeaderSupportedComponentProps;\n public readonly columns: TableColumn<T>[];\n\n public constructor(table: Table<T>, shape: TableHeaderShape = {}) {\n const { columns = [], ...rest } = shape;\n this.table = table;\n this.columns = columns.map((colShape) => new TableColumn(this, colShape));\n this.componentProps = rest;\n }\n}\n"],"mappings":";;;;AAOA,IAAa,cAAb,MAA4B;CAC1B;CACA;CACA;CAEA,YAAmB,OAAiB,QAA0B,CAAC,GAAG;EAChE,MAAM,EAAE,UAAU,CAAC,GAAG,GAAG,SAAS;EAClC,KAAK,QAAQ;EACb,KAAK,UAAU,QAAQ,KAAK,aAAa,IAAI,YAAY,MAAM,QAAQ,CAAC;EACxE,KAAK,iBAAiB;CACxB;AACF"}
1
+ {"version":3,"file":"TableHeader.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableHeader.ts"],"sourcesContent":["import type { Table } from \"@/components/List/model/table/Table\";\nimport type {\n TableHeaderShape,\n TableHeaderSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport { TableColumn } from \"@/components/List/model/table/TableColumn\";\nimport { isShallowEqual } from \"remeda\";\n\nexport class TableHeader<T> {\n public readonly table: Table<T>;\n public readonly componentProps: TableHeaderSupportedComponentProps;\n public readonly columns: TableColumn<T>[];\n\n public constructor(table: Table<T>, shape: TableHeaderShape = {}) {\n // `children` holds the column elements, which arrive as `columns`.\n const { columns = [], children: ignoredChildren, ...rest } = shape;\n this.table = table;\n this.columns = columns.map((colShape) => new TableColumn(this, colShape));\n this.componentProps = rest;\n }\n\n public rendersSameAs(other: TableHeader<T>): boolean {\n return (\n isShallowEqual(this.componentProps, other.componentProps) &&\n this.columns.length === other.columns.length &&\n this.columns.every((column, index) => {\n const otherColumn = other.columns[index];\n return !!otherColumn && column.rendersSameAs(otherColumn);\n })\n );\n }\n}\n"],"mappings":";;;;;AAQA,IAAa,cAAb,MAA4B;CAC1B;CACA;CACA;CAEA,YAAmB,OAAiB,QAA0B,CAAC,GAAG;EAEhE,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,iBAAiB,GAAG,SAAS;EAC7D,KAAK,QAAQ;EACb,KAAK,UAAU,QAAQ,KAAK,aAAa,IAAI,YAAY,MAAM,QAAQ,CAAC;EACxE,KAAK,iBAAiB;CACxB;CAEA,cAAqB,OAAgC;EACnD,OACE,eAAe,KAAK,gBAAgB,MAAM,cAAc,KACxD,KAAK,QAAQ,WAAW,MAAM,QAAQ,UACtC,KAAK,QAAQ,OAAO,QAAQ,UAAU;GACpC,MAAM,cAAc,MAAM,QAAQ;GAClC,OAAO,CAAC,CAAC,eAAe,OAAO,cAAc,WAAW;EAC1D,CAAC;CAEL;AACF"}
@@ -1,16 +1,43 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { TableCell } from "./TableCell.mjs";
4
+ import { isShallowEqual } from "remeda";
4
5
  //#region src/components/List/model/table/TableRow.ts
5
6
  var TableRow = class {
6
7
  tableBody;
7
8
  cells;
8
9
  componentProps;
10
+ renderDependencies;
11
+ lastComparison;
9
12
  constructor(tableBody, shape = {}) {
10
- const { cells = [], ...rest } = shape;
13
+ const { cells = [], renderDependencies, children: ignoredChildren, ...rest } = shape;
11
14
  this.tableBody = tableBody;
12
15
  this.cells = cells.map((cellShape) => new TableCell(this, cellShape));
13
16
  this.componentProps = rest;
17
+ this.renderDependencies = renderDependencies;
18
+ }
19
+ /**
20
+ * Whether `other` would render a row identically. Only rows that declare
21
+ * `renderDependencies` can tell, since the cells' render functions count by
22
+ * those instead of their identity. Rows without them always re-render. Row
23
+ * and cell props count by identity, one by one.
24
+ *
25
+ * Every row of a render shares one model, so the result is cached for the
26
+ * last `other`.
27
+ */
28
+ rendersSameAs(other) {
29
+ if (!other) return false;
30
+ if (this.lastComparison?.other !== other) this.lastComparison = {
31
+ other,
32
+ result: this.compareWith(other)
33
+ };
34
+ return this.lastComparison.result;
35
+ }
36
+ compareWith(other) {
37
+ return !!this.renderDependencies && isShallowEqual(this.renderDependencies, other.renderDependencies) && isShallowEqual(this.componentProps, other.componentProps) && this.cells.length === other.cells.length && this.cells.every((cell, index) => {
38
+ const otherCell = other.cells[index];
39
+ return !!otherCell && isShallowEqual(cell.componentProps, otherCell.componentProps);
40
+ });
14
41
  }
15
42
  };
16
43
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableRow.ts"],"sourcesContent":["import type {\n TableRowShape,\n TableRowSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport { TableCell } from \"@/components/List/model/table/TableCell\";\nimport type { TableBody } from \"@/components/List/model/table/TableBody\";\n\nexport class TableRow<T> {\n public readonly tableBody: TableBody<T>;\n public readonly cells: TableCell<T>[];\n public readonly componentProps: TableRowSupportedComponentProps;\n\n public constructor(tableBody: TableBody<T>, shape: TableRowShape<T> = {}) {\n const { cells = [], ...rest } = shape;\n this.tableBody = tableBody;\n this.cells = cells.map((cellShape) => new TableCell(this, cellShape));\n this.componentProps = rest;\n }\n}\n"],"mappings":";;;;AAOA,IAAa,WAAb,MAAyB;CACvB;CACA;CACA;CAEA,YAAmB,WAAyB,QAA0B,CAAC,GAAG;EACxE,MAAM,EAAE,QAAQ,CAAC,GAAG,GAAG,SAAS;EAChC,KAAK,YAAY;EACjB,KAAK,QAAQ,MAAM,KAAK,cAAc,IAAI,UAAU,MAAM,SAAS,CAAC;EACpE,KAAK,iBAAiB;CACxB;AACF"}
1
+ {"version":3,"file":"TableRow.mjs","names":[],"sources":["../../../../../../../../../src/components/List/model/table/TableRow.ts"],"sourcesContent":["import type {\n TableRowShape,\n TableRowSupportedComponentProps,\n} from \"@/components/List/model/table/types\";\nimport { TableCell } from \"@/components/List/model/table/TableCell\";\nimport type { TableBody } from \"@/components/List/model/table/TableBody\";\nimport type { DependencyList } from \"react\";\nimport { isShallowEqual } from \"remeda\";\n\nexport class TableRow<T> {\n public readonly tableBody: TableBody<T>;\n public readonly cells: TableCell<T>[];\n public readonly componentProps: TableRowSupportedComponentProps;\n public readonly renderDependencies?: DependencyList;\n private lastComparison?: { other: TableRow<T>; result: boolean };\n\n public constructor(tableBody: TableBody<T>, shape: TableRowShape<T> = {}) {\n // `children` holds the cell elements, which arrive as `cells`.\n const {\n cells = [],\n renderDependencies,\n children: ignoredChildren,\n ...rest\n } = shape;\n this.tableBody = tableBody;\n this.cells = cells.map((cellShape) => new TableCell(this, cellShape));\n this.componentProps = rest;\n this.renderDependencies = renderDependencies;\n }\n\n /**\n * Whether `other` would render a row identically. Only rows that declare\n * `renderDependencies` can tell, since the cells' render functions count by\n * those instead of their identity. Rows without them always re-render. Row\n * and cell props count by identity, one by one.\n *\n * Every row of a render shares one model, so the result is cached for the\n * last `other`.\n */\n public rendersSameAs(other?: TableRow<T>): boolean {\n if (!other) {\n return false;\n }\n if (this.lastComparison?.other !== other) {\n this.lastComparison = { other, result: this.compareWith(other) };\n }\n return this.lastComparison.result;\n }\n\n private compareWith(other: TableRow<T>): boolean {\n return (\n !!this.renderDependencies &&\n isShallowEqual(this.renderDependencies, other.renderDependencies) &&\n isShallowEqual(this.componentProps, other.componentProps) &&\n this.cells.length === other.cells.length &&\n this.cells.every((cell, index) => {\n const otherCell = other.cells[index];\n return (\n !!otherCell &&\n isShallowEqual(cell.componentProps, otherCell.componentProps)\n );\n })\n );\n }\n}\n"],"mappings":";;;;;AASA,IAAa,WAAb,MAAyB;CACvB;CACA;CACA;CACA;CACA;CAEA,YAAmB,WAAyB,QAA0B,CAAC,GAAG;EAExE,MAAM,EACJ,QAAQ,CAAC,GACT,oBACA,UAAU,iBACV,GAAG,SACD;EACJ,KAAK,YAAY;EACjB,KAAK,QAAQ,MAAM,KAAK,cAAc,IAAI,UAAU,MAAM,SAAS,CAAC;EACpE,KAAK,iBAAiB;EACtB,KAAK,qBAAqB;CAC5B;;;;;;;;;;CAWA,cAAqB,OAA8B;EACjD,IAAI,CAAC,OACH,OAAO;EAET,IAAI,KAAK,gBAAgB,UAAU,OACjC,KAAK,iBAAiB;GAAE;GAAO,QAAQ,KAAK,YAAY,KAAK;EAAE;EAEjE,OAAO,KAAK,eAAe;CAC7B;CAEA,YAAoB,OAA6B;EAC/C,OACE,CAAC,CAAC,KAAK,sBACP,eAAe,KAAK,oBAAoB,MAAM,kBAAkB,KAChE,eAAe,KAAK,gBAAgB,MAAM,cAAc,KACxD,KAAK,MAAM,WAAW,MAAM,MAAM,UAClC,KAAK,MAAM,OAAO,MAAM,UAAU;GAChC,MAAM,YAAY,MAAM,MAAM;GAC9B,OACE,CAAC,CAAC,aACF,eAAe,KAAK,gBAAgB,UAAU,cAAc;EAEhE,CAAC;CAEL;AACF"}
@@ -10,9 +10,10 @@ import { Link } from "../Link/Link.mjs";
10
10
  import { InlineCode } from "../InlineCode/InlineCode.mjs";
11
11
  import Markdown_module_default from "./Markdown.module.mjs";
12
12
  import { getHeadingLevelWithOffset } from "./lib/getHeadingLevelWithOffset.mjs";
13
+ import { isExternalHref } from "./lib/isExternalHref.mjs";
13
14
  import { SkeletonBlockText, SkeletonInlineContent } from "./components/SkeletonBlocks.mjs";
14
15
  import clsx from "clsx";
15
- import { Children, isValidElement } from "react";
16
+ import { Children, isValidElement, useId, useMemo } from "react";
16
17
  import { jsx } from "react/jsx-runtime";
17
18
  import ReactMarkdown from "react-markdown";
18
19
  import remarkGfm from "remark-gfm";
@@ -24,9 +25,13 @@ import remarkGfm from "remark-gfm";
24
25
  var Markdown = (props) => {
25
26
  const { children, color = "default", className, headingOffset = 0, components: customComponents, ref, allowElement, allowedElements, disallowedElements, rehypePlugins, remarkPlugins, remarkRehypeOptions, skipHtml, unwrapDisallowed, urlTransform, ...rest } = props;
26
27
  const isSkeleton = useSkeletonMode();
27
- const defaultComponents = {
28
+ const clobberPrefix = `user-content-${useId().replace(/[^\w-]/g, "")}-`;
29
+ const defaultComponents = useMemo(() => ({
28
30
  a: (props) => /* @__PURE__ */ jsx(Link, {
29
- target: "_blank",
31
+ id: props.id,
32
+ "aria-label": props["aria-label"],
33
+ "aria-describedby": props["aria-describedby"],
34
+ target: isExternalHref(props.href) ? "_blank" : void 0,
30
35
  color,
31
36
  href: props.href,
32
37
  children: props.children
@@ -41,31 +46,37 @@ var Markdown = (props) => {
41
46
  children: props.children
42
47
  }),
43
48
  h1: (props) => /* @__PURE__ */ jsx(Heading, {
49
+ id: props.id,
44
50
  level: getHeadingLevelWithOffset(1, headingOffset),
45
51
  color,
46
52
  children: props.children
47
53
  }),
48
54
  h2: (props) => /* @__PURE__ */ jsx(Heading, {
55
+ id: props.id,
49
56
  level: getHeadingLevelWithOffset(2, headingOffset),
50
57
  color,
51
58
  children: props.children
52
59
  }),
53
60
  h3: (props) => /* @__PURE__ */ jsx(Heading, {
61
+ id: props.id,
54
62
  level: getHeadingLevelWithOffset(3, headingOffset),
55
63
  color,
56
64
  children: props.children
57
65
  }),
58
66
  h4: (props) => /* @__PURE__ */ jsx(Heading, {
67
+ id: props.id,
59
68
  level: getHeadingLevelWithOffset(4, headingOffset),
60
69
  color,
61
70
  children: props.children
62
71
  }),
63
72
  h5: (props) => /* @__PURE__ */ jsx(Heading, {
73
+ id: props.id,
64
74
  level: getHeadingLevelWithOffset(5, headingOffset),
65
75
  color,
66
76
  children: props.children
67
77
  }),
68
78
  h6: (props) => /* @__PURE__ */ jsx(Heading, {
79
+ id: props.id,
69
80
  level: getHeadingLevelWithOffset(6, headingOffset),
70
81
  color,
71
82
  children: props.children
@@ -104,12 +115,16 @@ var Markdown = (props) => {
104
115
  color,
105
116
  children: /* @__PURE__ */ jsx("blockquote", { children: props.children })
106
117
  })
107
- };
118
+ }), [
119
+ color,
120
+ headingOffset,
121
+ isSkeleton
122
+ ]);
108
123
  const textContent = extractTextFromFirstChild(children);
109
- const mergedComponents = {
124
+ const mergedComponents = useMemo(() => ({
110
125
  ...defaultComponents,
111
126
  ...customComponents
112
- };
127
+ }), [defaultComponents, customComponents]);
113
128
  return /* @__PURE__ */ jsx("div", {
114
129
  className: clsx(Markdown_module_default.markdown, className),
115
130
  ...rest,
@@ -120,7 +135,10 @@ var Markdown = (props) => {
120
135
  disallowedElements,
121
136
  rehypePlugins,
122
137
  remarkPlugins: remarkPlugins ?? [remarkGfm],
123
- remarkRehypeOptions,
138
+ remarkRehypeOptions: {
139
+ clobberPrefix,
140
+ ...remarkRehypeOptions
141
+ },
124
142
  skipHtml,
125
143
  unwrapDisallowed,
126
144
  urlTransform,
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.mjs","names":["styles"],"sources":["../../../../../../../src/components/Markdown/Markdown.tsx"],"sourcesContent":["import { CodeBlock } from \"@/components/CodeBlock\";\nimport { Heading } from \"@/components/Heading\";\nimport { InlineCode } from \"@/components/InlineCode\";\nimport { Link } from \"@/components/Link\";\nimport { Separator } from \"@/components/Separator\";\nimport { Text } from \"@/components/Text\";\nimport type { CSSProperties, FC, Ref } from \"react\";\nimport { Children, isValidElement } from \"react\";\nimport type { Components, Options } from \"react-markdown\";\nimport ReactMarkdown from \"react-markdown\";\nimport styles from \"./Markdown.module.scss\";\nimport { extractTextFromFirstChild } from \"@/lib/react/remote\";\nimport type { AlphaColor, PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport remarkGfm from \"remark-gfm\";\nimport { getHeadingLevelWithOffset } from \"@/components/Markdown/lib/getHeadingLevelWithOffset\";\nimport type { CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport {\n SkeletonBlockText,\n SkeletonInlineContent,\n} from \"@/components/Markdown/components/SkeletonBlocks\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface MarkdownProps\n extends PropsWithClassName, Omit<Options, \"components\"> {\n /** The color schema of the markdown component. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** Shifts all heading levels by the given offset. @default 0 */\n headingOffset?: number;\n /** Allows overriding markdown element renderers from outside. */\n components?: Components;\n /** @internal */\n style?: CSSProperties;\n /** A ref to the elements root. */\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * @flr-generate all\n * @flr-ignore-props components\n */\nexport const Markdown: FC<MarkdownProps> = (props) => {\n const {\n children,\n color = \"default\",\n className,\n headingOffset = 0,\n components: customComponents,\n ref,\n allowElement,\n allowedElements,\n disallowedElements,\n rehypePlugins,\n remarkPlugins,\n remarkRehypeOptions,\n skipHtml,\n unwrapDisallowed,\n urlTransform,\n ...rest\n } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const defaultComponents: Components = {\n a: (props) => (\n <Link target=\"_blank\" color={color} href={props.href}>\n {props.children}\n </Link>\n ),\n p: (props) => (\n <Text elementType=\"p\" color={color}>\n {props.children}\n </Text>\n ),\n code: (props) => <InlineCode color={color}>{props.children}</InlineCode>,\n h1: (props) => (\n <Heading\n level={getHeadingLevelWithOffset(1, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h2: (props) => (\n <Heading\n level={getHeadingLevelWithOffset(2, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h3: (props) => (\n <Heading\n level={getHeadingLevelWithOffset(3, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h4: (props) => (\n <Heading\n level={getHeadingLevelWithOffset(4, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h5: (props) => (\n <Heading\n level={getHeadingLevelWithOffset(5, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h6: (props) => (\n <Heading\n level={getHeadingLevelWithOffset(6, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n hr: () => <Separator />,\n pre: (props) => {\n const preElementContent = Children.toArray(props.children)[0];\n\n return (\n <CodeBlock\n copyable={false}\n language={\n isValidElement<{ className?: string }>(preElementContent) &&\n preElementContent.props.className\n ? (preElementContent.props.className.replace(\n \"language-\",\n \"\",\n ) as CodeEditorLanguage)\n : undefined\n }\n code={String(\n isValidElement<{ children: string }>(preElementContent)\n ? preElementContent.props.children\n : preElementContent,\n ).trim()}\n />\n );\n },\n ul: ({ node: ignoredNode, ...props }) => (\n <SkeletonBlockText color={color}>\n <ul {...props} />\n </SkeletonBlockText>\n ),\n ol: ({ node: ignoredNode, ...props }) => (\n <SkeletonBlockText color={color}>\n <ol {...props} />\n </SkeletonBlockText>\n ),\n li: ({ node: ignoredNode, children, ...props }) => (\n <li {...props}>\n <SkeletonInlineContent>{children}</SkeletonInlineContent>\n </li>\n ),\n th: ({ node: ignoredNode, children, ...props }) => (\n <th {...props}>\n <SkeletonInlineContent>{children}</SkeletonInlineContent>\n </th>\n ),\n td: ({ node: ignoredNode, children, ...props }) => (\n <td {...props}>\n <SkeletonInlineContent>{children}</SkeletonInlineContent>\n </td>\n ),\n /* A text bar resets the mode for its content, so the image reads it\n from here. A skeleton issues no request. */\n img: ({ node: ignoredNode, ...props }) =>\n isSkeleton ? null : <img {...props} />,\n blockquote: (props) => (\n <SkeletonBlockText color={color}>\n <blockquote>{props.children}</blockquote>\n </SkeletonBlockText>\n ),\n };\n\n const textContent = extractTextFromFirstChild(children);\n const mergedComponents: Components = {\n ...defaultComponents,\n ...customComponents,\n };\n\n return (\n <div className={clsx(styles.markdown, className)} {...rest} ref={ref}>\n <ReactMarkdown\n allowElement={allowElement}\n allowedElements={allowedElements}\n disallowedElements={disallowedElements}\n rehypePlugins={rehypePlugins}\n remarkPlugins={remarkPlugins ?? [remarkGfm]}\n remarkRehypeOptions={remarkRehypeOptions}\n skipHtml={skipHtml}\n unwrapDisallowed={unwrapDisallowed}\n urlTransform={urlTransform}\n components={mergedComponents}\n >\n {textContent}\n </ReactMarkdown>\n </div>\n );\n};\n\nexport default Markdown;\n"],"mappings":"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"}
1
+ {"version":3,"file":"Markdown.mjs","names":["styles"],"sources":["../../../../../../../src/components/Markdown/Markdown.tsx"],"sourcesContent":["import { CodeBlock } from \"@/components/CodeBlock\";\nimport { Heading } from \"@/components/Heading\";\nimport { InlineCode } from \"@/components/InlineCode\";\nimport { Link } from \"@/components/Link\";\nimport { Separator } from \"@/components/Separator\";\nimport { Text } from \"@/components/Text\";\nimport type { CSSProperties, FC, Ref } from \"react\";\nimport { Children, isValidElement, useId, useMemo } from \"react\";\nimport type { Components, Options } from \"react-markdown\";\nimport ReactMarkdown from \"react-markdown\";\nimport styles from \"./Markdown.module.scss\";\nimport { extractTextFromFirstChild } from \"@/lib/react/remote\";\nimport type { AlphaColor, PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport remarkGfm from \"remark-gfm\";\nimport { getHeadingLevelWithOffset } from \"@/components/Markdown/lib/getHeadingLevelWithOffset\";\nimport { isExternalHref } from \"@/components/Markdown/lib/isExternalHref\";\nimport type { CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport {\n SkeletonBlockText,\n SkeletonInlineContent,\n} from \"@/components/Markdown/components/SkeletonBlocks\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface MarkdownProps\n extends PropsWithClassName, Omit<Options, \"components\"> {\n /** The color schema of the markdown component. @default \"default\" */\n color?: \"default\" | AlphaColor;\n /** Shifts all heading levels by the given offset. @default 0 */\n headingOffset?: number;\n /** Allows overriding markdown element renderers from outside. */\n components?: Components;\n /** @internal */\n style?: CSSProperties;\n /** A ref to the elements root. */\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * @flr-generate all\n * @flr-ignore-props components\n */\nexport const Markdown: FC<MarkdownProps> = (props) => {\n const {\n children,\n color = \"default\",\n className,\n headingOffset = 0,\n components: customComponents,\n ref,\n allowElement,\n allowedElements,\n disallowedElements,\n rehypePlugins,\n remarkPlugins,\n remarkRehypeOptions,\n skipHtml,\n unwrapDisallowed,\n urlTransform,\n ...rest\n } = props;\n\n const isSkeleton = useSkeletonMode();\n /* Footnote ids are per document, so two instances on one page would share\n them and a back link would jump into the other one. */\n const clobberPrefix = `user-content-${useId().replace(/[^\\w-]/g, \"\")}-`;\n\n /* react-markdown uses the renderers as element types: new ones on every\n render would remount the whole tree. */\n const defaultComponents = useMemo<Components>(\n () => ({\n /* GFM footnotes link through `id` (the back link's target), `aria-label`\n and `aria-describedby`. */\n a: (props) => (\n <Link\n id={props.id}\n aria-label={props[\"aria-label\"]}\n aria-describedby={props[\"aria-describedby\"]}\n target={isExternalHref(props.href) ? \"_blank\" : undefined}\n color={color}\n href={props.href}\n >\n {props.children}\n </Link>\n ),\n p: (props) => (\n <Text elementType=\"p\" color={color}>\n {props.children}\n </Text>\n ),\n code: (props) => <InlineCode color={color}>{props.children}</InlineCode>,\n h1: (props) => (\n <Heading\n id={props.id}\n level={getHeadingLevelWithOffset(1, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h2: (props) => (\n <Heading\n id={props.id}\n level={getHeadingLevelWithOffset(2, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h3: (props) => (\n <Heading\n id={props.id}\n level={getHeadingLevelWithOffset(3, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h4: (props) => (\n <Heading\n id={props.id}\n level={getHeadingLevelWithOffset(4, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h5: (props) => (\n <Heading\n id={props.id}\n level={getHeadingLevelWithOffset(5, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n h6: (props) => (\n <Heading\n id={props.id}\n level={getHeadingLevelWithOffset(6, headingOffset)}\n color={color}\n >\n {props.children}\n </Heading>\n ),\n hr: () => <Separator />,\n pre: (props) => {\n const preElementContent = Children.toArray(props.children)[0];\n\n return (\n <CodeBlock\n copyable={false}\n language={\n isValidElement<{ className?: string }>(preElementContent) &&\n preElementContent.props.className\n ? (preElementContent.props.className.replace(\n \"language-\",\n \"\",\n ) as CodeEditorLanguage)\n : undefined\n }\n code={String(\n isValidElement<{ children: string }>(preElementContent)\n ? preElementContent.props.children\n : preElementContent,\n ).trim()}\n />\n );\n },\n ul: ({ node: ignoredNode, ...props }) => (\n <SkeletonBlockText color={color}>\n <ul {...props} />\n </SkeletonBlockText>\n ),\n ol: ({ node: ignoredNode, ...props }) => (\n <SkeletonBlockText color={color}>\n <ol {...props} />\n </SkeletonBlockText>\n ),\n li: ({ node: ignoredNode, children, ...props }) => (\n <li {...props}>\n <SkeletonInlineContent>{children}</SkeletonInlineContent>\n </li>\n ),\n th: ({ node: ignoredNode, children, ...props }) => (\n <th {...props}>\n <SkeletonInlineContent>{children}</SkeletonInlineContent>\n </th>\n ),\n td: ({ node: ignoredNode, children, ...props }) => (\n <td {...props}>\n <SkeletonInlineContent>{children}</SkeletonInlineContent>\n </td>\n ),\n /* A text bar resets the mode for its content, so the image reads it\n from here. A skeleton issues no request. */\n img: ({ node: ignoredNode, ...props }) =>\n isSkeleton ? null : <img {...props} />,\n blockquote: (props) => (\n <SkeletonBlockText color={color}>\n <blockquote>{props.children}</blockquote>\n </SkeletonBlockText>\n ),\n }),\n [color, headingOffset, isSkeleton],\n );\n\n const textContent = extractTextFromFirstChild(children);\n const mergedComponents = useMemo<Components>(\n () => ({\n ...defaultComponents,\n ...customComponents,\n }),\n [defaultComponents, customComponents],\n );\n\n return (\n <div className={clsx(styles.markdown, className)} {...rest} ref={ref}>\n <ReactMarkdown\n allowElement={allowElement}\n allowedElements={allowedElements}\n disallowedElements={disallowedElements}\n rehypePlugins={rehypePlugins}\n remarkPlugins={remarkPlugins ?? [remarkGfm]}\n remarkRehypeOptions={{ clobberPrefix, ...remarkRehypeOptions }}\n skipHtml={skipHtml}\n unwrapDisallowed={unwrapDisallowed}\n urlTransform={urlTransform}\n components={mergedComponents}\n >\n {textContent}\n </ReactMarkdown>\n </div>\n );\n};\n\nexport default Markdown;\n"],"mappings":"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"}
@@ -18,7 +18,7 @@ var SkeletonBlockText = (props) => {
18
18
  const outerState = useContext(skeletonModeContext);
19
19
  return /* @__PURE__ */ jsx(SkeletonModeReset, { children: /* @__PURE__ */ jsx(Text, {
20
20
  ...rest,
21
- className: clsx(className, outerState.isEnabled && Markdown_module_default.skeletonBlock),
21
+ className: clsx(outerState.isEnabled && Markdown_module_default.skeletonBlock, className),
22
22
  children: /* @__PURE__ */ jsx(skeletonModeContext.Provider, {
23
23
  value: outerState,
24
24
  children
@@ -1 +1 @@
1
- {"version":3,"file":"SkeletonBlocks.mjs","names":["styles"],"sources":["../../../../../../../../src/components/Markdown/components/SkeletonBlocks.tsx"],"sourcesContent":["import {\n Children,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useContext,\n} from \"react\";\nimport clsx from \"clsx\";\nimport { Text, type TextProps } from \"@/components/Text\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\nimport {\n SkeletonModeReset,\n skeletonModeContext,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\nimport styles from \"../Markdown.module.scss\";\n\n/**\n * A text bar is an inline element and cannot wrap blocks. Markdown puts lists\n * and quotes into a `Text`, so in `SkeletonMode` this `Text` renders as real\n * text, and the blocks inside follow the skeleton rules on their own.\n */\nexport const SkeletonBlockText: FC<TextProps> = (props) => {\n const { children, className, ...rest } = props;\n\n const outerState = useContext(skeletonModeContext);\n\n return (\n <SkeletonModeReset>\n <Text\n {...rest}\n className={clsx(\n className,\n outerState.isEnabled && styles.skeletonBlock,\n )}\n >\n <skeletonModeContext.Provider value={outerState}>\n {children}\n </skeletonModeContext.Provider>\n </Text>\n </SkeletonModeReset>\n );\n};\n\nconst blockTagNames = new Set([\n \"blockquote\",\n \"div\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"hr\",\n \"ol\",\n \"p\",\n \"pre\",\n \"table\",\n \"ul\",\n]);\n\n/** Whether a rendered markdown element is a block — a nested list, a paragraph. */\nconst isBlock = (child: ReactNode): boolean => {\n if (!isValidElement<{ node?: { tagName?: string } }>(child)) {\n return false;\n }\n\n const tagName =\n typeof child.type === \"string\" ? child.type : child.props.node?.tagName;\n\n return tagName !== undefined && blockTagNames.has(tagName);\n};\n\nconst isBlank = (child: ReactNode) =>\n typeof child === \"string\" && child.trim() === \"\";\n\n/**\n * The content of a list item or a table cell: each run of inline content\n * becomes one text bar, blocks inside — a nested list, the paragraphs of a\n * loose list — keep their own skeleton rules. Outside an enabled `SkeletonMode`\n * it renders its children unchanged.\n */\nexport const SkeletonInlineContent: FC<PropsWithChildren> = (props) => {\n const { children } = props;\n\n const isSkeleton = useSkeletonMode();\n\n if (!isSkeleton) {\n return children;\n }\n\n const content: ReactNode[] = [];\n let run: ReactNode[] = [];\n\n /* The line breaks around a nested list stay outside the bar. */\n const endRun = () => {\n const start = run.findIndex((child) => !isBlank(child));\n const end = run.findLastIndex((child) => !isBlank(child)) + 1;\n\n if (start === -1) {\n content.push(...run);\n } else {\n content.push(\n ...run.slice(0, start),\n <SkeletonTextContent key={content.length} defaultWidth=\"8em\">\n {run.slice(start, end)}\n </SkeletonTextContent>,\n ...run.slice(end),\n );\n }\n\n run = [];\n };\n\n for (const child of Children.toArray(children)) {\n if (isBlock(child)) {\n endRun();\n content.push(child);\n } else {\n run.push(child);\n }\n }\n\n endRun();\n\n return content;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,IAAa,qBAAoC,UAAU;CACzD,MAAM,EAAE,UAAU,WAAW,GAAG,SAAS;CAEzC,MAAM,aAAa,WAAW,mBAAmB;CAEjD,OACE,oBAAC,mBAAD,EAAA,UACE,oBAAC,MAAD;EACE,GAAI;EACJ,WAAW,KACT,WACA,WAAW,aAAaA,wBAAO,aACjC;EAEA,UAAA,oBAAC,oBAAoB,UAArB;GAA8B,OAAO;GAClC;EAC2B,CAAA;CAC1B,CAAA,EACW,CAAA;AAEvB;AAEA,IAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,IAAM,WAAW,UAA8B;CAC7C,IAAI,CAAC,eAAgD,KAAK,GACxD,OAAO;CAGT,MAAM,UACJ,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,MAAM,MAAM,MAAM;CAElE,OAAO,YAAY,KAAA,KAAa,cAAc,IAAI,OAAO;AAC3D;AAEA,IAAM,WAAW,UACf,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM;;;;;;;AAQhD,IAAa,yBAAgD,UAAU;CACrE,MAAM,EAAE,aAAa;CAIrB,IAAI,CAFe,gBAEd,GACH,OAAO;CAGT,MAAM,UAAuB,CAAC;CAC9B,IAAI,MAAmB,CAAC;CAGxB,MAAM,eAAe;EACnB,MAAM,QAAQ,IAAI,WAAW,UAAU,CAAC,QAAQ,KAAK,CAAC;EACtD,MAAM,MAAM,IAAI,eAAe,UAAU,CAAC,QAAQ,KAAK,CAAC,IAAI;EAE5D,IAAI,UAAU,IACZ,QAAQ,KAAK,GAAG,GAAG;OAEnB,QAAQ,KACN,GAAG,IAAI,MAAM,GAAG,KAAK,GACrB,oBAAC,qBAAD;GAA0C,cAAa;GACpD,UAAA,IAAI,MAAM,OAAO,GAAG;EACF,GAFK,QAAQ,MAEb,GACrB,GAAG,IAAI,MAAM,GAAG,CAClB;EAGF,MAAM,CAAC;CACT;CAEA,KAAK,MAAM,SAAS,SAAS,QAAQ,QAAQ,GAC3C,IAAI,QAAQ,KAAK,GAAG;EAClB,OAAO;EACP,QAAQ,KAAK,KAAK;CACpB,OACE,IAAI,KAAK,KAAK;CAIlB,OAAO;CAEP,OAAO;AACT"}
1
+ {"version":3,"file":"SkeletonBlocks.mjs","names":["styles"],"sources":["../../../../../../../../src/components/Markdown/components/SkeletonBlocks.tsx"],"sourcesContent":["import {\n Children,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useContext,\n} from \"react\";\nimport clsx from \"clsx\";\nimport { Text, type TextProps } from \"@/components/Text\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\nimport {\n SkeletonModeReset,\n skeletonModeContext,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\nimport styles from \"../Markdown.module.scss\";\n\n/**\n * A text bar is an inline element and cannot wrap blocks. Markdown puts lists\n * and quotes into a `Text`, so in `SkeletonMode` this `Text` renders as real\n * text, and the blocks inside follow the skeleton rules on their own.\n */\nexport const SkeletonBlockText: FC<TextProps> = (props) => {\n const { children, className, ...rest } = props;\n\n const outerState = useContext(skeletonModeContext);\n\n return (\n <SkeletonModeReset>\n <Text\n {...rest}\n className={clsx(\n outerState.isEnabled && styles.skeletonBlock,\n className,\n )}\n >\n <skeletonModeContext.Provider value={outerState}>\n {children}\n </skeletonModeContext.Provider>\n </Text>\n </SkeletonModeReset>\n );\n};\n\nconst blockTagNames = new Set([\n \"blockquote\",\n \"div\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"hr\",\n \"ol\",\n \"p\",\n \"pre\",\n \"table\",\n \"ul\",\n]);\n\n/** Whether a rendered markdown element is a block — a nested list, a paragraph. */\nconst isBlock = (child: ReactNode): boolean => {\n if (!isValidElement<{ node?: { tagName?: string } }>(child)) {\n return false;\n }\n\n const tagName =\n typeof child.type === \"string\" ? child.type : child.props.node?.tagName;\n\n return tagName !== undefined && blockTagNames.has(tagName);\n};\n\nconst isBlank = (child: ReactNode) =>\n typeof child === \"string\" && child.trim() === \"\";\n\n/**\n * The content of a list item or a table cell: each run of inline content\n * becomes one text bar, blocks inside — a nested list, the paragraphs of a\n * loose list — keep their own skeleton rules. Outside an enabled `SkeletonMode`\n * it renders its children unchanged.\n */\nexport const SkeletonInlineContent: FC<PropsWithChildren> = (props) => {\n const { children } = props;\n\n const isSkeleton = useSkeletonMode();\n\n if (!isSkeleton) {\n return children;\n }\n\n const content: ReactNode[] = [];\n let run: ReactNode[] = [];\n\n /* The line breaks around a nested list stay outside the bar. */\n const endRun = () => {\n const start = run.findIndex((child) => !isBlank(child));\n const end = run.findLastIndex((child) => !isBlank(child)) + 1;\n\n if (start === -1) {\n content.push(...run);\n } else {\n content.push(\n ...run.slice(0, start),\n <SkeletonTextContent key={content.length} defaultWidth=\"8em\">\n {run.slice(start, end)}\n </SkeletonTextContent>,\n ...run.slice(end),\n );\n }\n\n run = [];\n };\n\n for (const child of Children.toArray(children)) {\n if (isBlock(child)) {\n endRun();\n content.push(child);\n } else {\n run.push(child);\n }\n }\n\n endRun();\n\n return content;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAuBA,IAAa,qBAAoC,UAAU;CACzD,MAAM,EAAE,UAAU,WAAW,GAAG,SAAS;CAEzC,MAAM,aAAa,WAAW,mBAAmB;CAEjD,OACE,oBAAC,mBAAD,EAAA,UACE,oBAAC,MAAD;EACE,GAAI;EACJ,WAAW,KACT,WAAW,aAAaA,wBAAO,eAC/B,SACF;EAEA,UAAA,oBAAC,oBAAoB,UAArB;GAA8B,OAAO;GAClC;EAC2B,CAAA;CAC1B,CAAA,EACW,CAAA;AAEvB;AAEA,IAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,IAAM,WAAW,UAA8B;CAC7C,IAAI,CAAC,eAAgD,KAAK,GACxD,OAAO;CAGT,MAAM,UACJ,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,MAAM,MAAM,MAAM;CAElE,OAAO,YAAY,KAAA,KAAa,cAAc,IAAI,OAAO;AAC3D;AAEA,IAAM,WAAW,UACf,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM;;;;;;;AAQhD,IAAa,yBAAgD,UAAU;CACrE,MAAM,EAAE,aAAa;CAIrB,IAAI,CAFe,gBAEd,GACH,OAAO;CAGT,MAAM,UAAuB,CAAC;CAC9B,IAAI,MAAmB,CAAC;CAGxB,MAAM,eAAe;EACnB,MAAM,QAAQ,IAAI,WAAW,UAAU,CAAC,QAAQ,KAAK,CAAC;EACtD,MAAM,MAAM,IAAI,eAAe,UAAU,CAAC,QAAQ,KAAK,CAAC,IAAI;EAE5D,IAAI,UAAU,IACZ,QAAQ,KAAK,GAAG,GAAG;OAEnB,QAAQ,KACN,GAAG,IAAI,MAAM,GAAG,KAAK,GACrB,oBAAC,qBAAD;GAA0C,cAAa;GACpD,UAAA,IAAI,MAAM,OAAO,GAAG;EACF,GAFK,QAAQ,MAEb,GACrB,GAAG,IAAI,MAAM,GAAG,CAClB;EAGF,MAAM,CAAC;CACT;CAEA,KAAK,MAAM,SAAS,SAAS,QAAQ,QAAQ,GAC3C,IAAI,QAAQ,KAAK,GAAG;EAClB,OAAO;EACP,QAAQ,KAAK,KAAK;CACpB,OACE,IAAI,KAAK,KAAK;CAIlB,OAAO;CAEP,OAAO;AACT"}
@@ -0,0 +1,8 @@
1
+ "use client"
2
+ /* */
3
+ //#region src/components/Markdown/lib/isExternalHref.ts
4
+ var isExternalHref = (href) => !!href && /^(https?:)?\/\//i.test(href);
5
+ //#endregion
6
+ export { isExternalHref };
7
+
8
+ //# sourceMappingURL=isExternalHref.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isExternalHref.mjs","names":[],"sources":["../../../../../../../../src/components/Markdown/lib/isExternalHref.ts"],"sourcesContent":["/* Only web URLs with a host leave the page. Relative paths, anchors, schemes\n like `mailto:` and `https:foo` (resolved against the current page) stay in\n the current tab. */\nexport const isExternalHref = (href: string | undefined) =>\n !!href && /^(https?:)?\\/\\//i.test(href);\n"],"mappings":";;;AAGA,IAAa,kBAAkB,SAC7B,CAAC,CAAC,QAAQ,mBAAmB,KAAK,IAAI"}
@@ -12,9 +12,36 @@ import { createElement } from "react";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
13
  import * as Aria from "react-aria-components";
14
14
  //#region src/components/MenuItem/MenuItem.tsx
15
+ var isMuted = (props) => !!(props.isPending || props.isSucceeded || props.isFailed || props["aria-disabled"]);
16
+ var renderElement = (domProps) => "href" in domProps ? /* @__PURE__ */ jsx("a", { ...domProps }) : /* @__PURE__ */ jsx("div", { ...domProps });
17
+ /**
18
+ * React Aria drops `aria-disabled` from the props it forwards to the DOM, so it
19
+ * is added to the rendered element. React Aria's `onClick` runs the menu's
20
+ * `onAction`, follows the link and toggles the selection. A mouse release that
21
+ * started outside the item toggles it on pointer up, Enter and Space toggle it
22
+ * on key down. All three handlers are replaced, and like React Aria they stop
23
+ * the event. A muted submenu trigger still opens its submenu on hover and
24
+ * ArrowRight, only Enter and Space are swallowed.
25
+ */
26
+ var renderMuted = (render = renderElement) => (domProps, renderProps) => render({
27
+ ...domProps,
28
+ "aria-disabled": true,
29
+ onClick: (e) => {
30
+ e.preventDefault();
31
+ e.stopPropagation();
32
+ },
33
+ onPointerUp: void 0,
34
+ onKeyDown: (e) => {
35
+ if (e.key === "Enter" || e.key === " ") {
36
+ e.preventDefault();
37
+ e.stopPropagation();
38
+ } else domProps.onKeyDown?.(e);
39
+ }
40
+ }, renderProps);
15
41
  var disablePendingProps = (props) => {
16
- if (props.isPending || props.isSucceeded || props.isFailed || props["aria-disabled"]) {
42
+ if (isMuted(props)) {
17
43
  props = { ...props };
44
+ props.onAction = void 0;
18
45
  props.onPress = void 0;
19
46
  props.onPressStart = void 0;
20
47
  props.onPressEnd = void 0;
@@ -25,8 +52,9 @@ var disablePendingProps = (props) => {
25
52
  };
26
53
  /** @flr-generate all */
27
54
  var MenuItem = flowComponent("MenuItem", (props) => {
55
+ const muted = isMuted(props);
28
56
  props = disablePendingProps(props);
29
- const { children, className, selectionVariant, isIndeterminate, id, ref, "aria-disabled": ariaDisabled, "aria-current": ariaCurrent, isPending, isSucceeded, isFailed, ...rest } = props;
57
+ const { children, className, selectionVariant, isIndeterminate, id, ref, "aria-disabled": ignoredAriaDisabled, "aria-current": ariaCurrent, render, isPending, isSucceeded, isFailed, ...rest } = props;
30
58
  /**
31
59
  * React Aria drops `aria-current` from the props it forwards to the DOM, so
32
60
  * the current state is exposed as a data attribute (`data-*` passes the
@@ -35,7 +63,7 @@ var MenuItem = flowComponent("MenuItem", (props) => {
35
63
  * "false".
36
64
  */
37
65
  const currentProps = ariaCurrent && ariaCurrent !== "false" ? { "data-current": true } : {};
38
- const rootClassName = clsx(MenuItem_module_default.menuItem, (ariaDisabled || isFailed || isSucceeded || isPending) && MenuItem_module_default.ariaDisabled, className);
66
+ const rootClassName = clsx(MenuItem_module_default.menuItem, className);
39
67
  useAriaAnnounceActionState(isPending ? "isPending" : isSucceeded ? "isSucceeded" : isFailed ? "isFailed" : "isIdle");
40
68
  const stateIconElement = isSucceeded ? /* @__PURE__ */ jsx(IconSucceeded, { color: "success" }) : isFailed ? /* @__PURE__ */ jsx(IconFailed, { color: "danger" }) : isPending ? /* @__PURE__ */ jsx(LoadingSpinner, {}) : void 0;
41
69
  const stateIcon = stateIconElement && /* @__PURE__ */ jsx("div", {
@@ -45,6 +73,7 @@ var MenuItem = flowComponent("MenuItem", (props) => {
45
73
  return /* @__PURE__ */ createElement(Aria.MenuItem, {
46
74
  ...rest,
47
75
  ...currentProps,
76
+ render: muted ? renderMuted(render) : render,
48
77
  key: id,
49
78
  id,
50
79
  className: rootClassName,