@alfadocs/ui-kit 1.38.0 → 1.40.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/{actions-cell-renderer-CUn1pqEq.js → actions-cell-renderer-BXBy9c0f.js} +3 -3
- package/dist/_chunks/{agenda-tray-CG6jUjKc.js → agenda-tray-CBaJASb5.js} +3 -3
- package/dist/_chunks/{ai-consent-banner-De4gzSBZ.js → ai-consent-banner-D7I2U-cz.js} +37 -36
- package/dist/_chunks/{ai-prompt-input-DdxlaI7q.js → ai-prompt-input-DXknpQCB.js} +2 -2
- package/dist/_chunks/{alia-sidebar-B6bXlZZk.js → alia-sidebar-CUqaJNPQ.js} +7 -7
- package/dist/_chunks/{anamnesis-card-DGwINeNn.js → anamnesis-card-xtEhyojD.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-Cxtgo2ok.js → anamnesis-summary-rows-DQUqwWc1.js} +7 -7
- package/dist/_chunks/{appointment-card-WsDGBBut.js → appointment-card-TgR_2GKS.js} +134 -102
- package/dist/_chunks/{appointment-peek-5S4O1VQP.js → appointment-peek-abiR0T9e.js} +3 -3
- package/dist/_chunks/{appointment-timeline-D-rNwKpS.js → appointment-timeline-CCnyUYKz.js} +67 -63
- package/dist/_chunks/{appointment-tray-CK2CULg_.js → appointment-tray-N0yEI8UF.js} +4 -4
- package/dist/_chunks/{audio-recorder-BlQBC7N_.js → audio-recorder-B7dT-Y3v.js} +3 -3
- package/dist/_chunks/{balance-badge-cell-DHs5p0bA.js → balance-badge-cell-o6LldMUA.js} +5 -5
- package/dist/_chunks/{bishop-score-D5b8tktp.js → bishop-score-Cu70iv9C.js} +2 -2
- package/dist/_chunks/{bmi-calculator-dOKP-vW4.js → bmi-calculator-C9N19aLX.js} +2 -2
- package/dist/_chunks/{booking-x3J7sS2G.js → booking-D43ASl8y.js} +1110 -1104
- package/dist/_chunks/{button-nJaPh_HC.js → button-CaUe1uyd.js} +11 -7
- package/dist/_chunks/{button-group-QmN1VdUW.js → button-group-R32U7SyV.js} +2 -2
- package/dist/_chunks/{calendar-7GAUlsNO.js → calendar-ChJQzRw-.js} +2 -2
- package/dist/_chunks/calendar-workspace-SN23GsXX.js +11378 -0
- package/dist/_chunks/{care-plan-card-COFOI-fI.js → care-plan-card-BOv0NRle.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-BOKn0KW-.js → care-plan-entry-card-d-rZD4li.js} +3 -3
- package/dist/_chunks/{care-plan-header-CbuOuVBw.js → care-plan-header-CEmBXn6-.js} +2 -2
- package/dist/_chunks/{carousel.agent-Dv4a4M8L.js → carousel.agent-z1yLBpyC.js} +2 -2
- package/dist/_chunks/{chart-iWl76PXv.js → chart-PF2krCZC.js} +3 -3
- package/dist/_chunks/{chat-input-qM5QpUSq.js → chat-input-Cj7ZYQr5.js} +2 -2
- package/dist/_chunks/{chat-message-RniXtrCH.js → chat-message-BMVxiUIX.js} +3 -3
- package/dist/_chunks/{code-block-uVjNSI9g.js → code-block-BB-viuTn.js} +2 -2
- package/dist/_chunks/{connection-status-OEsWjmRk.js → connection-status-BmA9T0UO.js} +3 -3
- package/dist/_chunks/{contact-profile-card--My1H2UD.js → contact-profile-card-Zt6WNg1u.js} +2 -2
- package/dist/_chunks/{control-room-rail-DQoHdE1U.js → control-room-rail-CnNZusR5.js} +3 -3
- package/dist/_chunks/{copy-field-fYKpl6aN.js → copy-field-B8XRVmQv.js} +2 -2
- package/dist/_chunks/credit-card-D9XZsHGA.js +15 -0
- package/dist/_chunks/{cycle-calculator-BJeaXiZv.js → cycle-calculator-BH2StWoT.js} +2 -2
- package/dist/_chunks/{dashboard-grid-B23BFzRl.js → dashboard-grid-BcXWL5S9.js} +2 -2
- package/dist/_chunks/{data-table-Dy1lyumT.js → data-table-CcAx_I1w.js} +6 -6
- package/dist/_chunks/{data-table-tabs-BMR0zsVQ.js → data-table-tabs-B9SXA5VP.js} +3 -3
- package/dist/_chunks/{description-list-C1RXMDZ_.js → description-list-BsJ_6CQE.js} +2 -2
- package/dist/_chunks/{document-preview-DsEyRcNd.js → document-preview-COV0BC6n.js} +2 -2
- package/dist/_chunks/{document-scanner-CbWVtm7u.js → document-scanner-B1abl-A4.js} +2 -2
- package/dist/_chunks/{due-date-calculator-Dhc9Ljkb.js → due-date-calculator-Buh_mVHq.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-D7blbDFY.js → editable-currency-cell-renderer-Psb6XKHR.js} +3 -3
- package/dist/_chunks/{editable-description-7ptNpJEg.js → editable-description-ADMVFPUz.js} +3 -3
- package/dist/_chunks/{editor-overlay-8fKAcRsm.js → editor-overlay-9tcPXNWt.js} +2 -2
- package/dist/_chunks/{empty-state-X0sVPfVo.js → empty-state-BUN_UAWf.js} +2 -2
- package/dist/_chunks/{entity-summary-BbW0mIzU.js → entity-summary-DXejuQ8i.js} +3 -3
- package/dist/_chunks/{error-boundary-ayXFCcq4.js → error-boundary-BNT2iQ1w.js} +2 -2
- package/dist/_chunks/{face-scheme-uFvhqz6h.js → face-scheme-Dg6ZyLKb.js} +5 -5
- package/dist/_chunks/{fetal-weight-C6SxchOv.js → fetal-weight-wx4ycKc6.js} +2 -2
- package/dist/_chunks/{field-array-C9dmRaIM.js → field-array-BW9KeeXG.js} +3 -3
- package/dist/_chunks/{file-manager-UlcYQv8n.js → file-manager-BfLQxF5t.js} +136 -150
- package/dist/_chunks/{finished-terminal-Br61Ip4e.js → finished-terminal-DJd7Z_po.js} +2 -2
- package/dist/_chunks/{fiscal-code-input-CkwIdB1y.js → fiscal-code-input-ODQRd_Sw.js} +2 -2
- package/dist/_chunks/folder-BghC8_S2.js +20 -0
- package/dist/_chunks/{freemium-paywall-BqGk_SBU.js → freemium-paywall-Cz-O9lQD.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-DDOGaPvg.js → gestational-age-calculator-CwbecTul.js} +2 -2
- package/dist/_chunks/{hcg-doubling-Bb_n6tEa.js → hcg-doubling-BcXriXJe.js} +2 -2
- package/dist/_chunks/{header-BZ4pZlJV.js → header-3o9o9v_T.js} +2 -2
- package/dist/_chunks/{header-settings-B8mLc03Q.js → header-settings-CTe45iDy.js} +4 -4
- package/dist/_chunks/{hover-card-Bcku1GQu.js → hover-card-BMJBVqIf.js} +2 -2
- package/dist/_chunks/{icon-button-8xqRnkdG.js → icon-button-CehAeZoP.js} +2 -2
- package/dist/_chunks/{icon-button-group-Dj6CRoYR.js → icon-button-group-DkkdIygu.js} +2 -2
- package/dist/_chunks/{icon-picker-CTWzlHJr.js → icon-picker-DMEelg9v.js} +3 -3
- package/dist/_chunks/{image-cropper-C84NDTB7.js → image-cropper-BjPjT7wU.js} +2 -2
- package/dist/_chunks/{info-tip-ey_Pon2y.js → info-tip-iP2Pm9dh.js} +2 -2
- package/dist/_chunks/{insert-result-LCNTskNJ.js → insert-result-DPnOBD85.js} +2 -2
- package/dist/_chunks/{key-value-pair-DczGb4yz.js → key-value-pair-DaQI_LZB.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-BNa8x6oJ.js → link-cell-renderer-s3oHzOwi.js} +2 -2
- package/dist/_chunks/{locale-picker-BLeHbFSc.js → locale-picker-CH3kfrIG.js} +3 -3
- package/dist/_chunks/{map-view-CCAlC9IL.js → map-view-CHw4RL6w.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-BwH6Aruw.js → marketplace-app-shell-d2EtcUbe.js} +4 -4
- package/dist/_chunks/{message-card-Dm5Xshup.js → message-card-V3sFPiQI.js} +3 -3
- package/dist/_chunks/{message-tray-CXjVsKqp.js → message-tray-CrRIHfiQ.js} +4 -4
- package/dist/_chunks/{note-timeline-D2oPuQP6.js → note-timeline-Dn_XTo1s.js} +131 -90
- package/dist/_chunks/{notes-panel-CkbfDDzj.js → notes-panel-CmTqIWlS.js} +277 -241
- package/dist/_chunks/{notification-card-ChcK9Wat.js → notification-card-B2gLO6dK.js} +3 -3
- package/dist/_chunks/{notification-tray-_NoChRKi.js → notification-tray-BOEKegVV.js} +4 -4
- package/dist/_chunks/{optical-prescription-cphK41eP.js → optical-prescription-LGgmtcST.js} +2 -2
- package/dist/_chunks/{panel-subview-BNXN8OEL.js → panel-subview-Cc2Wtt7D.js} +52 -52
- package/dist/_chunks/{patient-details-2cIaL-Zb.js → patient-details-C8ImUrVg.js} +3 -3
- package/dist/_chunks/{patient-field-row-IHb2VFc2.js → patient-field-row-BRSOKvme.js} +7 -7
- package/dist/_chunks/{patient-search-D08b6jgj.js → patient-search-5QcmQKJD.js} +2 -2
- package/dist/_chunks/{patient-summary-card-B131Q7Bp.js → patient-summary-card-BhmKB2KR.js} +7 -7
- package/dist/_chunks/{payment-automation-upsell-BLTdE2em.js → payment-automation-upsell-BKmBXU4i.js} +17 -16
- package/dist/_chunks/{payment-request-card-BxcdvxKR.js → payment-request-card-Cer6XXCn.js} +6 -5
- package/dist/_chunks/{periodontal-chart-BF_e3wZp.js → periodontal-chart-DJoZS_o7.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-BJEuJuzh.js → periodontal-chart-card-Nd1ZoYWb.js} +2 -2
- package/dist/_chunks/{popover-DzR5QYxp.js → popover-DO-pssF3.js} +2 -2
- package/dist/_chunks/{practice-results-CBNRJNnY.js → practice-results-D_jjzwgf.js} +5 -5
- package/dist/_chunks/{pregnancy-dating-nV1_S6w0.js → pregnancy-dating-DcyV9ZRD.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-tRecShAD.js → pregnancy-weight-gain-Bfq4Kwt5.js} +2 -2
- package/dist/_chunks/{privacy-lock-Be39vQUN.js → privacy-lock-CbFCAMM3.js} +3 -3
- package/dist/_chunks/{product-hub-panel-C3bMjscm.js → product-hub-panel-w40-_-1s.js} +3 -3
- package/dist/_chunks/{public-header.agent-Bl1KFwSE.js → public-header.agent-D-EBVskf.js} +3 -3
- package/dist/_chunks/{radiograph-panel.agent-k0G7JuoM.js → radiograph-panel.agent-LrILY2lN.js} +4 -4
- package/dist/_chunks/{receipt-euro-C6k4Gzhr.js → receipt-euro-B1cLM_TN.js} +3 -14
- package/dist/_chunks/{reviews-panel-Cy969x7q.js → reviews-panel-2GVuxGeT.js} +4 -4
- package/dist/_chunks/{rich-text-editor-BTXlorm5.js → rich-text-editor-BJ1-Lkao.js} +1024 -932
- package/dist/_chunks/{session-countdown-QMsnRa1x.js → session-countdown-BqppPrw6.js} +2 -2
- package/dist/_chunks/{sheet-hm04DGFd.js → sheet-C8WIDFS8.js} +2 -2
- package/dist/_chunks/{sign-in-with-alfadocs-button-BLe_quy5.js → sign-in-with-alfadocs-button-DWwBJtyE.js} +2 -2
- package/dist/_chunks/{signature-request-b-86AGlT.js → signature-request-D_j2aQu1.js} +359 -370
- package/dist/_chunks/{slot-grid-Bk3GZL1p.js → slot-grid-B3eOPkKD.js} +4 -4
- package/dist/_chunks/{streaming-text-DjFqLSt_.js → streaming-text-CE1u_oGa.js} +2 -2
- package/dist/_chunks/{task-tray-5co9Jr2L.js → task-tray-DIwjAIes.js} +3 -3
- package/dist/_chunks/{tasks-panel-BpH-x7U3.js → tasks-panel-CpcikOeY.js} +5 -5
- package/dist/_chunks/{theme-toggle-CMz8YfC1.js → theme-toggle-bI0pgDDv.js} +3 -3
- package/dist/_chunks/{toast-8jqtbfAB.js → toast-ZZfhA5u0.js} +2 -2
- package/dist/_chunks/{token-insert-menu-9Um0JinI.js → token-insert-menu-A9B5AJw6.js} +2 -2
- package/dist/_chunks/tool-rail-D89USYE6.js +799 -0
- package/dist/_chunks/{tooth-scheme-BWkYxxjR.js → tooth-scheme-DPAq0vQK.js} +3 -3
- package/dist/_chunks/{transaction-chip-Dth1nThY.js → transaction-chip-CwgcJiqF.js} +47 -46
- package/dist/_chunks/{unit-converter-BTgU50gk.js → unit-converter-C-LpGzrN.js} +2 -2
- package/dist/_chunks/user-plus-BtcOLgNU.js +17 -0
- package/dist/_chunks/{warning-stack-BW5Dwb3z.js → warning-stack-C0glSB7p.js} +3 -3
- package/dist/_chunks/{workflow-map-CXdsxvUj.js → workflow-map-DhR_h5yw.js} +5 -5
- package/dist/agent-catalog.json +3 -418
- package/dist/agent-i18n/en.json +2 -18
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/ai-consent-banner.d.ts +9 -0
- package/dist/components/ai-consent-banner/index.d.ts +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts +24 -0
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/appointment-timeline.d.ts +15 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +6 -0
- package/dist/components/booking/cascade.d.ts +6 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/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/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/connection-status/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dashboard-grid/index.js +1 -1
- package/dist/components/data-table/index.js +4 -4
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/editable-description/index.js +1 -1
- package/dist/components/editor-overlay/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/error-boundary/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/field-array/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/finished-terminal/index.js +1 -1
- package/dist/components/fiscal-code-input/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/image-cropper/index.js +1 -1
- package/dist/components/info-tip/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/note-timeline/index.js +1 -1
- package/dist/components/note-timeline/note-timeline.d.ts +9 -0
- package/dist/components/notes-panel/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +13 -5
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- 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/periodontal-chart/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +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/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +48 -0
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/token-insert-menu/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts +7 -0
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/host-compat.css +13 -4
- package/dist/i18n/locales/ar.d.ts +248 -194
- package/dist/i18n/locales/ar.js +253 -199
- package/dist/i18n/locales/de.d.ts +232 -178
- package/dist/i18n/locales/de.js +237 -183
- package/dist/i18n/locales/el.d.ts +247 -193
- package/dist/i18n/locales/el.js +252 -198
- package/dist/i18n/locales/en.d.ts +54 -0
- package/dist/i18n/locales/en.js +59 -5
- package/dist/i18n/locales/es.d.ts +240 -186
- package/dist/i18n/locales/es.js +245 -191
- package/dist/i18n/locales/fr.d.ts +234 -180
- package/dist/i18n/locales/fr.js +239 -185
- package/dist/i18n/locales/hi.d.ts +248 -194
- package/dist/i18n/locales/hi.js +257 -199
- package/dist/i18n/locales/it.d.ts +192 -138
- package/dist/i18n/locales/it.js +197 -143
- package/dist/i18n/locales/ja.d.ts +246 -192
- package/dist/i18n/locales/ja.js +251 -197
- package/dist/i18n/locales/nl.d.ts +237 -183
- package/dist/i18n/locales/nl.js +242 -188
- package/dist/i18n/locales/pl.d.ts +242 -188
- package/dist/i18n/locales/pl.js +247 -193
- package/dist/i18n/locales/pt.d.ts +242 -188
- package/dist/i18n/locales/pt.js +247 -193
- package/dist/i18n/locales/ro.d.ts +241 -187
- package/dist/i18n/locales/ro.js +246 -192
- package/dist/i18n/locales/ru.d.ts +247 -193
- package/dist/i18n/locales/ru.js +252 -198
- package/dist/i18n/locales/sq.d.ts +241 -187
- package/dist/i18n/locales/sq.js +246 -192
- package/dist/i18n/locales/sv.d.ts +242 -188
- package/dist/i18n/locales/sv.js +247 -193
- package/dist/i18n/locales/tr.d.ts +248 -194
- package/dist/i18n/locales/tr.js +253 -199
- package/dist/i18n/locales/zh.d.ts +241 -187
- package/dist/i18n/locales/zh.js +246 -192
- package/dist/index.js +107 -107
- package/dist/locales/ar.json +253 -199
- package/dist/locales/de.json +237 -183
- package/dist/locales/el.json +252 -198
- package/dist/locales/en.json +59 -5
- package/dist/locales/es.json +245 -191
- package/dist/locales/fr.json +239 -185
- package/dist/locales/hi.json +253 -199
- package/dist/locales/it.json +197 -143
- package/dist/locales/ja.json +251 -197
- package/dist/locales/nl.json +242 -188
- package/dist/locales/pl.json +247 -193
- package/dist/locales/pt.json +247 -193
- package/dist/locales/ro.json +246 -192
- package/dist/locales/ru.json +252 -198
- package/dist/locales/sq.json +246 -192
- package/dist/locales/sv.json +247 -193
- package/dist/locales/tr.json +253 -199
- package/dist/locales/zh.json +246 -192
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar-appointment-details.d.ts +7 -0
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts +10 -5
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts +31 -0
- package/dist/patterns/calendar/calendar-info-hover.d.ts +15 -1
- package/dist/patterns/calendar/calendar-privacy.d.ts +23 -0
- package/dist/patterns/calendar/calendar-rail-settle.d.ts +14 -0
- package/dist/patterns/calendar/calendar-upcoming-panel.d.ts +32 -0
- package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts +62 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts +14 -1
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +37 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +9 -1
- package/dist/patterns/calendar/calendar.model.d.ts +8 -2
- package/dist/patterns/calendar/calendar.sheets.d.ts +49 -28
- package/dist/patterns/calendar/calendar.types.d.ts +6 -0
- package/dist/patterns/calendar/index.d.ts +2 -2
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +3 -1
- package/dist/_chunks/calendar-workspace-Cc1LRVWY.js +0 -9900
- package/dist/_chunks/tool-rail-BP8sjxCw.js +0 -667
|
@@ -1,193 +1,195 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { SafeHtml as
|
|
6
|
-
import { u as
|
|
7
|
-
import { S as
|
|
8
|
-
import {
|
|
9
|
-
import { T as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { C as
|
|
25
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as y, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import { useId as pe, useState as A, useRef as H, useCallback as w, useEffect as G, Fragment as Ke, forwardRef as er, useMemo as Ye, useImperativeHandle as tr } from "react";
|
|
3
|
+
import { c as nt } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as re } from "react-i18next";
|
|
5
|
+
import { SafeHtml as rr, sanitiseHtml as nr } from "../safe-html/index.js";
|
|
6
|
+
import { u as or } from "./registry-DvAUVLHh.js";
|
|
7
|
+
import { S as Nt } from "./spinner-hbwuKwMf.js";
|
|
8
|
+
import { B as ce } from "./button-CaUe1uyd.js";
|
|
9
|
+
import { T as ir } from "./timestamp-BV2lC-wV.js";
|
|
10
|
+
import { A as ar } from "./ai-consent-banner-D7I2U-cz.js";
|
|
11
|
+
import { I as j } from "./icon-button-CehAeZoP.js";
|
|
12
|
+
import { T as sr } from "./text-area-Bt3p7Pt0.js";
|
|
13
|
+
import { E as Ct } from "./editor-overlay-9tcPXNWt.js";
|
|
14
|
+
import { X as bt } from "./x-B5YnXwCz.js";
|
|
15
|
+
import { R as lr } from "./rotate-ccw-BBQnIVTr.js";
|
|
16
|
+
import { C as cr } from "./check-DrFSN__t.js";
|
|
17
|
+
import { S as je } from "./square-DASBRZ0U.js";
|
|
18
|
+
import { M as Mt } from "./mic-CUklMZGF.js";
|
|
19
|
+
import { S as dr } from "./send-C5kDJ-Mz.js";
|
|
20
|
+
import { a as zt } from "./tooltip-Cp-PLePW.js";
|
|
21
|
+
import { P as q } from "./popover-DO-pssF3.js";
|
|
22
|
+
import { D as qe } from "./dropdown-menu-DU-Hrf33.js";
|
|
23
|
+
import { D as K } from "./dialog-BJiLqhx6.js";
|
|
24
|
+
import { C as ot } from "./color-picker-Bl5f0iK1.js";
|
|
25
|
+
import { T as Fe } from "./text-input-CUvCb6ST.js";
|
|
26
|
+
import { C as ur } from "./checkbox-CZkipDn7.js";
|
|
27
|
+
import { F as mr } from "./file-upload-BDpb08GM.js";
|
|
26
28
|
import { c as T } from "./createLucideIcon-DhHxpK9K.js";
|
|
27
|
-
import { E as
|
|
28
|
-
import { H as
|
|
29
|
-
import { I as
|
|
30
|
-
import { C as
|
|
31
|
-
import { T as
|
|
32
|
-
import { A as
|
|
29
|
+
import { E as hr } from "./ellipsis-dRo9ouSU.js";
|
|
30
|
+
import { H as gr } from "./highlighter-DSkckT2Q.js";
|
|
31
|
+
import { I as fr } from "./image-B_5MNK0x.js";
|
|
32
|
+
import { C as pr } from "./chevron-down-DWE7GSq9.js";
|
|
33
|
+
import { T as br } from "./trash-2-uumy3fy1.js";
|
|
34
|
+
import { A as yr } from "./astroid-BN4f5VXU.js";
|
|
33
35
|
/**
|
|
34
36
|
* @license lucide-react v1.22.0 - ISC
|
|
35
37
|
*
|
|
36
38
|
* This source code is licensed under the ISC license.
|
|
37
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
40
|
*/
|
|
39
|
-
const
|
|
41
|
+
const vr = [
|
|
40
42
|
["path", { d: "M4 20h16", key: "14thso" }],
|
|
41
43
|
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
42
44
|
["path", { d: "M8 12h8", key: "1wcyev" }]
|
|
43
|
-
],
|
|
45
|
+
], wr = T("baseline", vr);
|
|
44
46
|
/**
|
|
45
47
|
* @license lucide-react v1.22.0 - ISC
|
|
46
48
|
*
|
|
47
49
|
* This source code is licensed under the ISC license.
|
|
48
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
49
51
|
*/
|
|
50
|
-
const
|
|
52
|
+
const kr = [
|
|
51
53
|
["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
|
|
52
54
|
["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
|
|
53
55
|
["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
|
|
54
|
-
],
|
|
56
|
+
], xr = T("between-horizontal-end", kr);
|
|
55
57
|
/**
|
|
56
58
|
* @license lucide-react v1.22.0 - ISC
|
|
57
59
|
*
|
|
58
60
|
* This source code is licensed under the ISC license.
|
|
59
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
62
|
*/
|
|
61
|
-
const
|
|
63
|
+
const Nr = [
|
|
62
64
|
["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
|
|
63
65
|
["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
|
|
64
66
|
["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
|
|
65
|
-
],
|
|
67
|
+
], Cr = T("between-horizontal-start", Nr);
|
|
66
68
|
/**
|
|
67
69
|
* @license lucide-react v1.22.0 - ISC
|
|
68
70
|
*
|
|
69
71
|
* This source code is licensed under the ISC license.
|
|
70
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
73
|
*/
|
|
72
|
-
const
|
|
74
|
+
const Mr = [
|
|
73
75
|
["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
|
|
74
76
|
["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
|
|
75
77
|
["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
|
|
76
|
-
],
|
|
78
|
+
], zr = T("between-vertical-end", Mr);
|
|
77
79
|
/**
|
|
78
80
|
* @license lucide-react v1.22.0 - ISC
|
|
79
81
|
*
|
|
80
82
|
* This source code is licensed under the ISC license.
|
|
81
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
84
|
*/
|
|
83
|
-
const
|
|
85
|
+
const Tr = [
|
|
84
86
|
["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
|
|
85
87
|
["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
|
|
86
88
|
["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
|
|
87
|
-
],
|
|
89
|
+
], _r = T("between-vertical-start", Tr);
|
|
88
90
|
/**
|
|
89
91
|
* @license lucide-react v1.22.0 - ISC
|
|
90
92
|
*
|
|
91
93
|
* This source code is licensed under the ISC license.
|
|
92
94
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
95
|
*/
|
|
94
|
-
const
|
|
96
|
+
const Ar = [
|
|
95
97
|
[
|
|
96
98
|
"path",
|
|
97
99
|
{ 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" }
|
|
98
100
|
]
|
|
99
|
-
],
|
|
101
|
+
], Rr = T("bold", Ar);
|
|
100
102
|
/**
|
|
101
103
|
* @license lucide-react v1.22.0 - ISC
|
|
102
104
|
*
|
|
103
105
|
* This source code is licensed under the ISC license.
|
|
104
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
107
|
*/
|
|
106
|
-
const
|
|
108
|
+
const Er = [
|
|
107
109
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
108
110
|
["path", { d: "M12 3v18", key: "108xh3" }]
|
|
109
|
-
],
|
|
111
|
+
], Sr = T("columns-2", Er);
|
|
110
112
|
/**
|
|
111
113
|
* @license lucide-react v1.22.0 - ISC
|
|
112
114
|
*
|
|
113
115
|
* This source code is licensed under the ISC license.
|
|
114
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
115
117
|
*/
|
|
116
|
-
const
|
|
118
|
+
const Ir = [
|
|
117
119
|
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
118
120
|
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
119
121
|
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
120
122
|
["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
|
|
121
|
-
],
|
|
123
|
+
], Lr = T("heading-2", Ir);
|
|
122
124
|
/**
|
|
123
125
|
* @license lucide-react v1.22.0 - ISC
|
|
124
126
|
*
|
|
125
127
|
* This source code is licensed under the ISC license.
|
|
126
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
129
|
*/
|
|
128
|
-
const
|
|
130
|
+
const Hr = [
|
|
129
131
|
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
130
132
|
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
131
133
|
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
132
134
|
["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
|
|
133
135
|
["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
|
|
134
|
-
],
|
|
136
|
+
], $r = T("heading-3", Hr);
|
|
135
137
|
/**
|
|
136
138
|
* @license lucide-react v1.22.0 - ISC
|
|
137
139
|
*
|
|
138
140
|
* This source code is licensed under the ISC license.
|
|
139
141
|
* See the LICENSE file in the root directory of this source tree.
|
|
140
142
|
*/
|
|
141
|
-
const
|
|
143
|
+
const Pr = [
|
|
142
144
|
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
143
145
|
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
144
146
|
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
145
|
-
],
|
|
147
|
+
], Dr = T("italic", Pr);
|
|
146
148
|
/**
|
|
147
149
|
* @license lucide-react v1.22.0 - ISC
|
|
148
150
|
*
|
|
149
151
|
* This source code is licensed under the ISC license.
|
|
150
152
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
153
|
*/
|
|
152
|
-
const
|
|
154
|
+
const Or = [
|
|
153
155
|
["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" }],
|
|
154
156
|
["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" }]
|
|
155
|
-
],
|
|
157
|
+
], qr = T("link", Or);
|
|
156
158
|
/**
|
|
157
159
|
* @license lucide-react v1.22.0 - ISC
|
|
158
160
|
*
|
|
159
161
|
* This source code is licensed under the ISC license.
|
|
160
162
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
163
|
*/
|
|
162
|
-
const
|
|
164
|
+
const Br = [
|
|
163
165
|
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
164
166
|
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
165
167
|
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
166
168
|
["path", { d: "M4 4h1v5", key: "10yrso" }],
|
|
167
169
|
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
168
170
|
["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" }]
|
|
169
|
-
],
|
|
171
|
+
], jr = T("list-ordered", Br);
|
|
170
172
|
/**
|
|
171
173
|
* @license lucide-react v1.22.0 - ISC
|
|
172
174
|
*
|
|
173
175
|
* This source code is licensed under the ISC license.
|
|
174
176
|
* See the LICENSE file in the root directory of this source tree.
|
|
175
177
|
*/
|
|
176
|
-
const
|
|
178
|
+
const Fr = [
|
|
177
179
|
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
178
180
|
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
179
181
|
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
180
182
|
["path", { d: "M8 5h13", key: "1pao27" }],
|
|
181
183
|
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
182
184
|
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
183
|
-
],
|
|
185
|
+
], Gr = T("list", Fr);
|
|
184
186
|
/**
|
|
185
187
|
* @license lucide-react v1.22.0 - ISC
|
|
186
188
|
*
|
|
187
189
|
* This source code is licensed under the ISC license.
|
|
188
190
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
191
|
*/
|
|
190
|
-
const
|
|
192
|
+
const Kr = [
|
|
191
193
|
["path", { d: "M11 7 6 2", key: "1jwth8" }],
|
|
192
194
|
["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
|
|
193
195
|
[
|
|
@@ -204,25 +206,25 @@ const _r = [
|
|
|
204
206
|
key: "1nk1rd"
|
|
205
207
|
}
|
|
206
208
|
]
|
|
207
|
-
],
|
|
209
|
+
], Vr = T("paint-bucket", Kr);
|
|
208
210
|
/**
|
|
209
211
|
* @license lucide-react v1.22.0 - ISC
|
|
210
212
|
*
|
|
211
213
|
* This source code is licensed under the ISC license.
|
|
212
214
|
* See the LICENSE file in the root directory of this source tree.
|
|
213
215
|
*/
|
|
214
|
-
const
|
|
216
|
+
const Wr = [
|
|
215
217
|
["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
|
|
216
218
|
["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" }],
|
|
217
219
|
["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
|
|
218
|
-
],
|
|
220
|
+
], Xr = T("paint-roller", Wr);
|
|
219
221
|
/**
|
|
220
222
|
* @license lucide-react v1.22.0 - ISC
|
|
221
223
|
*
|
|
222
224
|
* This source code is licensed under the ISC license.
|
|
223
225
|
* See the LICENSE file in the root directory of this source tree.
|
|
224
226
|
*/
|
|
225
|
-
const
|
|
227
|
+
const Ur = [
|
|
226
228
|
[
|
|
227
229
|
"path",
|
|
228
230
|
{
|
|
@@ -234,68 +236,68 @@ const Sr = [
|
|
|
234
236
|
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
235
237
|
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
236
238
|
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
237
|
-
],
|
|
239
|
+
], Qr = T("palette", Ur);
|
|
238
240
|
/**
|
|
239
241
|
* @license lucide-react v1.22.0 - ISC
|
|
240
242
|
*
|
|
241
243
|
* This source code is licensed under the ISC license.
|
|
242
244
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
245
|
*/
|
|
244
|
-
const
|
|
246
|
+
const Zr = [
|
|
245
247
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
246
248
|
["path", { d: "M9 3v18", key: "fh3hqa" }]
|
|
247
|
-
],
|
|
249
|
+
], Yr = T("panel-left", Zr);
|
|
248
250
|
/**
|
|
249
251
|
* @license lucide-react v1.22.0 - ISC
|
|
250
252
|
*
|
|
251
253
|
* This source code is licensed under the ISC license.
|
|
252
254
|
* See the LICENSE file in the root directory of this source tree.
|
|
253
255
|
*/
|
|
254
|
-
const
|
|
256
|
+
const Jr = [
|
|
255
257
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
256
258
|
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
257
|
-
],
|
|
259
|
+
], en = T("panel-right", Jr);
|
|
258
260
|
/**
|
|
259
261
|
* @license lucide-react v1.22.0 - ISC
|
|
260
262
|
*
|
|
261
263
|
* This source code is licensed under the ISC license.
|
|
262
264
|
* See the LICENSE file in the root directory of this source tree.
|
|
263
265
|
*/
|
|
264
|
-
const
|
|
266
|
+
const tn = [
|
|
265
267
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
266
268
|
["path", { d: "M14 9h1", key: "l0svgy" }],
|
|
267
269
|
["path", { d: "M19 9h2", key: "te2zfg" }],
|
|
268
270
|
["path", { d: "M3 9h2", key: "1h4ldw" }],
|
|
269
271
|
["path", { d: "M9 9h1", key: "15jzuz" }]
|
|
270
|
-
],
|
|
272
|
+
], rn = T("panel-top-dashed", tn);
|
|
271
273
|
/**
|
|
272
274
|
* @license lucide-react v1.22.0 - ISC
|
|
273
275
|
*
|
|
274
276
|
* This source code is licensed under the ISC license.
|
|
275
277
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
278
|
*/
|
|
277
|
-
const
|
|
279
|
+
const nn = [
|
|
278
280
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
279
281
|
["path", { d: "M3 9h18", key: "1pudct" }]
|
|
280
|
-
],
|
|
282
|
+
], on = T("panel-top", nn);
|
|
281
283
|
/**
|
|
282
284
|
* @license lucide-react v1.22.0 - ISC
|
|
283
285
|
*
|
|
284
286
|
* This source code is licensed under the ISC license.
|
|
285
287
|
* See the LICENSE file in the root directory of this source tree.
|
|
286
288
|
*/
|
|
287
|
-
const
|
|
289
|
+
const an = [
|
|
288
290
|
["path", { d: "M13 4v16", key: "8vvj80" }],
|
|
289
291
|
["path", { d: "M17 4v16", key: "7dpous" }],
|
|
290
292
|
["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
|
|
291
|
-
],
|
|
293
|
+
], sn = T("pilcrow", an);
|
|
292
294
|
/**
|
|
293
295
|
* @license lucide-react v1.22.0 - ISC
|
|
294
296
|
*
|
|
295
297
|
* This source code is licensed under the ISC license.
|
|
296
298
|
* See the LICENSE file in the root directory of this source tree.
|
|
297
299
|
*/
|
|
298
|
-
const
|
|
300
|
+
const ln = [
|
|
299
301
|
[
|
|
300
302
|
"path",
|
|
301
303
|
{
|
|
@@ -310,101 +312,101 @@ const Kr = [
|
|
|
310
312
|
key: "1ymkrd"
|
|
311
313
|
}
|
|
312
314
|
]
|
|
313
|
-
],
|
|
315
|
+
], cn = T("quote", ln);
|
|
314
316
|
/**
|
|
315
317
|
* @license lucide-react v1.22.0 - ISC
|
|
316
318
|
*
|
|
317
319
|
* This source code is licensed under the ISC license.
|
|
318
320
|
* See the LICENSE file in the root directory of this source tree.
|
|
319
321
|
*/
|
|
320
|
-
const
|
|
322
|
+
const dn = [
|
|
321
323
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
322
324
|
["path", { d: "M3 12h18", key: "1i2n21" }]
|
|
323
|
-
],
|
|
325
|
+
], un = T("rows-2", dn);
|
|
324
326
|
/**
|
|
325
327
|
* @license lucide-react v1.22.0 - ISC
|
|
326
328
|
*
|
|
327
329
|
* This source code is licensed under the ISC license.
|
|
328
330
|
* See the LICENSE file in the root directory of this source tree.
|
|
329
331
|
*/
|
|
330
|
-
const
|
|
332
|
+
const mn = [
|
|
331
333
|
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
332
334
|
["path", { d: "M8 12h8", key: "1wcyev" }],
|
|
333
335
|
["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
|
|
334
|
-
],
|
|
336
|
+
], hn = T("spell-check", mn);
|
|
335
337
|
/**
|
|
336
338
|
* @license lucide-react v1.22.0 - ISC
|
|
337
339
|
*
|
|
338
340
|
* This source code is licensed under the ISC license.
|
|
339
341
|
* See the LICENSE file in the root directory of this source tree.
|
|
340
342
|
*/
|
|
341
|
-
const
|
|
343
|
+
const gn = [
|
|
342
344
|
["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
|
|
343
345
|
["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
|
|
344
346
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
|
|
345
|
-
],
|
|
347
|
+
], fn = T("strikethrough", gn);
|
|
346
348
|
/**
|
|
347
349
|
* @license lucide-react v1.22.0 - ISC
|
|
348
350
|
*
|
|
349
351
|
* This source code is licensed under the ISC license.
|
|
350
352
|
* See the LICENSE file in the root directory of this source tree.
|
|
351
353
|
*/
|
|
352
|
-
const
|
|
354
|
+
const pn = [
|
|
353
355
|
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
354
356
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
355
357
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
356
358
|
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
357
|
-
],
|
|
359
|
+
], bn = T("table", pn);
|
|
358
360
|
/**
|
|
359
361
|
* @license lucide-react v1.22.0 - ISC
|
|
360
362
|
*
|
|
361
363
|
* This source code is licensed under the ISC license.
|
|
362
364
|
* See the LICENSE file in the root directory of this source tree.
|
|
363
365
|
*/
|
|
364
|
-
const
|
|
366
|
+
const yn = [
|
|
365
367
|
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
366
368
|
["path", { d: "M17 12H7", key: "16if0g" }],
|
|
367
369
|
["path", { d: "M19 19H5", key: "vjpgq2" }]
|
|
368
|
-
],
|
|
370
|
+
], vn = T("text-align-center", yn);
|
|
369
371
|
/**
|
|
370
372
|
* @license lucide-react v1.22.0 - ISC
|
|
371
373
|
*
|
|
372
374
|
* This source code is licensed under the ISC license.
|
|
373
375
|
* See the LICENSE file in the root directory of this source tree.
|
|
374
376
|
*/
|
|
375
|
-
const
|
|
377
|
+
const wn = [
|
|
376
378
|
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
377
379
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
378
380
|
["path", { d: "M21 19H7", key: "4cu937" }]
|
|
379
|
-
],
|
|
381
|
+
], kn = T("text-align-end", wn);
|
|
380
382
|
/**
|
|
381
383
|
* @license lucide-react v1.22.0 - ISC
|
|
382
384
|
*
|
|
383
385
|
* This source code is licensed under the ISC license.
|
|
384
386
|
* See the LICENSE file in the root directory of this source tree.
|
|
385
387
|
*/
|
|
386
|
-
const
|
|
388
|
+
const xn = [
|
|
387
389
|
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
388
390
|
["path", { d: "M15 12H3", key: "6jk70r" }],
|
|
389
391
|
["path", { d: "M17 19H3", key: "z6ezky" }]
|
|
390
|
-
],
|
|
392
|
+
], Nn = T("text-align-start", xn);
|
|
391
393
|
/**
|
|
392
394
|
* @license lucide-react v1.22.0 - ISC
|
|
393
395
|
*
|
|
394
396
|
* This source code is licensed under the ISC license.
|
|
395
397
|
* See the LICENSE file in the root directory of this source tree.
|
|
396
398
|
*/
|
|
397
|
-
const
|
|
399
|
+
const Cn = [
|
|
398
400
|
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
|
|
399
401
|
["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
|
|
400
|
-
],
|
|
402
|
+
], Mn = T("underline", Cn);
|
|
401
403
|
/**
|
|
402
404
|
* @license lucide-react v1.22.0 - ISC
|
|
403
405
|
*
|
|
404
406
|
* This source code is licensed under the ISC license.
|
|
405
407
|
* See the LICENSE file in the root directory of this source tree.
|
|
406
408
|
*/
|
|
407
|
-
const
|
|
409
|
+
const zn = [
|
|
408
410
|
[
|
|
409
411
|
"path",
|
|
410
412
|
{
|
|
@@ -419,14 +421,14 @@ const cn = [
|
|
|
419
421
|
["path", { d: "M7 8H3", key: "zfb6yr" }],
|
|
420
422
|
["path", { d: "M21 16h-4", key: "1cnmox" }],
|
|
421
423
|
["path", { d: "M11 3H9", key: "1obp7u" }]
|
|
422
|
-
],
|
|
424
|
+
], Tn = T("wand-sparkles", zn);
|
|
423
425
|
/**
|
|
424
426
|
* @license lucide-react v1.22.0 - ISC
|
|
425
427
|
*
|
|
426
428
|
* This source code is licensed under the ISC license.
|
|
427
429
|
* See the LICENSE file in the root directory of this source tree.
|
|
428
430
|
*/
|
|
429
|
-
const
|
|
431
|
+
const _n = [
|
|
430
432
|
[
|
|
431
433
|
"path",
|
|
432
434
|
{
|
|
@@ -434,7 +436,7 @@ const un = [
|
|
|
434
436
|
key: "1ngwbx"
|
|
435
437
|
}
|
|
436
438
|
]
|
|
437
|
-
],
|
|
439
|
+
], An = T("wrench", _n), Rn = {
|
|
438
440
|
id: "rich-text-editor",
|
|
439
441
|
capabilities: ["edit_inline"],
|
|
440
442
|
state: {
|
|
@@ -571,7 +573,7 @@ const un = [
|
|
|
571
573
|
description: "Sourced from the id prop."
|
|
572
574
|
}
|
|
573
575
|
}
|
|
574
|
-
},
|
|
576
|
+
}, En = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", fe = "ds:!size-[var(--min-target-size)]", Sn = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", In = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", yt = [
|
|
575
577
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
576
578
|
"ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
|
|
577
579
|
"ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
|
|
@@ -585,91 +587,91 @@ const un = [
|
|
|
585
587
|
"ds:[&_ul]:list-disc ds:[&_ol]:list-decimal",
|
|
586
588
|
"ds:[&_ul]:ps-[var(--spacing-md)] ds:[&_ol]:ps-[var(--spacing-md)]"
|
|
587
589
|
].join(" ");
|
|
588
|
-
function
|
|
590
|
+
function vt(o, i) {
|
|
589
591
|
return i ? o ? /\s$/.test(o) ? `${o}${i}` : `${o} ${i}` : i : o;
|
|
590
592
|
}
|
|
591
|
-
function
|
|
593
|
+
function Ln({
|
|
592
594
|
open: o,
|
|
593
595
|
onClose: i,
|
|
594
|
-
onRequestAiDraft:
|
|
596
|
+
onRequestAiDraft: f,
|
|
595
597
|
onInsert: c,
|
|
596
|
-
previewAsHtml:
|
|
598
|
+
previewAsHtml: h = !0,
|
|
597
599
|
privacyNotice: d,
|
|
598
|
-
onDictate:
|
|
600
|
+
onDictate: v
|
|
599
601
|
}) {
|
|
600
|
-
const { t:
|
|
601
|
-
var
|
|
602
|
-
(
|
|
603
|
-
}, []),
|
|
604
|
-
if (!
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
signal:
|
|
602
|
+
const { t: m } = re(), k = pe(), N = pe(), [R, $] = A(""), [I, C] = A(!1), [P, l] = A(!1), [a, p] = A(null), E = H(null), [x, u] = A(!1), [Y, S] = A(""), [V, F] = A(""), W = H(null), M = w(() => {
|
|
603
|
+
var L;
|
|
604
|
+
(L = W.current) == null || L.abort();
|
|
605
|
+
}, []), B = w(() => {
|
|
606
|
+
if (!v) return;
|
|
607
|
+
const L = new AbortController();
|
|
608
|
+
W.current = L, u(!0), S(""), F(m("editor.ai.listening")), v({
|
|
609
|
+
signal: L.signal,
|
|
608
610
|
onPartialTranscript: (O) => {
|
|
609
|
-
|
|
611
|
+
L.signal.aborted || S(O);
|
|
610
612
|
},
|
|
611
613
|
onFinalTranscript: (O) => {
|
|
612
|
-
if (
|
|
613
|
-
const
|
|
614
|
-
|
|
614
|
+
if (L.signal.aborted) return;
|
|
615
|
+
const D = O.trim();
|
|
616
|
+
S(""), D && ($((ee) => vt(ee, D)), F(D));
|
|
615
617
|
}
|
|
616
618
|
}).catch(() => {
|
|
617
619
|
}).finally(() => {
|
|
618
|
-
|
|
620
|
+
S(""), W.current === L && (W.current = null, u(!1), F(""));
|
|
619
621
|
});
|
|
620
|
-
}, [
|
|
621
|
-
x ?
|
|
622
|
-
}, [x,
|
|
623
|
-
|
|
624
|
-
var
|
|
625
|
-
o ? (
|
|
626
|
-
}, [o]),
|
|
622
|
+
}, [v, m]), Q = w(() => {
|
|
623
|
+
x ? M() : B();
|
|
624
|
+
}, [x, B, M]);
|
|
625
|
+
G(() => {
|
|
626
|
+
var L, O;
|
|
627
|
+
o ? ($(""), C(!1), l(!1), p(null), S(""), F("")) : ((L = E.current) == null || L.abort(), E.current = null, (O = W.current) == null || O.abort());
|
|
628
|
+
}, [o]), G(
|
|
627
629
|
() => () => {
|
|
628
|
-
var
|
|
629
|
-
(
|
|
630
|
+
var L, O;
|
|
631
|
+
(L = E.current) == null || L.abort(), (O = W.current) == null || O.abort();
|
|
630
632
|
},
|
|
631
633
|
[]
|
|
632
634
|
);
|
|
633
|
-
const
|
|
634
|
-
var
|
|
635
|
-
const
|
|
636
|
-
if (!
|
|
637
|
-
|
|
635
|
+
const de = w(() => {
|
|
636
|
+
var D;
|
|
637
|
+
const L = R.trim();
|
|
638
|
+
if (!L || I) return;
|
|
639
|
+
M(), (D = E.current) == null || D.abort();
|
|
638
640
|
const O = new AbortController();
|
|
639
|
-
|
|
640
|
-
O.signal.aborted || (
|
|
641
|
-
}).catch((
|
|
642
|
-
O.signal.aborted ||
|
|
641
|
+
E.current = O, l(!1), C(!0), f({ prompt: L, signal: O.signal }).then((ee) => {
|
|
642
|
+
O.signal.aborted || (p(ee), C(!1));
|
|
643
|
+
}).catch((ee) => {
|
|
644
|
+
O.signal.aborted || ee && typeof ee == "object" && "name" in ee && ee.name === "AbortError" || (l(!0), C(!1));
|
|
643
645
|
});
|
|
644
|
-
}, [
|
|
646
|
+
}, [R, I, f, M]), _ = w(() => {
|
|
645
647
|
a != null && (c(a), i());
|
|
646
|
-
}, [a, c, i]),
|
|
648
|
+
}, [a, c, i]), J = a != null, X = x ? vt(R, Y) : R;
|
|
647
649
|
return /* @__PURE__ */ e(
|
|
648
|
-
|
|
650
|
+
Ct,
|
|
649
651
|
{
|
|
650
652
|
open: o,
|
|
651
653
|
onClose: i,
|
|
652
|
-
ariaLabel:
|
|
653
|
-
children:
|
|
654
|
+
ariaLabel: m("editor.ai.dialogTitle"),
|
|
655
|
+
children: J ? /* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
654
656
|
/* @__PURE__ */ e(
|
|
655
|
-
|
|
657
|
+
j,
|
|
656
658
|
{
|
|
657
659
|
size: "md",
|
|
658
660
|
intent: "outline",
|
|
659
|
-
className:
|
|
660
|
-
icon: /* @__PURE__ */ e(
|
|
661
|
-
"aria-label":
|
|
661
|
+
className: fe,
|
|
662
|
+
icon: /* @__PURE__ */ e(bt, {}),
|
|
663
|
+
"aria-label": m("common.close"),
|
|
662
664
|
onClick: i
|
|
663
665
|
}
|
|
664
666
|
),
|
|
665
|
-
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children:
|
|
666
|
-
|
|
667
|
+
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: h ? /* @__PURE__ */ e(
|
|
668
|
+
rr,
|
|
667
669
|
{
|
|
668
670
|
html: a,
|
|
669
671
|
profile: "rich-text",
|
|
670
|
-
className:
|
|
672
|
+
className: yt,
|
|
671
673
|
tabIndex: 0,
|
|
672
|
-
"aria-label":
|
|
674
|
+
"aria-label": m("editor.ai.dialogTitle")
|
|
673
675
|
}
|
|
674
676
|
) : (
|
|
675
677
|
// Focusable so a keyboard user can scroll a long draft preview
|
|
@@ -677,161 +679,161 @@ function bn({
|
|
|
677
679
|
// tabIndex allowlist doesn't cover a scrollable, non-interactive
|
|
678
680
|
// text region.
|
|
679
681
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
680
|
-
/* @__PURE__ */ e("p", { className:
|
|
682
|
+
/* @__PURE__ */ e("p", { className: yt, tabIndex: 0, children: a })
|
|
681
683
|
) }),
|
|
682
684
|
/* @__PURE__ */ e(
|
|
683
|
-
|
|
685
|
+
j,
|
|
684
686
|
{
|
|
685
687
|
size: "md",
|
|
686
688
|
intent: "outline",
|
|
687
|
-
className: `${
|
|
688
|
-
icon: /* @__PURE__ */ e(
|
|
689
|
-
"aria-label":
|
|
690
|
-
onClick: () =>
|
|
689
|
+
className: `${fe} ds:rounded-full`,
|
|
690
|
+
icon: /* @__PURE__ */ e(lr, {}),
|
|
691
|
+
"aria-label": m("editor.ai.retry"),
|
|
692
|
+
onClick: () => p(null)
|
|
691
693
|
}
|
|
692
694
|
),
|
|
693
695
|
/* @__PURE__ */ e(
|
|
694
|
-
|
|
696
|
+
j,
|
|
695
697
|
{
|
|
696
698
|
size: "md",
|
|
697
699
|
intent: "primary",
|
|
698
|
-
className: `${
|
|
699
|
-
icon: /* @__PURE__ */ e(
|
|
700
|
-
"aria-label":
|
|
701
|
-
onClick:
|
|
700
|
+
className: `${fe} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
701
|
+
icon: /* @__PURE__ */ e(cr, {}),
|
|
702
|
+
"aria-label": m("common.confirm"),
|
|
703
|
+
onClick: _
|
|
702
704
|
}
|
|
703
705
|
)
|
|
704
|
-
] }) : /* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
+
] }) : /* @__PURE__ */ y(le, { children: [
|
|
707
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
706
708
|
/* @__PURE__ */ e(
|
|
707
|
-
|
|
709
|
+
j,
|
|
708
710
|
{
|
|
709
711
|
size: "md",
|
|
710
712
|
intent: "outline",
|
|
711
|
-
className:
|
|
712
|
-
icon: /* @__PURE__ */ e(
|
|
713
|
-
"aria-label":
|
|
713
|
+
className: fe,
|
|
714
|
+
icon: /* @__PURE__ */ e(bt, {}),
|
|
715
|
+
"aria-label": m("common.close"),
|
|
714
716
|
onClick: i
|
|
715
717
|
}
|
|
716
718
|
),
|
|
717
719
|
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ e(
|
|
718
|
-
|
|
720
|
+
sr,
|
|
719
721
|
{
|
|
720
|
-
id:
|
|
722
|
+
id: k,
|
|
721
723
|
size: "md",
|
|
722
|
-
value:
|
|
723
|
-
onChange: (
|
|
724
|
-
placeholder:
|
|
725
|
-
"aria-label":
|
|
724
|
+
value: X,
|
|
725
|
+
onChange: (L) => $(L.target.value),
|
|
726
|
+
placeholder: m("editor.ai.promptPlaceholder"),
|
|
727
|
+
"aria-label": m("editor.ai.promptLabel"),
|
|
726
728
|
autoResize: !0,
|
|
727
729
|
minRows: 1,
|
|
728
730
|
maxRows: 3,
|
|
729
731
|
readOnly: x,
|
|
730
|
-
tone:
|
|
731
|
-
"aria-describedby":
|
|
732
|
+
tone: P ? "error" : "default",
|
|
733
|
+
"aria-describedby": P ? N : void 0
|
|
732
734
|
}
|
|
733
735
|
) }),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
+
v ? /* @__PURE__ */ e(
|
|
737
|
+
j,
|
|
736
738
|
{
|
|
737
739
|
size: "md",
|
|
738
740
|
intent: "outline",
|
|
739
|
-
className: x ? `${
|
|
740
|
-
icon: x ? /* @__PURE__ */ e(
|
|
741
|
+
className: x ? `${fe} ${En}` : fe,
|
|
742
|
+
icon: x ? /* @__PURE__ */ e(je, { className: "ds:fill-current" }) : /* @__PURE__ */ e(Mt, {}),
|
|
741
743
|
"aria-pressed": x,
|
|
742
|
-
"aria-label":
|
|
743
|
-
onClick:
|
|
744
|
+
"aria-label": m(x ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
745
|
+
onClick: Q
|
|
744
746
|
}
|
|
745
747
|
) : null,
|
|
746
748
|
/* @__PURE__ */ e(
|
|
747
|
-
|
|
749
|
+
j,
|
|
748
750
|
{
|
|
749
751
|
size: "md",
|
|
750
752
|
intent: "primary",
|
|
751
|
-
icon: I ? /* @__PURE__ */ e(
|
|
752
|
-
className: `${
|
|
753
|
-
disabled: I || !
|
|
753
|
+
icon: I ? /* @__PURE__ */ e(Nt, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ e(dr, {}),
|
|
754
|
+
className: `${fe} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
755
|
+
disabled: I || !R.trim(),
|
|
754
756
|
"aria-busy": I || void 0,
|
|
755
|
-
"aria-label":
|
|
756
|
-
onClick:
|
|
757
|
+
"aria-label": m("editor.ai.generate"),
|
|
758
|
+
onClick: de
|
|
757
759
|
}
|
|
758
760
|
)
|
|
759
761
|
] }),
|
|
760
|
-
|
|
761
|
-
|
|
762
|
+
v ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: V }) : null,
|
|
763
|
+
P ? /* @__PURE__ */ e("p", { id: N, role: "alert", className: In, children: m("editor.ai.error") }) : d ? /* @__PURE__ */ e("p", { className: Sn, children: d }) : null
|
|
762
764
|
] })
|
|
763
765
|
}
|
|
764
766
|
);
|
|
765
767
|
}
|
|
766
|
-
const
|
|
768
|
+
const Hn = {
|
|
767
769
|
bold: {
|
|
768
770
|
id: "bold",
|
|
769
|
-
icon: /* @__PURE__ */ e(
|
|
771
|
+
icon: /* @__PURE__ */ e(Rr, {}),
|
|
770
772
|
label: ["editor.bold", "Bold"],
|
|
771
773
|
command: ["module.inline.format", { tag: "b" }],
|
|
772
774
|
toggle: "bold"
|
|
773
775
|
},
|
|
774
776
|
italic: {
|
|
775
777
|
id: "italic",
|
|
776
|
-
icon: /* @__PURE__ */ e(
|
|
778
|
+
icon: /* @__PURE__ */ e(Dr, {}),
|
|
777
779
|
label: ["editor.italic", "Italic"],
|
|
778
780
|
command: ["module.inline.format", { tag: "i" }],
|
|
779
781
|
toggle: "italic"
|
|
780
782
|
},
|
|
781
783
|
underline: {
|
|
782
784
|
id: "underline",
|
|
783
|
-
icon: /* @__PURE__ */ e(
|
|
785
|
+
icon: /* @__PURE__ */ e(Mn, {}),
|
|
784
786
|
label: ["editor.underline", "Underline"],
|
|
785
787
|
command: ["module.inline.format", { tag: "u" }],
|
|
786
788
|
toggle: "underline"
|
|
787
789
|
},
|
|
788
790
|
strike: {
|
|
789
791
|
id: "strike",
|
|
790
|
-
icon: /* @__PURE__ */ e(
|
|
792
|
+
icon: /* @__PURE__ */ e(fn, {}),
|
|
791
793
|
label: ["editor.strike", "Strikethrough"],
|
|
792
794
|
command: ["module.inline.format", { tag: "del" }],
|
|
793
795
|
toggle: "strike"
|
|
794
796
|
},
|
|
795
797
|
ul: {
|
|
796
798
|
id: "ul",
|
|
797
|
-
icon: /* @__PURE__ */ e(
|
|
799
|
+
icon: /* @__PURE__ */ e(Gr, {}),
|
|
798
800
|
label: ["editor.list.bullet", "Bulleted list"],
|
|
799
801
|
command: ["module.list.toggle", "ul"],
|
|
800
802
|
toggle: "ul"
|
|
801
803
|
},
|
|
802
804
|
ol: {
|
|
803
805
|
id: "ol",
|
|
804
|
-
icon: /* @__PURE__ */ e(
|
|
806
|
+
icon: /* @__PURE__ */ e(jr, {}),
|
|
805
807
|
label: ["editor.list.ordered", "Numbered list"],
|
|
806
808
|
command: ["module.list.toggle", "ol"],
|
|
807
809
|
toggle: "ol"
|
|
808
810
|
}
|
|
809
|
-
},
|
|
811
|
+
}, Je = [
|
|
810
812
|
{
|
|
811
813
|
id: "paragraph",
|
|
812
814
|
tag: "p",
|
|
813
|
-
icon: /* @__PURE__ */ e(
|
|
815
|
+
icon: /* @__PURE__ */ e(sn, {}),
|
|
814
816
|
label: ["editor.paragraph", "Paragraph"]
|
|
815
817
|
},
|
|
816
818
|
{
|
|
817
819
|
id: "h2",
|
|
818
820
|
tag: "h2",
|
|
819
|
-
icon: /* @__PURE__ */ e(
|
|
821
|
+
icon: /* @__PURE__ */ e(Lr, {}),
|
|
820
822
|
label: ["editor.heading2", "Heading 2"]
|
|
821
823
|
},
|
|
822
824
|
{
|
|
823
825
|
id: "h3",
|
|
824
826
|
tag: "h3",
|
|
825
|
-
icon: /* @__PURE__ */ e(
|
|
827
|
+
icon: /* @__PURE__ */ e($r, {}),
|
|
826
828
|
label: ["editor.heading3", "Heading 3"]
|
|
827
829
|
},
|
|
828
830
|
{
|
|
829
831
|
id: "quote",
|
|
830
832
|
tag: "blockquote",
|
|
831
|
-
icon: /* @__PURE__ */ e(
|
|
833
|
+
icon: /* @__PURE__ */ e(cn, {}),
|
|
832
834
|
label: ["editor.quote", "Quote"]
|
|
833
835
|
}
|
|
834
|
-
],
|
|
836
|
+
], $n = {
|
|
835
837
|
minimal: ["bold", "italic", "underline", "link"],
|
|
836
838
|
standard: [
|
|
837
839
|
"format",
|
|
@@ -844,96 +846,96 @@ const yn = {
|
|
|
844
846
|
"link"
|
|
845
847
|
],
|
|
846
848
|
full: ["format", "bold", "italic", "underline", "strike", "ul", "ol", "link"]
|
|
847
|
-
},
|
|
849
|
+
}, Tt = [
|
|
848
850
|
{
|
|
849
851
|
id: "rowAbove",
|
|
850
852
|
command: "plugin.table.addRowAbove",
|
|
851
|
-
icon: /* @__PURE__ */ e(
|
|
853
|
+
icon: /* @__PURE__ */ e(Cr, {}),
|
|
852
854
|
label: ["editor.table.rowAbove", "Add row above"]
|
|
853
855
|
},
|
|
854
856
|
{
|
|
855
857
|
id: "rowBelow",
|
|
856
858
|
command: "plugin.table.addRowBelow",
|
|
857
|
-
icon: /* @__PURE__ */ e(
|
|
859
|
+
icon: /* @__PURE__ */ e(xr, {}),
|
|
858
860
|
label: ["editor.table.rowBelow", "Add row below"]
|
|
859
861
|
},
|
|
860
862
|
{
|
|
861
863
|
id: "colLeft",
|
|
862
864
|
command: "plugin.table.addColumnLeft",
|
|
863
|
-
icon: /* @__PURE__ */ e(
|
|
865
|
+
icon: /* @__PURE__ */ e(_r, {}),
|
|
864
866
|
label: ["editor.table.columnLeft", "Add column left"]
|
|
865
867
|
},
|
|
866
868
|
{
|
|
867
869
|
id: "colRight",
|
|
868
870
|
command: "plugin.table.addColumnRight",
|
|
869
|
-
icon: /* @__PURE__ */ e(
|
|
871
|
+
icon: /* @__PURE__ */ e(zr, {}),
|
|
870
872
|
label: ["editor.table.columnRight", "Add column right"]
|
|
871
873
|
},
|
|
872
874
|
{
|
|
873
875
|
id: "addHead",
|
|
874
876
|
command: "plugin.table.addHead",
|
|
875
|
-
icon: /* @__PURE__ */ e(
|
|
877
|
+
icon: /* @__PURE__ */ e(on, {}),
|
|
876
878
|
label: ["editor.table.addHeader", "Add header row"]
|
|
877
879
|
},
|
|
878
880
|
{
|
|
879
881
|
id: "deleteHead",
|
|
880
882
|
command: "plugin.table.deleteHead",
|
|
881
|
-
icon: /* @__PURE__ */ e(
|
|
883
|
+
icon: /* @__PURE__ */ e(rn, {}),
|
|
882
884
|
label: ["editor.table.deleteHeader", "Remove header row"]
|
|
883
885
|
},
|
|
884
886
|
{
|
|
885
887
|
id: "deleteRow",
|
|
886
888
|
command: "plugin.table.deleteRow",
|
|
887
|
-
icon: /* @__PURE__ */ e(
|
|
889
|
+
icon: /* @__PURE__ */ e(un, {}),
|
|
888
890
|
label: ["editor.table.deleteRow", "Delete row"]
|
|
889
891
|
},
|
|
890
892
|
{
|
|
891
893
|
id: "deleteColumn",
|
|
892
894
|
command: "plugin.table.deleteColumn",
|
|
893
|
-
icon: /* @__PURE__ */ e(
|
|
895
|
+
icon: /* @__PURE__ */ e(Sr, {}),
|
|
894
896
|
label: ["editor.table.deleteColumn", "Delete column"]
|
|
895
897
|
},
|
|
896
898
|
{
|
|
897
899
|
id: "deleteTable",
|
|
898
900
|
command: "plugin.table.deleteTable",
|
|
899
|
-
icon: /* @__PURE__ */ e(
|
|
901
|
+
icon: /* @__PURE__ */ e(br, {}),
|
|
900
902
|
label: ["editor.table.deleteTable", "Delete table"]
|
|
901
903
|
}
|
|
902
|
-
],
|
|
904
|
+
], Be = 6, Pn = nt(
|
|
903
905
|
[
|
|
904
906
|
"ds:@container/toolbar",
|
|
905
907
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
906
908
|
"ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
|
|
907
909
|
"ds:shadow-[var(--shadow-md)]"
|
|
908
910
|
].join(" ")
|
|
909
|
-
),
|
|
910
|
-
function
|
|
911
|
+
), Dn = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", it = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", Ce = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
|
|
912
|
+
function Ge(o) {
|
|
911
913
|
return o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
912
914
|
}
|
|
913
|
-
function
|
|
915
|
+
function On({
|
|
914
916
|
run: o,
|
|
915
917
|
active: i,
|
|
916
|
-
onTriggerDown:
|
|
918
|
+
onTriggerDown: f
|
|
917
919
|
}) {
|
|
918
|
-
const { t: c } =
|
|
919
|
-
return /* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */ e(
|
|
921
|
-
|
|
920
|
+
const { t: c } = re(), h = Je.find((d) => i.has(d.id)) ?? Je[0];
|
|
921
|
+
return /* @__PURE__ */ y(qe.Root, { children: [
|
|
922
|
+
/* @__PURE__ */ e(qe.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
923
|
+
ce,
|
|
922
924
|
{
|
|
923
925
|
size: "sm",
|
|
924
926
|
intent: "ghost",
|
|
925
|
-
startIcon:
|
|
926
|
-
endIcon: /* @__PURE__ */ e(
|
|
927
|
+
startIcon: h.icon,
|
|
928
|
+
endIcon: /* @__PURE__ */ e(pr, {}),
|
|
927
929
|
"aria-label": `${c("editor.format", "Paragraph style")}: ${c(
|
|
928
|
-
|
|
929
|
-
|
|
930
|
+
h.label[0],
|
|
931
|
+
h.label[1]
|
|
930
932
|
)}`,
|
|
931
|
-
onMouseDown:
|
|
932
|
-
children: /* @__PURE__ */ e("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: c(
|
|
933
|
+
onMouseDown: f,
|
|
934
|
+
children: /* @__PURE__ */ e("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: c(h.label[0], h.label[1]) })
|
|
933
935
|
}
|
|
934
936
|
) }),
|
|
935
|
-
/* @__PURE__ */ e(
|
|
936
|
-
|
|
937
|
+
/* @__PURE__ */ e(qe.Content, { align: "start", children: Je.map((d) => /* @__PURE__ */ e(
|
|
938
|
+
qe.Item,
|
|
937
939
|
{
|
|
938
940
|
startIcon: d.icon,
|
|
939
941
|
onSelect: () => o("module.block.format", { tag: d.tag }),
|
|
@@ -943,112 +945,112 @@ function xn({
|
|
|
943
945
|
)) })
|
|
944
946
|
] });
|
|
945
947
|
}
|
|
946
|
-
function
|
|
948
|
+
function qn({
|
|
947
949
|
insertHtml: o,
|
|
948
950
|
saveSelection: i,
|
|
949
|
-
restoreSelection:
|
|
951
|
+
restoreSelection: f,
|
|
950
952
|
getSelectedText: c
|
|
951
953
|
}) {
|
|
952
|
-
const { t:
|
|
953
|
-
|
|
954
|
+
const { t: h } = re(), [d, v] = A(!1), [m, k] = A(""), [N, R] = A(""), [$, I] = A(!1), C = pe(), P = pe(), l = () => {
|
|
955
|
+
k(""), R(""), I(!1);
|
|
954
956
|
}, a = () => {
|
|
955
|
-
const
|
|
956
|
-
if (!
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
|
|
957
|
+
const p = m.trim();
|
|
958
|
+
if (!p) return;
|
|
959
|
+
const E = N.trim() || p, x = $ ? ' target="_blank" rel="noopener noreferrer"' : "", u = `<a href="${Ge(p)}"${x}>${Ge(E)}</a>`;
|
|
960
|
+
v(!1), l(), window.requestAnimationFrame(() => {
|
|
961
|
+
f(), o(u);
|
|
960
962
|
});
|
|
961
963
|
};
|
|
962
|
-
return /* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */ e(
|
|
964
|
-
|
|
964
|
+
return /* @__PURE__ */ y(K.Root, { open: d, onOpenChange: v, children: [
|
|
965
|
+
/* @__PURE__ */ e(K.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
966
|
+
j,
|
|
965
967
|
{
|
|
966
968
|
size: "sm",
|
|
967
969
|
intent: "ghost",
|
|
968
|
-
icon: /* @__PURE__ */ e(
|
|
969
|
-
"aria-label":
|
|
970
|
+
icon: /* @__PURE__ */ e(qr, {}),
|
|
971
|
+
"aria-label": h("editor.link.insert", "Insert link"),
|
|
970
972
|
onMouseDown: () => {
|
|
971
|
-
i(),
|
|
973
|
+
i(), R(c());
|
|
972
974
|
}
|
|
973
975
|
}
|
|
974
976
|
) }),
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */ e(
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
977
|
+
/* @__PURE__ */ y(K.Content, { children: [
|
|
978
|
+
/* @__PURE__ */ e(K.Header, { children: /* @__PURE__ */ e(K.Title, { children: h("editor.link.insert", "Insert link") }) }),
|
|
979
|
+
/* @__PURE__ */ y(K.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
980
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
981
|
+
/* @__PURE__ */ e("label", { htmlFor: C, className: Ce, children: h("editor.link.url", "URL") }),
|
|
980
982
|
/* @__PURE__ */ e(
|
|
981
|
-
|
|
983
|
+
Fe,
|
|
982
984
|
{
|
|
983
|
-
id:
|
|
985
|
+
id: C,
|
|
984
986
|
type: "url",
|
|
985
|
-
value:
|
|
986
|
-
onChange: (
|
|
987
|
+
value: m,
|
|
988
|
+
onChange: (p) => k(p.target.value),
|
|
987
989
|
placeholder: "https://…"
|
|
988
990
|
}
|
|
989
991
|
)
|
|
990
992
|
] }),
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
993
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
994
|
+
/* @__PURE__ */ e("label", { htmlFor: P, className: Ce, children: h("editor.link.text", "Text to display") }),
|
|
993
995
|
/* @__PURE__ */ e(
|
|
994
|
-
|
|
996
|
+
Fe,
|
|
995
997
|
{
|
|
996
|
-
id:
|
|
997
|
-
value:
|
|
998
|
-
onChange: (
|
|
999
|
-
placeholder:
|
|
998
|
+
id: P,
|
|
999
|
+
value: N,
|
|
1000
|
+
onChange: (p) => R(p.target.value),
|
|
1001
|
+
placeholder: h("editor.link.textPlaceholder", "Link text")
|
|
1000
1002
|
}
|
|
1001
1003
|
)
|
|
1002
1004
|
] }),
|
|
1003
1005
|
/* @__PURE__ */ e(
|
|
1004
|
-
|
|
1006
|
+
ur,
|
|
1005
1007
|
{
|
|
1006
|
-
checked:
|
|
1007
|
-
onCheckedChange: (
|
|
1008
|
-
label:
|
|
1008
|
+
checked: $,
|
|
1009
|
+
onCheckedChange: (p) => I(p === !0),
|
|
1010
|
+
label: h("editor.link.newTab", "Open in new tab")
|
|
1009
1011
|
}
|
|
1010
1012
|
)
|
|
1011
1013
|
] }),
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */ e(
|
|
1014
|
-
/* @__PURE__ */ e(
|
|
1014
|
+
/* @__PURE__ */ y(K.Footer, { children: [
|
|
1015
|
+
/* @__PURE__ */ e(K.Close, { asChild: !0, children: /* @__PURE__ */ e(ce, { intent: "secondary", children: h("common.cancel") }) }),
|
|
1016
|
+
/* @__PURE__ */ e(ce, { onClick: a, disabled: !m.trim(), children: h("editor.link.insertAction", "Insert") })
|
|
1015
1017
|
] })
|
|
1016
1018
|
] })
|
|
1017
1019
|
] });
|
|
1018
1020
|
}
|
|
1019
|
-
function
|
|
1021
|
+
function Bn({
|
|
1020
1022
|
insertHtml: o,
|
|
1021
1023
|
saveSelection: i,
|
|
1022
|
-
restoreSelection:
|
|
1024
|
+
restoreSelection: f,
|
|
1023
1025
|
uploadImage: c
|
|
1024
1026
|
}) {
|
|
1025
|
-
const { t:
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
|
|
1027
|
+
const { t: h } = re(), [d, v] = A(!1), [m, k] = A(""), [N, R] = A(""), $ = pe(), I = pe(), C = (l, a) => {
|
|
1028
|
+
const p = `<img src="${Ge(l)}" alt="${Ge(a)}" loading="lazy">`;
|
|
1029
|
+
v(!1), k(""), R(""), window.requestAnimationFrame(() => {
|
|
1030
|
+
f(), o(p);
|
|
1029
1031
|
});
|
|
1030
|
-
},
|
|
1031
|
-
const l =
|
|
1032
|
-
l &&
|
|
1032
|
+
}, P = () => {
|
|
1033
|
+
const l = m.trim();
|
|
1034
|
+
l && C(l, N.trim());
|
|
1033
1035
|
};
|
|
1034
|
-
return /* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */ e(
|
|
1036
|
-
|
|
1036
|
+
return /* @__PURE__ */ y(K.Root, { open: d, onOpenChange: v, children: [
|
|
1037
|
+
/* @__PURE__ */ e(K.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1038
|
+
j,
|
|
1037
1039
|
{
|
|
1038
1040
|
size: "sm",
|
|
1039
1041
|
intent: "ghost",
|
|
1040
|
-
icon: /* @__PURE__ */ e(
|
|
1041
|
-
"aria-label":
|
|
1042
|
+
icon: /* @__PURE__ */ e(fr, {}),
|
|
1043
|
+
"aria-label": h("editor.image.insert", "Insert image"),
|
|
1042
1044
|
onMouseDown: () => i()
|
|
1043
1045
|
}
|
|
1044
1046
|
) }),
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */ e(
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
c ? /* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */ e("span", { className:
|
|
1047
|
+
/* @__PURE__ */ y(K.Content, { children: [
|
|
1048
|
+
/* @__PURE__ */ e(K.Header, { children: /* @__PURE__ */ e(K.Title, { children: h("editor.image.insert", "Insert image") }) }),
|
|
1049
|
+
/* @__PURE__ */ y(K.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
1050
|
+
c ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1051
|
+
/* @__PURE__ */ e("span", { className: Ce, children: h("editor.image.upload", "Upload") }),
|
|
1050
1052
|
/* @__PURE__ */ e(
|
|
1051
|
-
|
|
1053
|
+
mr,
|
|
1052
1054
|
{
|
|
1053
1055
|
variant: "dropzone",
|
|
1054
1056
|
accept: {
|
|
@@ -1056,35 +1058,35 @@ function Nn({
|
|
|
1056
1058
|
},
|
|
1057
1059
|
maxFiles: 1,
|
|
1058
1060
|
onUpload: async (l, { signal: a }) => {
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
+
const p = await c(l, a);
|
|
1062
|
+
C(p, l.name);
|
|
1061
1063
|
}
|
|
1062
1064
|
}
|
|
1063
1065
|
),
|
|
1064
|
-
/* @__PURE__ */ e("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children:
|
|
1066
|
+
/* @__PURE__ */ e("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: h("editor.image.orUrl", "Or paste an image URL") })
|
|
1065
1067
|
] }) : null,
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
1068
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1069
|
+
/* @__PURE__ */ e("label", { htmlFor: $, className: Ce, children: h("editor.image.url", "Image URL") }),
|
|
1068
1070
|
/* @__PURE__ */ e(
|
|
1069
|
-
|
|
1071
|
+
Fe,
|
|
1070
1072
|
{
|
|
1071
|
-
id:
|
|
1073
|
+
id: $,
|
|
1072
1074
|
type: "url",
|
|
1073
|
-
value:
|
|
1074
|
-
onChange: (l) =>
|
|
1075
|
+
value: m,
|
|
1076
|
+
onChange: (l) => k(l.target.value),
|
|
1075
1077
|
placeholder: "https://…"
|
|
1076
1078
|
}
|
|
1077
1079
|
)
|
|
1078
1080
|
] }),
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */ e("label", { htmlFor: I, className:
|
|
1081
|
+
/* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1082
|
+
/* @__PURE__ */ e("label", { htmlFor: I, className: Ce, children: h("editor.image.alt", "Alt text") }),
|
|
1081
1083
|
/* @__PURE__ */ e(
|
|
1082
|
-
|
|
1084
|
+
Fe,
|
|
1083
1085
|
{
|
|
1084
1086
|
id: I,
|
|
1085
|
-
value:
|
|
1086
|
-
onChange: (l) =>
|
|
1087
|
-
placeholder:
|
|
1087
|
+
value: N,
|
|
1088
|
+
onChange: (l) => R(l.target.value),
|
|
1089
|
+
placeholder: h(
|
|
1088
1090
|
"editor.image.altPlaceholder",
|
|
1089
1091
|
"Describe the image"
|
|
1090
1092
|
)
|
|
@@ -1092,127 +1094,127 @@ function Nn({
|
|
|
1092
1094
|
)
|
|
1093
1095
|
] })
|
|
1094
1096
|
] }),
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */ e(
|
|
1097
|
-
/* @__PURE__ */ e(
|
|
1097
|
+
/* @__PURE__ */ y(K.Footer, { children: [
|
|
1098
|
+
/* @__PURE__ */ e(K.Close, { asChild: !0, children: /* @__PURE__ */ e(ce, { intent: "secondary", children: h("common.cancel") }) }),
|
|
1099
|
+
/* @__PURE__ */ e(ce, { onClick: P, disabled: !m.trim(), children: h("editor.image.insertAction", "Insert") })
|
|
1098
1100
|
] })
|
|
1099
1101
|
] })
|
|
1100
1102
|
] });
|
|
1101
1103
|
}
|
|
1102
|
-
function
|
|
1104
|
+
function jn({
|
|
1103
1105
|
run: o,
|
|
1104
1106
|
saveSelection: i,
|
|
1105
|
-
restoreSelection:
|
|
1107
|
+
restoreSelection: f
|
|
1106
1108
|
}) {
|
|
1107
|
-
const { t: c } =
|
|
1108
|
-
d(
|
|
1109
|
+
const { t: c } = re(), [h, d] = A("#1f2a5c"), v = (k) => {
|
|
1110
|
+
d(k), f(), o("module.inline.format", {
|
|
1109
1111
|
tag: "span",
|
|
1110
|
-
style: { color:
|
|
1112
|
+
style: { color: k },
|
|
1111
1113
|
type: "toggle"
|
|
1112
1114
|
});
|
|
1113
|
-
},
|
|
1114
|
-
|
|
1115
|
+
}, m = () => {
|
|
1116
|
+
f(), o("module.inline.remove", { style: "color" });
|
|
1115
1117
|
};
|
|
1116
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ y(q, { onOpenChange: (k) => k && i(), children: [
|
|
1117
1119
|
/* @__PURE__ */ e(q.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1118
|
-
|
|
1120
|
+
j,
|
|
1119
1121
|
{
|
|
1120
1122
|
size: "sm",
|
|
1121
1123
|
intent: "ghost",
|
|
1122
|
-
icon: /* @__PURE__ */ e(
|
|
1124
|
+
icon: /* @__PURE__ */ e(Qr, {}),
|
|
1123
1125
|
"aria-label": c("editor.textColor", "Text colour"),
|
|
1124
|
-
onMouseDown: (
|
|
1125
|
-
|
|
1126
|
+
onMouseDown: (k) => {
|
|
1127
|
+
k.preventDefault(), i();
|
|
1126
1128
|
}
|
|
1127
1129
|
}
|
|
1128
1130
|
) }),
|
|
1129
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ y(q.Content, { side: "bottom", align: "start", children: [
|
|
1130
1132
|
/* @__PURE__ */ e(q.Heading, { children: c("editor.textColor", "Text colour") }),
|
|
1131
1133
|
/* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
|
|
1132
|
-
|
|
1134
|
+
ot,
|
|
1133
1135
|
{
|
|
1134
1136
|
variant: "inline",
|
|
1135
1137
|
size: "sm",
|
|
1136
|
-
value:
|
|
1137
|
-
onChange:
|
|
1138
|
+
value: h,
|
|
1139
|
+
onChange: v
|
|
1138
1140
|
}
|
|
1139
1141
|
) }),
|
|
1140
|
-
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(
|
|
1142
|
+
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(ce, { size: "sm", intent: "secondary", onClick: m, children: c("editor.color.remove", "Remove colour") }) })
|
|
1141
1143
|
] })
|
|
1142
1144
|
] });
|
|
1143
1145
|
}
|
|
1144
|
-
function
|
|
1146
|
+
function Fn({
|
|
1145
1147
|
run: o,
|
|
1146
1148
|
saveSelection: i,
|
|
1147
|
-
restoreSelection:
|
|
1149
|
+
restoreSelection: f
|
|
1148
1150
|
}) {
|
|
1149
|
-
const { t: c } =
|
|
1150
|
-
d(
|
|
1151
|
+
const { t: c } = re(), [h, d] = A("#fff3a3"), v = (k) => {
|
|
1152
|
+
d(k), f(), o("module.inline.format", {
|
|
1151
1153
|
tag: "span",
|
|
1152
|
-
style: { "background-color":
|
|
1154
|
+
style: { "background-color": k },
|
|
1153
1155
|
type: "toggle"
|
|
1154
1156
|
});
|
|
1155
|
-
},
|
|
1156
|
-
|
|
1157
|
+
}, m = () => {
|
|
1158
|
+
f(), o("module.inline.remove", { style: "background-color" });
|
|
1157
1159
|
};
|
|
1158
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ y(q, { onOpenChange: (k) => k && i(), children: [
|
|
1159
1161
|
/* @__PURE__ */ e(q.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1160
|
-
|
|
1162
|
+
j,
|
|
1161
1163
|
{
|
|
1162
1164
|
size: "sm",
|
|
1163
1165
|
intent: "ghost",
|
|
1164
|
-
icon: /* @__PURE__ */ e(
|
|
1166
|
+
icon: /* @__PURE__ */ e(gr, {}),
|
|
1165
1167
|
"aria-label": c("editor.highlightColor", "Highlight"),
|
|
1166
|
-
onMouseDown: (
|
|
1167
|
-
|
|
1168
|
+
onMouseDown: (k) => {
|
|
1169
|
+
k.preventDefault(), i();
|
|
1168
1170
|
}
|
|
1169
1171
|
}
|
|
1170
1172
|
) }),
|
|
1171
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ y(q.Content, { side: "bottom", align: "start", children: [
|
|
1172
1174
|
/* @__PURE__ */ e(q.Heading, { children: c("editor.highlightColor", "Highlight") }),
|
|
1173
1175
|
/* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
|
|
1174
|
-
|
|
1176
|
+
ot,
|
|
1175
1177
|
{
|
|
1176
1178
|
variant: "inline",
|
|
1177
1179
|
size: "sm",
|
|
1178
|
-
value:
|
|
1179
|
-
onChange:
|
|
1180
|
+
value: h,
|
|
1181
|
+
onChange: v
|
|
1180
1182
|
}
|
|
1181
1183
|
) }),
|
|
1182
|
-
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(
|
|
1184
|
+
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(ce, { size: "sm", intent: "secondary", onClick: m, children: c("editor.highlight.remove", "Remove highlight") }) })
|
|
1183
1185
|
] })
|
|
1184
1186
|
] });
|
|
1185
1187
|
}
|
|
1186
|
-
function
|
|
1187
|
-
const
|
|
1188
|
-
return `<table><tbody>${Array.from({ length: o }, () => `<tr>${
|
|
1188
|
+
function Gn(o, i) {
|
|
1189
|
+
const f = Array.from({ length: i }, () => "<td><br></td>").join("");
|
|
1190
|
+
return `<table><tbody>${Array.from({ length: o }, () => `<tr>${f}</tr>`).join("")}</tbody></table>`;
|
|
1189
1191
|
}
|
|
1190
|
-
function
|
|
1192
|
+
function Kn({
|
|
1191
1193
|
run: o,
|
|
1192
1194
|
insertTable: i,
|
|
1193
|
-
active:
|
|
1195
|
+
active: f
|
|
1194
1196
|
}) {
|
|
1195
|
-
const { t: c } =
|
|
1196
|
-
return /* @__PURE__ */
|
|
1197
|
+
const { t: c } = re(), [h, d] = A({ r: 0, c: 0 }), v = f.has("table");
|
|
1198
|
+
return /* @__PURE__ */ y(q, { onOpenChange: (m) => !m && d({ r: 0, c: 0 }), children: [
|
|
1197
1199
|
/* @__PURE__ */ e(q.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1198
|
-
|
|
1200
|
+
j,
|
|
1199
1201
|
{
|
|
1200
1202
|
size: "sm",
|
|
1201
1203
|
intent: "ghost",
|
|
1202
|
-
icon: /* @__PURE__ */ e(
|
|
1204
|
+
icon: /* @__PURE__ */ e(bn, {}),
|
|
1203
1205
|
"aria-label": c("editor.table.insert", "Insert table"),
|
|
1204
|
-
onMouseDown: (
|
|
1206
|
+
onMouseDown: (m) => m.preventDefault()
|
|
1205
1207
|
}
|
|
1206
1208
|
) }),
|
|
1207
|
-
/* @__PURE__ */ e(q.Content, { side: "bottom", align: "start", children:
|
|
1209
|
+
/* @__PURE__ */ e(q.Content, { side: "bottom", align: "start", children: v ? (
|
|
1208
1210
|
// Caret is already inside a table — offer the manage ops only, never
|
|
1209
1211
|
// a nested-table insert (mirrors Redactor's native dropdown, which
|
|
1210
1212
|
// disables "insert table" while the caret is in a table).
|
|
1211
|
-
/* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children:
|
|
1213
|
+
/* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: Tt.map((m) => /* @__PURE__ */ y(
|
|
1212
1214
|
"button",
|
|
1213
1215
|
{
|
|
1214
1216
|
type: "button",
|
|
1215
|
-
onClick: () => o(
|
|
1217
|
+
onClick: () => o(m.command),
|
|
1216
1218
|
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)]",
|
|
1217
1219
|
children: [
|
|
1218
1220
|
/* @__PURE__ */ e(
|
|
@@ -1220,15 +1222,15 @@ function _n({
|
|
|
1220
1222
|
{
|
|
1221
1223
|
"aria-hidden": "true",
|
|
1222
1224
|
className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)]",
|
|
1223
|
-
children:
|
|
1225
|
+
children: m.icon
|
|
1224
1226
|
}
|
|
1225
1227
|
),
|
|
1226
|
-
c(
|
|
1228
|
+
c(m.label[0], m.label[1])
|
|
1227
1229
|
]
|
|
1228
1230
|
},
|
|
1229
|
-
|
|
1231
|
+
m.id
|
|
1230
1232
|
)) })
|
|
1231
|
-
) : /* @__PURE__ */
|
|
1233
|
+
) : /* @__PURE__ */ y(le, { children: [
|
|
1232
1234
|
/* @__PURE__ */ e(q.Heading, { children: c("editor.table.insert", "Insert table") }),
|
|
1233
1235
|
/* @__PURE__ */ e(
|
|
1234
1236
|
"div",
|
|
@@ -1237,84 +1239,84 @@ function _n({
|
|
|
1237
1239
|
"aria-label": c("editor.table.sizePicker", "Table size"),
|
|
1238
1240
|
className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
|
|
1239
1241
|
onMouseLeave: () => d({ r: 0, c: 0 }),
|
|
1240
|
-
children: Array.from({ length:
|
|
1241
|
-
const
|
|
1242
|
+
children: Array.from({ length: Be * Be }, (m, k) => {
|
|
1243
|
+
const N = Math.floor(k / Be) + 1, R = k % Be + 1, $ = N <= h.r && R <= h.c;
|
|
1242
1244
|
return /* @__PURE__ */ e(
|
|
1243
1245
|
"button",
|
|
1244
1246
|
{
|
|
1245
1247
|
type: "button",
|
|
1246
1248
|
"aria-label": c("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1247
|
-
r:
|
|
1248
|
-
c:
|
|
1249
|
+
r: N,
|
|
1250
|
+
c: R
|
|
1249
1251
|
}),
|
|
1250
|
-
onMouseEnter: () => d({ r:
|
|
1251
|
-
onClick: () => i(
|
|
1252
|
-
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${
|
|
1252
|
+
onMouseEnter: () => d({ r: N, c: R }),
|
|
1253
|
+
onClick: () => i(Gn(N, R)),
|
|
1254
|
+
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${$ ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
|
|
1253
1255
|
},
|
|
1254
|
-
|
|
1256
|
+
k
|
|
1255
1257
|
);
|
|
1256
1258
|
})
|
|
1257
1259
|
}
|
|
1258
1260
|
),
|
|
1259
|
-
/* @__PURE__ */ e("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children:
|
|
1260
|
-
r:
|
|
1261
|
-
c:
|
|
1261
|
+
/* @__PURE__ */ e("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: h.r > 0 ? c("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1262
|
+
r: h.r,
|
|
1263
|
+
c: h.c
|
|
1262
1264
|
}) : c("editor.table.sizeHint", "Pick a size") })
|
|
1263
1265
|
] }) })
|
|
1264
1266
|
] });
|
|
1265
1267
|
}
|
|
1266
|
-
const
|
|
1268
|
+
const Vn = Object.fromEntries(Tt.map((o) => [o.id, o])), Wn = [
|
|
1267
1269
|
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1268
1270
|
"ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
|
|
1269
1271
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1270
1272
|
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1271
|
-
].join(" "),
|
|
1272
|
-
function
|
|
1273
|
+
].join(" "), Xn = "#fde68a";
|
|
1274
|
+
function wt({
|
|
1273
1275
|
scope: o,
|
|
1274
1276
|
icon: i,
|
|
1275
|
-
label:
|
|
1277
|
+
label: f,
|
|
1276
1278
|
onOpenChange: c,
|
|
1277
|
-
saveTableCell:
|
|
1279
|
+
saveTableCell: h,
|
|
1278
1280
|
applyTableBackground: d
|
|
1279
1281
|
}) {
|
|
1280
|
-
const { t:
|
|
1281
|
-
return /* @__PURE__ */
|
|
1282
|
+
const { t: v } = re(), [m, k] = A(Xn);
|
|
1283
|
+
return /* @__PURE__ */ y(
|
|
1282
1284
|
q,
|
|
1283
1285
|
{
|
|
1284
|
-
onOpenChange: (
|
|
1285
|
-
c(
|
|
1286
|
+
onOpenChange: (N) => {
|
|
1287
|
+
c(N), N && h();
|
|
1286
1288
|
},
|
|
1287
1289
|
children: [
|
|
1288
1290
|
/* @__PURE__ */ e(q.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1289
|
-
|
|
1291
|
+
j,
|
|
1290
1292
|
{
|
|
1291
1293
|
size: "sm",
|
|
1292
1294
|
intent: "ghost",
|
|
1293
1295
|
icon: i,
|
|
1294
|
-
tooltip:
|
|
1295
|
-
onMouseDown: (
|
|
1296
|
+
tooltip: f,
|
|
1297
|
+
onMouseDown: (N) => N.preventDefault()
|
|
1296
1298
|
}
|
|
1297
1299
|
) }),
|
|
1298
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ y(q.Content, { side: "bottom", align: "center", children: [
|
|
1299
1301
|
/* @__PURE__ */ e(
|
|
1300
|
-
|
|
1302
|
+
ot,
|
|
1301
1303
|
{
|
|
1302
1304
|
variant: "inline",
|
|
1303
1305
|
size: "sm",
|
|
1304
|
-
value:
|
|
1305
|
-
onChange: (
|
|
1306
|
-
|
|
1306
|
+
value: m,
|
|
1307
|
+
onChange: (N) => {
|
|
1308
|
+
k(N), d(o, N);
|
|
1307
1309
|
}
|
|
1308
1310
|
}
|
|
1309
1311
|
),
|
|
1310
1312
|
/* @__PURE__ */ e(
|
|
1311
|
-
|
|
1313
|
+
ce,
|
|
1312
1314
|
{
|
|
1313
1315
|
size: "sm",
|
|
1314
1316
|
intent: "ghost",
|
|
1315
1317
|
className: "ds:mt-[var(--spacing-xs)] ds:w-full",
|
|
1316
1318
|
onClick: () => d(o, null),
|
|
1317
|
-
children:
|
|
1319
|
+
children: v("editor.table.clearColor", "Clear colour")
|
|
1318
1320
|
}
|
|
1319
1321
|
)
|
|
1320
1322
|
] })
|
|
@@ -1322,47 +1324,47 @@ function ut({
|
|
|
1322
1324
|
}
|
|
1323
1325
|
);
|
|
1324
1326
|
}
|
|
1325
|
-
function
|
|
1327
|
+
function Un({
|
|
1326
1328
|
active: o,
|
|
1327
1329
|
run: i,
|
|
1328
|
-
areaRef:
|
|
1330
|
+
areaRef: f,
|
|
1329
1331
|
getActiveTableEl: c,
|
|
1330
|
-
enableColor:
|
|
1332
|
+
enableColor: h = !1,
|
|
1331
1333
|
saveTableCell: d,
|
|
1332
|
-
applyTableBackground:
|
|
1334
|
+
applyTableBackground: v
|
|
1333
1335
|
}) {
|
|
1334
|
-
const { t:
|
|
1335
|
-
|
|
1336
|
+
const { t: m } = re(), k = o.has("table"), [N, R] = A(null), $ = H(0), [I, C] = A(!1), P = w((a) => {
|
|
1337
|
+
$.current = Math.max(
|
|
1336
1338
|
0,
|
|
1337
|
-
|
|
1338
|
-
),
|
|
1339
|
+
$.current + (a ? 1 : -1)
|
|
1340
|
+
), C($.current > 0);
|
|
1339
1341
|
}, []);
|
|
1340
|
-
if (
|
|
1342
|
+
if (G(() => {
|
|
1341
1343
|
if (I) return;
|
|
1342
|
-
if (!
|
|
1343
|
-
|
|
1344
|
+
if (!k || typeof window > "u") {
|
|
1345
|
+
R(null);
|
|
1344
1346
|
return;
|
|
1345
1347
|
}
|
|
1346
1348
|
const a = () => {
|
|
1347
|
-
const
|
|
1348
|
-
if (!
|
|
1349
|
-
|
|
1349
|
+
const u = f.current, Y = c();
|
|
1350
|
+
if (!u || !Y) {
|
|
1351
|
+
R(null);
|
|
1350
1352
|
return;
|
|
1351
1353
|
}
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
+
const S = u.getBoundingClientRect(), V = Y.getBoundingClientRect(), F = getComputedStyle(u).direction === "rtl", W = Math.max(0, V.top - S.top - 44), M = F ? S.right - V.right + V.width / 2 : V.left - S.left + V.width / 2;
|
|
1355
|
+
R({ top: W, start: Math.max(0, M), rtl: F });
|
|
1354
1356
|
};
|
|
1355
1357
|
a();
|
|
1356
|
-
const
|
|
1357
|
-
return
|
|
1358
|
-
|
|
1358
|
+
const p = new ResizeObserver(a), E = f.current, x = c();
|
|
1359
|
+
return E && p.observe(E), x && p.observe(x), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
1360
|
+
p.disconnect(), window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
1359
1361
|
};
|
|
1360
|
-
}, [
|
|
1362
|
+
}, [k, I, f, c]), !k && !I || !N) return null;
|
|
1361
1363
|
const l = [
|
|
1362
1364
|
["rowAbove", "rowBelow"],
|
|
1363
1365
|
["colLeft", "colRight"],
|
|
1364
1366
|
["addHead"],
|
|
1365
|
-
...
|
|
1367
|
+
...h ? ["colour"] : [],
|
|
1366
1368
|
["deleteRow", "deleteColumn"],
|
|
1367
1369
|
["deleteTable"]
|
|
1368
1370
|
];
|
|
@@ -1370,54 +1372,54 @@ function Sn({
|
|
|
1370
1372
|
// Tooltips disambiguate the icon-only ops on hover (and provide each
|
|
1371
1373
|
// button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
|
|
1372
1374
|
// needs a provider ancestor, so scope one to the bar.
|
|
1373
|
-
/* @__PURE__ */ e(
|
|
1375
|
+
/* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(
|
|
1374
1376
|
"div",
|
|
1375
1377
|
{
|
|
1376
1378
|
role: "group",
|
|
1377
|
-
"aria-label":
|
|
1378
|
-
className: `${
|
|
1379
|
+
"aria-label": m("editor.table.toolbar", "Table tools"),
|
|
1380
|
+
className: `${Wn} ${N.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1379
1381
|
style: {
|
|
1380
|
-
"--rte-tt-top": `${
|
|
1381
|
-
"--rte-tt-start": `${
|
|
1382
|
+
"--rte-tt-top": `${N.top}px`,
|
|
1383
|
+
"--rte-tt-start": `${N.start}px`
|
|
1382
1384
|
},
|
|
1383
|
-
children: l.map((a,
|
|
1384
|
-
|
|
1385
|
-
a === "colour" ? /* @__PURE__ */
|
|
1385
|
+
children: l.map((a, p) => /* @__PURE__ */ y(Ke, { children: [
|
|
1386
|
+
p > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: it }) : null,
|
|
1387
|
+
a === "colour" ? /* @__PURE__ */ y(le, { children: [
|
|
1386
1388
|
/* @__PURE__ */ e(
|
|
1387
|
-
|
|
1389
|
+
wt,
|
|
1388
1390
|
{
|
|
1389
1391
|
scope: "cell",
|
|
1390
|
-
icon: /* @__PURE__ */ e(
|
|
1391
|
-
label:
|
|
1392
|
-
onOpenChange:
|
|
1392
|
+
icon: /* @__PURE__ */ e(Vr, {}),
|
|
1393
|
+
label: m("editor.table.cellColor", "Cell colour"),
|
|
1394
|
+
onOpenChange: P,
|
|
1393
1395
|
saveTableCell: d,
|
|
1394
|
-
applyTableBackground:
|
|
1396
|
+
applyTableBackground: v
|
|
1395
1397
|
}
|
|
1396
1398
|
),
|
|
1397
1399
|
/* @__PURE__ */ e(
|
|
1398
|
-
|
|
1400
|
+
wt,
|
|
1399
1401
|
{
|
|
1400
1402
|
scope: "row",
|
|
1401
|
-
icon: /* @__PURE__ */ e(
|
|
1402
|
-
label:
|
|
1403
|
-
onOpenChange:
|
|
1403
|
+
icon: /* @__PURE__ */ e(Xr, {}),
|
|
1404
|
+
label: m("editor.table.rowColor", "Row colour"),
|
|
1405
|
+
onOpenChange: P,
|
|
1404
1406
|
saveTableCell: d,
|
|
1405
|
-
applyTableBackground:
|
|
1407
|
+
applyTableBackground: v
|
|
1406
1408
|
}
|
|
1407
1409
|
)
|
|
1408
|
-
] }) : a.map((
|
|
1409
|
-
const x =
|
|
1410
|
+
] }) : a.map((E) => {
|
|
1411
|
+
const x = Vn[E];
|
|
1410
1412
|
return /* @__PURE__ */ e(
|
|
1411
|
-
|
|
1413
|
+
j,
|
|
1412
1414
|
{
|
|
1413
1415
|
size: "sm",
|
|
1414
1416
|
intent: "ghost",
|
|
1415
1417
|
icon: x.icon,
|
|
1416
|
-
tooltip:
|
|
1417
|
-
onMouseDown: (
|
|
1418
|
+
tooltip: m(x.label[0], x.label[1]),
|
|
1419
|
+
onMouseDown: (u) => u.preventDefault(),
|
|
1418
1420
|
onClick: () => i(x.command)
|
|
1419
1421
|
},
|
|
1420
|
-
|
|
1422
|
+
E
|
|
1421
1423
|
);
|
|
1422
1424
|
})
|
|
1423
1425
|
] }, a === "colour" ? "colour" : a[0]))
|
|
@@ -1425,55 +1427,55 @@ function Sn({
|
|
|
1425
1427
|
) })
|
|
1426
1428
|
);
|
|
1427
1429
|
}
|
|
1428
|
-
const
|
|
1430
|
+
const tt = [
|
|
1429
1431
|
"wysiwyg-img-inline",
|
|
1430
1432
|
"wysiwyg-img-wrap-left",
|
|
1431
1433
|
"wysiwyg-img-wrap-right"
|
|
1432
|
-
],
|
|
1434
|
+
], _t = [
|
|
1433
1435
|
"wysiwyg-img-align-left",
|
|
1434
1436
|
"wysiwyg-img-align-center",
|
|
1435
1437
|
"wysiwyg-img-align-right"
|
|
1436
1438
|
];
|
|
1437
|
-
function
|
|
1438
|
-
return i.find((
|
|
1439
|
+
function kt(o, i) {
|
|
1440
|
+
return i.find((f) => o.classList.contains(f)) ?? "";
|
|
1439
1441
|
}
|
|
1440
|
-
function
|
|
1441
|
-
const i = o.closest(".redactor-in"),
|
|
1442
|
-
return
|
|
1442
|
+
function Qn(o) {
|
|
1443
|
+
const i = o.closest(".redactor-in"), f = i instanceof HTMLElement ? i.clientWidth : 0, c = o.getBoundingClientRect().width;
|
|
1444
|
+
return f <= 0 || c <= 0 ? Me : Math.round(Math.min(Me, c / f * 100));
|
|
1443
1445
|
}
|
|
1444
|
-
const
|
|
1446
|
+
const rt = 10, Me = 100, Zn = 5, Yn = 10, xt = (o) => Math.min(Me, Math.max(rt, Math.round(o))), Jn = [
|
|
1445
1447
|
{
|
|
1446
1448
|
id: "wysiwyg-img-inline",
|
|
1447
|
-
icon: /* @__PURE__ */ e(
|
|
1449
|
+
icon: /* @__PURE__ */ e(wr, {}),
|
|
1448
1450
|
label: ["editor.image.inline", "Inline with text"]
|
|
1449
1451
|
},
|
|
1450
1452
|
{
|
|
1451
1453
|
id: "wysiwyg-img-wrap-left",
|
|
1452
|
-
icon: /* @__PURE__ */ e(
|
|
1454
|
+
icon: /* @__PURE__ */ e(Yr, {}),
|
|
1453
1455
|
label: ["editor.image.wrapLeft", "Wrap left"]
|
|
1454
1456
|
},
|
|
1455
1457
|
{
|
|
1456
1458
|
id: "wysiwyg-img-wrap-right",
|
|
1457
|
-
icon: /* @__PURE__ */ e(
|
|
1459
|
+
icon: /* @__PURE__ */ e(en, {}),
|
|
1458
1460
|
label: ["editor.image.wrapRight", "Wrap right"]
|
|
1459
1461
|
}
|
|
1460
|
-
],
|
|
1462
|
+
], eo = [
|
|
1461
1463
|
{
|
|
1462
1464
|
id: "wysiwyg-img-align-left",
|
|
1463
|
-
icon: /* @__PURE__ */ e(
|
|
1465
|
+
icon: /* @__PURE__ */ e(Nn, {}),
|
|
1464
1466
|
label: ["editor.image.alignLeft", "Align left"]
|
|
1465
1467
|
},
|
|
1466
1468
|
{
|
|
1467
1469
|
id: "wysiwyg-img-align-center",
|
|
1468
|
-
icon: /* @__PURE__ */ e(
|
|
1470
|
+
icon: /* @__PURE__ */ e(vn, {}),
|
|
1469
1471
|
label: ["editor.image.alignCenter", "Align centre"]
|
|
1470
1472
|
},
|
|
1471
1473
|
{
|
|
1472
1474
|
id: "wysiwyg-img-align-right",
|
|
1473
|
-
icon: /* @__PURE__ */ e(
|
|
1475
|
+
icon: /* @__PURE__ */ e(kn, {}),
|
|
1474
1476
|
label: ["editor.image.alignRight", "Align right"]
|
|
1475
1477
|
}
|
|
1476
|
-
],
|
|
1478
|
+
], to = [
|
|
1477
1479
|
{
|
|
1478
1480
|
id: "tl",
|
|
1479
1481
|
pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
|
|
@@ -1506,14 +1508,14 @@ const Ve = 10, we = 100, Ln = 5, Hn = 10, ht = (o) => Math.min(we, Math.max(Ve,
|
|
|
1506
1508
|
labelKey: "editor.image.resizeBottomEnd",
|
|
1507
1509
|
labelFallback: "Resize image, bottom-end corner"
|
|
1508
1510
|
}
|
|
1509
|
-
],
|
|
1511
|
+
], ro = [
|
|
1510
1512
|
"ds:absolute ds:z-20 ds:pointer-events-none",
|
|
1511
1513
|
"ds:[inset-block-start:var(--rte-img-top)] ds:[inset-inline-start:var(--rte-img-start)]",
|
|
1512
1514
|
"ds:[inline-size:var(--rte-img-width)] ds:[block-size:var(--rte-img-height)]",
|
|
1513
1515
|
"ds:rounded-[var(--radius-2xs)]",
|
|
1514
1516
|
"ds:[outline-style:solid] ds:[outline-width:var(--border-width-md)]",
|
|
1515
1517
|
"ds:[outline-color:var(--accent)] ds:[outline-offset:var(--focus-ring-offset)]"
|
|
1516
|
-
].join(" "),
|
|
1518
|
+
].join(" "), no = [
|
|
1517
1519
|
"ds:absolute ds:pointer-events-auto ds:touch-none",
|
|
1518
1520
|
"ds:[inline-size:var(--spacing-md)] ds:[block-size:var(--spacing-md)]",
|
|
1519
1521
|
"ds:rounded-[var(--radius-2xs)] ds:shadow-[var(--shadow-sm)]",
|
|
@@ -1522,50 +1524,50 @@ const Ve = 10, we = 100, Ln = 5, Hn = 10, ht = (o) => Math.min(we, Math.max(Ve,
|
|
|
1522
1524
|
"ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)]",
|
|
1523
1525
|
"ds:focus-visible:[outline-offset:var(--focus-ring-offset)]",
|
|
1524
1526
|
"ds:forced-colors:bg-[CanvasText]"
|
|
1525
|
-
].join(" "),
|
|
1527
|
+
].join(" "), oo = [
|
|
1526
1528
|
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1527
1529
|
"ds:[inset-block-start:var(--rte-img-bar-top)] ds:[inset-inline-start:var(--rte-img-center)]",
|
|
1528
1530
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1529
1531
|
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1530
1532
|
].join(" ");
|
|
1531
|
-
function
|
|
1533
|
+
function io({
|
|
1532
1534
|
areaRef: o,
|
|
1533
1535
|
activeImageEl: i,
|
|
1534
|
-
applyImageClass:
|
|
1536
|
+
applyImageClass: f,
|
|
1535
1537
|
setImageWidth: c
|
|
1536
1538
|
}) {
|
|
1537
|
-
const { t:
|
|
1538
|
-
|
|
1539
|
+
const { t: h } = re(), [d, v] = A(null), m = H(null);
|
|
1540
|
+
G(() => {
|
|
1539
1541
|
if (!i || typeof window > "u") {
|
|
1540
|
-
|
|
1542
|
+
v(null);
|
|
1541
1543
|
return;
|
|
1542
1544
|
}
|
|
1543
1545
|
const l = () => {
|
|
1544
|
-
const
|
|
1545
|
-
if (!
|
|
1546
|
-
|
|
1546
|
+
const u = o.current;
|
|
1547
|
+
if (!u) {
|
|
1548
|
+
v(null);
|
|
1547
1549
|
return;
|
|
1548
1550
|
}
|
|
1549
|
-
const Y =
|
|
1550
|
-
|
|
1551
|
-
top:
|
|
1552
|
-
start: Math.max(0,
|
|
1553
|
-
width:
|
|
1554
|
-
height:
|
|
1555
|
-
center: Math.max(0,
|
|
1556
|
-
barTop:
|
|
1557
|
-
pct:
|
|
1558
|
-
rtl:
|
|
1551
|
+
const Y = u.getBoundingClientRect(), S = i.getBoundingClientRect(), V = getComputedStyle(u).direction === "rtl", F = S.top - Y.top, W = V ? Y.right - S.right : S.left - Y.left, M = W + S.width / 2, B = Math.max(0, F - 44);
|
|
1552
|
+
v({
|
|
1553
|
+
top: F,
|
|
1554
|
+
start: Math.max(0, W),
|
|
1555
|
+
width: S.width,
|
|
1556
|
+
height: S.height,
|
|
1557
|
+
center: Math.max(0, M),
|
|
1558
|
+
barTop: B,
|
|
1559
|
+
pct: Qn(i),
|
|
1560
|
+
rtl: V
|
|
1559
1561
|
});
|
|
1560
1562
|
};
|
|
1561
1563
|
l();
|
|
1562
1564
|
const a = new ResizeObserver(l);
|
|
1563
1565
|
a.observe(i);
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
const
|
|
1566
|
+
const p = o.current;
|
|
1567
|
+
p && a.observe(p);
|
|
1568
|
+
const E = i.closest(".redactor-in");
|
|
1567
1569
|
let x = null;
|
|
1568
|
-
return
|
|
1570
|
+
return E && (x = new MutationObserver(l), x.observe(E, {
|
|
1569
1571
|
subtree: !0,
|
|
1570
1572
|
childList: !0,
|
|
1571
1573
|
characterData: !0,
|
|
@@ -1575,9 +1577,9 @@ function Fn({
|
|
|
1575
1577
|
a.disconnect(), x == null || x.disconnect(), window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
1576
1578
|
};
|
|
1577
1579
|
}, [i, o]);
|
|
1578
|
-
const
|
|
1580
|
+
const k = w(
|
|
1579
1581
|
(l) => (a) => {
|
|
1580
|
-
!a.isPrimary || !d || (a.preventDefault(), a.currentTarget.setPointerCapture(a.pointerId),
|
|
1582
|
+
!a.isPrimary || !d || (a.preventDefault(), a.currentTarget.setPointerCapture(a.pointerId), m.current = {
|
|
1581
1583
|
pointerId: a.pointerId,
|
|
1582
1584
|
startX: a.clientX,
|
|
1583
1585
|
startPct: d.pct,
|
|
@@ -1585,115 +1587,115 @@ function Fn({
|
|
|
1585
1587
|
});
|
|
1586
1588
|
},
|
|
1587
1589
|
[d]
|
|
1588
|
-
),
|
|
1590
|
+
), N = w(
|
|
1589
1591
|
(l) => {
|
|
1590
|
-
const a =
|
|
1592
|
+
const a = m.current;
|
|
1591
1593
|
if (!a || l.pointerId !== a.pointerId || !i) return;
|
|
1592
|
-
const
|
|
1593
|
-
if (
|
|
1594
|
-
const x = a.sign * (l.clientX - a.startX) /
|
|
1595
|
-
c(
|
|
1594
|
+
const p = i.closest(".redactor-in"), E = p instanceof HTMLElement ? p.clientWidth : 0;
|
|
1595
|
+
if (E <= 0) return;
|
|
1596
|
+
const x = a.sign * (l.clientX - a.startX) / E * 100;
|
|
1597
|
+
c(xt(a.startPct + x));
|
|
1596
1598
|
},
|
|
1597
1599
|
[i, c]
|
|
1598
|
-
),
|
|
1600
|
+
), R = w(
|
|
1599
1601
|
(l) => {
|
|
1600
|
-
const a =
|
|
1601
|
-
!a || l.pointerId !== a.pointerId || (l.currentTarget.releasePointerCapture(l.pointerId),
|
|
1602
|
+
const a = m.current;
|
|
1603
|
+
!a || l.pointerId !== a.pointerId || (l.currentTarget.releasePointerCapture(l.pointerId), m.current = null);
|
|
1602
1604
|
},
|
|
1603
1605
|
[]
|
|
1604
|
-
),
|
|
1606
|
+
), $ = w(
|
|
1605
1607
|
(l) => {
|
|
1606
1608
|
if (!d) return;
|
|
1607
1609
|
let a = null;
|
|
1608
|
-
const
|
|
1610
|
+
const p = l.shiftKey ? Yn : Zn;
|
|
1609
1611
|
switch (l.key) {
|
|
1610
1612
|
// Up / right always grow; down / left always shrink — independent of
|
|
1611
1613
|
// which corner has focus, so the gesture reads the same everywhere.
|
|
1612
1614
|
case "ArrowRight":
|
|
1613
1615
|
case "ArrowUp":
|
|
1614
|
-
a = d.pct +
|
|
1616
|
+
a = d.pct + p;
|
|
1615
1617
|
break;
|
|
1616
1618
|
case "ArrowLeft":
|
|
1617
1619
|
case "ArrowDown":
|
|
1618
|
-
a = d.pct -
|
|
1620
|
+
a = d.pct - p;
|
|
1619
1621
|
break;
|
|
1620
1622
|
case "Home":
|
|
1621
|
-
a =
|
|
1623
|
+
a = rt;
|
|
1622
1624
|
break;
|
|
1623
1625
|
case "End":
|
|
1624
|
-
a =
|
|
1626
|
+
a = Me;
|
|
1625
1627
|
break;
|
|
1626
1628
|
default:
|
|
1627
1629
|
return;
|
|
1628
1630
|
}
|
|
1629
|
-
l.preventDefault(), c(
|
|
1631
|
+
l.preventDefault(), c(xt(a));
|
|
1630
1632
|
},
|
|
1631
1633
|
[d, c]
|
|
1632
1634
|
);
|
|
1633
1635
|
if (!i || !d) return null;
|
|
1634
|
-
const I =
|
|
1636
|
+
const I = kt(i, tt), C = kt(i, _t), P = h("editor.image.widthAnnounce", {
|
|
1635
1637
|
width: d.pct,
|
|
1636
1638
|
defaultValue: "{{width}} percent"
|
|
1637
1639
|
});
|
|
1638
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ y(le, { children: [
|
|
1639
1641
|
/* @__PURE__ */ e(
|
|
1640
1642
|
"div",
|
|
1641
1643
|
{
|
|
1642
|
-
className:
|
|
1644
|
+
className: ro,
|
|
1643
1645
|
style: {
|
|
1644
1646
|
"--rte-img-top": `${d.top}px`,
|
|
1645
1647
|
"--rte-img-start": `${d.start}px`,
|
|
1646
1648
|
"--rte-img-width": `${d.width}px`,
|
|
1647
1649
|
"--rte-img-height": `${d.height}px`
|
|
1648
1650
|
},
|
|
1649
|
-
children:
|
|
1651
|
+
children: to.map((l) => /* @__PURE__ */ e(
|
|
1650
1652
|
"div",
|
|
1651
1653
|
{
|
|
1652
1654
|
role: "slider",
|
|
1653
1655
|
tabIndex: 0,
|
|
1654
|
-
"aria-label":
|
|
1656
|
+
"aria-label": h(l.labelKey, l.labelFallback),
|
|
1655
1657
|
"aria-orientation": "horizontal",
|
|
1656
|
-
"aria-valuemin":
|
|
1657
|
-
"aria-valuemax":
|
|
1658
|
+
"aria-valuemin": rt,
|
|
1659
|
+
"aria-valuemax": Me,
|
|
1658
1660
|
"aria-valuenow": d.pct,
|
|
1659
|
-
"aria-valuetext":
|
|
1660
|
-
className: `${
|
|
1661
|
-
onPointerDown:
|
|
1662
|
-
onPointerMove:
|
|
1663
|
-
onPointerUp:
|
|
1664
|
-
onPointerCancel:
|
|
1665
|
-
onKeyDown:
|
|
1661
|
+
"aria-valuetext": P,
|
|
1662
|
+
className: `${no} ${l.pos} ${l.cursor}`,
|
|
1663
|
+
onPointerDown: k(l),
|
|
1664
|
+
onPointerMove: N,
|
|
1665
|
+
onPointerUp: R,
|
|
1666
|
+
onPointerCancel: R,
|
|
1667
|
+
onKeyDown: $
|
|
1666
1668
|
},
|
|
1667
1669
|
l.id
|
|
1668
1670
|
))
|
|
1669
1671
|
}
|
|
1670
1672
|
),
|
|
1671
|
-
/* @__PURE__ */ e(
|
|
1673
|
+
/* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(
|
|
1672
1674
|
"div",
|
|
1673
1675
|
{
|
|
1674
1676
|
role: "group",
|
|
1675
|
-
"aria-label":
|
|
1676
|
-
className: `${
|
|
1677
|
+
"aria-label": h("editor.image.toolbar", "Image tools"),
|
|
1678
|
+
className: `${oo} ${d.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1677
1679
|
style: {
|
|
1678
1680
|
"--rte-img-bar-top": `${d.barTop}px`,
|
|
1679
1681
|
"--rte-img-center": `${d.center}px`
|
|
1680
1682
|
},
|
|
1681
|
-
children: [
|
|
1682
|
-
a > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className:
|
|
1683
|
-
l.map((
|
|
1684
|
-
const
|
|
1683
|
+
children: [Jn, eo].map((l, a) => /* @__PURE__ */ y(Ke, { children: [
|
|
1684
|
+
a > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: it }) : null,
|
|
1685
|
+
l.map((p) => {
|
|
1686
|
+
const E = a === 0 ? I === p.id : C === p.id;
|
|
1685
1687
|
return /* @__PURE__ */ e(
|
|
1686
|
-
|
|
1688
|
+
j,
|
|
1687
1689
|
{
|
|
1688
1690
|
size: "sm",
|
|
1689
1691
|
intent: "ghost",
|
|
1690
|
-
icon:
|
|
1691
|
-
"aria-pressed":
|
|
1692
|
-
tooltip:
|
|
1692
|
+
icon: p.icon,
|
|
1693
|
+
"aria-pressed": E,
|
|
1694
|
+
tooltip: h(p.label[0], p.label[1]),
|
|
1693
1695
|
onMouseDown: (x) => x.preventDefault(),
|
|
1694
|
-
onClick: () =>
|
|
1696
|
+
onClick: () => f(p.id)
|
|
1695
1697
|
},
|
|
1696
|
-
|
|
1698
|
+
p.id
|
|
1697
1699
|
);
|
|
1698
1700
|
})
|
|
1699
1701
|
] }, a === 0 ? "flow" : "align"))
|
|
@@ -1701,139 +1703,139 @@ function Fn({
|
|
|
1701
1703
|
) })
|
|
1702
1704
|
] });
|
|
1703
1705
|
}
|
|
1704
|
-
function
|
|
1706
|
+
function ao({
|
|
1705
1707
|
run: o,
|
|
1706
1708
|
active: i,
|
|
1707
|
-
preset:
|
|
1709
|
+
preset: f,
|
|
1708
1710
|
insertHtml: c,
|
|
1709
|
-
insertTable:
|
|
1711
|
+
insertTable: h,
|
|
1710
1712
|
saveSelection: d,
|
|
1711
|
-
restoreSelection:
|
|
1712
|
-
getSelectedText:
|
|
1713
|
-
uploadImage:
|
|
1714
|
-
enableColor:
|
|
1715
|
-
enableImage:
|
|
1716
|
-
enableTable:
|
|
1713
|
+
restoreSelection: v,
|
|
1714
|
+
getSelectedText: m,
|
|
1715
|
+
uploadImage: k,
|
|
1716
|
+
enableColor: N = !1,
|
|
1717
|
+
enableImage: R = !1,
|
|
1718
|
+
enableTable: $ = !1,
|
|
1717
1719
|
showExtensions: I = !1
|
|
1718
1720
|
}) {
|
|
1719
|
-
const { t:
|
|
1720
|
-
if (!l(
|
|
1721
|
-
const
|
|
1721
|
+
const { t: C } = re(), P = (B) => B.preventDefault(), l = (B) => $n[f].includes(B), a = (B) => {
|
|
1722
|
+
if (!l(B)) return null;
|
|
1723
|
+
const Q = Hn[B];
|
|
1722
1724
|
return /* @__PURE__ */ e(
|
|
1723
|
-
|
|
1725
|
+
j,
|
|
1724
1726
|
{
|
|
1725
1727
|
size: "sm",
|
|
1726
1728
|
intent: "ghost",
|
|
1727
|
-
icon:
|
|
1728
|
-
"aria-label":
|
|
1729
|
-
"aria-pressed":
|
|
1730
|
-
onMouseDown:
|
|
1731
|
-
onClick: () => o(...
|
|
1729
|
+
icon: Q.icon,
|
|
1730
|
+
"aria-label": C(Q.label[0], Q.label[1]),
|
|
1731
|
+
"aria-pressed": Q.toggle ? i.has(Q.toggle) : void 0,
|
|
1732
|
+
onMouseDown: P,
|
|
1733
|
+
onClick: () => o(...Q.command)
|
|
1732
1734
|
},
|
|
1733
|
-
|
|
1735
|
+
Q.id
|
|
1734
1736
|
);
|
|
1735
|
-
},
|
|
1737
|
+
}, p = () => /* @__PURE__ */ e("span", { "aria-hidden": "true", className: it }), E = l("format"), x = [
|
|
1736
1738
|
a("bold"),
|
|
1737
1739
|
a("italic"),
|
|
1738
1740
|
a("underline"),
|
|
1739
1741
|
a("strike"),
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
+
N ? /* @__PURE__ */ e(
|
|
1743
|
+
jn,
|
|
1742
1744
|
{
|
|
1743
1745
|
run: o,
|
|
1744
1746
|
saveSelection: d,
|
|
1745
|
-
restoreSelection:
|
|
1747
|
+
restoreSelection: v
|
|
1746
1748
|
},
|
|
1747
1749
|
"colour"
|
|
1748
1750
|
) : null,
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
+
N ? /* @__PURE__ */ e(
|
|
1752
|
+
Fn,
|
|
1751
1753
|
{
|
|
1752
1754
|
run: o,
|
|
1753
1755
|
saveSelection: d,
|
|
1754
|
-
restoreSelection:
|
|
1756
|
+
restoreSelection: v
|
|
1755
1757
|
},
|
|
1756
1758
|
"highlight"
|
|
1757
1759
|
) : null
|
|
1758
|
-
].filter(Boolean),
|
|
1760
|
+
].filter(Boolean), u = E || x.length > 0, Y = [a("ul"), a("ol")].filter(Boolean), S = [
|
|
1759
1761
|
l("link") ? /* @__PURE__ */ e(
|
|
1760
|
-
|
|
1762
|
+
qn,
|
|
1761
1763
|
{
|
|
1762
1764
|
insertHtml: c,
|
|
1763
1765
|
saveSelection: d,
|
|
1764
|
-
restoreSelection:
|
|
1765
|
-
getSelectedText:
|
|
1766
|
+
restoreSelection: v,
|
|
1767
|
+
getSelectedText: m
|
|
1766
1768
|
},
|
|
1767
1769
|
"link"
|
|
1768
1770
|
) : null,
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
+
R ? /* @__PURE__ */ e(
|
|
1772
|
+
Bn,
|
|
1771
1773
|
{
|
|
1772
1774
|
insertHtml: c,
|
|
1773
1775
|
saveSelection: d,
|
|
1774
|
-
restoreSelection:
|
|
1775
|
-
uploadImage:
|
|
1776
|
+
restoreSelection: v,
|
|
1777
|
+
uploadImage: k
|
|
1776
1778
|
},
|
|
1777
1779
|
"image"
|
|
1778
1780
|
) : null,
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
+
$ ? /* @__PURE__ */ e(
|
|
1782
|
+
Kn,
|
|
1781
1783
|
{
|
|
1782
1784
|
run: o,
|
|
1783
|
-
insertTable:
|
|
1785
|
+
insertTable: h,
|
|
1784
1786
|
active: i
|
|
1785
1787
|
},
|
|
1786
1788
|
"table"
|
|
1787
1789
|
) : null
|
|
1788
|
-
].filter(Boolean),
|
|
1790
|
+
].filter(Boolean), V = I ? [
|
|
1789
1791
|
/* @__PURE__ */ e(
|
|
1790
|
-
|
|
1792
|
+
j,
|
|
1791
1793
|
{
|
|
1792
1794
|
size: "sm",
|
|
1793
1795
|
intent: "ghost",
|
|
1794
|
-
icon: /* @__PURE__ */ e(
|
|
1795
|
-
"aria-label":
|
|
1796
|
+
icon: /* @__PURE__ */ e(An, {}),
|
|
1797
|
+
"aria-label": C("editor.extensions", "Editor extensions"),
|
|
1796
1798
|
disabled: !0,
|
|
1797
|
-
onMouseDown:
|
|
1799
|
+
onMouseDown: P
|
|
1798
1800
|
},
|
|
1799
1801
|
"extensions"
|
|
1800
1802
|
)
|
|
1801
|
-
] : [],
|
|
1802
|
-
(
|
|
1803
|
-
),
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
] },
|
|
1803
|
+
] : [], F = [Y, S, V].filter(
|
|
1804
|
+
(B) => B.length > 0
|
|
1805
|
+
), W = F.length > 0, M = (B) => F.map((Q, de) => /* @__PURE__ */ y(Ke, { children: [
|
|
1806
|
+
de > 0 || B ? /* @__PURE__ */ e(p, {}) : null,
|
|
1807
|
+
Q
|
|
1808
|
+
] }, de));
|
|
1807
1809
|
return (
|
|
1808
1810
|
// Outer element is the query container + visual chrome; the flex row is an
|
|
1809
1811
|
// inner child so `container-type` never lands on the flex parent (which
|
|
1810
1812
|
// would blockify the inline controls).
|
|
1811
|
-
/* @__PURE__ */ e("div", { className:
|
|
1813
|
+
/* @__PURE__ */ e("div", { className: Pn(), "data-component": "editor-toolbar", children: /* @__PURE__ */ y(
|
|
1812
1814
|
"div",
|
|
1813
1815
|
{
|
|
1814
1816
|
role: "group",
|
|
1815
|
-
"aria-label":
|
|
1816
|
-
className:
|
|
1817
|
+
"aria-label": C("editor.toolbarLabel"),
|
|
1818
|
+
className: Dn,
|
|
1817
1819
|
children: [
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
+
E ? /* @__PURE__ */ e(On, { run: o, active: i, onTriggerDown: P }) : null,
|
|
1821
|
+
E && x.length > 0 ? /* @__PURE__ */ e(p, {}) : null,
|
|
1820
1822
|
x,
|
|
1821
|
-
|
|
1822
|
-
/* @__PURE__ */ e("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children:
|
|
1823
|
-
/* @__PURE__ */
|
|
1824
|
-
|
|
1825
|
-
/* @__PURE__ */
|
|
1823
|
+
W ? /* @__PURE__ */ y(le, { children: [
|
|
1824
|
+
/* @__PURE__ */ e("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: M(u) }),
|
|
1825
|
+
/* @__PURE__ */ y("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
|
|
1826
|
+
u ? /* @__PURE__ */ e(p, {}) : null,
|
|
1827
|
+
/* @__PURE__ */ y(q, { children: [
|
|
1826
1828
|
/* @__PURE__ */ e(q.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1827
|
-
|
|
1829
|
+
j,
|
|
1828
1830
|
{
|
|
1829
1831
|
size: "sm",
|
|
1830
1832
|
intent: "ghost",
|
|
1831
|
-
icon: /* @__PURE__ */ e(
|
|
1832
|
-
"aria-label":
|
|
1833
|
-
onMouseDown:
|
|
1833
|
+
icon: /* @__PURE__ */ e(hr, {}),
|
|
1834
|
+
"aria-label": C("editor.more", "More options"),
|
|
1835
|
+
onMouseDown: P
|
|
1834
1836
|
}
|
|
1835
1837
|
) }),
|
|
1836
|
-
/* @__PURE__ */ e(q.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ e("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children:
|
|
1838
|
+
/* @__PURE__ */ e(q.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ e("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: M(!1) }) })
|
|
1837
1839
|
] })
|
|
1838
1840
|
] })
|
|
1839
1841
|
] }) : null
|
|
@@ -1842,39 +1844,39 @@ function Bn({
|
|
|
1842
1844
|
) })
|
|
1843
1845
|
);
|
|
1844
1846
|
}
|
|
1845
|
-
function
|
|
1846
|
-
return
|
|
1847
|
+
function se(o) {
|
|
1848
|
+
return nr(o, "rich-text");
|
|
1847
1849
|
}
|
|
1848
|
-
function
|
|
1850
|
+
function et(o = "") {
|
|
1849
1851
|
const i = String(o).trim();
|
|
1850
1852
|
if (i === "" || i === "<p><br></p>" || i === "<p> </p>")
|
|
1851
1853
|
return "";
|
|
1852
|
-
const
|
|
1853
|
-
return
|
|
1854
|
+
const f = i.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
1855
|
+
return f === "" && /<img\b[^>]*>/i.test(i) ? i : f === "" ? "" : i;
|
|
1854
1856
|
}
|
|
1855
|
-
function
|
|
1857
|
+
function so(o) {
|
|
1856
1858
|
return o.replace(
|
|
1857
1859
|
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
1858
1860
|
'<img loading="lazy"$1>'
|
|
1859
1861
|
);
|
|
1860
1862
|
}
|
|
1861
|
-
function
|
|
1863
|
+
function lo(o) {
|
|
1862
1864
|
if (!o || typeof o != "object") return;
|
|
1863
|
-
const i = o,
|
|
1865
|
+
const i = o, f = (c) => {
|
|
1864
1866
|
if (c && typeof c == "object" && "url" in c) {
|
|
1865
|
-
const
|
|
1866
|
-
return typeof
|
|
1867
|
+
const h = c.url;
|
|
1868
|
+
return typeof h == "string" ? h : void 0;
|
|
1867
1869
|
}
|
|
1868
1870
|
};
|
|
1869
|
-
return typeof i.url == "string" ? i.url :
|
|
1871
|
+
return typeof i.url == "string" ? i.url : f(i.file) ?? f(i.data) ?? Object.values(i).map(f).find(Boolean);
|
|
1870
1872
|
}
|
|
1871
|
-
function
|
|
1873
|
+
function co(o) {
|
|
1872
1874
|
if (o) return o;
|
|
1873
1875
|
if (typeof window > "u") return null;
|
|
1874
1876
|
const i = window;
|
|
1875
1877
|
return i.$R ?? i.Redactor ?? null;
|
|
1876
1878
|
}
|
|
1877
|
-
const
|
|
1879
|
+
const uo = {
|
|
1878
1880
|
bold: ["module.inline.format", { tag: "b" }],
|
|
1879
1881
|
italic: ["module.inline.format", { tag: "i" }],
|
|
1880
1882
|
strikethrough: ["module.inline.format", { tag: "del" }],
|
|
@@ -1883,17 +1885,17 @@ const Wn = {
|
|
|
1883
1885
|
heading: ["module.block.format", { tag: "h2" }],
|
|
1884
1886
|
quote: ["module.block.format", { tag: "blockquote" }],
|
|
1885
1887
|
paragraph: ["module.block.format", { tag: "p" }]
|
|
1886
|
-
},
|
|
1888
|
+
}, mo = {
|
|
1887
1889
|
zh: "zh_cn",
|
|
1888
1890
|
pt: "pt_br"
|
|
1889
1891
|
};
|
|
1890
|
-
function
|
|
1892
|
+
function ho(o) {
|
|
1891
1893
|
const i = o.split("-")[0];
|
|
1892
|
-
return
|
|
1894
|
+
return mo[i] ?? i ?? "en";
|
|
1893
1895
|
}
|
|
1894
|
-
const
|
|
1896
|
+
const go = nt(
|
|
1895
1897
|
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
1896
|
-
),
|
|
1898
|
+
), fo = nt(
|
|
1897
1899
|
[
|
|
1898
1900
|
"ds:block ds:[inline-size:100%]",
|
|
1899
1901
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
@@ -1907,7 +1909,7 @@ const Qn = Ge(
|
|
|
1907
1909
|
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1908
1910
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
1909
1911
|
].join(" ")
|
|
1910
|
-
),
|
|
1912
|
+
), At = [
|
|
1911
1913
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
1912
1914
|
"ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
|
|
1913
1915
|
"ds:text-[color:var(--primary-foreground)]",
|
|
@@ -1916,127 +1918,129 @@ const Qn = Ge(
|
|
|
1916
1918
|
"ds:focus-visible:outline-solid",
|
|
1917
1919
|
"ds:focus-visible:outline-[var(--primary-foreground)]",
|
|
1918
1920
|
"ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
|
|
1919
|
-
].join(" "),
|
|
1921
|
+
].join(" "), po = `${At} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, bo = `${At} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, yo = er(
|
|
1920
1922
|
({
|
|
1921
1923
|
id: o,
|
|
1922
1924
|
defaultValue: i,
|
|
1923
|
-
value:
|
|
1925
|
+
value: f,
|
|
1924
1926
|
onChange: c,
|
|
1925
|
-
toolbar:
|
|
1927
|
+
toolbar: h = "standard",
|
|
1926
1928
|
placeholder: d,
|
|
1927
|
-
readOnly:
|
|
1928
|
-
ariaLabel:
|
|
1929
|
-
minHeight:
|
|
1930
|
-
showExtensions:
|
|
1931
|
-
className:
|
|
1932
|
-
redactor:
|
|
1929
|
+
readOnly: v = !1,
|
|
1930
|
+
ariaLabel: m,
|
|
1931
|
+
minHeight: k,
|
|
1932
|
+
showExtensions: N,
|
|
1933
|
+
className: R,
|
|
1934
|
+
redactor: $,
|
|
1933
1935
|
options: I,
|
|
1934
|
-
plugins:
|
|
1935
|
-
lang:
|
|
1936
|
+
plugins: C,
|
|
1937
|
+
lang: P,
|
|
1936
1938
|
imageUploadUrl: l,
|
|
1937
1939
|
onKeyDown: a,
|
|
1938
|
-
onRequestAiDraft:
|
|
1939
|
-
aiDraftFormat:
|
|
1940
|
+
onRequestAiDraft: p,
|
|
1941
|
+
aiDraftFormat: E = "html",
|
|
1940
1942
|
aiPrivacyNotice: x,
|
|
1943
|
+
aiConsent: u,
|
|
1944
|
+
aiConsentHeadingLevel: Y,
|
|
1941
1945
|
onDictate: S,
|
|
1942
|
-
onProofread:
|
|
1943
|
-
onAutoFormat:
|
|
1944
|
-
},
|
|
1945
|
-
const { t:
|
|
1946
|
-
() => `rte-${
|
|
1947
|
-
[
|
|
1948
|
-
),
|
|
1946
|
+
onProofread: V,
|
|
1947
|
+
onAutoFormat: F
|
|
1948
|
+
}, W) => {
|
|
1949
|
+
const { t: M, i18n: B } = re(), Q = pe(), de = Ye(
|
|
1950
|
+
() => `rte-${Q.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
1951
|
+
[Q]
|
|
1952
|
+
), _ = `#${de}`, J = H(null), X = H(null), L = H(!1), O = H(v), D = H(null), ee = H(null), [oe, at] = A(!1), [Rt, ze] = A(!1), [st, Et] = A(
|
|
1949
1953
|
() => /* @__PURE__ */ new Set()
|
|
1950
|
-
),
|
|
1954
|
+
), Te = H(null), [St, It] = A(
|
|
1951
1955
|
null
|
|
1952
|
-
),
|
|
1953
|
-
|
|
1954
|
-
}, []),
|
|
1955
|
-
|
|
1956
|
-
|
|
1956
|
+
), _e = w((t) => {
|
|
1957
|
+
Te.current = t, It(t);
|
|
1958
|
+
}, []), we = H(null), Z = H(c), Ae = H(a);
|
|
1959
|
+
G(() => {
|
|
1960
|
+
Z.current = c, Ae.current = a;
|
|
1957
1961
|
}, [c, a]);
|
|
1958
|
-
const
|
|
1962
|
+
const Lt = H(
|
|
1959
1963
|
(() => {
|
|
1960
|
-
const t =
|
|
1961
|
-
return t ?
|
|
1964
|
+
const t = f ?? i ?? "";
|
|
1965
|
+
return t ? se(t) : "";
|
|
1962
1966
|
})()
|
|
1963
|
-
),
|
|
1967
|
+
), ue = w(() => {
|
|
1964
1968
|
var r;
|
|
1965
|
-
const t =
|
|
1969
|
+
const t = X.current;
|
|
1966
1970
|
if (t)
|
|
1967
1971
|
try {
|
|
1968
|
-
const n = t(
|
|
1972
|
+
const n = t(_, "source.getCode");
|
|
1969
1973
|
if (typeof n == "string") return n;
|
|
1970
1974
|
} catch {
|
|
1971
1975
|
}
|
|
1972
|
-
return ((r =
|
|
1973
|
-
}, [
|
|
1976
|
+
return ((r = J.current) == null ? void 0 : r.value) ?? "";
|
|
1977
|
+
}, [_]), ne = w(
|
|
1974
1978
|
(t, ...r) => {
|
|
1975
|
-
const n =
|
|
1979
|
+
const n = X.current;
|
|
1976
1980
|
if (!n) return !1;
|
|
1977
|
-
const s =
|
|
1981
|
+
const s = O.current;
|
|
1978
1982
|
if (s)
|
|
1979
1983
|
try {
|
|
1980
|
-
n(
|
|
1984
|
+
n(_, "disableReadOnly");
|
|
1981
1985
|
} catch {
|
|
1982
1986
|
}
|
|
1983
1987
|
try {
|
|
1984
|
-
return n(
|
|
1988
|
+
return n(_, t, ...r), !0;
|
|
1985
1989
|
} catch {
|
|
1986
1990
|
return !1;
|
|
1987
1991
|
} finally {
|
|
1988
1992
|
if (s)
|
|
1989
1993
|
try {
|
|
1990
|
-
n(
|
|
1994
|
+
n(_, "enableReadOnly");
|
|
1991
1995
|
} catch {
|
|
1992
1996
|
}
|
|
1993
1997
|
}
|
|
1994
1998
|
},
|
|
1995
|
-
[
|
|
1996
|
-
),
|
|
1999
|
+
[_]
|
|
2000
|
+
), me = w(
|
|
1997
2001
|
(t, r) => {
|
|
1998
|
-
var
|
|
1999
|
-
const n = (r == null ? void 0 : r.asHtml) ?? !0, s = n ?
|
|
2000
|
-
if (
|
|
2001
|
-
const
|
|
2002
|
-
if (!
|
|
2003
|
-
const z =
|
|
2004
|
-
|
|
2005
|
-
const
|
|
2002
|
+
var Ne;
|
|
2003
|
+
const n = (r == null ? void 0 : r.asHtml) ?? !0, s = n ? se(t) : t;
|
|
2004
|
+
if (ne(n ? "insertion.insertHtml" : "insertion.insertText", s)) return;
|
|
2005
|
+
const b = J.current;
|
|
2006
|
+
if (!b) return;
|
|
2007
|
+
const z = b.selectionStart ?? b.value.length, U = b.selectionEnd ?? b.value.length;
|
|
2008
|
+
b.value = b.value.slice(0, z) + s + b.value.slice(U);
|
|
2009
|
+
const Oe = z + s.length;
|
|
2006
2010
|
try {
|
|
2007
|
-
|
|
2011
|
+
b.setSelectionRange(Oe, Oe);
|
|
2008
2012
|
} catch {
|
|
2009
2013
|
}
|
|
2010
|
-
(
|
|
2014
|
+
(Ne = Z.current) == null || Ne.call(Z, { html: se(b.value), markdown: "" });
|
|
2011
2015
|
},
|
|
2012
|
-
[
|
|
2013
|
-
),
|
|
2016
|
+
[ne]
|
|
2017
|
+
), Ve = H(null), te = w(() => {
|
|
2014
2018
|
var s;
|
|
2015
|
-
const t = (s =
|
|
2019
|
+
const t = (s = D.current) == null ? void 0 : s.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, n = /* @__PURE__ */ new Set();
|
|
2016
2020
|
if (t && r && r.anchorNode && t.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
|
|
2017
|
-
r.rangeCount > 0 && (
|
|
2021
|
+
r.rangeCount > 0 && (Ve.current = r.getRangeAt(0).cloneRange());
|
|
2018
2022
|
try {
|
|
2019
2023
|
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");
|
|
2020
|
-
const
|
|
2024
|
+
const g = String(
|
|
2021
2025
|
document.queryCommandValue("formatBlock") || ""
|
|
2022
2026
|
).toLowerCase();
|
|
2023
|
-
/^h[1-6]$/.test(
|
|
2024
|
-
const
|
|
2025
|
-
|
|
2027
|
+
/^h[1-6]$/.test(g) ? (n.add("heading"), n.add(g)) : g === "blockquote" ? n.add("quote") : n.add("paragraph");
|
|
2028
|
+
const b = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
|
|
2029
|
+
b && t.contains(b) && b.closest("table") && n.add("table");
|
|
2026
2030
|
} catch {
|
|
2027
2031
|
}
|
|
2028
2032
|
}
|
|
2029
|
-
|
|
2030
|
-
(
|
|
2033
|
+
Et(
|
|
2034
|
+
(g) => g.size === n.size && [...n].every((b) => g.has(b)) ? g : n
|
|
2031
2035
|
);
|
|
2032
|
-
}, []),
|
|
2036
|
+
}, []), be = w(
|
|
2033
2037
|
(t, ...r) => {
|
|
2034
|
-
|
|
2038
|
+
ne(t, ...r), typeof window < "u" ? window.requestAnimationFrame(() => te()) : te();
|
|
2035
2039
|
},
|
|
2036
|
-
[
|
|
2040
|
+
[ne, te]
|
|
2037
2041
|
);
|
|
2038
|
-
|
|
2039
|
-
const t =
|
|
2042
|
+
G(() => {
|
|
2043
|
+
const t = D.current;
|
|
2040
2044
|
if (!t) return;
|
|
2041
2045
|
const r = {
|
|
2042
2046
|
b: ["module.inline.format", { tag: "b" }],
|
|
@@ -2044,36 +2048,36 @@ const Qn = Ge(
|
|
|
2044
2048
|
u: ["module.inline.format", { tag: "u" }]
|
|
2045
2049
|
}, n = (s) => {
|
|
2046
2050
|
if (!(s.metaKey || s.ctrlKey) || s.altKey || s.shiftKey || s.isComposing) return;
|
|
2047
|
-
const
|
|
2048
|
-
if (!
|
|
2049
|
-
const
|
|
2050
|
-
!
|
|
2051
|
+
const g = r[s.key.toLowerCase()];
|
|
2052
|
+
if (!g) return;
|
|
2053
|
+
const b = t.querySelector(".redactor-in");
|
|
2054
|
+
!b || !(s.target instanceof Node) || !b.contains(s.target) || O.current || (s.preventDefault(), s.stopImmediatePropagation(), be(...g));
|
|
2051
2055
|
};
|
|
2052
2056
|
return t.addEventListener("keydown", n, !0), () => t.removeEventListener("keydown", n, !0);
|
|
2053
|
-
}, [
|
|
2054
|
-
const
|
|
2057
|
+
}, [be]);
|
|
2058
|
+
const We = w(
|
|
2055
2059
|
(t) => {
|
|
2056
|
-
|
|
2060
|
+
me(t, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => te());
|
|
2057
2061
|
},
|
|
2058
|
-
[
|
|
2059
|
-
),
|
|
2062
|
+
[me, te]
|
|
2063
|
+
), ke = w(() => {
|
|
2060
2064
|
var r;
|
|
2061
2065
|
if (typeof window < "u") {
|
|
2062
|
-
const n = (r =
|
|
2063
|
-
n && s && s.rangeCount > 0 && s.anchorNode && n.contains(s.anchorNode) && (
|
|
2066
|
+
const n = (r = D.current) == null ? void 0 : r.querySelector(".redactor-in"), s = window.getSelection();
|
|
2067
|
+
n && s && s.rangeCount > 0 && s.anchorNode && n.contains(s.anchorNode) && (Ve.current = s.getRangeAt(0).cloneRange());
|
|
2064
2068
|
}
|
|
2065
|
-
const t =
|
|
2069
|
+
const t = X.current;
|
|
2066
2070
|
if (t)
|
|
2067
2071
|
try {
|
|
2068
|
-
t(
|
|
2072
|
+
t(_, "selection.save");
|
|
2069
2073
|
} catch {
|
|
2070
2074
|
}
|
|
2071
|
-
}, [
|
|
2072
|
-
const t =
|
|
2075
|
+
}, [_]), Re = w(() => {
|
|
2076
|
+
const t = X.current;
|
|
2073
2077
|
if (!t) return;
|
|
2074
|
-
const r =
|
|
2078
|
+
const r = Ve.current;
|
|
2075
2079
|
try {
|
|
2076
|
-
t(
|
|
2080
|
+
t(_, "editor.focus");
|
|
2077
2081
|
} catch {
|
|
2078
2082
|
}
|
|
2079
2083
|
if (r && typeof window < "u") {
|
|
@@ -2086,138 +2090,138 @@ const Qn = Ge(
|
|
|
2086
2090
|
}
|
|
2087
2091
|
}
|
|
2088
2092
|
try {
|
|
2089
|
-
t(
|
|
2093
|
+
t(_, "selection.restore");
|
|
2090
2094
|
} catch {
|
|
2091
2095
|
}
|
|
2092
|
-
}, [
|
|
2096
|
+
}, [_]), Ht = w(() => {
|
|
2093
2097
|
var n;
|
|
2094
2098
|
if (typeof window > "u") return "";
|
|
2095
|
-
const t = (n =
|
|
2099
|
+
const t = (n = D.current) == null ? void 0 : n.querySelector(".redactor-in"), r = window.getSelection();
|
|
2096
2100
|
return !t || !r || !r.anchorNode || !t.contains(r.anchorNode) ? "" : r.toString();
|
|
2097
|
-
}, []),
|
|
2098
|
-
var
|
|
2101
|
+
}, []), $t = w(() => {
|
|
2102
|
+
var g;
|
|
2099
2103
|
if (typeof window > "u") return null;
|
|
2100
|
-
const t = (
|
|
2104
|
+
const t = (g = D.current) == null ? void 0 : g.querySelector(".redactor-in"), r = window.getSelection();
|
|
2101
2105
|
if (!t || !r || r.rangeCount === 0) return null;
|
|
2102
2106
|
const n = r.anchorNode, s = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
|
|
2103
2107
|
return !s || !t.contains(s) ? null : s.closest("table");
|
|
2104
|
-
}, []),
|
|
2105
|
-
var
|
|
2108
|
+
}, []), lt = H(null), Ee = w(() => {
|
|
2109
|
+
var g;
|
|
2106
2110
|
if (typeof window > "u") return null;
|
|
2107
|
-
const t = (
|
|
2111
|
+
const t = (g = D.current) == null ? void 0 : g.querySelector(".redactor-in"), r = window.getSelection();
|
|
2108
2112
|
if (!t || !r || r.rangeCount === 0) return null;
|
|
2109
2113
|
const n = r.anchorNode, s = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
|
|
2110
2114
|
return !s || !t.contains(s) ? null : s.closest("td,th");
|
|
2111
|
-
}, []),
|
|
2112
|
-
|
|
2113
|
-
}, [
|
|
2115
|
+
}, []), Pt = w(() => {
|
|
2116
|
+
lt.current = Ee();
|
|
2117
|
+
}, [Ee]), Dt = w(
|
|
2114
2118
|
(t, r) => {
|
|
2115
|
-
var
|
|
2116
|
-
const n =
|
|
2119
|
+
var b;
|
|
2120
|
+
const n = lt.current ?? Ee();
|
|
2117
2121
|
if (!n) return;
|
|
2118
|
-
const s = t === "row" ? Array.from(((
|
|
2122
|
+
const s = t === "row" ? Array.from(((b = n.closest("tr")) == null ? void 0 : b.children) ?? [n]).filter(
|
|
2119
2123
|
(z) => z instanceof HTMLElement && (z.tagName === "TD" || z.tagName === "TH")
|
|
2120
|
-
) : [n],
|
|
2121
|
-
if (
|
|
2124
|
+
) : [n], g = X.current;
|
|
2125
|
+
if (g)
|
|
2122
2126
|
try {
|
|
2123
|
-
|
|
2127
|
+
g(_, "module.buffer.trigger");
|
|
2124
2128
|
} catch {
|
|
2125
2129
|
}
|
|
2126
2130
|
for (const z of s)
|
|
2127
2131
|
r ? z.style.setProperty("background-color", r) : z.style.removeProperty("background-color");
|
|
2128
|
-
if (
|
|
2132
|
+
if (g)
|
|
2129
2133
|
try {
|
|
2130
|
-
|
|
2134
|
+
g(_, "broadcast", "hardsync");
|
|
2131
2135
|
} catch {
|
|
2132
2136
|
}
|
|
2133
|
-
typeof window < "u" && window.requestAnimationFrame(() =>
|
|
2137
|
+
typeof window < "u" && window.requestAnimationFrame(() => te());
|
|
2134
2138
|
},
|
|
2135
|
-
[
|
|
2139
|
+
[Ee, _, te]
|
|
2136
2140
|
);
|
|
2137
|
-
|
|
2138
|
-
const t =
|
|
2141
|
+
G(() => {
|
|
2142
|
+
const t = D.current;
|
|
2139
2143
|
if (typeof window > "u" || !t) return;
|
|
2140
|
-
const r = (
|
|
2141
|
-
const
|
|
2142
|
-
if (!
|
|
2144
|
+
const r = (g) => {
|
|
2145
|
+
const b = t.querySelector(".redactor-in"), z = g.target;
|
|
2146
|
+
if (!b || !(z instanceof Node) || !b.contains(z))
|
|
2143
2147
|
return;
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2146
|
-
}, n = (
|
|
2147
|
-
|
|
2148
|
-
}, s = (
|
|
2149
|
-
const
|
|
2150
|
-
(!(
|
|
2148
|
+
const U = z instanceof Element ? z.closest("img") : null;
|
|
2149
|
+
_e(U && b.contains(U) ? U : null);
|
|
2150
|
+
}, n = (g) => {
|
|
2151
|
+
g.key === "Escape" && Te.current && _e(null);
|
|
2152
|
+
}, s = (g) => {
|
|
2153
|
+
const b = g.relatedTarget;
|
|
2154
|
+
(!(b instanceof Node) || !t.contains(b)) && _e(null);
|
|
2151
2155
|
};
|
|
2152
2156
|
return t.addEventListener("click", r), t.addEventListener("keydown", n), t.addEventListener("focusout", s), () => {
|
|
2153
2157
|
t.removeEventListener("click", r), t.removeEventListener("keydown", n), t.removeEventListener("focusout", s);
|
|
2154
2158
|
};
|
|
2155
|
-
}, [
|
|
2156
|
-
const
|
|
2159
|
+
}, [_e]);
|
|
2160
|
+
const Ot = w(
|
|
2157
2161
|
(t) => {
|
|
2158
|
-
const r =
|
|
2162
|
+
const r = Te.current;
|
|
2159
2163
|
if (!r) return;
|
|
2160
|
-
const n =
|
|
2164
|
+
const n = tt.includes(
|
|
2161
2165
|
t
|
|
2162
|
-
) ?
|
|
2166
|
+
) ? tt : _t, s = X.current;
|
|
2163
2167
|
if (s)
|
|
2164
2168
|
try {
|
|
2165
|
-
s(
|
|
2169
|
+
s(_, "module.buffer.trigger");
|
|
2166
2170
|
} catch {
|
|
2167
2171
|
}
|
|
2168
|
-
for (const
|
|
2172
|
+
for (const g of n) r.classList.remove(g);
|
|
2169
2173
|
if (r.classList.add(t), s)
|
|
2170
2174
|
try {
|
|
2171
|
-
s(
|
|
2175
|
+
s(_, "broadcast", "hardsync");
|
|
2172
2176
|
} catch {
|
|
2173
2177
|
}
|
|
2174
|
-
typeof window < "u" && window.requestAnimationFrame(() =>
|
|
2178
|
+
typeof window < "u" && window.requestAnimationFrame(() => te());
|
|
2175
2179
|
},
|
|
2176
|
-
[
|
|
2177
|
-
),
|
|
2180
|
+
[_, te]
|
|
2181
|
+
), qt = w(
|
|
2178
2182
|
(t) => {
|
|
2179
|
-
const r =
|
|
2183
|
+
const r = Te.current;
|
|
2180
2184
|
if (!r) return;
|
|
2181
|
-
const n =
|
|
2185
|
+
const n = X.current;
|
|
2182
2186
|
if (n)
|
|
2183
2187
|
try {
|
|
2184
|
-
n(
|
|
2188
|
+
n(_, "module.buffer.trigger");
|
|
2185
2189
|
} catch {
|
|
2186
2190
|
}
|
|
2187
2191
|
if (r.style.setProperty("width", `${t}%`), n)
|
|
2188
2192
|
try {
|
|
2189
|
-
n(
|
|
2193
|
+
n(_, "broadcast", "hardsync");
|
|
2190
2194
|
} catch {
|
|
2191
2195
|
}
|
|
2192
|
-
typeof window < "u" && window.requestAnimationFrame(() =>
|
|
2196
|
+
typeof window < "u" && window.requestAnimationFrame(() => te());
|
|
2193
2197
|
},
|
|
2194
|
-
[
|
|
2195
|
-
),
|
|
2198
|
+
[_, te]
|
|
2199
|
+
), Bt = w(
|
|
2196
2200
|
(t) => {
|
|
2197
2201
|
var n;
|
|
2198
|
-
const r =
|
|
2202
|
+
const r = X.current;
|
|
2199
2203
|
if (r && typeof window < "u") {
|
|
2200
|
-
const s = (n =
|
|
2201
|
-
if (
|
|
2204
|
+
const s = (n = D.current) == null ? void 0 : n.querySelector(".redactor-in"), g = window.getSelection(), b = g == null ? void 0 : g.anchorNode, z = b && b.nodeType === Node.TEXT_NODE ? b.parentElement : b, U = z && (s != null && s.contains(z)) ? z.closest("ul,ol") : null;
|
|
2205
|
+
if (U)
|
|
2202
2206
|
try {
|
|
2203
|
-
r(
|
|
2207
|
+
r(_, "caret.setAfter", U);
|
|
2204
2208
|
} catch {
|
|
2205
2209
|
}
|
|
2206
2210
|
}
|
|
2207
|
-
|
|
2208
|
-
var
|
|
2209
|
-
const s = (
|
|
2210
|
-
s == null || s.querySelectorAll("table td, table th").forEach((
|
|
2211
|
-
let z =
|
|
2211
|
+
We(t), typeof window < "u" && window.requestAnimationFrame(() => {
|
|
2212
|
+
var g;
|
|
2213
|
+
const s = (g = D.current) == null ? void 0 : g.querySelector(".redactor-in");
|
|
2214
|
+
s == null || s.querySelectorAll("table td, table th").forEach((b) => {
|
|
2215
|
+
let z = b.lastChild;
|
|
2212
2216
|
for (; z && z.nodeType === Node.TEXT_NODE && !(z.textContent ?? "").trim(); ) {
|
|
2213
|
-
const
|
|
2214
|
-
|
|
2217
|
+
const U = z.previousSibling;
|
|
2218
|
+
b.removeChild(z), z = U;
|
|
2215
2219
|
}
|
|
2216
2220
|
});
|
|
2217
2221
|
});
|
|
2218
2222
|
},
|
|
2219
|
-
[
|
|
2220
|
-
),
|
|
2223
|
+
[We, _]
|
|
2224
|
+
), jt = w(
|
|
2221
2225
|
async (t, r) => {
|
|
2222
2226
|
if (!l) throw new Error("No image upload URL configured.");
|
|
2223
2227
|
const n = new FormData();
|
|
@@ -2229,104 +2233,166 @@ const Qn = Ge(
|
|
|
2229
2233
|
signal: r
|
|
2230
2234
|
});
|
|
2231
2235
|
if (!s.ok) throw new Error(`Image upload failed (${s.status}).`);
|
|
2232
|
-
const
|
|
2233
|
-
if (!
|
|
2234
|
-
return
|
|
2236
|
+
const g = lo(await s.json());
|
|
2237
|
+
if (!g) throw new Error("Image upload response contained no URL.");
|
|
2238
|
+
return g;
|
|
2235
2239
|
},
|
|
2236
2240
|
[l]
|
|
2237
|
-
),
|
|
2238
|
-
const t =
|
|
2239
|
-
t != null && t.parentNode && t.parentNode.removeChild(t),
|
|
2240
|
-
}, []),
|
|
2241
|
+
), xe = H(null), Se = H(null), [he, ct] = A(!1), [Ft, dt] = A(!1), [Gt, Xe] = A(""), Ie = w(() => {
|
|
2242
|
+
const t = Se.current;
|
|
2243
|
+
t != null && t.parentNode && t.parentNode.removeChild(t), Se.current = null;
|
|
2244
|
+
}, []), ut = w((t) => {
|
|
2241
2245
|
var s;
|
|
2242
|
-
const r = (s =
|
|
2246
|
+
const r = (s = D.current) == null ? void 0 : s.querySelector(
|
|
2243
2247
|
".redactor-in"
|
|
2244
2248
|
);
|
|
2245
2249
|
if (!r) return;
|
|
2246
|
-
let n =
|
|
2250
|
+
let n = Se.current;
|
|
2247
2251
|
if (!n || !r.contains(n)) {
|
|
2248
2252
|
n = document.createElement("span"), n.setAttribute("data-rte-interim", ""), n.setAttribute("contenteditable", "false");
|
|
2249
|
-
const
|
|
2250
|
-
if (
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2253
|
+
const g = window.getSelection();
|
|
2254
|
+
if (g && g.rangeCount > 0 && r.contains(g.anchorNode)) {
|
|
2255
|
+
const b = g.getRangeAt(0);
|
|
2256
|
+
b.collapse(!1), b.insertNode(n);
|
|
2253
2257
|
} else
|
|
2254
2258
|
r.appendChild(n);
|
|
2255
|
-
|
|
2259
|
+
Se.current = n;
|
|
2256
2260
|
}
|
|
2257
2261
|
n.textContent = t;
|
|
2258
|
-
}, []),
|
|
2262
|
+
}, []), Le = w(() => {
|
|
2259
2263
|
var t;
|
|
2260
|
-
(t =
|
|
2261
|
-
}, []),
|
|
2262
|
-
if (!S) return;
|
|
2264
|
+
(t = xe.current) == null || t.abort();
|
|
2265
|
+
}, []), ie = u !== void 0 && !u.granted, He = w(() => {
|
|
2266
|
+
if (!S || ie) return;
|
|
2263
2267
|
const t = new AbortController();
|
|
2264
|
-
|
|
2268
|
+
xe.current = t, dt(!1), ct(!0), Xe(M("editor.ai.listening")), Ie(), S({
|
|
2265
2269
|
signal: t.signal,
|
|
2266
2270
|
// Interim text shows live in the editor (grey + caret); each final
|
|
2267
2271
|
// replaces it with committed text at the caret.
|
|
2268
2272
|
onPartialTranscript: (r) => {
|
|
2269
|
-
t.signal.aborted ||
|
|
2273
|
+
t.signal.aborted || ut(r);
|
|
2270
2274
|
},
|
|
2271
2275
|
onFinalTranscript: (r) => {
|
|
2272
2276
|
if (t.signal.aborted) return;
|
|
2273
|
-
|
|
2277
|
+
Ie();
|
|
2274
2278
|
const n = r.trim();
|
|
2275
|
-
n && (
|
|
2279
|
+
n && (me(`${n} `, { asHtml: !1 }), Xe(n));
|
|
2276
2280
|
}
|
|
2277
2281
|
}).catch((r) => {
|
|
2278
|
-
t.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError" ||
|
|
2282
|
+
t.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError" || dt(!0);
|
|
2279
2283
|
}).finally(() => {
|
|
2280
|
-
|
|
2284
|
+
Ie(), xe.current === t && (xe.current = null, ct(!1), Xe(""));
|
|
2281
2285
|
});
|
|
2282
|
-
}, [S,
|
|
2283
|
-
|
|
2284
|
-
}, [be, ot, nt]);
|
|
2285
|
-
Z(() => () => {
|
|
2286
|
+
}, [S, ie, me, Ie, ut, M]);
|
|
2287
|
+
G(() => () => {
|
|
2286
2288
|
var t;
|
|
2287
|
-
return (t =
|
|
2289
|
+
return (t = xe.current) == null ? void 0 : t.abort();
|
|
2288
2290
|
}, []);
|
|
2289
|
-
const [
|
|
2291
|
+
const [Kt, $e] = A(null), ye = H(null), [Vt, mt] = A(!1), Wt = ((u == null ? void 0 : u.pending) ?? !1) || Vt, Pe = H(!1), ht = w(() => {
|
|
2292
|
+
ye.current = null, Pe.current = !1, $e(null);
|
|
2293
|
+
}, []), Xt = w(() => {
|
|
2294
|
+
var r;
|
|
2295
|
+
Pe.current = !0;
|
|
2296
|
+
const t = (r = u == null ? void 0 : u.onGrant) == null ? void 0 : r.call(u);
|
|
2297
|
+
t && typeof t.then == "function" && (mt(!0), Promise.resolve(t).catch(() => {
|
|
2298
|
+
}).finally(() => mt(!1)));
|
|
2299
|
+
}, [u]), gt = H((u == null ? void 0 : u.granted) ?? !0);
|
|
2300
|
+
G(() => {
|
|
2301
|
+
const t = gt.current;
|
|
2302
|
+
if (gt.current = (u == null ? void 0 : u.granted) ?? !0, !t && (u != null && u.granted) && ye.current) {
|
|
2303
|
+
const r = ye.current, n = Pe.current;
|
|
2304
|
+
if (ye.current = null, Pe.current = !1, $e(null), !n) return;
|
|
2305
|
+
r === "write" ? ze(!0) : (Re(), He());
|
|
2306
|
+
}
|
|
2307
|
+
}, [u == null ? void 0 : u.granted, Re, He]), G(() => {
|
|
2308
|
+
ie && (ze(!1), he && Le());
|
|
2309
|
+
}, [ie, he, Le]);
|
|
2310
|
+
const Ut = w(() => {
|
|
2311
|
+
if (he) {
|
|
2312
|
+
Le();
|
|
2313
|
+
return;
|
|
2314
|
+
}
|
|
2315
|
+
if (ie) {
|
|
2316
|
+
ke(), ye.current = "dictate", $e("dictate");
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
He();
|
|
2320
|
+
}, [he, Le, ie, ke, He]), Qt = w(() => {
|
|
2321
|
+
if (ke(), ie) {
|
|
2322
|
+
ye.current = "write", $e("write");
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
ze(!0);
|
|
2326
|
+
}, [ke, ie]), Zt = Ye(() => u != null && u.granted ? /* @__PURE__ */ y(le, { children: [
|
|
2327
|
+
M(
|
|
2328
|
+
"editor.ai.consentRecorded",
|
|
2329
|
+
"AI assistance consent has been recorded."
|
|
2330
|
+
),
|
|
2331
|
+
u.grantedAt !== void 0 ? /* @__PURE__ */ y(le, { children: [
|
|
2332
|
+
" ",
|
|
2333
|
+
M("aiConsentBanner.grantedAtPrefix", "Granted"),
|
|
2334
|
+
" ",
|
|
2335
|
+
/* @__PURE__ */ e(
|
|
2336
|
+
ir,
|
|
2337
|
+
{
|
|
2338
|
+
value: u.grantedAt,
|
|
2339
|
+
format: "relative",
|
|
2340
|
+
shape: "inline"
|
|
2341
|
+
}
|
|
2342
|
+
)
|
|
2343
|
+
] }) : null,
|
|
2344
|
+
u.grantedBy ? /* @__PURE__ */ y(le, { children: [
|
|
2345
|
+
" ",
|
|
2346
|
+
M("aiConsentBanner.grantedBy", {
|
|
2347
|
+
name: u.grantedBy,
|
|
2348
|
+
defaultValue: "By {{name}}"
|
|
2349
|
+
})
|
|
2350
|
+
] }) : null,
|
|
2351
|
+
x ? /* @__PURE__ */ y(le, { children: [
|
|
2352
|
+
" ",
|
|
2353
|
+
x
|
|
2354
|
+
] }) : null
|
|
2355
|
+
] }) : x, [u, x, M]), [ae, Ue] = A(null), ge = H(null), ft = w(
|
|
2290
2356
|
(t, r) => {
|
|
2291
|
-
if (
|
|
2357
|
+
if (ge.current) return;
|
|
2292
2358
|
const n = new AbortController();
|
|
2293
|
-
|
|
2294
|
-
const s =
|
|
2295
|
-
Promise.resolve(r({ html: s, signal: n.signal })).then((
|
|
2359
|
+
ge.current = n, Ue(t);
|
|
2360
|
+
const s = ue();
|
|
2361
|
+
Promise.resolve(r({ html: s, signal: n.signal })).then((g) => {
|
|
2296
2362
|
var z;
|
|
2297
2363
|
if (n.signal.aborted) return;
|
|
2298
|
-
const
|
|
2299
|
-
|
|
2364
|
+
const b = se(String(g ?? ""));
|
|
2365
|
+
ne("source.setCode", b), (z = Z.current) == null || z.call(Z, { html: b, markdown: "" });
|
|
2300
2366
|
}).catch(() => {
|
|
2301
2367
|
}).finally(() => {
|
|
2302
|
-
|
|
2368
|
+
ge.current === n && (ge.current = null, Ue(null));
|
|
2303
2369
|
});
|
|
2304
2370
|
},
|
|
2305
|
-
[
|
|
2306
|
-
),
|
|
2371
|
+
[ue, ne]
|
|
2372
|
+
), pt = w(() => {
|
|
2307
2373
|
var t;
|
|
2308
|
-
(t =
|
|
2374
|
+
(t = ge.current) == null || t.abort(), ge.current = null, Ue(null);
|
|
2309
2375
|
}, []);
|
|
2310
|
-
|
|
2376
|
+
G(() => () => {
|
|
2311
2377
|
var t;
|
|
2312
|
-
return (t =
|
|
2313
|
-
}, []),
|
|
2314
|
-
const t =
|
|
2378
|
+
return (t = ge.current) == null ? void 0 : t.abort();
|
|
2379
|
+
}, []), G(() => {
|
|
2380
|
+
const t = J.current;
|
|
2315
2381
|
if (!t) return;
|
|
2316
|
-
t.value =
|
|
2317
|
-
const r =
|
|
2382
|
+
t.value = Lt.current;
|
|
2383
|
+
const r = co($);
|
|
2318
2384
|
if (!r) {
|
|
2319
|
-
|
|
2385
|
+
at(!0);
|
|
2320
2386
|
return;
|
|
2321
2387
|
}
|
|
2322
|
-
|
|
2388
|
+
X.current = r;
|
|
2323
2389
|
const n = {
|
|
2324
|
-
lang:
|
|
2390
|
+
lang: P ?? ho(B.language || "en"),
|
|
2325
2391
|
// The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
|
|
2326
2392
|
// via the command API, so Redactor's native toolbar is suppressed.
|
|
2327
2393
|
toolbar: !1,
|
|
2328
|
-
plugins:
|
|
2329
|
-
placeholder: d ??
|
|
2394
|
+
plugins: C ?? [],
|
|
2395
|
+
placeholder: d ?? M("editor.placeholder"),
|
|
2330
2396
|
toolbarFixed: !1,
|
|
2331
2397
|
// Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
|
|
2332
2398
|
shortcodes: !1,
|
|
@@ -2336,7 +2402,7 @@ const Qn = Ge(
|
|
|
2336
2402
|
// second, untokenised, mouse-only UI competing with ours.
|
|
2337
2403
|
imageEditable: !1,
|
|
2338
2404
|
imageResizable: !1
|
|
2339
|
-
}, s = l ? { imageUpload: l } : {},
|
|
2405
|
+
}, s = l ? { imageUpload: l } : {}, g = (I == null ? void 0 : I.callbacks) ?? {}, b = {
|
|
2340
2406
|
...n,
|
|
2341
2407
|
...s,
|
|
2342
2408
|
...I ?? {},
|
|
@@ -2346,118 +2412,118 @@ const Qn = Ge(
|
|
|
2346
2412
|
imageEditable: !1,
|
|
2347
2413
|
imageResizable: !1,
|
|
2348
2414
|
callbacks: {
|
|
2349
|
-
...
|
|
2415
|
+
...g,
|
|
2350
2416
|
changed(z) {
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2353
|
-
var
|
|
2354
|
-
(
|
|
2417
|
+
const U = et(so(z)), Oe = se(U);
|
|
2418
|
+
L.current = !0, Z.current && (we.current && clearTimeout(we.current), we.current = setTimeout(() => {
|
|
2419
|
+
var Ne;
|
|
2420
|
+
(Ne = Z.current) == null || Ne.call(Z, { html: Oe, markdown: "" });
|
|
2355
2421
|
}, 100));
|
|
2356
2422
|
},
|
|
2357
2423
|
keydown(z) {
|
|
2358
|
-
var
|
|
2359
|
-
(
|
|
2424
|
+
var U;
|
|
2425
|
+
(U = Ae.current) == null || U.call(Ae, z);
|
|
2360
2426
|
},
|
|
2361
2427
|
observe() {
|
|
2362
|
-
|
|
2428
|
+
te();
|
|
2363
2429
|
}
|
|
2364
2430
|
}
|
|
2365
2431
|
};
|
|
2366
2432
|
try {
|
|
2367
|
-
if (r(
|
|
2433
|
+
if (r(_, b), v)
|
|
2368
2434
|
try {
|
|
2369
|
-
r(
|
|
2435
|
+
r(_, "enableReadOnly");
|
|
2370
2436
|
} catch {
|
|
2371
2437
|
}
|
|
2372
2438
|
} catch {
|
|
2373
|
-
|
|
2439
|
+
at(!0);
|
|
2374
2440
|
}
|
|
2375
2441
|
return () => {
|
|
2376
|
-
|
|
2442
|
+
we.current && clearTimeout(we.current);
|
|
2377
2443
|
try {
|
|
2378
|
-
r(
|
|
2444
|
+
r(_, "destroy");
|
|
2379
2445
|
} catch {
|
|
2380
2446
|
}
|
|
2381
|
-
|
|
2447
|
+
X.current = null;
|
|
2382
2448
|
};
|
|
2383
|
-
}, []),
|
|
2384
|
-
if (!
|
|
2385
|
-
if (
|
|
2386
|
-
|
|
2449
|
+
}, []), G(() => {
|
|
2450
|
+
if (!X.current || f === void 0) return;
|
|
2451
|
+
if (L.current) {
|
|
2452
|
+
L.current = !1;
|
|
2387
2453
|
return;
|
|
2388
2454
|
}
|
|
2389
|
-
const t =
|
|
2390
|
-
|
|
2391
|
-
}, [
|
|
2392
|
-
|
|
2393
|
-
const t =
|
|
2455
|
+
const t = se(et(f));
|
|
2456
|
+
et(ue()) !== t && ne("source.setCode", t);
|
|
2457
|
+
}, [f, ue, ne]), G(() => {
|
|
2458
|
+
O.current = v;
|
|
2459
|
+
const t = X.current;
|
|
2394
2460
|
if (t)
|
|
2395
2461
|
try {
|
|
2396
|
-
t(
|
|
2462
|
+
t(_, v ? "enableReadOnly" : "disableReadOnly");
|
|
2397
2463
|
} catch {
|
|
2398
2464
|
}
|
|
2399
|
-
}, [
|
|
2400
|
-
if (!
|
|
2401
|
-
const t =
|
|
2465
|
+
}, [v, _]), G(() => {
|
|
2466
|
+
if (!oe || f === void 0) return;
|
|
2467
|
+
const t = J.current;
|
|
2402
2468
|
if (!t) return;
|
|
2403
|
-
const r =
|
|
2469
|
+
const r = se(f);
|
|
2404
2470
|
t.value !== r && document.activeElement !== t && (t.value = r);
|
|
2405
|
-
}, [
|
|
2406
|
-
const
|
|
2471
|
+
}, [oe, f]);
|
|
2472
|
+
const Qe = Ye(
|
|
2407
2473
|
() => ({
|
|
2408
2474
|
getHTML() {
|
|
2409
|
-
return
|
|
2475
|
+
return ue();
|
|
2410
2476
|
},
|
|
2411
2477
|
getText() {
|
|
2412
|
-
return
|
|
2478
|
+
return ue().replace(/<[^>]*>/g, " ").replace(/ /gi, " ").replace(/\s+/g, " ").trim();
|
|
2413
2479
|
},
|
|
2414
2480
|
getMarkdown() {
|
|
2415
2481
|
return "";
|
|
2416
2482
|
},
|
|
2417
2483
|
setContent(t) {
|
|
2418
|
-
const r =
|
|
2419
|
-
|
|
2484
|
+
const r = se(t);
|
|
2485
|
+
ne("source.setCode", r) || J.current && (J.current.value = r);
|
|
2420
2486
|
},
|
|
2421
|
-
insertAtCursor:
|
|
2487
|
+
insertAtCursor: me,
|
|
2422
2488
|
applyFormat(t) {
|
|
2423
|
-
const r =
|
|
2424
|
-
r &&
|
|
2489
|
+
const r = uo[t];
|
|
2490
|
+
r && be(...r);
|
|
2425
2491
|
},
|
|
2426
2492
|
focus() {
|
|
2427
2493
|
var r;
|
|
2428
|
-
const t =
|
|
2494
|
+
const t = X.current;
|
|
2429
2495
|
if (t)
|
|
2430
2496
|
try {
|
|
2431
|
-
t(
|
|
2497
|
+
t(_, "editor.focus");
|
|
2432
2498
|
return;
|
|
2433
2499
|
} catch {
|
|
2434
2500
|
}
|
|
2435
|
-
(r =
|
|
2501
|
+
(r = J.current) == null || r.focus();
|
|
2436
2502
|
},
|
|
2437
2503
|
clear() {
|
|
2438
|
-
|
|
2504
|
+
ne("source.setCode", "") || J.current && (J.current.value = "");
|
|
2439
2505
|
}
|
|
2440
2506
|
}),
|
|
2441
|
-
[
|
|
2507
|
+
[_, ue, ne, me, be]
|
|
2442
2508
|
);
|
|
2443
|
-
|
|
2444
|
-
const
|
|
2509
|
+
tr(W, () => Qe, [Qe]), or(Rn, Qe, o);
|
|
2510
|
+
const Yt = w(
|
|
2445
2511
|
(t) => {
|
|
2446
2512
|
var r;
|
|
2447
|
-
(r =
|
|
2448
|
-
html:
|
|
2513
|
+
(r = Z.current) == null || r.call(Z, {
|
|
2514
|
+
html: se(t.target.value),
|
|
2449
2515
|
markdown: ""
|
|
2450
2516
|
});
|
|
2451
2517
|
},
|
|
2452
2518
|
[]
|
|
2453
|
-
),
|
|
2454
|
-
|
|
2519
|
+
), De = m ?? M("editor.regionLabel"), Jt = d ?? M("editor.placeholder");
|
|
2520
|
+
G(() => {
|
|
2455
2521
|
var s;
|
|
2456
|
-
if (
|
|
2457
|
-
const t = (s =
|
|
2522
|
+
if (oe) return;
|
|
2523
|
+
const t = (s = D.current) == null ? void 0 : s.querySelector(".redactor-in");
|
|
2458
2524
|
if (!t) return;
|
|
2459
2525
|
const r = () => {
|
|
2460
|
-
t.getAttribute("role") !== "textbox" && t.setAttribute("role", "textbox"), t.getAttribute("aria-multiline") !== "true" && t.setAttribute("aria-multiline", "true"), t.getAttribute("aria-label") !==
|
|
2526
|
+
t.getAttribute("role") !== "textbox" && t.setAttribute("role", "textbox"), t.getAttribute("aria-multiline") !== "true" && t.setAttribute("aria-multiline", "true"), t.getAttribute("aria-label") !== De && t.setAttribute("aria-label", De), t.hasAttribute("aria-labelledby") && t.removeAttribute("aria-labelledby");
|
|
2461
2527
|
};
|
|
2462
2528
|
r();
|
|
2463
2529
|
const n = new MutationObserver(r);
|
|
@@ -2465,87 +2531,85 @@ const Qn = Ge(
|
|
|
2465
2531
|
attributes: !0,
|
|
2466
2532
|
attributeFilter: ["role", "aria-labelledby"]
|
|
2467
2533
|
}), () => n.disconnect();
|
|
2468
|
-
}, [
|
|
2469
|
-
const
|
|
2470
|
-
return S &&
|
|
2534
|
+
}, [oe, De]);
|
|
2535
|
+
const Ze = ae !== null, ve = [];
|
|
2536
|
+
return S && ve.push({
|
|
2471
2537
|
key: "dictate",
|
|
2472
|
-
icon:
|
|
2473
|
-
label:
|
|
2474
|
-
onClick:
|
|
2475
|
-
recording:
|
|
2476
|
-
}),
|
|
2538
|
+
icon: he ? /* @__PURE__ */ e(je, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(Mt, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2539
|
+
label: M(he ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
2540
|
+
onClick: Ut,
|
|
2541
|
+
recording: he
|
|
2542
|
+
}), V && ve.push({
|
|
2477
2543
|
key: "proofread",
|
|
2478
2544
|
// While running, the segment becomes a STOP/cancel button (progress is
|
|
2479
2545
|
// shown by the scrim spinner).
|
|
2480
|
-
icon:
|
|
2481
|
-
label:
|
|
2482
|
-
onClick:
|
|
2483
|
-
running:
|
|
2484
|
-
}),
|
|
2546
|
+
icon: ae === "proofread" ? /* @__PURE__ */ e(je, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(hn, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2547
|
+
label: ae === "proofread" ? M("common.cancel") : M("editor.ai.proofread", "Check spelling & grammar"),
|
|
2548
|
+
onClick: ae === "proofread" ? pt : () => ft("proofread", V),
|
|
2549
|
+
running: ae === "proofread"
|
|
2550
|
+
}), F && ve.push({
|
|
2485
2551
|
key: "format",
|
|
2486
|
-
icon:
|
|
2487
|
-
label:
|
|
2488
|
-
onClick:
|
|
2489
|
-
running:
|
|
2490
|
-
}),
|
|
2552
|
+
icon: ae === "format" ? /* @__PURE__ */ e(je, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(Tn, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2553
|
+
label: ae === "format" ? M("common.cancel") : M("editor.ai.autoFormat", "Auto-format document"),
|
|
2554
|
+
onClick: ae === "format" ? pt : () => ft("format", F),
|
|
2555
|
+
running: ae === "format"
|
|
2556
|
+
}), p && ve.push({
|
|
2491
2557
|
key: "write",
|
|
2492
|
-
icon: /* @__PURE__ */ e(
|
|
2493
|
-
label:
|
|
2494
|
-
onClick:
|
|
2495
|
-
|
|
2496
|
-
}
|
|
2497
|
-
}), /* @__PURE__ */ v(
|
|
2558
|
+
icon: /* @__PURE__ */ e(yr, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2559
|
+
label: M("editor.ai.helpMeWrite"),
|
|
2560
|
+
onClick: Qt
|
|
2561
|
+
}), /* @__PURE__ */ y(
|
|
2498
2562
|
"div",
|
|
2499
2563
|
{
|
|
2500
|
-
ref:
|
|
2501
|
-
className: [
|
|
2564
|
+
ref: D,
|
|
2565
|
+
className: [go(), R].filter(Boolean).join(" "),
|
|
2502
2566
|
"data-component": "rich-text-editor",
|
|
2503
2567
|
"data-component-id": o,
|
|
2504
|
-
"data-min-height":
|
|
2568
|
+
"data-min-height": k,
|
|
2505
2569
|
children: [
|
|
2506
|
-
!
|
|
2507
|
-
|
|
2570
|
+
!oe && !v ? /* @__PURE__ */ e(
|
|
2571
|
+
ao,
|
|
2508
2572
|
{
|
|
2509
|
-
run:
|
|
2510
|
-
active:
|
|
2511
|
-
preset:
|
|
2512
|
-
insertHtml:
|
|
2513
|
-
insertTable:
|
|
2514
|
-
saveSelection:
|
|
2515
|
-
restoreSelection:
|
|
2516
|
-
getSelectedText:
|
|
2517
|
-
uploadImage: l ?
|
|
2518
|
-
enableColor: (
|
|
2573
|
+
run: be,
|
|
2574
|
+
active: st,
|
|
2575
|
+
preset: h,
|
|
2576
|
+
insertHtml: We,
|
|
2577
|
+
insertTable: Bt,
|
|
2578
|
+
saveSelection: ke,
|
|
2579
|
+
restoreSelection: Re,
|
|
2580
|
+
getSelectedText: Ht,
|
|
2581
|
+
uploadImage: l ? jt : void 0,
|
|
2582
|
+
enableColor: (C == null ? void 0 : C.includes("fontcolor")) ?? !1,
|
|
2519
2583
|
enableImage: !!l,
|
|
2520
|
-
enableTable: (
|
|
2521
|
-
showExtensions:
|
|
2584
|
+
enableTable: (C == null ? void 0 : C.includes("table")) ?? !1,
|
|
2585
|
+
showExtensions: N
|
|
2522
2586
|
}
|
|
2523
2587
|
) : null,
|
|
2524
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ y("div", { className: "ds:relative", ref: ee, children: [
|
|
2525
2589
|
/* @__PURE__ */ e(
|
|
2526
2590
|
"textarea",
|
|
2527
2591
|
{
|
|
2528
|
-
ref:
|
|
2529
|
-
id:
|
|
2530
|
-
"aria-label":
|
|
2592
|
+
ref: J,
|
|
2593
|
+
id: de,
|
|
2594
|
+
"aria-label": De,
|
|
2531
2595
|
"aria-multiline": "true",
|
|
2532
|
-
"aria-busy":
|
|
2533
|
-
placeholder:
|
|
2534
|
-
onChange:
|
|
2535
|
-
readOnly:
|
|
2536
|
-
className:
|
|
2596
|
+
"aria-busy": Ze || void 0,
|
|
2597
|
+
placeholder: Jt,
|
|
2598
|
+
onChange: oe ? Yt : void 0,
|
|
2599
|
+
readOnly: oe ? v : void 0,
|
|
2600
|
+
className: oe ? fo() : void 0
|
|
2537
2601
|
}
|
|
2538
2602
|
),
|
|
2539
|
-
|
|
2603
|
+
Ze ? /* @__PURE__ */ e(
|
|
2540
2604
|
"div",
|
|
2541
2605
|
{
|
|
2542
2606
|
"aria-hidden": "true",
|
|
2543
2607
|
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)]",
|
|
2544
|
-
children: /* @__PURE__ */ e(
|
|
2608
|
+
children: /* @__PURE__ */ e(Nt, { size: "lg", variant: "prism" })
|
|
2545
2609
|
}
|
|
2546
2610
|
) : null,
|
|
2547
|
-
/* @__PURE__ */
|
|
2548
|
-
|
|
2611
|
+
/* @__PURE__ */ y("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
|
|
2612
|
+
ve.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: ve.map((t, r) => /* @__PURE__ */ y(Ke, { children: [
|
|
2549
2613
|
r > 0 ? /* @__PURE__ */ e(
|
|
2550
2614
|
"span",
|
|
2551
2615
|
{
|
|
@@ -2560,57 +2624,85 @@ const Qn = Ge(
|
|
|
2560
2624
|
onClick: t.onClick,
|
|
2561
2625
|
"aria-pressed": t.recording || void 0,
|
|
2562
2626
|
"aria-busy": t.running || void 0,
|
|
2563
|
-
disabled:
|
|
2627
|
+
disabled: Ze && !t.running || void 0,
|
|
2564
2628
|
"aria-label": t.label,
|
|
2565
|
-
className: t.recording ?
|
|
2629
|
+
className: t.recording ? bo : po,
|
|
2566
2630
|
children: t.icon
|
|
2567
2631
|
}
|
|
2568
2632
|
)
|
|
2569
2633
|
] }, t.key)) }) : null,
|
|
2570
|
-
|
|
2571
|
-
|
|
2634
|
+
p ? /* @__PURE__ */ e(
|
|
2635
|
+
Ln,
|
|
2572
2636
|
{
|
|
2573
|
-
open:
|
|
2574
|
-
onClose: () =>
|
|
2575
|
-
onRequestAiDraft:
|
|
2637
|
+
open: Rt && !ie,
|
|
2638
|
+
onClose: () => ze(!1),
|
|
2639
|
+
onRequestAiDraft: p,
|
|
2576
2640
|
onInsert: (t) => {
|
|
2577
|
-
|
|
2641
|
+
Re(), me(t, { asHtml: E !== "text" });
|
|
2578
2642
|
},
|
|
2579
|
-
previewAsHtml:
|
|
2580
|
-
privacyNotice:
|
|
2643
|
+
previewAsHtml: E !== "text",
|
|
2644
|
+
privacyNotice: Zt,
|
|
2581
2645
|
onDictate: S
|
|
2582
2646
|
}
|
|
2647
|
+
) : null,
|
|
2648
|
+
u ? /* @__PURE__ */ e(
|
|
2649
|
+
Ct,
|
|
2650
|
+
{
|
|
2651
|
+
open: Kt !== null,
|
|
2652
|
+
onClose: ht,
|
|
2653
|
+
ariaLabel: M(
|
|
2654
|
+
"editor.ai.consentRegionLabel",
|
|
2655
|
+
"AI assistance consent for this document"
|
|
2656
|
+
),
|
|
2657
|
+
footer: /* @__PURE__ */ e(ce, { intent: "ghost", size: "sm", onClick: ht, children: M("common.close") }),
|
|
2658
|
+
children: /* @__PURE__ */ e(
|
|
2659
|
+
ar,
|
|
2660
|
+
{
|
|
2661
|
+
granted: u.granted,
|
|
2662
|
+
grantedAt: u.grantedAt,
|
|
2663
|
+
grantedBy: u.grantedBy,
|
|
2664
|
+
canGrant: (u.canGrant ?? !0) && u.onGrant !== void 0,
|
|
2665
|
+
pending: Wt,
|
|
2666
|
+
onGrantConsent: Xt,
|
|
2667
|
+
headingLevel: Y,
|
|
2668
|
+
"aria-label": M(
|
|
2669
|
+
"editor.ai.consentRegionLabel",
|
|
2670
|
+
"AI assistance consent for this document"
|
|
2671
|
+
)
|
|
2672
|
+
}
|
|
2673
|
+
)
|
|
2674
|
+
}
|
|
2583
2675
|
) : null
|
|
2584
2676
|
] }),
|
|
2585
|
-
!
|
|
2586
|
-
|
|
2677
|
+
!oe && !v && ((C == null ? void 0 : C.includes("table")) ?? !1) ? /* @__PURE__ */ e(
|
|
2678
|
+
Un,
|
|
2587
2679
|
{
|
|
2588
|
-
active:
|
|
2589
|
-
run:
|
|
2590
|
-
areaRef:
|
|
2591
|
-
getActiveTableEl:
|
|
2592
|
-
enableColor: (
|
|
2593
|
-
saveTableCell:
|
|
2594
|
-
applyTableBackground:
|
|
2680
|
+
active: st,
|
|
2681
|
+
run: be,
|
|
2682
|
+
areaRef: ee,
|
|
2683
|
+
getActiveTableEl: $t,
|
|
2684
|
+
enableColor: (C == null ? void 0 : C.includes("fontcolor")) ?? !1,
|
|
2685
|
+
saveTableCell: Pt,
|
|
2686
|
+
applyTableBackground: Dt
|
|
2595
2687
|
}
|
|
2596
2688
|
) : null,
|
|
2597
|
-
!
|
|
2598
|
-
|
|
2689
|
+
!oe && !v ? /* @__PURE__ */ e(
|
|
2690
|
+
io,
|
|
2599
2691
|
{
|
|
2600
|
-
areaRef:
|
|
2601
|
-
activeImageEl:
|
|
2602
|
-
applyImageClass:
|
|
2603
|
-
setImageWidth:
|
|
2692
|
+
areaRef: ee,
|
|
2693
|
+
activeImageEl: St,
|
|
2694
|
+
applyImageClass: Ot,
|
|
2695
|
+
setImageWidth: qt
|
|
2604
2696
|
}
|
|
2605
2697
|
) : null
|
|
2606
2698
|
] }),
|
|
2607
|
-
S ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children:
|
|
2608
|
-
S &&
|
|
2699
|
+
S ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Gt }) : null,
|
|
2700
|
+
S && Ft ? /* @__PURE__ */ e(
|
|
2609
2701
|
"p",
|
|
2610
2702
|
{
|
|
2611
2703
|
role: "alert",
|
|
2612
2704
|
className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
2613
|
-
children:
|
|
2705
|
+
children: M("editor.ai.dictationError")
|
|
2614
2706
|
}
|
|
2615
2707
|
) : null
|
|
2616
2708
|
]
|
|
@@ -2618,10 +2710,10 @@ const Qn = Ge(
|
|
|
2618
2710
|
);
|
|
2619
2711
|
}
|
|
2620
2712
|
);
|
|
2621
|
-
|
|
2713
|
+
yo.displayName = "RichTextEditor";
|
|
2622
2714
|
export {
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2715
|
+
yo as R,
|
|
2716
|
+
Rn as r,
|
|
2717
|
+
go as w
|
|
2626
2718
|
};
|
|
2627
|
-
//# sourceMappingURL=rich-text-editor-
|
|
2719
|
+
//# sourceMappingURL=rich-text-editor-BJ1-Lkao.js.map
|