@qoretechnologies/reqore 0.76.0-pr.667.ge6cfc08 → 0.76.0-pr.673.g07b1f2f
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.
- package/.claude/CLAUDE.md +30 -2
- package/dist/components/Accordion/index.cjs +199 -0
- package/dist/components/Accordion/index.cjs.map +1 -0
- package/dist/components/Accordion/index.js +53 -89
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.cjs +239 -0
- package/dist/components/Breadcrumbs/index.cjs.map +1 -0
- package/dist/components/Breadcrumbs/index.js +33 -71
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Breadcrumbs/item.cjs +43 -0
- package/dist/components/Breadcrumbs/item.cjs.map +1 -0
- package/dist/components/Breadcrumbs/item.js +8 -13
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Bubble/index.cjs +281 -0
- package/dist/components/Bubble/index.cjs.map +1 -0
- package/dist/components/Bubble/index.js +53 -93
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.cjs +401 -0
- package/dist/components/Button/index.cjs.map +1 -0
- package/dist/components/Button/index.d.ts +1 -11
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +114 -156
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Callout/index.cjs +203 -0
- package/dist/components/Callout/index.cjs.map +1 -0
- package/dist/components/Callout/index.js +45 -84
- package/dist/components/Callout/index.js.map +1 -1
- package/dist/components/Checkbox/index.cjs +222 -0
- package/dist/components/Checkbox/index.cjs.map +1 -0
- package/dist/components/Checkbox/index.js +68 -106
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.cjs +127 -0
- package/dist/components/Collapse/index.cjs.map +1 -0
- package/dist/components/Collapse/index.js +19 -56
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.cjs +244 -0
- package/dist/components/CollapsibleContent/index.cjs.map +1 -0
- package/dist/components/CollapsibleContent/index.js +39 -78
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/Collection/index.cjs +362 -0
- package/dist/components/Collection/index.cjs.map +1 -0
- package/dist/components/Collection/index.d.ts +8 -7
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +75 -117
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.cjs +196 -0
- package/dist/components/Collection/item.cjs.map +1 -0
- package/dist/components/Collection/item.js +33 -73
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/column.cjs +47 -0
- package/dist/components/Columns/column.cjs.map +1 -0
- package/dist/components/Columns/column.js +3 -39
- package/dist/components/Columns/column.js.map +1 -1
- package/dist/components/Columns/index.cjs +79 -0
- package/dist/components/Columns/index.cjs.map +1 -0
- package/dist/components/Columns/index.js +8 -47
- package/dist/components/Columns/index.js.map +1 -1
- package/dist/components/Comment/index.cjs +72 -0
- package/dist/components/Comment/index.cjs.map +1 -0
- package/dist/components/Comment/index.js +22 -29
- package/dist/components/Comment/index.js.map +1 -1
- package/dist/components/CommentFeed/index.cjs +49 -0
- package/dist/components/CommentFeed/index.cjs.map +1 -0
- package/dist/components/CommentFeed/index.js +7 -14
- package/dist/components/CommentFeed/index.js.map +1 -1
- package/dist/components/Content/index.cjs +80 -0
- package/dist/components/Content/index.cjs.map +1 -0
- package/dist/components/Content/index.js +10 -48
- package/dist/components/Content/index.js.map +1 -1
- package/dist/components/Content/wrapper.cjs +43 -0
- package/dist/components/Content/wrapper.cjs.map +1 -0
- package/dist/components/Content/wrapper.js +8 -13
- package/dist/components/Content/wrapper.js.map +1 -1
- package/dist/components/ControlGroup/index.cjs +437 -0
- package/dist/components/ControlGroup/index.cjs.map +1 -0
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +58 -171
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/ControlGroup/item.cjs +86 -0
- package/dist/components/ControlGroup/item.cjs.map +1 -0
- package/dist/components/ControlGroup/item.js +12 -18
- package/dist/components/ControlGroup/item.js.map +1 -1
- package/dist/components/DataView/helpers.cjs +350 -0
- package/dist/components/DataView/helpers.cjs.map +1 -0
- package/dist/components/DataView/helpers.js +37 -53
- package/dist/components/DataView/helpers.js.map +1 -1
- package/dist/components/DataView/index.cjs +961 -0
- package/dist/components/DataView/index.cjs.map +1 -0
- package/dist/components/DataView/index.js +182 -234
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DatePicker/MonthYearDropdowns.cjs +64 -0
- package/dist/components/DatePicker/MonthYearDropdowns.cjs.map +1 -0
- package/dist/components/DatePicker/MonthYearDropdowns.js +12 -19
- package/dist/components/DatePicker/MonthYearDropdowns.js.map +1 -1
- package/dist/components/DatePicker/index.cjs +289 -0
- package/dist/components/DatePicker/index.cjs.map +1 -0
- package/dist/components/DatePicker/index.js +58 -65
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DescriptionList/index.cjs +183 -0
- package/dist/components/DescriptionList/index.cjs.map +1 -0
- package/dist/components/DescriptionList/index.js +26 -65
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/backdrop.cjs +73 -0
- package/dist/components/Drawer/backdrop.cjs.map +1 -0
- package/dist/components/Drawer/backdrop.js +17 -23
- package/dist/components/Drawer/backdrop.js.map +1 -1
- package/dist/components/Drawer/index.cjs +302 -0
- package/dist/components/Drawer/index.cjs.map +1 -0
- package/dist/components/Drawer/index.d.ts +0 -74
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +69 -221
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.cjs +77 -0
- package/dist/components/Dropdown/index.cjs.map +1 -0
- package/dist/components/Dropdown/index.js +17 -22
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/item.cjs +42 -0
- package/dist/components/Dropdown/item.cjs.map +1 -0
- package/dist/components/Dropdown/item.d.ts +1 -1
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Dropdown/item.js +11 -34
- package/dist/components/Dropdown/item.js.map +1 -1
- package/dist/components/Dropdown/list.cjs +346 -0
- package/dist/components/Dropdown/list.cjs.map +1 -0
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +74 -96
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.cjs +331 -0
- package/dist/components/Effect/index.cjs.map +1 -0
- package/dist/components/Effect/index.d.ts +1 -24
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +65 -107
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EmptyState/index.cjs +60 -0
- package/dist/components/EmptyState/index.cjs.map +1 -0
- package/dist/components/EmptyState/index.js +20 -26
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/EntityRow/index.cjs +249 -0
- package/dist/components/EntityRow/index.cjs.map +1 -0
- package/dist/components/EntityRow/index.js +59 -98
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/ErrorBoundary/index.cjs +118 -0
- package/dist/components/ErrorBoundary/index.cjs.map +1 -0
- package/dist/components/ErrorBoundary/index.js +12 -15
- package/dist/components/ErrorBoundary/index.js.map +1 -1
- package/dist/components/ExportModal/index.cjs +91 -0
- package/dist/components/ExportModal/index.cjs.map +1 -0
- package/dist/components/ExportModal/index.js +17 -24
- package/dist/components/ExportModal/index.js.map +1 -1
- package/dist/components/FadeScroller/index.cjs +327 -0
- package/dist/components/FadeScroller/index.cjs.map +1 -0
- package/dist/components/FadeScroller/index.js +23 -29
- package/dist/components/FadeScroller/index.js.map +1 -1
- package/dist/components/FeatureCard/index.cjs +168 -0
- package/dist/components/FeatureCard/index.cjs.map +1 -0
- package/dist/components/FeatureCard/index.js +45 -84
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/GlobalModalsWrapper/index.cjs +46 -0
- package/dist/components/GlobalModalsWrapper/index.cjs.map +1 -0
- package/dist/components/GlobalModalsWrapper/index.js +13 -16
- package/dist/components/GlobalModalsWrapper/index.js.map +1 -1
- package/dist/components/Header/index.cjs +70 -0
- package/dist/components/Header/index.cjs.map +1 -0
- package/dist/components/Header/index.js +21 -33
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.cjs +195 -0
- package/dist/components/Icon/index.cjs.map +1 -0
- package/dist/components/Icon/index.js +41 -77
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconPicker/index.cjs +236 -0
- package/dist/components/IconPicker/index.cjs.map +1 -0
- package/dist/components/IconPicker/index.js +41 -80
- package/dist/components/IconPicker/index.js.map +1 -1
- package/dist/components/Input/index.cjs +203 -0
- package/dist/components/Input/index.cjs.map +1 -0
- package/dist/components/Input/index.js +55 -94
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.cjs +62 -0
- package/dist/components/InputClearButton/index.cjs.map +1 -0
- package/dist/components/InputClearButton/index.js +14 -20
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.cjs +315 -0
- package/dist/components/InternalPopover/index.cjs.map +1 -0
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +53 -95
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyValueTable/index.cjs +108 -0
- package/dist/components/KeyValueTable/index.cjs.map +1 -0
- package/dist/components/KeyValueTable/index.js +11 -18
- package/dist/components/KeyValueTable/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.cjs +69 -0
- package/dist/components/KeyboardShortcut/index.cjs.map +1 -0
- package/dist/components/KeyboardShortcut/index.js +22 -28
- package/dist/components/KeyboardShortcut/index.js.map +1 -1
- package/dist/components/Label/index.cjs +24 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.js +5 -11
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/content.cjs +41 -0
- package/dist/components/Layout/content.cjs.map +1 -0
- package/dist/components/Layout/content.js +5 -10
- package/dist/components/Layout/content.js.map +1 -1
- package/dist/components/Layout/index.cjs +79 -0
- package/dist/components/Layout/index.cjs.map +1 -0
- package/dist/components/Layout/index.js +8 -46
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/Link/index.cjs +168 -0
- package/dist/components/Link/index.cjs.map +1 -0
- package/dist/components/Link/index.js +24 -63
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.cjs +98 -0
- package/dist/components/Menu/divider.cjs.map +1 -0
- package/dist/components/Menu/divider.js +20 -56
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.cjs +135 -0
- package/dist/components/Menu/index.cjs.map +1 -0
- package/dist/components/Menu/index.js +29 -67
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/item.cjs +99 -0
- package/dist/components/Menu/item.cjs.map +1 -0
- package/dist/components/Menu/item.js +18 -20
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Menu/section.cjs +59 -0
- package/dist/components/Menu/section.cjs.map +1 -0
- package/dist/components/Menu/section.js +12 -19
- package/dist/components/Menu/section.js.map +1 -1
- package/dist/components/Message/index.cjs +78 -0
- package/dist/components/Message/index.cjs.map +1 -0
- package/dist/components/Message/index.js +28 -33
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Modal/index.cjs +67 -0
- package/dist/components/Modal/index.cjs.map +1 -0
- package/dist/components/Modal/index.js +15 -18
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultiSelect/index.cjs +36 -0
- package/dist/components/MultiSelect/index.cjs.map +1 -0
- package/dist/components/MultiSelect/index.d.ts +3 -3
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.js +4 -10
- package/dist/components/MultiSelect/index.js.map +1 -1
- package/dist/components/NavRail/index.cjs +666 -0
- package/dist/components/NavRail/index.cjs.map +1 -0
- package/dist/components/NavRail/index.js +106 -145
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Navbar/divider.cjs +47 -0
- package/dist/components/Navbar/divider.cjs.map +1 -0
- package/dist/components/Navbar/divider.js +9 -14
- package/dist/components/Navbar/divider.js.map +1 -1
- package/dist/components/Navbar/group.cjs +85 -0
- package/dist/components/Navbar/group.cjs.map +1 -0
- package/dist/components/Navbar/group.js +9 -45
- package/dist/components/Navbar/group.js.map +1 -1
- package/dist/components/Navbar/index.cjs +97 -0
- package/dist/components/Navbar/index.cjs.map +1 -0
- package/dist/components/Navbar/index.js +17 -53
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Navbar/item.cjs +98 -0
- package/dist/components/Navbar/item.cjs.map +1 -0
- package/dist/components/Navbar/item.js +15 -50
- package/dist/components/Navbar/item.js.map +1 -1
- package/dist/components/Notifications/index.cjs +66 -0
- package/dist/components/Notifications/index.cjs.map +1 -0
- package/dist/components/Notifications/index.js +9 -44
- package/dist/components/Notifications/index.js.map +1 -1
- package/dist/components/Notifications/notification.cjs +343 -0
- package/dist/components/Notifications/notification.cjs.map +1 -0
- package/dist/components/Notifications/notification.js +79 -125
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.cjs +131 -0
- package/dist/components/Notifications/styles.cjs.map +1 -0
- package/dist/components/Notifications/styles.js +33 -69
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Paging/index.cjs +173 -0
- package/dist/components/Paging/index.cjs.map +1 -0
- package/dist/components/Paging/index.js +24 -63
- package/dist/components/Paging/index.js.map +1 -1
- package/dist/components/Panel/LabelEditor.cjs +62 -0
- package/dist/components/Panel/LabelEditor.cjs.map +1 -0
- package/dist/components/Panel/LabelEditor.d.ts.map +1 -1
- package/dist/components/Panel/LabelEditor.js +26 -62
- package/dist/components/Panel/LabelEditor.js.map +1 -1
- package/dist/components/Panel/NonResponsiveActions.cjs +47 -0
- package/dist/components/Panel/NonResponsiveActions.cjs.map +1 -0
- package/dist/components/Panel/NonResponsiveActions.js +9 -15
- package/dist/components/Panel/NonResponsiveActions.js.map +1 -1
- package/dist/components/Panel/index.cjs +1054 -0
- package/dist/components/Panel/index.cjs.map +1 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +190 -260
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.cjs +55 -0
- package/dist/components/Paragraph/index.cjs.map +1 -0
- package/dist/components/Paragraph/index.d.ts +0 -8
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +13 -19
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Popover/index.cjs +348 -0
- package/dist/components/Popover/index.cjs.map +1 -0
- package/dist/components/Popover/index.d.ts +0 -25
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +41 -90
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Progress/index.cjs +187 -0
- package/dist/components/Progress/index.cjs.map +1 -0
- package/dist/components/Progress/index.js +40 -78
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/RadioGroup/index.cjs +42 -0
- package/dist/components/RadioGroup/index.cjs.map +1 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +9 -23
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/Rating/index.cjs +207 -0
- package/dist/components/Rating/index.cjs.map +1 -0
- package/dist/components/Rating/index.js +43 -81
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +424 -0
- package/dist/components/RichTextEditor/index.cjs.map +1 -0
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +113 -338
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/SegmentedControl/index.cjs +364 -0
- package/dist/components/SegmentedControl/index.cjs.map +1 -0
- package/dist/components/SegmentedControl/index.js +59 -97
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/index.cjs +363 -0
- package/dist/components/Select/index.cjs.map +1 -0
- package/dist/components/Select/index.d.ts +29 -67
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +140 -73
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SeverityRow/index.cjs +207 -0
- package/dist/components/SeverityRow/index.cjs.map +1 -0
- package/dist/components/SeverityRow/index.js +47 -85
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Skeleton/index.cjs +58 -0
- package/dist/components/Skeleton/index.cjs.map +1 -0
- package/dist/components/Skeleton/index.js +9 -46
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/index.cjs +154 -0
- package/dist/components/Slider/index.cjs.map +1 -0
- package/dist/components/Slider/index.js +37 -76
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Spacer/index.cjs +138 -0
- package/dist/components/Spacer/index.cjs.map +1 -0
- package/dist/components/Spacer/index.js +25 -61
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Span/index.cjs +61 -0
- package/dist/components/Span/index.cjs.map +1 -0
- package/dist/components/Span/index.js +13 -19
- package/dist/components/Span/index.js.map +1 -1
- package/dist/components/Spinner/index.cjs +44 -0
- package/dist/components/Spinner/index.cjs.map +1 -0
- package/dist/components/Spinner/index.js +9 -16
- package/dist/components/Spinner/index.js.map +1 -1
- package/dist/components/StackedBar/index.cjs +209 -0
- package/dist/components/StackedBar/index.cjs.map +1 -0
- package/dist/components/StackedBar/index.js +34 -69
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.cjs +161 -0
- package/dist/components/Statistic/index.cjs.map +1 -0
- package/dist/components/Statistic/index.js +35 -73
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/body.cjs +265 -0
- package/dist/components/Table/body.cjs.map +1 -0
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +48 -107
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.cjs +179 -0
- package/dist/components/Table/cell.cjs.map +1 -0
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +29 -68
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/header.cjs +170 -0
- package/dist/components/Table/header.cjs.map +1 -0
- package/dist/components/Table/header.js +33 -69
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.cjs +277 -0
- package/dist/components/Table/headerCell.cjs.map +1 -0
- package/dist/components/Table/headerCell.js +26 -65
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.cjs +386 -0
- package/dist/components/Table/helpers.cjs.map +1 -0
- package/dist/components/Table/helpers.d.ts +28 -62
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +111 -189
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.cjs +682 -0
- package/dist/components/Table/index.cjs.map +1 -0
- package/dist/components/Table/index.d.ts +2 -30
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +95 -142
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.cjs +345 -0
- package/dist/components/Table/row.cjs.map +1 -0
- package/dist/components/Table/row.d.ts +1 -29
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +60 -163
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/scrollbar.cjs +201 -0
- package/dist/components/Table/scrollbar.cjs.map +1 -0
- package/dist/components/Table/scrollbar.js +31 -37
- package/dist/components/Table/scrollbar.js.map +1 -1
- package/dist/components/Table/value.cjs +26 -0
- package/dist/components/Table/value.cjs.map +1 -0
- package/dist/components/Table/value.js +9 -15
- package/dist/components/Table/value.js.map +1 -1
- package/dist/components/Tabs/content.cjs +63 -0
- package/dist/components/Tabs/content.cjs.map +1 -0
- package/dist/components/Tabs/content.js +12 -17
- package/dist/components/Tabs/content.js.map +1 -1
- package/dist/components/Tabs/index.cjs +109 -0
- package/dist/components/Tabs/index.cjs.map +1 -0
- package/dist/components/Tabs/index.js +14 -52
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.cjs +136 -0
- package/dist/components/Tabs/item.cjs.map +1 -0
- package/dist/components/Tabs/item.js +26 -65
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.cjs +322 -0
- package/dist/components/Tabs/list.cjs.map +1 -0
- package/dist/components/Tabs/list.js +60 -101
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.cjs +107 -0
- package/dist/components/Tag/group.cjs.map +1 -0
- package/dist/components/Tag/group.js +11 -49
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.cjs +343 -0
- package/dist/components/Tag/index.cjs.map +1 -0
- package/dist/components/Tag/index.d.ts +2 -5
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +92 -140
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.cjs +166 -0
- package/dist/components/Testimonial/index.cjs.map +1 -0
- package/dist/components/Testimonial/index.js +44 -82
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.cjs +220 -0
- package/dist/components/Textarea/index.cjs.map +1 -0
- package/dist/components/Textarea/index.d.ts +0 -10
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +63 -159
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tier/index.cjs +107 -0
- package/dist/components/Tier/index.cjs.map +1 -0
- package/dist/components/Tier/index.js +19 -58
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/TimeAgo/index.cjs +27 -0
- package/dist/components/TimeAgo/index.cjs.map +1 -0
- package/dist/components/TimeAgo/index.js +9 -16
- package/dist/components/TimeAgo/index.js.map +1 -1
- package/dist/components/Timeline/index.cjs +416 -0
- package/dist/components/Timeline/index.cjs.map +1 -0
- package/dist/components/Timeline/index.js +78 -117
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/TooltipComponent/index.cjs +37 -0
- package/dist/components/TooltipComponent/index.cjs.map +1 -0
- package/dist/components/TooltipComponent/index.js +7 -10
- package/dist/components/TooltipComponent/index.js.map +1 -1
- package/dist/components/Tree/index.cjs +321 -0
- package/dist/components/Tree/index.cjs.map +1 -0
- package/dist/components/Tree/index.d.ts +1 -2
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +70 -99
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/components/Tree/modal.cjs +38 -0
- package/dist/components/Tree/modal.cjs.map +1 -0
- package/dist/components/Tree/modal.js +13 -20
- package/dist/components/Tree/modal.js.map +1 -1
- package/dist/constants/animations.cjs +12 -0
- package/dist/constants/animations.cjs.map +1 -0
- package/dist/constants/animations.js +2 -5
- package/dist/constants/animations.js.map +1 -1
- package/dist/constants/colors.cjs +16 -0
- package/dist/constants/colors.cjs.map +1 -0
- package/dist/constants/colors.js +2 -5
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/fonts.cjs +28 -0
- package/dist/constants/fonts.cjs.map +1 -0
- package/dist/constants/fonts.js +6 -10
- package/dist/constants/fonts.js.map +1 -1
- package/dist/constants/paging.cjs +63 -0
- package/dist/constants/paging.cjs.map +1 -0
- package/dist/constants/paging.js +2 -6
- package/dist/constants/paging.js.map +1 -1
- package/dist/constants/sizes.cjs +462 -0
- package/dist/constants/sizes.cjs.map +1 -0
- package/dist/constants/sizes.js +51 -55
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.cjs +43 -0
- package/dist/constants/theme.cjs.map +1 -0
- package/dist/constants/theme.js +19 -22
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/Paging.cjs +52 -0
- package/dist/containers/Paging.cjs.map +1 -0
- package/dist/containers/Paging.js +13 -16
- package/dist/containers/Paging.js.map +1 -1
- package/dist/containers/ReqoreProvider.cjs +275 -0
- package/dist/containers/ReqoreProvider.cjs.map +1 -0
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +52 -62
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/ThemeProvider.cjs +17 -0
- package/dist/containers/ThemeProvider.cjs.map +1 -0
- package/dist/containers/ThemeProvider.js +8 -13
- package/dist/containers/ThemeProvider.js.map +1 -1
- package/dist/containers/UIProvider.cjs +96 -0
- package/dist/containers/UIProvider.cjs.map +1 -0
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +31 -63
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/CustomThemeContext.cjs +6 -0
- package/dist/context/CustomThemeContext.cjs.map +1 -0
- package/dist/context/CustomThemeContext.js +3 -5
- package/dist/context/CustomThemeContext.js.map +1 -1
- package/dist/context/ReqoreContext.cjs +25 -0
- package/dist/context/ReqoreContext.cjs.map +1 -0
- package/dist/context/ReqoreContext.js +4 -6
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/context/ThemeContext.cjs +6 -0
- package/dist/context/ThemeContext.cjs.map +1 -0
- package/dist/context/ThemeContext.js +3 -5
- package/dist/context/ThemeContext.js.map +1 -1
- package/dist/helpers/animations.cjs +11 -0
- package/dist/helpers/animations.cjs.map +1 -0
- package/dist/helpers/animations.js +2 -5
- package/dist/helpers/animations.js.map +1 -1
- package/dist/helpers/colors.cjs +273 -0
- package/dist/helpers/colors.cjs.map +1 -0
- package/dist/helpers/colors.js +78 -103
- package/dist/helpers/colors.js.map +1 -1
- package/dist/helpers/dates.cjs +62 -0
- package/dist/helpers/dates.cjs.map +1 -0
- package/dist/helpers/dates.js +8 -17
- package/dist/helpers/dates.js.map +1 -1
- package/dist/helpers/portal.cjs +32 -0
- package/dist/helpers/portal.cjs.map +1 -0
- package/dist/helpers/portal.d.ts +18 -0
- package/dist/helpers/portal.d.ts.map +1 -0
- package/dist/helpers/portal.js +27 -0
- package/dist/helpers/portal.js.map +1 -0
- package/dist/helpers/search.cjs +63 -0
- package/dist/helpers/search.cjs.map +1 -0
- package/dist/helpers/search.js +5 -11
- package/dist/helpers/search.js.map +1 -1
- package/dist/helpers/shortcuts.cjs +152 -0
- package/dist/helpers/shortcuts.cjs.map +1 -0
- package/dist/helpers/shortcuts.js +7 -14
- package/dist/helpers/shortcuts.js.map +1 -1
- package/dist/helpers/styled.cjs +46 -0
- package/dist/helpers/styled.cjs.map +1 -0
- package/dist/helpers/styled.js +1 -5
- package/dist/helpers/styled.js.map +1 -1
- package/dist/helpers/time.cjs +25 -0
- package/dist/helpers/time.cjs.map +1 -0
- package/dist/helpers/time.js +1 -5
- package/dist/helpers/time.js.map +1 -1
- package/dist/helpers/utils.cjs +294 -0
- package/dist/helpers/utils.cjs.map +1 -0
- package/dist/helpers/utils.js +38 -58
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/useAutoFocus.cjs +84 -0
- package/dist/hooks/useAutoFocus.cjs.map +1 -0
- package/dist/hooks/useAutoFocus.js +10 -14
- package/dist/hooks/useAutoFocus.js.map +1 -1
- package/dist/hooks/useCloneThroughFragments.cjs +63 -0
- package/dist/hooks/useCloneThroughFragments.cjs.map +1 -0
- package/dist/hooks/useCloneThroughFragments.js +8 -45
- package/dist/hooks/useCloneThroughFragments.js.map +1 -1
- package/dist/hooks/useCombinedRefs.cjs +44 -0
- package/dist/hooks/useCombinedRefs.cjs.map +1 -0
- package/dist/hooks/useCombinedRefs.js +5 -11
- package/dist/hooks/useCombinedRefs.js.map +1 -1
- package/dist/hooks/useComponentTooltip.cjs +34 -0
- package/dist/hooks/useComponentTooltip.cjs.map +1 -0
- package/dist/hooks/useComponentTooltip.js +7 -11
- package/dist/hooks/useComponentTooltip.js.map +1 -1
- package/dist/hooks/useFitTextSize.cjs +75 -0
- package/dist/hooks/useFitTextSize.cjs.map +1 -0
- package/dist/hooks/useFitTextSize.js +9 -13
- package/dist/hooks/useFitTextSize.js.map +1 -1
- package/dist/hooks/useFocusTrap.cjs +119 -0
- package/dist/hooks/useFocusTrap.cjs.map +1 -0
- package/dist/hooks/useFocusTrap.js +7 -10
- package/dist/hooks/useFocusTrap.js.map +1 -1
- package/dist/hooks/useLatestZIndex.cjs +12 -0
- package/dist/hooks/useLatestZIndex.cjs.map +1 -0
- package/dist/hooks/useLatestZIndex.js +6 -8
- package/dist/hooks/useLatestZIndex.js.map +1 -1
- package/dist/hooks/useMarqueeOnHover.cjs +292 -0
- package/dist/hooks/useMarqueeOnHover.cjs.map +1 -0
- package/dist/hooks/useMarqueeOnHover.js +25 -34
- package/dist/hooks/useMarqueeOnHover.js.map +1 -1
- package/dist/hooks/useNarrowContainer.cjs +68 -0
- package/dist/hooks/useNarrowContainer.cjs.map +1 -0
- package/dist/hooks/useNarrowContainer.js +8 -12
- package/dist/hooks/useNarrowContainer.js.map +1 -1
- package/dist/hooks/useOutsideClick.cjs +19 -0
- package/dist/hooks/useOutsideClick.cjs.map +1 -0
- package/dist/hooks/useOutsideClick.js +4 -6
- package/dist/hooks/useOutsideClick.js.map +1 -1
- package/dist/hooks/usePaging.cjs +152 -0
- package/dist/hooks/usePaging.cjs.map +1 -0
- package/dist/hooks/usePaging.js +20 -27
- package/dist/hooks/usePaging.js.map +1 -1
- package/dist/hooks/useQueryWithDelay.cjs +25 -0
- package/dist/hooks/useQueryWithDelay.cjs.map +1 -0
- package/dist/hooks/useQueryWithDelay.js +8 -12
- package/dist/hooks/useQueryWithDelay.js.map +1 -1
- package/dist/hooks/useReqore.cjs +17 -0
- package/dist/hooks/useReqore.cjs.map +1 -0
- package/dist/hooks/useReqore.js +4 -11
- package/dist/hooks/useReqore.js.map +1 -1
- package/dist/hooks/useReqoreContext.cjs +19 -0
- package/dist/hooks/useReqoreContext.cjs.map +1 -0
- package/dist/hooks/useReqoreContext.js +4 -11
- package/dist/hooks/useReqoreContext.js.map +1 -1
- package/dist/hooks/useReqoreEffect.cjs +34 -0
- package/dist/hooks/useReqoreEffect.cjs.map +1 -0
- package/dist/hooks/useReqoreEffect.js +5 -9
- package/dist/hooks/useReqoreEffect.js.map +1 -1
- package/dist/hooks/useScrollFade.cjs +70 -0
- package/dist/hooks/useScrollFade.cjs.map +1 -0
- package/dist/hooks/useScrollFade.js +8 -12
- package/dist/hooks/useScrollFade.js.map +1 -1
- package/dist/hooks/useTextareaAutoSize.cjs +22 -0
- package/dist/hooks/useTextareaAutoSize.cjs.map +1 -0
- package/dist/hooks/useTextareaAutoSize.js +3 -5
- package/dist/hooks/useTextareaAutoSize.js.map +1 -1
- package/dist/hooks/useTheme.cjs +49 -0
- package/dist/hooks/useTheme.cjs.map +1 -0
- package/dist/hooks/useTheme.js +15 -22
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/hooks/useWhyDidYouUpdate.cjs +46 -0
- package/dist/hooks/useWhyDidYouUpdate.cjs.map +1 -0
- package/dist/hooks/useWhyDidYouUpdate.js +4 -7
- package/dist/hooks/useWhyDidYouUpdate.js.map +1 -1
- package/dist/index.cjs +271 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +90 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -283
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/styles.cjs +88 -0
- package/dist/styles.cjs.map +1 -0
- package/dist/styles.js +22 -58
- package/dist/styles.js.map +1 -1
- package/dist/types/global.cjs +3 -0
- package/dist/types/global.cjs.map +1 -0
- package/dist/types/global.js +1 -2
- package/dist/types/icons.cjs +3 -0
- package/dist/types/icons.cjs.map +1 -0
- package/dist/types/icons.js +1 -2
- package/package.json +9 -6
- package/dist/components/Panel/responsive.d.ts +0 -21
- package/dist/components/Panel/responsive.d.ts.map +0 -1
- package/dist/components/Panel/responsive.js +0 -27
- package/dist/components/Panel/responsive.js.map +0 -1
- package/dist/helpers/selectItem.d.ts +0 -32
- package/dist/helpers/selectItem.d.ts.map +0 -1
- package/dist/helpers/selectItem.js +0 -142
- package/dist/helpers/selectItem.js.map +0 -1
- package/dist/helpers/tableGeometry.d.ts +0 -75
- package/dist/helpers/tableGeometry.d.ts.map +0 -1
- package/dist/helpers/tableGeometry.js +0 -168
- package/dist/helpers/tableGeometry.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -30,106 +29,29 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
30
29
|
}
|
|
31
30
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
31
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
var utils_1 = require("../../helpers/utils");
|
|
48
|
-
var Paragraph_1 = require("../Paragraph");
|
|
49
|
-
var Span_1 = require("../Span");
|
|
50
|
-
var Tag_1 = __importDefault(require("../Tag"));
|
|
51
|
-
/* Stable identities for the optional props' defaults.
|
|
52
|
-
*
|
|
53
|
-
* Written as literals in the destructuring (`tagsProps = {}`,
|
|
54
|
-
* `getTagProps = () => ({})`) they were rebuilt on EVERY render, which put a
|
|
55
|
-
* new identity into `renderElement`'s dependency list every time — and
|
|
56
|
-
* slate-react's own `ElementComponent` memo compares `renderElement` by
|
|
57
|
-
* identity. So an unstable default made every element in the document
|
|
58
|
-
* re-render on every keystroke, including chips nothing had touched. Hoisting
|
|
59
|
-
* them costs nothing and is the whole fix for the common case, where the
|
|
60
|
-
* consumer passes neither prop. */
|
|
61
|
-
var NO_TAG_PROPS = function () { return ({}); };
|
|
62
|
-
var EMPTY_TAG_PROPS = {};
|
|
63
|
-
var EMPTY_TAGS_LIST_PROPS = {};
|
|
64
|
-
exports.TemplateElement = (0, react_1.memo)(function (props) {
|
|
32
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
+
import isPropValid from '@emotion/is-prop-valid';
|
|
34
|
+
import { map, size } from 'lodash';
|
|
35
|
+
import { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useState } from 'react';
|
|
36
|
+
import { useUpdateEffect } from 'react-use';
|
|
37
|
+
import { createEditor, Editor, Transforms } from 'slate';
|
|
38
|
+
import { withHistory } from 'slate-history';
|
|
39
|
+
import { Editable, ReactEditor, Slate, useSelected, withReact } from 'slate-react';
|
|
40
|
+
import { ReqoreButton, ReqoreControlGroup, ReqorePanel, ReqoreTextarea } from '../../index.js';
|
|
41
|
+
import { getOneLessSize } from '../../helpers/utils.js';
|
|
42
|
+
import { ReqoreP } from '../Paragraph/index.js';
|
|
43
|
+
import { ReqoreSpan } from '../Span/index.js';
|
|
44
|
+
import ReqoreTag from '../Tag/index.js';
|
|
45
|
+
export var TemplateElement = memo(function (props) {
|
|
65
46
|
var _a, _b;
|
|
66
|
-
var selected =
|
|
67
|
-
var
|
|
68
|
-
var readOnly = (0, slate_react_1.useReadOnly)();
|
|
69
|
-
/* A chip is an inline VOID: it holds no text of its own, so a click on it has
|
|
70
|
-
no text position to land in and the browser places the cursor nowhere. This
|
|
71
|
-
handler used to `preventDefault()` + `stopPropagation()` and stop there,
|
|
72
|
-
which made the chip a dead spot.
|
|
73
|
-
|
|
74
|
-
That is not merely a missing convenience. A field whose entire value is one
|
|
75
|
-
reference renders as one chip and nothing else, so the chip IS the control:
|
|
76
|
-
with no way to get a cursor into the editor, nothing could be typed into it
|
|
77
|
-
at all. Reported against a Qorus test assertion's `Value`, where it made a
|
|
78
|
-
path deeper than any offered candidate — the case the rich-text control
|
|
79
|
-
exists for — impossible to write by hand.
|
|
80
|
-
|
|
81
|
-
The cursor goes AFTER the chip, which is where a walk is continued
|
|
82
|
-
(`$.order.id` -> `$.order.id.value`). Both calls above are kept and are
|
|
83
|
-
load-bearing: `preventDefault` stops the browser racing us to a position of
|
|
84
|
-
its own, and `stopPropagation` keeps the click from reaching a host row that
|
|
85
|
-
treats a click as "collapse me". The selection is then set explicitly rather
|
|
86
|
-
than left to the browser, so where the cursor lands does not depend on which
|
|
87
|
-
pixel of the chip was hit.
|
|
88
|
-
|
|
89
|
-
Removing a chip is unaffected: that is the tag's own `×`
|
|
90
|
-
(`onRemoveClick`), not a click on its body. */
|
|
91
|
-
var handleClick = (0, react_1.useCallback)(function (e) {
|
|
92
|
-
var _a, _b, _c;
|
|
47
|
+
var selected = useSelected();
|
|
48
|
+
var handleClick = useCallback(function (e) {
|
|
93
49
|
e.preventDefault();
|
|
94
50
|
e.stopPropagation();
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// this element used to be overridden by it rather than run alongside it.
|
|
98
|
-
(_b = (_a = props.tagProps) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
99
|
-
// A read-only surface has no cursor to give.
|
|
100
|
-
if (readOnly) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
var path = slate_react_1.ReactEditor.findPath(editor, props.element);
|
|
105
|
-
// From the void's END, and skipping voids. Asking for the point after
|
|
106
|
-
// the void's PATH can resolve to a point INSIDE its own empty text
|
|
107
|
-
// child, where typing is silently ignored — the cursor reads as placed
|
|
108
|
-
// (the DOM selection is real and inside the editor) and the editor
|
|
109
|
-
// still accepts nothing, which is a worse failure than an obvious one.
|
|
110
|
-
// The fallback covers a void that ends the document with no text node
|
|
111
|
-
// after it; a well-formed document always has one.
|
|
112
|
-
var point = (_c = slate_1.Editor.after(editor, slate_1.Editor.end(editor, path), { voids: false })) !== null && _c !== void 0 ? _c : slate_1.Editor.end(editor, []);
|
|
113
|
-
// Focus BEFORE selecting. `ReactEditor.focus` restores the editor's
|
|
114
|
-
// previous selection as it takes focus, so focusing afterwards throws
|
|
115
|
-
// away the point just set — which cost the FIRST character typed after
|
|
116
|
-
// a chip click and nothing else, the kind of loss that reads as a
|
|
117
|
-
// flaky keyboard rather than a bug.
|
|
118
|
-
slate_react_1.ReactEditor.focus(editor);
|
|
119
|
-
slate_1.Transforms.select(editor, point);
|
|
120
|
-
}
|
|
121
|
-
catch (_d) {
|
|
122
|
-
// The element can be gone between render and click (a re-render that
|
|
123
|
-
// replaced the value). Losing the cursor is the right outcome then, and
|
|
124
|
-
// it must not take the click handler down with it.
|
|
125
|
-
}
|
|
126
|
-
}, [editor, props.element, props.tagProps, readOnly]);
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Tag_1.default, __assign({}, props.attributes, { compact: true, flat: false, asBadge: true, fixed: 'key', tooltip: (_a = props.element.value) === null || _a === void 0 ? void 0 : _a.toString(), label: props.element.label }, props.tagProps, {
|
|
128
|
-
// AFTER the spread on purpose: `tagProps` carries an `onClick` of its
|
|
129
|
-
// own, so declaring this before it meant this handler never ran at all.
|
|
130
|
-
onClick: handleClick, contentEditable: false, intent: selected ? 'info' : (_b = props.tagProps) === null || _b === void 0 ? void 0 : _b.intent })), props.children] }));
|
|
51
|
+
}, []);
|
|
52
|
+
return (_jsxs(_Fragment, { children: [_jsx(ReqoreTag, __assign({}, props.attributes, { compact: true, flat: false, asBadge: true, fixed: 'key', onClick: handleClick, tooltip: (_a = props.element.value) === null || _a === void 0 ? void 0 : _a.toString(), label: props.element.label }, props.tagProps, { contentEditable: false, intent: selected ? 'info' : (_b = props.tagProps) === null || _b === void 0 ? void 0 : _b.intent })), props.children] }));
|
|
131
53
|
});
|
|
132
|
-
var withTemplates = function (editor) {
|
|
54
|
+
export var withTemplates = function (editor) {
|
|
133
55
|
var isInline = editor.isInline, isVoid = editor.isVoid, markableVoid = editor.markableVoid;
|
|
134
56
|
editor.isInline = function (element) {
|
|
135
57
|
return element.type === 'tag' ? true : isInline(element);
|
|
@@ -142,32 +64,30 @@ var withTemplates = function (editor) {
|
|
|
142
64
|
};
|
|
143
65
|
return editor;
|
|
144
66
|
};
|
|
145
|
-
exports.withTemplates = withTemplates;
|
|
146
67
|
var Leaf = function (_a) {
|
|
147
68
|
var attributes = _a.attributes, children = _a.children, leaf = _a.leaf;
|
|
148
69
|
if (leaf.bold) {
|
|
149
|
-
children = (
|
|
70
|
+
children = _jsx("strong", { children: children });
|
|
150
71
|
}
|
|
151
72
|
if (leaf.code) {
|
|
152
|
-
children = (
|
|
73
|
+
children = _jsx("code", { children: children });
|
|
153
74
|
}
|
|
154
75
|
if (leaf.italic) {
|
|
155
|
-
children = (
|
|
76
|
+
children = _jsx("em", { children: children });
|
|
156
77
|
}
|
|
157
78
|
if (leaf.underline) {
|
|
158
|
-
children = (
|
|
79
|
+
children = _jsx("u", { children: children });
|
|
159
80
|
}
|
|
160
|
-
return ((
|
|
81
|
+
return (_jsx(ReqoreSpan, __assign({ inline: true }, attributes, { effect: {
|
|
161
82
|
weight: leaf.bold ? 'bold' : 'normal',
|
|
162
83
|
italic: leaf.italic,
|
|
163
84
|
underline: leaf.underline,
|
|
164
85
|
}, children: children })));
|
|
165
86
|
};
|
|
166
|
-
var DefaultElement = function (props) {
|
|
87
|
+
export var DefaultElement = function (props) {
|
|
167
88
|
var _a;
|
|
168
|
-
return ((
|
|
89
|
+
return (_jsxs(ReqoreP, __assign({}, props.attributes, { style: { position: 'relative' }, children: [props.placeholder && (_jsx(ReqoreSpan, __assign({ inline: true, effect: { opacity: 0.3 } }, props.placeholderProps, { contentEditable: false, style: __assign({ position: 'absolute', top: 0, left: 0, right: 0, pointerEvents: 'none', userSelect: 'none' }, (_a = props.placeholderProps) === null || _a === void 0 ? void 0 : _a.style), children: props.placeholder }))), props.children] })));
|
|
169
90
|
};
|
|
170
|
-
exports.DefaultElement = DefaultElement;
|
|
171
91
|
var insertTag = function (editor, value, label, metadata) {
|
|
172
92
|
var mention = {
|
|
173
93
|
type: 'tag',
|
|
@@ -176,8 +96,8 @@ var insertTag = function (editor, value, label, metadata) {
|
|
|
176
96
|
metadata: metadata,
|
|
177
97
|
children: [{ text: '' }],
|
|
178
98
|
};
|
|
179
|
-
|
|
180
|
-
|
|
99
|
+
Transforms.insertNodes(editor, mention);
|
|
100
|
+
Transforms.move(editor);
|
|
181
101
|
};
|
|
182
102
|
/**
|
|
183
103
|
* Slate props that are not DOM attributes and must survive the filter below.
|
|
@@ -225,50 +145,50 @@ var NON_EDITABLE_PROPS = new Set(['cols', 'fill', 'rows', 'value']);
|
|
|
225
145
|
* silently. Apply the same rule styled-components applies for a tag target,
|
|
226
146
|
* plus the Slate props it has no way to know about.
|
|
227
147
|
*/
|
|
228
|
-
var RefSafeSlateEditable =
|
|
148
|
+
var RefSafeSlateEditable = memo(forwardRef(function (props, ref) {
|
|
229
149
|
// Accept the polymorphic input's DOM-ref contract without passing it to
|
|
230
150
|
// Slate's function component. Slate owns this element through ReactEditor.
|
|
231
151
|
void ref;
|
|
232
152
|
// Not memoised: `memo` above already skips the re-render when the props are
|
|
233
153
|
// shallow-equal, so every render that reaches here has new props to filter.
|
|
234
154
|
var editableProps = Object.keys(props).reduce(function (acc, key) {
|
|
235
|
-
if (!NON_EDITABLE_PROPS.has(key) && (SLATE_EDITABLE_PROPS.has(key) || (
|
|
155
|
+
if (!NON_EDITABLE_PROPS.has(key) && (SLATE_EDITABLE_PROPS.has(key) || isPropValid(key))) {
|
|
236
156
|
acc[key] = props[key];
|
|
237
157
|
}
|
|
238
158
|
return acc;
|
|
239
159
|
}, {});
|
|
240
|
-
return (
|
|
160
|
+
return _jsx(Editable, __assign({}, editableProps));
|
|
241
161
|
}));
|
|
242
162
|
RefSafeSlateEditable.displayName = 'RefSafeSlateEditable';
|
|
243
|
-
|
|
163
|
+
export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
|
|
244
164
|
var _b = _a.value, value = _b === void 0 ? [
|
|
245
165
|
{
|
|
246
166
|
type: 'paragraph',
|
|
247
167
|
children: [{ text: '' }],
|
|
248
168
|
},
|
|
249
|
-
] : _b, onChange = _a.onChange, tags = _a.tags, _c = _a.getTagProps, getTagProps = _c === void 0 ?
|
|
169
|
+
] : _b, onChange = _a.onChange, tags = _a.tags, _c = _a.getTagProps, getTagProps = _c === void 0 ? function () { return ({}); } : _c, _d = _a.tagsProps, tagsProps = _d === void 0 ? {} : _d, onTagClick = _a.onTagClick, _e = _a.tagsListProps, tagsListProps = _e === void 0 ? {} : _e, panelProps = _a.panelProps, actions = _a.actions, customRenderLeaf = _a.customRenderLeaf, decorate = _a.decorate, placeholder = _a.placeholder, placeholderProps = _a.placeholderProps, onFocus = _a.onFocus, onFocusCapture = _a.onFocusCapture, rest = __rest(_a, ["value", "onChange", "tags", "getTagProps", "tagsProps", "onTagClick", "tagsListProps", "panelProps", "actions", "customRenderLeaf", "decorate", "placeholder", "placeholderProps", "onFocus", "onFocusCapture"]);
|
|
250
170
|
// Create a Slate editor object that won't change across renders.
|
|
251
|
-
var editor =
|
|
252
|
-
|
|
253
|
-
var _f =
|
|
254
|
-
|
|
171
|
+
var editor = useState(function () { return withTemplates(withReact(withHistory(createEditor()))); })[0];
|
|
172
|
+
useImperativeHandle(ref, function () { return editor; }, [editor]);
|
|
173
|
+
var _f = useState(), target = _f[0], setTarget = _f[1];
|
|
174
|
+
useUpdateEffect(function () {
|
|
255
175
|
// Only update the editor's children if the value has changed
|
|
256
176
|
if (JSON.stringify(value) === JSON.stringify(editor.children)) {
|
|
257
177
|
return;
|
|
258
178
|
}
|
|
259
179
|
// Use Slate transforms instead of direct mutation
|
|
260
180
|
try {
|
|
261
|
-
|
|
181
|
+
Editor.withoutNormalizing(editor, function () {
|
|
262
182
|
// Deselect before replacing content
|
|
263
|
-
|
|
183
|
+
Transforms.deselect(editor);
|
|
264
184
|
// Remove all existing top-level nodes
|
|
265
185
|
while (editor.children.length) {
|
|
266
|
-
|
|
186
|
+
Transforms.removeNodes(editor, { at: [0] });
|
|
267
187
|
}
|
|
268
188
|
// Insert new content
|
|
269
|
-
|
|
189
|
+
Transforms.insertNodes(editor, value, { at: [0] });
|
|
270
190
|
// Move selection to end
|
|
271
|
-
|
|
191
|
+
Transforms.select(editor, Editor.end(editor, []));
|
|
272
192
|
});
|
|
273
193
|
}
|
|
274
194
|
catch (error) {
|
|
@@ -277,62 +197,51 @@ exports.ReqoreRichTextEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
277
197
|
editor.children = value;
|
|
278
198
|
}
|
|
279
199
|
}, [JSON.stringify(value)]);
|
|
280
|
-
var isEmpty =
|
|
281
|
-
return
|
|
200
|
+
var isEmpty = useMemo(function () {
|
|
201
|
+
return size(value) === 1 && size(value[0].children) === 1 && value[0].children[0].text === '';
|
|
282
202
|
}, [value]);
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (cached) {
|
|
310
|
-
return cached;
|
|
203
|
+
var renderElement = useCallback(function (props) {
|
|
204
|
+
switch (props.element.type) {
|
|
205
|
+
case 'tag': {
|
|
206
|
+
var tagProps = getTagProps(props.element);
|
|
207
|
+
var finalProps_1 = __assign(__assign({}, tagsProps), tagProps);
|
|
208
|
+
return (_jsx(TemplateElement, __assign({}, props, { tagProps: __assign(__assign({}, finalProps_1), { size: rest.size ? getOneLessSize(rest.size) : finalProps_1.size || 'small', onClick: !rest.readOnly && !rest.disabled
|
|
209
|
+
? function (event) {
|
|
210
|
+
var _a;
|
|
211
|
+
onTagClick === null || onTagClick === void 0 ? void 0 : onTagClick(props.element);
|
|
212
|
+
(_a = finalProps_1.onClick) === null || _a === void 0 ? void 0 : _a.call(finalProps_1, event);
|
|
213
|
+
}
|
|
214
|
+
: undefined, onRemoveClick: !rest.readOnly && !rest.disabled
|
|
215
|
+
? function () {
|
|
216
|
+
try {
|
|
217
|
+
var path = ReactEditor.findPath(editor, props.element);
|
|
218
|
+
Transforms.removeNodes(editor, { at: path });
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
// Element may no longer be in the editor
|
|
222
|
+
console.warn('Failed to remove tag:', error);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
: undefined }) })));
|
|
226
|
+
}
|
|
227
|
+
default:
|
|
228
|
+
return (_jsx(DefaultElement, __assign({}, props, { placeholder: isEmpty ? placeholder : undefined, placeholderProps: isEmpty ? placeholderProps : undefined })));
|
|
311
229
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
// Element may no longer be in the editor
|
|
328
|
-
console.warn('Failed to remove tag:', error);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
: undefined });
|
|
332
|
-
tagPropsCache.set(element, composed);
|
|
333
|
-
return composed;
|
|
334
|
-
}, [
|
|
335
|
-
tagPropsCache,
|
|
230
|
+
},
|
|
231
|
+
// All values read inside the callback must be listed here.
|
|
232
|
+
// `editor` is stable (created once via `useState` initializer)
|
|
233
|
+
// but listed for completeness. The callback-shaped props
|
|
234
|
+
// (`getTagProps`, `onTagClick`) and the `rest`-derived flags
|
|
235
|
+
// (`size`, `readOnly`, `disabled`) need to be tracked so the
|
|
236
|
+
// memo invalidates when the parent passes new ones — otherwise
|
|
237
|
+
// tag chips render with stale click handlers / sizes.
|
|
238
|
+
// Consumers that pass non-stable callbacks via inline arrow
|
|
239
|
+
// functions will cause re-memoization on every render; pass
|
|
240
|
+
// stable refs (`useCallback`) for best performance.
|
|
241
|
+
[
|
|
242
|
+
isEmpty,
|
|
243
|
+
placeholder,
|
|
244
|
+
placeholderProps,
|
|
336
245
|
editor,
|
|
337
246
|
getTagProps,
|
|
338
247
|
tagsProps,
|
|
@@ -341,34 +250,13 @@ exports.ReqoreRichTextEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
341
250
|
rest.readOnly,
|
|
342
251
|
rest.disabled,
|
|
343
252
|
]);
|
|
344
|
-
var
|
|
345
|
-
switch (props.element.type) {
|
|
346
|
-
case 'tag': {
|
|
347
|
-
return (0, jsx_runtime_1.jsx)(exports.TemplateElement, __assign({}, props, { tagProps: composeTagProps(props.element) }));
|
|
348
|
-
}
|
|
349
|
-
default:
|
|
350
|
-
return ((0, jsx_runtime_1.jsx)(exports.DefaultElement, __assign({}, props, { placeholder: isEmpty ? placeholder : undefined, placeholderProps: isEmpty ? placeholderProps : undefined })));
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
// All values read inside the callback must be listed here. Everything
|
|
354
|
-
// the chip composition reads now hangs off `composeTagProps`, which
|
|
355
|
-
// carries those dependencies itself — so this list is short on purpose,
|
|
356
|
-
// and that matters: slate-react's `ElementComponent` memo compares
|
|
357
|
-
// `renderElement` BY IDENTITY, so a dependency that churns re-renders
|
|
358
|
-
// every element in the document, not just the chips.
|
|
359
|
-
//
|
|
360
|
-
// Consumers that pass non-stable callbacks (`getTagProps`, `onTagClick`)
|
|
361
|
-
// or a fresh `placeholderProps` object as inline literals put that churn
|
|
362
|
-
// back; pass stable refs (`useCallback` / `useMemo`) for best
|
|
363
|
-
// performance.
|
|
364
|
-
[isEmpty, placeholder, placeholderProps, composeTagProps]);
|
|
365
|
-
var handleFocus = (0, react_1.useCallback)(function (event) {
|
|
253
|
+
var handleFocus = useCallback(function (event) {
|
|
366
254
|
// Firefox does not always create a DOM selection when an empty Slate
|
|
367
255
|
// editor contains an absolutely positioned, non-editable placeholder.
|
|
368
256
|
// Establish the corresponding Slate selection before the first key
|
|
369
257
|
// event so keyboard input is not discarded.
|
|
370
258
|
if (isEmpty && !editor.selection && !rest.readOnly && !rest.disabled) {
|
|
371
|
-
|
|
259
|
+
Transforms.select(editor, Editor.start(editor, []));
|
|
372
260
|
}
|
|
373
261
|
// Chain any consumer-provided focus handlers. Slate's `Editable`
|
|
374
262
|
// gates its internal `onFocus` wrapper behind editable-target/selection
|
|
@@ -377,23 +265,23 @@ exports.ReqoreRichTextEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
377
265
|
onFocusCapture === null || onFocusCapture === void 0 ? void 0 : onFocusCapture(event);
|
|
378
266
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
379
267
|
}, [editor, isEmpty, onFocus, onFocusCapture, rest.disabled, rest.readOnly]);
|
|
380
|
-
var renderLeaf =
|
|
381
|
-
return customRenderLeaf ? customRenderLeaf(props) : (
|
|
268
|
+
var renderLeaf = useCallback(function (props) {
|
|
269
|
+
return customRenderLeaf ? customRenderLeaf(props) : _jsx(Leaf, __assign({}, props));
|
|
382
270
|
}, [customRenderLeaf]);
|
|
383
|
-
var isMarkActive =
|
|
384
|
-
var marks =
|
|
271
|
+
var isMarkActive = useCallback(function (editor, format) {
|
|
272
|
+
var marks = Editor.marks(editor);
|
|
385
273
|
return marks ? marks[format] === true : false;
|
|
386
274
|
}, []);
|
|
387
|
-
var toggleMark =
|
|
275
|
+
var toggleMark = useCallback(function (editor, format) {
|
|
388
276
|
var isActive = isMarkActive(editor, format);
|
|
389
277
|
if (isActive) {
|
|
390
|
-
|
|
278
|
+
Editor.removeMark(editor, format);
|
|
391
279
|
}
|
|
392
280
|
else {
|
|
393
|
-
|
|
281
|
+
Editor.addMark(editor, format, true);
|
|
394
282
|
}
|
|
395
283
|
}, [isMarkActive]);
|
|
396
|
-
var panelActions =
|
|
284
|
+
var panelActions = useMemo(function () {
|
|
397
285
|
var _actions = __spreadArray([], ((panelProps === null || panelProps === void 0 ? void 0 : panelProps.actions) || []), true);
|
|
398
286
|
if (!actions) {
|
|
399
287
|
return _actions;
|
|
@@ -458,160 +346,47 @@ exports.ReqoreRichTextEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
458
346
|
_actions.push(undoRedoActions);
|
|
459
347
|
}
|
|
460
348
|
return _actions;
|
|
461
|
-
}, [actions, value, target,
|
|
462
|
-
var items =
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
349
|
+
}, [actions, value, target, Editor.marks(editor), editor]);
|
|
350
|
+
var items = useMemo(function () {
|
|
351
|
+
if (size(tags)) {
|
|
352
|
+
return map(tags, function (_a, key) {
|
|
465
353
|
var items = _a.items, tag = __rest(_a, ["items"]);
|
|
466
354
|
return (__assign(__assign({ label: tag.label || key }, tag), { items: items }));
|
|
467
355
|
});
|
|
468
356
|
}
|
|
469
357
|
return undefined;
|
|
470
358
|
}, [tags]);
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
The position itself is legitimate — it is the point `TemplateElement`
|
|
474
|
-
deliberately moves to when the chip is clicked, and typing works from
|
|
475
|
-
there. What breaks is arriving by clicking the empty text directly: the
|
|
476
|
-
BROWSER owns the DOM caret then, and it resolves the first keystroke back
|
|
477
|
-
into the chip's own text child, where Slate silently ignores it.
|
|
478
|
-
|
|
479
|
-
Measured on the reported case: selection `[0,2]` before the key,
|
|
480
|
-
`[0,1,0]` after it, document unchanged, `onChange` fired twice.
|
|
481
|
-
|
|
482
|
-
Re-selecting through Slate alone does not help, because Slate's selection
|
|
483
|
-
is ALREADY the right point — `Transforms.select` to the same range is a
|
|
484
|
-
no-op and never re-syncs the DOM. So the DOM range is set explicitly,
|
|
485
|
-
which is the thing the next keystroke actually resolves from.
|
|
486
|
-
|
|
487
|
-
Collapsed selections only: a RANGE spanning a chip is how it gets
|
|
488
|
-
selected for deletion and must be left alone. */
|
|
489
|
-
var repairCaretBesideVoid = (0, react_1.useCallback)(function () {
|
|
490
|
-
var _a;
|
|
491
|
-
if (rest.readOnly || rest.disabled) {
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
/* Adopt the caret this click placed BEFORE reading it.
|
|
495
|
-
|
|
496
|
-
slate-react takes the browser's caret into `editor.selection` from a
|
|
497
|
-
`selectionchange` handler throttled to 100ms, so at mouseup Slate may
|
|
498
|
-
still have no selection at all. This handler then used to return
|
|
499
|
-
without repairing anything — and the gap is worse than a missed
|
|
500
|
-
repair: a re-render of the editable in that window sees a browser caret
|
|
501
|
-
with no Slate selection, treats it as stale and REMOVES it, which is
|
|
502
|
-
itself a selection change and spends the throttle window. The click's
|
|
503
|
-
own change is deferred to the trailing edge, a key pressed before then
|
|
504
|
-
is dropped, and by the time the handler runs there is no caret left to
|
|
505
|
-
adopt — the field reads as frozen.
|
|
506
|
-
|
|
507
|
-
Measured in the Qorus test editor: Slate's selection `null` at the first
|
|
508
|
-
keystroke while the browser caret sat correctly beside the chip; the
|
|
509
|
-
same story passed only when the key happened to land more than 100ms
|
|
510
|
-
after the last throttled call.
|
|
511
|
-
|
|
512
|
-
Only a caret slate-react itself would accept is taken, and never while
|
|
513
|
-
composing — an IME owns the selection then. */
|
|
514
|
-
try {
|
|
515
|
-
var domSelection = slate_react_1.ReactEditor.getWindow(editor).getSelection();
|
|
516
|
-
var _b = domSelection !== null && domSelection !== void 0 ? domSelection : {}, anchorNode = _b.anchorNode, focusNode = _b.focusNode;
|
|
517
|
-
/* The same test slate-react's own handler applies before it adopts a
|
|
518
|
-
caret, so this takes exactly what that handler would take, only
|
|
519
|
-
sooner. */
|
|
520
|
-
if (domSelection &&
|
|
521
|
-
domSelection.rangeCount > 0 &&
|
|
522
|
-
anchorNode &&
|
|
523
|
-
focusNode &&
|
|
524
|
-
!slate_react_1.ReactEditor.isComposing(editor) &&
|
|
525
|
-
slate_react_1.ReactEditor.hasSelectableTarget(editor, anchorNode) &&
|
|
526
|
-
slate_react_1.ReactEditor.hasSelectableTarget(editor, focusNode)) {
|
|
527
|
-
var clicked = slate_react_1.ReactEditor.toSlateRange(editor, domSelection, {
|
|
528
|
-
exactMatch: false,
|
|
529
|
-
suppressThrow: true,
|
|
530
|
-
});
|
|
531
|
-
if (clicked && !(editor.selection && slate_1.Range.equals(editor.selection, clicked))) {
|
|
532
|
-
slate_1.Transforms.select(editor, clicked);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
catch (_c) {
|
|
537
|
-
// Nothing to adopt is not an error; the throttled handler still runs.
|
|
538
|
-
}
|
|
539
|
-
var selection = editor.selection;
|
|
540
|
-
if (!selection || !slate_1.Range.isCollapsed(selection)) {
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
try {
|
|
544
|
-
/* Either already inside a void (`voids: true`, or the void the point
|
|
545
|
-
is inside is not matched at all), or in the empty text immediately
|
|
546
|
-
after one. `Editor.void` / `Editor.leaf` rather than `Editor.nodes`:
|
|
547
|
-
the latter returns a generator, which this build target cannot
|
|
548
|
-
destructure (TS2802). */
|
|
549
|
-
var inside = slate_1.Editor.void(editor, { at: selection, voids: true });
|
|
550
|
-
var voidPath = inside === null || inside === void 0 ? void 0 : inside[1];
|
|
551
|
-
if (!voidPath) {
|
|
552
|
-
var textEntry = slate_1.Editor.leaf(editor, selection);
|
|
553
|
-
if (!textEntry) {
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
var textNode = textEntry[0], textPath = textEntry[1];
|
|
557
|
-
if (textNode.text !== '') {
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
var previous = slate_1.Editor.previous(editor, { at: textPath });
|
|
561
|
-
if (!previous || !slate_1.Editor.isVoid(editor, previous[0])) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
voidPath = previous[1];
|
|
565
|
-
}
|
|
566
|
-
// The same point `TemplateElement` uses: from the void's END and
|
|
567
|
-
// skipping voids, so it cannot resolve back into another one.
|
|
568
|
-
var point = (_a = slate_1.Editor.after(editor, slate_1.Editor.end(editor, voidPath), { voids: false })) !== null && _a !== void 0 ? _a : slate_1.Editor.end(editor, []);
|
|
569
|
-
var range = { anchor: point, focus: point };
|
|
570
|
-
slate_1.Transforms.select(editor, range);
|
|
571
|
-
var domRange = slate_react_1.ReactEditor.toDOMRange(editor, range);
|
|
572
|
-
var domSelection = slate_react_1.ReactEditor.getWindow(editor).getSelection();
|
|
573
|
-
if (domSelection) {
|
|
574
|
-
domSelection.removeAllRanges();
|
|
575
|
-
domSelection.addRange(domRange);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
catch (_d) {
|
|
579
|
-
// A selection can reference a path a concurrent re-render has removed,
|
|
580
|
-
// and `toDOMRange` throws for a point it cannot resolve. Leaving the
|
|
581
|
-
// cursor where it is beats throwing out of an event handler.
|
|
582
|
-
}
|
|
583
|
-
}, [editor, rest.readOnly, rest.disabled]);
|
|
584
|
-
return ((0, jsx_runtime_1.jsx)(__1.ReqorePanel, __assign({ flat: true, padded: false, minimal: true, transparent: true, size: 'small' }, panelProps, { children: (0, jsx_runtime_1.jsx)(slate_react_1.Slate, { editor: editor, initialValue: value, onChange: function (data) {
|
|
359
|
+
return (_jsx(ReqorePanel, __assign({ flat: true, padded: false, minimal: true, transparent: true, size: 'small' }, panelProps, { children: _jsx(Slate, { editor: editor, initialValue: value, onChange: function (data) {
|
|
585
360
|
var selection = editor.selection;
|
|
586
361
|
setTarget(selection);
|
|
587
362
|
onChange === null || onChange === void 0 ? void 0 : onChange(data);
|
|
588
|
-
}, children: (
|
|
363
|
+
}, children: _jsx(ReqoreTextarea, __assign({}, rest, { renderElement: renderElement, renderLeaf: renderLeaf, decorate: decorate, onFocusCapture: handleFocus, as: RefSafeSlateEditable, style: {
|
|
589
364
|
lineHeight: 1.5,
|
|
590
365
|
outline: 'none',
|
|
591
366
|
}, onClearClick: isEmpty
|
|
592
367
|
? undefined
|
|
593
368
|
: function () {
|
|
594
|
-
|
|
369
|
+
Transforms.delete(editor, {
|
|
595
370
|
at: {
|
|
596
|
-
anchor:
|
|
597
|
-
focus:
|
|
371
|
+
anchor: Editor.start(editor, []),
|
|
372
|
+
focus: Editor.end(editor, []),
|
|
598
373
|
},
|
|
599
374
|
});
|
|
600
375
|
// Focus the editor
|
|
601
376
|
try {
|
|
602
|
-
|
|
377
|
+
ReactEditor.focus(editor);
|
|
603
378
|
}
|
|
604
379
|
catch (error) {
|
|
605
380
|
// Editor may not be mounted
|
|
606
381
|
}
|
|
607
|
-
}, value: JSON.stringify(value || []), onChange:
|
|
382
|
+
}, value: JSON.stringify(value || []), onChange: useCallback(function () { }, []), templates: __assign(__assign({ customElements: size(panelActions)
|
|
608
383
|
? [
|
|
609
|
-
(
|
|
384
|
+
_jsx(ReqoreControlGroup, { spaceBetween: true, size: 'small', fixed: true, children: panelActions.map(function (action, index) {
|
|
610
385
|
var _a;
|
|
611
386
|
if (action.group) {
|
|
612
|
-
return ((
|
|
387
|
+
return (_jsx(ReqoreControlGroup, { stack: true, children: (_a = action.group) === null || _a === void 0 ? void 0 : _a.map(function (action, index) { return (_jsx(ReqoreButton, __assign({ customTheme: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listCustomTheme, intent: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listIntent }, action), index)); }) }, index));
|
|
613
388
|
}
|
|
614
|
-
return ((
|
|
389
|
+
return (_jsx(ReqoreButton, __assign({ customTheme: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listCustomTheme, intent: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listIntent }, action), index));
|
|
615
390
|
}) }, 0),
|
|
616
391
|
]
|
|
617
392
|
: undefined }, tagsListProps), { items: items, closeOnInsideClick: false, onItemSelect: function (item) {
|
|
@@ -619,12 +394,12 @@ exports.ReqoreRichTextEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
619
394
|
try {
|
|
620
395
|
// Use current selection or fallback to end of document
|
|
621
396
|
var selection = editor.selection || {
|
|
622
|
-
anchor:
|
|
623
|
-
focus:
|
|
397
|
+
anchor: Editor.end(editor, []),
|
|
398
|
+
focus: Editor.end(editor, []),
|
|
624
399
|
};
|
|
625
|
-
|
|
400
|
+
Transforms.select(editor, selection);
|
|
626
401
|
insertTag(editor, item.value, item.label, item.metadata);
|
|
627
|
-
|
|
402
|
+
ReactEditor.focus(editor);
|
|
628
403
|
}
|
|
629
404
|
catch (error) {
|
|
630
405
|
// Fallback: just insert at current position
|