@mittwald/flow-react-components 1.6.0-next.3 → 1.6.0-next.30

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 (291) 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/_10.locale.mjs +3 -3
  8. package/dist/js/_virtual/_11.locale.mjs +3 -9
  9. package/dist/js/_virtual/_12.locale.mjs +9 -3
  10. package/dist/js/_virtual/_13.locale.mjs +3 -9
  11. package/dist/js/_virtual/_14.locale.mjs +5 -505
  12. package/dist/js/_virtual/_15.locale.mjs +505 -5
  13. package/dist/js/_virtual/_16.locale.mjs +9 -3
  14. package/dist/js/_virtual/_17.locale.mjs +3 -63
  15. package/dist/js/_virtual/_18.locale.mjs +77 -3
  16. package/dist/js/_virtual/_19.locale.mjs +3 -9
  17. package/dist/js/_virtual/_20.locale.mjs +5 -5
  18. package/dist/js/_virtual/_21.locale.mjs +5 -11
  19. package/dist/js/_virtual/_22.locale.mjs +15 -3
  20. package/dist/js/_virtual/_23.locale.mjs +3 -15
  21. package/dist/js/_virtual/_24.locale.mjs +15 -3
  22. package/dist/js/_virtual/_25.locale.mjs +3 -33
  23. package/dist/js/_virtual/_26.locale.mjs +29 -5
  24. package/dist/js/_virtual/_27.locale.mjs +9 -3
  25. package/dist/js/_virtual/_28.locale.mjs +3 -3
  26. package/dist/js/_virtual/_29.locale.mjs +3 -93
  27. package/dist/js/_virtual/_30.locale.mjs +93 -3
  28. package/dist/js/_virtual/_31.locale.mjs +3 -9
  29. package/dist/js/_virtual/_32.locale.mjs +9 -3
  30. package/dist/js/_virtual/_33.locale.mjs +3 -9
  31. package/dist/js/_virtual/_34.locale.mjs +5 -7
  32. package/dist/js/_virtual/_35.locale.mjs +7 -13
  33. package/dist/js/_virtual/_36.locale.mjs +23 -0
  34. package/dist/js/_virtual/_4.locale.mjs +3 -9
  35. package/dist/js/_virtual/_5.locale.mjs +9 -3
  36. package/dist/js/_virtual/_6.locale.mjs +3 -21
  37. package/dist/js/_virtual/_7.locale.mjs +21 -3
  38. package/dist/js/_virtual/_8.locale.mjs +3 -3
  39. package/dist/js/_virtual/_9.locale.mjs +3 -3
  40. package/dist/js/default.mjs +4 -3
  41. package/dist/js/flr-universal.mjs +2 -1
  42. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +3 -2
  43. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
  44. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +3 -2
  45. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
  46. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +3 -3
  47. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
  48. package/dist/js/packages/components/src/components/Activity/Activity.mjs +1 -1
  49. package/dist/js/packages/components/src/components/Activity/Activity.mjs.map +1 -1
  50. package/dist/js/packages/components/src/components/Alert/Alert.mjs +3 -2
  51. package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
  52. package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs +4 -0
  53. package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs.map +1 -1
  54. package/dist/js/packages/components/src/components/Badge/Badge.mjs +1 -1
  55. package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.mjs +1 -1
  56. package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -8
  57. package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
  58. package/dist/js/packages/components/src/components/CartesianChart/components/ChartTooltip/TooltipProgressBar.mjs +1 -1
  59. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +23 -5
  60. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
  61. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs +67 -0
  62. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs.map +1 -0
  63. package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +2 -2
  64. package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
  65. package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +4 -4
  66. package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
  67. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +41 -12
  68. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
  69. package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs +29 -16
  70. package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs.map +1 -1
  71. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +4 -3
  72. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
  73. package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +3 -2
  74. package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
  75. package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSelectAll/ContextMenuSelectAll.mjs +1 -1
  76. package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs +1 -1
  77. package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs +1 -1
  78. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +6 -2
  79. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
  80. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
  81. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
  82. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +2 -1
  83. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
  84. package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs +40 -8
  85. package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs.map +1 -1
  86. package/dist/js/packages/components/src/components/DonutChart/DonutChart.mjs.map +1 -1
  87. package/dist/js/packages/components/src/components/FileCard/components/DeleteButton/DeleteButton.mjs +1 -1
  88. package/dist/js/packages/components/src/components/Heading/Heading.mjs +2 -0
  89. package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
  90. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
  91. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +3 -2
  92. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
  93. package/dist/js/packages/components/src/components/ImageCropper/ImageCropper.mjs +1 -1
  94. package/dist/js/packages/components/src/components/Kbd/Kbd.mjs +1 -1
  95. package/dist/js/packages/components/src/components/Label/Label.mjs +1 -5
  96. package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
  97. package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +1 -1
  98. package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs +1 -1
  99. package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/LightBoxGallery.mjs +1 -1
  100. package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs +1 -1
  101. package/dist/js/packages/components/src/components/Link/components/LinkIcon/LinkIcon.mjs +1 -1
  102. package/dist/js/packages/components/src/components/List/components/EmptySearchResultView/EmptySearchResultView.mjs +1 -1
  103. package/dist/js/packages/components/src/components/List/components/EmptyView/EmptyView.mjs +1 -1
  104. package/dist/js/packages/components/src/components/List/components/Footer/Footer.mjs +1 -1
  105. package/dist/js/packages/components/src/components/List/components/Footer/components/PaginationInfos/PaginationInfos.mjs +1 -1
  106. package/dist/js/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.mjs +1 -1
  107. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +7 -3
  108. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
  109. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +1 -1
  110. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionCheckboxGroup.mjs +1 -1
  111. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +6 -4
  112. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
  113. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +1 -1
  114. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.mjs +1 -1
  115. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs +1 -1
  116. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs +101 -0
  117. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs.map +1 -0
  118. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs +13 -0
  119. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs.map +1 -0
  120. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +17 -10
  121. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
  122. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs +6 -2
  123. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs.map +1 -1
  124. package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs +1 -1
  125. package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs +1 -1
  126. package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs +1 -1
  127. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +3 -0
  128. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
  129. package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs +1 -1
  130. package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs.map +1 -1
  131. package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/AccordionButton.mjs +1 -1
  132. package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs +1 -1
  133. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +1 -2
  134. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
  135. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs +3 -0
  136. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs.map +1 -1
  137. package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs +5 -9
  138. package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs.map +1 -1
  139. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +8 -12
  140. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
  141. package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs +31 -0
  142. package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs.map +1 -0
  143. package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +1 -1
  144. package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs +21 -0
  145. package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs.map +1 -0
  146. package/dist/js/packages/components/src/components/List/model/List.mjs +1 -0
  147. package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
  148. package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +15 -2
  149. package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -1
  150. package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs +16 -0
  151. package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs.map +1 -0
  152. package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs +20 -7
  153. package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs.map +1 -1
  154. package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs +1 -1
  155. package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs.map +1 -1
  156. package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs +28 -1
  157. package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs.map +1 -1
  158. package/dist/js/packages/components/src/components/List/views/EmptyView/EmptyView.mjs +1 -1
  159. package/dist/js/packages/components/src/components/Markdown/Markdown.mjs +29 -11
  160. package/dist/js/packages/components/src/components/Markdown/Markdown.mjs.map +1 -1
  161. package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs +1 -1
  162. package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs.map +1 -1
  163. package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs +8 -0
  164. package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs.map +1 -0
  165. package/dist/js/packages/components/src/components/MarkdownEditor/components/ModeButton.mjs +1 -1
  166. package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs +1 -1
  167. package/dist/js/packages/components/src/components/MarkdownEditor/lib/useFileUpload.mjs +1 -1
  168. package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +32 -3
  169. package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
  170. package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs +1 -3
  171. package/dist/js/packages/components/src/components/Message/Message.mjs +1 -1
  172. package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -1
  173. package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
  174. package/dist/js/packages/components/src/components/MessageThread/components/MessageSeparator/MessageSeparator.mjs +1 -1
  175. package/dist/js/packages/components/src/components/Modal/Modal.mjs +3 -2
  176. package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
  177. package/dist/js/packages/components/src/components/Modal/components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.mjs +1 -1
  178. package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +1 -3
  179. package/dist/js/packages/components/src/components/Notification/Notification.mjs +1 -1
  180. package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +2 -3
  181. package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
  182. package/dist/js/packages/components/src/components/Option/Option.module.mjs +1 -3
  183. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +2 -1
  184. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
  185. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +2 -2
  186. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
  187. package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +1 -1
  188. package/dist/js/packages/components/src/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.mjs +1 -1
  189. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +1 -1
  190. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +1 -1
  191. package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs +1 -1
  192. package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +1 -1
  193. package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
  194. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +4 -2
  195. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
  196. package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
  197. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs +5 -4
  198. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs.map +1 -1
  199. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarValue.mjs +1 -1
  200. package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +2 -3
  201. package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
  202. package/dist/js/packages/components/src/components/Rating/Rating.mjs +12 -11
  203. package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
  204. package/dist/js/packages/components/src/components/Rating/components/RatingSegment/RatingSegment.mjs +1 -1
  205. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +3 -4
  206. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
  207. package/dist/js/packages/components/src/components/Section/Section.mjs +10 -6
  208. package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
  209. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +0 -4
  210. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
  211. package/dist/js/packages/components/src/components/Section/context.mjs +47 -0
  212. package/dist/js/packages/components/src/components/Section/context.mjs.map +1 -0
  213. package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +2 -3
  214. package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  215. package/dist/js/packages/components/src/components/Select/Select.mjs +2 -3
  216. package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
  217. package/dist/js/packages/components/src/components/SkeletonMode/SkeletonMode.mjs +1 -1
  218. package/dist/js/packages/components/src/components/SkeletonText/SkeletonText.mjs +4 -3
  219. package/dist/js/packages/components/src/components/SkeletonText/SkeletonText.mjs.map +1 -1
  220. package/dist/js/packages/components/src/components/Slider/Slider.mjs +48 -42
  221. package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
  222. package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +1 -1
  223. package/dist/js/packages/components/src/components/Table/Table.mjs +3 -0
  224. package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
  225. package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
  226. package/dist/js/packages/components/src/components/Tabs/Tabs.mjs +6 -8
  227. package/dist/js/packages/components/src/components/Tabs/Tabs.mjs.map +1 -1
  228. package/dist/js/packages/components/src/components/Tabs/Tabs.module.mjs.map +1 -1
  229. package/dist/js/packages/components/src/components/Tabs/components/FallbackTab/FallbackTab.mjs +1 -1
  230. package/dist/js/packages/components/src/components/Tabs/components/TabList/TabList.mjs +0 -3
  231. package/dist/js/packages/components/src/components/Tabs/components/TabList/TabList.mjs.map +1 -1
  232. package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +1 -1
  233. package/dist/js/packages/components/src/components/TextField/TextField.mjs +12 -9
  234. package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
  235. package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +4 -2
  236. package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
  237. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs +15 -2
  238. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs.map +1 -1
  239. package/dist/js/packages/components/src/components/Wrap/Wrap.mjs.map +1 -1
  240. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +2 -2
  241. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormRootError/FormRootError.mjs +1 -1
  242. package/dist/js/packages/components/src/views/DatePickerView.mjs +16 -0
  243. package/dist/js/packages/components/src/views/DatePickerView.mjs.map +1 -0
  244. package/dist/js/packages/components/src/views/LabelView.mjs +16 -0
  245. package/dist/js/packages/components/src/views/LabelView.mjs.map +1 -0
  246. package/dist/js/packages/components/src/views/TimeFieldView.mjs +16 -0
  247. package/dist/js/packages/components/src/views/TimeFieldView.mjs.map +1 -0
  248. package/dist/js/packages/components-base/src/index.mjs +4 -2
  249. package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs +1 -0
  250. package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
  251. package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs +4 -1
  252. package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs.map +1 -1
  253. package/dist/js/packages/components-base/src/list/filter/dateRange.mjs +37 -13
  254. package/dist/js/packages/components-base/src/list/filter/dateRange.mjs.map +1 -1
  255. package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs +55 -0
  256. package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
  257. package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs +27 -0
  258. package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
  259. package/dist/types/_bundled/flow-components-base/index.d.ts +3 -1
  260. package/dist/types/_bundled/flow-components-base/list/filter/ListFilter.d.ts +2 -0
  261. package/dist/types/_bundled/flow-components-base/list/filter/dateRange.d.ts +24 -1
  262. package/dist/types/_bundled/flow-components-base/list/filter/dateTimeRangeFields.d.ts +34 -0
  263. package/dist/types/_bundled/flow-components-base/list/filter/formatDateRange.d.ts +7 -0
  264. package/dist/types/components/CartesianChart/hooks/useTickLabelWidth.d.ts +1 -0
  265. package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
  266. package/dist/types/components/DonutChart/DonutChart.d.ts +1 -4
  267. package/dist/types/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.d.ts +8 -0
  268. package/dist/types/components/List/components/Items/components/Item/Item.d.ts +2 -0
  269. package/dist/types/components/List/components/Items/components/Item/hooks/useGridItemProps.d.ts +1 -0
  270. package/dist/types/components/List/components/ListSummary/ListSummary.d.ts +3 -2
  271. package/dist/types/components/List/components/Table/components/Row.d.ts +13 -0
  272. package/dist/types/components/List/hooks/useLatestOnAction.d.ts +7 -0
  273. package/dist/types/components/List/index.d.ts +2 -0
  274. package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +15 -8
  275. package/dist/types/components/List/model/filter/resolveDateRangeFilterValue.d.ts +11 -0
  276. package/dist/types/components/List/model/filter/types.d.ts +23 -1
  277. package/dist/types/components/List/model/item/ItemView.d.ts +34 -11
  278. package/dist/types/components/List/model/table/TableRow.d.ts +14 -0
  279. package/dist/types/components/List/model/table/types.d.ts +17 -1
  280. package/dist/types/components/List/typedList.d.ts +1 -0
  281. package/dist/types/components/Markdown/lib/isExternalHref.d.ts +1 -0
  282. package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -4
  283. package/dist/types/components/Rating/Rating.d.ts +5 -5
  284. package/dist/types/components/Section/context.d.ts +28 -0
  285. package/dist/types/components/Wrap/Wrap.d.ts +5 -0
  286. package/dist/types/index/flr-universal.d.ts +1 -1
  287. package/package.json +12 -12
  288. package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +0 -10
  289. package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +0 -1
  290. package/dist/types/lib/date/transformDateValueToDateTime.d.ts +0 -3
  291. package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { useLocalizedStringFormatter } from "../../../../TranslationProvider/useLocalizedStringFormatter.mjs";
