themelia-react-ui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +190 -1
- package/README.md +92 -13
- package/dist/{accordion-BRWh3BM1.js → accordion-BRTcsp8J.js} +8 -8
- package/dist/accordion-BRTcsp8J.js.map +1 -0
- package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
- package/dist/action-menu-Drxw_vJk.js.map +1 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
- package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-DLVdK0Py.js} +151 -155
- package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
- package/dist/{app-shell-BH_bGcE2.js → app-shell-C_fKpljx.js} +11 -10
- package/dist/app-shell-C_fKpljx.js.map +1 -0
- package/dist/{attachment-DsLgNHXt.js → attachment-DbjUWsP0.js} +12 -12
- package/dist/{attachment-DsLgNHXt.js.map → attachment-DbjUWsP0.js.map} +1 -1
- package/dist/auth-CAQcasMV.js +723 -0
- package/dist/auth-CAQcasMV.js.map +1 -0
- package/dist/{avatar-CsnWaYmt.js → avatar-Bu2HhitA.js} +76 -71
- package/dist/avatar-Bu2HhitA.js.map +1 -0
- package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
- package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.js.map} +1 -1
- 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 +25 -27
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +150 -148
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +3 -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 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +233 -0
- package/dist/base/inline-edit.js.map +1 -0
- 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 +1 -1
- package/dist/base/repeaters.js +33 -33
- 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 +83 -81
- 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 +6 -6
- 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 +134 -134
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +120 -117
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +3 -0
- package/dist/blocks/analytics.js +530 -491
- 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 +395 -383
- 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 +311 -0
- package/dist/blocks/planning.js.map +1 -0
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
- package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
- package/dist/button-BZDasD04.js +651 -0
- package/dist/button-BZDasD04.js.map +1 -0
- package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
- package/dist/button-BZyfTvwm.js.map +1 -0
- package/dist/buttons-D_6KJvEE.js +99 -0
- package/dist/buttons-D_6KJvEE.js.map +1 -0
- package/dist/{cards-BMB0laLG.js → cards-qGSErLw_.js} +12 -12
- package/dist/{cards-BMB0laLG.js.map → cards-qGSErLw_.js.map} +1 -1
- package/dist/chart-Bsc5BICK.js +150 -0
- package/dist/chart-Bsc5BICK.js.map +1 -0
- package/dist/checkbox-BQNDjUCh.js +34 -0
- package/dist/checkbox-BQNDjUCh.js.map +1 -0
- package/dist/choice-inputs-Mk3iWbhr.js +725 -0
- package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
- package/dist/{code-block-DIlqzoiD.js → code-block-DzHKRybS.js} +23 -23
- package/dist/code-block-DzHKRybS.js.map +1 -0
- package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
- package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
- package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
- package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
- package/dist/{combobox-HDftpzxt.js → combobox-BFnbJJp3.js} +18 -18
- package/dist/combobox-BFnbJJp3.js.map +1 -0
- package/dist/{combobox-CHD750do.js → combobox-hozNwUcc.js} +313 -316
- package/dist/combobox-hozNwUcc.js.map +1 -0
- package/dist/{command-D0kWBZfd.js → command-BnmSchli.js} +9 -9
- package/dist/command-BnmSchli.js.map +1 -0
- package/dist/comments-u5L0OGip.js +1156 -0
- package/dist/comments-u5L0OGip.js.map +1 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
- package/dist/components/base/buttons/button.recipes.d.ts +10 -19
- 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 +3 -1
- package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
- package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
- package/dist/components/base/forms/form-field.d.ts +1 -0
- package/dist/components/base/forms/form-sizing.d.ts +3 -3
- package/dist/components/base/inline-edit/index.d.ts +2 -0
- package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
- package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
- 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/structure/structure.recipes.d.ts +6 -0
- 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-trailing-action.d.ts +3 -0
- package/dist/components/blocks/analytics/index.d.ts +1 -0
- package/dist/components/blocks/analytics/types.d.ts +1 -1
- package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
- package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
- package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
- 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/planning/index.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
- package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
- 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/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/hooks/use-pending-overlay-focus.d.ts +2 -0
- package/dist/components/features/overlays/overlays.types.d.ts +5 -4
- 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/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/page.d.ts +0 -1
- package/dist/components/layout/page/page.types.d.ts +9 -3
- 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/typography/heading.d.ts +5 -2
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/text.styles.d.ts +10 -0
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- 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-CPNyNo1_.js → containers-DqB-bSYE.js} +34 -56
- package/dist/containers-DqB-bSYE.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-BTSByfmq.js} +6 -6
- package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
- package/dist/{data-display-b3d1TfL4.js → data-display-Bihs9Ven.js} +542 -329
- package/dist/data-display-Bihs9Ven.js.map +1 -0
- package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
- package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
- package/dist/{date-picker-DI6kPNof.js → date-picker-DzP5HQq7.js} +492 -472
- package/dist/date-picker-DzP5HQq7.js.map +1 -0
- package/dist/date-pickers-BpgGz7S-.js +196 -0
- package/dist/date-pickers-BpgGz7S-.js.map +1 -0
- package/dist/{display-ByI5tkqy.js → display-CS6Hbk18.js} +8 -8
- package/dist/{display-ByI5tkqy.js.map → display-CS6Hbk18.js.map} +1 -1
- package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
- package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
- package/dist/features/activities.js +152 -141
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +182 -179
- 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 +103 -104
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +375 -373
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +222 -224
- 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 +856 -855
- 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 +1210 -1209
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +133 -132
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +29 -31
- 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 +82 -82
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +4 -4
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +456 -450
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-CJkUAapr.js +233 -0
- package/dist/feedback-CJkUAapr.js.map +1 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
- package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
- package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
- package/dist/{filters-qtrcv1hf.js → filters-D6FF8L6s.js} +715 -720
- package/dist/filters-D6FF8L6s.js.map +1 -0
- package/dist/{form-field-C6W-y2hR.js → form-field-CZwrkP7m.js} +17 -9
- package/dist/form-field-CZwrkP7m.js.map +1 -0
- package/dist/{form-sizing-39NohSqn.js → form-sizing-QP8aIRaW.js} +10 -6
- package/dist/form-sizing-QP8aIRaW.js.map +1 -0
- package/dist/{forms-BF-HSbff.js → forms-B5NCbkSC.js} +35 -35
- package/dist/{forms-BF-HSbff.js.map → forms-B5NCbkSC.js.map} +1 -1
- package/dist/forms-numeric-Crrm80Lm.js +867 -0
- package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
- package/dist/{header-B8ex54cY.js → header-kxruN3RM.js} +53 -49
- package/dist/header-kxruN3RM.js.map +1 -0
- package/dist/{hooks-D6UBVzf2.js → hooks-BrlnCwQd.js} +2 -2
- package/dist/{hooks-D6UBVzf2.js.map → hooks-BrlnCwQd.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-Btc6pQrp.js} +4 -4
- package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-SX9V0AL3.js +255 -0
- package/dist/input-SX9V0AL3.js.map +1 -0
- package/dist/input-vxcaNCYC.js +20 -0
- package/dist/input-vxcaNCYC.js.map +1 -0
- package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
- package/dist/item-DE4YnuJx.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 +44 -4
- package/dist/lib/control-group-recipes.d.ts +22 -0
- package/dist/lib/field-affordance-recipes.d.ts +35 -2
- package/dist/lib/field-state-recipes.d.ts +2 -2
- package/dist/lib/navigation-row-recipes.d.ts +3 -2
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +5 -2
- package/dist/lib/token-merge.generated.d.ts +144 -2
- package/dist/lib/ui-provider/types.d.ts +4 -2
- package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DLp3HAz0.js} +75 -74
- package/dist/media-gallery-DLp3HAz0.js.map +1 -0
- package/dist/{mentions-CRio8mTm.js → mentions-Cl0Kt_Pd.js} +52 -50
- package/dist/{mentions-CRio8mTm.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
- package/dist/message-SZUNB1eX.js +127 -0
- package/dist/message-SZUNB1eX.js.map +1 -0
- package/dist/{navigation-BTrEb5u4.js → navigation-DnQSNMT0.js} +64 -55
- package/dist/navigation-DnQSNMT0.js.map +1 -0
- package/dist/{navigation-DqEITuD2.js → navigation-DyytsLRB.js} +37 -37
- package/dist/navigation-DyytsLRB.js.map +1 -0
- package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
- package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
- package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
- package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
- package/dist/overlays-DUbs1KEi.js +1011 -0
- package/dist/overlays-DUbs1KEi.js.map +1 -0
- package/dist/{page-BMBGjJY8.js → page-hGmT4nWK.js} +75 -64
- package/dist/page-hGmT4nWK.js.map +1 -0
- package/dist/{page-header-BH41wCyY.js → page-header-D8nERkn5.js} +9 -9
- package/dist/page-header-D8nERkn5.js.map +1 -0
- package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
- package/dist/pagination-NLGqRirf.js.map +1 -0
- package/dist/{popover-TInGXsjg.js → popover-CghIYdQf.js} +23 -22
- package/dist/popover-CghIYdQf.js.map +1 -0
- package/dist/{popover-menu-BzqXqE72.js → popover-menu-B4PoWhRl.js} +6 -6
- package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
- package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
- package/dist/popover.recipes-QlD4JenO.js.map +1 -0
- package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
- package/dist/primitives-C7ff0QaI.js.map +1 -0
- package/dist/primitives.js +3 -3
- package/dist/progress-BroqrAyV.js +169 -0
- package/dist/progress-BroqrAyV.js.map +1 -0
- package/dist/{receipt-DYWTQGEc.js → receipt-BuJynLgf.js} +8 -8
- package/dist/{receipt-DYWTQGEc.js.map → receipt-BuJynLgf.js.map} +1 -1
- package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
- package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
- package/dist/rich-text-editor-BKyG7rWz.js +574 -0
- package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
- package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
- package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
- package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
- package/dist/scroll-area-D-pIhEKl.js.map +1 -0
- package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
- package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
- package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
- package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-D9f_wdIC.js → settings-DOTOzeZ2.js} +10 -9
- package/dist/{settings-D9f_wdIC.js.map → settings-DOTOzeZ2.js.map} +1 -1
- package/dist/{sheet-vOUloJ4O.js → sheet-BFhrNehm.js} +11 -11
- package/dist/sheet-BFhrNehm.js.map +1 -0
- package/dist/{sidebar-CNBKFDRW.js → sidebar-CyR4XKwR.js} +219 -200
- package/dist/sidebar-CyR4XKwR.js.map +1 -0
- package/dist/{sidebar-C3UKkbC5.js → sidebar-SvGJ0Zwi.js} +63 -58
- package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
- package/dist/{skeleton-BvRhK8y-.js → skeleton-3F0uhYn3.js} +4 -4
- package/dist/{skeleton-BvRhK8y-.js.map → skeleton-3F0uhYn3.js.map} +1 -1
- package/dist/{smart-card-B5FcKODh.js → smart-card-DjGVV2xr.js} +206 -199
- package/dist/smart-card-DjGVV2xr.js.map +1 -0
- package/dist/{spinner-JtlFJ7Nc.js → spinner-Cpf7oRkF.js} +5 -5
- package/dist/{spinner-JtlFJ7Nc.js.map → spinner-Cpf7oRkF.js.map} +1 -1
- package/dist/{structure-BvW4vG4H.js → structure-CRdqVawd.js} +14 -14
- package/dist/{structure-BvW4vG4H.js.map → structure-CRdqVawd.js.map} +1 -1
- package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
- package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
- package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
- package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
- package/dist/table-CLtJTxoR.js.map +1 -0
- package/dist/table-CcRDZiLP.js +1444 -0
- package/dist/table-CcRDZiLP.js.map +1 -0
- package/dist/tabs-BNgu7g0u.js +188 -0
- package/dist/tabs-BNgu7g0u.js.map +1 -0
- package/dist/text-inputs-DsR56TR-.js +330 -0
- package/dist/text-inputs-DsR56TR-.js.map +1 -0
- package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
- package/dist/text.styles-Q4sGAIgA.js.map +1 -0
- package/dist/theme.css +77 -115
- package/dist/{timelines-CnZ2S_Gr.js → timelines-D1pkt3se.js} +84 -78
- package/dist/timelines-D1pkt3se.js.map +1 -0
- package/dist/{tree-COD9BGdU.js → tree-BtmYyMZV.js} +8 -8
- package/dist/{tree-COD9BGdU.js.map → tree-BtmYyMZV.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-BxQgiZyw.js +96 -0
- package/dist/typography-BxQgiZyw.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
- package/dist/ui-provider-DRPn3qNl.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-DIzw1dx1.js → upload-CDbYw1WN.js} +326 -323
- package/dist/upload-CDbYw1WN.js.map +1 -0
- package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-CNd_hH_a.js} +25 -25
- package/dist/upload-queue-CNd_hH_a.js.map +1 -0
- package/dist/usage-card-VyJLUwRr.js +457 -0
- package/dist/usage-card-VyJLUwRr.js.map +1 -0
- package/dist/utils-BvH9PSmq.js +4275 -0
- package/dist/utils-BvH9PSmq.js.map +1 -0
- package/dist/value-inputs-D0KCrfVC.js +840 -0
- package/dist/value-inputs-D0KCrfVC.js.map +1 -0
- package/dist/{workspace-Cbqz4FzN.js → workspace-CcR8r-Nt.js} +115 -122
- package/dist/workspace-CcR8r-Nt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +112 -18
- package/docs/consumer-skill/examples/analytics.tsx +34 -0
- package/docs/consumer-skill/examples/app-layout.tsx +42 -12
- package/docs/consumer-skill/examples/detail.tsx +24 -9
- package/docs/consumer-skill/examples/manifest.json +27 -1
- package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
- package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
- 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 +219 -2
- package/docs/consumer-skill/references/design-contract.md +37 -10
- package/docs/consumer-skill/references/discovery.md +93 -5
- package/docs/consumer-skill/references/installation.md +20 -3
- package/docs/consumer-skill/references/integration.md +26 -0
- package/docs/consumer-skill/references/public-api.json +2416 -388
- package/docs/consumer-skill/references/review.md +126 -0
- package/docs/consumer-skill/references/theming.md +52 -7
- package/docs/consumer-skill/references/tokens.json +177 -9
- package/docs/consumer-skill/references/workflows.md +129 -1
- package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +317 -0
- package/docs/consumer-skill/scripts/discovery.mjs +65 -8
- package/docs/consumer-skill/scripts/surface-policy.mjs +66 -0
- package/package.json +30 -6
- package/dist/accordion-BRWh3BM1.js.map +0 -1
- package/dist/action-menu-Cx3SdfbN.js.map +0 -1
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js +0 -23
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
- package/dist/ai-artifact-DkOArd3-.js.map +0 -1
- package/dist/app-shell-BH_bGcE2.js.map +0 -1
- package/dist/auth-BDB1V_2q.js +0 -704
- package/dist/auth-BDB1V_2q.js.map +0 -1
- package/dist/avatar-CsnWaYmt.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/choice-inputs-CavA-SGV.js +0 -644
- package/dist/choice-inputs-CavA-SGV.js.map +0 -1
- package/dist/code-block-DIlqzoiD.js.map +0 -1
- package/dist/combobox-CHD750do.js.map +0 -1
- package/dist/combobox-HDftpzxt.js.map +0 -1
- package/dist/command-D0kWBZfd.js.map +0 -1
- package/dist/comments-CvYeglMS.js +0 -1132
- package/dist/comments-CvYeglMS.js.map +0 -1
- package/dist/containers-CPNyNo1_.js.map +0 -1
- package/dist/data-display-b3d1TfL4.js.map +0 -1
- package/dist/date-picker-DI6kPNof.js.map +0 -1
- package/dist/date-pickers-ByP6Cv2z.js +0 -224
- package/dist/date-pickers-ByP6Cv2z.js.map +0 -1
- package/dist/feedback-a9j9J-9A.js +0 -391
- package/dist/feedback-a9j9J-9A.js.map +0 -1
- package/dist/field-affordance-recipes-CHdUtn2Z.js +0 -17
- package/dist/field-affordance-recipes-CHdUtn2Z.js.map +0 -1
- package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
- package/dist/filters-qtrcv1hf.js.map +0 -1
- package/dist/form-field-C6W-y2hR.js.map +0 -1
- package/dist/form-sizing-39NohSqn.js.map +0 -1
- package/dist/forms-numeric-Y15Bg5Nr.js +0 -867
- package/dist/forms-numeric-Y15Bg5Nr.js.map +0 -1
- package/dist/header-B8ex54cY.js.map +0 -1
- package/dist/http-CLTVJc5I.js.map +0 -1
- package/dist/input-DMorJiTI.js +0 -202
- package/dist/input-DMorJiTI.js.map +0 -1
- package/dist/input-ci9fIgFH.js +0 -20
- package/dist/input-ci9fIgFH.js.map +0 -1
- package/dist/item-pJ0GsOiJ.js.map +0 -1
- package/dist/media-gallery-Ca4YmvBi.js.map +0 -1
- package/dist/message-B5-6LeYl.js +0 -108
- package/dist/message-B5-6LeYl.js.map +0 -1
- package/dist/navigation-BTrEb5u4.js.map +0 -1
- package/dist/navigation-DqEITuD2.js.map +0 -1
- package/dist/navigation-row-recipes-BFpvGPGE.js.map +0 -1
- package/dist/overlays-DBqV0J_V.js +0 -982
- package/dist/overlays-DBqV0J_V.js.map +0 -1
- package/dist/page-BMBGjJY8.js.map +0 -1
- package/dist/page-header-BH41wCyY.js.map +0 -1
- package/dist/pagination-C29vvt3I.js.map +0 -1
- package/dist/popover-TInGXsjg.js.map +0 -1
- package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
- package/dist/primitives-DKPOGVpj.js.map +0 -1
- package/dist/rich-text-editor-BZSJchAF.js +0 -575
- package/dist/rich-text-editor-BZSJchAF.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/sheet-vOUloJ4O.js.map +0 -1
- package/dist/sidebar-C3UKkbC5.js.map +0 -1
- package/dist/sidebar-CNBKFDRW.js.map +0 -1
- package/dist/smart-card-B5FcKODh.js.map +0 -1
- package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
- package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
- package/dist/table-DnlAJ-xR.js.map +0 -1
- package/dist/table-ghtAQ-JJ.js +0 -1424
- package/dist/table-ghtAQ-JJ.js.map +0 -1
- package/dist/tabs-DY09eoZg.js +0 -187
- package/dist/tabs-DY09eoZg.js.map +0 -1
- package/dist/text-inputs-BhOcedTo.js +0 -331
- package/dist/text-inputs-BhOcedTo.js.map +0 -1
- package/dist/text.styles-BwB7vAF2.js.map +0 -1
- package/dist/timelines-CnZ2S_Gr.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-DIzw1dx1.js.map +0 -1
- package/dist/upload-queue-xRJ3qDmd.js.map +0 -1
- package/dist/utils-C2EKeIw3.js +0 -72
- package/dist/utils-C2EKeIw3.js.map +0 -1
- package/dist/value-inputs-Co1fu-xv.js +0 -824
- package/dist/value-inputs-Co1fu-xv.js.map +0 -1
- package/dist/workspace-Cbqz4FzN.js.map +0 -1
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useStrings as e } from "./lib/strings.js";
|
|
3
|
+
import { t } from "./utils-BvH9PSmq.js";
|
|
4
|
+
import { a as n } from "./typography-BxQgiZyw.js";
|
|
5
|
+
import { n as r } from "./content-typography-CnwgMJ37.js";
|
|
6
|
+
import { g as i } from "./primitives-C7ff0QaI.js";
|
|
7
|
+
import { t as a } from "./number-DasMFWEG.js";
|
|
8
|
+
import { n as o, t as s } from "./rich-text-editor.recipes-B72Nfuze.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-BKyG7rWz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-editor-BKyG7rWz.js","names":["NumberValue","_Fragment","EditorContent","StarterKit","Text","editableContentClassName","SecondaryValue","Number","RichTextEditorToolbar","richTextEditorRecipes","defaultRichTextEditorStrings","Fragment$1","TiptapReact","StarterKitModule","readCaretContext","sel","range","startNode","startOffset","block","editable","text","cursor","prev","rect","r","replaceBeforeCaret","caret","remaining","length","take","previousTextNode","editor","html","notifyChange","fragment","insertHtmlIntoEditable","current","node","CountsFooterText","chars","words","overLimit","maxLength","cn","className","strings","CountsFooter","sourceMode","sourceValue","normalizeHtml","trimmed","value","toEditorContent","normalized","EditorContent$1","useTiptapEditor","StarterKit$1","TiptapRichTextEditor","forwardRef","stringsProp","useStrings","isFocused","setIsFocused","useState","setSourceMode","setSourceValue","isFocusedRef","useRef","externalValueRef","onCaretChangeRef","onCaretChange","disabled","autoFocus","currentEditor","onValueChange","useEffect","next","handler","useImperativeHandle","ref","contentStyle","useMemo","minHeight","compact","maxHeight","toggleSourceMode","useCallback","handleSourceChange","toolbarButtons","Bold","Italic","Strikethrough","List","ListOrdered","Quote","Undo2","Redo2","countsFooter","showCounts","placeholderText","placeholder","placeholderNode","footerSlot","hasTiptapRuntime","FallbackRichTextEditor","editableRef","setEditableRef","emitEditableChange","isEmpty","RichTextEditor","props"],"sources":["../src/components/features/rich-text-editor/partials/caret-helpers.ts","../src/components/features/rich-text-editor/partials/counts-footer.tsx","../src/components/features/rich-text-editor/partials/html-helpers.ts","../src/components/features/rich-text-editor/partials/rich-text-editor-tiptap.tsx","../src/components/features/rich-text-editor/partials/rich-text-editor-fallback.tsx","../src/components/features/rich-text-editor/rich-text-editor.tsx"],"sourcesContent":["/**\n * Caret-introspection helpers used by `<RichTextEditor>` to expose the\n * text before the caret and replace a leading run of characters with\n * inline HTML — the building blocks for `@`-mention chips and similar\n * inline triggers.\n */\nimport type { RichTextCaretContext, TiptapEditor } from '../rich-text-editor.types';\n\n/**\n * Read the current selection's caret context.\n *\n * Walks back from the caret through the current text node and any\n * preceding sibling text nodes inside the same block-level container\n * (paragraph / list-item / heading) collecting plain text. Returns the\n * accumulated text plus the caret's bounding rect when available.\n *\n * Returns `null` when there is no live selection or the selection isn't\n * a text caret inside a contenteditable.\n */\nexport function readCaretContext(): RichTextCaretContext | null {\n\tif (typeof window === 'undefined') return null;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return null;\n\tconst range = sel.getRangeAt(0);\n\tif (!range.collapsed) return null;\n\n\tconst startNode = range.startContainer;\n\tconst startOffset = range.startOffset;\n\n\tlet block: Node | null = startNode;\n\twhile (block && block.nodeType !== Node.ELEMENT_NODE) {\n\t\tblock = block.parentNode;\n\t}\n\tif (!block) return null;\n\tconst editable =\n\t\t(block as Element).closest('[contenteditable=\"true\"]') ??\n\t\t(block as Element).closest('.ProseMirror');\n\tif (!editable) return null;\n\n\tlet text = '';\n\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\ttext = (startNode.textContent ?? '').slice(0, startOffset);\n\t}\n\n\tlet cursor: Node | null = startNode;\n\twhile (cursor && cursor !== editable && cursor !== block) {\n\t\tlet prev: Node | null = cursor.previousSibling;\n\t\twhile (prev) {\n\t\t\ttext = (prev.textContent ?? '') + text;\n\t\t\tprev = prev.previousSibling;\n\t\t}\n\t\tcursor = cursor.parentNode;\n\t\tif (cursor && (cursor as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote')) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet rect: RichTextCaretContext['rect'];\n\tconst r = range.getBoundingClientRect();\n\tif (r && (r.top || r.left || r.right || r.bottom)) {\n\t\trect = { top: r.top, left: r.left, bottom: r.bottom, right: r.right };\n\t}\n\n\treturn { textBefore: text, rect };\n}\n\n/**\n * Extend the selection backwards by `length` characters, then insert\n * `html`. The selection extension means `editor.insertContent` (or the\n * fallback's `range.deleteContents()` + insert) replaces the trigger\n * range with the chip atomically — no manual text-content mutation, no\n * timing races between \"delete\" and \"insert\".\n */\nexport function replaceBeforeCaret(\n\teditor: TiptapEditor | null,\n\tlength: number,\n\thtml: string,\n\tnotifyChange: (next: string) => void,\n): void {\n\tif (typeof window === 'undefined') return;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return;\n\tconst caret = sel.getRangeAt(0);\n\tif (!caret.collapsed) return;\n\n\tlet remaining = length;\n\tlet startNode: Node = caret.startContainer;\n\tlet startOffset = caret.startOffset;\n\n\twhile (remaining > 0) {\n\t\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\t\tconst take = Math.min(startOffset, remaining);\n\t\t\tstartOffset -= take;\n\t\t\tremaining -= take;\n\t\t\tif (remaining === 0) break;\n\t\t}\n\t\tconst prev = previousTextNode(startNode);\n\t\tif (!prev) break;\n\t\tstartNode = prev;\n\t\tstartOffset = prev.textContent?.length ?? 0;\n\t}\n\n\tconst range = document.createRange();\n\trange.setStart(startNode, startOffset);\n\trange.setEnd(caret.endContainer, caret.endOffset);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n\n\tif (editor) {\n\t\teditor.chain().focus().insertContent(html).run();\n\t\tnotifyChange(editor.getHTML());\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\tsel.collapseToEnd();\n\tconst editable =\n\t\t(startNode as Element | null)?.parentElement?.closest?.('[contenteditable=\"true\"]') ?? null;\n\tif (editable) notifyChange((editable as HTMLElement).innerHTML);\n}\n\nexport function insertHtmlIntoEditable(editable: HTMLElement | null, html: string): void {\n\tif (typeof window === 'undefined' || !editable) return;\n\teditable.focus();\n\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\tconst range = sel.getRangeAt(0);\n\tif (!editable.contains(range.commonAncestorContainer)) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\trange.collapse(false);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n}\n\nfunction previousTextNode(node: Node): Node | null {\n\tlet current: Node | null = node;\n\twhile (current) {\n\t\tif (current.previousSibling) {\n\t\t\tcurrent = current.previousSibling;\n\t\t\twhile (current && current.lastChild) {\n\t\t\t\tcurrent = current.lastChild;\n\t\t\t}\n\t\t\tif (current && current.nodeType === Node.TEXT_NODE) return current;\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent = current.parentNode;\n\t\tif (!current || (current as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote, [contenteditable=\"true\"]')) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn null;\n}\n","import { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { RichTextEditorStrings } from '../rich-text-editor.strings';\nimport type { TiptapEditor } from '../rich-text-editor.types';\n\nexport interface CountsFooterTextProps {\n\t/** Plain-text projection of the document, used for the character count. */\n\ttext: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function CountsFooterText({ text, maxLength, strings, className }: CountsFooterTextProps) {\n\tconst chars = text.length;\n\tconst words = text.trim().length > 0 ? text.trim().split(/\\s+/).length : 0;\n\tconst overLimit = typeof maxLength === 'number' && chars > maxLength;\n\n\treturn (\n\t\t<div className={cn('counts-footer-text--component border-border flex items-center justify-end gap-space-lg border-t px-control py-space-sm', className)}>\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"xs\"\n\t\t\t\ttype={overLimit ? 'error' : 'secondary'}\n\t\t\t\tweight={overLimit ? 'medium' : 'regular'}\n\t\t\t\tclassName={cn('tabular-nums')}\n\t\t\t>\n\t\t\t\t<NumberValue value={chars} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" />\n\t\t\t\t{typeof maxLength === 'number' && (\n\t\t\t\t\t<> / <NumberValue value={maxLength} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" /></>\n\t\t\t\t)} {strings.counts.characters}\n\t\t\t</Text>\n\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t<NumberValue value={words} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.counts.words}\n\t\t\t</SecondaryValue>\n\t\t</div>\n\t);\n}\n\nCountsFooterText.displayName = 'CountsFooterText';\n\nexport interface CountsFooterProps {\n\t/** The editor instance, for reading counts directly. */\n\teditor: TiptapEditor;\n\t/** Whether the editor is showing HTML source. */\n\tsourceMode: boolean;\n\t/** Raw HTML while in source mode. */\n\tsourceValue: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n}\n\nexport function CountsFooter({\n\teditor,\n\tsourceMode,\n\tsourceValue,\n\tmaxLength,\n\tstrings,\n}: CountsFooterProps) {\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editor?.getText() ?? '');\n\n\treturn <CountsFooterText text={text} maxLength={maxLength} strings={strings} />;\n}\n\nCountsFooter.displayName = 'CountsFooter';\n","/**\n * Plain HTML normalization shared by the TipTap and contenteditable\n * fallback editors. Keeping these out of the React tree means the\n * editor partials stay focused on rendering.\n */\n\nexport function normalizeHtml(value: string): string {\n\tconst trimmed = value.trim();\n\n\tif (trimmed === '' || trimmed === '<p></p>' || trimmed === '<p><br></p>') {\n\t\treturn '';\n\t}\n\n\treturn trimmed;\n}\n\nexport function toEditorContent(value: string): string {\n\tconst normalized = normalizeHtml(value);\n\treturn normalized === '' ? '<p></p>' : normalized;\n}\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\nimport * as TiptapReact from '@tiptap/react';\nimport * as StarterKitModule from '@tiptap/starter-kit';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport { readCaretContext, replaceBeforeCaret } from './caret-helpers';\nimport { CountsFooter } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\nconst EditorContent = TiptapReact.EditorContent;\nconst useTiptapEditor = TiptapReact.useEditor;\nconst StarterKit =\n\t'default' in StarterKitModule ? StarterKitModule.default : StarterKitModule;\n\nexport const TiptapRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function TiptapRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst isFocusedRef = useRef(false);\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst editor = useTiptapEditor({\n\t\textensions: [StarterKit],\n\t\tcontent: toEditorContent(value),\n\t\teditable: !disabled,\n\t\timmediatelyRender: false,\n\t\tautofocus: autoFocus ? 'end' : false,\n\t\tonFocus: () => {\n\t\t\tisFocusedRef.current = true;\n\t\t\tsetIsFocused(true);\n\t\t},\n\t\tonBlur: () => {\n\t\t\tisFocusedRef.current = false;\n\t\t\tsetIsFocused(false);\n\t\t},\n\t\tonUpdate: ({ editor: currentEditor }: { editor: { getHTML: () => string } }) => {\n\t\t\tconst html = normalizeHtml(currentEditor.getHTML());\n\t\t\tif (!isFocusedRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (html !== externalValueRef.current) {\n\t\t\t\texternalValueRef.current = html;\n\t\t\t\tonValueChange(html);\n\t\t\t}\n\n\t\t\tonCaretChangeRef.current?.();\n\t\t},\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\trole: 'textbox',\n\t\t\t\t'aria-label': strings.editorLabel,\n\t\t\t\t'aria-multiline': 'true',\n\t\t\t\tclass: editableContentClassName,\n\t\t\t},\n\t\t},\n\t});\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst current = normalizeHtml(editor.getHTML());\n\t\tconst next = normalizeHtml(value);\n\t\texternalValueRef.current = next;\n\n\t\tif (current !== next) {\n\t\t\teditor.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t}\n\t}, [editor, value]);\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\teditor.setEditable(!disabled);\n\t}, [disabled, editor]);\n\n\tuseEffect(() => {\n\t\tif (typeof document === 'undefined') return;\n\t\tconst handler = () => {\n\t\t\tif (!isFocusedRef.current) return;\n\t\t\tonCaretChangeRef.current?.();\n\t\t};\n\t\tdocument.addEventListener('selectionchange', handler);\n\t\treturn () => document.removeEventListener('selectionchange', handler);\n\t}, []);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => {\n\t\t\t\teditor?.chain().focus().run();\n\t\t\t},\n\t\t\tgetHTML: () => normalizeHtml(editor?.getHTML() ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\teditor?.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tif (!editor) return;\n\t\t\t\teditor.chain().focus().insertContent(html).run();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editor?.getHTML() ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\teditor?.commands.setContent('<p></p>', { emitUpdate: false });\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(editor, length, html, (next) => {\n\t\t\t\t\texternalValueRef.current = normalizeHtml(next);\n\t\t\t\t\tonValueChange(externalValueRef.current);\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t\t[editor, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (sourceMode) {\n\t\t\tconst html = toEditorContent(sourceValue);\n\t\t\teditor.commands.setContent(html, { emitUpdate: false });\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t} else {\n\t\t\tsetSourceValue(editor.getHTML());\n\t\t\tsetSourceMode(true);\n\t\t}\n\t}, [editor, onValueChange, sourceMode, sourceValue]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'bold',\n\t\t\t\ticon: Bold,\n\t\t\t\tlabel: strings.toolbar.bold,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bold')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'italic',\n\t\t\t\ticon: Italic,\n\t\t\t\tlabel: strings.toolbar.italic,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('italic')),\n\t\t\t\trun: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'strike',\n\t\t\t\ticon: Strikethrough,\n\t\t\t\tlabel: strings.toolbar.strike,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('strike')),\n\t\t\t\trun: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bullet-list',\n\t\t\t\ticon: List,\n\t\t\t\tlabel: strings.toolbar.bulletList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bulletList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBulletList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ordered-list',\n\t\t\t\ticon: ListOrdered,\n\t\t\t\tlabel: strings.toolbar.orderedList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('orderedList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleOrderedList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'blockquote',\n\t\t\t\ticon: Quote,\n\t\t\t\tlabel: strings.toolbar.blockquote,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('blockquote')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBlockquote().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\ticon: Undo2,\n\t\t\t\tlabel: strings.toolbar.undo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().undo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().undo().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\ticon: Redo2,\n\t\t\t\tlabel: strings.toolbar.redo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().redo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().redo().run(),\n\t\t\t},\n\t\t],\n\t\t[editor, strings],\n\t);\n\n\tconst countsFooter =\n\t\tshowCounts && editor ? (\n\t\t\t<CountsFooter\n\t\t\t\teditor={editor}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\tsourceValue={sourceValue}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t) : null;\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst showPlaceholder =\n\t\tplaceholderText.length > 0 && !isFocused && Boolean(editor?.isEmpty);\n\tconst placeholderNode = showPlaceholder ? (\n\t\t<Text\n\t\t\ttag=\"span\"\n\t\t\tsize=\"sm\"\n\t\t\ttype=\"secondary\"\n\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t>\n\t\t\t{placeholderText}\n\t\t</Text>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor={Boolean(editor)}\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\trichTextEditorRecipes.source,\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\n\t\t\t\t\t<EditorContent\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\tclassName={richTextEditorRecipes.content}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nTiptapRichTextEditor.displayName = 'TiptapRichTextEditor';\n\nexport const hasTiptapRuntime =\n\ttypeof EditorContent === 'function' &&\n\ttypeof useTiptapEditor === 'function' &&\n\ttypeof StarterKit === 'object' &&\n\tStarterKit !== null;\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport {\n\tinsertHtmlIntoEditable,\n\treadCaretContext,\n\treplaceBeforeCaret,\n} from './caret-helpers';\nimport { CountsFooterText } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\n/**\n * Fallback editor used when the TipTap runtime is unavailable (e.g. in\n * environments where the package failed to load). Renders a\n * `contenteditable` surface with the same imperative handle so callers\n * never need to care which variant they got.\n */\nexport const FallbackRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function FallbackRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst editableRef = useRef<HTMLDivElement>(null);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst setEditableRef = useCallback((node: HTMLDivElement | null) => {\n\t\teditableRef.current = node;\n\t\tif (node && node.innerHTML === '') {\n\t\t\tnode.innerHTML = toEditorContent(externalValueRef.current);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst editable = editableRef.current;\n\t\tif (!editable || isFocused) return;\n\t\tconst next = toEditorContent(value);\n\t\tif (normalizeHtml(editable.innerHTML) !== normalizeHtml(next)) {\n\t\t\teditable.innerHTML = next;\n\t\t}\n\t\texternalValueRef.current = normalizeHtml(value);\n\t}, [isFocused, value]);\n\n\tuseEffect(() => {\n\t\tif (!autoFocus) return;\n\t\teditableRef.current?.focus();\n\t}, [autoFocus]);\n\n\tconst emitEditableChange = useCallback(() => {\n\t\tconst editable = editableRef.current;\n\t\tconst html = normalizeHtml(editable?.innerHTML ?? '');\n\t\texternalValueRef.current = html;\n\t\tonValueChange(html);\n\t\tonCaretChangeRef.current?.();\n\t}, [onValueChange]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => editableRef.current?.focus(),\n\t\t\tgetHTML: () => normalizeHtml(editableRef.current?.innerHTML ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\tif (editableRef.current) {\n\t\t\t\t\teditableRef.current.innerHTML = toEditorContent(next);\n\t\t\t\t}\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tinsertHtmlIntoEditable(editableRef.current, html);\n\t\t\t\temitEditableChange();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editableRef.current?.innerHTML ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\tif (editableRef.current) editableRef.current.innerHTML = '<p></p>';\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(null, length, html, () => emitEditableChange());\n\t\t\t},\n\t\t}),\n\t\t[emitEditableChange, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (sourceMode) {\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tif (editableRef.current) {\n\t\t\t\teditableRef.current.innerHTML = toEditorContent(normalized);\n\t\t\t}\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t\treturn;\n\t\t}\n\t\tsetSourceValue(editableRef.current?.innerHTML ?? toEditorContent(value));\n\t\tsetSourceMode(true);\n\t}, [onValueChange, sourceMode, sourceValue, value]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst isEmpty = normalizeHtml(externalValueRef.current) === '';\n\tconst placeholderNode =\n\t\tplaceholderText.length > 0 && !isFocused && isEmpty ? (\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t\t>\n\t\t\t\t{placeholderText}\n\t\t\t</Text>\n\t\t) : null;\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{ id: 'bold', icon: Bold, label: strings.toolbar.bold, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'italic', icon: Italic, label: strings.toolbar.italic, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'strike', icon: Strikethrough, label: strings.toolbar.strike, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'bullet-list', icon: List, label: strings.toolbar.bulletList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'ordered-list', icon: ListOrdered, label: strings.toolbar.orderedList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'blockquote', icon: Quote, label: strings.toolbar.blockquote, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'undo', icon: Undo2, label: strings.toolbar.undo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'redo', icon: Redo2, label: strings.toolbar.redo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t],\n\t\t[strings],\n\t);\n\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editableRef.current?.innerText ?? normalizeHtml(value).replace(/<[^>]*>/g, ''));\n\tconst countsFooter =\n\t\tshowCounts ? (\n\t\t\t<CountsFooterText text={text} maxLength={maxLength} strings={strings} />\n\t\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\trichTextEditorRecipes.source,\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={setEditableRef}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\taria-label={strings.editorLabel}\n\t\t\t\t\t\taria-multiline=\"true\"\n\t\t\t\t\t\tcontentEditable={!disabled}\n\t\t\t\t\t\tsuppressContentEditableWarning\n\t\t\t\t\t\tonInput={emitEditableChange}\n\t\t\t\t\t\tonKeyUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonMouseUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsFocused(false)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\teditableContentClassName,\n\t\t\t\t\t\t\t'h-full min-h-full',\n\t\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nFallbackRichTextEditor.displayName = 'FallbackRichTextEditor';\n","/**\n * Public `<RichTextEditor>` shell — picks the TipTap-backed editor when\n * the runtime is loaded and falls back to a plain `contenteditable`\n * surface otherwise. Both variants implement the same imperative\n * `RichTextEditorHandle`, so callers don't have to branch.\n *\n * Heavy lifting lives in `partials/`:\n * - `partials/rich-text-editor-tiptap.tsx` — TipTap variant\n * - `partials/rich-text-editor-fallback.tsx` — contenteditable variant\n * - `partials/rich-text-editor-toolbar.tsx` — shared toolbar\n * - `partials/counts-footer.tsx` — char/word counts\n * - `partials/caret-helpers.ts` — caret introspection\n * - `partials/html-helpers.ts` — HTML normalization\n */\nimport { forwardRef } from 'react';\n\nimport {\n\tFallbackRichTextEditor,\n\tTiptapRichTextEditor,\n\thasTiptapRuntime,\n} from './partials';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n} from './rich-text-editor.types';\n\nexport const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function RichTextEditor(\n\tprops,\n\tref,\n) {\n\tif (!hasTiptapRuntime) {\n\t\treturn <FallbackRichTextEditor className=\"rich-text-editor--component\" {...props} ref={ref} />;\n\t}\n\n\treturn <TiptapRichTextEditor {...props} ref={ref} />;\n});\n\nRichTextEditor.displayName = 'RichTextEditor';\n\nexport type {\n\tRichTextEditorProps,\n\tRichTextEditorHandle,\n\tRichTextEditorToolbarItem,\n\tRichTextCaretContext,\n} from './rich-text-editor.types';\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgBc,KAAgD;CAC/D,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAMC,IAAM,OAAO,aAAa;CAChC,IAAI,CAACA,KAAOA,EAAI,eAAe,GAAG,OAAO;CACzC,IAAMC,IAAQD,EAAI,WAAW,CAAC;CAC9B,IAAI,CAACC,EAAM,WAAW,OAAO;CAE7B,IAAMC,IAAYD,EAAM,gBAClBE,IAAcF,EAAM,aAEtBG,IAAqBF;CACzB,OAAOE,KAASA,EAAM,aAAa,KAAK,eACvC,IAAQA,EAAM;CAEf,IAAI,CAACA,GAAO,OAAO;CACnB,IAAMC,IACJD,EAAkB,QAAQ,4BAA0B,KACpDA,EAAkB,QAAQ,cAAc;CAC1C,IAAI,CAACC,GAAU,OAAO;CAEtB,IAAIC,IAAO;CACX,AAAIJ,EAAU,aAAa,KAAK,cAC/B,KAAQA,EAAU,eAAe,GAAA,CAAI,MAAM,GAAGC,CAAW;CAG1D,IAAII,IAAsBL;CAC1B,OAAOK,KAAUA,MAAWF,KAAYE,MAAWH,IAAO;EACzD,IAAII,IAAoBD,EAAO;EAC/B,OAAOC,IAEN,AADA,KAAQA,EAAK,eAAe,MAAMF,GAClC,IAAOE,EAAK;EAGb,IADA,IAASD,EAAO,YACZA,KAAWA,EAAmB,UAAU,2CAA2C,GACtF;CAEF;CAEA,IAAIE,GACEC,IAAIT,EAAM,sBAAsB;CAKtC,OAJIS,M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