@mono-lit/helper 0.0.0-stage → 0.0.1
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/LICENSE.md +55 -0
- package/README.md +34 -2
- package/dist/breakpoints-CAbhDUht.js +84 -0
- package/dist/checkbox-Cqpie9Ap.js +4 -0
- package/dist/chip-DBUUa2eB.js +4 -0
- package/dist/chip-limits-BMoO31JM.js +213 -0
- package/dist/chip-strip-Cw3gyz0q.js +213 -0
- package/dist/color-DHYrfXsX.js +253 -0
- package/dist/css-class-BRKRzHx-.js +60 -0
- package/dist/css-size-DhHSVZJK.js +37 -0
- package/dist/data/theme/presets.json.d.ts +140 -0
- package/dist/data-search-Bwo5bg8K.js +573 -0
- package/dist/data-source-controller-C50Qyfzh.js +178 -0
- package/dist/data-source-options-BTpfrOZ_.js +535 -0
- package/dist/data-source-options-CQSTZHPE.js +537 -0
- package/dist/data-source-read-CUX-lgrQ.js +216 -0
- package/dist/data-source-read-DL88aH8t.js +217 -0
- package/dist/decorate-DEXtNagw.js +141 -0
- package/dist/element-props-CLB6yvbm.js +114 -0
- package/dist/esm-Ptok4SQZ.js +2026 -0
- package/dist/excel-CY6zGkcx.js +608 -0
- package/dist/excel-DopRbEMK.js +608 -0
- package/dist/export-BvlBx_GZ.js +2302 -0
- package/dist/export.d.ts +1 -0
- package/dist/export.js +2302 -0
- package/dist/field-icons-BoOG6KrL.js +51 -0
- package/dist/field-path-C92eGLg3.js +251 -0
- package/dist/filter-builder-Bke3qOgJ.js +205 -0
- package/dist/filter-builder-CE4zE0V5.js +205 -0
- package/dist/filter-eval-DIfU2EAn.js +173 -0
- package/dist/filter-odata-C1vSGZaY.js +591 -0
- package/dist/form-control-core-B8d7k6vk.js +223 -0
- package/dist/form-control-core-eeRr0zLU.js +223 -0
- package/dist/hydration-flush-RB5Tz5nl.js +1001 -0
- package/dist/icon-CJkTlmTb.js +55 -0
- package/dist/icon-dVhYJUIH.js +17 -0
- package/dist/import-BgJdkwBI.js +606 -0
- package/dist/import.d.ts +1 -0
- package/dist/import.js +606 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16 -0
- package/dist/index.node-DjvYOL-J.js +395 -0
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.js +16 -0
- package/dist/input-zGOULADt.js +4 -0
- package/dist/layout-var-CZnzMC0s.js +73 -0
- package/dist/light-slots-BVJwyg_2.js +244 -0
- package/dist/light-slots-DW1WgfgT.js +254 -0
- package/dist/markdown-DfqrfOJN.js +20146 -0
- package/dist/mono-button-CoVnBLav.js +873 -0
- package/dist/mono-button.shadow-FfP_hMH4.js +784 -0
- package/dist/mono-data-chart-ChU4Ii3p.js +738 -0
- package/dist/mono-data-dropdown-BAUl58kW.js +357 -0
- package/dist/mono-data-grid-CLBK8clE.js +4140 -0
- package/dist/mono-data-grid-Db80FzdZ.js +4142 -0
- package/dist/mono-element-B0kP_96P.js +232 -0
- package/dist/mono-event-Bi1qP9uN.js +129 -0
- package/dist/mono-form-controller-5PfsU4qa.js +409 -0
- package/dist/mono-modal-controller-BMO3n3rP.js +223 -0
- package/dist/mono-ui-CPV7rrdo.js +358 -0
- package/dist/notifier-CE4yxMUQ.js +88 -0
- package/dist/nuxt.d.ts +1 -0
- package/dist/nuxt.js +130 -0
- package/dist/popup-portal-BziRX1yG.js +465 -0
- package/dist/popup-stack-CEEMib__.js +189 -0
- package/dist/rate-limit-BBa2PO79.js +521 -0
- package/dist/reactive-BHsqVjRh.js +789 -0
- package/dist/reactive-D3EERqgO.js +47 -0
- package/dist/search.d.ts +1 -0
- package/dist/search.js +97 -0
- package/dist/src/components/accordion/accordion-core.d.ts +62 -0
- package/dist/src/components/accordion/accordion-types.d.ts +62 -0
- package/dist/src/components/accordion/index.d.ts +3 -0
- package/dist/src/components/accordion/index.shadow.d.ts +5 -0
- package/dist/src/components/accordion/mono-accordion.d.ts +55 -0
- package/dist/src/components/accordion/mono-accordion.shadow.d.ts +56 -0
- package/dist/src/components/alert/alert-core.d.ts +46 -0
- package/dist/src/components/alert/alert-types.d.ts +44 -0
- package/dist/src/components/alert/index.d.ts +3 -0
- package/dist/src/components/alert/index.shadow.d.ts +5 -0
- package/dist/src/components/alert/mono-alert.d.ts +44 -0
- package/dist/src/components/alert/mono-alert.shadow.d.ts +34 -0
- package/dist/src/components/breadcrumb/breadcrumb-core.d.ts +61 -0
- package/dist/src/components/breadcrumb/breadcrumb-list-core.d.ts +49 -0
- package/dist/src/components/breadcrumb/breadcrumb-render.d.ts +31 -0
- package/dist/src/components/breadcrumb/breadcrumb-types.d.ts +117 -0
- package/dist/src/components/breadcrumb/breadcrumb-utils.d.ts +43 -0
- package/dist/src/components/breadcrumb/index.d.ts +6 -0
- package/dist/src/components/breadcrumb/index.shadow.d.ts +8 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb-list.d.ts +29 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb-list.shadow.d.ts +48 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb.d.ts +38 -0
- package/dist/src/components/breadcrumb/mono-breadcrumb.shadow.d.ts +73 -0
- package/dist/src/components/button/button-core.d.ts +90 -0
- package/dist/src/components/button/button-dropdown-core.d.ts +57 -0
- package/dist/src/components/button/button-dropdown-types.d.ts +129 -0
- package/dist/src/components/button/button-types.d.ts +219 -0
- package/dist/src/components/button/button-utils.d.ts +18 -0
- package/dist/src/components/button/index.button-dropdown.d.ts +4 -0
- package/dist/src/components/button/index.button-dropdown.shadow.d.ts +4 -0
- package/dist/src/components/button/index.d.ts +8 -0
- package/dist/src/components/button/index.shadow.d.ts +5 -0
- package/dist/src/components/button/mono-button-dropdown.d.ts +35 -0
- package/dist/src/components/button/mono-button-dropdown.shadow.d.ts +45 -0
- package/dist/src/components/button/mono-button.d.ts +123 -0
- package/dist/src/components/button/mono-button.shadow.d.ts +56 -0
- package/dist/src/components/card/card-core.d.ts +74 -0
- package/dist/src/components/card/card-types.d.ts +137 -0
- package/dist/src/components/card/card-utils.d.ts +23 -0
- package/dist/src/components/card/index.d.ts +4 -0
- package/dist/src/components/card/index.shadow.d.ts +6 -0
- package/dist/src/components/card/mono-card.d.ts +56 -0
- package/dist/src/components/card/mono-card.shadow.d.ts +52 -0
- package/dist/src/components/chart/chart-core.d.ts +43 -0
- package/dist/src/components/chart/chart-odata.d.ts +52 -0
- package/dist/src/components/chart/chart-types.d.ts +337 -0
- package/dist/src/components/chart/index.d.ts +8 -0
- package/dist/src/components/chart/index.shadow.d.ts +7 -0
- package/dist/src/components/chart/mono-chart-presets.d.ts +43 -0
- package/dist/src/components/chart/mono-chart-presets.shadow.d.ts +43 -0
- package/dist/src/components/chart/mono-chart.d.ts +30 -0
- package/dist/src/components/chart/mono-chart.shadow.d.ts +22 -0
- package/dist/src/components/chart/mono-data-chart.d.ts +27 -0
- package/dist/src/components/checkbox/checkbox-core.d.ts +53 -0
- package/dist/src/components/checkbox/checkbox-types.d.ts +69 -0
- package/dist/src/components/checkbox/checkbox-utils.d.ts +35 -0
- package/dist/src/components/checkbox/index.d.ts +4 -0
- package/dist/src/components/checkbox/index.shadow.d.ts +5 -0
- package/dist/src/components/checkbox/mono-checkbox.d.ts +34 -0
- package/dist/src/components/checkbox/mono-checkbox.shadow.d.ts +45 -0
- package/dist/src/components/chip/chip-core.d.ts +58 -0
- package/dist/src/components/chip/chip-types.d.ts +142 -0
- package/dist/src/components/chip/chip-utils.d.ts +24 -0
- package/dist/src/components/chip/index.d.ts +8 -0
- package/dist/src/components/chip/index.shadow.d.ts +6 -0
- package/dist/src/components/chip/mono-chip.d.ts +48 -0
- package/dist/src/components/chip/mono-chip.shadow.d.ts +33 -0
- package/dist/src/components/chip/mono-status-dot.d.ts +34 -0
- package/dist/src/components/date/date-core.d.ts +80 -0
- package/dist/src/components/date/date-types.d.ts +163 -0
- package/dist/src/components/date/index.d.ts +3 -0
- package/dist/src/components/date/index.shadow.d.ts +4 -0
- package/dist/src/components/date/mono-date.d.ts +22 -0
- package/dist/src/components/date/mono-date.shadow.d.ts +31 -0
- package/dist/src/components/drawer/drawer-core.d.ts +99 -0
- package/dist/src/components/drawer/drawer-types.d.ts +153 -0
- package/dist/src/components/drawer/index.d.ts +3 -0
- package/dist/src/components/drawer/index.shadow.d.ts +4 -0
- package/dist/src/components/drawer/mono-drawer.d.ts +45 -0
- package/dist/src/components/drawer/mono-drawer.shadow.d.ts +46 -0
- package/dist/src/components/dropdown/dropdown-core.d.ts +33 -0
- package/dist/src/components/dropdown/dropdown-types.d.ts +88 -0
- package/dist/src/components/dropdown/index.d.ts +3 -0
- package/dist/src/components/dropdown/index.shadow.d.ts +4 -0
- package/dist/src/components/dropdown/mono-dropdown.d.ts +34 -0
- package/dist/src/components/dropdown/mono-dropdown.shadow.d.ts +28 -0
- package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +65 -0
- package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +278 -0
- package/dist/src/components/dropdown-table/index.d.ts +5 -0
- package/dist/src/components/dropdown-table/index.shadow.d.ts +6 -0
- package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +152 -0
- package/dist/src/components/dropdown-table/mono-dropdown-table.d.ts +46 -0
- package/dist/src/components/dropdown-table/mono-dropdown-table.shadow.d.ts +22 -0
- package/dist/src/components/file-upload/file-upload-core.d.ts +60 -0
- package/dist/src/components/file-upload/file-upload-types.d.ts +145 -0
- package/dist/src/components/file-upload/file-upload-utils.d.ts +16 -0
- package/dist/src/components/file-upload/index.d.ts +4 -0
- package/dist/src/components/file-upload/index.shadow.d.ts +5 -0
- package/dist/src/components/file-upload/mono-file-upload.d.ts +33 -0
- package/dist/src/components/file-upload/mono-file-upload.shadow.d.ts +50 -0
- package/dist/src/components/filter/filter-builder-core.d.ts +36 -0
- package/dist/src/components/filter/filter-builder.d.ts +23 -0
- package/dist/src/components/filter/filter-odata.d.ts +27 -0
- package/dist/src/components/filter/filter-operators.d.ts +13 -0
- package/dist/src/components/filter/filter-types.d.ts +253 -0
- package/dist/src/components/filter/index.d.ts +6 -0
- package/dist/src/components/filter/index.shadow.d.ts +7 -0
- package/dist/src/components/filter/mono-filter-builder.d.ts +21 -0
- package/dist/src/components/filter/mono-filter-builder.shadow.d.ts +17 -0
- package/dist/src/components/form/form-control-core.d.ts +37 -0
- package/dist/src/components/form/form-rules.d.ts +25 -0
- package/dist/src/components/form/form-types.d.ts +307 -0
- package/dist/src/components/form/index.d.ts +6 -0
- package/dist/src/components/form/mono-form-controller.d.ts +16 -0
- package/dist/src/components/input/index.d.ts +6 -0
- package/dist/src/components/input/index.shadow.d.ts +8 -0
- package/dist/src/components/input/input-core.d.ts +91 -0
- package/dist/src/components/input/input-format.d.ts +118 -0
- package/dist/src/components/input/input-types.d.ts +179 -0
- package/dist/src/components/input/input-utils.d.ts +10 -0
- package/dist/src/components/input/mono-input.d.ts +46 -0
- package/dist/src/components/input/mono-input.shadow.d.ts +34 -0
- package/dist/src/components/menu/index.d.ts +6 -0
- package/dist/src/components/menu/index.shadow.d.ts +7 -0
- package/dist/src/components/menu/menu-core.d.ts +65 -0
- package/dist/src/components/menu/menu-render.d.ts +55 -0
- package/dist/src/components/menu/menu-types.d.ts +195 -0
- package/dist/src/components/menu/menu-utils.d.ts +53 -0
- package/dist/src/components/menu/mono-menu-list.d.ts +118 -0
- package/dist/src/components/menu/mono-menu.d.ts +39 -0
- package/dist/src/components/menu/mono-menu.shadow.d.ts +40 -0
- package/dist/src/components/modal/index.d.ts +4 -0
- package/dist/src/components/modal/index.shadow.d.ts +5 -0
- package/dist/src/components/modal/modal-core.d.ts +110 -0
- package/dist/src/components/modal/modal-types.d.ts +304 -0
- package/dist/src/components/modal/mono-modal-controller.d.ts +4 -0
- package/dist/src/components/modal/mono-modal.d.ts +45 -0
- package/dist/src/components/modal/mono-modal.shadow.d.ts +50 -0
- package/dist/src/components/nav/index.d.ts +4 -0
- package/dist/src/components/nav/index.shadow.d.ts +6 -0
- package/dist/src/components/nav/mono-nav.d.ts +41 -0
- package/dist/src/components/nav/mono-nav.shadow.d.ts +21 -0
- package/dist/src/components/nav/nav-core.d.ts +34 -0
- package/dist/src/components/nav/nav-types.d.ts +48 -0
- package/dist/src/components/nav/nav-utils.d.ts +12 -0
- package/dist/src/components/radio/index.d.ts +4 -0
- package/dist/src/components/radio/index.shadow.d.ts +5 -0
- package/dist/src/components/radio/mono-radio.d.ts +31 -0
- package/dist/src/components/radio/mono-radio.shadow.d.ts +35 -0
- package/dist/src/components/radio/radio-core.d.ts +45 -0
- package/dist/src/components/radio/radio-types.d.ts +58 -0
- package/dist/src/components/radio/radio-utils.d.ts +12 -0
- package/dist/src/components/rich-text-editor/index.d.ts +5 -0
- package/dist/src/components/rich-text-editor/index.shadow.d.ts +6 -0
- package/dist/src/components/rich-text-editor/mono-rich-text-editor.d.ts +31 -0
- package/dist/src/components/rich-text-editor/mono-rich-text-editor.shadow.d.ts +34 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-core.d.ts +100 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-loader.d.ts +17 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-toolbar.d.ts +65 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-types.d.ts +231 -0
- package/dist/src/components/select/index.d.ts +4 -0
- package/dist/src/components/select/index.shadow.d.ts +5 -0
- package/dist/src/components/select/mono-select.d.ts +69 -0
- package/dist/src/components/select/mono-select.shadow.d.ts +48 -0
- package/dist/src/components/select/select-core.d.ts +98 -0
- package/dist/src/components/select/select-types.d.ts +258 -0
- package/dist/src/components/select/select-utils.d.ts +7 -0
- package/dist/src/components/sidebar/index.d.ts +4 -0
- package/dist/src/components/sidebar/index.shadow.d.ts +6 -0
- package/dist/src/components/sidebar/mono-sidebar.d.ts +34 -0
- package/dist/src/components/sidebar/mono-sidebar.shadow.d.ts +27 -0
- package/dist/src/components/sidebar/sidebar-core.d.ts +51 -0
- package/dist/src/components/sidebar/sidebar-types.d.ts +119 -0
- package/dist/src/components/sidebar/sidebar-utils.d.ts +55 -0
- package/dist/src/components/switch/index.d.ts +4 -0
- package/dist/src/components/switch/index.shadow.d.ts +5 -0
- package/dist/src/components/switch/mono-switch.d.ts +31 -0
- package/dist/src/components/switch/mono-switch.shadow.d.ts +36 -0
- package/dist/src/components/switch/switch-core.d.ts +49 -0
- package/dist/src/components/switch/switch-types.d.ts +64 -0
- package/dist/src/components/switch/switch-utils.d.ts +12 -0
- package/dist/src/components/table/array-source.d.ts +44 -0
- package/dist/src/components/table/date-filter-tree.d.ts +93 -0
- package/dist/src/components/table/grouping.d.ts +55 -0
- package/dist/src/components/table/index.d.ts +33 -0
- package/dist/src/components/table/index.shadow.d.ts +47 -0
- package/dist/src/components/table/mono-data-grid.d.ts +1756 -0
- package/dist/src/components/table/mono-table-checkbox-core.d.ts +76 -0
- package/dist/src/components/table/mono-table-checkbox.d.ts +34 -0
- package/dist/src/components/table/mono-table-checkbox.shadow.d.ts +26 -0
- package/dist/src/components/table/mono-table-detail-core.d.ts +87 -0
- package/dist/src/components/table/mono-table-detail.d.ts +32 -0
- package/dist/src/components/table/mono-table-detail.shadow.d.ts +31 -0
- package/dist/src/components/table/mono-table-empty-core.d.ts +60 -0
- package/dist/src/components/table/mono-table-empty.d.ts +35 -0
- package/dist/src/components/table/mono-table-empty.shadow.d.ts +40 -0
- package/dist/src/components/table/mono-table-error-core.d.ts +84 -0
- package/dist/src/components/table/mono-table-error.d.ts +28 -0
- package/dist/src/components/table/mono-table-error.shadow.d.ts +21 -0
- package/dist/src/components/table/mono-table-info-core.d.ts +13 -0
- package/dist/src/components/table/mono-table-info.d.ts +19 -0
- package/dist/src/components/table/mono-table-info.shadow.d.ts +14 -0
- package/dist/src/components/table/mono-table-loading-core.d.ts +41 -0
- package/dist/src/components/table/mono-table-loading.d.ts +50 -0
- package/dist/src/components/table/mono-table-loading.shadow.d.ts +14 -0
- package/dist/src/components/table/mono-table-page-size-core.d.ts +14 -0
- package/dist/src/components/table/mono-table-page-size.d.ts +16 -0
- package/dist/src/components/table/mono-table-page-size.shadow.d.ts +11 -0
- package/dist/src/components/table/mono-table-paging-core.d.ts +22 -0
- package/dist/src/components/table/mono-table-paging-group-core.d.ts +18 -0
- package/dist/src/components/table/mono-table-paging-group.d.ts +20 -0
- package/dist/src/components/table/mono-table-paging-group.shadow.d.ts +13 -0
- package/dist/src/components/table/mono-table-paging.d.ts +16 -0
- package/dist/src/components/table/mono-table-paging.shadow.d.ts +11 -0
- package/dist/src/components/table/mono-table-search-core.d.ts +74 -0
- package/dist/src/components/table/mono-table-search.d.ts +34 -0
- package/dist/src/components/table/mono-table-search.shadow.d.ts +21 -0
- package/dist/src/components/table/mono-table-sort-core.d.ts +35 -0
- package/dist/src/components/table/mono-table-sort.d.ts +38 -0
- package/dist/src/components/table/mono-table-sort.shadow.d.ts +20 -0
- package/dist/src/components/table/mono-table-summary-core.d.ts +26 -0
- package/dist/src/components/table/mono-table-summary.d.ts +24 -0
- package/dist/src/components/table/mono-table-summary.shadow.d.ts +14 -0
- package/dist/src/components/table/mono-table-th-core.d.ts +56 -0
- package/dist/src/components/table/mono-table-th.d.ts +41 -0
- package/dist/src/components/table/mono-table-th.shadow.d.ts +19 -0
- package/dist/src/components/table/store-group-source.d.ts +24 -0
- package/dist/src/components/table/table-controller-core.d.ts +40 -0
- package/dist/src/components/table/table-filter-icons.d.ts +3 -0
- package/dist/src/components/table/table-menu-core.d.ts +65 -0
- package/dist/src/components/table/table-overlay.d.ts +165 -0
- package/dist/src/components/table/table-sort-icons.d.ts +4 -0
- package/dist/src/components/table/table-sort-utils.d.ts +20 -0
- package/dist/src/components/table/table-types.d.ts +475 -0
- package/dist/src/components/tabs/index.d.ts +3 -0
- package/dist/src/components/tabs/index.shadow.d.ts +4 -0
- package/dist/src/components/tabs/mono-tabs.d.ts +33 -0
- package/dist/src/components/tabs/mono-tabs.shadow.d.ts +37 -0
- package/dist/src/components/tabs/tabs-core.d.ts +57 -0
- package/dist/src/components/tabs/tabs-types.d.ts +65 -0
- package/dist/src/components/tag-input/index.d.ts +4 -0
- package/dist/src/components/tag-input/index.shadow.d.ts +5 -0
- package/dist/src/components/tag-input/mono-tag-input.d.ts +66 -0
- package/dist/src/components/tag-input/mono-tag-input.shadow.d.ts +40 -0
- package/dist/src/components/tag-input/tag-input-core.d.ts +108 -0
- package/dist/src/components/tag-input/tag-input-types.d.ts +394 -0
- package/dist/src/components/tag-input/tag-input-utils.d.ts +8 -0
- package/dist/src/components/textarea/index.d.ts +4 -0
- package/dist/src/components/textarea/index.shadow.d.ts +5 -0
- package/dist/src/components/textarea/mono-textarea.d.ts +29 -0
- package/dist/src/components/textarea/mono-textarea.shadow.d.ts +31 -0
- package/dist/src/components/textarea/textarea-core.d.ts +60 -0
- package/dist/src/components/textarea/textarea-types.d.ts +131 -0
- package/dist/src/components/textarea/textarea-utils.d.ts +7 -0
- package/dist/src/components/tooltip/control-tooltip.d.ts +36 -0
- package/dist/src/components/tooltip/index.d.ts +6 -0
- package/dist/src/components/tooltip/tooltip-config.d.ts +27 -0
- package/dist/src/components/tooltip/tooltip-declarative.d.ts +41 -0
- package/dist/src/components/tooltip/tooltip-loader.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip-types.d.ts +110 -0
- package/dist/src/composables/breakpoints.d.ts +59 -0
- package/dist/src/composables/chip-limits.d.ts +48 -0
- package/dist/src/composables/chip-strip.d.ts +93 -0
- package/dist/src/composables/color.d.ts +103 -0
- package/dist/src/composables/css-class.d.ts +27 -0
- package/dist/src/composables/css-size.d.ts +40 -0
- package/dist/src/composables/data-source-controller.d.ts +84 -0
- package/dist/src/composables/element-props.d.ts +46 -0
- package/dist/src/composables/field-icons.d.ts +7 -0
- package/dist/src/composables/hybird-prop.d.ts +79 -0
- package/dist/src/composables/hydration-flush.d.ts +34 -0
- package/dist/src/composables/icon.d.ts +17 -0
- package/dist/src/composables/layout-var.d.ts +34 -0
- package/dist/src/composables/light-slots.d.ts +133 -0
- package/dist/src/composables/mdi-glyphs.d.ts +4 -0
- package/dist/src/composables/mono-element.d.ts +9 -0
- package/dist/src/composables/mono-event.d.ts +55 -0
- package/dist/src/composables/mono-pending.d.ts +8 -0
- package/dist/src/composables/mono-skeleton.d.ts +193 -0
- package/dist/src/composables/mono-ui.d.ts +58 -0
- package/dist/src/composables/notifier.d.ts +46 -0
- package/dist/src/composables/popup-portal.d.ts +226 -0
- package/dist/src/composables/popup-stack.d.ts +70 -0
- package/dist/src/composables/rate-limit.d.ts +108 -0
- package/dist/src/composables/reactive.d.ts +53 -0
- package/dist/src/composables/shadow-css.d.ts +42 -0
- package/dist/src/composables/visibility.d.ts +36 -0
- package/dist/src/data/theme/index.d.ts +30 -0
- package/dist/src/data/theme/presets.d.ts +94 -0
- package/dist/src/entries/index.d.ts +2 -0
- package/dist/src/entries/index.node.d.ts +42 -0
- package/dist/src/entries/search.d.ts +3 -0
- package/dist/src/export/detail.d.ts +29 -0
- package/dist/src/export/download.d.ts +9 -0
- package/dist/src/export/excel/index.d.ts +27 -0
- package/dist/src/export/excel/nodes.d.ts +123 -0
- package/dist/src/export/expression.d.ts +36 -0
- package/dist/src/export/helpers.d.ts +6 -0
- package/dist/src/export/index.d.ts +13 -0
- package/dist/src/export/markdown.d.ts +52 -0
- package/dist/src/export/resolve-data.d.ts +31 -0
- package/dist/src/export/sentinel.d.ts +97 -0
- package/dist/src/export/sheet-name.d.ts +45 -0
- package/dist/src/export/styles.d.ts +33 -0
- package/dist/src/export/template.d.ts +10 -0
- package/dist/src/export/types.d.ts +259 -0
- package/dist/src/import/coerce.d.ts +38 -0
- package/dist/src/import/index.d.ts +16 -0
- package/dist/src/import/match.d.ts +54 -0
- package/dist/src/import/parse.d.ts +15 -0
- package/dist/src/import/types.d.ts +153 -0
- package/dist/src/nuxt/index.d.ts +94 -0
- package/dist/src/search/data-search.d.ts +207 -0
- package/dist/src/search/field-path.d.ts +107 -0
- package/dist/src/search/filter-eval.d.ts +30 -0
- package/dist/src/search/index.d.ts +22 -0
- package/dist/src/search/odata-search.d.ts +18 -0
- package/dist/src/search/search-expr.d.ts +160 -0
- package/dist/src/utils/data-source-apply.d.ts +97 -0
- package/dist/src/utils/data-source-options.d.ts +116 -0
- package/dist/src/utils/data-source-read.d.ts +85 -0
- package/dist/src/utils/data-source-summary.d.ts +55 -0
- package/dist/src/utils/normalize-error.d.ts +60 -0
- package/dist/src/vite/index.d.ts +48 -0
- package/dist/src/vite/mono-client-only.d.ts +35 -0
- package/dist/src/vite/mono-ssr-stub.d.ts +20 -0
- package/dist/src/vite/shadow-manifest.d.ts +8 -0
- package/dist/styles-BIJ31TM4.js +20146 -0
- package/dist/tooltip-CysgRgBi.js +760 -0
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +2 -0
- package/dist/ui/accordion.d.ts +1 -0
- package/dist/ui/accordion.js +466 -0
- package/dist/ui/alert.d.ts +1 -0
- package/dist/ui/alert.js +221 -0
- package/dist/ui/breadcrumb.d.ts +1 -0
- package/dist/ui/breadcrumb.js +902 -0
- package/dist/ui/button-dropdown.d.ts +1 -0
- package/dist/ui/button-dropdown.js +679 -0
- package/dist/ui/button.d.ts +1 -0
- package/dist/ui/button.js +63 -0
- package/dist/ui/card.d.ts +1 -0
- package/dist/ui/card.js +511 -0
- package/dist/ui/chart.d.ts +1 -0
- package/dist/ui/chart.js +808 -0
- package/dist/ui/checkbox.d.ts +1 -0
- package/dist/ui/checkbox.js +413 -0
- package/dist/ui/chip.d.ts +1 -0
- package/dist/ui/chip.js +558 -0
- package/dist/ui/date.d.ts +1 -0
- package/dist/ui/date.js +686 -0
- package/dist/ui/drawer.d.ts +1 -0
- package/dist/ui/drawer.js +901 -0
- package/dist/ui/dropdown-table.d.ts +1 -0
- package/dist/ui/dropdown-table.js +1291 -0
- package/dist/ui/dropdown.d.ts +1 -0
- package/dist/ui/dropdown.js +586 -0
- package/dist/ui/file-upload.d.ts +1 -0
- package/dist/ui/file-upload.js +688 -0
- package/dist/ui/filter.d.ts +1 -0
- package/dist/ui/filter.js +400 -0
- package/dist/ui/font/files/geist-47c091c9.woff2 +0 -0
- package/dist/ui/font/files/geist-8dd77544.woff2 +0 -0
- package/dist/ui/font/files/geist-b9248b1e.woff2 +0 -0
- package/dist/ui/font/files/geist-d40d74b4.woff2 +0 -0
- package/dist/ui/font/files/geist-f493429a.woff2 +0 -0
- package/dist/ui/font/files/geistmono-03737868.woff2 +0 -0
- package/dist/ui/font/files/geistmono-421a7e38.woff2 +0 -0
- package/dist/ui/font/files/geistmono-48ef518d.woff2 +0 -0
- package/dist/ui/font/files/geistmono-5df35d39.woff2 +0 -0
- package/dist/ui/font/files/geistmono-7de289a4.woff2 +0 -0
- package/dist/ui/font/files/geistmono-e976128f.woff2 +0 -0
- package/dist/ui/font/files/inter-05cf802c.woff2 +0 -0
- package/dist/ui/font/files/inter-2b2f25a4.woff2 +0 -0
- package/dist/ui/font/files/inter-467acc7a.woff2 +0 -0
- package/dist/ui/font/files/inter-6e85163c.woff2 +0 -0
- package/dist/ui/font/files/inter-7048add3.woff2 +0 -0
- package/dist/ui/font/files/inter-9be0371e.woff2 +0 -0
- package/dist/ui/font/files/inter-a28b7e31.woff2 +0 -0
- package/dist/ui/font/files/poppins-054df55a.woff2 +0 -0
- package/dist/ui/font/files/poppins-0ee5dc9a.woff2 +0 -0
- package/dist/ui/font/files/poppins-0f44cb18.woff2 +0 -0
- package/dist/ui/font/files/poppins-0ff0d30c.woff2 +0 -0
- package/dist/ui/font/files/poppins-13045147.woff2 +0 -0
- package/dist/ui/font/files/poppins-1db57cd9.woff2 +0 -0
- package/dist/ui/font/files/poppins-2cf2a902.woff2 +0 -0
- package/dist/ui/font/files/poppins-39e7f079.woff2 +0 -0
- package/dist/ui/font/files/poppins-9607042d.woff2 +0 -0
- package/dist/ui/font/files/poppins-9a88fc1f.woff2 +0 -0
- package/dist/ui/font/files/poppins-b8f4f752.woff2 +0 -0
- package/dist/ui/font/files/poppins-f5e57db4.woff2 +0 -0
- package/dist/ui/font/geist-mono.css +104 -0
- package/dist/ui/font/geist.css +168 -0
- package/dist/ui/font/inter.css +232 -0
- package/dist/ui/font/poppins.css +104 -0
- package/dist/ui/form.d.ts +1 -0
- package/dist/ui/form.js +3 -0
- package/dist/ui/index.css +21826 -0
- package/dist/ui/input.d.ts +1 -0
- package/dist/ui/input.js +1176 -0
- package/dist/ui/menu.d.ts +1 -0
- package/dist/ui/menu.js +1289 -0
- package/dist/ui/modal.d.ts +1 -0
- package/dist/ui/modal.js +995 -0
- package/dist/ui/nav.d.ts +1 -0
- package/dist/ui/nav.js +295 -0
- package/dist/ui/radio.d.ts +1 -0
- package/dist/ui/radio.js +379 -0
- package/dist/ui/rich-text-editor.d.ts +1 -0
- package/dist/ui/rich-text-editor.js +1338 -0
- package/dist/ui/select.d.ts +1 -0
- package/dist/ui/select.js +2066 -0
- package/dist/ui/shadow/accordion.js +442 -0
- package/dist/ui/shadow/alert.js +218 -0
- package/dist/ui/shadow/breadcrumb.js +919 -0
- package/dist/ui/shadow/button-dropdown.js +696 -0
- package/dist/ui/shadow/button.js +63 -0
- package/dist/ui/shadow/card.js +524 -0
- package/dist/ui/shadow/chart.js +1569 -0
- package/dist/ui/shadow/checkbox.js +457 -0
- package/dist/ui/shadow/chip.js +559 -0
- package/dist/ui/shadow/date.js +712 -0
- package/dist/ui/shadow/drawer.js +869 -0
- package/dist/ui/shadow/dropdown-table.js +1620 -0
- package/dist/ui/shadow/dropdown.js +547 -0
- package/dist/ui/shadow/file-upload.js +731 -0
- package/dist/ui/shadow/filter.js +402 -0
- package/dist/ui/shadow/input.js +1150 -0
- package/dist/ui/shadow/menu.js +899 -0
- package/dist/ui/shadow/modal.js +1193 -0
- package/dist/ui/shadow/nav.js +240 -0
- package/dist/ui/shadow/radio.js +408 -0
- package/dist/ui/shadow/rich-text-editor.js +1344 -0
- package/dist/ui/shadow/select.js +2033 -0
- package/dist/ui/shadow/sidebar.js +606 -0
- package/dist/ui/shadow/switch.js +428 -0
- package/dist/ui/shadow/table.js +4755 -0
- package/dist/ui/shadow/tabs.js +372 -0
- package/dist/ui/shadow/tag-input.js +2846 -0
- package/dist/ui/shadow/textarea.js +816 -0
- package/dist/ui/sidebar.d.ts +1 -0
- package/dist/ui/sidebar.js +659 -0
- package/dist/ui/switch.d.ts +1 -0
- package/dist/ui/switch.js +398 -0
- package/dist/ui/table.d.ts +1 -0
- package/dist/ui/table.js +4654 -0
- package/dist/ui/tabs.d.ts +1 -0
- package/dist/ui/tabs.js +379 -0
- package/dist/ui/tag-input.d.ts +1 -0
- package/dist/ui/tag-input.js +2819 -0
- package/dist/ui/textarea.d.ts +1 -0
- package/dist/ui/textarea.js +819 -0
- package/dist/ui/theme/legacy.css +293 -0
- package/dist/ui/theme/luma.css +743 -0
- package/dist/ui/theme/lyra.css +754 -0
- package/dist/ui/theme/maia.css +673 -0
- package/dist/ui/theme/mira.css +802 -0
- package/dist/ui/theme/nova.css +662 -0
- package/dist/ui/theme/one.css +699 -0
- package/dist/ui/theme/rhea.css +742 -0
- package/dist/ui/theme/sera.css +845 -0
- package/dist/ui/theme/tokens.css +261 -0
- package/dist/ui/theme/vega.css +467 -0
- package/dist/vite-C5iUK7so.js +329 -0
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +2 -0
- package/dist/vue.d.ts +282 -0
- package/package.json +411 -3
|
@@ -0,0 +1,1338 @@
|
|
|
1
|
+
import { l as monoHostChildNodes } from "../mono-ui-CPV7rrdo.js";
|
|
2
|
+
import { t as customElement } from "../mono-element-B0kP_96P.js";
|
|
3
|
+
import { a as defineHybridPropAliases, r as booleanStringConverter, s as optionalNumberConverter, t as __decorate } from "../decorate-DEXtNagw.js";
|
|
4
|
+
import { t as dispatchMonoEvent } from "../mono-event-Bi1qP9uN.js";
|
|
5
|
+
import { s as placeSlotNode } from "../light-slots-DW1WgfgT.js";
|
|
6
|
+
import { n as toCssSize, t as buildSizeStyle } from "../css-size-DhHSVZJK.js";
|
|
7
|
+
import { t as MonoFormControlCore } from "../form-control-core-eeRr0zLU.js";
|
|
8
|
+
import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
|
|
9
|
+
import { property, state } from "lit/decorators.js";
|
|
10
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
//#region src/components/rich-text-editor/rich-text-editor-loader.ts
|
|
12
|
+
var INSTALL_HINT = "[mono-rich-text-editor] needs the optional peer dependency \"suneditor\". Install it in your app: pnpm add suneditor@^3.3.3";
|
|
13
|
+
function withHint(err) {
|
|
14
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
15
|
+
return /* @__PURE__ */ new Error(`${INSTALL_HINT}${message ? ` (original error: ${message})` : ""}`);
|
|
16
|
+
}
|
|
17
|
+
var _corePromise = null;
|
|
18
|
+
/** The `suneditor` default export (`{ create, init }`), cached; a failure resets so a later attempt retries. */
|
|
19
|
+
function loadSunEditor() {
|
|
20
|
+
_corePromise ??= import("suneditor").then((m) => m?.default ?? m).catch((err) => {
|
|
21
|
+
_corePromise = null;
|
|
22
|
+
throw withHint(err);
|
|
23
|
+
});
|
|
24
|
+
return _corePromise;
|
|
25
|
+
}
|
|
26
|
+
var _cssPromise = null;
|
|
27
|
+
/**
|
|
28
|
+
* SunEditor's UI stylesheet (`suneditor/css/editor`), injected ONCE per page by
|
|
29
|
+
* the consumer's bundler as a side-effect import. Failure is not fatal — the
|
|
30
|
+
* editor still works, unstyled — so it is reported once and swallowed.
|
|
31
|
+
*/
|
|
32
|
+
function loadSunEditorCss() {
|
|
33
|
+
_cssPromise ??= import("suneditor/css/editor").then(() => void 0).catch((err) => {
|
|
34
|
+
console.warn("[mono-rich-text-editor] could not load \"suneditor/css/editor\" — the editor will render unstyled. Import the stylesheet yourself and set load-css=\"false\" if your bundler cannot import CSS from a dynamic import.", err);
|
|
35
|
+
});
|
|
36
|
+
return _cssPromise;
|
|
37
|
+
}
|
|
38
|
+
var _pluginsPromise = null;
|
|
39
|
+
/** Every built-in plugin, keyed by name (`suneditor/plugins`' default export). */
|
|
40
|
+
function loadSunEditorPlugins() {
|
|
41
|
+
_pluginsPromise ??= import("suneditor/plugins").then((m) => m?.default ?? m).catch((err) => {
|
|
42
|
+
_pluginsPromise = null;
|
|
43
|
+
throw withHint(err);
|
|
44
|
+
});
|
|
45
|
+
return _pluginsPromise;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The language packs SunEditor ships, each behind its own static import so the
|
|
49
|
+
* consumer's bundler can split them. Unknown codes fall back to English (the
|
|
50
|
+
* editor's own default) with a warning rather than failing the build.
|
|
51
|
+
*/
|
|
52
|
+
var LANGS = {
|
|
53
|
+
ckb: () => import("suneditor/langs/ckb"),
|
|
54
|
+
cs: () => import("suneditor/langs/cs"),
|
|
55
|
+
da: () => import("suneditor/langs/da"),
|
|
56
|
+
de: () => import("suneditor/langs/de"),
|
|
57
|
+
en: () => import("suneditor/langs/en"),
|
|
58
|
+
es: () => import("suneditor/langs/es"),
|
|
59
|
+
fa: () => import("suneditor/langs/fa"),
|
|
60
|
+
fr: () => import("suneditor/langs/fr"),
|
|
61
|
+
he: () => import("suneditor/langs/he"),
|
|
62
|
+
hu: () => import("suneditor/langs/hu"),
|
|
63
|
+
it: () => import("suneditor/langs/it"),
|
|
64
|
+
ja: () => import("suneditor/langs/ja"),
|
|
65
|
+
km: () => import("suneditor/langs/km"),
|
|
66
|
+
ko: () => import("suneditor/langs/ko"),
|
|
67
|
+
lv: () => import("suneditor/langs/lv"),
|
|
68
|
+
nl: () => import("suneditor/langs/nl"),
|
|
69
|
+
pl: () => import("suneditor/langs/pl"),
|
|
70
|
+
pt_br: () => import("suneditor/langs/pt_br"),
|
|
71
|
+
ro: () => import("suneditor/langs/ro"),
|
|
72
|
+
ru: () => import("suneditor/langs/ru"),
|
|
73
|
+
se: () => import("suneditor/langs/se"),
|
|
74
|
+
tr: () => import("suneditor/langs/tr"),
|
|
75
|
+
uk: () => import("suneditor/langs/uk"),
|
|
76
|
+
ur: () => import("suneditor/langs/ur"),
|
|
77
|
+
zh_cn: () => import("suneditor/langs/zh_cn")
|
|
78
|
+
};
|
|
79
|
+
/** Codes `lang` accepts. */
|
|
80
|
+
var SUNEDITOR_LANG_CODES = Object.keys(LANGS);
|
|
81
|
+
var _langPromises = /* @__PURE__ */ new Map();
|
|
82
|
+
/**
|
|
83
|
+
* A language pack by code (`ko`, `pt-BR` → `pt_br`, `zh-CN` → `zh_cn`, …), or
|
|
84
|
+
* `undefined` for English / an unknown code (SunEditor then uses its default).
|
|
85
|
+
*/
|
|
86
|
+
function loadSunEditorLang(code) {
|
|
87
|
+
const key = code.trim().toLowerCase().replace(/-/g, "_");
|
|
88
|
+
if (!key || key === "en") return Promise.resolve(void 0);
|
|
89
|
+
const loader = LANGS[key];
|
|
90
|
+
if (!loader) {
|
|
91
|
+
console.warn(`[mono-rich-text-editor] unknown lang "${code}" — SunEditor ships: ${SUNEDITOR_LANG_CODES.join(", ")}. Using English.`);
|
|
92
|
+
return Promise.resolve(void 0);
|
|
93
|
+
}
|
|
94
|
+
let p = _langPromises.get(key);
|
|
95
|
+
if (!p) {
|
|
96
|
+
p = loader().then((m) => m?.default ?? m).catch((err) => {
|
|
97
|
+
_langPromises.delete(key);
|
|
98
|
+
throw withHint(err);
|
|
99
|
+
});
|
|
100
|
+
_langPromises.set(key, p);
|
|
101
|
+
}
|
|
102
|
+
return p;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/components/rich-text-editor/rich-text-editor-toolbar.ts
|
|
106
|
+
/**
|
|
107
|
+
* Buttons SunEditor's core provides WITHOUT a plugin (v3 `_defaultButtons`).
|
|
108
|
+
* Anything else in a `buttonList` is the `key` of a plugin that has to be in
|
|
109
|
+
* `plugins`, so a preset is filtered against the plugins actually loaded.
|
|
110
|
+
*/
|
|
111
|
+
var SUNEDITOR_CORE_BUTTONS = new Set([
|
|
112
|
+
"bold",
|
|
113
|
+
"underline",
|
|
114
|
+
"italic",
|
|
115
|
+
"strike",
|
|
116
|
+
"subscript",
|
|
117
|
+
"superscript",
|
|
118
|
+
"removeFormat",
|
|
119
|
+
"copyFormat",
|
|
120
|
+
"indent",
|
|
121
|
+
"outdent",
|
|
122
|
+
"fullScreen",
|
|
123
|
+
"showBlocks",
|
|
124
|
+
"codeView",
|
|
125
|
+
"markdownView",
|
|
126
|
+
"undo",
|
|
127
|
+
"redo",
|
|
128
|
+
"preview",
|
|
129
|
+
"print",
|
|
130
|
+
"copy",
|
|
131
|
+
"dir",
|
|
132
|
+
"dir_ltr",
|
|
133
|
+
"dir_rtl",
|
|
134
|
+
"finder",
|
|
135
|
+
"save",
|
|
136
|
+
"newDocument",
|
|
137
|
+
"selectAll",
|
|
138
|
+
"pageBreak",
|
|
139
|
+
"pageUp",
|
|
140
|
+
"pageDown",
|
|
141
|
+
"pageNavigator"
|
|
142
|
+
]);
|
|
143
|
+
/**
|
|
144
|
+
* Built-ins `plugins="auto"` leaves OUT: each needs configuration SunEditor
|
|
145
|
+
* warns about when it is missing (a server `url` / `uploadUrl`, a `templates` or
|
|
146
|
+
* `layouts` list, an external KaTeX / MathJax / PDF service). Ask for them by
|
|
147
|
+
* name — `plugins="auto, imageGallery"` is not a thing, but
|
|
148
|
+
* `:plugins.prop="[...]"` with the class or `plugins="font, link, template"`
|
|
149
|
+
* is — and supply their options through `options`.
|
|
150
|
+
*/
|
|
151
|
+
var AUTO_EXCLUDED_PLUGINS = new Set([
|
|
152
|
+
"exportPDF",
|
|
153
|
+
"fileUpload",
|
|
154
|
+
"layout",
|
|
155
|
+
"template",
|
|
156
|
+
"math",
|
|
157
|
+
"imageGallery",
|
|
158
|
+
"videoGallery",
|
|
159
|
+
"audioGallery",
|
|
160
|
+
"fileGallery",
|
|
161
|
+
"fileBrowser"
|
|
162
|
+
]);
|
|
163
|
+
/** Markers a `buttonList` may carry besides button names. */
|
|
164
|
+
var SPECIAL = /^(\||\/|-left|-right|-center|#fix)$/;
|
|
165
|
+
/**
|
|
166
|
+
* SunEditor's own default (`DEFAULTS.BUTTON_LIST`) — no plugin buttons at all.
|
|
167
|
+
* Mirrored here rather than imported so the presets stay pure.
|
|
168
|
+
*/
|
|
169
|
+
var TOOLBAR_DEFAULT = [
|
|
170
|
+
["undo", "redo"],
|
|
171
|
+
"|",
|
|
172
|
+
[
|
|
173
|
+
"bold",
|
|
174
|
+
"underline",
|
|
175
|
+
"italic",
|
|
176
|
+
"strike",
|
|
177
|
+
"|",
|
|
178
|
+
"subscript",
|
|
179
|
+
"superscript"
|
|
180
|
+
],
|
|
181
|
+
"|",
|
|
182
|
+
["removeFormat"],
|
|
183
|
+
"|",
|
|
184
|
+
["outdent", "indent"],
|
|
185
|
+
"|",
|
|
186
|
+
[
|
|
187
|
+
"fullScreen",
|
|
188
|
+
"showBlocks",
|
|
189
|
+
"codeView"
|
|
190
|
+
],
|
|
191
|
+
"|",
|
|
192
|
+
["preview", "print"]
|
|
193
|
+
];
|
|
194
|
+
/** The essentials: a comment box, a note field. */
|
|
195
|
+
var TOOLBAR_BASIC = [
|
|
196
|
+
["undo", "redo"],
|
|
197
|
+
"|",
|
|
198
|
+
[
|
|
199
|
+
"bold",
|
|
200
|
+
"underline",
|
|
201
|
+
"italic",
|
|
202
|
+
"strike"
|
|
203
|
+
],
|
|
204
|
+
"|",
|
|
205
|
+
[
|
|
206
|
+
"list_bulleted",
|
|
207
|
+
"list_numbered",
|
|
208
|
+
"link"
|
|
209
|
+
],
|
|
210
|
+
"|",
|
|
211
|
+
["removeFormat"]
|
|
212
|
+
];
|
|
213
|
+
/** The default: what a document / description / email body needs. */
|
|
214
|
+
var TOOLBAR_STANDARD = [
|
|
215
|
+
["undo", "redo"],
|
|
216
|
+
"|",
|
|
217
|
+
[
|
|
218
|
+
"blockStyle",
|
|
219
|
+
"font",
|
|
220
|
+
"fontSize"
|
|
221
|
+
],
|
|
222
|
+
"|",
|
|
223
|
+
[
|
|
224
|
+
"bold",
|
|
225
|
+
"underline",
|
|
226
|
+
"italic",
|
|
227
|
+
"strike"
|
|
228
|
+
],
|
|
229
|
+
["fontColor", "backgroundColor"],
|
|
230
|
+
"|",
|
|
231
|
+
[
|
|
232
|
+
"align",
|
|
233
|
+
"list_bulleted",
|
|
234
|
+
"list_numbered",
|
|
235
|
+
"outdent",
|
|
236
|
+
"indent"
|
|
237
|
+
],
|
|
238
|
+
"|",
|
|
239
|
+
[
|
|
240
|
+
"table",
|
|
241
|
+
"link",
|
|
242
|
+
"image",
|
|
243
|
+
"video"
|
|
244
|
+
],
|
|
245
|
+
"|",
|
|
246
|
+
[
|
|
247
|
+
"blockquote",
|
|
248
|
+
"codeBlock",
|
|
249
|
+
"hr"
|
|
250
|
+
],
|
|
251
|
+
"|",
|
|
252
|
+
["removeFormat"],
|
|
253
|
+
"|",
|
|
254
|
+
["codeView", "fullScreen"]
|
|
255
|
+
];
|
|
256
|
+
/**
|
|
257
|
+
* Every built-in that works with no extra configuration. Left out on purpose:
|
|
258
|
+
* the galleries / file browser (need a server `url`), `template` (needs a
|
|
259
|
+
* `templates` list), `math` and `exportPDF` (need external libraries) — pass
|
|
260
|
+
* those through `toolbar` + `options` when the app provides what they need.
|
|
261
|
+
*/
|
|
262
|
+
var TOOLBAR_FULL = [
|
|
263
|
+
["undo", "redo"],
|
|
264
|
+
"|",
|
|
265
|
+
[
|
|
266
|
+
"blockStyle",
|
|
267
|
+
"paragraphStyle",
|
|
268
|
+
"font",
|
|
269
|
+
"fontSize",
|
|
270
|
+
"lineHeight"
|
|
271
|
+
],
|
|
272
|
+
"|",
|
|
273
|
+
[
|
|
274
|
+
"bold",
|
|
275
|
+
"underline",
|
|
276
|
+
"italic",
|
|
277
|
+
"strike",
|
|
278
|
+
"subscript",
|
|
279
|
+
"superscript"
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
"fontColor",
|
|
283
|
+
"backgroundColor",
|
|
284
|
+
"textStyle",
|
|
285
|
+
"copyFormat",
|
|
286
|
+
"removeFormat"
|
|
287
|
+
],
|
|
288
|
+
"|",
|
|
289
|
+
[
|
|
290
|
+
"align",
|
|
291
|
+
"list_bulleted",
|
|
292
|
+
"list_numbered",
|
|
293
|
+
"outdent",
|
|
294
|
+
"indent",
|
|
295
|
+
"dir_ltr",
|
|
296
|
+
"dir_rtl"
|
|
297
|
+
],
|
|
298
|
+
"|",
|
|
299
|
+
[
|
|
300
|
+
"table",
|
|
301
|
+
"layout",
|
|
302
|
+
"link",
|
|
303
|
+
"image",
|
|
304
|
+
"video",
|
|
305
|
+
"audio",
|
|
306
|
+
"embed",
|
|
307
|
+
"drawing"
|
|
308
|
+
],
|
|
309
|
+
"|",
|
|
310
|
+
[
|
|
311
|
+
"blockquote",
|
|
312
|
+
"codeBlock",
|
|
313
|
+
"hr",
|
|
314
|
+
"pageBreak"
|
|
315
|
+
],
|
|
316
|
+
"|",
|
|
317
|
+
[
|
|
318
|
+
"showBlocks",
|
|
319
|
+
"codeView",
|
|
320
|
+
"markdownView",
|
|
321
|
+
"fullScreen"
|
|
322
|
+
],
|
|
323
|
+
"|",
|
|
324
|
+
[
|
|
325
|
+
"finder",
|
|
326
|
+
"selectAll",
|
|
327
|
+
"preview",
|
|
328
|
+
"print"
|
|
329
|
+
]
|
|
330
|
+
];
|
|
331
|
+
var TOOLBAR_PRESETS = {
|
|
332
|
+
basic: TOOLBAR_BASIC,
|
|
333
|
+
standard: TOOLBAR_STANDARD,
|
|
334
|
+
full: TOOLBAR_FULL,
|
|
335
|
+
default: TOOLBAR_DEFAULT
|
|
336
|
+
};
|
|
337
|
+
function isToolbarPreset(value) {
|
|
338
|
+
return typeof value === "string" && value in TOOLBAR_PRESETS;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* The `buttonList` for a `toolbar` prop value: a preset name, an array, its
|
|
342
|
+
* JSON, or a string of names — `bold, italic | link` (`|` and `/` are honoured
|
|
343
|
+
* as separators, `,`/whitespace split the rest). Unknown → the `standard` preset.
|
|
344
|
+
*/
|
|
345
|
+
function resolveToolbar(toolbar) {
|
|
346
|
+
if (toolbar == null || toolbar === "") return TOOLBAR_STANDARD;
|
|
347
|
+
if (Array.isArray(toolbar)) return toolbar;
|
|
348
|
+
if (isToolbarPreset(toolbar)) return TOOLBAR_PRESETS[toolbar];
|
|
349
|
+
if (typeof toolbar !== "string") return TOOLBAR_STANDARD;
|
|
350
|
+
const trimmed = toolbar.trim();
|
|
351
|
+
if (trimmed.startsWith("[")) try {
|
|
352
|
+
const parsed = JSON.parse(trimmed);
|
|
353
|
+
if (Array.isArray(parsed)) return parsed;
|
|
354
|
+
} catch {}
|
|
355
|
+
const out = [];
|
|
356
|
+
let group = [];
|
|
357
|
+
for (const token of trimmed.split(/[\s,]+/).filter(Boolean)) if (SPECIAL.test(token)) {
|
|
358
|
+
if (group.length) out.push(group);
|
|
359
|
+
group = [];
|
|
360
|
+
out.push(token);
|
|
361
|
+
} else group.push(token);
|
|
362
|
+
if (group.length) out.push(group);
|
|
363
|
+
return out.length ? out : TOOLBAR_STANDARD;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Drop the plugin buttons a `buttonList` names that are NOT among `available`
|
|
367
|
+
* plugin keys, so `plugins="none"` (or a trimmed list) with the default toolbar
|
|
368
|
+
* degrades to the core buttons instead of SunEditor rejecting the list.
|
|
369
|
+
* Separators left with nothing on either side are dropped too.
|
|
370
|
+
*/
|
|
371
|
+
function pruneToolbar(list, available) {
|
|
372
|
+
const keep = (name) => SPECIAL.test(name) || SUNEDITOR_CORE_BUTTONS.has(name) || available.has(name);
|
|
373
|
+
const out = [];
|
|
374
|
+
for (const item of list) if (Array.isArray(item)) {
|
|
375
|
+
const group = item.filter(keep);
|
|
376
|
+
if (group.some((n) => !SPECIAL.test(n))) out.push(group);
|
|
377
|
+
} else if (keep(item)) out.push(item);
|
|
378
|
+
const cleaned = [];
|
|
379
|
+
for (const item of out) {
|
|
380
|
+
const isSep = typeof item === "string" && SPECIAL.test(item);
|
|
381
|
+
const prev = cleaned[cleaned.length - 1];
|
|
382
|
+
if (isSep && (cleaned.length === 0 || typeof prev === "string" && SPECIAL.test(prev))) continue;
|
|
383
|
+
cleaned.push(item);
|
|
384
|
+
}
|
|
385
|
+
while (cleaned.length && typeof cleaned[cleaned.length - 1] === "string") cleaned.pop();
|
|
386
|
+
return cleaned;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* The plugin set to hand SunEditor, from the `plugins` prop and (when needed)
|
|
390
|
+
* the full built-in map. Returns `{ plugins, keys }` — `keys` is what
|
|
391
|
+
* `pruneToolbar` filters against.
|
|
392
|
+
*
|
|
393
|
+
* - `'auto'` / unset → every built-in that needs no configuration (`all` must
|
|
394
|
+
* be supplied; see {@link AUTO_EXCLUDED_PLUGINS}).
|
|
395
|
+
* - `'none'` → nothing.
|
|
396
|
+
* - an array → plugin classes kept as they are, NAMES looked up in `all`.
|
|
397
|
+
* - an object → SunEditor's own `{ name: class }` form.
|
|
398
|
+
* - a string → comma/space-separated names.
|
|
399
|
+
*/
|
|
400
|
+
function resolvePlugins(plugins, all) {
|
|
401
|
+
const out = [];
|
|
402
|
+
const keys = /* @__PURE__ */ new Set();
|
|
403
|
+
const push = (key, cls) => {
|
|
404
|
+
if (!cls || out.includes(cls)) return;
|
|
405
|
+
out.push(cls);
|
|
406
|
+
const k = key ?? pluginKey(cls);
|
|
407
|
+
if (k) keys.add(k);
|
|
408
|
+
};
|
|
409
|
+
if (plugins == null || plugins === "" || plugins === "auto") {
|
|
410
|
+
for (const [key, cls] of Object.entries(all ?? {})) if (!AUTO_EXCLUDED_PLUGINS.has(key)) push(key, cls);
|
|
411
|
+
return {
|
|
412
|
+
plugins: out,
|
|
413
|
+
keys
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
if (plugins === "none") return {
|
|
417
|
+
plugins: out,
|
|
418
|
+
keys
|
|
419
|
+
};
|
|
420
|
+
if (typeof plugins === "string") {
|
|
421
|
+
for (const name of plugins.split(/[\s,]+/).filter(Boolean)) push(name, all?.[name]);
|
|
422
|
+
return {
|
|
423
|
+
plugins: out,
|
|
424
|
+
keys
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
if (Array.isArray(plugins)) {
|
|
428
|
+
for (const entry of plugins) if (typeof entry === "string") push(entry, all?.[entry]);
|
|
429
|
+
else push(void 0, entry);
|
|
430
|
+
return {
|
|
431
|
+
plugins: out,
|
|
432
|
+
keys
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
for (const [key, cls] of Object.entries(plugins)) push(key, cls);
|
|
436
|
+
return {
|
|
437
|
+
plugins: out,
|
|
438
|
+
keys
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
/** A SunEditor v3 plugin class carries its button name as `static key`. */
|
|
442
|
+
function pluginKey(cls) {
|
|
443
|
+
const key = cls?.key;
|
|
444
|
+
return typeof key === "string" ? key : void 0;
|
|
445
|
+
}
|
|
446
|
+
/** Whether `plugins` needs the full built-in map to be resolved. */
|
|
447
|
+
function pluginsNeedCatalog(plugins) {
|
|
448
|
+
if (plugins == null || plugins === "" || plugins === "auto") return true;
|
|
449
|
+
if (plugins === "none") return false;
|
|
450
|
+
if (typeof plugins === "string") return true;
|
|
451
|
+
if (Array.isArray(plugins)) return plugins.some((p) => typeof p === "string");
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/components/rich-text-editor/rich-text-editor-core.ts
|
|
456
|
+
/**
|
|
457
|
+
* `MonoRichTextEditorCore` — render-mode-agnostic logic for `mono-rich-text-editor`,
|
|
458
|
+
* a form field whose input is a [SunEditor](https://suneditor.com) v3 instance.
|
|
459
|
+
*
|
|
460
|
+
* **The peer is optional.** `suneditor` is externalized from mono's build and
|
|
461
|
+
* loaded the first time an element renders (`rich-text-editor-loader.ts`). An
|
|
462
|
+
* app that has not installed it gets an inline message naming the package and
|
|
463
|
+
* the command, plus an `mno-error` event — never a crash.
|
|
464
|
+
*
|
|
465
|
+
* **The editor's DOM lives in LIGHT DOM, in both builds.** SunEditor is styled by
|
|
466
|
+
* one global stylesheet and parks its modals in a `.sun-editor-carrier-wrapper`
|
|
467
|
+
* on `<body>`, so neither could ever be adopted into a shadow root. The core
|
|
468
|
+
* therefore creates ONE mount node (`.mono-rich-text-editor-mount`) and each
|
|
469
|
+
* build decides where it shows: the light build re-homes it into the rendered
|
|
470
|
+
* field frame, the shadow build keeps it as a light child projected through
|
|
471
|
+
* `<slot name="editor">`. Either way it inherits the `--se-*` theme remap the
|
|
472
|
+
* frame declares, and the page sheet reaches it. SSR renders the chrome only —
|
|
473
|
+
* an editor is client state, exactly like `mono-chart` and `mono-date`.
|
|
474
|
+
*
|
|
475
|
+
* **Lifecycle mirrors `date-core`.** `_ensureEditor()` is idempotent and runs
|
|
476
|
+
* from `firstUpdated`, `connectedCallback` and every `updated()` that finds no
|
|
477
|
+
* instance, so a `v-if` / `<KeepAlive>` round trip rebuilds the editor instead
|
|
478
|
+
* of leaving a dead field. A build token plus an `isConnected` re-check after
|
|
479
|
+
* every `await` keeps a superseded build from constructing an editor on a
|
|
480
|
+
* detached node that nothing would ever destroy. `disconnectedCallback`
|
|
481
|
+
* destroys BEFORE `super` so the DOM is still in the tree.
|
|
482
|
+
*
|
|
483
|
+
* **Value model.** `modelValue` is the HTML. SunEditor → element: `onChange`
|
|
484
|
+
* emits `mno-change`, `onInput` emits `mno-input` (the textarea detail shape),
|
|
485
|
+
* an empty editor is published as `''` so `required` means what it says.
|
|
486
|
+
* Element → editor: an outside `modelValue` write reaches `$.html.set()` only
|
|
487
|
+
* when it differs from the last value the editor itself produced — no caret
|
|
488
|
+
* jumps, no echo. `monoForm` binds through {@link MonoFormControlCore} exactly
|
|
489
|
+
* as `mono-textarea` does.
|
|
490
|
+
*/
|
|
491
|
+
var MonoRichTextEditorCore = (superClass) => {
|
|
492
|
+
class MonoRichTextEditorCoreClass extends MonoFormControlCore(superClass) {
|
|
493
|
+
constructor(...args) {
|
|
494
|
+
super(...args);
|
|
495
|
+
this.size = "md";
|
|
496
|
+
this.color = "primary";
|
|
497
|
+
this.variant = "outlined";
|
|
498
|
+
this.modelValue = "";
|
|
499
|
+
this.value = "";
|
|
500
|
+
this.name = "";
|
|
501
|
+
this.placeholder = "";
|
|
502
|
+
this.label = "";
|
|
503
|
+
this.helperText = "";
|
|
504
|
+
this.validationState = "default";
|
|
505
|
+
this.validationMessage = "";
|
|
506
|
+
this.errorMessage = "";
|
|
507
|
+
this.successMessage = "";
|
|
508
|
+
this.disabled = false;
|
|
509
|
+
this.readonly = false;
|
|
510
|
+
this.required = false;
|
|
511
|
+
this.cssClass = {};
|
|
512
|
+
this.cssClassName = "";
|
|
513
|
+
this.mode = "classic";
|
|
514
|
+
this.charCounter = false;
|
|
515
|
+
this.statusbar = true;
|
|
516
|
+
this.loadCss = true;
|
|
517
|
+
this._hasLabelSlotState = false;
|
|
518
|
+
this._hasHelperSlotState = false;
|
|
519
|
+
this._error = "";
|
|
520
|
+
this._loading = false;
|
|
521
|
+
this._fieldId = `mono-rich-text-editor-${Math.random().toString(36).slice(2)}`;
|
|
522
|
+
this._messageId = `${this._fieldId}-message`;
|
|
523
|
+
this._editor = null;
|
|
524
|
+
this._building = false;
|
|
525
|
+
this._buildToken = 0;
|
|
526
|
+
this._lastEmitted = "";
|
|
527
|
+
this._lastChanged = "";
|
|
528
|
+
this._ready = false;
|
|
529
|
+
this._titleObservers = [];
|
|
530
|
+
this._onToggleFullScreen = (params) => {
|
|
531
|
+
this._mount?.toggleAttribute("mono-fullscreen", !!params?.is);
|
|
532
|
+
};
|
|
533
|
+
this._onLoad = () => {
|
|
534
|
+
this._ready = true;
|
|
535
|
+
this._loading = false;
|
|
536
|
+
this._applyState();
|
|
537
|
+
this._applyAria();
|
|
538
|
+
const editor = this._editor;
|
|
539
|
+
if (editor) dispatchMonoEvent(this, "ready", { editor });
|
|
540
|
+
};
|
|
541
|
+
this._onChange = (params) => {
|
|
542
|
+
this._publish("change", params);
|
|
543
|
+
};
|
|
544
|
+
this._onInput = (params) => {
|
|
545
|
+
this._publish("input", params);
|
|
546
|
+
};
|
|
547
|
+
this._onFocus = (params) => {
|
|
548
|
+
dispatchMonoEvent(this, "focus", {
|
|
549
|
+
name: this.name || void 0,
|
|
550
|
+
sourceEvent: params
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
this._onBlur = (params) => {
|
|
554
|
+
dispatchMonoEvent(this, "blur", {
|
|
555
|
+
name: this.name || void 0,
|
|
556
|
+
sourceEvent: params
|
|
557
|
+
});
|
|
558
|
+
};
|
|
559
|
+
defineHybridPropAliases(this, [
|
|
560
|
+
"modelValue",
|
|
561
|
+
"helperText",
|
|
562
|
+
"validationState",
|
|
563
|
+
"validationMessage",
|
|
564
|
+
"errorMessage",
|
|
565
|
+
"successMessage",
|
|
566
|
+
"charCounter",
|
|
567
|
+
"maxLength",
|
|
568
|
+
"loadCss",
|
|
569
|
+
"textDirection",
|
|
570
|
+
"ariaLabelText",
|
|
571
|
+
"cssClass",
|
|
572
|
+
"minWidth",
|
|
573
|
+
"maxWidth",
|
|
574
|
+
"minHeight",
|
|
575
|
+
"maxHeight"
|
|
576
|
+
]);
|
|
577
|
+
for (const alias of ["css-class", "cssclass"]) Object.defineProperty(this, alias, {
|
|
578
|
+
get: () => this.cssClass,
|
|
579
|
+
set: (value) => this._setCssClass(value),
|
|
580
|
+
configurable: true,
|
|
581
|
+
enumerable: false
|
|
582
|
+
});
|
|
583
|
+
for (const alias of [
|
|
584
|
+
"ariaLabel",
|
|
585
|
+
"aria-label",
|
|
586
|
+
"arialabel"
|
|
587
|
+
]) Object.defineProperty(this, alias, {
|
|
588
|
+
get: () => this.ariaLabelText,
|
|
589
|
+
set: (value) => {
|
|
590
|
+
this.ariaLabelText = value == null ? void 0 : String(value);
|
|
591
|
+
},
|
|
592
|
+
configurable: true,
|
|
593
|
+
enumerable: false
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
static get observedAttributes() {
|
|
597
|
+
return [
|
|
598
|
+
...super.observedAttributes ?? [],
|
|
599
|
+
"modelvalue",
|
|
600
|
+
"helpertext",
|
|
601
|
+
"validationstate",
|
|
602
|
+
"validationmessage",
|
|
603
|
+
"errormessage",
|
|
604
|
+
"successmessage",
|
|
605
|
+
"charcounter",
|
|
606
|
+
"maxlength",
|
|
607
|
+
"loadcss",
|
|
608
|
+
"textdirection",
|
|
609
|
+
"arialabeltext",
|
|
610
|
+
"arialabel",
|
|
611
|
+
"css-class",
|
|
612
|
+
"cssclass"
|
|
613
|
+
];
|
|
614
|
+
}
|
|
615
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
616
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
617
|
+
if (oldValue === newValue) return;
|
|
618
|
+
switch (name) {
|
|
619
|
+
case "modelvalue":
|
|
620
|
+
this.modelValue = newValue ?? "";
|
|
621
|
+
return;
|
|
622
|
+
case "helpertext":
|
|
623
|
+
this.helperText = newValue ?? "";
|
|
624
|
+
return;
|
|
625
|
+
case "validationstate":
|
|
626
|
+
this.validationState = newValue ?? "default";
|
|
627
|
+
return;
|
|
628
|
+
case "validationmessage":
|
|
629
|
+
this.validationMessage = newValue ?? "";
|
|
630
|
+
return;
|
|
631
|
+
case "errormessage":
|
|
632
|
+
this.errorMessage = newValue ?? "";
|
|
633
|
+
return;
|
|
634
|
+
case "successmessage":
|
|
635
|
+
this.successMessage = newValue ?? "";
|
|
636
|
+
return;
|
|
637
|
+
case "charcounter":
|
|
638
|
+
this.charCounter = this._toBoolean(newValue);
|
|
639
|
+
return;
|
|
640
|
+
case "maxlength":
|
|
641
|
+
this.maxLength = optionalNumberConverter.fromAttribute(newValue);
|
|
642
|
+
return;
|
|
643
|
+
case "loadcss":
|
|
644
|
+
this.loadCss = this._toBoolean(newValue);
|
|
645
|
+
return;
|
|
646
|
+
case "textdirection":
|
|
647
|
+
this.textDirection = newValue === "rtl" ? "rtl" : newValue === "ltr" ? "ltr" : void 0;
|
|
648
|
+
return;
|
|
649
|
+
case "arialabeltext":
|
|
650
|
+
case "arialabel":
|
|
651
|
+
this.ariaLabelText = newValue ?? void 0;
|
|
652
|
+
return;
|
|
653
|
+
case "css-class":
|
|
654
|
+
case "cssclass": this._setCssClass(newValue);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
static {
|
|
658
|
+
this._configKeys = [
|
|
659
|
+
"mode",
|
|
660
|
+
"toolbar",
|
|
661
|
+
"plugins",
|
|
662
|
+
"language",
|
|
663
|
+
"textDirection",
|
|
664
|
+
"charCounter",
|
|
665
|
+
"maxLength",
|
|
666
|
+
"statusbar",
|
|
667
|
+
"sticky",
|
|
668
|
+
"options",
|
|
669
|
+
"placeholder",
|
|
670
|
+
"height",
|
|
671
|
+
"minHeight",
|
|
672
|
+
"maxHeight"
|
|
673
|
+
];
|
|
674
|
+
}
|
|
675
|
+
willUpdate(changed) {
|
|
676
|
+
super.willUpdate?.(changed);
|
|
677
|
+
for (const key of [
|
|
678
|
+
"disabled",
|
|
679
|
+
"readonly",
|
|
680
|
+
"required",
|
|
681
|
+
"charCounter",
|
|
682
|
+
"statusbar",
|
|
683
|
+
"loadCss"
|
|
684
|
+
]) {
|
|
685
|
+
const v = this[key];
|
|
686
|
+
if (typeof v !== "boolean") this[key] = this._toBoolean(v);
|
|
687
|
+
}
|
|
688
|
+
if (changed.has("modelValue") && this.value !== this.modelValue) this.value = this.modelValue ?? "";
|
|
689
|
+
if (changed.has("value") && this.modelValue !== this.value) this.modelValue = String(this.value ?? "");
|
|
690
|
+
}
|
|
691
|
+
connectedCallback() {
|
|
692
|
+
super.connectedCallback();
|
|
693
|
+
if (isServer) return;
|
|
694
|
+
this._ensureMount();
|
|
695
|
+
if (this.hasUpdated) this._ensureEditor();
|
|
696
|
+
}
|
|
697
|
+
disconnectedCallback() {
|
|
698
|
+
this._destroyEditor();
|
|
699
|
+
super.disconnectedCallback();
|
|
700
|
+
}
|
|
701
|
+
firstUpdated() {
|
|
702
|
+
if (isServer) return;
|
|
703
|
+
this._ensureEditor();
|
|
704
|
+
}
|
|
705
|
+
updated(changed) {
|
|
706
|
+
super.updated?.(changed);
|
|
707
|
+
if (isServer) return;
|
|
708
|
+
this._placeMount();
|
|
709
|
+
if (!this._editor) {
|
|
710
|
+
if (!this._building && MonoRichTextEditorCoreClass._configKeys.some((k) => changed.has(k))) this._error = "";
|
|
711
|
+
this._ensureEditor();
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (MonoRichTextEditorCoreClass._configKeys.some((k) => changed.has(k))) {
|
|
715
|
+
this._rebuild();
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
if (changed.has("modelValue")) this._applyModelValue();
|
|
719
|
+
if (changed.has("disabled") || changed.has("readonly")) this._applyState();
|
|
720
|
+
if (changed.has("ariaLabelText") || changed.has("label") || changed.has("placeholder")) this._applyAria();
|
|
721
|
+
}
|
|
722
|
+
/** Create the light-DOM mount once. Where it goes is the build's call (`_placeMount`). */
|
|
723
|
+
_ensureMount() {
|
|
724
|
+
if (this._mount) return;
|
|
725
|
+
const mount = document.createElement("div");
|
|
726
|
+
mount.className = "mono-rich-text-editor-mount";
|
|
727
|
+
mount.setAttribute("mono-rte-mount", "");
|
|
728
|
+
this._mount = mount;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Put the mount where this build shows it. Light: inside the rendered
|
|
732
|
+
* `[data-mono-slot="editor"]` frame. Shadow: a light child of the host, with
|
|
733
|
+
* `slot="editor"` so `<slot name="editor">` projects it. Idempotent.
|
|
734
|
+
*/
|
|
735
|
+
_placeMount() {
|
|
736
|
+
const mount = this._mount;
|
|
737
|
+
if (!mount) return;
|
|
738
|
+
if (this._useNativeSlots) {
|
|
739
|
+
if (mount.getAttribute("slot") !== "editor") mount.setAttribute("slot", "editor");
|
|
740
|
+
if (mount.parentNode !== this) this.appendChild(mount);
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
const outlet = this.renderRoot.querySelector("[data-mono-slot=\"editor\"]");
|
|
744
|
+
if (outlet && mount.parentNode !== outlet) outlet.appendChild(mount);
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Build the instance if there is none — idempotent, safe from every hook.
|
|
748
|
+
* Every `await` is followed by the token / connection re-check: an element
|
|
749
|
+
* that left the tree mid-import must not end up owning an editor.
|
|
750
|
+
*/
|
|
751
|
+
async _ensureEditor() {
|
|
752
|
+
if (isServer || this._editor || this._building) return;
|
|
753
|
+
const mount = this._mount;
|
|
754
|
+
if (!mount?.isConnected) return;
|
|
755
|
+
this._building = true;
|
|
756
|
+
this._loading = true;
|
|
757
|
+
const token = ++this._buildToken;
|
|
758
|
+
try {
|
|
759
|
+
const [SUNEDITOR] = await Promise.all([loadSunEditor(), this.loadCss ? loadSunEditorCss() : Promise.resolve()]);
|
|
760
|
+
const catalog = pluginsNeedCatalog(this.plugins) ? await loadSunEditorPlugins() : null;
|
|
761
|
+
const lang = typeof this.language === "string" ? await loadSunEditorLang(this.language) : this.language;
|
|
762
|
+
if (token !== this._buildToken || !this.isConnected || !mount.isConnected || this._editor) return;
|
|
763
|
+
mount.replaceChildren();
|
|
764
|
+
const target = document.createElement("div");
|
|
765
|
+
target.className = "mono-rich-text-editor-target";
|
|
766
|
+
mount.appendChild(target);
|
|
767
|
+
this._lastEmitted = this._lastChanged = this.modelValue || "";
|
|
768
|
+
this._ready = false;
|
|
769
|
+
this._editor = SUNEDITOR.create(target, this._buildOptions(catalog, lang));
|
|
770
|
+
this._error = "";
|
|
771
|
+
this._themeTooltips(mount);
|
|
772
|
+
} catch (err) {
|
|
773
|
+
if (token !== this._buildToken) return;
|
|
774
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
775
|
+
this._error = message;
|
|
776
|
+
this._loading = false;
|
|
777
|
+
dispatchMonoEvent(this, "error", {
|
|
778
|
+
message,
|
|
779
|
+
error: err
|
|
780
|
+
});
|
|
781
|
+
} finally {
|
|
782
|
+
if (token === this._buildToken) this._building = false;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* SunEditor labels its dropdown items (font family, font size, the colour
|
|
787
|
+
* palettes …) with `title`, which the browser draws as the OS tooltip — white,
|
|
788
|
+
* system font, out of every theme's reach. Rewrite each into `data-tooltip`
|
|
789
|
+
* (+ `aria-label`, so nothing is lost to assistive tech), which the sheet
|
|
790
|
+
* paints as Basecoat's tooltip; a title that only repeats the item's own text
|
|
791
|
+
* is dropped. The lists are built lazily, on first open, so the mount — and
|
|
792
|
+
* the modal carrier SunEditor parks on <body> — are watched for new ones.
|
|
793
|
+
*/
|
|
794
|
+
_themeTooltips(mount) {
|
|
795
|
+
this._titleObservers.forEach((o) => o.disconnect());
|
|
796
|
+
this._titleObservers = [];
|
|
797
|
+
mount.style.setProperty("--_mono-rte-page-font", getComputedStyle(this).fontFamily);
|
|
798
|
+
const retitle = (root) => {
|
|
799
|
+
const nodes = root.matches("[title]") ? [root, ...root.querySelectorAll("[title]")] : [...root.querySelectorAll("[title]")];
|
|
800
|
+
for (const el of nodes) {
|
|
801
|
+
const title = el.getAttribute("title")?.trim();
|
|
802
|
+
el.removeAttribute("title");
|
|
803
|
+
if (!title) continue;
|
|
804
|
+
if (!el.hasAttribute("aria-label")) el.setAttribute("aria-label", title);
|
|
805
|
+
if ((el.textContent ?? "").trim() === title) continue;
|
|
806
|
+
el.setAttribute("data-tooltip", title);
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
const watch = (root) => {
|
|
810
|
+
retitle(root);
|
|
811
|
+
if (typeof MutationObserver === "undefined") return;
|
|
812
|
+
const mo = new MutationObserver((records) => {
|
|
813
|
+
for (const r of records) {
|
|
814
|
+
if (r.type === "attributes") {
|
|
815
|
+
if (r.target.hasAttribute("title")) retitle(r.target);
|
|
816
|
+
continue;
|
|
817
|
+
}
|
|
818
|
+
r.addedNodes.forEach((n) => {
|
|
819
|
+
if (n.nodeType === Node.ELEMENT_NODE) retitle(n);
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
mo.observe(root, {
|
|
824
|
+
childList: true,
|
|
825
|
+
subtree: true,
|
|
826
|
+
attributes: true,
|
|
827
|
+
attributeFilter: ["title"]
|
|
828
|
+
});
|
|
829
|
+
this._titleObservers.push(mo);
|
|
830
|
+
};
|
|
831
|
+
watch(mount);
|
|
832
|
+
const carriers = document.querySelectorAll(".sun-editor-carrier-wrapper");
|
|
833
|
+
const carrier = carriers[carriers.length - 1];
|
|
834
|
+
if (carrier) {
|
|
835
|
+
carrier.style.setProperty("--_mono-rte-page-font", getComputedStyle(this).fontFamily);
|
|
836
|
+
watch(carrier);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
_buildOptions(catalog, lang) {
|
|
840
|
+
const { plugins, keys } = resolvePlugins(this.plugins, catalog);
|
|
841
|
+
const buttonList = pruneToolbar(resolveToolbar(this.toolbar), keys);
|
|
842
|
+
const consumer = this.options ?? {};
|
|
843
|
+
const consumerEvents = consumer.events ?? {};
|
|
844
|
+
const chain = (mine, name) => (params) => {
|
|
845
|
+
const theirs = consumerEvents[name];
|
|
846
|
+
const result = typeof theirs === "function" ? theirs(params) : void 0;
|
|
847
|
+
mine(params);
|
|
848
|
+
return result;
|
|
849
|
+
};
|
|
850
|
+
const options = {
|
|
851
|
+
value: this.modelValue || "",
|
|
852
|
+
placeholder: this.placeholder || void 0,
|
|
853
|
+
mode: this.mode,
|
|
854
|
+
buttonList,
|
|
855
|
+
plugins,
|
|
856
|
+
lang: lang ?? void 0,
|
|
857
|
+
textDirection: this.textDirection,
|
|
858
|
+
charCounter: this.charCounter || this.maxLength != null,
|
|
859
|
+
charCounter_max: this.maxLength ?? void 0,
|
|
860
|
+
statusbar: this.statusbar,
|
|
861
|
+
toolbar_sticky: this.sticky ?? -1,
|
|
862
|
+
width: "100%",
|
|
863
|
+
height: toCssSize(this.height) ?? "auto",
|
|
864
|
+
minHeight: toCssSize(this.minHeight) ?? void 0,
|
|
865
|
+
maxHeight: toCssSize(this.maxHeight) ?? void 0,
|
|
866
|
+
...consumer,
|
|
867
|
+
events: {
|
|
868
|
+
...consumerEvents,
|
|
869
|
+
onload: chain(this._onLoad, "onload"),
|
|
870
|
+
onChange: chain(this._onChange, "onChange"),
|
|
871
|
+
onInput: chain(this._onInput, "onInput"),
|
|
872
|
+
onFocus: chain(this._onFocus, "onFocus"),
|
|
873
|
+
onBlur: chain(this._onBlur, "onBlur"),
|
|
874
|
+
onToggleFullScreen: chain(this._onToggleFullScreen, "onToggleFullScreen")
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
for (const key of Object.keys(options)) if (options[key] === void 0) delete options[key];
|
|
878
|
+
return options;
|
|
879
|
+
}
|
|
880
|
+
_destroyEditor() {
|
|
881
|
+
this._buildToken++;
|
|
882
|
+
this._building = false;
|
|
883
|
+
const editor = this._editor;
|
|
884
|
+
this._editor = null;
|
|
885
|
+
this._ready = false;
|
|
886
|
+
this._loading = false;
|
|
887
|
+
this._titleObservers.forEach((o) => o.disconnect());
|
|
888
|
+
this._titleObservers = [];
|
|
889
|
+
if (editor) try {
|
|
890
|
+
editor.destroy();
|
|
891
|
+
} catch {}
|
|
892
|
+
this._mount?.replaceChildren();
|
|
893
|
+
}
|
|
894
|
+
/** Destroy + create, keeping the current HTML (it lives in `modelValue`). */
|
|
895
|
+
_rebuild() {
|
|
896
|
+
this._destroyEditor();
|
|
897
|
+
this._ensureEditor();
|
|
898
|
+
}
|
|
899
|
+
/** The editor's HTML as the field's value — `''` when it holds nothing. */
|
|
900
|
+
_read(data) {
|
|
901
|
+
const editor = this._editor;
|
|
902
|
+
if (!editor) return "";
|
|
903
|
+
try {
|
|
904
|
+
if (editor.isEmpty()) return "";
|
|
905
|
+
} catch {}
|
|
906
|
+
return typeof data === "string" ? data : editor.$.html.get();
|
|
907
|
+
}
|
|
908
|
+
_publish(kind, params) {
|
|
909
|
+
if (this.disabled || this.readonly) return;
|
|
910
|
+
const next = this._read(params?.data);
|
|
911
|
+
const oldValue = this.modelValue;
|
|
912
|
+
if (kind === "change") {
|
|
913
|
+
if (next === this._lastChanged) return;
|
|
914
|
+
this._lastChanged = next;
|
|
915
|
+
}
|
|
916
|
+
this._lastEmitted = next;
|
|
917
|
+
this.value = next;
|
|
918
|
+
this.modelValue = next;
|
|
919
|
+
dispatchMonoEvent(this, kind, {
|
|
920
|
+
modelValue: next,
|
|
921
|
+
currentValue: next,
|
|
922
|
+
oldValue,
|
|
923
|
+
value: next,
|
|
924
|
+
name: this.name || void 0,
|
|
925
|
+
sourceEvent: params
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
/** Push an OUTSIDE `modelValue` into the editor — only when it is genuinely new. */
|
|
929
|
+
_applyModelValue() {
|
|
930
|
+
const editor = this._editor;
|
|
931
|
+
if (!editor) return;
|
|
932
|
+
const next = this.modelValue || "";
|
|
933
|
+
if (next === this._lastEmitted) return;
|
|
934
|
+
this._lastEmitted = this._lastChanged = next;
|
|
935
|
+
try {
|
|
936
|
+
editor.$.html.set(next);
|
|
937
|
+
} catch (err) {
|
|
938
|
+
console.warn("[mono-rich-text-editor] could not set the editor content", err);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
_applyState() {
|
|
942
|
+
const editor = this._editor;
|
|
943
|
+
if (!editor || !this._ready) return;
|
|
944
|
+
try {
|
|
945
|
+
if (this.disabled) editor.$.ui.disable();
|
|
946
|
+
else {
|
|
947
|
+
editor.$.ui.enable();
|
|
948
|
+
editor.$.ui.readOnly(!!this.readonly);
|
|
949
|
+
}
|
|
950
|
+
} catch (err) {
|
|
951
|
+
console.warn("[mono-rich-text-editor] could not apply disabled/readonly", err);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
_applyAria() {
|
|
955
|
+
const editor = this._editor;
|
|
956
|
+
if (!editor || !this._ready) return;
|
|
957
|
+
const wysiwyg = editor.$.frameContext?.get?.("wysiwyg");
|
|
958
|
+
if (!wysiwyg) return;
|
|
959
|
+
const label = this.ariaLabelText || this.label || this.placeholder;
|
|
960
|
+
if (label) wysiwyg.setAttribute("aria-label", label);
|
|
961
|
+
else wysiwyg.removeAttribute("aria-label");
|
|
962
|
+
wysiwyg.setAttribute("aria-invalid", this._resolvedValidationState === "invalid" ? "true" : "false");
|
|
963
|
+
if (this._shouldShowFooter) wysiwyg.setAttribute("aria-describedby", this._messageId);
|
|
964
|
+
else wysiwyg.removeAttribute("aria-describedby");
|
|
965
|
+
}
|
|
966
|
+
/** The live SunEditor instance, or `null` before it loads / when the peer is missing. */
|
|
967
|
+
get editor() {
|
|
968
|
+
return this._editor;
|
|
969
|
+
}
|
|
970
|
+
/** The HTML as SunEditor serialises it (`''` when empty). */
|
|
971
|
+
getHtml() {
|
|
972
|
+
return this._read();
|
|
973
|
+
}
|
|
974
|
+
/** Replace the content. Emits `mno-change` like a user edit would. */
|
|
975
|
+
setHtml(html) {
|
|
976
|
+
this.modelValue = html ?? "";
|
|
977
|
+
this._applyModelValue();
|
|
978
|
+
}
|
|
979
|
+
/** Insert HTML at the caret. */
|
|
980
|
+
insertHtml(html) {
|
|
981
|
+
this._editor?.$.html.insert(html);
|
|
982
|
+
}
|
|
983
|
+
/** The plain text of the content. */
|
|
984
|
+
getText() {
|
|
985
|
+
return (this._editor?.$.frameContext?.get?.("wysiwyg"))?.innerText ?? "";
|
|
986
|
+
}
|
|
987
|
+
isEmpty() {
|
|
988
|
+
return this._read() === "";
|
|
989
|
+
}
|
|
990
|
+
focus() {
|
|
991
|
+
this._editor?.$.focusManager.focus();
|
|
992
|
+
}
|
|
993
|
+
blur() {
|
|
994
|
+
this._editor?.$.focusManager.blur();
|
|
995
|
+
}
|
|
996
|
+
/** Toggle (or set) the HTML source view. */
|
|
997
|
+
codeView(value) {
|
|
998
|
+
this._editor?.$.viewer.codeView(value);
|
|
999
|
+
}
|
|
1000
|
+
/** Toggle (or set) full screen. */
|
|
1001
|
+
fullScreen(value) {
|
|
1002
|
+
this._editor?.$.viewer.fullScreen(value);
|
|
1003
|
+
}
|
|
1004
|
+
_setCssClass(value) {
|
|
1005
|
+
if (value == null) {
|
|
1006
|
+
this.cssClass = {};
|
|
1007
|
+
this.cssClassName = "";
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
if (typeof value === "object") {
|
|
1011
|
+
this.cssClass = value;
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
if (typeof value === "string") {
|
|
1015
|
+
const trimmed = value.trim();
|
|
1016
|
+
if (!trimmed) {
|
|
1017
|
+
this.cssClass = {};
|
|
1018
|
+
this.cssClassName = "";
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
if (trimmed.startsWith("{") && trimmed.endsWith("}")) try {
|
|
1022
|
+
this.cssClass = JSON.parse(trimmed);
|
|
1023
|
+
return;
|
|
1024
|
+
} catch {}
|
|
1025
|
+
this.cssClassName = trimmed;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
_toBoolean(value) {
|
|
1029
|
+
if (typeof value === "boolean") return value;
|
|
1030
|
+
if (typeof value === "string") {
|
|
1031
|
+
const normalized = value.toLowerCase().trim();
|
|
1032
|
+
return normalized === "" || normalized === "true";
|
|
1033
|
+
}
|
|
1034
|
+
return Boolean(value);
|
|
1035
|
+
}
|
|
1036
|
+
_cls(base, key) {
|
|
1037
|
+
const extra = this.cssClass?.[key];
|
|
1038
|
+
return extra ? `${base} ${extra}` : base;
|
|
1039
|
+
}
|
|
1040
|
+
get _resolvedValidationState() {
|
|
1041
|
+
if (this.validationState && this.validationState !== "default") return this.validationState;
|
|
1042
|
+
if (this.errorMessage) return "invalid";
|
|
1043
|
+
if (this.successMessage) return "valid";
|
|
1044
|
+
return "default";
|
|
1045
|
+
}
|
|
1046
|
+
get _wrapperClasses() {
|
|
1047
|
+
return [
|
|
1048
|
+
"mono-rich-text-editor",
|
|
1049
|
+
this.size,
|
|
1050
|
+
this.color,
|
|
1051
|
+
this.variant,
|
|
1052
|
+
`mode-${this.mode.replace(":", "-")}`,
|
|
1053
|
+
this.disabled ? "disabled" : "",
|
|
1054
|
+
this.readonly ? "readonly" : "",
|
|
1055
|
+
this._resolvedValidationState !== "default" ? `is-${this._resolvedValidationState}` : "",
|
|
1056
|
+
this.value ? "has-value" : "",
|
|
1057
|
+
this._loading ? "is-loading" : "",
|
|
1058
|
+
this._error ? "is-unavailable" : "",
|
|
1059
|
+
this.cssClassName,
|
|
1060
|
+
this.cssClass?.root
|
|
1061
|
+
].filter(Boolean).join(" ");
|
|
1062
|
+
}
|
|
1063
|
+
get _fieldClasses() {
|
|
1064
|
+
return [
|
|
1065
|
+
this._cls("mono-rich-text-editor-field", "field"),
|
|
1066
|
+
this.size,
|
|
1067
|
+
this.color,
|
|
1068
|
+
this.variant
|
|
1069
|
+
].filter(Boolean).join(" ");
|
|
1070
|
+
}
|
|
1071
|
+
get _shouldShowFooter() {
|
|
1072
|
+
return Boolean(this.validationMessage || this.errorMessage || this.successMessage || this.helperText || this._hasHelperSlotState);
|
|
1073
|
+
}
|
|
1074
|
+
_renderLabel() {
|
|
1075
|
+
const hasContent = !!this.label || this._hasLabelSlotState;
|
|
1076
|
+
if (!hasContent && !this._slotsAlwaysRender) return nothing;
|
|
1077
|
+
return html`
|
|
1078
|
+
<label class=${this._cls("mono-rich-text-editor-label", "label")} mono-rte-label ?mono-empty=${!hasContent} ?data-empty=${!hasContent}>
|
|
1079
|
+
${this._slotOutlet("label", this.label)}
|
|
1080
|
+
${this.required ? html`<span class=${this._cls("mono-rich-text-editor-required", "required")} mono-rte-required-mark>*</span>` : nothing}
|
|
1081
|
+
</label>
|
|
1082
|
+
`;
|
|
1083
|
+
}
|
|
1084
|
+
_renderMessage() {
|
|
1085
|
+
const base = this._cls("mono-rich-text-editor-message", "message");
|
|
1086
|
+
if (this.validationMessage) {
|
|
1087
|
+
const state = this._resolvedValidationState;
|
|
1088
|
+
return html`<div class=${`${base} ${state}`} mono-rte-message=${state} role=${state === "invalid" ? "alert" : nothing}>${this.validationMessage}</div>`;
|
|
1089
|
+
}
|
|
1090
|
+
if (this.errorMessage) return html`<div class=${`${base} invalid`} mono-rte-message="invalid" role="alert">${this.errorMessage}</div>`;
|
|
1091
|
+
if (this.successMessage) return html`<div class=${`${base} valid`} mono-rte-message="valid">${this.successMessage}</div>`;
|
|
1092
|
+
if (this.helperText || this._hasHelperSlotState || this._slotsAlwaysRender) {
|
|
1093
|
+
const empty = !this.helperText && !this._hasHelperSlotState;
|
|
1094
|
+
return html`
|
|
1095
|
+
<div class=${`${base} helper`} mono-rte-message="helper" ?mono-empty=${empty} ?data-empty=${empty}>
|
|
1096
|
+
${this._slotOutlet("helper", this.helperText)}
|
|
1097
|
+
</div>
|
|
1098
|
+
`;
|
|
1099
|
+
}
|
|
1100
|
+
return nothing;
|
|
1101
|
+
}
|
|
1102
|
+
_renderFooter() {
|
|
1103
|
+
if (!this._shouldShowFooter && !this._slotsAlwaysRender) return nothing;
|
|
1104
|
+
return html`
|
|
1105
|
+
<div class=${this._cls("mono-rich-text-editor-footer", "footer")} mono-rte-footer ?mono-empty=${!this._shouldShowFooter} ?data-empty=${!this._shouldShowFooter}>
|
|
1106
|
+
<div class=${this.cssClass?.messageWrap ?? ""} mono-rte-message-wrap>${this._renderMessage()}</div>
|
|
1107
|
+
</div>
|
|
1108
|
+
`;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* The peer-missing / build-failure notice. A SIBLING of the field frame, never
|
|
1112
|
+
* inside it: the frame's children are the mount the build re-homes there, and
|
|
1113
|
+
* a Lit child part beside a node Lit did not render would clear it on update.
|
|
1114
|
+
*/
|
|
1115
|
+
_renderUnavailable() {
|
|
1116
|
+
if (!this._error) return nothing;
|
|
1117
|
+
return html`<div class="mono-rich-text-editor-unavailable" mono-rte-unavailable role="alert">${this._error}</div>`;
|
|
1118
|
+
}
|
|
1119
|
+
render() {
|
|
1120
|
+
const state = this._resolvedValidationState;
|
|
1121
|
+
return html`
|
|
1122
|
+
<div
|
|
1123
|
+
class=${this._wrapperClasses}
|
|
1124
|
+
style=${styleMap(buildSizeStyle({
|
|
1125
|
+
width: this.width,
|
|
1126
|
+
minWidth: this.minWidth,
|
|
1127
|
+
maxWidth: this.maxWidth
|
|
1128
|
+
}))}
|
|
1129
|
+
mono-rich-text-editor
|
|
1130
|
+
mono-size=${this.size === "md" ? nothing : this.size}
|
|
1131
|
+
mono-color=${this.color === "primary" ? nothing : this.color}
|
|
1132
|
+
mono-variant=${this.variant === "outlined" ? nothing : this.variant}
|
|
1133
|
+
mono-validation-state=${state === "default" ? nothing : state}
|
|
1134
|
+
mono-mode=${this.mode === "classic" ? nothing : this.mode}
|
|
1135
|
+
?mono-disabled=${this.disabled}
|
|
1136
|
+
?mono-readonly=${this.readonly}
|
|
1137
|
+
?mono-required=${this.required}
|
|
1138
|
+
?mono-loading=${this._loading}
|
|
1139
|
+
?mono-unavailable=${!!this._error}
|
|
1140
|
+
?mono-has-value=${!!this.value}
|
|
1141
|
+
>
|
|
1142
|
+
${this._renderLabel()}
|
|
1143
|
+
${this._renderEditorOutlet(this._fieldClasses)}
|
|
1144
|
+
${this._renderUnavailable()}
|
|
1145
|
+
<div id=${this._messageId} mono-rte-message-outlet>${this._renderFooter()}</div>
|
|
1146
|
+
</div>
|
|
1147
|
+
`;
|
|
1148
|
+
}
|
|
1149
|
+
/** Whether the `label` / `helper` regions render even when empty. Light: no. Shadow: yes. */
|
|
1150
|
+
get _slotsAlwaysRender() {
|
|
1151
|
+
return false;
|
|
1152
|
+
}
|
|
1153
|
+
/** Whether slots are native `<slot>`s (shadow) rather than captured placeholders (light). */
|
|
1154
|
+
get _useNativeSlots() {
|
|
1155
|
+
return false;
|
|
1156
|
+
}
|
|
1157
|
+
_setSlotState(name, has) {
|
|
1158
|
+
if (name === "label") this._hasLabelSlotState = has;
|
|
1159
|
+
else this._hasHelperSlotState = has;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Slot outlet for `label` / `helper`. Light (default): a `data-mono-slot`
|
|
1163
|
+
* placeholder the captured nodes are re-parented into when present, else the
|
|
1164
|
+
* prop `fallback`. Shadow overrides with a native `<slot name>`.
|
|
1165
|
+
*/
|
|
1166
|
+
_slotOutlet(name, fallback = nothing) {
|
|
1167
|
+
return (name === "label" ? this._hasLabelSlotState : this._hasHelperSlotState) ? html`<span data-mono-slot=${name}></span>` : html`${fallback}`;
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* The field frame the editor mount shows in. Its children are NOT Lit's:
|
|
1171
|
+
* light — the mount is appended by `_placeMount`; shadow — overridden to hold
|
|
1172
|
+
* a `<slot name="editor">`. Nothing else may ever render inside it.
|
|
1173
|
+
*/
|
|
1174
|
+
_renderEditorOutlet(fieldClass) {
|
|
1175
|
+
return html`<div class=${fieldClass} mono-rte-field data-mono-slot="editor"></div>`;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "size", void 0);
|
|
1179
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "color", void 0);
|
|
1180
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "variant", void 0);
|
|
1181
|
+
__decorate([property({
|
|
1182
|
+
type: String,
|
|
1183
|
+
attribute: "model-value"
|
|
1184
|
+
})], MonoRichTextEditorCoreClass.prototype, "modelValue", void 0);
|
|
1185
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "value", void 0);
|
|
1186
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "name", void 0);
|
|
1187
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "placeholder", void 0);
|
|
1188
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "label", void 0);
|
|
1189
|
+
__decorate([property({
|
|
1190
|
+
type: String,
|
|
1191
|
+
attribute: "helper-text"
|
|
1192
|
+
})], MonoRichTextEditorCoreClass.prototype, "helperText", void 0);
|
|
1193
|
+
__decorate([property({
|
|
1194
|
+
type: String,
|
|
1195
|
+
attribute: "validation-state"
|
|
1196
|
+
})], MonoRichTextEditorCoreClass.prototype, "validationState", void 0);
|
|
1197
|
+
__decorate([property({
|
|
1198
|
+
type: String,
|
|
1199
|
+
attribute: "validation-message"
|
|
1200
|
+
})], MonoRichTextEditorCoreClass.prototype, "validationMessage", void 0);
|
|
1201
|
+
__decorate([property({
|
|
1202
|
+
type: String,
|
|
1203
|
+
attribute: "error-message"
|
|
1204
|
+
})], MonoRichTextEditorCoreClass.prototype, "errorMessage", void 0);
|
|
1205
|
+
__decorate([property({
|
|
1206
|
+
type: String,
|
|
1207
|
+
attribute: "success-message"
|
|
1208
|
+
})], MonoRichTextEditorCoreClass.prototype, "successMessage", void 0);
|
|
1209
|
+
__decorate([property({
|
|
1210
|
+
type: String,
|
|
1211
|
+
attribute: "aria-label"
|
|
1212
|
+
})], MonoRichTextEditorCoreClass.prototype, "ariaLabelText", void 0);
|
|
1213
|
+
__decorate([property({
|
|
1214
|
+
reflect: true,
|
|
1215
|
+
converter: booleanStringConverter
|
|
1216
|
+
})], MonoRichTextEditorCoreClass.prototype, "disabled", void 0);
|
|
1217
|
+
__decorate([property({
|
|
1218
|
+
reflect: true,
|
|
1219
|
+
converter: booleanStringConverter
|
|
1220
|
+
})], MonoRichTextEditorCoreClass.prototype, "readonly", void 0);
|
|
1221
|
+
__decorate([property({
|
|
1222
|
+
reflect: true,
|
|
1223
|
+
converter: booleanStringConverter
|
|
1224
|
+
})], MonoRichTextEditorCoreClass.prototype, "required", void 0);
|
|
1225
|
+
__decorate([property({ attribute: false })], MonoRichTextEditorCoreClass.prototype, "cssClass", void 0);
|
|
1226
|
+
__decorate([property({ attribute: false })], MonoRichTextEditorCoreClass.prototype, "cssClassName", void 0);
|
|
1227
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "mode", void 0);
|
|
1228
|
+
__decorate([property({ attribute: "toolbar" })], MonoRichTextEditorCoreClass.prototype, "toolbar", void 0);
|
|
1229
|
+
__decorate([property({ attribute: "plugins" })], MonoRichTextEditorCoreClass.prototype, "plugins", void 0);
|
|
1230
|
+
__decorate([property({ attribute: "language" })], MonoRichTextEditorCoreClass.prototype, "language", void 0);
|
|
1231
|
+
__decorate([property({
|
|
1232
|
+
type: String,
|
|
1233
|
+
attribute: "text-direction"
|
|
1234
|
+
})], MonoRichTextEditorCoreClass.prototype, "textDirection", void 0);
|
|
1235
|
+
__decorate([property({
|
|
1236
|
+
attribute: "char-counter",
|
|
1237
|
+
reflect: true,
|
|
1238
|
+
converter: booleanStringConverter
|
|
1239
|
+
})], MonoRichTextEditorCoreClass.prototype, "charCounter", void 0);
|
|
1240
|
+
__decorate([property({
|
|
1241
|
+
attribute: "max-length",
|
|
1242
|
+
converter: optionalNumberConverter
|
|
1243
|
+
})], MonoRichTextEditorCoreClass.prototype, "maxLength", void 0);
|
|
1244
|
+
__decorate([property({
|
|
1245
|
+
reflect: true,
|
|
1246
|
+
converter: booleanStringConverter
|
|
1247
|
+
})], MonoRichTextEditorCoreClass.prototype, "statusbar", void 0);
|
|
1248
|
+
__decorate([property({ converter: optionalNumberConverter })], MonoRichTextEditorCoreClass.prototype, "sticky", void 0);
|
|
1249
|
+
__decorate([property({
|
|
1250
|
+
attribute: "load-css",
|
|
1251
|
+
converter: booleanStringConverter
|
|
1252
|
+
})], MonoRichTextEditorCoreClass.prototype, "loadCss", void 0);
|
|
1253
|
+
__decorate([property({ attribute: false })], MonoRichTextEditorCoreClass.prototype, "options", void 0);
|
|
1254
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "width", void 0);
|
|
1255
|
+
__decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "height", void 0);
|
|
1256
|
+
__decorate([property({
|
|
1257
|
+
type: String,
|
|
1258
|
+
attribute: "min-width"
|
|
1259
|
+
})], MonoRichTextEditorCoreClass.prototype, "minWidth", void 0);
|
|
1260
|
+
__decorate([property({
|
|
1261
|
+
type: String,
|
|
1262
|
+
attribute: "max-width"
|
|
1263
|
+
})], MonoRichTextEditorCoreClass.prototype, "maxWidth", void 0);
|
|
1264
|
+
__decorate([property({
|
|
1265
|
+
type: String,
|
|
1266
|
+
attribute: "min-height"
|
|
1267
|
+
})], MonoRichTextEditorCoreClass.prototype, "minHeight", void 0);
|
|
1268
|
+
__decorate([property({
|
|
1269
|
+
type: String,
|
|
1270
|
+
attribute: "max-height"
|
|
1271
|
+
})], MonoRichTextEditorCoreClass.prototype, "maxHeight", void 0);
|
|
1272
|
+
__decorate([state()], MonoRichTextEditorCoreClass.prototype, "_hasLabelSlotState", void 0);
|
|
1273
|
+
__decorate([state()], MonoRichTextEditorCoreClass.prototype, "_hasHelperSlotState", void 0);
|
|
1274
|
+
__decorate([state()], MonoRichTextEditorCoreClass.prototype, "_error", void 0);
|
|
1275
|
+
__decorate([state()], MonoRichTextEditorCoreClass.prototype, "_loading", void 0);
|
|
1276
|
+
return MonoRichTextEditorCoreClass;
|
|
1277
|
+
};
|
|
1278
|
+
//#endregion
|
|
1279
|
+
//#region src/components/rich-text-editor/rich-text-editor.css?raw
|
|
1280
|
+
var rich_text_editor_default = "/* =========================================================================\r\n mono-rich-text-editor — a mono form field whose input is a SunEditor v3\r\n instance. An EXTENSION: Basecoat has no editor, so the CHROME is the ported\r\n textarea's `.field` (basecoat-css@1.0.2, vega style) — label, frame, message\r\n — and the EDITOR is SunEditor's own DOM, styled by ITS stylesheet\r\n (`suneditor/css/editor`, loaded by the element at runtime) and themed from\r\n here by remapping its `--se-*` tokens onto the Basecoat tokens.\r\n\r\n Styled by ATTRIBUTE, like Basecoat — and the attributes mirror the element's\r\n props one for one, so hand-written markup reads like the Lit / Vue tag:\r\n\r\n <mono-rich-text-editor size=\"sm\" color=\"danger\" label=\"Body\" helper-text=\"…\">\r\n <div mono-rich-text-editor mono-size=\"sm\" mono-color=\"danger\">\r\n <label mono-rte-label>Body</label>\r\n <div mono-rte-field><div mono-rte-mount>…SunEditor…</div></div>\r\n <div mono-rte-footer><div mono-rte-message-wrap><div mono-rte-message=\"helper\">…</div></div></div>\r\n </div>\r\n\r\n An absent attribute is the prop's default (`:not([mono-size])` = md,\r\n `:not([mono-color])` = primary, `:not([mono-variant])` = outlined). The element\r\n renders these on its root (both builds) plus the STATES `mono-disabled` /\r\n `mono-readonly` / `mono-required` / `mono-loading` / `mono-unavailable` /\r\n `mono-has-value` and `mono-validation-state=\"valid|invalid|warning\"`. The\r\n old classes (`.mono-rich-text-editor.md.primary.outlined`) are still emitted\r\n as inert hooks until 2.0 but no rule here reads them.\r\n\r\n THE PARTS ARE FAMILY-UNIQUE (`mono-rte-*`): the frame holds SunEditor's whole\r\n DOM, and a consumer's content may carry anything.\r\n\r\n Selector map (ours ≡ upstream):\r\n [mono-rich-text-editor] ≡ .field (flex w-full flex-col gap-3)\r\n [mono-rich-text-editor] > [mono-rte-label] ≡ .field > label / .label\r\n [mono-rte-field] ≡ .textarea's box (rounded-md border-input bg-transparent shadow-xs,\r\n focus-within: border-ring ring-3 ring-ring/50) — the editor sits inside\r\n [mono-rte-mount] .sun-editor .se-toolbar ≡ EXTENSION (a muted band under the frame's top edge)\r\n [mono-rte-footer] > [mono-rte-message-wrap] > [mono-rte-message=\"…\"] ≡ .field > p / .field [role='alert']\r\n [mono-validation-state=\"invalid\"] ≡ aria-invalid:border-destructive aria-invalid:ring-destructive/20\r\n [mono-validation-state=\"valid|warning\"] ≡ EXTENSION (the same treatment in --success / --warning)\r\n [mono-size=\"xs|sm|lg|xl|xxl\"] ≡ EXTENSION (the textarea's font ladder; icons step with it)\r\n [mono-variant=\"filled\"] ≡ EXTENSION (luma / mira / rhea's textarea)\r\n [mono-variant=\"underlined\"] ≡ EXTENSION (sera's: the bottom edge only, no ring)\r\n [mono-rte-unavailable] ≡ EXTENSION (the peer-missing notice)\r\n .se-tooltip-text (SunEditor's) ≡ [data-tooltip]::before (bg-foreground text-background rounded-md px-3 py-1.5 text-xs)\r\n\r\n FLAVORS: the frame IS the textarea's box, so every metric resolves\r\n `--mono-rich-text-editor-<k>` → `--mono-textarea-<k>` → the base through the\r\n SAME chains textarea.css uses — a flavour that retunes the textarea retunes\r\n this frame, and no flavour file carries an editor entry. SunEditor's own\r\n popovers (dropdowns, the modal layer it parks on <body>) take the select\r\n panel's popover chain (`--mono-select-dropdown-*`), like every other popover.\r\n\r\n The editor DOM is LIGHT DOM in both builds (see `rich-text-editor-core.ts`),\r\n so the `--se-*` remap is declared on the frame and inherited by the mount —\r\n through a `<slot>` in the shadow build, which custom properties cross — and\r\n DELIVERED on `.sun-editor` from the PAGE sheet (the shadow sheet cannot reach\r\n a slotted descendant). Nothing below reaches into SunEditor's selectors except\r\n to flatten the frame it paints around itself, which the mono frame replaces.\r\n ========================================================================= */\r\n\r\nmono-rich-text-editor {\r\n display: block;\r\n}\r\n\r\n/* The token block — on the element root AND on SunEditor's carrier (the layer it\r\n parks on <body> for its dropdown lists, dialogs and alerts), which is outside\r\n every frame and can inherit nothing from it. The element's own props (`color`,\r\n `size`) cannot reach the carrier either: it takes the defaults. */\r\n[mono-rich-text-editor],\r\n.sun-editor.sun-editor-carrier-wrapper {\r\n /* ── palette: each slot is a public knob over the textarea's, over a Basecoat token ── */\r\n --_mono-rte-text: var(--mono-rich-text-editor-text, var(--mono-textarea-text, var(--foreground)));\r\n --_mono-rte-placeholder: var(--mono-rich-text-editor-placeholder, var(--mono-textarea-placeholder, var(--muted-foreground)));\r\n --_mono-rte-muted: var(--mono-rich-text-editor-muted, var(--mono-textarea-muted, var(--muted-foreground)));\r\n --_mono-rte-primary: var(--mono-rich-text-editor-primary, var(--mono-textarea-primary, var(--ring)));\r\n --_mono-rte-secondary: var(--mono-rich-text-editor-secondary, var(--mono-textarea-secondary, var(--muted-foreground)));\r\n --_mono-rte-success: var(--mono-rich-text-editor-success, var(--mono-textarea-success, var(--success)));\r\n --_mono-rte-danger: var(--mono-rich-text-editor-danger, var(--mono-textarea-danger, var(--destructive)));\r\n --_mono-rte-warning: var(--mono-rich-text-editor-warning, var(--mono-textarea-warning, var(--warning)));\r\n --_mono-rte-info: var(--mono-rich-text-editor-info, var(--mono-textarea-info, var(--info)));\r\n --_mono-rte-teal: var(--mono-rich-text-editor-teal, var(--mono-textarea-teal, var(--teal)));\r\n --_mono-rte-purple: var(--mono-rich-text-editor-purple, var(--mono-textarea-purple, var(--purple)));\r\n --_mono-rte-neutral: var(--mono-rich-text-editor-neutral, var(--mono-textarea-neutral, var(--neutral)));\r\n --_mono-rte-dark: var(--mono-rich-text-editor-dark, var(--mono-textarea-dark, var(--dark)));\r\n --_mono-rte-valid: var(--mono-rich-text-editor-valid, var(--mono-textarea-valid, var(--success)));\r\n --_mono-rte-invalid: var(--mono-rich-text-editor-invalid, var(--mono-textarea-invalid, var(--destructive)));\r\n\r\n /* ── the painted result — three tiers, base = vega's .textarea ─────────── */\r\n --_mono-rte-ring-color: var(--mono-rich-text-editor-ring-color, var(--mono-rich-text-editor-focus-color, var(--_mono-rte-ring-color-preset, var(--_mono-rte-primary))));\r\n --_mono-rte-ring-width: var(--mono-rich-text-editor-ring-width, var(--mono-textarea-ring-width, var(--_mono-rte-ring-width-preset, var(--mono-ring-width))));\r\n --_mono-rte-ring-alpha: var(--mono-rich-text-editor-ring-alpha, var(--mono-textarea-ring-alpha, var(--mono-ring-alpha)));\r\n --_mono-rte-border-color: var(--mono-rich-text-editor-rest-border, var(--mono-rich-text-editor-border-color, var(--mono-rich-text-editor-border, var(--mono-textarea-rest-border, var(--mono-textarea-border-color, var(--_mono-rte-border-color-preset, var(--input)))))));\r\n --_mono-rte-side-border-color: var(--_mono-rte-side-border-color-preset, var(--_mono-rte-border-color));\r\n --_mono-rte-bg: var(--mono-rich-text-editor-bg, var(--mono-rich-text-editor-surface, var(--mono-textarea-bg, var(--mono-textarea-surface, var(--_mono-rte-bg-preset, var(--mono-mode-surface))))));\r\n --_mono-rte-shadow: var(--mono-rich-text-editor-shadow, var(--mono-textarea-shadow, var(--_mono-rte-shadow-preset, var(--mono-shadow-xs))));\r\n --_mono-rte-border-width: var(--mono-rich-text-editor-border-width, var(--mono-textarea-border-width, var(--mono-border-width)));\r\n --_mono-rte-radius: var(--mono-rich-text-editor-radius, var(--mono-textarea-radius, var(--_mono-rte-radius-preset, var(--mono-radius-md))));\r\n\r\n /* ── md metrics live on the unqualified root ON PURPOSE: hand-written\r\n `<div mono-rich-text-editor>` that names no size renders like size=\"md\" ── */\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-md, var(--mono-textarea-font-md, var(--mono-text-sm))));\r\n --_mono-rte-icon-size: var(--mono-rich-text-editor-icon-size, var(--_mono-rte-icon-size-preset, 18px));\r\n --_mono-rte-font-family: var(--mono-rich-text-editor-font-family, inherit);\r\n --_mono-rte-min-height: var(--mono-rich-text-editor-min-height, 10rem);\r\n /* EXTENSION — the toolbar band: a muted wash under the frame's top edge */\r\n --_mono-rte-toolbar-bg: var(--mono-rich-text-editor-toolbar-bg, color-mix(in oklab, var(--muted) 60%, var(--_mono-rte-bg)));\r\n\r\n /* ── SunEditor's popovers (dropdowns, dialogs) are the select panel's popover ── */\r\n --_mono-rte-popover-bg: var(--mono-rich-text-editor-popover-bg, var(--mono-select-dropdown-bg, var(--popover)));\r\n --_mono-rte-popover-color: var(--mono-rich-text-editor-popover-color, var(--mono-select-dropdown-color, var(--popover-foreground)));\r\n --_mono-rte-popover-radius: var(--mono-rich-text-editor-popover-radius, var(--mono-select-dropdown-radius, var(--mono-radius-md)));\r\n --_mono-rte-popover-shadow: var(--mono-rich-text-editor-popover-shadow, var(--mono-select-dropdown-shadow, var(--mono-shadow-md)));\r\n\r\n /* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — bg-foreground text-background rounded-md px-3 py-1.5 text-xs\r\n SunEditor's toolbar tooltips; the corner is the style's shared tooltip token */\r\n --_mono-rte-tooltip-bg: var(--mono-rich-text-editor-tooltip-bg, var(--mono-tooltip-bg, var(--foreground)));\r\n --_mono-rte-tooltip-color: var(--mono-rich-text-editor-tooltip-color, var(--mono-tooltip-color, var(--background)));\r\n --_mono-rte-tooltip-radius: var(--mono-rich-text-editor-tooltip-radius, var(--mono-tooltip-radius, var(--mono-radius-md)));\r\n\r\n /* ── SunEditor's tokens, remapped onto the theme ─────────────────────────\r\n Declared on the FRAME'S ancestor so the light-DOM mount inherits them in\r\n both builds. `.sun-editor` re-declares every one of these on itself with\r\n its defaults, so each is delivered again on `.sun-editor` below — this\r\n block is what a consumer sees and overrides; that one is the delivery. */\r\n --_se-main-color: var(--_mono-rte-text);\r\n --_se-main-color-lighter: var(--_mono-rte-muted);\r\n --_se-main-background: var(--_mono-rte-bg);\r\n --_se-main-border: var(--border);\r\n --_se-main-divider: var(--border);\r\n --_se-main-outline: var(--_mono-rte-ring-color);\r\n /* the accent: links and the focus outline */\r\n --_se-active: var(--_mono-rte-ring-color);\r\n --_se-active-dark: color-mix(in oklab, var(--_mono-rte-ring-color) 85%, var(--foreground));\r\n /* basecoat@1.0.2 styles/vega.css .btn[data-variant='ghost'] — hover:bg-accent hover:text-accent-foreground\r\n a pressed toolbar button and a checked list item are the toggle-on state:\r\n the accent WASH with the foreground ink, never a primary tint */\r\n --_se-active-ink: var(--mono-rich-text-editor-active-color, var(--accent-foreground, var(--_mono-rte-text)));\r\n --_se-active-light: var(--mono-rich-text-editor-active-bg, var(--accent, var(--muted)));\r\n --_se-active-light2: var(--mono-mode-surface-hover);\r\n --_se-hover: var(--_mono-rte-text);\r\n --_se-hover-light: var(--mono-mode-ghost-hover);\r\n --_se-hover-light2: var(--mono-mode-surface-hover);\r\n --_se-error: var(--_mono-rte-danger);\r\n --_se-success: var(--_mono-rte-success);\r\n --_se-placeholder: var(--_mono-rte-placeholder);\r\n --_se-radius: var(--mono-radius-sm);\r\n --_se-radius-lg: var(--_mono-rte-popover-radius);\r\n --_se-shadow-layer: var(--_mono-rte-popover-shadow);\r\n --_se-font-family: var(--_mono-rte-font-family);\r\n --_se-font-size: var(--_mono-rte-font-size);\r\n --_se-icon-size: var(--_mono-rte-icon-size);\r\n --_se-min-height: var(--_mono-rte-min-height);\r\n\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field — flex w-full flex-col gap-3 */\r\n[mono-rich-text-editor] {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--mono-rich-text-editor-gap, var(--mono-textarea-gap, calc(var(--mono-spacing) * 3)));\r\n width: 100%;\r\n min-width: 0;\r\n color: var(--_mono-rte-text);\r\n font-family: inherit;\r\n}\r\n\r\n[mono-rich-text-editor],\r\n:where([mono-rich-text-editor]) > *,\r\n:where([mono-rich-text-editor]) > * > *::before,\r\n:where([mono-rich-text-editor]) > * > *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n/* the shadow build renders every region and marks the empty ones; the light\r\n build renders only what exists */\r\n[mono-rich-text-editor] :is([mono-rte-label], [mono-rte-message], [mono-rte-footer])[mono-empty] {\r\n display: none;\r\n}\r\n\r\n[mono-rich-text-editor] > [mono-rte-message-outlet]:not(:has([mono-rte-footer]:not([mono-empty]))) {\r\n display: none;\r\n}\r\n\r\n/* =========================================\r\n Sizes — EXTENSION: the textarea's font ladder; the icons step with it\r\n ========================================= */\r\n\r\n[mono-rich-text-editor][mono-size=\"xs\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-xs, var(--mono-textarea-font-xs, var(--mono-text-xs))));\r\n --_mono-rte-icon-size-preset: 14px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"sm\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-sm, var(--mono-textarea-font-sm, var(--mono-textarea-font-md, var(--mono-text-sm)))));\r\n --_mono-rte-icon-size-preset: 16px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"lg\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-lg, var(--mono-textarea-font-lg, var(--mono-textarea-font-md, var(--mono-text-sm)))));\r\n --_mono-rte-icon-size-preset: 20px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"xl\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-xl, var(--mono-textarea-font-xl, var(--mono-text-base))));\r\n --_mono-rte-icon-size-preset: 22px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"xxl\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-xxl, var(--mono-textarea-font-xxl, var(--mono-text-base))));\r\n --_mono-rte-icon-size-preset: 24px;\r\n}\r\n\r\n/* =========================================\r\n Colours — EXTENSION: the `color` prop is the FOCUS colour, which is also the\r\n editor's active state and links\r\n ========================================= */\r\n\r\n[mono-rich-text-editor][mono-color=\"secondary\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-secondary);\r\n}\r\n[mono-rich-text-editor][mono-color=\"success\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-success);\r\n}\r\n[mono-rich-text-editor][mono-color=\"danger\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-danger);\r\n}\r\n[mono-rich-text-editor][mono-color=\"warning\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-warning);\r\n}\r\n[mono-rich-text-editor][mono-color=\"info\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-info);\r\n}\r\n[mono-rich-text-editor][mono-color=\"teal\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-teal);\r\n}\r\n[mono-rich-text-editor][mono-color=\"purple\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-purple);\r\n}\r\n[mono-rich-text-editor][mono-color=\"neutral\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-neutral);\r\n}\r\n[mono-rich-text-editor][mono-color=\"dark\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-dark);\r\n}\r\n\r\n/* =========================================\r\n Label\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > label, .label\r\n — text-sm leading-snug font-medium */\r\n:where([mono-rich-text-editor]) > [mono-rte-label] {\r\n display: flex;\r\n align-items: center;\r\n gap: calc(var(--mono-spacing) * 1);\r\n font-size: var(--mono-rich-text-editor-label-font-size, var(--mono-textarea-label-font-size, var(--mono-text-sm)));\r\n line-height: var(--mono-rich-text-editor-label-line-height, var(--mono-textarea-label-line-height, var(--mono-leading-snug)));\r\n font-weight: var(--mono-rich-text-editor-label-font-weight, var(--mono-textarea-label-font-weight, var(--mono-label-font-weight, var(--mono-font-weight-medium))));\r\n color: var(--mono-rich-text-editor-label-color, var(--mono-textarea-label-color, var(--_mono-rte-text)));\r\n}\r\n\r\n[mono-rich-text-editor][mono-validation-state=\"invalid\"] > [mono-rte-label] {\r\n color: var(--mono-rich-text-editor-label-color, var(--mono-textarea-label-color, var(--_mono-rte-invalid)));\r\n}\r\n\r\n:where([mono-rich-text-editor]) [mono-rte-required-mark] {\r\n color: var(--mono-rich-text-editor-required-color, var(--mono-textarea-required-color, var(--destructive)));\r\n}\r\n\r\n[mono-rich-text-editor][mono-disabled] > [mono-rte-label] {\r\n opacity: 0.5;\r\n}\r\n\r\n/* =========================================\r\n The frame — the textarea's box, holding the editor\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > textarea, .textarea\r\n — rounded-md border border-input bg-transparent shadow-xs\r\n transition-[color,box-shadow] (dark:bg-input/30 via --mono-mode-surface);\r\n mono: no padding — the editor's toolbar and page fill the box edge to edge */\r\n:where([mono-rich-text-editor]) [mono-rte-field] {\r\n --_mono-rte-ring: 0 0 #0000;\r\n position: relative;\r\n width: 100%;\r\n min-width: 0;\r\n border: var(--_mono-rte-border-width) solid var(--_mono-rte-side-border-color);\r\n border-bottom-color: var(--_mono-rte-border-color);\r\n border-radius: var(--_mono-rte-radius);\r\n background-color: var(--_mono-rte-bg);\r\n color: var(--_mono-rte-text);\r\n box-shadow: var(--_mono-rte-ring), var(--_mono-rte-shadow);\r\n /* the editor paints its own corners; clip so the toolbar's top corners follow\r\n the frame's radius */\r\n overflow: hidden;\r\n transition-property: color, background-color, border-color, box-shadow, opacity;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n\r\n/* Before the editor loads (and on the server) the frame is a quiet box the\r\n size of the editing area, so the form does not jump when it lands. */\r\n[mono-rich-text-editor][mono-loading] [mono-rte-field] {\r\n min-height: calc(var(--_mono-rte-min-height) + 2.75rem);\r\n}\r\n[mono-rich-text-editor][mono-unavailable] [mono-rte-field] {\r\n display: none;\r\n}\r\n\r\n/* focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 —\r\n the focus is on SunEditor's contenteditable inside the frame */\r\n:where([mono-rich-text-editor]) [mono-rte-field]:focus-within {\r\n border-color: var(--_mono-rte-side-border-color);\r\n border-bottom-color: var(--_mono-rte-ring-color);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) color-mix(in oklab, var(--_mono-rte-ring-color) var(--_mono-rte-ring-alpha), transparent);\r\n}\r\n[mono-rich-text-editor]:is(:not([mono-variant]), [mono-variant=\"outlined\"], [mono-variant=\"filled\"]) [mono-rte-field]:focus-within {\r\n border-color: var(--_mono-rte-ring-color);\r\n}\r\n\r\n/* aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20\r\n (dark: /50 and /40, carried by the mode tokens) */\r\n[mono-rich-text-editor][mono-validation-state=\"invalid\"] [mono-rte-field] {\r\n --_mono-rte-border-color: var(--mono-mode-invalid-border);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) var(--mono-mode-invalid-ring);\r\n}\r\n\r\n/* EXTENSION — the same treatment in the success / warning roles */\r\n[mono-rich-text-editor][mono-validation-state=\"valid\"] [mono-rte-field] {\r\n --_mono-rte-border-color: color-mix(in oklab, var(--_mono-rte-valid) var(--mono-mode-state-border-alpha), transparent);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) color-mix(in oklab, var(--_mono-rte-valid) var(--mono-mode-state-ring-alpha), transparent);\r\n}\r\n[mono-rich-text-editor][mono-validation-state=\"warning\"] [mono-rte-field] {\r\n --_mono-rte-border-color: color-mix(in oklab, var(--_mono-rte-warning) var(--mono-mode-state-border-alpha), transparent);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) color-mix(in oklab, var(--_mono-rte-warning) var(--mono-mode-state-ring-alpha), transparent);\r\n}\r\n\r\n/* disabled:cursor-not-allowed disabled:opacity-50 */\r\n[mono-rich-text-editor][mono-disabled] [mono-rte-field] {\r\n opacity: 0.5;\r\n cursor: not-allowed;\r\n background-color: var(--mono-rich-text-editor-disabled-bg, var(--mono-textarea-disabled-bg, var(--_mono-rte-bg)));\r\n}\r\n\r\n/* EXTENSION — readonly is legible, not dimmed: a muted surface */\r\n[mono-rich-text-editor][mono-readonly]:not([mono-disabled]) [mono-rte-field] {\r\n --_se-main-background: var(--mono-rich-text-editor-readonly-bg, var(--mono-textarea-readonly-bg, var(--muted)));\r\n background-color: var(--mono-rich-text-editor-readonly-bg, var(--mono-textarea-readonly-bg, var(--muted)));\r\n}\r\n\r\n/* =========================================\r\n Variants — EXTENSION: the two other looks Basecoat's styles ship, through\r\n the textarea's own knobs so a flavour that restyles the textarea restyles this\r\n ========================================= */\r\n\r\n[mono-rich-text-editor]:is(:not([mono-variant]), [mono-variant=\"outlined\"]) {\r\n --_mono-rte-bg-preset: var(--mono-rich-text-editor-outline-bg, var(--mono-textarea-outline-bg));\r\n --_mono-rte-border-color-preset: var(--mono-rich-text-editor-outline-border-color, var(--mono-textarea-outline-border-color));\r\n --_mono-rte-side-border-color-preset: var(--mono-rich-text-editor-outline-side-border-color, var(--mono-textarea-outline-side-border-color));\r\n --_mono-rte-shadow-preset: var(--mono-rich-text-editor-outline-shadow, var(--mono-textarea-outline-shadow, var(--mono-shadow-xs)));\r\n --_mono-rte-radius-preset: var(--mono-rich-text-editor-outline-radius, var(--mono-textarea-outline-radius));\r\n --_mono-rte-ring-width-preset: var(--mono-rich-text-editor-outline-ring-width, var(--mono-textarea-outline-ring-width));\r\n}\r\n\r\n/* `filled` ≡ luma / mira / rhea's textarea: a tinted surface, no border, no shadow */\r\n[mono-rich-text-editor][mono-variant=\"filled\"] {\r\n --_mono-rte-bg-preset: var(--mono-rich-text-editor-filled-bg, var(--mono-textarea-filled-bg, color-mix(in oklab, var(--input) 50%, transparent)));\r\n --_mono-rte-border-color-preset: transparent;\r\n --_mono-rte-shadow-preset: 0 0 #0000;\r\n}\r\n\r\n/* `underlined` ≡ sera's: square, the bottom edge only, and no ring */\r\n[mono-rich-text-editor][mono-variant=\"underlined\"] {\r\n --_mono-rte-radius-preset: 0;\r\n --_mono-rte-bg-preset: transparent;\r\n --_mono-rte-side-border-color-preset: transparent;\r\n --_mono-rte-shadow-preset: 0 0 #0000;\r\n --_mono-rte-ring-width-preset: 0px;\r\n}\r\n[mono-rich-text-editor][mono-variant=\"underlined\"] [mono-rte-field] {\r\n --_se-main-background: transparent;\r\n --_mono-rte-toolbar-bg: transparent;\r\n}\r\n\r\n/* =========================================\r\n Footer — the message row\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .fieldset legend + p, .field > p, .field section > p\r\n — text-sm text-muted-foreground leading-normal font-normal */\r\n:where([mono-rich-text-editor]) [mono-rte-footer] {\r\n display: flex;\r\n align-items: flex-start;\r\n justify-content: space-between;\r\n gap: calc(var(--mono-spacing) * 2);\r\n}\r\n\r\n:where([mono-rich-text-editor]) [mono-rte-message-wrap] {\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n}\r\n\r\n:where([mono-rich-text-editor]) [mono-rte-message] {\r\n font-size: var(--mono-rich-text-editor-message-font-size, var(--mono-textarea-message-font-size, var(--mono-text-sm)));\r\n line-height: var(--mono-rich-text-editor-message-line-height, var(--mono-textarea-message-line-height, var(--mono-leading-normal)));\r\n font-weight: var(--mono-font-weight-normal);\r\n color: var(--_mono-rte-muted);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field [role=\"alert\"] — text-destructive text-sm */\r\n:where([mono-rich-text-editor]) [mono-rte-message=\"invalid\"] {\r\n color: var(--_mono-rte-invalid);\r\n}\r\n:where([mono-rich-text-editor]) [mono-rte-message=\"valid\"] {\r\n color: var(--_mono-rte-valid);\r\n}\r\n:where([mono-rich-text-editor]) [mono-rte-message=\"warning\"] {\r\n color: var(--_mono-rte-warning);\r\n}\r\n\r\n/* EXTENSION — the peer-missing notice: reads like a validation message, never like a crash */\r\n:where([mono-rich-text-editor]) [mono-rte-unavailable] {\r\n padding: calc(var(--mono-spacing) * 2.5) calc(var(--mono-spacing) * 3);\r\n border: var(--mono-border-width) dashed var(--_mono-rte-danger);\r\n border-radius: var(--_mono-rte-radius);\r\n background: color-mix(in oklab, var(--_mono-rte-danger) var(--mono-mode-tint), transparent);\r\n color: var(--_mono-rte-danger);\r\n font-size: var(--mono-text-sm);\r\n line-height: var(--mono-leading-normal);\r\n overflow-wrap: anywhere;\r\n}\r\n\r\n/* =========================================\r\n SunEditor inside the frame — from the PAGE sheet (the mount is light DOM)\r\n ========================================= */\r\n\r\n[mono-rte-mount] {\r\n display: block;\r\n width: 100%;\r\n min-width: 0;\r\n}\r\n\r\n/* Deliver the remap. `.sun-editor` sets every `--se-*` on itself from\r\n SunEditor's sheet, so the same selector (plus ours for specificity) has to\r\n set them again — the values, though, come from the frame's `--_se-*` above,\r\n which the mount inherits. Only the tokens a theme is made of; the rest keep\r\n SunEditor's defaults. */\r\n[mono-rte-mount] .sun-editor,\r\n[mono-rte-mount] .sun-editor-editable,\r\n.sun-editor.sun-editor-carrier-wrapper {\r\n --se-main-font-family: var(--_se-font-family);\r\n --se-content-font-family: var(--_se-font-family);\r\n --se-main-font-size: var(--_se-font-size);\r\n --se-btn-font-size: var(--_se-font-size);\r\n --se-edit-font-size: calc(var(--_se-font-size) * 1.1);\r\n --se-icon-size: var(--_se-icon-size);\r\n --se-min-height: var(--_se-min-height);\r\n --se-border-radius: var(--_se-radius);\r\n --se-border-radius-lg: var(--_se-radius-lg);\r\n\r\n --se-main-color: var(--_se-main-color);\r\n --se-main-color-lighter: var(--_se-main-color-lighter);\r\n --se-main-font-color: var(--_se-main-color);\r\n --se-main-background-color: var(--_se-main-background);\r\n --se-main-border-color: var(--_se-main-border);\r\n --se-main-divider-color: var(--_se-main-divider);\r\n --se-main-outline-color: var(--_se-main-outline);\r\n --se-main-shadow-color: var(--_se-main-divider);\r\n --se-statusbar-font-color: var(--_se-main-color-lighter);\r\n --se-dropdown-font-color: var(--_se-main-color);\r\n\r\n --se-edit-font-color: var(--_se-main-color);\r\n --se-edit-background-color: var(--_se-main-background);\r\n --se-edit-anchor: var(--_se-active);\r\n --se-caret-color: var(--_se-main-color);\r\n --se-placeholder-color: var(--_se-placeholder);\r\n\r\n --se-hover-color: var(--_se-hover);\r\n --se-hover-dark-color: var(--_se-main-border);\r\n --se-hover-light-color: var(--_se-hover-light);\r\n --se-hover-light2-color: var(--_se-hover-light2);\r\n --se-hover-light3-color: var(--_se-hover-light2);\r\n\r\n /* the accent for outlines and links; the toggle-on state for buttons and\r\n checked list items (ink = --se-active-dark3/4, wash = --se-active-light*) */\r\n --se-active-color: var(--_se-active);\r\n --se-active-hover-color: var(--_se-active-ink);\r\n --se-active-dark-color: var(--_se-main-border);\r\n --se-active-dark2-color: var(--_se-active-dark);\r\n --se-active-dark3-color: var(--_se-active-ink);\r\n --se-active-dark4-color: var(--_se-main-border);\r\n --se-active-dark5-color: var(--_se-active-dark);\r\n --se-active-light-color: var(--_se-active-light);\r\n --se-active-light2-color: var(--_se-active-light);\r\n --se-active-light3-color: var(--_se-active-light2);\r\n --se-active-light4-color: var(--_se-active-light);\r\n --se-active-light5-color: var(--_se-active-light2);\r\n --se-active-light6-color: var(--_se-active-light2);\r\n\r\n --se-error-color: var(--_se-error);\r\n --se-success-color: var(--_se-success);\r\n\r\n --se-select-menu-hover-bg: var(--_se-hover-light);\r\n --se-select-menu-active-bg: var(--_se-active-light);\r\n --se-modal-background-color: var(--_mono-rte-popover-bg);\r\n --se-modal-color: var(--_mono-rte-popover-color);\r\n --se-modal-border-color: var(--_se-main-border);\r\n --se-modal-anchor-color: var(--_se-active);\r\n --se-shadow-layer: var(--_se-shadow-layer);\r\n\r\n /* ── the sub-surfaces SunEditor paints from its own light palette ────────\r\n code view, the table picker, the floating controllers, the modal chrome,\r\n the overlay, the editing area's own colours — every one a page token now */\r\n --se-codeview-font-family: var(--font-mono, ui-monospace, monospace);\r\n --se-markdown-font-family: var(--font-mono, ui-monospace, monospace);\r\n --se-code-view-color: var(--_mono-rte-text);\r\n --se-code-view-background-color: var(--_se-main-background);\r\n --se-code-view-line-color: var(--_mono-rte-muted);\r\n --se-code-view-line-background-color: var(--muted);\r\n --se-markdown-view-color: var(--_mono-rte-text);\r\n --se-markdown-view-background-color: var(--_se-main-background);\r\n --se-markdown-view-line-color: var(--_mono-rte-muted);\r\n --se-markdown-view-line-background-color: var(--muted);\r\n\r\n --se-table-picker-color: var(--_mono-rte-popover-bg);\r\n --se-table-picker-border-color: var(--_se-main-border);\r\n --se-table-picker-highlight-color: color-mix(in oklab, var(--_se-active) var(--mono-mode-tint), var(--_mono-rte-popover-bg));\r\n --se-table-picker-highlight-border-color: var(--_se-active);\r\n\r\n --se-controller-background-color: var(--_mono-rte-popover-bg);\r\n --se-controller-color: var(--_mono-rte-popover-color);\r\n --se-controller-border-color: var(--_se-main-border);\r\n --se-shadow-controller: var(--_se-shadow-layer);\r\n --se-shadow-controller-color: transparent;\r\n --se-shadow-layer-color: transparent;\r\n --se-overlay-background-color: var(--mono-mode-backdrop, #000);\r\n\r\n --se-modal-preview-color: var(--_mono-rte-muted);\r\n --se-modal-file-input-background-color: var(--muted);\r\n --se-modal-input-disabled-color: var(--_mono-rte-muted);\r\n --se-modal-input-disabled-background-color: var(--muted);\r\n --se-input-btn-border-color: var(--_se-main-border);\r\n --se-input-btn-disabled-color: var(--_mono-rte-muted);\r\n --se-main-out-color: var(--_se-main-border);\r\n --se-hover-dark2-color: var(--_se-main-border);\r\n --se-hover-dark3-color: var(--_se-main-border);\r\n --se-loading-color: var(--_se-active);\r\n\r\n --se-drag-caret-color: var(--_se-active);\r\n --se-edit-active: var(--_se-active);\r\n --se-edit-hover: var(--_se-active-light);\r\n --se-edit-outline: var(--_se-main-border);\r\n --se-edit-font-pre: var(--_mono-rte-text);\r\n --se-edit-font-quote: var(--_mono-rte-muted);\r\n --se-edit-background-pre: var(--muted);\r\n --se-edit-border-light: var(--_se-main-border);\r\n --se-edit-border-dark: var(--_se-main-border);\r\n --se-edit-border-dark-n1: var(--_se-main-border);\r\n --se-edit-border-dark-n2: var(--_se-main-border);\r\n --se-edit-border-table: var(--_se-main-border);\r\n --se-edit-hr-color: var(--_se-main-border);\r\n --se-edit-hr-on-back: var(--_se-active-light);\r\n --se-edit-anchor-on-back: color-mix(in oklab, var(--_se-active) var(--mono-mode-tint), transparent);\r\n --se-edit-anchor-on-font: var(--_se-active);\r\n\r\n --se-success-dark-color: var(--_se-success);\r\n --se-success-dark2-color: var(--_se-success);\r\n --se-success-dark3-color: var(--_se-success);\r\n --se-success-light-color: color-mix(in oklab, var(--_se-success) var(--mono-mode-tint), transparent);\r\n --se-success-light2-color: color-mix(in oklab, var(--_se-success) var(--mono-mode-tint), transparent);\r\n --se-success-light3-color: color-mix(in oklab, var(--_se-success) var(--mono-mode-tint-hover), transparent);\r\n --se-success-light4-color: var(--_se-success);\r\n --se-success-light5-color: var(--_se-success);\r\n --se-error-dark-color: var(--_se-error);\r\n --se-error-dark2-color: var(--_se-error);\r\n --se-error-dark3-color: var(--_se-error);\r\n --se-error-light-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint-hover), transparent);\r\n --se-error-light2-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n --se-error-light3-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n --se-error-light4-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n --se-error-light5-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n}\r\n\r\n/* In the carrier \"main background\" is the LAYER surface — the dropdown lists,\r\n dialogs and alerts — so it is the popover surface there, not the editing\r\n surface (which is transparent in light mode: an invisible list). */\r\n.sun-editor.sun-editor-carrier-wrapper {\r\n --se-main-background-color: var(--_mono-rte-popover-bg);\r\n --se-main-font-color: var(--_mono-rte-popover-color);\r\n --se-dropdown-font-color: var(--_mono-rte-popover-color);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .select:not(select) [role='option'].active, .select:not(select) [role='option']:focus-visible — bg-muted text-foreground\r\n a checked list item (the current font, size, format …) is a selected option:\r\n SunEditor only re-inks it, and its ink was the primary tint */\r\n[mono-rte-mount] .sun-editor .se-list-inner li.se-checked > button,\r\n.sun-editor.sun-editor-carrier-wrapper .se-list-inner li.se-checked > button {\r\n background-color: var(--_se-active-light);\r\n color: var(--_se-active-ink);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > textarea, .textarea — placeholder:text-muted-foreground\r\n Every placeholder the editor shows — the Size / Font inputs in the toolbar,\r\n the empty editing area, a dialog's fields — is the field placeholder: the\r\n muted ink, OPAQUE. Left alone, a host page's preflight (Tailwind / UnoCSS)\r\n makes a placeholder 50% translucent currentColor, which over a tinted page\r\n reads as a colour of its own; and SunEditor inks its empty-area placeholder\r\n with its OUTLINE token, the accent. */\r\n[mono-rte-mount] .sun-editor input::placeholder,\r\n[mono-rte-mount] .sun-editor textarea::placeholder,\r\n.sun-editor.sun-editor-carrier-wrapper input::placeholder,\r\n.sun-editor.sun-editor-carrier-wrapper textarea::placeholder {\r\n color: var(--_mono-rte-placeholder);\r\n opacity: 1;\r\n}\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-placeholder,\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-placeholder-line:before {\r\n color: var(--_mono-rte-placeholder);\r\n}\r\n\r\n/* The frame replaces SunEditor's own — no double border, no second radius. */\r\n[mono-rte-mount] .sun-editor {\r\n border: 0;\r\n border-radius: 0;\r\n background: transparent;\r\n width: 100% !important;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — bg-foreground text-background inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs\r\n SunEditor's toolbar tooltips, painted as Basecoat's tooltip: it drew them in\r\n `--se-main-font-color` on `--se-main-background-color`, which in dark mode\r\n is a translucent wash under near-white text. (0,5,0) over SunEditor's (0,4,0). */\r\n[mono-rte-mount] .sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text,\r\n.sun-editor.sun-editor-carrier-wrapper .se-tooltip .se-tooltip-inner .se-tooltip-text {\r\n padding: calc(var(--mono-spacing) * 1.5) calc(var(--mono-spacing) * 3);\r\n border-radius: var(--_mono-rte-tooltip-radius);\r\n background-color: var(--_mono-rte-tooltip-bg);\r\n color: var(--_mono-rte-tooltip-color);\r\n /* the page font, handed over by the element: a tooltip inside the font list\r\n would otherwise inherit the item's own face */\r\n font-family: var(--_mono-rte-page-font, inherit);\r\n font-size: var(--mono-text-xs);\r\n line-height: var(--mono-text-xs--lh);\r\n font-weight: var(--mono-font-weight-normal);\r\n white-space: nowrap;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — the dropdown items (font family,\r\n font size, the colour palettes …) carried native `title` tooltips, which no theme can\r\n paint; the element rewrites them into `data-tooltip`, drawn here the way Basecoat\r\n draws its own: a pseudo-element with the attribute as content, above the item\r\n (the anchor is `position: relative`, as in Basecoat's compiled `[data-tooltip]`) */\r\n[mono-rte-mount] .sun-editor [data-tooltip],\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip] {\r\n position: relative;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — bg-foreground text-background inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs */\r\n[mono-rte-mount] .sun-editor [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip]::after {\r\n content: attr(data-tooltip);\r\n position: absolute;\r\n left: 50%;\r\n bottom: calc(100% + calc(var(--mono-spacing) * 1.5));\r\n z-index: 60;\r\n width: max-content;\r\n max-width: 20rem;\r\n padding: calc(var(--mono-spacing) * 1.5) calc(var(--mono-spacing) * 3);\r\n border-radius: var(--_mono-rte-tooltip-radius);\r\n background-color: var(--_mono-rte-tooltip-bg);\r\n color: var(--_mono-rte-tooltip-color);\r\n font-family: var(--_mono-rte-page-font, inherit);\r\n font-size: var(--mono-text-xs);\r\n line-height: var(--mono-text-xs--lh);\r\n font-weight: var(--mono-font-weight-normal);\r\n font-style: normal;\r\n text-indent: 0;\r\n text-transform: none;\r\n letter-spacing: normal;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n pointer-events: none;\r\n visibility: hidden;\r\n opacity: 0;\r\n transform: translateX(-50%) scale(0.95);\r\n transform-origin: bottom center;\r\n transition-property: opacity, transform, visibility;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration-fast, 100ms);\r\n}\r\n\r\n[mono-rte-mount] .sun-editor [data-tooltip]:hover::after,\r\n[mono-rte-mount] .sun-editor [data-tooltip]:focus-visible::after,\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip]:hover::after,\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip]:focus-visible::after {\r\n visibility: visible;\r\n opacity: 1;\r\n transform: translateX(-50%) scale(1);\r\n}\r\n\r\n/* a dropdown layer clips its own overflow, so a tooltip above the FIRST row of a\r\n palette would be cut off at the layer edge: that row opens its tooltips below */\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet:first-child [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet:first-child [data-tooltip]::after {\r\n bottom: auto;\r\n top: calc(100% + calc(var(--mono-spacing) * 1.5));\r\n transform-origin: top center;\r\n}\r\n\r\n/* SunEditor shrinks a hovered / active swatch with `transform: scale(.8)`. A\r\n transform makes the button a stacking context, so its tooltip — a child —\r\n can never rise above the swatches painted after it (the next row covers a\r\n first-row tooltip) and shrinks with it. The same \"pressed\" read as an inset\r\n ring of the layer surface instead; the hovered swatch lifts above its row. */\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet button:hover,\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet button.active,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet button:hover,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet button.active {\r\n transform: none;\r\n box-shadow: inset 0 0 0 3px var(--_mono-rte-popover-bg, var(--popover));\r\n}\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet button:hover,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet button:hover {\r\n z-index: 1;\r\n}\r\n\r\n/* …and the same clip sideways: a centred tooltip on the first / last column of\r\n a palette row runs past the layer's edge, so those hang from the item's own\r\n outer edge instead */\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:first-child [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:first-child [data-tooltip]::after {\r\n left: 0;\r\n transform: scale(0.95);\r\n transform-origin: left center;\r\n}\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:last-child [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:last-child [data-tooltip]::after {\r\n left: auto;\r\n right: 0;\r\n transform: scale(0.95);\r\n transform-origin: right center;\r\n}\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:hover::after,\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:focus-visible::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:hover::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:focus-visible::after {\r\n transform: scale(1);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip][data-arrow]::after — bg-foreground */\r\n[mono-rte-mount] .sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text:after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-tooltip .se-tooltip-inner .se-tooltip-text:after {\r\n border-color: transparent transparent var(--_mono-rte-tooltip-bg) transparent;\r\n}\r\n[mono-rte-mount] .sun-editor .se-toolbar.se-toolbar-bottom .se-tooltip .se-tooltip-inner .se-tooltip-text:after {\r\n border-color: var(--_mono-rte-tooltip-bg) transparent transparent transparent;\r\n}\r\n\r\n/* EXTENSION — the toolbar band, on a hairline */\r\n[mono-rte-mount] .sun-editor .se-toolbar {\r\n background: var(--_mono-rte-toolbar-bg);\r\n box-shadow: inset 0 calc(var(--mono-border-width) * -1) 0 0 var(--border);\r\n}\r\n\r\n/* The carrier — modals, alerts and the dropdown lists SunEditor parks on <body>\r\n — is in the token block and the delivery rule above: it paints exactly like\r\n the frame it belongs to, at the element's default `color` and `size`. */\r\n\r\n/* =========================================\r\n SunEditor's dialogs — the modal SunEditor parks in its carrier: its chrome\r\n is the page's dialog, its fields the ported input, its buttons the ported\r\n button, its tabs the ported tabs. Selectors mirror SunEditor's own chains\r\n (prefixed by the scope) so they out-weigh them by exactly the scope.\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .dialog > * — bg-popover text-popover-foreground */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-content {\r\n border: var(--mono-border-width) solid var(--_se-main-border);\r\n border-radius: var(--_mono-rte-popover-radius);\r\n box-shadow: var(--_mono-rte-popover-shadow);\r\n color: var(--_mono-rte-popover-color);\r\n}\r\n\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-header .se-modal-title {\r\n font-size: var(--mono-text-base);\r\n font-weight: var(--mono-font-weight-semibold);\r\n color: var(--_mono-rte-popover-color);\r\n}\r\n\r\n/* the close button: a ghost button, muted at rest */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-header .se-close-btn {\r\n color: var(--_mono-rte-muted);\r\n text-shadow: none;\r\n border-radius: var(--mono-radius-sm);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .tabs > [role='tablist'] — the modal's Image / Link tabs:\r\n a text tab with the accent under the active one, not a boxed strip */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs {\r\n /* SunEditor floats the tab buttons inside a 25px-high strip; as a flex row the\r\n strip is as tall as the tabs and stays in flow above the form */\r\n display: flex;\r\n align-items: stretch;\r\n gap: calc(var(--mono-spacing) * 1);\r\n height: auto;\r\n margin-bottom: calc(var(--mono-spacing) * 3);\r\n border-bottom: var(--mono-border-width) solid var(--_se-main-border);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs button {\r\n background-color: transparent;\r\n border: 0;\r\n border-bottom: 2px solid transparent;\r\n margin-bottom: calc(var(--mono-border-width) * -1);\r\n padding: calc(var(--mono-spacing) * 1.5) calc(var(--mono-spacing) * 3);\r\n color: var(--_mono-rte-muted);\r\n font-size: var(--mono-text-sm);\r\n font-weight: var(--mono-font-weight-medium);\r\n transition-property: color, border-color;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs button:hover {\r\n background-color: transparent;\r\n color: var(--_mono-rte-text);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs button.active {\r\n background-color: transparent;\r\n border-bottom-color: var(--_se-active);\r\n color: var(--_mono-rte-text);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .input-group — rounded-md border border-input\r\n the modal's text fields and selects are the ported input: its surface, edge,\r\n corner and ring, through the input's own public knobs */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-input-form,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-input-select,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form select,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-controller input[type='text'],\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-controller select {\r\n background-color: var(--mono-input-bg, var(--mono-input-surface, var(--mono-input-outline-bg, var(--mono-mode-surface))));\r\n border: var(--mono-border-width) solid var(--mono-input-rest-border, var(--mono-input-border-color, var(--mono-input-outline-border-color, var(--input))));\r\n border-radius: var(--mono-input-radius-sm, var(--mono-input-outline-radius, var(--mono-input-radius, var(--mono-radius-md))));\r\n color: var(--_mono-rte-text);\r\n box-shadow: var(--mono-input-outline-shadow, var(--mono-shadow-xs));\r\n font-size: var(--mono-text-sm);\r\n outline: none;\r\n transition-property: border-color, box-shadow;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-input-form:focus,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form select:focus {\r\n border-color: var(--_se-active);\r\n box-shadow: 0 0 0 var(--mono-ring-width) color-mix(in oklab, var(--_se-active) var(--mono-ring-alpha), transparent);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner input:disabled {\r\n opacity: 0.5;\r\n}\r\n\r\n/* the file drop area: a dashed muted panel */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-flex-input-wrapper > .se-input-form-abs {\r\n border-radius: var(--mono-input-radius-sm, var(--mono-input-outline-radius, var(--mono-input-radius, var(--mono-radius-md))));\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .btn — Submit is the primary button */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-content .se-btn-primary {\r\n background-color: var(--mono-button-bg, var(--primary));\r\n border: var(--mono-border-width) solid transparent;\r\n border-radius: var(--mono-button-sm-radius, var(--mono-button-radius, var(--mono-radius-md)));\r\n color: var(--mono-button-color, var(--primary-foreground));\r\n font-size: var(--mono-text-sm);\r\n font-weight: var(--mono-font-weight-medium);\r\n box-shadow: var(--mono-shadow-xs);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary:hover,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary:focus {\r\n background-color: color-mix(in oklab, var(--mono-button-bg, var(--primary)) 90%, transparent);\r\n border-color: transparent;\r\n color: var(--mono-button-color, var(--primary-foreground));\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary:disabled {\r\n opacity: 0.5;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .btn[data-variant='outline'] — the modal's secondary buttons */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-btn-revert,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-modal-form-files .se-modal-files-edge-button,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-modal-flex-form .se-btn {\r\n border: var(--mono-border-width) solid var(--input);\r\n border-radius: var(--mono-button-sm-radius, var(--mono-button-radius, var(--mono-radius-md)));\r\n background-color: var(--background);\r\n color: var(--_mono-rte-text);\r\n opacity: 1;\r\n}\r\n\r\n/* the native checkboxes and radios take the accent */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) input[type='checkbox'],\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) input[type='radio'] {\r\n accent-color: var(--_se-active);\r\n}\r\n\r\n/* the floating controllers (link / image / table) are popovers */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-controller {\r\n border-radius: var(--_mono-rte-popover-radius);\r\n}\r\n\r\n/* Full screen — SunEditor fixes its root over the page (inline style, no class of\r\n its own; the element marks the mount when SunEditor reports the toggle, and the\r\n inline style is the fallback). The frame stays behind, so the editor takes the\r\n PAGE surface itself: opaque, in the mode's colours, the toolbar band on top. */\r\n[mono-rte-mount][mono-fullscreen] .sun-editor,\r\n[mono-rte-mount] .sun-editor[style*=\"position: fixed\"] {\r\n --_se-main-background: var(--mono-rich-text-editor-fullscreen-bg, var(--background));\r\n --_mono-rte-toolbar-bg: var(--mono-rich-text-editor-toolbar-bg, color-mix(in oklab, var(--muted) 60%, var(--mono-rich-text-editor-fullscreen-bg, var(--background))));\r\n background: var(--mono-rich-text-editor-fullscreen-bg, var(--background));\r\n color: var(--_mono-rte-text);\r\n}\r\n\r\n/* code view: the page's mono face on the editing surface, the line column muted */\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-code-viewer,\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-code-wrapper .se-code-view-line {\r\n font-family: var(--font-mono, ui-monospace, monospace);\r\n font-size: var(--mono-text-sm);\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n :where([mono-rich-text-editor]) [mono-rte-field] {\r\n transition: none;\r\n }\r\n}\r\n";
|
|
1281
|
+
//#endregion
|
|
1282
|
+
//#region src/components/rich-text-editor/mono-rich-text-editor.ts
|
|
1283
|
+
var MonoRichTextEditor = class MonoRichTextEditor extends MonoRichTextEditorCore(LitElement) {
|
|
1284
|
+
constructor(..._args) {
|
|
1285
|
+
super(..._args);
|
|
1286
|
+
this._slotsCaptured = false;
|
|
1287
|
+
this._slotLabel = [];
|
|
1288
|
+
this._slotHelper = [];
|
|
1289
|
+
}
|
|
1290
|
+
static {
|
|
1291
|
+
this.styles = [unsafeCSS(rich_text_editor_default)];
|
|
1292
|
+
}
|
|
1293
|
+
createRenderRoot() {
|
|
1294
|
+
return this;
|
|
1295
|
+
}
|
|
1296
|
+
connectedCallback() {
|
|
1297
|
+
this._captureSlots();
|
|
1298
|
+
super.connectedCallback();
|
|
1299
|
+
if (this.isConnected) this.performUpdate();
|
|
1300
|
+
}
|
|
1301
|
+
updated(changed) {
|
|
1302
|
+
super.updated(changed);
|
|
1303
|
+
this._placeSlot("label", this._slotLabel);
|
|
1304
|
+
this._placeSlot("helper", this._slotHelper);
|
|
1305
|
+
}
|
|
1306
|
+
_captureSlots() {
|
|
1307
|
+
if (this._slotsCaptured) return;
|
|
1308
|
+
this._slotsCaptured = true;
|
|
1309
|
+
const captured = monoHostChildNodes(this);
|
|
1310
|
+
const capturedSlotNodes = /* @__PURE__ */ new Set();
|
|
1311
|
+
for (const node of captured) {
|
|
1312
|
+
if (!(node instanceof Element)) continue;
|
|
1313
|
+
const slotName = node.getAttribute("slot");
|
|
1314
|
+
if (slotName === "label") {
|
|
1315
|
+
node.removeAttribute("slot");
|
|
1316
|
+
this._slotLabel.push(node);
|
|
1317
|
+
capturedSlotNodes.add(node);
|
|
1318
|
+
}
|
|
1319
|
+
if (slotName === "helper") {
|
|
1320
|
+
node.removeAttribute("slot");
|
|
1321
|
+
this._slotHelper.push(node);
|
|
1322
|
+
capturedSlotNodes.add(node);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
this._hasLabelSlotState = this._slotLabel.length > 0;
|
|
1326
|
+
this._hasHelperSlotState = this._slotHelper.length > 0;
|
|
1327
|
+
for (const node of capturedSlotNodes) if (node.parentNode === this) this.removeChild(node);
|
|
1328
|
+
}
|
|
1329
|
+
_placeSlot(name, nodes) {
|
|
1330
|
+
if (!nodes.length) return;
|
|
1331
|
+
const target = this.querySelector(`[data-mono-slot="${name}"]`);
|
|
1332
|
+
if (!target) return;
|
|
1333
|
+
for (const node of nodes) placeSlotNode(target, node);
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
MonoRichTextEditor = __decorate([customElement("mono-rich-text-editor")], MonoRichTextEditor);
|
|
1337
|
+
//#endregion
|
|
1338
|
+
export { AUTO_EXCLUDED_PLUGINS, MonoRichTextEditor, SUNEDITOR_CORE_BUTTONS, SUNEDITOR_LANG_CODES, TOOLBAR_BASIC, TOOLBAR_DEFAULT, TOOLBAR_FULL, TOOLBAR_PRESETS, TOOLBAR_STANDARD, loadSunEditor, loadSunEditorCss, loadSunEditorLang, loadSunEditorPlugins, pruneToolbar, resolvePlugins, resolveToolbar };
|