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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt-
|
|
1
|
+
{"version":3,"file":"receipt-CV89q1fs.js","names":["NumberValue","cn","Text","Stack","hasRenderableContent","Card","Money","Number$1","paperClip","width","height","depth","inset","count","toothWidth","step","point","x","y","points","segment","Receipt","forwardRef","props","paper","useRef","clipPath","setClipPath","useState","toothDepth","element","update","rectangle","observer","children","header","footer","qrCode","hasFooter","className","shadow","ReceiptItems","items","item"],"sources":["../src/components/blocks/commerce/receipt/receipt.tsx","../src/components/blocks/commerce/receipt/receipt-items.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Card, hasRenderableContent } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptProps } from './types';\n\nfunction paperClip(width: number, height: number, depth: number, toothWidth: number) {\n\tif (!(width > 0 && height > 0 && depth > 0)) return undefined;\n\tconst inset = Math.min(depth, height / 4);\n\tconst count = Math.max(1, Math.min(1024, Math.round(width / toothWidth)));\n\tconst step = width / count;\n\tconst point = (x: number, y: number) => `${Number(x.toFixed(2))}px ${Number(y.toFixed(2))}px`;\n\tconst points: string[] = [point(0, inset)];\n\tfor (let segment = 0; segment < count; segment++) {\n\t\tpoints.push(point((segment + 0.5) * step, 0), point((segment + 1) * step, inset));\n\t}\n\tpoints.push(point(width, height - inset));\n\tfor (let segment = count - 1; segment >= 0; segment--) {\n\t\tpoints.push(point((segment + 0.5) * step, height), point(segment * step, height - inset));\n\t}\n\treturn `polygon(${points.join(', ')})`;\n}\n\n/** Explicit paper surface: Card owns all content insets; clipping is decorative geometry. */\nexport const Receipt = forwardRef<HTMLDivElement, ReceiptProps>(function Receipt({\n\tchildren, header, footer, qrCode, padding = 'md', toothDepth = 5, toothWidth = 8,\n\tshadow = true, className, ...props\n}, ref) {\n\tconst paper = useRef<HTMLDivElement>(null);\n\tconst [clipPath, setClipPath] = useState<string>();\n\tconst depth = Number.isFinite(toothDepth) ? Math.max(0, toothDepth) : 5;\n\tconst width = Number.isFinite(toothWidth) ? Math.max(2, toothWidth) : 8;\n\tuseEffect(() => {\n\t\tconst element = paper.current;\n\t\tif (!element) return;\n\t\tconst update = () => {\n\t\t\tconst rectangle = element.getBoundingClientRect();\n\t\t\tsetClipPath(paperClip(rectangle.width, rectangle.height, depth, width));\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') {\n\t\t\twindow.addEventListener('resize', update);\n\t\t\treturn () => window.removeEventListener('resize', update);\n\t\t}\n\t\tconst observer = new ResizeObserver(update);\n\t\tobserver.observe(element);\n\t\treturn () => observer.disconnect();\n\t}, [depth, width, children, header, footer, qrCode]);\n\tconst hasFooter = hasRenderableContent(footer) || hasRenderableContent(qrCode);\n\treturn <div {...props} ref={ref} className={cn('receipt--component relative isolate w-full min-w-0', className)}>\n\t\t{shadow && <div aria-hidden=\"true\" className=\"receipt--shadow pointer-events-none absolute inset-x-0 rounded-radius shadow-sm\" style={{ insetBlock: depth }} />}\n\t\t<Card ref={paper} surface=\"flat\" padding={padding} headerStart={header}\n\t\t\tfooterSlot={hasFooter ? <Stack gap=\"normal\" align=\"center\" className=\"receipt--footer w-full min-w-0\">{qrCode}{footer}</Stack> : undefined}\n\t\t\tclassName=\"receipt--paper relative bg-card text-card-foreground\" style={{ clipPath }}>\n\t\t\t{children}\n\t\t</Card>\n\t</div>;\n});\n","import { Stack } from '../../../base/structure';\nimport { Money } from '../../../primitives/money';\nimport { Number as NumberValue } from '../../../primitives/number';\nimport { Text } from '../../../typography/text';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptItemsProps } from './types';\n\nexport function ReceiptItems({ items, currency, locale, unit, minorUnitScale, formatMode, className, ...props }: ReceiptItemsProps) {\n\tif (items.length === 0) return null;\n\treturn <Stack {...props} gap=\"md\" className={cn('receipt-items--component min-w-0', className)}>\n\t\t{items.map(item => <Stack key={item.id} direction=\"horizontal\" gap=\"md\" justify=\"between\" align=\"start\" wrap={false} className=\"receipt-items--item min-w-0\">\n\t\t\t<Stack gap=\"dense\" className=\"receipt-items--copy min-w-0 flex-1\">\n\t\t\t\t<Text className=\"break-words [overflow-wrap:anywhere]\">{item.name} × <NumberValue value={item.quantity} locale={locale} align=\"left\" /></Text>\n\t\t\t\t{item.description != null && <Text size=\"xs\" type=\"secondary\" className=\"break-words [overflow-wrap:anywhere]\">{item.description}</Text>}\n\t\t\t</Stack>\n\t\t\t<Money amount={item.total ?? item.quantity * item.unitPrice} currency={currency} locale={locale} unit={unit} minorUnitScale={minorUnitScale} formatMode={formatMode} className=\"receipt-items--amount min-w-0 max-w-full whitespace-normal [overflow-wrap:anywhere]\" />\n\t\t</Stack>)}\n\t</Stack>;\n}\n"],"mappings":";;;;;;;;;AAMA,SAASQ,EAAU,GAAe,GAAgB,GAAe,GAAoB;CACpF,IAAI,EAAEC,IAAQ,KAAKC,IAAS,KAAKC,IAAQ,IAAI;CAC7C,IAAMC,IAAQ,KAAK,IAAID,GAAOD,IAAS,CAAC,GAClCG,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,KAAK,MAAMJ,IAAQK,CAAU,CAAC,CAAC,GAClEC,IAAON,IAAQI,GACfG,KAAS,GAAW,MAAc,GAAG,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KACpFC,IAAmB,CAACH,EAAM,GAAGJ,CAAK,CAAC;CACzC,KAAK,IAAIQ,IAAU,GAAGA,IAAUP,GAAO,KACtC,EAAO,KAAKG,GAAOI,IAAU,MAAOL,GAAM,CAAC,GAAGC,GAAOI,IAAU,KAAKL,GAAMH,CAAK,CAAC;CAEjF,EAAO,KAAKI,EAAMP,GAAOC,IAASE,CAAK,CAAC;CACxC,KAAK,IAAIQ,IAAUP,IAAQ,GAAGO,KAAW,GAAG,KAC3C,EAAO,KAAKJ,GAAOI,IAAU,MAAOL,GAAML,CAAM,GAAGM,EAAMI,IAAUL,GAAML,IAASE,CAAK,CAAC;CAEzF,OAAO,WAAWO,EAAO,KAAK,IAAI,EAAE;AACrC;AAGA,IAAaE,IAAUC,EAAyC,SAAiB,EAChF,aAAU,WAAQ,WAAQ,WAAQ,aAAU,MAAM,gBAAa,GAAG,gBAAa,GAC/E,YAAS,IAAM,cAAW,GAAGC,KAC3B,GAAK;CACP,IAAMC,IAAQC,EAAuB,IAAI,GACnC,CAACC,GAAUC,KAAeC,EAAiB,GAC3CjB,IAAQ,OAAO,SAASkB,CAAU,IAAI,KAAK,IAAI,GAAGA,CAAU,IAAI,GAChEpB,IAAQ,OAAO,SAASK,CAAU,IAAI,KAAK,IAAI,GAAGA,CAAU,IAAI;CACtE,QAAgB;EACf,IAAMgB,IAAUN,EAAM;EACtB,IAAI,CAACM,GAAS;EACd,IAAMC,UAAe;GACpB,IAAMC,IAAYF,EAAQ,sBAAsB;GAChD,EAAYtB,EAAUwB,EAAU,OAAOA,EAAU,QAAQrB,GAAOF,CAAK,CAAC;EACvE;EAEA,IADAsB,EAAO,GACH,OAAO,iBAAmB,KAE7B,OADA,OAAO,iBAAiB,UAAUA,CAAM,SAC3B,OAAO,oBAAoB,UAAUA,CAAM;EAEzD,IAAME,IAAW,IAAI,eAAeF,CAAM;EAE1C,OADAE,EAAS,QAAQH,CAAO,SACXG,EAAS,WAAW;CAClC,GAAG;EAACtB;EAAOF;EAAOyB;EAAUC;EAAQC;EAAQC;CAAM,CAAC;CACnD,IAAMC,IAAYlC,EAAqBgC,CAAM,KAAKhC,EAAqBiC,CAAM;CAC7E,OAAO,kBAAC,OAAD;EAAK,GAAId;EAAY;EAAK,WAAWtB,EAAG,sDAAsDsC,CAAS;EAAvG,UAAA,CACLC,KAAU,kBAAC,OAAD;GAAK,eAAY;GAAO,WAAU;GAAkF,OAAO,EAAE,YAAY7B,EAAM;EAAI,CAAA,GAC9J,kBAACN,GAAD;GAAM,KAAKmB;GAAO,SAAQ;GAAgB;GAAS,aAAaW;GAC/D,YAAYG,IAAY,kBAACnC,GAAD;IAAO,KAAI;IAAS,OAAM;IAAS,WAAU;IAA7C,UAAA,CAA+EkC,GAAQD,CAAc;GAAI,CAAA,IAAA,KAAA;GACjI,WAAU;GAAuD,OAAO,EAAE,YAAS;GAClF;EACI,CAAA,CACF;;AACN,CAAC;;;AClDD,SAAgBK,EAAa,EAAE,UAAO,aAAU,WAAQ,SAAM,mBAAgB,eAAY,cAAW,GAAGlB,KAA4B;CAEnI,OADImB,EAAM,WAAW,IAAU,OACxB,kBAACvC,GAAD;EAAO,GAAIoB;EAAO,KAAI;EAAK,WAAWtB,EAAG,oCAAoCsC,CAAS;EAC3F,UAAAG,EAAM,KAAI,MAAQ,kBAACvC,GAAD;GAAqB,WAAU;GAAa,KAAI;GAAK,SAAQ;GAAU,OAAM;GAAQ,MAAM;GAAO,WAAU;GAA5G,UAAA,CAClB,kBAACA,GAAD;IAAO,KAAI;IAAQ,WAAU;IAA7B,UAAA,CACC,kBAACD,GAAD;KAAM,WAAU;KAAhB,UAAA;MAAwDyC,EAAK;MAAK;MAAG,kBAAC3C,GAAD;OAAa,OAAO2C,EAAK;OAAkB;OAAQ,OAAM;MAAQ,CAAA;KAAO;IAC5I,CAAA,GAAAA,EAAK,eAAe,QAAQ,kBAACzC,GAAD;KAAM,MAAK;KAAK,MAAK;KAAY,WAAU;KAAwC,UAAAyC,EAAK;IAAkB,CAAA,CACjI;GACP,CAAA,GAAA,kBAACrC,GAAD;IAAO,QAAQqC,EAAK,SAASA,EAAK,WAAWA,EAAK;IAAqB;IAAkB;IAAc;IAAsB;IAA4B;IAAY,WAAU;GAAuF,CAAA,CAChQ;EANwB,GAAAA,EAAK,EAM7B,CAAC;CACF,CAAA;AACR"}
|
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useStrings as e } from "./lib/strings.js";
|
|
3
|
+
import { t } from "./utils-Cospvlj1.js";
|
|
4
|
+
import { s as n } from "./typography-CAr3dQhX.js";
|
|
5
|
+
import { n as r } from "./content-typography-CnwgMJ37.js";
|
|
6
|
+
import { g as i } from "./primitives-BHrwQXFC.js";
|
|
7
|
+
import { t as a } from "./number-CKRBYmZK.js";
|
|
8
|
+
import { n as o, t as s } from "./rich-text-editor.recipes-CnrbmTS1.js";
|
|
9
|
+
import { t as c } from "./rich-text-editor.strings-BpnIQgMl.js";
|
|
10
|
+
import { forwardRef as l, useCallback as u, useEffect as d, useImperativeHandle as ee, useMemo as f, useRef as p, useState as m } from "react";
|
|
11
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
|
+
import { Bold as te, Italic as v, List as ne, ListOrdered as re, Quote as y, Redo2 as b, Strikethrough as ie, Undo2 as ae } from "lucide-react";
|
|
13
|
+
import * as x from "@tiptap/react";
|
|
14
|
+
import * as S from "@tiptap/starter-kit";
|
|
15
|
+
//#region src/components/features/rich-text-editor/partials/caret-helpers.ts
|
|
16
|
+
function oe() {
|
|
17
|
+
if (typeof window > "u") return null;
|
|
18
|
+
let e = window.getSelection();
|
|
19
|
+
if (!e || e.rangeCount === 0) return null;
|
|
20
|
+
let t = e.getRangeAt(0);
|
|
21
|
+
if (!t.collapsed) return null;
|
|
22
|
+
let n = t.startContainer, r = t.startOffset, i = n;
|
|
23
|
+
for (; i && i.nodeType !== Node.ELEMENT_NODE;) i = i.parentNode;
|
|
24
|
+
if (!i) return null;
|
|
25
|
+
let a = i.closest("[contenteditable=\"true\"]") ?? i.closest(".ProseMirror");
|
|
26
|
+
if (!a) return null;
|
|
27
|
+
let o = "";
|
|
28
|
+
n.nodeType === Node.TEXT_NODE && (o = (n.textContent ?? "").slice(0, r));
|
|
29
|
+
let s = n;
|
|
30
|
+
for (; s && s !== a && s !== i;) {
|
|
31
|
+
let e = s.previousSibling;
|
|
32
|
+
for (; e;) o = (e.textContent ?? "") + o, e = e.previousSibling;
|
|
33
|
+
if (s = s.parentNode, s && s.matches?.("p, li, h1, h2, h3, h4, h5, h6, blockquote")) break;
|
|
34
|
+
}
|
|
35
|
+
let c, l = t.getBoundingClientRect();
|
|
36
|
+
return l && (l.top || l.left || l.right || l.bottom) && (c = {
|
|
37
|
+
top: l.top,
|
|
38
|
+
left: l.left,
|
|
39
|
+
bottom: l.bottom,
|
|
40
|
+
right: l.right
|
|
41
|
+
}), {
|
|
42
|
+
textBefore: o,
|
|
43
|
+
rect: c
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function se(e, t, n, r) {
|
|
47
|
+
if (typeof window > "u") return;
|
|
48
|
+
let i = window.getSelection();
|
|
49
|
+
if (!i || i.rangeCount === 0) return;
|
|
50
|
+
let a = i.getRangeAt(0);
|
|
51
|
+
if (!a.collapsed) return;
|
|
52
|
+
let o = t, s = a.startContainer, c = a.startOffset;
|
|
53
|
+
for (; o > 0;) {
|
|
54
|
+
if (s.nodeType === Node.TEXT_NODE) {
|
|
55
|
+
let e = Math.min(c, o);
|
|
56
|
+
if (c -= e, o -= e, o === 0) break;
|
|
57
|
+
}
|
|
58
|
+
let e = w(s);
|
|
59
|
+
if (!e) break;
|
|
60
|
+
s = e, c = e.textContent?.length ?? 0;
|
|
61
|
+
}
|
|
62
|
+
let l = document.createRange();
|
|
63
|
+
if (l.setStart(s, c), l.setEnd(a.endContainer, a.endOffset), i.removeAllRanges(), i.addRange(l), e) {
|
|
64
|
+
e.chain().focus().insertContent(n).run(), r(e.getHTML());
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
l.deleteContents();
|
|
68
|
+
let u = document.createRange().createContextualFragment(n);
|
|
69
|
+
l.insertNode(u), i.collapseToEnd();
|
|
70
|
+
let d = s?.parentElement?.closest?.("[contenteditable=\"true\"]") ?? null;
|
|
71
|
+
d && r(d.innerHTML);
|
|
72
|
+
}
|
|
73
|
+
function C(e, t) {
|
|
74
|
+
if (typeof window > "u" || !e) return;
|
|
75
|
+
e.focus();
|
|
76
|
+
let n = window.getSelection();
|
|
77
|
+
if (!n || n.rangeCount === 0) {
|
|
78
|
+
e.insertAdjacentHTML("beforeend", t);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let r = n.getRangeAt(0);
|
|
82
|
+
if (!e.contains(r.commonAncestorContainer)) {
|
|
83
|
+
e.insertAdjacentHTML("beforeend", t);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
r.deleteContents();
|
|
87
|
+
let i = document.createRange().createContextualFragment(t);
|
|
88
|
+
r.insertNode(i), r.collapse(!1), n.removeAllRanges(), n.addRange(r);
|
|
89
|
+
}
|
|
90
|
+
function w(e) {
|
|
91
|
+
let t = e;
|
|
92
|
+
for (; t;) {
|
|
93
|
+
if (t.previousSibling) {
|
|
94
|
+
for (t = t.previousSibling; t && t.lastChild;) t = t.lastChild;
|
|
95
|
+
if (t && t.nodeType === Node.TEXT_NODE) return t;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (t = t.parentNode, !t || t.matches?.("p, li, h1, h2, h3, h4, h5, h6, blockquote, [contenteditable=\"true\"]")) return null;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/features/rich-text-editor/partials/counts-footer.tsx
|
|
104
|
+
function T({ text: e, maxLength: r, strings: o, className: s }) {
|
|
105
|
+
let c = e.length, l = e.trim().length > 0 ? e.trim().split(/\s+/).length : 0, u = typeof r == "number" && c > r;
|
|
106
|
+
return /* @__PURE__ */ _("div", {
|
|
107
|
+
className: t("counts-footer-text--component border-border flex items-center justify-end gap-space-lg border-t px-control py-space-sm", s),
|
|
108
|
+
children: [/* @__PURE__ */ _(n, {
|
|
109
|
+
tag: "span",
|
|
110
|
+
size: "xs",
|
|
111
|
+
type: u ? "error" : "secondary",
|
|
112
|
+
weight: u ? "medium" : "regular",
|
|
113
|
+
className: t("tabular-nums"),
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ g(a, {
|
|
116
|
+
value: c,
|
|
117
|
+
size: "xs",
|
|
118
|
+
type: u ? "error" : "secondary",
|
|
119
|
+
align: "left"
|
|
120
|
+
}),
|
|
121
|
+
typeof r == "number" && /* @__PURE__ */ _(h, { children: [" / ", /* @__PURE__ */ g(a, {
|
|
122
|
+
value: r,
|
|
123
|
+
size: "xs",
|
|
124
|
+
type: u ? "error" : "secondary",
|
|
125
|
+
align: "left"
|
|
126
|
+
})] }),
|
|
127
|
+
" ",
|
|
128
|
+
o.counts.characters
|
|
129
|
+
]
|
|
130
|
+
}), /* @__PURE__ */ _(i, {
|
|
131
|
+
size: "xs",
|
|
132
|
+
className: "tabular-nums",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ g(a, {
|
|
135
|
+
value: l,
|
|
136
|
+
size: "xs",
|
|
137
|
+
type: "secondary",
|
|
138
|
+
align: "left"
|
|
139
|
+
}),
|
|
140
|
+
" ",
|
|
141
|
+
o.counts.words
|
|
142
|
+
]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
T.displayName = "CountsFooterText";
|
|
147
|
+
function E({ editor: e, sourceMode: t, sourceValue: n, maxLength: r, strings: i }) {
|
|
148
|
+
let a = t ? n.replace(/<[^>]*>/g, "") : e?.getText() ?? "";
|
|
149
|
+
return /* @__PURE__ */ g(T, {
|
|
150
|
+
text: a,
|
|
151
|
+
maxLength: r,
|
|
152
|
+
strings: i
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
E.displayName = "CountsFooter";
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/components/features/rich-text-editor/partials/html-helpers.ts
|
|
158
|
+
function D(e) {
|
|
159
|
+
let t = e.trim();
|
|
160
|
+
return t === "" || t === "<p></p>" || t === "<p><br></p>" ? "" : t;
|
|
161
|
+
}
|
|
162
|
+
function O(e) {
|
|
163
|
+
let t = D(e);
|
|
164
|
+
return t === "" ? "<p></p>" : t;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/components/features/rich-text-editor/partials/rich-text-editor-tiptap.tsx
|
|
168
|
+
var k = x.EditorContent, A = x.useEditor, j = "default" in S ? S.default : S, M = l(function({ value: i, onValueChange: a, placeholder: l, compact: h = !1, minHeight: x, maxHeight: S, disabled: C = !1, showCounts: w = !1, maxLength: T, extraToolbarItems: M, toolbarTrailing: N, footerSlot: P, hideSourceToggle: F = !1, autoFocus: I = !1, className: ce, onCaretChange: L, strings: R }, z) {
|
|
169
|
+
let B = e(c, R), [V, H] = m(!1), [U, W] = m(!1), [G, K] = m(""), q = p(!1), J = p(D(i)), Y = p(L);
|
|
170
|
+
Y.current = L;
|
|
171
|
+
let X = A({
|
|
172
|
+
extensions: [j],
|
|
173
|
+
content: O(i),
|
|
174
|
+
editable: !C,
|
|
175
|
+
immediatelyRender: !1,
|
|
176
|
+
autofocus: I ? "end" : !1,
|
|
177
|
+
onFocus: () => {
|
|
178
|
+
q.current = !0, H(!0);
|
|
179
|
+
},
|
|
180
|
+
onBlur: () => {
|
|
181
|
+
q.current = !1, H(!1);
|
|
182
|
+
},
|
|
183
|
+
onUpdate: ({ editor: e }) => {
|
|
184
|
+
let t = D(e.getHTML());
|
|
185
|
+
q.current && (t !== J.current && (J.current = t, a(t)), Y.current?.());
|
|
186
|
+
},
|
|
187
|
+
editorProps: { attributes: {
|
|
188
|
+
role: "textbox",
|
|
189
|
+
"aria-label": B.editorLabel,
|
|
190
|
+
"aria-multiline": "true",
|
|
191
|
+
class: r
|
|
192
|
+
} }
|
|
193
|
+
});
|
|
194
|
+
d(() => {
|
|
195
|
+
if (!X) return;
|
|
196
|
+
let e = D(X.getHTML()), t = D(i);
|
|
197
|
+
J.current = t, e !== t && X.commands.setContent(O(t), { emitUpdate: !1 });
|
|
198
|
+
}, [X, i]), d(() => {
|
|
199
|
+
X && X.setEditable(!C);
|
|
200
|
+
}, [C, X]), d(() => {
|
|
201
|
+
if (typeof document > "u") return;
|
|
202
|
+
let e = () => {
|
|
203
|
+
q.current && Y.current?.();
|
|
204
|
+
};
|
|
205
|
+
return document.addEventListener("selectionchange", e), () => document.removeEventListener("selectionchange", e);
|
|
206
|
+
}, []), ee(z, () => ({
|
|
207
|
+
focus: () => {
|
|
208
|
+
X?.chain().focus().run();
|
|
209
|
+
},
|
|
210
|
+
getHTML: () => D(X?.getHTML() ?? ""),
|
|
211
|
+
setHTML: (e) => {
|
|
212
|
+
let t = D(e);
|
|
213
|
+
J.current = t, X?.commands.setContent(O(t), { emitUpdate: !1 }), a(t);
|
|
214
|
+
},
|
|
215
|
+
insertHTML: (e) => {
|
|
216
|
+
X && X.chain().focus().insertContent(e).run();
|
|
217
|
+
},
|
|
218
|
+
isEmpty: () => D(X?.getHTML() ?? "") === "",
|
|
219
|
+
clear: () => {
|
|
220
|
+
J.current = "", X?.commands.setContent("<p></p>", { emitUpdate: !1 }), a("");
|
|
221
|
+
},
|
|
222
|
+
getCaretContext: () => oe(),
|
|
223
|
+
replaceBeforeCaret: (e, t) => {
|
|
224
|
+
se(X, e, t, (e) => {
|
|
225
|
+
J.current = D(e), a(J.current);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}), [X, a]);
|
|
229
|
+
let Z = f(() => ({
|
|
230
|
+
minHeight: x ?? (h ? "2rem" : "12rem"),
|
|
231
|
+
...S ? {
|
|
232
|
+
maxHeight: S,
|
|
233
|
+
overflowY: "auto"
|
|
234
|
+
} : {}
|
|
235
|
+
}), [
|
|
236
|
+
h,
|
|
237
|
+
S,
|
|
238
|
+
x
|
|
239
|
+
]), le = u(() => {
|
|
240
|
+
if (X) {
|
|
241
|
+
if (U) {
|
|
242
|
+
let e = O(G);
|
|
243
|
+
X.commands.setContent(e, { emitUpdate: !1 });
|
|
244
|
+
let t = D(G);
|
|
245
|
+
J.current = t, a(t), W(!1);
|
|
246
|
+
} else K(X.getHTML()), W(!0);
|
|
247
|
+
}
|
|
248
|
+
}, [
|
|
249
|
+
X,
|
|
250
|
+
a,
|
|
251
|
+
U,
|
|
252
|
+
G
|
|
253
|
+
]), Q = u((e) => {
|
|
254
|
+
let t = e.target.value;
|
|
255
|
+
K(t);
|
|
256
|
+
let n = D(t);
|
|
257
|
+
J.current = n, a(n);
|
|
258
|
+
}, [a]), ue = f(() => [
|
|
259
|
+
{
|
|
260
|
+
id: "bold",
|
|
261
|
+
icon: te,
|
|
262
|
+
label: B.toolbar.bold,
|
|
263
|
+
isActive: () => !!X?.isActive("bold"),
|
|
264
|
+
run: () => X?.chain().focus().toggleBold().run()
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "italic",
|
|
268
|
+
icon: v,
|
|
269
|
+
label: B.toolbar.italic,
|
|
270
|
+
isActive: () => !!X?.isActive("italic"),
|
|
271
|
+
run: () => X?.chain().focus().toggleItalic().run()
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "strike",
|
|
275
|
+
icon: ie,
|
|
276
|
+
label: B.toolbar.strike,
|
|
277
|
+
isActive: () => !!X?.isActive("strike"),
|
|
278
|
+
run: () => X?.chain().focus().toggleStrike().run()
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: "bullet-list",
|
|
282
|
+
icon: ne,
|
|
283
|
+
label: B.toolbar.bulletList,
|
|
284
|
+
isActive: () => !!X?.isActive("bulletList"),
|
|
285
|
+
run: () => X?.chain().focus().toggleBulletList().run()
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: "ordered-list",
|
|
289
|
+
icon: re,
|
|
290
|
+
label: B.toolbar.orderedList,
|
|
291
|
+
isActive: () => !!X?.isActive("orderedList"),
|
|
292
|
+
run: () => X?.chain().focus().toggleOrderedList().run()
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: "blockquote",
|
|
296
|
+
icon: y,
|
|
297
|
+
label: B.toolbar.blockquote,
|
|
298
|
+
isActive: () => !!X?.isActive("blockquote"),
|
|
299
|
+
run: () => X?.chain().focus().toggleBlockquote().run()
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: "undo",
|
|
303
|
+
icon: ae,
|
|
304
|
+
label: B.toolbar.undo,
|
|
305
|
+
isActive: () => !1,
|
|
306
|
+
run: () => X?.chain().focus().undo().run(),
|
|
307
|
+
disabled: !X?.can().chain().focus().undo().run()
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "redo",
|
|
311
|
+
icon: b,
|
|
312
|
+
label: B.toolbar.redo,
|
|
313
|
+
isActive: () => !1,
|
|
314
|
+
run: () => X?.chain().focus().redo().run(),
|
|
315
|
+
disabled: !X?.can().chain().focus().redo().run()
|
|
316
|
+
}
|
|
317
|
+
], [X, B]), de = w && X ? /* @__PURE__ */ g(E, {
|
|
318
|
+
editor: X,
|
|
319
|
+
sourceMode: U,
|
|
320
|
+
sourceValue: G,
|
|
321
|
+
maxLength: T,
|
|
322
|
+
strings: B
|
|
323
|
+
}) : null, $ = typeof l == "string" ? l : "", fe = $.length > 0 && !V && X?.isEmpty ? /* @__PURE__ */ g(n, {
|
|
324
|
+
tag: "span",
|
|
325
|
+
size: "sm",
|
|
326
|
+
type: "secondary",
|
|
327
|
+
className: "pointer-events-none absolute inset-0 px-control py-control-y-offset",
|
|
328
|
+
children: $
|
|
329
|
+
}) : null;
|
|
330
|
+
return /* @__PURE__ */ _("div", {
|
|
331
|
+
className: t(s.frame, C && s.disabled, ce),
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ g(o, {
|
|
334
|
+
buttons: ue,
|
|
335
|
+
extraToolbarItems: M,
|
|
336
|
+
hideSourceToggle: F,
|
|
337
|
+
sourceMode: U,
|
|
338
|
+
toggleSourceMode: le,
|
|
339
|
+
disabled: C,
|
|
340
|
+
hasEditor: !!X,
|
|
341
|
+
toolbarTrailing: N,
|
|
342
|
+
strings: B
|
|
343
|
+
}),
|
|
344
|
+
U ? /* @__PURE__ */ g("textarea", {
|
|
345
|
+
"aria-label": B.sourceLabel,
|
|
346
|
+
value: G,
|
|
347
|
+
onChange: Q,
|
|
348
|
+
disabled: C,
|
|
349
|
+
spellCheck: !1,
|
|
350
|
+
className: t(s.source, C && "cursor-not-allowed"),
|
|
351
|
+
style: Z
|
|
352
|
+
}) : /* @__PURE__ */ _("div", {
|
|
353
|
+
className: "relative",
|
|
354
|
+
style: Z,
|
|
355
|
+
children: [fe, /* @__PURE__ */ g(k, {
|
|
356
|
+
editor: X,
|
|
357
|
+
className: s.content
|
|
358
|
+
})]
|
|
359
|
+
}),
|
|
360
|
+
!!P && /* @__PURE__ */ g("div", {
|
|
361
|
+
className: "px-control pb-space-md pt-space-xs",
|
|
362
|
+
children: P
|
|
363
|
+
}),
|
|
364
|
+
de
|
|
365
|
+
]
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
M.displayName = "TiptapRichTextEditor";
|
|
369
|
+
var N = typeof k == "function" && typeof A == "function" && typeof j == "object" && !!j, P = l(function({ value: i, onValueChange: a, placeholder: l, compact: h = !1, minHeight: x, maxHeight: S, disabled: w = !1, showCounts: E = !1, maxLength: k, extraToolbarItems: A, toolbarTrailing: j, footerSlot: M, hideSourceToggle: N = !1, autoFocus: P = !1, className: F, onCaretChange: I, strings: ce }, L) {
|
|
370
|
+
let R = e(c, ce), z = p(null), [B, V] = m(!1), [H, U] = m(!1), [W, G] = m(""), K = p(D(i)), q = p(I);
|
|
371
|
+
q.current = I;
|
|
372
|
+
let J = u((e) => {
|
|
373
|
+
z.current = e, e && e.innerHTML === "" && (e.innerHTML = O(K.current));
|
|
374
|
+
}, []);
|
|
375
|
+
d(() => {
|
|
376
|
+
let e = z.current;
|
|
377
|
+
if (!e || B) return;
|
|
378
|
+
let t = O(i);
|
|
379
|
+
D(e.innerHTML) !== D(t) && (e.innerHTML = t), K.current = D(i);
|
|
380
|
+
}, [B, i]), d(() => {
|
|
381
|
+
P && z.current?.focus();
|
|
382
|
+
}, [P]);
|
|
383
|
+
let Y = u(() => {
|
|
384
|
+
let e = z.current, t = D(e?.innerHTML ?? "");
|
|
385
|
+
K.current = t, a(t), q.current?.();
|
|
386
|
+
}, [a]);
|
|
387
|
+
ee(L, () => ({
|
|
388
|
+
focus: () => z.current?.focus(),
|
|
389
|
+
getHTML: () => D(z.current?.innerHTML ?? ""),
|
|
390
|
+
setHTML: (e) => {
|
|
391
|
+
let t = D(e);
|
|
392
|
+
K.current = t, z.current && (z.current.innerHTML = O(t)), a(t);
|
|
393
|
+
},
|
|
394
|
+
insertHTML: (e) => {
|
|
395
|
+
C(z.current, e), Y();
|
|
396
|
+
},
|
|
397
|
+
isEmpty: () => D(z.current?.innerHTML ?? "") === "",
|
|
398
|
+
clear: () => {
|
|
399
|
+
K.current = "", z.current && (z.current.innerHTML = "<p></p>"), a("");
|
|
400
|
+
},
|
|
401
|
+
getCaretContext: () => oe(),
|
|
402
|
+
replaceBeforeCaret: (e, t) => {
|
|
403
|
+
se(null, e, t, () => Y());
|
|
404
|
+
}
|
|
405
|
+
}), [Y, a]);
|
|
406
|
+
let X = f(() => ({
|
|
407
|
+
minHeight: x ?? (h ? "2rem" : "12rem"),
|
|
408
|
+
...S ? {
|
|
409
|
+
maxHeight: S,
|
|
410
|
+
overflowY: "auto"
|
|
411
|
+
} : {}
|
|
412
|
+
}), [
|
|
413
|
+
h,
|
|
414
|
+
S,
|
|
415
|
+
x
|
|
416
|
+
]), Z = u(() => {
|
|
417
|
+
if (H) {
|
|
418
|
+
let e = D(W);
|
|
419
|
+
K.current = e, z.current && (z.current.innerHTML = O(e)), a(e), U(!1);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
G(z.current?.innerHTML ?? O(i)), U(!0);
|
|
423
|
+
}, [
|
|
424
|
+
a,
|
|
425
|
+
H,
|
|
426
|
+
W,
|
|
427
|
+
i
|
|
428
|
+
]), le = u((e) => {
|
|
429
|
+
let t = e.target.value;
|
|
430
|
+
G(t);
|
|
431
|
+
let n = D(t);
|
|
432
|
+
K.current = n, a(n);
|
|
433
|
+
}, [a]), Q = typeof l == "string" ? l : "", ue = D(K.current) === "", de = Q.length > 0 && !B && ue ? /* @__PURE__ */ g(n, {
|
|
434
|
+
tag: "span",
|
|
435
|
+
size: "sm",
|
|
436
|
+
type: "secondary",
|
|
437
|
+
className: "pointer-events-none absolute inset-0 px-control py-control-y-offset",
|
|
438
|
+
children: Q
|
|
439
|
+
}) : null, $ = f(() => [
|
|
440
|
+
{
|
|
441
|
+
id: "bold",
|
|
442
|
+
icon: te,
|
|
443
|
+
label: R.toolbar.bold,
|
|
444
|
+
isActive: () => !1,
|
|
445
|
+
run: () => void 0,
|
|
446
|
+
disabled: !0
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
id: "italic",
|
|
450
|
+
icon: v,
|
|
451
|
+
label: R.toolbar.italic,
|
|
452
|
+
isActive: () => !1,
|
|
453
|
+
run: () => void 0,
|
|
454
|
+
disabled: !0
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
id: "strike",
|
|
458
|
+
icon: ie,
|
|
459
|
+
label: R.toolbar.strike,
|
|
460
|
+
isActive: () => !1,
|
|
461
|
+
run: () => void 0,
|
|
462
|
+
disabled: !0
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
id: "bullet-list",
|
|
466
|
+
icon: ne,
|
|
467
|
+
label: R.toolbar.bulletList,
|
|
468
|
+
isActive: () => !1,
|
|
469
|
+
run: () => void 0,
|
|
470
|
+
disabled: !0
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: "ordered-list",
|
|
474
|
+
icon: re,
|
|
475
|
+
label: R.toolbar.orderedList,
|
|
476
|
+
isActive: () => !1,
|
|
477
|
+
run: () => void 0,
|
|
478
|
+
disabled: !0
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
id: "blockquote",
|
|
482
|
+
icon: y,
|
|
483
|
+
label: R.toolbar.blockquote,
|
|
484
|
+
isActive: () => !1,
|
|
485
|
+
run: () => void 0,
|
|
486
|
+
disabled: !0
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
id: "undo",
|
|
490
|
+
icon: ae,
|
|
491
|
+
label: R.toolbar.undo,
|
|
492
|
+
isActive: () => !1,
|
|
493
|
+
run: () => void 0,
|
|
494
|
+
disabled: !0
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
id: "redo",
|
|
498
|
+
icon: b,
|
|
499
|
+
label: R.toolbar.redo,
|
|
500
|
+
isActive: () => !1,
|
|
501
|
+
run: () => void 0,
|
|
502
|
+
disabled: !0
|
|
503
|
+
}
|
|
504
|
+
], [R]), fe = H ? W.replace(/<[^>]*>/g, "") : z.current?.innerText ?? D(i).replace(/<[^>]*>/g, ""), pe = E ? /* @__PURE__ */ g(T, {
|
|
505
|
+
text: fe,
|
|
506
|
+
maxLength: k,
|
|
507
|
+
strings: R
|
|
508
|
+
}) : null;
|
|
509
|
+
return /* @__PURE__ */ _("div", {
|
|
510
|
+
className: t(s.frame, w && s.disabled, F),
|
|
511
|
+
children: [
|
|
512
|
+
/* @__PURE__ */ g(o, {
|
|
513
|
+
buttons: $,
|
|
514
|
+
extraToolbarItems: A,
|
|
515
|
+
hideSourceToggle: N,
|
|
516
|
+
sourceMode: H,
|
|
517
|
+
toggleSourceMode: Z,
|
|
518
|
+
disabled: w,
|
|
519
|
+
hasEditor: !0,
|
|
520
|
+
toolbarTrailing: j,
|
|
521
|
+
strings: R
|
|
522
|
+
}),
|
|
523
|
+
H ? /* @__PURE__ */ g("textarea", {
|
|
524
|
+
"aria-label": R.sourceLabel,
|
|
525
|
+
value: W,
|
|
526
|
+
onChange: le,
|
|
527
|
+
disabled: w,
|
|
528
|
+
spellCheck: !1,
|
|
529
|
+
className: t(s.source, w && "cursor-not-allowed"),
|
|
530
|
+
style: X
|
|
531
|
+
}) : /* @__PURE__ */ _("div", {
|
|
532
|
+
className: "relative",
|
|
533
|
+
style: X,
|
|
534
|
+
children: [de, /* @__PURE__ */ g("div", {
|
|
535
|
+
ref: J,
|
|
536
|
+
role: "textbox",
|
|
537
|
+
"aria-label": R.editorLabel,
|
|
538
|
+
"aria-multiline": "true",
|
|
539
|
+
contentEditable: !w,
|
|
540
|
+
suppressContentEditableWarning: !0,
|
|
541
|
+
onInput: Y,
|
|
542
|
+
onKeyUp: () => q.current?.(),
|
|
543
|
+
onMouseUp: () => q.current?.(),
|
|
544
|
+
onFocus: () => V(!0),
|
|
545
|
+
onBlur: () => V(!1),
|
|
546
|
+
className: t(r, "h-full min-h-full", w && "cursor-not-allowed")
|
|
547
|
+
})]
|
|
548
|
+
}),
|
|
549
|
+
!!M && /* @__PURE__ */ g("div", {
|
|
550
|
+
className: "px-control pb-space-md pt-space-xs",
|
|
551
|
+
children: M
|
|
552
|
+
}),
|
|
553
|
+
pe
|
|
554
|
+
]
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
P.displayName = "FallbackRichTextEditor";
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region src/components/features/rich-text-editor/rich-text-editor.tsx
|
|
560
|
+
var F = l(function(e, t) {
|
|
561
|
+
return N ? /* @__PURE__ */ g(M, {
|
|
562
|
+
...e,
|
|
563
|
+
ref: t
|
|
564
|
+
}) : /* @__PURE__ */ g(P, {
|
|
565
|
+
className: "rich-text-editor--component",
|
|
566
|
+
...e,
|
|
567
|
+
ref: t
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
F.displayName = "RichTextEditor";
|
|
571
|
+
//#endregion
|
|
572
|
+
export { T as n, F as t };
|
|
573
|
+
|
|
574
|
+
//# sourceMappingURL=rich-text-editor-CF8QYt5p.js.map
|