@krak-stack/registry 0.10.20 → 0.11.2
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/CHANGELOG.md +89 -3
- package/README.md +11 -8
- package/dist/components/agent/index.d.ts +454 -0
- package/dist/components/agent/react.d.ts +55 -0
- package/dist/components/agent/react.js +2440 -0
- package/dist/components/agent/schema.d.ts +55 -0
- package/dist/components/animated-list/classes.d.ts +9 -0
- package/dist/components/animated-list/html.d.ts +11 -0
- package/dist/components/animated-list/html.js +533 -0
- package/dist/components/animated-list/index.d.ts +205 -0
- package/dist/components/animated-list/react.d.ts +11 -0
- package/dist/components/{ui/animated-list.js → animated-list/react.js} +199 -54
- package/dist/components/animated-list/schema.d.ts +44 -0
- package/dist/components/animated-number/html.d.ts +19 -0
- package/dist/components/animated-number/html.js +101 -0
- package/dist/components/animated-number/index.d.ts +80 -0
- package/dist/components/{ui/animated-number.d.ts → animated-number/react.d.ts} +2 -7
- package/dist/components/animated-number/react.js +124 -0
- package/dist/components/animated-number/schema.d.ts +9 -0
- package/dist/components/app-brand/classes.d.ts +11 -0
- package/dist/components/app-brand/html.d.ts +26 -0
- package/dist/components/app-brand/html.js +78 -0
- package/dist/components/app-brand/react.d.ts +12 -0
- package/dist/components/app-brand/react.js +86 -0
- package/dist/components/app-brand/schema.d.ts +36 -0
- package/dist/components/app-switcher/classes.d.ts +15 -0
- package/dist/components/app-switcher/html.d.ts +72 -0
- package/dist/components/app-switcher/html.js +327 -0
- package/dist/components/app-switcher/index.d.ts +47 -0
- package/dist/components/app-switcher/react.d.ts +12 -0
- package/dist/components/{ui/app-switcher.js → app-switcher/react.js} +84 -15
- package/dist/components/app-switcher/schema.d.ts +39 -0
- package/dist/components/async-action-button/classes.d.ts +11 -0
- package/dist/components/async-action-button/html.d.ts +46 -0
- package/dist/components/async-action-button/html.js +266 -0
- package/dist/components/async-action-button/index.d.ts +73 -0
- package/dist/components/async-action-button/react.d.ts +10 -0
- package/dist/components/async-action-button/react.js +224 -0
- package/dist/components/async-action-button/schema.d.ts +28 -0
- package/dist/{services/events/client/audit-log-table.d.ts → components/audit-log-table/react.d.ts} +2 -2
- package/dist/{services/events/client/audit-log-table.js → components/audit-log-table/react.js} +1964 -847
- package/dist/components/auto-height/html.d.ts +8 -0
- package/dist/components/auto-height/html.js +81 -0
- package/dist/components/auto-height/index.d.ts +2 -0
- package/dist/components/{ui/auto-height.d.ts → auto-height/react.d.ts} +2 -4
- package/dist/components/auto-height/react.js +75 -0
- package/dist/components/auto-height/schema.d.ts +7 -0
- package/dist/components/bulk-list-input/classes.d.ts +7 -0
- package/dist/components/bulk-list-input/html.d.ts +41 -0
- package/dist/components/bulk-list-input/html.js +265 -0
- package/dist/components/bulk-list-input/index.d.ts +76 -0
- package/dist/components/bulk-list-input/react.d.ts +12 -0
- package/dist/components/{ui/bulk-list-input.js → bulk-list-input/react.js} +71 -4
- package/dist/components/bulk-list-input/schema.d.ts +33 -0
- package/dist/components/choice-cards/classes.d.ts +19 -0
- package/dist/components/choice-cards/html.d.ts +76 -0
- package/dist/components/choice-cards/html.js +237 -0
- package/dist/components/choice-cards/index.d.ts +1 -0
- package/dist/components/choice-cards/react.d.ts +21 -0
- package/dist/components/{ui/choice-cards.js → choice-cards/react.js} +29 -10
- package/dist/components/choice-cards/schema.d.ts +100 -0
- package/dist/components/code-block/classes.d.ts +13 -0
- package/dist/components/code-block/html.d.ts +21 -0
- package/dist/components/code-block/html.js +381 -0
- package/dist/components/code-block/index.d.ts +4 -0
- package/dist/components/code-block/react.d.ts +4 -0
- package/dist/components/{ui/code-block.js → code-block/react.js} +168 -50
- package/dist/components/code-block/schema.d.ts +29 -0
- package/dist/components/color-input/classes.d.ts +9 -0
- package/dist/components/color-input/html.d.ts +48 -0
- package/dist/components/color-input/html.js +187 -0
- package/dist/components/color-input/index.d.ts +88 -0
- package/dist/components/color-input/react.d.ts +7 -0
- package/dist/components/{ui/color-picker.js → color-input/react.js} +165 -233
- package/dist/components/color-input/schema.d.ts +40 -0
- package/dist/components/copy-button/html.d.ts +48 -0
- package/dist/components/copy-button/html.js +266 -0
- package/dist/components/copy-button/index.d.ts +73 -0
- package/dist/components/copy-button/react.d.ts +12 -0
- package/dist/components/copy-button/react.js +234 -0
- package/dist/components/copy-button/schema.d.ts +37 -0
- package/dist/components/copy-value/html.d.ts +37 -0
- package/dist/components/copy-value/html.js +426 -0
- package/dist/components/copy-value/index.d.ts +57 -0
- package/dist/components/copy-value/react.d.ts +9 -0
- package/dist/components/{ui/copy-value.js → copy-value/react.js} +243 -65
- package/dist/components/copy-value/schema.d.ts +45 -0
- package/dist/components/cron-input/classes.d.ts +25 -0
- package/dist/components/cron-input/html.d.ts +36 -0
- package/dist/components/cron-input/html.js +204 -0
- package/dist/components/cron-input/index.d.ts +59 -0
- package/dist/components/cron-input/react.d.ts +7 -0
- package/dist/components/{ui/cron-expression-editor.js → cron-input/react.js} +126 -54
- package/dist/components/cron-input/schema.d.ts +24 -0
- package/dist/components/danger-confirmation/classes.d.ts +7 -0
- package/dist/components/danger-confirmation/html.d.ts +39 -0
- package/dist/components/danger-confirmation/html.js +227 -0
- package/dist/components/danger-confirmation/index.d.ts +113 -0
- package/dist/components/{ui/danger-confirmation.d.ts → danger-confirmation/react.d.ts} +3 -12
- package/dist/components/{ui/danger-confirmation.js → danger-confirmation/react.js} +203 -205
- package/dist/components/danger-confirmation/schema.d.ts +34 -0
- package/dist/components/data-table/classes.d.ts +63 -0
- package/dist/components/data-table/html.d.ts +1938 -0
- package/dist/components/data-table/html.js +2682 -0
- package/dist/components/data-table/index.d.ts +2686 -0
- package/dist/components/data-table/react.d.ts +578 -0
- package/dist/components/{ui/data-table.js → data-table/react.js} +1958 -835
- package/dist/components/data-table/schema.d.ts +3012 -0
- package/dist/components/date-input/classes.d.ts +17 -0
- package/dist/components/date-input/html.d.ts +60 -0
- package/dist/components/date-input/html.js +418 -0
- package/dist/components/date-input/index.d.ts +91 -0
- package/dist/components/date-input/react.d.ts +10 -0
- package/dist/components/{ui/date-picker.js → date-input/react.js} +233 -79
- package/dist/components/date-input/schema.d.ts +41 -0
- package/dist/components/editable-text/classes.d.ts +17 -0
- package/dist/components/editable-text/html.d.ts +51 -0
- package/dist/components/editable-text/html.js +370 -0
- package/dist/components/editable-text/index.d.ts +143 -0
- package/dist/components/editable-text/react.d.ts +6 -0
- package/dist/components/editable-text/react.js +345 -0
- package/dist/components/editable-text/schema.d.ts +31 -0
- package/dist/components/editing-locale-switcher/classes.d.ts +7 -0
- package/dist/components/editing-locale-switcher/html.d.ts +27 -0
- package/dist/components/editing-locale-switcher/html.js +250 -0
- package/dist/components/editing-locale-switcher/index.d.ts +52 -0
- package/dist/components/editing-locale-switcher/react.d.ts +7 -0
- package/dist/components/{ui/editing-locale-switcher.js → editing-locale-switcher/react.js} +63 -10
- package/dist/components/editing-locale-switcher/schema.d.ts +16 -0
- package/dist/components/{ui/effect-form.d.ts → effect-form/react.d.ts} +2 -2
- package/dist/components/{ui/effect-form.js → effect-form/react.js} +302 -76
- package/dist/components/effectcn/alert-dialog.d.ts +13 -0
- package/dist/components/effectcn/button.d.ts +31 -0
- package/dist/components/effectcn/calendar.d.ts +12 -0
- package/dist/components/effectcn/checkbox.d.ts +10 -0
- package/dist/components/effectcn/combobox.d.ts +25 -0
- package/dist/components/effectcn/dialog.d.ts +19 -0
- package/dist/components/effectcn/field.d.ts +11 -0
- package/dist/components/effectcn/file-drop.d.ts +8 -0
- package/dist/components/effectcn/input.d.ts +26 -0
- package/dist/components/effectcn/menu.d.ts +85 -0
- package/dist/components/effectcn/menubar.d.ts +8 -0
- package/dist/components/effectcn/popover.d.ts +18 -0
- package/dist/components/effectcn/scroll-area.d.ts +12 -0
- package/dist/components/effectcn/select.d.ts +68 -0
- package/dist/components/effectcn/toast.d.ts +29 -0
- package/dist/components/email-composer/index.d.ts +229 -0
- package/dist/components/email-composer/labels.d.ts +12 -0
- package/dist/components/email-composer/react.d.ts +5 -0
- package/dist/components/{ui/email-composer.js → email-composer/react.js} +461 -127
- package/dist/components/email-composer/schema.d.ts +42 -0
- package/dist/components/email-editor/classes.d.ts +21 -0
- package/dist/components/email-editor/html.d.ts +360 -0
- package/dist/components/email-editor/html.js +1706 -0
- package/dist/components/email-editor/index.d.ts +693 -0
- package/dist/components/{ui/email-editor.d.ts → email-editor/labels.d.ts} +1 -21
- package/dist/components/email-editor/legacy-editor.html.d.ts +160 -0
- package/dist/components/email-editor/react.d.ts +11 -0
- package/dist/components/{ui/email-editor.js → email-editor/react.js} +600 -230
- package/dist/components/email-editor/schema.d.ts +162 -0
- package/dist/components/error-component/classes.d.ts +7 -0
- package/dist/components/error-component/html.d.ts +120 -0
- package/dist/components/error-component/html.js +346 -0
- package/dist/components/error-component/index.d.ts +69 -0
- package/dist/components/error-component/react.d.ts +8 -0
- package/dist/components/{ui/error-component.js → error-component/react.js} +281 -78
- package/dist/components/error-component/schema.d.ts +56 -0
- package/dist/components/file-input/classes.d.ts +7 -0
- package/dist/components/file-input/html.d.ts +95 -0
- package/dist/components/file-input/html.js +368 -0
- package/dist/components/file-input/index.d.ts +99 -0
- package/dist/components/file-input/react.d.ts +11 -0
- package/dist/components/{ui/file-picker.js → file-input/react.js} +122 -19
- package/dist/components/file-input/schema.d.ts +37 -0
- package/dist/components/{ui/form.d.ts → form/react.d.ts} +7 -7
- package/dist/components/{ui/form.js → form/react.js} +300 -74
- package/dist/components/icon-input/html.d.ts +55 -0
- package/dist/components/icon-input/html.js +538 -0
- package/dist/components/icon-input/index.d.ts +143 -0
- package/dist/components/icon-input/react.d.ts +6 -0
- package/dist/components/{ui/icon-input.js → icon-input/react.js} +305 -89
- package/dist/components/icon-input/schema.d.ts +23 -0
- package/dist/components/image-crop-editor/classes.d.ts +19 -0
- package/dist/components/image-crop-editor/html.d.ts +66 -0
- package/dist/components/image-crop-editor/html.js +561 -0
- package/dist/components/image-crop-editor/index.d.ts +183 -0
- package/dist/components/image-crop-editor/react.d.ts +8 -0
- package/dist/components/image-crop-editor/react.js +648 -0
- package/dist/components/image-crop-editor/schema.d.ts +54 -0
- package/dist/components/krakstack-provider/html.d.ts +17 -0
- package/dist/components/krakstack-provider/html.js +37 -0
- package/dist/components/krakstack-provider/index.d.ts +7 -0
- package/dist/components/krakstack-provider/react.d.ts +8 -0
- package/dist/components/{ui/krakstack-provider.js → krakstack-provider/react.js} +14 -5
- package/dist/components/krakstack-provider/schema.d.ts +6 -0
- package/dist/components/loading/classes.d.ts +5 -0
- package/dist/components/loading/html.d.ts +18 -0
- package/dist/components/loading/html.js +166 -0
- package/dist/components/loading/index.d.ts +6 -0
- package/dist/components/loading/react.d.ts +4 -0
- package/dist/components/loading/react.js +51 -0
- package/dist/components/loading/schema.d.ts +23 -0
- package/dist/components/locale-switcher/html.d.ts +22 -0
- package/dist/components/locale-switcher/html.js +264 -0
- package/dist/components/locale-switcher/index.d.ts +50 -0
- package/dist/components/locale-switcher/react.d.ts +7 -0
- package/dist/components/{ui/locale-switcher.js → locale-switcher/react.js} +55 -22
- package/dist/components/locale-switcher/schema.d.ts +12 -0
- package/dist/components/map-menu/classes.d.ts +13 -0
- package/dist/components/map-menu/google-maps.d.ts +80 -0
- package/dist/components/map-menu/google-viewport.d.ts +7 -0
- package/dist/components/map-menu/html.d.ts +274 -0
- package/dist/components/map-menu/html.js +934 -0
- package/dist/components/map-menu/index.d.ts +246 -0
- package/dist/components/map-menu/map.d.ts +47 -0
- package/dist/components/map-menu/react.d.ts +40 -0
- package/dist/components/{ui/map-menu.js → map-menu/react.js} +321 -83
- package/dist/components/map-menu/schema.d.ts +132 -0
- package/dist/components/markdown/classes.d.ts +1 -0
- package/dist/components/markdown/html.d.ts +23 -0
- package/dist/components/markdown/html.js +510 -0
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/react.d.ts +3 -0
- package/dist/components/markdown/react.js +392 -0
- package/dist/components/markdown/schema.d.ts +20 -0
- package/dist/components/notification-menu/classes.d.ts +11 -0
- package/dist/components/notification-menu/html.d.ts +67 -0
- package/dist/components/notification-menu/html.js +425 -0
- package/dist/components/notification-menu/index.d.ts +132 -0
- package/dist/components/notification-menu/react.d.ts +57 -0
- package/dist/components/notification-menu/react.js +829 -0
- package/dist/components/notification-menu/schema.d.ts +59 -0
- package/dist/components/pagination/classes.d.ts +19 -0
- package/dist/components/pagination/html.d.ts +49 -0
- package/dist/components/pagination/html.js +387 -0
- package/dist/components/pagination/index.d.ts +109 -0
- package/dist/components/pagination/react.d.ts +9 -0
- package/dist/components/{ui/pagination.js → pagination/react.js} +123 -23
- package/dist/components/pagination/schema.d.ts +36 -0
- package/dist/components/phone-number-input/classes.d.ts +17 -0
- package/dist/components/phone-number-input/html.d.ts +52 -0
- package/dist/components/phone-number-input/html.js +655 -0
- package/dist/components/phone-number-input/index.d.ts +59 -0
- package/dist/components/phone-number-input/react.d.ts +11 -0
- package/dist/components/{ui/phone-number-input.js → phone-number-input/react.js} +368 -138
- package/dist/components/phone-number-input/schema.d.ts +31 -0
- package/dist/components/presence-transition/html.d.ts +13 -0
- package/dist/components/presence-transition/html.js +128 -0
- package/dist/components/presence-transition/index.d.ts +57 -0
- package/dist/components/{ui/presence-transition.d.ts → presence-transition/react.d.ts} +3 -5
- package/dist/components/presence-transition/react.js +139 -0
- package/dist/components/presence-transition/schema.d.ts +7 -0
- package/dist/components/registry-previews/component-example.d.ts +31 -0
- package/dist/components/registry-previews/component-example.js +525 -0
- package/dist/components/registry-previews/html-preview.d.ts +17 -0
- package/dist/components/registry-previews/html-preview.js +83 -0
- package/dist/components/rich-text-editor/classes.d.ts +15 -0
- package/dist/components/rich-text-editor/engine.d.ts +9 -0
- package/dist/components/rich-text-editor/html.d.ts +246 -0
- package/dist/components/rich-text-editor/html.js +830 -0
- package/dist/components/rich-text-editor/index.d.ts +453 -0
- package/dist/components/rich-text-editor/labels.d.ts +42 -0
- package/dist/components/rich-text-editor/react.d.ts +19 -0
- package/dist/components/{ui/rich-text-editor.js → rich-text-editor/react.js} +365 -96
- package/dist/components/rich-text-editor/schema.d.ts +116 -0
- package/dist/components/search-menu/classes.d.ts +9 -0
- package/dist/components/search-menu/html.d.ts +127 -0
- package/dist/components/search-menu/html.js +432 -0
- package/dist/components/search-menu/index.d.ts +85 -0
- package/dist/components/search-menu/react.d.ts +18 -0
- package/dist/components/{ui/search-menu.js → search-menu/react.js} +128 -23
- package/dist/components/search-menu/schema.d.ts +78 -0
- package/dist/components/select-with-custom-input/classes.d.ts +17 -0
- package/dist/components/select-with-custom-input/html.d.ts +60 -0
- package/dist/components/select-with-custom-input/html.js +238 -0
- package/dist/components/select-with-custom-input/index.d.ts +114 -0
- package/dist/components/select-with-custom-input/react.d.ts +7 -0
- package/dist/components/{ui/select-with-custom-input.js → select-with-custom-input/react.js} +127 -22
- package/dist/components/select-with-custom-input/schema.d.ts +54 -0
- package/dist/components/sidebar-layout/classes.d.ts +21 -0
- package/dist/components/sidebar-layout/html.d.ts +97 -0
- package/dist/components/sidebar-layout/html.js +361 -0
- package/dist/components/sidebar-layout/index.d.ts +57 -0
- package/dist/components/sidebar-layout/react.d.ts +30 -0
- package/dist/components/{ui/sidebar-layout.js → sidebar-layout/react.js} +199 -39
- package/dist/components/sidebar-layout/schema.d.ts +54 -0
- package/dist/components/stats-card/classes.d.ts +11 -0
- package/dist/components/stats-card/html.d.ts +15 -0
- package/dist/components/stats-card/html.js +55 -0
- package/dist/components/stats-card/react.d.ts +7 -0
- package/dist/components/{ui/stats-card.js → stats-card/react.js} +19 -15
- package/dist/components/stats-card/schema.d.ts +14 -0
- package/dist/components/stepper/classes.d.ts +39 -0
- package/dist/components/stepper/html.d.ts +107 -0
- package/dist/components/stepper/html.js +397 -0
- package/dist/components/stepper/index.d.ts +83 -0
- package/dist/components/stepper/react.d.ts +17 -0
- package/dist/components/{ui/stepper.js → stepper/react.js} +120 -21
- package/dist/components/stepper/schema.d.ts +52 -0
- package/dist/components/support/classes.d.ts +55 -0
- package/dist/components/support/form.d.ts +19 -0
- package/dist/components/support/html.d.ts +266 -0
- package/dist/components/support/html.js +604 -0
- package/dist/components/support/index.d.ts +226 -0
- package/dist/components/support/multipart.d.ts +21 -0
- package/dist/components/support/react.d.ts +54 -0
- package/dist/components/support/react.js +1098 -0
- package/dist/components/support/schema.d.ts +69 -0
- package/dist/components/support.d.ts +1 -66
- package/dist/components/theme-switcher/html.d.ts +28 -0
- package/dist/components/theme-switcher/html.js +288 -0
- package/dist/components/theme-switcher/index.d.ts +59 -0
- package/dist/components/{ui/theme-switcher.d.ts → theme-switcher/react.d.ts} +4 -12
- package/dist/components/{ui/theme-switcher.js → theme-switcher/react.js} +69 -35
- package/dist/components/theme-switcher/schema.d.ts +33 -0
- package/dist/components/time-input/classes.d.ts +23 -0
- package/dist/components/time-input/html.d.ts +75 -0
- package/dist/components/time-input/html.js +571 -0
- package/dist/components/time-input/index.d.ts +164 -0
- package/dist/components/time-input/react.d.ts +7 -0
- package/dist/components/{ui/time-picker.js → time-input/react.js} +286 -114
- package/dist/components/time-input/schema.d.ts +96 -0
- package/dist/components/timezone-input/classes.d.ts +13 -0
- package/dist/components/timezone-input/html.d.ts +58 -0
- package/dist/components/timezone-input/html.js +804 -0
- package/dist/components/timezone-input/index.d.ts +170 -0
- package/dist/components/timezone-input/react.d.ts +9 -0
- package/dist/components/{ui/timezone-select.js → timezone-input/react.js} +337 -104
- package/dist/components/timezone-input/schema.d.ts +43 -0
- package/dist/components/toast/classes.d.ts +7 -0
- package/dist/components/toast/html.d.ts +34 -0
- package/dist/components/toast/html.js +280 -0
- package/dist/components/toast/index.d.ts +10 -0
- package/dist/components/toast/react.d.ts +9 -0
- package/dist/components/{ui/toast.js → toast/react.js} +35 -15
- package/dist/components/toast/schema.d.ts +24 -0
- package/dist/{services/events/client/tracking-notice.d.ts → components/tracking-notice/react.d.ts} +7 -1
- package/dist/{services/events/client/tracking-notice.js → components/tracking-notice/react.js} +13 -7
- package/dist/components/ui/animated-list.d.ts +1 -21
- package/dist/components/ui/app-brand.d.ts +1 -33
- package/dist/components/ui/async-action-button.d.ts +1 -17
- package/dist/components/ui/code-block.d.ts +1 -14
- package/dist/components/ui/copy-button.d.ts +1 -21
- package/dist/components/ui/data-table.d.ts +1 -584
- package/dist/components/ui/krakstack-provider.d.ts +1 -9
- package/dist/components/ui/loading.d.ts +1 -13
- package/dist/components/ui/pagination.d.ts +1 -47
- package/dist/components/ui/rich-text-editor.d.ts +1 -72
- package/dist/components/ui/search-menu.d.ts +1 -36
- package/dist/components/ui/sidebar-layout.d.ts +1 -40
- package/dist/components/ui/virtualized-combobox.d.ts +1 -59
- package/dist/components/unsaved-changes-guard/html.d.ts +34 -0
- package/dist/components/unsaved-changes-guard/html.js +172 -0
- package/dist/components/unsaved-changes-guard/index.d.ts +56 -0
- package/dist/components/unsaved-changes-guard/react.d.ts +4 -0
- package/dist/components/{ui/unsaved-changes-guard.js → unsaved-changes-guard/react.js} +74 -11
- package/dist/components/unsaved-changes-guard/schema.d.ts +37 -0
- package/dist/components/upload-attachment/classes.d.ts +11 -0
- package/dist/components/upload-attachment/html.d.ts +84 -0
- package/dist/components/upload-attachment/html.js +312 -0
- package/dist/components/upload-attachment/index.d.ts +72 -0
- package/dist/components/upload-attachment/react.d.ts +9 -0
- package/dist/components/{ui/upload-attachment.js → upload-attachment/react.js} +114 -17
- package/dist/components/upload-attachment/schema.d.ts +53 -0
- package/dist/components/virtualized-combobox/classes.d.ts +7 -0
- package/dist/components/virtualized-combobox/html.d.ts +97 -0
- package/dist/components/virtualized-combobox/html.js +310 -0
- package/dist/components/virtualized-combobox/index.d.ts +182 -0
- package/dist/components/virtualized-combobox/react.d.ts +31 -0
- package/dist/components/{ui/virtualized-combobox.js → virtualized-combobox/react.js} +160 -40
- package/dist/components/virtualized-combobox/schema.d.ts +92 -0
- package/dist/components/webhook-delivery-table/html.d.ts +216 -0
- package/dist/components/webhook-delivery-table/html.js +3008 -0
- package/dist/components/webhook-delivery-table/index.d.ts +405 -0
- package/dist/components/webhook-delivery-table/react.d.ts +13 -0
- package/dist/{services/webhooks/client/delivery-table.js → components/webhook-delivery-table/react.js} +2278 -917
- package/dist/components/webhook-delivery-table/schema.d.ts +134 -0
- package/dist/lib/docs.d.ts +17 -1
- package/dist/lib/docs.integrations.server.js +341 -75
- package/dist/lib/docs.js +715 -299
- package/dist/lib/docs.server.js +325 -59
- package/dist/lib/documentation-toolkit.d.ts +4 -4
- package/dist/lib/documentation-toolkit.js +337 -71
- package/dist/lib/effect-ui-adapter/model-runtime.d.ts +17 -0
- package/dist/lib/effect-ui-adapter/use-model.d.ts +9 -0
- package/dist/lib/effect-ui-adapter/use-model.js +158 -0
- package/dist/lib/effectcn-form.d.ts +3 -0
- package/dist/lib/effectcn-form.js +54 -0
- package/dist/lib/email-composer/index.d.ts +12 -0
- package/dist/lib/email-composer/schema.d.ts +14 -0
- package/dist/lib/httpapi-toolkit.d.ts +1 -1
- package/dist/lib/lucide-effect.d.ts +39 -0
- package/dist/lib/markdown/content.d.ts +1 -12
- package/dist/lib/rich-text/model.d.ts +5 -0
- package/dist/lib/webfetch-toolkit.d.ts +1 -1
- package/dist/services/agent/client/index.js +530 -168
- package/dist/services/agent/client/widget.d.ts +1 -55
- package/dist/services/notification/client/index.js +138 -27
- package/dist/services/notification/client/notification-menu.d.ts +1 -85
- package/dist/services/notification/public.js +138 -27
- package/dist/services/opentelemetry/browser.js +15 -9
- package/dist/services/webhooks/index.d.ts +4 -3
- package/package.json +185 -142
- package/dist/components/support-dialog.js +0 -881
- package/dist/components/support.js +0 -881
- package/dist/components/ui/animated-number.js +0 -75
- package/dist/components/ui/app-brand.js +0 -126
- package/dist/components/ui/app-switcher.d.ts +0 -26
- package/dist/components/ui/async-action-button.js +0 -149
- package/dist/components/ui/auto-height.js +0 -86
- package/dist/components/ui/bulk-list-input.d.ts +0 -25
- package/dist/components/ui/choice-cards.d.ts +0 -33
- package/dist/components/ui/color-picker.d.ts +0 -31
- package/dist/components/ui/copy-button.js +0 -138
- package/dist/components/ui/copy-value.d.ts +0 -24
- package/dist/components/ui/cron-expression-editor.d.ts +0 -16
- package/dist/components/ui/cron-expression-editor.schema.d.ts +0 -7
- package/dist/components/ui/date-picker.d.ts +0 -33
- package/dist/components/ui/date-picker.schema.d.ts +0 -9
- package/dist/components/ui/editable-text.d.ts +0 -19
- package/dist/components/ui/editable-text.js +0 -341
- package/dist/components/ui/editing-locale-switcher.d.ts +0 -11
- package/dist/components/ui/error-component.d.ts +0 -34
- package/dist/components/ui/file-picker.d.ts +0 -37
- package/dist/components/ui/icon-input.d.ts +0 -58
- package/dist/components/ui/image-crop-editor.d.ts +0 -41
- package/dist/components/ui/image-crop-editor.js +0 -417
- package/dist/components/ui/loading.js +0 -39
- package/dist/components/ui/locale-switcher.d.ts +0 -11
- package/dist/components/ui/map-menu-map.d.ts +0 -115
- package/dist/components/ui/map-menu.d.ts +0 -87
- package/dist/components/ui/phone-number-input.d.ts +0 -22
- package/dist/components/ui/phone-number-input.schema.d.ts +0 -7
- package/dist/components/ui/presence-transition.js +0 -94
- package/dist/components/ui/select-with-custom-input.d.ts +0 -36
- package/dist/components/ui/stats-card.d.ts +0 -12
- package/dist/components/ui/stepper.d.ts +0 -37
- package/dist/components/ui/time-picker.d.ts +0 -50
- package/dist/components/ui/time-picker.schema.d.ts +0 -28
- package/dist/components/ui/timezone-select.d.ts +0 -57
- package/dist/components/ui/timezone-select.schema.d.ts +0 -9
- package/dist/components/ui/toast.d.ts +0 -18
- package/dist/components/ui/unsaved-changes-guard.d.ts +0 -16
- package/dist/components/ui/upload-attachment.d.ts +0 -39
- package/dist/services/notification/persistence/drizzle.d.ts +0 -868
- package/dist/services/notification/persistence/drizzle.js +0 -214
- package/dist/services/notification/persistence/index.d.ts +0 -2
- package/dist/services/notification/persistence/index.js +0 -227
- package/dist/services/notification/persistence/schema.d.ts +0 -143
- package/dist/services/notification/persistence/schema.js +0 -118
- package/dist/services/webhooks/client/delivery-table.d.ts +0 -62
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
// ../../src/components/
|
|
2
|
-
import { Schema as
|
|
1
|
+
// ../../src/components/rich-text-editor/react.tsx
|
|
2
|
+
import { Schema as Schema6 } from "effect";
|
|
3
3
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
4
|
-
import { EditorState } from "@tiptap/pm/state";
|
|
5
|
-
import { closeHistory } from "@tiptap/pm/history";
|
|
6
4
|
import { renderToReactElement } from "@tiptap/static-renderer/pm/react";
|
|
7
5
|
import {
|
|
8
6
|
useEffect,
|
|
9
7
|
useEffectEvent,
|
|
10
|
-
useId
|
|
11
|
-
useState
|
|
8
|
+
useId
|
|
12
9
|
} from "react";
|
|
13
10
|
import {
|
|
14
11
|
Bold,
|
|
@@ -251,8 +248,8 @@ function DropdownMenuItem({
|
|
|
251
248
|
});
|
|
252
249
|
}
|
|
253
250
|
|
|
254
|
-
// ../../src/components/
|
|
255
|
-
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
251
|
+
// ../../src/components/rich-text-editor/react.tsx
|
|
252
|
+
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
256
253
|
|
|
257
254
|
// ../../src/lib/rich-text/schema.ts
|
|
258
255
|
import { Schema } from "effect";
|
|
@@ -348,9 +345,65 @@ var richTextValidation = ({
|
|
|
348
345
|
]
|
|
349
346
|
});
|
|
350
347
|
|
|
351
|
-
// ../../src/components/
|
|
352
|
-
import {
|
|
353
|
-
|
|
348
|
+
// ../../src/components/rich-text-editor/react.tsx
|
|
349
|
+
import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
350
|
+
|
|
351
|
+
// ../../src/components/rich-text-editor/classes.ts
|
|
352
|
+
var richTextEditorClasses = {
|
|
353
|
+
toolbar: "bg-muted/30 flex flex-wrap items-center gap-1 border-b p-2",
|
|
354
|
+
linkForm: "flex flex-wrap items-end gap-2 border-b p-3",
|
|
355
|
+
linkField: "grid min-w-0 flex-1 gap-1 text-xs",
|
|
356
|
+
linkError: "text-destructive w-full text-xs",
|
|
357
|
+
editorError: "text-destructive px-4 pb-3 text-xs"
|
|
358
|
+
};
|
|
359
|
+
var resolveRichTextEditorClasses = (overrides) => ({
|
|
360
|
+
...richTextEditorClasses,
|
|
361
|
+
...overrides
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
// ../../src/components/rich-text-editor/index.ts
|
|
365
|
+
import { Schema as Schema4 } from "effect";
|
|
366
|
+
import { Component, UiSchema, View } from "effect/ui";
|
|
367
|
+
|
|
368
|
+
// ../../src/components/rich-text-editor/schema.ts
|
|
369
|
+
import { Schema as Schema3, Struct } from "effect";
|
|
370
|
+
var RichTextEditorMessageFields = {
|
|
371
|
+
bold: Schema3.String,
|
|
372
|
+
italic: Schema3.String,
|
|
373
|
+
underline: Schema3.String,
|
|
374
|
+
undo: Schema3.String,
|
|
375
|
+
redo: Schema3.String,
|
|
376
|
+
link: Schema3.String,
|
|
377
|
+
unlink: Schema3.String,
|
|
378
|
+
linkUrl: Schema3.String,
|
|
379
|
+
apply: Schema3.String,
|
|
380
|
+
cancel: Schema3.String,
|
|
381
|
+
variable: Schema3.String,
|
|
382
|
+
paragraph: Schema3.String,
|
|
383
|
+
heading: Schema3.String,
|
|
384
|
+
bullet: Schema3.String,
|
|
385
|
+
numbered: Schema3.String,
|
|
386
|
+
toolbar: Schema3.String,
|
|
387
|
+
invalid: Schema3.String,
|
|
388
|
+
invalidLink: Schema3.String
|
|
389
|
+
};
|
|
390
|
+
var RichTextEditorCopy = Schema3.Struct(RichTextEditorMessageFields);
|
|
391
|
+
var RichTextEditorClassesOverridesSchema = Schema3.Record(Schema3.Literals(Struct.keys(richTextEditorClasses)), Schema3.optionalKey(Schema3.String)).annotate({ identifier: "RichTextEditorClassesOverrides" });
|
|
392
|
+
var RichTextEditorFields = {
|
|
393
|
+
classes: Schema3.optional(RichTextEditorClassesOverridesSchema),
|
|
394
|
+
value: RichTextDocument,
|
|
395
|
+
label: Schema3.String,
|
|
396
|
+
variables: Schema3.optional(Schema3.Array(RichTextVariable)),
|
|
397
|
+
disabled: Schema3.optional(Schema3.Boolean),
|
|
398
|
+
locale: Schema3.optional(Schema3.String),
|
|
399
|
+
messages: Schema3.optional(Schema3.Record(Schema3.String, Schema3.UndefinedOr(Schema3.Struct(Struct.map(RichTextEditorMessageFields, Schema3.optional))))),
|
|
400
|
+
className: Schema3.optional(Schema3.String),
|
|
401
|
+
maxLength: Schema3.optional(Schema3.Number)
|
|
402
|
+
};
|
|
403
|
+
var RichTextEditorPropsSchema = Schema3.Struct(RichTextEditorFields).annotate({ identifier: "RichTextEditorProps" });
|
|
404
|
+
|
|
405
|
+
// ../../src/components/rich-text-editor/labels.ts
|
|
406
|
+
var defaultMessages = {
|
|
354
407
|
en: {
|
|
355
408
|
bold: "Bold",
|
|
356
409
|
italic: "Italic",
|
|
@@ -392,7 +445,249 @@ var labels = {
|
|
|
392
445
|
invalidLink: "Saisissez un lien HTTPS ou mailto."
|
|
393
446
|
}
|
|
394
447
|
};
|
|
448
|
+
|
|
449
|
+
// ../../src/components/rich-text-editor/index.ts
|
|
450
|
+
var richTextEditorMessages = (locale, messages) => ({
|
|
451
|
+
...locale.startsWith("fr") ? defaultMessages.fr : defaultMessages.en,
|
|
452
|
+
...messages?.[locale.split("-")[0] ?? locale],
|
|
453
|
+
...messages?.[locale]
|
|
454
|
+
});
|
|
455
|
+
var EditorAction = UiSchema.TaggedEnum({
|
|
456
|
+
Format: {
|
|
457
|
+
kind: Schema4.Literals([
|
|
458
|
+
"bold",
|
|
459
|
+
"italic",
|
|
460
|
+
"underline",
|
|
461
|
+
"paragraph",
|
|
462
|
+
"heading",
|
|
463
|
+
"bullet",
|
|
464
|
+
"numbered",
|
|
465
|
+
"undo",
|
|
466
|
+
"redo",
|
|
467
|
+
"unlink"
|
|
468
|
+
])
|
|
469
|
+
},
|
|
470
|
+
Insert: { key: Schema4.String },
|
|
471
|
+
Link: { href: RichTextLink }
|
|
472
|
+
}).annotate({ identifier: "RichTextEditorAction" });
|
|
473
|
+
var EditorStatus = Schema4.Struct({
|
|
474
|
+
ready: Schema4.Boolean,
|
|
475
|
+
undo: Schema4.Boolean,
|
|
476
|
+
redo: Schema4.Boolean,
|
|
477
|
+
bold: Schema4.Boolean,
|
|
478
|
+
italic: Schema4.Boolean,
|
|
479
|
+
underline: Schema4.Boolean,
|
|
480
|
+
block: Schema4.Literals(["paragraph", "heading", "bullet", "numbered"]),
|
|
481
|
+
href: Schema4.NullOr(Schema4.String)
|
|
482
|
+
});
|
|
483
|
+
var RichTextEditorEvents = UiSchema.TaggedEnum({
|
|
484
|
+
Changed: { value: RichTextDocument }
|
|
485
|
+
}).annotate({ identifier: "RichTextEditorEvents" });
|
|
486
|
+
var RichTextEditorMessage = UiSchema.TaggedEnum({
|
|
487
|
+
Changed: { value: RichTextDocument },
|
|
488
|
+
Status: { status: EditorStatus },
|
|
489
|
+
Invalid: { invalid: Schema4.Boolean },
|
|
490
|
+
Replaced: {},
|
|
491
|
+
SetToolbarPopup: {
|
|
492
|
+
popup: Schema4.Literals(["block", "variable"]),
|
|
493
|
+
open: Schema4.Boolean
|
|
494
|
+
},
|
|
495
|
+
ToggleLink: {},
|
|
496
|
+
EditLink: { link: Schema4.String },
|
|
497
|
+
ApplyLink: {},
|
|
498
|
+
CloseLink: {},
|
|
499
|
+
Action: { action: EditorAction }
|
|
500
|
+
}).annotate({ identifier: "RichTextEditorMessage" });
|
|
501
|
+
var modelOptions = {
|
|
502
|
+
name: "RichTextEditor",
|
|
503
|
+
props: RichTextEditorPropsSchema,
|
|
504
|
+
model: Schema4.Struct({
|
|
505
|
+
status: EditorStatus,
|
|
506
|
+
invalid: Schema4.Boolean,
|
|
507
|
+
toolbarPopup: Schema4.NullOr(Schema4.Literals(["block", "variable"])),
|
|
508
|
+
linkOpen: Schema4.Boolean,
|
|
509
|
+
link: Schema4.String,
|
|
510
|
+
linkError: Schema4.Boolean,
|
|
511
|
+
request: Schema4.NullOr(Schema4.Struct({ serial: Schema4.Int, action: EditorAction }))
|
|
512
|
+
}).annotate({ identifier: "RichTextEditorModel" }),
|
|
513
|
+
message: RichTextEditorMessage,
|
|
514
|
+
restore: false
|
|
515
|
+
};
|
|
516
|
+
var richTextEditorOptions = {
|
|
517
|
+
...modelOptions,
|
|
518
|
+
events: RichTextEditorEvents
|
|
519
|
+
};
|
|
520
|
+
var transition = (model, message, disabled) => {
|
|
521
|
+
switch (message._tag) {
|
|
522
|
+
case "Changed":
|
|
523
|
+
return model;
|
|
524
|
+
case "Status":
|
|
525
|
+
return { ...model, status: message.status };
|
|
526
|
+
case "Invalid":
|
|
527
|
+
return { ...model, invalid: message.invalid };
|
|
528
|
+
case "Replaced":
|
|
529
|
+
return { ...model, invalid: false, toolbarPopup: null, linkOpen: false };
|
|
530
|
+
case "SetToolbarPopup":
|
|
531
|
+
return {
|
|
532
|
+
...model,
|
|
533
|
+
toolbarPopup: disabled ? null : message.open ? message.popup : model.toolbarPopup === message.popup ? null : model.toolbarPopup
|
|
534
|
+
};
|
|
535
|
+
case "ToggleLink":
|
|
536
|
+
return {
|
|
537
|
+
...model,
|
|
538
|
+
linkOpen: !model.linkOpen,
|
|
539
|
+
link: model.status.href ?? "",
|
|
540
|
+
linkError: false
|
|
541
|
+
};
|
|
542
|
+
case "EditLink":
|
|
543
|
+
return { ...model, link: message.link };
|
|
544
|
+
case "ApplyLink":
|
|
545
|
+
if (disabled)
|
|
546
|
+
return model;
|
|
547
|
+
if (!Schema4.is(RichTextLink)(model.link))
|
|
548
|
+
return { ...model, linkError: true };
|
|
549
|
+
return {
|
|
550
|
+
...model,
|
|
551
|
+
linkOpen: false,
|
|
552
|
+
request: {
|
|
553
|
+
serial: (model.request?.serial ?? 0) + 1,
|
|
554
|
+
action: EditorAction.Link({ href: model.link })
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
case "CloseLink":
|
|
558
|
+
return { ...model, linkOpen: false };
|
|
559
|
+
case "Action":
|
|
560
|
+
if (disabled)
|
|
561
|
+
return model;
|
|
562
|
+
return {
|
|
563
|
+
...model,
|
|
564
|
+
linkOpen: message.action._tag === "Format" && message.action.kind === "unlink" ? false : model.linkOpen,
|
|
565
|
+
request: {
|
|
566
|
+
serial: (model.request?.serial ?? 0) + 1,
|
|
567
|
+
action: message.action
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
var update = ($, message) => transition($.model, message, $.props.disabled);
|
|
573
|
+
var richTextEditorBehaviours = {
|
|
574
|
+
init: () => ({
|
|
575
|
+
status: {
|
|
576
|
+
ready: false,
|
|
577
|
+
undo: false,
|
|
578
|
+
redo: false,
|
|
579
|
+
bold: false,
|
|
580
|
+
italic: false,
|
|
581
|
+
underline: false,
|
|
582
|
+
block: "paragraph",
|
|
583
|
+
href: null
|
|
584
|
+
},
|
|
585
|
+
invalid: false,
|
|
586
|
+
toolbarPopup: null,
|
|
587
|
+
linkOpen: false,
|
|
588
|
+
link: "",
|
|
589
|
+
linkError: false,
|
|
590
|
+
request: null
|
|
591
|
+
}),
|
|
592
|
+
update
|
|
593
|
+
};
|
|
594
|
+
var RichTextEditorModel = Component.define(modelOptions).make({
|
|
595
|
+
...richTextEditorBehaviours,
|
|
596
|
+
view: () => View.text("")
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
// ../../src/components/rich-text-editor/engine.ts
|
|
600
|
+
import { Schema as Schema5 } from "effect";
|
|
601
|
+
import { closeHistory } from "@tiptap/pm/history";
|
|
602
|
+
import { EditorState } from "@tiptap/pm/state";
|
|
395
603
|
var replacementMeta = "krakstackExternalReplacement";
|
|
604
|
+
var replaceRichText = (editor, value) => {
|
|
605
|
+
const doc = editor.schema.nodeFromJSON(Schema5.decodeSync(RichTextDocument)(value));
|
|
606
|
+
doc.check();
|
|
607
|
+
if (!editor.state.doc.eq(doc)) {
|
|
608
|
+
editor.view.updateState(EditorState.create({
|
|
609
|
+
schema: editor.schema,
|
|
610
|
+
doc,
|
|
611
|
+
plugins: editor.state.plugins
|
|
612
|
+
}));
|
|
613
|
+
editor.view.dispatch(editor.state.tr.setMeta(replacementMeta, true));
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
var refreshMentionLabels = (editor, variables) => {
|
|
617
|
+
for (const chip of editor.view.dom.querySelectorAll('[data-type="mention"]')) {
|
|
618
|
+
const key = chip.getAttribute("data-id");
|
|
619
|
+
const text = `{{${variables.find((variable) => variable.key === key)?.label ?? key}}}`;
|
|
620
|
+
if (chip.textContent !== text)
|
|
621
|
+
chip.textContent = text;
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
var readEditorStatus = (editor) => ({
|
|
625
|
+
ready: true,
|
|
626
|
+
undo: editor.can().undo(),
|
|
627
|
+
redo: editor.can().redo(),
|
|
628
|
+
bold: editor.isActive("bold"),
|
|
629
|
+
italic: editor.isActive("italic"),
|
|
630
|
+
underline: editor.isActive("underline"),
|
|
631
|
+
block: editor.isActive("bulletList") ? "bullet" : editor.isActive("orderedList") ? "numbered" : editor.isActive("heading") ? "heading" : "paragraph",
|
|
632
|
+
href: editor.getAttributes("link").href ?? null
|
|
633
|
+
});
|
|
634
|
+
var runEditorAction = (editor, action, variables) => {
|
|
635
|
+
if (!editor.isEditable)
|
|
636
|
+
return;
|
|
637
|
+
if (action._tag === "Insert") {
|
|
638
|
+
const variable = variables.find(({ key }) => key === action.key);
|
|
639
|
+
if (!variable)
|
|
640
|
+
return;
|
|
641
|
+
editor.view.dispatch(closeHistory(editor.state.tr));
|
|
642
|
+
editor.chain().focus().insertContent({
|
|
643
|
+
type: "mention",
|
|
644
|
+
attrs: { id: variable.key, label: variable.label }
|
|
645
|
+
}).run();
|
|
646
|
+
editor.view.dispatch(closeHistory(editor.state.tr));
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
const chain = editor.chain().focus();
|
|
650
|
+
if (action._tag === "Link") {
|
|
651
|
+
chain.extendMarkRange("link").setLink({ href: action.href }).run();
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
switch (action.kind) {
|
|
655
|
+
case "bold":
|
|
656
|
+
chain.toggleBold().run();
|
|
657
|
+
break;
|
|
658
|
+
case "italic":
|
|
659
|
+
chain.toggleItalic().run();
|
|
660
|
+
break;
|
|
661
|
+
case "underline":
|
|
662
|
+
chain.toggleUnderline().run();
|
|
663
|
+
break;
|
|
664
|
+
case "undo":
|
|
665
|
+
chain.undo().run();
|
|
666
|
+
break;
|
|
667
|
+
case "redo":
|
|
668
|
+
chain.redo().run();
|
|
669
|
+
break;
|
|
670
|
+
case "bullet":
|
|
671
|
+
chain.toggleBulletList().run();
|
|
672
|
+
break;
|
|
673
|
+
case "numbered":
|
|
674
|
+
chain.toggleOrderedList().run();
|
|
675
|
+
break;
|
|
676
|
+
case "heading":
|
|
677
|
+
chain.clearNodes().setHeading({ level: 2 }).run();
|
|
678
|
+
break;
|
|
679
|
+
case "paragraph":
|
|
680
|
+
chain.clearNodes().setParagraph().run();
|
|
681
|
+
break;
|
|
682
|
+
case "unlink":
|
|
683
|
+
chain.extendMarkRange("link").unsetLink().run();
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
var editorContentClass = "min-h-40 px-4 py-3 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset [&_h1]:text-2xl [&_h2]:text-xl [&_h3]:text-lg [&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold [&_ul]:list-disc [&_ol]:list-decimal [&_ul]:pl-6 [&_ol]:pl-6 [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:pl-4 [&_pre]:rounded [&_pre]:bg-muted [&_pre]:p-3";
|
|
688
|
+
|
|
689
|
+
// ../../src/components/rich-text-editor/react.tsx
|
|
690
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
396
691
|
var ToolButton = ({
|
|
397
692
|
label,
|
|
398
693
|
children,
|
|
@@ -417,17 +712,18 @@ var RichTextContent = ({
|
|
|
417
712
|
values
|
|
418
713
|
}) => renderToReactElement({
|
|
419
714
|
extensions: richTextExtensions({ variables: () => variables }),
|
|
420
|
-
content:
|
|
715
|
+
content: Schema6.decodeSync(RichTextDocument)(value),
|
|
421
716
|
options: {
|
|
422
717
|
nodeMapping: {
|
|
423
718
|
mention: ({ node }) => {
|
|
424
|
-
const key =
|
|
719
|
+
const key = Schema6.decodeUnknownSync(RichTextVariable.fields.key)(node.attrs.id);
|
|
425
720
|
return values?.[key] ?? `{{${variables.find((variable) => variable.key === key)?.label ?? key}}}`;
|
|
426
721
|
}
|
|
427
722
|
}
|
|
428
723
|
}
|
|
429
724
|
});
|
|
430
725
|
var RichTextEditor = ({
|
|
726
|
+
classes: classOverrides,
|
|
431
727
|
value,
|
|
432
728
|
onChange,
|
|
433
729
|
label,
|
|
@@ -441,18 +737,22 @@ var RichTextEditor = ({
|
|
|
441
737
|
extensions,
|
|
442
738
|
onReady
|
|
443
739
|
}) => {
|
|
740
|
+
const richTextEditorClasses = resolveRichTextEditorClasses(classOverrides);
|
|
444
741
|
const locale = useKrakstackLocale(override);
|
|
445
|
-
const
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
742
|
+
const copy = richTextEditorMessages(locale, messages);
|
|
743
|
+
const {
|
|
744
|
+
model: { invalid: error, linkOpen, link, linkError, request },
|
|
745
|
+
send
|
|
746
|
+
} = useModel(RichTextEditorModel, {
|
|
747
|
+
value,
|
|
748
|
+
label,
|
|
749
|
+
variables,
|
|
750
|
+
disabled,
|
|
751
|
+
locale,
|
|
752
|
+
messages,
|
|
753
|
+
className,
|
|
754
|
+
maxLength
|
|
755
|
+
});
|
|
456
756
|
const id = useId();
|
|
457
757
|
const getMaxLength = useEffectEvent(() => maxLength);
|
|
458
758
|
const getVariables = useEffectEvent(() => variables);
|
|
@@ -462,21 +762,20 @@ var RichTextEditor = ({
|
|
|
462
762
|
...extensions ?? richTextExtensions({ variables: () => getVariables() }),
|
|
463
763
|
richTextValidation({
|
|
464
764
|
maxLength: () => getMaxLength(),
|
|
465
|
-
onInvalid:
|
|
765
|
+
onInvalid: (invalid) => send(RichTextEditorMessage.Invalid({ invalid }))
|
|
466
766
|
})
|
|
467
767
|
],
|
|
468
|
-
content:
|
|
768
|
+
content: Schema6.decodeSync(RichTextDocument)(value),
|
|
469
769
|
editable: !disabled,
|
|
470
|
-
onCreate: ({ editor }) =>
|
|
770
|
+
onCreate: ({ editor }) => {
|
|
771
|
+
send(RichTextEditorMessage.Status({ status: readEditorStatus(editor) }));
|
|
772
|
+
onReady?.(editor);
|
|
773
|
+
},
|
|
471
774
|
onUpdate: ({ editor }) => onChange(editor.getJSON()),
|
|
472
|
-
onTransaction: ({ transaction }) => {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
setLinkOpen(false);
|
|
477
|
-
}
|
|
478
|
-
if (replacement || transaction.docChanged || transaction.selectionSet || transaction.storedMarksSet)
|
|
479
|
-
setRevision((current) => current + 1);
|
|
775
|
+
onTransaction: ({ editor, transaction }) => {
|
|
776
|
+
if (transaction.getMeta(replacementMeta) === true)
|
|
777
|
+
send(RichTextEditorMessage.Replaced());
|
|
778
|
+
send(RichTextEditorMessage.Status({ status: readEditorStatus(editor) }));
|
|
480
779
|
},
|
|
481
780
|
editorProps: {
|
|
482
781
|
attributes: {
|
|
@@ -485,7 +784,7 @@ var RichTextEditor = ({
|
|
|
485
784
|
"aria-multiline": "true",
|
|
486
785
|
"aria-disabled": String(!!disabled),
|
|
487
786
|
"aria-describedby": error ? `${id}-error` : "",
|
|
488
|
-
class:
|
|
787
|
+
class: `${editorContentClass} ${contentStyle?.fontSize === undefined ? "text-sm" : ""} ${contentStyle?.lineHeight === undefined ? "leading-relaxed" : ""}`
|
|
489
788
|
}
|
|
490
789
|
}
|
|
491
790
|
}, [extensions]);
|
|
@@ -496,16 +795,7 @@ var RichTextEditor = ({
|
|
|
496
795
|
useEffect(() => {
|
|
497
796
|
if (!editor)
|
|
498
797
|
return;
|
|
499
|
-
|
|
500
|
-
incoming.check();
|
|
501
|
-
if (!editor.state.doc.eq(incoming)) {
|
|
502
|
-
editor.view.updateState(EditorState.create({
|
|
503
|
-
schema: editor.schema,
|
|
504
|
-
doc: incoming,
|
|
505
|
-
plugins: editor.state.plugins
|
|
506
|
-
}));
|
|
507
|
-
editor.view.dispatch(editor.state.tr.setMeta(replacementMeta, true));
|
|
508
|
-
}
|
|
798
|
+
replaceRichText(editor, value);
|
|
509
799
|
}, [editor, value]);
|
|
510
800
|
useEffect(() => {
|
|
511
801
|
editor?.setEditable(!disabled, false);
|
|
@@ -513,29 +803,33 @@ var RichTextEditor = ({
|
|
|
513
803
|
useEffect(() => {
|
|
514
804
|
if (!editor)
|
|
515
805
|
return;
|
|
516
|
-
|
|
517
|
-
const key = chip.getAttribute("data-id");
|
|
518
|
-
const text = `{{${variables.find((variable) => variable.key === key)?.label ?? key}}}`;
|
|
519
|
-
if (chip.textContent !== text)
|
|
520
|
-
chip.textContent = text;
|
|
521
|
-
}
|
|
806
|
+
refreshMentionLabels(editor, variables);
|
|
522
807
|
}, [editor, variables]);
|
|
808
|
+
const applyAction = useEffectEvent((action) => {
|
|
809
|
+
if (editor)
|
|
810
|
+
runEditorAction(editor, action, variables);
|
|
811
|
+
});
|
|
812
|
+
useEffect(() => {
|
|
813
|
+
if (request)
|
|
814
|
+
applyAction(request.action);
|
|
815
|
+
}, [request]);
|
|
816
|
+
const act = (action) => send(RichTextEditorMessage.Action({ action }));
|
|
817
|
+
const format = (kind) => act(EditorAction.Format({ kind }));
|
|
523
818
|
const block = editor?.isActive("bulletList") ? "bullet" : editor?.isActive("orderedList") ? "numbered" : editor?.isActive("heading") ? "heading" : "paragraph";
|
|
524
819
|
return /* @__PURE__ */ jsxs3("div", {
|
|
525
820
|
"data-slot": "rich-text-editor",
|
|
526
|
-
"data-revision": revision,
|
|
527
821
|
className: `bg-background text-foreground overflow-hidden rounded-xl border ${className ?? ""}`,
|
|
528
822
|
children: [
|
|
529
823
|
/* @__PURE__ */ jsxs3("div", {
|
|
530
824
|
role: "group",
|
|
531
825
|
"aria-label": copy.toolbar,
|
|
532
|
-
className:
|
|
826
|
+
className: richTextEditorClasses.toolbar,
|
|
533
827
|
children: [
|
|
534
828
|
/* @__PURE__ */ jsx5(ToolButton, {
|
|
535
829
|
label: copy.undo,
|
|
536
830
|
disabled: disabled || !editor?.can().undo(),
|
|
537
831
|
onClick: () => {
|
|
538
|
-
|
|
832
|
+
format("undo");
|
|
539
833
|
},
|
|
540
834
|
children: /* @__PURE__ */ jsx5(Undo2, {})
|
|
541
835
|
}),
|
|
@@ -543,7 +837,7 @@ var RichTextEditor = ({
|
|
|
543
837
|
label: copy.redo,
|
|
544
838
|
disabled: disabled || !editor?.can().redo(),
|
|
545
839
|
onClick: () => {
|
|
546
|
-
|
|
840
|
+
format("redo");
|
|
547
841
|
},
|
|
548
842
|
children: /* @__PURE__ */ jsx5(Redo2, {})
|
|
549
843
|
}),
|
|
@@ -557,16 +851,8 @@ var RichTextEditor = ({
|
|
|
557
851
|
{ value: "numbered", label: copy.numbered }
|
|
558
852
|
],
|
|
559
853
|
onValueChange: (kind) => {
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
if (kind === "bullet")
|
|
563
|
-
editor.chain().focus().toggleBulletList().run();
|
|
564
|
-
else if (kind === "numbered")
|
|
565
|
-
editor.chain().focus().toggleOrderedList().run();
|
|
566
|
-
else if (kind === "heading")
|
|
567
|
-
editor.chain().focus().clearNodes().setHeading({ level: 2 }).run();
|
|
568
|
-
else
|
|
569
|
-
editor.chain().focus().clearNodes().setParagraph().run();
|
|
854
|
+
if (kind === "bullet" || kind === "numbered" || kind === "heading" || kind === "paragraph")
|
|
855
|
+
format(kind);
|
|
570
856
|
},
|
|
571
857
|
children: [
|
|
572
858
|
/* @__PURE__ */ jsx5(SelectTrigger, {
|
|
@@ -605,7 +891,7 @@ var RichTextEditor = ({
|
|
|
605
891
|
disabled: disabled || !editor,
|
|
606
892
|
pressed: editor?.isActive("bold"),
|
|
607
893
|
onClick: () => {
|
|
608
|
-
|
|
894
|
+
format("bold");
|
|
609
895
|
},
|
|
610
896
|
children: /* @__PURE__ */ jsx5(Bold, {})
|
|
611
897
|
}),
|
|
@@ -614,7 +900,7 @@ var RichTextEditor = ({
|
|
|
614
900
|
disabled: disabled || !editor,
|
|
615
901
|
pressed: editor?.isActive("italic"),
|
|
616
902
|
onClick: () => {
|
|
617
|
-
|
|
903
|
+
format("italic");
|
|
618
904
|
},
|
|
619
905
|
children: /* @__PURE__ */ jsx5(Italic, {})
|
|
620
906
|
}),
|
|
@@ -623,7 +909,7 @@ var RichTextEditor = ({
|
|
|
623
909
|
disabled: disabled || !editor,
|
|
624
910
|
pressed: editor?.isActive("underline"),
|
|
625
911
|
onClick: () => {
|
|
626
|
-
|
|
912
|
+
format("underline");
|
|
627
913
|
},
|
|
628
914
|
children: /* @__PURE__ */ jsx5(Underline, {})
|
|
629
915
|
}),
|
|
@@ -631,11 +917,7 @@ var RichTextEditor = ({
|
|
|
631
917
|
label: copy.link,
|
|
632
918
|
disabled: disabled || !editor,
|
|
633
919
|
pressed: linkOpen || editor?.isActive("link"),
|
|
634
|
-
onClick: () =>
|
|
635
|
-
setLink(editor?.getAttributes("link").href ?? "");
|
|
636
|
-
setLinkError(false);
|
|
637
|
-
setLinkOpen(!linkOpen);
|
|
638
|
-
},
|
|
920
|
+
onClick: () => send(RichTextEditorMessage.ToggleLink()),
|
|
639
921
|
children: /* @__PURE__ */ jsx5(Link2, {})
|
|
640
922
|
}),
|
|
641
923
|
variables.length ? /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
@@ -662,12 +944,7 @@ var RichTextEditor = ({
|
|
|
662
944
|
onClick: () => {
|
|
663
945
|
if (disabled || !editor)
|
|
664
946
|
return;
|
|
665
|
-
|
|
666
|
-
editor.commands.insertContent({
|
|
667
|
-
type: "mention",
|
|
668
|
-
attrs: { id: variable.key, label: variable.label }
|
|
669
|
-
});
|
|
670
|
-
editor.view.dispatch(closeHistory(editor.state.tr));
|
|
947
|
+
act(EditorAction.Insert({ key: variable.key }));
|
|
671
948
|
},
|
|
672
949
|
children: variable.label
|
|
673
950
|
}, variable.key))
|
|
@@ -677,17 +954,17 @@ var RichTextEditor = ({
|
|
|
677
954
|
]
|
|
678
955
|
}),
|
|
679
956
|
linkOpen ? /* @__PURE__ */ jsxs3("div", {
|
|
680
|
-
className:
|
|
957
|
+
className: richTextEditorClasses.linkForm,
|
|
681
958
|
children: [
|
|
682
959
|
/* @__PURE__ */ jsxs3("label", {
|
|
683
|
-
className:
|
|
960
|
+
className: richTextEditorClasses.linkField,
|
|
684
961
|
children: [
|
|
685
962
|
copy.linkUrl,
|
|
686
963
|
/* @__PURE__ */ jsx5(Input, {
|
|
687
964
|
value: link,
|
|
688
965
|
"aria-invalid": linkError,
|
|
689
966
|
placeholder: "https://",
|
|
690
|
-
onChange: (event) =>
|
|
967
|
+
onChange: (event) => send(RichTextEditorMessage.EditLink({ link: event.target.value }))
|
|
691
968
|
})
|
|
692
969
|
]
|
|
693
970
|
}),
|
|
@@ -695,14 +972,7 @@ var RichTextEditor = ({
|
|
|
695
972
|
type: "button",
|
|
696
973
|
size: "sm",
|
|
697
974
|
disabled,
|
|
698
|
-
onClick: () =>
|
|
699
|
-
if (!Schema3.is(RichTextLink)(link)) {
|
|
700
|
-
setLinkError(true);
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
editor?.chain().focus().extendMarkRange("link").setLink({ href: link }).run();
|
|
704
|
-
setLinkOpen(false);
|
|
705
|
-
},
|
|
975
|
+
onClick: () => send(RichTextEditorMessage.ApplyLink()),
|
|
706
976
|
children: copy.apply
|
|
707
977
|
}),
|
|
708
978
|
editor?.isActive("link") ? /* @__PURE__ */ jsxs3(Button, {
|
|
@@ -711,8 +981,7 @@ var RichTextEditor = ({
|
|
|
711
981
|
variant: "outline",
|
|
712
982
|
disabled,
|
|
713
983
|
onClick: () => {
|
|
714
|
-
|
|
715
|
-
setLinkOpen(false);
|
|
984
|
+
format("unlink");
|
|
716
985
|
},
|
|
717
986
|
children: [
|
|
718
987
|
/* @__PURE__ */ jsx5(Unlink, {
|
|
@@ -725,12 +994,12 @@ var RichTextEditor = ({
|
|
|
725
994
|
type: "button",
|
|
726
995
|
size: "sm",
|
|
727
996
|
variant: "ghost",
|
|
728
|
-
onClick: () =>
|
|
997
|
+
onClick: () => send(RichTextEditorMessage.CloseLink()),
|
|
729
998
|
children: copy.cancel
|
|
730
999
|
}),
|
|
731
1000
|
linkError ? /* @__PURE__ */ jsx5("p", {
|
|
732
1001
|
role: "alert",
|
|
733
|
-
className:
|
|
1002
|
+
className: richTextEditorClasses.linkError,
|
|
734
1003
|
children: copy.invalidLink
|
|
735
1004
|
}) : null
|
|
736
1005
|
]
|
|
@@ -742,7 +1011,7 @@ var RichTextEditor = ({
|
|
|
742
1011
|
error ? /* @__PURE__ */ jsx5("p", {
|
|
743
1012
|
id: `${id}-error`,
|
|
744
1013
|
role: "alert",
|
|
745
|
-
className:
|
|
1014
|
+
className: richTextEditorClasses.editorError,
|
|
746
1015
|
children: copy.invalid
|
|
747
1016
|
}) : null
|
|
748
1017
|
]
|