4
- import __locale_default from "../../../../../../../../_virtual/_6.locale.mjs";
4
+ import __locale_default from "../../../../../../../../_virtual/_7.locale.mjs";
5
5
  import { useContext, useMemo } from "react";
6
6
  import { RangeCalendarStateContext } from "react-aria-components";
7
7
  import invariant from "invariant";
@@ -16,10 +16,12 @@ import { TypedChartLegend } from "./components/ChartLegend/ChartLegend.mjs";
16
16
  import { TypedChartTooltip } from "./components/ChartTooltip/types.mjs";
17
17
  import { TypedLine } from "./components/Line/Line.mjs";
18
18
  import clsx from "clsx";
19
- import { isValidElement, useId, useMemo } from "react";
19
+ import { useId, useMemo } from "react";
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
21
21
  import { ComposedChart, ResponsiveContainer } from "recharts";
22
22
  //#region src/components/CartesianChart/CartesianChart.tsx
23
+ var reactComponentTypes = [Symbol.for("react.memo"), Symbol.for("react.forward_ref")];
24
+ var isEmptyViewComponent = (value) => typeof value === "function" || typeof value === "object" && value !== null && "$$typeof" in value && reactComponentTypes.includes(value.$$typeof);
23
25
  /** @flr-generate all */
24
26
  var CartesianChart = (props) => {
25
27
  const { children, data, className, height, flexGrow, emptyView, layout = "horizontal", ...rest } = props;
@@ -27,12 +29,8 @@ var CartesianChart = (props) => {
27
29
  const { viewDimensions, ref: containerRef } = useChartClipRect();
28
30
  const showEmptyView = !!((!data || data.length === 0) && emptyView);
29
31
  const rootClassName = clsx(CartesianChart_module_default.cartesianChart, showEmptyView && CartesianChart_module_default.emptyView, className);
30
- if (!!emptyView && !isValidElement(emptyView)) warnDeprecation("CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.");
31
- const emptyElement = useMemo(() => {
32
- if (isValidElement(emptyView)) return emptyView;
33
- if (!emptyView) return;
34
- return null;
35
- }, [emptyView]);
32
+ const EmptyViewComponent = isEmptyViewComponent(emptyView) ? emptyView : void 0;
33
+ if (EmptyViewComponent) warnDeprecation("Passing a component to the 'emptyView' prop is deprecated and will be removed in a future release. Use 'emptyView={<Element />}' instead.");
36
34
  const chartId = useId().replaceAll(/[^\w-]/g, "");
37
35
  const contextValue = useMemo(() => ({
38
36
  layout,
@@ -74,7 +72,7 @@ var CartesianChart = (props) => {
74
72
  ...viewDimensions,
75
73
  children: /* @__PURE__ */ jsx(DivView, {
76
74
  className: CartesianChart_module_default.emptyViewContainer,
77
- children: emptyElement
75
+ children: EmptyViewComponent ? /* @__PURE__ */ jsx(EmptyViewComponent, { data }) : emptyView
78
76
  })
79
77
  })]
80
78
  })
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.mjs","names":["styles"],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useId,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\nimport type {\n CartesianChartLayout,\n ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { CartesianChartContextProvider } from \"@/components/CartesianChart/context\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\nimport { TypedBar } from \"@/components/CartesianChart/components/Bar\";\nimport { TypedXAxis } from \"@/components/CartesianChart/components/XAxis\";\nimport { TypedYAxis } from \"@/components/CartesianChart/components/YAxis\";\nimport { TypedChartGrid } from \"@/components/CartesianChart/components/ChartGrid\";\nimport { TypedChartLegend } from \"@/components/CartesianChart/components/ChartLegend\";\nimport { TypedChartTooltip } from \"@/components/CartesianChart/components/ChartTooltip\";\nimport { TypedLine } from \"@/components/CartesianChart/components/Line\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps<TData = ChartDataValue>\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n /** The data points rendered by the chart. */\n data?: TData[];\n\n /** The height of the chart. */\n height?: string;\n\n /**\n * The orientation of the axes and graphical items. `\"horizontal\"` puts the\n * category axis on the x-axis — bars grow upwards. `\"vertical\"` puts it on\n * the y-axis — bars grow to the side. `XAxis` and `YAxis` follow the layout\n * on their own; only the `dataKey` moves to whichever axis is the categorical\n * one.\n *\n * @default \"horizontal\"\n */\n layout?: CartesianChartLayout;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView,\n layout = \"horizontal\",\n ...rest\n } = props;\n const warnDeprecation = useWarnDeprecation();\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n showEmptyView && styles.emptyView,\n className,\n );\n const usesDeprecatedEmptyView = !!emptyView && !isValidElement(emptyView);\n\n if (usesDeprecatedEmptyView) {\n warnDeprecation(\n \"CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.\",\n );\n }\n\n const emptyElement = useMemo(() => {\n if (isValidElement(emptyView)) {\n return emptyView;\n }\n\n if (!emptyView) {\n return;\n }\n\n return null;\n }, [emptyView]);\n\n const chartId = useId().replaceAll(/[^\\w-]/g, \"\");\n const contextValue = useMemo(\n () => ({ layout, stackIdPrefix: `${chartId}-` }),\n [layout, chartId],\n );\n\n const isSkeleton = useSkeletonMode();\n\n /* No recharts and no svg: one surface in the size the chart would take. */\n if (isSkeleton) {\n return (\n <div\n className={styles.skeleton}\n style={{\n height,\n aspectRatio: height ? undefined : 3,\n flex: flexGrow ? 1 : undefined,\n }}\n aria-hidden\n inert\n />\n );\n }\n\n return (\n <CartesianChartContextProvider value={contextValue}>\n <Wrap if={height}>\n <div style={{ height, flex: flexGrow ? 1 : undefined }}>\n <ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n width={height ? undefined : \"100%\"}\n aspect={height ? undefined : 3}\n ref={containerRef}\n >\n <ComposedChart\n data={data}\n className={rootClassName}\n layout={layout}\n {...rest}\n >\n {children}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <DivView className={styles.emptyViewContainer}>\n {emptyElement}\n </DivView>\n </foreignObject>\n )}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n </Wrap>\n </CartesianChartContextProvider>\n );\n};\n\nexport const typedCartesianChart = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData extends ChartDataValue<any> = ChartDataValue<any>,\n XAxisDataKey extends DataKeyProp<TData> = DataKeyProp<TData>,\n>() => ({\n Chart: CartesianChart as ComponentType<CartesianChartProps<TData>>,\n Area: TypedArea<TData>(),\n Bar: TypedBar<TData>(),\n XAxis: TypedXAxis<TData, XAxisDataKey>(),\n YAxis: TypedYAxis<TData>(),\n Grid: TypedChartGrid(),\n Legend: TypedChartLegend(),\n Tooltip: TypedChartTooltip<TData, XAxisDataKey>(),\n Line: TypedLine<TData>(),\n});\n\nexport default CartesianChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAa,kBAA2C,UAAU;CAChE,MAAM,EACJ,UACA,MACA,WACA,QACA,UACA,WACA,SAAS,cACT,GAAG,SACD;CACJ,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,EAAE,gBAAgB,KAAK,iBAAiB,iBAAiB;C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L;CACN,OAAO;CACP,MAAM,UAAiB;CACvB,KAAK,SAAgB;CACrB,OAAO,WAAgC;CACvC,OAAO,WAAkB;CACzB,MAAM,eAAe;CACrB,QAAQ,iBAAiB;CACzB,SAAS,kBAAuC;CAChD,MAAM,UAAiB;AACzB"}
1
+ {"version":3,"file":"CartesianChart.mjs","names":["styles"],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FC,\n type PropsWithChildren,\n type ReactNode,\n useId,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\nimport type {\n CartesianChartLayout,\n ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { CartesianChartContextProvider } from \"@/components/CartesianChart/context\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\nimport { TypedBar } from \"@/components/CartesianChart/components/Bar\";\nimport { TypedXAxis } from \"@/components/CartesianChart/components/XAxis\";\nimport { TypedYAxis } from \"@/components/CartesianChart/components/YAxis\";\nimport { TypedChartGrid } from \"@/components/CartesianChart/components/ChartGrid\";\nimport { TypedChartLegend } from \"@/components/CartesianChart/components/ChartLegend\";\nimport { TypedChartTooltip } from \"@/components/CartesianChart/components/ChartTooltip\";\nimport { TypedLine } from \"@/components/CartesianChart/components/Line\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps<TData = ChartDataValue>\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n /** The data points rendered by the chart. */\n data?: TData[];\n\n /** The height of the chart. */\n height?: string;\n\n /**\n * The orientation of the axes and graphical items. `\"horizontal\"` puts the\n * category axis on the x-axis — bars grow upwards. `\"vertical\"` puts it on\n * the y-axis — bars grow to the side. `XAxis` and `YAxis` follow the layout\n * on their own; only the `dataKey` moves to whichever axis is the categorical\n * one.\n *\n * @default \"horizontal\"\n */\n layout?: CartesianChartLayout;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\nconst reactComponentTypes = [\n Symbol.for(\"react.memo\"),\n Symbol.for(\"react.forward_ref\"),\n];\n\nconst isEmptyViewComponent = (\n value: unknown,\n): value is ComponentType<CartesianChartEmptyViewProps> =>\n typeof value === \"function\" ||\n (typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n reactComponentTypes.includes(value.$$typeof as symbol));\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView,\n layout = \"horizontal\",\n ...rest\n } = props;\n const warnDeprecation = useWarnDeprecation();\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n showEmptyView && styles.emptyView,\n className,\n );\n const EmptyViewComponent = isEmptyViewComponent(emptyView)\n ? emptyView\n : undefined;\n\n if (EmptyViewComponent) {\n warnDeprecation(\n \"Passing a component to the 'emptyView' prop is deprecated and will be removed in a future release. Use 'emptyView={<Element />}' instead.\",\n );\n }\n\n const chartId = useId().replaceAll(/[^\\w-]/g, \"\");\n const contextValue = useMemo(\n () => ({ layout, stackIdPrefix: `${chartId}-` }),\n [layout, chartId],\n );\n\n const isSkeleton = useSkeletonMode();\n\n /* No recharts and no svg: one surface in the size the chart would take. */\n if (isSkeleton) {\n return (\n <div\n className={styles.skeleton}\n style={{\n height,\n aspectRatio: height ? undefined : 3,\n flex: flexGrow ? 1 : undefined,\n }}\n aria-hidden\n inert\n />\n );\n }\n\n return (\n <CartesianChartContextProvider value={contextValue}>\n <Wrap if={height}>\n <div style={{ height, flex: flexGrow ? 1 : undefined }}>\n <ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n width={height ? undefined : \"100%\"}\n aspect={height ? undefined : 3}\n ref={containerRef}\n >\n <ComposedChart\n data={data}\n className={rootClassName}\n layout={layout}\n {...rest}\n >\n {children}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <DivView className={styles.emptyViewContainer}>\n {EmptyViewComponent ? (\n <EmptyViewComponent data={data} />\n ) : (\n emptyView\n )}\n </DivView>\n </foreignObject>\n )}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n </Wrap>\n </CartesianChartContextProvider>\n );\n};\n\nexport const typedCartesianChart = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData extends ChartDataValue<any> = ChartDataValue<any>,\n XAxisDataKey extends DataKeyProp<TData> = DataKeyProp<TData>,\n>() => ({\n Chart: CartesianChart as ComponentType<CartesianChartProps<TData>>,\n Area: TypedArea<TData>(),\n Bar: TypedBar<TData>(),\n XAxis: TypedXAxis<TData, XAxisDataKey>(),\n YAxis: TypedYAxis<TData>(),\n Grid: TypedChartGrid(),\n Legend: TypedChartLegend(),\n Tooltip: TypedChartTooltip<TData, XAxisDataKey>(),\n Line: TypedLine<TData>(),\n});\n\nexport default CartesianChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuEA,IAAM,sBAAsB,CAC1B,OAAO,IAAI,YAAY,GACvB,OAAO,IAAI,mBAAmB,CAChC;AAEA,IAAM,wBACJ,UAEA,OAAO,UAAU,cAChB,OAAO,UAAU,YAChB,UAAU,QACV,cAAc,SACd,oBAAo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,oBAAD,EAA0B,KAAO,CAAA,IAEjC;OAEK,CAAA;MACI,CAAA,CAEJ;;IACI,CAAA;GAClB,CAAA;EACD,CAAA;CACuB,CAAA;AAEnC;AAEA,IAAa,6BAIL;CACN,OAAO;CACP,MAAM,UAAiB;CACvB,KAAK,SAAgB;CACrB,OAAO,WAAgC;CACvC,OAAO,WAAkB;CACzB,MAAM,eAAe;CACrB,QAAQ,iBAAiB;CACzB,SAAS,kBAAuC;CAChD,MAAM,UAAiB;AACzB"}
@@ -3,7 +3,7 @@
3
3
  import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLocalizedStringFormatter.mjs";
4
4
  import { ProgressBar } from "../../../ProgressBar/ProgressBar.mjs";
5
5
  import { Label } from "../../../Label/Label.mjs";
6
- import __locale_default from "../../../../../../../_virtual/_9.locale.mjs";
6
+ import __locale_default from "../../../../../../../_virtual/_10.locale.mjs";
7
7
  import ChartTooltip_module_default from "./ChartTooltip.module.mjs";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import { usePromise } from "@mittwald/react-use-promise";
@@ -2,6 +2,7 @@
2
2
  /* */
3
3
  import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.mjs";
4
4
  import { useCartesianChartContext } from "../../context.mjs";
5
+ import { useTickLabelWidth } from "../../hooks/useTickLabelWidth.mjs";
5
6
  import { TypedYAxis } from "./types.mjs";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import * as Recharts from "recharts";
@@ -20,17 +21,34 @@ var YAxis = (props) => {
20
21
  const { domain, type = "auto", width, ...rest } = props;
21
22
  const tokens = useDesignTokens();
22
23
  const { layout } = useCartesianChartContext();
23
- const isCategoryAxis = type === "category" || type === "auto" && layout === "vertical";
24
+ const tickLabels = useTickLabelWidth();
25
+ const isAutoWidth = (width ?? (type === "category" || type === "auto" && layout === "vertical" ? "auto" : void 0)) === "auto";
26
+ const tickMargin = parseInt(tokens.axis.spacing.value);
27
+ const tickSize = parseInt(tokens.axis["tick-size"].value);
28
+ const tickFill = tokens.axis["color"].value;
29
+ const autoWidth = tickLabels.width === void 0 ? "auto" : tickLabels.width + tickSize + tickMargin;
30
+ const measuredTick = (tickProps) => {
31
+ const { payload, index, tickFormatter } = tickProps;
32
+ const value = `${tickFormatter ? tickFormatter(payload.value, index) : payload.value}${rest.unit ?? ""}`;
33
+ return /* @__PURE__ */ jsx(Recharts.Text, {
34
+ ...tickProps,
35
+ ref: tickLabels.labelRef,
36
+ className: "recharts-cartesian-axis-tick-value",
37
+ fill: tickFill,
38
+ width: void 0,
39
+ children: value
40
+ });
41
+ };
24
42
  return /* @__PURE__ */ jsx(Recharts.YAxis, {
25
43
  ...rest,
26
44
  allowDataOverflow: true,
27
45
  domain,
28
46
  type,
29
- width: width ?? (isCategoryAxis ? "auto" : void 0),
47
+ width: isAutoWidth ? autoWidth : width,
30
48
  fontSize: tokens.axis["font-size"].value,
31
- tick: { fill: tokens.axis["color"].value },
32
- tickMargin: parseInt(tokens.axis.spacing.value),
33
- tickSize: parseInt(tokens.axis["tick-size"].value)
49
+ tick: isAutoWidth ? measuredTick : { fill: tickFill },
50
+ tickMargin,
51
+ tickSize
34
52
  });
35
53
  };
36
54
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n /**\n * The width of the axis in pixels. `\"auto\"` sizes the axis to its widest tick\n * label. Defaults to `\"auto\"` for a category axis (e.g. with `layout` set to\n * `\"vertical\"`) and to `60` otherwise. Pin a number to align the plot areas\n * of synchronized charts.\n */\n width?: number | \"auto\";\n};\n\n/**\n * `tickFormatter` is deliberately not part of the remote surface. A function\n * property crosses the boundary as a thread proxy whose call returns a Promise,\n * and recharts concatenates the formatter's result straight into the tick label\n * — so remotely every tick rendered `[object Promise]`. Dropping it from the\n * remote surface leaves the raw value there; the prop keeps working locally.\n *\n * @flr-generate all\n * @flr-ignore-props tickFormatter\n */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", width, ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n\n const isCategoryAxis =\n type === \"category\" || (type === \"auto\" && layout === \"vertical\");\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n width={width ?? (isCategoryAxis ? \"auto\" : undefined)}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={{\n fill: tokens.axis[\"color\"].value,\n }}\n tickMargin={parseInt(tokens.axis.spacing.value)}\n tickSize={parseInt(tokens.axis[\"tick-size\"].value)}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,OAAO,GAAG,SAAS;CAElD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAE5C,MAAM,iBACJ,SAAS,cAAe,SAAS,UAAU,WAAW;CAExD,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,OAAO,UAAU,iBAAiB,SAAS,KAAA;EAC3C,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,EACJ,MAAM,OAAO,KAAK,QAAQ,CAAC,MAC7B;EACA,YAAY,SAAS,OAAO,KAAK,QAAQ,KAAK;EAC9C,UAAU,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CAClD,CAAA;AAEL"}
1
+ {"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\nimport { useTickLabelWidth } from \"@/components/CartesianChart/hooks/useTickLabelWidth\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n /**\n * The width of the axis in pixels. `\"auto\"` sizes the axis to its widest tick\n * label. Defaults to `\"auto\"` for a category axis (e.g. with `layout` set to\n * `\"vertical\"`) and to `60` otherwise. Pin a number to align the plot areas\n * of synchronized charts.\n */\n width?: number | \"auto\";\n};\n\n/**\n * `tickFormatter` is deliberately not part of the remote surface. A function\n * property crosses the boundary as a thread proxy whose call returns a Promise,\n * and recharts concatenates the formatter's result straight into the tick label\n * — so remotely every tick rendered `[object Promise]`. Dropping it from the\n * remote surface leaves the raw value there; the prop keeps working locally.\n *\n * @flr-generate all\n * @flr-ignore-props tickFormatter\n */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", width, ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n const tickLabels = useTickLabelWidth();\n\n const isCategoryAxis =\n type === \"category\" || (type === \"auto\" && layout === \"vertical\");\n const isAutoWidth =\n (width ?? (isCategoryAxis ? \"auto\" : undefined)) === \"auto\";\n\n const tickMargin = parseInt(tokens.axis.spacing.value);\n const tickSize = parseInt(tokens.axis[\"tick-size\"].value);\n const tickFill = tokens.axis[\"color\"].value;\n\n /*\n * Recharts' own `\"auto\"` stays in charge until the labels are measured, so\n * the first frame is close already.\n */\n const autoWidth =\n tickLabels.width === undefined\n ? \"auto\"\n : tickLabels.width + tickSize + tickMargin;\n\n /*\n * Recharts' default tick label, plus the measuring ref. Recharts passes a\n * numeric axis width on to the label, which wraps once the text is wider —\n * so the label drops it, as it does with `\"auto\"`.\n */\n const measuredTick = (tickProps: Recharts.YAxisTickContentProps) => {\n const { payload, index, tickFormatter } = tickProps;\n const value = `${tickFormatter ? tickFormatter(payload.value, index) : payload.value}${rest.unit ?? \"\"}`;\n return (\n <Recharts.Text\n {...tickProps}\n ref={tickLabels.labelRef}\n className=\"recharts-cartesian-axis-tick-value\"\n fill={tickFill}\n width={undefined}\n >\n {value}\n </Recharts.Text>\n );\n };\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n width={isAutoWidth ? autoWidth : width}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={isAutoWidth ? measuredTick : { fill: tickFill }}\n tickMargin={tickMargin}\n tickSize={tickSize}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,OAAO,GAAG,SAAS;CAElD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAC5C,MAAM,aAAa,kBAAkB;CAIrC,MAAM,eACH,UAFD,SAAS,cAAe,SAAS,UAAU,WAAW,aAE1B,SAAS,KAAA,QAAgB;CAEvD,MAAM,aAAa,SAAS,OAAO,KAAK,QAAQ,KAAK;CACrD,MAAM,WAAW,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CACxD,MAAM,WAAW,OAAO,KAAK,QAAQ,CAAC;CAMtC,MAAM,YACJ,WAAW,UAAU,KAAA,IACjB,SACA,WAAW,QAAQ,WAAW;CAOpC,MAAM,gBAAgB,cAA8C;EAClE,MAAM,EAAE,SAAS,OAAO,kBAAkB;EAC1C,MAAM,QAAQ,GAAG,gBAAgB,cAAc,QAAQ,OAAO,KAAK,IAAI,QAAQ,QAAQ,KAAK,QAAQ;EACpG,OACE,oBAAC,SAAS,MAAV;GACE,GAAI;GACJ,KAAK,WAAW;GAChB,WAAU;GACV,MAAM;GACN,OAAO,KAAA;GAEN,UAAA;EACY,CAAA;CAEnB;CAEA,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,OAAO,cAAc,YAAY;EACjC,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,cAAc,eAAe,EAAE,MAAM,SAAS;EACxC;EACF;CACX,CAAA;AAEL"}
@@ -0,0 +1,67 @@
1
+ "use client"
2
+ /* */
3
+ import { createFrameResizeObserver } from "../../../lib/dom/createFrameResizeObserver.mjs";
4
+ import { useCallback, useEffect, useRef, useState } from "react";
5
+ //#region src/components/CartesianChart/hooks/useTickLabelWidth.ts
6
+ var measureLabel = (label) => {
7
+ try {
8
+ return label.getBBox().width;
9
+ } catch {
10
+ return 0;
11
+ }
12
+ };
13
+ /**
14
+ * Measures the widest tick label of an axis, for an axis that sizes itself to
15
+ * its labels.
16
+ *
17
+ * Replaces recharts' own `width="auto"` measurement, which undersizes the axis
18
+ * in two ways. It reads `getBoundingClientRect()` — screen pixels, which a CSS
19
+ * `zoom` or `transform` on an ancestor scales — and uses the result as SVG user
20
+ * units. And it measures once, so a web font that replaces its fallback after
21
+ * mount widens the labels past the axis. `getBBox()` measures in user units,
22
+ * and a `ResizeObserver` — which tracks an SVG element's bbox — measures again
23
+ * whenever a label changes size: a font swap, a new text, a hidden chart that
24
+ * is shown.
25
+ *
26
+ * Attach the returned ref to every tick label. The width is `undefined` until a
27
+ * label has been measured.
28
+ *
29
+ * @internal
30
+ */
31
+ var useTickLabelWidth = () => {
32
+ const labels = useRef(/* @__PURE__ */ new Set());
33
+ const observer = useRef(null);
34
+ const [width, setWidth] = useState();
35
+ const measure = useCallback(() => {
36
+ const widest = Math.max(0, ...[...labels.current].map(measureLabel));
37
+ setWidth(widest > 0 ? Math.ceil(widest) : void 0);
38
+ }, []);
39
+ useEffect(() => {
40
+ if (typeof ResizeObserver === "undefined") return;
41
+ const frameObserver = createFrameResizeObserver(measure);
42
+ frameObserver.observe(labels.current);
43
+ observer.current = frameObserver;
44
+ return () => {
45
+ frameObserver.disconnect();
46
+ observer.current = null;
47
+ };
48
+ }, [measure]);
49
+ return {
50
+ width,
51
+ labelRef: useCallback((label) => {
52
+ if (!label) return;
53
+ labels.current.add(label);
54
+ observer.current?.observe(labels.current);
55
+ measure();
56
+ return () => {
57
+ labels.current.delete(label);
58
+ observer.current?.observe(labels.current);
59
+ measure();
60
+ };
61
+ }, [measure])
62
+ };
63
+ };
64
+ //#endregion
65
+ export { useTickLabelWidth };
66
+
67
+ //# sourceMappingURL=useTickLabelWidth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTickLabelWidth.mjs","names":[],"sources":["../../../../../../../../src/components/CartesianChart/hooks/useTickLabelWidth.ts"],"sourcesContent":["import {\n type RefCallback,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n createFrameResizeObserver,\n type FrameResizeObserver,\n} from \"@/lib/dom/createFrameResizeObserver\";\n\nconst measureLabel = (label: SVGTextElement): number => {\n try {\n return label.getBBox().width;\n } catch {\n // Firefox throws for an element that is not rendered, and jsdom has no\n // `getBBox` at all.\n return 0;\n }\n};\n\n/**\n * Measures the widest tick label of an axis, for an axis that sizes itself to\n * its labels.\n *\n * Replaces recharts' own `width=\"auto\"` measurement, which undersizes the axis\n * in two ways. It reads `getBoundingClientRect()` — screen pixels, which a CSS\n * `zoom` or `transform` on an ancestor scales — and uses the result as SVG user\n * units. And it measures once, so a web font that replaces its fallback after\n * mount widens the labels past the axis. `getBBox()` measures in user units,\n * and a `ResizeObserver` — which tracks an SVG element's bbox — measures again\n * whenever a label changes size: a font swap, a new text, a hidden chart that\n * is shown.\n *\n * Attach the returned ref to every tick label. The width is `undefined` until a\n * label has been measured.\n *\n * @internal\n */\nexport const useTickLabelWidth = () => {\n const labels = useRef(new Set<SVGTextElement>());\n const observer = useRef<FrameResizeObserver>(null);\n const [width, setWidth] = useState<number>();\n\n const measure = useCallback(() => {\n const widest = Math.max(0, ...[...labels.current].map(measureLabel));\n setWidth(widest > 0 ? Math.ceil(widest) : undefined);\n }, []);\n\n useEffect(() => {\n // jsdom has no `ResizeObserver`.\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const frameObserver = createFrameResizeObserver(measure);\n frameObserver.observe(labels.current);\n observer.current = frameObserver;\n return () => {\n frameObserver.disconnect();\n observer.current = null;\n };\n }, [measure]);\n\n const labelRef: RefCallback<SVGTextElement> = useCallback(\n (label) => {\n if (!label) {\n return;\n }\n labels.current.add(label);\n observer.current?.observe(labels.current);\n measure();\n return () => {\n labels.current.delete(label);\n observer.current?.observe(labels.current);\n measure();\n };\n },\n [measure],\n );\n\n return { width, labelRef };\n};\n"],"mappings":";;;;;AAYA,IAAM,gBAAgB,UAAkC;CACtD,IAAI;EACF,OAAO,MAAM,QAAQ,CAAC,CAAC;CACzB,QAAQ;EAGN,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,0BAA0B;CACrC,MAAM,SAAS,uBAAO,IAAI,IAAoB,CAAC;CAC/C,MAAM,WAAW,OAA4B,IAAI;CACjD,MAAM,CAAC,OAAO,YAAY,SAAiB;CAE3C,MAAM,UAAU,kBAAkB;EAChC,MAAM,SAAS,KAAK,IAAI,GAAG,GAAG,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,IAAI,YAAY,CAAC;EACnE,SAAS,SAAS,IAAI,KAAK,KAAK,MAAM,IAAI,KAAA,CAAS;CACrD,GAAG,CAAC,CAAC;CAEL,gBAAgB;EAEd,IAAI,OAAO,mBAAmB,aAC5B;EAEF,MAAM,gBAAgB,0BAA0B,OAAO;EACvD,cAAc,QAAQ,OAAO,OAAO;EACpC,SAAS,UAAU;EACnB,aAAa;GACX,cAAc,WAAW;GACzB,SAAS,UAAU;EACrB;CACF,GAAG,CAAC,OAAO,CAAC;CAmBZ,OAAO;EAAE;EAAO,UAjB8B,aAC3C,UAAU;GACT,IAAI,CAAC,OACH;GAEF,OAAO,QAAQ,IAAI,KAAK;GACxB,SAAS,SAAS,QAAQ,OAAO,OAAO;GACxC,QAAQ;GACR,aAAa;IACX,OAAO,QAAQ,OAAO,KAAK;IAC3B,SAAS,SAAS,QAAQ,OAAO,OAAO;IACxC,QAAQ;GACV;EACF,GACA,CAAC,OAAO,CAGM;CAAS;AAC3B"}
@@ -33,12 +33,12 @@ var Checkbox = flowComponent("Checkbox", (props) => {
33
33
  };
34
34
  return /* @__PURE__ */ jsxs("div", {
35
35
  ...skeletonProps,
36
- className: clsx(Checkbox_module_default.checkbox, className, wrapperProps.className),
36
+ className: clsx(wrapperProps.className, Checkbox_module_default.checkbox, className),
37
37
  children: [/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children: /* @__PURE__ */ jsx(Aria.Checkbox, {
38
38
  ...rest,
39
39
  "aria-describedby": controlProps["aria-describedby"],
40
40
  inputRef,
41
- className: clsx(inputClassName, Checkbox_module_default.input),
41
+ className: clsx(Checkbox_module_default.input, inputClassName),
42
42
  children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs(PropsContextProvider, {
43
43
  props: fieldPropsContext,
44
44
  children: [renderIcon(isSelected, isIndeterminate), /* @__PURE__ */ jsx(SkeletonRawText, { children })]
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.mjs","names":["styles"],"sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Checkbox.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"react-aria\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CheckboxProps\n extends\n PropsWithChildren<\n Omit<Aria.CheckboxProps, \"children\" | \"ref\" | \"inputRef\">\n >,\n FlowComponentProps<HTMLInputElement> {\n /** The class name of the underlying input element. */\n inputClassName?: string;\n}\n\n/** @flr-generate all */\nexport const Checkbox = flowComponent(\"Checkbox\", (props) => {\n const { children, className, ref, inputClassName, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"Checkbox\");\n\n const inputRef = useObjectRef(ref);\n const isSkeleton = useSkeletonMode();\n\n const checkedIcon = <IconCheckboxChecked className={styles.icon} />;\n const indeterminateIcon = (\n <IconCheckboxIndeterminate className={styles.icon} />\n );\n const emptyIcon = <IconCheckboxEmpty className={styles.icon} />;\n\n const renderIcon = (isSelected: boolean, isIndeterminate: boolean) => {\n const icon = isSelected\n ? checkedIcon\n : isIndeterminate\n ? indeterminateIcon\n : emptyIcon;\n\n const skeletonIcon = (\n <span className={styles.skeletonIcon}>\n <SkeletonModeReset>{icon}</SkeletonModeReset>\n </span>\n );\n\n return isSkeleton ? skeletonIcon : icon;\n };\n\n return (\n <div\n {...skeletonProps}\n className={clsx(styles.checkbox, className, wrapperProps.className)}\n >\n <FieldErrorCaptureContext>\n <Aria.Checkbox\n {...rest}\n aria-describedby={controlProps[\"aria-describedby\"]}\n inputRef={inputRef}\n className={clsx(inputClassName, styles.input)}\n >\n {({ isSelected, isIndeterminate }) => (\n <PropsContextProvider props={fieldPropsContext}>\n {renderIcon(isSelected, isIndeterminate)}\n <SkeletonRawText>{children}</SkeletonRawText>\n </PropsContextProvider>\n )}\n </Aria.Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EAAE,UAAU,WAAW,KAAK,gBAAgB,GAAG,SAAS;CAE9D,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,cACA,kBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,WAAW,aAAa,GAAG;CACjC,MAAM,aAAa,gBAAgB;CAEnC,MAAM,cAAc,oBAAC,qBAAD,EAAqB,WAAWA,wBAAO,KAAO,CAAA;CAClE,MAAM,oBACJ,oBAAC,2BAAD,EAA2B,WAAWA,wBAAO,KAAO,CAAA;CAEtD,MAAM,YAAY,oBAAC,mBAAD,EAAmB,WAAWA,wBAAO,KAAO,CAAA;CAE9D,MAAM,cAAc,YAAqB,oBAA6B;EACpE,MAAM,OAAO,aACT,cACA,kBACE,oBACA;EAEN,MAAM,eACJ,oBAAC,QAAD;GAAM,WAAWA,wBAAO;GACtB,UAAA,oBAAC,mBAAD,EAAA,UAAoB,KAAwB,CAAA;EACxC,CAAA;EAGR,OAAO,aAAa,eAAe;CACrC;CAEA,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,WAAW,KAAKA,wBAAO,UAAU,WAAW,aAAa,SAAS;EAFpE,UAAA,CAIE,oBAAC,0BAAD,EAAA,UACE,oBAAC,KAAK,UAAN;GACE,GAAI;GACJ,oBAAkB,aAAa;GACrB;GACV,WAAW,KAAK,gBAAgBA,wBAAO,KAAK;GAE1C,WAAA,EAAE,YAAY,sBACd,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,WAAW,YAAY,eAAe,GACvC,oBAAC,iBAAD,EAAkB,SAA0B,CAAA,CACxB;;EAEX,CAAA,EACS,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET,CAAC"}
1
+ {"version":3,"file":"Checkbox.mjs","names":["styles"],"sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Checkbox.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"react-aria\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CheckboxProps\n extends\n PropsWithChildren<\n Omit<Aria.CheckboxProps, \"children\" | \"ref\" | \"inputRef\">\n >,\n FlowComponentProps<HTMLInputElement> {\n /** The class name of the underlying input element. */\n inputClassName?: string;\n}\n\n/** @flr-generate all */\nexport const Checkbox = flowComponent(\"Checkbox\", (props) => {\n const { children, className, ref, inputClassName, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"Checkbox\");\n\n const inputRef = useObjectRef(ref);\n const isSkeleton = useSkeletonMode();\n\n const checkedIcon = <IconCheckboxChecked className={styles.icon} />;\n const indeterminateIcon = (\n <IconCheckboxIndeterminate className={styles.icon} />\n );\n const emptyIcon = <IconCheckboxEmpty className={styles.icon} />;\n\n const renderIcon = (isSelected: boolean, isIndeterminate: boolean) => {\n const icon = isSelected\n ? checkedIcon\n : isIndeterminate\n ? indeterminateIcon\n : emptyIcon;\n\n const skeletonIcon = (\n <span className={styles.skeletonIcon}>\n <SkeletonModeReset>{icon}</SkeletonModeReset>\n </span>\n );\n\n return isSkeleton ? skeletonIcon : icon;\n };\n\n return (\n <div\n {...skeletonProps}\n className={clsx(wrapperProps.className, styles.checkbox, className)}\n >\n <FieldErrorCaptureContext>\n <Aria.Checkbox\n {...rest}\n aria-describedby={controlProps[\"aria-describedby\"]}\n inputRef={inputRef}\n className={clsx(styles.input, inputClassName)}\n >\n {({ isSelected, isIndeterminate }) => (\n <PropsContextProvider props={fieldPropsContext}>\n {renderIcon(isSelected, isIndeterminate)}\n <SkeletonRawText>{children}</SkeletonRawText>\n </PropsContextProvider>\n )}\n </Aria.Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EAAE,UAAU,WAAW,KAAK,gBAAgB,GAAG,SAAS;CAE9D,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,cACA,kBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,WAAW,aAAa,GAAG;CACjC,MAAM,aAAa,gBAAgB;CAEnC,MAAM,cAAc,oBAAC,qBAAD,EAAqB,WAAWA,wBAAO,KAAO,CAAA;CAClE,MAAM,oBACJ,oBAAC,2BAAD,EAA2B,WAAWA,wBAAO,KAAO,CAAA;CAEtD,MAAM,YAAY,oBAAC,mBAAD,EAAmB,WAAWA,wBAAO,KAAO,CAAA;CAE9D,MAAM,cAAc,YAAqB,oBAA6B;EACpE,MAAM,OAAO,aACT,cACA,kBACE,oBACA;EAEN,MAAM,eACJ,oBAAC,QAAD;GAAM,WAAWA,wBAAO;GACtB,UAAA,oBAAC,mBAAD,EAAA,UAAoB,KAAwB,CAAA;EACxC,CAAA;EAGR,OAAO,aAAa,eAAe;CACrC;CAEA,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,WAAW,KAAK,aAAa,WAAWA,wBAAO,UAAU,SAAS;EAFpE,UAAA,CAIE,oBAAC,0BAAD,EAAA,UACE,oBAAC,KAAK,UAAN;GACE,GAAI;GACJ,oBAAkB,aAAa;GACrB;GACV,WAAW,KAAKA,wBAAO,OAAO,cAAc;GAE1C,WAAA,EAAE,YAAY,sBACd,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,WAAW,YAAY,eAAe,GACvC,oBAAC,iBAAD,EAAkB,SAA0B,CAAA,CACxB;;EAEX,CAAA,EACS,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET,CAAC"}
@@ -5,7 +5,7 @@ import { useLocalizedStringFormatter } from "../TranslationProvider/useLocalized
5
5
  import { Button } from "../Button/Button.mjs";
6
6
  import CodeBlock_module_default from "./CodeBlock.module.mjs";
7
7
  import { CodeEditor } from "../CodeEditor/CodeEditor.mjs";
8
- import __locale_default from "../../../../../_virtual/_11.locale.mjs";
8
+ import __locale_default from "../../../../../_virtual/_12.locale.mjs";
9
9
  import clsx from "clsx";
10
10
  import { useId, useRef, useState } from "react";
11
11
  import { jsx } from "react/jsx-runtime";
@@ -20,10 +20,10 @@ var CodeBlock = (props) => {
20
20
  const editorRef = useRef(null);
21
21
  const stringFormatter = useLocalizedStringFormatter(__locale_default, "CodeBlock");
22
22
  const isSkeleton = useSkeletonMode();
23
- const rootClassName = clsx(CodeBlock_module_default.codeBlock, isSkeleton && CodeBlock_module_default.skeleton, className);
23
+ const baseClassName = clsx(CodeBlock_module_default.codeBlock, isSkeleton && CodeBlock_module_default.skeleton);
24
24
  const id = useId();
25
25
  if (!code) return /* @__PURE__ */ jsx("div", {
26
- className: clsx(rootClassName, CodeBlock_module_default.withChildren),
26
+ className: clsx(baseClassName, CodeBlock_module_default.withChildren, className),
27
27
  inert: isSkeleton || void 0,
28
28
  children: /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: /* @__PURE__ */ jsx(SkeletonModeReset, { children }) }) })
29
29
  });
@@ -48,7 +48,7 @@ var CodeBlock = (props) => {
48
48
  }
49
49
  };
50
50
  return /* @__PURE__ */ jsx("div", {
51
- className: clsx(rootClassName, maxHeight && CodeBlock_module_default.truncated, folded && CodeBlock_module_default.folded),
51
+ className: clsx(baseClassName, maxHeight && CodeBlock_module_default.truncated, folded && CodeBlock_module_default.folded, className),
52
52
  style: heightVariables,
53
53
  onTransitionEnd: (event) => {
54
54
  if (event.propertyName === "max-height") setExpandedHeight(void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import {\n type FC,\n type PropsWithChildren,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeBlock.module.scss\";\nimport { CodeEditor, type CodeEditorProps } from \"@/components/CodeEditor\";\nimport { Button } from \"@/components/Button\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\nimport locales from \"./locales/*.locale.json\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CodeBlockProps\n extends\n PropsWithClassName,\n PropsWithChildren,\n Partial<\n Pick<CodeEditorProps, \"language\" | \"showLineNumbers\" | \"copyable\">\n > {\n /** The code displayed in the block. */\n code?: string;\n /**\n * Controls truncation of long code blocks. `false` disables it, `true`\n * truncates after 8 lines, and a number sets the maximum line count.\n *\n * @default: false\n */\n truncateLines?: boolean | number;\n}\n\n/** @flr-generate all */\nexport const CodeBlock: FC<CodeBlockProps> = (props) => {\n const {\n code,\n className,\n copyable = false,\n showLineNumbers = false,\n children,\n truncateLines = false,\n ...rest\n } = props;\n\n const [folded, setFolded] = useState(truncateLines !== false);\n const [maxHeight, setMaxHeight] = useState<number>();\n /* The full height, only while the toggle animates to or from it. */\n const [expandedHeight, setExpandedHeight] = useState<number>();\n const editorRef = useRef<HTMLElement>(null);\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"CodeBlock\");\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.codeBlock,\n isSkeleton && styles.skeleton,\n className,\n );\n\n const id = useId();\n\n if (!code) {\n return (\n <div\n className={clsx(rootClassName, styles.withChildren)}\n inert={isSkeleton || undefined}\n >\n {/* Deliberately class-less: a `flow--` class would make the global\n reset's `font: inherit` apply and replace the UA monospace\n metrics. See CodeBlock.module.scss. */}\n <pre>\n <code>\n <SkeletonModeReset>{children}</SkeletonModeReset>\n </code>\n </pre>\n </div>\n );\n }\n\n const heightVariables: React.CSSProperties = {\n ...(maxHeight ? { \"--max-height\": `${maxHeight}px` } : {}),\n ...(expandedHeight\n ? { \"--expanded-max-height\": `${expandedHeight}px` }\n : {}),\n };\n\n /* A height transition needs a length on both ends – `none` does not\n interpolate. So the full height is measured for the transition and\n released once it ended, and code that changes later is not clipped. */\n const toggleFolded = () => {\n const editor = editorRef.current;\n\n if (!editor) {\n setFolded((folded) => !folded);\n return;\n }\n\n const animates = getComputedStyle(editor)\n .transitionDuration.split(\",\")\n .some((duration) => parseFloat(duration) > 0);\n\n if (folded) {\n setExpandedHeight(animates ? editor.scrollHeight : undefined);\n setFolded(false);\n } else {\n flushSync(() => setExpandedHeight(editor.scrollHeight));\n // Applies the start height before the folded one replaces it.\n editor.getBoundingClientRect();\n setFolded(true);\n }\n };\n\n return (\n <div\n className={clsx(\n rootClassName,\n maxHeight && styles.truncated,\n folded && styles.folded,\n )}\n style={heightVariables}\n onTransitionEnd={(event) => {\n if (event.propertyName === \"max-height\") {\n setExpandedHeight(undefined);\n }\n }}\n inert={isSkeleton || undefined}\n >\n {/* The code block is one skeleton surface in the size of its code, so\n the editor inside renders for real, but invisibly. */}\n <SkeletonModeReset>\n <CodeEditor\n {...rest}\n value={code}\n editable={false}\n copyable={copyable}\n showLineNumbers={showLineNumbers}\n showLinterMarkers={false}\n showCodeFolding={false}\n showActiveLineMarker={false}\n isReadOnly\n onCreateEditor={(view) => {\n editorRef.current = view.dom;\n\n if (!truncateLines) {\n return;\n }\n\n const lineHeight = 20;\n const padding = 12;\n\n const visibleLines =\n typeof truncateLines === \"number\" ? truncateLines : 8;\n\n const totalLines = view.state.doc.lines;\n\n if (totalLines > visibleLines)\n setMaxHeight(lineHeight * visibleLines + padding);\n }}\n id={id}\n >\n {truncateLines && maxHeight && (\n <div className={clsx(styles.buttonContainer)}>\n <Button\n variant=\"plain\"\n color=\"secondary\"\n size=\"s\"\n onPress={toggleFolded}\n aria-expanded={!folded}\n aria-controls={id}\n >\n {stringFormatter.format(folded ? \"showMore\" : \"showLess\")}\n </Button>\n </div>\n )}\n </CodeEditor>\n </SkeletonModeReset>\n </div>\n );\n};\n\nexport default CodeBlock;\n"],"mappings":";;;;;;;;;;;;;;AAuCA,IAAa,aAAiC,UAAU;CACtD,MAAM,EACJ,MACA,WACA,WAAW,OACX,kBAAkB,OAClB,UACA,gBAAgB,OAChB,GAAG,SACD;CAEJ,MAAM,CAAC,QAAQ,aAAa,SAAS,kBAAkB,KAAK;CAC5D,MAAM,CAAC,WAAW,gBAAgB,SAAiB;CAEnD,MAAM,CAAC,gBAAgB,qBAAqB,SAAiB;CAC7D,MAAM,YAAY,OAAoB,IAAI;CAE1C,MAAM,kBAAkB,4BAA4B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,mBAAmB;GACnB,iBAAiB;GACjB,sBAAsB;GACtB,YAAA;GACA,iBAAiB,SAAS;IACxB,UAAU,UAAU,KAAK;IAEzB,IAAI,CAAC,eACH;IAGF,MAAM,aAAa;IACnB,MAAM,UAAU;IAEhB,MAAM,eACJ,OAAO,kBAAkB,WAAW,gBAAgB;IAItD,IAFmB,KAAK,MAAM,IAAI,QAEjB,cACf,aAAa,aAAa,eAAe,OAAO;GACpD;GACI;GAEH,UAAA,iBAAiB,aAChB,oBAAC,OAAD;IAAK,WAAW,KAAKA,yBAAO,eAAe;IACzC,UAAA,oBAAC,QAAD;KACE,SAAQ;KACR,OAAM;KACN,MAAK;KACL,SAAS;KACT,iBAAe,CAAC;KAChB,iBAAe;KAEd,UAAA,gBAAgB,OAAO,SAAS,aAAa,UAAU;IAClD,CAAA;GACL,CAAA;EAEG,CAAA,EACK,CAAA;CAChB,CAAA;AAET"}
1
+ {"version":3,"file":"CodeBlock.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import {\n type FC,\n type PropsWithChildren,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeBlock.module.scss\";\nimport { CodeEditor, type CodeEditorProps } from \"@/components/CodeEditor\";\nimport { Button } from \"@/components/Button\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\nimport locales from \"./locales/*.locale.json\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CodeBlockProps\n extends\n PropsWithClassName,\n PropsWithChildren,\n Partial<\n Pick<CodeEditorProps, \"language\" | \"showLineNumbers\" | \"copyable\">\n > {\n /** The code displayed in the block. */\n code?: string;\n /**\n * Controls truncation of long code blocks. `false` disables it, `true`\n * truncates after 8 lines, and a number sets the maximum line count.\n *\n * @default false\n */\n truncateLines?: boolean | number;\n}\n\n/** @flr-generate all */\nexport const CodeBlock: FC<CodeBlockProps> = (props) => {\n const {\n code,\n className,\n copyable = false,\n showLineNumbers = false,\n children,\n truncateLines = false,\n ...rest\n } = props;\n\n const [folded, setFolded] = useState(truncateLines !== false);\n const [maxHeight, setMaxHeight] = useState<number>();\n /* The full height, only while the toggle animates to or from it. */\n const [expandedHeight, setExpandedHeight] = useState<number>();\n const editorRef = useRef<HTMLElement>(null);\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"CodeBlock\");\n const isSkeleton = useSkeletonMode();\n\n const baseClassName = clsx(styles.codeBlock, isSkeleton && styles.skeleton);\n\n const id = useId();\n\n if (!code) {\n return (\n <div\n className={clsx(baseClassName, styles.withChildren, className)}\n inert={isSkeleton || undefined}\n >\n {/* Deliberately class-less: a `flow--` class would make the global\n reset's `font: inherit` apply and replace the UA monospace\n metrics. See CodeBlock.module.scss. */}\n <pre>\n <code>\n <SkeletonModeReset>{children}</SkeletonModeReset>\n </code>\n </pre>\n </div>\n );\n }\n\n const heightVariables: React.CSSProperties = {\n ...(maxHeight ? { \"--max-height\": `${maxHeight}px` } : {}),\n ...(expandedHeight\n ? { \"--expanded-max-height\": `${expandedHeight}px` }\n : {}),\n };\n\n /* A height transition needs a length on both ends – `none` does not\n interpolate. So the full height is measured for the transition and\n released once it ended, and code that changes later is not clipped. */\n const toggleFolded = () => {\n const editor = editorRef.current;\n\n if (!editor) {\n setFolded((folded) => !folded);\n return;\n }\n\n const animates = getComputedStyle(editor)\n .transitionDuration.split(\",\")\n .some((duration) => parseFloat(duration) > 0);\n\n if (folded) {\n setExpandedHeight(animates ? editor.scrollHeight : undefined);\n setFolded(false);\n } else {\n flushSync(() => setExpandedHeight(editor.scrollHeight));\n // Applies the start height before the folded one replaces it.\n editor.getBoundingClientRect();\n setFolded(true);\n }\n };\n\n return (\n <div\n className={clsx(\n baseClassName,\n maxHeight && styles.truncated,\n folded && styles.folded,\n className,\n )}\n style={heightVariables}\n onTransitionEnd={(event) => {\n if (event.propertyName === \"max-height\") {\n setExpandedHeight(undefined);\n }\n }}\n inert={isSkeleton || undefined}\n >\n {/* The code block is one skeleton surface in the size of its code, so\n the editor inside renders for real, but invisibly. */}\n <SkeletonModeReset>\n <CodeEditor\n {...rest}\n value={code}\n editable={false}\n copyable={copyable}\n showLineNumbers={showLineNumbers}\n showLinterMarkers={false}\n showCodeFolding={false}\n showActiveLineMarker={false}\n isReadOnly\n onCreateEditor={(view) => {\n editorRef.current = view.dom;\n\n if (!truncateLines) {\n return;\n }\n\n const lineHeight = 20;\n const padding = 12;\n\n const visibleLines =\n typeof truncateLines === \"number\" ? truncateLines : 8;\n\n const totalLines = view.state.doc.lines;\n\n if (totalLines > visibleLines)\n setMaxHeight(lineHeight * visibleLines + padding);\n }}\n id={id}\n >\n {truncateLines && maxHeight && (\n <div className={clsx(styles.buttonContainer)}>\n <Button\n variant=\"plain\"\n color=\"secondary\"\n size=\"s\"\n onPress={toggleFolded}\n aria-expanded={!folded}\n aria-controls={id}\n >\n {stringFormatter.format(folded ? \"showMore\" : \"showLess\")}\n </Button>\n </div>\n )}\n </CodeEditor>\n </SkeletonModeReset>\n </div>\n );\n};\n\nexport default CodeBlock;\n"],"mappings":";;;;;;;;;;;;;;AAuCA,IAAa,aAAiC,UAAU;CACtD,MAAM,EACJ,MACA,WACA,WAAW,OACX,kBAAkB,OAClB,UACA,gBAAgB,OAChB,GAAG,SACD;CAEJ,MAAM,CAAC,QAAQ,aAAa,SAAS,kBAAkB,KAAK;CAC5D,MAAM,CAAC,WAAW,gBAAgB,SAAiB;CAEnD,MAAM,CAAC,gBAAgB,qBAAqB,SAAiB;CAC7D,MAAM,YAAY,OAAoB,IAAI;CAE1C,MAAM,kBAAkB,4BAA4BA,kBAAS,WAAW;CACxE,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KAAKC,yBAAO,WAAW,cAAcA,yBAAO,QAAQ;CAE1E,MAAM,KAAK,MAAM;CAE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MAAM,aAAa;IACnB,MAAM,UAAU;IAEhB,MAAM,eACJ,OAAO,kBAAkB,WAAW,gBAAgB;IAItD,IAFmB,KAAK,MAAM,IAAI,QAEjB,cACf,aAAa,aAAa,eAAe,OAAO;GACpD;GACI;GAEH,UAAA,iBAAiB,aAChB,oBAAC,OAAD;IAAK,WAAW,KAAKA,yBAAO,eAAe;IACzC,UAAA,oBAAC,QAAD;KACE,SAAQ;KACR,OAAM;KACN,MAAK;KACL,SAAS;KACT,iBAAe,CAAC;KAChB,iBAAe;KAEd,UAAA,gBAAgB,OAAO,SAAS,aAAa,UAAU;IAClD,CAAA;GACL,CAAA;EAEG,CAAA,EACK,CAAA;CAChB,CAAA;AAET"}
@@ -12,7 +12,7 @@ import { defaultLightTheme } from "./themes/defaultEditorTheme.mjs";
12
12
  import { useCodeEditorExtensions } from "./hooks/useCodeEditorExtensions.mjs";
13
13
  import { CopyButton } from "../CopyButton/CopyButton.mjs";
14
14
  import clsx from "clsx";
15
- import { useCallback, useId, useState } from "react";
15
+ import { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
16
16
  import { jsx, jsxs } from "react/jsx-runtime";
17
17
  import { useObjectRef } from "react-aria";
18
18
  import CodeMirror, { EditorView } from "@uiw/react-codemirror";
@@ -22,7 +22,7 @@ import CodeMirror, { EditorView } from "@uiw/react-codemirror";
22
22
  * @flowStatus new
23
23
  */
24
24
  var CodeEditor = flowComponent("CodeEditor", (props) => {
25
- const { ref, children, className, language, extensions, isReadOnly, isDisabled, isInvalid, isRequired, validationBehavior: _ignoredValidationBehavior, value, showLineNumbers = true, showCodeFolding = true, showCodeIndentationMakers = true, showLinterMarkers = true, showActiveLineMarker = true, copyable = true, height, minHeight, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest } = useControlledHostValueProps(props, "");
25
+ const { ref, children, className, language, extensions, isReadOnly, isDisabled, isInvalid, isRequired, validationBehavior: _ignoredValidationBehavior, value, onChange, onStatistics, showLineNumbers = true, showCodeFolding = true, showCodeIndentationMakers = true, showLinterMarkers = true, showActiveLineMarker = true, copyable = true, height, minHeight, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest } = useControlledHostValueProps(props, "");
26
26
  const { FieldErrorView, FieldErrorCaptureContext, wrapperProps, controlProps, fieldPropsContext } = useFieldComponent(props, "CodeEditor");
27
27
  const rootClassName = clsx(wrapperProps.className, CodeEditor_module_default.codeEditor, className);
28
28
  const labelId = useId();
@@ -83,14 +83,48 @@ var CodeEditor = flowComponent("CodeEditor", (props) => {
83
83
  */
84
84
  const labelledBy = joinIds(ariaLabelledBy, hasLabel && labelId);
85
85
  const describedBy = joinIds(hasDescription && descriptionId, controlProps["aria-describedby"]);
86
- const contentAttributes = EditorView.contentAttributes.of({
86
+ /**
87
+ * CodeMirror reconfigures the editor whenever `extensions`, `basicSetup` or
88
+ * `onChange` is a new object. All three are stable, so a render with
89
+ * unchanged props leaves the editor as it is.
90
+ */
91
+ const allExtensions = useMemo(() => [...enabledExtensions, EditorView.contentAttributes.of({
87
92
  ...labelledBy ? { "aria-labelledby": labelledBy } : {},
88
93
  ...ariaLabel ? { "aria-label": ariaLabel } : {},
89
94
  ...describedBy ? { "aria-describedby": describedBy } : {},
90
95
  ...isRequired ? { "aria-required": "true" } : {},
91
96
  ...isInvalid ? { "aria-invalid": "true" } : {},
92
97
  ...isDisabled ? { "aria-disabled": "true" } : {}
98
+ })], [
99
+ enabledExtensions,
100
+ labelledBy,
101
+ ariaLabel,
102
+ describedBy,
103
+ isRequired,
104
+ isInvalid,
105
+ isDisabled
106
+ ]);
107
+ const handlersRef = useRef({
108
+ onChange,
109
+ onStatistics
93
110
  });
111
+ useLayoutEffect(() => {
112
+ handlersRef.current = {
113
+ onChange,
114
+ onStatistics
115
+ };
116
+ });
117
+ const stableOnChange = useCallback((value) => handlersRef.current.onChange(value), []);
118
+ const stableOnStatistics = useCallback((statistics) => handlersRef.current.onStatistics?.(statistics), []);
119
+ const highlightActiveLine = showActiveLineMarker && !isDisabled;
120
+ const basicSetup = useMemo(() => ({
121
+ highlightActiveLine,
122
+ highlightActiveLineGutter: highlightActiveLine,
123
+ autocompletion: false,
124
+ lineNumbers: false,
125
+ foldGutter: false,
126
+ highlightSelectionMatches: false
127
+ }), [highlightActiveLine]);
94
128
  const localRef = useObjectRef(ref);
95
129
  useMakeFocusable(localRef);
96
130
  const isSkeleton = useSkeletonMode();
@@ -105,14 +139,9 @@ var CodeEditor = flowComponent("CodeEditor", (props) => {
105
139
  const editor = /* @__PURE__ */ jsxs(CodeMirror, {
106
140
  ...rest,
107
141
  value,
108
- basicSetup: {
109
- highlightActiveLine: showActiveLineMarker && !isDisabled,
110
- highlightActiveLineGutter: showActiveLineMarker && !isDisabled,
111
- autocompletion: false,
112
- lineNumbers: false,
113
- foldGutter: false,
114
- highlightSelectionMatches: false
115
- },
142
+ onChange: stableOnChange,
143
+ onStatistics: stableOnStatistics,
144
+ basicSetup,
116
145
  theme: defaultLightTheme,
117
146
  "data-invalid": isInvalid || void 0,
118
147
  "data-disabled": isDisabled || void 0,
@@ -122,7 +151,7 @@ var CodeEditor = flowComponent("CodeEditor", (props) => {
122
151
  ref: (codeMirrorRef) => {
123
152
  if (codeMirrorRef?.editor) localRef.current = codeMirrorRef.editor;
124
153
  },
125
- extensions: [...enabledExtensions, contentAttributes],
154
+ extensions: allExtensions,
126
155
  height: height ?? minHeight,
127
156
  children: [copyable && /* @__PURE__ */ jsx(CopyButton, {
128
157
  className: CodeEditor_module_default.copyButton,
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.mjs","names":["styles"],"sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror, { EditorView } from \"@uiw/react-codemirror\";\nimport { useCallback, useId, useState } from \"react\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { joinIds, useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n /** The initial code of an uncontrolled editor. */\n defaultValue?: string;\n /**\n * Whether the code can be read but not edited.\n *\n * @default false\n */\n isReadOnly?: boolean;\n /**\n * Whether the editor is disabled. The code can neither be edited, focused nor\n * copied.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Whether the editor is displayed as invalid.\n *\n * @default false\n */\n isInvalid?: boolean;\n /** The elements class name. */\n className?: string;\n /**\n * The language the code is highlighted as. A language the editor does not\n * know is shown as plain text.\n */\n language?: CodeEditorLanguage | (string & {});\n /**\n * Whether a button to copy the code to the clipboard is shown.\n *\n * @default true\n */\n copyable?: boolean;\n /**\n * Whether the field must be filled in. Only marks the editor as required for\n * assistive technology — the editor does not validate itself.\n *\n * @default false\n */\n isRequired?: boolean;\n /**\n * @internal Set by `<Field />` on every form field. The editor has no\n * react-aria validation to forward it to and drops it.\n */\n validationBehavior?: unknown;\n}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isDisabled,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n height,\n minHeight,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n wrapperProps.className,\n styles.codeEditor,\n className,\n );\n\n const labelId = useId();\n const descriptionId = useId();\n\n /**\n * Both are optional. Their refs tell whether they are rendered, so the editor\n * never references an element that does not exist – a dangling id fails HTML\n * validators and a11y checks. The callbacks are stable: a new one per render\n * would detach and re-attach on every render.\n */\n const [hasLabel, setHasLabel] = useState(false);\n const [hasDescription, setHasDescription] = useState(false);\n const labelRef = useCallback((element: Element | null) => {\n setHasLabel(!!element);\n }, []);\n const descriptionRef = useCallback((element: Element | null) => {\n setHasDescription(!!element);\n }, []);\n\n /**\n * The label and the field description are declared as children of the code\n * editor, but must be rendered outside of the editor itself. They are\n * tunneled out of the editor – just like the field error. Their ids are the\n * ones the editor references.\n */\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n id: labelId,\n ref: labelRef,\n tunnel: { id: \"label\", component: \"CodeEditor\" },\n },\n FieldDescription: {\n ...fieldPropsContext.FieldDescription,\n id: descriptionId,\n ref: descriptionRef,\n tunnel: { id: \"fieldDescription\", component: \"CodeEditor\" },\n },\n };\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n /**\n * The editable element of CodeMirror is the `.cm-content` element – not the\n * root element the props are applied to. Its ARIA attributes are set through\n * the content attributes facet.\n *\n * Without a label, an `aria-label` names the editor instead.\n */\n const labelledBy = joinIds(ariaLabelledBy, hasLabel && labelId);\n const describedBy = joinIds(\n hasDescription && descriptionId,\n controlProps[\"aria-describedby\"],\n );\n\n const contentAttributes = EditorView.contentAttributes.of({\n ...(labelledBy ? { \"aria-labelledby\": labelledBy } : {}),\n ...(ariaLabel ? { \"aria-label\": ariaLabel } : {}),\n ...(describedBy ? { \"aria-describedby\": describedBy } : {}),\n ...(isRequired ? { \"aria-required\": \"true\" } : {}),\n ...(isInvalid ? { \"aria-invalid\": \"true\" } : {}),\n ...(isDisabled ? { \"aria-disabled\": \"true\" } : {}),\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n const isSkeleton = useSkeletonMode();\n\n /* No CodeMirror: one surface, as high as the code in the editor's line\n height. The children still render, so a label or a field description\n tunnels out and follows its own skeleton rule. */\n const skeleton = (\n <div\n className={clsx(\n styles.codeMirror,\n isReadOnly && styles.readonly,\n styles.skeleton,\n )}\n >\n <div\n className={styles.skeletonLines}\n style={{ height: height ?? minHeight }}\n >\n {(value ?? \"\").split(\"\\n\").map((line, index) => (\n <div key={index}>{line || \" \"}</div>\n ))}\n </div>\n {children}\n </div>\n );\n\n const editor = (\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker && !isDisabled,\n highlightActiveLineGutter: showActiveLineMarker && !isDisabled,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n data-invalid={isInvalid || undefined}\n data-disabled={isDisabled || undefined}\n readOnly={isReadOnly || isDisabled}\n editable={!isDisabled}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={[...enabledExtensions, contentAttributes]}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n isDisabled={isDisabled}\n />\n )}\n {children}\n </CodeMirror>\n );\n\n return (\n <div\n className={rootClassName}\n data-disabled={isDisabled || undefined}\n inert={isSkeleton || undefined}\n >\n <PropsContextProvider props={propsContext}>\n <UiComponentTunnelExit id=\"label\" component=\"CodeEditor\" />\n <FieldErrorCaptureContext>\n {isSkeleton ? skeleton : editor}\n </FieldErrorCaptureContext>\n <UiComponentTunnelExit id=\"fieldDescription\" component=\"CodeEditor\" />\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiFA,IAAa,aAAa,cAAc,eAAe,UAAU;CAC/D,MAAM,EACJ,KACA,UACA,WACA,UACA,YACA,YACA,YACA,WACA,YACA,oBAAoB,4BACpB,OACA,kBAAkB,MAClB,kBAAkB,MAClB,4BAA4B,MAC5B,oBAAoB,MACpB,uBAAuB,MACvB,WAAW,MACX,QACA,WACA,cAAc,WACd,mBAAmB,gBACnB,GAAG,SACD,4BAA4B,OAAO,EAAE;CAEzC,MAAM,EACJ,gBACA,0BACA,cACA,cACA,sBACE,kBAAkB,OAAO,YAAY;CAEzC,MAAM,gBAAgB,KACpB,aAAa,WACbA,0BAAO,YACP,SACF;CAEA,MAAM,UAAU,MAAM;CACtB,MAAM,gBAAgB,MAAM;;;;;;;CAQ5B,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAC9C,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,KAAK;CAC1D,MAAM,WAAW,aAAa,YAA4B;EACxD,YAAY,CAAC,CAAC,OAAO;CACvB,GAAG,CAAC,CAAC;CACL,MAAM,iBAAiB,aAAa,YAA4B;EAC9D,kBAAkB,CAAC,CAAC,OAAO;CAC7B,GAAG,CAAC,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AAC,YAAD;EACE,GAAI;EACG;EACP,YAAY;GACV,qBAAqB,wBAAwB,CAAC;GAC9C,2BAA2B,wBAAwB,CAAC;GACpD,gBAAgB;GAChB,aAAa;GACb,YAAY;GACZ,2BAA2B;EAC7B;EACA,OAAO;EACP,gBAAc,aAAa,KAAA;EAC3B,iBAAe,cAAc,KAAA;EAC7B,UAAU,cAAc;EACxB,UAAU,CAAC;EACX,WAAW,KAAKA,0BAAO,YAAY,cAAcA,0BAAO,QAAQ;EAChE,MAAM,kBAAkB;GACtB,IAAI,eAAe,QACjB,SAAS,UAAU,cAAc;EAErC;EACA,YAAY,CAAC,GAAG,mBAAmB,iBAAiB;EACpD,QAAQ,UAAU;EAvBpB,UAAA,CAyBG,YACC,oBAAC,YAAD;GACE,WAAWA,0BAAO;GAClB,MAAK;GACL,SAAQ;GACR,MAAM;GACM;EACb,CAAA,GAEF,QACS;;CAGd,OACE,oBAAC,OAAD;EACE,WAAW;EACX,iBAAe,cAAc,KAAA;EAC7B,OAAO,cAAc,KAAA;EAErB,UAAA,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA;IACE,oBAAC,uBAAD;KAAuB,IAAG;KAAQ,WAAU;IAAc,CAAA;IAC1D,oBAAC,0BAAD,EAAA,UACG,aAAa,WAAW,OACD,CAAA;IAC1B,oBAAC,uBAAD;KAAuB,IAAG;KAAmB,WAAU;IAAc,CAAA;IACrE,oBAAC,gBAAD,CAAiB,CAAA;GACG;;CACnB,CAAA;AAET,CAAC"}
1
+ {"version":3,"file":"CodeEditor.mjs","names":["styles"],"sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps, Statistics } from \"@uiw/react-codemirror\";\nimport CodeMirror, { EditorView } from \"@uiw/react-codemirror\";\nimport {\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { joinIds, useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n /** The initial code of an uncontrolled editor. */\n defaultValue?: string;\n /**\n * Whether the code can be read but not edited.\n *\n * @default false\n */\n isReadOnly?: boolean;\n /**\n * Whether the editor is disabled. The code can neither be edited, focused nor\n * copied.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Whether the editor is displayed as invalid.\n *\n * @default false\n */\n isInvalid?: boolean;\n /** The elements class name. */\n className?: string;\n /**\n * The language the code is highlighted as. A language the editor does not\n * know is shown as plain text.\n */\n language?: CodeEditorLanguage | (string & {});\n /**\n * Whether a button to copy the code to the clipboard is shown.\n *\n * @default true\n */\n copyable?: boolean;\n /**\n * Whether the field must be filled in. Only marks the editor as required for\n * assistive technology — the editor does not validate itself.\n *\n * @default false\n */\n isRequired?: boolean;\n /**\n * @internal Set by `<Field />` on every form field. The editor has no\n * react-aria validation to forward it to and drops it.\n */\n validationBehavior?: unknown;\n}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isDisabled,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n onChange,\n onStatistics,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n height,\n minHeight,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n wrapperProps.className,\n styles.codeEditor,\n className,\n );\n\n const labelId = useId();\n const descriptionId = useId();\n\n /**\n * Both are optional. Their refs tell whether they are rendered, so the editor\n * never references an element that does not exist – a dangling id fails HTML\n * validators and a11y checks. The callbacks are stable: a new one per render\n * would detach and re-attach on every render.\n */\n const [hasLabel, setHasLabel] = useState(false);\n const [hasDescription, setHasDescription] = useState(false);\n const labelRef = useCallback((element: Element | null) => {\n setHasLabel(!!element);\n }, []);\n const descriptionRef = useCallback((element: Element | null) => {\n setHasDescription(!!element);\n }, []);\n\n /**\n * The label and the field description are declared as children of the code\n * editor, but must be rendered outside of the editor itself. They are\n * tunneled out of the editor – just like the field error. Their ids are the\n * ones the editor references.\n */\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n id: labelId,\n ref: labelRef,\n tunnel: { id: \"label\", component: \"CodeEditor\" },\n },\n FieldDescription: {\n ...fieldPropsContext.FieldDescription,\n id: descriptionId,\n ref: descriptionRef,\n tunnel: { id: \"fieldDescription\", component: \"CodeEditor\" },\n },\n };\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n /**\n * The editable element of CodeMirror is the `.cm-content` element – not the\n * root element the props are applied to. Its ARIA attributes are set through\n * the content attributes facet.\n *\n * Without a label, an `aria-label` names the editor instead.\n */\n const labelledBy = joinIds(ariaLabelledBy, hasLabel && labelId);\n const describedBy = joinIds(\n hasDescription && descriptionId,\n controlProps[\"aria-describedby\"],\n );\n\n /**\n * CodeMirror reconfigures the editor whenever `extensions`, `basicSetup` or\n * `onChange` is a new object. All three are stable, so a render with\n * unchanged props leaves the editor as it is.\n */\n const allExtensions = useMemo(\n () => [\n ...enabledExtensions,\n EditorView.contentAttributes.of({\n ...(labelledBy ? { \"aria-labelledby\": labelledBy } : {}),\n ...(ariaLabel ? { \"aria-label\": ariaLabel } : {}),\n ...(describedBy ? { \"aria-describedby\": describedBy } : {}),\n ...(isRequired ? { \"aria-required\": \"true\" } : {}),\n ...(isInvalid ? { \"aria-invalid\": \"true\" } : {}),\n ...(isDisabled ? { \"aria-disabled\": \"true\" } : {}),\n }),\n ],\n [\n enabledExtensions,\n labelledBy,\n ariaLabel,\n describedBy,\n isRequired,\n isInvalid,\n isDisabled,\n ],\n );\n\n /*\n * A new `onChange` on every render would reconfigure the editor as well.\n * CodeMirror's update listener captures `onStatistics` along with it, so both\n * call the latest handler through a ref.\n */\n const handlersRef = useRef({ onChange, onStatistics });\n useLayoutEffect(() => {\n handlersRef.current = { onChange, onStatistics };\n });\n const stableOnChange = useCallback(\n (value: string) => handlersRef.current.onChange(value),\n [],\n );\n const stableOnStatistics = useCallback(\n (statistics: Statistics) => handlersRef.current.onStatistics?.(statistics),\n [],\n );\n\n const highlightActiveLine = showActiveLineMarker && !isDisabled;\n const basicSetup = useMemo(\n () => ({\n highlightActiveLine,\n highlightActiveLineGutter: highlightActiveLine,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }),\n [highlightActiveLine],\n );\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n const isSkeleton = useSkeletonMode();\n\n /* No CodeMirror: one surface, as high as the code in the editor's line\n height. The children still render, so a label or a field description\n tunnels out and follows its own skeleton rule. */\n const skeleton = (\n <div\n className={clsx(\n styles.codeMirror,\n isReadOnly && styles.readonly,\n styles.skeleton,\n )}\n >\n <div\n className={styles.skeletonLines}\n style={{ height: height ?? minHeight }}\n >\n {(value ?? \"\").split(\"\\n\").map((line, index) => (\n <div key={index}>{line || \" \"}</div>\n ))}\n </div>\n {children}\n </div>\n );\n\n const editor = (\n <CodeMirror\n {...rest}\n value={value}\n onChange={stableOnChange}\n onStatistics={stableOnStatistics}\n basicSetup={basicSetup}\n theme={defaultLightTheme}\n data-invalid={isInvalid || undefined}\n data-disabled={isDisabled || undefined}\n readOnly={isReadOnly || isDisabled}\n editable={!isDisabled}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={allExtensions}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n isDisabled={isDisabled}\n />\n )}\n {children}\n </CodeMirror>\n );\n\n return (\n <div\n className={rootClassName}\n data-disabled={isDisabled || undefined}\n inert={isSkeleton || undefined}\n >\n <PropsContextProvider props={propsContext}>\n <UiComponentTunnelExit id=\"label\" component=\"CodeEditor\" />\n <FieldErrorCaptureContext>\n {isSkeleton ? skeleton : editor}\n </FieldErrorCaptureContext>\n <UiComponentTunnelExit id=\"fieldDescription\" component=\"CodeEditor\" />\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwFA,IAAa,aAAa,cAAc,eAAe,UAAU;CAC/D,MAAM,EACJ,KACA,UACA,WACA,UACA,YACA,YACA,YACA,WACA,YAC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iBAAe,cAAc,KAAA;EAC7B,UAAU,cAAc;EACxB,UAAU,CAAC;EACX,WAAW,KAAKA,0BAAO,YAAY,cAAcA,0BAAO,QAAQ;EAChE,MAAM,kBAAkB;GACtB,IAAI,eAAe,QACjB,SAAS,UAAU,cAAc;EAErC;EACA,YAAY;EACZ,QAAQ,UAAU;EAlBpB,UAAA,CAoBG,YACC,oBAAC,YAAD;GACE,WAAWA,0BAAO;GAClB,MAAK;GACL,SAAQ;GACR,MAAM;GACM;EACb,CAAA,GAEF,QACS;;CAGd,OACE,oBAAC,OAAD;EACE,WAAW;EACX,iBAAe,cAAc,KAAA;EAC7B,OAAO,cAAc,KAAA;EAErB,UAAA,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA;IACE,oBAAC,uBAAD;KAAuB,IAAG;KAAQ,WAAU;IAAc,CAAA;IAC1D,oBAAC,0BAAD,EAAA,UACG,aAAa,WAAW,OACD,CAAA;IAC1B,oBAAC,uBAAD;KAAuB,IAAG;KAAmB,WAAU;IAAc,CAAA;IACrE,oBAAC,gBAAD,CAAiB,CAAA;GACG;;CACnB,CAAA;AAET,CAAC"}
@@ -2,38 +2,51 @@
2
2
  /* */
3
3
  import supportedCodeEditorLanguages, { isCodeEditorLanguage } from "../languages/index.mjs";
4
4
  import { gutterSpacer } from "../extensions/gutterSpacer.mjs";
5
+ import { useMemo } from "react";
5
6
  import { lineNumbers } from "@uiw/react-codemirror";
6
7
  import { foldGutter } from "@codemirror/language";
7
8
  import { lintGutter } from "@codemirror/lint";
8
9
  import { indentationMarkers } from "@replit/codemirror-indentation-markers";
9
10
  //#region src/components/CodeEditor/hooks/useCodeEditorExtensions.tsx
10
11
  var markerColor = "var(--code-editor--indentation-marker-color)";
11
- var indentationMarkerColors = {
12
+ var codeIndentationMarkers = indentationMarkers({ colors: {
12
13
  light: markerColor,
13
14
  dark: markerColor,
14
15
  activeLight: markerColor,
15
16
  activeDark: markerColor
16
- };
17
+ } });
18
+ var noExtensions = [];
17
19
  /** @internal */
18
- var useCodeEditorExtensions = (language, extensions = [], options = {
20
+ var useCodeEditorExtensions = (language, extensions = noExtensions, options = {
19
21
  showCodeFolding: true,
20
22
  showCodeIndentationMakers: true,
21
23
  showLineNumbers: true,
22
24
  showLinterMarkers: true
23
25
  }) => {
24
- if (options.showLineNumbers) extensions.push(lineNumbers());
25
- if (options.showCodeFolding) extensions.push(foldGutter({ markerDOM: (open) => {
26
- const element = document.createElement("span");
27
- element.classList.add("cm-foldGutter");
28
- element.classList.add(open ? "cm-foldGutter-open" : "cm-foldGutter-closed");
29
- element.innerText = open ? "⌄" : "›";
30
- return element;
31
- } }));
32
- if (options.showLinterMarkers) extensions.push(lintGutter());
33
- if (options.showLineNumbers && (!options.showCodeFolding || !options.showLinterMarkers)) extensions.push(gutterSpacer());
34
- if (options.showCodeIndentationMakers) extensions.push(indentationMarkers({ colors: indentationMarkerColors }));
35
- if (language && isCodeEditorLanguage(language)) supportedCodeEditorLanguages[language]?.map((loader) => extensions.push(loader()));
36
- return extensions;
26
+ const { showCodeFolding, showCodeIndentationMakers, showLineNumbers, showLinterMarkers } = options;
27
+ return useMemo(() => {
28
+ const enabledExtensions = [...extensions];
29
+ if (showLineNumbers) enabledExtensions.push(lineNumbers());
30
+ if (showCodeFolding) enabledExtensions.push(foldGutter({ markerDOM: (open) => {
31
+ const element = document.createElement("span");
32
+ element.classList.add("cm-foldGutter");
33
+ element.classList.add(open ? "cm-foldGutter-open" : "cm-foldGutter-closed");
34
+ element.innerText = open ? "⌄" : "›";
35
+ return element;
36
+ } }));
37
+ if (showLinterMarkers) enabledExtensions.push(lintGutter());
38
+ if (showLineNumbers && (!showCodeFolding || !showLinterMarkers)) enabledExtensions.push(gutterSpacer());
39
+ if (showCodeIndentationMakers) enabledExtensions.push(codeIndentationMarkers);
40
+ if (language && isCodeEditorLanguage(language)) for (const loader of supportedCodeEditorLanguages[language] ?? []) enabledExtensions.push(loader());
41
+ return enabledExtensions;
42
+ }, [
43
+ language,
44
+ extensions,
45
+ showCodeFolding,
46
+ showCodeIndentationMakers,
47
+ showLineNumbers,
48
+ showLinterMarkers
49
+ ]);
37
50
  };
38
51
  //#endregion
39
52
  export { useCodeEditorExtensions };