@namroodinc/liquid-editorial 0.2.0 → 0.3.0
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/README.md +64 -2
- package/UPGRADING.md +153 -0
- package/dist/chunks/{Board-BLhB5_xx.cjs → Board-BUJ5CinL.cjs} +2 -2
- package/dist/chunks/Board-BUJ5CinL.cjs.map +1 -0
- package/dist/chunks/{Board-BTFSzn6c.js → Board-Cyrda2qG.js} +2 -2
- package/dist/chunks/Board-Cyrda2qG.js.map +1 -0
- package/dist/chunks/{FormEditor-DuW8x78Y.js → FormEditor-DRmPFe2E.js} +100 -102
- package/dist/chunks/FormEditor-DRmPFe2E.js.map +1 -0
- package/dist/chunks/FormEditor-PVkvKep1.cjs +2 -0
- package/dist/chunks/FormEditor-PVkvKep1.cjs.map +1 -0
- package/dist/chunks/Icon-ByUB0L1a.js +78 -0
- package/dist/chunks/Icon-ByUB0L1a.js.map +1 -0
- package/dist/chunks/Icon-CW6qJcDy.cjs +2 -0
- package/dist/chunks/Icon-CW6qJcDy.cjs.map +1 -0
- package/dist/chunks/{RichTextEditor-BxtlbjXj.cjs → RichTextEditor-C7nMfDmE.cjs} +2 -2
- package/dist/chunks/RichTextEditor-C7nMfDmE.cjs.map +1 -0
- package/dist/chunks/{RichTextEditor-Dnx4i7bQ.js → RichTextEditor-DjR10XJ-.js} +55 -53
- package/dist/chunks/RichTextEditor-DjR10XJ-.js.map +1 -0
- package/dist/chunks/binding-Bshy43sG.js +33 -0
- package/dist/chunks/binding-Bshy43sG.js.map +1 -0
- package/dist/chunks/binding-tMjrUzkU.cjs +2 -0
- package/dist/chunks/binding-tMjrUzkU.cjs.map +1 -0
- package/dist/chunks/context-BONPXF-V.cjs +2 -0
- package/dist/chunks/context-BONPXF-V.cjs.map +1 -0
- package/dist/chunks/context-CXvOl4Kt.js +7 -0
- package/dist/chunks/context-CXvOl4Kt.js.map +1 -0
- package/dist/chunks/dialogStack-6yv3NXFD.js +43 -0
- package/dist/chunks/dialogStack-6yv3NXFD.js.map +1 -0
- package/dist/chunks/dialogStack-C9SLVu6Q.cjs +2 -0
- package/dist/chunks/dialogStack-C9SLVu6Q.cjs.map +1 -0
- package/dist/chunks/frame-Bs_jaQRw.js +70 -0
- package/dist/chunks/frame-Bs_jaQRw.js.map +1 -0
- package/dist/chunks/frame-CNxvbg0D.cjs +2 -0
- package/dist/chunks/frame-CNxvbg0D.cjs.map +1 -0
- package/dist/chunks/group-CzbacuAY.js +29 -0
- package/dist/chunks/group-CzbacuAY.js.map +1 -0
- package/dist/chunks/group-pKDQtq-9.cjs +2 -0
- package/dist/chunks/group-pKDQtq-9.cjs.map +1 -0
- package/dist/chunks/observeElementWidth-BCJM2FAw.cjs +2 -0
- package/dist/chunks/observeElementWidth-BCJM2FAw.cjs.map +1 -0
- package/dist/chunks/observeElementWidth-BlQOlW2t.js +12 -0
- package/dist/chunks/observeElementWidth-BlQOlW2t.js.map +1 -0
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.cjs.map +1 -1
- package/dist/components/AppShell/index.d.cts +5 -1
- package/dist/components/AppShell/index.d.cts.map +1 -1
- package/dist/components/AppShell/index.d.ts +5 -1
- package/dist/components/AppShell/index.d.ts.map +1 -1
- package/dist/components/AppShell/index.js +53 -60
- package/dist/components/AppShell/index.js.map +1 -1
- package/dist/components/AppShell/style.css +48 -6
- package/dist/components/AssetCard/index.cjs +1 -1
- package/dist/components/AssetCard/index.cjs.map +1 -1
- package/dist/components/AssetCard/index.d.cts +1 -1
- package/dist/components/AssetCard/index.d.cts.map +1 -1
- package/dist/components/AssetCard/index.d.ts +1 -1
- package/dist/components/AssetCard/index.d.ts.map +1 -1
- package/dist/components/AssetCard/index.js +1 -1
- package/dist/components/AssetCard/index.js.map +1 -1
- package/dist/components/AssetCard/style.css +20 -9
- package/dist/components/AssetGrid/index.cjs +1 -1
- package/dist/components/AssetGrid/index.cjs.map +1 -1
- package/dist/components/AssetGrid/index.d.cts +1 -1
- package/dist/components/AssetGrid/index.d.cts.map +1 -1
- package/dist/components/AssetGrid/index.d.ts +1 -1
- package/dist/components/AssetGrid/index.d.ts.map +1 -1
- package/dist/components/AssetGrid/index.js +1 -1
- package/dist/components/AssetGrid/index.js.map +1 -1
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.d.cts.map +1 -1
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Badge/index.cjs +1 -1
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.d.cts +2 -0
- package/dist/components/Badge/index.d.cts.map +1 -1
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +8 -8
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/style.css +2 -1
- package/dist/components/Board/index.cjs +1 -1
- package/dist/components/Board/index.d.cts.map +1 -1
- package/dist/components/Board/index.d.ts.map +1 -1
- package/dist/components/Board/index.js +1 -1
- package/dist/components/Board/keyboard.d.cts.map +1 -1
- package/dist/components/Board/keyboard.d.ts.map +1 -1
- package/dist/components/Board/moves.d.cts.map +1 -1
- package/dist/components/Board/moves.d.ts.map +1 -1
- package/dist/components/Board/style.css +12 -7
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.cts.map +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/style.css +1 -1
- package/dist/components/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/ButtonGroup/index.d.cts.map +1 -1
- package/dist/components/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/ButtonGroup/index.js.map +1 -1
- package/dist/components/ButtonGroup/style.css +1 -0
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.d.cts +3 -3
- package/dist/components/Choice/index.d.cts.map +1 -1
- package/dist/components/Choice/index.d.ts +3 -3
- package/dist/components/Choice/index.d.ts.map +1 -1
- package/dist/components/Choice/index.js +27 -27
- package/dist/components/Choice/index.js.map +1 -1
- package/dist/components/Choice/style.css +1 -8
- package/dist/components/Container/style.css +1 -0
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.d.cts +5 -9
- package/dist/components/DatePicker/index.d.cts.map +1 -1
- package/dist/components/DatePicker/index.d.ts +5 -9
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +125 -121
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DatePicker/style.css +18 -2
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.cjs.map +1 -1
- package/dist/components/Drawer/index.d.cts.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +72 -70
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Drawer/style.css +7 -2
- package/dist/components/EditLayout/index.cjs +2 -0
- package/dist/components/EditLayout/index.cjs.map +1 -0
- package/dist/components/EditLayout/index.d.cts +25 -0
- package/dist/components/EditLayout/index.d.cts.map +1 -0
- package/dist/components/EditLayout/index.d.ts +25 -0
- package/dist/components/EditLayout/index.d.ts.map +1 -0
- package/dist/components/EditLayout/index.js +239 -0
- package/dist/components/EditLayout/index.js.map +1 -0
- package/dist/components/EditLayout/style.css +226 -0
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.cjs.map +1 -1
- package/dist/components/EntryPicker/index.d.cts +3 -2
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts +3 -2
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +40 -47
- package/dist/components/EntryPicker/index.js.map +1 -1
- package/dist/components/EntryPicker/style.css +0 -11
- package/dist/components/Field/binding.d.cts +18 -0
- package/dist/components/Field/binding.d.cts.map +1 -0
- package/dist/components/Field/binding.d.ts +18 -0
- package/dist/components/Field/binding.d.ts.map +1 -0
- package/dist/components/Field/context.d.cts +9 -0
- package/dist/components/Field/context.d.cts.map +1 -0
- package/dist/components/Field/context.d.ts +9 -0
- package/dist/components/Field/context.d.ts.map +1 -0
- package/dist/components/Field/frame.d.cts +12 -0
- package/dist/components/Field/frame.d.cts.map +1 -0
- package/dist/components/Field/frame.d.ts +12 -0
- package/dist/components/Field/frame.d.ts.map +1 -0
- package/dist/components/Field/group.d.cts +12 -0
- package/dist/components/Field/group.d.cts.map +1 -0
- package/dist/components/Field/group.d.ts +12 -0
- package/dist/components/Field/group.d.ts.map +1 -0
- package/dist/components/Field/index.cjs +1 -1
- package/dist/components/Field/index.cjs.map +1 -1
- package/dist/components/Field/index.d.cts +4 -22
- package/dist/components/Field/index.d.cts.map +1 -1
- package/dist/components/Field/index.d.ts +4 -22
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +5 -42
- package/dist/components/Field/index.js.map +1 -1
- package/dist/components/Field/style.css +6 -1
- package/dist/components/Field/types.d.cts +31 -0
- package/dist/components/Field/types.d.cts.map +1 -0
- package/dist/components/Field/types.d.ts +31 -0
- package/dist/components/Field/types.d.ts.map +1 -0
- package/dist/components/FieldAffix/index.cjs.map +1 -1
- package/dist/components/FieldAffix/index.d.cts.map +1 -1
- package/dist/components/FieldAffix/index.d.ts.map +1 -1
- package/dist/components/FieldAffix/index.js.map +1 -1
- package/dist/components/FormEditor/control.d.cts +5 -3
- package/dist/components/FormEditor/control.d.cts.map +1 -1
- package/dist/components/FormEditor/control.d.ts +5 -3
- package/dist/components/FormEditor/control.d.ts.map +1 -1
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.d.cts +1 -1
- package/dist/components/FormEditor/index.d.cts.map +1 -1
- package/dist/components/FormEditor/index.d.ts +1 -1
- package/dist/components/FormEditor/index.d.ts.map +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts +8 -5
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +8 -5
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/FormEditor/style.css +3 -1
- package/dist/components/Icon/icons.d.cts +1 -0
- package/dist/components/Icon/icons.d.cts.map +1 -1
- package/dist/components/Icon/icons.d.ts +1 -0
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Icon/style.css +1 -1
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.cjs.map +1 -1
- package/dist/components/ImageCropper/index.d.cts +1 -1
- package/dist/components/ImageCropper/index.d.cts.map +1 -1
- package/dist/components/ImageCropper/index.d.ts +1 -1
- package/dist/components/ImageCropper/index.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.js +113 -112
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/ImageCropper/style.css +28 -5
- package/dist/components/Menu/index.cjs.map +1 -1
- package/dist/components/Menu/index.d.cts.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/style.css +0 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.cjs.map +1 -1
- package/dist/components/Modal/index.d.cts.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +47 -46
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/style.css +2 -2
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.cjs.map +1 -1
- package/dist/components/NumberField/index.d.cts +4 -3
- package/dist/components/NumberField/index.d.cts.map +1 -1
- package/dist/components/NumberField/index.d.ts +4 -3
- package/dist/components/NumberField/index.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +57 -53
- package/dist/components/NumberField/index.js.map +1 -1
- package/dist/components/NumberField/style.css +20 -7
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.d.cts.map +1 -1
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js.map +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RichTextEditor/document.d.cts.map +1 -1
- package/dist/components/RichTextEditor/document.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.d.cts +3 -7
- package/dist/components/RichTextEditor/index.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts +3 -7
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RichTextEditor/style.css +2 -2
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.cjs.map +1 -1
- package/dist/components/SearchField/index.d.cts.map +1 -1
- package/dist/components/SearchField/index.d.ts.map +1 -1
- package/dist/components/SearchField/index.js +1 -1
- package/dist/components/SearchField/index.js.map +1 -1
- package/dist/components/SearchField/style.css +0 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.cts +1 -0
- package/dist/components/Select/index.d.cts.map +1 -1
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +54 -53
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.cjs.map +1 -1
- package/dist/components/SelectionCard/index.d.cts +3 -2
- package/dist/components/SelectionCard/index.d.cts.map +1 -1
- package/dist/components/SelectionCard/index.d.ts +3 -2
- package/dist/components/SelectionCard/index.d.ts.map +1 -1
- package/dist/components/SelectionCard/index.js +28 -28
- package/dist/components/SelectionCard/index.js.map +1 -1
- package/dist/components/SelectionCard/style.css +2 -13
- package/dist/components/SideNav/index.cjs +1 -1
- package/dist/components/SideNav/index.cjs.map +1 -1
- package/dist/components/SideNav/index.d.cts.map +1 -1
- package/dist/components/SideNav/index.d.ts.map +1 -1
- package/dist/components/SideNav/index.js +1 -1
- package/dist/components/SideNav/index.js.map +1 -1
- package/dist/components/SideNav/style.css +7 -2
- package/dist/components/Skeleton/index.cjs.map +1 -1
- package/dist/components/Skeleton/index.d.cts.map +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Skeleton/style.css +2 -2
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.cjs.map +1 -1
- package/dist/components/Slider/index.d.cts +3 -2
- package/dist/components/Slider/index.d.cts.map +1 -1
- package/dist/components/Slider/index.d.ts +3 -2
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +60 -56
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/style.css +19 -16
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.cjs.map +1 -1
- package/dist/components/SortableList/index.d.cts.map +1 -1
- package/dist/components/SortableList/index.d.ts.map +1 -1
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/SortableList/index.js.map +1 -1
- package/dist/components/SortableList/style.css +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.cjs.map +1 -1
- package/dist/components/Stepper/index.d.cts.map +1 -1
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/Stepper/index.js.map +1 -1
- package/dist/components/Stepper/style.css +2 -2
- package/dist/components/SubNav/index.cjs +1 -1
- package/dist/components/SubNav/index.cjs.map +1 -1
- package/dist/components/SubNav/index.d.cts.map +1 -1
- package/dist/components/SubNav/index.d.ts.map +1 -1
- package/dist/components/SubNav/index.js +1 -1
- package/dist/components/SubNav/index.js.map +1 -1
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts +2 -0
- package/dist/components/Switch/index.d.cts.map +1 -1
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +13 -12
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/style.css +6 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.cjs.map +1 -1
- package/dist/components/Table/index.d.cts.map +1 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/style.css +1 -0
- package/dist/components/TagsInput/index.cjs +1 -1
- package/dist/components/TagsInput/index.cjs.map +1 -1
- package/dist/components/TagsInput/index.d.cts +2 -5
- package/dist/components/TagsInput/index.d.cts.map +1 -1
- package/dist/components/TagsInput/index.d.ts +2 -5
- package/dist/components/TagsInput/index.d.ts.map +1 -1
- package/dist/components/TagsInput/index.js +19 -17
- package/dist/components/TagsInput/index.js.map +1 -1
- package/dist/components/TagsInput/style.css +2 -1
- package/dist/components/TextField/index.cjs.map +1 -1
- package/dist/components/TextField/index.d.cts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/components/TextField/index.js.map +1 -1
- package/dist/components/Time/index.cjs.map +1 -1
- package/dist/components/Time/index.d.cts.map +1 -1
- package/dist/components/Time/index.d.ts.map +1 -1
- package/dist/components/Time/index.js.map +1 -1
- package/dist/components/Time/style.css +1 -2
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/index.js.map +1 -1
- package/dist/components/Toast/style.css +1 -1
- package/dist/components/TopNav/index.cjs +1 -1
- package/dist/components/TopNav/index.cjs.map +1 -1
- package/dist/components/TopNav/index.d.cts.map +1 -1
- package/dist/components/TopNav/index.d.ts.map +1 -1
- package/dist/components/TopNav/index.js +1 -1
- package/dist/components/TopNav/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/internal/dialogStack.d.cts +9 -0
- package/dist/internal/dialogStack.d.cts.map +1 -0
- package/dist/internal/dialogStack.d.ts +9 -0
- package/dist/internal/dialogStack.d.ts.map +1 -0
- package/dist/internal/lockBodyScroll.d.cts +7 -0
- package/dist/internal/lockBodyScroll.d.cts.map +1 -0
- package/dist/internal/lockBodyScroll.d.ts +7 -0
- package/dist/internal/lockBodyScroll.d.ts.map +1 -0
- package/dist/internal/observeElementWidth.d.cts +3 -0
- package/dist/internal/observeElementWidth.d.cts.map +1 -0
- package/dist/internal/observeElementWidth.d.ts +3 -0
- package/dist/internal/observeElementWidth.d.ts.map +1 -0
- package/dist/reset.css +29 -4
- package/dist/styles.css +20 -16
- package/dist/test/dragEvent.d.cts.map +1 -1
- package/dist/test/dragEvent.d.ts.map +1 -1
- package/dist/tokens.css +77 -40
- package/package.json +9 -2
- package/dist/chunks/Board-BLhB5_xx.cjs.map +0 -1
- package/dist/chunks/Board-BTFSzn6c.js.map +0 -1
- package/dist/chunks/FormEditor-8bz3pOdP.cjs +0 -2
- package/dist/chunks/FormEditor-8bz3pOdP.cjs.map +0 -1
- package/dist/chunks/FormEditor-DuW8x78Y.js.map +0 -1
- package/dist/chunks/Icon-CGY1FNXT.js +0 -77
- package/dist/chunks/Icon-CGY1FNXT.js.map +0 -1
- package/dist/chunks/Icon-CWsA1W83.cjs +0 -2
- package/dist/chunks/Icon-CWsA1W83.cjs.map +0 -1
- package/dist/chunks/RichTextEditor-BxtlbjXj.cjs.map +0 -1
- package/dist/chunks/RichTextEditor-Dnx4i7bQ.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Field as e } from "../components/Field/index.js";
|
|
2
2
|
import { TextArea as t, TextField as n } from "../components/TextField/index.js";
|
|
3
|
-
import { n as r, r as i, t as a } from "./RichTextEditor-
|
|
3
|
+
import { n as r, r as i, t as a } from "./RichTextEditor-DjR10XJ-.js";
|
|
4
4
|
import { EntryPicker as o } from "../components/EntryPicker/index.js";
|
|
5
5
|
import { NumberField as s } from "../components/NumberField/index.js";
|
|
6
6
|
import { Select as c } from "../components/Select/index.js";
|
|
@@ -31,71 +31,77 @@ function m(e) {
|
|
|
31
31
|
var h = {
|
|
32
32
|
asset: {
|
|
33
33
|
key: "assetId",
|
|
34
|
-
label: "Assets",
|
|
35
34
|
itemLabel: "asset",
|
|
36
35
|
itemsLabel: "assets"
|
|
37
36
|
},
|
|
38
37
|
reference: {
|
|
39
38
|
key: "entryId",
|
|
40
|
-
label: "Entries",
|
|
41
39
|
itemLabel: "entry",
|
|
42
40
|
itemsLabel: "entries"
|
|
43
41
|
}
|
|
44
42
|
};
|
|
45
43
|
function g(e) {
|
|
46
|
-
|
|
44
|
+
return e.type === "asset" || e.type === "reference" ? e.picker?.label ?? e.label : e.label;
|
|
45
|
+
}
|
|
46
|
+
function _(e) {
|
|
47
|
+
let t = h[e.type], { addLabel: n = `Choose ${g(e)}`, emptyLabel: r, itemLabel: i = t.itemLabel, itemsLabel: a = t.itemsLabel, max: o, isReorderable: s } = e.picker ?? {};
|
|
47
48
|
return {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
addLabel: r,
|
|
49
|
+
addLabel: n,
|
|
50
|
+
emptyLabel: r,
|
|
51
51
|
itemLabel: i,
|
|
52
|
-
itemsLabel: a
|
|
52
|
+
itemsLabel: a,
|
|
53
|
+
max: o,
|
|
54
|
+
isReorderable: s
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function v(e, t) {
|
|
58
|
+
let { key: n } = h[e.type];
|
|
59
|
+
return (Array.isArray(t) ? t : t === void 0 ? [] : [t]).flatMap((e) => b(e, n) ? [e[n]] : []);
|
|
60
|
+
}
|
|
61
|
+
function y(e) {
|
|
56
62
|
if (typeof e != "string") return;
|
|
57
63
|
let t = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(?:Z|\+00:00)$/.exec(e);
|
|
58
64
|
if (!t) return;
|
|
59
65
|
let n = `${t[1]}:${t[2] ?? "00"}.${(t[3] ?? "").padEnd(3, "0")}Z`, r = new Date(n);
|
|
60
66
|
if (Number.isFinite(r.getTime()) && r.toISOString() === n) return n;
|
|
61
67
|
}
|
|
62
|
-
function
|
|
68
|
+
function b(e, t) {
|
|
63
69
|
return !!e && typeof e == "object" && t in e && typeof e[t] == "string" && e[t].trim().length > 0;
|
|
64
70
|
}
|
|
65
|
-
function
|
|
66
|
-
return !!e.text?.trim() || e.type === "horizontalRule" || !!e.content?.some(
|
|
71
|
+
function x(e) {
|
|
72
|
+
return !!e.text?.trim() || e.type === "horizontalRule" || !!e.content?.some(x);
|
|
67
73
|
}
|
|
68
|
-
function
|
|
69
|
-
return `${e
|
|
74
|
+
function S(e) {
|
|
75
|
+
return `${g(e)} is required.`;
|
|
70
76
|
}
|
|
71
|
-
function
|
|
77
|
+
function C(e, t) {
|
|
72
78
|
if (typeof t != "string") return "Enter text.";
|
|
73
|
-
if (e.required && !t.trim()) return
|
|
79
|
+
if (e.required && !t.trim()) return S(e);
|
|
74
80
|
if ((e.type === "shortText" || e.type === "longText") && e.maxLength !== void 0 && t.length > e.maxLength) return `Enter no more than ${e.maxLength} characters.`;
|
|
75
81
|
}
|
|
76
|
-
function
|
|
82
|
+
function w(e, t) {
|
|
77
83
|
let n = r(t);
|
|
78
84
|
if (n) return n;
|
|
79
|
-
if (e.required && !
|
|
85
|
+
if (e.required && !x(t)) return S(e);
|
|
80
86
|
}
|
|
81
|
-
function
|
|
87
|
+
function T(e, t) {
|
|
82
88
|
if (typeof t != "string") return "Choose an available option.";
|
|
83
|
-
if (t === "") return e.required ?
|
|
89
|
+
if (t === "") return e.required ? S(e) : void 0;
|
|
84
90
|
if (e.type === "select" && e.options.length > 0 && !e.options.some((e) => e.value === t)) return "Choose an available option.";
|
|
85
91
|
}
|
|
86
|
-
function
|
|
92
|
+
function E(e, t) {
|
|
87
93
|
if (e.type !== "asset" && e.type !== "reference") return;
|
|
88
94
|
let { key: n, itemLabel: r, itemsLabel: i } = h[e.type];
|
|
89
|
-
if (!e.multiple) return
|
|
90
|
-
if (!Array.isArray(t) || !t.every((e) =>
|
|
91
|
-
if (e.required && t.length === 0) return
|
|
95
|
+
if (!e.multiple) return b(t, n) ? void 0 : `Choose an ${r}.`;
|
|
96
|
+
if (!Array.isArray(t) || !t.every((e) => b(e, n))) return `Choose a list of ${i}.`;
|
|
97
|
+
if (e.required && t.length === 0) return S(e);
|
|
92
98
|
let a = e.picker?.max;
|
|
93
|
-
if (a !== void 0 && t.length > a) return `Choose no more than ${a} ${
|
|
99
|
+
if (a !== void 0 && t.length > a) return `Choose no more than ${a} ${_(e).itemsLabel}.`;
|
|
94
100
|
}
|
|
95
|
-
var
|
|
96
|
-
shortText:
|
|
97
|
-
longText:
|
|
98
|
-
richText:
|
|
101
|
+
var D = {
|
|
102
|
+
shortText: C,
|
|
103
|
+
longText: C,
|
|
104
|
+
richText: w,
|
|
99
105
|
number: (e, t) => {
|
|
100
106
|
if (typeof t != "number" || !Number.isFinite(t)) return "Enter a finite number.";
|
|
101
107
|
if (e.type === "number") {
|
|
@@ -104,31 +110,23 @@ var T = {
|
|
|
104
110
|
}
|
|
105
111
|
},
|
|
106
112
|
boolean: (e, t) => typeof t == "boolean" ? void 0 : "Choose a boolean value.",
|
|
107
|
-
dateTime: (e, t) =>
|
|
108
|
-
select:
|
|
109
|
-
asset:
|
|
110
|
-
reference:
|
|
113
|
+
dateTime: (e, t) => y(t) ? void 0 : "Enter a valid UTC date and time.",
|
|
114
|
+
select: T,
|
|
115
|
+
asset: E,
|
|
116
|
+
reference: E
|
|
111
117
|
};
|
|
112
|
-
function
|
|
113
|
-
return t === void 0 ? e.required ?
|
|
118
|
+
function O(e, t) {
|
|
119
|
+
return t === void 0 ? e.required ? S(e) : void 0 : D[e.type](e, t);
|
|
114
120
|
}
|
|
115
|
-
function
|
|
121
|
+
function k(e, t) {
|
|
116
122
|
return m(e), Object.fromEntries(e.fields.flatMap((e) => {
|
|
117
|
-
let n =
|
|
123
|
+
let n = O(e, Object.hasOwn(t, e.id) ? t[e.id] : void 0);
|
|
118
124
|
return n ? [[e.id, n]] : [];
|
|
119
125
|
}));
|
|
120
126
|
}
|
|
121
127
|
//#endregion
|
|
122
128
|
//#region src/components/FormEditor/control.tsx
|
|
123
|
-
function
|
|
124
|
-
let n = e.type === "asset" ? "assetId" : "entryId";
|
|
125
|
-
return (Array.isArray(t) ? t : t === void 0 ? [] : [t]).flatMap((e) => {
|
|
126
|
-
if (!e || typeof e != "object" || !(n in e)) return [];
|
|
127
|
-
let t = e[n];
|
|
128
|
-
return typeof t == "string" ? [t] : [];
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function k(e, t) {
|
|
129
|
+
function A(e, t) {
|
|
132
130
|
if (e.type === "asset") {
|
|
133
131
|
let n = t.map((e) => ({ assetId: e }));
|
|
134
132
|
return e.multiple ? n : n[0];
|
|
@@ -136,7 +134,7 @@ function k(e, t) {
|
|
|
136
134
|
let n = t.map((e) => ({ entryId: e }));
|
|
137
135
|
return e.multiple ? n : n[0];
|
|
138
136
|
}
|
|
139
|
-
function
|
|
137
|
+
function j({ field: e, stored: t, isDisabled: n, required: r, accessibility: i, onChange: a }) {
|
|
140
138
|
return /* @__PURE__ */ f(s, {
|
|
141
139
|
...i,
|
|
142
140
|
required: r,
|
|
@@ -155,7 +153,7 @@ function A({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
155
153
|
}
|
|
156
154
|
});
|
|
157
155
|
}
|
|
158
|
-
function
|
|
156
|
+
function M({ field: e, stored: t, isDisabled: n, required: r, accessibility: i, onChange: a }) {
|
|
159
157
|
let o = !r && !e.options.some((e) => e.value === "");
|
|
160
158
|
return /* @__PURE__ */ f(c, {
|
|
161
159
|
...i,
|
|
@@ -172,114 +170,114 @@ function j({ field: e, stored: t, isDisabled: n, required: r, accessibility: i,
|
|
|
172
170
|
onValueChange: (e) => a(e === "" ? void 0 : e)
|
|
173
171
|
});
|
|
174
172
|
}
|
|
175
|
-
function
|
|
176
|
-
return /* @__PURE__ */ f(
|
|
173
|
+
function N({ field: e, selected: t, items: n, isDisabled: r, accessibility: i, onChange: a }) {
|
|
174
|
+
return /* @__PURE__ */ f(o, {
|
|
177
175
|
...i,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
isDisabled: r,
|
|
185
|
-
onValueChange: (t) => a(k(e, t))
|
|
186
|
-
})
|
|
176
|
+
items: n,
|
|
177
|
+
value: t,
|
|
178
|
+
..._(e),
|
|
179
|
+
mode: e.multiple ? "multiple" : "single",
|
|
180
|
+
isDisabled: r,
|
|
181
|
+
onValueChange: (t) => a(A(e, t))
|
|
187
182
|
});
|
|
188
183
|
}
|
|
189
|
-
function
|
|
190
|
-
let
|
|
184
|
+
function P({ field: e, stored: r, selected: o, items: s, isDisabled: c, accessibility: { required: u, ...d }, onChange: p }) {
|
|
185
|
+
let m = {
|
|
191
186
|
stored: r,
|
|
192
|
-
isDisabled:
|
|
193
|
-
required:
|
|
194
|
-
accessibility:
|
|
195
|
-
onChange:
|
|
187
|
+
isDisabled: c,
|
|
188
|
+
required: u,
|
|
189
|
+
accessibility: d,
|
|
190
|
+
onChange: p
|
|
196
191
|
};
|
|
197
192
|
switch (e.type) {
|
|
198
193
|
case "shortText": return /* @__PURE__ */ f(n, {
|
|
199
|
-
...
|
|
200
|
-
required:
|
|
201
|
-
disabled:
|
|
194
|
+
...d,
|
|
195
|
+
required: u,
|
|
196
|
+
disabled: c,
|
|
202
197
|
placeholder: e.placeholder,
|
|
203
198
|
type: e.inputType,
|
|
204
199
|
maxLength: e.maxLength,
|
|
205
200
|
readOnly: e.readOnly,
|
|
206
201
|
autoFocus: e.autoFocus,
|
|
207
202
|
value: typeof r == "string" ? r : "",
|
|
208
|
-
onChange: (e) =>
|
|
203
|
+
onChange: (e) => p(e.target.value)
|
|
209
204
|
});
|
|
210
205
|
case "longText": return /* @__PURE__ */ f(t, {
|
|
211
|
-
...
|
|
212
|
-
required:
|
|
213
|
-
disabled:
|
|
206
|
+
...d,
|
|
207
|
+
required: u,
|
|
208
|
+
disabled: c,
|
|
214
209
|
placeholder: e.placeholder,
|
|
215
210
|
rows: e.rows,
|
|
216
211
|
maxLength: e.maxLength,
|
|
217
212
|
readOnly: e.readOnly,
|
|
218
213
|
autoFocus: e.autoFocus,
|
|
219
214
|
value: typeof r == "string" ? r : "",
|
|
220
|
-
onChange: (e) =>
|
|
215
|
+
onChange: (e) => p(e.target.value)
|
|
221
216
|
});
|
|
222
|
-
case "number": return /* @__PURE__ */ f(
|
|
217
|
+
case "number": return /* @__PURE__ */ f(j, {
|
|
223
218
|
field: e,
|
|
224
|
-
...
|
|
219
|
+
...m
|
|
225
220
|
});
|
|
226
221
|
case "boolean": return /* @__PURE__ */ f(l, {
|
|
227
|
-
...
|
|
228
|
-
isDisabled:
|
|
222
|
+
...d,
|
|
223
|
+
isDisabled: c,
|
|
229
224
|
autoFocus: e.autoFocus,
|
|
230
225
|
isSelected: r === !0,
|
|
231
|
-
onSelectedChange:
|
|
226
|
+
onSelectedChange: p
|
|
232
227
|
});
|
|
233
228
|
case "dateTime": return /* @__PURE__ */ f(n, {
|
|
234
|
-
...
|
|
235
|
-
required:
|
|
236
|
-
disabled:
|
|
229
|
+
...d,
|
|
230
|
+
required: u,
|
|
231
|
+
disabled: c,
|
|
237
232
|
type: "datetime-local",
|
|
238
233
|
step: "0.001",
|
|
239
234
|
autoFocus: e.autoFocus,
|
|
240
|
-
value:
|
|
241
|
-
onChange: (e) =>
|
|
235
|
+
value: y(r)?.slice(0, -1) ?? "",
|
|
236
|
+
onChange: (e) => p(y(`${e.target.value}Z`))
|
|
242
237
|
});
|
|
243
238
|
case "richText": return /* @__PURE__ */ f(a, {
|
|
244
|
-
...
|
|
239
|
+
...d,
|
|
245
240
|
label: e.label,
|
|
246
|
-
isRequired:
|
|
247
|
-
isDisabled:
|
|
241
|
+
isRequired: u,
|
|
242
|
+
isDisabled: c,
|
|
248
243
|
placeholder: e.placeholder,
|
|
249
244
|
format: "json",
|
|
250
245
|
value: r === void 0 ? i : r,
|
|
251
|
-
onChange:
|
|
246
|
+
onChange: p
|
|
252
247
|
});
|
|
253
|
-
case "select": return /* @__PURE__ */ f(
|
|
248
|
+
case "select": return /* @__PURE__ */ f(M, {
|
|
254
249
|
field: e,
|
|
255
|
-
...
|
|
250
|
+
...m
|
|
256
251
|
});
|
|
257
252
|
case "asset":
|
|
258
|
-
case "reference": return /* @__PURE__ */ f(
|
|
253
|
+
case "reference": return /* @__PURE__ */ f(N, {
|
|
259
254
|
field: e,
|
|
260
|
-
items:
|
|
261
|
-
|
|
255
|
+
items: s,
|
|
256
|
+
selected: o ?? [],
|
|
257
|
+
...m
|
|
262
258
|
});
|
|
263
259
|
}
|
|
264
260
|
}
|
|
265
261
|
//#endregion
|
|
266
262
|
//#region src/components/FormEditor/index.tsx
|
|
267
|
-
function
|
|
268
|
-
let c = u(() => a === void 0 && o ?
|
|
263
|
+
function F({ field: t, stored: n, items: r, isDisabled: i, error: a, isErrorVisible: o, onChange: s }) {
|
|
264
|
+
let c = u(() => a === void 0 && o ? O(t, n) : void 0, [
|
|
269
265
|
a,
|
|
270
266
|
o,
|
|
271
267
|
t,
|
|
272
268
|
n
|
|
273
|
-
]), l = t.type === "
|
|
269
|
+
]), l = u(() => t.type === "asset" || t.type === "reference" ? v(t, n) : void 0, [t, n]);
|
|
274
270
|
return /* @__PURE__ */ f(e, {
|
|
275
|
-
label:
|
|
271
|
+
label: t.type === "dateTime" ? `${t.label} (UTC)` : g(t),
|
|
276
272
|
hint: t.hint,
|
|
277
273
|
error: a ?? c,
|
|
278
274
|
isRequired: t.required,
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
count: l?.length,
|
|
276
|
+
isGroup: l !== void 0,
|
|
277
|
+
children: (e) => /* @__PURE__ */ f(P, {
|
|
281
278
|
field: t,
|
|
282
279
|
stored: n,
|
|
280
|
+
selected: l,
|
|
283
281
|
items: r,
|
|
284
282
|
isDisabled: i,
|
|
285
283
|
accessibility: e,
|
|
@@ -287,7 +285,7 @@ function P({ field: t, stored: n, items: r, isDisabled: i, error: a, isErrorVisi
|
|
|
287
285
|
})
|
|
288
286
|
});
|
|
289
287
|
}
|
|
290
|
-
function
|
|
288
|
+
function I({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, pickerItems: i = {}, errors: a = {}, isDisabled: o = !1, showAllErrors: s = !1, columns: c = 1, minColumnWidth: l = "16rem", className: p, style: h, ...g }) {
|
|
291
289
|
let [_, v] = d(n), [y, b] = d(() => /* @__PURE__ */ new Set()), x = t ?? _;
|
|
292
290
|
u(() => m(e), [e]);
|
|
293
291
|
let S = (e, n) => {
|
|
@@ -310,7 +308,7 @@ function F({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, picker
|
|
|
310
308
|
...g,
|
|
311
309
|
children: e.fields.map((e) => {
|
|
312
310
|
let t = Object.hasOwn(x, e.id) ? x[e.id] : void 0, n = o || !!e.isDisabled, r = n || "readOnly" in e && !!e.readOnly, c = s || y.has(e.id) || e.type === "number" && typeof t == "number";
|
|
313
|
-
return /* @__PURE__ */ f(
|
|
311
|
+
return /* @__PURE__ */ f(F, {
|
|
314
312
|
field: e,
|
|
315
313
|
stored: t,
|
|
316
314
|
items: i[e.id] ?? [],
|
|
@@ -325,6 +323,6 @@ function F({ schema: e, value: t, defaultValue: n = {}, onValueChange: r, picker
|
|
|
325
323
|
});
|
|
326
324
|
}
|
|
327
325
|
//#endregion
|
|
328
|
-
export {
|
|
326
|
+
export { k as n, I as t };
|
|
329
327
|
|
|
330
|
-
//# sourceMappingURL=FormEditor-
|
|
328
|
+
//# sourceMappingURL=FormEditor-DRmPFe2E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormEditor-DRmPFe2E.js","names":["documentError","emptyDocument","RichTextEditor","fieldTypes","assertModel","ids","field","model","linkCopy","fieldLabel","pickerCopy","defaults","selectedIds","value","isLink","link","key","parseUtcDateTime","match","canonical","date","hasRichText","node","requiredError","textError","richTextError","error","choiceError","option","linkError","itemLabel","item","itemsLabel","max","validators","fieldError","validateFormValues","values","pickerValue","links","NumberControl","NumberField","accessibility","stored","next","onChange","SelectControl","isClearable","required","Select","PickerControl","EntryPicker","selected","FormControl","shared","TextField","isDisabled","event","TextArea","Switch","FormEditorField","validation","useMemo","isErrorVisible","Field","FormEditor","rest","internal","setInternal","useState","defaultValue","changed","setChanged","current","schema","commit","fieldId","previous","onValueChange","layout","columns","minColumnWidth","className","style","fieldDisabled","isLocked","showAllErrors","pickerItems","errors"],"sources":["../../src/components/FormEditor/model.ts","../../src/components/FormEditor/control.tsx","../../src/components/FormEditor/index.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { SelectOption } from \"../Select\";\nimport type { EntryPickerProps } from \"../EntryPicker\";\nimport type { JSONContent } from \"@tiptap/react\";\nimport { documentError } from \"../RichTextEditor/document\";\nimport type { RichTextDocument } from \"../RichTextEditor\";\n\ninterface FormFieldBase {\n id: string;\n label: string;\n hint?: ReactNode;\n placeholder?: string;\n required?: boolean;\n isDisabled?: boolean;\n}\n\nexport type FormField = FormFieldBase &\n (\n | {\n type: \"shortText\";\n inputType?: \"text\" | \"email\";\n maxLength?: number;\n readOnly?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n }\n | {\n type: \"longText\";\n rows?: number;\n maxLength?: number;\n readOnly?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n }\n | { type: \"boolean\" | \"dateTime\"; autoFocus?: boolean; multiple?: never }\n | { type: \"richText\"; autoFocus?: never; multiple?: never }\n | {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number | \"any\";\n hasSteppers?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n }\n | { type: \"select\"; options: SelectOption[]; autoFocus?: boolean; multiple?: never }\n | {\n type: \"asset\" | \"reference\";\n multiple?: boolean;\n autoFocus?: never;\n picker?: Pick<\n EntryPickerProps,\n \"label\" | \"addLabel\" | \"emptyLabel\" | \"itemLabel\" | \"itemsLabel\" | \"max\" | \"isReorderable\"\n >;\n }\n );\n\nexport type FieldOf<T extends FormField[\"type\"]> = Extract<FormField, { type: T }>;\n\nexport interface FormSchema {\n fields: readonly FormField[];\n}\n\nexport interface AssetValue {\n assetId: string;\n}\nexport interface ReferenceValue {\n entryId: string;\n}\nexport type FormFieldValue =\n | string\n | number\n | boolean\n | RichTextDocument\n | AssetValue\n | ReferenceValue\n | AssetValue[]\n | ReferenceValue[];\nexport type FormValues = Record<string, FormFieldValue | undefined>;\nexport type FormErrors = Partial<Record<string, string>>;\n\nconst fieldTypes = new Set([\n \"shortText\",\n \"longText\",\n \"richText\",\n \"number\",\n \"boolean\",\n \"dateTime\",\n \"asset\",\n \"reference\",\n \"select\",\n]);\n\nexport function assertModel(model: FormSchema) {\n const ids = new Set<string>();\n for (const field of model.fields) {\n if (!field.id?.trim() || ids.has(field.id))\n throw new Error(\"Form field IDs must be nonempty and unique.\");\n if (!fieldTypes.has(field.type)) throw new Error(`Unsupported form field type: ${field.type}`);\n if (field.type === \"select\" && !Array.isArray(field.options))\n throw new Error(`Select field ${field.id} needs an options array.`);\n ids.add(field.id);\n }\n}\n\nconst linkCopy = {\n asset: { key: \"assetId\", itemLabel: \"asset\", itemsLabel: \"assets\" },\n reference: { key: \"entryId\", itemLabel: \"entry\", itemsLabel: \"entries\" },\n} as const;\n\n/** The field's visible and accessible name. A picker's `label` overrides it. */\nexport function fieldLabel(field: FormField): string {\n return field.type === \"asset\" || field.type === \"reference\"\n ? (field.picker?.label ?? field.label)\n : field.label;\n}\n\n/** Picker action and item copy, with asset or entry wording for any option left out or undefined. */\nexport function pickerCopy(field: FieldOf<\"asset\" | \"reference\">) {\n const defaults = linkCopy[field.type];\n const {\n addLabel = `Choose ${fieldLabel(field)}`,\n emptyLabel,\n itemLabel = defaults.itemLabel,\n itemsLabel = defaults.itemsLabel,\n max,\n isReorderable,\n } = field.picker ?? {};\n return { addLabel, emptyLabel, itemLabel, itemsLabel, max, isReorderable };\n}\n\n/** The picked IDs, in stored order, skipping anything that isn't a link. */\nexport function selectedIds(field: FieldOf<\"asset\" | \"reference\">, value: unknown): string[] {\n const { key } = linkCopy[field.type];\n const links = Array.isArray(value) ? value : value === undefined ? [] : [value];\n return links.flatMap((link) =>\n isLink(link, key) ? [(link as Record<string, string>)[key]] : [],\n );\n}\n\n/** Accept UTC ISO strings without rolling invalid dates into the next month. */\nexport function parseUtcDateTime(value: unknown): string | undefined {\n if (typeof value !== \"string\") return;\n const match = /^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2})(?::(\\d{2})(?:\\.(\\d{1,3}))?)?(?:Z|\\+00:00)$/.exec(\n value,\n );\n if (!match) return;\n const canonical = `${match[1]}:${match[2] ?? \"00\"}.${(match[3] ?? \"\").padEnd(3, \"0\")}Z`;\n const date = new Date(canonical);\n if (Number.isFinite(date.getTime()) && date.toISOString() === canonical) return canonical;\n}\n\nfunction isLink(value: unknown, key: \"assetId\" | \"entryId\"): boolean {\n return (\n !!value &&\n typeof value === \"object\" &&\n key in value &&\n typeof (value as Record<string, unknown>)[key] === \"string\" &&\n (value as Record<string, string>)[key].trim().length > 0\n );\n}\n\nfunction hasRichText(node: JSONContent): boolean {\n return !!node.text?.trim() || node.type === \"horizontalRule\" || !!node.content?.some(hasRichText);\n}\n\nfunction requiredError(field: FormField): string {\n return `${fieldLabel(field)} is required.`;\n}\n\nfunction textError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") return \"Enter text.\";\n if (field.required && !value.trim()) return requiredError(field);\n if (\n (field.type === \"shortText\" || field.type === \"longText\") &&\n field.maxLength !== undefined &&\n value.length > field.maxLength\n ) {\n return `Enter no more than ${field.maxLength} characters.`;\n }\n}\n\nfunction richTextError(field: FormField, value: unknown): string | undefined {\n const error = documentError(value);\n if (error) return error;\n if (field.required && !hasRichText(value as RichTextDocument)) return requiredError(field);\n}\n\nfunction choiceError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") return \"Choose an available option.\";\n if (value === \"\") return field.required ? requiredError(field) : undefined;\n // An empty list means the choices are still loading, so a stored value stays valid until they arrive.\n if (\n field.type === \"select\" &&\n field.options.length > 0 &&\n !field.options.some((option) => option.value === value)\n ) {\n return \"Choose an available option.\";\n }\n}\n\nfunction linkError(field: FormField, value: unknown): string | undefined {\n if (field.type !== \"asset\" && field.type !== \"reference\") return;\n const { key, itemLabel, itemsLabel } = linkCopy[field.type];\n if (!field.multiple) return isLink(value, key) ? undefined : `Choose an ${itemLabel}.`;\n if (!Array.isArray(value) || !value.every((item) => isLink(item, key)))\n return `Choose a list of ${itemsLabel}.`;\n if (field.required && value.length === 0) return requiredError(field);\n const max = field.picker?.max;\n if (max !== undefined && value.length > max)\n return `Choose no more than ${max} ${pickerCopy(field).itemsLabel}.`;\n}\n\nconst validators: Record<\n FormField[\"type\"],\n (field: FormField, value: unknown) => string | undefined\n> = {\n shortText: textError,\n longText: textError,\n richText: richTextError,\n number: (field, value) => {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return \"Enter a finite number.\";\n if (field.type !== \"number\") return;\n if (field.min !== undefined && value < field.min)\n return `Enter a number of at least ${field.min}.`;\n if (field.max !== undefined && value > field.max)\n return `Enter a number no greater than ${field.max}.`;\n },\n boolean: (_field, value) => (typeof value === \"boolean\" ? undefined : \"Choose a boolean value.\"),\n dateTime: (_field, value) =>\n parseUtcDateTime(value) ? undefined : \"Enter a valid UTC date and time.\",\n select: choiceError,\n asset: linkError,\n reference: linkError,\n};\n\nexport function fieldError(field: FormField, value: unknown): string | undefined {\n if (value === undefined) return field.required ? requiredError(field) : undefined;\n return validators[field.type](field, value);\n}\n\n/** Validate data loaded from JSON as well as values emitted by FormEditor. */\nexport function validateFormValues(model: FormSchema, values: Record<string, unknown>): FormErrors {\n assertModel(model);\n return Object.fromEntries(\n model.fields.flatMap((field): [string, string][] => {\n const error = fieldError(\n field,\n Object.hasOwn(values, field.id) ? values[field.id] : undefined,\n );\n return error ? [[field.id, error]] : [];\n }),\n );\n}\n","import { EntryPicker, type EntryItem } from \"../EntryPicker\";\nimport type { FieldRenderProps } from \"../Field\";\nimport { NumberField } from \"../NumberField\";\nimport { RichTextEditor, type RichTextDocument } from \"../RichTextEditor\";\nimport { emptyDocument } from \"../RichTextEditor/document\";\nimport { Select } from \"../Select\";\nimport { Switch } from \"../Switch\";\nimport { TextArea, TextField } from \"../TextField\";\nimport {\n parseUtcDateTime,\n pickerCopy,\n type FieldOf,\n type FormField,\n type FormFieldValue,\n} from \"./model\";\n\nfunction pickerValue(field: FormField, ids: string[]): FormFieldValue | undefined {\n if (field.type === \"asset\") {\n const links = ids.map((assetId) => ({ assetId }));\n return field.multiple ? links : links[0];\n }\n const links = ids.map((entryId) => ({ entryId }));\n return field.multiple ? links : links[0];\n}\n\ntype Accessibility = FieldRenderProps;\n\ninterface ControlProps<F extends FormField> {\n field: F;\n stored: FormFieldValue | undefined;\n isDisabled: boolean;\n required: boolean | undefined;\n accessibility: Omit<Accessibility, \"required\">;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\nfunction NumberControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"number\">>) {\n return (\n <NumberField\n {...accessibility}\n required={required}\n isDisabled={isDisabled}\n placeholder={field.placeholder}\n min={field.min}\n max={field.max}\n step={field.step ?? \"any\"}\n hasSteppers={field.hasSteppers ?? false}\n autoFocus={field.autoFocus}\n decreaseLabel={`Decrease ${field.label}`}\n increaseLabel={`Increase ${field.label}`}\n value={typeof stored === \"number\" && Number.isFinite(stored) ? stored : \"\"}\n onValueChange={(next) => {\n if (next === \"\" || Number.isFinite(next)) onChange(next === \"\" ? undefined : next);\n }}\n />\n );\n}\n\nfunction SelectControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"select\">>) {\n // Optional selects lead with an empty choice; picking it removes the key.\n const isClearable = !required && !field.options.some((option) => option.value === \"\");\n return (\n <Select\n {...accessibility}\n aria-required={required || undefined}\n isDisabled={isDisabled}\n isInvalid={accessibility[\"aria-invalid\"]}\n options={\n isClearable\n ? [{ value: \"\", label: field.placeholder ?? \"None\" }, ...field.options]\n : field.options\n }\n placeholder={field.placeholder}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onValueChange={(next) => onChange(next === \"\" ? undefined : next)}\n />\n );\n}\n\nfunction PickerControl({\n field,\n selected,\n items,\n isDisabled,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"asset\" | \"reference\">> & { items: EntryItem[]; selected: string[] }) {\n return (\n <EntryPicker\n {...accessibility}\n items={items}\n value={selected}\n {...pickerCopy(field)}\n mode={field.multiple ? \"multiple\" : \"single\"}\n isDisabled={isDisabled}\n onValueChange={(ids) => onChange(pickerValue(field, ids))}\n />\n );\n}\n\ninterface FormControlProps {\n field: FormField;\n stored: FormFieldValue | undefined;\n /** Picker fields' stored IDs, derived once by the owning field. */\n selected: string[] | undefined;\n items: EntryItem[];\n isDisabled: boolean;\n accessibility: Accessibility;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\nexport function FormControl({\n field,\n stored,\n selected,\n items,\n isDisabled,\n accessibility: { required, ...accessibility },\n onChange,\n}: FormControlProps) {\n const shared = { stored, isDisabled, required, accessibility, onChange };\n switch (field.type) {\n case \"shortText\":\n return (\n <TextField\n {...accessibility}\n required={required}\n disabled={isDisabled}\n placeholder={field.placeholder}\n type={field.inputType}\n maxLength={field.maxLength}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onChange={(event) => onChange(event.target.value)}\n />\n );\n case \"longText\":\n return (\n <TextArea\n {...accessibility}\n required={required}\n disabled={isDisabled}\n placeholder={field.placeholder}\n rows={field.rows}\n maxLength={field.maxLength}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onChange={(event) => onChange(event.target.value)}\n />\n );\n case \"number\":\n return (\n <NumberControl\n field={field}\n {...shared}\n />\n );\n case \"boolean\":\n return (\n <Switch\n {...accessibility}\n isDisabled={isDisabled}\n autoFocus={field.autoFocus}\n isSelected={stored === true}\n onSelectedChange={onChange}\n />\n );\n case \"dateTime\":\n return (\n <TextField\n {...accessibility}\n required={required}\n disabled={isDisabled}\n type=\"datetime-local\"\n step=\"0.001\"\n autoFocus={field.autoFocus}\n value={parseUtcDateTime(stored)?.slice(0, -1) ?? \"\"}\n onChange={(event) => onChange(parseUtcDateTime(`${event.target.value}Z`))}\n />\n );\n case \"richText\":\n return (\n <RichTextEditor\n {...accessibility}\n label={field.label}\n isRequired={required}\n isDisabled={isDisabled}\n placeholder={field.placeholder}\n format=\"json\"\n value={stored === undefined ? emptyDocument : (stored as RichTextDocument)}\n onChange={onChange}\n />\n );\n case \"select\":\n return (\n <SelectControl\n field={field}\n {...shared}\n />\n );\n case \"asset\":\n case \"reference\":\n return (\n <PickerControl\n field={field}\n items={items}\n selected={selected ?? []}\n {...shared}\n />\n );\n }\n}\n","import { useMemo, useState, type CSSProperties, type HTMLAttributes } from \"react\";\nimport type { EntryItem } from \"../EntryPicker\";\nimport { Field } from \"../Field\";\nimport type { GridColumns } from \"../Grid\";\nimport { FormControl } from \"./control\";\nimport {\n assertModel,\n fieldError,\n fieldLabel,\n selectedIds,\n type FormField,\n type FormSchema,\n type FormErrors,\n type FormFieldValue,\n type FormValues,\n} from \"./model\";\nimport \"./style.css\";\n\nexport { validateFormValues } from \"./model\";\nexport type {\n AssetValue,\n FormField,\n FormSchema,\n FormErrors,\n FormFieldValue,\n FormValues,\n ReferenceValue,\n} from \"./model\";\n\nexport interface FormChange {\n fieldId: string;\n}\n\nexport interface FormEditorProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"defaultValue\" | \"onChange\"\n> {\n schema: FormSchema;\n value?: FormValues;\n defaultValue?: FormValues;\n onValueChange?: (values: FormValues, change: FormChange) => void;\n /** Available assets or entries, keyed by field ID. Loading belongs to the app. */\n pickerItems?: Record<string, EntryItem[]>;\n /** App-provided messages take precedence over built-in validation. */\n errors?: FormErrors;\n isDisabled?: boolean;\n showAllErrors?: boolean;\n /** Columns at the widest. The form drops one whenever a field would be narrower than `minColumnWidth`. */\n columns?: GridColumns;\n /** Narrowest a field may get before the form drops a column. */\n minColumnWidth?: string;\n}\n\ninterface FormEditorFieldProps {\n field: FormField;\n stored: FormFieldValue | undefined;\n items: EntryItem[];\n isDisabled: boolean;\n error: string | undefined;\n isErrorVisible: boolean;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\n/** Validates only when its message can show, and only when its own field or value changes. */\nfunction FormEditorField({\n field,\n stored,\n items,\n isDisabled,\n error,\n isErrorVisible,\n onChange,\n}: FormEditorFieldProps) {\n const validation = useMemo(\n () => (error === undefined && isErrorVisible ? fieldError(field, stored) : undefined),\n [error, isErrorVisible, field, stored],\n );\n const selected = useMemo(\n () =>\n field.type === \"asset\" || field.type === \"reference\" ? selectedIds(field, stored) : undefined,\n [field, stored],\n );\n return (\n <Field\n label={field.type === \"dateTime\" ? `${field.label} (UTC)` : fieldLabel(field)}\n hint={field.hint}\n error={error ?? validation}\n isRequired={field.required}\n count={selected?.length}\n isGroup={selected !== undefined}\n >\n {(accessibility) => (\n <FormControl\n field={field}\n stored={stored}\n selected={selected}\n items={items}\n isDisabled={isDisabled}\n accessibility={accessibility}\n onChange={onChange}\n />\n )}\n </Field>\n );\n}\n\n/** Ordered form controls. Loading, submission, and persistence belong to the app. */\nexport function FormEditor({\n schema,\n value,\n defaultValue = {},\n onValueChange,\n pickerItems = {},\n errors = {},\n isDisabled = false,\n showAllErrors = false,\n columns = 1,\n minColumnWidth = \"16rem\",\n className,\n style,\n ...rest\n}: FormEditorProps) {\n const [internal, setInternal] = useState<FormValues>(defaultValue);\n const [changed, setChanged] = useState<Set<string>>(() => new Set());\n const current = value ?? internal;\n useMemo(() => assertModel(schema), [schema]);\n\n const commit = (fieldId: string, next: FormFieldValue | undefined) => {\n const values = { ...current };\n if (next === undefined) delete values[fieldId];\n else values[fieldId] = next;\n if (value === undefined) setInternal(values);\n setChanged((previous) => new Set(previous).add(fieldId));\n onValueChange?.(values, { fieldId });\n };\n\n const layout =\n columns === \"auto\"\n ? { \"--form-editor-min-column\": minColumnWidth }\n : { \"--form-editor-columns\": columns, \"--form-editor-min-column\": minColumnWidth };\n\n return (\n <div\n className={[\"ds-form-editor\", columns === \"auto\" && \"ds-form-editor--auto\", className]\n .filter(Boolean)\n .join(\" \")}\n style={{ ...layout, ...style } as CSSProperties}\n {...rest}\n >\n {schema.fields.map((field) => {\n const stored = Object.hasOwn(current, field.id) ? current[field.id] : undefined;\n const fieldDisabled = isDisabled || Boolean(field.isDisabled);\n const isLocked = fieldDisabled || (\"readOnly\" in field && Boolean(field.readOnly));\n // NumberField marks an out-of-range number invalid itself, so its message shows straight away.\n const isErrorVisible =\n showAllErrors ||\n changed.has(field.id) ||\n (field.type === \"number\" && typeof stored === \"number\");\n return (\n <FormEditorField\n key={field.id}\n field={field}\n stored={stored}\n items={pickerItems[field.id] ?? []}\n isDisabled={fieldDisabled}\n error={errors[field.id]}\n isErrorVisible={isErrorVisible}\n onChange={(next) => {\n if (!isLocked) commit(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AAC,GACvDE,IAAgBzC,GAAQ,EAAE,WAAQ,CAAC;CACrC,GAEM0C,IACJC,MAAY,SACR,EAAE,4BAA4BC,EAAe,IAC7C;EAAE,yBAAyBD;EAAS,4BAA4BC;CAAe;CAErF,OACE,kBAAC,OAAD;EACE,WAAW;GAAC;GAAkBD,MAAY,UAAU;GAAwBE;EAAS,CAAC,CACnF,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;EACX,OAAO;GAAE,GAAGH;GAAQ,GAAGI;EAAM;EAC7B,GAAIjB;EAEH,UAAAQ,EAAO,OAAO,KAAK,MAAU;GAC5B,IAAM/B,IAAS,OAAO,OAAO8B,GAASnE,EAAM,EAAE,IAAImE,EAAQnE,EAAM,MAAM,KAAA,GAChE8E,IAAgB5B,KAAc,EAAQlD,EAAM,YAC5C+E,IAAWD,KAAkB,cAAc9E,KAAS,EAAQA,EAAM,UAElEyD,IACJuB,KACAf,EAAQ,IAAIjE,EAAM,EAAE,KACnBA,EAAM,SAAS,YAAY,OAAOqC,KAAW;GAChD,OACE,kBAACiB,GAAD;IAES;IACC;IACR,OAAO2B,EAAYjF,EAAM,OAAO,CAAC;IACjC,YAAY8E;IACZ,OAAOI,EAAOlF,EAAM;IACJ;IAChB,WAAW,MAAS;KAClB,AAAK+E,KAAUV,EAAOrE,EAAM,IAAIsC,CAAI;IACtC;GACD,GAVMtC,EAAM,EAUZ;EAEL,CAAC;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../components/Field/index.cjs"),t=require("../components/TextField/index.cjs"),n=require("./RichTextEditor-C7nMfDmE.cjs"),r=require("../components/EntryPicker/index.cjs"),i=require("../components/NumberField/index.cjs"),a=require("../components/Select/index.cjs"),o=require("../components/Switch/index.cjs");let s=require("react"),c=require("react/jsx-runtime");var l=new Set([`shortText`,`longText`,`richText`,`number`,`boolean`,`dateTime`,`asset`,`reference`,`select`]);function u(e){let t=new Set;for(let n of e.fields){if(!n.id?.trim()||t.has(n.id))throw Error(`Form field IDs must be nonempty and unique.`);if(!l.has(n.type))throw Error(`Unsupported form field type: ${n.type}`);if(n.type===`select`&&!Array.isArray(n.options))throw Error(`Select field ${n.id} needs an options array.`);t.add(n.id)}}var d={asset:{key:`assetId`,itemLabel:`asset`,itemsLabel:`assets`},reference:{key:`entryId`,itemLabel:`entry`,itemsLabel:`entries`}};function f(e){return e.type===`asset`||e.type===`reference`?e.picker?.label??e.label:e.label}function p(e){let t=d[e.type],{addLabel:n=`Choose ${f(e)}`,emptyLabel:r,itemLabel:i=t.itemLabel,itemsLabel:a=t.itemsLabel,max:o,isReorderable:s}=e.picker??{};return{addLabel:n,emptyLabel:r,itemLabel:i,itemsLabel:a,max:o,isReorderable:s}}function m(e,t){let{key:n}=d[e.type];return(Array.isArray(t)?t:t===void 0?[]:[t]).flatMap(e=>g(e,n)?[e[n]]:[])}function h(e){if(typeof e!=`string`)return;let t=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(?:Z|\+00:00)$/.exec(e);if(!t)return;let n=`${t[1]}:${t[2]??`00`}.${(t[3]??``).padEnd(3,`0`)}Z`,r=new Date(n);if(Number.isFinite(r.getTime())&&r.toISOString()===n)return n}function g(e,t){return!!e&&typeof e==`object`&&t in e&&typeof e[t]==`string`&&e[t].trim().length>0}function _(e){return!!e.text?.trim()||e.type===`horizontalRule`||!!e.content?.some(_)}function v(e){return`${f(e)} is required.`}function y(e,t){if(typeof t!=`string`)return`Enter text.`;if(e.required&&!t.trim())return v(e);if((e.type===`shortText`||e.type===`longText`)&&e.maxLength!==void 0&&t.length>e.maxLength)return`Enter no more than ${e.maxLength} characters.`}function b(e,t){let r=n.n(t);if(r)return r;if(e.required&&!_(t))return v(e)}function x(e,t){if(typeof t!=`string`)return`Choose an available option.`;if(t===``)return e.required?v(e):void 0;if(e.type===`select`&&e.options.length>0&&!e.options.some(e=>e.value===t))return`Choose an available option.`}function S(e,t){if(e.type!==`asset`&&e.type!==`reference`)return;let{key:n,itemLabel:r,itemsLabel:i}=d[e.type];if(!e.multiple)return g(t,n)?void 0:`Choose an ${r}.`;if(!Array.isArray(t)||!t.every(e=>g(e,n)))return`Choose a list of ${i}.`;if(e.required&&t.length===0)return v(e);let a=e.picker?.max;if(a!==void 0&&t.length>a)return`Choose no more than ${a} ${p(e).itemsLabel}.`}var C={shortText:y,longText:y,richText:b,number:(e,t)=>{if(typeof t!=`number`||!Number.isFinite(t))return`Enter a finite number.`;if(e.type===`number`){if(e.min!==void 0&&t<e.min)return`Enter a number of at least ${e.min}.`;if(e.max!==void 0&&t>e.max)return`Enter a number no greater than ${e.max}.`}},boolean:(e,t)=>typeof t==`boolean`?void 0:`Choose a boolean value.`,dateTime:(e,t)=>h(t)?void 0:`Enter a valid UTC date and time.`,select:x,asset:S,reference:S};function w(e,t){return t===void 0?e.required?v(e):void 0:C[e.type](e,t)}function T(e,t){return u(e),Object.fromEntries(e.fields.flatMap(e=>{let n=w(e,Object.hasOwn(t,e.id)?t[e.id]:void 0);return n?[[e.id,n]]:[]}))}function E(e,t){if(e.type===`asset`){let n=t.map(e=>({assetId:e}));return e.multiple?n:n[0]}let n=t.map(e=>({entryId:e}));return e.multiple?n:n[0]}function D({field:e,stored:t,isDisabled:n,required:r,accessibility:a,onChange:o}){return(0,c.jsx)(i.NumberField,{...a,required:r,isDisabled:n,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step??`any`,hasSteppers:e.hasSteppers??!1,autoFocus:e.autoFocus,decreaseLabel:`Decrease ${e.label}`,increaseLabel:`Increase ${e.label}`,value:typeof t==`number`&&Number.isFinite(t)?t:``,onValueChange:e=>{(e===``||Number.isFinite(e))&&o(e===``?void 0:e)}})}function O({field:e,stored:t,isDisabled:n,required:r,accessibility:i,onChange:o}){let s=!r&&!e.options.some(e=>e.value===``);return(0,c.jsx)(a.Select,{...i,"aria-required":r||void 0,isDisabled:n,isInvalid:i[`aria-invalid`],options:s?[{value:``,label:e.placeholder??`None`},...e.options]:e.options,placeholder:e.placeholder,autoFocus:e.autoFocus,value:typeof t==`string`?t:``,onValueChange:e=>o(e===``?void 0:e)})}function k({field:e,selected:t,items:n,isDisabled:i,accessibility:a,onChange:o}){return(0,c.jsx)(r.EntryPicker,{...a,items:n,value:t,...p(e),mode:e.multiple?`multiple`:`single`,isDisabled:i,onValueChange:t=>o(E(e,t))})}function A({field:e,stored:r,selected:i,items:a,isDisabled:s,accessibility:{required:l,...u},onChange:d}){let f={stored:r,isDisabled:s,required:l,accessibility:u,onChange:d};switch(e.type){case`shortText`:return(0,c.jsx)(t.TextField,{...u,required:l,disabled:s,placeholder:e.placeholder,type:e.inputType,maxLength:e.maxLength,readOnly:e.readOnly,autoFocus:e.autoFocus,value:typeof r==`string`?r:``,onChange:e=>d(e.target.value)});case`longText`:return(0,c.jsx)(t.TextArea,{...u,required:l,disabled:s,placeholder:e.placeholder,rows:e.rows,maxLength:e.maxLength,readOnly:e.readOnly,autoFocus:e.autoFocus,value:typeof r==`string`?r:``,onChange:e=>d(e.target.value)});case`number`:return(0,c.jsx)(D,{field:e,...f});case`boolean`:return(0,c.jsx)(o.Switch,{...u,isDisabled:s,autoFocus:e.autoFocus,isSelected:r===!0,onSelectedChange:d});case`dateTime`:return(0,c.jsx)(t.TextField,{...u,required:l,disabled:s,type:`datetime-local`,step:`0.001`,autoFocus:e.autoFocus,value:h(r)?.slice(0,-1)??``,onChange:e=>d(h(`${e.target.value}Z`))});case`richText`:return(0,c.jsx)(n.t,{...u,label:e.label,isRequired:l,isDisabled:s,placeholder:e.placeholder,format:`json`,value:r===void 0?n.r:r,onChange:d});case`select`:return(0,c.jsx)(O,{field:e,...f});case`asset`:case`reference`:return(0,c.jsx)(k,{field:e,items:a,selected:i??[],...f})}}function j({field:t,stored:n,items:r,isDisabled:i,error:a,isErrorVisible:o,onChange:l}){let u=(0,s.useMemo)(()=>a===void 0&&o?w(t,n):void 0,[a,o,t,n]),d=(0,s.useMemo)(()=>t.type===`asset`||t.type===`reference`?m(t,n):void 0,[t,n]);return(0,c.jsx)(e.Field,{label:t.type===`dateTime`?`${t.label} (UTC)`:f(t),hint:t.hint,error:a??u,isRequired:t.required,count:d?.length,isGroup:d!==void 0,children:e=>(0,c.jsx)(A,{field:t,stored:n,selected:d,items:r,isDisabled:i,accessibility:e,onChange:l})})}function M({schema:e,value:t,defaultValue:n={},onValueChange:r,pickerItems:i={},errors:a={},isDisabled:o=!1,showAllErrors:l=!1,columns:d=1,minColumnWidth:f=`16rem`,className:p,style:m,...h}){let[g,_]=(0,s.useState)(n),[v,y]=(0,s.useState)(()=>new Set),b=t??g;(0,s.useMemo)(()=>u(e),[e]);let x=(e,n)=>{let i={...b};n===void 0?delete i[e]:i[e]=n,t===void 0&&_(i),y(t=>new Set(t).add(e)),r?.(i,{fieldId:e})},S=d===`auto`?{"--form-editor-min-column":f}:{"--form-editor-columns":d,"--form-editor-min-column":f};return(0,c.jsx)(`div`,{className:[`ds-form-editor`,d===`auto`&&`ds-form-editor--auto`,p].filter(Boolean).join(` `),style:{...S,...m},...h,children:e.fields.map(e=>{let t=Object.hasOwn(b,e.id)?b[e.id]:void 0,n=o||!!e.isDisabled,r=n||`readOnly`in e&&!!e.readOnly,s=l||v.has(e.id)||e.type===`number`&&typeof t==`number`;return(0,c.jsx)(j,{field:e,stored:t,items:i[e.id]??[],isDisabled:n,error:a[e.id],isErrorVisible:s,onChange:t=>{r||x(e.id,t)}},e.id)})})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}});
|
|
2
|
+
//# sourceMappingURL=FormEditor-PVkvKep1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormEditor-PVkvKep1.cjs","names":["documentError","NumberField","Select","EntryPicker","TextField","TextArea","Switch","RichTextEditor","emptyDocument","useMemo","Field","useState","require_components_Field_index","require_components_TextField_index","require_RichTextEditor","require_components_EntryPicker_index","require_components_NumberField_index","require_components_Select_index","require_components_Switch_index","react","react_jsx_runtime","fieldTypes","assertModel","ids","field","model","linkCopy","fieldLabel","pickerCopy","defaults","selectedIds","value","isLink","link","key","parseUtcDateTime","match","canonical","date","hasRichText","node","requiredError","textError","richTextError","error","choiceError","option","linkError","itemLabel","item","itemsLabel","max","validators","fieldError","validateFormValues","values","pickerValue","links","NumberControl","accessibility","stored","next","onChange","SelectControl","isClearable","required","PickerControl","selected","FormControl","shared","isDisabled","event","FormEditorField","validation","isErrorVisible","FormEditor","rest","internal","setInternal","defaultValue","changed","setChanged","current","schema","commit","fieldId","previous","onValueChange","layout","columns","minColumnWidth","className","style","fieldDisabled","isLocked","showAllErrors","pickerItems","errors"],"sources":["../../src/components/FormEditor/model.ts","../../src/components/FormEditor/control.tsx","../../src/components/FormEditor/index.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { SelectOption } from \"../Select\";\nimport type { EntryPickerProps } from \"../EntryPicker\";\nimport type { JSONContent } from \"@tiptap/react\";\nimport { documentError } from \"../RichTextEditor/document\";\nimport type { RichTextDocument } from \"../RichTextEditor\";\n\ninterface FormFieldBase {\n id: string;\n label: string;\n hint?: ReactNode;\n placeholder?: string;\n required?: boolean;\n isDisabled?: boolean;\n}\n\nexport type FormField = FormFieldBase &\n (\n | {\n type: \"shortText\";\n inputType?: \"text\" | \"email\";\n maxLength?: number;\n readOnly?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n }\n | {\n type: \"longText\";\n rows?: number;\n maxLength?: number;\n readOnly?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n }\n | { type: \"boolean\" | \"dateTime\"; autoFocus?: boolean; multiple?: never }\n | { type: \"richText\"; autoFocus?: never; multiple?: never }\n | {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number | \"any\";\n hasSteppers?: boolean;\n autoFocus?: boolean;\n multiple?: never;\n }\n | { type: \"select\"; options: SelectOption[]; autoFocus?: boolean; multiple?: never }\n | {\n type: \"asset\" | \"reference\";\n multiple?: boolean;\n autoFocus?: never;\n picker?: Pick<\n EntryPickerProps,\n \"label\" | \"addLabel\" | \"emptyLabel\" | \"itemLabel\" | \"itemsLabel\" | \"max\" | \"isReorderable\"\n >;\n }\n );\n\nexport type FieldOf<T extends FormField[\"type\"]> = Extract<FormField, { type: T }>;\n\nexport interface FormSchema {\n fields: readonly FormField[];\n}\n\nexport interface AssetValue {\n assetId: string;\n}\nexport interface ReferenceValue {\n entryId: string;\n}\nexport type FormFieldValue =\n | string\n | number\n | boolean\n | RichTextDocument\n | AssetValue\n | ReferenceValue\n | AssetValue[]\n | ReferenceValue[];\nexport type FormValues = Record<string, FormFieldValue | undefined>;\nexport type FormErrors = Partial<Record<string, string>>;\n\nconst fieldTypes = new Set([\n \"shortText\",\n \"longText\",\n \"richText\",\n \"number\",\n \"boolean\",\n \"dateTime\",\n \"asset\",\n \"reference\",\n \"select\",\n]);\n\nexport function assertModel(model: FormSchema) {\n const ids = new Set<string>();\n for (const field of model.fields) {\n if (!field.id?.trim() || ids.has(field.id))\n throw new Error(\"Form field IDs must be nonempty and unique.\");\n if (!fieldTypes.has(field.type)) throw new Error(`Unsupported form field type: ${field.type}`);\n if (field.type === \"select\" && !Array.isArray(field.options))\n throw new Error(`Select field ${field.id} needs an options array.`);\n ids.add(field.id);\n }\n}\n\nconst linkCopy = {\n asset: { key: \"assetId\", itemLabel: \"asset\", itemsLabel: \"assets\" },\n reference: { key: \"entryId\", itemLabel: \"entry\", itemsLabel: \"entries\" },\n} as const;\n\n/** The field's visible and accessible name. A picker's `label` overrides it. */\nexport function fieldLabel(field: FormField): string {\n return field.type === \"asset\" || field.type === \"reference\"\n ? (field.picker?.label ?? field.label)\n : field.label;\n}\n\n/** Picker action and item copy, with asset or entry wording for any option left out or undefined. */\nexport function pickerCopy(field: FieldOf<\"asset\" | \"reference\">) {\n const defaults = linkCopy[field.type];\n const {\n addLabel = `Choose ${fieldLabel(field)}`,\n emptyLabel,\n itemLabel = defaults.itemLabel,\n itemsLabel = defaults.itemsLabel,\n max,\n isReorderable,\n } = field.picker ?? {};\n return { addLabel, emptyLabel, itemLabel, itemsLabel, max, isReorderable };\n}\n\n/** The picked IDs, in stored order, skipping anything that isn't a link. */\nexport function selectedIds(field: FieldOf<\"asset\" | \"reference\">, value: unknown): string[] {\n const { key } = linkCopy[field.type];\n const links = Array.isArray(value) ? value : value === undefined ? [] : [value];\n return links.flatMap((link) =>\n isLink(link, key) ? [(link as Record<string, string>)[key]] : [],\n );\n}\n\n/** Accept UTC ISO strings without rolling invalid dates into the next month. */\nexport function parseUtcDateTime(value: unknown): string | undefined {\n if (typeof value !== \"string\") return;\n const match = /^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2})(?::(\\d{2})(?:\\.(\\d{1,3}))?)?(?:Z|\\+00:00)$/.exec(\n value,\n );\n if (!match) return;\n const canonical = `${match[1]}:${match[2] ?? \"00\"}.${(match[3] ?? \"\").padEnd(3, \"0\")}Z`;\n const date = new Date(canonical);\n if (Number.isFinite(date.getTime()) && date.toISOString() === canonical) return canonical;\n}\n\nfunction isLink(value: unknown, key: \"assetId\" | \"entryId\"): boolean {\n return (\n !!value &&\n typeof value === \"object\" &&\n key in value &&\n typeof (value as Record<string, unknown>)[key] === \"string\" &&\n (value as Record<string, string>)[key].trim().length > 0\n );\n}\n\nfunction hasRichText(node: JSONContent): boolean {\n return !!node.text?.trim() || node.type === \"horizontalRule\" || !!node.content?.some(hasRichText);\n}\n\nfunction requiredError(field: FormField): string {\n return `${fieldLabel(field)} is required.`;\n}\n\nfunction textError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") return \"Enter text.\";\n if (field.required && !value.trim()) return requiredError(field);\n if (\n (field.type === \"shortText\" || field.type === \"longText\") &&\n field.maxLength !== undefined &&\n value.length > field.maxLength\n ) {\n return `Enter no more than ${field.maxLength} characters.`;\n }\n}\n\nfunction richTextError(field: FormField, value: unknown): string | undefined {\n const error = documentError(value);\n if (error) return error;\n if (field.required && !hasRichText(value as RichTextDocument)) return requiredError(field);\n}\n\nfunction choiceError(field: FormField, value: unknown): string | undefined {\n if (typeof value !== \"string\") return \"Choose an available option.\";\n if (value === \"\") return field.required ? requiredError(field) : undefined;\n // An empty list means the choices are still loading, so a stored value stays valid until they arrive.\n if (\n field.type === \"select\" &&\n field.options.length > 0 &&\n !field.options.some((option) => option.value === value)\n ) {\n return \"Choose an available option.\";\n }\n}\n\nfunction linkError(field: FormField, value: unknown): string | undefined {\n if (field.type !== \"asset\" && field.type !== \"reference\") return;\n const { key, itemLabel, itemsLabel } = linkCopy[field.type];\n if (!field.multiple) return isLink(value, key) ? undefined : `Choose an ${itemLabel}.`;\n if (!Array.isArray(value) || !value.every((item) => isLink(item, key)))\n return `Choose a list of ${itemsLabel}.`;\n if (field.required && value.length === 0) return requiredError(field);\n const max = field.picker?.max;\n if (max !== undefined && value.length > max)\n return `Choose no more than ${max} ${pickerCopy(field).itemsLabel}.`;\n}\n\nconst validators: Record<\n FormField[\"type\"],\n (field: FormField, value: unknown) => string | undefined\n> = {\n shortText: textError,\n longText: textError,\n richText: richTextError,\n number: (field, value) => {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return \"Enter a finite number.\";\n if (field.type !== \"number\") return;\n if (field.min !== undefined && value < field.min)\n return `Enter a number of at least ${field.min}.`;\n if (field.max !== undefined && value > field.max)\n return `Enter a number no greater than ${field.max}.`;\n },\n boolean: (_field, value) => (typeof value === \"boolean\" ? undefined : \"Choose a boolean value.\"),\n dateTime: (_field, value) =>\n parseUtcDateTime(value) ? undefined : \"Enter a valid UTC date and time.\",\n select: choiceError,\n asset: linkError,\n reference: linkError,\n};\n\nexport function fieldError(field: FormField, value: unknown): string | undefined {\n if (value === undefined) return field.required ? requiredError(field) : undefined;\n return validators[field.type](field, value);\n}\n\n/** Validate data loaded from JSON as well as values emitted by FormEditor. */\nexport function validateFormValues(model: FormSchema, values: Record<string, unknown>): FormErrors {\n assertModel(model);\n return Object.fromEntries(\n model.fields.flatMap((field): [string, string][] => {\n const error = fieldError(\n field,\n Object.hasOwn(values, field.id) ? values[field.id] : undefined,\n );\n return error ? [[field.id, error]] : [];\n }),\n );\n}\n","import { EntryPicker, type EntryItem } from \"../EntryPicker\";\nimport type { FieldRenderProps } from \"../Field\";\nimport { NumberField } from \"../NumberField\";\nimport { RichTextEditor, type RichTextDocument } from \"../RichTextEditor\";\nimport { emptyDocument } from \"../RichTextEditor/document\";\nimport { Select } from \"../Select\";\nimport { Switch } from \"../Switch\";\nimport { TextArea, TextField } from \"../TextField\";\nimport {\n parseUtcDateTime,\n pickerCopy,\n type FieldOf,\n type FormField,\n type FormFieldValue,\n} from \"./model\";\n\nfunction pickerValue(field: FormField, ids: string[]): FormFieldValue | undefined {\n if (field.type === \"asset\") {\n const links = ids.map((assetId) => ({ assetId }));\n return field.multiple ? links : links[0];\n }\n const links = ids.map((entryId) => ({ entryId }));\n return field.multiple ? links : links[0];\n}\n\ntype Accessibility = FieldRenderProps;\n\ninterface ControlProps<F extends FormField> {\n field: F;\n stored: FormFieldValue | undefined;\n isDisabled: boolean;\n required: boolean | undefined;\n accessibility: Omit<Accessibility, \"required\">;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\nfunction NumberControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"number\">>) {\n return (\n <NumberField\n {...accessibility}\n required={required}\n isDisabled={isDisabled}\n placeholder={field.placeholder}\n min={field.min}\n max={field.max}\n step={field.step ?? \"any\"}\n hasSteppers={field.hasSteppers ?? false}\n autoFocus={field.autoFocus}\n decreaseLabel={`Decrease ${field.label}`}\n increaseLabel={`Increase ${field.label}`}\n value={typeof stored === \"number\" && Number.isFinite(stored) ? stored : \"\"}\n onValueChange={(next) => {\n if (next === \"\" || Number.isFinite(next)) onChange(next === \"\" ? undefined : next);\n }}\n />\n );\n}\n\nfunction SelectControl({\n field,\n stored,\n isDisabled,\n required,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"select\">>) {\n // Optional selects lead with an empty choice; picking it removes the key.\n const isClearable = !required && !field.options.some((option) => option.value === \"\");\n return (\n <Select\n {...accessibility}\n aria-required={required || undefined}\n isDisabled={isDisabled}\n isInvalid={accessibility[\"aria-invalid\"]}\n options={\n isClearable\n ? [{ value: \"\", label: field.placeholder ?? \"None\" }, ...field.options]\n : field.options\n }\n placeholder={field.placeholder}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onValueChange={(next) => onChange(next === \"\" ? undefined : next)}\n />\n );\n}\n\nfunction PickerControl({\n field,\n selected,\n items,\n isDisabled,\n accessibility,\n onChange,\n}: ControlProps<FieldOf<\"asset\" | \"reference\">> & { items: EntryItem[]; selected: string[] }) {\n return (\n <EntryPicker\n {...accessibility}\n items={items}\n value={selected}\n {...pickerCopy(field)}\n mode={field.multiple ? \"multiple\" : \"single\"}\n isDisabled={isDisabled}\n onValueChange={(ids) => onChange(pickerValue(field, ids))}\n />\n );\n}\n\ninterface FormControlProps {\n field: FormField;\n stored: FormFieldValue | undefined;\n /** Picker fields' stored IDs, derived once by the owning field. */\n selected: string[] | undefined;\n items: EntryItem[];\n isDisabled: boolean;\n accessibility: Accessibility;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\nexport function FormControl({\n field,\n stored,\n selected,\n items,\n isDisabled,\n accessibility: { required, ...accessibility },\n onChange,\n}: FormControlProps) {\n const shared = { stored, isDisabled, required, accessibility, onChange };\n switch (field.type) {\n case \"shortText\":\n return (\n <TextField\n {...accessibility}\n required={required}\n disabled={isDisabled}\n placeholder={field.placeholder}\n type={field.inputType}\n maxLength={field.maxLength}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onChange={(event) => onChange(event.target.value)}\n />\n );\n case \"longText\":\n return (\n <TextArea\n {...accessibility}\n required={required}\n disabled={isDisabled}\n placeholder={field.placeholder}\n rows={field.rows}\n maxLength={field.maxLength}\n readOnly={field.readOnly}\n autoFocus={field.autoFocus}\n value={typeof stored === \"string\" ? stored : \"\"}\n onChange={(event) => onChange(event.target.value)}\n />\n );\n case \"number\":\n return (\n <NumberControl\n field={field}\n {...shared}\n />\n );\n case \"boolean\":\n return (\n <Switch\n {...accessibility}\n isDisabled={isDisabled}\n autoFocus={field.autoFocus}\n isSelected={stored === true}\n onSelectedChange={onChange}\n />\n );\n case \"dateTime\":\n return (\n <TextField\n {...accessibility}\n required={required}\n disabled={isDisabled}\n type=\"datetime-local\"\n step=\"0.001\"\n autoFocus={field.autoFocus}\n value={parseUtcDateTime(stored)?.slice(0, -1) ?? \"\"}\n onChange={(event) => onChange(parseUtcDateTime(`${event.target.value}Z`))}\n />\n );\n case \"richText\":\n return (\n <RichTextEditor\n {...accessibility}\n label={field.label}\n isRequired={required}\n isDisabled={isDisabled}\n placeholder={field.placeholder}\n format=\"json\"\n value={stored === undefined ? emptyDocument : (stored as RichTextDocument)}\n onChange={onChange}\n />\n );\n case \"select\":\n return (\n <SelectControl\n field={field}\n {...shared}\n />\n );\n case \"asset\":\n case \"reference\":\n return (\n <PickerControl\n field={field}\n items={items}\n selected={selected ?? []}\n {...shared}\n />\n );\n }\n}\n","import { useMemo, useState, type CSSProperties, type HTMLAttributes } from \"react\";\nimport type { EntryItem } from \"../EntryPicker\";\nimport { Field } from \"../Field\";\nimport type { GridColumns } from \"../Grid\";\nimport { FormControl } from \"./control\";\nimport {\n assertModel,\n fieldError,\n fieldLabel,\n selectedIds,\n type FormField,\n type FormSchema,\n type FormErrors,\n type FormFieldValue,\n type FormValues,\n} from \"./model\";\nimport \"./style.css\";\n\nexport { validateFormValues } from \"./model\";\nexport type {\n AssetValue,\n FormField,\n FormSchema,\n FormErrors,\n FormFieldValue,\n FormValues,\n ReferenceValue,\n} from \"./model\";\n\nexport interface FormChange {\n fieldId: string;\n}\n\nexport interface FormEditorProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"defaultValue\" | \"onChange\"\n> {\n schema: FormSchema;\n value?: FormValues;\n defaultValue?: FormValues;\n onValueChange?: (values: FormValues, change: FormChange) => void;\n /** Available assets or entries, keyed by field ID. Loading belongs to the app. */\n pickerItems?: Record<string, EntryItem[]>;\n /** App-provided messages take precedence over built-in validation. */\n errors?: FormErrors;\n isDisabled?: boolean;\n showAllErrors?: boolean;\n /** Columns at the widest. The form drops one whenever a field would be narrower than `minColumnWidth`. */\n columns?: GridColumns;\n /** Narrowest a field may get before the form drops a column. */\n minColumnWidth?: string;\n}\n\ninterface FormEditorFieldProps {\n field: FormField;\n stored: FormFieldValue | undefined;\n items: EntryItem[];\n isDisabled: boolean;\n error: string | undefined;\n isErrorVisible: boolean;\n onChange: (value: FormFieldValue | undefined) => void;\n}\n\n/** Validates only when its message can show, and only when its own field or value changes. */\nfunction FormEditorField({\n field,\n stored,\n items,\n isDisabled,\n error,\n isErrorVisible,\n onChange,\n}: FormEditorFieldProps) {\n const validation = useMemo(\n () => (error === undefined && isErrorVisible ? fieldError(field, stored) : undefined),\n [error, isErrorVisible, field, stored],\n );\n const selected = useMemo(\n () =>\n field.type === \"asset\" || field.type === \"reference\" ? selectedIds(field, stored) : undefined,\n [field, stored],\n );\n return (\n <Field\n label={field.type === \"dateTime\" ? `${field.label} (UTC)` : fieldLabel(field)}\n hint={field.hint}\n error={error ?? validation}\n isRequired={field.required}\n count={selected?.length}\n isGroup={selected !== undefined}\n >\n {(accessibility) => (\n <FormControl\n field={field}\n stored={stored}\n selected={selected}\n items={items}\n isDisabled={isDisabled}\n accessibility={accessibility}\n onChange={onChange}\n />\n )}\n </Field>\n );\n}\n\n/** Ordered form controls. Loading, submission, and persistence belong to the app. */\nexport function FormEditor({\n schema,\n value,\n defaultValue = {},\n onValueChange,\n pickerItems = {},\n errors = {},\n isDisabled = false,\n showAllErrors = false,\n columns = 1,\n minColumnWidth = \"16rem\",\n className,\n style,\n ...rest\n}: FormEditorProps) {\n const [internal, setInternal] = useState<FormValues>(defaultValue);\n const [changed, setChanged] = useState<Set<string>>(() => new Set());\n const current = value ?? internal;\n useMemo(() => assertModel(schema), [schema]);\n\n const commit = (fieldId: string, next: FormFieldValue | undefined) => {\n const values = { ...current };\n if (next === undefined) delete values[fieldId];\n else values[fieldId] = next;\n if (value === undefined) setInternal(values);\n setChanged((previous) => new Set(previous).add(fieldId));\n onValueChange?.(values, { fieldId });\n };\n\n const layout =\n columns === \"auto\"\n ? { \"--form-editor-min-column\": minColumnWidth }\n : { \"--form-editor-columns\": columns, \"--form-editor-min-column\": minColumnWidth };\n\n return (\n <div\n className={[\"ds-form-editor\", columns === \"auto\" && \"ds-form-editor--auto\", className]\n .filter(Boolean)\n .join(\" \")}\n style={{ ...layout, ...style } as CSSProperties}\n {...rest}\n >\n {schema.fields.map((field) => {\n const stored = Object.hasOwn(current, field.id) ? current[field.id] : undefined;\n const fieldDisabled = isDisabled || Boolean(field.isDisabled);\n const isLocked = fieldDisabled || (\"readOnly\" in field && Boolean(field.readOnly));\n // NumberField marks an out-of-range number invalid itself, so its message shows straight away.\n const isErrorVisible =\n showAllErrors ||\n changed.has(field.id) ||\n (field.type === \"number\" && typeof stored === \"number\");\n return (\n <FormEditorField\n key={field.id}\n field={field}\n stored={stored}\n items={pickerItems[field.id] ?? []}\n isDisabled={fieldDisabled}\n error={errors[field.id]}\n isErrorVisible={isErrorVisible}\n onChange={(next) => {\n if (!isLocked) commit(field.id, next);\n }}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"A,2XAiFA,IAAMqB,EAAa,IAAI,IAAI,CACzB,YACA,WACA,WACA,SACA,UACA,WACA,QACA,YACA,QACF,CAAC,EAED,SAAgBC,EAAY,EAAmB,CAC7C,IAAMC,EAAM,IAAI,IAChB,IAAK,IAAMC,KAASC,EAAM,OAAQ,CAChC,GAAI,CAACD,EAAM,IAAI,KAAK,GAAKD,EAAI,IAAIC,EAAM,EAAE,EACvC,MAAU,MAAM,6CAA6C,EAC/D,GAAI,CAACH,EAAW,IAAIG,EAAM,IAAI,EAAG,MAAU,MAAM,g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,IAAID,CAAO,CAAC,EACvDE,IAAgBhC,EAAQ,CAAE,SAAQ,CAAC,CACrC,EAEMiC,EACJC,IAAY,OACR,CAAE,2BAA4BC,CAAe,EAC7C,CAAE,wBAAyBD,EAAS,2BAA4BC,CAAe,EAErF,OACE,EAAAtE,EAAA,IAAA,CAAC,MAAD,CACE,UAAW,CAAC,iBAAkBqE,IAAY,QAAU,uBAAwBE,CAAS,CAAC,CACnF,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,EACX,MAAO,CAAE,GAAGH,EAAQ,GAAGI,CAAM,EAC7B,GAAIhB,EAEH,SAAAO,EAAO,OAAO,IAAK,GAAU,CAC5B,IAAMvB,EAAS,OAAO,OAAOsB,EAAS1D,EAAM,EAAE,EAAI0D,EAAQ1D,EAAM,IAAM,IAAA,GAChEqE,EAAgBvB,GAAc,EAAQ9C,EAAM,WAC5CsE,EAAWD,GAAkB,aAAcrE,GAAS,EAAQA,EAAM,SAElEkD,EACJqB,GACAf,EAAQ,IAAIxD,EAAM,EAAE,GACnBA,EAAM,OAAS,UAAY,OAAOoC,GAAW,SAChD,OACE,EAAAxC,EAAA,IAAA,CAACoD,EAAD,CAES,QACC,SACR,MAAOwB,EAAYxE,EAAM,KAAO,CAAC,EACjC,WAAYqE,EACZ,MAAOI,EAAOzE,EAAM,IACJ,iBAChB,SAAW,GAAS,CACbsE,GAAUV,EAAO5D,EAAM,GAAIqC,CAAI,CACtC,CACD,EAVMrC,EAAM,EAUZ,CAEL,CAAC,CACE,CAAA,CAET,C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { AlertTriangle as t, Archive as n, ArrowLeft as r, ArrowRight as i, Bell as a, Bold as o, Calendar as ee, Check as s, ChevronDown as c, ChevronLeft as l, ChevronRight as u, ChevronUp as d, ChevronsLeft as f, ChevronsRight as p, Clock as m, Code as h, Copy as g, Download as _, ExternalLink as v, Eye as y, FileText as b, Filter as x, FolderClosed as S, Globe as C, GripHorizontal as w, GripVertical as T, Heading2 as E, Heading3 as D, Home as O, Image as k, Info as A, Italic as te, LayoutGrid as j, Link as M, Link2Off as N, List as P, ListOrdered as F, Loader2 as I, Menu as L, Minus as R, MoreHorizontal as z, Pencil as B, Plus as V, Quote as H, Redo2 as U, RotateCcw as W, RotateCw as G, Search as K, Settings as q, Strikethrough as J, Trash2 as Y, Undo2 as X, Upload as Z, User as Q, Users as ne, X as re } from "lucide-react";
|
|
3
|
+
import { jsx as ie } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Icon/icons.ts
|
|
5
|
+
var $ = {
|
|
6
|
+
"alert-triangle": t,
|
|
7
|
+
archive: n,
|
|
8
|
+
bold: o,
|
|
9
|
+
code: h,
|
|
10
|
+
"heading-2": E,
|
|
11
|
+
"heading-3": D,
|
|
12
|
+
italic: te,
|
|
13
|
+
"link-off": N,
|
|
14
|
+
list: P,
|
|
15
|
+
"list-ordered": F,
|
|
16
|
+
quote: H,
|
|
17
|
+
redo: U,
|
|
18
|
+
strikethrough: J,
|
|
19
|
+
undo: X,
|
|
20
|
+
"arrow-left": r,
|
|
21
|
+
"arrow-right": i,
|
|
22
|
+
calendar: ee,
|
|
23
|
+
check: s,
|
|
24
|
+
"chevron-down": c,
|
|
25
|
+
"chevron-left": l,
|
|
26
|
+
"chevron-up": d,
|
|
27
|
+
minus: R,
|
|
28
|
+
"chevron-right": u,
|
|
29
|
+
clock: m,
|
|
30
|
+
copy: g,
|
|
31
|
+
download: _,
|
|
32
|
+
eye: y,
|
|
33
|
+
"external-link": v,
|
|
34
|
+
filter: x,
|
|
35
|
+
bell: a,
|
|
36
|
+
"chevrons-left": f,
|
|
37
|
+
"chevrons-right": p,
|
|
38
|
+
"file-text": b,
|
|
39
|
+
folder: S,
|
|
40
|
+
globe: C,
|
|
41
|
+
home: O,
|
|
42
|
+
"layout-grid": j,
|
|
43
|
+
menu: L,
|
|
44
|
+
users: ne,
|
|
45
|
+
"grip-horizontal": w,
|
|
46
|
+
"grip-vertical": T,
|
|
47
|
+
image: k,
|
|
48
|
+
info: A,
|
|
49
|
+
link: M,
|
|
50
|
+
spinner: I,
|
|
51
|
+
"more-horizontal": z,
|
|
52
|
+
pencil: B,
|
|
53
|
+
plus: V,
|
|
54
|
+
"rotate-ccw": W,
|
|
55
|
+
"rotate-cw": G,
|
|
56
|
+
search: K,
|
|
57
|
+
settings: q,
|
|
58
|
+
trash: Y,
|
|
59
|
+
upload: Z,
|
|
60
|
+
user: Q,
|
|
61
|
+
x: re
|
|
62
|
+
}, ae = Object.keys($), oe = e(function({ name: e, size: t = 16, className: n, ...r }, i) {
|
|
63
|
+
let a = $[e];
|
|
64
|
+
return /* @__PURE__ */ ie(a, {
|
|
65
|
+
ref: i,
|
|
66
|
+
width: t,
|
|
67
|
+
height: t,
|
|
68
|
+
className: ["ds-icon", n].filter(Boolean).join(" "),
|
|
69
|
+
role: r["aria-label"] ? "img" : void 0,
|
|
70
|
+
"aria-hidden": !r["aria-label"] || void 0,
|
|
71
|
+
focusable: "false",
|
|
72
|
+
...r
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { ae as n, $ as r, oe as t };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=Icon-ByUB0L1a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon-ByUB0L1a.js","names":["icons","AlertTriangle","Archive","Bold","Code","Heading2","Heading3","Italic","Link2Off","List","ListOrdered","Quote","Redo2","Strikethrough","Undo2","ArrowLeft","ArrowRight","Calendar","Check","ChevronDown","ChevronLeft","ChevronUp","Minus","ChevronRight","Clock","Copy","Download","Eye","ExternalLink","Filter","Bell","ChevronsLeft","ChevronsRight","FileText","FolderClosed","Globe","Home","LayoutGrid","Menu","Users","GripHorizontal","GripVertical","Image","Info","Link","Loader2","MoreHorizontal","Pencil","Plus","RotateCcw","RotateCw","Search","Settings","Trash2","Upload","User","X","iconNames","Icon","forwardRef","rest","Glyph","name","size","className"],"sources":["../../src/components/Icon/icons.ts","../../src/components/Icon/index.tsx"],"sourcesContent":["import {\n AlertTriangle,\n Bold,\n Code,\n Heading2,\n Heading3,\n Italic,\n Link2Off,\n List,\n ListOrdered,\n Quote,\n Redo2,\n Strikethrough,\n Undo2,\n Archive,\n ArrowLeft,\n ArrowRight,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronUp,\n Minus,\n ChevronRight,\n Clock,\n Copy,\n Download,\n Eye,\n ExternalLink,\n Filter,\n Bell,\n ChevronsLeft,\n ChevronsRight,\n FileText,\n FolderClosed,\n Globe,\n Home,\n LayoutGrid,\n Menu,\n Users,\n GripHorizontal,\n GripVertical,\n Image,\n Info,\n Link,\n Loader2,\n MoreHorizontal,\n Pencil,\n Plus,\n RotateCcw,\n RotateCw,\n Search,\n Settings,\n Trash2,\n Upload,\n User,\n X,\n} from \"lucide-react\";\n\n/**\n * The finite icon set. Adding a glyph means adding a line here — a visible\n * decision rather than an import someone typed at a call site.\n */\nexport const icons = {\n \"alert-triangle\": AlertTriangle,\n archive: Archive,\n bold: Bold,\n code: Code,\n \"heading-2\": Heading2,\n \"heading-3\": Heading3,\n italic: Italic,\n \"link-off\": Link2Off,\n list: List,\n \"list-ordered\": ListOrdered,\n quote: Quote,\n redo: Redo2,\n strikethrough: Strikethrough,\n undo: Undo2,\n \"arrow-left\": ArrowLeft,\n \"arrow-right\": ArrowRight,\n calendar: Calendar,\n check: Check,\n \"chevron-down\": ChevronDown,\n \"chevron-left\": ChevronLeft,\n \"chevron-up\": ChevronUp,\n minus: Minus,\n \"chevron-right\": ChevronRight,\n clock: Clock,\n copy: Copy,\n download: Download,\n eye: Eye,\n \"external-link\": ExternalLink,\n filter: Filter,\n bell: Bell,\n \"chevrons-left\": ChevronsLeft,\n \"chevrons-right\": ChevronsRight,\n \"file-text\": FileText,\n folder: FolderClosed,\n globe: Globe,\n home: Home,\n \"layout-grid\": LayoutGrid,\n menu: Menu,\n users: Users,\n \"grip-horizontal\": GripHorizontal,\n \"grip-vertical\": GripVertical,\n image: Image,\n info: Info,\n link: Link,\n spinner: Loader2,\n \"more-horizontal\": MoreHorizontal,\n pencil: Pencil,\n plus: Plus,\n \"rotate-ccw\": RotateCcw,\n \"rotate-cw\": RotateCw,\n search: Search,\n settings: Settings,\n trash: Trash2,\n upload: Upload,\n user: User,\n x: X,\n} as const;\n\nexport type IconName = keyof typeof icons;\n\nexport const iconNames = Object.keys(icons) as IconName[];\n","import { forwardRef, type SVGProps } from \"react\";\nimport { icons, type IconName } from \"./icons\";\nimport \"./style.css\";\n\nexport type IconSize = 16 | 20 | 24;\n\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, \"ref\"> {\n /** Glyph name from the curated set in `icons.ts`. */\n name: IconName;\n /** 16 inside controls, 20 standalone, 24 for empty states. No other sizes. */\n size?: IconSize;\n}\n\n/**\n * A glyph that clarifies an action or a status. Inherits `currentColor`, so it\n * takes its colour from the control it sits in — it never carries its own.\n */\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n { name, size = 16, className, ...rest },\n ref,\n) {\n const Glyph = icons[name];\n return (\n <Glyph\n ref={ref}\n width={size}\n height={size}\n className={[\"ds-icon\", className].filter(Boolean).join(\" \")}\n role={rest[\"aria-label\"] ? \"img\" : undefined}\n aria-hidden={rest[\"aria-label\"] ? undefined : true}\n focusable=\"false\"\n {...rest}\n />\n );\n});\n"],"mappings":";;;;AA+DA,IAAaA,IAAQ;CACnB,kBAAkBC;CAClB,SAASC;CACT,MAAMC;CACN,MAAMC;CACN,aAAaC;CACb,aAAaC;CACb,QAAQC;CACR,YAAYC;CACZ,MAAMC;CACN,gBAAgBC;CAChB,OAAOC;CACP,MAAMC;CACN,eAAeC;CACf,MAAMC;CACN,cAAcC;CACd,eAAeC;CACf,UAAUC;CACV,OAAOC;CACP,gBAAgBC;CAChB,gBAAgBC;CAChB,cAAcC;CACd,OAAOC;CACP,iBAAiBC;CACjB,OAAOC;CACP,MAAMC;CACN,UAAUC;CACV,KAAKC;CACL,iBAAiBC;CACjB,QAAQC;CACR,MAAMC;CACN,iBAAiBC;CACjB,kBAAkBC;CAClB,aAAaC;CACb,QAAQC;CACR,OAAOC;CACP,MAAMC;CACN,eAAeC;CACf,MAAMC;CACN,OAAOC;CACP,mBAAmBC;CACnB,iBAAiBC;CACjB,OAAOC;CACP,MAAMC;CACN,MAAMC;CACN,SAASC;CACT,mBAAmBC;CACnB,QAAQC;CACR,MAAMC;CACN,cAAcC;CACd,aAAaC;CACb,QAAQC;CACR,UAAUC;CACV,OAAOC;CACP,QAAQC;CACR,MAAMC;CACN,GAAGC;AACL,GAIaC,KAAY,OAAO,KAAKzD,CAAK,GC3G7B0D,KAAOC,EAAqC,SACvD,EAAE,SAAM,UAAO,IAAI,cAAW,GAAGC,KACjC,GACA;CACA,IAAMC,IAAQ7D,EAAM8D;CACpB,OACE,mBAACD,GAAD;EACO;EACL,OAAOE;EACP,QAAQA;EACR,WAAW,CAAC,WAAWC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC1D,MAAMJ,EAAK,gBAAgB,QAAQ,KAAA;EACnC,eAAa,GAAK,iBAAgB,KAAA;EAClC,WAAU;EACV,GAAIA;CACL,CAAA;AAEL,CAAC"}
|