@constructive-io/ui 0.12.0 → 0.14.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 +1 -1
- package/dist/{ai-CiaH2sfF.js → ai-4JrVVL3q.js} +1794 -250
- package/dist/ai-4JrVVL3q.js.map +1 -0
- package/dist/{ai-lAkichk8.cjs → ai-B08ufcbD.cjs} +1888 -248
- package/dist/ai-B08ufcbD.cjs.map +1 -0
- package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
- package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
- package/dist/components/accordion.cjs +60 -0
- package/dist/components/accordion.cjs.map +1 -0
- package/dist/components/accordion.d.cts +14 -0
- package/dist/components/accordion.d.ts +14 -0
- package/dist/components/accordion.js +54 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/ai/index.cjs +17 -1
- package/dist/components/ai/index.d.cts +2 -2
- package/dist/components/ai/index.d.ts +2 -2
- package/dist/components/ai/index.js +2 -2
- package/dist/components/alert-dialog.cjs +17 -8
- package/dist/components/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog.d.cts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +17 -8
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +18 -8
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.d.cts +2 -2
- package/dist/components/alert.d.ts +2 -2
- package/dist/components/alert.js +18 -9
- package/dist/components/alert.js.map +1 -1
- package/dist/components/autocomplete.cjs +9 -5
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.js +9 -5
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +9 -3
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.d.cts +6 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +9 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +25 -18
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +2 -2
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/badge.js +25 -18
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +9 -6
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.js +9 -6
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.cjs +57 -0
- package/dist/components/button-group.cjs.map +1 -0
- package/dist/components/button-group.d.cts +16 -0
- package/dist/components/button-group.d.ts +16 -0
- package/dist/components/button-group.js +51 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.cjs +62 -18
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +32 -2
- package/dist/components/button.d.ts +32 -2
- package/dist/components/button.js +62 -18
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +14 -8
- package/dist/components/calendar-rac.cjs.map +1 -1
- package/dist/components/calendar-rac.js +14 -8
- package/dist/components/calendar-rac.js.map +1 -1
- package/dist/components/card.cjs +35 -23
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +3 -2
- package/dist/components/card.d.ts +3 -2
- package/dist/components/card.js +35 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.cjs +5 -5
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +5 -5
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +3 -3
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.js +3 -3
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +24 -12
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.d.cts +2 -1
- package/dist/components/combobox.d.ts +2 -1
- package/dist/components/combobox.js +24 -12
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +30 -14
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +9 -2
- package/dist/components/command.d.ts +9 -2
- package/dist/components/command.js +30 -14
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +22 -12
- package/dist/components/dialog.cjs.map +1 -1
- package/dist/components/dialog.d.cts +5 -2
- package/dist/components/dialog.d.ts +5 -2
- package/dist/components/dialog.js +22 -12
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +50 -27
- package/dist/components/dock.cjs.map +1 -1
- package/dist/components/dock.d.cts +1 -1
- package/dist/components/dock.d.ts +1 -1
- package/dist/components/dock.js +51 -28
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +22 -14
- package/dist/components/drawer.cjs.map +1 -1
- package/dist/components/drawer.js +22 -14
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +34 -28
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.d.cts +2 -2
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +52 -46
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +4 -4
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.js +4 -4
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +33 -33
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.js +34 -34
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +1 -1
- package/dist/components/flickering-grid.cjs.map +1 -1
- package/dist/components/flickering-grid.js +1 -1
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +10 -5
- package/dist/components/flow-zoom-panel.cjs.map +1 -1
- package/dist/components/flow-zoom-panel.d.cts +8 -1
- package/dist/components/flow-zoom-panel.d.ts +8 -1
- package/dist/components/flow-zoom-panel.js +10 -5
- package/dist/components/flow-zoom-panel.js.map +1 -1
- package/dist/components/form-control.cjs +12 -8
- package/dist/components/form-control.cjs.map +1 -1
- package/dist/components/form-control.js +12 -8
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +5 -5
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.js +5 -5
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +13 -7
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +2 -2
- package/dist/components/input-group.d.ts +2 -2
- package/dist/components/input-group.js +11 -7
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.cjs +252 -0
- package/dist/components/input-otp.cjs.map +1 -0
- package/dist/components/input-otp.d.cts +44 -0
- package/dist/components/input-otp.d.ts +44 -0
- package/dist/components/input-otp.js +251 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.cjs +10 -4
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +11 -2
- package/dist/components/input.d.ts +11 -2
- package/dist/components/input.js +10 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.cjs +151 -0
- package/dist/components/item.cjs.map +1 -0
- package/dist/components/item.d.cts +37 -0
- package/dist/components/item.d.ts +37 -0
- package/dist/components/item.js +137 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/json-input.cjs +4 -143
- package/dist/components/json-input.d.cts +6 -4
- package/dist/components/json-input.d.ts +6 -4
- package/dist/components/json-input.js +2 -140
- package/dist/components/kbd.cjs +35 -0
- package/dist/components/kbd.cjs.map +1 -0
- package/dist/components/kbd.d.cts +16 -0
- package/dist/components/kbd.d.ts +16 -0
- package/dist/components/kbd.js +31 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.cjs +3 -3
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +20 -8
- package/dist/components/motion-grid.cjs.map +1 -1
- package/dist/components/motion-grid.js +20 -8
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +77 -67
- package/dist/components/multi-select.cjs.map +1 -1
- package/dist/components/multi-select.js +77 -67
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +12 -9
- package/dist/components/page-header.cjs.map +1 -1
- package/dist/components/page-header.js +12 -9
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.cjs +10 -4
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +10 -4
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/phone-input.cjs +228 -0
- package/dist/components/phone-input.cjs.map +1 -0
- package/dist/components/phone-input.d.cts +42 -0
- package/dist/components/phone-input.d.ts +42 -0
- package/dist/components/phone-input.js +220 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.cjs +12 -4
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +7 -1
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +12 -5
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.cjs +20 -3
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +20 -3
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +2 -2
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
- package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
- package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
- package/dist/components/progressive-blur-scroll-container.js +2 -2
- package/dist/components/progressive-blur-scroll-container.js.map +1 -1
- package/dist/components/progressive-blur.cjs +3 -2
- package/dist/components/progressive-blur.cjs.map +1 -1
- package/dist/components/progressive-blur.js +3 -2
- package/dist/components/progressive-blur.js.map +1 -1
- package/dist/components/radio-group.cjs +2 -2
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +1 -1
- package/dist/components/record-picker.js +1 -1
- package/dist/components/resizable.cjs +2 -2
- package/dist/components/resizable.cjs.map +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +43 -21
- package/dist/components/responsive-diagram.cjs.map +1 -1
- package/dist/components/responsive-diagram.d.cts +7 -1
- package/dist/components/responsive-diagram.d.ts +7 -1
- package/dist/components/responsive-diagram.js +43 -21
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/scroll-area.cjs +2 -2
- package/dist/components/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area.js +2 -2
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +84 -20
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +12 -7
- package/dist/components/select.d.ts +12 -7
- package/dist/components/select.js +84 -20
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.d.cts +11 -2
- package/dist/components/separator.d.ts +11 -2
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.d.cts +11 -5
- package/dist/components/sheet.d.ts +12 -6
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.cjs +2 -1
- package/dist/components/sidebar.d.cts +8 -7
- package/dist/components/sidebar.d.ts +8 -7
- package/dist/components/sidebar.js +2 -1
- package/dist/components/slider.cjs +47 -0
- package/dist/components/slider.cjs.map +1 -0
- package/dist/components/slider.d.cts +8 -0
- package/dist/components/slider.d.ts +8 -0
- package/dist/components/slider.js +44 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.cjs +15 -4
- package/dist/components/sonner.cjs.map +1 -1
- package/dist/components/sonner.d.cts +10 -1
- package/dist/components/sonner.d.ts +10 -1
- package/dist/components/sonner.js +16 -5
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.cjs +25 -0
- package/dist/components/spinner.cjs.map +1 -0
- package/dist/components/spinner.d.cts +16 -0
- package/dist/components/spinner.d.ts +16 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stack/index.cjs +1 -1
- package/dist/components/stack/index.d.cts +1 -1
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/stepper.cjs +23 -17
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +2 -2
- package/dist/components/stepper.d.ts +2 -2
- package/dist/components/stepper.js +23 -17
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +5 -5
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.js +5 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +26 -7
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.d.cts +20 -2
- package/dist/components/table.d.ts +20 -2
- package/dist/components/table.js +26 -8
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +64 -8
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.d.cts +13 -2
- package/dist/components/tabs.d.ts +13 -2
- package/dist/components/tabs.js +66 -11
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +10 -5
- package/dist/components/tags.cjs.map +1 -1
- package/dist/components/tags.d.cts +1 -1
- package/dist/components/tags.d.ts +1 -1
- package/dist/components/tags.js +10 -5
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +5 -4
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +5 -4
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.d.cts +2 -2
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle-group.cjs +69 -0
- package/dist/components/toggle-group.cjs.map +1 -0
- package/dist/components/toggle-group.d.cts +27 -0
- package/dist/components/toggle-group.d.ts +27 -0
- package/dist/components/toggle-group.js +65 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.cjs +54 -0
- package/dist/components/toggle.cjs.map +1 -0
- package/dist/components/toggle.d.cts +13 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +50 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.cjs +18 -6
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +18 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +2 -2
- package/dist/components/unlink-button.cjs.map +1 -1
- package/dist/components/unlink-button.d.cts +1 -0
- package/dist/components/unlink-button.d.ts +1 -0
- package/dist/components/unlink-button.js +2 -2
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/components/workspace-kit/index.cjs +1507 -0
- package/dist/components/workspace-kit/index.cjs.map +1 -0
- package/dist/components/workspace-kit/index.d.cts +728 -0
- package/dist/components/workspace-kit/index.d.ts +728 -0
- package/dist/components/workspace-kit/index.js +1440 -0
- package/dist/components/workspace-kit/index.js.map +1 -0
- package/dist/compose-refs-Mbma1O3M.js +47 -0
- package/dist/compose-refs-Mbma1O3M.js.map +1 -0
- package/dist/compose-refs-uPrvNoiU.cjs +52 -0
- package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
- package/dist/fluid-highlight-CNELHV8o.js +134 -0
- package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs +145 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
- package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
- package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
- package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
- package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
- package/dist/{index-CyaFaZe2.d.cts → index-Cluc_xc5.d.ts} +345 -20
- package/dist/{index-B0wXxIAb.d.ts → index-DXoG0ghv.d.cts} +345 -20
- package/dist/index.cjs +107 -17
- package/dist/index.d.cts +64 -14
- package/dist/index.d.ts +64 -14
- package/dist/index.js +27 -14
- package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
- package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
- package/dist/initial-focus-j2E0EnIx.js +61 -0
- package/dist/initial-focus-j2E0EnIx.js.map +1 -0
- package/dist/initials-DSkWTOb0.cjs +127 -0
- package/dist/initials-DSkWTOb0.cjs.map +1 -0
- package/dist/initials-kCcHgrSy.js +97 -0
- package/dist/initials-kCcHgrSy.js.map +1 -0
- package/dist/json-input-CH5aEmoA.js +293 -0
- package/dist/json-input-CH5aEmoA.js.map +1 -0
- package/dist/json-input-D8yM578l.cjs +311 -0
- package/dist/json-input-D8yM578l.cjs.map +1 -0
- package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
- package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
- package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
- package/dist/motion-config-DoFp4I8f.js.map +1 -0
- package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
- package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
- package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
- package/dist/record-picker-DSRo4RXV.js.map +1 -0
- package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
- package/dist/sheet-OxWlnT_G.cjs.map +1 -0
- package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
- package/dist/sheet-wPF_l9Cn.js.map +1 -0
- package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
- package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
- package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
- package/dist/sidebar-DWl1Azyv.js.map +1 -0
- package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
- package/dist/stack-CEvmUSwF.cjs.map +1 -0
- package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
- package/dist/stack-Kqu7YaR0.js.map +1 -0
- package/dist/text-runs-CdmlS5C7.cjs +52 -0
- package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
- package/dist/text-runs-DqcEO8L_.js +45 -0
- package/dist/text-runs-DqcEO8L_.js.map +1 -0
- package/dist/theme-CKpIa4Fj.d.cts +536 -0
- package/dist/theme-CKpIa4Fj.d.ts +536 -0
- package/dist/theme-dials-config.cjs +273 -0
- package/dist/theme-dials-config.cjs.map +1 -0
- package/dist/theme-dials-config.d.cts +95 -0
- package/dist/theme-dials-config.d.ts +95 -0
- package/dist/theme-dials-config.js +269 -0
- package/dist/theme-dials-config.js.map +1 -0
- package/dist/theme-presets.cjs +922 -0
- package/dist/theme-presets.cjs.map +1 -0
- package/dist/theme-presets.d.cts +89 -0
- package/dist/theme-presets.d.ts +89 -0
- package/dist/theme-presets.js +912 -0
- package/dist/theme-presets.js.map +1 -0
- package/dist/theme-tuning-CTOHSrsh.d.cts +158 -0
- package/dist/theme-tuning-DOko6Pmy.d.ts +158 -0
- package/dist/theme-tuning.cjs +349 -0
- package/dist/theme-tuning.cjs.map +1 -0
- package/dist/theme-tuning.d.cts +2 -0
- package/dist/theme-tuning.d.ts +2 -0
- package/dist/theme-tuning.js +333 -0
- package/dist/theme-tuning.js.map +1 -0
- package/dist/theme.cjs +438 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +436 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast-08jF1DBQ.cjs +193 -0
- package/dist/toast-08jF1DBQ.cjs.map +1 -0
- package/dist/toast-CVW5XY4u.js +164 -0
- package/dist/toast-CVW5XY4u.js.map +1 -0
- package/dist/toast-details-BdxxSLlN.cjs +209 -0
- package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
- package/dist/toast-details-CfsB1Vxb.js +198 -0
- package/dist/toast-details-CfsB1Vxb.js.map +1 -0
- package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
- package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
- package/dist/tuning-BKVFsxLr.js +48 -0
- package/dist/tuning-BKVFsxLr.js.map +1 -0
- package/dist/tuning-BRPG7U1U.cjs +71 -0
- package/dist/tuning-BRPG7U1U.cjs.map +1 -0
- package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
- package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
- package/dist/use-document-theme-Ch_PqxZz.js +38 -0
- package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
- package/dist/use-scroll-fade-ilq-o00-.js +72 -0
- package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
- package/package.json +166 -27
- package/src/styles/globals.css +194 -97
- package/dist/ai-CiaH2sfF.js.map +0 -1
- package/dist/ai-lAkichk8.cjs.map +0 -1
- package/dist/button-Bvh83YGs.d.cts +0 -20
- package/dist/button-Bvh83YGs.d.ts +0 -20
- package/dist/components/app-bar.cjs +0 -81
- package/dist/components/app-bar.cjs.map +0 -1
- package/dist/components/app-bar.d.cts +0 -27
- package/dist/components/app-bar.d.ts +0 -27
- package/dist/components/app-bar.js +0 -77
- package/dist/components/app-bar.js.map +0 -1
- package/dist/components/app-shell.cjs +0 -267
- package/dist/components/app-shell.cjs.map +0 -1
- package/dist/components/app-shell.d.cts +0 -98
- package/dist/components/app-shell.d.ts +0 -98
- package/dist/components/app-shell.js +0 -264
- package/dist/components/app-shell.js.map +0 -1
- package/dist/components/json-input.cjs.map +0 -1
- package/dist/components/json-input.js.map +0 -1
- package/dist/input-CBrCuMH8.d.cts +0 -11
- package/dist/input-CBrCuMH8.d.ts +0 -11
- package/dist/motion-config-COCFHq1L.cjs.map +0 -1
- package/dist/motion-config-COsZ6azM.js.map +0 -1
- package/dist/record-picker-BbxngCeV.js.map +0 -1
- package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
- package/dist/separator-BQEsr0Rc.d.cts +0 -11
- package/dist/separator-BQEsr0Rc.d.ts +0 -11
- package/dist/sheet-BLHnhLRH.js.map +0 -1
- package/dist/sheet-BdA0rfIz.cjs.map +0 -1
- package/dist/sidebar-BavjjJp0.cjs.map +0 -1
- package/dist/sidebar-DeoL2ttp.js.map +0 -1
- package/dist/stack-C9GROTGA.js.map +0 -1
- package/dist/stack-ci2lkfkr.cjs.map +0 -1
- package/dist/toast-D6MqijT2.cjs +0 -316
- package/dist/toast-D6MqijT2.cjs.map +0 -1
- package/dist/toast-D_BOLzm3.js +0 -287
- package/dist/toast-D_BOLzm3.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initials-DSkWTOb0.cjs","names":[],"sources":["../src/lib/intl.ts","../src/lib/initials.ts"],"sourcesContent":["/**\n * Cached `Intl` formatters and the small text helpers built on them.\n *\n * Intl constructors are slow and a list row formats several values, so each distinct locale and option set is built\n * once per page. An invalid locale tag falls back to `en-US` instead of throwing in the middle of a render.\n */\n\ntype Formatter = Intl.NumberFormat | Intl.DateTimeFormat | Intl.RelativeTimeFormat | Intl.ListFormat | Intl.PluralRules;\n\nconst formatters = new Map<string, Formatter>();\n\nfunction cached<T extends Formatter>(key: string, create: (locale: string) => T, locale: string): T {\n\tlet formatter = formatters.get(`${key}|${locale}`) as T | undefined;\n\tif (!formatter) {\n\t\ttry {\n\t\t\tformatter = create(locale);\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof RangeError) || locale === 'en-US') throw error;\n\t\t\tformatter = create('en-US');\n\t\t}\n\t\tformatters.set(`${key}|${locale}`, formatter);\n\t}\n\treturn formatter;\n}\n\nexport function numberFormat(locale: string, options: Intl.NumberFormatOptions = {}) {\n\treturn cached(`n|${JSON.stringify(options)}`, (tag) => new Intl.NumberFormat(tag, options), locale);\n}\n\nexport function dateFormat(locale: string, options: Intl.DateTimeFormatOptions) {\n\treturn cached(`d|${JSON.stringify(options)}`, (tag) => new Intl.DateTimeFormat(tag, options), locale);\n}\n\nexport function relativeTimeFormat(locale: string) {\n\treturn cached('r', (tag) => new Intl.RelativeTimeFormat(tag, { numeric: 'auto' }), locale);\n}\n\nexport function listFormat(locale: string) {\n\treturn cached('l', (tag) => new Intl.ListFormat(tag, { type: 'conjunction' }), locale);\n}\n\nexport function pluralRules(locale: string) {\n\treturn cached('p', (tag) => new Intl.PluralRules(tag), locale);\n}\n\n/**\n * Groups the digits of a count: `1284` becomes \"1,284\". Defaults to en-US so the server and the browser agree; pass\n * the reader's locale to show their own separators. A missing or non-finite value reads as an em dash.\n */\nexport function formatCount(value: number, locale = 'en-US') {\n\treturn Number.isFinite(value) ? numberFormat(locale).format(value) : '—';\n}\n\nexport type PluralForms = { one: string; other: string; zero?: string; two?: string; few?: string; many?: string };\n\n/**\n * Picks the noun form for a count with `Intl.PluralRules`, so `1` reads \"1 skill\" and `2` reads \"2 skills\". Falls\n * back to `other` for a form that was not supplied.\n *\n * The forms are English unless `locale` says otherwise, and the choice follows the rules of the language they are\n * written in, not of the page's formatting locale: Japanese has no \"one\" form, so English forms picked by Japanese\n * rules would read \"1 skills\". Pass `locale` only together with forms written for it, such as\n * `plural(n, { one, few, many, other }, 'ru')`.\n */\nexport function plural(count: number, forms: PluralForms, locale = 'en-US') {\n\treturn forms[pluralRules(locale).select(count)] ?? forms.other;\n}\n\n/**\n * Joins names for a sentence, showing the first `max` and a count of the rest: \"a, b, c, and 12 more\". Fifteen names\n * are a number to act on, not a paragraph to read.\n */\nexport function nameList(names: readonly string[], { max = 3, locale = 'en-US' }: { max?: number; locale?: string } = {}) {\n\tconst shown = names.slice(0, max);\n\tconst rest = names.length - shown.length;\n\treturn listFormat(locale).format(rest > 0 ? [...shown, `${formatCount(rest, locale)} more`] : shown);\n}\n\n/** A date nobody set: the zero timestamp (`1970-01-01T00:00:00Z`) a host sends for \"none\", an empty string, or text that is not a date. */\nexport function isUnsetDate(iso: string) {\n\tconst time = Date.parse(iso);\n\treturn time === 0 || Number.isNaN(time);\n}\n\n/** Built once. Grapheme boundaries do not depend on the locale, so the server and the browser split text alike. */\nexport const graphemeSegmenter =\n\ttypeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function' ? new Intl.Segmenter(undefined, { granularity: 'grapheme' }) : null;\n\n/** The characters a reader sees: a letter with its accent or an emoji sequence is one piece, never cut in half. */\nexport function graphemes(text: string) {\n\treturn graphemeSegmenter ? Array.from(graphemeSegmenter.segment(text), (part) => part.segment) : Array.from(text);\n}\n","import { graphemeSegmenter } from './intl';\n\n/**\n * Initials for an avatar fallback, safe for any script.\n *\n * Takes the first grapheme of the first and last word, so emoji, ZWJ sequences,\n * combining marks and non-Latin names are never split mid-character (the\n * `word[0]` pattern turns `🦊 Fox` into a lone surrogate). A single word gives\n * one initial. Pass an email address and the local part is used.\n *\n * Letters are upper-cased without consulting the runtime's locale, so the server\n * and the browser always draw the same characters (`toLocaleUpperCase()` turns `i`\n * into `İ` under a Turkish default, which would not hydrate). Pass `locale` to opt\n * in to a language's casing rules.\n *\n * Returns `null` when there is nothing to show, so callers can render an icon\n * instead of an empty circle:\n *\n * ```tsx\n * <AvatarFallback>{initials(user.name ?? user.email) ?? <UserIcon />}</AvatarFallback>\n * ```\n */\nexport interface InitialsOptions {\n\t/** Maximum number of initials. Defaults to 2 (first and last word). */\n\tmax?: number;\n\t/**\n\t * BCP 47 language tag whose casing rules upper-case the initials, for example `'tr'`\n\t * so `irem` becomes `İ`. Without it casing is locale-independent.\n\t */\n\tlocale?: string | string[];\n}\n\n\n// Approximation for runtimes without Intl.Segmenter: a flag, or one code point\n// plus its combining marks, variation selector, skin tone and ZWJ continuations.\nconst GRAPHEME_FALLBACK =\n\t/^(?:\\p{Regional_Indicator}{2}|.[\\p{M}️\\u{1F3FB}-\\u{1F3FF}]*(?:.[\\p{M}️\\u{1F3FB}-\\u{1F3FF}]*)*)/u;\n\nconst LEADING_NOISE = /^[^\\p{L}\\p{N}\\p{Extended_Pictographic}\\p{Regional_Indicator}]+/u;\nconst TRAILING_NOISE = /[^\\p{L}\\p{N}\\p{Extended_Pictographic}\\p{Regional_Indicator}]+$/u;\nconst GENERATIONAL_SUFFIX = /^(?:jr|sr|ii|iii|iv|phd|md|esq)$/i;\nconst EMAIL = /^[^\\s@]+@[^\\s@]+$/;\n\nfunction firstGrapheme(text: string): string {\n\tif (graphemeSegmenter) {\n\t\tfor (const { segment } of graphemeSegmenter.segment(text)) return segment;\n\t\treturn '';\n\t}\n\treturn GRAPHEME_FALLBACK.exec(text)?.[0] ?? '';\n}\n\nfunction upperCase(grapheme: string, locale: InitialsOptions['locale']): string {\n\tconst upper = locale ? grapheme.toLocaleUpperCase(locale) : grapheme.toUpperCase();\n\t// `ß` becomes `SS`: keep the original when uppercasing would add a character.\n\treturn firstGrapheme(upper) === upper ? upper : grapheme;\n}\n\nfunction wordsOf(value: string): string[] {\n\tconst trimmed = value.trim();\n\tif (EMAIL.test(trimmed)) {\n\t\tconst local = trimmed.slice(0, trimmed.indexOf('@')).split('+')[0];\n\t\treturn local.split(/[._-]+/);\n\t}\n\treturn trimmed.split(/\\s+/u);\n}\n\nexport function initials(\n\tname: string | null | undefined,\n\t{ max = 2, locale }: InitialsOptions = {},\n): string | null {\n\tif (!name) return null;\n\tconst limit = Math.max(1, Math.floor(max));\n\n\tlet words = wordsOf(name)\n\t\t.map((word) => word.replace(LEADING_NOISE, '').replace(TRAILING_NOISE, ''))\n\t\t.filter(Boolean);\n\t// \"Montgomery III\" is Montgomery, not \"MI\".\n\tif (words.length > 1 && GENERATIONAL_SUFFIX.test(words[words.length - 1])) words = words.slice(0, -1);\n\tif (words.length === 0) return null;\n\n\tlet picked = words;\n\tif (words.length > limit) picked = limit === 1 ? [words[0]] : [...words.slice(0, limit - 1), words[words.length - 1]];\n\treturn picked.map((word) => upperCase(firstGrapheme(word), locale)).join('');\n}\n"],"mappings":";;;AASA,MAAM,6BAAa,IAAI,IAAuB;AAE9C,SAAS,OAA4B,KAAa,QAA+B,QAAmB;CACnG,IAAI,YAAY,WAAW,IAAI,GAAG,IAAI,GAAG,QAAQ;CACjD,IAAI,CAAC,WAAW;EACf,IAAI;GACH,YAAY,OAAO,MAAM;EAC1B,SAAS,OAAO;GACf,IAAI,EAAE,iBAAiB,eAAe,WAAW,SAAS,MAAM;GAChE,YAAY,OAAO,OAAO;EAC3B;EACA,WAAW,IAAI,GAAG,IAAI,GAAG,UAAU,SAAS;CAC7C;CACA,OAAO;AACR;AAEA,SAAgB,aAAa,QAAgB,UAAoC,CAAC,GAAG;CACpF,OAAO,OAAO,KAAK,KAAK,UAAU,OAAO,MAAM,QAAQ,IAAI,KAAK,aAAa,KAAK,OAAO,GAAG,MAAM;AACnG;AAUA,SAAgB,WAAW,QAAgB;CAC1C,OAAO,OAAO,MAAM,QAAQ,IAAI,KAAK,WAAW,KAAK,EAAE,MAAM,cAAc,CAAC,GAAG,MAAM;AACtF;AAEA,SAAgB,YAAY,QAAgB;CAC3C,OAAO,OAAO,MAAM,QAAQ,IAAI,KAAK,YAAY,GAAG,GAAG,MAAM;AAC9D;;;;;AAMA,SAAgB,YAAY,OAAe,SAAS,SAAS;CAC5D,OAAO,OAAO,SAAS,KAAK,IAAI,aAAa,MAAM,CAAC,CAAC,OAAO,KAAK,IAAI;AACtE;;;;;;;;;;AAaA,SAAgB,OAAO,OAAe,OAAoB,SAAS,SAAS;CAC3E,OAAO,MAAM,YAAY,MAAM,CAAC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,MAAM,MAAM;AAC5B;AAEA,SAAgB,SACf,MACA,EAAE,MAAM,GAAG,WAA4B,CAAC,GACxB;CAChB,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,GAAG,CAAC;CAEzC,IAAI,QAAQ,QAAQ,IAAI,CAAC,CACvB,KAAK,SAAS,KAAK,QAAQ,eAAe,EAAE,CAAC,CAAC,QAAQ,gBAAgB,EAAE,CAAC,CAAC,CAC1E,OAAO,OAAO;CAEhB,IAAI,MAAM,SAAS,KAAK,oBAAoB,KAAK,MAAM,MAAM,SAAS,EAAE,GAAG,QAAQ,MAAM,MAAM,GAAG,EAAE;CACpG,IAAI,MAAM,WAAW,GAAG,OAAO;CAE/B,IAAI,SAAS;CACb,IAAI,MAAM,SAAS,OAAO,SAAS,UAAU,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,MAAM,MAAM,SAAS,EAAE;CACpH,OAAO,OAAO,KAAK,SAAS,UAAU,cAAc,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE;AAC5E"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
//#region src/lib/intl.ts
|
|
3
|
+
const formatters = /* @__PURE__ */ new Map();
|
|
4
|
+
function cached(key, create, locale) {
|
|
5
|
+
let formatter = formatters.get(`${key}|${locale}`);
|
|
6
|
+
if (!formatter) {
|
|
7
|
+
try {
|
|
8
|
+
formatter = create(locale);
|
|
9
|
+
} catch (error) {
|
|
10
|
+
if (!(error instanceof RangeError) || locale === "en-US") throw error;
|
|
11
|
+
formatter = create("en-US");
|
|
12
|
+
}
|
|
13
|
+
formatters.set(`${key}|${locale}`, formatter);
|
|
14
|
+
}
|
|
15
|
+
return formatter;
|
|
16
|
+
}
|
|
17
|
+
function numberFormat(locale, options = {}) {
|
|
18
|
+
return cached(`n|${JSON.stringify(options)}`, (tag) => new Intl.NumberFormat(tag, options), locale);
|
|
19
|
+
}
|
|
20
|
+
function listFormat(locale) {
|
|
21
|
+
return cached("l", (tag) => new Intl.ListFormat(tag, { type: "conjunction" }), locale);
|
|
22
|
+
}
|
|
23
|
+
function pluralRules(locale) {
|
|
24
|
+
return cached("p", (tag) => new Intl.PluralRules(tag), locale);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Groups the digits of a count: `1284` becomes "1,284". Defaults to en-US so the server and the browser agree; pass
|
|
28
|
+
* the reader's locale to show their own separators. A missing or non-finite value reads as an em dash.
|
|
29
|
+
*/
|
|
30
|
+
function formatCount(value, locale = "en-US") {
|
|
31
|
+
return Number.isFinite(value) ? numberFormat(locale).format(value) : "—";
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Picks the noun form for a count with `Intl.PluralRules`, so `1` reads "1 skill" and `2` reads "2 skills". Falls
|
|
35
|
+
* back to `other` for a form that was not supplied.
|
|
36
|
+
*
|
|
37
|
+
* The forms are English unless `locale` says otherwise, and the choice follows the rules of the language they are
|
|
38
|
+
* written in, not of the page's formatting locale: Japanese has no "one" form, so English forms picked by Japanese
|
|
39
|
+
* rules would read "1 skills". Pass `locale` only together with forms written for it, such as
|
|
40
|
+
* `plural(n, { one, few, many, other }, 'ru')`.
|
|
41
|
+
*/
|
|
42
|
+
function plural(count, forms, locale = "en-US") {
|
|
43
|
+
return forms[pluralRules(locale).select(count)] ?? forms.other;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Joins names for a sentence, showing the first `max` and a count of the rest: "a, b, c, and 12 more". Fifteen names
|
|
47
|
+
* are a number to act on, not a paragraph to read.
|
|
48
|
+
*/
|
|
49
|
+
function nameList(names, { max = 3, locale = "en-US" } = {}) {
|
|
50
|
+
const shown = names.slice(0, max);
|
|
51
|
+
const rest = names.length - shown.length;
|
|
52
|
+
return listFormat(locale).format(rest > 0 ? [...shown, `${formatCount(rest, locale)} more`] : shown);
|
|
53
|
+
}
|
|
54
|
+
/** Built once. Grapheme boundaries do not depend on the locale, so the server and the browser split text alike. */
|
|
55
|
+
const graphemeSegmenter = typeof Intl !== "undefined" && typeof Intl.Segmenter === "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
56
|
+
/** The characters a reader sees: a letter with its accent or an emoji sequence is one piece, never cut in half. */
|
|
57
|
+
function graphemes(text) {
|
|
58
|
+
return graphemeSegmenter ? Array.from(graphemeSegmenter.segment(text), (part) => part.segment) : Array.from(text);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/lib/initials.ts
|
|
63
|
+
const GRAPHEME_FALLBACK = /^(?:\p{Regional_Indicator}{2}|.[\p{M}️\u{1F3FB}-\u{1F3FF}]*(?:.[\p{M}️\u{1F3FB}-\u{1F3FF}]*)*)/u;
|
|
64
|
+
const LEADING_NOISE = /^[^\p{L}\p{N}\p{Extended_Pictographic}\p{Regional_Indicator}]+/u;
|
|
65
|
+
const TRAILING_NOISE = /[^\p{L}\p{N}\p{Extended_Pictographic}\p{Regional_Indicator}]+$/u;
|
|
66
|
+
const GENERATIONAL_SUFFIX = /^(?:jr|sr|ii|iii|iv|phd|md|esq)$/i;
|
|
67
|
+
const EMAIL = /^[^\s@]+@[^\s@]+$/;
|
|
68
|
+
function firstGrapheme(text) {
|
|
69
|
+
if (graphemeSegmenter) {
|
|
70
|
+
for (const { segment } of graphemeSegmenter.segment(text)) return segment;
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
return GRAPHEME_FALLBACK.exec(text)?.[0] ?? "";
|
|
74
|
+
}
|
|
75
|
+
function upperCase(grapheme, locale) {
|
|
76
|
+
const upper = locale ? grapheme.toLocaleUpperCase(locale) : grapheme.toUpperCase();
|
|
77
|
+
return firstGrapheme(upper) === upper ? upper : grapheme;
|
|
78
|
+
}
|
|
79
|
+
function wordsOf(value) {
|
|
80
|
+
const trimmed = value.trim();
|
|
81
|
+
if (EMAIL.test(trimmed)) return trimmed.slice(0, trimmed.indexOf("@")).split("+")[0].split(/[._-]+/);
|
|
82
|
+
return trimmed.split(/\s+/u);
|
|
83
|
+
}
|
|
84
|
+
function initials(name, { max = 2, locale } = {}) {
|
|
85
|
+
if (!name) return null;
|
|
86
|
+
const limit = Math.max(1, Math.floor(max));
|
|
87
|
+
let words = wordsOf(name).map((word) => word.replace(LEADING_NOISE, "").replace(TRAILING_NOISE, "")).filter(Boolean);
|
|
88
|
+
if (words.length > 1 && GENERATIONAL_SUFFIX.test(words[words.length - 1])) words = words.slice(0, -1);
|
|
89
|
+
if (words.length === 0) return null;
|
|
90
|
+
let picked = words;
|
|
91
|
+
if (words.length > limit) picked = limit === 1 ? [words[0]] : [...words.slice(0, limit - 1), words[words.length - 1]];
|
|
92
|
+
return picked.map((word) => upperCase(firstGrapheme(word), locale)).join("");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { plural as a, nameList as i, formatCount as n, graphemes as r, initials as t };
|
|
97
|
+
//# sourceMappingURL=initials-kCcHgrSy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initials-kCcHgrSy.js","names":[],"sources":["../src/lib/intl.ts","../src/lib/initials.ts"],"sourcesContent":["/**\n * Cached `Intl` formatters and the small text helpers built on them.\n *\n * Intl constructors are slow and a list row formats several values, so each distinct locale and option set is built\n * once per page. An invalid locale tag falls back to `en-US` instead of throwing in the middle of a render.\n */\n\ntype Formatter = Intl.NumberFormat | Intl.DateTimeFormat | Intl.RelativeTimeFormat | Intl.ListFormat | Intl.PluralRules;\n\nconst formatters = new Map<string, Formatter>();\n\nfunction cached<T extends Formatter>(key: string, create: (locale: string) => T, locale: string): T {\n\tlet formatter = formatters.get(`${key}|${locale}`) as T | undefined;\n\tif (!formatter) {\n\t\ttry {\n\t\t\tformatter = create(locale);\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof RangeError) || locale === 'en-US') throw error;\n\t\t\tformatter = create('en-US');\n\t\t}\n\t\tformatters.set(`${key}|${locale}`, formatter);\n\t}\n\treturn formatter;\n}\n\nexport function numberFormat(locale: string, options: Intl.NumberFormatOptions = {}) {\n\treturn cached(`n|${JSON.stringify(options)}`, (tag) => new Intl.NumberFormat(tag, options), locale);\n}\n\nexport function dateFormat(locale: string, options: Intl.DateTimeFormatOptions) {\n\treturn cached(`d|${JSON.stringify(options)}`, (tag) => new Intl.DateTimeFormat(tag, options), locale);\n}\n\nexport function relativeTimeFormat(locale: string) {\n\treturn cached('r', (tag) => new Intl.RelativeTimeFormat(tag, { numeric: 'auto' }), locale);\n}\n\nexport function listFormat(locale: string) {\n\treturn cached('l', (tag) => new Intl.ListFormat(tag, { type: 'conjunction' }), locale);\n}\n\nexport function pluralRules(locale: string) {\n\treturn cached('p', (tag) => new Intl.PluralRules(tag), locale);\n}\n\n/**\n * Groups the digits of a count: `1284` becomes \"1,284\". Defaults to en-US so the server and the browser agree; pass\n * the reader's locale to show their own separators. A missing or non-finite value reads as an em dash.\n */\nexport function formatCount(value: number, locale = 'en-US') {\n\treturn Number.isFinite(value) ? numberFormat(locale).format(value) : '—';\n}\n\nexport type PluralForms = { one: string; other: string; zero?: string; two?: string; few?: string; many?: string };\n\n/**\n * Picks the noun form for a count with `Intl.PluralRules`, so `1` reads \"1 skill\" and `2` reads \"2 skills\". Falls\n * back to `other` for a form that was not supplied.\n *\n * The forms are English unless `locale` says otherwise, and the choice follows the rules of the language they are\n * written in, not of the page's formatting locale: Japanese has no \"one\" form, so English forms picked by Japanese\n * rules would read \"1 skills\". Pass `locale` only together with forms written for it, such as\n * `plural(n, { one, few, many, other }, 'ru')`.\n */\nexport function plural(count: number, forms: PluralForms, locale = 'en-US') {\n\treturn forms[pluralRules(locale).select(count)] ?? forms.other;\n}\n\n/**\n * Joins names for a sentence, showing the first `max` and a count of the rest: \"a, b, c, and 12 more\". Fifteen names\n * are a number to act on, not a paragraph to read.\n */\nexport function nameList(names: readonly string[], { max = 3, locale = 'en-US' }: { max?: number; locale?: string } = {}) {\n\tconst shown = names.slice(0, max);\n\tconst rest = names.length - shown.length;\n\treturn listFormat(locale).format(rest > 0 ? [...shown, `${formatCount(rest, locale)} more`] : shown);\n}\n\n/** A date nobody set: the zero timestamp (`1970-01-01T00:00:00Z`) a host sends for \"none\", an empty string, or text that is not a date. */\nexport function isUnsetDate(iso: string) {\n\tconst time = Date.parse(iso);\n\treturn time === 0 || Number.isNaN(time);\n}\n\n/** Built once. Grapheme boundaries do not depend on the locale, so the server and the browser split text alike. */\nexport const graphemeSegmenter =\n\ttypeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function' ? new Intl.Segmenter(undefined, { granularity: 'grapheme' }) : null;\n\n/** The characters a reader sees: a letter with its accent or an emoji sequence is one piece, never cut in half. */\nexport function graphemes(text: string) {\n\treturn graphemeSegmenter ? Array.from(graphemeSegmenter.segment(text), (part) => part.segment) : Array.from(text);\n}\n","import { graphemeSegmenter } from './intl';\n\n/**\n * Initials for an avatar fallback, safe for any script.\n *\n * Takes the first grapheme of the first and last word, so emoji, ZWJ sequences,\n * combining marks and non-Latin names are never split mid-character (the\n * `word[0]` pattern turns `🦊 Fox` into a lone surrogate). A single word gives\n * one initial. Pass an email address and the local part is used.\n *\n * Letters are upper-cased without consulting the runtime's locale, so the server\n * and the browser always draw the same characters (`toLocaleUpperCase()` turns `i`\n * into `İ` under a Turkish default, which would not hydrate). Pass `locale` to opt\n * in to a language's casing rules.\n *\n * Returns `null` when there is nothing to show, so callers can render an icon\n * instead of an empty circle:\n *\n * ```tsx\n * <AvatarFallback>{initials(user.name ?? user.email) ?? <UserIcon />}</AvatarFallback>\n * ```\n */\nexport interface InitialsOptions {\n\t/** Maximum number of initials. Defaults to 2 (first and last word). */\n\tmax?: number;\n\t/**\n\t * BCP 47 language tag whose casing rules upper-case the initials, for example `'tr'`\n\t * so `irem` becomes `İ`. Without it casing is locale-independent.\n\t */\n\tlocale?: string | string[];\n}\n\n\n// Approximation for runtimes without Intl.Segmenter: a flag, or one code point\n// plus its combining marks, variation selector, skin tone and ZWJ continuations.\nconst GRAPHEME_FALLBACK =\n\t/^(?:\\p{Regional_Indicator}{2}|.[\\p{M}️\\u{1F3FB}-\\u{1F3FF}]*(?:.[\\p{M}️\\u{1F3FB}-\\u{1F3FF}]*)*)/u;\n\nconst LEADING_NOISE = /^[^\\p{L}\\p{N}\\p{Extended_Pictographic}\\p{Regional_Indicator}]+/u;\nconst TRAILING_NOISE = /[^\\p{L}\\p{N}\\p{Extended_Pictographic}\\p{Regional_Indicator}]+$/u;\nconst GENERATIONAL_SUFFIX = /^(?:jr|sr|ii|iii|iv|phd|md|esq)$/i;\nconst EMAIL = /^[^\\s@]+@[^\\s@]+$/;\n\nfunction firstGrapheme(text: string): string {\n\tif (graphemeSegmenter) {\n\t\tfor (const { segment } of graphemeSegmenter.segment(text)) return segment;\n\t\treturn '';\n\t}\n\treturn GRAPHEME_FALLBACK.exec(text)?.[0] ?? '';\n}\n\nfunction upperCase(grapheme: string, locale: InitialsOptions['locale']): string {\n\tconst upper = locale ? grapheme.toLocaleUpperCase(locale) : grapheme.toUpperCase();\n\t// `ß` becomes `SS`: keep the original when uppercasing would add a character.\n\treturn firstGrapheme(upper) === upper ? upper : grapheme;\n}\n\nfunction wordsOf(value: string): string[] {\n\tconst trimmed = value.trim();\n\tif (EMAIL.test(trimmed)) {\n\t\tconst local = trimmed.slice(0, trimmed.indexOf('@')).split('+')[0];\n\t\treturn local.split(/[._-]+/);\n\t}\n\treturn trimmed.split(/\\s+/u);\n}\n\nexport function initials(\n\tname: string | null | undefined,\n\t{ max = 2, locale }: InitialsOptions = {},\n): string | null {\n\tif (!name) return null;\n\tconst limit = Math.max(1, Math.floor(max));\n\n\tlet words = wordsOf(name)\n\t\t.map((word) => word.replace(LEADING_NOISE, '').replace(TRAILING_NOISE, ''))\n\t\t.filter(Boolean);\n\t// \"Montgomery III\" is Montgomery, not \"MI\".\n\tif (words.length > 1 && GENERATIONAL_SUFFIX.test(words[words.length - 1])) words = words.slice(0, -1);\n\tif (words.length === 0) return null;\n\n\tlet picked = words;\n\tif (words.length > limit) picked = limit === 1 ? [words[0]] : [...words.slice(0, limit - 1), words[words.length - 1]];\n\treturn picked.map((word) => upperCase(firstGrapheme(word), locale)).join('');\n}\n"],"mappings":";;AASA,MAAM,6BAAa,IAAI,IAAuB;AAE9C,SAAS,OAA4B,KAAa,QAA+B,QAAmB;CACnG,IAAI,YAAY,WAAW,IAAI,GAAG,IAAI,GAAG,QAAQ;CACjD,IAAI,CAAC,WAAW;EACf,IAAI;GACH,YAAY,OAAO,MAAM;EAC1B,SAAS,OAAO;GACf,IAAI,EAAE,iBAAiB,eAAe,WAAW,SAAS,MAAM;GAChE,YAAY,OAAO,OAAO;EAC3B;EACA,WAAW,IAAI,GAAG,IAAI,GAAG,UAAU,SAAS;CAC7C;CACA,OAAO;AACR;AAEA,SAAgB,aAAa,QAAgB,UAAoC,CAAC,GAAG;CACpF,OAAO,OAAO,KAAK,KAAK,UAAU,OAAO,MAAM,QAAQ,IAAI,KAAK,aAAa,KAAK,OAAO,GAAG,MAAM;AACnG;AAUA,SAAgB,WAAW,QAAgB;CAC1C,OAAO,OAAO,MAAM,QAAQ,IAAI,KAAK,WAAW,KAAK,EAAE,MAAM,cAAc,CAAC,GAAG,MAAM;AACtF;AAEA,SAAgB,YAAY,QAAgB;CAC3C,OAAO,OAAO,MAAM,QAAQ,IAAI,KAAK,YAAY,GAAG,GAAG,MAAM;AAC9D;;;;;AAMA,SAAgB,YAAY,OAAe,SAAS,SAAS;CAC5D,OAAO,OAAO,SAAS,KAAK,IAAI,aAAa,MAAM,CAAC,CAAC,OAAO,KAAK,IAAI;AACtE;;;;;;;;;;AAaA,SAAgB,OAAO,OAAe,OAAoB,SAAS,SAAS;CAC3E,OAAO,MAAM,YAAY,MAAM,CAAC,CAAC,OAAO,KAAK,MAAM,MAAM;AAC1D;;;;;AAMA,SAAgB,SAAS,OAA0B,EAAE,MAA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;CAChB,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,GAAG,CAAC;CAEzC,IAAI,QAAQ,QAAQ,IAAI,CAAC,CACvB,KAAK,SAAS,KAAK,QAAQ,eAAe,EAAE,CAAC,CAAC,QAAQ,gBAAgB,EAAE,CAAC,CAAC,CAC1E,OAAO,OAAO;CAEhB,IAAI,MAAM,SAAS,KAAK,oBAAoB,KAAK,MAAM,MAAM,SAAS,EAAE,GAAG,QAAQ,MAAM,MAAM,GAAG,EAAE;CACpG,IAAI,MAAM,WAAW,GAAG,OAAO;CAE/B,IAAI,SAAS;CACb,IAAI,MAAM,SAAS,OAAO,SAAS,UAAU,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,MAAM,MAAM,SAAS,EAAE;CACpH,OAAO,OAAO,KAAK,SAAS,UAAU,cAAc,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE;AAC5E"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as cn } from "./utils-BkMLyah9.js";
|
|
3
|
+
import { Button } from "./components/button.js";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
|
|
5
|
+
import { t as useDocumentTheme } from "./use-document-theme-Ch_PqxZz.js";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { Suspense, useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { CheckCircle2, CircleAlert, Loader2, WandSparkles } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
//#region src/lib/json-error-position.ts
|
|
12
|
+
/**
|
|
13
|
+
* Where a JSON text first stops being valid, for an error message a person can act on. Engines word syntax errors
|
|
14
|
+
* differently and often leave out the position (Safari always does), which makes a mistake on line 4,500 hard to find,
|
|
15
|
+
* so the position is found by a small scan of the grammar instead of being read from the engine's message.
|
|
16
|
+
*/
|
|
17
|
+
const JSON_NUMBER = /-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/y;
|
|
18
|
+
const JSON_HEX_ESCAPE = /[0-9a-fA-F]{4}/y;
|
|
19
|
+
/** Where `text` first stops being valid JSON, as a 0-based character offset (null when it parses). */
|
|
20
|
+
const findJsonErrorOffset = (text) => {
|
|
21
|
+
let i = 0;
|
|
22
|
+
const fail = (at = i) => {
|
|
23
|
+
throw new JsonOffsetError(at);
|
|
24
|
+
};
|
|
25
|
+
const whitespace = () => {
|
|
26
|
+
while (i < text.length && " \n\r ".includes(text[i])) i += 1;
|
|
27
|
+
};
|
|
28
|
+
const string = () => {
|
|
29
|
+
i += 1;
|
|
30
|
+
while (i < text.length) {
|
|
31
|
+
const char = text[i];
|
|
32
|
+
if (char === "\"") {
|
|
33
|
+
i += 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (char === "\\") {
|
|
37
|
+
const escape = text[i + 1];
|
|
38
|
+
if (escape === "u") {
|
|
39
|
+
JSON_HEX_ESCAPE.lastIndex = i + 2;
|
|
40
|
+
if (!JSON_HEX_ESCAPE.test(text)) fail(i);
|
|
41
|
+
i += 6;
|
|
42
|
+
} else if (escape !== void 0 && "\"\\/bfnrt".includes(escape)) i += 2;
|
|
43
|
+
else fail(i + 1);
|
|
44
|
+
} else if (char < " ") fail(i);
|
|
45
|
+
else i += 1;
|
|
46
|
+
}
|
|
47
|
+
fail(text.length);
|
|
48
|
+
};
|
|
49
|
+
const value = () => {
|
|
50
|
+
whitespace();
|
|
51
|
+
const char = text[i];
|
|
52
|
+
if (char === "{") {
|
|
53
|
+
i += 1;
|
|
54
|
+
whitespace();
|
|
55
|
+
if (text[i] === "}") {
|
|
56
|
+
i += 1;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
for (;;) {
|
|
60
|
+
whitespace();
|
|
61
|
+
if (text[i] !== "\"") fail();
|
|
62
|
+
string();
|
|
63
|
+
whitespace();
|
|
64
|
+
if (text[i] !== ":") fail();
|
|
65
|
+
i += 1;
|
|
66
|
+
value();
|
|
67
|
+
whitespace();
|
|
68
|
+
if (text[i] === ",") {
|
|
69
|
+
i += 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (text[i] === "}") {
|
|
73
|
+
i += 1;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
fail();
|
|
77
|
+
}
|
|
78
|
+
} else if (char === "[") {
|
|
79
|
+
i += 1;
|
|
80
|
+
whitespace();
|
|
81
|
+
if (text[i] === "]") {
|
|
82
|
+
i += 1;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
for (;;) {
|
|
86
|
+
value();
|
|
87
|
+
whitespace();
|
|
88
|
+
if (text[i] === ",") {
|
|
89
|
+
i += 1;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (text[i] === "]") {
|
|
93
|
+
i += 1;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
fail();
|
|
97
|
+
}
|
|
98
|
+
} else if (char === "\"") string();
|
|
99
|
+
else if (char === "-" || char >= "0" && char <= "9") {
|
|
100
|
+
JSON_NUMBER.lastIndex = i;
|
|
101
|
+
const number = JSON_NUMBER.exec(text);
|
|
102
|
+
if (!number) fail();
|
|
103
|
+
i += number[0].length;
|
|
104
|
+
} else if (text.startsWith("true", i)) i += 4;
|
|
105
|
+
else if (text.startsWith("false", i)) i += 5;
|
|
106
|
+
else if (text.startsWith("null", i)) i += 4;
|
|
107
|
+
else fail();
|
|
108
|
+
};
|
|
109
|
+
try {
|
|
110
|
+
value();
|
|
111
|
+
whitespace();
|
|
112
|
+
if (i < text.length) fail();
|
|
113
|
+
return null;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
return error instanceof JsonOffsetError ? error.offset : null;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
var JsonOffsetError = class extends Error {
|
|
119
|
+
offset;
|
|
120
|
+
constructor(offset) {
|
|
121
|
+
super("Invalid JSON");
|
|
122
|
+
this.offset = offset;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
/** The engine's message plus the line and column of the first error ("... (line 4,500, column 3)"). */
|
|
126
|
+
const describeJsonError = (text, message) => {
|
|
127
|
+
const offset = findJsonErrorOffset(text);
|
|
128
|
+
if (offset === null) return message;
|
|
129
|
+
const before = text.slice(0, offset);
|
|
130
|
+
const line = before.split("\n").length;
|
|
131
|
+
const column = offset - before.lastIndexOf("\n");
|
|
132
|
+
return `${message} (line ${line.toLocaleString("en-US")}, column ${column})`;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/components/json-input.tsx
|
|
137
|
+
const AceEditor = React$1.lazy(async () => {
|
|
138
|
+
const ace = await import("react-ace");
|
|
139
|
+
await import("ace-builds/src-noconflict/mode-json");
|
|
140
|
+
await import("ace-builds/src-noconflict/theme-textmate");
|
|
141
|
+
await import("ace-builds/src-noconflict/theme-cloud9_night");
|
|
142
|
+
return ace;
|
|
143
|
+
});
|
|
144
|
+
const EditorLoading = () => /* @__PURE__ */ jsx("div", {
|
|
145
|
+
className: "flex h-32 items-center justify-center",
|
|
146
|
+
children: /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin" })
|
|
147
|
+
});
|
|
148
|
+
const displayJsonState = (jsonState) => {
|
|
149
|
+
return {
|
|
150
|
+
loading: {
|
|
151
|
+
icon: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground size-[18px] animate-spin" }),
|
|
152
|
+
text: "Checking JSON Format...",
|
|
153
|
+
className: "text-muted-foreground"
|
|
154
|
+
},
|
|
155
|
+
success: {
|
|
156
|
+
icon: /* @__PURE__ */ jsx(CheckCircle2, { className: "size-[18px] text-green-600" }),
|
|
157
|
+
text: "Valid JSON Format",
|
|
158
|
+
className: "text-foreground"
|
|
159
|
+
},
|
|
160
|
+
error: {
|
|
161
|
+
icon: /* @__PURE__ */ jsx(CircleAlert, { className: "text-destructive size-[18px]" }),
|
|
162
|
+
text: jsonState.errMsg || "Invalid JSON Format",
|
|
163
|
+
className: "text-destructive"
|
|
164
|
+
},
|
|
165
|
+
empty: {}
|
|
166
|
+
}[jsonState.state];
|
|
167
|
+
};
|
|
168
|
+
const LINE_HEIGHT = 19;
|
|
169
|
+
const viewportListeners = /* @__PURE__ */ new Set();
|
|
170
|
+
const notifyViewport = () => viewportListeners.forEach((notify) => notify());
|
|
171
|
+
/** One resize listener serves every editor on the page; it is added with the first and removed with the last. */
|
|
172
|
+
function subscribeToViewport(listener) {
|
|
173
|
+
viewportListeners.add(listener);
|
|
174
|
+
if (viewportListeners.size === 1) window.addEventListener("resize", notifyViewport);
|
|
175
|
+
return () => {
|
|
176
|
+
viewportListeners.delete(listener);
|
|
177
|
+
if (viewportListeners.size === 0) window.removeEventListener("resize", notifyViewport);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/** The number of editor lines that fit in 40% of the viewport (client-side; a fixed fallback during SSR). */
|
|
181
|
+
function useViewportLines() {
|
|
182
|
+
return useSyncExternalStore(subscribeToViewport, () => Math.max(1, Math.floor(window.innerHeight * .4 / LINE_HEIGHT)), () => 24);
|
|
183
|
+
}
|
|
184
|
+
const JsonInput = ({ value = "", setValue, minLines = 16, maxLines, className, theme: themeProp }) => {
|
|
185
|
+
const [jsonState, setJsonState] = useState({ state: "empty" });
|
|
186
|
+
const viewportLines = useViewportLines();
|
|
187
|
+
const pageTheme = useDocumentTheme(themeProp === void 0);
|
|
188
|
+
const theme = themeProp ?? pageTheme;
|
|
189
|
+
const handleChange = (val) => {
|
|
190
|
+
setJsonState({ state: "loading" });
|
|
191
|
+
setValue(val);
|
|
192
|
+
};
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
const timeoutId = setTimeout(() => {
|
|
195
|
+
const error = validateJson(value);
|
|
196
|
+
if (value.trim().length === 0) setJsonState({ state: "empty" });
|
|
197
|
+
else if (error) setJsonState({
|
|
198
|
+
state: "error",
|
|
199
|
+
errMsg: describeJsonError(value, error)
|
|
200
|
+
});
|
|
201
|
+
else setJsonState({ state: "success" });
|
|
202
|
+
}, 400);
|
|
203
|
+
return () => clearTimeout(timeoutId);
|
|
204
|
+
}, [value]);
|
|
205
|
+
const { icon, text, className: textClassName } = displayJsonState(jsonState);
|
|
206
|
+
const isValidJson = validateJson(value) === null;
|
|
207
|
+
const cap = Math.max(minLines, maxLines ?? viewportLines);
|
|
208
|
+
const lines = useMemo(() => {
|
|
209
|
+
return Math.min(Math.max(countJsonLines(value), minLines), cap);
|
|
210
|
+
}, [
|
|
211
|
+
value,
|
|
212
|
+
minLines,
|
|
213
|
+
cap
|
|
214
|
+
]);
|
|
215
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
216
|
+
className: cn("border-border relative overflow-y-auto rounded-md border p-2.5 pr-12", className),
|
|
217
|
+
children: [/* @__PURE__ */ jsx(JsonEditor, {
|
|
218
|
+
value,
|
|
219
|
+
setValue: handleChange,
|
|
220
|
+
lines,
|
|
221
|
+
theme
|
|
222
|
+
}), /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
223
|
+
asChild: true,
|
|
224
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
225
|
+
className: "absolute top-2 right-2 size-8 rounded-md",
|
|
226
|
+
size: "icon",
|
|
227
|
+
variant: "outline",
|
|
228
|
+
type: "button",
|
|
229
|
+
disabled: !isValidJson,
|
|
230
|
+
onClick: () => setValue(prettifyJson(value)),
|
|
231
|
+
children: /* @__PURE__ */ jsx(WandSparkles, { className: "text-muted-foreground size-4" })
|
|
232
|
+
})
|
|
233
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: "Format JSON" })] }) })]
|
|
234
|
+
}), jsonState.state !== "empty" && /* @__PURE__ */ jsxs("div", {
|
|
235
|
+
className: "mt-2 flex items-center gap-2",
|
|
236
|
+
children: [icon, /* @__PURE__ */ jsx("span", {
|
|
237
|
+
className: cn("text-sm", textClassName),
|
|
238
|
+
children: text
|
|
239
|
+
})]
|
|
240
|
+
})] });
|
|
241
|
+
};
|
|
242
|
+
const JsonEditor = ({ value, setValue, lines, readOnly = false, isValid = true, enableFolding = false, theme: themeProp }) => {
|
|
243
|
+
const pageTheme = useDocumentTheme(themeProp === void 0);
|
|
244
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
245
|
+
fallback: /* @__PURE__ */ jsx(EditorLoading, {}),
|
|
246
|
+
children: /* @__PURE__ */ jsx(AceEditor, {
|
|
247
|
+
mode: "json",
|
|
248
|
+
theme: (themeProp ?? pageTheme) === "light" ? "textmate" : "cloud9_night",
|
|
249
|
+
fontSize: "14px",
|
|
250
|
+
readOnly,
|
|
251
|
+
style: {
|
|
252
|
+
width: "100%",
|
|
253
|
+
background: "transparent",
|
|
254
|
+
offset: 0
|
|
255
|
+
},
|
|
256
|
+
setOptions: {
|
|
257
|
+
useWorker: false,
|
|
258
|
+
printMargin: false,
|
|
259
|
+
showFoldWidgets: enableFolding,
|
|
260
|
+
foldStyle: "markbegin"
|
|
261
|
+
},
|
|
262
|
+
tabSize: 2,
|
|
263
|
+
wrapEnabled: readOnly && !isValid,
|
|
264
|
+
showGutter: enableFolding,
|
|
265
|
+
minLines: lines,
|
|
266
|
+
maxLines: lines,
|
|
267
|
+
highlightActiveLine: !readOnly,
|
|
268
|
+
value,
|
|
269
|
+
onChange: setValue
|
|
270
|
+
})
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
const validateJson = (text) => {
|
|
274
|
+
try {
|
|
275
|
+
if (text.trim().length === 0) throw new SyntaxError(`Can't use empty string`);
|
|
276
|
+
JSON.parse(text);
|
|
277
|
+
return null;
|
|
278
|
+
} catch (error) {
|
|
279
|
+
return error.message;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
const prettifyJson = (text) => {
|
|
283
|
+
try {
|
|
284
|
+
return JSON.stringify(JSON.parse(text), null, 2);
|
|
285
|
+
} catch {
|
|
286
|
+
return text;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
const countJsonLines = (text) => text.split(/\n/).length;
|
|
290
|
+
|
|
291
|
+
//#endregion
|
|
292
|
+
export { JsonInput as n, validateJson as r, JsonEditor as t };
|
|
293
|
+
//# sourceMappingURL=json-input-CH5aEmoA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-input-CH5aEmoA.js","names":["React"],"sources":["../src/lib/json-error-position.ts","../src/components/json-input.tsx"],"sourcesContent":["/**\n * Where a JSON text first stops being valid, for an error message a person can act on. Engines word syntax errors\n * differently and often leave out the position (Safari always does), which makes a mistake on line 4,500 hard to find,\n * so the position is found by a small scan of the grammar instead of being read from the engine's message.\n */\n\n// Sticky, so they match at `lastIndex` itself: a number of any length is read whole and nothing is sliced out of the text.\nconst JSON_NUMBER = /-?(0|[1-9]\\d*)(\\.\\d+)?([eE][+-]?\\d+)?/y;\nconst JSON_HEX_ESCAPE = /[0-9a-fA-F]{4}/y;\n\n/** Where `text` first stops being valid JSON, as a 0-based character offset (null when it parses). */\nexport const findJsonErrorOffset = (text: string): number | null => {\n\tlet i = 0;\n\tconst fail = (at = i): never => {\n\t\tthrow new JsonOffsetError(at);\n\t};\n\tconst whitespace = () => {\n\t\twhile (i < text.length && ' \\n\\r\\t'.includes(text[i])) i += 1;\n\t};\n\tconst string = () => {\n\t\ti += 1;\n\t\twhile (i < text.length) {\n\t\t\tconst char = text[i];\n\t\t\tif (char === '\"') {\n\t\t\t\ti += 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (char === '\\\\') {\n\t\t\t\tconst escape = text[i + 1];\n\t\t\t\tif (escape === 'u') {\n\t\t\t\t\tJSON_HEX_ESCAPE.lastIndex = i + 2;\n\t\t\t\t\tif (!JSON_HEX_ESCAPE.test(text)) fail(i);\n\t\t\t\t\ti += 6;\n\t\t\t\t} else if (escape !== undefined && '\"\\\\/bfnrt'.includes(escape)) i += 2;\n\t\t\t\telse fail(i + 1);\n\t\t\t} else if (char < ' ') fail(i);\n\t\t\telse i += 1;\n\t\t}\n\t\tfail(text.length);\n\t};\n\tconst value = (): void => {\n\t\twhitespace();\n\t\tconst char = text[i];\n\t\tif (char === '{') {\n\t\t\ti += 1;\n\t\t\twhitespace();\n\t\t\tif (text[i] === '}') {\n\t\t\t\ti += 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (;;) {\n\t\t\t\twhitespace();\n\t\t\t\tif (text[i] !== '\"') fail();\n\t\t\t\tstring();\n\t\t\t\twhitespace();\n\t\t\t\tif (text[i] !== ':') fail();\n\t\t\t\ti += 1;\n\t\t\t\tvalue();\n\t\t\t\twhitespace();\n\t\t\t\tif (text[i] === ',') {\n\t\t\t\t\ti += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (text[i] === '}') {\n\t\t\t\t\ti += 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfail();\n\t\t\t}\n\t\t} else if (char === '[') {\n\t\t\ti += 1;\n\t\t\twhitespace();\n\t\t\tif (text[i] === ']') {\n\t\t\t\ti += 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (;;) {\n\t\t\t\tvalue();\n\t\t\t\twhitespace();\n\t\t\t\tif (text[i] === ',') {\n\t\t\t\t\ti += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (text[i] === ']') {\n\t\t\t\t\ti += 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfail();\n\t\t\t}\n\t\t} else if (char === '\"') string();\n\t\telse if (char === '-' || (char >= '0' && char <= '9')) {\n\t\t\tJSON_NUMBER.lastIndex = i;\n\t\t\tconst number = JSON_NUMBER.exec(text);\n\t\t\tif (!number) fail();\n\t\t\ti += number![0].length;\n\t\t} else if (text.startsWith('true', i)) i += 4;\n\t\telse if (text.startsWith('false', i)) i += 5;\n\t\telse if (text.startsWith('null', i)) i += 4;\n\t\telse fail();\n\t};\n\n\ttry {\n\t\tvalue();\n\t\twhitespace();\n\t\tif (i < text.length) fail();\n\t\treturn null;\n\t} catch (error) {\n\t\treturn error instanceof JsonOffsetError ? error.offset : null;\n\t}\n};\n\nclass JsonOffsetError extends Error {\n\tconstructor(readonly offset: number) {\n\t\tsuper('Invalid JSON');\n\t}\n}\n\n/** The engine's message plus the line and column of the first error (\"... (line 4,500, column 3)\"). */\nexport const describeJsonError = (text: string, message: string) => {\n\tconst offset = findJsonErrorOffset(text);\n\tif (offset === null) return message;\n\tconst before = text.slice(0, offset);\n\tconst line = before.split('\\n').length;\n\tconst column = offset - before.lastIndexOf('\\n');\n\treturn `${message} (line ${line.toLocaleString('en-US')}, column ${column})`;\n};\n","'use client';\n\nimport * as React from 'react';\nimport { useEffect, useMemo, useState, useSyncExternalStore, Suspense } from 'react';\nimport { CheckCircle2, CircleAlert, Loader2, WandSparkles } from 'lucide-react';\nimport type { IAceEditorProps } from 'react-ace';\n\nimport { describeJsonError } from '../lib/json-error-position';\nimport { useDocumentTheme } from '../lib/use-document-theme';\nimport { cn } from '../lib/utils';\n\nimport { Button } from './button';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip';\n\n// Lazy load AceEditor\nconst AceEditor = React.lazy(async () => {\n\tconst ace = await import('react-ace');\n\tawait import('ace-builds/src-noconflict/mode-json');\n\tawait import('ace-builds/src-noconflict/theme-textmate');\n\tawait import('ace-builds/src-noconflict/theme-cloud9_night');\n\treturn ace;\n});\n\nconst EditorLoading = () => (\n\t<div className=\"flex h-32 items-center justify-center\">\n\t\t<Loader2 className=\"h-6 w-6 animate-spin\" />\n\t</div>\n);\n\ntype JsonDisplay = {\n\ticon?: React.ReactNode;\n\ttext?: string;\n\tclassName?: string;\n};\n\ninterface JsonState {\n\tstate: 'empty' | 'loading' | 'success' | 'error';\n\terrMsg?: string;\n}\n\nconst displayJsonState = (jsonState: JsonState) => {\n\tconst jsonStateMap: Record<JsonState['state'], JsonDisplay> = {\n\t\tloading: {\n\t\t\ticon: <Loader2 className=\"text-muted-foreground size-[18px] animate-spin\" />,\n\t\t\ttext: 'Checking JSON Format...',\n\t\t\tclassName: 'text-muted-foreground',\n\t\t},\n\n\t\tsuccess: {\n\t\t\ticon: <CheckCircle2 className=\"size-[18px] text-green-600\" />,\n\t\t\ttext: 'Valid JSON Format',\n\t\t\tclassName: 'text-foreground',\n\t\t},\n\n\t\terror: {\n\t\t\ticon: <CircleAlert className=\"text-destructive size-[18px]\" />,\n\t\t\ttext: jsonState.errMsg || 'Invalid JSON Format',\n\t\t\tclassName: 'text-destructive',\n\t\t},\n\n\t\tempty: {},\n\t};\n\n\treturn jsonStateMap[jsonState.state];\n};\n\ntype JsonInputProps = {\n\tvalue: string;\n\tsetValue: (value: string) => void;\n\tminLines?: number;\n\t/** Tallest the editor grows, in lines; longer documents scroll inside it. Defaults to what fits in 40% of the viewport. */\n\tmaxLines?: number;\n\tclassName?: string;\n\t/** Theme for the editor: 'light' or 'dark'. Defaults to the document's theme (the `dark` class on `<html>`). */\n\ttheme?: 'light' | 'dark';\n};\n\n// Ace draws a 14px line about 19px tall.\nconst LINE_HEIGHT = 19;\n\nconst viewportListeners = new Set<() => void>();\nconst notifyViewport = () => viewportListeners.forEach((notify) => notify());\n\n/** One resize listener serves every editor on the page; it is added with the first and removed with the last. */\nfunction subscribeToViewport(listener: () => void) {\n\tviewportListeners.add(listener);\n\tif (viewportListeners.size === 1) window.addEventListener('resize', notifyViewport);\n\treturn () => {\n\t\tviewportListeners.delete(listener);\n\t\tif (viewportListeners.size === 0) window.removeEventListener('resize', notifyViewport);\n\t};\n}\n\n/** The number of editor lines that fit in 40% of the viewport (client-side; a fixed fallback during SSR). */\nfunction useViewportLines() {\n\treturn useSyncExternalStore(\n\t\tsubscribeToViewport,\n\t\t() => Math.max(1, Math.floor((window.innerHeight * 0.4) / LINE_HEIGHT)),\n\t\t() => 24,\n\t);\n}\n\nexport const JsonInput = ({ value = '', setValue, minLines = 16, maxLines, className, theme: themeProp }: JsonInputProps) => {\n\tconst [jsonState, setJsonState] = useState<JsonState>({ state: 'empty' });\n\tconst viewportLines = useViewportLines();\n\tconst pageTheme = useDocumentTheme(themeProp === undefined);\n\tconst theme = themeProp ?? pageTheme;\n\n\tconst handleChange = (val: string) => {\n\t\tsetJsonState({ state: 'loading' });\n\t\tsetValue(val);\n\t};\n\n\tuseEffect(() => {\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\tconst error = validateJson(value);\n\n\t\t\tif (value.trim().length === 0) setJsonState({ state: 'empty' });\n\t\t\telse if (error) setJsonState({ state: 'error', errMsg: describeJsonError(value, error) });\n\t\t\telse setJsonState({ state: 'success' });\n\t\t}, 400);\n\n\t\treturn () => clearTimeout(timeoutId);\n\t}, [value]);\n\n\tconst { icon, text, className: textClassName } = displayJsonState(jsonState);\n\tconst isValidJson = validateJson(value) === null;\n\n\tconst cap = Math.max(minLines, maxLines ?? viewportLines);\n\tconst lines = useMemo(() => {\n\t\treturn Math.min(Math.max(countJsonLines(value), minLines), cap);\n\t}, [value, minLines, cap]);\n\n\treturn (\n\t\t<div>\n\t\t\t{/* The code is always left to right, so the format button stays on the right and the editor leaves it room. */}\n\t\t\t<div className={cn('border-border relative overflow-y-auto rounded-md border p-2.5 pr-12', className)}>\n\t\t\t\t<JsonEditor value={value} setValue={handleChange} lines={lines} theme={theme} />\n\t\t\t\t<TooltipProvider>\n\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"absolute top-2 right-2 size-8 rounded-md\"\n\t\t\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdisabled={!isValidJson}\n\t\t\t\t\t\t\t\tonClick={() => setValue(prettifyJson(value))}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WandSparkles className=\"text-muted-foreground size-4\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t<TooltipContent>Format JSON</TooltipContent>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t</TooltipProvider>\n\t\t\t</div>\n\t\t\t{jsonState.state !== 'empty' && (\n\t\t\t\t<div className=\"mt-2 flex items-center gap-2\">\n\t\t\t\t\t{icon}\n\t\t\t\t\t<span className={cn('text-sm', textClassName)}>{text}</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\ntype JsonEditorProps = {\n\tvalue: string;\n\tlines: number;\n\tsetValue?: (value: string) => void;\n\treadOnly?: boolean;\n\tisValid?: boolean;\n\tenableFolding?: boolean;\n\t/** Theme for the editor: 'light' or 'dark'. Defaults to the document's theme (the `dark` class on `<html>`). */\n\ttheme?: 'light' | 'dark';\n};\n\nexport const JsonEditor = ({\n\tvalue,\n\tsetValue,\n\tlines,\n\treadOnly = false,\n\tisValid = true,\n\tenableFolding = false,\n\ttheme: themeProp,\n}: JsonEditorProps) => {\n\tconst pageTheme = useDocumentTheme(themeProp === undefined);\n\tconst theme = themeProp ?? pageTheme;\n\tconst editorProps: IAceEditorProps = {\n\t\tmode: 'json',\n\t\ttheme: theme === 'light' ? 'textmate' : 'cloud9_night',\n\t\tfontSize: '14px',\n\t\treadOnly,\n\t\tstyle: {\n\t\t\twidth: '100%',\n\t\t\tbackground: 'transparent',\n\t\t\toffset: 0,\n\t\t},\n\t\tsetOptions: {\n\t\t\tuseWorker: false,\n\t\t\tprintMargin: false,\n\t\t\tshowFoldWidgets: enableFolding,\n\t\t\tfoldStyle: 'markbegin',\n\t\t},\n\t\ttabSize: 2,\n\t\twrapEnabled: readOnly && !isValid,\n\t\tshowGutter: enableFolding,\n\t\tminLines: lines,\n\t\tmaxLines: lines,\n\t\thighlightActiveLine: !readOnly,\n\t\tvalue,\n\t\tonChange: setValue,\n\t};\n\n\treturn (\n\t\t<Suspense fallback={<EditorLoading />}>\n\t\t\t<AceEditor {...editorProps} />\n\t\t</Suspense>\n\t);\n};\n\nexport const validateJson = (text: string) => {\n\ttry {\n\t\tif (text.trim().length === 0) throw new SyntaxError(`Can't use empty string`);\n\t\tJSON.parse(text);\n\t\treturn null;\n\t} catch (error) {\n\t\treturn (error as SyntaxError).message;\n\t}\n};\n\nconst prettifyJson = (text: string) => {\n\ttry {\n\t\treturn JSON.stringify(JSON.parse(text), null, 2);\n\t} catch {\n\t\treturn text;\n\t}\n};\n\nconst countJsonLines = (text: string) => text.split(/\\n/).length;\n"],"mappings":";;;;;;;;;;;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,kBAAkB;;AAGxB,MAAa,uBAAuB,SAAgC;CACnE,IAAI,IAAI;CACR,MAAM,QAAQ,KAAK,MAAa;EAC/B,MAAM,IAAI,gBAAgB,EAAE;CAC7B;CACA,MAAM,mBAAmB;EACxB,OAAO,IAAI,KAAK,UAAU,SAAU,SAAS,KAAK,EAAE,GAAG,KAAK;CAC7D;CACA,MAAM,eAAe;EACpB,KAAK;EACL,OAAO,IAAI,KAAK,QAAQ;GACvB,MAAM,OAAO,KAAK;GAClB,IAAI,SAAS,MAAK;IACjB,KAAK;IACL;GACD;GACA,IAAI,SAAS,MAAM;IAClB,MAAM,SAAS,KAAK,IAAI;IACxB,IAAI,WAAW,KAAK;KACnB,gBAAgB,YAAY,IAAI;KAChC,IAAI,CAAC,gBAAgB,KAAK,IAAI,GAAG,KAAK,CAAC;KACvC,KAAK;IACN,OAAO,IAAI,WAAW,UAAa,aAAY,SAAS,MAAM,GAAG,KAAK;SACjE,KAAK,IAAI,CAAC;GAChB,OAAO,IAAI,OAAO,KAAK,KAAK,CAAC;QACxB,KAAK;EACX;EACA,KAAK,KAAK,MAAM;CACj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