@alfadocs/ui-kit 0.70.0 → 0.71.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/dist/_chunks/address-fields-CPbFJ8e8.js +246 -0
- package/dist/_chunks/{ai-prompt-input-CuhTo9mh.js → ai-prompt-input-V4DdOeqv.js} +2 -2
- package/dist/_chunks/{alia-sidebar-B47qRQb5.js → alia-sidebar-DvIUzIX9.js} +107 -106
- package/dist/_chunks/{anatomy-scheme-CJB6dI6p.js → anatomy-scheme-CXSk11UJ.js} +2 -2
- package/dist/_chunks/{app-frame-BYx1gcV7.js → app-frame-DIEMIC5V.js} +67 -56
- package/dist/_chunks/{appointment-card-C06aZqA7.js → appointment-card-DVaeJNVB.js} +82 -98
- package/dist/_chunks/{appointment-timeline-BJM0S_Fg.js → appointment-timeline-PJgnrjFb.js} +159 -157
- package/dist/_chunks/{appointment-tray-DRRw5ROi.js → appointment-tray-B16QPGbm.js} +2 -2
- package/dist/_chunks/{audio-recorder-Cpdk5qpQ.js → audio-recorder-DNDsOLqO.js} +2 -2
- package/dist/_chunks/{autocomplete-DOeGouCL.js → autocomplete-BrONKN8l.js} +168 -146
- package/dist/_chunks/{bishop-score-DnYWtZa_.js → bishop-score-Cym_TeQY.js} +2 -2
- package/dist/_chunks/{booking-DUBI0oqt.js → booking-C7do4vaR.js} +4 -4
- package/dist/_chunks/{button-group-Ciq6J4IW.js → button-group-CvEnVzY7.js} +32 -35
- package/dist/_chunks/{care-plan-card-C5sTfY9G.js → care-plan-card-DzPDYgtK.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-CXnxGCWA.js → care-plan-entry-card-CEnQy7YP.js} +3 -3
- package/dist/_chunks/care-plan-header-DcXFXWit.js +198 -0
- package/dist/_chunks/{chat-message-3V54YipB.js → chat-message-DzpcJR-q.js} +25 -23
- package/dist/_chunks/city-input-Dkgaak7I.js +169 -0
- package/dist/_chunks/clipboard-list-S7s-MXQq.js +25 -0
- package/dist/_chunks/{combobox-Clum7gJ1.js → combobox-DnqSF0IH.js} +131 -114
- package/dist/_chunks/connection-status-CY1HV8Wg.js +108 -0
- package/dist/_chunks/control-room-rail-FAQZrGVL.js +333 -0
- package/dist/_chunks/country-select-BwUZQvTa.js +709 -0
- package/dist/_chunks/editable-currency-cell-renderer-CGELrkIj.js +410 -0
- package/dist/_chunks/{entity-card-9_62gY7l.js → entity-card-DmrgYSEX.js} +4 -4
- package/dist/_chunks/entity-summary-CaM1Y-xE.js +291 -0
- package/dist/_chunks/field-array-siUZzfYe.js +146 -0
- package/dist/_chunks/{field-value-NXYczdpO.js → field-value-3jMM0uDx.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CF2ISaYQ.js → gestational-age-calculator-DKzEV5Qi.js} +2 -2
- package/dist/_chunks/iban-input-B0TWzR1R.js +436 -0
- package/dist/_chunks/icon-picker-0B7KhrF1.js +272 -0
- package/dist/_chunks/image-cropper-D9jqJy19.js +367 -0
- package/dist/_chunks/{link-cell-renderer-CTXqtXV-.js → link-cell-renderer-De_SLjSq.js} +262 -261
- package/dist/_chunks/list-checks-BUs75d_o.js +18 -0
- package/dist/_chunks/{marketplace-app-shell-Skhfp6vK.js → marketplace-app-shell-BGqkywsi.js} +3 -3
- package/dist/_chunks/message-card-DsHFFiL1.js +319 -0
- package/dist/_chunks/{message-tray-DwrBLJlf.js → message-tray-C0a6CL1_.js} +172 -135
- package/dist/_chunks/{multi-select-BdHHDrRN.js → multi-select-WE4S9FIF.js} +75 -63
- package/dist/_chunks/nav-grid-9xphY3FM.js +169 -0
- package/dist/_chunks/notes-panel-DXiMfuvp.js +320 -0
- package/dist/_chunks/notification-card-BMqNzCIt.js +290 -0
- package/dist/_chunks/{notification-tray-AEun6DN2.js → notification-tray-BmUlCx3g.js} +201 -166
- package/dist/_chunks/{operator-hero-CR0Rqh4-.js → operator-hero-BO8TqzX2.js} +2 -2
- package/dist/_chunks/panel-header-D313n_9-.js +105 -0
- package/dist/_chunks/{patient-details-Dlhqb5ig.js → patient-details-DgfTJimE.js} +280 -196
- package/dist/_chunks/{patient-search-Be6cLrHR.js → patient-search-CSWQKOSP.js} +2 -2
- package/dist/_chunks/{patient-shell-DV3XEtIB.js → patient-shell-BMwsIKlW.js} +3 -3
- package/dist/_chunks/{patient-summary-card-WySCMwwA.js → patient-summary-card-D4NdgYJB.js} +27 -12
- package/dist/_chunks/{patient-table-CHxf3Oqk.js → patient-table-CERknpd8.js} +3 -3
- package/dist/_chunks/{payment-request-card-BcZJwu9z.js → payment-request-card-Blf-MFNY.js} +2 -2
- package/dist/_chunks/permission-matrix-Bw5oexUt.js +174 -0
- package/dist/_chunks/position-grid-CcvqHaKN.js +169 -0
- package/dist/_chunks/postal-code-input-UCOYuRY2.js +192 -0
- package/dist/_chunks/{practice-results-C6qDfxos.js → practice-results-El5Z-oVp.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-CRVWswD-.js → pregnancy-dating-CunHrOpO.js} +2 -2
- package/dist/_chunks/{product-hub-panel-e6pW220e.js → product-hub-panel-DtU7KXxm.js} +257 -217
- package/dist/_chunks/province-select-D_TZvix3.js +261 -0
- package/dist/_chunks/{public-header.agent-DqkqA-ca.js → public-header.agent-TxmC_x1I.js} +2 -2
- package/dist/_chunks/radiograph-panel.agent-tWjN2nHX.js +553 -0
- package/dist/_chunks/reviews-panel-DxkSrgMl.js +559 -0
- package/dist/_chunks/rich-text-editor-C8tyGjfb.js +2621 -0
- package/dist/_chunks/{scroll-area-5wNK0Cyz.js → scroll-area-BZOvUhwQ.js} +2 -2
- package/dist/_chunks/{select-DMLG44F5.js → select-KsyRr8WH.js} +114 -102
- package/dist/_chunks/{sheet-BxsE7eQm.js → sheet-umkfZjF6.js} +53 -42
- package/dist/_chunks/{sidebar-DY9jGjgt.js → sidebar-QCp9wHNP.js} +125 -113
- package/dist/_chunks/{tabs-BxcOziCo.js → tabs-CYZVKKDl.js} +2 -2
- package/dist/_chunks/task-card-DCdsI0ZT.js +189 -0
- package/dist/_chunks/{task-tray-qOEQflu4.js → task-tray-DNVejijD.js} +2 -2
- package/dist/_chunks/tasks-panel-C9odmawT.js +757 -0
- package/dist/_chunks/token-insert-menu-CFQqTe_n.js +147 -0
- package/dist/_chunks/{ai-tools-rail-B5NEghsp.js → tool-rail-BZx0-yIr.js} +152 -139
- package/dist/_chunks/{tooth-scheme-BhQoPNBD.js → tooth-scheme-DJZtzfeY.js} +470 -468
- package/dist/_chunks/{transcript-panel-3THQX6nJ.js → transcript-panel-CHGHHHdT.js} +95 -83
- package/dist/_chunks/{unit-converter-YEpD9evj.js → unit-converter-CwlZbfdn.js} +2 -2
- package/dist/_chunks/{workflow-map-Dy8mLCqF.js → workflow-map-M8MBBHQm.js} +106 -118
- package/dist/agent-catalog.json +2062 -226
- package/dist/agent-i18n/en.json +206 -8
- package/dist/components/_shared/option.d.ts +2 -0
- package/dist/components/_shared/patient-fields.d.ts +1 -1
- package/dist/components/address-fields/address-fields.agent.d.ts +9 -0
- package/dist/components/address-fields/address-fields.d.ts +29 -0
- package/dist/components/address-fields/index.d.ts +5 -0
- package/dist/components/address-fields/index.js +6 -0
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/anatomy-scheme/index.js +1 -1
- package/dist/components/app-frame/app-frame.d.ts +2 -2
- package/dist/components/app-frame/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +10 -0
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/care-plan-header.d.ts +16 -5
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/city-input/city-input.agent.d.ts +8 -0
- package/dist/components/city-input/city-input.d.ts +57 -0
- package/dist/components/city-input/index.d.ts +5 -0
- package/dist/components/city-input/index.js +6 -0
- package/dist/components/combobox/combobox.d.ts +17 -0
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/connection-status/connection-status.agent.d.ts +4 -0
- package/dist/components/connection-status/connection-status.d.ts +36 -0
- package/dist/components/connection-status/index.d.ts +4 -0
- package/dist/components/connection-status/index.js +6 -0
- package/dist/components/control-room-rail/control-room-context.d.ts +5 -5
- package/dist/components/control-room-rail/control-room-rail.agent.d.ts +4 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts +5 -5
- package/dist/components/control-room-rail/index.d.ts +1 -0
- package/dist/components/control-room-rail/index.js +4 -3
- package/dist/components/counter/counter.d.ts +1 -1
- package/dist/components/country-select/country-select.agent.d.ts +8 -0
- package/dist/components/country-select/country-select.d.ts +51 -0
- package/dist/components/country-select/index.d.ts +6 -0
- package/dist/components/country-select/index.js +9 -0
- package/dist/components/country-select/iso-3166.d.ts +15 -0
- package/dist/components/data-table/cell-renderers/reorder-cell-renderer.d.ts +34 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +13 -11
- package/dist/components/entity-summary/entity-summary.agent.d.ts +4 -0
- package/dist/components/entity-summary/entity-summary.d.ts +53 -4
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/field-array/field-array.agent.d.ts +4 -0
- package/dist/components/field-array/field-array.d.ts +45 -0
- package/dist/components/field-array/index.d.ts +4 -0
- package/dist/components/field-array/index.js +6 -0
- package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/iban-input/iban-input.agent.d.ts +4 -0
- package/dist/components/iban-input/iban-input.d.ts +51 -0
- package/dist/components/iban-input/index.d.ts +5 -0
- package/dist/components/iban-input/index.js +13 -0
- package/dist/components/iban-input/is-valid-iban.d.ts +31 -0
- package/dist/components/icon-picker/icon-picker.agent.d.ts +4 -0
- package/dist/components/icon-picker/icon-picker.d.ts +41 -0
- package/dist/components/icon-picker/index.d.ts +4 -0
- package/dist/components/icon-picker/index.js +6 -0
- package/dist/components/image-cropper/crop-geometry.d.ts +30 -0
- package/dist/components/image-cropper/image-cropper.agent.d.ts +4 -0
- package/dist/components/image-cropper/image-cropper.d.ts +32 -0
- package/dist/components/image-cropper/index.d.ts +5 -0
- package/dist/components/image-cropper/index.js +11 -0
- package/dist/components/index.d.ts +16 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-card/message-card.d.ts +14 -0
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts +4 -0
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/nav-grid/index.d.ts +4 -0
- package/dist/components/nav-grid/index.js +7 -0
- package/dist/components/nav-grid/nav-grid.agent.d.ts +4 -0
- package/dist/components/nav-grid/nav-grid.d.ts +41 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.agent.d.ts +4 -0
- package/dist/components/notes-panel/notes-panel.d.ts +30 -0
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-card/notification-card.d.ts +15 -0
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts +4 -0
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/panel-header/index.d.ts +3 -0
- package/dist/components/panel-header/index.js +7 -0
- package/dist/components/panel-header/panel-header.d.ts +41 -0
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/permission-matrix/index.d.ts +4 -0
- package/dist/components/permission-matrix/index.js +7 -0
- package/dist/components/permission-matrix/permission-matrix.agent.d.ts +4 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts +47 -0
- package/dist/components/position-grid/index.d.ts +4 -0
- package/dist/components/position-grid/index.js +7 -0
- package/dist/components/position-grid/position-grid.agent.d.ts +4 -0
- package/dist/components/position-grid/position-grid.d.ts +39 -0
- package/dist/components/postal-code-input/index.d.ts +5 -0
- package/dist/components/postal-code-input/index.js +6 -0
- package/dist/components/postal-code-input/postal-code-input.agent.d.ts +8 -0
- package/dist/components/postal-code-input/postal-code-input.d.ts +27 -0
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/product-hub-tray/product-hub-tray.d.ts +13 -1
- package/dist/components/province-select/index.d.ts +6 -0
- package/dist/components/province-select/index.js +7 -0
- package/dist/components/province-select/it-provinces.d.ts +8 -0
- package/dist/components/province-select/province-select.agent.d.ts +8 -0
- package/dist/components/province-select/province-select.d.ts +38 -0
- package/dist/components/public-footer/public-footer.d.ts +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +17 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +8 -2
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-card/task-card.d.ts +14 -6
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.d.ts +4 -0
- package/dist/components/tasks-panel/index.js +6 -0
- package/dist/components/tasks-panel/tasks-panel.agent.d.ts +4 -0
- package/dist/components/tasks-panel/tasks-panel.d.ts +152 -0
- package/dist/components/token-insert-menu/index.d.ts +4 -0
- package/dist/components/token-insert-menu/index.js +6 -0
- package/dist/components/token-insert-menu/token-insert-menu.agent.d.ts +4 -0
- package/dist/components/token-insert-menu/token-insert-menu.d.ts +33 -0
- package/dist/components/tool-rail/index.d.ts +4 -0
- package/dist/components/tool-rail/index.js +6 -0
- package/dist/components/tool-rail/tool-rail.agent.d.ts +4 -0
- package/dist/components/{ai-tools-rail/ai-tools-rail.d.ts → tool-rail/tool-rail.d.ts} +29 -12
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/tooth-scheme/tooth-scheme.d.ts +9 -0
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/transcript-panel/transcript-panel.d.ts +2 -2
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/use-edge-resize.d.ts +2 -2
- package/dist/i18n/locales/ar.d.ts +167 -2
- package/dist/i18n/locales/ar.js +157 -5
- package/dist/i18n/locales/de.d.ts +167 -2
- package/dist/i18n/locales/de.js +159 -5
- package/dist/i18n/locales/el.d.ts +167 -2
- package/dist/i18n/locales/el.js +164 -5
- package/dist/i18n/locales/en.d.ts +167 -2
- package/dist/i18n/locales/en.js +170 -5
- package/dist/i18n/locales/es.d.ts +167 -2
- package/dist/i18n/locales/es.js +156 -5
- package/dist/i18n/locales/fr.d.ts +167 -2
- package/dist/i18n/locales/fr.js +159 -5
- package/dist/i18n/locales/hi.d.ts +167 -2
- package/dist/i18n/locales/hi.js +155 -5
- package/dist/i18n/locales/it.d.ts +167 -2
- package/dist/i18n/locales/it.js +159 -5
- package/dist/i18n/locales/ja.d.ts +167 -2
- package/dist/i18n/locales/ja.js +160 -5
- package/dist/i18n/locales/nl.d.ts +167 -2
- package/dist/i18n/locales/nl.js +152 -5
- package/dist/i18n/locales/pl.d.ts +167 -2
- package/dist/i18n/locales/pl.js +160 -5
- package/dist/i18n/locales/pt.d.ts +167 -2
- package/dist/i18n/locales/pt.js +164 -5
- package/dist/i18n/locales/ro.d.ts +167 -2
- package/dist/i18n/locales/ro.js +164 -5
- package/dist/i18n/locales/ru.d.ts +167 -2
- package/dist/i18n/locales/ru.js +157 -5
- package/dist/i18n/locales/sq.d.ts +167 -2
- package/dist/i18n/locales/sq.js +161 -5
- package/dist/i18n/locales/sv.d.ts +167 -2
- package/dist/i18n/locales/sv.js +159 -5
- package/dist/i18n/locales/tr.d.ts +167 -2
- package/dist/i18n/locales/tr.js +157 -5
- package/dist/i18n/locales/zh.d.ts +167 -2
- package/dist/i18n/locales/zh.js +152 -5
- package/dist/index.js +823 -755
- package/dist/locales/ar.json +170 -5
- package/dist/locales/de.json +170 -5
- package/dist/locales/el.json +170 -5
- package/dist/locales/en.json +170 -5
- package/dist/locales/es.json +170 -5
- package/dist/locales/fr.json +170 -5
- package/dist/locales/hi.json +170 -5
- package/dist/locales/it.json +170 -5
- package/dist/locales/ja.json +170 -5
- package/dist/locales/nl.json +170 -5
- package/dist/locales/pl.json +170 -5
- package/dist/locales/pt.json +170 -5
- package/dist/locales/ro.json +170 -5
- package/dist/locales/ru.json +170 -5
- package/dist/locales/sq.json +170 -5
- package/dist/locales/sv.json +170 -5
- package/dist/locales/tr.json +170 -5
- package/dist/locales/zh.json +170 -5
- package/dist/patterns/alia-assistant/alia-types.d.ts +9 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +9 -1
- package/package.json +65 -5
- package/dist/_chunks/care-plan-header-BUwqDTtz.js +0 -206
- package/dist/_chunks/control-room-rail-Y8ryLYsP.js +0 -229
- package/dist/_chunks/editable-currency-cell-renderer-C9twtALM.js +0 -328
- package/dist/_chunks/entity-summary-BxRjFh_4.js +0 -138
- package/dist/_chunks/message-card-Bx4GmLvf.js +0 -277
- package/dist/_chunks/notes-panel-ay8_lPrA.js +0 -158
- package/dist/_chunks/notification-card-D2jiKSJJ.js +0 -259
- package/dist/_chunks/radiograph-panel.agent-CAX-C3g3.js +0 -558
- package/dist/_chunks/reviews-panel-Dq7LMDcH.js +0 -555
- package/dist/_chunks/rich-text-editor-DlCqPixb.js +0 -2158
- package/dist/_chunks/task-card-BwY9jaV1.js +0 -124
- package/dist/components/ai-tools-rail/ai-tools-rail.agent.d.ts +0 -4
- package/dist/components/ai-tools-rail/index.d.ts +0 -4
- package/dist/components/ai-tools-rail/index.js +0 -6
|
@@ -1,2158 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as y, Fragment as De } from "react/jsx-runtime";
|
|
2
|
-
import { useId as de, useState as T, useRef as $, useCallback as C, useEffect as W, Fragment as at, forwardRef as Tt, useMemo as et, useImperativeHandle as zt } from "react";
|
|
3
|
-
import { c as je } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as Z } from "react-i18next";
|
|
5
|
-
import { SafeHtml as Mt, sanitiseHtml as _t } from "../safe-html/index.js";
|
|
6
|
-
import { u as Rt } from "./registry-DvAUVLHh.js";
|
|
7
|
-
import { S as it } from "./spinner-hbwuKwMf.js";
|
|
8
|
-
import { I as B } from "./icon-button-LqoiKcUN.js";
|
|
9
|
-
import { T as St } from "./text-area-Bt3p7Pt0.js";
|
|
10
|
-
import { E as At } from "./editor-overlay-wYm22wZK.js";
|
|
11
|
-
import { X as tt } from "./x-CCcI3eJp.js";
|
|
12
|
-
import { R as Et } from "./rotate-ccw-BWANpitO.js";
|
|
13
|
-
import { C as Ht } from "./check-DPdL_Sm7.js";
|
|
14
|
-
import { S as _e } from "./square-CZoGU14v.js";
|
|
15
|
-
import { M as lt } from "./mic-B4Gog3Gi.js";
|
|
16
|
-
import { S as It } from "./send-CySZIRPJ.js";
|
|
17
|
-
import { B as oe } from "./button-DD_0Xdmr.js";
|
|
18
|
-
import { a as Lt } from "./tooltip-DvmfrNvB.js";
|
|
19
|
-
import { P as F } from "./popover-B2qCDhJC.js";
|
|
20
|
-
import { D as ze } from "./dropdown-menu-qrxjymfw.js";
|
|
21
|
-
import { D as P } from "./dialog-ZNuboNmy.js";
|
|
22
|
-
import { C as Pe } from "./color-picker-C_fZl6sA.js";
|
|
23
|
-
import { T as Re } from "./text-input-B-OWQ1Je.js";
|
|
24
|
-
import { C as $t } from "./checkbox-BuZ1u__2.js";
|
|
25
|
-
import { F as Ot } from "./file-upload-DwZcAK8D.js";
|
|
26
|
-
import { c as M } from "./createLucideIcon-CrFbzy84.js";
|
|
27
|
-
import { C as qt } from "./chevron-down-BX_NP2Yh.js";
|
|
28
|
-
import { I as Dt } from "./image-C6RM5hfF.js";
|
|
29
|
-
import { C as jt } from "./columns-2-BTOBZbep.js";
|
|
30
|
-
import { T as Pt } from "./trash-2-rPAKaRgB.js";
|
|
31
|
-
import { S as Bt } from "./sparkles-CuYXqQLg.js";
|
|
32
|
-
/**
|
|
33
|
-
* @license lucide-react v1.8.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/
|
|
38
|
-
const Ft = [
|
|
39
|
-
["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
|
|
40
|
-
["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
|
|
41
|
-
["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
|
|
42
|
-
], Vt = M("between-horizontal-end", Ft);
|
|
43
|
-
/**
|
|
44
|
-
* @license lucide-react v1.8.0 - ISC
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the ISC license.
|
|
47
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/
|
|
49
|
-
const Kt = [
|
|
50
|
-
["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
|
|
51
|
-
["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
|
|
52
|
-
["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
|
|
53
|
-
], Gt = M("between-horizontal-start", Kt);
|
|
54
|
-
/**
|
|
55
|
-
* @license lucide-react v1.8.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/
|
|
60
|
-
const Wt = [
|
|
61
|
-
["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
|
|
62
|
-
["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
|
|
63
|
-
["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
|
|
64
|
-
], Ut = M("between-vertical-end", Wt);
|
|
65
|
-
/**
|
|
66
|
-
* @license lucide-react v1.8.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/
|
|
71
|
-
const Xt = [
|
|
72
|
-
["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
|
|
73
|
-
["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
|
|
74
|
-
["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
|
|
75
|
-
], Qt = M("between-vertical-start", Xt);
|
|
76
|
-
/**
|
|
77
|
-
* @license lucide-react v1.8.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/
|
|
82
|
-
const Zt = [
|
|
83
|
-
[
|
|
84
|
-
"path",
|
|
85
|
-
{ 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" }
|
|
86
|
-
]
|
|
87
|
-
], Yt = M("bold", Zt);
|
|
88
|
-
/**
|
|
89
|
-
* @license lucide-react v1.8.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/
|
|
94
|
-
const Jt = [
|
|
95
|
-
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
96
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
97
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
98
|
-
["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
|
|
99
|
-
], er = M("heading-2", Jt);
|
|
100
|
-
/**
|
|
101
|
-
* @license lucide-react v1.8.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/
|
|
106
|
-
const tr = [
|
|
107
|
-
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
108
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
109
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
110
|
-
["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
|
|
111
|
-
["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
|
|
112
|
-
], rr = M("heading-3", tr);
|
|
113
|
-
/**
|
|
114
|
-
* @license lucide-react v1.8.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/
|
|
119
|
-
const nr = [
|
|
120
|
-
["path", { d: "m9 11-6 6v3h9l3-3", key: "1a3l36" }],
|
|
121
|
-
["path", { d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4", key: "14a9rk" }]
|
|
122
|
-
], or = M("highlighter", nr);
|
|
123
|
-
/**
|
|
124
|
-
* @license lucide-react v1.8.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/
|
|
129
|
-
const ar = [
|
|
130
|
-
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
131
|
-
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
132
|
-
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
133
|
-
], ir = M("italic", ar);
|
|
134
|
-
/**
|
|
135
|
-
* @license lucide-react v1.8.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/
|
|
140
|
-
const lr = [
|
|
141
|
-
["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
|
|
142
|
-
["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
|
|
143
|
-
], sr = M("link", lr);
|
|
144
|
-
/**
|
|
145
|
-
* @license lucide-react v1.8.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/
|
|
150
|
-
const dr = [
|
|
151
|
-
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
152
|
-
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
153
|
-
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
154
|
-
["path", { d: "M4 4h1v5", key: "10yrso" }],
|
|
155
|
-
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
156
|
-
["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" }]
|
|
157
|
-
], cr = M("list-ordered", dr);
|
|
158
|
-
/**
|
|
159
|
-
* @license lucide-react v1.8.0 - ISC
|
|
160
|
-
*
|
|
161
|
-
* This source code is licensed under the ISC license.
|
|
162
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/
|
|
164
|
-
const ur = [
|
|
165
|
-
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
166
|
-
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
167
|
-
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
168
|
-
["path", { d: "M8 5h13", key: "1pao27" }],
|
|
169
|
-
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
170
|
-
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
171
|
-
], mr = M("list", ur);
|
|
172
|
-
/**
|
|
173
|
-
* @license lucide-react v1.8.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/
|
|
178
|
-
const hr = [
|
|
179
|
-
["path", { d: "M11 7 6 2", key: "1jwth8" }],
|
|
180
|
-
["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
|
|
181
|
-
[
|
|
182
|
-
"path",
|
|
183
|
-
{
|
|
184
|
-
d: "M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595",
|
|
185
|
-
key: "1nkol4"
|
|
186
|
-
}
|
|
187
|
-
],
|
|
188
|
-
[
|
|
189
|
-
"path",
|
|
190
|
-
{
|
|
191
|
-
d: "m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33",
|
|
192
|
-
key: "1nk1rd"
|
|
193
|
-
}
|
|
194
|
-
]
|
|
195
|
-
], fr = M("paint-bucket", hr);
|
|
196
|
-
/**
|
|
197
|
-
* @license lucide-react v1.8.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/
|
|
202
|
-
const gr = [
|
|
203
|
-
["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
|
|
204
|
-
["path", { d: "M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2", key: "1b9h7c" }],
|
|
205
|
-
["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
|
|
206
|
-
], pr = M("paint-roller", gr);
|
|
207
|
-
/**
|
|
208
|
-
* @license lucide-react v1.8.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/
|
|
213
|
-
const br = [
|
|
214
|
-
[
|
|
215
|
-
"path",
|
|
216
|
-
{
|
|
217
|
-
d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
|
|
218
|
-
key: "e79jfc"
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
|
|
222
|
-
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
223
|
-
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
224
|
-
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
225
|
-
], yr = M("palette", br);
|
|
226
|
-
/**
|
|
227
|
-
* @license lucide-react v1.8.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/
|
|
232
|
-
const vr = [
|
|
233
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
234
|
-
["path", { d: "M14 9h1", key: "l0svgy" }],
|
|
235
|
-
["path", { d: "M19 9h2", key: "te2zfg" }],
|
|
236
|
-
["path", { d: "M3 9h2", key: "1h4ldw" }],
|
|
237
|
-
["path", { d: "M9 9h1", key: "15jzuz" }]
|
|
238
|
-
], kr = M("panel-top-dashed", vr);
|
|
239
|
-
/**
|
|
240
|
-
* @license lucide-react v1.8.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/
|
|
245
|
-
const wr = [
|
|
246
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
247
|
-
["path", { d: "M3 9h18", key: "1pudct" }]
|
|
248
|
-
], xr = M("panel-top", wr);
|
|
249
|
-
/**
|
|
250
|
-
* @license lucide-react v1.8.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/
|
|
255
|
-
const Cr = [
|
|
256
|
-
["path", { d: "M13 4v16", key: "8vvj80" }],
|
|
257
|
-
["path", { d: "M17 4v16", key: "7dpous" }],
|
|
258
|
-
["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
|
|
259
|
-
], Nr = M("pilcrow", Cr);
|
|
260
|
-
/**
|
|
261
|
-
* @license lucide-react v1.8.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/
|
|
266
|
-
const Tr = [
|
|
267
|
-
[
|
|
268
|
-
"path",
|
|
269
|
-
{
|
|
270
|
-
d: "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
|
|
271
|
-
key: "rib7q0"
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
[
|
|
275
|
-
"path",
|
|
276
|
-
{
|
|
277
|
-
d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
|
|
278
|
-
key: "1ymkrd"
|
|
279
|
-
}
|
|
280
|
-
]
|
|
281
|
-
], zr = M("quote", Tr);
|
|
282
|
-
/**
|
|
283
|
-
* @license lucide-react v1.8.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/
|
|
288
|
-
const Mr = [
|
|
289
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
290
|
-
["path", { d: "M3 12h18", key: "1i2n21" }]
|
|
291
|
-
], _r = M("rows-2", Mr);
|
|
292
|
-
/**
|
|
293
|
-
* @license lucide-react v1.8.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/
|
|
298
|
-
const Rr = [
|
|
299
|
-
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
300
|
-
["path", { d: "M8 12h8", key: "1wcyev" }],
|
|
301
|
-
["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
|
|
302
|
-
], Sr = M("spell-check", Rr);
|
|
303
|
-
/**
|
|
304
|
-
* @license lucide-react v1.8.0 - ISC
|
|
305
|
-
*
|
|
306
|
-
* This source code is licensed under the ISC license.
|
|
307
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
-
*/
|
|
309
|
-
const Ar = [
|
|
310
|
-
["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
|
|
311
|
-
["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
|
|
312
|
-
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
|
|
313
|
-
], Er = M("strikethrough", Ar);
|
|
314
|
-
/**
|
|
315
|
-
* @license lucide-react v1.8.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/
|
|
320
|
-
const Hr = [
|
|
321
|
-
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
322
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
323
|
-
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
324
|
-
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
325
|
-
], Ir = M("table", Hr);
|
|
326
|
-
/**
|
|
327
|
-
* @license lucide-react v1.8.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/
|
|
332
|
-
const Lr = [
|
|
333
|
-
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
|
|
334
|
-
["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
|
|
335
|
-
], $r = M("underline", Lr);
|
|
336
|
-
/**
|
|
337
|
-
* @license lucide-react v1.8.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/
|
|
342
|
-
const Or = [
|
|
343
|
-
[
|
|
344
|
-
"path",
|
|
345
|
-
{
|
|
346
|
-
d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
|
|
347
|
-
key: "ul74o6"
|
|
348
|
-
}
|
|
349
|
-
],
|
|
350
|
-
["path", { d: "m14 7 3 3", key: "1r5n42" }],
|
|
351
|
-
["path", { d: "M5 6v4", key: "ilb8ba" }],
|
|
352
|
-
["path", { d: "M19 14v4", key: "blhpug" }],
|
|
353
|
-
["path", { d: "M10 2v2", key: "7u0qdc" }],
|
|
354
|
-
["path", { d: "M7 8H3", key: "zfb6yr" }],
|
|
355
|
-
["path", { d: "M21 16h-4", key: "1cnmox" }],
|
|
356
|
-
["path", { d: "M11 3H9", key: "1obp7u" }]
|
|
357
|
-
], qr = M("wand-sparkles", Or);
|
|
358
|
-
/**
|
|
359
|
-
* @license lucide-react v1.8.0 - ISC
|
|
360
|
-
*
|
|
361
|
-
* This source code is licensed under the ISC license.
|
|
362
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
-
*/
|
|
364
|
-
const Dr = [
|
|
365
|
-
[
|
|
366
|
-
"path",
|
|
367
|
-
{
|
|
368
|
-
d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
|
|
369
|
-
key: "1ngwbx"
|
|
370
|
-
}
|
|
371
|
-
]
|
|
372
|
-
], jr = M("wrench", Dr), Pr = {
|
|
373
|
-
id: "rich-text-editor",
|
|
374
|
-
capabilities: ["edit_inline"],
|
|
375
|
-
state: {
|
|
376
|
-
html: {
|
|
377
|
-
type: "string",
|
|
378
|
-
descriptionKey: "ui.agent.richTextEditor.state.html",
|
|
379
|
-
description: "Sanitised HTML representation of the editor content.",
|
|
380
|
-
read: (o) => o.getHTML()
|
|
381
|
-
},
|
|
382
|
-
text: {
|
|
383
|
-
type: "string",
|
|
384
|
-
descriptionKey: "ui.agent.richTextEditor.state.text",
|
|
385
|
-
description: "Plain-text content of the editor (tags stripped).",
|
|
386
|
-
read: (o) => o.getText()
|
|
387
|
-
},
|
|
388
|
-
markdown: {
|
|
389
|
-
type: "string",
|
|
390
|
-
descriptionKey: "ui.agent.richTextEditor.state.markdown",
|
|
391
|
-
description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
|
|
392
|
-
read: (o) => o.getMarkdown()
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
actions: {
|
|
396
|
-
set_content: {
|
|
397
|
-
// Replaces the whole document — discards whatever the user had typed.
|
|
398
|
-
safety: "destructive",
|
|
399
|
-
argsType: "{ html: string }",
|
|
400
|
-
argsSchema: {
|
|
401
|
-
type: "object",
|
|
402
|
-
properties: {
|
|
403
|
-
html: {
|
|
404
|
-
type: "string",
|
|
405
|
-
description: "Replacement HTML (sanitised via DOMPurify)."
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
required: ["html"]
|
|
409
|
-
},
|
|
410
|
-
idempotent: !0,
|
|
411
|
-
descriptionKey: "ui.agent.richTextEditor.actions.setContent",
|
|
412
|
-
description: "Replace the editor content. Loses unsaved input.",
|
|
413
|
-
invoke: (o, a) => {
|
|
414
|
-
o.setContent(a.html);
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
insert_at_cursor: {
|
|
418
|
-
// Reversible via the editor's own undo stack — write, not destructive.
|
|
419
|
-
safety: "write",
|
|
420
|
-
argsType: "{ content: string; asHtml?: boolean }",
|
|
421
|
-
argsSchema: {
|
|
422
|
-
type: "object",
|
|
423
|
-
properties: {
|
|
424
|
-
content: {
|
|
425
|
-
type: "string",
|
|
426
|
-
description: "Content to insert at the caret."
|
|
427
|
-
},
|
|
428
|
-
asHtml: {
|
|
429
|
-
type: "boolean",
|
|
430
|
-
description: "Treat content as HTML (sanitised). Pass false for plain text. Defaults to true."
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
required: ["content"]
|
|
434
|
-
},
|
|
435
|
-
descriptionKey: "ui.agent.richTextEditor.actions.insertAtCursor",
|
|
436
|
-
description: "Insert content at the caret (replacing any selection). HTML is sanitised; pass asHtml:false for plain text. Seam for merge/template variables and AI-generated drafts.",
|
|
437
|
-
examples: [
|
|
438
|
-
{
|
|
439
|
-
args: { content: "{{patient.firstName}}", asHtml: !1 },
|
|
440
|
-
note: "Insert a merge variable as plain text."
|
|
441
|
-
}
|
|
442
|
-
],
|
|
443
|
-
invoke: (o, a) => {
|
|
444
|
-
o.insertAtCursor(a.content, { asHtml: a.asHtml });
|
|
445
|
-
}
|
|
446
|
-
},
|
|
447
|
-
apply_format: {
|
|
448
|
-
// Reversible via undo — write, not destructive.
|
|
449
|
-
safety: "write",
|
|
450
|
-
argsType: "{ format: 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph' }",
|
|
451
|
-
argsSchema: {
|
|
452
|
-
type: "object",
|
|
453
|
-
properties: {
|
|
454
|
-
format: {
|
|
455
|
-
type: "string",
|
|
456
|
-
enum: [
|
|
457
|
-
"bold",
|
|
458
|
-
"italic",
|
|
459
|
-
"strikethrough",
|
|
460
|
-
"bulletedList",
|
|
461
|
-
"numberedList",
|
|
462
|
-
"heading",
|
|
463
|
-
"quote",
|
|
464
|
-
"paragraph"
|
|
465
|
-
],
|
|
466
|
-
description: "Block or inline format to toggle/apply."
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
required: ["format"]
|
|
470
|
-
},
|
|
471
|
-
descriptionKey: "ui.agent.richTextEditor.actions.applyFormat",
|
|
472
|
-
description: "Toggle/apply a block or inline format on the current selection (bold, italic, strikethrough, bulleted/numbered list, heading, quote, paragraph).",
|
|
473
|
-
examples: [{ args: { format: "bold" }, note: "Bold the selection." }],
|
|
474
|
-
invoke: (o, a) => {
|
|
475
|
-
o.applyFormat(a.format);
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
clear: {
|
|
479
|
-
// Empties the document — loses unsaved input.
|
|
480
|
-
safety: "destructive",
|
|
481
|
-
idempotent: !0,
|
|
482
|
-
descriptionKey: "ui.agent.richTextEditor.actions.clear",
|
|
483
|
-
description: "Empty the editor. Loses unsaved input.",
|
|
484
|
-
invoke: (o) => {
|
|
485
|
-
o.clear();
|
|
486
|
-
}
|
|
487
|
-
},
|
|
488
|
-
focus: {
|
|
489
|
-
safety: "read",
|
|
490
|
-
idempotent: !0,
|
|
491
|
-
descriptionKey: "ui.agent.richTextEditor.actions.focus",
|
|
492
|
-
description: "Move keyboard focus to the editor surface.",
|
|
493
|
-
invoke: (o) => {
|
|
494
|
-
o.focus();
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
domHooks: {
|
|
499
|
-
root: { attr: "data-component", value: "rich-text-editor" },
|
|
500
|
-
instanceId: {
|
|
501
|
-
attr: "data-component-id",
|
|
502
|
-
sourceProp: "id",
|
|
503
|
-
description: "Sourced from the id prop."
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}, Br = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", se = "ds:!size-[var(--min-target-size)]", Fr = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Vr = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", rt = [
|
|
507
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
508
|
-
"ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
|
|
509
|
-
"ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
|
|
510
|
-
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]"
|
|
511
|
-
].join(" ");
|
|
512
|
-
function nt(o, a) {
|
|
513
|
-
return a ? o ? /\s$/.test(o) ? `${o}${a}` : `${o} ${a}` : a : o;
|
|
514
|
-
}
|
|
515
|
-
function Kr({
|
|
516
|
-
open: o,
|
|
517
|
-
onClose: a,
|
|
518
|
-
onRequestAiDraft: c,
|
|
519
|
-
onInsert: s,
|
|
520
|
-
previewAsHtml: d = !0,
|
|
521
|
-
privacyNotice: g,
|
|
522
|
-
onDictate: p
|
|
523
|
-
}) {
|
|
524
|
-
const { t: l } = Z(), b = de(), v = de(), [z, I] = T(""), [S, x] = T(!1), [O, m] = T(!1), [f, k] = T(null), A = $(null), [_, E] = T(!1), [Y, L] = T(""), [q, H] = T(""), J = $(null), ee = C(() => {
|
|
525
|
-
var w;
|
|
526
|
-
(w = J.current) == null || w.abort();
|
|
527
|
-
}, []), me = C(() => {
|
|
528
|
-
if (!p) return;
|
|
529
|
-
const w = new AbortController();
|
|
530
|
-
J.current = w, E(!0), L(""), H(l("editor.ai.listening")), p({
|
|
531
|
-
signal: w.signal,
|
|
532
|
-
onPartialTranscript: (D) => {
|
|
533
|
-
w.signal.aborted || L(D);
|
|
534
|
-
},
|
|
535
|
-
onFinalTranscript: (D) => {
|
|
536
|
-
if (w.signal.aborted) return;
|
|
537
|
-
const j = D.trim();
|
|
538
|
-
L(""), j && (I((U) => nt(U, j)), H(j));
|
|
539
|
-
}
|
|
540
|
-
}).catch(() => {
|
|
541
|
-
}).finally(() => {
|
|
542
|
-
L(""), J.current === w && (J.current = null, E(!1), H(""));
|
|
543
|
-
});
|
|
544
|
-
}, [p, l]), R = C(() => {
|
|
545
|
-
_ ? ee() : me();
|
|
546
|
-
}, [_, me, ee]);
|
|
547
|
-
W(() => {
|
|
548
|
-
var w, D;
|
|
549
|
-
o ? (I(""), x(!1), m(!1), k(null), L(""), H("")) : ((w = A.current) == null || w.abort(), A.current = null, (D = J.current) == null || D.abort());
|
|
550
|
-
}, [o]), W(
|
|
551
|
-
() => () => {
|
|
552
|
-
var w, D;
|
|
553
|
-
(w = A.current) == null || w.abort(), (D = J.current) == null || D.abort();
|
|
554
|
-
},
|
|
555
|
-
[]
|
|
556
|
-
);
|
|
557
|
-
const G = C(() => {
|
|
558
|
-
var j;
|
|
559
|
-
const w = z.trim();
|
|
560
|
-
if (!w || S) return;
|
|
561
|
-
ee(), (j = A.current) == null || j.abort();
|
|
562
|
-
const D = new AbortController();
|
|
563
|
-
A.current = D, m(!1), x(!0), c({ prompt: w, signal: D.signal }).then((U) => {
|
|
564
|
-
D.signal.aborted || (k(U), x(!1));
|
|
565
|
-
}).catch((U) => {
|
|
566
|
-
D.signal.aborted || U && typeof U == "object" && "name" in U && U.name === "AbortError" || (m(!0), x(!1));
|
|
567
|
-
});
|
|
568
|
-
}, [z, S, c, ee]), K = C(() => {
|
|
569
|
-
f != null && (s(f), a());
|
|
570
|
-
}, [f, s, a]), he = f != null, fe = _ ? nt(z, Y) : z;
|
|
571
|
-
return /* @__PURE__ */ e(
|
|
572
|
-
At,
|
|
573
|
-
{
|
|
574
|
-
open: o,
|
|
575
|
-
onClose: a,
|
|
576
|
-
ariaLabel: l("editor.ai.dialogTitle"),
|
|
577
|
-
children: he ? /* @__PURE__ */ y("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-sm)]", children: [
|
|
578
|
-
/* @__PURE__ */ e(
|
|
579
|
-
B,
|
|
580
|
-
{
|
|
581
|
-
size: "md",
|
|
582
|
-
intent: "outline",
|
|
583
|
-
className: se,
|
|
584
|
-
icon: /* @__PURE__ */ e(tt, {}),
|
|
585
|
-
"aria-label": l("common.close"),
|
|
586
|
-
onClick: a
|
|
587
|
-
}
|
|
588
|
-
),
|
|
589
|
-
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: d ? /* @__PURE__ */ e(
|
|
590
|
-
Mt,
|
|
591
|
-
{
|
|
592
|
-
html: f,
|
|
593
|
-
profile: "rich-text",
|
|
594
|
-
className: rt,
|
|
595
|
-
tabIndex: 0,
|
|
596
|
-
"aria-label": l("editor.ai.dialogTitle")
|
|
597
|
-
}
|
|
598
|
-
) : (
|
|
599
|
-
// Focusable so a keyboard user can scroll a long draft preview
|
|
600
|
-
// (mirrors the SafeHtml preview branch above). The lint rule's
|
|
601
|
-
// tabIndex allowlist doesn't cover a scrollable, non-interactive
|
|
602
|
-
// text region.
|
|
603
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
604
|
-
/* @__PURE__ */ e("p", { className: rt, tabIndex: 0, children: f })
|
|
605
|
-
) }),
|
|
606
|
-
/* @__PURE__ */ e(
|
|
607
|
-
B,
|
|
608
|
-
{
|
|
609
|
-
size: "md",
|
|
610
|
-
intent: "outline",
|
|
611
|
-
className: `${se} ds:rounded-full`,
|
|
612
|
-
icon: /* @__PURE__ */ e(Et, {}),
|
|
613
|
-
"aria-label": l("editor.ai.retry"),
|
|
614
|
-
onClick: () => k(null)
|
|
615
|
-
}
|
|
616
|
-
),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
618
|
-
B,
|
|
619
|
-
{
|
|
620
|
-
size: "md",
|
|
621
|
-
intent: "primary",
|
|
622
|
-
className: `${se} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
623
|
-
icon: /* @__PURE__ */ e(Ht, {}),
|
|
624
|
-
"aria-label": l("common.confirm"),
|
|
625
|
-
onClick: K
|
|
626
|
-
}
|
|
627
|
-
)
|
|
628
|
-
] }) : /* @__PURE__ */ y(De, { children: [
|
|
629
|
-
/* @__PURE__ */ y("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-sm)]", children: [
|
|
630
|
-
/* @__PURE__ */ e(
|
|
631
|
-
B,
|
|
632
|
-
{
|
|
633
|
-
size: "md",
|
|
634
|
-
intent: "outline",
|
|
635
|
-
className: se,
|
|
636
|
-
icon: /* @__PURE__ */ e(tt, {}),
|
|
637
|
-
"aria-label": l("common.close"),
|
|
638
|
-
onClick: a
|
|
639
|
-
}
|
|
640
|
-
),
|
|
641
|
-
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ e(
|
|
642
|
-
St,
|
|
643
|
-
{
|
|
644
|
-
id: b,
|
|
645
|
-
size: "md",
|
|
646
|
-
className: "ds:content-center",
|
|
647
|
-
value: fe,
|
|
648
|
-
onChange: (w) => I(w.target.value),
|
|
649
|
-
placeholder: l("editor.ai.promptPlaceholder"),
|
|
650
|
-
"aria-label": l("editor.ai.promptLabel"),
|
|
651
|
-
autoResize: !0,
|
|
652
|
-
minRows: 1,
|
|
653
|
-
maxRows: 3,
|
|
654
|
-
readOnly: _,
|
|
655
|
-
tone: O ? "error" : "default",
|
|
656
|
-
"aria-describedby": O ? v : void 0
|
|
657
|
-
}
|
|
658
|
-
) }),
|
|
659
|
-
p ? /* @__PURE__ */ e(
|
|
660
|
-
B,
|
|
661
|
-
{
|
|
662
|
-
size: "md",
|
|
663
|
-
intent: "outline",
|
|
664
|
-
className: _ ? `${se} ${Br}` : se,
|
|
665
|
-
icon: _ ? /* @__PURE__ */ e(_e, { className: "ds:fill-current" }) : /* @__PURE__ */ e(lt, {}),
|
|
666
|
-
"aria-pressed": _,
|
|
667
|
-
"aria-label": l(_ ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
668
|
-
onClick: R
|
|
669
|
-
}
|
|
670
|
-
) : null,
|
|
671
|
-
/* @__PURE__ */ e(
|
|
672
|
-
B,
|
|
673
|
-
{
|
|
674
|
-
size: "md",
|
|
675
|
-
intent: "primary",
|
|
676
|
-
icon: S ? /* @__PURE__ */ e(it, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ e(It, {}),
|
|
677
|
-
className: `${se} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
678
|
-
disabled: S || !z.trim(),
|
|
679
|
-
"aria-busy": S || void 0,
|
|
680
|
-
"aria-label": l("editor.ai.generate"),
|
|
681
|
-
onClick: G
|
|
682
|
-
}
|
|
683
|
-
)
|
|
684
|
-
] }),
|
|
685
|
-
p ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: q }) : null,
|
|
686
|
-
O ? /* @__PURE__ */ e("p", { id: v, role: "alert", className: Vr, children: l("editor.ai.error") }) : g ? /* @__PURE__ */ e("p", { className: Fr, children: g }) : null
|
|
687
|
-
] })
|
|
688
|
-
}
|
|
689
|
-
);
|
|
690
|
-
}
|
|
691
|
-
const Gr = {
|
|
692
|
-
bold: {
|
|
693
|
-
id: "bold",
|
|
694
|
-
icon: /* @__PURE__ */ e(Yt, {}),
|
|
695
|
-
label: ["editor.bold", "Bold"],
|
|
696
|
-
command: ["module.inline.format", { tag: "b" }],
|
|
697
|
-
toggle: "bold"
|
|
698
|
-
},
|
|
699
|
-
italic: {
|
|
700
|
-
id: "italic",
|
|
701
|
-
icon: /* @__PURE__ */ e(ir, {}),
|
|
702
|
-
label: ["editor.italic", "Italic"],
|
|
703
|
-
command: ["module.inline.format", { tag: "i" }],
|
|
704
|
-
toggle: "italic"
|
|
705
|
-
},
|
|
706
|
-
underline: {
|
|
707
|
-
id: "underline",
|
|
708
|
-
icon: /* @__PURE__ */ e($r, {}),
|
|
709
|
-
label: ["editor.underline", "Underline"],
|
|
710
|
-
command: ["module.inline.format", { tag: "u" }],
|
|
711
|
-
toggle: "underline"
|
|
712
|
-
},
|
|
713
|
-
strike: {
|
|
714
|
-
id: "strike",
|
|
715
|
-
icon: /* @__PURE__ */ e(Er, {}),
|
|
716
|
-
label: ["editor.strike", "Strikethrough"],
|
|
717
|
-
command: ["module.inline.format", { tag: "del" }],
|
|
718
|
-
toggle: "strike"
|
|
719
|
-
},
|
|
720
|
-
ul: {
|
|
721
|
-
id: "ul",
|
|
722
|
-
icon: /* @__PURE__ */ e(mr, {}),
|
|
723
|
-
label: ["editor.list.bullet", "Bulleted list"],
|
|
724
|
-
command: ["module.list.toggle", "ul"],
|
|
725
|
-
toggle: "ul"
|
|
726
|
-
},
|
|
727
|
-
ol: {
|
|
728
|
-
id: "ol",
|
|
729
|
-
icon: /* @__PURE__ */ e(cr, {}),
|
|
730
|
-
label: ["editor.list.ordered", "Numbered list"],
|
|
731
|
-
command: ["module.list.toggle", "ol"],
|
|
732
|
-
toggle: "ol"
|
|
733
|
-
}
|
|
734
|
-
}, Oe = [
|
|
735
|
-
{
|
|
736
|
-
id: "paragraph",
|
|
737
|
-
tag: "p",
|
|
738
|
-
icon: /* @__PURE__ */ e(Nr, {}),
|
|
739
|
-
label: ["editor.paragraph", "Paragraph"]
|
|
740
|
-
},
|
|
741
|
-
{
|
|
742
|
-
id: "h2",
|
|
743
|
-
tag: "h2",
|
|
744
|
-
icon: /* @__PURE__ */ e(er, {}),
|
|
745
|
-
label: ["editor.heading2", "Heading 2"]
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
id: "h3",
|
|
749
|
-
tag: "h3",
|
|
750
|
-
icon: /* @__PURE__ */ e(rr, {}),
|
|
751
|
-
label: ["editor.heading3", "Heading 3"]
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
id: "quote",
|
|
755
|
-
tag: "blockquote",
|
|
756
|
-
icon: /* @__PURE__ */ e(zr, {}),
|
|
757
|
-
label: ["editor.quote", "Quote"]
|
|
758
|
-
}
|
|
759
|
-
], Wr = {
|
|
760
|
-
minimal: ["bold", "italic", "underline", "link"],
|
|
761
|
-
standard: [
|
|
762
|
-
"format",
|
|
763
|
-
"bold",
|
|
764
|
-
"italic",
|
|
765
|
-
"underline",
|
|
766
|
-
"strike",
|
|
767
|
-
"ul",
|
|
768
|
-
"ol",
|
|
769
|
-
"link"
|
|
770
|
-
],
|
|
771
|
-
full: ["format", "bold", "italic", "underline", "strike", "ul", "ol", "link"]
|
|
772
|
-
}, st = [
|
|
773
|
-
{
|
|
774
|
-
id: "rowAbove",
|
|
775
|
-
command: "plugin.table.addRowAbove",
|
|
776
|
-
icon: /* @__PURE__ */ e(Gt, {}),
|
|
777
|
-
label: ["editor.table.rowAbove", "Add row above"]
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
id: "rowBelow",
|
|
781
|
-
command: "plugin.table.addRowBelow",
|
|
782
|
-
icon: /* @__PURE__ */ e(Vt, {}),
|
|
783
|
-
label: ["editor.table.rowBelow", "Add row below"]
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
id: "colLeft",
|
|
787
|
-
command: "plugin.table.addColumnLeft",
|
|
788
|
-
icon: /* @__PURE__ */ e(Qt, {}),
|
|
789
|
-
label: ["editor.table.columnLeft", "Add column left"]
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
id: "colRight",
|
|
793
|
-
command: "plugin.table.addColumnRight",
|
|
794
|
-
icon: /* @__PURE__ */ e(Ut, {}),
|
|
795
|
-
label: ["editor.table.columnRight", "Add column right"]
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
id: "addHead",
|
|
799
|
-
command: "plugin.table.addHead",
|
|
800
|
-
icon: /* @__PURE__ */ e(xr, {}),
|
|
801
|
-
label: ["editor.table.addHeader", "Add header row"]
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
id: "deleteHead",
|
|
805
|
-
command: "plugin.table.deleteHead",
|
|
806
|
-
icon: /* @__PURE__ */ e(kr, {}),
|
|
807
|
-
label: ["editor.table.deleteHeader", "Remove header row"]
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
id: "deleteRow",
|
|
811
|
-
command: "plugin.table.deleteRow",
|
|
812
|
-
icon: /* @__PURE__ */ e(_r, {}),
|
|
813
|
-
label: ["editor.table.deleteRow", "Delete row"]
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
id: "deleteColumn",
|
|
817
|
-
command: "plugin.table.deleteColumn",
|
|
818
|
-
icon: /* @__PURE__ */ e(jt, {}),
|
|
819
|
-
label: ["editor.table.deleteColumn", "Delete column"]
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
id: "deleteTable",
|
|
823
|
-
command: "plugin.table.deleteTable",
|
|
824
|
-
icon: /* @__PURE__ */ e(Pt, {}),
|
|
825
|
-
label: ["editor.table.deleteTable", "Delete table"]
|
|
826
|
-
}
|
|
827
|
-
], Me = 6, Ur = je(
|
|
828
|
-
[
|
|
829
|
-
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
830
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
831
|
-
"ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
|
|
832
|
-
"ds:shadow-[var(--shadow-md)]"
|
|
833
|
-
].join(" ")
|
|
834
|
-
), dt = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", ve = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
|
|
835
|
-
function Se(o) {
|
|
836
|
-
return o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
837
|
-
}
|
|
838
|
-
function Xr({
|
|
839
|
-
run: o,
|
|
840
|
-
active: a,
|
|
841
|
-
onTriggerDown: c
|
|
842
|
-
}) {
|
|
843
|
-
const { t: s } = Z(), d = Oe.find((g) => a.has(g.id)) ?? Oe[0];
|
|
844
|
-
return /* @__PURE__ */ y(ze.Root, { children: [
|
|
845
|
-
/* @__PURE__ */ e(ze.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
846
|
-
oe,
|
|
847
|
-
{
|
|
848
|
-
size: "sm",
|
|
849
|
-
intent: "ghost",
|
|
850
|
-
startIcon: d.icon,
|
|
851
|
-
endIcon: /* @__PURE__ */ e(qt, {}),
|
|
852
|
-
"aria-label": s("editor.format", "Paragraph style"),
|
|
853
|
-
onMouseDown: c,
|
|
854
|
-
children: s(d.label[0], d.label[1])
|
|
855
|
-
}
|
|
856
|
-
) }),
|
|
857
|
-
/* @__PURE__ */ e(ze.Content, { align: "start", children: Oe.map((g) => /* @__PURE__ */ e(
|
|
858
|
-
ze.Item,
|
|
859
|
-
{
|
|
860
|
-
startIcon: g.icon,
|
|
861
|
-
onSelect: () => o("module.block.format", { tag: g.tag }),
|
|
862
|
-
children: s(g.label[0], g.label[1])
|
|
863
|
-
},
|
|
864
|
-
g.id
|
|
865
|
-
)) })
|
|
866
|
-
] });
|
|
867
|
-
}
|
|
868
|
-
function Qr({
|
|
869
|
-
insertHtml: o,
|
|
870
|
-
saveSelection: a,
|
|
871
|
-
restoreSelection: c,
|
|
872
|
-
getSelectedText: s
|
|
873
|
-
}) {
|
|
874
|
-
const { t: d } = Z(), [g, p] = T(!1), [l, b] = T(""), [v, z] = T(""), [I, S] = T(!1), x = de(), O = de(), m = () => {
|
|
875
|
-
b(""), z(""), S(!1);
|
|
876
|
-
}, f = () => {
|
|
877
|
-
const k = l.trim();
|
|
878
|
-
if (!k) return;
|
|
879
|
-
const A = v.trim() || k, _ = I ? ' target="_blank" rel="noopener noreferrer"' : "", E = `<a href="${Se(k)}"${_}>${Se(A)}</a>`;
|
|
880
|
-
p(!1), m(), window.requestAnimationFrame(() => {
|
|
881
|
-
c(), o(E);
|
|
882
|
-
});
|
|
883
|
-
};
|
|
884
|
-
return /* @__PURE__ */ y(P.Root, { open: g, onOpenChange: p, children: [
|
|
885
|
-
/* @__PURE__ */ e(P.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
886
|
-
B,
|
|
887
|
-
{
|
|
888
|
-
size: "sm",
|
|
889
|
-
intent: "ghost",
|
|
890
|
-
icon: /* @__PURE__ */ e(sr, {}),
|
|
891
|
-
"aria-label": d("editor.link.insert", "Insert link"),
|
|
892
|
-
onMouseDown: () => {
|
|
893
|
-
a(), z(s());
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
) }),
|
|
897
|
-
/* @__PURE__ */ y(P.Content, { children: [
|
|
898
|
-
/* @__PURE__ */ e(P.Header, { children: /* @__PURE__ */ e(P.Title, { children: d("editor.link.insert", "Insert link") }) }),
|
|
899
|
-
/* @__PURE__ */ y(P.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
900
|
-
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
901
|
-
/* @__PURE__ */ e("label", { htmlFor: x, className: ve, children: d("editor.link.url", "URL") }),
|
|
902
|
-
/* @__PURE__ */ e(
|
|
903
|
-
Re,
|
|
904
|
-
{
|
|
905
|
-
id: x,
|
|
906
|
-
type: "url",
|
|
907
|
-
value: l,
|
|
908
|
-
onChange: (k) => b(k.target.value),
|
|
909
|
-
placeholder: "https://…"
|
|
910
|
-
}
|
|
911
|
-
)
|
|
912
|
-
] }),
|
|
913
|
-
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
914
|
-
/* @__PURE__ */ e("label", { htmlFor: O, className: ve, children: d("editor.link.text", "Text to display") }),
|
|
915
|
-
/* @__PURE__ */ e(
|
|
916
|
-
Re,
|
|
917
|
-
{
|
|
918
|
-
id: O,
|
|
919
|
-
value: v,
|
|
920
|
-
onChange: (k) => z(k.target.value),
|
|
921
|
-
placeholder: d("editor.link.textPlaceholder", "Link text")
|
|
922
|
-
}
|
|
923
|
-
)
|
|
924
|
-
] }),
|
|
925
|
-
/* @__PURE__ */ e(
|
|
926
|
-
$t,
|
|
927
|
-
{
|
|
928
|
-
checked: I,
|
|
929
|
-
onCheckedChange: (k) => S(k === !0),
|
|
930
|
-
label: d("editor.link.newTab", "Open in new tab")
|
|
931
|
-
}
|
|
932
|
-
)
|
|
933
|
-
] }),
|
|
934
|
-
/* @__PURE__ */ y(P.Footer, { children: [
|
|
935
|
-
/* @__PURE__ */ e(P.Close, { asChild: !0, children: /* @__PURE__ */ e(oe, { intent: "secondary", children: d("common.cancel") }) }),
|
|
936
|
-
/* @__PURE__ */ e(oe, { onClick: f, disabled: !l.trim(), children: d("editor.link.insertAction", "Insert") })
|
|
937
|
-
] })
|
|
938
|
-
] })
|
|
939
|
-
] });
|
|
940
|
-
}
|
|
941
|
-
function Zr({
|
|
942
|
-
insertHtml: o,
|
|
943
|
-
saveSelection: a,
|
|
944
|
-
restoreSelection: c,
|
|
945
|
-
uploadImage: s
|
|
946
|
-
}) {
|
|
947
|
-
const { t: d } = Z(), [g, p] = T(!1), [l, b] = T(""), [v, z] = T(""), I = de(), S = de(), x = (m, f) => {
|
|
948
|
-
const k = `<img src="${Se(m)}" alt="${Se(f)}" loading="lazy">`;
|
|
949
|
-
p(!1), b(""), z(""), window.requestAnimationFrame(() => {
|
|
950
|
-
c(), o(k);
|
|
951
|
-
});
|
|
952
|
-
}, O = () => {
|
|
953
|
-
const m = l.trim();
|
|
954
|
-
m && x(m, v.trim());
|
|
955
|
-
};
|
|
956
|
-
return /* @__PURE__ */ y(P.Root, { open: g, onOpenChange: p, children: [
|
|
957
|
-
/* @__PURE__ */ e(P.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
958
|
-
B,
|
|
959
|
-
{
|
|
960
|
-
size: "sm",
|
|
961
|
-
intent: "ghost",
|
|
962
|
-
icon: /* @__PURE__ */ e(Dt, {}),
|
|
963
|
-
"aria-label": d("editor.image.insert", "Insert image"),
|
|
964
|
-
onMouseDown: () => a()
|
|
965
|
-
}
|
|
966
|
-
) }),
|
|
967
|
-
/* @__PURE__ */ y(P.Content, { children: [
|
|
968
|
-
/* @__PURE__ */ e(P.Header, { children: /* @__PURE__ */ e(P.Title, { children: d("editor.image.insert", "Insert image") }) }),
|
|
969
|
-
/* @__PURE__ */ y(P.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
970
|
-
s ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
971
|
-
/* @__PURE__ */ e("span", { className: ve, children: d("editor.image.upload", "Upload") }),
|
|
972
|
-
/* @__PURE__ */ e(
|
|
973
|
-
Ot,
|
|
974
|
-
{
|
|
975
|
-
variant: "dropzone",
|
|
976
|
-
accept: {
|
|
977
|
-
"image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
|
|
978
|
-
},
|
|
979
|
-
maxFiles: 1,
|
|
980
|
-
onUpload: async (m, { signal: f }) => {
|
|
981
|
-
const k = await s(m, f);
|
|
982
|
-
x(k, m.name);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
),
|
|
986
|
-
/* @__PURE__ */ e("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: d("editor.image.orUrl", "Or paste an image URL") })
|
|
987
|
-
] }) : null,
|
|
988
|
-
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
989
|
-
/* @__PURE__ */ e("label", { htmlFor: I, className: ve, children: d("editor.image.url", "Image URL") }),
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
Re,
|
|
992
|
-
{
|
|
993
|
-
id: I,
|
|
994
|
-
type: "url",
|
|
995
|
-
value: l,
|
|
996
|
-
onChange: (m) => b(m.target.value),
|
|
997
|
-
placeholder: "https://…"
|
|
998
|
-
}
|
|
999
|
-
)
|
|
1000
|
-
] }),
|
|
1001
|
-
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1002
|
-
/* @__PURE__ */ e("label", { htmlFor: S, className: ve, children: d("editor.image.alt", "Alt text") }),
|
|
1003
|
-
/* @__PURE__ */ e(
|
|
1004
|
-
Re,
|
|
1005
|
-
{
|
|
1006
|
-
id: S,
|
|
1007
|
-
value: v,
|
|
1008
|
-
onChange: (m) => z(m.target.value),
|
|
1009
|
-
placeholder: d(
|
|
1010
|
-
"editor.image.altPlaceholder",
|
|
1011
|
-
"Describe the image"
|
|
1012
|
-
)
|
|
1013
|
-
}
|
|
1014
|
-
)
|
|
1015
|
-
] })
|
|
1016
|
-
] }),
|
|
1017
|
-
/* @__PURE__ */ y(P.Footer, { children: [
|
|
1018
|
-
/* @__PURE__ */ e(P.Close, { asChild: !0, children: /* @__PURE__ */ e(oe, { intent: "secondary", children: d("common.cancel") }) }),
|
|
1019
|
-
/* @__PURE__ */ e(oe, { onClick: O, disabled: !l.trim(), children: d("editor.image.insertAction", "Insert") })
|
|
1020
|
-
] })
|
|
1021
|
-
] })
|
|
1022
|
-
] });
|
|
1023
|
-
}
|
|
1024
|
-
function Yr({
|
|
1025
|
-
run: o,
|
|
1026
|
-
saveSelection: a,
|
|
1027
|
-
restoreSelection: c
|
|
1028
|
-
}) {
|
|
1029
|
-
const { t: s } = Z(), [d, g] = T("#1f2a5c"), p = (b) => {
|
|
1030
|
-
g(b), c(), o("module.inline.format", {
|
|
1031
|
-
tag: "span",
|
|
1032
|
-
style: { color: b },
|
|
1033
|
-
type: "toggle"
|
|
1034
|
-
});
|
|
1035
|
-
}, l = () => {
|
|
1036
|
-
c(), o("module.inline.remove", { style: "color" });
|
|
1037
|
-
};
|
|
1038
|
-
return /* @__PURE__ */ y(F, { onOpenChange: (b) => b && a(), children: [
|
|
1039
|
-
/* @__PURE__ */ e(F.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1040
|
-
B,
|
|
1041
|
-
{
|
|
1042
|
-
size: "sm",
|
|
1043
|
-
intent: "ghost",
|
|
1044
|
-
icon: /* @__PURE__ */ e(yr, {}),
|
|
1045
|
-
"aria-label": s("editor.textColor", "Text colour"),
|
|
1046
|
-
onMouseDown: (b) => {
|
|
1047
|
-
b.preventDefault(), a();
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
) }),
|
|
1051
|
-
/* @__PURE__ */ y(F.Content, { side: "bottom", align: "start", children: [
|
|
1052
|
-
/* @__PURE__ */ e(F.Heading, { children: s("editor.textColor", "Text colour") }),
|
|
1053
|
-
/* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
|
|
1054
|
-
Pe,
|
|
1055
|
-
{
|
|
1056
|
-
variant: "inline",
|
|
1057
|
-
size: "sm",
|
|
1058
|
-
value: d,
|
|
1059
|
-
onChange: p
|
|
1060
|
-
}
|
|
1061
|
-
) }),
|
|
1062
|
-
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(oe, { size: "sm", intent: "secondary", onClick: l, children: s("editor.color.remove", "Remove colour") }) })
|
|
1063
|
-
] })
|
|
1064
|
-
] });
|
|
1065
|
-
}
|
|
1066
|
-
function Jr({
|
|
1067
|
-
run: o,
|
|
1068
|
-
saveSelection: a,
|
|
1069
|
-
restoreSelection: c
|
|
1070
|
-
}) {
|
|
1071
|
-
const { t: s } = Z(), [d, g] = T("#fff3a3"), p = (b) => {
|
|
1072
|
-
g(b), c(), o("module.inline.format", {
|
|
1073
|
-
tag: "span",
|
|
1074
|
-
style: { "background-color": b },
|
|
1075
|
-
type: "toggle"
|
|
1076
|
-
});
|
|
1077
|
-
}, l = () => {
|
|
1078
|
-
c(), o("module.inline.remove", { style: "background-color" });
|
|
1079
|
-
};
|
|
1080
|
-
return /* @__PURE__ */ y(F, { onOpenChange: (b) => b && a(), children: [
|
|
1081
|
-
/* @__PURE__ */ e(F.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1082
|
-
B,
|
|
1083
|
-
{
|
|
1084
|
-
size: "sm",
|
|
1085
|
-
intent: "ghost",
|
|
1086
|
-
icon: /* @__PURE__ */ e(or, {}),
|
|
1087
|
-
"aria-label": s("editor.highlightColor", "Highlight"),
|
|
1088
|
-
onMouseDown: (b) => {
|
|
1089
|
-
b.preventDefault(), a();
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
) }),
|
|
1093
|
-
/* @__PURE__ */ y(F.Content, { side: "bottom", align: "start", children: [
|
|
1094
|
-
/* @__PURE__ */ e(F.Heading, { children: s("editor.highlightColor", "Highlight") }),
|
|
1095
|
-
/* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
|
|
1096
|
-
Pe,
|
|
1097
|
-
{
|
|
1098
|
-
variant: "inline",
|
|
1099
|
-
size: "sm",
|
|
1100
|
-
value: d,
|
|
1101
|
-
onChange: p
|
|
1102
|
-
}
|
|
1103
|
-
) }),
|
|
1104
|
-
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(oe, { size: "sm", intent: "secondary", onClick: l, children: s("editor.highlight.remove", "Remove highlight") }) })
|
|
1105
|
-
] })
|
|
1106
|
-
] });
|
|
1107
|
-
}
|
|
1108
|
-
function en(o, a) {
|
|
1109
|
-
const c = Array.from({ length: a }, () => "<td><br></td>").join("");
|
|
1110
|
-
return `<table><tbody>${Array.from({ length: o }, () => `<tr>${c}</tr>`).join("")}</tbody></table>`;
|
|
1111
|
-
}
|
|
1112
|
-
function tn({
|
|
1113
|
-
run: o,
|
|
1114
|
-
insertTable: a,
|
|
1115
|
-
active: c
|
|
1116
|
-
}) {
|
|
1117
|
-
const { t: s } = Z(), [d, g] = T({ r: 0, c: 0 }), p = c.has("table");
|
|
1118
|
-
return /* @__PURE__ */ y(F, { onOpenChange: (l) => !l && g({ r: 0, c: 0 }), children: [
|
|
1119
|
-
/* @__PURE__ */ e(F.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1120
|
-
B,
|
|
1121
|
-
{
|
|
1122
|
-
size: "sm",
|
|
1123
|
-
intent: "ghost",
|
|
1124
|
-
icon: /* @__PURE__ */ e(Ir, {}),
|
|
1125
|
-
"aria-label": s("editor.table.insert", "Insert table"),
|
|
1126
|
-
onMouseDown: (l) => l.preventDefault()
|
|
1127
|
-
}
|
|
1128
|
-
) }),
|
|
1129
|
-
/* @__PURE__ */ e(F.Content, { side: "bottom", align: "start", children: p ? (
|
|
1130
|
-
// Caret is already inside a table — offer the manage ops only, never
|
|
1131
|
-
// a nested-table insert (mirrors Redactor's native dropdown, which
|
|
1132
|
-
// disables "insert table" while the caret is in a table).
|
|
1133
|
-
/* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: st.map((l) => /* @__PURE__ */ y(
|
|
1134
|
-
"button",
|
|
1135
|
-
{
|
|
1136
|
-
type: "button",
|
|
1137
|
-
onClick: () => o(l.command),
|
|
1138
|
-
className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-start ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)] ds:hover:bg-[var(--muted)]",
|
|
1139
|
-
children: [
|
|
1140
|
-
/* @__PURE__ */ e(
|
|
1141
|
-
"span",
|
|
1142
|
-
{
|
|
1143
|
-
"aria-hidden": "true",
|
|
1144
|
-
className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)]",
|
|
1145
|
-
children: l.icon
|
|
1146
|
-
}
|
|
1147
|
-
),
|
|
1148
|
-
s(l.label[0], l.label[1])
|
|
1149
|
-
]
|
|
1150
|
-
},
|
|
1151
|
-
l.id
|
|
1152
|
-
)) })
|
|
1153
|
-
) : /* @__PURE__ */ y(De, { children: [
|
|
1154
|
-
/* @__PURE__ */ e(F.Heading, { children: s("editor.table.insert", "Insert table") }),
|
|
1155
|
-
/* @__PURE__ */ e(
|
|
1156
|
-
"div",
|
|
1157
|
-
{
|
|
1158
|
-
role: "group",
|
|
1159
|
-
"aria-label": s("editor.table.sizePicker", "Table size"),
|
|
1160
|
-
className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
|
|
1161
|
-
onMouseLeave: () => g({ r: 0, c: 0 }),
|
|
1162
|
-
children: Array.from({ length: Me * Me }, (l, b) => {
|
|
1163
|
-
const v = Math.floor(b / Me) + 1, z = b % Me + 1, I = v <= d.r && z <= d.c;
|
|
1164
|
-
return /* @__PURE__ */ e(
|
|
1165
|
-
"button",
|
|
1166
|
-
{
|
|
1167
|
-
type: "button",
|
|
1168
|
-
"aria-label": s("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1169
|
-
r: v,
|
|
1170
|
-
c: z
|
|
1171
|
-
}),
|
|
1172
|
-
onMouseEnter: () => g({ r: v, c: z }),
|
|
1173
|
-
onClick: () => a(en(v, z)),
|
|
1174
|
-
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${I ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
|
|
1175
|
-
},
|
|
1176
|
-
b
|
|
1177
|
-
);
|
|
1178
|
-
})
|
|
1179
|
-
}
|
|
1180
|
-
),
|
|
1181
|
-
/* @__PURE__ */ e("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: d.r > 0 ? s("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1182
|
-
r: d.r,
|
|
1183
|
-
c: d.c
|
|
1184
|
-
}) : s("editor.table.sizeHint", "Pick a size") })
|
|
1185
|
-
] }) })
|
|
1186
|
-
] });
|
|
1187
|
-
}
|
|
1188
|
-
const rn = Object.fromEntries(st.map((o) => [o.id, o])), nn = [
|
|
1189
|
-
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1190
|
-
"ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
|
|
1191
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1192
|
-
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1193
|
-
].join(" "), on = "#fde68a";
|
|
1194
|
-
function ot({
|
|
1195
|
-
scope: o,
|
|
1196
|
-
icon: a,
|
|
1197
|
-
label: c,
|
|
1198
|
-
onOpenChange: s,
|
|
1199
|
-
saveTableCell: d,
|
|
1200
|
-
applyTableBackground: g
|
|
1201
|
-
}) {
|
|
1202
|
-
const { t: p } = Z(), [l, b] = T(on);
|
|
1203
|
-
return /* @__PURE__ */ y(
|
|
1204
|
-
F,
|
|
1205
|
-
{
|
|
1206
|
-
onOpenChange: (v) => {
|
|
1207
|
-
s(v), v && d();
|
|
1208
|
-
},
|
|
1209
|
-
children: [
|
|
1210
|
-
/* @__PURE__ */ e(F.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1211
|
-
B,
|
|
1212
|
-
{
|
|
1213
|
-
size: "sm",
|
|
1214
|
-
intent: "ghost",
|
|
1215
|
-
icon: a,
|
|
1216
|
-
tooltip: c,
|
|
1217
|
-
onMouseDown: (v) => v.preventDefault()
|
|
1218
|
-
}
|
|
1219
|
-
) }),
|
|
1220
|
-
/* @__PURE__ */ y(F.Content, { side: "bottom", align: "center", children: [
|
|
1221
|
-
/* @__PURE__ */ e(
|
|
1222
|
-
Pe,
|
|
1223
|
-
{
|
|
1224
|
-
variant: "inline",
|
|
1225
|
-
size: "sm",
|
|
1226
|
-
value: l,
|
|
1227
|
-
onChange: (v) => {
|
|
1228
|
-
b(v), g(o, v);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
),
|
|
1232
|
-
/* @__PURE__ */ e(
|
|
1233
|
-
oe,
|
|
1234
|
-
{
|
|
1235
|
-
size: "sm",
|
|
1236
|
-
intent: "ghost",
|
|
1237
|
-
className: "ds:mt-[var(--spacing-xs)] ds:w-full",
|
|
1238
|
-
onClick: () => g(o, null),
|
|
1239
|
-
children: p("editor.table.clearColor", "Clear colour")
|
|
1240
|
-
}
|
|
1241
|
-
)
|
|
1242
|
-
] })
|
|
1243
|
-
]
|
|
1244
|
-
}
|
|
1245
|
-
);
|
|
1246
|
-
}
|
|
1247
|
-
function an({
|
|
1248
|
-
active: o,
|
|
1249
|
-
run: a,
|
|
1250
|
-
areaRef: c,
|
|
1251
|
-
getActiveTableEl: s,
|
|
1252
|
-
enableColor: d = !1,
|
|
1253
|
-
saveTableCell: g,
|
|
1254
|
-
applyTableBackground: p
|
|
1255
|
-
}) {
|
|
1256
|
-
const { t: l } = Z(), b = o.has("table"), [v, z] = T(null), I = $(0), [S, x] = T(!1), O = C((f) => {
|
|
1257
|
-
I.current = Math.max(
|
|
1258
|
-
0,
|
|
1259
|
-
I.current + (f ? 1 : -1)
|
|
1260
|
-
), x(I.current > 0);
|
|
1261
|
-
}, []);
|
|
1262
|
-
if (W(() => {
|
|
1263
|
-
if (S) return;
|
|
1264
|
-
if (!b || typeof window > "u") {
|
|
1265
|
-
z(null);
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
const f = () => {
|
|
1269
|
-
const E = c.current, Y = s();
|
|
1270
|
-
if (!E || !Y) {
|
|
1271
|
-
z(null);
|
|
1272
|
-
return;
|
|
1273
|
-
}
|
|
1274
|
-
const L = E.getBoundingClientRect(), q = Y.getBoundingClientRect(), H = getComputedStyle(E).direction === "rtl", J = Math.max(0, q.top - L.top - 44), ee = H ? L.right - q.right + q.width / 2 : q.left - L.left + q.width / 2;
|
|
1275
|
-
z({ top: J, start: Math.max(0, ee), rtl: H });
|
|
1276
|
-
};
|
|
1277
|
-
f();
|
|
1278
|
-
const k = new ResizeObserver(f), A = c.current, _ = s();
|
|
1279
|
-
return A && k.observe(A), _ && k.observe(_), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
1280
|
-
k.disconnect(), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
1281
|
-
};
|
|
1282
|
-
}, [b, S, c, s]), !b && !S || !v) return null;
|
|
1283
|
-
const m = [
|
|
1284
|
-
["rowAbove", "rowBelow"],
|
|
1285
|
-
["colLeft", "colRight"],
|
|
1286
|
-
["addHead"],
|
|
1287
|
-
...d ? ["colour"] : [],
|
|
1288
|
-
["deleteRow", "deleteColumn"],
|
|
1289
|
-
["deleteTable"]
|
|
1290
|
-
];
|
|
1291
|
-
return (
|
|
1292
|
-
// Tooltips disambiguate the icon-only ops on hover (and provide each
|
|
1293
|
-
// button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
|
|
1294
|
-
// needs a provider ancestor, so scope one to the bar.
|
|
1295
|
-
/* @__PURE__ */ e(Lt, { children: /* @__PURE__ */ e(
|
|
1296
|
-
"div",
|
|
1297
|
-
{
|
|
1298
|
-
role: "group",
|
|
1299
|
-
"aria-label": l("editor.table.toolbar", "Table tools"),
|
|
1300
|
-
className: `${nn} ${v.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1301
|
-
style: {
|
|
1302
|
-
"--rte-tt-top": `${v.top}px`,
|
|
1303
|
-
"--rte-tt-start": `${v.start}px`
|
|
1304
|
-
},
|
|
1305
|
-
children: m.map((f, k) => /* @__PURE__ */ y(at, { children: [
|
|
1306
|
-
k > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: dt }) : null,
|
|
1307
|
-
f === "colour" ? /* @__PURE__ */ y(De, { children: [
|
|
1308
|
-
/* @__PURE__ */ e(
|
|
1309
|
-
ot,
|
|
1310
|
-
{
|
|
1311
|
-
scope: "cell",
|
|
1312
|
-
icon: /* @__PURE__ */ e(fr, {}),
|
|
1313
|
-
label: l("editor.table.cellColor", "Cell colour"),
|
|
1314
|
-
onOpenChange: O,
|
|
1315
|
-
saveTableCell: g,
|
|
1316
|
-
applyTableBackground: p
|
|
1317
|
-
}
|
|
1318
|
-
),
|
|
1319
|
-
/* @__PURE__ */ e(
|
|
1320
|
-
ot,
|
|
1321
|
-
{
|
|
1322
|
-
scope: "row",
|
|
1323
|
-
icon: /* @__PURE__ */ e(pr, {}),
|
|
1324
|
-
label: l("editor.table.rowColor", "Row colour"),
|
|
1325
|
-
onOpenChange: O,
|
|
1326
|
-
saveTableCell: g,
|
|
1327
|
-
applyTableBackground: p
|
|
1328
|
-
}
|
|
1329
|
-
)
|
|
1330
|
-
] }) : f.map((A) => {
|
|
1331
|
-
const _ = rn[A];
|
|
1332
|
-
return /* @__PURE__ */ e(
|
|
1333
|
-
B,
|
|
1334
|
-
{
|
|
1335
|
-
size: "sm",
|
|
1336
|
-
intent: "ghost",
|
|
1337
|
-
icon: _.icon,
|
|
1338
|
-
tooltip: l(_.label[0], _.label[1]),
|
|
1339
|
-
onMouseDown: (E) => E.preventDefault(),
|
|
1340
|
-
onClick: () => a(_.command)
|
|
1341
|
-
},
|
|
1342
|
-
A
|
|
1343
|
-
);
|
|
1344
|
-
})
|
|
1345
|
-
] }, f === "colour" ? "colour" : f[0]))
|
|
1346
|
-
}
|
|
1347
|
-
) })
|
|
1348
|
-
);
|
|
1349
|
-
}
|
|
1350
|
-
function ln({
|
|
1351
|
-
run: o,
|
|
1352
|
-
active: a,
|
|
1353
|
-
preset: c,
|
|
1354
|
-
insertHtml: s,
|
|
1355
|
-
insertTable: d,
|
|
1356
|
-
saveSelection: g,
|
|
1357
|
-
restoreSelection: p,
|
|
1358
|
-
getSelectedText: l,
|
|
1359
|
-
uploadImage: b,
|
|
1360
|
-
enableColor: v = !1,
|
|
1361
|
-
enableImage: z = !1,
|
|
1362
|
-
enableTable: I = !1,
|
|
1363
|
-
showExtensions: S = !1
|
|
1364
|
-
}) {
|
|
1365
|
-
const { t: x } = Z(), O = (L) => L.preventDefault(), m = (L) => Wr[c].includes(L), f = (L) => {
|
|
1366
|
-
if (!m(L)) return null;
|
|
1367
|
-
const q = Gr[L];
|
|
1368
|
-
return /* @__PURE__ */ e(
|
|
1369
|
-
B,
|
|
1370
|
-
{
|
|
1371
|
-
size: "sm",
|
|
1372
|
-
intent: "ghost",
|
|
1373
|
-
icon: q.icon,
|
|
1374
|
-
"aria-label": x(q.label[0], q.label[1]),
|
|
1375
|
-
"aria-pressed": q.toggle ? a.has(q.toggle) : void 0,
|
|
1376
|
-
onMouseDown: O,
|
|
1377
|
-
onClick: () => o(...q.command)
|
|
1378
|
-
},
|
|
1379
|
-
q.id
|
|
1380
|
-
);
|
|
1381
|
-
}, k = () => /* @__PURE__ */ e("span", { "aria-hidden": "true", className: dt }), A = m("format"), _ = m("bold") || m("italic") || m("underline") || m("strike") || v, E = m("ul") || m("ol"), Y = m("link") || z || I;
|
|
1382
|
-
return /* @__PURE__ */ y(
|
|
1383
|
-
"div",
|
|
1384
|
-
{
|
|
1385
|
-
role: "group",
|
|
1386
|
-
"aria-label": x("editor.toolbarLabel"),
|
|
1387
|
-
className: Ur(),
|
|
1388
|
-
"data-component": "editor-toolbar",
|
|
1389
|
-
children: [
|
|
1390
|
-
A ? /* @__PURE__ */ e(Xr, { run: o, active: a, onTriggerDown: O }) : null,
|
|
1391
|
-
A && _ ? /* @__PURE__ */ e(k, {}) : null,
|
|
1392
|
-
f("bold"),
|
|
1393
|
-
f("italic"),
|
|
1394
|
-
f("underline"),
|
|
1395
|
-
f("strike"),
|
|
1396
|
-
v ? /* @__PURE__ */ e(
|
|
1397
|
-
Yr,
|
|
1398
|
-
{
|
|
1399
|
-
run: o,
|
|
1400
|
-
saveSelection: g,
|
|
1401
|
-
restoreSelection: p
|
|
1402
|
-
}
|
|
1403
|
-
) : null,
|
|
1404
|
-
v ? /* @__PURE__ */ e(
|
|
1405
|
-
Jr,
|
|
1406
|
-
{
|
|
1407
|
-
run: o,
|
|
1408
|
-
saveSelection: g,
|
|
1409
|
-
restoreSelection: p
|
|
1410
|
-
}
|
|
1411
|
-
) : null,
|
|
1412
|
-
(A || _) && E ? /* @__PURE__ */ e(k, {}) : null,
|
|
1413
|
-
f("ul"),
|
|
1414
|
-
f("ol"),
|
|
1415
|
-
(A || _ || E) && Y ? /* @__PURE__ */ e(k, {}) : null,
|
|
1416
|
-
m("link") ? /* @__PURE__ */ e(
|
|
1417
|
-
Qr,
|
|
1418
|
-
{
|
|
1419
|
-
insertHtml: s,
|
|
1420
|
-
saveSelection: g,
|
|
1421
|
-
restoreSelection: p,
|
|
1422
|
-
getSelectedText: l
|
|
1423
|
-
}
|
|
1424
|
-
) : null,
|
|
1425
|
-
z ? /* @__PURE__ */ e(
|
|
1426
|
-
Zr,
|
|
1427
|
-
{
|
|
1428
|
-
insertHtml: s,
|
|
1429
|
-
saveSelection: g,
|
|
1430
|
-
restoreSelection: p,
|
|
1431
|
-
uploadImage: b
|
|
1432
|
-
}
|
|
1433
|
-
) : null,
|
|
1434
|
-
I ? /* @__PURE__ */ e(tn, { run: o, insertTable: d, active: a }) : null,
|
|
1435
|
-
S && (A || _ || E || Y) ? /* @__PURE__ */ e(k, {}) : null,
|
|
1436
|
-
S ? /* @__PURE__ */ e(
|
|
1437
|
-
B,
|
|
1438
|
-
{
|
|
1439
|
-
size: "sm",
|
|
1440
|
-
intent: "ghost",
|
|
1441
|
-
icon: /* @__PURE__ */ e(jr, {}),
|
|
1442
|
-
"aria-label": x("editor.extensions", "Editor extensions"),
|
|
1443
|
-
disabled: !0,
|
|
1444
|
-
onMouseDown: O
|
|
1445
|
-
}
|
|
1446
|
-
) : null
|
|
1447
|
-
]
|
|
1448
|
-
}
|
|
1449
|
-
);
|
|
1450
|
-
}
|
|
1451
|
-
function re(o) {
|
|
1452
|
-
return _t(o, "rich-text");
|
|
1453
|
-
}
|
|
1454
|
-
function qe(o = "") {
|
|
1455
|
-
const a = String(o).trim();
|
|
1456
|
-
if (a === "" || a === "<p><br></p>" || a === "<p> </p>")
|
|
1457
|
-
return "";
|
|
1458
|
-
const c = a.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
1459
|
-
return c === "" && /<img\b[^>]*>/i.test(a) ? a : c === "" ? "" : a;
|
|
1460
|
-
}
|
|
1461
|
-
function sn(o) {
|
|
1462
|
-
return o.replace(
|
|
1463
|
-
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
1464
|
-
'<img loading="lazy"$1>'
|
|
1465
|
-
);
|
|
1466
|
-
}
|
|
1467
|
-
function dn(o) {
|
|
1468
|
-
if (!o || typeof o != "object") return;
|
|
1469
|
-
const a = o, c = (s) => {
|
|
1470
|
-
if (s && typeof s == "object" && "url" in s) {
|
|
1471
|
-
const d = s.url;
|
|
1472
|
-
return typeof d == "string" ? d : void 0;
|
|
1473
|
-
}
|
|
1474
|
-
};
|
|
1475
|
-
return typeof a.url == "string" ? a.url : c(a.file) ?? c(a.data) ?? Object.values(a).map(c).find(Boolean);
|
|
1476
|
-
}
|
|
1477
|
-
function cn(o) {
|
|
1478
|
-
if (o) return o;
|
|
1479
|
-
if (typeof window > "u") return null;
|
|
1480
|
-
const a = window;
|
|
1481
|
-
return a.$R ?? a.Redactor ?? null;
|
|
1482
|
-
}
|
|
1483
|
-
const un = {
|
|
1484
|
-
bold: ["module.inline.format", { tag: "b" }],
|
|
1485
|
-
italic: ["module.inline.format", { tag: "i" }],
|
|
1486
|
-
strikethrough: ["module.inline.format", { tag: "del" }],
|
|
1487
|
-
bulletedList: ["module.list.toggle", "ul"],
|
|
1488
|
-
numberedList: ["module.list.toggle", "ol"],
|
|
1489
|
-
heading: ["module.block.format", { tag: "h2" }],
|
|
1490
|
-
quote: ["module.block.format", { tag: "blockquote" }],
|
|
1491
|
-
paragraph: ["module.block.format", { tag: "p" }]
|
|
1492
|
-
}, mn = {
|
|
1493
|
-
zh: "zh_cn",
|
|
1494
|
-
pt: "pt_br"
|
|
1495
|
-
};
|
|
1496
|
-
function hn(o) {
|
|
1497
|
-
const a = o.split("-")[0];
|
|
1498
|
-
return mn[a] ?? a ?? "en";
|
|
1499
|
-
}
|
|
1500
|
-
const fn = je(
|
|
1501
|
-
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
1502
|
-
), gn = je(
|
|
1503
|
-
[
|
|
1504
|
-
"ds:block ds:[inline-size:100%]",
|
|
1505
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1506
|
-
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
1507
|
-
"ds:shadow-[var(--shadow-md)]",
|
|
1508
|
-
"ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
|
|
1509
|
-
"ds:p-[var(--spacing-md)] ds:[min-block-size:var(--rich-text-editor-min-block-size)]",
|
|
1510
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
1511
|
-
"ds:focus-visible:outline-solid",
|
|
1512
|
-
"ds:focus-visible:outline-[var(--ring)]",
|
|
1513
|
-
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1514
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
1515
|
-
].join(" ")
|
|
1516
|
-
), ct = [
|
|
1517
|
-
"ds:inline-flex ds:items-center ds:justify-center",
|
|
1518
|
-
"ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
|
|
1519
|
-
"ds:text-[color:var(--primary-foreground)]",
|
|
1520
|
-
"ds:transition-colors",
|
|
1521
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
1522
|
-
"ds:focus-visible:outline-solid",
|
|
1523
|
-
"ds:focus-visible:outline-[var(--primary-foreground)]",
|
|
1524
|
-
"ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
|
|
1525
|
-
].join(" "), pn = `${ct} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, bn = `${ct} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, yn = Tt(
|
|
1526
|
-
({
|
|
1527
|
-
id: o,
|
|
1528
|
-
defaultValue: a,
|
|
1529
|
-
value: c,
|
|
1530
|
-
onChange: s,
|
|
1531
|
-
toolbar: d = "standard",
|
|
1532
|
-
placeholder: g,
|
|
1533
|
-
readOnly: p = !1,
|
|
1534
|
-
ariaLabel: l,
|
|
1535
|
-
minHeight: b,
|
|
1536
|
-
showExtensions: v,
|
|
1537
|
-
className: z,
|
|
1538
|
-
redactor: I,
|
|
1539
|
-
options: S,
|
|
1540
|
-
plugins: x,
|
|
1541
|
-
lang: O,
|
|
1542
|
-
imageUploadUrl: m,
|
|
1543
|
-
onKeyDown: f,
|
|
1544
|
-
onRequestAiDraft: k,
|
|
1545
|
-
aiDraftFormat: A = "html",
|
|
1546
|
-
aiPrivacyNotice: _,
|
|
1547
|
-
onDictate: E,
|
|
1548
|
-
onProofread: Y,
|
|
1549
|
-
onAutoFormat: L
|
|
1550
|
-
}, q) => {
|
|
1551
|
-
const { t: H, i18n: J } = Z(), ee = de(), me = et(
|
|
1552
|
-
() => `rte-${ee.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
1553
|
-
[ee]
|
|
1554
|
-
), R = `#${me}`, G = $(null), K = $(null), he = $(!1), fe = $(p), w = $(null), D = $(null), [j, U] = T(!1), [ut, Be] = T(!1), [Fe, mt] = T(
|
|
1555
|
-
() => /* @__PURE__ */ new Set()
|
|
1556
|
-
), ge = $(null), V = $(s), ke = $(f);
|
|
1557
|
-
W(() => {
|
|
1558
|
-
V.current = s, ke.current = f;
|
|
1559
|
-
}, [s, f]);
|
|
1560
|
-
const ht = $(
|
|
1561
|
-
(() => {
|
|
1562
|
-
const t = c ?? a ?? "";
|
|
1563
|
-
return t ? re(t) : "";
|
|
1564
|
-
})()
|
|
1565
|
-
), ae = C(() => {
|
|
1566
|
-
var r;
|
|
1567
|
-
const t = K.current;
|
|
1568
|
-
if (t)
|
|
1569
|
-
try {
|
|
1570
|
-
const n = t(R, "source.getCode");
|
|
1571
|
-
if (typeof n == "string") return n;
|
|
1572
|
-
} catch {
|
|
1573
|
-
}
|
|
1574
|
-
return ((r = G.current) == null ? void 0 : r.value) ?? "";
|
|
1575
|
-
}, [R]), X = C(
|
|
1576
|
-
(t, ...r) => {
|
|
1577
|
-
const n = K.current;
|
|
1578
|
-
if (!n) return !1;
|
|
1579
|
-
const i = fe.current;
|
|
1580
|
-
if (i)
|
|
1581
|
-
try {
|
|
1582
|
-
n(R, "disableReadOnly");
|
|
1583
|
-
} catch {
|
|
1584
|
-
}
|
|
1585
|
-
try {
|
|
1586
|
-
return n(R, t, ...r), !0;
|
|
1587
|
-
} catch {
|
|
1588
|
-
return !1;
|
|
1589
|
-
} finally {
|
|
1590
|
-
if (i)
|
|
1591
|
-
try {
|
|
1592
|
-
n(R, "enableReadOnly");
|
|
1593
|
-
} catch {
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
},
|
|
1597
|
-
[R]
|
|
1598
|
-
), ie = C(
|
|
1599
|
-
(t, r) => {
|
|
1600
|
-
var ye;
|
|
1601
|
-
const n = (r == null ? void 0 : r.asHtml) ?? !0, i = n ? re(t) : t;
|
|
1602
|
-
if (X(n ? "insertion.insertHtml" : "insertion.insertText", i)) return;
|
|
1603
|
-
const h = G.current;
|
|
1604
|
-
if (!h) return;
|
|
1605
|
-
const N = h.selectionStart ?? h.value.length, Q = h.selectionEnd ?? h.value.length;
|
|
1606
|
-
h.value = h.value.slice(0, N) + i + h.value.slice(Q);
|
|
1607
|
-
const Te = N + i.length;
|
|
1608
|
-
try {
|
|
1609
|
-
h.setSelectionRange(Te, Te);
|
|
1610
|
-
} catch {
|
|
1611
|
-
}
|
|
1612
|
-
(ye = V.current) == null || ye.call(V, { html: re(h.value), markdown: "" });
|
|
1613
|
-
},
|
|
1614
|
-
[X]
|
|
1615
|
-
), Ae = $(null), ne = C(() => {
|
|
1616
|
-
var i;
|
|
1617
|
-
const t = (i = w.current) == null ? void 0 : i.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, n = /* @__PURE__ */ new Set();
|
|
1618
|
-
if (t && r && r.anchorNode && t.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
|
|
1619
|
-
r.rangeCount > 0 && (Ae.current = r.getRangeAt(0).cloneRange());
|
|
1620
|
-
try {
|
|
1621
|
-
document.queryCommandState("bold") && n.add("bold"), document.queryCommandState("italic") && n.add("italic"), document.queryCommandState("underline") && n.add("underline"), document.queryCommandState("strikeThrough") && n.add("strike"), document.queryCommandState("insertUnorderedList") && n.add("ul"), document.queryCommandState("insertOrderedList") && n.add("ol");
|
|
1622
|
-
const u = String(
|
|
1623
|
-
document.queryCommandValue("formatBlock") || ""
|
|
1624
|
-
).toLowerCase();
|
|
1625
|
-
/^h[1-6]$/.test(u) ? (n.add("heading"), n.add(u)) : u === "blockquote" ? n.add("quote") : n.add("paragraph");
|
|
1626
|
-
const h = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
|
|
1627
|
-
h && t.contains(h) && h.closest("table") && n.add("table");
|
|
1628
|
-
} catch {
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
mt(
|
|
1632
|
-
(u) => u.size === n.size && [...n].every((h) => u.has(h)) ? u : n
|
|
1633
|
-
);
|
|
1634
|
-
}, []), ce = C(
|
|
1635
|
-
(t, ...r) => {
|
|
1636
|
-
X(t, ...r), typeof window < "u" ? window.requestAnimationFrame(() => ne()) : ne();
|
|
1637
|
-
},
|
|
1638
|
-
[X, ne]
|
|
1639
|
-
);
|
|
1640
|
-
W(() => {
|
|
1641
|
-
const t = w.current;
|
|
1642
|
-
if (!t) return;
|
|
1643
|
-
const r = {
|
|
1644
|
-
b: ["module.inline.format", { tag: "b" }],
|
|
1645
|
-
i: ["module.inline.format", { tag: "i" }],
|
|
1646
|
-
u: ["module.inline.format", { tag: "u" }]
|
|
1647
|
-
}, n = (i) => {
|
|
1648
|
-
if (!(i.metaKey || i.ctrlKey) || i.altKey || i.shiftKey || i.isComposing) return;
|
|
1649
|
-
const u = r[i.key.toLowerCase()];
|
|
1650
|
-
if (!u) return;
|
|
1651
|
-
const h = t.querySelector(".redactor-in");
|
|
1652
|
-
!h || !(i.target instanceof Node) || !h.contains(i.target) || fe.current || (i.preventDefault(), i.stopImmediatePropagation(), ce(...u));
|
|
1653
|
-
};
|
|
1654
|
-
return t.addEventListener("keydown", n, !0), () => t.removeEventListener("keydown", n, !0);
|
|
1655
|
-
}, [ce]);
|
|
1656
|
-
const Ee = C(
|
|
1657
|
-
(t) => {
|
|
1658
|
-
ie(t, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => ne());
|
|
1659
|
-
},
|
|
1660
|
-
[ie, ne]
|
|
1661
|
-
), Ve = C(() => {
|
|
1662
|
-
var r;
|
|
1663
|
-
if (typeof window < "u") {
|
|
1664
|
-
const n = (r = w.current) == null ? void 0 : r.querySelector(".redactor-in"), i = window.getSelection();
|
|
1665
|
-
n && i && i.rangeCount > 0 && i.anchorNode && n.contains(i.anchorNode) && (Ae.current = i.getRangeAt(0).cloneRange());
|
|
1666
|
-
}
|
|
1667
|
-
const t = K.current;
|
|
1668
|
-
if (t)
|
|
1669
|
-
try {
|
|
1670
|
-
t(R, "selection.save");
|
|
1671
|
-
} catch {
|
|
1672
|
-
}
|
|
1673
|
-
}, [R]), Ke = C(() => {
|
|
1674
|
-
const t = K.current;
|
|
1675
|
-
if (!t) return;
|
|
1676
|
-
const r = Ae.current;
|
|
1677
|
-
try {
|
|
1678
|
-
t(R, "editor.focus");
|
|
1679
|
-
} catch {
|
|
1680
|
-
}
|
|
1681
|
-
if (r && typeof window < "u") {
|
|
1682
|
-
const n = window.getSelection();
|
|
1683
|
-
if (n)
|
|
1684
|
-
try {
|
|
1685
|
-
n.removeAllRanges(), n.addRange(r);
|
|
1686
|
-
return;
|
|
1687
|
-
} catch {
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
try {
|
|
1691
|
-
t(R, "selection.restore");
|
|
1692
|
-
} catch {
|
|
1693
|
-
}
|
|
1694
|
-
}, [R]), ft = C(() => {
|
|
1695
|
-
var n;
|
|
1696
|
-
if (typeof window > "u") return "";
|
|
1697
|
-
const t = (n = w.current) == null ? void 0 : n.querySelector(".redactor-in"), r = window.getSelection();
|
|
1698
|
-
return !t || !r || !r.anchorNode || !t.contains(r.anchorNode) ? "" : r.toString();
|
|
1699
|
-
}, []), gt = C(() => {
|
|
1700
|
-
var u;
|
|
1701
|
-
if (typeof window > "u") return null;
|
|
1702
|
-
const t = (u = w.current) == null ? void 0 : u.querySelector(".redactor-in"), r = window.getSelection();
|
|
1703
|
-
if (!t || !r || r.rangeCount === 0) return null;
|
|
1704
|
-
const n = r.anchorNode, i = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
|
|
1705
|
-
return !i || !t.contains(i) ? null : i.closest("table");
|
|
1706
|
-
}, []), Ge = $(null), we = C(() => {
|
|
1707
|
-
var u;
|
|
1708
|
-
if (typeof window > "u") return null;
|
|
1709
|
-
const t = (u = w.current) == null ? void 0 : u.querySelector(".redactor-in"), r = window.getSelection();
|
|
1710
|
-
if (!t || !r || r.rangeCount === 0) return null;
|
|
1711
|
-
const n = r.anchorNode, i = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
|
|
1712
|
-
return !i || !t.contains(i) ? null : i.closest("td,th");
|
|
1713
|
-
}, []), pt = C(() => {
|
|
1714
|
-
Ge.current = we();
|
|
1715
|
-
}, [we]), bt = C(
|
|
1716
|
-
(t, r) => {
|
|
1717
|
-
var h;
|
|
1718
|
-
const n = Ge.current ?? we();
|
|
1719
|
-
if (!n) return;
|
|
1720
|
-
const i = t === "row" ? Array.from(((h = n.closest("tr")) == null ? void 0 : h.children) ?? [n]).filter(
|
|
1721
|
-
(N) => N instanceof HTMLElement && (N.tagName === "TD" || N.tagName === "TH")
|
|
1722
|
-
) : [n], u = K.current;
|
|
1723
|
-
if (u)
|
|
1724
|
-
try {
|
|
1725
|
-
u(R, "module.buffer.trigger");
|
|
1726
|
-
} catch {
|
|
1727
|
-
}
|
|
1728
|
-
for (const N of i)
|
|
1729
|
-
r ? N.style.setProperty("background-color", r) : N.style.removeProperty("background-color");
|
|
1730
|
-
if (u)
|
|
1731
|
-
try {
|
|
1732
|
-
u(R, "broadcast", "hardsync");
|
|
1733
|
-
} catch {
|
|
1734
|
-
}
|
|
1735
|
-
typeof window < "u" && window.requestAnimationFrame(() => ne());
|
|
1736
|
-
},
|
|
1737
|
-
[we, R, ne]
|
|
1738
|
-
), yt = C(
|
|
1739
|
-
(t) => {
|
|
1740
|
-
var n;
|
|
1741
|
-
const r = K.current;
|
|
1742
|
-
if (r && typeof window < "u") {
|
|
1743
|
-
const i = (n = w.current) == null ? void 0 : n.querySelector(".redactor-in"), u = window.getSelection(), h = u == null ? void 0 : u.anchorNode, N = h && h.nodeType === Node.TEXT_NODE ? h.parentElement : h, Q = N && (i != null && i.contains(N)) ? N.closest("ul,ol") : null;
|
|
1744
|
-
if (Q)
|
|
1745
|
-
try {
|
|
1746
|
-
r(R, "caret.setAfter", Q);
|
|
1747
|
-
} catch {
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1750
|
-
Ee(t), typeof window < "u" && window.requestAnimationFrame(() => {
|
|
1751
|
-
var u;
|
|
1752
|
-
const i = (u = w.current) == null ? void 0 : u.querySelector(".redactor-in");
|
|
1753
|
-
i == null || i.querySelectorAll("table td, table th").forEach((h) => {
|
|
1754
|
-
let N = h.lastChild;
|
|
1755
|
-
for (; N && N.nodeType === Node.TEXT_NODE && !(N.textContent ?? "").trim(); ) {
|
|
1756
|
-
const Q = N.previousSibling;
|
|
1757
|
-
h.removeChild(N), N = Q;
|
|
1758
|
-
}
|
|
1759
|
-
});
|
|
1760
|
-
});
|
|
1761
|
-
},
|
|
1762
|
-
[Ee, R]
|
|
1763
|
-
), vt = C(
|
|
1764
|
-
async (t, r) => {
|
|
1765
|
-
if (!m) throw new Error("No image upload URL configured.");
|
|
1766
|
-
const n = new FormData();
|
|
1767
|
-
n.append("file", t);
|
|
1768
|
-
const i = await fetch(m, {
|
|
1769
|
-
method: "POST",
|
|
1770
|
-
body: n,
|
|
1771
|
-
credentials: "same-origin",
|
|
1772
|
-
signal: r
|
|
1773
|
-
});
|
|
1774
|
-
if (!i.ok) throw new Error(`Image upload failed (${i.status}).`);
|
|
1775
|
-
const u = dn(await i.json());
|
|
1776
|
-
if (!u) throw new Error("Image upload response contained no URL.");
|
|
1777
|
-
return u;
|
|
1778
|
-
},
|
|
1779
|
-
[m]
|
|
1780
|
-
), pe = $(null), xe = $(null), [be, We] = T(!1), [kt, Ue] = T(!1), [wt, He] = T(""), Ce = C(() => {
|
|
1781
|
-
const t = xe.current;
|
|
1782
|
-
t != null && t.parentNode && t.parentNode.removeChild(t), xe.current = null;
|
|
1783
|
-
}, []), Xe = C((t) => {
|
|
1784
|
-
var i;
|
|
1785
|
-
const r = (i = w.current) == null ? void 0 : i.querySelector(
|
|
1786
|
-
".redactor-in"
|
|
1787
|
-
);
|
|
1788
|
-
if (!r) return;
|
|
1789
|
-
let n = xe.current;
|
|
1790
|
-
if (!n || !r.contains(n)) {
|
|
1791
|
-
n = document.createElement("span"), n.setAttribute("data-rte-interim", ""), n.setAttribute("contenteditable", "false");
|
|
1792
|
-
const u = window.getSelection();
|
|
1793
|
-
if (u && u.rangeCount > 0 && r.contains(u.anchorNode)) {
|
|
1794
|
-
const h = u.getRangeAt(0);
|
|
1795
|
-
h.collapse(!1), h.insertNode(n);
|
|
1796
|
-
} else
|
|
1797
|
-
r.appendChild(n);
|
|
1798
|
-
xe.current = n;
|
|
1799
|
-
}
|
|
1800
|
-
n.textContent = t;
|
|
1801
|
-
}, []), Qe = C(() => {
|
|
1802
|
-
var t;
|
|
1803
|
-
(t = pe.current) == null || t.abort();
|
|
1804
|
-
}, []), Ze = C(() => {
|
|
1805
|
-
if (!E) return;
|
|
1806
|
-
const t = new AbortController();
|
|
1807
|
-
pe.current = t, Ue(!1), We(!0), He(H("editor.ai.listening")), Ce(), E({
|
|
1808
|
-
signal: t.signal,
|
|
1809
|
-
// Interim text shows live in the editor (grey + caret); each final
|
|
1810
|
-
// replaces it with committed text at the caret.
|
|
1811
|
-
onPartialTranscript: (r) => {
|
|
1812
|
-
t.signal.aborted || Xe(r);
|
|
1813
|
-
},
|
|
1814
|
-
onFinalTranscript: (r) => {
|
|
1815
|
-
if (t.signal.aborted) return;
|
|
1816
|
-
Ce();
|
|
1817
|
-
const n = r.trim();
|
|
1818
|
-
n && (ie(`${n} `, { asHtml: !1 }), He(n));
|
|
1819
|
-
}
|
|
1820
|
-
}).catch((r) => {
|
|
1821
|
-
t.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError" || Ue(!0);
|
|
1822
|
-
}).finally(() => {
|
|
1823
|
-
Ce(), pe.current === t && (pe.current = null, We(!1), He(""));
|
|
1824
|
-
});
|
|
1825
|
-
}, [E, ie, Ce, Xe, H]), xt = C(() => {
|
|
1826
|
-
be ? Qe() : Ze();
|
|
1827
|
-
}, [be, Ze, Qe]);
|
|
1828
|
-
W(() => () => {
|
|
1829
|
-
var t;
|
|
1830
|
-
return (t = pe.current) == null ? void 0 : t.abort();
|
|
1831
|
-
}, []);
|
|
1832
|
-
const [te, Ie] = T(null), le = $(null), Ye = C(
|
|
1833
|
-
(t, r) => {
|
|
1834
|
-
if (le.current) return;
|
|
1835
|
-
const n = new AbortController();
|
|
1836
|
-
le.current = n, Ie(t);
|
|
1837
|
-
const i = ae();
|
|
1838
|
-
Promise.resolve(r({ html: i, signal: n.signal })).then((u) => {
|
|
1839
|
-
var N;
|
|
1840
|
-
if (n.signal.aborted) return;
|
|
1841
|
-
const h = re(String(u ?? ""));
|
|
1842
|
-
X("source.setCode", h), (N = V.current) == null || N.call(V, { html: h, markdown: "" });
|
|
1843
|
-
}).catch(() => {
|
|
1844
|
-
}).finally(() => {
|
|
1845
|
-
le.current === n && (le.current = null, Ie(null));
|
|
1846
|
-
});
|
|
1847
|
-
},
|
|
1848
|
-
[ae, X]
|
|
1849
|
-
), Je = C(() => {
|
|
1850
|
-
var t;
|
|
1851
|
-
(t = le.current) == null || t.abort(), le.current = null, Ie(null);
|
|
1852
|
-
}, []);
|
|
1853
|
-
W(() => () => {
|
|
1854
|
-
var t;
|
|
1855
|
-
return (t = le.current) == null ? void 0 : t.abort();
|
|
1856
|
-
}, []), W(() => {
|
|
1857
|
-
const t = G.current;
|
|
1858
|
-
if (!t) return;
|
|
1859
|
-
t.value = ht.current;
|
|
1860
|
-
const r = cn(I);
|
|
1861
|
-
if (!r) {
|
|
1862
|
-
U(!0);
|
|
1863
|
-
return;
|
|
1864
|
-
}
|
|
1865
|
-
K.current = r;
|
|
1866
|
-
const n = {
|
|
1867
|
-
lang: O ?? hn(J.language || "en"),
|
|
1868
|
-
// The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
|
|
1869
|
-
// via the command API, so Redactor's native toolbar is suppressed.
|
|
1870
|
-
toolbar: !1,
|
|
1871
|
-
plugins: x ?? [],
|
|
1872
|
-
placeholder: g ?? H("editor.placeholder"),
|
|
1873
|
-
toolbarFixed: !1,
|
|
1874
|
-
// Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
|
|
1875
|
-
shortcodes: !1,
|
|
1876
|
-
imageEditable: !1,
|
|
1877
|
-
imageResizable: !0
|
|
1878
|
-
}, i = m ? { imageUpload: m } : {}, u = (S == null ? void 0 : S.callbacks) ?? {}, h = {
|
|
1879
|
-
...n,
|
|
1880
|
-
...i,
|
|
1881
|
-
...S ?? {},
|
|
1882
|
-
// Re-pin safety-critical keys LAST so consumer `options` can't override
|
|
1883
|
-
// the sanitising change handler, re-enable image editing, or turn off
|
|
1884
|
-
// drag-resize (platform re-pins both image flags — RedactorWysiwyg.js:115-116).
|
|
1885
|
-
imageEditable: !1,
|
|
1886
|
-
imageResizable: !0,
|
|
1887
|
-
callbacks: {
|
|
1888
|
-
...u,
|
|
1889
|
-
changed(N) {
|
|
1890
|
-
const Q = qe(sn(N)), Te = re(Q);
|
|
1891
|
-
he.current = !0, V.current && (ge.current && clearTimeout(ge.current), ge.current = setTimeout(() => {
|
|
1892
|
-
var ye;
|
|
1893
|
-
(ye = V.current) == null || ye.call(V, { html: Te, markdown: "" });
|
|
1894
|
-
}, 100));
|
|
1895
|
-
},
|
|
1896
|
-
keydown(N) {
|
|
1897
|
-
var Q;
|
|
1898
|
-
(Q = ke.current) == null || Q.call(ke, N);
|
|
1899
|
-
},
|
|
1900
|
-
observe() {
|
|
1901
|
-
ne();
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
};
|
|
1905
|
-
try {
|
|
1906
|
-
if (r(R, h), p)
|
|
1907
|
-
try {
|
|
1908
|
-
r(R, "enableReadOnly");
|
|
1909
|
-
} catch {
|
|
1910
|
-
}
|
|
1911
|
-
} catch {
|
|
1912
|
-
U(!0);
|
|
1913
|
-
}
|
|
1914
|
-
return () => {
|
|
1915
|
-
ge.current && clearTimeout(ge.current);
|
|
1916
|
-
try {
|
|
1917
|
-
r(R, "destroy");
|
|
1918
|
-
} catch {
|
|
1919
|
-
}
|
|
1920
|
-
K.current = null;
|
|
1921
|
-
};
|
|
1922
|
-
}, []), W(() => {
|
|
1923
|
-
if (!K.current || c === void 0) return;
|
|
1924
|
-
if (he.current) {
|
|
1925
|
-
he.current = !1;
|
|
1926
|
-
return;
|
|
1927
|
-
}
|
|
1928
|
-
const t = re(qe(c));
|
|
1929
|
-
qe(ae()) !== t && X("source.setCode", t);
|
|
1930
|
-
}, [c, ae, X]), W(() => {
|
|
1931
|
-
fe.current = p;
|
|
1932
|
-
const t = K.current;
|
|
1933
|
-
if (t)
|
|
1934
|
-
try {
|
|
1935
|
-
t(R, p ? "enableReadOnly" : "disableReadOnly");
|
|
1936
|
-
} catch {
|
|
1937
|
-
}
|
|
1938
|
-
}, [p, R]), W(() => {
|
|
1939
|
-
if (!j || c === void 0) return;
|
|
1940
|
-
const t = G.current;
|
|
1941
|
-
if (!t) return;
|
|
1942
|
-
const r = re(c);
|
|
1943
|
-
t.value !== r && document.activeElement !== t && (t.value = r);
|
|
1944
|
-
}, [j, c]);
|
|
1945
|
-
const Le = et(
|
|
1946
|
-
() => ({
|
|
1947
|
-
getHTML() {
|
|
1948
|
-
return ae();
|
|
1949
|
-
},
|
|
1950
|
-
getText() {
|
|
1951
|
-
return ae().replace(/<[^>]*>/g, " ").replace(/ /gi, " ").replace(/\s+/g, " ").trim();
|
|
1952
|
-
},
|
|
1953
|
-
getMarkdown() {
|
|
1954
|
-
return "";
|
|
1955
|
-
},
|
|
1956
|
-
setContent(t) {
|
|
1957
|
-
const r = re(t);
|
|
1958
|
-
X("source.setCode", r) || G.current && (G.current.value = r);
|
|
1959
|
-
},
|
|
1960
|
-
insertAtCursor: ie,
|
|
1961
|
-
applyFormat(t) {
|
|
1962
|
-
const r = un[t];
|
|
1963
|
-
r && ce(...r);
|
|
1964
|
-
},
|
|
1965
|
-
focus() {
|
|
1966
|
-
var r;
|
|
1967
|
-
const t = K.current;
|
|
1968
|
-
if (t)
|
|
1969
|
-
try {
|
|
1970
|
-
t(R, "editor.focus");
|
|
1971
|
-
return;
|
|
1972
|
-
} catch {
|
|
1973
|
-
}
|
|
1974
|
-
(r = G.current) == null || r.focus();
|
|
1975
|
-
},
|
|
1976
|
-
clear() {
|
|
1977
|
-
X("source.setCode", "") || G.current && (G.current.value = "");
|
|
1978
|
-
}
|
|
1979
|
-
}),
|
|
1980
|
-
[R, ae, X, ie, ce]
|
|
1981
|
-
);
|
|
1982
|
-
zt(q, () => Le, [Le]), Rt(Pr, Le, o);
|
|
1983
|
-
const Ct = C(
|
|
1984
|
-
(t) => {
|
|
1985
|
-
var r;
|
|
1986
|
-
(r = V.current) == null || r.call(V, {
|
|
1987
|
-
html: re(t.target.value),
|
|
1988
|
-
markdown: ""
|
|
1989
|
-
});
|
|
1990
|
-
},
|
|
1991
|
-
[]
|
|
1992
|
-
), Ne = l ?? H("editor.regionLabel"), Nt = g ?? H("editor.placeholder");
|
|
1993
|
-
W(() => {
|
|
1994
|
-
var i;
|
|
1995
|
-
if (j) return;
|
|
1996
|
-
const t = (i = w.current) == null ? void 0 : i.querySelector(".redactor-in");
|
|
1997
|
-
if (!t) return;
|
|
1998
|
-
const r = () => {
|
|
1999
|
-
t.getAttribute("role") !== "textbox" && t.setAttribute("role", "textbox"), t.getAttribute("aria-multiline") !== "true" && t.setAttribute("aria-multiline", "true"), t.getAttribute("aria-label") !== Ne && t.setAttribute("aria-label", Ne), t.hasAttribute("aria-labelledby") && t.removeAttribute("aria-labelledby");
|
|
2000
|
-
};
|
|
2001
|
-
r();
|
|
2002
|
-
const n = new MutationObserver(r);
|
|
2003
|
-
return n.observe(t, {
|
|
2004
|
-
attributes: !0,
|
|
2005
|
-
attributeFilter: ["role", "aria-labelledby"]
|
|
2006
|
-
}), () => n.disconnect();
|
|
2007
|
-
}, [j, Ne]);
|
|
2008
|
-
const $e = te !== null, ue = [];
|
|
2009
|
-
return E && ue.push({
|
|
2010
|
-
key: "dictate",
|
|
2011
|
-
icon: be ? /* @__PURE__ */ e(_e, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(lt, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2012
|
-
label: H(be ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
2013
|
-
onClick: xt,
|
|
2014
|
-
recording: be
|
|
2015
|
-
}), Y && ue.push({
|
|
2016
|
-
key: "proofread",
|
|
2017
|
-
// While running, the segment becomes a STOP/cancel button (progress is
|
|
2018
|
-
// shown by the scrim spinner).
|
|
2019
|
-
icon: te === "proofread" ? /* @__PURE__ */ e(_e, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(Sr, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2020
|
-
label: te === "proofread" ? H("common.cancel") : H("editor.ai.proofread", "Check spelling & grammar"),
|
|
2021
|
-
onClick: te === "proofread" ? Je : () => Ye("proofread", Y),
|
|
2022
|
-
running: te === "proofread"
|
|
2023
|
-
}), L && ue.push({
|
|
2024
|
-
key: "format",
|
|
2025
|
-
icon: te === "format" ? /* @__PURE__ */ e(_e, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(qr, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2026
|
-
label: te === "format" ? H("common.cancel") : H("editor.ai.autoFormat", "Auto-format document"),
|
|
2027
|
-
onClick: te === "format" ? Je : () => Ye("format", L),
|
|
2028
|
-
running: te === "format"
|
|
2029
|
-
}), k && ue.push({
|
|
2030
|
-
key: "write",
|
|
2031
|
-
icon: /* @__PURE__ */ e(Bt, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2032
|
-
label: H("editor.ai.helpMeWrite"),
|
|
2033
|
-
onClick: () => {
|
|
2034
|
-
Ve(), Be(!0);
|
|
2035
|
-
}
|
|
2036
|
-
}), /* @__PURE__ */ y(
|
|
2037
|
-
"div",
|
|
2038
|
-
{
|
|
2039
|
-
ref: w,
|
|
2040
|
-
className: [fn(), z].filter(Boolean).join(" "),
|
|
2041
|
-
"data-component": "rich-text-editor",
|
|
2042
|
-
"data-component-id": o,
|
|
2043
|
-
"data-min-height": b,
|
|
2044
|
-
children: [
|
|
2045
|
-
!j && !p ? /* @__PURE__ */ e(
|
|
2046
|
-
ln,
|
|
2047
|
-
{
|
|
2048
|
-
run: ce,
|
|
2049
|
-
active: Fe,
|
|
2050
|
-
preset: d,
|
|
2051
|
-
insertHtml: Ee,
|
|
2052
|
-
insertTable: yt,
|
|
2053
|
-
saveSelection: Ve,
|
|
2054
|
-
restoreSelection: Ke,
|
|
2055
|
-
getSelectedText: ft,
|
|
2056
|
-
uploadImage: m ? vt : void 0,
|
|
2057
|
-
enableColor: (x == null ? void 0 : x.includes("fontcolor")) ?? !1,
|
|
2058
|
-
enableImage: !!m,
|
|
2059
|
-
enableTable: (x == null ? void 0 : x.includes("table")) ?? !1,
|
|
2060
|
-
showExtensions: v
|
|
2061
|
-
}
|
|
2062
|
-
) : null,
|
|
2063
|
-
/* @__PURE__ */ y("div", { className: "ds:relative", ref: D, children: [
|
|
2064
|
-
/* @__PURE__ */ e(
|
|
2065
|
-
"textarea",
|
|
2066
|
-
{
|
|
2067
|
-
ref: G,
|
|
2068
|
-
id: me,
|
|
2069
|
-
"aria-label": Ne,
|
|
2070
|
-
"aria-multiline": "true",
|
|
2071
|
-
"aria-busy": $e || void 0,
|
|
2072
|
-
placeholder: Nt,
|
|
2073
|
-
onChange: j ? Ct : void 0,
|
|
2074
|
-
readOnly: j ? p : void 0,
|
|
2075
|
-
className: j ? gn() : void 0
|
|
2076
|
-
}
|
|
2077
|
-
),
|
|
2078
|
-
$e ? /* @__PURE__ */ e(
|
|
2079
|
-
"div",
|
|
2080
|
-
{
|
|
2081
|
-
"aria-hidden": "true",
|
|
2082
|
-
className: "ds:absolute ds:inset-0 ds:z-[5] ds:flex ds:items-center ds:justify-center ds:cursor-wait ds:rounded-[var(--radius-md)] ds:bg-[color-mix(in_srgb,var(--background)_40%,transparent)]",
|
|
2083
|
-
children: /* @__PURE__ */ e(it, { size: "lg", variant: "prism" })
|
|
2084
|
-
}
|
|
2085
|
-
) : null,
|
|
2086
|
-
/* @__PURE__ */ y("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
|
|
2087
|
-
ue.length > 0 ? /* @__PURE__ */ e("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10 ds:flex ds:items-center ds:overflow-hidden ds:rounded-full ds:bg-[var(--primary)] ds:bg-[image:var(--gradient-brand)] ds:shadow-[0_8px_24px_color-mix(in_srgb,var(--primary)_35%,transparent)]", children: ue.map((t, r) => /* @__PURE__ */ y(at, { children: [
|
|
2088
|
-
r > 0 ? /* @__PURE__ */ e(
|
|
2089
|
-
"span",
|
|
2090
|
-
{
|
|
2091
|
-
"aria-hidden": "true",
|
|
2092
|
-
className: "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[color-mix(in_srgb,var(--primary-foreground)_35%,transparent)]"
|
|
2093
|
-
}
|
|
2094
|
-
) : null,
|
|
2095
|
-
/* @__PURE__ */ e(
|
|
2096
|
-
"button",
|
|
2097
|
-
{
|
|
2098
|
-
type: "button",
|
|
2099
|
-
onClick: t.onClick,
|
|
2100
|
-
"aria-pressed": t.recording || void 0,
|
|
2101
|
-
"aria-busy": t.running || void 0,
|
|
2102
|
-
disabled: $e && !t.running || void 0,
|
|
2103
|
-
"aria-label": t.label,
|
|
2104
|
-
title: t.label,
|
|
2105
|
-
className: t.recording ? bn : pn,
|
|
2106
|
-
children: t.icon
|
|
2107
|
-
}
|
|
2108
|
-
)
|
|
2109
|
-
] }, t.key)) }) : null,
|
|
2110
|
-
k ? /* @__PURE__ */ e(
|
|
2111
|
-
Kr,
|
|
2112
|
-
{
|
|
2113
|
-
open: ut,
|
|
2114
|
-
onClose: () => Be(!1),
|
|
2115
|
-
onRequestAiDraft: k,
|
|
2116
|
-
onInsert: (t) => {
|
|
2117
|
-
Ke(), ie(t, { asHtml: A !== "text" });
|
|
2118
|
-
},
|
|
2119
|
-
previewAsHtml: A !== "text",
|
|
2120
|
-
privacyNotice: _,
|
|
2121
|
-
onDictate: E
|
|
2122
|
-
}
|
|
2123
|
-
) : null
|
|
2124
|
-
] }),
|
|
2125
|
-
!j && !p && ((x == null ? void 0 : x.includes("table")) ?? !1) ? /* @__PURE__ */ e(
|
|
2126
|
-
an,
|
|
2127
|
-
{
|
|
2128
|
-
active: Fe,
|
|
2129
|
-
run: ce,
|
|
2130
|
-
areaRef: D,
|
|
2131
|
-
getActiveTableEl: gt,
|
|
2132
|
-
enableColor: (x == null ? void 0 : x.includes("fontcolor")) ?? !1,
|
|
2133
|
-
saveTableCell: pt,
|
|
2134
|
-
applyTableBackground: bt
|
|
2135
|
-
}
|
|
2136
|
-
) : null
|
|
2137
|
-
] }),
|
|
2138
|
-
E ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: wt }) : null,
|
|
2139
|
-
E && kt ? /* @__PURE__ */ e(
|
|
2140
|
-
"p",
|
|
2141
|
-
{
|
|
2142
|
-
role: "alert",
|
|
2143
|
-
className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
2144
|
-
children: H("editor.ai.dictationError")
|
|
2145
|
-
}
|
|
2146
|
-
) : null
|
|
2147
|
-
]
|
|
2148
|
-
}
|
|
2149
|
-
);
|
|
2150
|
-
}
|
|
2151
|
-
);
|
|
2152
|
-
yn.displayName = "RichTextEditor";
|
|
2153
|
-
export {
|
|
2154
|
-
yn as R,
|
|
2155
|
-
Pr as r,
|
|
2156
|
-
fn as w
|
|
2157
|
-
};
|
|
2158
|
-
//# sourceMappingURL=rich-text-editor-DlCqPixb.js.map
|