@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,5 +1,5 @@
|
|
|
1
|
-
// ../../src/components/
|
|
2
|
-
import { Schema as
|
|
1
|
+
// ../../src/components/email-editor/react.tsx
|
|
2
|
+
import { Schema as Schema11 } from "effect";
|
|
3
3
|
import { Popover } from "@base-ui/react/popover";
|
|
4
4
|
import {
|
|
5
5
|
useId as useId3,
|
|
@@ -240,7 +240,7 @@ function PopoverTitle({ className, ...props }) {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
// ../../src/components/
|
|
243
|
+
// ../../src/components/animated-list/react.tsx
|
|
244
244
|
import {
|
|
245
245
|
useEffect as useEffect2,
|
|
246
246
|
useEffectEvent as useEffectEvent2,
|
|
@@ -249,8 +249,9 @@ import {
|
|
|
249
249
|
useState as useState2
|
|
250
250
|
} from "react";
|
|
251
251
|
import { GripVertical } from "lucide-react";
|
|
252
|
+
import { Component as Component2, View } from "effect/ui";
|
|
252
253
|
import { cn as cn2 } from "cn";
|
|
253
|
-
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
254
|
+
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
254
255
|
|
|
255
256
|
// ../../src/lib/krakmotion.ts
|
|
256
257
|
import {
|
|
@@ -284,26 +285,6 @@ var animateElement = (element, frames, duration, complete) => {
|
|
|
284
285
|
animation.cancel();
|
|
285
286
|
};
|
|
286
287
|
};
|
|
287
|
-
var useKeyedPresence = (items, getKey) => {
|
|
288
|
-
const [previous, setPrevious] = useState(items);
|
|
289
|
-
const [retained, setRetained] = useState(items);
|
|
290
|
-
if (previous !== items) {
|
|
291
|
-
const keys = new Set(items.map(getKey));
|
|
292
|
-
const next = [...items];
|
|
293
|
-
retained.forEach((item, index) => {
|
|
294
|
-
if (!keys.has(getKey(item)))
|
|
295
|
-
next.splice(Math.min(index, next.length), 0, item);
|
|
296
|
-
});
|
|
297
|
-
setPrevious(items);
|
|
298
|
-
setRetained(next);
|
|
299
|
-
}
|
|
300
|
-
const present = new Set(items.map(getKey));
|
|
301
|
-
return {
|
|
302
|
-
items: retained,
|
|
303
|
-
present,
|
|
304
|
-
remove: (key) => setRetained((current) => current.filter((item) => getKey(item) !== key))
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
288
|
var useListLayout = (ref, duration) => {
|
|
308
289
|
const previous = useRef(new Map);
|
|
309
290
|
const animations = useRef(new Map);
|
|
@@ -469,8 +450,53 @@ var useVerticalDrag = ({
|
|
|
469
450
|
};
|
|
470
451
|
};
|
|
471
452
|
|
|
472
|
-
// ../../src/components/
|
|
473
|
-
import {
|
|
453
|
+
// ../../src/components/animated-list/react.tsx
|
|
454
|
+
import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
455
|
+
|
|
456
|
+
// ../../src/components/animated-list/classes.ts
|
|
457
|
+
var animatedListClasses = {
|
|
458
|
+
list: "relative grid gap-3",
|
|
459
|
+
dragHandle: "text-muted-foreground focus-visible:ring-ring inline-flex size-8 shrink-0 cursor-grab touch-none items-center justify-center rounded-md outline-none select-none focus-visible:ring-2 active:cursor-grabbing disabled:cursor-default disabled:opacity-50"
|
|
460
|
+
};
|
|
461
|
+
var resolveAnimatedListClasses = (overrides) => ({
|
|
462
|
+
...animatedListClasses,
|
|
463
|
+
...overrides
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// ../../src/components/animated-list/index.ts
|
|
467
|
+
import { Schema as Schema2, Stream } from "effect";
|
|
468
|
+
import { Component, Subscription, UiSchema } from "effect/ui";
|
|
469
|
+
|
|
470
|
+
// ../../src/components/animated-list/schema.ts
|
|
471
|
+
import { Predicate, Schema, Struct } from "effect";
|
|
472
|
+
var Position = Schema.declare((value) => Predicate.isFunction(value));
|
|
473
|
+
var MessageOverrides = Schema.Struct({
|
|
474
|
+
reorder: Schema.optional(Schema.String),
|
|
475
|
+
instructions: Schema.optional(Schema.String),
|
|
476
|
+
position: Schema.optional(Position)
|
|
477
|
+
});
|
|
478
|
+
var AnimatedListClassesOverridesSchema = Schema.Record(Schema.Literals(Struct.keys(animatedListClasses)), Schema.optionalKey(Schema.String)).annotate({ identifier: "AnimatedListClassesOverrides" });
|
|
479
|
+
var AnimatedListPropsSchema = Schema.Struct({
|
|
480
|
+
classes: Schema.optional(AnimatedListClassesOverridesSchema),
|
|
481
|
+
duration: Schema.optional(Schema.Number),
|
|
482
|
+
className: Schema.optional(Schema.String),
|
|
483
|
+
itemClassName: Schema.optional(Schema.String),
|
|
484
|
+
label: Schema.optional(Schema.String),
|
|
485
|
+
dragOverflow: Schema.optional(Schema.Number),
|
|
486
|
+
locale: Schema.optional(Schema.String),
|
|
487
|
+
messages: Schema.optional(Schema.Record(Schema.String, Schema.UndefinedOr(MessageOverrides)))
|
|
488
|
+
}).annotate({ identifier: "AnimatedListProps" });
|
|
489
|
+
var AnimatedListRow = Schema.Struct({
|
|
490
|
+
key: Schema.String,
|
|
491
|
+
label: Schema.optional(Schema.String)
|
|
492
|
+
}).annotate({ identifier: "AnimatedListRow" });
|
|
493
|
+
var AnimatedListModelProps = Schema.Struct({
|
|
494
|
+
...AnimatedListPropsSchema.fields,
|
|
495
|
+
items: Schema.Array(AnimatedListRow),
|
|
496
|
+
reorderable: Schema.optional(Schema.Boolean)
|
|
497
|
+
}).annotate({ identifier: "AnimatedListModelProps" });
|
|
498
|
+
|
|
499
|
+
// ../../src/components/animated-list/index.ts
|
|
474
500
|
var labels = {
|
|
475
501
|
en: {
|
|
476
502
|
reorder: "Reorder",
|
|
@@ -483,7 +509,107 @@ var labels = {
|
|
|
483
509
|
position: (label, position, total) => `${label}, position ${position} sur ${total}.`
|
|
484
510
|
}
|
|
485
511
|
};
|
|
512
|
+
var animatedListCopy = (locale, messages) => ({
|
|
513
|
+
...locale.startsWith("fr") ? labels.fr : labels.en,
|
|
514
|
+
...messages?.[locale.split("-")[0] ?? locale],
|
|
515
|
+
...messages?.[locale]
|
|
516
|
+
});
|
|
517
|
+
var reorderTarget = (key, index, total) => key === "Home" ? 0 : key === "End" ? total - 1 : key === "ArrowUp" ? Math.max(0, index - 1) : key === "ArrowDown" ? Math.min(total - 1, index + 1) : undefined;
|
|
518
|
+
var moveItem = (items, from, to) => {
|
|
519
|
+
if (from < 0 || from >= items.length || to < 0 || to >= items.length || from === to)
|
|
520
|
+
return;
|
|
521
|
+
const next = [...items];
|
|
522
|
+
next.splice(to, 0, ...next.splice(from, 1));
|
|
523
|
+
return next;
|
|
524
|
+
};
|
|
525
|
+
var retainedRows = (items, previous) => {
|
|
526
|
+
const keys = new Set(items.map((row) => row.key));
|
|
527
|
+
const next = [...items];
|
|
528
|
+
previous.forEach((row, index) => {
|
|
529
|
+
if (!keys.has(row.key))
|
|
530
|
+
next.splice(Math.min(index, next.length), 0, row);
|
|
531
|
+
});
|
|
532
|
+
return next;
|
|
533
|
+
};
|
|
534
|
+
var listAnnouncement = (items, key, copy) => {
|
|
535
|
+
const index = items.findIndex((row) => row.key === key);
|
|
536
|
+
const row = items[index];
|
|
537
|
+
return row ? copy.position(row.label ?? row.key, index + 1, items.length) : "";
|
|
538
|
+
};
|
|
539
|
+
var AnimatedListMessage = UiSchema.TaggedEnum({
|
|
540
|
+
Synced: {},
|
|
541
|
+
Exited: { key: Schema2.String },
|
|
542
|
+
Announced: { key: Schema2.String },
|
|
543
|
+
Moved: { key: Schema2.String, to: Schema2.Number }
|
|
544
|
+
});
|
|
545
|
+
var AnimatedListEvent = UiSchema.TaggedEnum({
|
|
546
|
+
Reordered: {
|
|
547
|
+
from: Schema2.Number,
|
|
548
|
+
to: Schema2.Number,
|
|
549
|
+
items: Schema2.Array(AnimatedListRow)
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
var animatedListOptions = {
|
|
553
|
+
name: "AnimatedList",
|
|
554
|
+
props: AnimatedListModelProps,
|
|
555
|
+
model: Schema2.Struct({
|
|
556
|
+
lastItems: Schema2.Array(AnimatedListRow),
|
|
557
|
+
rows: Schema2.Array(AnimatedListRow),
|
|
558
|
+
announcedKey: Schema2.NullOr(Schema2.String)
|
|
559
|
+
}).annotate({ identifier: "AnimatedListModel" }),
|
|
560
|
+
message: AnimatedListMessage,
|
|
561
|
+
restore: false
|
|
562
|
+
};
|
|
563
|
+
var Definition = Component.define(animatedListOptions);
|
|
564
|
+
var changed = Subscription.make("animated-list/changed", Stream.succeed(AnimatedListMessage.Synced()));
|
|
565
|
+
var listMove = (props, key, to) => {
|
|
566
|
+
const from = props.items.findIndex((row) => row.key === key);
|
|
567
|
+
const items = props.reorderable && moveItem(props.items, from, to);
|
|
568
|
+
return items ? { from, to, items } : undefined;
|
|
569
|
+
};
|
|
570
|
+
var updateAnimatedList = ({
|
|
571
|
+
model,
|
|
572
|
+
props
|
|
573
|
+
}, message) => {
|
|
574
|
+
switch (message._tag) {
|
|
575
|
+
case "Synced":
|
|
576
|
+
return {
|
|
577
|
+
...model,
|
|
578
|
+
lastItems: props.items,
|
|
579
|
+
rows: retainedRows(props.items, model.rows)
|
|
580
|
+
};
|
|
581
|
+
case "Exited":
|
|
582
|
+
return props.items.some((row) => row.key === message.key) ? model : {
|
|
583
|
+
...model,
|
|
584
|
+
rows: model.rows.filter((row) => row.key !== message.key)
|
|
585
|
+
};
|
|
586
|
+
case "Announced":
|
|
587
|
+
return { ...model, announcedKey: message.key };
|
|
588
|
+
case "Moved":
|
|
589
|
+
return listMove(props, message.key, message.to) ? { ...model, announcedKey: message.key } : model;
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
var update = Definition.update(updateAnimatedList);
|
|
593
|
+
var animatedListBehaviours = {
|
|
594
|
+
init: Definition.init(({ props }) => ({
|
|
595
|
+
lastItems: props.items,
|
|
596
|
+
rows: props.items,
|
|
597
|
+
announcedKey: null
|
|
598
|
+
})),
|
|
599
|
+
update,
|
|
600
|
+
subscriptions: Definition.subscriptions(({ model, props }) => [
|
|
601
|
+
(props.items.length !== model.lastItems.length || props.items.some(({ key, label }, index) => model.lastItems[index]?.key !== key || model.lastItems[index]?.label !== label)) && changed
|
|
602
|
+
])
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
// ../../src/components/animated-list/react.tsx
|
|
606
|
+
import { jsx as jsx5, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
607
|
+
var Model = Component2.define(animatedListOptions).make({
|
|
608
|
+
...animatedListBehaviours,
|
|
609
|
+
view: () => View.text("")
|
|
610
|
+
});
|
|
486
611
|
var AnimatedList = ({
|
|
612
|
+
classes: classOverrides,
|
|
487
613
|
items,
|
|
488
614
|
getKey,
|
|
489
615
|
children,
|
|
@@ -497,30 +623,45 @@ var AnimatedList = ({
|
|
|
497
623
|
locale: override,
|
|
498
624
|
messages
|
|
499
625
|
}) => {
|
|
626
|
+
const animatedListClasses = resolveAnimatedListClasses(classOverrides);
|
|
500
627
|
const locale = useKrakstackLocale(override);
|
|
501
|
-
const copy =
|
|
502
|
-
...locale.startsWith("fr") ? labels.fr : labels.en,
|
|
503
|
-
...messages?.[locale.split("-")[0] ?? locale],
|
|
504
|
-
...messages?.[locale]
|
|
505
|
-
};
|
|
628
|
+
const copy = animatedListCopy(locale, messages);
|
|
506
629
|
const instructions = useId();
|
|
507
630
|
const container = useRef2(null);
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
631
|
+
const descriptors = items.map((item) => ({
|
|
632
|
+
key: getKey(item),
|
|
633
|
+
label: getItemLabel?.(item)
|
|
634
|
+
}));
|
|
635
|
+
const { model, send } = useModel(Model, {
|
|
636
|
+
items: descriptors,
|
|
637
|
+
reorderable: !!onReorder
|
|
638
|
+
});
|
|
639
|
+
const retained = retainedRows(descriptors, model.rows);
|
|
640
|
+
const current = new Map(items.map((item) => [getKey(item), { item }]));
|
|
641
|
+
const [previous, setPrevious] = useState2(() => ({
|
|
642
|
+
items,
|
|
643
|
+
rows: model.rows,
|
|
644
|
+
rendered: current
|
|
645
|
+
}));
|
|
646
|
+
const rendered = new Map(retained.flatMap(({ key }) => {
|
|
647
|
+
const value = current.get(key) ?? previous.rendered.get(key);
|
|
648
|
+
return value ? [[key, value]] : [];
|
|
649
|
+
}));
|
|
650
|
+
if (previous.items !== items || previous.rows !== model.rows) {
|
|
651
|
+
setPrevious({ items, rows: model.rows, rendered });
|
|
652
|
+
}
|
|
653
|
+
const committed = useRef2(false);
|
|
654
|
+
useEffect2(() => {
|
|
655
|
+
committed.current = true;
|
|
656
|
+
}, []);
|
|
512
657
|
useListLayout(container, duration);
|
|
513
|
-
const announcement =
|
|
658
|
+
const announcement = listAnnouncement(descriptors, model.announcedKey, copy);
|
|
514
659
|
const move = (key, target) => {
|
|
515
660
|
const index = items.findIndex((item) => getKey(item) === key);
|
|
516
|
-
|
|
661
|
+
const next = onReorder && moveItem(items, index, target);
|
|
662
|
+
if (!next || !onReorder)
|
|
517
663
|
return;
|
|
518
|
-
|
|
519
|
-
const [item] = next.splice(index, 1);
|
|
520
|
-
if (item === undefined)
|
|
521
|
-
return;
|
|
522
|
-
next.splice(target, 0, item);
|
|
523
|
-
setAnnouncedKey(key);
|
|
664
|
+
send(AnimatedListMessage.Announced({ key }));
|
|
524
665
|
onReorder(next);
|
|
525
666
|
};
|
|
526
667
|
return /* @__PURE__ */ jsxs2(Fragment, {
|
|
@@ -528,27 +669,30 @@ var AnimatedList = ({
|
|
|
528
669
|
/* @__PURE__ */ jsx5("ul", {
|
|
529
670
|
ref: container,
|
|
530
671
|
"data-slot": "animated-list",
|
|
531
|
-
className: cn2(
|
|
672
|
+
className: cn2(animatedListClasses.list, className),
|
|
532
673
|
"aria-label": label,
|
|
533
|
-
children: retained.
|
|
534
|
-
const
|
|
674
|
+
children: retained.map(({ key, label }) => {
|
|
675
|
+
const value = rendered.get(key);
|
|
676
|
+
if (!value)
|
|
677
|
+
return null;
|
|
535
678
|
const index = items.findIndex((candidate) => getKey(candidate) === key);
|
|
536
679
|
return /* @__PURE__ */ jsx5(ListItem, {
|
|
537
680
|
itemKey: key,
|
|
538
|
-
present:
|
|
539
|
-
|
|
681
|
+
present: current.has(key),
|
|
682
|
+
committed,
|
|
540
683
|
duration,
|
|
541
684
|
className: itemClassName,
|
|
685
|
+
handleClassName: animatedListClasses.dragHandle,
|
|
542
686
|
instructions,
|
|
543
|
-
handleLabel: `${copy.reorder}: ${
|
|
687
|
+
handleLabel: `${copy.reorder}: ${label ?? key}`,
|
|
544
688
|
reorderable: !!onReorder,
|
|
545
689
|
disabled: items.length < 2,
|
|
546
690
|
container,
|
|
547
691
|
dragOverflow,
|
|
548
|
-
onExit: () =>
|
|
692
|
+
onExit: () => send(AnimatedListMessage.Exited({ key })),
|
|
549
693
|
onMove: (target) => move(key, target),
|
|
550
|
-
onKeyMove: (direction) => move(key, direction
|
|
551
|
-
children: children(item)
|
|
694
|
+
onKeyMove: (direction) => move(key, reorderTarget(direction, index, items.length) ?? index),
|
|
695
|
+
children: children(value.item)
|
|
552
696
|
}, key);
|
|
553
697
|
})
|
|
554
698
|
}),
|
|
@@ -574,11 +718,12 @@ var AnimatedList = ({
|
|
|
574
718
|
var ListItem = ({
|
|
575
719
|
itemKey,
|
|
576
720
|
present,
|
|
577
|
-
|
|
721
|
+
committed,
|
|
578
722
|
duration,
|
|
579
723
|
className,
|
|
580
724
|
instructions,
|
|
581
725
|
handleLabel,
|
|
726
|
+
handleClassName,
|
|
582
727
|
reorderable,
|
|
583
728
|
disabled,
|
|
584
729
|
container,
|
|
@@ -605,7 +750,7 @@ var ListItem = ({
|
|
|
605
750
|
const element = ref.current;
|
|
606
751
|
const first = !mounted.current;
|
|
607
752
|
mounted.current = true;
|
|
608
|
-
if (!element || first &&
|
|
753
|
+
if (!element || first && !committed.current && present)
|
|
609
754
|
return;
|
|
610
755
|
if (!first && lastPresent.current === present && !transitioning.current)
|
|
611
756
|
return;
|
|
@@ -616,7 +761,7 @@ var ListItem = ({
|
|
|
616
761
|
if (!present)
|
|
617
762
|
exit();
|
|
618
763
|
});
|
|
619
|
-
}, [present,
|
|
764
|
+
}, [present, committed, duration, reduced]);
|
|
620
765
|
return /* @__PURE__ */ jsxs2("li", {
|
|
621
766
|
ref,
|
|
622
767
|
"data-slot": "animated-list-item",
|
|
@@ -631,7 +776,7 @@ var ListItem = ({
|
|
|
631
776
|
disabled: disabled || !present,
|
|
632
777
|
"aria-label": handleLabel,
|
|
633
778
|
"aria-describedby": instructions,
|
|
634
|
-
className:
|
|
779
|
+
className: handleClassName,
|
|
635
780
|
...drag,
|
|
636
781
|
onKeyDown: (event) => {
|
|
637
782
|
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
@@ -651,9 +796,8 @@ var ListItem = ({
|
|
|
651
796
|
]
|
|
652
797
|
});
|
|
653
798
|
};
|
|
654
|
-
|
|
655
799
|
// ../../src/lib/email-document/legacy-rich-text/editor.tsx
|
|
656
|
-
import { Option as Option2, Schema as
|
|
800
|
+
import { Option as Option2, Schema as Schema6 } from "effect";
|
|
657
801
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
658
802
|
import { EditorState } from "@tiptap/pm/state";
|
|
659
803
|
import { closeHistory } from "@tiptap/pm/history";
|
|
@@ -730,63 +874,63 @@ function DropdownMenuItem({
|
|
|
730
874
|
}
|
|
731
875
|
|
|
732
876
|
// ../../src/lib/email-document/legacy-rich-text/editor.tsx
|
|
733
|
-
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
|
|
877
|
+
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider/react";
|
|
734
878
|
|
|
735
879
|
// ../../src/lib/email-document/legacy-rich-text/schema.ts
|
|
736
|
-
import { Schema } from "effect";
|
|
737
|
-
var RichTextLink =
|
|
880
|
+
import { Schema as Schema3 } from "effect";
|
|
881
|
+
var RichTextLink = Schema3.String.check(Schema3.isMaxLength(2000), Schema3.makeFilter((value) => {
|
|
738
882
|
if (/[\s\p{Cc}\\{}]/u.test(value))
|
|
739
883
|
return false;
|
|
740
884
|
const url = URL.parse(value);
|
|
741
885
|
return url !== null && ["https:", "mailto:"].includes(url.protocol) && !url.username && !url.password;
|
|
742
886
|
})).annotate({ identifier: "RichTextLink" });
|
|
743
|
-
var RichTextMarks =
|
|
744
|
-
bold:
|
|
745
|
-
italic:
|
|
746
|
-
underline:
|
|
747
|
-
href:
|
|
887
|
+
var RichTextMarks = Schema3.Struct({
|
|
888
|
+
bold: Schema3.optional(Schema3.Boolean),
|
|
889
|
+
italic: Schema3.optional(Schema3.Boolean),
|
|
890
|
+
underline: Schema3.optional(Schema3.Boolean),
|
|
891
|
+
href: Schema3.optional(RichTextLink)
|
|
748
892
|
}).annotate({ identifier: "RichTextMarks" });
|
|
749
|
-
var RichTextInline =
|
|
750
|
-
|
|
751
|
-
type:
|
|
752
|
-
text:
|
|
753
|
-
marks:
|
|
893
|
+
var RichTextInline = Schema3.Union([
|
|
894
|
+
Schema3.Struct({
|
|
895
|
+
type: Schema3.Literal("text"),
|
|
896
|
+
text: Schema3.String.check(Schema3.isMaxLength(20000)),
|
|
897
|
+
marks: Schema3.optional(RichTextMarks)
|
|
754
898
|
}),
|
|
755
|
-
|
|
756
|
-
type:
|
|
757
|
-
key:
|
|
758
|
-
marks:
|
|
899
|
+
Schema3.Struct({
|
|
900
|
+
type: Schema3.Literal("variable"),
|
|
901
|
+
key: Schema3.String.check(Schema3.isPattern(/^[a-zA-Z][a-zA-Z0-9_.]{0,79}$/)),
|
|
902
|
+
marks: Schema3.optional(RichTextMarks)
|
|
759
903
|
})
|
|
760
904
|
]).annotate({ identifier: "RichTextInline" });
|
|
761
|
-
var RichTextBlockKind =
|
|
905
|
+
var RichTextBlockKind = Schema3.Literals([
|
|
762
906
|
"paragraph",
|
|
763
907
|
"heading",
|
|
764
908
|
"bullet",
|
|
765
909
|
"numbered"
|
|
766
910
|
]).annotate({ identifier: "RichTextBlockKind" });
|
|
767
|
-
var RichTextDocument =
|
|
768
|
-
version:
|
|
769
|
-
blocks:
|
|
911
|
+
var RichTextDocument = Schema3.Struct({
|
|
912
|
+
version: Schema3.Literal(1),
|
|
913
|
+
blocks: Schema3.Array(Schema3.Struct({
|
|
770
914
|
type: RichTextBlockKind,
|
|
771
|
-
content:
|
|
772
|
-
})).check(
|
|
773
|
-
}).check(
|
|
774
|
-
var RichTextVariable =
|
|
775
|
-
key:
|
|
776
|
-
label:
|
|
777
|
-
type:
|
|
778
|
-
sample:
|
|
915
|
+
content: Schema3.Array(RichTextInline).check(Schema3.isMaxLength(2000))
|
|
916
|
+
})).check(Schema3.isMinLength(1), Schema3.isMaxLength(100))
|
|
917
|
+
}).check(Schema3.makeFilter((value) => value.blocks.reduce((size, block) => size + block.content.reduce((count, inline) => count + (inline.type === "text" ? inline.text.length : 1), 0), 0) <= 20000)).annotate({ identifier: "RichTextDocument" });
|
|
918
|
+
var RichTextVariable = Schema3.Struct({
|
|
919
|
+
key: Schema3.String.check(Schema3.isPattern(/^[a-zA-Z][a-zA-Z0-9_.]{0,79}$/)),
|
|
920
|
+
label: Schema3.String,
|
|
921
|
+
type: Schema3.Literals(["text", "url"]),
|
|
922
|
+
sample: Schema3.String
|
|
779
923
|
}).annotate({ identifier: "RichTextVariable" });
|
|
780
924
|
|
|
781
925
|
// ../../src/lib/email-document/legacy-rich-text/tiptap.ts
|
|
782
926
|
import { Extension, Node } from "@tiptap/core";
|
|
783
927
|
import { Plugin } from "@tiptap/pm/state";
|
|
784
928
|
import StarterKit from "@tiptap/starter-kit";
|
|
785
|
-
import { Option, Schema as
|
|
929
|
+
import { Option, Schema as Schema5 } from "effect";
|
|
786
930
|
|
|
787
931
|
// ../../src/lib/email-document/legacy-rich-text/model.ts
|
|
788
|
-
import { Schema as
|
|
789
|
-
var sameMarks =
|
|
932
|
+
import { Schema as Schema4 } from "effect";
|
|
933
|
+
var sameMarks = Schema4.toEquivalence(RichTextMarks);
|
|
790
934
|
var richTextFromString = (text) => ({
|
|
791
935
|
version: 1,
|
|
792
936
|
blocks: text.split(/\r\n?|\n/).map((line) => ({
|
|
@@ -849,9 +993,9 @@ var fromTiptapDocument = (doc) => {
|
|
|
849
993
|
});
|
|
850
994
|
blocks.push({ type: block.attrs.kind, content });
|
|
851
995
|
});
|
|
852
|
-
return
|
|
996
|
+
return Schema5.decodeUnknownOption(RichTextDocument)({ version: 1, blocks });
|
|
853
997
|
};
|
|
854
|
-
var SingleLineDocument = RichTextDocument.check(
|
|
998
|
+
var SingleLineDocument = RichTextDocument.check(Schema5.makeFilter((value) => value.blocks.length === 1 && value.blocks.every((block) => block.type === "paragraph" && block.content.every((inline) => !inline.marks && (inline.type !== "text" || !/[\r\n]/.test(inline.text)))))).annotate({ identifier: "SingleLineRichTextDocument" });
|
|
855
999
|
var richTextExtensions = ({
|
|
856
1000
|
singleLine = false,
|
|
857
1001
|
maxLength = () => {
|
|
@@ -883,7 +1027,7 @@ var richTextExtensions = ({
|
|
|
883
1027
|
openOnClick: false,
|
|
884
1028
|
autolink: false,
|
|
885
1029
|
linkOnPaste: false,
|
|
886
|
-
isAllowedUri: (url) =>
|
|
1030
|
+
isAllowedUri: (url) => Schema5.is(RichTextLink)(url),
|
|
887
1031
|
HTMLAttributes: { class: "underline" }
|
|
888
1032
|
},
|
|
889
1033
|
undoRedo: { depth: 100 }
|
|
@@ -896,7 +1040,7 @@ var richTextExtensions = ({
|
|
|
896
1040
|
addAttributes: () => ({ kind: { default: "paragraph" } }),
|
|
897
1041
|
parseHTML: () => [{ tag: "p" }],
|
|
898
1042
|
renderHTML: ({ node }) => {
|
|
899
|
-
const kind =
|
|
1043
|
+
const kind = Schema5.decodeUnknownSync(RichTextBlockKind)(node.attrs.kind);
|
|
900
1044
|
if (kind === "heading")
|
|
901
1045
|
return ["h2", { class: "text-xl font-semibold" }, 0];
|
|
902
1046
|
return [
|
|
@@ -933,7 +1077,7 @@ var richTextExtensions = ({
|
|
|
933
1077
|
addAttributes: () => ({ key: { default: null } }),
|
|
934
1078
|
renderText: ({ node }) => `{{${node.attrs.key}}}`,
|
|
935
1079
|
renderHTML: ({ node }) => {
|
|
936
|
-
const key =
|
|
1080
|
+
const key = Schema5.decodeUnknownSync(Schema5.String)(node.attrs.key);
|
|
937
1081
|
return [
|
|
938
1082
|
"span",
|
|
939
1083
|
{
|
|
@@ -954,7 +1098,7 @@ var richTextExtensions = ({
|
|
|
954
1098
|
return true;
|
|
955
1099
|
const decoded = fromTiptapDocument(transaction.doc);
|
|
956
1100
|
const limit = maxLength();
|
|
957
|
-
const valid = Option.isSome(decoded) && (!singleLine ||
|
|
1101
|
+
const valid = Option.isSome(decoded) && (!singleLine || Schema5.is(SingleLineDocument)(decoded.value)) && (limit === undefined || richTextPlainText(decoded.value).length <= limit);
|
|
958
1102
|
onInvalid?.(!valid);
|
|
959
1103
|
return valid;
|
|
960
1104
|
}
|
|
@@ -1384,7 +1528,7 @@ var RichTextEditor = ({
|
|
|
1384
1528
|
size: "sm",
|
|
1385
1529
|
disabled,
|
|
1386
1530
|
onClick: () => {
|
|
1387
|
-
if (!
|
|
1531
|
+
if (!Schema6.is(RichTextLink)(link)) {
|
|
1388
1532
|
setLinkError(true);
|
|
1389
1533
|
return;
|
|
1390
1534
|
}
|
|
@@ -1492,92 +1636,92 @@ function TabsContent({ className, ...props }) {
|
|
|
1492
1636
|
});
|
|
1493
1637
|
}
|
|
1494
1638
|
|
|
1495
|
-
// ../../src/components/
|
|
1496
|
-
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
|
|
1639
|
+
// ../../src/components/email-editor/react.tsx
|
|
1640
|
+
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider/react";
|
|
1497
1641
|
|
|
1498
1642
|
// ../../src/lib/email-document/schema.ts
|
|
1499
|
-
import { Schema as
|
|
1500
|
-
var EmailImageUrl = RichTextLink.check(
|
|
1501
|
-
var EmailColor =
|
|
1502
|
-
var EmailAlignment =
|
|
1643
|
+
import { Schema as Schema7 } from "effect";
|
|
1644
|
+
var EmailImageUrl = RichTextLink.check(Schema7.isPattern(/^https:\/\//)).annotate({ identifier: "EmailImageUrl" });
|
|
1645
|
+
var EmailColor = Schema7.String.check(Schema7.isPattern(/^#[0-9a-fA-F]{6}$/)).annotate({ identifier: "EmailColor" });
|
|
1646
|
+
var EmailAlignment = Schema7.Literals([
|
|
1503
1647
|
"left",
|
|
1504
1648
|
"center",
|
|
1505
1649
|
"right"
|
|
1506
1650
|
]).annotate({ identifier: "EmailAlignment" });
|
|
1507
|
-
var EmailFont =
|
|
1651
|
+
var EmailFont = Schema7.Literals(["sans", "serif", "mono"]).annotate({
|
|
1508
1652
|
identifier: "EmailFont"
|
|
1509
1653
|
});
|
|
1510
|
-
var spacing =
|
|
1654
|
+
var spacing = Schema7.Int.check(Schema7.isBetween({ minimum: 0, maximum: 96 }));
|
|
1511
1655
|
var common = {
|
|
1512
|
-
id:
|
|
1656
|
+
id: Schema7.NonEmptyString.check(Schema7.isMaxLength(80)),
|
|
1513
1657
|
alignment: EmailAlignment,
|
|
1514
1658
|
paddingTop: spacing,
|
|
1515
1659
|
paddingBottom: spacing
|
|
1516
1660
|
};
|
|
1517
|
-
var EmailDestination =
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
type:
|
|
1661
|
+
var EmailDestination = Schema7.Union([
|
|
1662
|
+
Schema7.Struct({ type: Schema7.Literal("url"), url: RichTextLink }),
|
|
1663
|
+
Schema7.Struct({
|
|
1664
|
+
type: Schema7.Literal("variable"),
|
|
1521
1665
|
key: RichTextVariable.fields.key
|
|
1522
1666
|
})
|
|
1523
1667
|
]).annotate({ identifier: "EmailDestination" });
|
|
1524
|
-
var EmailElement =
|
|
1525
|
-
|
|
1668
|
+
var EmailElement = Schema7.Union([
|
|
1669
|
+
Schema7.Struct({
|
|
1526
1670
|
...common,
|
|
1527
|
-
type:
|
|
1671
|
+
type: Schema7.Literal("text"),
|
|
1528
1672
|
content: RichTextDocument
|
|
1529
1673
|
}),
|
|
1530
|
-
|
|
1674
|
+
Schema7.Struct({
|
|
1531
1675
|
...common,
|
|
1532
|
-
type:
|
|
1533
|
-
label:
|
|
1676
|
+
type: Schema7.Literal("button"),
|
|
1677
|
+
label: Schema7.String.check(Schema7.isMaxLength(200)),
|
|
1534
1678
|
destination: EmailDestination
|
|
1535
1679
|
}),
|
|
1536
|
-
|
|
1680
|
+
Schema7.Struct({
|
|
1537
1681
|
...common,
|
|
1538
|
-
type:
|
|
1682
|
+
type: Schema7.Literal("code"),
|
|
1539
1683
|
variable: RichTextVariable.fields.key
|
|
1540
1684
|
}),
|
|
1541
|
-
|
|
1685
|
+
Schema7.Struct({
|
|
1542
1686
|
...common,
|
|
1543
|
-
type:
|
|
1687
|
+
type: Schema7.Literals(["logo", "image"]),
|
|
1544
1688
|
src: EmailImageUrl,
|
|
1545
|
-
alt:
|
|
1546
|
-
width:
|
|
1689
|
+
alt: Schema7.String.check(Schema7.isMaxLength(200)),
|
|
1690
|
+
width: Schema7.Int.check(Schema7.isBetween({ minimum: 32, maximum: 560 }))
|
|
1547
1691
|
}),
|
|
1548
|
-
|
|
1549
|
-
|
|
1692
|
+
Schema7.Struct({ ...common, type: Schema7.Literal("divider") }),
|
|
1693
|
+
Schema7.Struct({ ...common, type: Schema7.Literal("spacer"), height: spacing })
|
|
1550
1694
|
]).annotate({ identifier: "EmailElement" });
|
|
1551
|
-
var subject =
|
|
1552
|
-
var EmailDocument =
|
|
1553
|
-
version:
|
|
1695
|
+
var subject = Schema7.String.check(Schema7.isMaxLength(200), Schema7.isPattern(/^[^\r\n]*$/));
|
|
1696
|
+
var EmailDocument = Schema7.Struct({
|
|
1697
|
+
version: Schema7.Literal(1),
|
|
1554
1698
|
subject,
|
|
1555
1699
|
preview: subject,
|
|
1556
|
-
appearance:
|
|
1700
|
+
appearance: Schema7.Struct({
|
|
1557
1701
|
background: EmailColor,
|
|
1558
1702
|
surface: EmailColor,
|
|
1559
1703
|
text: EmailColor,
|
|
1560
1704
|
primary: EmailColor,
|
|
1561
1705
|
primaryText: EmailColor,
|
|
1562
1706
|
font: EmailFont,
|
|
1563
|
-
radius:
|
|
1707
|
+
radius: Schema7.Int.check(Schema7.isBetween({ minimum: 0, maximum: 32 }))
|
|
1564
1708
|
}),
|
|
1565
|
-
elements:
|
|
1566
|
-
}).check(
|
|
1567
|
-
var EmailRenderInput =
|
|
1709
|
+
elements: Schema7.Array(EmailElement).check(Schema7.isMaxLength(40))
|
|
1710
|
+
}).check(Schema7.makeFilter((document2) => new Set(document2.elements.map((element) => element.id)).size === document2.elements.length)).annotate({ identifier: "EmailDocument" });
|
|
1711
|
+
var EmailRenderInput = Schema7.Struct({
|
|
1568
1712
|
document: EmailDocument,
|
|
1569
|
-
variables:
|
|
1570
|
-
values:
|
|
1571
|
-
requiredVariables:
|
|
1713
|
+
variables: Schema7.Array(RichTextVariable),
|
|
1714
|
+
values: Schema7.Record(Schema7.String, Schema7.String),
|
|
1715
|
+
requiredVariables: Schema7.optional(Schema7.Array(Schema7.String))
|
|
1572
1716
|
}).annotate({ identifier: "EmailRenderInput" });
|
|
1573
|
-
var EmailRenderResult =
|
|
1574
|
-
subject:
|
|
1575
|
-
html:
|
|
1576
|
-
text:
|
|
1717
|
+
var EmailRenderResult = Schema7.Struct({
|
|
1718
|
+
subject: Schema7.String,
|
|
1719
|
+
html: Schema7.String,
|
|
1720
|
+
text: Schema7.String
|
|
1577
1721
|
}).annotate({ identifier: "EmailRenderResult" });
|
|
1578
1722
|
|
|
1579
1723
|
// ../../src/lib/email-document/model.ts
|
|
1580
|
-
import { Schema as
|
|
1724
|
+
import { Schema as Schema8 } from "effect";
|
|
1581
1725
|
var emailElementTypes = [
|
|
1582
1726
|
"text",
|
|
1583
1727
|
"button",
|
|
@@ -1658,7 +1802,7 @@ var validateEmailDocument = ({
|
|
|
1658
1802
|
values,
|
|
1659
1803
|
requiredVariables = []
|
|
1660
1804
|
}) => {
|
|
1661
|
-
if (!
|
|
1805
|
+
if (!Schema8.is(EmailDocument)(document2))
|
|
1662
1806
|
return [{ code: "invalid-document" }];
|
|
1663
1807
|
const references = emailDocumentReferences(document2);
|
|
1664
1808
|
const issues = [];
|
|
@@ -1671,7 +1815,7 @@ var validateEmailDocument = ({
|
|
|
1671
1815
|
for (const element of document2.elements) {
|
|
1672
1816
|
if (element.type === "button" && element.destination.type === "variable") {
|
|
1673
1817
|
const key = element.destination.key;
|
|
1674
|
-
if (variables.find((variable) => variable.key === key)?.type !== "url" || values && !
|
|
1818
|
+
if (variables.find((variable) => variable.key === key)?.type !== "url" || values && !Schema8.is(RichTextLink)(values[key]))
|
|
1675
1819
|
issues.push({ code: "invalid-url", key });
|
|
1676
1820
|
}
|
|
1677
1821
|
}
|
|
@@ -1681,39 +1825,28 @@ var validateEmailDocument = ({
|
|
|
1681
1825
|
return issues;
|
|
1682
1826
|
};
|
|
1683
1827
|
|
|
1684
|
-
// ../../src/components/
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
onValueChange(value);
|
|
1699
|
-
},
|
|
1700
|
-
children: [
|
|
1701
|
-
/* @__PURE__ */ jsx9(SelectTrigger, {
|
|
1702
|
-
"aria-label": label,
|
|
1703
|
-
className: "w-full min-w-0 text-xs",
|
|
1704
|
-
children: /* @__PURE__ */ jsx9(SelectValue, {})
|
|
1705
|
-
}),
|
|
1706
|
-
/* @__PURE__ */ jsx9(SelectContent, {
|
|
1707
|
-
align: "start",
|
|
1708
|
-
alignItemWithTrigger: false,
|
|
1709
|
-
children: options.map((option) => /* @__PURE__ */ jsx9(SelectItem, {
|
|
1710
|
-
value: option.value,
|
|
1711
|
-
children: option.label
|
|
1712
|
-
}, option.value))
|
|
1713
|
-
})
|
|
1714
|
-
]
|
|
1828
|
+
// ../../src/components/email-editor/classes.ts
|
|
1829
|
+
var emailEditorClasses = {
|
|
1830
|
+
inspectorField: "grid min-w-0 gap-1.5 text-xs font-medium",
|
|
1831
|
+
inspector: "min-w-0 space-y-4",
|
|
1832
|
+
sectionHeading: "text-xs font-medium",
|
|
1833
|
+
previewPlaceholder: "p-8 text-center text-sm",
|
|
1834
|
+
image: "inline-block max-w-full",
|
|
1835
|
+
metadata: "text-muted-foreground text-xs",
|
|
1836
|
+
actionGrid: "grid grid-cols-2 gap-2",
|
|
1837
|
+
error: "text-destructive text-xs"
|
|
1838
|
+
};
|
|
1839
|
+
var resolveEmailEditorClasses = (overrides) => ({
|
|
1840
|
+
...emailEditorClasses,
|
|
1841
|
+
...overrides
|
|
1715
1842
|
});
|
|
1716
|
-
|
|
1843
|
+
|
|
1844
|
+
// ../../src/components/email-editor/index.ts
|
|
1845
|
+
import { Schema as Schema10 } from "effect";
|
|
1846
|
+
import { Component as Component3, UiSchema as UiSchema2 } from "effect/ui";
|
|
1847
|
+
|
|
1848
|
+
// ../../src/components/email-editor/labels.ts
|
|
1849
|
+
var defaultMessages = {
|
|
1717
1850
|
en: {
|
|
1718
1851
|
edit: "Design",
|
|
1719
1852
|
preview: "Preview",
|
|
@@ -1819,6 +1952,274 @@ var labels3 = {
|
|
|
1819
1952
|
local: "Glissez avec la poignée ou utilisez ses touches fléchées. Vos modifications restent dans cet éditeur."
|
|
1820
1953
|
}
|
|
1821
1954
|
};
|
|
1955
|
+
|
|
1956
|
+
// ../../src/components/email-editor/schema.ts
|
|
1957
|
+
import { Schema as Schema9, Struct as Struct2 } from "effect";
|
|
1958
|
+
var Overrides = Schema9.Struct({
|
|
1959
|
+
edit: Schema9.optional(Schema9.String),
|
|
1960
|
+
preview: Schema9.optional(Schema9.String),
|
|
1961
|
+
subject: Schema9.optional(Schema9.String),
|
|
1962
|
+
preheader: Schema9.optional(Schema9.String),
|
|
1963
|
+
add: Schema9.optional(Schema9.String),
|
|
1964
|
+
text: Schema9.optional(Schema9.String),
|
|
1965
|
+
button: Schema9.optional(Schema9.String),
|
|
1966
|
+
code: Schema9.optional(Schema9.String),
|
|
1967
|
+
logo: Schema9.optional(Schema9.String),
|
|
1968
|
+
image: Schema9.optional(Schema9.String),
|
|
1969
|
+
divider: Schema9.optional(Schema9.String),
|
|
1970
|
+
spacer: Schema9.optional(Schema9.String),
|
|
1971
|
+
content: Schema9.optional(Schema9.String),
|
|
1972
|
+
properties: Schema9.optional(Schema9.String),
|
|
1973
|
+
select: Schema9.optional(Schema9.String),
|
|
1974
|
+
alignment: Schema9.optional(Schema9.String),
|
|
1975
|
+
left: Schema9.optional(Schema9.String),
|
|
1976
|
+
center: Schema9.optional(Schema9.String),
|
|
1977
|
+
right: Schema9.optional(Schema9.String),
|
|
1978
|
+
paddingTop: Schema9.optional(Schema9.String),
|
|
1979
|
+
paddingBottom: Schema9.optional(Schema9.String),
|
|
1980
|
+
width: Schema9.optional(Schema9.String),
|
|
1981
|
+
height: Schema9.optional(Schema9.String),
|
|
1982
|
+
src: Schema9.optional(Schema9.String),
|
|
1983
|
+
alt: Schema9.optional(Schema9.String),
|
|
1984
|
+
label: Schema9.optional(Schema9.String),
|
|
1985
|
+
destination: Schema9.optional(Schema9.String),
|
|
1986
|
+
url: Schema9.optional(Schema9.String),
|
|
1987
|
+
variable: Schema9.optional(Schema9.String),
|
|
1988
|
+
insertVariable: Schema9.optional(Schema9.String),
|
|
1989
|
+
close: Schema9.optional(Schema9.String),
|
|
1990
|
+
duplicate: Schema9.optional(Schema9.String),
|
|
1991
|
+
remove: Schema9.optional(Schema9.String),
|
|
1992
|
+
background: Schema9.optional(Schema9.String),
|
|
1993
|
+
surface: Schema9.optional(Schema9.String),
|
|
1994
|
+
primary: Schema9.optional(Schema9.String),
|
|
1995
|
+
primaryText: Schema9.optional(Schema9.String),
|
|
1996
|
+
foreground: Schema9.optional(Schema9.String),
|
|
1997
|
+
font: Schema9.optional(Schema9.String),
|
|
1998
|
+
sans: Schema9.optional(Schema9.String),
|
|
1999
|
+
serif: Schema9.optional(Schema9.String),
|
|
2000
|
+
mono: Schema9.optional(Schema9.String),
|
|
2001
|
+
branding: Schema9.optional(Schema9.String),
|
|
2002
|
+
invalid: Schema9.optional(Schema9.String),
|
|
2003
|
+
newText: Schema9.optional(Schema9.String),
|
|
2004
|
+
newButton: Schema9.optional(Schema9.String),
|
|
2005
|
+
newImage: Schema9.optional(Schema9.String),
|
|
2006
|
+
empty: Schema9.optional(Schema9.String),
|
|
2007
|
+
editElement: Schema9.optional(Schema9.String),
|
|
2008
|
+
local: Schema9.optional(Schema9.String)
|
|
2009
|
+
});
|
|
2010
|
+
var EmailEditorClassesOverridesSchema = Schema9.Record(Schema9.Literals(Struct2.keys(emailEditorClasses)), Schema9.optionalKey(Schema9.String)).annotate({ identifier: "EmailEditorClassesOverrides" });
|
|
2011
|
+
var EmailEditorPropsSchema = Schema9.Struct({
|
|
2012
|
+
classes: Schema9.optional(EmailEditorClassesOverridesSchema),
|
|
2013
|
+
value: EmailDocument,
|
|
2014
|
+
variables: Schema9.optional(Schema9.Array(RichTextVariable)),
|
|
2015
|
+
requiredVariables: Schema9.optional(Schema9.Array(Schema9.String)),
|
|
2016
|
+
disabled: Schema9.optional(Schema9.Boolean),
|
|
2017
|
+
locale: Schema9.optional(Schema9.String),
|
|
2018
|
+
messages: Schema9.optional(Schema9.Record(Schema9.String, Schema9.UndefinedOr(Overrides)))
|
|
2019
|
+
}).annotate({ identifier: "EmailEditorProps" });
|
|
2020
|
+
|
|
2021
|
+
// ../../src/components/email-editor/index.ts
|
|
2022
|
+
var emailEditorMessages = (locale, messages) => ({
|
|
2023
|
+
...locale.startsWith("fr") ? defaultMessages.fr : defaultMessages.en,
|
|
2024
|
+
...messages?.[locale.split("-")[0] ?? locale],
|
|
2025
|
+
...messages?.[locale]
|
|
2026
|
+
});
|
|
2027
|
+
var fonts = {
|
|
2028
|
+
sans: "Arial, sans-serif",
|
|
2029
|
+
serif: "Georgia, serif",
|
|
2030
|
+
mono: "'Courier New', monospace"
|
|
2031
|
+
};
|
|
2032
|
+
var createElement = (type, id, copy, variables) => newEmailElement(type, {
|
|
2033
|
+
id,
|
|
2034
|
+
text: copy.newText,
|
|
2035
|
+
button: copy.newButton,
|
|
2036
|
+
imageAlt: copy.newImage,
|
|
2037
|
+
codeVariable: variables.find(({ key }) => key === "code")?.key ?? variables.find(({ type }) => type === "text")?.key,
|
|
2038
|
+
urlVariable: variables.find(({ type }) => type === "url")?.key
|
|
2039
|
+
});
|
|
2040
|
+
var replaceElement = (value, element) => ({
|
|
2041
|
+
...value,
|
|
2042
|
+
elements: value.elements.map((item) => item.id === element.id ? element : item)
|
|
2043
|
+
});
|
|
2044
|
+
var duplicateElement = (value, target, id) => ({
|
|
2045
|
+
...value,
|
|
2046
|
+
elements: value.elements.flatMap((item) => item.id === target ? [item, { ...item, id }] : [item])
|
|
2047
|
+
});
|
|
2048
|
+
var removeElement = (value, target) => ({
|
|
2049
|
+
...value,
|
|
2050
|
+
elements: value.elements.filter(({ id }) => id !== target)
|
|
2051
|
+
});
|
|
2052
|
+
var moveElement = (value, source, target) => {
|
|
2053
|
+
const from = value.elements.findIndex(({ id }) => id === source);
|
|
2054
|
+
const to = value.elements.findIndex(({ id }) => id === target);
|
|
2055
|
+
if (from < 0 || to < 0 || from === to)
|
|
2056
|
+
return value;
|
|
2057
|
+
const elements = [...value.elements];
|
|
2058
|
+
const [element] = elements.splice(from, 1);
|
|
2059
|
+
if (!element)
|
|
2060
|
+
return value;
|
|
2061
|
+
elements.splice(to, 0, element);
|
|
2062
|
+
return { ...value, elements };
|
|
2063
|
+
};
|
|
2064
|
+
var initialActive = (value) => value.elements.find(({ type }) => type === "text")?.id ?? null;
|
|
2065
|
+
var EmailEditorEvents = UiSchema2.TaggedEnum({
|
|
2066
|
+
Changed: { value: EmailDocument }
|
|
2067
|
+
}).annotate({ identifier: "EmailEditorEvents" });
|
|
2068
|
+
var EmailEditorMessage = UiSchema2.TaggedEnum({
|
|
2069
|
+
Mode: { mode: Schema10.Literals(["design", "preview"]) },
|
|
2070
|
+
SetDesignPopover: {
|
|
2071
|
+
popover: Schema10.Literals(["add", "branding"]),
|
|
2072
|
+
open: Schema10.Boolean
|
|
2073
|
+
},
|
|
2074
|
+
Select: { id: Schema10.String },
|
|
2075
|
+
Close: {},
|
|
2076
|
+
Add: {
|
|
2077
|
+
id: Schema10.String,
|
|
2078
|
+
kind: Schema10.Literals(emailElementTypes),
|
|
2079
|
+
text: Schema10.String,
|
|
2080
|
+
button: Schema10.String,
|
|
2081
|
+
image: Schema10.String
|
|
2082
|
+
},
|
|
2083
|
+
Duplicate: { id: Schema10.String, target: Schema10.String },
|
|
2084
|
+
Remove: { id: Schema10.String },
|
|
2085
|
+
Move: { source: Schema10.String, target: Schema10.String },
|
|
2086
|
+
Content: { id: Schema10.String, content: RichTextDocument },
|
|
2087
|
+
Header: {
|
|
2088
|
+
key: Schema10.Literals(["subject", "preview"]),
|
|
2089
|
+
content: RichTextDocument
|
|
2090
|
+
},
|
|
2091
|
+
Appearance: {
|
|
2092
|
+
key: Schema10.Literals([
|
|
2093
|
+
"background",
|
|
2094
|
+
"surface",
|
|
2095
|
+
"primary",
|
|
2096
|
+
"primaryText",
|
|
2097
|
+
"text",
|
|
2098
|
+
"font"
|
|
2099
|
+
]),
|
|
2100
|
+
value: Schema10.String
|
|
2101
|
+
},
|
|
2102
|
+
Setting: {
|
|
2103
|
+
id: Schema10.String,
|
|
2104
|
+
key: Schema10.Literals([
|
|
2105
|
+
"alignment",
|
|
2106
|
+
"paddingTop",
|
|
2107
|
+
"paddingBottom",
|
|
2108
|
+
"label",
|
|
2109
|
+
"destination",
|
|
2110
|
+
"url",
|
|
2111
|
+
"variable",
|
|
2112
|
+
"src",
|
|
2113
|
+
"alt",
|
|
2114
|
+
"width",
|
|
2115
|
+
"height"
|
|
2116
|
+
]),
|
|
2117
|
+
value: Schema10.String
|
|
2118
|
+
}
|
|
2119
|
+
}).annotate({ identifier: "EmailEditorMessage" });
|
|
2120
|
+
var emailEditorOptions = {
|
|
2121
|
+
name: "EmailEditor",
|
|
2122
|
+
props: EmailEditorPropsSchema,
|
|
2123
|
+
model: Schema10.Struct({
|
|
2124
|
+
active: Schema10.NullOr(Schema10.String),
|
|
2125
|
+
settingsOpen: Schema10.Boolean,
|
|
2126
|
+
mode: Schema10.Literals(["design", "preview"]),
|
|
2127
|
+
designPopover: Schema10.NullOr(Schema10.Literals(["add", "branding"]))
|
|
2128
|
+
}).annotate({ identifier: "EmailEditorModel" }),
|
|
2129
|
+
message: EmailEditorMessage,
|
|
2130
|
+
events: EmailEditorEvents,
|
|
2131
|
+
restore: false
|
|
2132
|
+
};
|
|
2133
|
+
var update2 = Component3.define(emailEditorOptions).update({
|
|
2134
|
+
Mode: ($, { mode }) => $.evolve({ mode, designPopover: null }),
|
|
2135
|
+
SetDesignPopover: ($, { popover, open }) => $.evolve({
|
|
2136
|
+
designPopover: open ? popover : $.model.designPopover === popover ? null : $.model.designPopover
|
|
2137
|
+
}),
|
|
2138
|
+
Select: ($, { id }) => $.props.disabled ? $.model : $.evolve({ active: id, settingsOpen: true }),
|
|
2139
|
+
Close: ($) => $.evolve({ settingsOpen: false }),
|
|
2140
|
+
Add: ($, { kind, id, text, button, image }) => $.props.disabled || $.props.value.elements.length >= 40 ? $.model : $.evolve({ active: id, designPopover: null }).emit(EmailEditorEvents.Changed({
|
|
2141
|
+
value: {
|
|
2142
|
+
...$.props.value,
|
|
2143
|
+
elements: [
|
|
2144
|
+
...$.props.value.elements,
|
|
2145
|
+
createElement(kind, id, { newText: text, newButton: button, newImage: image }, $.props.variables ?? [])
|
|
2146
|
+
]
|
|
2147
|
+
}
|
|
2148
|
+
})),
|
|
2149
|
+
Duplicate: ($, { id, target }) => $.props.disabled || $.props.value.elements.length >= 40 ? $.model : $.evolve({ active: id }).emit(EmailEditorEvents.Changed({
|
|
2150
|
+
value: duplicateElement($.props.value, target, id)
|
|
2151
|
+
})),
|
|
2152
|
+
Remove: ($, { id }) => $.props.disabled ? $.model : $.evolve({ active: null, settingsOpen: false }).emit(EmailEditorEvents.Changed({
|
|
2153
|
+
value: removeElement($.props.value, id)
|
|
2154
|
+
})),
|
|
2155
|
+
Move: ($, { source, target }) => {
|
|
2156
|
+
const value = moveElement($.props.value, source, target);
|
|
2157
|
+
return $.props.disabled || value === $.props.value ? $.model : $.set($.model).emit(EmailEditorEvents.Changed({ value }));
|
|
2158
|
+
},
|
|
2159
|
+
Content: ($, { id, content }) => {
|
|
2160
|
+
const element = $.props.value.elements.find((item) => item.id === id);
|
|
2161
|
+
return $.props.disabled || element?.type !== "text" ? $.model : $.set($.model).emit(EmailEditorEvents.Changed({
|
|
2162
|
+
value: replaceElement($.props.value, { ...element, content })
|
|
2163
|
+
}));
|
|
2164
|
+
},
|
|
2165
|
+
Header: ($, { key, content }) => $.props.disabled ? $.model : $.set($.model).emit(EmailEditorEvents.Changed({
|
|
2166
|
+
value: { ...$.props.value, [key]: richTextPlainText(content) }
|
|
2167
|
+
})),
|
|
2168
|
+
Appearance: ($, { key, value }) => $.props.disabled ? $.model : $.set($.model).emit(EmailEditorEvents.Changed({
|
|
2169
|
+
value: {
|
|
2170
|
+
...$.props.value,
|
|
2171
|
+
appearance: { ...$.props.value.appearance, [key]: value }
|
|
2172
|
+
}
|
|
2173
|
+
})),
|
|
2174
|
+
Setting: ($, { id, key, value }) => {
|
|
2175
|
+
const element = $.props.value.elements.find((item) => item.id === id);
|
|
2176
|
+
if ($.props.disabled || !element)
|
|
2177
|
+
return $.model;
|
|
2178
|
+
const updated = key === "destination" && element.type === "button" ? {
|
|
2179
|
+
...element,
|
|
2180
|
+
destination: value === "__url" ? { type: "url", url: "https://example.com" } : { type: "variable", key: value }
|
|
2181
|
+
} : key === "url" && element.type === "button" ? { ...element, destination: { type: "url", url: value } } : {
|
|
2182
|
+
...element,
|
|
2183
|
+
[key]: key === "width" || key === "height" || key === "paddingTop" || key === "paddingBottom" ? value === "" ? 0 : Number(value) : value
|
|
2184
|
+
};
|
|
2185
|
+
return $.set($.model).emit(EmailEditorEvents.Changed({
|
|
2186
|
+
value: replaceElement($.props.value, updated)
|
|
2187
|
+
}));
|
|
2188
|
+
}
|
|
2189
|
+
});
|
|
2190
|
+
|
|
2191
|
+
// ../../src/components/email-editor/react.tsx
|
|
2192
|
+
import { jsx as jsx9, jsxs as jsxs5, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
2193
|
+
var EmailEditorSelect = ({
|
|
2194
|
+
label,
|
|
2195
|
+
value,
|
|
2196
|
+
options,
|
|
2197
|
+
disabled,
|
|
2198
|
+
onValueChange
|
|
2199
|
+
}) => /* @__PURE__ */ jsxs5(Select, {
|
|
2200
|
+
items: options,
|
|
2201
|
+
value,
|
|
2202
|
+
disabled,
|
|
2203
|
+
onValueChange: (value) => {
|
|
2204
|
+
if (value !== null)
|
|
2205
|
+
onValueChange(value);
|
|
2206
|
+
},
|
|
2207
|
+
children: [
|
|
2208
|
+
/* @__PURE__ */ jsx9(SelectTrigger, {
|
|
2209
|
+
"aria-label": label,
|
|
2210
|
+
className: "w-full min-w-0 text-xs",
|
|
2211
|
+
children: /* @__PURE__ */ jsx9(SelectValue, {})
|
|
2212
|
+
}),
|
|
2213
|
+
/* @__PURE__ */ jsx9(SelectContent, {
|
|
2214
|
+
align: "start",
|
|
2215
|
+
alignItemWithTrigger: false,
|
|
2216
|
+
children: options.map((option) => /* @__PURE__ */ jsx9(SelectItem, {
|
|
2217
|
+
value: option.value,
|
|
2218
|
+
children: option.label
|
|
2219
|
+
}, option.value))
|
|
2220
|
+
})
|
|
2221
|
+
]
|
|
2222
|
+
});
|
|
1822
2223
|
var icons = {
|
|
1823
2224
|
text: Type,
|
|
1824
2225
|
button: MousePointer2,
|
|
@@ -1828,12 +2229,8 @@ var icons = {
|
|
|
1828
2229
|
divider: Minus,
|
|
1829
2230
|
spacer: Space
|
|
1830
2231
|
};
|
|
1831
|
-
var fonts = {
|
|
1832
|
-
sans: "Arial, sans-serif",
|
|
1833
|
-
serif: "Georgia, serif",
|
|
1834
|
-
mono: "'Courier New', monospace"
|
|
1835
|
-
};
|
|
1836
2232
|
var EmailEditor = ({
|
|
2233
|
+
classes: classOverrides,
|
|
1837
2234
|
value,
|
|
1838
2235
|
onChange,
|
|
1839
2236
|
variables = [],
|
|
@@ -1843,13 +2240,10 @@ var EmailEditor = ({
|
|
|
1843
2240
|
locale: override,
|
|
1844
2241
|
messages
|
|
1845
2242
|
}) => {
|
|
2243
|
+
const emailEditorClasses = resolveEmailEditorClasses(classOverrides);
|
|
1846
2244
|
const locale = useKrakstackLocale3(override);
|
|
1847
|
-
const copy =
|
|
1848
|
-
|
|
1849
|
-
...messages?.[locale.split("-")[0] ?? locale],
|
|
1850
|
-
...messages?.[locale]
|
|
1851
|
-
};
|
|
1852
|
-
const [active, setActive] = useState4(value.elements.find((element) => element.type === "text")?.id ?? null);
|
|
2245
|
+
const copy = emailEditorMessages(locale, messages);
|
|
2246
|
+
const [active, setActive] = useState4(() => initialActive(value));
|
|
1853
2247
|
const selected = value.elements.find((element) => element.id === active);
|
|
1854
2248
|
const [view, setView] = useState4("design");
|
|
1855
2249
|
const canvas = useRef3(null);
|
|
@@ -1869,25 +2263,15 @@ var EmailEditor = ({
|
|
|
1869
2263
|
const [insertOpen, setInsertOpen] = useState4(false);
|
|
1870
2264
|
const update = (element) => {
|
|
1871
2265
|
if (!disabled)
|
|
1872
|
-
onChange(
|
|
1873
|
-
...value,
|
|
1874
|
-
elements: value.elements.map((item) => item.id === element.id ? element : item)
|
|
1875
|
-
});
|
|
2266
|
+
onChange(replaceElement(value, element));
|
|
1876
2267
|
};
|
|
1877
2268
|
const add = (type) => {
|
|
1878
|
-
const element =
|
|
1879
|
-
id: crypto.randomUUID(),
|
|
1880
|
-
text: copy.newText,
|
|
1881
|
-
button: copy.newButton,
|
|
1882
|
-
imageAlt: copy.newImage,
|
|
1883
|
-
codeVariable: variables.find((variable) => variable.key === "code")?.key ?? variables.find((variable) => variable.type === "text")?.key,
|
|
1884
|
-
urlVariable: variables.find((variable) => variable.type === "url")?.key
|
|
1885
|
-
});
|
|
2269
|
+
const element = createElement(type, crypto.randomUUID(), copy, variables);
|
|
1886
2270
|
onChange({ ...value, elements: [...value.elements, element] });
|
|
1887
2271
|
setActive(element.id);
|
|
1888
2272
|
};
|
|
1889
2273
|
const field = (label, control) => /* @__PURE__ */ jsxs5("label", {
|
|
1890
|
-
className:
|
|
2274
|
+
className: emailEditorClasses.inspectorField,
|
|
1891
2275
|
children: [
|
|
1892
2276
|
label,
|
|
1893
2277
|
control
|
|
@@ -1900,7 +2284,7 @@ var EmailEditor = ({
|
|
|
1900
2284
|
};
|
|
1901
2285
|
return /* @__PURE__ */ jsxs5("div", {
|
|
1902
2286
|
"data-slot": "email-editor",
|
|
1903
|
-
className:
|
|
2287
|
+
className: emailEditorClasses.inspector,
|
|
1904
2288
|
children: [
|
|
1905
2289
|
/* @__PURE__ */ jsxs5(Tabs, {
|
|
1906
2290
|
value: view,
|
|
@@ -1938,7 +2322,7 @@ var EmailEditor = ({
|
|
|
1938
2322
|
className: "min-w-0 space-y-1.5",
|
|
1939
2323
|
children: [
|
|
1940
2324
|
/* @__PURE__ */ jsx9("p", {
|
|
1941
|
-
className:
|
|
2325
|
+
className: emailEditorClasses.sectionHeading,
|
|
1942
2326
|
children: label
|
|
1943
2327
|
}),
|
|
1944
2328
|
/* @__PURE__ */ jsx9(RichTextEditor, {
|
|
@@ -2081,7 +2465,7 @@ var EmailEditor = ({
|
|
|
2081
2465
|
...value,
|
|
2082
2466
|
appearance: {
|
|
2083
2467
|
...value.appearance,
|
|
2084
|
-
font:
|
|
2468
|
+
font: Schema11.decodeUnknownSync(EmailFont)(font)
|
|
2085
2469
|
}
|
|
2086
2470
|
})
|
|
2087
2471
|
}))
|
|
@@ -2101,19 +2485,19 @@ var EmailEditor = ({
|
|
|
2101
2485
|
"data-slot": "email-editor-canvas",
|
|
2102
2486
|
className: "min-w-0 rounded-xl border p-3 sm:p-4",
|
|
2103
2487
|
style: {
|
|
2104
|
-
backgroundColor:
|
|
2488
|
+
backgroundColor: Schema11.is(EmailColor)(value.appearance.background) ? value.appearance.background : "#f4f4f5"
|
|
2105
2489
|
},
|
|
2106
2490
|
children: /* @__PURE__ */ jsxs5("div", {
|
|
2107
2491
|
className: "min-w-0 rounded-lg p-2 shadow-sm sm:p-3",
|
|
2108
2492
|
style: {
|
|
2109
2493
|
...canvasVariables,
|
|
2110
|
-
backgroundColor:
|
|
2111
|
-
color:
|
|
2494
|
+
backgroundColor: Schema11.is(EmailColor)(value.appearance.surface) ? value.appearance.surface : "#ffffff",
|
|
2495
|
+
color: Schema11.is(EmailColor)(value.appearance.text) ? value.appearance.text : "#18181b",
|
|
2112
2496
|
fontFamily: fonts[value.appearance.font]
|
|
2113
2497
|
},
|
|
2114
2498
|
children: [
|
|
2115
2499
|
!value.elements.length ? /* @__PURE__ */ jsx9("p", {
|
|
2116
|
-
className:
|
|
2500
|
+
className: emailEditorClasses.previewPlaceholder,
|
|
2117
2501
|
children: copy.empty
|
|
2118
2502
|
}) : null,
|
|
2119
2503
|
/* @__PURE__ */ jsx9(AnimatedList, {
|
|
@@ -2219,11 +2603,11 @@ var EmailEditor = ({
|
|
|
2219
2603
|
onClick: () => setActive(element.id),
|
|
2220
2604
|
className: "w-full rounded-lg border border-[#e5e7eb] p-4 font-mono text-xl tracking-[0.2em]",
|
|
2221
2605
|
children: `{{${element.variable}}}`
|
|
2222
|
-
}) : element.type === "image" || element.type === "logo" ?
|
|
2606
|
+
}) : element.type === "image" || element.type === "logo" ? Schema11.is(RichTextLink)(element.src) ? /* @__PURE__ */ jsx9("img", {
|
|
2223
2607
|
src: element.src,
|
|
2224
2608
|
alt: element.alt,
|
|
2225
2609
|
width: element.width,
|
|
2226
|
-
className:
|
|
2610
|
+
className: emailEditorClasses.image
|
|
2227
2611
|
}) : /* @__PURE__ */ jsx9(Image, {
|
|
2228
2612
|
className: "mx-auto size-8"
|
|
2229
2613
|
}) : element.type === "divider" ? /* @__PURE__ */ jsx9("hr", {
|
|
@@ -2275,7 +2659,7 @@ var EmailEditor = ({
|
|
|
2275
2659
|
]
|
|
2276
2660
|
}),
|
|
2277
2661
|
!selected ? /* @__PURE__ */ jsx9("p", {
|
|
2278
|
-
className:
|
|
2662
|
+
className: emailEditorClasses.metadata,
|
|
2279
2663
|
children: copy.select
|
|
2280
2664
|
}) : /* @__PURE__ */ jsxs5("div", {
|
|
2281
2665
|
className: "grid min-w-0 items-end gap-3 sm:grid-cols-2 [&>label]:min-w-0",
|
|
@@ -2290,11 +2674,11 @@ var EmailEditor = ({
|
|
|
2290
2674
|
})),
|
|
2291
2675
|
onValueChange: (alignment) => update({
|
|
2292
2676
|
...selected,
|
|
2293
|
-
alignment:
|
|
2677
|
+
alignment: Schema11.decodeUnknownSync(EmailAlignment)(alignment)
|
|
2294
2678
|
})
|
|
2295
2679
|
})),
|
|
2296
2680
|
/* @__PURE__ */ jsx9("div", {
|
|
2297
|
-
className:
|
|
2681
|
+
className: emailEditorClasses.actionGrid,
|
|
2298
2682
|
children: ["paddingTop", "paddingBottom"].map((key) => /* @__PURE__ */ jsxs5("label", {
|
|
2299
2683
|
className: "grid gap-1.5 text-[11px]",
|
|
2300
2684
|
children: [
|
|
@@ -2424,20 +2808,9 @@ var EmailEditor = ({
|
|
|
2424
2808
|
variant: "outline",
|
|
2425
2809
|
disabled: disabled || value.elements.length >= 40,
|
|
2426
2810
|
onClick: () => {
|
|
2427
|
-
const
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
};
|
|
2431
|
-
const index = value.elements.findIndex((element) => element.id === selected.id);
|
|
2432
|
-
onChange({
|
|
2433
|
-
...value,
|
|
2434
|
-
elements: [
|
|
2435
|
-
...value.elements.slice(0, index + 1),
|
|
2436
|
-
duplicate,
|
|
2437
|
-
...value.elements.slice(index + 1)
|
|
2438
|
-
]
|
|
2439
|
-
});
|
|
2440
|
-
setActive(duplicate.id);
|
|
2811
|
+
const id = crypto.randomUUID();
|
|
2812
|
+
onChange(duplicateElement(value, selected.id, id));
|
|
2813
|
+
setActive(id);
|
|
2441
2814
|
},
|
|
2442
2815
|
children: [
|
|
2443
2816
|
/* @__PURE__ */ jsx9(Copy, {
|
|
@@ -2454,10 +2827,7 @@ var EmailEditor = ({
|
|
|
2454
2827
|
disabled,
|
|
2455
2828
|
onClick: () => {
|
|
2456
2829
|
document.getElementById(`${id}-add`)?.focus();
|
|
2457
|
-
onChange(
|
|
2458
|
-
...value,
|
|
2459
|
-
elements: value.elements.filter((element) => element.id !== selected.id)
|
|
2460
|
-
});
|
|
2830
|
+
onChange(removeElement(value, selected.id));
|
|
2461
2831
|
setActive(null);
|
|
2462
2832
|
setSettingsOpen(false);
|
|
2463
2833
|
},
|
|
@@ -2480,7 +2850,7 @@ var EmailEditor = ({
|
|
|
2480
2850
|
]
|
|
2481
2851
|
}),
|
|
2482
2852
|
/* @__PURE__ */ jsx9("p", {
|
|
2483
|
-
className:
|
|
2853
|
+
className: emailEditorClasses.metadata,
|
|
2484
2854
|
children: copy.local
|
|
2485
2855
|
})
|
|
2486
2856
|
]
|
|
@@ -2489,7 +2859,7 @@ var EmailEditor = ({
|
|
|
2489
2859
|
}),
|
|
2490
2860
|
invalid ? /* @__PURE__ */ jsx9("p", {
|
|
2491
2861
|
role: "alert",
|
|
2492
|
-
className:
|
|
2862
|
+
className: emailEditorClasses.error,
|
|
2493
2863
|
children: copy.invalid
|
|
2494
2864
|
}) : null
|
|
2495
2865
|
]
|