themelia-react-ui 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +417 -0
- package/README.md +67 -16
- package/dist/{accordion-B-5Focs8.js → accordion-CQXVcd7Q.js} +15 -15
- package/dist/accordion-CQXVcd7Q.js.map +1 -0
- package/dist/action-menu-BTpyPWJ2.js +264 -0
- package/dist/action-menu-BTpyPWJ2.js.map +1 -0
- package/dist/affordance-geometry.generated-CCIXb2A1.js +68 -0
- package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
- package/dist/{ai-artifact-B5tPpXnS.js → ai-artifact-2PQ2fItc.js} +206 -215
- package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
- package/dist/{app-shell-at8Kt4l_.js → app-shell-BE_j8-AT.js} +11 -10
- package/dist/app-shell-BE_j8-AT.js.map +1 -0
- package/dist/{attachment-BO2R47wn.js → attachment-q69dlt5Y.js} +14 -14
- package/dist/attachment-q69dlt5Y.js.map +1 -0
- package/dist/auth-M3vGMgDR.js +723 -0
- package/dist/auth-M3vGMgDR.js.map +1 -0
- package/dist/{avatar-Bpzty83c.js → avatar-djdaaQ_s.js} +15 -13
- package/dist/avatar-djdaaQ_s.js.map +1 -0
- package/dist/{badge-BZXZT9wd.js → badge-0tATj-tW.js} +9 -9
- package/dist/badge-0tATj-tW.js.map +1 -0
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/buttons.js +3 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +33 -35
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +246 -222
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +3 -3
- package/dist/base/display.js +7 -7
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +94 -92
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +7 -4
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +53 -53
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +84 -82
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +7 -7
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +228 -219
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +182 -212
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +665 -620
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +2 -2
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +1439 -1553
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +88 -97
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BG_FfMK4.js} +10 -9
- package/dist/breadcrumbs-BG_FfMK4.js.map +1 -0
- package/dist/button-BS3KDg00.js +674 -0
- package/dist/button-BS3KDg00.js.map +1 -0
- package/dist/{button-BS6l5JUw.js → button-R9CCoH7A.js} +3 -3
- package/dist/button-R9CCoH7A.js.map +1 -0
- package/dist/buttons-DS0ZIwJ_.js +99 -0
- package/dist/buttons-DS0ZIwJ_.js.map +1 -0
- package/dist/{cards-Cum56XOF.js → cards-QoJ4syG9.js} +12 -12
- package/dist/{cards-Cum56XOF.js.map → cards-QoJ4syG9.js.map} +1 -1
- package/dist/chart-DwYRKKc-.js +152 -0
- package/dist/chart-DwYRKKc-.js.map +1 -0
- package/dist/checkbox-B7ygNTYp.js +35 -0
- package/dist/checkbox-B7ygNTYp.js.map +1 -0
- package/dist/choice-inputs-DrJ17tpL.js +752 -0
- package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
- package/dist/{code-block-xHKbAJDj.js → code-block-CD0B7M93.js} +27 -27
- package/dist/code-block-CD0B7M93.js.map +1 -0
- package/dist/{collapsible-DsnktFNv.js → collapsible-oMUGM4tr.js} +3 -3
- package/dist/{collapsible-DsnktFNv.js.map → collapsible-oMUGM4tr.js.map} +1 -1
- package/dist/{collection-content-C4fthJV_.js → collection-content-Ys-OZOkY.js} +3 -3
- package/dist/{collection-content-C4fthJV_.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
- package/dist/combobox-6dvVny2q.js +272 -0
- package/dist/combobox-6dvVny2q.js.map +1 -0
- package/dist/combobox-CB7039j7.js +865 -0
- package/dist/combobox-CB7039j7.js.map +1 -0
- package/dist/{command-C0xe7u9B.js → command-kPMPjIxJ.js} +35 -31
- package/dist/command-kPMPjIxJ.js.map +1 -0
- package/dist/{comments-DviPLnwy.js → comments-You0Bzbr.js} +434 -409
- package/dist/comments-You0Bzbr.js.map +1 -0
- package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
- package/dist/components/base/action-menu/action-menu.d.ts +7 -2
- package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
- package/dist/components/base/badge/badge.d.ts +1 -1
- package/dist/components/base/badge/badge.recipes.d.ts +4 -4
- package/dist/components/base/buttons/base-button.d.ts +7 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/buttons/button.recipes.d.ts +10 -19
- package/dist/components/base/buttons/button.variants.d.ts +1 -0
- package/dist/components/base/buttons/loader-button.d.ts +3 -1
- package/dist/components/base/buttons/text-button.d.ts +2 -2
- package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
- package/dist/components/base/cards/card.recipes.d.ts +13 -5
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
- package/dist/components/base/cards/smart-card.types.d.ts +1 -1
- package/dist/components/base/carousel/carousel.d.ts +3 -1
- package/dist/components/base/chart/chart.d.ts +7 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
- package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
- package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
- package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
- package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
- package/dist/components/base/date-pickers/datepicker.types.d.ts +16 -3
- package/dist/components/base/display/alert-dialog.d.ts +8 -2
- package/dist/components/base/display/content-block.d.ts +4 -2
- package/dist/components/base/display/date-block.d.ts +1 -1
- package/dist/components/base/display/dialog.d.ts +12 -5
- package/dist/components/base/display/surface-title.d.ts +6 -1
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -4
- package/dist/components/base/forms/form-field.d.ts +1 -0
- package/dist/components/base/forms/form-sizing.d.ts +35 -3
- package/dist/components/base/forms/workflow.d.ts +2 -0
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
- package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +4 -1
- package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
- package/dist/components/base/navigation/tabs.d.ts +3 -5
- package/dist/components/base/popover/popover.recipes.d.ts +3 -3
- package/dist/components/base/qr-code/qr-code.d.ts +2 -0
- package/dist/components/base/sheet/index.d.ts +29 -1
- package/dist/components/base/sheet/sheet.d.ts +14 -5
- package/dist/components/base/spinner/spinner.d.ts +3 -2
- package/dist/components/base/structure/structure.types.d.ts +1 -1
- package/dist/components/base/table/index.d.ts +1 -1
- package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
- package/dist/components/base/upload/upload.recipes.d.ts +11 -0
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
- package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
- package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
- package/dist/components/blocks/analytics/index.d.ts +1 -1
- package/dist/components/blocks/analytics/types.d.ts +1 -1
- package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
- package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
- package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
- package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
- package/dist/components/features/combobox/components/error-message.d.ts +1 -1
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
- package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
- package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.types.d.ts +9 -1
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
- package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
- package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
- package/dist/components/features/overlays/overlays.types.d.ts +46 -22
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/partials/index.d.ts +1 -1
- package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
- package/dist/components/features/products/partials/product-tone.d.ts +11 -1
- package/dist/components/features/products/products.types.d.ts +2 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
- package/dist/components/features/table/table.types.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
- package/dist/components/layout/auth/auth.types.d.ts +1 -0
- package/dist/components/layout/page/index.d.ts +1 -1
- package/dist/components/layout/page/page.d.ts +0 -1
- package/dist/components/layout/page/page.types.d.ts +62 -6
- package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
- package/dist/components/primitives/date.d.ts +16 -3
- package/dist/components/primitives/dimensions.d.ts +6 -0
- package/dist/components/primitives/duration.d.ts +6 -0
- package/dist/components/primitives/file-size.d.ts +6 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +11 -2
- package/dist/components/primitives/link.d.ts +7 -0
- package/dist/components/primitives/money.d.ts +29 -7
- package/dist/components/primitives/number.d.ts +17 -0
- package/dist/components/primitives/value-typography.d.ts +54 -0
- package/dist/components/primitives/value.d.ts +31 -6
- package/dist/components/typography/heading.d.ts +13 -2
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/label.d.ts +3 -0
- package/dist/components/typography/running-text.d.ts +12 -0
- package/dist/components/typography/text-link.d.ts +23 -1
- package/dist/components/typography/text.d.ts +12 -0
- package/dist/components/typography/text.styles.d.ts +37 -5
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/overlay.recipes.d.ts +15 -2
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/select.d.ts +3 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/table.d.ts +2 -1
- package/dist/container.recipes-D9t8MHR3.js +27 -0
- package/dist/container.recipes-D9t8MHR3.js.map +1 -0
- package/dist/{containers-6s-ucRQQ.js → containers-D_L4mTVb.js} +34 -57
- package/dist/containers-D_L4mTVb.js.map +1 -0
- package/dist/control-group-recipes-DBXmfh2E.js +21 -0
- package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
- package/dist/{copyable-B7SBXJMr.js → copyable-DDjTeW_j.js} +6 -6
- package/dist/{copyable-B7SBXJMr.js.map → copyable-DDjTeW_j.js.map} +1 -1
- package/dist/data-display-3xWQUnMA.js +1335 -0
- package/dist/data-display-3xWQUnMA.js.map +1 -0
- package/dist/date-picker-DrDFj8Lo.js +1527 -0
- package/dist/date-picker-DrDFj8Lo.js.map +1 -0
- package/dist/date-pickers-CnFCb0n2.js +174 -0
- package/dist/date-pickers-CnFCb0n2.js.map +1 -0
- package/dist/date-uf3z37Nm.js +144 -0
- package/dist/date-uf3z37Nm.js.map +1 -0
- package/dist/{display-CFM5myut.js → display-DrdvPwF0.js} +25 -25
- package/dist/display-DrdvPwF0.js.map +1 -0
- package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-CURh59jb.js} +22 -15
- package/dist/dropdown-menu-CURh59jb.js.map +1 -0
- package/dist/features/activities.js +177 -163
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +187 -183
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +25 -23
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +353 -355
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +346 -354
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +225 -227
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +29 -29
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +59 -58
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +898 -900
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1412 -1444
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +51 -49
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +103 -97
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +13 -13
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +187 -183
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +7 -7
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +508 -503
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-DWUkgEjR.js → feedback-C7nR0UtT.js} +30 -31
- package/dist/feedback-C7nR0UtT.js.map +1 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
- package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-C-MFBX_8.js} +5 -5
- package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
- package/dist/{filters-BhsUtsxW.js → filters-Da-gNPsE.js} +760 -765
- package/dist/filters-Da-gNPsE.js.map +1 -0
- package/dist/{form-field-Bn7ZH1rA.js → form-field-VZRULhUK.js} +20 -12
- package/dist/form-field-VZRULhUK.js.map +1 -0
- package/dist/form-sizing-uWP4lzVh.js +126 -0
- package/dist/form-sizing-uWP4lzVh.js.map +1 -0
- package/dist/{forms-B7pzS25o.js → forms-DDeEnXSY.js} +38 -38
- package/dist/forms-DDeEnXSY.js.map +1 -0
- package/dist/forms-numeric-D3CO60IF.js +905 -0
- package/dist/forms-numeric-D3CO60IF.js.map +1 -0
- package/dist/{header-C59QZyxV.js → header-2ycNqGOR.js} +42 -37
- package/dist/header-2ycNqGOR.js.map +1 -0
- package/dist/{hooks-CM1Vp9Pe.js → hooks-DQ5SPwZw.js} +2 -2
- package/dist/{hooks-CM1Vp9Pe.js.map → hooks-DQ5SPwZw.js.map} +1 -1
- package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
- package/dist/http-CdEIHyQf.js.map +1 -0
- package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-DKlaKXoo.js} +4 -4
- package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-BoLm9Hks.js +20 -0
- package/dist/input-BoLm9Hks.js.map +1 -0
- package/dist/input-DhQdBnV3.js +255 -0
- package/dist/input-DhQdBnV3.js.map +1 -0
- package/dist/item-xzh8Df65.js +264 -0
- package/dist/item-xzh8Df65.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +46 -10
- package/dist/lib/control-group-recipes.d.ts +22 -0
- package/dist/lib/field-affordance-recipes.d.ts +70 -2
- package/dist/lib/field-state-recipes.d.ts +6 -4
- package/dist/lib/format.d.ts +9 -0
- package/dist/lib/money-format.d.ts +30 -0
- package/dist/lib/navigation-row-recipes.d.ts +3 -2
- package/dist/lib/overlay-anatomy-recipes.d.ts +2 -2
- package/dist/lib/surface-recipes.d.ts +13 -8
- package/dist/lib/token-merge.generated.d.ts +144 -2
- package/dist/lib/track-recipes.d.ts +1 -1
- package/dist/lib/ui-provider/provider.d.ts +7 -2
- package/dist/lib/ui-provider/store.d.ts +6 -2
- package/dist/lib/ui-provider/types.d.ts +9 -4
- package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/media-gallery-DQUQ0m3O.js +201 -0
- package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
- package/dist/{mentions-B8Ko-fhS.js → mentions-DwnO1hh4.js} +40 -39
- package/dist/{mentions-B8Ko-fhS.js.map → mentions-DwnO1hh4.js.map} +1 -1
- package/dist/message-YfFmbXNP.js +127 -0
- package/dist/message-YfFmbXNP.js.map +1 -0
- package/dist/{navigation-BUIn2Qxx.js → navigation-Cbp5V8gG.js} +27 -28
- package/dist/navigation-Cbp5V8gG.js.map +1 -0
- package/dist/navigation-Cs1npsPm.js +300 -0
- package/dist/navigation-Cs1npsPm.js.map +1 -0
- package/dist/{navigation-row-recipes-GVh11KiT.js → navigation-row-recipes-DlU-4QYO.js} +3 -3
- package/dist/navigation-row-recipes-DlU-4QYO.js.map +1 -0
- package/dist/number-CKRBYmZK.js +352 -0
- package/dist/number-CKRBYmZK.js.map +1 -0
- package/dist/overlay.recipes-CNO2S9V6.js +34 -0
- package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
- package/dist/overlays-DhZO7N-I.js +994 -0
- package/dist/overlays-DhZO7N-I.js.map +1 -0
- package/dist/page-C6R_8jFt.js +325 -0
- package/dist/page-C6R_8jFt.js.map +1 -0
- package/dist/{page-header-DQRa0jug.js → page-header-hUTzcRZX.js} +12 -12
- package/dist/page-header-hUTzcRZX.js.map +1 -0
- package/dist/{pagination-C29vvt3I.js → pagination-Cm0jqa3I.js} +21 -21
- package/dist/pagination-Cm0jqa3I.js.map +1 -0
- package/dist/{popover-CoLDEg19.js → popover-Dcv_9jxr.js} +23 -22
- package/dist/popover-Dcv_9jxr.js.map +1 -0
- package/dist/{popover-menu-GLIQTJTx.js → popover-menu-DnRFKnHP.js} +6 -6
- package/dist/{popover-menu-GLIQTJTx.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
- package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-wmbvL8Ah.js} +5 -5
- package/dist/popover.recipes-wmbvL8Ah.js.map +1 -0
- package/dist/primitives-BHrwQXFC.js +379 -0
- package/dist/primitives-BHrwQXFC.js.map +1 -0
- package/dist/primitives.js +5 -5
- package/dist/{progress-BOe8l_FZ.js → progress-Br9WTFya.js} +12 -11
- package/dist/progress-Br9WTFya.js.map +1 -0
- package/dist/{receipt-BM8xsGFy.js → receipt-CV89q1fs.js} +8 -8
- package/dist/{receipt-BM8xsGFy.js.map → receipt-CV89q1fs.js.map} +1 -1
- package/dist/rich-text-editor-CF8QYt5p.js +574 -0
- package/dist/rich-text-editor-CF8QYt5p.js.map +1 -0
- package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-CnrbmTS1.js} +35 -26
- package/dist/rich-text-editor.recipes-CnrbmTS1.js.map +1 -0
- package/dist/{rich-text-B7sBAdDG.js → rich-text-j-FGAeZW.js} +4 -4
- package/dist/{rich-text-B7sBAdDG.js.map → rich-text-j-FGAeZW.js.map} +1 -1
- package/dist/{scroll-area-BheMQ270.js → scroll-area-DRdr16Pt.js} +3 -3
- package/dist/scroll-area-DRdr16Pt.js.map +1 -0
- package/dist/{separator-DO0EbCEm.js → separator-BMEvwnSX.js} +2 -2
- package/dist/{separator-DO0EbCEm.js.map → separator-BMEvwnSX.js.map} +1 -1
- package/dist/{separator-Gk_WXH-l.js → separator-Do5GWDYi.js} +4 -4
- package/dist/separator-Do5GWDYi.js.map +1 -0
- package/dist/services/actions/action-adapters.d.ts +4 -0
- package/dist/services/actions.js +8 -3
- package/dist/services/actions.js.map +1 -1
- package/dist/{settings-BnCyyPOJ.js → settings-DHk0L2MF.js} +20 -19
- package/dist/settings-DHk0L2MF.js.map +1 -0
- package/dist/sheet-DRFNY1_D.js +207 -0
- package/dist/sheet-DRFNY1_D.js.map +1 -0
- package/dist/sidebar-Cb8WzOvE.js +511 -0
- package/dist/sidebar-Cb8WzOvE.js.map +1 -0
- package/dist/{sidebar-DPR7fmqN.js → sidebar-Crc9M9JV.js} +220 -201
- package/dist/sidebar-Crc9M9JV.js.map +1 -0
- package/dist/{skeleton-CmT1ppqb.js → skeleton-DVMXr15h.js} +5 -5
- package/dist/{skeleton-CmT1ppqb.js.map → skeleton-DVMXr15h.js.map} +1 -1
- package/dist/smart-card-Bek-TwUp.js +599 -0
- package/dist/smart-card-Bek-TwUp.js.map +1 -0
- package/dist/{spinner-BY9HbUEh.js → spinner-CmTAbEp0.js} +8 -6
- package/dist/spinner-CmTAbEp0.js.map +1 -0
- package/dist/{structure-MvKVq-oL.js → structure-hzCW-XsV.js} +3 -3
- package/dist/{structure-MvKVq-oL.js.map → structure-hzCW-XsV.js.map} +1 -1
- package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
- package/dist/structure.recipes-EPz60cU8.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/surface-recipes-DOdoBXGm.js +28 -0
- package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
- package/dist/table-D6zKeYQX.js +162 -0
- package/dist/table-D6zKeYQX.js.map +1 -0
- package/dist/table-Dn4XSrSB.js +1444 -0
- package/dist/table-Dn4XSrSB.js.map +1 -0
- package/dist/tabs-Dk8E_knt.js +189 -0
- package/dist/tabs-Dk8E_knt.js.map +1 -0
- package/dist/text-inputs-BFpku0Qd.js +331 -0
- package/dist/text-inputs-BFpku0Qd.js.map +1 -0
- package/dist/{text.styles-BwB7vAF2.js → text.styles-g4He6UIW.js} +26 -15
- package/dist/text.styles-g4He6UIW.js.map +1 -0
- package/dist/theme.css +90 -124
- package/dist/themes/green.css +24 -0
- package/dist/{timelines-B9ICkQcV.js → timelines-CxuAFIc2.js} +97 -104
- package/dist/timelines-CxuAFIc2.js.map +1 -0
- package/dist/track-recipes-CDcKmndW.js +10 -0
- package/dist/track-recipes-CDcKmndW.js.map +1 -0
- package/dist/{tree-BdWSaoFT.js → tree-BotPlyiD.js} +13 -13
- package/dist/{tree-BdWSaoFT.js.map → tree-BotPlyiD.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CAr3dQhX.js +116 -0
- package/dist/typography-CAr3dQhX.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-CftIB6TY.js → ui-provider-D2_TeLqw.js} +22 -22
- package/dist/ui-provider-D2_TeLqw.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-D8Za5x_c.js → upload-B0WHW7ak.js} +278 -274
- package/dist/upload-B0WHW7ak.js.map +1 -0
- package/dist/{upload-queue-hIIYBLS7.js → upload-queue-BHZ_wBfd.js} +72 -75
- package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
- package/dist/{usage-card-DnmnJ58D.js → usage-card-U0YBLTNT.js} +31 -33
- package/dist/usage-card-U0YBLTNT.js.map +1 -0
- package/dist/utils-Cospvlj1.js +4445 -0
- package/dist/utils-Cospvlj1.js.map +1 -0
- package/dist/value-inputs-CjfzGMsN.js +854 -0
- package/dist/value-inputs-CjfzGMsN.js.map +1 -0
- package/dist/value-typography-Deb3yQZg.js +116 -0
- package/dist/value-typography-Deb3yQZg.js.map +1 -0
- package/dist/{workspace-C1PZmk8L.js → workspace-YoFjXi6i.js} +97 -105
- package/dist/workspace-YoFjXi6i.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +123 -119
- package/docs/consumer-skill/examples/analytics.tsx +34 -0
- package/docs/consumer-skill/examples/app-layout.tsx +42 -14
- package/docs/consumer-skill/examples/detail.tsx +20 -5
- package/docs/consumer-skill/examples/edit.tsx +1 -1
- package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
- package/docs/consumer-skill/examples/manifest.json +37 -3
- package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
- package/docs/consumer-skill/examples/website.tsx +56 -0
- package/docs/consumer-skill/references/analytics.md +70 -0
- package/docs/consumer-skill/references/composition.md +195 -9
- package/docs/consumer-skill/references/design-contract.md +33 -7
- package/docs/consumer-skill/references/discovery.md +80 -5
- package/docs/consumer-skill/references/installation.md +22 -0
- package/docs/consumer-skill/references/integration.md +46 -1
- package/docs/consumer-skill/references/public-api.json +2083 -237
- package/docs/consumer-skill/references/review.md +74 -6
- package/docs/consumer-skill/references/theming.md +59 -8
- package/docs/consumer-skill/references/tokens.json +180 -9
- package/docs/consumer-skill/references/workflows.md +34 -0
- package/docs/consumer-skill/scripts/check-composition.mjs +1 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +271 -18
- package/docs/consumer-skill/scripts/discovery.mjs +69 -9
- package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
- package/docs/consumer-skill/scripts/surface-policy.mjs +44 -0
- package/package.json +11 -6
- package/dist/accordion-B-5Focs8.js.map +0 -1
- package/dist/action-menu-Cx3SdfbN.js +0 -265
- package/dist/action-menu-Cx3SdfbN.js.map +0 -1
- package/dist/affordance-geometry.generated-D8Jcfb0G.js +0 -32
- package/dist/affordance-geometry.generated-D8Jcfb0G.js.map +0 -1
- package/dist/ai-artifact-B5tPpXnS.js.map +0 -1
- package/dist/app-shell-at8Kt4l_.js.map +0 -1
- package/dist/attachment-BO2R47wn.js.map +0 -1
- package/dist/auth-OFwWSAap.js +0 -704
- package/dist/auth-OFwWSAap.js.map +0 -1
- package/dist/avatar-Bpzty83c.js.map +0 -1
- package/dist/badge-BZXZT9wd.js.map +0 -1
- package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
- package/dist/button-BS6l5JUw.js.map +0 -1
- package/dist/buttons-Co6GavvM.js +0 -674
- package/dist/buttons-Co6GavvM.js.map +0 -1
- package/dist/chart-DVfcwQu6.js +0 -149
- package/dist/chart-DVfcwQu6.js.map +0 -1
- package/dist/checkbox-BavDRjF7.js +0 -34
- package/dist/checkbox-BavDRjF7.js.map +0 -1
- package/dist/choice-inputs-CC7XqPQO.js +0 -619
- package/dist/choice-inputs-CC7XqPQO.js.map +0 -1
- package/dist/code-block-xHKbAJDj.js.map +0 -1
- package/dist/combobox-DEbdr-3u.js +0 -273
- package/dist/combobox-DEbdr-3u.js.map +0 -1
- package/dist/combobox-xv3yJbzl.js +0 -850
- package/dist/combobox-xv3yJbzl.js.map +0 -1
- package/dist/command-C0xe7u9B.js.map +0 -1
- package/dist/comments-DviPLnwy.js.map +0 -1
- package/dist/containers-6s-ucRQQ.js.map +0 -1
- package/dist/data-display-cWIRdeaf.js +0 -1129
- package/dist/data-display-cWIRdeaf.js.map +0 -1
- package/dist/date-BFNMnrS5.js +0 -140
- package/dist/date-BFNMnrS5.js.map +0 -1
- package/dist/date-picker-CA6ogMQB.js +0 -1521
- package/dist/date-picker-CA6ogMQB.js.map +0 -1
- package/dist/date-pickers-BPIKLdsD.js +0 -224
- package/dist/date-pickers-BPIKLdsD.js.map +0 -1
- package/dist/display-CFM5myut.js.map +0 -1
- package/dist/dropdown-menu-BlnyHr-9.js.map +0 -1
- package/dist/feedback-DWUkgEjR.js.map +0 -1
- package/dist/field-affordance-recipes-IjzPrCTw.js +0 -17
- package/dist/field-affordance-recipes-IjzPrCTw.js.map +0 -1
- package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
- package/dist/filters-BhsUtsxW.js.map +0 -1
- package/dist/form-field-Bn7ZH1rA.js.map +0 -1
- package/dist/form-sizing-BWs70_a2.js +0 -100
- package/dist/form-sizing-BWs70_a2.js.map +0 -1
- package/dist/format-iamDSqs2.js +0 -110
- package/dist/format-iamDSqs2.js.map +0 -1
- package/dist/forms-B7pzS25o.js.map +0 -1
- package/dist/forms-numeric-BUBxELBv.js +0 -867
- package/dist/forms-numeric-BUBxELBv.js.map +0 -1
- package/dist/header-C59QZyxV.js.map +0 -1
- package/dist/http-CLTVJc5I.js.map +0 -1
- package/dist/input-WwYQZJzG.js +0 -202
- package/dist/input-WwYQZJzG.js.map +0 -1
- package/dist/input-ci9fIgFH.js +0 -20
- package/dist/input-ci9fIgFH.js.map +0 -1
- package/dist/item-pJ0GsOiJ.js +0 -257
- package/dist/item-pJ0GsOiJ.js.map +0 -1
- package/dist/media-gallery-DhDRgnVZ.js +0 -200
- package/dist/media-gallery-DhDRgnVZ.js.map +0 -1
- package/dist/message-COsdEvXT.js +0 -108
- package/dist/message-COsdEvXT.js.map +0 -1
- package/dist/navigation-BUIn2Qxx.js.map +0 -1
- package/dist/navigation-DBEu4POU.js +0 -267
- package/dist/navigation-DBEu4POU.js.map +0 -1
- package/dist/navigation-row-recipes-GVh11KiT.js.map +0 -1
- package/dist/number-BNT_BIzJ.js +0 -269
- package/dist/number-BNT_BIzJ.js.map +0 -1
- package/dist/overlay.recipes-BxW5FIfK.js +0 -6
- package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
- package/dist/overlays-B11wZka6.js +0 -982
- package/dist/overlays-B11wZka6.js.map +0 -1
- package/dist/page-BV6ioQg3.js +0 -202
- package/dist/page-BV6ioQg3.js.map +0 -1
- package/dist/page-header-DQRa0jug.js.map +0 -1
- package/dist/pagination-C29vvt3I.js.map +0 -1
- package/dist/popover-CoLDEg19.js.map +0 -1
- package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
- package/dist/primitives-DKPOGVpj.js +0 -330
- package/dist/primitives-DKPOGVpj.js.map +0 -1
- package/dist/progress-BOe8l_FZ.js.map +0 -1
- package/dist/rich-text-editor-CoVrTiSv.js +0 -575
- package/dist/rich-text-editor-CoVrTiSv.js.map +0 -1
- package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
- package/dist/scroll-area-BheMQ270.js.map +0 -1
- package/dist/select-B2mb-qN2.js +0 -108
- package/dist/select-B2mb-qN2.js.map +0 -1
- package/dist/separator-Gk_WXH-l.js.map +0 -1
- package/dist/settings-BnCyyPOJ.js.map +0 -1
- package/dist/sheet-B-q914Ad.js +0 -205
- package/dist/sheet-B-q914Ad.js.map +0 -1
- package/dist/sidebar-C_2p3Tfj.js +0 -501
- package/dist/sidebar-C_2p3Tfj.js.map +0 -1
- package/dist/sidebar-DPR7fmqN.js.map +0 -1
- package/dist/smart-card-CYLn46e6.js +0 -578
- package/dist/smart-card-CYLn46e6.js.map +0 -1
- package/dist/spinner-BY9HbUEh.js.map +0 -1
- package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
- package/dist/surface-recipes-CQfRr-VL.js +0 -27
- package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
- package/dist/table-BS39xnlq.js +0 -1424
- package/dist/table-BS39xnlq.js.map +0 -1
- package/dist/table-DnlAJ-xR.js +0 -146
- package/dist/table-DnlAJ-xR.js.map +0 -1
- package/dist/tabs-B5cNMWiP.js +0 -187
- package/dist/tabs-B5cNMWiP.js.map +0 -1
- package/dist/text-inputs-Dh9XGyiS.js +0 -331
- package/dist/text-inputs-Dh9XGyiS.js.map +0 -1
- package/dist/text.styles-BwB7vAF2.js.map +0 -1
- package/dist/timelines-B9ICkQcV.js.map +0 -1
- package/dist/track-recipes-LLPNVwFg.js +0 -10
- package/dist/track-recipes-LLPNVwFg.js.map +0 -1
- package/dist/typography-Cv8MT-82.js +0 -96
- package/dist/typography-Cv8MT-82.js.map +0 -1
- package/dist/ui-provider-CftIB6TY.js.map +0 -1
- package/dist/upload-D8Za5x_c.js.map +0 -1
- package/dist/upload-queue-hIIYBLS7.js.map +0 -1
- package/dist/usage-card-DnmnJ58D.js.map +0 -1
- package/dist/utils-C2EKeIw3.js +0 -72
- package/dist/utils-C2EKeIw3.js.map +0 -1
- package/dist/value-inputs-DX2dbxjj.js +0 -824
- package/dist/value-inputs-DX2dbxjj.js.map +0 -1
- package/dist/workspace-C1PZmk8L.js.map +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "../lib/strings.js";
|
|
3
|
-
import { t } from "../utils-
|
|
4
|
-
import { n } from "../
|
|
5
|
-
import {
|
|
6
|
-
import { i, t as a } from "../structure-
|
|
7
|
-
import {
|
|
8
|
-
import { n as u, t as d } from "../feedback-
|
|
9
|
-
import { n as f, t as p } from "../action-menu-
|
|
10
|
-
import { n as m, r as h, t as g } from "../overlays-
|
|
3
|
+
import { t } from "../utils-Cospvlj1.js";
|
|
4
|
+
import { s as n } from "../typography-CAr3dQhX.js";
|
|
5
|
+
import { t as r } from "../button-BS3KDg00.js";
|
|
6
|
+
import { i, t as a } from "../structure-hzCW-XsV.js";
|
|
7
|
+
import { h as o, p as s, t as c, v as l } from "../smart-card-Bek-TwUp.js";
|
|
8
|
+
import { n as u, t as d } from "../feedback-C7nR0UtT.js";
|
|
9
|
+
import { n as f, t as p } from "../action-menu-BTpyPWJ2.js";
|
|
10
|
+
import { n as m, r as h, t as g } from "../overlays-DhZO7N-I.js";
|
|
11
11
|
import { n as _ } from "../content-typography-CnwgMJ37.js";
|
|
12
|
-
import { t as v } from "../accordion-
|
|
13
|
-
import { t as y } from "../input-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { i as
|
|
19
|
-
import { t as
|
|
20
|
-
import { n as
|
|
21
|
-
import { t as
|
|
22
|
-
import { a as
|
|
23
|
-
import { useEffect as
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import { Bold as
|
|
26
|
-
import { EditorContent as
|
|
27
|
-
import
|
|
12
|
+
import { t as v } from "../accordion-CQXVcd7Q.js";
|
|
13
|
+
import { t as y } from "../input-DhQdBnV3.js";
|
|
14
|
+
import { t as b } from "../form-field-VZRULhUK.js";
|
|
15
|
+
import { a as x, c as S, d as C, o as w, s as T } from "../text-inputs-BFpku0Qd.js";
|
|
16
|
+
import { c as E } from "../choice-inputs-DrJ17tpL.js";
|
|
17
|
+
import { t as ee } from "../scroll-area-DRdr16Pt.js";
|
|
18
|
+
import { i as D, n as O, r as te, t as k } from "../tabs-Dk8E_knt.js";
|
|
19
|
+
import { t as A } from "../popover-menu-DnRFKnHP.js";
|
|
20
|
+
import { n as j, t as M } from "../rich-text-editor.recipes-CnrbmTS1.js";
|
|
21
|
+
import { t as N } from "../rich-text-editor.strings-BpnIQgMl.js";
|
|
22
|
+
import { a as P, c as F, i as I, l as L, n as R, o as z, r as B, s as V, t as H, u as U } from "../http-CdEIHyQf.js";
|
|
23
|
+
import { useEffect as W, useId as G, useImperativeHandle as K, useMemo as ne, useRef as q, useState as J } from "react";
|
|
24
|
+
import { Fragment as Y, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
25
|
+
import { Bold as re, Italic as ie, Link as ae, List as oe, ListOrdered as se, Plus as ce, Redo2 as le, Undo2 as ue, X as de } from "lucide-react";
|
|
26
|
+
import { EditorContent as fe, Node as pe, generateJSON as me, mergeAttributes as he, useEditor as ge } from "@tiptap/react";
|
|
27
|
+
import _e from "@tiptap/starter-kit";
|
|
28
28
|
//#region src/components/features/email-composer/partials/data-status.tsx
|
|
29
29
|
function Q(e) {
|
|
30
30
|
return !!(e?.loading || e?.error);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return e?.loading ? /* @__PURE__ */
|
|
32
|
+
function ve({ state: e, label: t, retryLabel: n, report: r }) {
|
|
33
|
+
return e?.loading ? /* @__PURE__ */ X(u, { label: t }) : e?.error ? /* @__PURE__ */ X(d, {
|
|
34
34
|
variant: "inline",
|
|
35
35
|
description: e.error,
|
|
36
36
|
retryLabel: n,
|
|
@@ -41,8 +41,8 @@ function ye({ state: e, label: t, retryLabel: n, report: r }) {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/components/features/email-composer/use-composer.ts
|
|
44
|
-
function
|
|
45
|
-
let n = e(
|
|
44
|
+
function ye(t) {
|
|
45
|
+
let n = e(U, t.strings), r = q(null);
|
|
46
46
|
r.current ||= structuredClone({
|
|
47
47
|
to: [],
|
|
48
48
|
cc: [],
|
|
@@ -50,12 +50,12 @@ function be(t) {
|
|
|
50
50
|
subject: "",
|
|
51
51
|
body: {
|
|
52
52
|
kind: "rich",
|
|
53
|
-
document:
|
|
53
|
+
document: L
|
|
54
54
|
},
|
|
55
55
|
placeholderOverrides: {},
|
|
56
56
|
...t.value ?? t.defaultValue
|
|
57
57
|
});
|
|
58
|
-
let [i, a] =
|
|
58
|
+
let [i, a] = J(r.current), o = t.value ?? i, s = q({
|
|
59
59
|
props: t,
|
|
60
60
|
draft: o,
|
|
61
61
|
strings: n
|
|
@@ -65,26 +65,26 @@ function be(t) {
|
|
|
65
65
|
draft: o,
|
|
66
66
|
strings: n
|
|
67
67
|
};
|
|
68
|
-
let c =
|
|
68
|
+
let c = q(o);
|
|
69
69
|
t.value !== void 0 && (c.current = t.value);
|
|
70
|
-
let l =
|
|
71
|
-
|
|
70
|
+
let l = q(null), u = q(null), [d, f] = J(!1), [p, m] = J(""), [h, g] = J(""), [_, v] = J(!1), [y, b] = J([]), x = q(!0);
|
|
71
|
+
W(() => (x.current = !0, () => {
|
|
72
72
|
x.current = !1;
|
|
73
73
|
}), []);
|
|
74
|
-
let S =
|
|
74
|
+
let S = ne(() => {
|
|
75
75
|
let e = Object.create(null);
|
|
76
76
|
for (let r of t.placeholders?.sets ?? []) for (let t of Object.keys(r.definitions)) {
|
|
77
77
|
if (Object.hasOwn(e, t)) throw Error(n.duplicateVariable(t));
|
|
78
78
|
r.definitions[t] && (e[t] = r.definitions[t]);
|
|
79
79
|
}
|
|
80
80
|
return e;
|
|
81
|
-
}, [t.placeholders?.sets, n]), C =
|
|
81
|
+
}, [t.placeholders?.sets, n]), C = ne(() => [...t.templates?.items ?? [], ...y], [t.templates?.items, y]), w = q(C);
|
|
82
82
|
if (w.current = C, new Set(C.map((e) => e.id)).size !== C.length) throw Error(n.duplicateTemplate);
|
|
83
|
-
let T = () => s.current.props.value ?? c.current, E = (e) => C.find((t) => t.id === e.templateId),
|
|
84
|
-
let t = s.current.props.context, n = E(e), r = s.current.strings, i =
|
|
83
|
+
let T = () => s.current.props.value ?? c.current, E = (e) => C.find((t) => t.id === e.templateId), ee = q(null), D = (e = T()) => {
|
|
84
|
+
let t = s.current.props.context, n = E(e), r = s.current.strings, i = ee.current;
|
|
85
85
|
if (i && i.draft === e && i.context === t && i.definitions === S && i.template === n && i.strings === r) return i.result;
|
|
86
|
-
let a =
|
|
87
|
-
return
|
|
86
|
+
let a = R(e, t, S, n, r);
|
|
87
|
+
return ee.current = {
|
|
88
88
|
draft: e,
|
|
89
89
|
context: t,
|
|
90
90
|
definitions: S,
|
|
@@ -92,7 +92,7 @@ function be(t) {
|
|
|
92
92
|
strings: r,
|
|
93
93
|
result: a
|
|
94
94
|
}, a;
|
|
95
|
-
},
|
|
95
|
+
}, O = () => {
|
|
96
96
|
let { props: e, strings: t } = s.current, n = [];
|
|
97
97
|
for (let r of [
|
|
98
98
|
"to",
|
|
@@ -106,54 +106,54 @@ function be(t) {
|
|
|
106
106
|
field: "placeholders",
|
|
107
107
|
message: t.dataUnavailable
|
|
108
108
|
}), n;
|
|
109
|
-
},
|
|
110
|
-
let e = T(), t = [...
|
|
109
|
+
}, te = O().length > 0, k = (e = T()) => structuredClone([...O(), ...D(e).issues]), A = () => {
|
|
110
|
+
let e = T(), t = [...D(e).rendered?.unresolved ?? []];
|
|
111
111
|
return {
|
|
112
112
|
draft: structuredClone(e),
|
|
113
113
|
dirty: JSON.stringify(e) !== JSON.stringify(r.current),
|
|
114
114
|
busy: u.current !== null,
|
|
115
|
-
issues:
|
|
115
|
+
issues: k(e),
|
|
116
116
|
unresolvedPlaceholders: t
|
|
117
117
|
};
|
|
118
|
-
},
|
|
118
|
+
}, j = (e) => {
|
|
119
119
|
let t = e instanceof Error ? e : Error(String(e));
|
|
120
120
|
x.current && m(t.message), s.current.props.onError?.(t);
|
|
121
|
-
},
|
|
121
|
+
}, M = (e, t = "api", n = !1) => {
|
|
122
122
|
if (!x.current || !n && u.current && u.current !== "action") return;
|
|
123
123
|
let r = structuredClone(e(structuredClone(T())));
|
|
124
124
|
s.current.props.value === void 0 && (c.current = r, a(r)), s.current.props.onChange?.(structuredClone(r)), s.current.props.onEdit?.(structuredClone(r), { source: t }), m(""), g("");
|
|
125
|
-
},
|
|
126
|
-
async function
|
|
125
|
+
}, N = q(null);
|
|
126
|
+
async function P(e, t, n = !1) {
|
|
127
127
|
if (u.current && !(n && u.current === "action") || !x.current) return;
|
|
128
128
|
let r = {
|
|
129
129
|
kind: e,
|
|
130
130
|
settled: !1,
|
|
131
|
-
parent: n ?
|
|
131
|
+
parent: n ? N.current : null
|
|
132
132
|
};
|
|
133
|
-
|
|
133
|
+
N.current = r, u.current = e, f(!0), m(""), g("");
|
|
134
134
|
try {
|
|
135
135
|
await t();
|
|
136
136
|
} catch (e) {
|
|
137
|
-
|
|
137
|
+
j(e);
|
|
138
138
|
} finally {
|
|
139
|
-
if (r.settled = !0,
|
|
139
|
+
if (r.settled = !0, N.current === r) {
|
|
140
140
|
let e = r.parent;
|
|
141
141
|
for (; e?.settled;) e = e.parent;
|
|
142
|
-
|
|
142
|
+
N.current = e, u.current = e?.kind ?? null, x.current && f(e !== null);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
let
|
|
146
|
+
let F = () => {
|
|
147
147
|
if (!l.current) throw Error(n.editorNotReady);
|
|
148
148
|
if (T().body.kind === "html") throw Error(n.editableRequired);
|
|
149
149
|
return l.current.synchronize(T().body), l.current;
|
|
150
150
|
};
|
|
151
|
-
function
|
|
151
|
+
function I(e, t = {}, r = !1) {
|
|
152
152
|
if (!r && u.current && u.current !== "action") return;
|
|
153
153
|
let i = t.body ?? "replace";
|
|
154
154
|
if (i !== "replace" && (e.body.kind === "html" || T().body.kind === "html")) throw Error(n.editableRequired);
|
|
155
|
-
let a = i === "replace" ? e.body :
|
|
156
|
-
|
|
155
|
+
let a = i === "replace" ? e.body : F().insert(e.body, i);
|
|
156
|
+
M((n) => ({
|
|
157
157
|
...n,
|
|
158
158
|
body: a,
|
|
159
159
|
subject: t.subject === "preserve" ? n.subject : e.subject ?? n.subject,
|
|
@@ -161,66 +161,66 @@ function be(t) {
|
|
|
161
161
|
placeholderOverrides: t.overrides === "reset" ? {} : n.placeholderOverrides
|
|
162
162
|
}), "template", r);
|
|
163
163
|
}
|
|
164
|
-
let
|
|
165
|
-
|
|
166
|
-
getState: () =>
|
|
167
|
-
update: (e) =>
|
|
168
|
-
setSubject: (e) =>
|
|
169
|
-
setRecipients: (e, t) =>
|
|
170
|
-
setBody: (e) =>
|
|
171
|
-
importBody: (e) =>
|
|
172
|
-
setPlaceholder: (e, t) =>
|
|
173
|
-
clearPlaceholderOverride: (e) =>
|
|
174
|
-
insertPlaceholder: (e) =>
|
|
175
|
-
applyTemplate: (e, t) =>
|
|
176
|
-
insertText: (e) =>
|
|
177
|
-
focusBody: () =>
|
|
178
|
-
validate: () =>
|
|
179
|
-
prepare: () =>
|
|
180
|
-
send: () =>
|
|
181
|
-
discard: () =>
|
|
164
|
+
let z = q(null), B = q(null);
|
|
165
|
+
B.current ||= {
|
|
166
|
+
getState: () => z.current.getState(),
|
|
167
|
+
update: (e) => z.current.update(e),
|
|
168
|
+
setSubject: (e) => z.current.setSubject(e),
|
|
169
|
+
setRecipients: (e, t) => z.current.setRecipients(e, t),
|
|
170
|
+
setBody: (e) => z.current.setBody(e),
|
|
171
|
+
importBody: (e) => z.current.importBody(e),
|
|
172
|
+
setPlaceholder: (e, t) => z.current.setPlaceholder(e, t),
|
|
173
|
+
clearPlaceholderOverride: (e) => z.current.clearPlaceholderOverride(e),
|
|
174
|
+
insertPlaceholder: (e) => z.current.insertPlaceholder(e),
|
|
175
|
+
applyTemplate: (e, t) => z.current.applyTemplate(e, t),
|
|
176
|
+
insertText: (e) => z.current.insertText(e),
|
|
177
|
+
focusBody: () => z.current.focusBody(),
|
|
178
|
+
validate: () => z.current.validate(),
|
|
179
|
+
prepare: () => z.current.prepare(),
|
|
180
|
+
send: () => z.current.send(),
|
|
181
|
+
discard: () => z.current.discard()
|
|
182
182
|
};
|
|
183
|
-
let
|
|
184
|
-
if (
|
|
185
|
-
let e =
|
|
183
|
+
let V = B.current, H = async () => {
|
|
184
|
+
if (O().length) throw Error(s.current.strings.dataUnavailable);
|
|
185
|
+
let e = D();
|
|
186
186
|
if (e.issues.length || !e.rendered) throw Error(e.issues.map((e) => e.message).join(" "));
|
|
187
187
|
return structuredClone(e.rendered.email);
|
|
188
|
-
},
|
|
188
|
+
}, G = (e = !1) => P("send", async () => {
|
|
189
189
|
let e = s.current.props;
|
|
190
190
|
v(!0);
|
|
191
|
-
let t = await
|
|
191
|
+
let t = await H();
|
|
192
192
|
if (e.onBeforeSend) {
|
|
193
|
-
let n = await e.onBeforeSend(t,
|
|
193
|
+
let n = await e.onBeforeSend(t, V);
|
|
194
194
|
if (n === !1 || !x.current) return;
|
|
195
195
|
t = n;
|
|
196
196
|
}
|
|
197
197
|
x.current && (t = structuredClone(t), await e.onSend(structuredClone(t)), x.current && (g(n.sent), e.onSent?.(t)));
|
|
198
|
-
}, e),
|
|
198
|
+
}, e), Y = (e = !1) => P("discard", async () => {
|
|
199
199
|
let e = s.current.props, t = T();
|
|
200
|
-
await e.onDiscard?.(
|
|
200
|
+
await e.onDiscard?.(V), x.current && T() === t && (M(() => r.current, "api", !0), v(!1), g(n.discarded), e.onClose?.());
|
|
201
201
|
}, e);
|
|
202
|
-
|
|
203
|
-
getState:
|
|
204
|
-
update: (e) =>
|
|
205
|
-
setSubject: (e) =>
|
|
202
|
+
z.current = {
|
|
203
|
+
getState: A,
|
|
204
|
+
update: (e) => M(e),
|
|
205
|
+
setSubject: (e) => M((t) => ({
|
|
206
206
|
...t,
|
|
207
207
|
subject: e
|
|
208
208
|
})),
|
|
209
|
-
setRecipients: (e, t) =>
|
|
209
|
+
setRecipients: (e, t) => M((n) => ({
|
|
210
210
|
...n,
|
|
211
211
|
[e]: t
|
|
212
212
|
})),
|
|
213
|
-
setBody: (e) =>
|
|
213
|
+
setBody: (e) => M((t) => ({
|
|
214
214
|
...t,
|
|
215
215
|
body: e
|
|
216
216
|
})),
|
|
217
|
-
importBody: (e) =>
|
|
217
|
+
importBody: (e) => M((t) => ({
|
|
218
218
|
...t,
|
|
219
219
|
body: e
|
|
220
220
|
})),
|
|
221
221
|
setPlaceholder: (e, t) => {
|
|
222
222
|
if (!Object.hasOwn(S, e)) throw Error(n.unknownVariable(e));
|
|
223
|
-
|
|
223
|
+
M((n) => ({
|
|
224
224
|
...n,
|
|
225
225
|
placeholderOverrides: {
|
|
226
226
|
...n.placeholderOverrides,
|
|
@@ -228,20 +228,20 @@ function be(t) {
|
|
|
228
228
|
}
|
|
229
229
|
}), "placeholder");
|
|
230
230
|
},
|
|
231
|
-
clearPlaceholderOverride: (e) =>
|
|
231
|
+
clearPlaceholderOverride: (e) => M((t) => (delete t.placeholderOverrides[e], t), "placeholder"),
|
|
232
232
|
insertPlaceholder: (e) => {
|
|
233
233
|
if (u.current && u.current !== "action") return;
|
|
234
234
|
if (!Object.hasOwn(S, e)) throw Error(n.unknownVariable(e));
|
|
235
|
-
let t =
|
|
236
|
-
|
|
235
|
+
let t = F().insertPlaceholder(e);
|
|
236
|
+
M((e) => ({
|
|
237
237
|
...e,
|
|
238
238
|
body: t
|
|
239
239
|
}));
|
|
240
240
|
},
|
|
241
241
|
insertText: (e) => {
|
|
242
242
|
if (u.current && u.current !== "action") return;
|
|
243
|
-
let t =
|
|
244
|
-
|
|
243
|
+
let t = F().insertText(e);
|
|
244
|
+
M((e) => ({
|
|
245
245
|
...e,
|
|
246
246
|
body: t
|
|
247
247
|
}));
|
|
@@ -251,53 +251,53 @@ function be(t) {
|
|
|
251
251
|
if (Q(s.current.props.templates)) throw Error(s.current.strings.templatesUnavailable);
|
|
252
252
|
let r = C.find((t) => t.id === e);
|
|
253
253
|
if (!r) throw Error(n.unknownTemplate(e));
|
|
254
|
-
|
|
254
|
+
I(r, t);
|
|
255
255
|
},
|
|
256
|
-
validate: () =>
|
|
257
|
-
prepare:
|
|
258
|
-
send: () =>
|
|
259
|
-
discard: () =>
|
|
260
|
-
},
|
|
261
|
-
let
|
|
262
|
-
await e.onSelect(Object.assign(Object.create(
|
|
263
|
-
send: () =>
|
|
264
|
-
discard: () =>
|
|
256
|
+
validate: () => k(),
|
|
257
|
+
prepare: H,
|
|
258
|
+
send: () => G(),
|
|
259
|
+
discard: () => Y()
|
|
260
|
+
}, K(t.apiRef, () => V, [V]);
|
|
261
|
+
let X = (e) => P("action", async () => {
|
|
262
|
+
await e.onSelect(Object.assign(Object.create(V), {
|
|
263
|
+
send: () => G(!0),
|
|
264
|
+
discard: () => Y(!0)
|
|
265
265
|
}));
|
|
266
|
-
}),
|
|
266
|
+
}), Z = () => P("import", async () => {
|
|
267
267
|
let e = T(), t = await s.current.props.templates?.onImport?.();
|
|
268
268
|
if (t && x.current) {
|
|
269
269
|
if (w.current.some((e) => e.id === t.id)) throw Error(n.duplicateTemplate);
|
|
270
|
-
b((e) => [...e, structuredClone(t)]), T() === e &&
|
|
270
|
+
b((e) => [...e, structuredClone(t)]), T() === e && I(t, {}, !0);
|
|
271
271
|
}
|
|
272
|
-
}), { rendered:
|
|
272
|
+
}), { rendered: re, renderError: ie } = D(o);
|
|
273
273
|
return {
|
|
274
|
-
api:
|
|
274
|
+
api: V,
|
|
275
275
|
draft: o,
|
|
276
276
|
strings: n,
|
|
277
277
|
busy: d,
|
|
278
|
-
dataPending:
|
|
278
|
+
dataPending: te,
|
|
279
279
|
error: p,
|
|
280
280
|
notice: h,
|
|
281
281
|
attempted: _,
|
|
282
|
-
rendered:
|
|
283
|
-
renderError:
|
|
282
|
+
rendered: re,
|
|
283
|
+
renderError: ie,
|
|
284
284
|
definitions: S,
|
|
285
285
|
templates: C,
|
|
286
|
-
values:
|
|
286
|
+
values: re?.email.resolvedPlaceholders ?? {},
|
|
287
287
|
editorRef: l,
|
|
288
|
-
state:
|
|
289
|
-
report:
|
|
290
|
-
runAction:
|
|
291
|
-
importTemplate:
|
|
292
|
-
changeBody: (e) =>
|
|
288
|
+
state: A(),
|
|
289
|
+
report: j,
|
|
290
|
+
runAction: X,
|
|
291
|
+
importTemplate: Z,
|
|
292
|
+
changeBody: (e) => M((t) => ({
|
|
293
293
|
...t,
|
|
294
294
|
body: e
|
|
295
295
|
}), "body"),
|
|
296
|
-
changeSubject: (e) =>
|
|
296
|
+
changeSubject: (e) => M((t) => ({
|
|
297
297
|
...t,
|
|
298
298
|
subject: e
|
|
299
299
|
}), "subject"),
|
|
300
|
-
changeRecipients: (e, t) =>
|
|
300
|
+
changeRecipients: (e, t) => M((n) => ({
|
|
301
301
|
...n,
|
|
302
302
|
[e]: t
|
|
303
303
|
}), "recipient")
|
|
@@ -305,20 +305,20 @@ function be(t) {
|
|
|
305
305
|
}
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region src/components/features/email-composer/partials/recipients.tsx
|
|
308
|
-
function
|
|
309
|
-
let [d, f] =
|
|
310
|
-
|
|
311
|
-
f(
|
|
308
|
+
function be({ recipient: e, field: t, index: n, options: r, busy: i, strings: a, change: o, remove: s, add: c, id: l, errorId: u }) {
|
|
309
|
+
let [d, f] = J(I(e));
|
|
310
|
+
W(() => {
|
|
311
|
+
f(I(e));
|
|
312
312
|
}, [e.name, e.email]);
|
|
313
313
|
let p = r.mode === "readonly", m = r.mode === "disabled" || i, h = r.mode !== "disabled" && r.allowRemove !== !1 && (!p || r.allowRemove === !0), g = () => {
|
|
314
|
-
!p && !m && d !==
|
|
314
|
+
!p && !m && d !== I(e) && o({
|
|
315
315
|
id: e.id,
|
|
316
|
-
...
|
|
316
|
+
...B(d)
|
|
317
317
|
});
|
|
318
318
|
};
|
|
319
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ Z(x, {
|
|
320
320
|
className: "min-w-0 w-full",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ X(S, {
|
|
322
322
|
id: l,
|
|
323
323
|
"aria-invalid": !!u,
|
|
324
324
|
"aria-describedby": u,
|
|
@@ -326,23 +326,23 @@ function xe({ recipient: e, field: t, index: n, options: r, busy: i, strings: a,
|
|
|
326
326
|
value: d,
|
|
327
327
|
readOnly: p,
|
|
328
328
|
disabled: m,
|
|
329
|
-
title:
|
|
329
|
+
title: I(e),
|
|
330
330
|
onChange: (e) => f(e.target.value),
|
|
331
331
|
onBlur: g,
|
|
332
332
|
onKeyDown: (t) => {
|
|
333
|
-
t.key === "Enter" && (t.preventDefault(), g()), t.key === "Escape" && (t.preventDefault(), f(
|
|
333
|
+
t.key === "Enter" && (t.preventDefault(), g()), t.key === "Escape" && (t.preventDefault(), f(I(e)));
|
|
334
334
|
}
|
|
335
|
-
}), (h || c) && /* @__PURE__ */
|
|
335
|
+
}), (h || c) && /* @__PURE__ */ Z(w, {
|
|
336
336
|
align: "inline-end",
|
|
337
|
-
children: [h && /* @__PURE__ */
|
|
337
|
+
children: [h && /* @__PURE__ */ X(T, {
|
|
338
338
|
type: "button",
|
|
339
339
|
iconOnly: !0,
|
|
340
340
|
size: "sm",
|
|
341
341
|
disabled: i,
|
|
342
342
|
"aria-label": a.removeRecipient(e.email),
|
|
343
343
|
onClick: s,
|
|
344
|
-
children: /* @__PURE__ */
|
|
345
|
-
}), c && /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ X(de, { className: "size-icon" })
|
|
345
|
+
}), c && /* @__PURE__ */ X(T, {
|
|
346
346
|
type: "button",
|
|
347
347
|
iconOnly: !0,
|
|
348
348
|
size: "sm",
|
|
@@ -350,40 +350,38 @@ function xe({ recipient: e, field: t, index: n, options: r, busy: i, strings: a,
|
|
|
350
350
|
"aria-label": a.addRecipient(t),
|
|
351
351
|
title: a.addRecipient(t),
|
|
352
352
|
onClick: c,
|
|
353
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ X(ce, { className: "size-icon" })
|
|
354
354
|
})]
|
|
355
355
|
})]
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
let [u, d] =
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
let e = z(f);
|
|
364
|
-
f.trim() && !_.current.some((t) => t.email.toLowerCase() === e.email.toLowerCase()) && o([..._.current, e]), p(""), d(!1);
|
|
358
|
+
function xe({ field: e, value: t, options: n = {}, busy: r, strings: i, onChange: o, error: s, actions: c, report: l }) {
|
|
359
|
+
let [u, d] = J(!1), [f, p] = J(""), m = G(), h = s ? `${m}-error` : void 0, g = q(null), _ = n.mode !== "disabled" && n.allowAdd !== !1 && (n.mode !== "readonly" || n.allowAdd === !0), v = u || t.length === 0, y = Q(n), C = () => {
|
|
360
|
+
if (r || !_ || !v || y) return;
|
|
361
|
+
let e = B(f);
|
|
362
|
+
f.trim() && !t.some((t) => t.email.toLowerCase() === e.email.toLowerCase()) && o([...t, e]), p(""), d(!1);
|
|
365
363
|
};
|
|
366
|
-
|
|
364
|
+
W(() => {
|
|
367
365
|
u && g.current?.focus();
|
|
368
366
|
}, [u]);
|
|
369
|
-
let
|
|
370
|
-
|
|
367
|
+
let E = () => {
|
|
368
|
+
v && C(), d(!0), g.current?.focus();
|
|
371
369
|
};
|
|
372
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ X(b, {
|
|
373
371
|
label: i[e],
|
|
374
372
|
required: e === "to",
|
|
375
373
|
error: s,
|
|
376
374
|
supportingTextId: h,
|
|
377
375
|
htmlFor: t.length ? `${m}-0` : `${m}-new`,
|
|
378
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ Z(a, {
|
|
379
377
|
id: `${m}-group`,
|
|
380
378
|
gap: "sm",
|
|
381
|
-
children: [
|
|
379
|
+
children: [y ? /* @__PURE__ */ X(ve, {
|
|
382
380
|
state: n,
|
|
383
381
|
label: i.loadingRecipients(i[e]),
|
|
384
382
|
retryLabel: i.retry,
|
|
385
383
|
report: l
|
|
386
|
-
}) : /* @__PURE__ */
|
|
384
|
+
}) : /* @__PURE__ */ Z(Y, { children: [t.map((a, s) => /* @__PURE__ */ X(be, {
|
|
387
385
|
id: `${m}-${s}`,
|
|
388
386
|
errorId: h,
|
|
389
387
|
recipient: a,
|
|
@@ -394,10 +392,10 @@ function Se({ field: e, value: t, options: n = {}, busy: r, strings: i, onChange
|
|
|
394
392
|
strings: i,
|
|
395
393
|
change: (e) => o(t.map((t, n) => n === s ? e : t)),
|
|
396
394
|
remove: () => o(t.filter((e, t) => t !== s)),
|
|
397
|
-
add:
|
|
398
|
-
}, a.id ?? s)),
|
|
395
|
+
add: _ && !v && s === t.length - 1 ? E : void 0
|
|
396
|
+
}, a.id ?? s)), v && /* @__PURE__ */ Z(x, {
|
|
399
397
|
className: "min-w-0 w-full",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ X(S, {
|
|
401
399
|
id: `${m}-new`,
|
|
402
400
|
ref: g,
|
|
403
401
|
autoFocus: e !== "to",
|
|
@@ -407,15 +405,15 @@ function Se({ field: e, value: t, options: n = {}, busy: r, strings: i, onChange
|
|
|
407
405
|
placeholder: i.recipientPlaceholder,
|
|
408
406
|
value: f,
|
|
409
407
|
disabled: r || n.mode === "disabled",
|
|
410
|
-
readOnly: !
|
|
408
|
+
readOnly: !_,
|
|
411
409
|
onChange: (e) => p(e.target.value),
|
|
412
|
-
onBlur:
|
|
410
|
+
onBlur: C,
|
|
413
411
|
onKeyDown: (e) => {
|
|
414
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
412
|
+
e.key === "Enter" && (e.preventDefault(), C()), e.key === "Escape" && (e.preventDefault(), p(""), d(!1));
|
|
415
413
|
}
|
|
416
|
-
}),
|
|
414
|
+
}), _ && /* @__PURE__ */ X(w, {
|
|
417
415
|
align: "inline-end",
|
|
418
|
-
children: /* @__PURE__ */
|
|
416
|
+
children: /* @__PURE__ */ X(T, {
|
|
419
417
|
type: "button",
|
|
420
418
|
iconOnly: !0,
|
|
421
419
|
size: "sm",
|
|
@@ -423,11 +421,11 @@ function Se({ field: e, value: t, options: n = {}, busy: r, strings: i, onChange
|
|
|
423
421
|
"aria-label": i.addRecipient(i[e]),
|
|
424
422
|
title: i.addRecipient(i[e]),
|
|
425
423
|
onMouseDown: (e) => e.preventDefault(),
|
|
426
|
-
onClick:
|
|
427
|
-
children: /* @__PURE__ */
|
|
424
|
+
onClick: E,
|
|
425
|
+
children: /* @__PURE__ */ X(ce, { className: "size-icon" })
|
|
428
426
|
})
|
|
429
427
|
})]
|
|
430
|
-
})] }), c && /* @__PURE__ */
|
|
428
|
+
})] }), c && /* @__PURE__ */ X(a, {
|
|
431
429
|
direction: "horizontal",
|
|
432
430
|
gap: "xs",
|
|
433
431
|
justify: "end",
|
|
@@ -438,47 +436,47 @@ function Se({ field: e, value: t, options: n = {}, busy: r, strings: i, onChange
|
|
|
438
436
|
}
|
|
439
437
|
//#endregion
|
|
440
438
|
//#region src/components/features/email-composer/partials/variables.tsx
|
|
441
|
-
function
|
|
442
|
-
let u =
|
|
443
|
-
return /* @__PURE__ */
|
|
439
|
+
function Se({ definitions: e, values: t, draft: n, api: o, strings: s, busy: c, editable: l }) {
|
|
440
|
+
let u = G();
|
|
441
|
+
return /* @__PURE__ */ X(i, {
|
|
444
442
|
minColumnWidth: "sm",
|
|
445
443
|
gap: "md",
|
|
446
444
|
children: Object.keys(e).map((i) => {
|
|
447
|
-
let d = e[i], f = Object.hasOwn(
|
|
445
|
+
let d = e[i], f = Object.hasOwn(n.placeholderOverrides, i), p = `${u}-email-variable-${i}`, m = {
|
|
448
446
|
id: p,
|
|
449
447
|
value: String(t[i] ?? ""),
|
|
450
448
|
disabled: c,
|
|
451
449
|
readOnly: !d.editable
|
|
452
|
-
}, h = d.input === "textarea" ? /* @__PURE__ */
|
|
450
|
+
}, h = d.input === "textarea" ? /* @__PURE__ */ X(C, {
|
|
453
451
|
...m,
|
|
454
452
|
onChange: (e) => o.setPlaceholder(i, e.target.value)
|
|
455
|
-
}) : d.input === "select" ? /* @__PURE__ */
|
|
453
|
+
}) : d.input === "select" ? /* @__PURE__ */ X(E, {
|
|
456
454
|
...m,
|
|
457
455
|
placeholder: s.choose,
|
|
458
456
|
options: [...d.options ?? []],
|
|
459
457
|
onValueChange: (e) => o.setPlaceholder(i, e ?? "")
|
|
460
|
-
}) : /* @__PURE__ */
|
|
458
|
+
}) : /* @__PURE__ */ X(y, {
|
|
461
459
|
...m,
|
|
462
460
|
type: d.input === "number" ? "number" : d.input === "date" ? "date" : "text",
|
|
463
461
|
onChange: (e) => o.setPlaceholder(i, d.input === "number" && e.target.value !== "" ? Number(e.target.value) : e.target.value)
|
|
464
462
|
});
|
|
465
|
-
return /* @__PURE__ */
|
|
463
|
+
return /* @__PURE__ */ X(b, {
|
|
466
464
|
label: d.group ? `${d.group} · ${d.label}` : d.label,
|
|
467
465
|
htmlFor: p,
|
|
468
466
|
required: d.required,
|
|
469
467
|
helperText: `${f ? s.overridden : s.dynamic}${d.description ? ` · ${d.description}` : ""}`,
|
|
470
|
-
children: /* @__PURE__ */
|
|
468
|
+
children: /* @__PURE__ */ Z(a, {
|
|
471
469
|
id: `${p}-group`,
|
|
472
470
|
direction: "horizontal",
|
|
473
471
|
gap: "sm",
|
|
474
472
|
align: "start",
|
|
475
473
|
wrap: !1,
|
|
476
474
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ X("div", {
|
|
478
476
|
className: "min-w-0 flex-1",
|
|
479
477
|
children: h
|
|
480
478
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ X(r, {
|
|
482
480
|
type: "button",
|
|
483
481
|
iconOnly: !0,
|
|
484
482
|
size: "sm",
|
|
@@ -487,9 +485,9 @@ function Ce({ definitions: e, values: t, draft: r, api: o, strings: s, busy: c,
|
|
|
487
485
|
disabled: c || !l,
|
|
488
486
|
"aria-label": s.insertVariable(d.label),
|
|
489
487
|
onClick: () => o.insertPlaceholder(i),
|
|
490
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ X(ce, { className: "size-icon" })
|
|
491
489
|
}),
|
|
492
|
-
f && /* @__PURE__ */
|
|
490
|
+
f && /* @__PURE__ */ X(r, {
|
|
493
491
|
type: "button",
|
|
494
492
|
size: "sm",
|
|
495
493
|
buttonStyle: "ghost",
|
|
@@ -506,7 +504,7 @@ function Ce({ definitions: e, values: t, draft: r, api: o, strings: s, busy: c,
|
|
|
506
504
|
}
|
|
507
505
|
//#endregion
|
|
508
506
|
//#region src/components/features/email-composer/partials/body-editor.tsx
|
|
509
|
-
var
|
|
507
|
+
var Ce = pe.create({
|
|
510
508
|
name: "placeholderToken",
|
|
511
509
|
group: "inline",
|
|
512
510
|
inline: !0,
|
|
@@ -518,7 +516,7 @@ var we = me.create({
|
|
|
518
516
|
parseHTML: () => [{ tag: "span[data-placeholder]" }],
|
|
519
517
|
renderHTML: ({ node: e, HTMLAttributes: t }) => [
|
|
520
518
|
"span",
|
|
521
|
-
|
|
519
|
+
he(t, {
|
|
522
520
|
"data-placeholder": e.attrs.key,
|
|
523
521
|
class: "rounded-inner bg-accent text-accent-foreground",
|
|
524
522
|
contenteditable: "false"
|
|
@@ -526,21 +524,21 @@ var we = me.create({
|
|
|
526
524
|
`{{${e.attrs.key}}}`
|
|
527
525
|
],
|
|
528
526
|
renderText: ({ node: e }) => `{{${e.attrs.key}}}`
|
|
529
|
-
}), $ = [
|
|
530
|
-
function
|
|
531
|
-
let u =
|
|
527
|
+
}), $ = [_e.configure({ link: { openOnClick: !1 } }), Ce];
|
|
528
|
+
function we({ body: n, disabled: r, onChange: i, adapterRef: c, strings: l }) {
|
|
529
|
+
let u = q(i);
|
|
532
530
|
u.current = i;
|
|
533
|
-
let d =
|
|
531
|
+
let d = q(!1), [f, p] = J(!1), [m, g] = J(""), [v, x] = J(""), S = q({
|
|
534
532
|
from: 1,
|
|
535
533
|
to: 1
|
|
536
|
-
}),
|
|
534
|
+
}), C = e(N, {
|
|
537
535
|
editorLabel: l.body,
|
|
538
536
|
toolbar: l.toolbar
|
|
539
|
-
}),
|
|
537
|
+
}), w = ge({
|
|
540
538
|
extensions: $,
|
|
541
539
|
immediatelyRender: !1,
|
|
542
540
|
shouldRerenderOnTransaction: !0,
|
|
543
|
-
content: n.kind === "rich" ? n.document :
|
|
541
|
+
content: n.kind === "rich" ? n.document : F(n),
|
|
544
542
|
editable: !r,
|
|
545
543
|
editorProps: { attributes: {
|
|
546
544
|
role: "textbox",
|
|
@@ -555,27 +553,27 @@ function Te({ body: n, disabled: r, onChange: i, adapterRef: o, strings: l }) {
|
|
|
555
553
|
});
|
|
556
554
|
}
|
|
557
555
|
});
|
|
558
|
-
|
|
559
|
-
if (
|
|
560
|
-
let e = n.kind === "rich" ?
|
|
561
|
-
JSON.stringify(
|
|
556
|
+
W(() => {
|
|
557
|
+
if (w) try {
|
|
558
|
+
let e = n.kind === "rich" ? w.schema.nodeFromJSON(n.document).toJSON() : me(F(n), $);
|
|
559
|
+
JSON.stringify(w.getJSON()) !== JSON.stringify(e) && w.commands.setContent(e, { emitUpdate: !1 });
|
|
562
560
|
} catch {}
|
|
563
|
-
}),
|
|
564
|
-
|
|
561
|
+
}), W(() => {
|
|
562
|
+
w?.setEditable(!r && n.kind !== "html", !1);
|
|
565
563
|
}, [
|
|
566
|
-
|
|
564
|
+
w,
|
|
567
565
|
r,
|
|
568
566
|
n.kind
|
|
569
|
-
]),
|
|
567
|
+
]), W(() => {
|
|
570
568
|
(r || n.kind === "html") && p(!1);
|
|
571
|
-
}, [r, n.kind]),
|
|
569
|
+
}, [r, n.kind]), K(c, () => {
|
|
572
570
|
let e = (e) => {
|
|
573
|
-
if (!
|
|
571
|
+
if (!w) throw Error(l.editorNotReady);
|
|
574
572
|
d.current = !0;
|
|
575
573
|
try {
|
|
576
574
|
return e(), {
|
|
577
575
|
kind: "rich",
|
|
578
|
-
document:
|
|
576
|
+
document: w.getJSON()
|
|
579
577
|
};
|
|
580
578
|
} finally {
|
|
581
579
|
d.current = !1;
|
|
@@ -583,121 +581,121 @@ function Te({ body: n, disabled: r, onChange: i, adapterRef: o, strings: l }) {
|
|
|
583
581
|
};
|
|
584
582
|
return {
|
|
585
583
|
synchronize: (e) => {
|
|
586
|
-
if (!
|
|
587
|
-
let t = e.kind === "rich" ?
|
|
588
|
-
JSON.stringify(
|
|
584
|
+
if (!w) return;
|
|
585
|
+
let t = e.kind === "rich" ? w.schema.nodeFromJSON(e.document).toJSON() : me(F(e), $);
|
|
586
|
+
JSON.stringify(w.getJSON()) !== JSON.stringify(t) && w.commands.setContent(t, { emitUpdate: !1 });
|
|
589
587
|
},
|
|
590
588
|
focus: () => {
|
|
591
|
-
|
|
589
|
+
w?.commands.focus();
|
|
592
590
|
},
|
|
593
591
|
convert: (e) => ({
|
|
594
592
|
kind: "rich",
|
|
595
|
-
document: e.kind === "rich" ? e.document :
|
|
593
|
+
document: e.kind === "rich" ? e.document : me(F(e), $)
|
|
596
594
|
}),
|
|
597
595
|
insert: (t, n) => e(() => {
|
|
598
|
-
n === "append" &&
|
|
596
|
+
n === "append" && w.commands.focus("end"), w.chain().focus().insertContent(t.kind === "rich" ? t.document.content ?? [] : F(t)).run();
|
|
599
597
|
}),
|
|
600
598
|
insertText: (t) => e(() => {
|
|
601
|
-
t &&
|
|
599
|
+
t && w.chain().focus().insertContent({
|
|
602
600
|
type: "text",
|
|
603
601
|
text: t
|
|
604
602
|
}).run();
|
|
605
603
|
}),
|
|
606
604
|
insertPlaceholder: (t) => e(() => {
|
|
607
|
-
|
|
605
|
+
w.chain().focus().insertContent({
|
|
608
606
|
type: "placeholderToken",
|
|
609
607
|
attrs: { key: t }
|
|
610
608
|
}).run();
|
|
611
609
|
})
|
|
612
610
|
};
|
|
613
|
-
}, [
|
|
614
|
-
let
|
|
611
|
+
}, [w, l]);
|
|
612
|
+
let T = [
|
|
615
613
|
{
|
|
616
614
|
id: "bold",
|
|
617
|
-
icon:
|
|
618
|
-
label:
|
|
619
|
-
isActive: () => !!
|
|
615
|
+
icon: re,
|
|
616
|
+
label: C.toolbar.bold,
|
|
617
|
+
isActive: () => !!w?.isActive("bold"),
|
|
620
618
|
run: () => {
|
|
621
|
-
|
|
619
|
+
w?.chain().focus().toggleBold().run();
|
|
622
620
|
}
|
|
623
621
|
},
|
|
624
622
|
{
|
|
625
623
|
id: "italic",
|
|
626
|
-
icon:
|
|
627
|
-
label:
|
|
628
|
-
isActive: () => !!
|
|
624
|
+
icon: ie,
|
|
625
|
+
label: C.toolbar.italic,
|
|
626
|
+
isActive: () => !!w?.isActive("italic"),
|
|
629
627
|
run: () => {
|
|
630
|
-
|
|
628
|
+
w?.chain().focus().toggleItalic().run();
|
|
631
629
|
}
|
|
632
630
|
},
|
|
633
631
|
{
|
|
634
632
|
id: "bullet",
|
|
635
|
-
icon:
|
|
636
|
-
label:
|
|
637
|
-
isActive: () => !!
|
|
633
|
+
icon: oe,
|
|
634
|
+
label: C.toolbar.bulletList,
|
|
635
|
+
isActive: () => !!w?.isActive("bulletList"),
|
|
638
636
|
run: () => {
|
|
639
|
-
|
|
637
|
+
w?.chain().focus().toggleBulletList().run();
|
|
640
638
|
}
|
|
641
639
|
},
|
|
642
640
|
{
|
|
643
641
|
id: "ordered",
|
|
644
|
-
icon:
|
|
645
|
-
label:
|
|
646
|
-
isActive: () => !!
|
|
642
|
+
icon: se,
|
|
643
|
+
label: C.toolbar.orderedList,
|
|
644
|
+
isActive: () => !!w?.isActive("orderedList"),
|
|
647
645
|
run: () => {
|
|
648
|
-
|
|
646
|
+
w?.chain().focus().toggleOrderedList().run();
|
|
649
647
|
}
|
|
650
648
|
},
|
|
651
649
|
{
|
|
652
650
|
id: "undo",
|
|
653
|
-
icon:
|
|
654
|
-
label:
|
|
651
|
+
icon: ue,
|
|
652
|
+
label: C.toolbar.undo,
|
|
655
653
|
isActive: () => !1,
|
|
656
654
|
run: () => {
|
|
657
|
-
|
|
655
|
+
w?.chain().focus().undo().run();
|
|
658
656
|
},
|
|
659
|
-
disabled: !
|
|
657
|
+
disabled: !w?.can().undo()
|
|
660
658
|
},
|
|
661
659
|
{
|
|
662
660
|
id: "redo",
|
|
663
661
|
icon: le,
|
|
664
|
-
label:
|
|
662
|
+
label: C.toolbar.redo,
|
|
665
663
|
isActive: () => !1,
|
|
666
664
|
run: () => {
|
|
667
|
-
|
|
665
|
+
w?.chain().focus().redo().run();
|
|
668
666
|
},
|
|
669
|
-
disabled: !
|
|
667
|
+
disabled: !w?.can().redo()
|
|
670
668
|
}
|
|
671
669
|
];
|
|
672
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ Z(a, {
|
|
673
671
|
gap: "none",
|
|
674
|
-
className: t("email-composer--editor",
|
|
672
|
+
className: t("email-composer--editor", M.frame, r && M.disabled),
|
|
675
673
|
children: [
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
buttons:
|
|
674
|
+
/* @__PURE__ */ X(j, {
|
|
675
|
+
buttons: T,
|
|
678
676
|
disabled: r,
|
|
679
|
-
hasEditor: !!
|
|
677
|
+
hasEditor: !!w,
|
|
680
678
|
sourceMode: !1,
|
|
681
679
|
hideSourceToggle: !0,
|
|
682
680
|
toggleSourceMode: () => {},
|
|
683
|
-
strings:
|
|
681
|
+
strings: C,
|
|
684
682
|
extraToolbarItems: [{
|
|
685
683
|
id: "link",
|
|
686
|
-
icon:
|
|
684
|
+
icon: ae,
|
|
687
685
|
label: l.link,
|
|
688
686
|
onClick: () => {
|
|
689
|
-
|
|
690
|
-
from:
|
|
691
|
-
to:
|
|
692
|
-
}, g(String(
|
|
687
|
+
w && (S.current = {
|
|
688
|
+
from: w.state.selection.from,
|
|
689
|
+
to: w.state.selection.to
|
|
690
|
+
}, g(String(w.getAttributes("link").href ?? "")), x(""), p(!0));
|
|
693
691
|
}
|
|
694
692
|
}]
|
|
695
693
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
editor:
|
|
698
|
-
className: t(
|
|
694
|
+
/* @__PURE__ */ X(fe, {
|
|
695
|
+
editor: w,
|
|
696
|
+
className: t(M.content, "min-h-64 w-full min-w-0 [&_.ProseMirror]:min-h-64")
|
|
699
697
|
}),
|
|
700
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ X(h, {
|
|
701
699
|
open: f,
|
|
702
700
|
onOpenChange: p,
|
|
703
701
|
title: l.linkTitle,
|
|
@@ -710,22 +708,22 @@ function Te({ body: n, disabled: r, onChange: i, adapterRef: o, strings: l }) {
|
|
|
710
708
|
onAsyncConfirm: async () => {
|
|
711
709
|
let e = m.trim();
|
|
712
710
|
if (e && !/^(https?:\/\/|mailto:)/i.test(e)) {
|
|
713
|
-
|
|
711
|
+
x(l.invalidLink);
|
|
714
712
|
return;
|
|
715
713
|
}
|
|
716
|
-
|
|
714
|
+
w?.commands.setTextSelection(S.current), e ? w?.chain().focus().extendMarkRange("link").setLink({ href: e }).run() : w?.chain().focus().extendMarkRange("link").unsetLink().run(), p(!1);
|
|
717
715
|
},
|
|
718
|
-
children: /* @__PURE__ */
|
|
716
|
+
children: /* @__PURE__ */ Z(a, {
|
|
719
717
|
gap: "md",
|
|
720
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ X(b, {
|
|
721
719
|
label: l.linkUrl,
|
|
722
|
-
children: /* @__PURE__ */
|
|
720
|
+
children: /* @__PURE__ */ X(y, {
|
|
723
721
|
value: m,
|
|
724
722
|
onChange: (e) => g(e.target.value)
|
|
725
723
|
})
|
|
726
|
-
}), v && /* @__PURE__ */
|
|
724
|
+
}), v && /* @__PURE__ */ X(s, {
|
|
727
725
|
tone: "destructive",
|
|
728
|
-
children: /* @__PURE__ */
|
|
726
|
+
children: /* @__PURE__ */ X(o, { children: v })
|
|
729
727
|
})]
|
|
730
728
|
})
|
|
731
729
|
})
|
|
@@ -734,22 +732,22 @@ function Te({ body: n, disabled: r, onChange: i, adapterRef: o, strings: l }) {
|
|
|
734
732
|
}
|
|
735
733
|
//#endregion
|
|
736
734
|
//#region src/components/features/email-composer/partials/html-preview.tsx
|
|
737
|
-
function
|
|
738
|
-
return /* @__PURE__ */
|
|
735
|
+
function Te({ html: e, subject: t, strings: r }) {
|
|
736
|
+
return /* @__PURE__ */ Z(a, {
|
|
739
737
|
gap: "normal",
|
|
740
738
|
className: "min-w-0",
|
|
741
|
-
children: [/* @__PURE__ */
|
|
739
|
+
children: [/* @__PURE__ */ Z(n, {
|
|
742
740
|
type: "secondary",
|
|
743
741
|
children: [
|
|
744
|
-
|
|
742
|
+
r.subject,
|
|
745
743
|
": ",
|
|
746
744
|
t
|
|
747
745
|
]
|
|
748
|
-
}), /* @__PURE__ */
|
|
746
|
+
}), /* @__PURE__ */ X(c, {
|
|
749
747
|
surface: "card",
|
|
750
748
|
padding: "none",
|
|
751
|
-
children: /* @__PURE__ */
|
|
752
|
-
title:
|
|
749
|
+
children: /* @__PURE__ */ X("iframe", {
|
|
750
|
+
title: r.previewLabel,
|
|
753
751
|
sandbox: "",
|
|
754
752
|
referrerPolicy: "no-referrer",
|
|
755
753
|
className: "h-80 w-full border-0",
|
|
@@ -760,18 +758,18 @@ function Ee({ html: e, subject: t, strings: n }) {
|
|
|
760
758
|
}
|
|
761
759
|
//#endregion
|
|
762
760
|
//#region src/components/features/email-composer/email-composer.tsx
|
|
763
|
-
function
|
|
764
|
-
let
|
|
761
|
+
function Ee(e) {
|
|
762
|
+
let n = ye(e), { api: i, draft: u, strings: d, busy: _, state: x } = n, [S, C] = J("editor"), [w, T] = J(e.placeholders?.showEditor ?? !1), [E, j] = J(!1), [M, N] = J(!1), [P, F] = J(!1), I = G(), L = S === "preview" || u.body.kind === "html", R = (t) => (e.actions ?? []).filter((e) => (e.position ?? "toolbar") === t && (e.visible?.(x) ?? !0)).map((e) => ({
|
|
765
763
|
id: e.id,
|
|
766
764
|
label: e.label,
|
|
767
765
|
icon: e.icon,
|
|
768
|
-
disabled: _ || e.disabled?.(
|
|
766
|
+
disabled: _ || e.disabled?.(x),
|
|
769
767
|
onClick: () => {
|
|
770
|
-
|
|
768
|
+
n.runAction(e);
|
|
771
769
|
},
|
|
772
770
|
buttonStyle: "ghost",
|
|
773
771
|
tone: "secondary"
|
|
774
|
-
})),
|
|
772
|
+
})), z = /* @__PURE__ */ Z(a, {
|
|
775
773
|
direction: {
|
|
776
774
|
base: "vertical",
|
|
777
775
|
sm: "horizontal"
|
|
@@ -783,10 +781,10 @@ function De(e) {
|
|
|
783
781
|
},
|
|
784
782
|
justify: "between",
|
|
785
783
|
className: "w-full",
|
|
786
|
-
children: [/* @__PURE__ */
|
|
784
|
+
children: [/* @__PURE__ */ Z(a, {
|
|
787
785
|
direction: "horizontal",
|
|
788
786
|
gap: "sm",
|
|
789
|
-
children: [e.buttons?.discard !== !1 && /* @__PURE__ */
|
|
787
|
+
children: [e.buttons?.discard !== !1 && /* @__PURE__ */ X(r, {
|
|
790
788
|
type: "button",
|
|
791
789
|
tone: "secondary",
|
|
792
790
|
buttonStyle: "ghost",
|
|
@@ -795,115 +793,116 @@ function De(e) {
|
|
|
795
793
|
i.discard();
|
|
796
794
|
},
|
|
797
795
|
children: e.buttons?.discard?.label ?? d.discard
|
|
798
|
-
}), /* @__PURE__ */
|
|
799
|
-
}), /* @__PURE__ */
|
|
796
|
+
}), /* @__PURE__ */ X(p, { actions: R("footer-start") })]
|
|
797
|
+
}), /* @__PURE__ */ Z(a, {
|
|
800
798
|
direction: "horizontal",
|
|
801
799
|
gap: "sm",
|
|
802
800
|
justify: "end",
|
|
803
801
|
children: [
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
!!
|
|
806
|
-
actions:
|
|
802
|
+
/* @__PURE__ */ X(p, { actions: R("footer-end") }),
|
|
803
|
+
!!R("overflow").length && /* @__PURE__ */ X(f, {
|
|
804
|
+
actions: R("overflow"),
|
|
807
805
|
srText: d.more,
|
|
808
806
|
buttonProps: { disabled: _ }
|
|
809
807
|
}),
|
|
810
|
-
e.buttons?.send !== !1 && /* @__PURE__ */ X(
|
|
808
|
+
e.buttons?.send !== !1 && /* @__PURE__ */ X(r, {
|
|
811
809
|
type: "button",
|
|
812
810
|
tone: "primary",
|
|
813
|
-
disabled: _ ||
|
|
811
|
+
disabled: _ || n.dataPending,
|
|
814
812
|
loading: _,
|
|
815
813
|
strings: { loading: d.working },
|
|
816
814
|
onClick: () => {
|
|
817
815
|
i.send();
|
|
818
816
|
},
|
|
819
|
-
children:
|
|
817
|
+
children: _ ? d.working : e.buttons?.send?.label ?? d.send
|
|
820
818
|
})
|
|
821
819
|
]
|
|
822
820
|
})]
|
|
823
|
-
}),
|
|
821
|
+
}), B = (e) => n.attempted ? x.issues.find((t) => t.field === e)?.message : void 0, V = /* @__PURE__ */ Z(a, {
|
|
824
822
|
gap: "lg",
|
|
825
823
|
className: "email-composer--body min-w-0",
|
|
826
824
|
children: [
|
|
827
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ Z(a, {
|
|
828
826
|
gap: "md",
|
|
829
827
|
className: "email-composer--details",
|
|
830
|
-
children: [/* @__PURE__ */
|
|
828
|
+
children: [/* @__PURE__ */ X(a, {
|
|
831
829
|
gap: "md",
|
|
832
830
|
children: [
|
|
833
831
|
"to",
|
|
834
832
|
"cc",
|
|
835
833
|
"bcc"
|
|
836
|
-
].filter((t) => t === "to" || t === "cc" && (
|
|
834
|
+
].filter((t) => t === "to" || t === "cc" && (E || u.cc.length || Q(e.recipients?.cc)) || t === "bcc" && (M || u.bcc.length || Q(e.recipients?.bcc))).map((t) => /* @__PURE__ */ X(xe, {
|
|
837
835
|
field: t,
|
|
838
836
|
value: u[t],
|
|
839
837
|
options: e.recipients?.[t],
|
|
840
838
|
strings: d,
|
|
841
839
|
busy: _,
|
|
842
|
-
report:
|
|
843
|
-
error:
|
|
844
|
-
onChange: (e) =>
|
|
845
|
-
actions: t === "to" ? /* @__PURE__ */
|
|
840
|
+
report: n.report,
|
|
841
|
+
error: B(t),
|
|
842
|
+
onChange: (e) => n.changeRecipients(t, e),
|
|
843
|
+
actions: t === "to" ? /* @__PURE__ */ Z(Y, { children: [!E && !u.cc.length && /* @__PURE__ */ X(r, {
|
|
846
844
|
type: "button",
|
|
847
845
|
size: "sm",
|
|
848
846
|
buttonStyle: "ghost",
|
|
849
847
|
tone: "secondary",
|
|
850
848
|
disabled: _,
|
|
851
|
-
onClick: () =>
|
|
849
|
+
onClick: () => j(!0),
|
|
852
850
|
children: d.cc
|
|
853
|
-
}), !
|
|
851
|
+
}), !M && !u.bcc.length && /* @__PURE__ */ X(r, {
|
|
854
852
|
type: "button",
|
|
855
853
|
size: "sm",
|
|
856
854
|
buttonStyle: "ghost",
|
|
857
855
|
tone: "secondary",
|
|
858
856
|
disabled: _,
|
|
859
|
-
onClick: () =>
|
|
857
|
+
onClick: () => N(!0),
|
|
860
858
|
children: d.bcc
|
|
861
859
|
})] }) : void 0
|
|
862
860
|
}, t))
|
|
863
|
-
}), /* @__PURE__ */
|
|
861
|
+
}), /* @__PURE__ */ X(b, {
|
|
864
862
|
label: d.subject,
|
|
865
863
|
required: !0,
|
|
866
|
-
htmlFor: `${
|
|
867
|
-
error:
|
|
868
|
-
supportingTextId: `${
|
|
869
|
-
children: /* @__PURE__ */
|
|
870
|
-
id: `${
|
|
864
|
+
htmlFor: `${I}-subject`,
|
|
865
|
+
error: B("subject"),
|
|
866
|
+
supportingTextId: `${I}-subject-error`,
|
|
867
|
+
children: /* @__PURE__ */ X(y, {
|
|
868
|
+
id: `${I}-subject`,
|
|
871
869
|
value: u.subject,
|
|
872
870
|
readOnly: e.subject?.readOnly,
|
|
873
871
|
disabled: _,
|
|
874
|
-
invalid: !!
|
|
875
|
-
"aria-describedby":
|
|
876
|
-
onChange: (e) =>
|
|
872
|
+
invalid: !!B("subject"),
|
|
873
|
+
"aria-describedby": B("subject") ? `${I}-subject-error` : void 0,
|
|
874
|
+
onChange: (e) => n.changeSubject(e.target.value)
|
|
877
875
|
})
|
|
878
876
|
})]
|
|
879
877
|
}),
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
value:
|
|
878
|
+
/* @__PURE__ */ X(k, {
|
|
879
|
+
value: L ? "preview" : "editor",
|
|
882
880
|
onValueChange: (e) => {
|
|
883
|
-
e &&
|
|
881
|
+
e && C(e);
|
|
884
882
|
},
|
|
885
|
-
children: /* @__PURE__ */
|
|
883
|
+
children: /* @__PURE__ */ Z(c, {
|
|
886
884
|
surface: "flat",
|
|
887
885
|
padding: "none",
|
|
888
886
|
contentGap: "md",
|
|
887
|
+
titleSize: "sm",
|
|
889
888
|
title: d.body,
|
|
890
|
-
headerAction: /* @__PURE__ */
|
|
889
|
+
headerAction: /* @__PURE__ */ Z(te, { children: [/* @__PURE__ */ X(D, {
|
|
891
890
|
value: "editor",
|
|
892
891
|
disabled: u.body.kind === "html",
|
|
893
892
|
children: d.editor
|
|
894
|
-
}), /* @__PURE__ */
|
|
893
|
+
}), /* @__PURE__ */ X(D, {
|
|
895
894
|
value: "preview",
|
|
896
895
|
children: d.preview
|
|
897
896
|
})] }),
|
|
898
897
|
children: [
|
|
899
|
-
(!!e.templates || !!
|
|
898
|
+
(!!e.templates || !!n.templates.length || R("toolbar").length > 0) && /* @__PURE__ */ Z(a, {
|
|
900
899
|
direction: "horizontal",
|
|
901
900
|
gap: "sm",
|
|
902
901
|
align: "center",
|
|
903
902
|
className: "email-composer--message-actions",
|
|
904
903
|
children: [
|
|
905
|
-
(e.templates || !!
|
|
906
|
-
trigger: /* @__PURE__ */
|
|
904
|
+
(e.templates || !!n.templates.length) && /* @__PURE__ */ X(A, {
|
|
905
|
+
trigger: /* @__PURE__ */ X(r, {
|
|
907
906
|
type: "button",
|
|
908
907
|
tone: "secondary",
|
|
909
908
|
buttonStyle: "outline",
|
|
@@ -911,7 +910,7 @@ function De(e) {
|
|
|
911
910
|
disabled: _,
|
|
912
911
|
children: d.templates
|
|
913
912
|
}),
|
|
914
|
-
items:
|
|
913
|
+
items: n.templates.map((e) => ({
|
|
915
914
|
value: e.id,
|
|
916
915
|
label: e.name,
|
|
917
916
|
description: e.description ?? e.category,
|
|
@@ -921,13 +920,13 @@ function De(e) {
|
|
|
921
920
|
try {
|
|
922
921
|
i.applyTemplate(e.value);
|
|
923
922
|
} catch (e) {
|
|
924
|
-
|
|
923
|
+
n.report(e);
|
|
925
924
|
}
|
|
926
925
|
},
|
|
927
926
|
loading: e.templates?.loading,
|
|
928
927
|
error: e.templates?.error,
|
|
929
928
|
onRetry: e.templates?.onRetry ? () => {
|
|
930
|
-
Promise.resolve().then(e.templates.onRetry).catch(
|
|
929
|
+
Promise.resolve().then(e.templates.onRetry).catch(n.report);
|
|
931
930
|
} : void 0,
|
|
932
931
|
onOpenChange: e.templates?.onOpenChange,
|
|
933
932
|
strings: {
|
|
@@ -937,88 +936,88 @@ function De(e) {
|
|
|
937
936
|
retry: d.retry
|
|
938
937
|
}
|
|
939
938
|
}),
|
|
940
|
-
e.templates?.allowImport && e.templates.onImport && /* @__PURE__ */
|
|
939
|
+
e.templates?.allowImport && e.templates.onImport && /* @__PURE__ */ X(r, {
|
|
941
940
|
type: "button",
|
|
942
941
|
tone: "secondary",
|
|
943
942
|
buttonStyle: "ghost",
|
|
944
943
|
size: "sm",
|
|
945
944
|
disabled: _,
|
|
946
945
|
onClick: () => {
|
|
947
|
-
|
|
946
|
+
n.importTemplate();
|
|
948
947
|
},
|
|
949
948
|
children: d.importTemplate
|
|
950
949
|
}),
|
|
951
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ X(p, {
|
|
952
951
|
size: "sm",
|
|
953
|
-
actions:
|
|
952
|
+
actions: R("toolbar")
|
|
954
953
|
})
|
|
955
954
|
]
|
|
956
955
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ X(O, {
|
|
958
957
|
value: "editor",
|
|
959
958
|
keepMounted: !0,
|
|
960
|
-
children: /* @__PURE__ */
|
|
959
|
+
children: /* @__PURE__ */ X(we, {
|
|
961
960
|
body: u.body,
|
|
962
|
-
disabled: _ ||
|
|
963
|
-
onChange:
|
|
964
|
-
adapterRef:
|
|
961
|
+
disabled: _ || L,
|
|
962
|
+
onChange: n.changeBody,
|
|
963
|
+
adapterRef: n.editorRef,
|
|
965
964
|
strings: d
|
|
966
965
|
})
|
|
967
966
|
}),
|
|
968
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ X(O, {
|
|
969
968
|
value: "preview",
|
|
970
|
-
children:
|
|
971
|
-
html:
|
|
972
|
-
subject:
|
|
969
|
+
children: n.rendered && /* @__PURE__ */ X(Te, {
|
|
970
|
+
html: n.rendered.email.html,
|
|
971
|
+
subject: n.rendered.email.subject,
|
|
973
972
|
strings: d
|
|
974
973
|
})
|
|
975
974
|
})
|
|
976
975
|
]
|
|
977
976
|
})
|
|
978
977
|
}),
|
|
979
|
-
(!!Object.keys(
|
|
980
|
-
value:
|
|
981
|
-
onValueChange: (e) =>
|
|
978
|
+
(!!Object.keys(n.definitions).length || Q(e.placeholders)) && /* @__PURE__ */ X(v, {
|
|
979
|
+
value: w ? ["variables"] : [],
|
|
980
|
+
onValueChange: (e) => T(e.includes("variables")),
|
|
982
981
|
items: [{
|
|
983
982
|
value: "variables",
|
|
984
983
|
title: d.variables,
|
|
985
984
|
description: d.variablesDescription,
|
|
986
|
-
content: Q(e.placeholders) ? /* @__PURE__ */
|
|
985
|
+
content: Q(e.placeholders) ? /* @__PURE__ */ X(ve, {
|
|
987
986
|
state: e.placeholders,
|
|
988
987
|
label: d.loadingVariables,
|
|
989
988
|
retryLabel: d.retry,
|
|
990
|
-
report:
|
|
991
|
-
}) : /* @__PURE__ */
|
|
992
|
-
definitions:
|
|
993
|
-
values:
|
|
989
|
+
report: n.report
|
|
990
|
+
}) : /* @__PURE__ */ X(Se, {
|
|
991
|
+
definitions: n.definitions,
|
|
992
|
+
values: n.values,
|
|
994
993
|
draft: u,
|
|
995
994
|
api: i,
|
|
996
995
|
strings: d,
|
|
997
996
|
busy: _,
|
|
998
|
-
editable: !
|
|
997
|
+
editable: !L
|
|
999
998
|
})
|
|
1000
999
|
}]
|
|
1001
1000
|
}),
|
|
1002
|
-
u.body.kind === "html" && /* @__PURE__ */
|
|
1001
|
+
u.body.kind === "html" && /* @__PURE__ */ X(r, {
|
|
1003
1002
|
type: "button",
|
|
1004
1003
|
tone: "secondary",
|
|
1005
1004
|
buttonStyle: "outline",
|
|
1006
1005
|
disabled: _,
|
|
1007
|
-
onClick: () =>
|
|
1006
|
+
onClick: () => F(!0),
|
|
1008
1007
|
children: d.convert
|
|
1009
1008
|
}),
|
|
1010
|
-
(
|
|
1009
|
+
(n.error || !n.dataPending && n.renderError) && /* @__PURE__ */ Z(s, {
|
|
1011
1010
|
tone: "destructive",
|
|
1012
|
-
children: [/* @__PURE__ */
|
|
1011
|
+
children: [/* @__PURE__ */ X(l, { children: d.errorTitle }), /* @__PURE__ */ X(o, { children: n.error || n.renderError })]
|
|
1013
1012
|
}),
|
|
1014
|
-
|
|
1013
|
+
n.notice && /* @__PURE__ */ X(s, {
|
|
1015
1014
|
tone: "success",
|
|
1016
1015
|
role: "status",
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ X(o, { children: n.notice })
|
|
1018
1017
|
}),
|
|
1019
1018
|
e.children?.(i)
|
|
1020
1019
|
]
|
|
1021
|
-
}),
|
|
1020
|
+
}), H = e.title ?? d.title, U = e.onClose ? /* @__PURE__ */ X(r, {
|
|
1022
1021
|
type: "button",
|
|
1023
1022
|
iconOnly: !0,
|
|
1024
1023
|
tone: "secondary",
|
|
@@ -1027,12 +1026,12 @@ function De(e) {
|
|
|
1027
1026
|
disabled: _,
|
|
1028
1027
|
"aria-label": d.close,
|
|
1029
1028
|
onClick: e.onClose,
|
|
1030
|
-
children: /* @__PURE__ */
|
|
1031
|
-
}) : void 0,
|
|
1029
|
+
children: /* @__PURE__ */ X(de, { className: "size-icon" })
|
|
1030
|
+
}) : void 0, W, K = t("email-composer--component min-w-0", e.className);
|
|
1032
1031
|
if (e.position === "dialog" || e.position === "sheet") {
|
|
1033
1032
|
let t = {
|
|
1034
1033
|
open: !0,
|
|
1035
|
-
title:
|
|
1034
|
+
title: H,
|
|
1036
1035
|
description: e.description,
|
|
1037
1036
|
onOpenChange: (t) => {
|
|
1038
1037
|
!t && !_ && e.onClose?.();
|
|
@@ -1044,43 +1043,42 @@ function De(e) {
|
|
|
1044
1043
|
showCancel: !1,
|
|
1045
1044
|
showConfirm: !1,
|
|
1046
1045
|
showCloseButton: !!e.onClose && !_,
|
|
1047
|
-
footer:
|
|
1048
|
-
className:
|
|
1046
|
+
footer: z,
|
|
1047
|
+
className: K
|
|
1049
1048
|
};
|
|
1050
|
-
|
|
1049
|
+
W = e.position === "dialog" ? /* @__PURE__ */ X(h, {
|
|
1051
1050
|
...t,
|
|
1052
1051
|
size: "3xl",
|
|
1053
1052
|
showCloseButton: !!e.onClose && !_,
|
|
1054
|
-
children:
|
|
1055
|
-
}) : /* @__PURE__ */
|
|
1053
|
+
children: V
|
|
1054
|
+
}) : /* @__PURE__ */ X(m, {
|
|
1056
1055
|
...t,
|
|
1057
1056
|
width: "3xl",
|
|
1058
|
-
children:
|
|
1057
|
+
children: V
|
|
1059
1058
|
});
|
|
1060
1059
|
} else {
|
|
1061
|
-
let t = /* @__PURE__ */
|
|
1062
|
-
className:
|
|
1060
|
+
let t = /* @__PURE__ */ X(c, {
|
|
1061
|
+
className: K,
|
|
1063
1062
|
surface: "card",
|
|
1064
|
-
title:
|
|
1063
|
+
title: H,
|
|
1065
1064
|
description: e.description,
|
|
1066
|
-
headerAction:
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
children: B
|
|
1065
|
+
headerAction: U,
|
|
1066
|
+
headerClassName: e.position === "floating" && U ? "flex-nowrap [&>.card--header-start]:basis-0 [&>.card--header-end]:shrink-0" : void 0,
|
|
1067
|
+
footerSlot: z,
|
|
1068
|
+
children: V
|
|
1071
1069
|
});
|
|
1072
|
-
|
|
1070
|
+
W = e.position === "floating" ? /* @__PURE__ */ X("div", {
|
|
1073
1071
|
className: "fixed bottom-space-md end-space-md z-40 w-[min(42rem,calc(100vw-2rem))]",
|
|
1074
|
-
children: /* @__PURE__ */
|
|
1072
|
+
children: /* @__PURE__ */ X(ee, {
|
|
1075
1073
|
className: "max-h-[calc(100dvh-2rem)]",
|
|
1076
1074
|
viewportClassName: "max-h-[calc(100dvh-2rem)]",
|
|
1077
1075
|
children: t
|
|
1078
1076
|
})
|
|
1079
1077
|
}) : t;
|
|
1080
1078
|
}
|
|
1081
|
-
return /* @__PURE__ */
|
|
1082
|
-
open:
|
|
1083
|
-
onOpenChange:
|
|
1079
|
+
return /* @__PURE__ */ Z(Y, { children: [W, /* @__PURE__ */ X(g, {
|
|
1080
|
+
open: P,
|
|
1081
|
+
onOpenChange: F,
|
|
1084
1082
|
title: d.convertTitle,
|
|
1085
1083
|
description: d.convertDescription,
|
|
1086
1084
|
strings: {
|
|
@@ -1089,11 +1087,11 @@ function De(e) {
|
|
|
1089
1087
|
close: d.closeConversion
|
|
1090
1088
|
},
|
|
1091
1089
|
onConfirm: () => {
|
|
1092
|
-
!_ &&
|
|
1090
|
+
!_ && n.editorRef.current && (i.setBody(n.editorRef.current.convert(u.body)), C("editor"));
|
|
1093
1091
|
}
|
|
1094
1092
|
})] });
|
|
1095
1093
|
}
|
|
1096
1094
|
//#endregion
|
|
1097
|
-
export {
|
|
1095
|
+
export { Ee as EmailComposer, F as bodyHtml, H as createHttpSender, U as defaultEmailComposerStrings, B as parseRecipient, I as recipientLabel, P as renderEmail, z as resolveValues, V as validate };
|
|
1098
1096
|
|
|
1099
1097
|
//# sourceMappingURL=email-composer.js.map
|