@alfadocs/ui-kit 0.1.9 → 0.2.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/README.md +30 -0
- package/dist/_chunks/accordion-DOmxGEWU.js +228 -0
- package/dist/_chunks/{agenda-card-DwLIxgi7.js → agenda-card-CalZqycc.js} +12 -3
- package/dist/_chunks/{agenda-tray-DUvengGQ.js → agenda-tray-3ffFDQZC.js} +54 -51
- package/dist/_chunks/{ai-prompt-input.agent-0NHYLTWD.js → ai-prompt-input-BBiDlEIS.js} +231 -231
- package/dist/_chunks/{alert-BlOUMkXj.js → alert-B1sj8Ss0.js} +24 -14
- package/dist/_chunks/{apexcharts-theme-BkSShpEy.js → apexcharts-theme-BJigns_V.js} +7 -2
- package/dist/_chunks/{app-frame-6d7Lu4ea.js → app-frame-CDJOgPXe.js} +7 -16
- package/dist/_chunks/{audio-recorder.agent--VKeykUp.js → audio-recorder-B4U1LuiQ.js} +161 -162
- package/dist/_chunks/{audio-visualiser-CeMPCZkd.js → audio-visualiser-ByDEFLNm.js} +25 -19
- package/dist/_chunks/autocomplete-D4oUZbsP.js +466 -0
- package/dist/_chunks/{badge-mrstWxve.js → badge-DKFbntoa.js} +16 -13
- package/dist/_chunks/{balance-cell-renderer-5CA7zpAi.js → balance-cell-renderer-B8zgIM-m.js} +63 -44
- package/dist/_chunks/{breadcrumb.agent-GM2hAKFX.js → breadcrumb-D1snXjPb.js} +165 -157
- package/dist/_chunks/{button-7mLWcMp_.js → button-DD_0Xdmr.js} +12 -2
- package/dist/_chunks/{calendar-nGEgelJs.js → calendar-zy0tUUVG.js} +13 -18
- package/dist/_chunks/{card-BEy58ZKp.js → card-CWzuTLYE.js} +40 -34
- package/dist/_chunks/{chart.agent-_pRYS17d.js → chart-BLvFl169.js} +147 -131
- package/dist/_chunks/chat-container-ClzsWXp2.js +220 -0
- package/dist/_chunks/chat-input-DOlsB1fm.js +333 -0
- package/dist/_chunks/{chat-message-ByouZpPP.js → chat-message-DoAhgUTj.js} +23 -13
- package/dist/_chunks/{collapsible.agent-DkS1jVyn.js → collapsible-CuxUBoHJ.js} +97 -99
- package/dist/_chunks/{color-picker-94qcBZqZ.js → color-picker-CTIcHlDF.js} +111 -45
- package/dist/_chunks/combobox-DCNXqbC7.js +460 -0
- package/dist/_chunks/command-palette-C_vgSgrI.js +441 -0
- package/dist/_chunks/{date-picker-BqPTn7bO.js → date-picker-B1PO1ZQP.js} +190 -181
- package/dist/_chunks/{date-range-picker-B2hGsffw.js → date-range-picker-mix2nEVC.js} +21 -8
- package/dist/_chunks/{date-time-picker-Bzt0S8yO.js → date-time-picker-Dnong_BY.js} +30 -15
- package/dist/_chunks/{description-list-DvJbp6Yg.js → description-list-BYA77Yud.js} +26 -23
- package/dist/_chunks/dialog-BPD7wlGE.js +211 -0
- package/dist/_chunks/dropdown-menu-CpiF6CPz.js +300 -0
- package/dist/_chunks/{empty-state-DQPtRp2b.js → empty-state-3CLJIXSj.js} +132 -101
- package/dist/_chunks/file-upload-C947ACDK.js +829 -0
- package/dist/_chunks/{floating-action-button-Cnw-f6AG.js → floating-action-button-C8OYj8mE.js} +9 -2
- package/dist/_chunks/{form-field-BfsPLTSc.js → form-field-Bmkeh7WY.js} +12 -11
- package/dist/_chunks/{form-field-context-94LwgYTQ.js → form-field-context-B3APVHKx.js} +4 -2
- package/dist/_chunks/{freemium-paywall.agent-_nQqLyRF.js → freemium-paywall-CnvceDav.js} +124 -117
- package/dist/_chunks/{header-BGn1mRp8.js → header-D0ULgQl3.js} +69 -68
- package/dist/_chunks/{icon-button-Wnnde5lc.js → icon-button-C4CGcYuz.js} +11 -3
- package/dist/_chunks/{kbd-8baVw3KU.js → kbd-Cglkd7CY.js} +6 -2
- package/dist/_chunks/{key-value-pair-JRFS9Xrh.js → key-value-pair-CgWvAIGb.js} +2 -2
- package/dist/_chunks/{leo-sidebar-BwINPdix.js → leo-sidebar-CfEY-xi2.js} +16 -20
- package/dist/_chunks/{link-QheANk74.js → link-8QmFjIz2.js} +2 -5
- package/dist/_chunks/list-qP6p0NTw.js +434 -0
- package/dist/_chunks/{logo-BpFoCL-s.js → logo-_Z-jLq80.js} +155 -26
- package/dist/_chunks/{matrix-rain-BEkvux64.js → matrix-rain-CRPMXcVx.js} +8 -2
- package/dist/_chunks/{message-card-qhoGv947.js → message-card-ChCX9Iv6.js} +63 -60
- package/dist/_chunks/{message-tray-xHUCra-Y.js → message-tray-n8q9ITXI.js} +71 -76
- package/dist/_chunks/{multi-select.agent-Do6CeQUT.js → multi-select-wqqrgjUQ.js} +326 -291
- package/dist/_chunks/{navigation-menu.agent-D69ND6Qq.js → navigation-menu-ClbHeawy.js} +136 -123
- package/dist/_chunks/{notification-card-CsVEYJE-.js → notification-card-hBlPN1-c.js} +3 -3
- package/dist/_chunks/{notification-tray-DTXMq42J.js → notification-tray-C5cnXbl9.js} +70 -66
- package/dist/_chunks/{number-input-fvGmnRy9.js → number-input-Q7wkHnvQ.js} +7 -3
- package/dist/_chunks/{otp-input-EglXOUue.js → otp-input-C9gUByF0.js} +6 -3
- package/dist/_chunks/{pagination.agent-BkZQl45y.js → pagination-3AC4zTsi.js} +234 -194
- package/dist/_chunks/{password-input-D6kuYXmr.js → password-input-C4LmjIH1.js} +6 -9
- package/dist/_chunks/{patient-shell-BRmrrUUW.js → patient-shell-BlsEUKWB.js} +10 -15
- package/dist/_chunks/{payment-form-BWaXas8z.js → payment-form-C3vT_npe.js} +195 -186
- package/dist/_chunks/{pdf-viewer.agent-BaGEDheA.js → pdf-viewer-CZIfY08H.js} +270 -241
- package/dist/_chunks/{phone-input-C8Op4sEc.js → phone-input-CSHJOJ13.js} +4 -9
- package/dist/_chunks/popover-DekUKNBk.js +293 -0
- package/dist/_chunks/{privacy-lock.agent-C1i1-T58.js → privacy-lock-BKsI6ReN.js} +117 -109
- package/dist/_chunks/progress-C11tqhoI.js +298 -0
- package/dist/_chunks/{recaptcha-widget.agent-BGHpU5zD.js → recaptcha-widget-NyfOfLII.js} +95 -86
- package/dist/_chunks/resizable-mpXXyIsN.js +483 -0
- package/dist/_chunks/{rich-text-editor.agent-DnE125Tz.js → rich-text-editor-C7TCIlQO.js} +298 -209
- package/dist/_chunks/{scroll-area-DLr5w9Dd.js → scroll-area-DEDU-lp-.js} +67 -54
- package/dist/_chunks/{search-bar.agent-DxFAxctc.js → search-bar-BTDfgYtg.js} +291 -268
- package/dist/_chunks/{search-input-Xw3cdWXW.js → search-input-CdJIEjFo.js} +116 -107
- package/dist/_chunks/{select-DY1Cb2Tg.js → select-y6bXV1f1.js} +84 -83
- package/dist/_chunks/{separator-B4wXDLNC.js → separator-CYU_bGFn.js} +2 -5
- package/dist/_chunks/{sheet-B9kH9pcI.js → sheet-4tgMFwj0.js} +135 -60
- package/dist/_chunks/{sidebar-CHF5xr_P.js → sidebar-Bx3wCDyy.js} +546 -457
- package/dist/_chunks/{sign-in-with-alfadocs-button-BN_FPGHT.js → sign-in-with-alfadocs-button-B9UrqOqH.js} +9 -5
- package/dist/_chunks/{signature-capture.agent-BpeDwFht.js → signature-capture-DjMlFOzS.js} +210 -212
- package/dist/_chunks/{skeleton-dtqyF09N.js → skeleton-CZbwyJAA.js} +9 -3
- package/dist/_chunks/{slider-CcsQTZTA.js → slider-BT2bZWsy.js} +138 -134
- package/dist/_chunks/{slot-grid-D_l5VsHG.js → slot-grid-CgpYgBkW.js} +105 -95
- package/dist/_chunks/{sparkline.agent-56Sj7nOP.js → sparkline-_gy8aJDG.js} +107 -100
- package/dist/_chunks/{spinner-GCcv67vh.js → spinner-DLaYfLPl.js} +66 -14
- package/dist/_chunks/{stat-DUB6g90R.js → stat-B9PHSPbN.js} +45 -27
- package/dist/_chunks/{stepper-calendar.agent-9iT3ClIB.js → stepper-calendar-BLOJUE0-.js} +189 -187
- package/dist/_chunks/stepper-progress-jFY8BSf7.js +208 -0
- package/dist/_chunks/{suggestion-chip-DhFrkRPj.js → suggestion-chip-C4Jz0LrM.js} +50 -52
- package/dist/_chunks/{switch-BYEH8I53.js → switch-C0psfIQF.js} +2 -2
- package/dist/_chunks/{tabs.agent-h7NvsTR1.js → tabs-DaFA3Muo.js} +183 -155
- package/dist/_chunks/{tag-BqidXKo3.js → tag-DuLMjRbF.js} +90 -32
- package/dist/_chunks/{task-card-CY5ztNkU.js → task-card-Dw_ZJDL8.js} +5 -2
- package/dist/_chunks/{task-tray-CCoUdorl.js → task-tray-XlIW9ueh.js} +50 -49
- package/dist/_chunks/{text-area-C_M8wliK.js → text-area-CO9Dz0qX.js} +2 -2
- package/dist/_chunks/{text-input-BX39e6T6.js → text-input-DZwt9L8H.js} +65 -62
- package/dist/_chunks/{theme-root-DDb0TJjd.js → theme-root-CSKD5ZRm.js} +9 -2
- package/dist/_chunks/{theme-toggle.agent-btmXTWdW.js → theme-toggle-B9zzCnvl.js} +179 -177
- package/dist/_chunks/{time-picker-B8AMIrX7.js → time-picker-DvPUmHH-.js} +95 -93
- package/dist/_chunks/{timeline.agent-CRPza9wc.js → timeline-BvmnQadS.js} +96 -96
- package/dist/_chunks/{toast.agent-BjEGuq1Z.js → toast.agent-BwKXA0km.js} +46 -8
- package/dist/_chunks/{tooth-scheme.agent-CWrQBjJM.js → tooth-scheme-3mITSXiZ.js} +146 -162
- package/dist/_chunks/{transcript-panel.agent-BXEYP6w-.js → transcript-panel-Bx5ANMsv.js} +110 -101
- package/dist/_chunks/{typing-indicator-CbUBf-Dx.js → typing-indicator-BZ5jXZPn.js} +27 -5
- package/dist/_chunks/{use-theme-BMUhembX.js → use-theme-B1cwAXJR.js} +2 -5
- package/dist/_chunks/{visually-hidden-Bw7vBHLm.js → visually-hidden-BHxEUGyT.js} +11 -2
- package/dist/_chunks/{warning-stack-8Pa3pekh.js → warning-stack-VygGHSqC.js} +11 -13
- package/dist/_chunks/{workflow-map-D2A7rTEG.js → workflow-map-C-nlogPC.js} +430 -452
- package/dist/agent-catalog.json +580 -15
- package/dist/components/_shared/index.d.ts +2 -2
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +5 -6
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/agenda-tray.d.ts +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/app-frame/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/chart/index.d.ts +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-container/chat-container.d.ts +1 -1
- package/dist/components/chat-container/index.js +2 -3
- package/dist/components/chat-input/chat-input.d.ts +1 -1
- package/dist/components/chat-input/index.js +3 -4
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox-group/index.d.ts +1 -1
- package/dist/components/collapsible/collapsible.d.ts +1 -1
- package/dist/components/collapsible/index.d.ts +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +46 -13
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/data-table/data-table.d.ts +3 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/data-table/toolbar.d.ts +6 -5
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.d.ts +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/description-list.d.ts +1 -2
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -16
- package/dist/components/dropdown-menu/index.js +3 -4
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/floating-action-button/index.js +1 -1
- package/dist/components/form-field/index.js +2 -2
- package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/matrix-rain/index.js +1 -1
- package/dist/components/message-card/index.d.ts +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
- package/dist/components/notification-card/index.d.ts +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/pagination.d.ts +4 -6
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/payment-form/index.js +7 -8
- package/dist/components/payment-form/payment-form.d.ts +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/phone-input/index.d.ts +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +3 -4
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/privacy-lock/privacy-lock.d.ts +1 -1
- package/dist/components/progress/index.js +3 -4
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/resizable/index.d.ts +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-bar/search-bar.d.ts +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.js +3 -4
- package/dist/components/sheet/sheet.d.ts +2 -2
- package/dist/components/sidebar/index.js +7 -8
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/stat/index.js +1 -1
- package/dist/components/stepper-calendar/index.js +1 -1
- package/dist/components/stepper-calendar/stepper-calendar.d.ts +1 -1
- package/dist/components/stepper-progress/index.d.ts +1 -1
- package/dist/components/stepper-progress/index.js +1 -2
- package/dist/components/stepper-progress/stepper-progress.d.ts +1 -1
- package/dist/components/suggestion-chip/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/task-tray/task-tray.d.ts +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-root/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/tooth-scheme/tooth-scheme.d.ts +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/transcript-panel/transcript-panel.d.ts +1 -1
- package/dist/components/typing-indicator/index.js +1 -1
- package/dist/components/visually-hidden/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/components/workflow/workflow-editor.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +392 -402
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/safe-html/index.js +20 -3
- package/dist/tokens.css +2 -2
- package/package.json +12 -2
- package/dist/_chunks/accordion-BEnrZmAn.js +0 -120
- package/dist/_chunks/accordion.agent-BTjeO1Sx.js +0 -52
- package/dist/_chunks/autocomplete.agent-Dh7KioS6.js +0 -432
- package/dist/_chunks/chat-container-Dl0Kfy5a.js +0 -175
- package/dist/_chunks/chat-container.agent-CM4WModE.js +0 -27
- package/dist/_chunks/chat-input-C_tMQv92.js +0 -252
- package/dist/_chunks/chat-input.agent-Bsz3ckGa.js +0 -69
- package/dist/_chunks/combobox.agent-CAvUkkIe.js +0 -410
- package/dist/_chunks/command-palette.agent-HatEt_EM.js +0 -391
- package/dist/_chunks/dialog.agent-Daf1TTko.js +0 -179
- package/dist/_chunks/dropdown-menu-C7AZipNz.js +0 -219
- package/dist/_chunks/dropdown-menu.agent-BcxIKOjK.js +0 -43
- package/dist/_chunks/file-upload.agent-DJaH2dHg.js +0 -681
- package/dist/_chunks/list.agent-D0iWt4VI.js +0 -420
- package/dist/_chunks/payment-form.agent-kuIfodCj.js +0 -31
- package/dist/_chunks/popover-kFN8s84V.js +0 -229
- package/dist/_chunks/popover.agent-K_d1cfbj.js +0 -39
- package/dist/_chunks/progress-wNsqkw8I.js +0 -253
- package/dist/_chunks/progress.agent-C68rDOXL.js +0 -27
- package/dist/_chunks/resizable.agent-CMwZzvsi.js +0 -456
- package/dist/_chunks/sheet.agent-QAyTOxgk.js +0 -46
- package/dist/_chunks/sidebar.agent-C9TM_ZDZ.js +0 -49
- package/dist/_chunks/stepper-progress-Bmen-YXB.js +0 -149
- package/dist/_chunks/stepper-progress.agent-q9InWca4.js +0 -61
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { jsxs as k, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useEditor as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Table as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { Markdown as
|
|
12
|
-
import { p as
|
|
13
|
-
import { c as
|
|
14
|
-
import { useTranslation as
|
|
2
|
+
import { forwardRef as se, useId as re, useMemo as j, useState as H, useEffect as w, useRef as B, useImperativeHandle as ie, useCallback as _ } from "react";
|
|
3
|
+
import { useEditor as oe, EditorContent as ne } from "@tiptap/react";
|
|
4
|
+
import ae from "@tiptap/starter-kit";
|
|
5
|
+
import de from "@tiptap/extension-link";
|
|
6
|
+
import ce from "@tiptap/extension-image";
|
|
7
|
+
import { Table as le } from "@tiptap/extension-table";
|
|
8
|
+
import ue from "@tiptap/extension-table-row";
|
|
9
|
+
import me from "@tiptap/extension-table-cell";
|
|
10
|
+
import fe from "@tiptap/extension-table-header";
|
|
11
|
+
import { Markdown as he } from "tiptap-markdown";
|
|
12
|
+
import { p as pe } from "./purify.es-DpIUMBYC.js";
|
|
13
|
+
import { c as S } from "./index-D2ZczOXr.js";
|
|
14
|
+
import { useTranslation as U } from "react-i18next";
|
|
15
15
|
import * as z from "@radix-ui/react-dialog";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { u as be } from "./registry-C9nwlNyL.js";
|
|
17
|
+
import { s as ge } from "./safe-image-src-DstKgCo7.js";
|
|
18
|
+
import { X as ve } from "./x-CCcI3eJp.js";
|
|
19
|
+
import { C as ke } from "./chevron-down-BX_NP2Yh.js";
|
|
19
20
|
import { c as m } from "./createLucideIcon-CrFbzy84.js";
|
|
20
21
|
/**
|
|
21
22
|
* @license lucide-react v1.8.0 - ISC
|
|
@@ -23,97 +24,97 @@ import { c as m } from "./createLucideIcon-CrFbzy84.js";
|
|
|
23
24
|
* This source code is licensed under the ISC license.
|
|
24
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
25
26
|
*/
|
|
26
|
-
const
|
|
27
|
+
const ye = [
|
|
27
28
|
[
|
|
28
29
|
"path",
|
|
29
30
|
{ d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
|
|
30
31
|
]
|
|
31
|
-
],
|
|
32
|
+
], xe = m("bold", ye);
|
|
32
33
|
/**
|
|
33
34
|
* @license lucide-react v1.8.0 - ISC
|
|
34
35
|
*
|
|
35
36
|
* This source code is licensed under the ISC license.
|
|
36
37
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
38
|
*/
|
|
38
|
-
const
|
|
39
|
+
const ze = [
|
|
39
40
|
["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
|
|
40
41
|
["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
|
|
41
|
-
],
|
|
42
|
+
], we = m("code", ze);
|
|
42
43
|
/**
|
|
43
44
|
* @license lucide-react v1.8.0 - ISC
|
|
44
45
|
*
|
|
45
46
|
* This source code is licensed under the ISC license.
|
|
46
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
48
|
*/
|
|
48
|
-
const
|
|
49
|
+
const Me = [
|
|
49
50
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
50
51
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
51
52
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
52
|
-
],
|
|
53
|
+
], Ne = m("image", Me);
|
|
53
54
|
/**
|
|
54
55
|
* @license lucide-react v1.8.0 - ISC
|
|
55
56
|
*
|
|
56
57
|
* This source code is licensed under the ISC license.
|
|
57
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
59
|
*/
|
|
59
|
-
const
|
|
60
|
+
const Ae = [
|
|
60
61
|
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
61
62
|
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
62
63
|
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
63
|
-
],
|
|
64
|
+
], Ce = m("italic", Ae);
|
|
64
65
|
/**
|
|
65
66
|
* @license lucide-react v1.8.0 - ISC
|
|
66
67
|
*
|
|
67
68
|
* This source code is licensed under the ISC license.
|
|
68
69
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
70
|
*/
|
|
70
|
-
const
|
|
71
|
+
const Le = [
|
|
71
72
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
72
73
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
73
74
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
74
|
-
],
|
|
75
|
+
], Te = m("link-2", Le);
|
|
75
76
|
/**
|
|
76
77
|
* @license lucide-react v1.8.0 - ISC
|
|
77
78
|
*
|
|
78
79
|
* This source code is licensed under the ISC license.
|
|
79
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
80
81
|
*/
|
|
81
|
-
const
|
|
82
|
+
const _e = [
|
|
82
83
|
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
83
84
|
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
84
85
|
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
85
86
|
["path", { d: "M4 4h1v5", key: "10yrso" }],
|
|
86
87
|
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
87
88
|
["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
|
|
88
|
-
],
|
|
89
|
+
], Re = m("list-ordered", _e);
|
|
89
90
|
/**
|
|
90
91
|
* @license lucide-react v1.8.0 - ISC
|
|
91
92
|
*
|
|
92
93
|
* This source code is licensed under the ISC license.
|
|
93
94
|
* See the LICENSE file in the root directory of this source tree.
|
|
94
95
|
*/
|
|
95
|
-
const
|
|
96
|
+
const je = [
|
|
96
97
|
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
97
98
|
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
98
99
|
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
99
100
|
["path", { d: "M8 5h13", key: "1pao27" }],
|
|
100
101
|
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
101
102
|
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
102
|
-
],
|
|
103
|
+
], Ie = m("list", je);
|
|
103
104
|
/**
|
|
104
105
|
* @license lucide-react v1.8.0 - ISC
|
|
105
106
|
*
|
|
106
107
|
* This source code is licensed under the ISC license.
|
|
107
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
109
|
*/
|
|
109
|
-
const
|
|
110
|
+
const He = [["path", { d: "M5 12h14", key: "1ays0h" }]], Be = m("minus", He);
|
|
110
111
|
/**
|
|
111
112
|
* @license lucide-react v1.8.0 - ISC
|
|
112
113
|
*
|
|
113
114
|
* This source code is licensed under the ISC license.
|
|
114
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
115
116
|
*/
|
|
116
|
-
const
|
|
117
|
+
const Se = [
|
|
117
118
|
[
|
|
118
119
|
"path",
|
|
119
120
|
{
|
|
@@ -128,39 +129,86 @@ const He = [
|
|
|
128
129
|
key: "1ymkrd"
|
|
129
130
|
}
|
|
130
131
|
]
|
|
131
|
-
],
|
|
132
|
+
], $e = m("quote", Se);
|
|
132
133
|
/**
|
|
133
134
|
* @license lucide-react v1.8.0 - ISC
|
|
134
135
|
*
|
|
135
136
|
* This source code is licensed under the ISC license.
|
|
136
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
137
138
|
*/
|
|
138
|
-
const
|
|
139
|
+
const De = [
|
|
139
140
|
["path", { d: "M21 7v6h-6", key: "3ptur4" }],
|
|
140
141
|
["path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7", key: "1kgawr" }]
|
|
141
|
-
],
|
|
142
|
+
], Ee = m("redo", De);
|
|
142
143
|
/**
|
|
143
144
|
* @license lucide-react v1.8.0 - ISC
|
|
144
145
|
*
|
|
145
146
|
* This source code is licensed under the ISC license.
|
|
146
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
147
148
|
*/
|
|
148
|
-
const
|
|
149
|
+
const Ke = [
|
|
149
150
|
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
150
151
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
151
152
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
152
153
|
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
153
|
-
],
|
|
154
|
+
], qe = m("table", Ke);
|
|
154
155
|
/**
|
|
155
156
|
* @license lucide-react v1.8.0 - ISC
|
|
156
157
|
*
|
|
157
158
|
* This source code is licensed under the ISC license.
|
|
158
159
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
160
|
*/
|
|
160
|
-
const
|
|
161
|
+
const Fe = [
|
|
161
162
|
["path", { d: "M3 7v6h6", key: "1v2h90" }],
|
|
162
163
|
["path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13", key: "1r6uu6" }]
|
|
163
|
-
],
|
|
164
|
+
], Ve = m("undo", Fe), Pe = {
|
|
165
|
+
id: "rich-text-editor",
|
|
166
|
+
capabilities: ["edit_inline"],
|
|
167
|
+
state: {
|
|
168
|
+
html: {
|
|
169
|
+
type: "string",
|
|
170
|
+
description: "Sanitised HTML representation of the editor content.",
|
|
171
|
+
read: (a) => a.getHTML()
|
|
172
|
+
},
|
|
173
|
+
markdown: {
|
|
174
|
+
type: "string",
|
|
175
|
+
description: "Markdown representation of the editor content.",
|
|
176
|
+
read: (a) => a.getMarkdown()
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
actions: {
|
|
180
|
+
set_content: {
|
|
181
|
+
safety: "destructive",
|
|
182
|
+
argsType: "{ html: string }",
|
|
183
|
+
description: "Replace the editor content. Loses unsaved input.",
|
|
184
|
+
invoke: (a, g) => {
|
|
185
|
+
a.setContent(g.html);
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
clear: {
|
|
189
|
+
safety: "destructive",
|
|
190
|
+
description: "Empty the editor. Loses unsaved input.",
|
|
191
|
+
invoke: (a) => {
|
|
192
|
+
a.clear();
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
focus: {
|
|
196
|
+
safety: "read",
|
|
197
|
+
description: "Move keyboard focus to the editor surface.",
|
|
198
|
+
invoke: (a) => {
|
|
199
|
+
a.focus();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
domHooks: {
|
|
204
|
+
root: { attr: "data-component", value: "rich-text-editor" },
|
|
205
|
+
instanceId: {
|
|
206
|
+
attr: "data-component-id",
|
|
207
|
+
sourceProp: "id",
|
|
208
|
+
description: "Sourced from the id prop."
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}, Ze = {
|
|
164
212
|
FORBID_TAGS: [
|
|
165
213
|
"script",
|
|
166
214
|
"style",
|
|
@@ -180,12 +228,12 @@ const Ke = [
|
|
|
180
228
|
"onblur"
|
|
181
229
|
]
|
|
182
230
|
};
|
|
183
|
-
function
|
|
184
|
-
return
|
|
231
|
+
function I(a) {
|
|
232
|
+
return pe.sanitize(a, Ze);
|
|
185
233
|
}
|
|
186
|
-
const
|
|
234
|
+
const Ue = S(
|
|
187
235
|
"tiptap-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
188
|
-
),
|
|
236
|
+
), Ge = S(
|
|
189
237
|
[
|
|
190
238
|
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
191
239
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
@@ -200,7 +248,7 @@ const Ve = B(
|
|
|
200
248
|
},
|
|
201
249
|
defaultVariants: { direction: "ltr" }
|
|
202
250
|
}
|
|
203
|
-
),
|
|
251
|
+
), G = S(
|
|
204
252
|
[
|
|
205
253
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
206
254
|
"ds:min-block-size-[var(--min-target-size)]",
|
|
@@ -229,12 +277,12 @@ const Ve = B(
|
|
|
229
277
|
},
|
|
230
278
|
defaultVariants: { pressed: !1, disabled: !1 }
|
|
231
279
|
}
|
|
232
|
-
),
|
|
280
|
+
), Qe = S(
|
|
233
281
|
[
|
|
234
282
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
235
283
|
"ds:bg-[var(--background)] ds:text-[var(--foreground)]"
|
|
236
284
|
].join(" ")
|
|
237
|
-
),
|
|
285
|
+
), Xe = {
|
|
238
286
|
minimal: ["bold", "italic", "link"],
|
|
239
287
|
standard: [
|
|
240
288
|
"bold",
|
|
@@ -261,22 +309,22 @@ const Ve = B(
|
|
|
261
309
|
"redo"
|
|
262
310
|
]
|
|
263
311
|
};
|
|
264
|
-
function
|
|
312
|
+
function Ye({
|
|
265
313
|
editor: a,
|
|
266
|
-
registerRef:
|
|
314
|
+
registerRef: g,
|
|
267
315
|
tabIndex: l,
|
|
268
316
|
onFocus: h,
|
|
269
317
|
onKeyDown: R,
|
|
270
318
|
label: M,
|
|
271
319
|
disabled: i,
|
|
272
|
-
pressed:
|
|
320
|
+
pressed: $
|
|
273
321
|
}) {
|
|
274
|
-
const [y, N] =
|
|
322
|
+
const [y, N] = H(!1), A = B(null);
|
|
275
323
|
w(() => {
|
|
276
324
|
if (!y) return;
|
|
277
|
-
function c(
|
|
278
|
-
const
|
|
279
|
-
A.current &&
|
|
325
|
+
function c(D) {
|
|
326
|
+
const v = D.target;
|
|
327
|
+
A.current && v && !A.current.contains(v) && N(!1);
|
|
280
328
|
}
|
|
281
329
|
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
282
330
|
}, [y]);
|
|
@@ -288,7 +336,7 @@ function Ge({
|
|
|
288
336
|
"button",
|
|
289
337
|
{
|
|
290
338
|
type: "button",
|
|
291
|
-
ref:
|
|
339
|
+
ref: g,
|
|
292
340
|
tabIndex: l,
|
|
293
341
|
onFocus: h,
|
|
294
342
|
onKeyDown: R,
|
|
@@ -300,10 +348,23 @@ function Ge({
|
|
|
300
348
|
"aria-disabled": i || void 0,
|
|
301
349
|
"aria-label": M,
|
|
302
350
|
title: M,
|
|
303
|
-
className:
|
|
351
|
+
className: G({ pressed: $, disabled: i }),
|
|
304
352
|
children: [
|
|
305
|
-
/* @__PURE__ */ r(
|
|
306
|
-
|
|
353
|
+
/* @__PURE__ */ r(
|
|
354
|
+
"span",
|
|
355
|
+
{
|
|
356
|
+
"aria-hidden": "true",
|
|
357
|
+
className: "ds:text-[length:var(--font-size-sm)] ds:font-semibold",
|
|
358
|
+
children: "H"
|
|
359
|
+
}
|
|
360
|
+
),
|
|
361
|
+
/* @__PURE__ */ r(
|
|
362
|
+
ke,
|
|
363
|
+
{
|
|
364
|
+
"aria-hidden": "true",
|
|
365
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
366
|
+
}
|
|
367
|
+
)
|
|
307
368
|
]
|
|
308
369
|
}
|
|
309
370
|
),
|
|
@@ -343,9 +404,12 @@ function Ge({
|
|
|
343
404
|
) : null
|
|
344
405
|
] });
|
|
345
406
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
348
|
-
|
|
407
|
+
function Je({
|
|
408
|
+
open: a,
|
|
409
|
+
onOpenChange: g
|
|
410
|
+
}) {
|
|
411
|
+
const { t: l } = U();
|
|
412
|
+
return /* @__PURE__ */ r(z.Root, { open: a, onOpenChange: g, children: /* @__PURE__ */ k(z.Portal, { children: [
|
|
349
413
|
/* @__PURE__ */ r(
|
|
350
414
|
z.Overlay,
|
|
351
415
|
{
|
|
@@ -370,13 +434,7 @@ function Qe({ open: a, onOpenChange: v }) {
|
|
|
370
434
|
].join(" "),
|
|
371
435
|
children: [
|
|
372
436
|
/* @__PURE__ */ k("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-md)]", children: [
|
|
373
|
-
/* @__PURE__ */ r(
|
|
374
|
-
z.Title,
|
|
375
|
-
{
|
|
376
|
-
className: "type-title-card ds:leading-snug",
|
|
377
|
-
children: l("editor.shortcuts.title")
|
|
378
|
-
}
|
|
379
|
-
),
|
|
437
|
+
/* @__PURE__ */ r(z.Title, { className: "type-title-card ds:leading-snug", children: l("editor.shortcuts.title") }),
|
|
380
438
|
/* @__PURE__ */ r(z.Close, { asChild: !0, children: /* @__PURE__ */ r(
|
|
381
439
|
"button",
|
|
382
440
|
{
|
|
@@ -393,7 +451,13 @@ function Qe({ open: a, onOpenChange: v }) {
|
|
|
393
451
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
394
452
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
395
453
|
].join(" "),
|
|
396
|
-
children: /* @__PURE__ */ r(
|
|
454
|
+
children: /* @__PURE__ */ r(
|
|
455
|
+
ve,
|
|
456
|
+
{
|
|
457
|
+
"aria-hidden": "true",
|
|
458
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
459
|
+
}
|
|
460
|
+
)
|
|
397
461
|
}
|
|
398
462
|
) })
|
|
399
463
|
] }),
|
|
@@ -430,39 +494,39 @@ function Qe({ open: a, onOpenChange: v }) {
|
|
|
430
494
|
)
|
|
431
495
|
] }) });
|
|
432
496
|
}
|
|
433
|
-
const
|
|
497
|
+
const We = se(
|
|
434
498
|
({
|
|
435
499
|
id: a,
|
|
436
|
-
defaultValue:
|
|
500
|
+
defaultValue: g,
|
|
437
501
|
value: l,
|
|
438
502
|
onChange: h,
|
|
439
503
|
toolbar: R = "standard",
|
|
440
504
|
placeholder: M,
|
|
441
505
|
readOnly: i = !1,
|
|
442
|
-
ariaLabel:
|
|
506
|
+
ariaLabel: $,
|
|
443
507
|
minHeight: y,
|
|
444
508
|
className: N
|
|
445
509
|
}, A) => {
|
|
446
|
-
const { t: o } =
|
|
510
|
+
const { t: o } = U(), c = re(), D = j(
|
|
447
511
|
() => `rte-${c.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
448
512
|
[c]
|
|
449
|
-
), [
|
|
513
|
+
), [v, Q] = H(!1);
|
|
450
514
|
w(() => {
|
|
451
|
-
typeof document > "u" ||
|
|
515
|
+
typeof document > "u" || Q(document.documentElement.dir === "rtl");
|
|
452
516
|
}, []);
|
|
453
|
-
const [
|
|
517
|
+
const [X, F] = H(!1), C = B(null), L = B(h);
|
|
454
518
|
w(() => {
|
|
455
519
|
L.current = h;
|
|
456
520
|
}, [h]);
|
|
457
|
-
const
|
|
458
|
-
const s = l ??
|
|
459
|
-
return s ?
|
|
460
|
-
}, [
|
|
521
|
+
const Y = j(() => {
|
|
522
|
+
const s = l ?? g ?? "";
|
|
523
|
+
return s ? I(s) : "";
|
|
524
|
+
}, [g, l]), e = oe({
|
|
461
525
|
extensions: [
|
|
462
|
-
|
|
526
|
+
ae.configure({
|
|
463
527
|
heading: { levels: [1, 2, 3] }
|
|
464
528
|
}),
|
|
465
|
-
|
|
529
|
+
de.configure({
|
|
466
530
|
protocols: ["http", "https", "mailto", "tel"],
|
|
467
531
|
HTMLAttributes: {
|
|
468
532
|
rel: "noopener noreferrer",
|
|
@@ -470,17 +534,17 @@ const Xe = te(
|
|
|
470
534
|
},
|
|
471
535
|
validate: (s) => /^(https?:|mailto:|tel:)/i.test(s)
|
|
472
536
|
}),
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
le,
|
|
537
|
+
ce,
|
|
538
|
+
le.configure({ resizable: !1 }),
|
|
476
539
|
ue,
|
|
477
540
|
me,
|
|
478
|
-
fe
|
|
541
|
+
fe,
|
|
542
|
+
he.configure({
|
|
479
543
|
html: !1,
|
|
480
544
|
transformPastedText: !0
|
|
481
545
|
})
|
|
482
546
|
],
|
|
483
|
-
content:
|
|
547
|
+
content: Y,
|
|
484
548
|
editable: !i,
|
|
485
549
|
immediatelyRender: !1,
|
|
486
550
|
shouldRerenderOnTransaction: !0,
|
|
@@ -488,21 +552,21 @@ const Xe = te(
|
|
|
488
552
|
attributes: {
|
|
489
553
|
role: "textbox",
|
|
490
554
|
"aria-multiline": "true",
|
|
491
|
-
"aria-label":
|
|
555
|
+
"aria-label": $ ?? o("editor.placeholder"),
|
|
492
556
|
"data-placeholder": M ?? o("editor.placeholder")
|
|
493
557
|
},
|
|
494
558
|
transformPastedHTML(s) {
|
|
495
|
-
return
|
|
559
|
+
return I(s);
|
|
496
560
|
},
|
|
497
561
|
handleKeyDown(s, t) {
|
|
498
|
-
return (t.metaKey || t.ctrlKey) && t.key === "/" ? (t.preventDefault(),
|
|
562
|
+
return (t.metaKey || t.ctrlKey) && t.key === "/" ? (t.preventDefault(), F(!0), !0) : !1;
|
|
499
563
|
}
|
|
500
564
|
},
|
|
501
565
|
onUpdate({ editor: s }) {
|
|
502
566
|
L.current && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
503
|
-
var d,
|
|
504
|
-
const t = s.getHTML(), f = ((
|
|
505
|
-
(
|
|
567
|
+
var d, p, b;
|
|
568
|
+
const t = s.getHTML(), f = ((p = (d = s.storage.markdown) == null ? void 0 : d.getMarkdown) == null ? void 0 : p.call(d)) ?? "";
|
|
569
|
+
(b = L.current) == null || b.call(L, { html: t, markdown: f });
|
|
506
570
|
}, 100));
|
|
507
571
|
}
|
|
508
572
|
});
|
|
@@ -512,10 +576,10 @@ const Xe = te(
|
|
|
512
576
|
e && e.setEditable(!i);
|
|
513
577
|
}, [e, i]), w(() => {
|
|
514
578
|
if (!e || l === void 0 || e.getHTML() === l) return;
|
|
515
|
-
const t =
|
|
579
|
+
const t = I(l);
|
|
516
580
|
e.commands.setContent(t, { emitUpdate: !1 });
|
|
517
|
-
}, [e, l])
|
|
518
|
-
|
|
581
|
+
}, [e, l]);
|
|
582
|
+
const E = j(
|
|
519
583
|
() => ({
|
|
520
584
|
getHTML() {
|
|
521
585
|
return (e == null ? void 0 : e.getHTML()) ?? "";
|
|
@@ -526,7 +590,7 @@ const Xe = te(
|
|
|
526
590
|
},
|
|
527
591
|
setContent(s) {
|
|
528
592
|
if (!e) return;
|
|
529
|
-
const t =
|
|
593
|
+
const t = I(s);
|
|
530
594
|
e.commands.setContent(t);
|
|
531
595
|
},
|
|
532
596
|
focus() {
|
|
@@ -538,24 +602,25 @@ const Xe = te(
|
|
|
538
602
|
}),
|
|
539
603
|
[e]
|
|
540
604
|
);
|
|
541
|
-
|
|
605
|
+
ie(A, () => E, [E]), be(Pe, E, a);
|
|
606
|
+
const V = B([]), [T, K] = H(0), q = j(() => Xe[R], [R]), J = _(
|
|
542
607
|
(s) => (t) => {
|
|
543
|
-
|
|
608
|
+
V.current[s] = t;
|
|
544
609
|
},
|
|
545
610
|
[]
|
|
546
|
-
),
|
|
547
|
-
const t =
|
|
611
|
+
), P = _((s) => {
|
|
612
|
+
const t = V.current[s];
|
|
548
613
|
t && t.focus();
|
|
549
|
-
}, []),
|
|
614
|
+
}, []), Z = _(
|
|
550
615
|
(s) => {
|
|
551
|
-
const t =
|
|
616
|
+
const t = q.length;
|
|
552
617
|
if (t === 0) return;
|
|
553
|
-
const u =
|
|
618
|
+
const u = v ? "ArrowLeft" : "ArrowRight", f = v ? "ArrowRight" : "ArrowLeft";
|
|
554
619
|
let d = null;
|
|
555
|
-
s.key === u ? d = (T + 1) % t : s.key === f ? d = (T - 1 + t) % t : s.key === "Home" ? d = 0 : s.key === "End" && (d = t - 1), d !== null && (s.preventDefault(),
|
|
620
|
+
s.key === u ? d = (T + 1) % t : s.key === f ? d = (T - 1 + t) % t : s.key === "Home" ? d = 0 : s.key === "End" && (d = t - 1), d !== null && (s.preventDefault(), K(d), P(d));
|
|
556
621
|
},
|
|
557
|
-
[T,
|
|
558
|
-
),
|
|
622
|
+
[T, P, v, q.length]
|
|
623
|
+
), W = _(
|
|
559
624
|
(s) => {
|
|
560
625
|
if (s.preventDefault(), !e) return;
|
|
561
626
|
const t = e.getAttributes("link").href, u = window.prompt(o("editor.link.insert"), t ?? "");
|
|
@@ -568,21 +633,21 @@ const Xe = te(
|
|
|
568
633
|
/^(https?:|mailto:|tel:)/i.test(f) && e.chain().focus().extendMarkRange("link").setLink({ href: f }).run();
|
|
569
634
|
},
|
|
570
635
|
[e, o]
|
|
571
|
-
),
|
|
636
|
+
), O = _(() => {
|
|
572
637
|
if (!e) return;
|
|
573
638
|
const s = window.prompt(o("editor.image.insert"), "");
|
|
574
639
|
if (s === null) return;
|
|
575
|
-
const t =
|
|
640
|
+
const t = ge(s);
|
|
576
641
|
t && e.chain().focus().setImage({ src: t }).run();
|
|
577
642
|
}, [e, o]);
|
|
578
|
-
function
|
|
643
|
+
function ee(s, t) {
|
|
579
644
|
if (!e) return null;
|
|
580
|
-
const u =
|
|
645
|
+
const u = J(t), f = {
|
|
581
646
|
tabIndex: t === T ? 0 : -1,
|
|
582
|
-
onFocus: () =>
|
|
583
|
-
onKeyDown:
|
|
584
|
-
}, d = (n, x) =>
|
|
585
|
-
function
|
|
647
|
+
onFocus: () => K(t),
|
|
648
|
+
onKeyDown: Z
|
|
649
|
+
}, d = (n, x) => G({ pressed: n, disabled: x });
|
|
650
|
+
function p(n) {
|
|
586
651
|
return /* @__PURE__ */ r(
|
|
587
652
|
"button",
|
|
588
653
|
{
|
|
@@ -602,7 +667,7 @@ const Xe = te(
|
|
|
602
667
|
}
|
|
603
668
|
);
|
|
604
669
|
}
|
|
605
|
-
function
|
|
670
|
+
function b(n) {
|
|
606
671
|
return /* @__PURE__ */ r(
|
|
607
672
|
"button",
|
|
608
673
|
{
|
|
@@ -627,119 +692,191 @@ const Xe = te(
|
|
|
627
692
|
}
|
|
628
693
|
switch (s) {
|
|
629
694
|
case "bold":
|
|
630
|
-
return
|
|
695
|
+
return p({
|
|
631
696
|
label: o("editor.bold"),
|
|
632
697
|
pressed: e.isActive("bold"),
|
|
633
698
|
disabled: i,
|
|
634
699
|
shortcut: "Control+B Meta+B",
|
|
635
700
|
onActivate: () => e.chain().focus().toggleBold().run(),
|
|
636
|
-
icon: /* @__PURE__ */ r(
|
|
701
|
+
icon: /* @__PURE__ */ r(
|
|
702
|
+
xe,
|
|
703
|
+
{
|
|
704
|
+
"aria-hidden": "true",
|
|
705
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
706
|
+
}
|
|
707
|
+
)
|
|
637
708
|
});
|
|
638
709
|
case "italic":
|
|
639
|
-
return
|
|
710
|
+
return p({
|
|
640
711
|
label: o("editor.italic"),
|
|
641
712
|
pressed: e.isActive("italic"),
|
|
642
713
|
disabled: i,
|
|
643
714
|
shortcut: "Control+I Meta+I",
|
|
644
715
|
onActivate: () => e.chain().focus().toggleItalic().run(),
|
|
645
|
-
icon: /* @__PURE__ */ r(
|
|
716
|
+
icon: /* @__PURE__ */ r(
|
|
717
|
+
Ce,
|
|
718
|
+
{
|
|
719
|
+
"aria-hidden": "true",
|
|
720
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
721
|
+
}
|
|
722
|
+
)
|
|
646
723
|
});
|
|
647
724
|
case "link":
|
|
648
|
-
return
|
|
725
|
+
return b({
|
|
649
726
|
label: o("editor.link.insert"),
|
|
650
727
|
disabled: i,
|
|
651
728
|
shortcut: "Control+K Meta+K",
|
|
652
|
-
onActivate:
|
|
653
|
-
icon: /* @__PURE__ */ r(
|
|
729
|
+
onActivate: W,
|
|
730
|
+
icon: /* @__PURE__ */ r(
|
|
731
|
+
Te,
|
|
732
|
+
{
|
|
733
|
+
"aria-hidden": "true",
|
|
734
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
735
|
+
}
|
|
736
|
+
)
|
|
654
737
|
});
|
|
655
738
|
case "heading":
|
|
656
739
|
return /* @__PURE__ */ r(
|
|
657
|
-
|
|
740
|
+
Ye,
|
|
658
741
|
{
|
|
659
742
|
editor: e,
|
|
660
743
|
registerRef: u,
|
|
661
744
|
tabIndex: t === T ? 0 : -1,
|
|
662
|
-
onFocus: () =>
|
|
663
|
-
onKeyDown:
|
|
745
|
+
onFocus: () => K(t),
|
|
746
|
+
onKeyDown: Z,
|
|
664
747
|
label: o("editor.heading"),
|
|
665
748
|
disabled: i,
|
|
666
749
|
pressed: e.isActive("heading", { level: 1 }) || e.isActive("heading", { level: 2 }) || e.isActive("heading", { level: 3 })
|
|
667
750
|
}
|
|
668
751
|
);
|
|
669
752
|
case "bulletList":
|
|
670
|
-
return
|
|
753
|
+
return p({
|
|
671
754
|
label: o("editor.list.bullet"),
|
|
672
755
|
pressed: e.isActive("bulletList"),
|
|
673
756
|
disabled: i,
|
|
674
757
|
onActivate: () => e.chain().focus().toggleBulletList().run(),
|
|
675
|
-
icon: /* @__PURE__ */ r(
|
|
758
|
+
icon: /* @__PURE__ */ r(
|
|
759
|
+
Ie,
|
|
760
|
+
{
|
|
761
|
+
"aria-hidden": "true",
|
|
762
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
763
|
+
}
|
|
764
|
+
)
|
|
676
765
|
});
|
|
677
766
|
case "orderedList":
|
|
678
|
-
return
|
|
767
|
+
return p({
|
|
679
768
|
label: o("editor.list.ordered"),
|
|
680
769
|
pressed: e.isActive("orderedList"),
|
|
681
770
|
disabled: i,
|
|
682
771
|
onActivate: () => e.chain().focus().toggleOrderedList().run(),
|
|
683
|
-
icon: /* @__PURE__ */ r(
|
|
772
|
+
icon: /* @__PURE__ */ r(
|
|
773
|
+
Re,
|
|
774
|
+
{
|
|
775
|
+
"aria-hidden": "true",
|
|
776
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
777
|
+
}
|
|
778
|
+
)
|
|
684
779
|
});
|
|
685
780
|
case "quote":
|
|
686
|
-
return
|
|
781
|
+
return p({
|
|
687
782
|
label: o("editor.quote"),
|
|
688
783
|
pressed: e.isActive("blockquote"),
|
|
689
784
|
disabled: i,
|
|
690
785
|
onActivate: () => e.chain().focus().toggleBlockquote().run(),
|
|
691
|
-
icon: /* @__PURE__ */ r(
|
|
786
|
+
icon: /* @__PURE__ */ r(
|
|
787
|
+
$e,
|
|
788
|
+
{
|
|
789
|
+
"aria-hidden": "true",
|
|
790
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
791
|
+
}
|
|
792
|
+
)
|
|
692
793
|
});
|
|
693
794
|
case "image":
|
|
694
|
-
return
|
|
795
|
+
return b({
|
|
695
796
|
label: o("editor.image.insert"),
|
|
696
797
|
disabled: i,
|
|
697
|
-
onActivate:
|
|
698
|
-
icon: /* @__PURE__ */ r(
|
|
798
|
+
onActivate: O,
|
|
799
|
+
icon: /* @__PURE__ */ r(
|
|
800
|
+
Ne,
|
|
801
|
+
{
|
|
802
|
+
"aria-hidden": "true",
|
|
803
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
804
|
+
}
|
|
805
|
+
)
|
|
699
806
|
});
|
|
700
807
|
case "table":
|
|
701
|
-
return
|
|
808
|
+
return b({
|
|
702
809
|
label: o("editor.table.insert"),
|
|
703
810
|
disabled: i,
|
|
704
811
|
onActivate: () => e.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run(),
|
|
705
|
-
icon: /* @__PURE__ */ r(
|
|
812
|
+
icon: /* @__PURE__ */ r(
|
|
813
|
+
qe,
|
|
814
|
+
{
|
|
815
|
+
"aria-hidden": "true",
|
|
816
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
817
|
+
}
|
|
818
|
+
)
|
|
706
819
|
});
|
|
707
820
|
case "codeBlock":
|
|
708
|
-
return
|
|
821
|
+
return p({
|
|
709
822
|
label: o("editor.codeBlock"),
|
|
710
823
|
pressed: e.isActive("codeBlock"),
|
|
711
824
|
disabled: i,
|
|
712
825
|
onActivate: () => e.chain().focus().toggleCodeBlock().run(),
|
|
713
|
-
icon: /* @__PURE__ */ r(
|
|
826
|
+
icon: /* @__PURE__ */ r(
|
|
827
|
+
we,
|
|
828
|
+
{
|
|
829
|
+
"aria-hidden": "true",
|
|
830
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
831
|
+
}
|
|
832
|
+
)
|
|
714
833
|
});
|
|
715
834
|
case "horizontalRule":
|
|
716
|
-
return
|
|
835
|
+
return b({
|
|
717
836
|
label: o("editor.horizontalRule"),
|
|
718
837
|
disabled: i,
|
|
719
838
|
onActivate: () => e.chain().focus().setHorizontalRule().run(),
|
|
720
|
-
icon: /* @__PURE__ */ r(
|
|
839
|
+
icon: /* @__PURE__ */ r(
|
|
840
|
+
Be,
|
|
841
|
+
{
|
|
842
|
+
"aria-hidden": "true",
|
|
843
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
844
|
+
}
|
|
845
|
+
)
|
|
721
846
|
});
|
|
722
847
|
case "undo":
|
|
723
|
-
return
|
|
848
|
+
return b({
|
|
724
849
|
label: o("editor.undo"),
|
|
725
850
|
disabled: i || !e.can().undo(),
|
|
726
851
|
shortcut: "Control+Z Meta+Z",
|
|
727
852
|
onActivate: () => e.chain().focus().undo().run(),
|
|
728
|
-
icon: /* @__PURE__ */ r(
|
|
853
|
+
icon: /* @__PURE__ */ r(
|
|
854
|
+
Ve,
|
|
855
|
+
{
|
|
856
|
+
"aria-hidden": "true",
|
|
857
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
858
|
+
}
|
|
859
|
+
)
|
|
729
860
|
});
|
|
730
861
|
case "redo":
|
|
731
|
-
return
|
|
862
|
+
return b({
|
|
732
863
|
label: o("editor.redo"),
|
|
733
864
|
disabled: i || !e.can().redo(),
|
|
734
865
|
shortcut: "Control+Shift+Z Meta+Shift+Z",
|
|
735
866
|
onActivate: () => e.chain().focus().redo().run(),
|
|
736
|
-
icon: /* @__PURE__ */ r(
|
|
867
|
+
icon: /* @__PURE__ */ r(
|
|
868
|
+
Ee,
|
|
869
|
+
{
|
|
870
|
+
"aria-hidden": "true",
|
|
871
|
+
className: "ds:block-size-4 ds:inline-size-4"
|
|
872
|
+
}
|
|
873
|
+
)
|
|
737
874
|
});
|
|
738
875
|
default:
|
|
739
876
|
return null;
|
|
740
877
|
}
|
|
741
878
|
}
|
|
742
|
-
const
|
|
879
|
+
const te = (() => {
|
|
743
880
|
switch (y) {
|
|
744
881
|
case "sm":
|
|
745
882
|
return "min-block-size-[8rem]";
|
|
@@ -754,9 +891,9 @@ const Xe = te(
|
|
|
754
891
|
return /* @__PURE__ */ k(
|
|
755
892
|
"div",
|
|
756
893
|
{
|
|
757
|
-
id:
|
|
758
|
-
className: [
|
|
759
|
-
dir:
|
|
894
|
+
id: D,
|
|
895
|
+
className: [Ue(), N].filter(Boolean).join(" "),
|
|
896
|
+
dir: v ? "rtl" : void 0,
|
|
760
897
|
"data-component": "rich-text-editor",
|
|
761
898
|
"data-component-id": a,
|
|
762
899
|
children: [
|
|
@@ -765,78 +902,30 @@ const Xe = te(
|
|
|
765
902
|
{
|
|
766
903
|
role: "toolbar",
|
|
767
904
|
"aria-label": o("editor.toolbarLabel"),
|
|
768
|
-
className:
|
|
769
|
-
children:
|
|
905
|
+
className: Ge({ direction: v ? "rtl" : "ltr" }),
|
|
906
|
+
children: q.map((s, t) => /* @__PURE__ */ r("span", { className: "ds:contents", children: ee(s, t) }, s))
|
|
770
907
|
}
|
|
771
908
|
),
|
|
772
909
|
/* @__PURE__ */ r(
|
|
773
910
|
"div",
|
|
774
911
|
{
|
|
775
|
-
className: [
|
|
776
|
-
children: /* @__PURE__ */ r(
|
|
912
|
+
className: [Qe(), te].filter(Boolean).join(" "),
|
|
913
|
+
children: /* @__PURE__ */ r(ne, { editor: e })
|
|
777
914
|
}
|
|
778
915
|
),
|
|
779
|
-
/* @__PURE__ */ r(
|
|
916
|
+
/* @__PURE__ */ r(Je, { open: X, onOpenChange: F })
|
|
780
917
|
]
|
|
781
918
|
}
|
|
782
919
|
);
|
|
783
920
|
}
|
|
784
921
|
);
|
|
785
|
-
|
|
786
|
-
const ht = {
|
|
787
|
-
id: "rich-text-editor",
|
|
788
|
-
capabilities: ["edit_inline"],
|
|
789
|
-
state: {
|
|
790
|
-
html: {
|
|
791
|
-
type: "string",
|
|
792
|
-
description: "Sanitised HTML representation of the editor content.",
|
|
793
|
-
read: (a) => a.getHTML()
|
|
794
|
-
},
|
|
795
|
-
markdown: {
|
|
796
|
-
type: "string",
|
|
797
|
-
description: "Markdown representation of the editor content.",
|
|
798
|
-
read: (a) => a.getMarkdown()
|
|
799
|
-
}
|
|
800
|
-
},
|
|
801
|
-
actions: {
|
|
802
|
-
set_content: {
|
|
803
|
-
safety: "destructive",
|
|
804
|
-
argsType: "{ html: string }",
|
|
805
|
-
description: "Replace the editor content. Loses unsaved input.",
|
|
806
|
-
invoke: (a, v) => {
|
|
807
|
-
a.setContent(v.html);
|
|
808
|
-
}
|
|
809
|
-
},
|
|
810
|
-
clear: {
|
|
811
|
-
safety: "destructive",
|
|
812
|
-
description: "Empty the editor. Loses unsaved input.",
|
|
813
|
-
invoke: (a) => {
|
|
814
|
-
a.clear();
|
|
815
|
-
}
|
|
816
|
-
},
|
|
817
|
-
focus: {
|
|
818
|
-
safety: "read",
|
|
819
|
-
description: "Move keyboard focus to the editor surface.",
|
|
820
|
-
invoke: (a) => {
|
|
821
|
-
a.focus();
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
},
|
|
825
|
-
domHooks: {
|
|
826
|
-
root: { attr: "data-component", value: "rich-text-editor" },
|
|
827
|
-
instanceId: {
|
|
828
|
-
attr: "data-component-id",
|
|
829
|
-
sourceProp: "id",
|
|
830
|
-
description: "Sourced from the id prop."
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
};
|
|
922
|
+
We.displayName = "RichTextEditor";
|
|
834
923
|
export {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
924
|
+
We as R,
|
|
925
|
+
Ge as a,
|
|
926
|
+
Qe as e,
|
|
927
|
+
Pe as r,
|
|
928
|
+
G as t,
|
|
929
|
+
Ue as w
|
|
841
930
|
};
|
|
842
|
-
//# sourceMappingURL=rich-text-editor
|
|
931
|
+
//# sourceMappingURL=rich-text-editor-C7TCIlQO.js.map
|