@alfadocs/ui-kit 0.64.0 → 0.66.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/{agenda-tray-DA6qj8BL.js → agenda-tray-Bh1KfEOG.js} +2 -2
- package/dist/_chunks/{ai-consent-banner-DBKV27je.js → ai-consent-banner-Btzmk8OH.js} +3 -2
- package/dist/_chunks/{ai-prompt-input-Dx8eXoPm.js → ai-prompt-input-BwEACCPm.js} +2 -2
- package/dist/_chunks/{ai-tools-rail-7tC3GT4h.js → ai-tools-rail-DAfaW8eA.js} +65 -56
- package/dist/_chunks/{alia-sidebar-DlvyXgVC.js → alia-sidebar-CN8pA6c-.js} +7 -7
- package/dist/_chunks/{anamnesis-card-CmkBVAln.js → anamnesis-card-qeLYRG79.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-CdiqkF05.js → antenatal-schedule-timeline-BfzFjEyb.js} +3 -3
- package/dist/_chunks/{appointment-tray-BwDHhWWC.js → appointment-tray-BQnJEora.js} +2 -2
- package/dist/_chunks/{ar-C68WKG5a.js → ar-Cn5Fq48Z.js} +2 -2
- package/dist/_chunks/{audio-recorder-CdXuT9ln.js → audio-recorder-DjXLP4aF.js} +2 -2
- package/dist/_chunks/{autocomplete-CDqxB68B.js → autocomplete-CcCFlVf-.js} +4 -4
- package/dist/_chunks/{bishop-score-CzjSx-dm.js → bishop-score-DPN4Ched.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DA2NGmVK.js → bmi-calculator-DuUneHuZ.js} +2 -2
- package/dist/_chunks/{booking-ChfvWy3P.js → booking-L8-YP8BJ.js} +148 -148
- package/dist/_chunks/calendar-B6soK1Yb.js +17 -0
- package/dist/_chunks/{calendar-CkuJIg3s.js → calendar-oYWOCrnf.js} +1 -1
- package/dist/_chunks/{care-plan-card-DhZNoXs4.js → care-plan-card-D42WD4-T.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-DW70yBOD.js → care-plan-entry-card-BukNI7Uy.js} +2 -2
- package/dist/_chunks/{carousel.agent-DrX96W-1.js → carousel.agent-vt21A_el.js} +2 -2
- package/dist/_chunks/{chat-input-CFwc7JxL.js → chat-input-B5zjNEUN.js} +2 -2
- package/dist/_chunks/{chat-message-Dm8U2RY1.js → chat-message-3V54YipB.js} +2 -2
- package/dist/_chunks/{code-block-HoddNOKJ.js → code-block-BBWHhIc8.js} +2 -2
- package/dist/_chunks/columns-2-BTOBZbep.js +15 -0
- package/dist/_chunks/{contact-profile-card-DvvVfAA2.js → contact-profile-card-CCeJmjbd.js} +2 -2
- package/dist/_chunks/{cycle-calculator-C_t1Hs8V.js → cycle-calculator-D6LTmtQt.js} +4 -4
- package/dist/_chunks/{date-picker-BfHblqwA.js → date-picker-oGg5BnXL.js} +12 -11
- package/dist/_chunks/{date-picker-variants-CXEAx3O_.js → date-picker-variants-DAcSLTua.js} +358 -372
- package/dist/_chunks/{date-range-picker-hcAMs1wO.js → date-range-picker-C5BWfH_T.js} +34 -25
- package/dist/_chunks/{date-time-picker-H-3Pwqlb.js → date-time-picker-Ze1My59T.js} +18 -17
- package/dist/_chunks/{de-DK4A9_a8.js → de-CrJs4ZsX.js} +2 -2
- package/dist/_chunks/{description-list-BEbK2g93.js → description-list-gkNGWk5G.js} +2 -2
- package/dist/_chunks/{due-date-calculator-Q8MIwEVV.js → due-date-calculator-CIG194vq.js} +4 -4
- package/dist/_chunks/{editable-currency-cell-renderer-BQgaKFCz.js → editable-currency-cell-renderer-f3d0Rhue.js} +535 -535
- package/dist/_chunks/editor-overlay-wYm22wZK.js +88 -0
- package/dist/_chunks/{el-B29HXhG5.js → el-DHdMOIhL.js} +6 -6
- package/dist/_chunks/{es-BOwPVwWn.js → es-DCATCfqo.js} +2 -2
- package/dist/_chunks/{fetal-weight-D1a6BmM-.js → fetal-weight-Xf8-ZoDy.js} +2 -2
- package/dist/_chunks/{fiscal-code-input-BZ0FxwUl.js → fiscal-code-input-DPtqluVb.js} +2 -2
- package/dist/_chunks/{fr-DoDBtn0T.js → fr-BfGEMshF.js} +2 -2
- package/dist/_chunks/{freemium-paywall-gHGA44dW.js → freemium-paywall-CkWjv3o6.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-D85E8lGN.js → gestational-age-calculator-BGsZaWXW.js} +6 -6
- package/dist/_chunks/{hcg-doubling-Dg0Hr7ey.js → hcg-doubling-LH5i6oM7.js} +3 -3
- package/dist/_chunks/{header-Ce1Br27u.js → header-CNszv2WQ.js} +2 -2
- package/dist/_chunks/{header-settings-D5Z2B_Yz.js → header-settings-CNOqIhoW.js} +3 -3
- package/dist/_chunks/{hi-DGByrKby.js → hi-CBFRXEIm.js} +2 -2
- package/dist/_chunks/icon-button-LqoiKcUN.js +78 -0
- package/dist/_chunks/image-C6RM5hfF.js +16 -0
- package/dist/_chunks/{insert-result-C1SYdueh.js → insert-result-njqBthzT.js} +115 -125
- package/dist/_chunks/{isSameWeek-B1odL2vR.js → isSameWeek-I3DfXUp1.js} +2 -2
- package/dist/_chunks/{it-B16rEecm.js → it-nz6vAKwG.js} +7 -7
- package/dist/_chunks/{ja-B0viOgft.js → ja-DQcqdAEJ.js} +2 -2
- package/dist/_chunks/{key-value-pair-CkQIb9EG.js → key-value-pair-BrgbMfbF.js} +2 -2
- package/dist/_chunks/{locale-picker-D99UyZVJ.js → locale-picker-C9JmBht3.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-C4OYAC22.js → marketplace-app-shell-Cou6XnMJ.js} +5 -5
- package/dist/_chunks/{message-card-Dvl1TgaN.js → message-card-Bgcvfj6-.js} +2 -2
- package/dist/_chunks/{message-tray-Dl6GQaaV.js → message-tray-saAVMeHP.js} +3 -3
- package/dist/_chunks/{multi-select-DOLO3K_z.js → multi-select-BcPylvHR.js} +100 -90
- package/dist/_chunks/{nl-cBxEX2QU.js → nl-L5SuDjyl.js} +2 -2
- package/dist/_chunks/{notification-card-CObnGdJu.js → notification-card-BiESdm8q.js} +2 -2
- package/dist/_chunks/{notification-tray-BWHDIjgd.js → notification-tray-DlgenTEe.js} +3 -3
- package/dist/_chunks/{patient-search-CArmRKeg.js → patient-search-Bw9ONucF.js} +2 -2
- package/dist/_chunks/{patient-shell-Coarf346.js → patient-shell-Tgpv0HND.js} +4 -4
- package/dist/_chunks/{patient-summary-card-BnTqxcTr.js → patient-summary-card-Bgso0p_l.js} +2 -2
- package/dist/_chunks/{payment-form-DJ9vnzrT.js → payment-form-nXocS_MX.js} +11 -4
- package/dist/_chunks/{payment-request-card-B_lyobd0.js → payment-request-card-DBz3hVDz.js} +3 -3
- package/dist/_chunks/{pdf-viewer-chMpwpA4.js → pdf-viewer-GsfNqeeT.js} +3 -3
- package/dist/_chunks/{periodontal-chart-card-BYs9hax1.js → periodontal-chart-card-AYyHtU9K.js} +2 -2
- package/dist/_chunks/phone-input-DVXhNlIl.js +563 -0
- package/dist/_chunks/{pl-DtS08ioY.js → pl-YAn5z2wR.js} +3 -3
- package/dist/_chunks/{popover-Devce-tT.js → popover-DTbfAuR0.js} +2 -2
- package/dist/_chunks/{practice-results-CtfciF2v.js → practice-results-CVAgY2RZ.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-7NUaAfob.js → pregnancy-dating-f9aJbiAk.js} +6 -6
- package/dist/_chunks/{pregnancy-weight-gain-DI7X-0JX.js → pregnancy-weight-gain-BMRBeA8V.js} +2 -2
- package/dist/_chunks/{privacy-lock-BN3L-alb.js → privacy-lock-C7JyMf0y.js} +2 -2
- package/dist/_chunks/{product-hub-panel-CkfZBA3t.js → product-hub-panel-CAXDFeGP.js} +2 -2
- package/dist/_chunks/{pt-yFXs1VvH.js → pt-D9xdT5KQ.js} +6 -6
- package/dist/_chunks/{public-header.agent-CYQK6T6F.js → public-header.agent-BOhJgZEU.js} +3 -3
- package/dist/_chunks/{reviews-panel-CPrXu5TX.js → reviews-panel-DBktKm7i.js} +2 -2
- package/dist/_chunks/rich-text-editor-B5XQNxe8.js +1586 -0
- package/dist/_chunks/{ro-DsCzSrzR.js → ro-Cp--52bT.js} +2 -2
- package/dist/_chunks/{ru-DgDxL0pc.js → ru-BM8eX_Zz.js} +3 -3
- package/dist/_chunks/{search-bar-CvN_S0jW.js → search-bar-SY2BcV2N.js} +2 -2
- package/dist/_chunks/{search-input-D3aMvi4l.js → search-input-DbxrnHkW.js} +3 -3
- package/dist/_chunks/{sheet-xbzu4YiY.js → sheet-taJer-Ha.js} +2 -2
- package/dist/_chunks/{sidebar-DPEHzxLZ.js → sidebar-BFwbx74W.js} +12 -1
- package/dist/_chunks/{sign-document--nr5cxsB.js → sign-document-CdAiHiCh.js} +2 -2
- package/dist/_chunks/{sign-in-with-alfadocs-button-BpAjVmsI.js → sign-in-with-alfadocs-button-LppxjlFt.js} +2 -2
- package/dist/_chunks/{signature-field-DbhbpLha.js → signature-field-Dy1JRjzE.js} +10 -3
- package/dist/_chunks/{slot-grid-BlHHP9Qy.js → slot-grid-FsqumOaS.js} +2 -2
- package/dist/_chunks/smart-date-CWikAqZx.js +114 -0
- package/dist/_chunks/{social-sign-in-button-uJYLM366.js → social-sign-in-button-dlpPI5l7.js} +2 -2
- package/dist/_chunks/{spinner-OjQNn8oN.js → spinner-hbwuKwMf.js} +10 -10
- package/dist/_chunks/{sq-DHlCYN67.js → sq-XRpr0r49.js} +6 -6
- package/dist/_chunks/{streaming-text-CfhDqtIT.js → streaming-text-BB9mvK4m.js} +2 -2
- package/dist/_chunks/subDays-BcYv1Lxi.js +8 -0
- package/dist/_chunks/{sv-O0QaQs_s.js → sv-Z3APomE8.js} +2 -2
- package/dist/_chunks/{task-tray-Cb_hK4yb.js → task-tray-CAncV-QQ.js} +2 -2
- package/dist/_chunks/{theme-toggle-DAW7uC0B.js → theme-toggle-DETmSu_h.js} +2 -2
- package/dist/_chunks/{toast.agent-B0MCsvdZ.js → toast.agent-vuLRRn2a.js} +2 -2
- package/dist/_chunks/{tooth-scheme-CiphQaON.js → tooth-scheme-BIx1O2aJ.js} +3 -3
- package/dist/_chunks/{tr-BmNDRuio.js → tr-e0-P4FON.js} +2 -2
- package/dist/_chunks/{transcript-panel-B4HiC7ed.js → transcript-panel-CLHmv83g.js} +2 -2
- package/dist/_chunks/trash-2-rPAKaRgB.js +18 -0
- package/dist/_chunks/{unit-converter-BIbXHIQA.js → unit-converter-C1V3ACM9.js} +2 -2
- package/dist/_chunks/{wallet-pay-button-DuDPBlCO.js → wallet-pay-button--dnR6NfJ.js} +2 -2
- package/dist/_chunks/{workflow-map-BJDUNYlX.js → workflow-map-Bt4Of5dT.js} +137 -149
- package/dist/_chunks/{zh-CN-CgVJZEzz.js → zh-CN-B-igM5gY.js} +3 -3
- package/dist/agent-catalog.json +32 -1
- package/dist/components/agenda-tray/index.js +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/ai-tools-rail/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/appointment-card/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/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/index.js +1 -1
- package/dist/components/button/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/carousel/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/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/editor-overlay/editor-overlay.d.ts +19 -0
- package/dist/components/editor-overlay/index.d.ts +3 -0
- package/dist/components/editor-overlay/index.js +5 -0
- package/dist/components/fetal-weight/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/icon-button/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/locale-picker/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/multi-select/index.js +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/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/payment-card/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts +9 -0
- 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/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +26 -0
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +25 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +43 -0
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/smart-date/index.d.ts +3 -0
- package/dist/components/smart-date/index.js +5 -0
- package/dist/components/smart-date/smart-date.d.ts +32 -0
- package/dist/components/social-sign-in-button/index.js +1 -1
- package/dist/components/spinner/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/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/wallet-pay-button/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +60 -0
- package/dist/i18n/locales/ar.js +61 -1
- package/dist/i18n/locales/de.d.ts +60 -0
- package/dist/i18n/locales/de.js +61 -1
- package/dist/i18n/locales/el.d.ts +60 -0
- package/dist/i18n/locales/el.js +61 -1
- package/dist/i18n/locales/en.d.ts +60 -0
- package/dist/i18n/locales/en.js +65 -1
- package/dist/i18n/locales/es.d.ts +60 -0
- package/dist/i18n/locales/es.js +61 -1
- package/dist/i18n/locales/fr.d.ts +60 -0
- package/dist/i18n/locales/fr.js +61 -1
- package/dist/i18n/locales/hi.d.ts +60 -0
- package/dist/i18n/locales/hi.js +61 -1
- package/dist/i18n/locales/it.d.ts +60 -0
- package/dist/i18n/locales/it.js +61 -1
- package/dist/i18n/locales/ja.d.ts +60 -0
- package/dist/i18n/locales/ja.js +61 -1
- package/dist/i18n/locales/nl.d.ts +60 -0
- package/dist/i18n/locales/nl.js +61 -1
- package/dist/i18n/locales/pl.d.ts +60 -0
- package/dist/i18n/locales/pl.js +61 -1
- package/dist/i18n/locales/pt.d.ts +60 -0
- package/dist/i18n/locales/pt.js +61 -1
- package/dist/i18n/locales/ro.d.ts +60 -0
- package/dist/i18n/locales/ro.js +61 -1
- package/dist/i18n/locales/ru.d.ts +60 -0
- package/dist/i18n/locales/ru.js +61 -1
- package/dist/i18n/locales/sq.d.ts +60 -0
- package/dist/i18n/locales/sq.js +61 -1
- package/dist/i18n/locales/sv.d.ts +60 -0
- package/dist/i18n/locales/sv.js +61 -1
- package/dist/i18n/locales/tr.d.ts +60 -0
- package/dist/i18n/locales/tr.js +61 -1
- package/dist/i18n/locales/zh.d.ts +60 -0
- package/dist/i18n/locales/zh.js +61 -1
- package/dist/index.js +494 -490
- package/dist/locales/ar.json +61 -1
- package/dist/locales/de.json +61 -1
- package/dist/locales/el.json +61 -1
- package/dist/locales/en.json +61 -1
- package/dist/locales/es.json +61 -1
- package/dist/locales/fr.json +61 -1
- package/dist/locales/hi.json +61 -1
- package/dist/locales/it.json +61 -1
- package/dist/locales/ja.json +61 -1
- package/dist/locales/nl.json +61 -1
- package/dist/locales/pl.json +61 -1
- package/dist/locales/pt.json +61 -1
- package/dist/locales/ro.json +61 -1
- package/dist/locales/ru.json +61 -1
- package/dist/locales/sq.json +61 -1
- package/dist/locales/sv.json +61 -1
- package/dist/locales/tr.json +61 -1
- package/dist/locales/zh.json +61 -1
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +36 -22
- package/package.json +10 -1
- package/dist/_chunks/icon-button-CKEOrN37.js +0 -70
- package/dist/_chunks/phone-input-DfZbPPvh.js +0 -525
- package/dist/_chunks/rich-text-editor-B03qM22-.js +0 -334
- package/dist/_chunks/subDays-Bs00akhK.js +0 -8
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Y, useId as K, useMemo as N, useRef as l, useState as ee, useEffect as p, useImperativeHandle as te, useCallback as re } from "react";
|
|
3
|
-
import { c as A } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as ne } from "react-i18next";
|
|
5
|
-
import { sanitiseHtml as oe } from "../safe-html/index.js";
|
|
6
|
-
import { u as ie } from "./registry-nPAVE19X.js";
|
|
7
|
-
const se = {
|
|
8
|
-
id: "rich-text-editor",
|
|
9
|
-
capabilities: ["edit_inline"],
|
|
10
|
-
state: {
|
|
11
|
-
html: {
|
|
12
|
-
type: "string",
|
|
13
|
-
description: "Sanitised HTML representation of the editor content.",
|
|
14
|
-
read: (t) => t.getHTML()
|
|
15
|
-
},
|
|
16
|
-
markdown: {
|
|
17
|
-
type: "string",
|
|
18
|
-
description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
|
|
19
|
-
read: (t) => t.getMarkdown()
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
actions: {
|
|
23
|
-
set_content: {
|
|
24
|
-
safety: "destructive",
|
|
25
|
-
argsType: "{ html: string }",
|
|
26
|
-
description: "Replace the editor content. Loses unsaved input.",
|
|
27
|
-
invoke: (t, n) => {
|
|
28
|
-
t.setContent(n.html);
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
clear: {
|
|
32
|
-
safety: "destructive",
|
|
33
|
-
description: "Empty the editor. Loses unsaved input.",
|
|
34
|
-
invoke: (t) => {
|
|
35
|
-
t.clear();
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
focus: {
|
|
39
|
-
safety: "read",
|
|
40
|
-
description: "Move keyboard focus to the editor surface.",
|
|
41
|
-
invoke: (t) => {
|
|
42
|
-
t.focus();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
domHooks: {
|
|
47
|
-
root: { attr: "data-component", value: "rich-text-editor" },
|
|
48
|
-
instanceId: {
|
|
49
|
-
attr: "data-component-id",
|
|
50
|
-
sourceProp: "id",
|
|
51
|
-
description: "Sourced from the id prop."
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
function u(t) {
|
|
56
|
-
return oe(t, "rich-text");
|
|
57
|
-
}
|
|
58
|
-
function z(t = "") {
|
|
59
|
-
const n = String(t).trim();
|
|
60
|
-
if (n === "" || n === "<p><br></p>" || n === "<p> </p>")
|
|
61
|
-
return "";
|
|
62
|
-
const i = n.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
63
|
-
return i === "" && /<img\b[^>]*>/i.test(n) ? n : i === "" ? "" : n;
|
|
64
|
-
}
|
|
65
|
-
function ae(t) {
|
|
66
|
-
return t.replace(
|
|
67
|
-
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
68
|
-
'<img loading="lazy"$1>'
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
function ce(t) {
|
|
72
|
-
if (t) return t;
|
|
73
|
-
if (typeof window > "u") return null;
|
|
74
|
-
const n = window;
|
|
75
|
-
return n.$R ?? n.Redactor ?? null;
|
|
76
|
-
}
|
|
77
|
-
const de = {
|
|
78
|
-
minimal: ["bold", "italic", "link"],
|
|
79
|
-
standard: ["format", "bold", "italic", "link", "lists"],
|
|
80
|
-
full: [
|
|
81
|
-
"format",
|
|
82
|
-
"bold",
|
|
83
|
-
"italic",
|
|
84
|
-
"deleted",
|
|
85
|
-
"link",
|
|
86
|
-
"lists",
|
|
87
|
-
"image",
|
|
88
|
-
"table",
|
|
89
|
-
"line"
|
|
90
|
-
]
|
|
91
|
-
}, le = {
|
|
92
|
-
sm: "8rem",
|
|
93
|
-
md: "16rem",
|
|
94
|
-
lg: "24rem"
|
|
95
|
-
}, ue = {
|
|
96
|
-
zh: "zh_cn",
|
|
97
|
-
pt: "pt_br"
|
|
98
|
-
};
|
|
99
|
-
function fe(t) {
|
|
100
|
-
const n = t.split("-")[0];
|
|
101
|
-
return ue[n] ?? n ?? "en";
|
|
102
|
-
}
|
|
103
|
-
const me = A(
|
|
104
|
-
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
105
|
-
), pe = A(
|
|
106
|
-
[
|
|
107
|
-
"ds:block ds:[inline-size:100%]",
|
|
108
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
109
|
-
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
110
|
-
"ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
|
|
111
|
-
"ds:p-[var(--spacing-md)] ds:[min-block-size:10rem]",
|
|
112
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
113
|
-
"ds:focus-visible:outline-solid",
|
|
114
|
-
"ds:focus-visible:outline-[var(--ring)]",
|
|
115
|
-
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
116
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
117
|
-
].join(" ")
|
|
118
|
-
), ge = Y(
|
|
119
|
-
({
|
|
120
|
-
id: t,
|
|
121
|
-
defaultValue: n,
|
|
122
|
-
value: i,
|
|
123
|
-
onChange: R,
|
|
124
|
-
toolbar: $ = "standard",
|
|
125
|
-
placeholder: E,
|
|
126
|
-
readOnly: g = !1,
|
|
127
|
-
ariaLabel: O,
|
|
128
|
-
minHeight: H,
|
|
129
|
-
className: B,
|
|
130
|
-
redactor: P,
|
|
131
|
-
options: h,
|
|
132
|
-
plugins: V,
|
|
133
|
-
lang: j,
|
|
134
|
-
imageUploadUrl: L,
|
|
135
|
-
onKeyDown: y
|
|
136
|
-
}, G) => {
|
|
137
|
-
const { t: k, i18n: D } = ne(), M = K(), C = N(
|
|
138
|
-
() => `rte-${M.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
139
|
-
[M]
|
|
140
|
-
), o = `#${C}`, s = l(null), a = l(null), T = l(!1), [f, _] = ee(!1), m = l(null), c = l(R), b = l(y);
|
|
141
|
-
p(() => {
|
|
142
|
-
c.current = R, b.current = y;
|
|
143
|
-
}, [R, y]);
|
|
144
|
-
const F = l(
|
|
145
|
-
(() => {
|
|
146
|
-
const e = i ?? n ?? "";
|
|
147
|
-
return e ? u(e) : "";
|
|
148
|
-
})()
|
|
149
|
-
);
|
|
150
|
-
p(() => {
|
|
151
|
-
const e = s.current;
|
|
152
|
-
if (!e) return;
|
|
153
|
-
e.value = F.current;
|
|
154
|
-
const r = ce(P);
|
|
155
|
-
if (!r) {
|
|
156
|
-
_(!0);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
a.current = r;
|
|
160
|
-
const d = {
|
|
161
|
-
lang: j ?? fe(D.language || "en"),
|
|
162
|
-
buttons: de[$],
|
|
163
|
-
buttonsHide: ["html"],
|
|
164
|
-
plugins: V ?? [],
|
|
165
|
-
placeholder: E ?? k("editor.placeholder"),
|
|
166
|
-
toolbarFixed: !1,
|
|
167
|
-
imageEditable: !1,
|
|
168
|
-
imageResizable: !0
|
|
169
|
-
};
|
|
170
|
-
H && (d.minHeight = le[H]);
|
|
171
|
-
const q = L ? { imageUpload: L } : {}, J = (h == null ? void 0 : h.callbacks) ?? {}, Q = {
|
|
172
|
-
...d,
|
|
173
|
-
...q,
|
|
174
|
-
...h ?? {},
|
|
175
|
-
// Re-pin safety-critical keys LAST so consumer `options` can't override
|
|
176
|
-
// the sanitising change handler or re-enable image editing.
|
|
177
|
-
imageEditable: !1,
|
|
178
|
-
callbacks: {
|
|
179
|
-
...J,
|
|
180
|
-
changed(w) {
|
|
181
|
-
const v = z(ae(w)), X = u(v);
|
|
182
|
-
T.current = !0, c.current && (m.current && clearTimeout(m.current), m.current = setTimeout(() => {
|
|
183
|
-
var I;
|
|
184
|
-
(I = c.current) == null || I.call(c, { html: X, markdown: "" });
|
|
185
|
-
}, 100));
|
|
186
|
-
},
|
|
187
|
-
keydown(w) {
|
|
188
|
-
var v;
|
|
189
|
-
(v = b.current) == null || v.call(b, w);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
try {
|
|
194
|
-
if (r(o, Q), g)
|
|
195
|
-
try {
|
|
196
|
-
r(o, "enableReadonly");
|
|
197
|
-
} catch {
|
|
198
|
-
}
|
|
199
|
-
} catch {
|
|
200
|
-
_(!0);
|
|
201
|
-
}
|
|
202
|
-
return () => {
|
|
203
|
-
m.current && clearTimeout(m.current);
|
|
204
|
-
try {
|
|
205
|
-
r(o, "destroy");
|
|
206
|
-
} catch {
|
|
207
|
-
}
|
|
208
|
-
a.current = null;
|
|
209
|
-
};
|
|
210
|
-
}, []), p(() => {
|
|
211
|
-
const e = a.current;
|
|
212
|
-
if (!e || i === void 0) return;
|
|
213
|
-
if (T.current) {
|
|
214
|
-
T.current = !1;
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
const r = u(z(i));
|
|
218
|
-
let d = "";
|
|
219
|
-
try {
|
|
220
|
-
d = z(
|
|
221
|
-
String(e(o, "source.getCode") ?? "")
|
|
222
|
-
);
|
|
223
|
-
} catch {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (d !== r)
|
|
227
|
-
try {
|
|
228
|
-
e(o, "source.setCode", r);
|
|
229
|
-
} catch {
|
|
230
|
-
}
|
|
231
|
-
}, [i, o]), p(() => {
|
|
232
|
-
const e = a.current;
|
|
233
|
-
if (e)
|
|
234
|
-
try {
|
|
235
|
-
e(o, g ? "enableReadonly" : "disableReadonly");
|
|
236
|
-
} catch {
|
|
237
|
-
}
|
|
238
|
-
}, [g, o]), p(() => {
|
|
239
|
-
if (!f || i === void 0) return;
|
|
240
|
-
const e = s.current;
|
|
241
|
-
if (!e) return;
|
|
242
|
-
const r = u(i);
|
|
243
|
-
e.value !== r && document.activeElement !== e && (e.value = r);
|
|
244
|
-
}, [f, i]);
|
|
245
|
-
const x = N(
|
|
246
|
-
() => ({
|
|
247
|
-
getHTML() {
|
|
248
|
-
var r;
|
|
249
|
-
const e = a.current;
|
|
250
|
-
if (e)
|
|
251
|
-
try {
|
|
252
|
-
return String(e(o, "source.getCode") ?? "");
|
|
253
|
-
} catch {
|
|
254
|
-
}
|
|
255
|
-
return ((r = s.current) == null ? void 0 : r.value) ?? "";
|
|
256
|
-
},
|
|
257
|
-
getMarkdown() {
|
|
258
|
-
return "";
|
|
259
|
-
},
|
|
260
|
-
setContent(e) {
|
|
261
|
-
const r = u(e), d = a.current;
|
|
262
|
-
if (d)
|
|
263
|
-
try {
|
|
264
|
-
d(o, "source.setCode", r);
|
|
265
|
-
return;
|
|
266
|
-
} catch {
|
|
267
|
-
}
|
|
268
|
-
s.current && (s.current.value = r);
|
|
269
|
-
},
|
|
270
|
-
focus() {
|
|
271
|
-
var r;
|
|
272
|
-
const e = a.current;
|
|
273
|
-
if (e)
|
|
274
|
-
try {
|
|
275
|
-
e(o, "editor.focus");
|
|
276
|
-
return;
|
|
277
|
-
} catch {
|
|
278
|
-
}
|
|
279
|
-
(r = s.current) == null || r.focus();
|
|
280
|
-
},
|
|
281
|
-
clear() {
|
|
282
|
-
const e = a.current;
|
|
283
|
-
if (e)
|
|
284
|
-
try {
|
|
285
|
-
e(o, "source.setCode", "");
|
|
286
|
-
return;
|
|
287
|
-
} catch {
|
|
288
|
-
}
|
|
289
|
-
s.current && (s.current.value = "");
|
|
290
|
-
}
|
|
291
|
-
}),
|
|
292
|
-
[o]
|
|
293
|
-
);
|
|
294
|
-
te(G, () => x, [x]), ie(se, x, t);
|
|
295
|
-
const U = re(
|
|
296
|
-
(e) => {
|
|
297
|
-
var r;
|
|
298
|
-
(r = c.current) == null || r.call(c, {
|
|
299
|
-
html: u(e.target.value),
|
|
300
|
-
markdown: ""
|
|
301
|
-
});
|
|
302
|
-
},
|
|
303
|
-
[]
|
|
304
|
-
), W = O ?? k("editor.regionLabel"), Z = E ?? k("editor.placeholder");
|
|
305
|
-
return /* @__PURE__ */ S(
|
|
306
|
-
"div",
|
|
307
|
-
{
|
|
308
|
-
className: [me(), B].filter(Boolean).join(" "),
|
|
309
|
-
"data-component": "rich-text-editor",
|
|
310
|
-
"data-component-id": t,
|
|
311
|
-
children: /* @__PURE__ */ S(
|
|
312
|
-
"textarea",
|
|
313
|
-
{
|
|
314
|
-
ref: s,
|
|
315
|
-
id: C,
|
|
316
|
-
"aria-label": W,
|
|
317
|
-
"aria-multiline": "true",
|
|
318
|
-
placeholder: Z,
|
|
319
|
-
onChange: f ? U : void 0,
|
|
320
|
-
readOnly: f ? g : void 0,
|
|
321
|
-
className: f ? pe() : void 0
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
}
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
ge.displayName = "RichTextEditor";
|
|
329
|
-
export {
|
|
330
|
-
ge as R,
|
|
331
|
-
se as r,
|
|
332
|
-
me as w
|
|
333
|
-
};
|
|
334
|
-
//# sourceMappingURL=rich-text-editor-B03qM22-.js.map
|