@wirabyte/ui 0.0.0-stage → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +74 -2
- package/accordion/accordion.component.d.ts +126 -0
- package/accordion/accordion.module.d.ts +9 -0
- package/accordion/accordion.types.d.ts +10 -0
- package/accordion/index.d.ts +5 -0
- package/accordion/public-api.d.ts +3 -0
- package/alert/alert-dialog.base.d.ts +79 -0
- package/alert/alert-dialog.component.d.ts +8 -0
- package/alert/alert.module.d.ts +8 -0
- package/alert/alert.service.d.ts +76 -0
- package/alert/alert.types.d.ts +87 -0
- package/alert/index.d.ts +5 -0
- package/alert/public-api.d.ts +5 -0
- package/animate/animate.directive.d.ts +34 -0
- package/animate/animate.module.d.ts +11 -0
- package/animate/animate.service.d.ts +36 -0
- package/animate/animate.styles.d.ts +2 -0
- package/animate/animate.types.d.ts +20 -0
- package/animate/index.d.ts +5 -0
- package/animate/public-api.d.ts +4 -0
- package/api/index.d.ts +5 -0
- package/api/public-api.d.ts +15 -0
- package/api/shared.module.d.ts +8 -0
- package/asidemenu/asidemenu.component.d.ts +221 -0
- package/asidemenu/asidemenu.module.d.ts +9 -0
- package/asidemenu/index.d.ts +5 -0
- package/asidemenu/public-api.d.ts +2 -0
- package/autocomplete/autocomplete.base.d.ts +181 -0
- package/autocomplete/autocomplete.component.d.ts +10 -0
- package/autocomplete/autocomplete.module.d.ts +9 -0
- package/autocomplete/autocomplete.types.d.ts +10 -0
- package/autocomplete/index.d.ts +5 -0
- package/autocomplete/public-api.d.ts +4 -0
- package/avatar/avatar.component.d.ts +38 -0
- package/avatar/avatar.module.d.ts +8 -0
- package/avatar/avatar.types.d.ts +2 -0
- package/avatar/index.d.ts +5 -0
- package/avatar/public-api.d.ts +3 -0
- package/badge/badge.component.d.ts +20 -0
- package/badge/badge.directive.d.ts +32 -0
- package/badge/badge.module.d.ts +9 -0
- package/badge/badge.styles.d.ts +2 -0
- package/badge/badge.types.d.ts +3 -0
- package/badge/index.d.ts +5 -0
- package/badge/public-api.d.ts +4 -0
- package/blockui/blockui.component.d.ts +41 -0
- package/blockui/blockui.module.d.ts +8 -0
- package/blockui/index.d.ts +5 -0
- package/blockui/public-api.d.ts +2 -0
- package/bottombar/bottombar.component.d.ts +79 -0
- package/bottombar/bottombar.module.d.ts +9 -0
- package/bottombar/index.d.ts +5 -0
- package/bottombar/public-api.d.ts +2 -0
- package/breadcrumb/breadcrumb.component.d.ts +41 -0
- package/breadcrumb/breadcrumb.module.d.ts +8 -0
- package/breadcrumb/index.d.ts +5 -0
- package/breadcrumb/public-api.d.ts +2 -0
- package/button/button-class.d.ts +8 -0
- package/button/button.component.d.ts +69 -0
- package/button/button.directive.d.ts +53 -0
- package/button/button.module.d.ts +9 -0
- package/button/button.styles.d.ts +2 -0
- package/button/button.types.d.ts +8 -0
- package/button/index.d.ts +5 -0
- package/button/public-api.d.ts +7 -0
- package/card/card-slots.d.ts +11 -0
- package/card/card.component.d.ts +41 -0
- package/card/card.module.d.ts +10 -0
- package/card/card.types.d.ts +5 -0
- package/card/index.d.ts +5 -0
- package/card/public-api.d.ts +4 -0
- package/carousel/carousel.component.d.ts +169 -0
- package/carousel/carousel.module.d.ts +10 -0
- package/carousel/carousel.types.d.ts +21 -0
- package/carousel/index.d.ts +5 -0
- package/carousel/public-api.d.ts +3 -0
- package/chart/chart.component.d.ts +11 -0
- package/chart/chart.module.d.ts +8 -0
- package/chart/index.d.ts +5 -0
- package/chart/public-api.d.ts +3 -0
- package/chartjs/chartjs.base.d.ts +70 -0
- package/chartjs/chartjs.component.d.ts +10 -0
- package/chartjs/chartjs.module.d.ts +8 -0
- package/chartjs/chartjs.types.d.ts +8 -0
- package/chartjs/index.d.ts +5 -0
- package/chartjs/public-api.d.ts +4 -0
- package/checkbox/checkbox.component.d.ts +59 -0
- package/checkbox/checkbox.module.d.ts +8 -0
- package/checkbox/checkbox.styles.d.ts +2 -0
- package/checkbox/checkbox.types.d.ts +4 -0
- package/checkbox/index.d.ts +5 -0
- package/checkbox/public-api.d.ts +5 -0
- package/chip/chip.component.d.ts +36 -0
- package/chip/chip.module.d.ts +8 -0
- package/chip/index.d.ts +5 -0
- package/chip/public-api.d.ts +2 -0
- package/colorpicker/colorpicker.component.d.ts +87 -0
- package/colorpicker/colorpicker.module.d.ts +8 -0
- package/colorpicker/index.d.ts +5 -0
- package/colorpicker/public-api.d.ts +2 -0
- package/config/forms.d.ts +17 -0
- package/config/index.d.ts +5 -0
- package/config/initializer.d.ts +3 -0
- package/config/menu-item.d.ts +52 -0
- package/config/options.d.ts +48 -0
- package/config/popup.d.ts +48 -0
- package/config/provide.d.ts +23 -0
- package/config/public-api.d.ts +17 -0
- package/config/ripple.d.ts +2 -0
- package/config/scroll-lock.d.ts +5 -0
- package/config/severity.d.ts +5 -0
- package/config/style-loader.d.ts +12 -0
- package/config/template.d.ts +19 -0
- package/config/theme.service.d.ts +46 -0
- package/config/version-guard.d.ts +14 -0
- package/config/version.d.ts +6 -0
- package/config/wu-config.service.d.ts +24 -0
- package/confirmdialog/confirmation.service.d.ts +25 -0
- package/confirmdialog/confirmdialog.base.d.ts +110 -0
- package/confirmdialog/confirmdialog.component.d.ts +11 -0
- package/confirmdialog/confirmdialog.module.d.ts +9 -0
- package/confirmdialog/confirmdialog.types.d.ts +37 -0
- package/confirmdialog/index.d.ts +5 -0
- package/confirmdialog/public-api.d.ts +5 -0
- package/contextmenu/contextmenu.component.d.ts +47 -0
- package/contextmenu/contextmenu.module.d.ts +8 -0
- package/contextmenu/index.d.ts +5 -0
- package/contextmenu/public-api.d.ts +2 -0
- package/core/carousel.d.ts +27 -0
- package/core/catalog.d.ts +446 -0
- package/core/chart/format.d.ts +19 -0
- package/core/chart/index.d.ts +6 -0
- package/core/chart/kinds.d.ts +78 -0
- package/core/chart/model.d.ts +500 -0
- package/core/chart/more.d.ts +33 -0
- package/core/chart/paths.d.ts +41 -0
- package/core/chart/scale.d.ts +22 -0
- package/core/color.d.ts +31 -0
- package/core/colorpicker.d.ts +23 -0
- package/core/compat.d.ts +11 -0
- package/core/config.d.ts +64 -0
- package/core/date.d.ts +130 -0
- package/core/datepicker.d.ts +184 -0
- package/core/dock.d.ts +6 -0
- package/core/editor.d.ts +117 -0
- package/core/errorpage.d.ts +15 -0
- package/core/excel.d.ts +239 -0
- package/core/exporters.d.ts +18 -0
- package/core/families.d.ts +13 -0
- package/core/fileupload.d.ts +24 -0
- package/core/flow/changes.d.ts +63 -0
- package/core/flow/edges.d.ts +52 -0
- package/core/flow/export.d.ts +56 -0
- package/core/flow/geometry.d.ts +117 -0
- package/core/flow/graph.d.ts +104 -0
- package/core/flow/history.d.ts +54 -0
- package/core/flow/index.d.ts +13 -0
- package/core/flow/interaction.d.ts +140 -0
- package/core/flow/layout.d.ts +57 -0
- package/core/flow/paths.d.ts +76 -0
- package/core/flow/text.d.ts +18 -0
- package/core/flow/types.d.ts +217 -0
- package/core/flow/viewport.d.ts +48 -0
- package/core/i18n.d.ts +24 -0
- package/core/imagecompare.d.ts +12 -0
- package/core/imagecropper.d.ts +183 -0
- package/core/index.d.ts +39 -0
- package/core/inputotp.d.ts +20 -0
- package/core/knob.d.ts +28 -0
- package/core/mask.d.ts +43 -0
- package/core/menu.d.ts +29 -0
- package/core/number.d.ts +66 -0
- package/core/organizationchart.d.ts +39 -0
- package/core/overrides.d.ts +109 -0
- package/core/picklist.d.ts +81 -0
- package/core/select.d.ts +44 -0
- package/core/splitter.d.ts +17 -0
- package/core/table.d.ts +48 -0
- package/core/terminal.d.ts +12 -0
- package/core/thai/buddhist.d.ts +22 -0
- package/core/thai/locale.d.ts +358 -0
- package/core/thai/text.d.ts +32 -0
- package/core/thai/thai-id.d.ts +6 -0
- package/core/tokens.d.ts +69 -0
- package/core/tree.d.ts +50 -0
- package/core/validation.d.ts +18 -0
- package/datepicker/datepicker.component.d.ts +275 -0
- package/datepicker/datepicker.module.d.ts +8 -0
- package/datepicker/datepicker.types.d.ts +10 -0
- package/datepicker/index.d.ts +5 -0
- package/datepicker/public-api.d.ts +3 -0
- package/dialog/dialog.base.d.ts +147 -0
- package/dialog/dialog.component.d.ts +11 -0
- package/dialog/dialog.module.d.ts +10 -0
- package/dialog/dialog.service.d.ts +104 -0
- package/dialog/dialog.types.d.ts +3 -0
- package/dialog/index.d.ts +5 -0
- package/dialog/public-api.d.ts +5 -0
- package/divider/divider.component.d.ts +20 -0
- package/divider/divider.module.d.ts +8 -0
- package/divider/divider.types.d.ts +4 -0
- package/divider/index.d.ts +5 -0
- package/divider/public-api.d.ts +3 -0
- package/dock/dock.component.d.ts +88 -0
- package/dock/dock.module.d.ts +9 -0
- package/dock/index.d.ts +5 -0
- package/dock/public-api.d.ts +2 -0
- package/dragdrop/dragdrop.directive.d.ts +65 -0
- package/dragdrop/dragdrop.module.d.ts +8 -0
- package/dragdrop/dragdrop.styles.d.ts +2 -0
- package/dragdrop/index.d.ts +5 -0
- package/dragdrop/public-api.d.ts +2 -0
- package/drawer/drawer.component.d.ts +102 -0
- package/drawer/drawer.module.d.ts +8 -0
- package/drawer/index.d.ts +5 -0
- package/drawer/public-api.d.ts +5 -0
- package/editor/editor-content.directive.d.ts +10 -0
- package/editor/editor-icon.directive.d.ts +8 -0
- package/editor/editor.base.d.ts +367 -0
- package/editor/editor.component.d.ts +11 -0
- package/editor/editor.dom.d.ts +91 -0
- package/editor/editor.icons.d.ts +13 -0
- package/editor/editor.module.d.ts +10 -0
- package/editor/editor.styles.d.ts +2 -0
- package/editor/editor.types.d.ts +92 -0
- package/editor/index.d.ts +5 -0
- package/editor/public-api.d.ts +6 -0
- package/emptystate/emptystate.component.d.ts +44 -0
- package/emptystate/emptystate.module.d.ts +8 -0
- package/emptystate/index.d.ts +5 -0
- package/emptystate/public-api.d.ts +2 -0
- package/errorpage/errorpage.component.d.ts +73 -0
- package/errorpage/errorpage.module.d.ts +8 -0
- package/errorpage/index.d.ts +5 -0
- package/errorpage/public-api.d.ts +2 -0
- package/esm2020/accordion/accordion.component.mjs +376 -0
- package/esm2020/accordion/accordion.module.mjs +19 -0
- package/esm2020/accordion/accordion.types.mjs +17 -0
- package/esm2020/accordion/public-api.mjs +4 -0
- package/esm2020/accordion/wirabyte-ui-accordion.mjs +5 -0
- package/esm2020/alert/alert-dialog.base.mjs +355 -0
- package/esm2020/alert/alert-dialog.component.mjs +21 -0
- package/esm2020/alert/alert.module.mjs +17 -0
- package/esm2020/alert/alert.service.mjs +142 -0
- package/esm2020/alert/alert.types.mjs +2 -0
- package/esm2020/alert/public-api.mjs +6 -0
- package/esm2020/alert/wirabyte-ui-alert.mjs +5 -0
- package/esm2020/animate/animate.directive.mjs +71 -0
- package/esm2020/animate/animate.module.mjs +21 -0
- package/esm2020/animate/animate.service.mjs +183 -0
- package/esm2020/animate/animate.styles.mjs +3 -0
- package/esm2020/animate/animate.types.mjs +2 -0
- package/esm2020/animate/public-api.mjs +5 -0
- package/esm2020/animate/wirabyte-ui-animate.mjs +5 -0
- package/esm2020/api/public-api.mjs +11 -0
- package/esm2020/api/shared.module.mjs +17 -0
- package/esm2020/api/wirabyte-ui-api.mjs +5 -0
- package/esm2020/asidemenu/asidemenu.component.mjs +811 -0
- package/esm2020/asidemenu/asidemenu.module.mjs +18 -0
- package/esm2020/asidemenu/public-api.mjs +3 -0
- package/esm2020/asidemenu/wirabyte-ui-asidemenu.mjs +5 -0
- package/esm2020/autocomplete/autocomplete.base.mjs +567 -0
- package/esm2020/autocomplete/autocomplete.component.mjs +24 -0
- package/esm2020/autocomplete/autocomplete.module.mjs +18 -0
- package/esm2020/autocomplete/autocomplete.types.mjs +2 -0
- package/esm2020/autocomplete/public-api.mjs +5 -0
- package/esm2020/autocomplete/wirabyte-ui-autocomplete.mjs +5 -0
- package/esm2020/avatar/avatar.component.mjs +81 -0
- package/esm2020/avatar/avatar.module.mjs +17 -0
- package/esm2020/avatar/avatar.types.mjs +2 -0
- package/esm2020/avatar/public-api.mjs +4 -0
- package/esm2020/avatar/wirabyte-ui-avatar.mjs +5 -0
- package/esm2020/badge/badge.component.mjs +52 -0
- package/esm2020/badge/badge.directive.mjs +111 -0
- package/esm2020/badge/badge.module.mjs +18 -0
- package/esm2020/badge/badge.styles.mjs +3 -0
- package/esm2020/badge/badge.types.mjs +2 -0
- package/esm2020/badge/public-api.mjs +5 -0
- package/esm2020/badge/wirabyte-ui-badge.mjs +5 -0
- package/esm2020/blockui/blockui.component.mjs +152 -0
- package/esm2020/blockui/blockui.module.mjs +17 -0
- package/esm2020/blockui/public-api.mjs +3 -0
- package/esm2020/blockui/wirabyte-ui-blockui.mjs +5 -0
- package/esm2020/bottombar/bottombar.component.mjs +209 -0
- package/esm2020/bottombar/bottombar.module.mjs +18 -0
- package/esm2020/bottombar/public-api.mjs +3 -0
- package/esm2020/bottombar/wirabyte-ui-bottombar.mjs +5 -0
- package/esm2020/breadcrumb/breadcrumb.component.mjs +86 -0
- package/esm2020/breadcrumb/breadcrumb.module.mjs +17 -0
- package/esm2020/breadcrumb/public-api.mjs +3 -0
- package/esm2020/breadcrumb/wirabyte-ui-breadcrumb.mjs +5 -0
- package/esm2020/button/button-class.mjs +26 -0
- package/esm2020/button/button.component.mjs +175 -0
- package/esm2020/button/button.directive.mjs +193 -0
- package/esm2020/button/button.module.mjs +18 -0
- package/esm2020/button/button.styles.mjs +3 -0
- package/esm2020/button/button.types.mjs +2 -0
- package/esm2020/button/public-api.mjs +8 -0
- package/esm2020/button/wirabyte-ui-button.mjs +5 -0
- package/esm2020/card/card-slots.mjs +27 -0
- package/esm2020/card/card.component.mjs +88 -0
- package/esm2020/card/card.module.mjs +19 -0
- package/esm2020/card/card.types.mjs +2 -0
- package/esm2020/card/public-api.mjs +5 -0
- package/esm2020/card/wirabyte-ui-card.mjs +5 -0
- package/esm2020/carousel/carousel.component.mjs +617 -0
- package/esm2020/carousel/carousel.module.mjs +19 -0
- package/esm2020/carousel/carousel.types.mjs +2 -0
- package/esm2020/carousel/public-api.mjs +4 -0
- package/esm2020/carousel/wirabyte-ui-carousel.mjs +5 -0
- package/esm2020/chart/chart.component.mjs +42 -0
- package/esm2020/chart/chart.module.mjs +17 -0
- package/esm2020/chart/public-api.mjs +3 -0
- package/esm2020/chart/wirabyte-ui-chart.mjs +5 -0
- package/esm2020/chartjs/chartjs.base.mjs +204 -0
- package/esm2020/chartjs/chartjs.component.mjs +41 -0
- package/esm2020/chartjs/chartjs.module.mjs +17 -0
- package/esm2020/chartjs/chartjs.types.mjs +2 -0
- package/esm2020/chartjs/public-api.mjs +5 -0
- package/esm2020/chartjs/wirabyte-ui-chartjs.mjs +5 -0
- package/esm2020/checkbox/checkbox.component.mjs +140 -0
- package/esm2020/checkbox/checkbox.module.mjs +17 -0
- package/esm2020/checkbox/checkbox.styles.mjs +3 -0
- package/esm2020/checkbox/checkbox.types.mjs +2 -0
- package/esm2020/checkbox/public-api.mjs +6 -0
- package/esm2020/checkbox/wirabyte-ui-checkbox.mjs +5 -0
- package/esm2020/chip/chip.component.mjs +76 -0
- package/esm2020/chip/chip.module.mjs +17 -0
- package/esm2020/chip/public-api.mjs +3 -0
- package/esm2020/chip/wirabyte-ui-chip.mjs +5 -0
- package/esm2020/colorpicker/colorpicker.component.mjs +308 -0
- package/esm2020/colorpicker/colorpicker.module.mjs +17 -0
- package/esm2020/colorpicker/public-api.mjs +3 -0
- package/esm2020/colorpicker/wirabyte-ui-colorpicker.mjs +5 -0
- package/esm2020/config/forms.mjs +38 -0
- package/esm2020/config/initializer.mjs +6 -0
- package/esm2020/config/menu-item.mjs +2 -0
- package/esm2020/config/options.mjs +3 -0
- package/esm2020/config/popup.mjs +153 -0
- package/esm2020/config/provide.mjs +45 -0
- package/esm2020/config/public-api.mjs +17 -0
- package/esm2020/config/ripple.mjs +13 -0
- package/esm2020/config/scroll-lock.mjs +31 -0
- package/esm2020/config/severity.mjs +9 -0
- package/esm2020/config/style-loader.mjs +32 -0
- package/esm2020/config/template.mjs +46 -0
- package/esm2020/config/theme.service.mjs +161 -0
- package/esm2020/config/version-guard.mjs +43 -0
- package/esm2020/config/version.mjs +3 -0
- package/esm2020/config/wirabyte-ui-config.mjs +5 -0
- package/esm2020/config/wu-config.service.mjs +50 -0
- package/esm2020/confirmdialog/confirmation.service.mjs +78 -0
- package/esm2020/confirmdialog/confirmdialog.base.mjs +274 -0
- package/esm2020/confirmdialog/confirmdialog.component.mjs +22 -0
- package/esm2020/confirmdialog/confirmdialog.module.mjs +18 -0
- package/esm2020/confirmdialog/confirmdialog.types.mjs +8 -0
- package/esm2020/confirmdialog/public-api.mjs +6 -0
- package/esm2020/confirmdialog/wirabyte-ui-confirmdialog.mjs +5 -0
- package/esm2020/contextmenu/contextmenu.component.mjs +159 -0
- package/esm2020/contextmenu/contextmenu.module.mjs +17 -0
- package/esm2020/contextmenu/public-api.mjs +3 -0
- package/esm2020/contextmenu/wirabyte-ui-contextmenu.mjs +5 -0
- package/esm2020/core/carousel.mjs +62 -0
- package/esm2020/core/catalog.mjs +203 -0
- package/esm2020/core/chart/format.mjs +66 -0
- package/esm2020/core/chart/index.mjs +7 -0
- package/esm2020/core/chart/kinds.mjs +1336 -0
- package/esm2020/core/chart/model.mjs +713 -0
- package/esm2020/core/chart/more.mjs +311 -0
- package/esm2020/core/chart/paths.mjs +160 -0
- package/esm2020/core/chart/scale.mjs +58 -0
- package/esm2020/core/color.mjs +94 -0
- package/esm2020/core/colorpicker.mjs +73 -0
- package/esm2020/core/compat.mjs +149 -0
- package/esm2020/core/config.mjs +163 -0
- package/esm2020/core/date.mjs +317 -0
- package/esm2020/core/datepicker.mjs +526 -0
- package/esm2020/core/dock.mjs +14 -0
- package/esm2020/core/editor.mjs +271 -0
- package/esm2020/core/errorpage.mjs +47 -0
- package/esm2020/core/excel.mjs +809 -0
- package/esm2020/core/exporters.mjs +241 -0
- package/esm2020/core/families.mjs +1756 -0
- package/esm2020/core/fileupload.mjs +48 -0
- package/esm2020/core/flow/changes.mjs +205 -0
- package/esm2020/core/flow/edges.mjs +87 -0
- package/esm2020/core/flow/export.mjs +231 -0
- package/esm2020/core/flow/geometry.mjs +309 -0
- package/esm2020/core/flow/graph.mjs +314 -0
- package/esm2020/core/flow/history.mjs +105 -0
- package/esm2020/core/flow/index.mjs +14 -0
- package/esm2020/core/flow/interaction.mjs +246 -0
- package/esm2020/core/flow/layout.mjs +586 -0
- package/esm2020/core/flow/paths.mjs +252 -0
- package/esm2020/core/flow/text.mjs +68 -0
- package/esm2020/core/flow/types.mjs +7 -0
- package/esm2020/core/flow/viewport.mjs +133 -0
- package/esm2020/core/i18n.mjs +78 -0
- package/esm2020/core/imagecompare.mjs +28 -0
- package/esm2020/core/imagecropper.mjs +483 -0
- package/esm2020/core/index.mjs +40 -0
- package/esm2020/core/inputotp.mjs +50 -0
- package/esm2020/core/knob.mjs +106 -0
- package/esm2020/core/mask.mjs +112 -0
- package/esm2020/core/menu.mjs +77 -0
- package/esm2020/core/number.mjs +131 -0
- package/esm2020/core/organizationchart.mjs +84 -0
- package/esm2020/core/overrides.mjs +169 -0
- package/esm2020/core/picklist.mjs +248 -0
- package/esm2020/core/select.mjs +161 -0
- package/esm2020/core/splitter.mjs +63 -0
- package/esm2020/core/table.mjs +174 -0
- package/esm2020/core/terminal.mjs +29 -0
- package/esm2020/core/thai/buddhist.mjs +129 -0
- package/esm2020/core/thai/locale.mjs +652 -0
- package/esm2020/core/thai/text.mjs +164 -0
- package/esm2020/core/thai/thai-id.mjs +22 -0
- package/esm2020/core/tokens.mjs +314 -0
- package/esm2020/core/tree.mjs +137 -0
- package/esm2020/core/validation.mjs +43 -0
- package/esm2020/core/wirabyte-ui-core.mjs +5 -0
- package/esm2020/datepicker/datepicker.component.mjs +921 -0
- package/esm2020/datepicker/datepicker.module.mjs +17 -0
- package/esm2020/datepicker/datepicker.types.mjs +2 -0
- package/esm2020/datepicker/public-api.mjs +4 -0
- package/esm2020/datepicker/wirabyte-ui-datepicker.mjs +5 -0
- package/esm2020/dialog/dialog.base.mjs +433 -0
- package/esm2020/dialog/dialog.component.mjs +18 -0
- package/esm2020/dialog/dialog.module.mjs +19 -0
- package/esm2020/dialog/dialog.service.mjs +237 -0
- package/esm2020/dialog/dialog.types.mjs +2 -0
- package/esm2020/dialog/public-api.mjs +6 -0
- package/esm2020/dialog/wirabyte-ui-dialog.mjs +5 -0
- package/esm2020/divider/divider.component.mjs +56 -0
- package/esm2020/divider/divider.module.mjs +17 -0
- package/esm2020/divider/divider.types.mjs +2 -0
- package/esm2020/divider/public-api.mjs +4 -0
- package/esm2020/divider/wirabyte-ui-divider.mjs +5 -0
- package/esm2020/dock/dock.component.mjs +287 -0
- package/esm2020/dock/dock.module.mjs +18 -0
- package/esm2020/dock/public-api.mjs +3 -0
- package/esm2020/dock/wirabyte-ui-dock.mjs +5 -0
- package/esm2020/dragdrop/dragdrop.directive.mjs +206 -0
- package/esm2020/dragdrop/dragdrop.module.mjs +17 -0
- package/esm2020/dragdrop/dragdrop.styles.mjs +3 -0
- package/esm2020/dragdrop/public-api.mjs +3 -0
- package/esm2020/dragdrop/wirabyte-ui-dragdrop.mjs +5 -0
- package/esm2020/drawer/drawer.component.mjs +300 -0
- package/esm2020/drawer/drawer.module.mjs +17 -0
- package/esm2020/drawer/public-api.mjs +6 -0
- package/esm2020/drawer/wirabyte-ui-drawer.mjs +5 -0
- package/esm2020/editor/editor-content.directive.mjs +24 -0
- package/esm2020/editor/editor-icon.directive.mjs +24 -0
- package/esm2020/editor/editor.base.mjs +2082 -0
- package/esm2020/editor/editor.component.mjs +20 -0
- package/esm2020/editor/editor.dom.mjs +787 -0
- package/esm2020/editor/editor.icons.mjs +106 -0
- package/esm2020/editor/editor.module.mjs +19 -0
- package/esm2020/editor/editor.styles.mjs +3 -0
- package/esm2020/editor/editor.types.mjs +6 -0
- package/esm2020/editor/public-api.mjs +7 -0
- package/esm2020/editor/wirabyte-ui-editor.mjs +5 -0
- package/esm2020/emptystate/emptystate.component.mjs +78 -0
- package/esm2020/emptystate/emptystate.module.mjs +17 -0
- package/esm2020/emptystate/public-api.mjs +3 -0
- package/esm2020/emptystate/wirabyte-ui-emptystate.mjs +5 -0
- package/esm2020/errorpage/errorpage.component.mjs +163 -0
- package/esm2020/errorpage/errorpage.module.mjs +17 -0
- package/esm2020/errorpage/public-api.mjs +3 -0
- package/esm2020/errorpage/wirabyte-ui-errorpage.mjs +5 -0
- package/esm2020/excel/excel.mjs +35 -0
- package/esm2020/excel/public-api.mjs +3 -0
- package/esm2020/excel/wirabyte-ui-excel.mjs +5 -0
- package/esm2020/fieldset/fieldset.component.mjs +74 -0
- package/esm2020/fieldset/fieldset.module.mjs +18 -0
- package/esm2020/fieldset/public-api.mjs +3 -0
- package/esm2020/fieldset/wirabyte-ui-fieldset.mjs +5 -0
- package/esm2020/fileupload/fileupload.base.mjs +563 -0
- package/esm2020/fileupload/fileupload.component.mjs +19 -0
- package/esm2020/fileupload/fileupload.module.mjs +18 -0
- package/esm2020/fileupload/fileupload.types.mjs +2 -0
- package/esm2020/fileupload/public-api.mjs +5 -0
- package/esm2020/fileupload/wirabyte-ui-fileupload.mjs +5 -0
- package/esm2020/floatlabel/floatlabel.component.mjs +53 -0
- package/esm2020/floatlabel/floatlabel.module.mjs +17 -0
- package/esm2020/floatlabel/floatlabel.types.mjs +2 -0
- package/esm2020/floatlabel/public-api.mjs +4 -0
- package/esm2020/floatlabel/wirabyte-ui-floatlabel.mjs +5 -0
- package/esm2020/flow/flow-background.component.mjs +183 -0
- package/esm2020/flow/flow-controls.component.mjs +267 -0
- package/esm2020/flow/flow-handle.component.mjs +130 -0
- package/esm2020/flow/flow-history.directive.mjs +129 -0
- package/esm2020/flow/flow-host.mjs +7 -0
- package/esm2020/flow/flow-minimap.component.mjs +322 -0
- package/esm2020/flow/flow-node-outlet.mjs +148 -0
- package/esm2020/flow/flow-node-resizer.component.mjs +208 -0
- package/esm2020/flow/flow-node-toolbar.component.mjs +119 -0
- package/esm2020/flow/flow-panel.component.mjs +37 -0
- package/esm2020/flow/flow-templates.mjs +100 -0
- package/esm2020/flow/flow.component.mjs +3245 -0
- package/esm2020/flow/flow.module.mjs +76 -0
- package/esm2020/flow/flow.types.mjs +7 -0
- package/esm2020/flow/public-api.mjs +17 -0
- package/esm2020/flow/wirabyte-ui-flow.mjs +5 -0
- package/esm2020/galleria/galleria.component.mjs +480 -0
- package/esm2020/galleria/galleria.module.mjs +17 -0
- package/esm2020/galleria/public-api.mjs +3 -0
- package/esm2020/galleria/wirabyte-ui-galleria.mjs +5 -0
- package/esm2020/i18n/i18n.module.mjs +37 -0
- package/esm2020/i18n/i18n.service.mjs +148 -0
- package/esm2020/i18n/i18n.types.mjs +3 -0
- package/esm2020/i18n/language-switch.component.mjs +91 -0
- package/esm2020/i18n/public-api.mjs +7 -0
- package/esm2020/i18n/translate.pipe.mjs +52 -0
- package/esm2020/i18n/wirabyte-ui-i18n.mjs +5 -0
- package/esm2020/iconfield/iconfield.component.mjs +73 -0
- package/esm2020/iconfield/iconfield.module.mjs +17 -0
- package/esm2020/iconfield/public-api.mjs +3 -0
- package/esm2020/iconfield/wirabyte-ui-iconfield.mjs +5 -0
- package/esm2020/image/image.base.mjs +183 -0
- package/esm2020/image/image.component.mjs +14 -0
- package/esm2020/image/image.module.mjs +18 -0
- package/esm2020/image/public-api.mjs +4 -0
- package/esm2020/image/wirabyte-ui-image.mjs +5 -0
- package/esm2020/imagecompare/imagecompare.component.mjs +200 -0
- package/esm2020/imagecompare/imagecompare.module.mjs +18 -0
- package/esm2020/imagecompare/public-api.mjs +3 -0
- package/esm2020/imagecompare/wirabyte-ui-imagecompare.mjs +5 -0
- package/esm2020/imagecropper/imagecropper.component.mjs +1253 -0
- package/esm2020/imagecropper/imagecropper.module.mjs +17 -0
- package/esm2020/imagecropper/imagecropper.types.mjs +6 -0
- package/esm2020/imagecropper/public-api.mjs +5 -0
- package/esm2020/imagecropper/wirabyte-ui-imagecropper.mjs +5 -0
- package/esm2020/inplace/inplace.component.mjs +145 -0
- package/esm2020/inplace/inplace.module.mjs +17 -0
- package/esm2020/inplace/public-api.mjs +3 -0
- package/esm2020/inplace/wirabyte-ui-inplace.mjs +5 -0
- package/esm2020/inputgroup/inputgroup.component.mjs +61 -0
- package/esm2020/inputgroup/inputgroup.module.mjs +17 -0
- package/esm2020/inputgroup/public-api.mjs +3 -0
- package/esm2020/inputgroup/wirabyte-ui-inputgroup.mjs +5 -0
- package/esm2020/inputmask/inputmask.base.mjs +319 -0
- package/esm2020/inputmask/inputmask.component.mjs +23 -0
- package/esm2020/inputmask/inputmask.module.mjs +17 -0
- package/esm2020/inputmask/public-api.mjs +4 -0
- package/esm2020/inputmask/wirabyte-ui-inputmask.mjs +5 -0
- package/esm2020/inputnumber/inputnumber.component.mjs +364 -0
- package/esm2020/inputnumber/inputnumber.module.mjs +17 -0
- package/esm2020/inputnumber/inputnumber.types.mjs +2 -0
- package/esm2020/inputnumber/public-api.mjs +4 -0
- package/esm2020/inputnumber/wirabyte-ui-inputnumber.mjs +5 -0
- package/esm2020/inputotp/inputotp.component.mjs +344 -0
- package/esm2020/inputotp/inputotp.module.mjs +18 -0
- package/esm2020/inputotp/inputotp.types.mjs +2 -0
- package/esm2020/inputotp/public-api.mjs +4 -0
- package/esm2020/inputotp/wirabyte-ui-inputotp.mjs +5 -0
- package/esm2020/inputtext/inputtext.directive.mjs +62 -0
- package/esm2020/inputtext/inputtext.module.mjs +17 -0
- package/esm2020/inputtext/inputtext.styles.mjs +3 -0
- package/esm2020/inputtext/inputtext.types.mjs +2 -0
- package/esm2020/inputtext/public-api.mjs +6 -0
- package/esm2020/inputtext/wirabyte-ui-inputtext.mjs +5 -0
- package/esm2020/keyfilter/keyfilter.directive.mjs +131 -0
- package/esm2020/keyfilter/keyfilter.module.mjs +17 -0
- package/esm2020/keyfilter/public-api.mjs +3 -0
- package/esm2020/keyfilter/wirabyte-ui-keyfilter.mjs +5 -0
- package/esm2020/knob/knob.component.mjs +207 -0
- package/esm2020/knob/knob.module.mjs +17 -0
- package/esm2020/knob/public-api.mjs +3 -0
- package/esm2020/knob/wirabyte-ui-knob.mjs +5 -0
- package/esm2020/listbox/listbox.component.mjs +520 -0
- package/esm2020/listbox/listbox.module.mjs +17 -0
- package/esm2020/listbox/public-api.mjs +3 -0
- package/esm2020/listbox/wirabyte-ui-listbox.mjs +5 -0
- package/esm2020/menu/menu.base.mjs +320 -0
- package/esm2020/menu/menu.component.mjs +19 -0
- package/esm2020/menu/menu.module.mjs +18 -0
- package/esm2020/menu/public-api.mjs +4 -0
- package/esm2020/menu/wirabyte-ui-menu.mjs +5 -0
- package/esm2020/menubar/menubar.base.mjs +568 -0
- package/esm2020/menubar/menubar.component.mjs +19 -0
- package/esm2020/menubar/menubar.module.mjs +18 -0
- package/esm2020/menubar/public-api.mjs +4 -0
- package/esm2020/menubar/wirabyte-ui-menubar.mjs +5 -0
- package/esm2020/message/message.component.mjs +107 -0
- package/esm2020/message/message.module.mjs +20 -0
- package/esm2020/message/message.types.mjs +2 -0
- package/esm2020/message/messages.base.mjs +109 -0
- package/esm2020/message/messages.component.mjs +62 -0
- package/esm2020/message/public-api.mjs +6 -0
- package/esm2020/message/wirabyte-ui-message.mjs +5 -0
- package/esm2020/metergroup/metergroup.component.mjs +146 -0
- package/esm2020/metergroup/metergroup.module.mjs +17 -0
- package/esm2020/metergroup/metergroup.types.mjs +26 -0
- package/esm2020/metergroup/public-api.mjs +4 -0
- package/esm2020/metergroup/wirabyte-ui-metergroup.mjs +5 -0
- package/esm2020/multiselect/multiselect.base.mjs +732 -0
- package/esm2020/multiselect/multiselect.component.mjs +26 -0
- package/esm2020/multiselect/multiselect.module.mjs +18 -0
- package/esm2020/multiselect/multiselect.styles.mjs +3 -0
- package/esm2020/multiselect/multiselect.types.mjs +2 -0
- package/esm2020/multiselect/public-api.mjs +6 -0
- package/esm2020/multiselect/wirabyte-ui-multiselect.mjs +5 -0
- package/esm2020/navbar/navbar.component.mjs +460 -0
- package/esm2020/navbar/navbar.module.mjs +18 -0
- package/esm2020/navbar/public-api.mjs +3 -0
- package/esm2020/navbar/wirabyte-ui-navbar.mjs +5 -0
- package/esm2020/orderlist/orderlist.base.mjs +411 -0
- package/esm2020/orderlist/orderlist.component.mjs +17 -0
- package/esm2020/orderlist/orderlist.module.mjs +18 -0
- package/esm2020/orderlist/orderlist.types.mjs +2 -0
- package/esm2020/orderlist/public-api.mjs +5 -0
- package/esm2020/orderlist/wirabyte-ui-orderlist.mjs +5 -0
- package/esm2020/organizationchart/organizationchart.component.mjs +200 -0
- package/esm2020/organizationchart/organizationchart.module.mjs +18 -0
- package/esm2020/organizationchart/organizationchart.types.mjs +2 -0
- package/esm2020/organizationchart/public-api.mjs +4 -0
- package/esm2020/organizationchart/wirabyte-ui-organizationchart.mjs +5 -0
- package/esm2020/paginator/paginator.base.mjs +188 -0
- package/esm2020/paginator/paginator.component.mjs +20 -0
- package/esm2020/paginator/paginator.module.mjs +17 -0
- package/esm2020/paginator/paginator.types.mjs +2 -0
- package/esm2020/paginator/public-api.mjs +5 -0
- package/esm2020/paginator/wirabyte-ui-paginator.mjs +5 -0
- package/esm2020/panel/panel.component.mjs +108 -0
- package/esm2020/panel/panel.module.mjs +19 -0
- package/esm2020/panel/panel.types.mjs +2 -0
- package/esm2020/panel/public-api.mjs +4 -0
- package/esm2020/panel/wirabyte-ui-panel.mjs +5 -0
- package/esm2020/panelmenu/panelmenu.base.mjs +181 -0
- package/esm2020/panelmenu/panelmenu.component.mjs +15 -0
- package/esm2020/panelmenu/panelmenu.module.mjs +18 -0
- package/esm2020/panelmenu/public-api.mjs +4 -0
- package/esm2020/panelmenu/wirabyte-ui-panelmenu.mjs +5 -0
- package/esm2020/password/password.component.mjs +233 -0
- package/esm2020/password/password.module.mjs +17 -0
- package/esm2020/password/password.types.mjs +14 -0
- package/esm2020/password/public-api.mjs +4 -0
- package/esm2020/password/wirabyte-ui-password.mjs +5 -0
- package/esm2020/picklist/list-drag.mjs +259 -0
- package/esm2020/picklist/picklist.base.mjs +649 -0
- package/esm2020/picklist/picklist.component.mjs +17 -0
- package/esm2020/picklist/picklist.module.mjs +18 -0
- package/esm2020/picklist/picklist.styles.mjs +3 -0
- package/esm2020/picklist/picklist.types.mjs +2 -0
- package/esm2020/picklist/public-api.mjs +8 -0
- package/esm2020/picklist/wirabyte-ui-picklist.mjs +5 -0
- package/esm2020/popover/popover.base.mjs +171 -0
- package/esm2020/popover/popover.component.mjs +17 -0
- package/esm2020/popover/popover.module.mjs +18 -0
- package/esm2020/popover/public-api.mjs +4 -0
- package/esm2020/popover/wirabyte-ui-popover.mjs +5 -0
- package/esm2020/presets/public-api.mjs +5 -0
- package/esm2020/presets/wirabyte-ui-presets.mjs +5 -0
- package/esm2020/progressbar/progressbar.component.mjs +117 -0
- package/esm2020/progressbar/progressbar.module.mjs +17 -0
- package/esm2020/progressbar/progressbar.types.mjs +19 -0
- package/esm2020/progressbar/public-api.mjs +4 -0
- package/esm2020/progressbar/wirabyte-ui-progressbar.mjs +5 -0
- package/esm2020/progressspinner/progressspinner.component.mjs +109 -0
- package/esm2020/progressspinner/progressspinner.module.mjs +17 -0
- package/esm2020/progressspinner/progressspinner.types.mjs +27 -0
- package/esm2020/progressspinner/public-api.mjs +4 -0
- package/esm2020/progressspinner/wirabyte-ui-progressspinner.mjs +5 -0
- package/esm2020/public-api.mjs +3 -0
- package/esm2020/radiobutton/public-api.mjs +7 -0
- package/esm2020/radiobutton/radio-registry.mjs +40 -0
- package/esm2020/radiobutton/radiobutton.component.mjs +125 -0
- package/esm2020/radiobutton/radiobutton.module.mjs +17 -0
- package/esm2020/radiobutton/radiobutton.styles.mjs +3 -0
- package/esm2020/radiobutton/radiobutton.types.mjs +2 -0
- package/esm2020/radiobutton/wirabyte-ui-radiobutton.mjs +5 -0
- package/esm2020/rating/public-api.mjs +4 -0
- package/esm2020/rating/rating.component.mjs +107 -0
- package/esm2020/rating/rating.module.mjs +17 -0
- package/esm2020/rating/rating.types.mjs +2 -0
- package/esm2020/rating/wirabyte-ui-rating.mjs +5 -0
- package/esm2020/result/public-api.mjs +3 -0
- package/esm2020/result/result.component.mjs +72 -0
- package/esm2020/result/result.module.mjs +17 -0
- package/esm2020/result/wirabyte-ui-result.mjs +5 -0
- package/esm2020/ripple/public-api.mjs +3 -0
- package/esm2020/ripple/ripple.directive.mjs +43 -0
- package/esm2020/ripple/ripple.module.mjs +17 -0
- package/esm2020/ripple/ripple.styles.mjs +3 -0
- package/esm2020/ripple/wirabyte-ui-ripple.mjs +5 -0
- package/esm2020/scroller/public-api.mjs +6 -0
- package/esm2020/scroller/scroller.component.mjs +305 -0
- package/esm2020/scroller/scroller.module.mjs +17 -0
- package/esm2020/scroller/wirabyte-ui-scroller.mjs +5 -0
- package/esm2020/scrollpanel/public-api.mjs +3 -0
- package/esm2020/scrollpanel/scrollpanel.component.mjs +67 -0
- package/esm2020/scrollpanel/scrollpanel.module.mjs +17 -0
- package/esm2020/scrollpanel/wirabyte-ui-scrollpanel.mjs +5 -0
- package/esm2020/select/public-api.mjs +7 -0
- package/esm2020/select/select.base.mjs +667 -0
- package/esm2020/select/select.component.mjs +26 -0
- package/esm2020/select/select.module.mjs +17 -0
- package/esm2020/select/select.styles.mjs +3 -0
- package/esm2020/select/select.types.mjs +2 -0
- package/esm2020/select/wirabyte-ui-select.mjs +5 -0
- package/esm2020/selectbutton/public-api.mjs +4 -0
- package/esm2020/selectbutton/selectbutton.component.mjs +174 -0
- package/esm2020/selectbutton/selectbutton.module.mjs +18 -0
- package/esm2020/selectbutton/selectbutton.types.mjs +2 -0
- package/esm2020/selectbutton/wirabyte-ui-selectbutton.mjs +5 -0
- package/esm2020/sitefooter/public-api.mjs +3 -0
- package/esm2020/sitefooter/sitefooter.component.mjs +139 -0
- package/esm2020/sitefooter/sitefooter.module.mjs +18 -0
- package/esm2020/sitefooter/wirabyte-ui-sitefooter.mjs +5 -0
- package/esm2020/skeleton/public-api.mjs +4 -0
- package/esm2020/skeleton/skeleton.component.mjs +51 -0
- package/esm2020/skeleton/skeleton.module.mjs +17 -0
- package/esm2020/skeleton/skeleton.types.mjs +2 -0
- package/esm2020/skeleton/wirabyte-ui-skeleton.mjs +5 -0
- package/esm2020/slider/public-api.mjs +3 -0
- package/esm2020/slider/slider.component.mjs +247 -0
- package/esm2020/slider/slider.module.mjs +17 -0
- package/esm2020/slider/wirabyte-ui-slider.mjs +5 -0
- package/esm2020/splitbutton/public-api.mjs +3 -0
- package/esm2020/splitbutton/splitbutton.component.mjs +180 -0
- package/esm2020/splitbutton/splitbutton.module.mjs +17 -0
- package/esm2020/splitbutton/wirabyte-ui-splitbutton.mjs +5 -0
- package/esm2020/splitter/public-api.mjs +5 -0
- package/esm2020/splitter/splitter-panel.component.mjs +32 -0
- package/esm2020/splitter/splitter.component.mjs +372 -0
- package/esm2020/splitter/splitter.module.mjs +19 -0
- package/esm2020/splitter/splitter.types.mjs +2 -0
- package/esm2020/splitter/wirabyte-ui-splitter.mjs +5 -0
- package/esm2020/stepper/public-api.mjs +4 -0
- package/esm2020/stepper/stepper.base.mjs +392 -0
- package/esm2020/stepper/stepper.component.mjs +191 -0
- package/esm2020/stepper/stepper.module.mjs +19 -0
- package/esm2020/stepper/wirabyte-ui-stepper.mjs +5 -0
- package/esm2020/steps/public-api.mjs +4 -0
- package/esm2020/steps/steps.base.mjs +148 -0
- package/esm2020/steps/steps.component.mjs +15 -0
- package/esm2020/steps/steps.module.mjs +17 -0
- package/esm2020/steps/wirabyte-ui-steps.mjs +5 -0
- package/esm2020/table/public-api.mjs +10 -0
- package/esm2020/table/table-celleditor.component.mjs +34 -0
- package/esm2020/table/table-filter.component.mjs +123 -0
- package/esm2020/table/table.base.mjs +1443 -0
- package/esm2020/table/table.celleditor.mjs +42 -0
- package/esm2020/table/table.component.mjs +21 -0
- package/esm2020/table/table.directives.mjs +1117 -0
- package/esm2020/table/table.filter.mjs +346 -0
- package/esm2020/table/table.module.mjs +99 -0
- package/esm2020/table/table.types.mjs +3 -0
- package/esm2020/table/wirabyte-ui-table.mjs +5 -0
- package/esm2020/tabmenu/public-api.mjs +3 -0
- package/esm2020/tabmenu/wirabyte-ui-tabmenu.mjs +5 -0
- package/esm2020/tabs/public-api.mjs +9 -0
- package/esm2020/tabs/tabmenu.base.mjs +196 -0
- package/esm2020/tabs/tabmenu.component.mjs +18 -0
- package/esm2020/tabs/tabmenu.module.mjs +18 -0
- package/esm2020/tabs/tabs.component.mjs +477 -0
- package/esm2020/tabs/tabs.module.mjs +20 -0
- package/esm2020/tabs/tabs.styles.mjs +3 -0
- package/esm2020/tabs/tabs.types.mjs +50 -0
- package/esm2020/tabs/wirabyte-ui-tabs.mjs +5 -0
- package/esm2020/tag/public-api.mjs +4 -0
- package/esm2020/tag/tag.component.mjs +52 -0
- package/esm2020/tag/tag.module.mjs +17 -0
- package/esm2020/tag/tag.types.mjs +2 -0
- package/esm2020/tag/wirabyte-ui-tag.mjs +5 -0
- package/esm2020/terminal/public-api.mjs +6 -0
- package/esm2020/terminal/terminal.component.mjs +150 -0
- package/esm2020/terminal/terminal.module.mjs +17 -0
- package/esm2020/terminal/terminal.service.mjs +35 -0
- package/esm2020/terminal/wirabyte-ui-terminal.mjs +5 -0
- package/esm2020/textarea/public-api.mjs +3 -0
- package/esm2020/textarea/textarea.directive.mjs +87 -0
- package/esm2020/textarea/textarea.module.mjs +17 -0
- package/esm2020/textarea/wirabyte-ui-textarea.mjs +5 -0
- package/esm2020/thai/public-api.mjs +4 -0
- package/esm2020/thai/thai.module.mjs +18 -0
- package/esm2020/thai/thai.pipes.mjs +115 -0
- package/esm2020/thai/wirabyte-ui-thai.mjs +5 -0
- package/esm2020/tieredmenu/public-api.mjs +3 -0
- package/esm2020/tieredmenu/tieredmenu.component.mjs +385 -0
- package/esm2020/tieredmenu/tieredmenu.module.mjs +17 -0
- package/esm2020/tieredmenu/wirabyte-ui-tieredmenu.mjs +5 -0
- package/esm2020/timeline/public-api.mjs +4 -0
- package/esm2020/timeline/timeline.base.mjs +66 -0
- package/esm2020/timeline/timeline.component.mjs +46 -0
- package/esm2020/timeline/timeline.module.mjs +18 -0
- package/esm2020/timeline/wirabyte-ui-timeline.mjs +5 -0
- package/esm2020/toast/message.service.mjs +34 -0
- package/esm2020/toast/public-api.mjs +6 -0
- package/esm2020/toast/toast.base.mjs +227 -0
- package/esm2020/toast/toast.component.mjs +17 -0
- package/esm2020/toast/toast.module.mjs +18 -0
- package/esm2020/toast/toast.types.mjs +2 -0
- package/esm2020/toast/wirabyte-ui-toast.mjs +5 -0
- package/esm2020/togglebutton/public-api.mjs +4 -0
- package/esm2020/togglebutton/togglebutton.component.mjs +129 -0
- package/esm2020/togglebutton/togglebutton.module.mjs +17 -0
- package/esm2020/togglebutton/togglebutton.types.mjs +2 -0
- package/esm2020/togglebutton/wirabyte-ui-togglebutton.mjs +5 -0
- package/esm2020/toggleswitch/public-api.mjs +4 -0
- package/esm2020/toggleswitch/toggleswitch.component.mjs +123 -0
- package/esm2020/toggleswitch/toggleswitch.module.mjs +17 -0
- package/esm2020/toggleswitch/toggleswitch.types.mjs +2 -0
- package/esm2020/toggleswitch/wirabyte-ui-toggleswitch.mjs +5 -0
- package/esm2020/toolbar/public-api.mjs +3 -0
- package/esm2020/toolbar/toolbar.component.mjs +67 -0
- package/esm2020/toolbar/toolbar.module.mjs +18 -0
- package/esm2020/toolbar/wirabyte-ui-toolbar.mjs +5 -0
- package/esm2020/tooltip/public-api.mjs +4 -0
- package/esm2020/tooltip/tooltip.directive.mjs +370 -0
- package/esm2020/tooltip/tooltip.module.mjs +17 -0
- package/esm2020/tooltip/tooltip.styles.mjs +3 -0
- package/esm2020/tooltip/tooltip.types.mjs +2 -0
- package/esm2020/tooltip/wirabyte-ui-tooltip.mjs +5 -0
- package/esm2020/tree/public-api.mjs +3 -0
- package/esm2020/tree/tree.component.mjs +453 -0
- package/esm2020/tree/tree.module.mjs +17 -0
- package/esm2020/tree/wirabyte-ui-tree.mjs +5 -0
- package/esm2020/treeselect/public-api.mjs +3 -0
- package/esm2020/treeselect/treeselect.component.mjs +410 -0
- package/esm2020/treeselect/treeselect.module.mjs +17 -0
- package/esm2020/treeselect/wirabyte-ui-treeselect.mjs +5 -0
- package/esm2020/validation/field-error.component.mjs +84 -0
- package/esm2020/validation/public-api.mjs +4 -0
- package/esm2020/validation/validation.module.mjs +19 -0
- package/esm2020/validation/validators.mjs +84 -0
- package/esm2020/validation/wirabyte-ui-validation.mjs +5 -0
- package/esm2020/wirabyte-ui.mjs +5 -0
- package/excel/excel.d.ts +24 -0
- package/excel/index.d.ts +5 -0
- package/excel/public-api.d.ts +3 -0
- package/fesm2015/wirabyte-ui-accordion.mjs +416 -0
- package/fesm2015/wirabyte-ui-accordion.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-alert.mjs +555 -0
- package/fesm2015/wirabyte-ui-alert.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-animate.mjs +280 -0
- package/fesm2015/wirabyte-ui-animate.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-api.mjs +34 -0
- package/fesm2015/wirabyte-ui-api.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-asidemenu.mjs +848 -0
- package/fesm2015/wirabyte-ui-asidemenu.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-autocomplete.mjs +619 -0
- package/fesm2015/wirabyte-ui-autocomplete.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-avatar.mjs +103 -0
- package/fesm2015/wirabyte-ui-avatar.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-badge.mjs +185 -0
- package/fesm2015/wirabyte-ui-badge.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-blockui.mjs +176 -0
- package/fesm2015/wirabyte-ui-blockui.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-bottombar.mjs +237 -0
- package/fesm2015/wirabyte-ui-bottombar.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-breadcrumb.mjs +109 -0
- package/fesm2015/wirabyte-ui-breadcrumb.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-button.mjs +415 -0
- package/fesm2015/wirabyte-ui-button.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-card.mjs +134 -0
- package/fesm2015/wirabyte-ui-card.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-carousel.mjs +647 -0
- package/fesm2015/wirabyte-ui-carousel.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-chart.mjs +63 -0
- package/fesm2015/wirabyte-ui-chart.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-chartjs.mjs +268 -0
- package/fesm2015/wirabyte-ui-chartjs.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-checkbox.mjs +164 -0
- package/fesm2015/wirabyte-ui-checkbox.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-chip.mjs +97 -0
- package/fesm2015/wirabyte-ui-chip.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-colorpicker.mjs +333 -0
- package/fesm2015/wirabyte-ui-colorpicker.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-config.mjs +624 -0
- package/fesm2015/wirabyte-ui-config.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-confirmdialog.mjs +421 -0
- package/fesm2015/wirabyte-ui-confirmdialog.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-contextmenu.mjs +185 -0
- package/fesm2015/wirabyte-ui-contextmenu.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-core.mjs +13312 -0
- package/fesm2015/wirabyte-ui-core.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-datepicker.mjs +951 -0
- package/fesm2015/wirabyte-ui-datepicker.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-dialog.mjs +707 -0
- package/fesm2015/wirabyte-ui-dialog.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-divider.mjs +77 -0
- package/fesm2015/wirabyte-ui-divider.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-dock.mjs +317 -0
- package/fesm2015/wirabyte-ui-dock.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-dragdrop.mjs +232 -0
- package/fesm2015/wirabyte-ui-dragdrop.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-drawer.mjs +326 -0
- package/fesm2015/wirabyte-ui-drawer.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-editor.mjs +3099 -0
- package/fesm2015/wirabyte-ui-editor.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-emptystate.mjs +101 -0
- package/fesm2015/wirabyte-ui-emptystate.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-errorpage.mjs +187 -0
- package/fesm2015/wirabyte-ui-errorpage.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-excel.mjs +49 -0
- package/fesm2015/wirabyte-ui-excel.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-fieldset.mjs +95 -0
- package/fesm2015/wirabyte-ui-fieldset.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-fileupload.mjs +607 -0
- package/fesm2015/wirabyte-ui-fileupload.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-floatlabel.mjs +74 -0
- package/fesm2015/wirabyte-ui-floatlabel.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-flow.mjs +4967 -0
- package/fesm2015/wirabyte-ui-flow.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-galleria.mjs +506 -0
- package/fesm2015/wirabyte-ui-galleria.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-i18n.mjs +330 -0
- package/fesm2015/wirabyte-ui-i18n.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-iconfield.mjs +94 -0
- package/fesm2015/wirabyte-ui-iconfield.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-image.mjs +218 -0
- package/fesm2015/wirabyte-ui-image.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-imagecompare.mjs +224 -0
- package/fesm2015/wirabyte-ui-imagecompare.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-imagecropper.mjs +1301 -0
- package/fesm2015/wirabyte-ui-imagecropper.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-inplace.mjs +167 -0
- package/fesm2015/wirabyte-ui-inplace.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-inputgroup.mjs +82 -0
- package/fesm2015/wirabyte-ui-inputgroup.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-inputmask.mjs +367 -0
- package/fesm2015/wirabyte-ui-inputmask.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-inputnumber.mjs +388 -0
- package/fesm2015/wirabyte-ui-inputnumber.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-inputotp.mjs +370 -0
- package/fesm2015/wirabyte-ui-inputotp.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-inputtext.mjs +85 -0
- package/fesm2015/wirabyte-ui-inputtext.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-keyfilter.mjs +155 -0
- package/fesm2015/wirabyte-ui-keyfilter.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-knob.mjs +229 -0
- package/fesm2015/wirabyte-ui-knob.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-listbox.mjs +543 -0
- package/fesm2015/wirabyte-ui-listbox.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-menu.mjs +365 -0
- package/fesm2015/wirabyte-ui-menu.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-menubar.mjs +614 -0
- package/fesm2015/wirabyte-ui-menubar.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-message.mjs +291 -0
- package/fesm2015/wirabyte-ui-message.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-metergroup.mjs +192 -0
- package/fesm2015/wirabyte-ui-metergroup.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-multiselect.mjs +795 -0
- package/fesm2015/wirabyte-ui-multiselect.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-navbar.mjs +491 -0
- package/fesm2015/wirabyte-ui-navbar.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-orderlist.mjs +450 -0
- package/fesm2015/wirabyte-ui-orderlist.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-organizationchart.mjs +225 -0
- package/fesm2015/wirabyte-ui-organizationchart.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-paginator.mjs +226 -0
- package/fesm2015/wirabyte-ui-paginator.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-panel.mjs +130 -0
- package/fesm2015/wirabyte-ui-panel.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-panelmenu.mjs +216 -0
- package/fesm2015/wirabyte-ui-panelmenu.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-password.mjs +271 -0
- package/fesm2015/wirabyte-ui-password.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-picklist.mjs +954 -0
- package/fesm2015/wirabyte-ui-picklist.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-popover.mjs +210 -0
- package/fesm2015/wirabyte-ui-popover.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-presets.mjs +10 -0
- package/fesm2015/wirabyte-ui-presets.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-progressbar.mjs +156 -0
- package/fesm2015/wirabyte-ui-progressbar.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-progressspinner.mjs +158 -0
- package/fesm2015/wirabyte-ui-progressspinner.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-radiobutton.mjs +186 -0
- package/fesm2015/wirabyte-ui-radiobutton.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-rating.mjs +129 -0
- package/fesm2015/wirabyte-ui-rating.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-result.mjs +95 -0
- package/fesm2015/wirabyte-ui-result.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-ripple.mjs +67 -0
- package/fesm2015/wirabyte-ui-ripple.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-scroller.mjs +330 -0
- package/fesm2015/wirabyte-ui-scroller.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-scrollpanel.mjs +90 -0
- package/fesm2015/wirabyte-ui-scrollpanel.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-select.mjs +730 -0
- package/fesm2015/wirabyte-ui-select.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-selectbutton.mjs +195 -0
- package/fesm2015/wirabyte-ui-selectbutton.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-sitefooter.mjs +166 -0
- package/fesm2015/wirabyte-ui-sitefooter.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-skeleton.mjs +72 -0
- package/fesm2015/wirabyte-ui-skeleton.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-slider.mjs +271 -0
- package/fesm2015/wirabyte-ui-slider.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-splitbutton.mjs +202 -0
- package/fesm2015/wirabyte-ui-splitbutton.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-splitter.mjs +431 -0
- package/fesm2015/wirabyte-ui-splitter.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-stepper.mjs +607 -0
- package/fesm2015/wirabyte-ui-stepper.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-steps.mjs +182 -0
- package/fesm2015/wirabyte-ui-steps.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-table.mjs +3223 -0
- package/fesm2015/wirabyte-ui-table.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-tabmenu.mjs +8 -0
- package/fesm2015/wirabyte-ui-tabmenu.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-tabs.mjs +790 -0
- package/fesm2015/wirabyte-ui-tabs.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-tag.mjs +73 -0
- package/fesm2015/wirabyte-ui-tag.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-terminal.mjs +207 -0
- package/fesm2015/wirabyte-ui-terminal.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-textarea.mjs +108 -0
- package/fesm2015/wirabyte-ui-textarea.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-thai.mjs +138 -0
- package/fesm2015/wirabyte-ui-thai.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-tieredmenu.mjs +417 -0
- package/fesm2015/wirabyte-ui-tieredmenu.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-timeline.mjs +130 -0
- package/fesm2015/wirabyte-ui-timeline.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-toast.mjs +294 -0
- package/fesm2015/wirabyte-ui-toast.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-togglebutton.mjs +151 -0
- package/fesm2015/wirabyte-ui-togglebutton.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-toggleswitch.mjs +144 -0
- package/fesm2015/wirabyte-ui-toggleswitch.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-toolbar.mjs +88 -0
- package/fesm2015/wirabyte-ui-toolbar.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-tooltip.mjs +398 -0
- package/fesm2015/wirabyte-ui-tooltip.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-tree.mjs +480 -0
- package/fesm2015/wirabyte-ui-tree.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-treeselect.mjs +438 -0
- package/fesm2015/wirabyte-ui-treeselect.mjs.map +1 -0
- package/fesm2015/wirabyte-ui-validation.mjs +189 -0
- package/fesm2015/wirabyte-ui-validation.mjs.map +1 -0
- package/fesm2015/wirabyte-ui.mjs +9 -0
- package/fesm2015/wirabyte-ui.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-accordion.mjs +414 -0
- package/fesm2020/wirabyte-ui-accordion.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-alert.mjs +529 -0
- package/fesm2020/wirabyte-ui-alert.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-animate.mjs +276 -0
- package/fesm2020/wirabyte-ui-animate.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-api.mjs +34 -0
- package/fesm2020/wirabyte-ui-api.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-asidemenu.mjs +832 -0
- package/fesm2020/wirabyte-ui-asidemenu.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-autocomplete.mjs +608 -0
- package/fesm2020/wirabyte-ui-autocomplete.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-avatar.mjs +102 -0
- package/fesm2020/wirabyte-ui-avatar.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-badge.mjs +183 -0
- package/fesm2020/wirabyte-ui-badge.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-blockui.mjs +173 -0
- package/fesm2020/wirabyte-ui-blockui.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-bottombar.mjs +230 -0
- package/fesm2020/wirabyte-ui-bottombar.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-breadcrumb.mjs +107 -0
- package/fesm2020/wirabyte-ui-breadcrumb.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-button.mjs +412 -0
- package/fesm2020/wirabyte-ui-button.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-card.mjs +134 -0
- package/fesm2020/wirabyte-ui-card.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-carousel.mjs +638 -0
- package/fesm2020/wirabyte-ui-carousel.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-chart.mjs +63 -0
- package/fesm2020/wirabyte-ui-chart.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-chartjs.mjs +262 -0
- package/fesm2020/wirabyte-ui-chartjs.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-checkbox.mjs +164 -0
- package/fesm2020/wirabyte-ui-checkbox.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-chip.mjs +97 -0
- package/fesm2020/wirabyte-ui-chip.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-colorpicker.mjs +329 -0
- package/fesm2020/wirabyte-ui-colorpicker.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-config.mjs +621 -0
- package/fesm2020/wirabyte-ui-config.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-confirmdialog.mjs +395 -0
- package/fesm2020/wirabyte-ui-confirmdialog.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-contextmenu.mjs +180 -0
- package/fesm2020/wirabyte-ui-contextmenu.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-core.mjs +13367 -0
- package/fesm2020/wirabyte-ui-core.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-datepicker.mjs +942 -0
- package/fesm2020/wirabyte-ui-datepicker.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-dialog.mjs +698 -0
- package/fesm2020/wirabyte-ui-dialog.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-divider.mjs +77 -0
- package/fesm2020/wirabyte-ui-divider.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-dock.mjs +308 -0
- package/fesm2020/wirabyte-ui-dock.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-dragdrop.mjs +229 -0
- package/fesm2020/wirabyte-ui-dragdrop.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-drawer.mjs +321 -0
- package/fesm2020/wirabyte-ui-drawer.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-editor.mjs +3056 -0
- package/fesm2020/wirabyte-ui-editor.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-emptystate.mjs +99 -0
- package/fesm2020/wirabyte-ui-emptystate.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-errorpage.mjs +184 -0
- package/fesm2020/wirabyte-ui-errorpage.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-excel.mjs +43 -0
- package/fesm2020/wirabyte-ui-excel.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-fieldset.mjs +95 -0
- package/fesm2020/wirabyte-ui-fieldset.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-fileupload.mjs +599 -0
- package/fesm2020/wirabyte-ui-fileupload.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-floatlabel.mjs +74 -0
- package/fesm2020/wirabyte-ui-floatlabel.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-flow.mjs +4920 -0
- package/fesm2020/wirabyte-ui-flow.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-galleria.mjs +501 -0
- package/fesm2020/wirabyte-ui-galleria.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-i18n.mjs +321 -0
- package/fesm2020/wirabyte-ui-i18n.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-iconfield.mjs +94 -0
- package/fesm2020/wirabyte-ui-iconfield.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-image.mjs +214 -0
- package/fesm2020/wirabyte-ui-image.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-imagecompare.mjs +221 -0
- package/fesm2020/wirabyte-ui-imagecompare.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-imagecropper.mjs +1279 -0
- package/fesm2020/wirabyte-ui-imagecropper.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-inplace.mjs +166 -0
- package/fesm2020/wirabyte-ui-inplace.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-inputgroup.mjs +82 -0
- package/fesm2020/wirabyte-ui-inputgroup.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-inputmask.mjs +360 -0
- package/fesm2020/wirabyte-ui-inputmask.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-inputnumber.mjs +385 -0
- package/fesm2020/wirabyte-ui-inputnumber.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-inputotp.mjs +365 -0
- package/fesm2020/wirabyte-ui-inputotp.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-inputtext.mjs +85 -0
- package/fesm2020/wirabyte-ui-inputtext.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-keyfilter.mjs +152 -0
- package/fesm2020/wirabyte-ui-keyfilter.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-knob.mjs +228 -0
- package/fesm2020/wirabyte-ui-knob.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-listbox.mjs +541 -0
- package/fesm2020/wirabyte-ui-listbox.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-menu.mjs +356 -0
- package/fesm2020/wirabyte-ui-menu.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-menubar.mjs +604 -0
- package/fesm2020/wirabyte-ui-menubar.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-message.mjs +291 -0
- package/fesm2020/wirabyte-ui-message.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-metergroup.mjs +192 -0
- package/fesm2020/wirabyte-ui-metergroup.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-multiselect.mjs +778 -0
- package/fesm2020/wirabyte-ui-multiselect.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-navbar.mjs +481 -0
- package/fesm2020/wirabyte-ui-navbar.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-orderlist.mjs +445 -0
- package/fesm2020/wirabyte-ui-orderlist.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-organizationchart.mjs +221 -0
- package/fesm2020/wirabyte-ui-organizationchart.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-paginator.mjs +226 -0
- package/fesm2020/wirabyte-ui-paginator.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-panel.mjs +130 -0
- package/fesm2020/wirabyte-ui-panel.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-panelmenu.mjs +213 -0
- package/fesm2020/wirabyte-ui-panelmenu.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-password.mjs +267 -0
- package/fesm2020/wirabyte-ui-password.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-picklist.mjs +944 -0
- package/fesm2020/wirabyte-ui-picklist.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-popover.mjs +205 -0
- package/fesm2020/wirabyte-ui-popover.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-presets.mjs +10 -0
- package/fesm2020/wirabyte-ui-presets.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-progressbar.mjs +156 -0
- package/fesm2020/wirabyte-ui-progressbar.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-progressspinner.mjs +156 -0
- package/fesm2020/wirabyte-ui-progressspinner.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-radiobutton.mjs +186 -0
- package/fesm2020/wirabyte-ui-radiobutton.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-rating.mjs +128 -0
- package/fesm2020/wirabyte-ui-rating.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-result.mjs +93 -0
- package/fesm2020/wirabyte-ui-result.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-ripple.mjs +66 -0
- package/fesm2020/wirabyte-ui-ripple.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-scroller.mjs +326 -0
- package/fesm2020/wirabyte-ui-scroller.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-scrollpanel.mjs +88 -0
- package/fesm2020/wirabyte-ui-scrollpanel.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-select.mjs +713 -0
- package/fesm2020/wirabyte-ui-select.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-selectbutton.mjs +195 -0
- package/fesm2020/wirabyte-ui-selectbutton.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-sitefooter.mjs +160 -0
- package/fesm2020/wirabyte-ui-sitefooter.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-skeleton.mjs +72 -0
- package/fesm2020/wirabyte-ui-skeleton.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-slider.mjs +268 -0
- package/fesm2020/wirabyte-ui-slider.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-splitbutton.mjs +201 -0
- package/fesm2020/wirabyte-ui-splitbutton.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-splitter.mjs +422 -0
- package/fesm2020/wirabyte-ui-splitter.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-stepper.mjs +602 -0
- package/fesm2020/wirabyte-ui-stepper.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-steps.mjs +180 -0
- package/fesm2020/wirabyte-ui-steps.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-table.mjs +3201 -0
- package/fesm2020/wirabyte-ui-table.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-tabmenu.mjs +8 -0
- package/fesm2020/wirabyte-ui-tabmenu.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-tabs.mjs +769 -0
- package/fesm2020/wirabyte-ui-tabs.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-tag.mjs +73 -0
- package/fesm2020/wirabyte-ui-tag.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-terminal.mjs +203 -0
- package/fesm2020/wirabyte-ui-terminal.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-textarea.mjs +108 -0
- package/fesm2020/wirabyte-ui-textarea.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-thai.mjs +138 -0
- package/fesm2020/wirabyte-ui-thai.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-tieredmenu.mjs +406 -0
- package/fesm2020/wirabyte-ui-tieredmenu.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-timeline.mjs +130 -0
- package/fesm2020/wirabyte-ui-timeline.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-toast.mjs +291 -0
- package/fesm2020/wirabyte-ui-toast.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-togglebutton.mjs +150 -0
- package/fesm2020/wirabyte-ui-togglebutton.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-toggleswitch.mjs +144 -0
- package/fesm2020/wirabyte-ui-toggleswitch.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-toolbar.mjs +88 -0
- package/fesm2020/wirabyte-ui-toolbar.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-tooltip.mjs +393 -0
- package/fesm2020/wirabyte-ui-tooltip.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-tree.mjs +474 -0
- package/fesm2020/wirabyte-ui-tree.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-treeselect.mjs +431 -0
- package/fesm2020/wirabyte-ui-treeselect.mjs.map +1 -0
- package/fesm2020/wirabyte-ui-validation.mjs +186 -0
- package/fesm2020/wirabyte-ui-validation.mjs.map +1 -0
- package/fesm2020/wirabyte-ui.mjs +9 -0
- package/fesm2020/wirabyte-ui.mjs.map +1 -0
- package/fieldset/fieldset.component.d.ts +35 -0
- package/fieldset/fieldset.module.d.ts +9 -0
- package/fieldset/index.d.ts +5 -0
- package/fieldset/public-api.d.ts +2 -0
- package/fileupload/fileupload.base.d.ts +175 -0
- package/fileupload/fileupload.component.d.ts +11 -0
- package/fileupload/fileupload.module.d.ts +9 -0
- package/fileupload/fileupload.types.d.ts +54 -0
- package/fileupload/index.d.ts +5 -0
- package/fileupload/public-api.d.ts +4 -0
- package/floatlabel/floatlabel.component.d.ts +21 -0
- package/floatlabel/floatlabel.module.d.ts +8 -0
- package/floatlabel/floatlabel.types.d.ts +1 -0
- package/floatlabel/index.d.ts +5 -0
- package/floatlabel/public-api.d.ts +3 -0
- package/flow/flow-background.component.d.ts +49 -0
- package/flow/flow-controls.component.d.ts +47 -0
- package/flow/flow-handle.component.d.ts +48 -0
- package/flow/flow-history.directive.d.ts +42 -0
- package/flow/flow-host.d.ts +48 -0
- package/flow/flow-minimap.component.d.ts +79 -0
- package/flow/flow-node-outlet.d.ts +46 -0
- package/flow/flow-node-resizer.component.d.ts +57 -0
- package/flow/flow-node-toolbar.component.d.ts +38 -0
- package/flow/flow-panel.component.d.ts +11 -0
- package/flow/flow-templates.d.ts +47 -0
- package/flow/flow.component.d.ts +633 -0
- package/flow/flow.module.d.ts +21 -0
- package/flow/flow.types.d.ts +210 -0
- package/flow/index.d.ts +5 -0
- package/flow/public-api.d.ts +16 -0
- package/galleria/galleria.component.d.ts +163 -0
- package/galleria/galleria.module.d.ts +8 -0
- package/galleria/index.d.ts +5 -0
- package/galleria/public-api.d.ts +2 -0
- package/i18n/i18n.module.d.ts +22 -0
- package/i18n/i18n.service.d.ts +54 -0
- package/i18n/i18n.types.d.ts +33 -0
- package/i18n/index.d.ts +5 -0
- package/i18n/language-switch.component.d.ts +50 -0
- package/i18n/public-api.d.ts +6 -0
- package/i18n/translate.pipe.d.ts +25 -0
- package/iconfield/iconfield.component.d.ts +30 -0
- package/iconfield/iconfield.module.d.ts +8 -0
- package/iconfield/index.d.ts +5 -0
- package/iconfield/public-api.d.ts +2 -0
- package/image/image.base.d.ts +83 -0
- package/image/image.component.d.ts +7 -0
- package/image/image.module.d.ts +9 -0
- package/image/index.d.ts +5 -0
- package/image/public-api.d.ts +3 -0
- package/imagecompare/imagecompare.component.d.ts +67 -0
- package/imagecompare/imagecompare.module.d.ts +9 -0
- package/imagecompare/index.d.ts +5 -0
- package/imagecompare/public-api.d.ts +2 -0
- package/imagecropper/imagecropper.component.d.ts +309 -0
- package/imagecropper/imagecropper.module.d.ts +8 -0
- package/imagecropper/imagecropper.types.d.ts +79 -0
- package/imagecropper/index.d.ts +5 -0
- package/imagecropper/public-api.d.ts +4 -0
- package/index.d.ts +5 -0
- package/inplace/index.d.ts +5 -0
- package/inplace/inplace.component.d.ts +59 -0
- package/inplace/inplace.module.d.ts +8 -0
- package/inplace/public-api.d.ts +2 -0
- package/inputgroup/index.d.ts +5 -0
- package/inputgroup/inputgroup.component.d.ts +26 -0
- package/inputgroup/inputgroup.module.d.ts +8 -0
- package/inputgroup/public-api.d.ts +2 -0
- package/inputmask/index.d.ts +5 -0
- package/inputmask/inputmask.base.d.ts +115 -0
- package/inputmask/inputmask.component.d.ts +10 -0
- package/inputmask/inputmask.module.d.ts +8 -0
- package/inputmask/public-api.d.ts +3 -0
- package/inputnumber/index.d.ts +5 -0
- package/inputnumber/inputnumber.component.d.ts +132 -0
- package/inputnumber/inputnumber.module.d.ts +8 -0
- package/inputnumber/inputnumber.types.d.ts +7 -0
- package/inputnumber/public-api.d.ts +3 -0
- package/inputotp/index.d.ts +5 -0
- package/inputotp/inputotp.component.d.ts +105 -0
- package/inputotp/inputotp.module.d.ts +9 -0
- package/inputotp/inputotp.types.d.ts +22 -0
- package/inputotp/public-api.d.ts +3 -0
- package/inputtext/index.d.ts +5 -0
- package/inputtext/inputtext.directive.d.ts +25 -0
- package/inputtext/inputtext.module.d.ts +8 -0
- package/inputtext/inputtext.styles.d.ts +2 -0
- package/inputtext/inputtext.types.d.ts +3 -0
- package/inputtext/public-api.d.ts +5 -0
- package/keyfilter/index.d.ts +5 -0
- package/keyfilter/keyfilter.directive.d.ts +29 -0
- package/keyfilter/keyfilter.module.d.ts +8 -0
- package/keyfilter/public-api.d.ts +2 -0
- package/knob/index.d.ts +5 -0
- package/knob/knob.component.d.ts +94 -0
- package/knob/knob.module.d.ts +8 -0
- package/knob/public-api.d.ts +2 -0
- package/listbox/index.d.ts +5 -0
- package/listbox/listbox.component.d.ts +186 -0
- package/listbox/listbox.module.d.ts +8 -0
- package/listbox/public-api.d.ts +2 -0
- package/menu/index.d.ts +5 -0
- package/menu/menu.base.d.ts +95 -0
- package/menu/menu.component.d.ts +11 -0
- package/menu/menu.module.d.ts +9 -0
- package/menu/public-api.d.ts +4 -0
- package/menubar/index.d.ts +5 -0
- package/menubar/menubar.base.d.ts +135 -0
- package/menubar/menubar.component.d.ts +11 -0
- package/menubar/menubar.module.d.ts +9 -0
- package/menubar/public-api.d.ts +4 -0
- package/message/index.d.ts +5 -0
- package/message/message.component.d.ts +50 -0
- package/message/message.module.d.ts +11 -0
- package/message/message.types.d.ts +5 -0
- package/message/messages.base.d.ts +50 -0
- package/message/messages.component.d.ts +7 -0
- package/message/public-api.d.ts +5 -0
- package/metergroup/index.d.ts +5 -0
- package/metergroup/metergroup.component.d.ts +59 -0
- package/metergroup/metergroup.module.d.ts +8 -0
- package/metergroup/metergroup.types.d.ts +42 -0
- package/metergroup/public-api.d.ts +3 -0
- package/multiselect/index.d.ts +5 -0
- package/multiselect/multiselect.base.d.ts +222 -0
- package/multiselect/multiselect.component.d.ts +11 -0
- package/multiselect/multiselect.module.d.ts +9 -0
- package/multiselect/multiselect.styles.d.ts +2 -0
- package/multiselect/multiselect.types.d.ts +20 -0
- package/multiselect/public-api.d.ts +5 -0
- package/navbar/index.d.ts +5 -0
- package/navbar/navbar.component.d.ts +172 -0
- package/navbar/navbar.module.d.ts +9 -0
- package/navbar/public-api.d.ts +2 -0
- package/orderlist/index.d.ts +5 -0
- package/orderlist/orderlist.base.d.ts +136 -0
- package/orderlist/orderlist.component.d.ts +10 -0
- package/orderlist/orderlist.module.d.ts +9 -0
- package/orderlist/orderlist.types.d.ts +10 -0
- package/orderlist/public-api.d.ts +4 -0
- package/organizationchart/index.d.ts +5 -0
- package/organizationchart/organizationchart.component.d.ts +76 -0
- package/organizationchart/organizationchart.module.d.ts +9 -0
- package/organizationchart/organizationchart.types.d.ts +10 -0
- package/organizationchart/public-api.d.ts +4 -0
- package/package.json +891 -3
- package/paginator/index.d.ts +5 -0
- package/paginator/paginator.base.d.ts +95 -0
- package/paginator/paginator.component.d.ts +10 -0
- package/paginator/paginator.module.d.ts +8 -0
- package/paginator/paginator.types.d.ts +7 -0
- package/paginator/public-api.d.ts +4 -0
- package/panel/index.d.ts +5 -0
- package/panel/panel.component.d.ts +51 -0
- package/panel/panel.module.d.ts +10 -0
- package/panel/panel.types.d.ts +2 -0
- package/panel/public-api.d.ts +3 -0
- package/panelmenu/index.d.ts +5 -0
- package/panelmenu/panelmenu.base.d.ts +53 -0
- package/panelmenu/panelmenu.component.d.ts +7 -0
- package/panelmenu/panelmenu.module.d.ts +9 -0
- package/panelmenu/public-api.d.ts +3 -0
- package/password/index.d.ts +5 -0
- package/password/password.component.d.ts +90 -0
- package/password/password.module.d.ts +8 -0
- package/password/password.types.d.ts +6 -0
- package/password/public-api.d.ts +3 -0
- package/picklist/index.d.ts +5 -0
- package/picklist/list-drag.d.ts +49 -0
- package/picklist/picklist.base.d.ts +217 -0
- package/picklist/picklist.component.d.ts +10 -0
- package/picklist/picklist.module.d.ts +9 -0
- package/picklist/picklist.styles.d.ts +2 -0
- package/picklist/picklist.types.d.ts +21 -0
- package/picklist/public-api.d.ts +7 -0
- package/popover/index.d.ts +5 -0
- package/popover/popover.base.d.ts +61 -0
- package/popover/popover.component.d.ts +10 -0
- package/popover/popover.module.d.ts +9 -0
- package/popover/public-api.d.ts +3 -0
- package/presets/index.d.ts +5 -0
- package/presets/public-api.d.ts +2 -0
- package/progressbar/index.d.ts +5 -0
- package/progressbar/progressbar.component.d.ts +62 -0
- package/progressbar/progressbar.module.d.ts +8 -0
- package/progressbar/progressbar.types.d.ts +16 -0
- package/progressbar/public-api.d.ts +3 -0
- package/progressspinner/index.d.ts +5 -0
- package/progressspinner/progressspinner.component.d.ts +50 -0
- package/progressspinner/progressspinner.module.d.ts +8 -0
- package/progressspinner/progressspinner.types.d.ts +9 -0
- package/progressspinner/public-api.d.ts +3 -0
- package/public-api.d.ts +2 -0
- package/radiobutton/index.d.ts +5 -0
- package/radiobutton/public-api.d.ts +6 -0
- package/radiobutton/radio-registry.d.ts +23 -0
- package/radiobutton/radiobutton.component.d.ts +57 -0
- package/radiobutton/radiobutton.module.d.ts +8 -0
- package/radiobutton/radiobutton.styles.d.ts +2 -0
- package/radiobutton/radiobutton.types.d.ts +4 -0
- package/rating/index.d.ts +5 -0
- package/rating/public-api.d.ts +3 -0
- package/rating/rating.component.d.ts +47 -0
- package/rating/rating.module.d.ts +8 -0
- package/rating/rating.types.d.ts +4 -0
- package/result/index.d.ts +5 -0
- package/result/public-api.d.ts +2 -0
- package/result/result.component.d.ts +39 -0
- package/result/result.module.d.ts +8 -0
- package/ripple/index.d.ts +5 -0
- package/ripple/public-api.d.ts +2 -0
- package/ripple/ripple.directive.d.ts +15 -0
- package/ripple/ripple.module.d.ts +8 -0
- package/ripple/ripple.styles.d.ts +2 -0
- package/schematics/collection.json +21 -0
- package/schematics/core/carousel.cjs +70 -0
- package/schematics/core/catalog.cjs +206 -0
- package/schematics/core/chart/format.cjs +68 -0
- package/schematics/core/chart/index.cjs +32 -0
- package/schematics/core/chart/kinds.cjs +1355 -0
- package/schematics/core/chart/model.cjs +717 -0
- package/schematics/core/chart/more.cjs +317 -0
- package/schematics/core/chart/paths.cjs +170 -0
- package/schematics/core/chart/scale.cjs +63 -0
- package/schematics/core/color.cjs +106 -0
- package/schematics/core/colorpicker.cjs +79 -0
- package/schematics/core/compat.cjs +152 -0
- package/schematics/core/config.cjs +172 -0
- package/schematics/core/date.cjs +346 -0
- package/schematics/core/datepicker.cjs +530 -0
- package/schematics/core/dock.cjs +16 -0
- package/schematics/core/editor.cjs +281 -0
- package/schematics/core/errorpage.cjs +52 -0
- package/schematics/core/excel.cjs +826 -0
- package/schematics/core/exporters.cjs +249 -0
- package/schematics/core/families.cjs +1758 -0
- package/schematics/core/fileupload.cjs +54 -0
- package/schematics/core/flow/changes.cjs +215 -0
- package/schematics/core/flow/edges.cjs +95 -0
- package/schematics/core/flow/export.cjs +236 -0
- package/schematics/core/flow/geometry.cjs +338 -0
- package/schematics/core/flow/graph.cjs +338 -0
- package/schematics/core/flow/history.cjs +109 -0
- package/schematics/core/flow/index.cjs +29 -0
- package/schematics/core/flow/interaction.cjs +264 -0
- package/schematics/core/flow/layout.cjs +592 -0
- package/schematics/core/flow/paths.cjs +268 -0
- package/schematics/core/flow/text.cjs +74 -0
- package/schematics/core/flow/types.cjs +7 -0
- package/schematics/core/flow/viewport.cjs +151 -0
- package/schematics/core/i18n.cjs +85 -0
- package/schematics/core/imagecompare.cjs +32 -0
- package/schematics/core/imagecropper.cjs +515 -0
- package/schematics/core/index.cjs +55 -0
- package/schematics/core/inputotp.cjs +56 -0
- package/schematics/core/knob.cjs +114 -0
- package/schematics/core/mask.cjs +122 -0
- package/schematics/core/menu.cjs +88 -0
- package/schematics/core/number.cjs +141 -0
- package/schematics/core/organizationchart.cjs +91 -0
- package/schematics/core/overrides.cjs +179 -0
- package/schematics/core/picklist.cjs +262 -0
- package/schematics/core/select.cjs +172 -0
- package/schematics/core/splitter.cjs +69 -0
- package/schematics/core/table.cjs +183 -0
- package/schematics/core/terminal.cjs +34 -0
- package/schematics/core/thai/buddhist.cjs +135 -0
- package/schematics/core/thai/locale.cjs +654 -0
- package/schematics/core/thai/text.cjs +173 -0
- package/schematics/core/thai/thai-id.cjs +26 -0
- package/schematics/core/tokens.cjs +335 -0
- package/schematics/core/tree.cjs +144 -0
- package/schematics/core/validation.cjs +46 -0
- package/schematics/from-primeng/index.cjs +221 -0
- package/schematics/from-primeng/mapping.cjs +195 -0
- package/schematics/from-primeng/schema.cjs +2 -0
- package/schematics/from-primeng/schema.json +17 -0
- package/schematics/migration.json +4 -0
- package/schematics/ng-add/index.cjs +318 -0
- package/schematics/ng-add/schema.cjs +2 -0
- package/schematics/ng-add/schema.json +325 -0
- package/schematics/utils/ast.cjs +185 -0
- package/schematics/utils/workspace.cjs +115 -0
- package/scroller/index.d.ts +5 -0
- package/scroller/public-api.d.ts +5 -0
- package/scroller/scroller.component.d.ts +135 -0
- package/scroller/scroller.module.d.ts +8 -0
- package/scrollpanel/index.d.ts +5 -0
- package/scrollpanel/public-api.d.ts +2 -0
- package/scrollpanel/scrollpanel.component.d.ts +27 -0
- package/scrollpanel/scrollpanel.module.d.ts +8 -0
- package/select/index.d.ts +5 -0
- package/select/public-api.d.ts +6 -0
- package/select/select.base.d.ts +217 -0
- package/select/select.component.d.ts +11 -0
- package/select/select.module.d.ts +8 -0
- package/select/select.styles.d.ts +2 -0
- package/select/select.types.d.ts +9 -0
- package/selectbutton/index.d.ts +5 -0
- package/selectbutton/public-api.d.ts +3 -0
- package/selectbutton/selectbutton.component.d.ts +70 -0
- package/selectbutton/selectbutton.module.d.ts +9 -0
- package/selectbutton/selectbutton.types.d.ts +9 -0
- package/sitefooter/index.d.ts +5 -0
- package/sitefooter/public-api.d.ts +2 -0
- package/sitefooter/sitefooter.component.d.ts +69 -0
- package/sitefooter/sitefooter.module.d.ts +9 -0
- package/skeleton/index.d.ts +5 -0
- package/skeleton/public-api.d.ts +3 -0
- package/skeleton/skeleton.component.d.ts +22 -0
- package/skeleton/skeleton.module.d.ts +8 -0
- package/skeleton/skeleton.types.d.ts +2 -0
- package/slider/index.d.ts +5 -0
- package/slider/public-api.d.ts +2 -0
- package/slider/slider.component.d.ts +79 -0
- package/slider/slider.module.d.ts +8 -0
- package/splitbutton/index.d.ts +5 -0
- package/splitbutton/public-api.d.ts +2 -0
- package/splitbutton/splitbutton.component.d.ts +75 -0
- package/splitbutton/splitbutton.module.d.ts +8 -0
- package/splitter/index.d.ts +5 -0
- package/splitter/public-api.d.ts +4 -0
- package/splitter/splitter-panel.component.d.ts +20 -0
- package/splitter/splitter.component.d.ts +109 -0
- package/splitter/splitter.module.d.ts +10 -0
- package/splitter/splitter.types.d.ts +8 -0
- package/stepper/index.d.ts +5 -0
- package/stepper/public-api.d.ts +3 -0
- package/stepper/stepper.base.d.ts +200 -0
- package/stepper/stepper.component.d.ts +41 -0
- package/stepper/stepper.module.d.ts +9 -0
- package/steps/index.d.ts +5 -0
- package/steps/public-api.d.ts +3 -0
- package/steps/steps.base.d.ts +52 -0
- package/steps/steps.component.d.ts +7 -0
- package/steps/steps.module.d.ts +8 -0
- package/table/index.d.ts +5 -0
- package/table/public-api.d.ts +9 -0
- package/table/table-celleditor.component.d.ts +14 -0
- package/table/table-filter.component.d.ts +11 -0
- package/table/table.base.d.ts +410 -0
- package/table/table.celleditor.d.ts +20 -0
- package/table/table.component.d.ts +12 -0
- package/table/table.directives.d.ts +330 -0
- package/table/table.filter.d.ts +131 -0
- package/table/table.module.d.ts +12 -0
- package/table/table.types.d.ts +180 -0
- package/tabmenu/index.d.ts +5 -0
- package/tabmenu/public-api.d.ts +2 -0
- package/tabs/index.d.ts +5 -0
- package/tabs/public-api.d.ts +8 -0
- package/tabs/tabmenu.base.d.ts +59 -0
- package/tabs/tabmenu.component.d.ts +10 -0
- package/tabs/tabmenu.module.d.ts +9 -0
- package/tabs/tabs.component.d.ts +147 -0
- package/tabs/tabs.module.d.ts +10 -0
- package/tabs/tabs.styles.d.ts +2 -0
- package/tabs/tabs.types.d.ts +21 -0
- package/tag/index.d.ts +5 -0
- package/tag/public-api.d.ts +3 -0
- package/tag/tag.component.d.ts +24 -0
- package/tag/tag.module.d.ts +8 -0
- package/tag/tag.types.d.ts +2 -0
- package/terminal/index.d.ts +5 -0
- package/terminal/public-api.d.ts +5 -0
- package/terminal/terminal.component.d.ts +58 -0
- package/terminal/terminal.module.d.ts +8 -0
- package/terminal/terminal.service.d.ts +20 -0
- package/textarea/index.d.ts +5 -0
- package/textarea/public-api.d.ts +2 -0
- package/textarea/textarea.directive.d.ts +33 -0
- package/textarea/textarea.module.d.ts +8 -0
- package/thai/index.d.ts +5 -0
- package/thai/public-api.d.ts +3 -0
- package/thai/thai.module.d.ts +8 -0
- package/thai/thai.pipes.d.ts +57 -0
- package/theme/_api.scss +71 -0
- package/theme/_color.scss +153 -0
- package/theme/_data.scss +9283 -0
- package/theme/_index.scss +424 -0
- package/theme/_version.scss +2 -0
- package/themes/arun-blue/theme.css +1446 -0
- package/themes/arun-green/theme.css +1446 -0
- package/themes/arun-orange/theme.css +1445 -0
- package/themes/arun-purple/theme.css +1446 -0
- package/themes/md-dark-deeppurple/theme.css +1309 -0
- package/themes/md-dark-indigo/theme.css +1309 -0
- package/themes/md-light-deeppurple/theme.css +1418 -0
- package/themes/md-light-indigo/theme.css +1418 -0
- package/themes/ratri-blue/theme.css +1309 -0
- package/themes/ratri-green/theme.css +1309 -0
- package/themes/ratri-orange/theme.css +1309 -0
- package/themes/ratri-purple/theme.css +1309 -0
- package/themes/sayan-blue/theme.css +1309 -0
- package/themes/sayan-green/theme.css +1309 -0
- package/themes/sayan-orange/theme.css +1309 -0
- package/themes/sayan-purple/theme.css +1309 -0
- package/themes/sila-dark-blue/theme.css +1309 -0
- package/themes/sila-dark-indigo/theme.css +1309 -0
- package/themes/sila-dark-purple/theme.css +1309 -0
- package/themes/sila-dark-teal/theme.css +1309 -0
- package/themes/sila-light-blue/theme.css +1446 -0
- package/themes/sila-light-indigo/theme.css +1446 -0
- package/themes/sila-light-purple/theme.css +1446 -0
- package/themes/sila-light-teal/theme.css +1446 -0
- package/themes/sila-light-wira/theme.css +1446 -0
- package/tieredmenu/index.d.ts +5 -0
- package/tieredmenu/public-api.d.ts +2 -0
- package/tieredmenu/tieredmenu.component.d.ts +90 -0
- package/tieredmenu/tieredmenu.module.d.ts +8 -0
- package/timeline/index.d.ts +5 -0
- package/timeline/public-api.d.ts +3 -0
- package/timeline/timeline.base.d.ts +36 -0
- package/timeline/timeline.component.d.ts +7 -0
- package/timeline/timeline.module.d.ts +9 -0
- package/toast/index.d.ts +5 -0
- package/toast/message.service.d.ts +19 -0
- package/toast/public-api.d.ts +5 -0
- package/toast/toast.base.d.ts +84 -0
- package/toast/toast.component.d.ts +10 -0
- package/toast/toast.module.d.ts +9 -0
- package/toast/toast.types.d.ts +28 -0
- package/togglebutton/index.d.ts +5 -0
- package/togglebutton/public-api.d.ts +3 -0
- package/togglebutton/togglebutton.component.d.ts +56 -0
- package/togglebutton/togglebutton.module.d.ts +8 -0
- package/togglebutton/togglebutton.types.d.ts +4 -0
- package/toggleswitch/index.d.ts +5 -0
- package/toggleswitch/public-api.d.ts +3 -0
- package/toggleswitch/toggleswitch.component.d.ts +52 -0
- package/toggleswitch/toggleswitch.module.d.ts +8 -0
- package/toggleswitch/toggleswitch.types.d.ts +4 -0
- package/toolbar/index.d.ts +5 -0
- package/toolbar/public-api.d.ts +2 -0
- package/toolbar/toolbar.component.d.ts +29 -0
- package/toolbar/toolbar.module.d.ts +9 -0
- package/tooltip/index.d.ts +5 -0
- package/tooltip/public-api.d.ts +3 -0
- package/tooltip/tooltip.directive.d.ts +87 -0
- package/tooltip/tooltip.module.d.ts +8 -0
- package/tooltip/tooltip.styles.d.ts +2 -0
- package/tooltip/tooltip.types.d.ts +14 -0
- package/tree/index.d.ts +5 -0
- package/tree/public-api.d.ts +2 -0
- package/tree/tree.component.d.ts +149 -0
- package/tree/tree.module.d.ts +8 -0
- package/treeselect/index.d.ts +5 -0
- package/treeselect/public-api.d.ts +2 -0
- package/treeselect/treeselect.component.d.ts +140 -0
- package/treeselect/treeselect.module.d.ts +8 -0
- package/utils/_index.scss +532 -0
- package/utils/_palettes.scss +23 -0
- package/utils/utils.css +9280 -0
- package/utils/utils.min.css +1 -0
- package/validation/field-error.component.d.ts +39 -0
- package/validation/index.d.ts +5 -0
- package/validation/public-api.d.ts +3 -0
- package/validation/validation.module.d.ts +9 -0
- package/validation/validators.d.ts +33 -0
|
@@ -0,0 +1,3099 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { DOCUMENT, NgClass, NgFor, NgIf, NgStyle, NgSwitch, NgSwitchCase, NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, TemplateRef, EventEmitter, inject, ChangeDetectorRef, NgZone, ElementRef, Directive, Input, Output, ContentChildren, ContentChild, ViewChild, forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
5
|
+
import { ɵtoBool, WU_VERSION_INFO, ɵuniqueId, WuConfig, ɵrefreshOnTranslation, ɵassertSupportedAngular, ɵWU_SKIP_VERSION_CHECK, ɵWuStyleLoader, ɵfindTemplate, ɵWuPopup, ɵlockScroll, WuTemplate } from '@wirabyte/ui/config';
|
|
6
|
+
import { ɵWU_BUTTON_CSS, ɵbuttonClass } from '@wirabyte/ui/button';
|
|
7
|
+
import { ɵWU_INPUTTEXT_CSS } from '@wirabyte/ui/inputtext';
|
|
8
|
+
import { safeEditorUrl, safeEditorImage, editorToolbarGroups, editorToolOptions, EditorHistory, editorHtmlToText, TH_LOCALE, EDITOR_FONT_SIZES, acceptsFile, formatFileSize, isEmptyEditorHtml, editorCounts } from '@wirabyte/ui/core';
|
|
9
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* DOM helpers of wu-editor, free of Angular: selection save / restore, the HTML cleaner used for values, pastes and
|
|
13
|
+
* drops, block lookups and the table operations.
|
|
14
|
+
*/
|
|
15
|
+
const TEXT_BLOCKS = ['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'BLOCKQUOTE', 'PRE', 'LI', 'DIV', 'TD', 'TH'];
|
|
16
|
+
const BLOCK_SET = new Set([...TEXT_BLOCKS, 'UL', 'OL', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR', 'HR', 'FIGURE']);
|
|
17
|
+
function isBlock(node) {
|
|
18
|
+
return !!node && node.nodeType === 1 && BLOCK_SET.has(node.tagName);
|
|
19
|
+
}
|
|
20
|
+
// ---------- selection ----------
|
|
21
|
+
function nodePath(root, node) {
|
|
22
|
+
const path = [];
|
|
23
|
+
let n = node;
|
|
24
|
+
while (n && n !== root) {
|
|
25
|
+
const parent = n.parentNode;
|
|
26
|
+
if (!parent)
|
|
27
|
+
return null;
|
|
28
|
+
path.unshift(Array.prototype.indexOf.call(parent.childNodes, n));
|
|
29
|
+
n = parent;
|
|
30
|
+
}
|
|
31
|
+
return n === root ? path : null;
|
|
32
|
+
}
|
|
33
|
+
function nodeAt(root, path) {
|
|
34
|
+
let n = root;
|
|
35
|
+
for (const i of path) {
|
|
36
|
+
if (!n || !n.childNodes[i])
|
|
37
|
+
return null;
|
|
38
|
+
n = n.childNodes[i];
|
|
39
|
+
}
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
/** The selection's range when it is inside `root`. */
|
|
43
|
+
function rangeIn(root) {
|
|
44
|
+
const sel = root.ownerDocument.getSelection();
|
|
45
|
+
if (!sel || !sel.rangeCount)
|
|
46
|
+
return null;
|
|
47
|
+
const r = sel.getRangeAt(0);
|
|
48
|
+
return root.contains(r.commonAncestorContainer) ? r : null;
|
|
49
|
+
}
|
|
50
|
+
function saveSelection(root) {
|
|
51
|
+
const r = rangeIn(root);
|
|
52
|
+
if (!r)
|
|
53
|
+
return null;
|
|
54
|
+
const start = nodePath(root, r.startContainer);
|
|
55
|
+
const end = nodePath(root, r.endContainer);
|
|
56
|
+
return start && end ? { start, startOffset: r.startOffset, end, endOffset: r.endOffset } : null;
|
|
57
|
+
}
|
|
58
|
+
function restoreSelection(root, s) {
|
|
59
|
+
if (!s)
|
|
60
|
+
return false;
|
|
61
|
+
const a = nodeAt(root, s.start);
|
|
62
|
+
const b = nodeAt(root, s.end);
|
|
63
|
+
if (!a || !b)
|
|
64
|
+
return false;
|
|
65
|
+
const len = (n) => (n.nodeType === 3 ? n.length : n.childNodes.length);
|
|
66
|
+
const range = root.ownerDocument.createRange();
|
|
67
|
+
try {
|
|
68
|
+
range.setStart(a, Math.min(s.startOffset, len(a)));
|
|
69
|
+
range.setEnd(b, Math.min(s.endOffset, len(b)));
|
|
70
|
+
}
|
|
71
|
+
catch (_a) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
selectRange(range);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
function selectRange(range) {
|
|
78
|
+
var _a;
|
|
79
|
+
const sel = (_a = range.startContainer.ownerDocument) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
80
|
+
if (!sel)
|
|
81
|
+
return;
|
|
82
|
+
sel.removeAllRanges();
|
|
83
|
+
sel.addRange(range);
|
|
84
|
+
}
|
|
85
|
+
/** Puts the caret at the start (or end) of a node. */
|
|
86
|
+
function caretIn(node, atEnd = false) {
|
|
87
|
+
const doc = node.ownerDocument;
|
|
88
|
+
if (!doc)
|
|
89
|
+
return;
|
|
90
|
+
const r = doc.createRange();
|
|
91
|
+
r.selectNodeContents(node);
|
|
92
|
+
r.collapse(!atEnd);
|
|
93
|
+
selectRange(r);
|
|
94
|
+
}
|
|
95
|
+
function closestIn(node, root, selector) {
|
|
96
|
+
let el = node ? (node.nodeType === 1 ? node : node.parentElement) : null;
|
|
97
|
+
while (el && el !== root) {
|
|
98
|
+
if (el.matches(selector))
|
|
99
|
+
return el;
|
|
100
|
+
el = el.parentElement;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
/** The innermost text block holding a node (paragraph, heading, list item, cell …). */
|
|
105
|
+
function blockOf(node, root) {
|
|
106
|
+
let el = node ? (node.nodeType === 1 ? node : node.parentElement) : null;
|
|
107
|
+
while (el && el !== root) {
|
|
108
|
+
if (TEXT_BLOCKS.includes(el.tagName))
|
|
109
|
+
return el;
|
|
110
|
+
el = el.parentElement;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
/** Text blocks the range touches, in document order (cells and list items count; their wrappers do not). */
|
|
115
|
+
function blocksIn(root, range) {
|
|
116
|
+
const out = [];
|
|
117
|
+
const add = (b) => {
|
|
118
|
+
if (b && !out.includes(b))
|
|
119
|
+
out.push(b);
|
|
120
|
+
};
|
|
121
|
+
add(blockOf(range.startContainer, root));
|
|
122
|
+
const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
|
|
123
|
+
let n = walker.nextNode();
|
|
124
|
+
while (n) {
|
|
125
|
+
if (TEXT_BLOCKS.includes(n.tagName) && range.intersectsNode(n) && !n.querySelector(TEXT_BLOCKS.join(',')))
|
|
126
|
+
add(n);
|
|
127
|
+
n = walker.nextNode();
|
|
128
|
+
}
|
|
129
|
+
add(blockOf(range.endContainer, root));
|
|
130
|
+
return out.filter((b) => !(range.collapsed && b !== blockOf(range.startContainer, root)));
|
|
131
|
+
}
|
|
132
|
+
// ---------- class helpers (Quill-compatible class names, so saved HTML keeps working) ----------
|
|
133
|
+
/** Replaces the class matching `prefix` (e.g. `ql-align-`) with `prefix + value`, or removes it when value is empty. */
|
|
134
|
+
function setPrefixedClass(el, prefix, value) {
|
|
135
|
+
for (const c of Array.from(el.classList))
|
|
136
|
+
if (c.startsWith(prefix))
|
|
137
|
+
el.classList.remove(c);
|
|
138
|
+
if (value)
|
|
139
|
+
el.classList.add(prefix + value);
|
|
140
|
+
if (!el.classList.length)
|
|
141
|
+
el.removeAttribute('class');
|
|
142
|
+
}
|
|
143
|
+
function prefixedClass(el, prefix) {
|
|
144
|
+
if (!el)
|
|
145
|
+
return null;
|
|
146
|
+
for (const c of Array.from(el.classList))
|
|
147
|
+
if (c.startsWith(prefix))
|
|
148
|
+
return c.slice(prefix.length);
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
// ---------- the cleaner ----------
|
|
152
|
+
const DROP = new Set(['SCRIPT', 'STYLE', 'IFRAME', 'OBJECT', 'EMBED', 'META', 'LINK', 'TITLE', 'HEAD', 'SVG', 'MATH', 'FORM', 'INPUT', 'BUTTON', 'TEXTAREA', 'SELECT', 'OPTION', 'NOSCRIPT', 'TEMPLATE', 'CANVAS', 'VIDEO', 'AUDIO', 'SOURCE', 'XML']);
|
|
153
|
+
const ALLOWED = {
|
|
154
|
+
P: ['class', 'style'],
|
|
155
|
+
H1: ['class', 'style'],
|
|
156
|
+
H2: ['class', 'style'],
|
|
157
|
+
H3: ['class', 'style'],
|
|
158
|
+
H4: ['class', 'style'],
|
|
159
|
+
H5: ['class', 'style'],
|
|
160
|
+
H6: ['class', 'style'],
|
|
161
|
+
BLOCKQUOTE: ['class', 'style'],
|
|
162
|
+
PRE: ['class', 'spellcheck'],
|
|
163
|
+
CODE: [],
|
|
164
|
+
STRONG: [],
|
|
165
|
+
EM: [],
|
|
166
|
+
U: [],
|
|
167
|
+
S: [],
|
|
168
|
+
SUB: [],
|
|
169
|
+
SUP: [],
|
|
170
|
+
BR: [],
|
|
171
|
+
HR: [],
|
|
172
|
+
SPAN: ['class', 'style'],
|
|
173
|
+
A: ['href', 'target', 'rel', 'title'],
|
|
174
|
+
UL: ['class'],
|
|
175
|
+
OL: ['class', 'start', 'type'],
|
|
176
|
+
LI: ['class', 'style'],
|
|
177
|
+
IMG: ['src', 'alt', 'width', 'height', 'class', 'title'],
|
|
178
|
+
TABLE: ['class', 'style'],
|
|
179
|
+
THEAD: [],
|
|
180
|
+
TBODY: [],
|
|
181
|
+
TFOOT: [],
|
|
182
|
+
TR: [],
|
|
183
|
+
TH: ['colspan', 'rowspan', 'class', 'style'],
|
|
184
|
+
TD: ['colspan', 'rowspan', 'class', 'style'],
|
|
185
|
+
COLGROUP: [],
|
|
186
|
+
COL: ['width', 'span', 'style'],
|
|
187
|
+
CAPTION: [],
|
|
188
|
+
FIGURE: ['class'],
|
|
189
|
+
FIGCAPTION: [],
|
|
190
|
+
};
|
|
191
|
+
const RENAME = { B: 'STRONG', I: 'EM', STRIKE: 'S', DEL: 'S', INS: 'U', DIV: 'P', H7: 'P', ARTICLE: 'P', SECTION: 'P' };
|
|
192
|
+
const INLINE_TAGS = new Set(['STRONG', 'EM', 'U', 'S', 'SUB', 'SUP', 'CODE', 'A']);
|
|
193
|
+
const STYLE_PROPS = ['color', 'background-color', 'text-align', 'font-size', 'font-family', 'width', 'margin-left', 'padding-left'];
|
|
194
|
+
const CLASS_OK = /^(ql-(align|indent|size|font|direction)-[\w-]+|ql-syntax|wu-image-(left|center|right|inline)|wu-editor-table)$/;
|
|
195
|
+
/**
|
|
196
|
+
* Cleans HTML for the editor: only the tags and attributes it understands, safe links and images, a few inline styles
|
|
197
|
+
* (colours, alignment, size, font, image width). Pastes from Word, Google Docs and web pages lose their own markup;
|
|
198
|
+
* values saved by Quill keep their `ql-*` classes. Returns the clean HTML.
|
|
199
|
+
*/
|
|
200
|
+
function cleanEditorHtml(html, doc, o = {}) {
|
|
201
|
+
const tpl = doc.createElement('template');
|
|
202
|
+
tpl.innerHTML = html || '';
|
|
203
|
+
const root = tpl.content;
|
|
204
|
+
// Quill 2 writes bullet lists as <ol><li data-list="bullet">.
|
|
205
|
+
root.querySelectorAll('ol').forEach((ol) => {
|
|
206
|
+
const items = Array.from(ol.children);
|
|
207
|
+
if (items.length && items.every((li) => li.getAttribute('data-list') === 'bullet')) {
|
|
208
|
+
const ul = doc.createElement('ul');
|
|
209
|
+
while (ol.firstChild)
|
|
210
|
+
ul.appendChild(ol.firstChild);
|
|
211
|
+
ol.replaceWith(ul);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
cleanChildren(root, doc, o);
|
|
215
|
+
wrapLoose(root, doc);
|
|
216
|
+
const div = doc.createElement('div');
|
|
217
|
+
div.appendChild(root);
|
|
218
|
+
return div.innerHTML;
|
|
219
|
+
}
|
|
220
|
+
function cleanChildren(parent, doc, o) {
|
|
221
|
+
var _a;
|
|
222
|
+
const inPre = !!((_a = parent.closest) === null || _a === void 0 ? void 0 : _a.call(parent, 'pre'));
|
|
223
|
+
for (const node of Array.from(parent.childNodes)) {
|
|
224
|
+
if (node.nodeType === 8) {
|
|
225
|
+
node.remove();
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
if (node.nodeType === 3) {
|
|
229
|
+
// Source formatting (newlines, indentation) is not content, except inside code blocks.
|
|
230
|
+
if (!inPre)
|
|
231
|
+
node.nodeValue = (node.nodeValue || '').replace(/[\t\n\r ]+/g, ' ');
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (node.nodeType !== 1)
|
|
235
|
+
continue;
|
|
236
|
+
let el = node;
|
|
237
|
+
const tag = el.tagName.toUpperCase();
|
|
238
|
+
if (DROP.has(tag) || tag.includes(':')) {
|
|
239
|
+
// Word's <o:p> and friends hold nothing worth keeping.
|
|
240
|
+
el.remove();
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
// Google Docs wraps everything in <b style="font-weight:normal">.
|
|
244
|
+
if (tag === 'B' && /font-weight\s*:\s*(normal|400)/i.test(el.getAttribute('style') || '')) {
|
|
245
|
+
cleanChildren(el, doc, o);
|
|
246
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (tag === 'FONT') {
|
|
250
|
+
const span = doc.createElement('span');
|
|
251
|
+
const color = el.getAttribute('color');
|
|
252
|
+
if (color)
|
|
253
|
+
span.style.color = color;
|
|
254
|
+
const face = el.getAttribute('face');
|
|
255
|
+
if (face)
|
|
256
|
+
span.style.fontFamily = face;
|
|
257
|
+
while (el.firstChild)
|
|
258
|
+
span.appendChild(el.firstChild);
|
|
259
|
+
el.replaceWith(span);
|
|
260
|
+
el = span;
|
|
261
|
+
}
|
|
262
|
+
else if (RENAME[tag]) {
|
|
263
|
+
const target = RENAME[tag];
|
|
264
|
+
// A div holding blocks is just a wrapper: keep its children.
|
|
265
|
+
if (tag === 'DIV' && Array.from(el.children).some((c) => isBlock(c))) {
|
|
266
|
+
cleanChildren(el, doc, o);
|
|
267
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
const renamed = doc.createElement(target);
|
|
271
|
+
for (const a of Array.from(el.attributes))
|
|
272
|
+
renamed.setAttribute(a.name, a.value);
|
|
273
|
+
while (el.firstChild)
|
|
274
|
+
renamed.appendChild(el.firstChild);
|
|
275
|
+
el.replaceWith(renamed);
|
|
276
|
+
el = renamed;
|
|
277
|
+
}
|
|
278
|
+
const name = el.tagName.toUpperCase();
|
|
279
|
+
// Browsers put colours straight on <strong>, <em> …; colours live on spans, as before.
|
|
280
|
+
if (INLINE_TAGS.has(name) && el.getAttribute('style')) {
|
|
281
|
+
const span = doc.createElement('span');
|
|
282
|
+
span.setAttribute('style', el.getAttribute('style') || '');
|
|
283
|
+
el.removeAttribute('style');
|
|
284
|
+
while (el.firstChild)
|
|
285
|
+
span.appendChild(el.firstChild);
|
|
286
|
+
el.appendChild(span);
|
|
287
|
+
}
|
|
288
|
+
const allowed = ALLOWED[name];
|
|
289
|
+
if (!allowed) {
|
|
290
|
+
// Unknown wrappers (section, label, …) give way to their content.
|
|
291
|
+
cleanChildren(el, doc, o);
|
|
292
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
for (const a of Array.from(el.attributes)) {
|
|
296
|
+
const n = a.name.toLowerCase();
|
|
297
|
+
if (!allowed.includes(n))
|
|
298
|
+
el.removeAttribute(a.name);
|
|
299
|
+
}
|
|
300
|
+
if (el.hasAttribute('class')) {
|
|
301
|
+
const keep = Array.from(el.classList).filter((c) => CLASS_OK.test(c));
|
|
302
|
+
if (keep.length)
|
|
303
|
+
el.setAttribute('class', keep.join(' '));
|
|
304
|
+
else
|
|
305
|
+
el.removeAttribute('class');
|
|
306
|
+
}
|
|
307
|
+
if (el.hasAttribute('style')) {
|
|
308
|
+
const kept = [];
|
|
309
|
+
for (const prop of STYLE_PROPS) {
|
|
310
|
+
const v = el.style.getPropertyValue(prop);
|
|
311
|
+
// Safari copies the page's own styles (theme variables, inherit) onto what it pastes; those are not content.
|
|
312
|
+
if (v && !/expression|url\(|javascript|var\(|^(inherit|initial|unset|normal)$/i.test(v.trim()))
|
|
313
|
+
kept.push(`${prop}: ${v}`);
|
|
314
|
+
}
|
|
315
|
+
// Width only on tables, their columns and cells.
|
|
316
|
+
const out = kept.filter((d) => !d.startsWith('width') || ['TABLE', 'COL', 'TD', 'TH'].includes(name));
|
|
317
|
+
if (out.length)
|
|
318
|
+
el.setAttribute('style', out.join('; '));
|
|
319
|
+
else
|
|
320
|
+
el.removeAttribute('style');
|
|
321
|
+
}
|
|
322
|
+
if (name === 'A') {
|
|
323
|
+
const href = el.getAttribute('href');
|
|
324
|
+
if (!href || !safeEditorUrl(href, o.protocols)) {
|
|
325
|
+
// A link that goes nowhere is just its text.
|
|
326
|
+
cleanChildren(el, doc, o);
|
|
327
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
if (el.getAttribute('target') === '_blank')
|
|
331
|
+
el.setAttribute('rel', 'noopener noreferrer');
|
|
332
|
+
else
|
|
333
|
+
el.removeAttribute('target');
|
|
334
|
+
}
|
|
335
|
+
if (name === 'IMG') {
|
|
336
|
+
const src = el.getAttribute('src') || '';
|
|
337
|
+
if (!safeEditorImage(src)) {
|
|
338
|
+
el.remove();
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (name === 'SPAN' && !el.attributes.length) {
|
|
343
|
+
cleanChildren(el, doc, o);
|
|
344
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
cleanChildren(el, doc, o);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/** Text and inline content directly in the root goes into paragraphs. */
|
|
351
|
+
function wrapLoose(root, doc) {
|
|
352
|
+
var _a;
|
|
353
|
+
let p = null;
|
|
354
|
+
for (const node of Array.from(root.childNodes)) {
|
|
355
|
+
const inline = node.nodeType === 3 ? !!((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || !!p : node.nodeType === 1 && !isBlock(node);
|
|
356
|
+
if (inline) {
|
|
357
|
+
if (!p) {
|
|
358
|
+
p = doc.createElement('p');
|
|
359
|
+
root.insertBefore(p, node);
|
|
360
|
+
}
|
|
361
|
+
p.appendChild(node);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
if (node.nodeType === 3)
|
|
365
|
+
node.remove();
|
|
366
|
+
p = null;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
function tableGrid(table) {
|
|
371
|
+
const rows = Array.from(table.rows);
|
|
372
|
+
const grid = rows.map(() => []);
|
|
373
|
+
rows.forEach((tr, r) => {
|
|
374
|
+
let c = 0;
|
|
375
|
+
for (const cell of Array.from(tr.cells)) {
|
|
376
|
+
while (grid[r][c])
|
|
377
|
+
c++;
|
|
378
|
+
const rs = Math.max(1, cell.rowSpan || 1);
|
|
379
|
+
const cs = Math.max(1, cell.colSpan || 1);
|
|
380
|
+
for (let i = 0; i < rs && r + i < rows.length; i++)
|
|
381
|
+
for (let j = 0; j < cs; j++)
|
|
382
|
+
grid[r + i][c + j] = cell;
|
|
383
|
+
c += cs;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
const cols = Math.max(0, ...grid.map((row) => row.length));
|
|
387
|
+
return { grid, rows, cols };
|
|
388
|
+
}
|
|
389
|
+
/** Row and column of a cell's top-left slot. */
|
|
390
|
+
function cellSlot(g, cell) {
|
|
391
|
+
for (let r = 0; r < g.grid.length; r++) {
|
|
392
|
+
const c = g.grid[r].indexOf(cell);
|
|
393
|
+
if (c >= 0)
|
|
394
|
+
return { row: r, col: c };
|
|
395
|
+
}
|
|
396
|
+
return { row: -1, col: -1 };
|
|
397
|
+
}
|
|
398
|
+
/** Sets a row / column span; a span of 1 leaves no attribute behind. */
|
|
399
|
+
function setSpan(cell, kind, n) {
|
|
400
|
+
const attr = kind === 'row' ? 'rowspan' : 'colspan';
|
|
401
|
+
if (n > 1)
|
|
402
|
+
cell.setAttribute(attr, String(n));
|
|
403
|
+
else
|
|
404
|
+
cell.removeAttribute(attr);
|
|
405
|
+
}
|
|
406
|
+
function newCell(doc, tag) {
|
|
407
|
+
const cell = doc.createElement(tag);
|
|
408
|
+
cell.appendChild(doc.createElement('br'));
|
|
409
|
+
return cell;
|
|
410
|
+
}
|
|
411
|
+
/** A new table, `rows` × `cols`, with a header row when asked. */
|
|
412
|
+
function createTable(doc, rows, cols, headerRow) {
|
|
413
|
+
const table = doc.createElement('table');
|
|
414
|
+
table.className = 'wu-editor-table';
|
|
415
|
+
if (headerRow) {
|
|
416
|
+
const thead = table.createTHead();
|
|
417
|
+
const tr = thead.insertRow();
|
|
418
|
+
for (let c = 0; c < cols; c++)
|
|
419
|
+
tr.appendChild(newCell(doc, 'th'));
|
|
420
|
+
}
|
|
421
|
+
const tbody = table.createTBody();
|
|
422
|
+
for (let r = 0; r < (headerRow ? rows - 1 : rows); r++) {
|
|
423
|
+
const tr = tbody.insertRow();
|
|
424
|
+
for (let c = 0; c < cols; c++)
|
|
425
|
+
tr.appendChild(newCell(doc, 'td'));
|
|
426
|
+
}
|
|
427
|
+
// The full width of the text, with even columns in %, so it follows the page on any screen.
|
|
428
|
+
table.style.width = '100%';
|
|
429
|
+
const group = doc.createElement('colgroup');
|
|
430
|
+
for (let c = 0; c < cols; c++) {
|
|
431
|
+
const col = doc.createElement('col');
|
|
432
|
+
col.style.width = percent(100 / cols);
|
|
433
|
+
group.appendChild(col);
|
|
434
|
+
}
|
|
435
|
+
table.insertBefore(group, table.firstChild);
|
|
436
|
+
return table;
|
|
437
|
+
}
|
|
438
|
+
/** A width in % with at most two decimals. */
|
|
439
|
+
function percent(n) {
|
|
440
|
+
return `${Math.round(Math.max(0, n) * 100) / 100}%`;
|
|
441
|
+
}
|
|
442
|
+
/** The <col>s of the table's <colgroup>, one per column; null when it has none or they do not match the columns. */
|
|
443
|
+
function tableCols(table) {
|
|
444
|
+
const group = Array.from(table.children).find((c) => c.tagName === 'COLGROUP');
|
|
445
|
+
if (!group)
|
|
446
|
+
return null;
|
|
447
|
+
const cols = Array.from(group.children).filter((c) => c.tagName === 'COL');
|
|
448
|
+
return cols.length && cols.length === tableGrid(table).cols ? cols : null;
|
|
449
|
+
}
|
|
450
|
+
/** Gives the table one <col> per column with its width in % of the table, measured from how it is drawn now. */
|
|
451
|
+
function ensureTableCols(table) {
|
|
452
|
+
var _a;
|
|
453
|
+
const have = tableCols(table);
|
|
454
|
+
if (have)
|
|
455
|
+
return have;
|
|
456
|
+
const g = tableGrid(table);
|
|
457
|
+
const doc = table.ownerDocument;
|
|
458
|
+
const widths = [];
|
|
459
|
+
for (let c = 0; c < g.cols; c++) {
|
|
460
|
+
let w = 0;
|
|
461
|
+
for (const row of g.grid) {
|
|
462
|
+
const cell = row[c];
|
|
463
|
+
if (cell && (cell.colSpan || 1) === 1) {
|
|
464
|
+
w = cell.getBoundingClientRect().width;
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
widths.push(w);
|
|
469
|
+
}
|
|
470
|
+
const known = widths.filter((w) => w > 0);
|
|
471
|
+
const fallback = known.length ? known.reduce((a, b) => a + b, 0) / known.length : 1;
|
|
472
|
+
const full = widths.map((w) => w || fallback);
|
|
473
|
+
const sum = full.reduce((a, b) => a + b, 0) || 1;
|
|
474
|
+
Array.from(table.children)
|
|
475
|
+
.filter((c) => c.tagName === 'COLGROUP')
|
|
476
|
+
.forEach((c) => c.remove());
|
|
477
|
+
const group = doc.createElement('colgroup');
|
|
478
|
+
const cols = full.map((w) => {
|
|
479
|
+
const col = doc.createElement('col');
|
|
480
|
+
col.style.width = percent((w / sum) * 100);
|
|
481
|
+
group.appendChild(col);
|
|
482
|
+
return col;
|
|
483
|
+
});
|
|
484
|
+
table.insertBefore(group, table.firstChild);
|
|
485
|
+
if (!table.style.width)
|
|
486
|
+
table.style.width = percent((table.getBoundingClientRect().width / Math.max(1, ((_a = table.parentElement) === null || _a === void 0 ? void 0 : _a.clientWidth) || 1)) * 100);
|
|
487
|
+
return cols;
|
|
488
|
+
}
|
|
489
|
+
/** The rectangle of grid slots from cell `a` to cell `b`, grown until no merged cell sticks out of it. */
|
|
490
|
+
function cellRect(table, a, b) {
|
|
491
|
+
var _a;
|
|
492
|
+
const g = tableGrid(table);
|
|
493
|
+
const sa = cellSlot(g, a);
|
|
494
|
+
const sb = cellSlot(g, b);
|
|
495
|
+
let r1 = Math.min(sa.row, sb.row);
|
|
496
|
+
let c1 = Math.min(sa.col, sb.col);
|
|
497
|
+
let r2 = Math.max(sa.row + (a.rowSpan || 1) - 1, sb.row + (b.rowSpan || 1) - 1);
|
|
498
|
+
let c2 = Math.max(sa.col + (a.colSpan || 1) - 1, sb.col + (b.colSpan || 1) - 1);
|
|
499
|
+
for (let grown = true; grown;) {
|
|
500
|
+
grown = false;
|
|
501
|
+
for (let r = r1; r <= r2; r++) {
|
|
502
|
+
for (let c = c1; c <= c2; c++) {
|
|
503
|
+
const cell = (_a = g.grid[r]) === null || _a === void 0 ? void 0 : _a[c];
|
|
504
|
+
if (!cell)
|
|
505
|
+
continue;
|
|
506
|
+
const s = cellSlot(g, cell);
|
|
507
|
+
const er = s.row + (cell.rowSpan || 1) - 1;
|
|
508
|
+
const ec = s.col + (cell.colSpan || 1) - 1;
|
|
509
|
+
if (s.row < r1 || s.col < c1 || er > r2 || ec > c2) {
|
|
510
|
+
r1 = Math.min(r1, s.row);
|
|
511
|
+
c1 = Math.min(c1, s.col);
|
|
512
|
+
r2 = Math.max(r2, er);
|
|
513
|
+
c2 = Math.max(c2, ec);
|
|
514
|
+
grown = true;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return { r1, c1, r2, c2 };
|
|
520
|
+
}
|
|
521
|
+
/** The cells inside a rectangle of slots, each once, in reading order. */
|
|
522
|
+
function cellsInRect(table, rect) {
|
|
523
|
+
var _a;
|
|
524
|
+
const g = tableGrid(table);
|
|
525
|
+
const out = [];
|
|
526
|
+
for (let r = rect.r1; r <= rect.r2; r++) {
|
|
527
|
+
for (let c = rect.c1; c <= rect.c2; c++) {
|
|
528
|
+
const cell = (_a = g.grid[r]) === null || _a === void 0 ? void 0 : _a[c];
|
|
529
|
+
if (cell && !out.includes(cell))
|
|
530
|
+
out.push(cell);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return out;
|
|
534
|
+
}
|
|
535
|
+
/** Joins every cell of the rectangle into its top-left one (their content kept, one after another). */
|
|
536
|
+
function mergeRect(table, rect) {
|
|
537
|
+
const cells = cellsInRect(table, rect);
|
|
538
|
+
if (cells.length < 2)
|
|
539
|
+
return null;
|
|
540
|
+
const target = cells[0];
|
|
541
|
+
const filled = (c) => { var _a; return !!(((_a = c.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || c.querySelector('img, table')); };
|
|
542
|
+
if (!filled(target))
|
|
543
|
+
target.innerHTML = '';
|
|
544
|
+
for (const cell of cells.slice(1)) {
|
|
545
|
+
if (filled(cell)) {
|
|
546
|
+
if (target.childNodes.length)
|
|
547
|
+
target.appendChild(table.ownerDocument.createElement('br'));
|
|
548
|
+
while (cell.firstChild)
|
|
549
|
+
target.appendChild(cell.firstChild);
|
|
550
|
+
}
|
|
551
|
+
cell.remove();
|
|
552
|
+
}
|
|
553
|
+
if (!target.childNodes.length)
|
|
554
|
+
target.appendChild(table.ownerDocument.createElement('br'));
|
|
555
|
+
setSpan(target, 'row', rect.r2 - rect.r1 + 1);
|
|
556
|
+
setSpan(target, 'col', rect.c2 - rect.c1 + 1);
|
|
557
|
+
return target;
|
|
558
|
+
}
|
|
559
|
+
/** Inserts a row above or below the cell's row; cells merged across the spot grow. Returns the new row's first cell. */
|
|
560
|
+
function insertRow(cell, below) {
|
|
561
|
+
var _a, _b;
|
|
562
|
+
const table = cell.closest('table');
|
|
563
|
+
const doc = cell.ownerDocument;
|
|
564
|
+
const g = tableGrid(table);
|
|
565
|
+
const { row } = cellSlot(g, cell);
|
|
566
|
+
const at = below ? row + (cell.rowSpan || 1) - 1 : row;
|
|
567
|
+
const ref = g.rows[at];
|
|
568
|
+
const tr = doc.createElement('tr');
|
|
569
|
+
const tag = ((_a = ref.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'THEAD' && !below ? 'th' : 'td';
|
|
570
|
+
const seen = new Set();
|
|
571
|
+
for (let c = 0; c < g.cols; c++) {
|
|
572
|
+
const covering = g.grid[at][c];
|
|
573
|
+
const spansAcross = covering && (below ? cellSlot(g, covering).row + (covering.rowSpan || 1) - 1 > at : cellSlot(g, covering).row < at);
|
|
574
|
+
if (spansAcross) {
|
|
575
|
+
if (!seen.has(covering)) {
|
|
576
|
+
setSpan(covering, 'row', (covering.rowSpan || 1) + 1);
|
|
577
|
+
seen.add(covering);
|
|
578
|
+
}
|
|
579
|
+
c += (covering.colSpan || 1) - 1;
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
tr.appendChild(newCell(doc, tag === 'th' && below ? 'td' : tag));
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
// A row added under the header row goes into the body.
|
|
586
|
+
if (below && ((_b = ref.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'THEAD') {
|
|
587
|
+
const body = table.tBodies[0] || table.createTBody();
|
|
588
|
+
body.insertBefore(tr, body.firstChild);
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
ref.parentElement.insertBefore(tr, below ? ref.nextSibling : ref);
|
|
592
|
+
}
|
|
593
|
+
return tr.cells[0] || null;
|
|
594
|
+
}
|
|
595
|
+
/** Inserts a column left or right of the cell's column. */
|
|
596
|
+
function insertColumn(cell, right) {
|
|
597
|
+
const table = cell.closest('table');
|
|
598
|
+
const doc = cell.ownerDocument;
|
|
599
|
+
const g = tableGrid(table);
|
|
600
|
+
const { col } = cellSlot(g, cell);
|
|
601
|
+
const at = right ? col + (cell.colSpan || 1) - 1 : col;
|
|
602
|
+
// The new column takes half of the one it sits beside.
|
|
603
|
+
const cols = tableCols(table);
|
|
604
|
+
if (cols) {
|
|
605
|
+
const ref = cols[at];
|
|
606
|
+
const half = (parseFloat(ref.style.width) || 100 / (cols.length + 1)) / 2;
|
|
607
|
+
const fresh = doc.createElement('col');
|
|
608
|
+
ref.style.width = percent(half);
|
|
609
|
+
fresh.style.width = percent(half);
|
|
610
|
+
ref.parentElement.insertBefore(fresh, right ? ref.nextSibling : ref);
|
|
611
|
+
}
|
|
612
|
+
const grown = new Set();
|
|
613
|
+
g.rows.forEach((tr, r) => {
|
|
614
|
+
var _a;
|
|
615
|
+
const covering = g.grid[r][at];
|
|
616
|
+
if (!covering) {
|
|
617
|
+
tr.appendChild(newCell(doc, ((_a = tr.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'THEAD' ? 'th' : 'td'));
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
const slot = cellSlot(g, covering);
|
|
621
|
+
const inside = right ? slot.col + (covering.colSpan || 1) - 1 > at : slot.col < at;
|
|
622
|
+
if (inside) {
|
|
623
|
+
if (!grown.has(covering)) {
|
|
624
|
+
setSpan(covering, 'col', (covering.colSpan || 1) + 1);
|
|
625
|
+
grown.add(covering);
|
|
626
|
+
}
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
if (slot.row !== r)
|
|
630
|
+
return; // a cell merged down from above already covers this row's slot
|
|
631
|
+
const fresh = newCell(doc, covering.tagName === 'TH' ? 'th' : 'td');
|
|
632
|
+
if ((covering.rowSpan || 1) > 1)
|
|
633
|
+
setSpan(fresh, 'row', covering.rowSpan);
|
|
634
|
+
covering.parentElement.insertBefore(fresh, right ? covering.nextSibling : covering);
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
/** Removes the cell's row (merged cells shrink). Returns a cell to put the caret in, or null when the table is empty. */
|
|
638
|
+
function deleteRow(cell) {
|
|
639
|
+
var _a;
|
|
640
|
+
const table = cell.closest('table');
|
|
641
|
+
const g = tableGrid(table);
|
|
642
|
+
const { row } = cellSlot(g, cell);
|
|
643
|
+
const tr = g.rows[row];
|
|
644
|
+
const done = new Set();
|
|
645
|
+
for (let c = 0; c < g.cols; c++) {
|
|
646
|
+
const covering = g.grid[row][c];
|
|
647
|
+
if (!covering || done.has(covering))
|
|
648
|
+
continue;
|
|
649
|
+
done.add(covering);
|
|
650
|
+
const slot = cellSlot(g, covering);
|
|
651
|
+
const rs = covering.rowSpan || 1;
|
|
652
|
+
if (rs > 1) {
|
|
653
|
+
if (slot.row === row) {
|
|
654
|
+
// Move the merged cell down into the next row.
|
|
655
|
+
const next = g.rows[row + 1];
|
|
656
|
+
setSpan(covering, 'row', rs - 1);
|
|
657
|
+
const after = g.grid[row + 1].slice(0, c).reverse().find((x) => x && x.parentElement === next);
|
|
658
|
+
next.insertBefore(covering, after ? after.nextSibling : next.firstChild);
|
|
659
|
+
}
|
|
660
|
+
else {
|
|
661
|
+
setSpan(covering, 'row', rs - 1);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
const target = ((_a = (g.rows[row + 1] || g.rows[row - 1])) === null || _a === void 0 ? void 0 : _a.cells[0]) || null;
|
|
666
|
+
tr.remove();
|
|
667
|
+
if (!table.rows.length) {
|
|
668
|
+
table.remove();
|
|
669
|
+
return null;
|
|
670
|
+
}
|
|
671
|
+
return target && target.isConnected ? target : table.rows[0].cells[0] || null;
|
|
672
|
+
}
|
|
673
|
+
/** Removes the cell's column. */
|
|
674
|
+
function deleteColumn(cell) {
|
|
675
|
+
const table = cell.closest('table');
|
|
676
|
+
const cols = tableCols(table);
|
|
677
|
+
const g = tableGrid(table);
|
|
678
|
+
const { row, col } = cellSlot(g, cell);
|
|
679
|
+
// Its width goes to the neighbour.
|
|
680
|
+
if (cols) {
|
|
681
|
+
const gone = cols[col];
|
|
682
|
+
const next = cols[col + 1] || cols[col - 1];
|
|
683
|
+
if (next)
|
|
684
|
+
next.style.width = percent((parseFloat(next.style.width) || 0) + (parseFloat(gone.style.width) || 0));
|
|
685
|
+
gone.remove();
|
|
686
|
+
}
|
|
687
|
+
const done = new Set();
|
|
688
|
+
g.rows.forEach((_, r) => {
|
|
689
|
+
const covering = g.grid[r][col];
|
|
690
|
+
if (!covering || done.has(covering))
|
|
691
|
+
return;
|
|
692
|
+
done.add(covering);
|
|
693
|
+
if ((covering.colSpan || 1) > 1)
|
|
694
|
+
setSpan(covering, 'col', covering.colSpan - 1);
|
|
695
|
+
else
|
|
696
|
+
covering.remove();
|
|
697
|
+
});
|
|
698
|
+
if (!table.querySelector('td, th')) {
|
|
699
|
+
table.remove();
|
|
700
|
+
return null;
|
|
701
|
+
}
|
|
702
|
+
const g2 = tableGrid(table);
|
|
703
|
+
const r = Math.min(row, g2.grid.length - 1);
|
|
704
|
+
return g2.grid[r][Math.min(col, g2.grid[r].length - 1)] || table.querySelector('td, th');
|
|
705
|
+
}
|
|
706
|
+
/** Joins the cell with the one to its right (same height), or below (same width). Returns whether it merged. */
|
|
707
|
+
function mergeCells(cell, direction) {
|
|
708
|
+
var _a, _b, _c, _d;
|
|
709
|
+
const table = cell.closest('table');
|
|
710
|
+
const g = tableGrid(table);
|
|
711
|
+
const { row, col } = cellSlot(g, cell);
|
|
712
|
+
const rs = cell.rowSpan || 1;
|
|
713
|
+
const cs = cell.colSpan || 1;
|
|
714
|
+
const other = direction === 'right' ? (_a = g.grid[row]) === null || _a === void 0 ? void 0 : _a[col + cs] : (_b = g.grid[row + rs]) === null || _b === void 0 ? void 0 : _b[col];
|
|
715
|
+
if (!other || other === cell)
|
|
716
|
+
return false;
|
|
717
|
+
const o = cellSlot(g, other);
|
|
718
|
+
if (direction === 'right' && (o.row !== row || (other.rowSpan || 1) !== rs))
|
|
719
|
+
return false;
|
|
720
|
+
if (direction === 'down' && (o.col !== col || (other.colSpan || 1) !== cs))
|
|
721
|
+
return false;
|
|
722
|
+
if (((_c = other.textContent) === null || _c === void 0 ? void 0 : _c.trim()) || other.querySelector('img')) {
|
|
723
|
+
if (!((_d = cell.textContent) === null || _d === void 0 ? void 0 : _d.trim()))
|
|
724
|
+
cell.innerHTML = '';
|
|
725
|
+
else
|
|
726
|
+
cell.appendChild(cell.ownerDocument.createElement('br'));
|
|
727
|
+
while (other.firstChild)
|
|
728
|
+
cell.appendChild(other.firstChild);
|
|
729
|
+
}
|
|
730
|
+
if (direction === 'right')
|
|
731
|
+
setSpan(cell, 'col', cs + (other.colSpan || 1));
|
|
732
|
+
else
|
|
733
|
+
setSpan(cell, 'row', rs + (other.rowSpan || 1));
|
|
734
|
+
other.remove();
|
|
735
|
+
return true;
|
|
736
|
+
}
|
|
737
|
+
/** Splits a merged cell back into single cells. */
|
|
738
|
+
function splitCell(cell) {
|
|
739
|
+
const rs = cell.rowSpan || 1;
|
|
740
|
+
const cs = cell.colSpan || 1;
|
|
741
|
+
if (rs === 1 && cs === 1)
|
|
742
|
+
return false;
|
|
743
|
+
const table = cell.closest('table');
|
|
744
|
+
const doc = cell.ownerDocument;
|
|
745
|
+
const g = tableGrid(table);
|
|
746
|
+
const { row, col } = cellSlot(g, cell);
|
|
747
|
+
const tag = cell.tagName === 'TH' ? 'th' : 'td';
|
|
748
|
+
setSpan(cell, 'row', 1);
|
|
749
|
+
setSpan(cell, 'col', 1);
|
|
750
|
+
for (let r = row; r < row + rs; r++) {
|
|
751
|
+
const tr = g.rows[r];
|
|
752
|
+
// Insert after the last cell of this row that sits left of the split area.
|
|
753
|
+
let after = r === row ? cell : null;
|
|
754
|
+
if (r !== row) {
|
|
755
|
+
for (let c = col - 1; c >= 0; c--) {
|
|
756
|
+
const x = g.grid[r][c];
|
|
757
|
+
if (x && x.parentElement === tr) {
|
|
758
|
+
after = x;
|
|
759
|
+
break;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
for (let c = r === row ? 1 : 0; c < cs; c++) {
|
|
764
|
+
const fresh = newCell(doc, tag);
|
|
765
|
+
tr.insertBefore(fresh, after ? after.nextSibling : tr.firstChild);
|
|
766
|
+
after = fresh;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
return true;
|
|
770
|
+
}
|
|
771
|
+
/** Turns the first row into a header row (`<thead>` with `<th>`), or back into a body row. */
|
|
772
|
+
function toggleHeaderRow(table) {
|
|
773
|
+
const doc = table.ownerDocument;
|
|
774
|
+
const swap = (cell, tag) => {
|
|
775
|
+
const n = doc.createElement(tag);
|
|
776
|
+
for (const a of Array.from(cell.attributes))
|
|
777
|
+
n.setAttribute(a.name, a.value);
|
|
778
|
+
while (cell.firstChild)
|
|
779
|
+
n.appendChild(cell.firstChild);
|
|
780
|
+
cell.replaceWith(n);
|
|
781
|
+
};
|
|
782
|
+
if (table.tHead && table.tHead.rows.length) {
|
|
783
|
+
const body = table.tBodies[0] || table.createTBody();
|
|
784
|
+
for (const tr of Array.from(table.tHead.rows).reverse()) {
|
|
785
|
+
Array.from(tr.cells).forEach((c) => swap(c, 'td'));
|
|
786
|
+
body.insertBefore(tr, body.firstChild);
|
|
787
|
+
}
|
|
788
|
+
table.tHead.remove();
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
const first = table.rows[0];
|
|
792
|
+
if (!first)
|
|
793
|
+
return;
|
|
794
|
+
const thead = table.createTHead();
|
|
795
|
+
Array.from(first.cells).forEach((c) => swap(c, 'th'));
|
|
796
|
+
thead.appendChild(first);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
/** The next (or previous) cell for Tab / Shift+Tab, or null at the end. */
|
|
800
|
+
function adjacentCell(cell, back) {
|
|
801
|
+
const table = cell.closest('table');
|
|
802
|
+
const cells = Array.from(table.querySelectorAll('td, th')).filter((c) => c.closest('table') === table);
|
|
803
|
+
const i = cells.indexOf(cell);
|
|
804
|
+
return cells[back ? i - 1 : i + 1] || null;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const WU_EDITOR_OPTIONS = new InjectionToken('WU_EDITOR_OPTIONS');
|
|
808
|
+
function provideEditorOptions(options) {
|
|
809
|
+
return { provide: WU_EDITOR_OPTIONS, useValue: options };
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const svg = (body, fill = false) => `<svg class="wu-editor-icon" viewBox="0 0 20 20" ${fill ? 'fill="currentColor" stroke="none"' : 'fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"'} aria-hidden="true" focusable="false">${body}</svg>`;
|
|
813
|
+
/** The editor's built-in icons (inline SVG, they follow the text colour). */
|
|
814
|
+
const ɵWU_EDITOR_ICONS = {
|
|
815
|
+
undo: svg('<path d="M7.5 5 4 8.5 7.5 12"/><path d="M4 8.5h8a4 4 0 0 1 0 8h-2"/>'),
|
|
816
|
+
redo: svg('<path d="M12.5 5 16 8.5 12.5 12"/><path d="M16 8.5H8a4 4 0 0 0 0 8h2"/>'),
|
|
817
|
+
bold: svg('<path d="M6 4h5a3.25 3.25 0 0 1 0 6.5H6zM6 10.5h6a3.25 3.25 0 0 1 0 6.5H6z" stroke-width="2"/>'),
|
|
818
|
+
italic: svg('<path d="M12.5 4h-5M12.5 16h-5M11.25 4 8.75 16"/>'),
|
|
819
|
+
underline: svg('<path d="M6 3.5v6a4 4 0 0 0 8 0v-6M5 17h10"/>'),
|
|
820
|
+
strike: svg('<path d="M4 10h12M13.5 6.25C13 4.9 11.7 4 10 4 8 4 6.5 5.1 6.5 6.6c0 1.2.8 2 2.5 2.6M7 13.6c.4 1.4 1.7 2.4 3.3 2.4 2.1 0 3.6-1.1 3.6-2.7 0-.7-.2-1.2-.6-1.7"/>'),
|
|
821
|
+
subscript: svg('<path d="m3.5 5 7 9M10.5 5l-7 9M13.5 12.5c0-.9.7-1.5 1.6-1.5s1.6.6 1.6 1.4c0 1.4-3.2 2.4-3.2 4.1h3.3"/>'),
|
|
822
|
+
superscript: svg('<path d="m3.5 6 7 9M10.5 6l-7 9M13.5 4.5c0-.9.7-1.5 1.6-1.5s1.6.6 1.6 1.4c0 1.4-3.2 2.4-3.2 4.1h3.3"/>'),
|
|
823
|
+
code: svg('<path d="M7.5 6 3.5 10l4 4M12.5 6l4 4-4 4"/>'),
|
|
824
|
+
color: svg('<path d="m5.5 13.5 4.5-10 4.5 10M7.2 10h5.6"/><path d="M4 16.75h12" stroke-width="2.5"/>'),
|
|
825
|
+
highlight: svg('<path d="m11.5 4.5 4 4-6 6H5.5v-4z"/><path d="m9.5 6.5 4 4M3.5 17h13"/>'),
|
|
826
|
+
bulletList: svg('<path d="M8 5.5h8.5M8 10h8.5M8 14.5h8.5"/><circle cx="4.25" cy="5.5" r=".9" fill="currentColor"/><circle cx="4.25" cy="10" r=".9" fill="currentColor"/><circle cx="4.25" cy="14.5" r=".9" fill="currentColor"/>'),
|
|
827
|
+
orderedList: svg('<path d="M8.5 5.5h8M8.5 10h8M8.5 14.5h8M3.5 4.25l1-.75v4M3.25 12.5c.2-.6.7-1 1.3-1 .7 0 1.2.5 1.2 1.1 0 1-2.5 1.6-2.5 3h2.6" stroke-width="1.3"/>'),
|
|
828
|
+
indent: svg('<path d="M9 5.5h7.5M9 10h7.5M9 14.5h7.5M3.5 7.5 6 10l-2.5 2.5"/>'),
|
|
829
|
+
outdent: svg('<path d="M9 5.5h7.5M9 10h7.5M9 14.5h7.5M6 7.5 3.5 10 6 12.5"/>'),
|
|
830
|
+
alignLeft: svg('<path d="M3.5 5h13M3.5 8.33h8.5M3.5 11.67h13M3.5 15h8.5"/>'),
|
|
831
|
+
alignCenter: svg('<path d="M3.5 5h13M5.75 8.33h8.5M3.5 11.67h13M5.75 15h8.5"/>'),
|
|
832
|
+
alignRight: svg('<path d="M3.5 5h13M8 8.33h8.5M3.5 11.67h13M8 15h8.5"/>'),
|
|
833
|
+
alignJustify: svg('<path d="M3.5 5h13M3.5 8.33h13M3.5 11.67h13M3.5 15h13"/>'),
|
|
834
|
+
link: svg('<path d="M8.5 11.5a3.25 3.25 0 0 0 4.6 0l2.3-2.3a3.25 3.25 0 0 0-4.6-4.6l-.9.9"/><path d="M11.5 8.5a3.25 3.25 0 0 0-4.6 0l-2.3 2.3a3.25 3.25 0 0 0 4.6 4.6l.9-.9"/>'),
|
|
835
|
+
unlink: svg('<path d="M8.5 11.5a3.25 3.25 0 0 0 4.6 0l2.3-2.3a3.25 3.25 0 0 0-4.6-4.6l-.9.9M11.5 8.5a3.25 3.25 0 0 0-4.6 0l-2.3 2.3a3.25 3.25 0 0 0 4.6 4.6l.9-.9M3.5 3.5l13 13"/>'),
|
|
836
|
+
external: svg('<path d="M11 4h5v5M16 4l-7 7M14 11.5V15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h3.5"/>'),
|
|
837
|
+
edit: svg('<path d="m12.5 4.5 3 3L7 16H4v-3z"/>'),
|
|
838
|
+
image: svg('<rect x="3" y="4" width="14" height="12" rx="1.5"/><circle cx="7.5" cy="8.25" r="1.25"/><path d="m3.5 14 4-4 3 3 2-2 4 4"/>'),
|
|
839
|
+
table: svg('<rect x="3" y="4" width="14" height="12" rx="1.5"/><path d="M3 8h14M3 12h14M8 8v8M12.5 8v8"/>'),
|
|
840
|
+
blockquote: svg('<path d="M4 10.5V14h3.5v-3.5H5.5c0-2 .7-3.2 2-4M11 10.5V14h3.5v-3.5h-2c0-2 .7-3.2 2-4"/>'),
|
|
841
|
+
codeBlock: svg('<rect x="3" y="3.5" width="14" height="13" rx="1.5"/><path d="M8 8 6 10l2 2M12 8l2 2-2 2"/>'),
|
|
842
|
+
hr: svg('<path d="M3 10h14M6 6h8M6 14h8" stroke-dasharray="0"/>'),
|
|
843
|
+
clear: svg('<path d="M6 4h8M10 4l-3 12M4 16h5M12.5 11.5l4 4M16.5 11.5l-4 4"/>'),
|
|
844
|
+
source: svg('<path d="M7 6 3.5 10 7 14M13 6l3.5 4-3.5 4M11 4.5l-2 11"/>'),
|
|
845
|
+
fullscreen: svg('<path d="M4 8V4h4M12 4h4v4M16 12v4h-4M8 16H4v-4"/>'),
|
|
846
|
+
exitFullscreen: svg('<path d="M8 4v4H4M16 8h-4V4M12 16v-4h4M4 12h4v4"/>'),
|
|
847
|
+
heading: svg('<path d="M5 4v12M15 4v12M5 10h10"/>'),
|
|
848
|
+
fontSize: svg('<path d="m2.5 15 4-10 4 10M4 11.5h5M12 15l2.75-6.5L17.5 15M12.9 13h3.7"/>'),
|
|
849
|
+
fontFamily: svg('<path d="M5 15 9 4h2l4 11M6.5 11h7"/>'),
|
|
850
|
+
chevron: '<svg class="wu-editor-chevron" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="m4.5 6.5 3.5 3.5 3.5-3.5"/></svg>',
|
|
851
|
+
trash: svg('<path d="M4 6h12M8 6V4h4v2M5.5 6l.7 10h7.6l.7-10M8.5 9v4.5M11.5 9v4.5"/>'),
|
|
852
|
+
check: svg('<path d="m4.5 10.5 3.5 3.5 7.5-8"/>'),
|
|
853
|
+
upload: svg('<path d="M10 13V4M6.5 7.5 10 4l3.5 3.5M4 13v3h12v-3"/>'),
|
|
854
|
+
rowAbove: svg('<rect x="3" y="9" width="14" height="7" rx="1"/><path d="M10 2.5v5M7.5 5h5"/>'),
|
|
855
|
+
rowBelow: svg('<rect x="3" y="4" width="14" height="7" rx="1"/><path d="M10 12.5v5M7.5 15h5"/>'),
|
|
856
|
+
colLeft: svg('<rect x="9" y="3" width="7" height="14" rx="1"/><path d="M2.5 10h5M5 7.5v5"/>'),
|
|
857
|
+
colRight: svg('<rect x="4" y="3" width="7" height="14" rx="1"/><path d="M12.5 10h5M15 7.5v5"/>'),
|
|
858
|
+
deleteRow: svg('<rect x="3" y="7" width="14" height="6" rx="1"/><path d="m8 8.5 4 3M12 8.5l-4 3"/>'),
|
|
859
|
+
deleteCol: svg('<rect x="7" y="3" width="6" height="14" rx="1"/><path d="m8.5 8 3 4M11.5 8l-3 4"/>'),
|
|
860
|
+
headerRow: svg('<rect x="3" y="4" width="14" height="12" rx="1.5"/><path d="M3 8h14"/><path d="M3.75 4.75h12.5v2.5H3.75z" fill="currentColor" stroke="none"/>'),
|
|
861
|
+
mergeRight: svg('<rect x="3" y="5" width="14" height="10" rx="1"/><path d="M6 10h8M11.5 7.5 14 10l-2.5 2.5"/>'),
|
|
862
|
+
mergeDown: svg('<rect x="5" y="3" width="10" height="14" rx="1"/><path d="M10 6v8M7.5 11.5 10 14l2.5-2.5"/>'),
|
|
863
|
+
splitCell: svg('<rect x="3" y="5" width="14" height="10" rx="1"/><path d="M10 5v10"/>'),
|
|
864
|
+
imageInline: svg('<rect x="7" y="6" width="6" height="5" rx="1"/><path d="M3 8.5h2.5M14.5 8.5H17M3 14h14"/>'),
|
|
865
|
+
imageLeft: svg('<rect x="3" y="5" width="7" height="6" rx="1"/><path d="M12 6h5M12 9h5M3 14h14"/>'),
|
|
866
|
+
imageCenter: svg('<rect x="6.5" y="4" width="7" height="7" rx="1"/><path d="M3 14h14M5 17h10"/>'),
|
|
867
|
+
imageRight: svg('<rect x="10" y="5" width="7" height="6" rx="1"/><path d="M3 6h5M3 9h5M3 14h14"/>'),
|
|
868
|
+
};
|
|
869
|
+
/** Reads `ql-bold`, `ql-list` + value, `select.ql-header` and the rest; null for controls the editor does not offer. */
|
|
870
|
+
function ɵquillTool(el) {
|
|
871
|
+
const has = (c) => el.classList.contains(c);
|
|
872
|
+
const value = (el.getAttribute('value') || '').trim();
|
|
873
|
+
const select = el.tagName === 'SELECT';
|
|
874
|
+
if (has('ql-bold'))
|
|
875
|
+
return { tool: 'bold' };
|
|
876
|
+
if (has('ql-italic'))
|
|
877
|
+
return { tool: 'italic' };
|
|
878
|
+
if (has('ql-underline'))
|
|
879
|
+
return { tool: 'underline' };
|
|
880
|
+
if (has('ql-strike'))
|
|
881
|
+
return { tool: 'strike' };
|
|
882
|
+
if (has('ql-script'))
|
|
883
|
+
return { tool: value === 'super' ? 'superscript' : 'subscript' };
|
|
884
|
+
if (has('ql-header'))
|
|
885
|
+
return select ? { tool: 'heading', dropdown: true } : { tool: 'heading', heading: Number(value) || 1 };
|
|
886
|
+
if (has('ql-size'))
|
|
887
|
+
return { tool: 'fontSize', dropdown: true };
|
|
888
|
+
if (has('ql-font'))
|
|
889
|
+
return { tool: 'fontFamily', dropdown: true };
|
|
890
|
+
if (has('ql-color'))
|
|
891
|
+
return { tool: 'color' };
|
|
892
|
+
if (has('ql-background'))
|
|
893
|
+
return { tool: 'highlight' };
|
|
894
|
+
if (has('ql-list'))
|
|
895
|
+
return { tool: value === 'ordered' ? 'orderedList' : 'bulletList' };
|
|
896
|
+
if (has('ql-indent'))
|
|
897
|
+
return { tool: value === '-1' ? 'outdent' : 'indent' };
|
|
898
|
+
if (has('ql-align')) {
|
|
899
|
+
if (select)
|
|
900
|
+
return { tool: 'align' };
|
|
901
|
+
return { tool: value === 'center' ? 'alignCenter' : value === 'right' ? 'alignRight' : value === 'justify' ? 'alignJustify' : 'alignLeft' };
|
|
902
|
+
}
|
|
903
|
+
if (has('ql-blockquote'))
|
|
904
|
+
return { tool: 'blockquote' };
|
|
905
|
+
if (has('ql-code-block'))
|
|
906
|
+
return { tool: 'codeBlock' };
|
|
907
|
+
if (has('ql-code'))
|
|
908
|
+
return { tool: 'code' };
|
|
909
|
+
if (has('ql-link'))
|
|
910
|
+
return { tool: 'link' };
|
|
911
|
+
if (has('ql-image'))
|
|
912
|
+
return { tool: 'image' };
|
|
913
|
+
if (has('ql-clean'))
|
|
914
|
+
return { tool: 'clear' };
|
|
915
|
+
return null;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
const asTemplate = (v) => (v instanceof TemplateRef ? v : null);
|
|
919
|
+
const QUILL_SIZES = { '0.75em': 'small', '1.5em': 'large', '2.5em': 'huge' };
|
|
920
|
+
const ACCEPT_IMAGES = 'image/png,image/jpeg,image/gif,image/webp';
|
|
921
|
+
const MAX_INDENT = 8;
|
|
922
|
+
/** Header names and values from Angular's HttpHeaders or a plain object. */
|
|
923
|
+
function headerEntries(headers) {
|
|
924
|
+
if (!headers)
|
|
925
|
+
return [];
|
|
926
|
+
const h = headers;
|
|
927
|
+
if (typeof h.keys === 'function' && typeof h.get === 'function')
|
|
928
|
+
return h.keys().map((k) => [k, h.get(k) || '']);
|
|
929
|
+
return Object.entries(headers).map(([k, v]) => [k, String(v)]);
|
|
930
|
+
}
|
|
931
|
+
function pathValue(obj, path) {
|
|
932
|
+
let v = obj;
|
|
933
|
+
for (const k of path.split('.')) {
|
|
934
|
+
if (v === null || v === undefined || typeof v !== 'object')
|
|
935
|
+
return undefined;
|
|
936
|
+
v = v[k];
|
|
937
|
+
}
|
|
938
|
+
return v;
|
|
939
|
+
}
|
|
940
|
+
const EMPTY_STATE = {
|
|
941
|
+
bold: false,
|
|
942
|
+
italic: false,
|
|
943
|
+
underline: false,
|
|
944
|
+
strike: false,
|
|
945
|
+
subscript: false,
|
|
946
|
+
superscript: false,
|
|
947
|
+
code: false,
|
|
948
|
+
bulletList: false,
|
|
949
|
+
orderedList: false,
|
|
950
|
+
blockquote: false,
|
|
951
|
+
codeBlock: false,
|
|
952
|
+
link: false,
|
|
953
|
+
table: false,
|
|
954
|
+
heading: 0,
|
|
955
|
+
align: 'left',
|
|
956
|
+
fontSize: '',
|
|
957
|
+
fontFamily: '',
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* What wu-editor does, shared by the v1 and v2/v3 templates: a rich-text editor written for WiraUI (no third-party
|
|
961
|
+
* editor inside). The value is HTML through `[(ngModel)]` / forms (null when empty, as before), with the class names
|
|
962
|
+
* values saved earlier use (`ql-align-center`, `ql-indent-1`, `ql-size-large`) so stored content keeps its look.
|
|
963
|
+
*
|
|
964
|
+
* Toolbar: a preset (`toolbar="basic" | "standard" | "full"`), a list of tools, or the app's own `header` template with
|
|
965
|
+
* the familiar `ql-bold` / `ql-header` markup; `[toolOptions]` sets heading levels, sizes, colours, table grid and more.
|
|
966
|
+
* Tables (insert, rows, columns, merge, header row), links, pictures (uploaded to a URL or embedded as base64, resized,
|
|
967
|
+
* aligned), undo / redo, paste clean-up, source view, full screen and a word count.
|
|
968
|
+
*/
|
|
969
|
+
class ɵWuEditorBase {
|
|
970
|
+
/** Tools to show: a preset, a list with `'|'` between groups, or a list of groups. Default `'standard'`. */
|
|
971
|
+
set toolbar(v) {
|
|
972
|
+
var _a;
|
|
973
|
+
this._toolbar = v !== null && v !== void 0 ? v : null;
|
|
974
|
+
this.groups = editorToolbarGroups((_a = this._toolbar) !== null && _a !== void 0 ? _a : this.defaults.toolbar, 'standard');
|
|
975
|
+
}
|
|
976
|
+
/** Fine settings of the tools: heading levels, font sizes and families, colours, alignments, table grid, links. */
|
|
977
|
+
set toolOptions(v) {
|
|
978
|
+
this._toolOptions = v !== null && v !== void 0 ? v : null;
|
|
979
|
+
this.opts = editorToolOptions(Object.assign(Object.assign({}, (this.defaults.toolOptions || {})), (v || {})));
|
|
980
|
+
}
|
|
981
|
+
set readonly(v) {
|
|
982
|
+
this._readonly = ɵtoBool(v);
|
|
983
|
+
this.syncEditable();
|
|
984
|
+
}
|
|
985
|
+
get readonly() {
|
|
986
|
+
return this._readonly;
|
|
987
|
+
}
|
|
988
|
+
/** Show the word and character count under the content. */
|
|
989
|
+
set showCount(v) {
|
|
990
|
+
this._showCount = ɵtoBool(v);
|
|
991
|
+
}
|
|
992
|
+
get showCount() {
|
|
993
|
+
return this._showCount;
|
|
994
|
+
}
|
|
995
|
+
/** Keep the toolbar in view while a tall editor scrolls the page. Default true. */
|
|
996
|
+
set stickyToolbar(v) {
|
|
997
|
+
this._sticky = v === undefined || ɵtoBool(v);
|
|
998
|
+
}
|
|
999
|
+
get stickyToolbar() {
|
|
1000
|
+
return this._sticky;
|
|
1001
|
+
}
|
|
1002
|
+
constructor() {
|
|
1003
|
+
var _a;
|
|
1004
|
+
this.onTextChange = new EventEmitter();
|
|
1005
|
+
this.onSelectionChange = new EventEmitter();
|
|
1006
|
+
this.onInit = new EventEmitter();
|
|
1007
|
+
this.onFocus = new EventEmitter();
|
|
1008
|
+
this.onBlur = new EventEmitter();
|
|
1009
|
+
this.onImageUpload = new EventEmitter();
|
|
1010
|
+
this.onImageUploadError = new EventEmitter();
|
|
1011
|
+
this.major = WU_VERSION_INFO.major;
|
|
1012
|
+
this.icons = ɵWU_EDITOR_ICONS;
|
|
1013
|
+
this.baseId = ɵuniqueId('wu-editor');
|
|
1014
|
+
this.groups = editorToolbarGroups(null);
|
|
1015
|
+
this.opts = editorToolOptions(null);
|
|
1016
|
+
this.state = Object.assign({}, EMPTY_STATE);
|
|
1017
|
+
this.focused = false;
|
|
1018
|
+
this.empty = true;
|
|
1019
|
+
this.disabled = false;
|
|
1020
|
+
this.sourceMode = false;
|
|
1021
|
+
this.sourceText = '';
|
|
1022
|
+
this.fullscreen = false;
|
|
1023
|
+
this.counts = { characters: 0, words: 0 };
|
|
1024
|
+
this.canUndo = false;
|
|
1025
|
+
this.canRedo = false;
|
|
1026
|
+
/** The open panel and what it is about. */
|
|
1027
|
+
this.panel = null;
|
|
1028
|
+
this.panelAnchor = null;
|
|
1029
|
+
/** Table grid picker: rows × cols under the pointer. */
|
|
1030
|
+
this.gridHover = { rows: 0, cols: 0 };
|
|
1031
|
+
/** The insert panel's own size fields. */
|
|
1032
|
+
this.tableForm = { rows: 3, cols: 3, header: true };
|
|
1033
|
+
/** Cells picked by dragging across them (or Shift + click), for merging. */
|
|
1034
|
+
this.cellPick = null;
|
|
1035
|
+
/** Link form fields. */
|
|
1036
|
+
this.linkForm = { url: '', text: '', newTab: true, showText: false, error: '' };
|
|
1037
|
+
/** Image form. */
|
|
1038
|
+
this.imageForm = { tab: 'upload', url: '', alt: '', error: '' };
|
|
1039
|
+
/** Picture selected in the content (shows the frame and the picture menu). */
|
|
1040
|
+
this.selectedImage = null;
|
|
1041
|
+
this.frame = { top: 0, left: 0, width: 0, height: 0 };
|
|
1042
|
+
/** Messages shown under the content (upload failures …), cleared after a while. */
|
|
1043
|
+
this.notices = [];
|
|
1044
|
+
this.imageAligns = ['inline', 'left', 'center', 'right'];
|
|
1045
|
+
this.imageWidths = [25, 50, 75, 100];
|
|
1046
|
+
this.tableInserts = ['rowAbove', 'rowBelow', 'colLeft', 'colRight'];
|
|
1047
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1048
|
+
this.doc = inject(DOCUMENT);
|
|
1049
|
+
this.zone = inject(NgZone);
|
|
1050
|
+
this.config = inject(WuConfig);
|
|
1051
|
+
this.host = inject(ElementRef).nativeElement;
|
|
1052
|
+
this.defaults = inject(WU_EDITOR_OPTIONS, { optional: true }) || {};
|
|
1053
|
+
this.i18n = ɵrefreshOnTranslation();
|
|
1054
|
+
this.history = new EditorHistory();
|
|
1055
|
+
this._toolbar = null;
|
|
1056
|
+
this._toolOptions = null;
|
|
1057
|
+
this._readonly = false;
|
|
1058
|
+
this._showCount = false;
|
|
1059
|
+
this._sticky = true;
|
|
1060
|
+
this.value = null;
|
|
1061
|
+
this.lastEmitted = null;
|
|
1062
|
+
this.savedRange = null;
|
|
1063
|
+
this.lastSelection = null;
|
|
1064
|
+
this.popup = null;
|
|
1065
|
+
this.unlockScroll = null;
|
|
1066
|
+
this.cleanups = [];
|
|
1067
|
+
this.stateFrame = 0;
|
|
1068
|
+
this.quillObserver = null;
|
|
1069
|
+
this.onChange = () => undefined;
|
|
1070
|
+
this.onTouched = () => undefined;
|
|
1071
|
+
this.viewReady = false;
|
|
1072
|
+
// ---------- tables: picking cells, resizing columns ----------
|
|
1073
|
+
this.resizeHover = null;
|
|
1074
|
+
ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));
|
|
1075
|
+
const styles = inject(ɵWuStyleLoader);
|
|
1076
|
+
styles.load('button', ɵWU_BUTTON_CSS);
|
|
1077
|
+
styles.load('inputtext', ɵWU_INPUTTEXT_CSS);
|
|
1078
|
+
this.groups = editorToolbarGroups((_a = this.defaults.toolbar) !== null && _a !== void 0 ? _a : null, 'standard');
|
|
1079
|
+
this.opts = editorToolOptions(this.defaults.toolOptions);
|
|
1080
|
+
const self = this;
|
|
1081
|
+
this.api = {
|
|
1082
|
+
get root() {
|
|
1083
|
+
return self.area;
|
|
1084
|
+
},
|
|
1085
|
+
getHTML: () => this.html(),
|
|
1086
|
+
getSemanticHTML: () => this.html(),
|
|
1087
|
+
getText: () => editorHtmlToText(this.html()),
|
|
1088
|
+
getLength: () => editorHtmlToText(this.html()).length + 1,
|
|
1089
|
+
setHTML: (html) => this.setContent(html, true),
|
|
1090
|
+
insertHTML: (html) => this.insertHtml(cleanEditorHtml(html, this.doc, this.cleanOpts)),
|
|
1091
|
+
insertText: (text) => this.exec(() => this.doc.execCommand('insertText', false, text)),
|
|
1092
|
+
focus: () => this.focus(),
|
|
1093
|
+
blur: () => this.area.blur(),
|
|
1094
|
+
hasFocus: () => this.doc.activeElement === this.area,
|
|
1095
|
+
enable: (on = true) => this.setDisabledState(!on),
|
|
1096
|
+
disable: () => this.setDisabledState(true),
|
|
1097
|
+
undo: () => this.undo(),
|
|
1098
|
+
redo: () => this.redo(),
|
|
1099
|
+
clipboard: {
|
|
1100
|
+
dangerouslyPasteHTML: (a, b) => this.setContent(typeof a === 'string' ? a : b || '', true),
|
|
1101
|
+
},
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
// ---------- lifecycle ----------
|
|
1105
|
+
ngAfterViewInit() {
|
|
1106
|
+
this.viewReady = true;
|
|
1107
|
+
const area = this.area;
|
|
1108
|
+
area.innerHTML = this.toEditable(this.value);
|
|
1109
|
+
this.history.reset({ html: area.innerHTML, selection: null });
|
|
1110
|
+
this.syncEditable();
|
|
1111
|
+
this.refreshMeta();
|
|
1112
|
+
this.zone.runOutsideAngular(() => {
|
|
1113
|
+
const onSel = () => this.selectionChanged();
|
|
1114
|
+
this.doc.addEventListener('selectionchange', onSel);
|
|
1115
|
+
this.cleanups.push(() => this.doc.removeEventListener('selectionchange', onSel));
|
|
1116
|
+
const onBeforeInput = (e) => this.beforeInput(e);
|
|
1117
|
+
area.addEventListener('beforeinput', onBeforeInput);
|
|
1118
|
+
this.cleanups.push(() => area.removeEventListener('beforeinput', onBeforeInput));
|
|
1119
|
+
const onScroll = () => this.placeFrame();
|
|
1120
|
+
area.addEventListener('scroll', onScroll, { passive: true });
|
|
1121
|
+
this.cleanups.push(() => area.removeEventListener('scroll', onScroll));
|
|
1122
|
+
// Tables: drag across cells to pick them, drag a column's edge to resize it.
|
|
1123
|
+
const onMove = (e) => this.tablePointerMove(e);
|
|
1124
|
+
const onDown = (e) => this.tablePointerDown(e);
|
|
1125
|
+
area.addEventListener('pointermove', onMove);
|
|
1126
|
+
area.addEventListener('pointerdown', onDown);
|
|
1127
|
+
this.cleanups.push(() => area.removeEventListener('pointermove', onMove), () => area.removeEventListener('pointerdown', onDown));
|
|
1128
|
+
});
|
|
1129
|
+
if (this.headerTemplate)
|
|
1130
|
+
this.wireQuillToolbar();
|
|
1131
|
+
this.syncToolbarTabStops();
|
|
1132
|
+
this.cdr.detectChanges();
|
|
1133
|
+
this.onInit.emit({ editor: this.api });
|
|
1134
|
+
}
|
|
1135
|
+
ngOnDestroy() {
|
|
1136
|
+
var _a, _b;
|
|
1137
|
+
this.i18n.unsubscribe();
|
|
1138
|
+
this.closePanel(false);
|
|
1139
|
+
(_a = this.unlockScroll) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1140
|
+
(_b = this.quillObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1141
|
+
for (const off of this.cleanups.splice(0))
|
|
1142
|
+
off();
|
|
1143
|
+
const win = this.doc.defaultView;
|
|
1144
|
+
if (this.stateFrame && win)
|
|
1145
|
+
win.cancelAnimationFrame(this.stateFrame);
|
|
1146
|
+
}
|
|
1147
|
+
/** The calls apps make on the editor from code (the same object `(onInit)` hands over). */
|
|
1148
|
+
getEditor() {
|
|
1149
|
+
return this.api;
|
|
1150
|
+
}
|
|
1151
|
+
/** The same as getEditor(), for code moving over. */
|
|
1152
|
+
getQuill() {
|
|
1153
|
+
return this.api;
|
|
1154
|
+
}
|
|
1155
|
+
// ---------- forms ----------
|
|
1156
|
+
writeValue(v) {
|
|
1157
|
+
this.value = v === null || v === undefined ? null : String(v);
|
|
1158
|
+
this.lastEmitted = this.value;
|
|
1159
|
+
if (this.viewReady) {
|
|
1160
|
+
this.area.innerHTML = this.toEditable(this.value);
|
|
1161
|
+
this.history.reset({ html: this.area.innerHTML, selection: null });
|
|
1162
|
+
this.selectImage(null);
|
|
1163
|
+
this.refreshMeta();
|
|
1164
|
+
this.cdr.markForCheck();
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
registerOnChange(fn) {
|
|
1168
|
+
this.onChange = fn;
|
|
1169
|
+
}
|
|
1170
|
+
registerOnTouched(fn) {
|
|
1171
|
+
this.onTouched = fn;
|
|
1172
|
+
}
|
|
1173
|
+
setDisabledState(disabled) {
|
|
1174
|
+
this.disabled = disabled;
|
|
1175
|
+
this.syncEditable();
|
|
1176
|
+
this.cdr.markForCheck();
|
|
1177
|
+
}
|
|
1178
|
+
// ---------- what the templates read ----------
|
|
1179
|
+
get t() {
|
|
1180
|
+
return this.config.translation;
|
|
1181
|
+
}
|
|
1182
|
+
get m() {
|
|
1183
|
+
return this.config.translation.editor || TH_LOCALE.editor;
|
|
1184
|
+
}
|
|
1185
|
+
get headerTemplate() {
|
|
1186
|
+
return asTemplate(this.headerRef) || ɵfindTemplate(this.templates, 'header');
|
|
1187
|
+
}
|
|
1188
|
+
get locked() {
|
|
1189
|
+
return this.disabled || this._readonly;
|
|
1190
|
+
}
|
|
1191
|
+
get area() {
|
|
1192
|
+
return this.areaRef.nativeElement;
|
|
1193
|
+
}
|
|
1194
|
+
get areaLabel() {
|
|
1195
|
+
return this.ariaLabel || this.placeholder || this.m.content;
|
|
1196
|
+
}
|
|
1197
|
+
headingLabel(level) {
|
|
1198
|
+
return level ? this.m.heading.replace('{0}', String(level)) : this.m.paragraph;
|
|
1199
|
+
}
|
|
1200
|
+
get currentHeadingLabel() {
|
|
1201
|
+
if (this.state.codeBlock)
|
|
1202
|
+
return this.m.codeBlock;
|
|
1203
|
+
if (this.state.blockquote)
|
|
1204
|
+
return this.m.blockquote;
|
|
1205
|
+
return this.headingLabel(this.state.heading);
|
|
1206
|
+
}
|
|
1207
|
+
get fontSizes() {
|
|
1208
|
+
if (this.opts.fontSizes.length)
|
|
1209
|
+
return this.opts.fontSizes;
|
|
1210
|
+
const m = this.m;
|
|
1211
|
+
return EDITOR_FONT_SIZES.map((s) => ({
|
|
1212
|
+
value: s.value,
|
|
1213
|
+
label: s.label === 'small' ? m.sizeSmall : s.label === 'large' ? m.sizeLarge : s.label === 'huge' ? m.sizeHuge : m.sizeNormal,
|
|
1214
|
+
}));
|
|
1215
|
+
}
|
|
1216
|
+
get fontFamilies() {
|
|
1217
|
+
if (this.opts.fontFamilies.length)
|
|
1218
|
+
return this.opts.fontFamilies;
|
|
1219
|
+
return [
|
|
1220
|
+
{ label: this.m.defaultFont, value: '' },
|
|
1221
|
+
{ label: 'Serif', value: 'serif' },
|
|
1222
|
+
{ label: 'Monospace', value: 'monospace' },
|
|
1223
|
+
];
|
|
1224
|
+
}
|
|
1225
|
+
get currentSizeLabel() {
|
|
1226
|
+
var _a;
|
|
1227
|
+
return ((_a = this.fontSizes.find((s) => s.value === this.state.fontSize)) === null || _a === void 0 ? void 0 : _a.label) || this.m.fontSize;
|
|
1228
|
+
}
|
|
1229
|
+
get currentFontLabel() {
|
|
1230
|
+
var _a;
|
|
1231
|
+
return ((_a = this.fontFamilies.find((s) => s.value === this.state.fontFamily)) === null || _a === void 0 ? void 0 : _a.label) || this.m.fontFamily;
|
|
1232
|
+
}
|
|
1233
|
+
/** Label and icon of one tool. */
|
|
1234
|
+
toolLabel(tool) {
|
|
1235
|
+
const m = this.m;
|
|
1236
|
+
if (tool === 'fullscreen' && this.fullscreen)
|
|
1237
|
+
return this.m.exitFullscreen;
|
|
1238
|
+
if (tool === 'table' && this.state.table)
|
|
1239
|
+
return this.m.table;
|
|
1240
|
+
return m[tool] || tool;
|
|
1241
|
+
}
|
|
1242
|
+
isOn(tool) {
|
|
1243
|
+
const s = this.state;
|
|
1244
|
+
if (tool === 'source')
|
|
1245
|
+
return this.sourceMode;
|
|
1246
|
+
if (tool === 'fullscreen')
|
|
1247
|
+
return this.fullscreen;
|
|
1248
|
+
if (tool === 'alignLeft' || tool === 'alignCenter' || tool === 'alignRight' || tool === 'alignJustify')
|
|
1249
|
+
return this.state.align === tool.slice(5).toLowerCase();
|
|
1250
|
+
return s[tool] === true;
|
|
1251
|
+
}
|
|
1252
|
+
isDisabled(tool) {
|
|
1253
|
+
if (tool === 'fullscreen')
|
|
1254
|
+
return false;
|
|
1255
|
+
if (this.locked)
|
|
1256
|
+
return true;
|
|
1257
|
+
if (this.sourceMode)
|
|
1258
|
+
return tool !== 'source';
|
|
1259
|
+
if (tool === 'undo')
|
|
1260
|
+
return !this.canUndo;
|
|
1261
|
+
if (tool === 'redo')
|
|
1262
|
+
return !this.canRedo;
|
|
1263
|
+
return false;
|
|
1264
|
+
}
|
|
1265
|
+
/** Tools that open a menu (aria-haspopup). */
|
|
1266
|
+
hasMenu(tool) {
|
|
1267
|
+
return ['heading', 'fontSize', 'fontFamily', 'color', 'highlight', 'align', 'link', 'image', 'table'].includes(tool);
|
|
1268
|
+
}
|
|
1269
|
+
/** Tools drawn as a labelled dropdown rather than an icon. */
|
|
1270
|
+
isDropdown(tool) {
|
|
1271
|
+
return tool === 'heading' || tool === 'fontSize' || tool === 'fontFamily';
|
|
1272
|
+
}
|
|
1273
|
+
dropdownLabel(tool) {
|
|
1274
|
+
return tool === 'heading' ? this.currentHeadingLabel : tool === 'fontSize' ? this.currentSizeLabel : this.currentFontLabel;
|
|
1275
|
+
}
|
|
1276
|
+
/** Name of the icon a tool shows (the align tool shows the current alignment). */
|
|
1277
|
+
toolIcon(tool) {
|
|
1278
|
+
if (tool === 'align')
|
|
1279
|
+
return 'align' + this.state.align[0].toUpperCase() + this.state.align.slice(1);
|
|
1280
|
+
if (tool === 'fullscreen' && this.fullscreen)
|
|
1281
|
+
return 'exitFullscreen';
|
|
1282
|
+
return tool;
|
|
1283
|
+
}
|
|
1284
|
+
/** Whether the menu of a tool is the one open. */
|
|
1285
|
+
panelOpenFor(tool) {
|
|
1286
|
+
return tool === 'table' ? this.panel === 'table' || this.panel === 'tableMenu' : this.panel === tool;
|
|
1287
|
+
}
|
|
1288
|
+
get areaId() {
|
|
1289
|
+
return `${this.id || this.baseId}_content`;
|
|
1290
|
+
}
|
|
1291
|
+
buttonClass(styleClass, extra = '') {
|
|
1292
|
+
return ɵbuttonClass(styleClass) + (extra ? ' ' + extra : '');
|
|
1293
|
+
}
|
|
1294
|
+
alignLabel(a) {
|
|
1295
|
+
return a === 'center' ? this.m.alignCenter : a === 'right' ? this.m.alignRight : a === 'justify' ? this.m.alignJustify : this.m.alignLeft;
|
|
1296
|
+
}
|
|
1297
|
+
alignIcon(a) {
|
|
1298
|
+
return 'align' + a[0].toUpperCase() + a.slice(1);
|
|
1299
|
+
}
|
|
1300
|
+
gridRows() {
|
|
1301
|
+
return Array.from({ length: this.opts.table.rows }, (_, i) => i + 1);
|
|
1302
|
+
}
|
|
1303
|
+
gridCols() {
|
|
1304
|
+
return Array.from({ length: this.opts.table.cols }, (_, i) => i + 1);
|
|
1305
|
+
}
|
|
1306
|
+
get gridLabel() {
|
|
1307
|
+
const { rows, cols } = this.gridHover;
|
|
1308
|
+
return rows && cols ? this.m.tableSize.replace('{0}', String(rows)).replace('{1}', String(cols)) : this.m.insertTable;
|
|
1309
|
+
}
|
|
1310
|
+
get countText() {
|
|
1311
|
+
return `${this.m.words.replace('{0}', String(this.counts.words))} · ${this.m.characters.replace('{0}', String(this.counts.characters))}`;
|
|
1312
|
+
}
|
|
1313
|
+
get acceptImages() {
|
|
1314
|
+
return this.uploadConfig.accept || ACCEPT_IMAGES;
|
|
1315
|
+
}
|
|
1316
|
+
get imageWidthLabel() {
|
|
1317
|
+
const img = this.selectedImage;
|
|
1318
|
+
return img && img.getAttribute('width') ? `${img.getAttribute('width')}px` : this.m.imageOriginal;
|
|
1319
|
+
}
|
|
1320
|
+
imageAlignLabel(a) {
|
|
1321
|
+
const m = this.m;
|
|
1322
|
+
return a === 'left' ? m.imageLeft : a === 'center' ? m.imageCenter : a === 'right' ? m.imageRight : m.imageInline;
|
|
1323
|
+
}
|
|
1324
|
+
imageAlignIs(a) {
|
|
1325
|
+
const img = this.selectedImage;
|
|
1326
|
+
if (!img)
|
|
1327
|
+
return false;
|
|
1328
|
+
const cur = prefixedClass(img, 'wu-image-') || 'inline';
|
|
1329
|
+
return cur === a;
|
|
1330
|
+
}
|
|
1331
|
+
// ---------- toolbar actions ----------
|
|
1332
|
+
/** Keeps the content's selection when a toolbar button is pressed. */
|
|
1333
|
+
toolbarMouseDown(event) {
|
|
1334
|
+
const t = event.target;
|
|
1335
|
+
if (t.closest('select, input, textarea'))
|
|
1336
|
+
return;
|
|
1337
|
+
if (t.closest('button'))
|
|
1338
|
+
event.preventDefault();
|
|
1339
|
+
}
|
|
1340
|
+
/** A toolbar button. */
|
|
1341
|
+
runTool(tool, event) {
|
|
1342
|
+
if (this.isDisabled(tool))
|
|
1343
|
+
return;
|
|
1344
|
+
const anchor = event.currentTarget || null;
|
|
1345
|
+
switch (tool) {
|
|
1346
|
+
case 'undo':
|
|
1347
|
+
return this.undo();
|
|
1348
|
+
case 'redo':
|
|
1349
|
+
return this.redo();
|
|
1350
|
+
case 'bold':
|
|
1351
|
+
case 'italic':
|
|
1352
|
+
case 'underline':
|
|
1353
|
+
return this.exec(() => this.doc.execCommand(tool, false));
|
|
1354
|
+
case 'strike':
|
|
1355
|
+
return this.exec(() => this.doc.execCommand('strikeThrough', false));
|
|
1356
|
+
case 'subscript':
|
|
1357
|
+
case 'superscript':
|
|
1358
|
+
return this.exec(() => this.doc.execCommand(tool, false));
|
|
1359
|
+
case 'code':
|
|
1360
|
+
return this.exec(() => this.toggleInlineCode());
|
|
1361
|
+
case 'bulletList':
|
|
1362
|
+
return this.exec(() => this.doc.execCommand('insertUnorderedList', false));
|
|
1363
|
+
case 'orderedList':
|
|
1364
|
+
return this.exec(() => this.doc.execCommand('insertOrderedList', false));
|
|
1365
|
+
case 'indent':
|
|
1366
|
+
return this.exec(() => this.indent(1));
|
|
1367
|
+
case 'outdent':
|
|
1368
|
+
return this.exec(() => this.indent(-1));
|
|
1369
|
+
case 'alignLeft':
|
|
1370
|
+
case 'alignCenter':
|
|
1371
|
+
case 'alignRight':
|
|
1372
|
+
case 'alignJustify':
|
|
1373
|
+
return this.exec(() => this.setAlign(tool.slice(5).toLowerCase()));
|
|
1374
|
+
case 'blockquote':
|
|
1375
|
+
return this.exec(() => this.formatBlock(this.state.blockquote ? 'p' : 'blockquote'));
|
|
1376
|
+
case 'codeBlock':
|
|
1377
|
+
return this.exec(() => this.formatBlock(this.state.codeBlock ? 'p' : 'pre'));
|
|
1378
|
+
case 'hr':
|
|
1379
|
+
return this.exec(() => this.doc.execCommand('insertHorizontalRule', false));
|
|
1380
|
+
case 'clear':
|
|
1381
|
+
return this.exec(() => this.clearFormatting());
|
|
1382
|
+
case 'source':
|
|
1383
|
+
return this.toggleSource();
|
|
1384
|
+
case 'fullscreen':
|
|
1385
|
+
return this.toggleFullscreen();
|
|
1386
|
+
case 'table':
|
|
1387
|
+
return this.openPanel(this.state.table ? 'tableMenu' : 'table', anchor);
|
|
1388
|
+
case 'align':
|
|
1389
|
+
case 'heading':
|
|
1390
|
+
case 'fontSize':
|
|
1391
|
+
case 'fontFamily':
|
|
1392
|
+
case 'color':
|
|
1393
|
+
case 'highlight':
|
|
1394
|
+
case 'link':
|
|
1395
|
+
case 'image':
|
|
1396
|
+
return this.openPanel(tool, anchor);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
/** ← / → / Home / End move along the toolbar (one Tab stop), as toolbars do. */
|
|
1400
|
+
toolbarKeydown(event) {
|
|
1401
|
+
var _a;
|
|
1402
|
+
const bar = (_a = this.toolbarRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
1403
|
+
if (!bar || !['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
|
|
1404
|
+
return;
|
|
1405
|
+
const items = this.toolbarItems();
|
|
1406
|
+
const at = items.indexOf(event.target);
|
|
1407
|
+
if (at < 0)
|
|
1408
|
+
return;
|
|
1409
|
+
event.preventDefault();
|
|
1410
|
+
const next = event.key === 'Home' ? 0 : event.key === 'End' ? items.length - 1 : (at + (event.key === 'ArrowRight' ? 1 : -1) + items.length) % items.length;
|
|
1411
|
+
items.forEach((el, i) => el.setAttribute('tabindex', i === next ? '0' : '-1'));
|
|
1412
|
+
items[next].focus();
|
|
1413
|
+
}
|
|
1414
|
+
pickHeading(level) {
|
|
1415
|
+
this.closePanel(false);
|
|
1416
|
+
this.exec(() => this.formatBlock(level ? `h${level}` : 'p'));
|
|
1417
|
+
}
|
|
1418
|
+
/** Quote or code block from the block menu; picking the current one turns it back into a paragraph. */
|
|
1419
|
+
pickBlock(kind) {
|
|
1420
|
+
this.closePanel(false);
|
|
1421
|
+
const on = kind === 'blockquote' ? this.state.blockquote : this.state.codeBlock;
|
|
1422
|
+
this.exec(() => this.formatBlock(on ? 'p' : kind === 'blockquote' ? 'blockquote' : 'pre'));
|
|
1423
|
+
}
|
|
1424
|
+
pickSize(value) {
|
|
1425
|
+
this.closePanel(false);
|
|
1426
|
+
this.exec(() => this.applyInlineStyle('fontSize', value));
|
|
1427
|
+
}
|
|
1428
|
+
pickFont(value) {
|
|
1429
|
+
this.closePanel(false);
|
|
1430
|
+
this.exec(() => this.applyInlineStyle('fontFamily', value));
|
|
1431
|
+
}
|
|
1432
|
+
pickAlign(a) {
|
|
1433
|
+
this.closePanel(false);
|
|
1434
|
+
this.exec(() => this.setAlign(a));
|
|
1435
|
+
}
|
|
1436
|
+
pickColor(kind, value) {
|
|
1437
|
+
this.closePanel(false);
|
|
1438
|
+
this.exec(() => {
|
|
1439
|
+
if (!value)
|
|
1440
|
+
return this.removeInlineStyle(kind === 'color' ? 'color' : 'background-color');
|
|
1441
|
+
this.doc.execCommand('styleWithCSS', false, 'true');
|
|
1442
|
+
if (kind === 'color')
|
|
1443
|
+
this.doc.execCommand('foreColor', false, value);
|
|
1444
|
+
else if (!this.doc.execCommand('hiliteColor', false, value))
|
|
1445
|
+
this.doc.execCommand('backColor', false, value);
|
|
1446
|
+
this.doc.execCommand('styleWithCSS', false, 'false');
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
customColor(kind, event) {
|
|
1450
|
+
this.pickColor(kind, event.target.value);
|
|
1451
|
+
}
|
|
1452
|
+
gridMove(rows, cols) {
|
|
1453
|
+
this.gridHover = { rows, cols };
|
|
1454
|
+
}
|
|
1455
|
+
/** Arrow keys over the grid picker; Enter inserts. */
|
|
1456
|
+
gridKeydown(event) {
|
|
1457
|
+
const g = this.gridHover;
|
|
1458
|
+
let { rows, cols } = g.rows ? g : { rows: 1, cols: 1 };
|
|
1459
|
+
if (event.key === 'ArrowRight')
|
|
1460
|
+
cols = Math.min(this.opts.table.cols, cols + 1);
|
|
1461
|
+
else if (event.key === 'ArrowLeft')
|
|
1462
|
+
cols = Math.max(1, cols - 1);
|
|
1463
|
+
else if (event.key === 'ArrowDown')
|
|
1464
|
+
rows = Math.min(this.opts.table.rows, rows + 1);
|
|
1465
|
+
else if (event.key === 'ArrowUp')
|
|
1466
|
+
rows = Math.max(1, rows - 1);
|
|
1467
|
+
else if (event.key === 'Enter' || event.key === ' ') {
|
|
1468
|
+
event.preventDefault();
|
|
1469
|
+
return this.insertTable(rows, cols);
|
|
1470
|
+
}
|
|
1471
|
+
else
|
|
1472
|
+
return;
|
|
1473
|
+
event.preventDefault();
|
|
1474
|
+
this.gridHover = { rows, cols };
|
|
1475
|
+
this.cdr.markForCheck();
|
|
1476
|
+
}
|
|
1477
|
+
/** The insert panel's size fields: rows and columns typed in, then Insert. */
|
|
1478
|
+
insertCustomTable() {
|
|
1479
|
+
const n = (v, max) => Math.min(max, Math.max(1, Math.floor(Number(v)) || 1));
|
|
1480
|
+
this.insertTable(n(this.tableForm.rows, 100), n(this.tableForm.cols, 30), this.tableForm.header);
|
|
1481
|
+
}
|
|
1482
|
+
setTableForm(field, event) {
|
|
1483
|
+
this.tableForm = Object.assign(Object.assign({}, this.tableForm), { [field]: event.target.value });
|
|
1484
|
+
}
|
|
1485
|
+
setTableHeader(event) {
|
|
1486
|
+
this.tableForm = Object.assign(Object.assign({}, this.tableForm), { header: event.target.checked });
|
|
1487
|
+
}
|
|
1488
|
+
insertTable(rows, cols, header = this.opts.table.headerRow) {
|
|
1489
|
+
this.closePanel(false);
|
|
1490
|
+
this.exec(() => {
|
|
1491
|
+
const table = createTable(this.doc, Math.max(1, rows), Math.max(1, cols), header && rows > 1);
|
|
1492
|
+
const html = table.outerHTML + '<p><br></p>';
|
|
1493
|
+
this.doc.execCommand('insertHTML', false, html);
|
|
1494
|
+
// Put the caret in the first cell of the new table.
|
|
1495
|
+
const tables = this.area.querySelectorAll('table');
|
|
1496
|
+
const r = rangeIn(this.area);
|
|
1497
|
+
let target = null;
|
|
1498
|
+
tables.forEach((t) => {
|
|
1499
|
+
if (!target && r && t.compareDocumentPosition(r.startContainer) & 4)
|
|
1500
|
+
target = t;
|
|
1501
|
+
});
|
|
1502
|
+
const placed = (target || tables[tables.length - 1]);
|
|
1503
|
+
const first = placed === null || placed === void 0 ? void 0 : placed.querySelector('td, th');
|
|
1504
|
+
if (first)
|
|
1505
|
+
caretIn(first);
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
/** Table menu actions. */
|
|
1509
|
+
tableAction(action) {
|
|
1510
|
+
var _a;
|
|
1511
|
+
const pick = this.cellPick;
|
|
1512
|
+
const cell = (pick === null || pick === void 0 ? void 0 : pick.from) || this.currentCell();
|
|
1513
|
+
const fromBar = this.panel === 'tableBar';
|
|
1514
|
+
this.closePanel(false);
|
|
1515
|
+
if (!cell)
|
|
1516
|
+
return;
|
|
1517
|
+
this.exec(() => {
|
|
1518
|
+
const table = cell.closest('table');
|
|
1519
|
+
let caret = cell;
|
|
1520
|
+
this.clearCellPick();
|
|
1521
|
+
switch (action) {
|
|
1522
|
+
case 'mergeCells':
|
|
1523
|
+
if (pick && pick.table === table)
|
|
1524
|
+
caret = mergeRect(table, cellRect(table, pick.from, pick.to)) || cell;
|
|
1525
|
+
else
|
|
1526
|
+
mergeCells(cell, 'right');
|
|
1527
|
+
break;
|
|
1528
|
+
case 'rowAbove':
|
|
1529
|
+
insertRow(cell, false);
|
|
1530
|
+
break;
|
|
1531
|
+
case 'rowBelow':
|
|
1532
|
+
caret = insertRow(cell, true);
|
|
1533
|
+
break;
|
|
1534
|
+
case 'colLeft':
|
|
1535
|
+
insertColumn(cell, false);
|
|
1536
|
+
break;
|
|
1537
|
+
case 'colRight':
|
|
1538
|
+
insertColumn(cell, true);
|
|
1539
|
+
break;
|
|
1540
|
+
case 'deleteRow':
|
|
1541
|
+
caret = deleteRow(cell);
|
|
1542
|
+
break;
|
|
1543
|
+
case 'deleteCol':
|
|
1544
|
+
caret = deleteColumn(cell);
|
|
1545
|
+
break;
|
|
1546
|
+
case 'deleteTable': {
|
|
1547
|
+
const after = table.nextElementSibling;
|
|
1548
|
+
table.remove();
|
|
1549
|
+
caret = after || null;
|
|
1550
|
+
break;
|
|
1551
|
+
}
|
|
1552
|
+
case 'headerRow':
|
|
1553
|
+
toggleHeaderRow(table);
|
|
1554
|
+
break;
|
|
1555
|
+
case 'mergeRight':
|
|
1556
|
+
mergeCells(cell, 'right');
|
|
1557
|
+
break;
|
|
1558
|
+
case 'mergeDown':
|
|
1559
|
+
mergeCells(cell, 'down');
|
|
1560
|
+
break;
|
|
1561
|
+
case 'splitCell':
|
|
1562
|
+
splitCell(cell);
|
|
1563
|
+
break;
|
|
1564
|
+
}
|
|
1565
|
+
if (caret && caret.isConnected)
|
|
1566
|
+
caretIn(caret);
|
|
1567
|
+
else if (!this.area.firstChild)
|
|
1568
|
+
this.area.innerHTML = '<p><br></p>';
|
|
1569
|
+
}, true);
|
|
1570
|
+
// The table's own toolbar stays while the table does.
|
|
1571
|
+
const still = (_a = (cell.isConnected ? cell : this.currentCell())) === null || _a === void 0 ? void 0 : _a.closest('table');
|
|
1572
|
+
if (fromBar && still && this.area.contains(still))
|
|
1573
|
+
setTimeout(() => this.openPanel('tableBar', still));
|
|
1574
|
+
}
|
|
1575
|
+
/** Two or more cells picked (merge them), else the cell can join its right neighbour. */
|
|
1576
|
+
get canMergePicked() {
|
|
1577
|
+
if (this.cellPick)
|
|
1578
|
+
return cellsInRect(this.cellPick.table, cellRect(this.cellPick.table, this.cellPick.from, this.cellPick.to)).length > 1;
|
|
1579
|
+
return this.canMerge('right');
|
|
1580
|
+
}
|
|
1581
|
+
/** Over a column's right edge the pointer becomes a resize arrow. */
|
|
1582
|
+
tablePointerMove(event) {
|
|
1583
|
+
var _a;
|
|
1584
|
+
if (this.locked || event.buttons)
|
|
1585
|
+
return;
|
|
1586
|
+
const hit = this.columnEdgeAt(event);
|
|
1587
|
+
if (!!hit !== !!this.resizeHover || (hit === null || hit === void 0 ? void 0 : hit.col) !== ((_a = this.resizeHover) === null || _a === void 0 ? void 0 : _a.col))
|
|
1588
|
+
this.area.classList.toggle('wu-editor-col-resize', !!hit);
|
|
1589
|
+
this.resizeHover = hit;
|
|
1590
|
+
}
|
|
1591
|
+
tablePointerDown(event) {
|
|
1592
|
+
var _a, _b;
|
|
1593
|
+
if (this.locked || event.button !== 0)
|
|
1594
|
+
return;
|
|
1595
|
+
const hit = this.columnEdgeAt(event);
|
|
1596
|
+
if (hit) {
|
|
1597
|
+
event.preventDefault();
|
|
1598
|
+
this.zone.run(() => this.startColumnResize(hit.table, hit.col, event));
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
const cell = (_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, 'td, th');
|
|
1602
|
+
if (!cell || !this.area.contains(cell)) {
|
|
1603
|
+
if (this.cellPick)
|
|
1604
|
+
this.zone.run(() => this.clearCellPick());
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
const table = cell.closest('table');
|
|
1608
|
+
// Shift + click: from the cell with the caret to this one.
|
|
1609
|
+
const caretCell = this.currentCell();
|
|
1610
|
+
if (event.shiftKey && caretCell && caretCell !== cell && caretCell.closest('table') === table) {
|
|
1611
|
+
event.preventDefault();
|
|
1612
|
+
this.zone.run(() => { var _a; return this.pickCells(table, ((_a = this.cellPick) === null || _a === void 0 ? void 0 : _a.from) || caretCell, cell); });
|
|
1613
|
+
return;
|
|
1614
|
+
}
|
|
1615
|
+
if (this.cellPick)
|
|
1616
|
+
this.zone.run(() => this.clearCellPick());
|
|
1617
|
+
const doc = this.doc;
|
|
1618
|
+
const move = (e) => {
|
|
1619
|
+
var _a, _b;
|
|
1620
|
+
const over = (_b = (_a = doc.elementFromPoint(e.clientX, e.clientY)) === null || _a === void 0 ? void 0 : _a.closest) === null || _b === void 0 ? void 0 : _b.call(_a, 'td, th');
|
|
1621
|
+
if (!over || over.closest('table') !== table)
|
|
1622
|
+
return;
|
|
1623
|
+
if (over === cell && !this.cellPick)
|
|
1624
|
+
return;
|
|
1625
|
+
this.zone.run(() => this.pickCells(table, cell, over));
|
|
1626
|
+
};
|
|
1627
|
+
const up = () => {
|
|
1628
|
+
doc.removeEventListener('pointermove', move);
|
|
1629
|
+
doc.removeEventListener('pointerup', up);
|
|
1630
|
+
if (this.cellPick) {
|
|
1631
|
+
// The caret goes back to the first cell; the picked cells stay marked.
|
|
1632
|
+
caretIn(this.cellPick.from);
|
|
1633
|
+
this.area.classList.remove('wu-editor-picking');
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
doc.addEventListener('pointermove', move);
|
|
1637
|
+
doc.addEventListener('pointerup', up);
|
|
1638
|
+
}
|
|
1639
|
+
pickCells(table, from, to) {
|
|
1640
|
+
this.cellPick = { table, from, to };
|
|
1641
|
+
const picked = new Set(cellsInRect(table, cellRect(table, from, to)));
|
|
1642
|
+
table.querySelectorAll('td, th').forEach((c) => c.classList.toggle('wu-editor-cell-picked', picked.has(c)));
|
|
1643
|
+
this.area.classList.add('wu-editor-picking');
|
|
1644
|
+
if (this.panel !== 'tableBar' || this.panelAnchor !== table)
|
|
1645
|
+
this.openPanel('tableBar', table);
|
|
1646
|
+
this.cdr.markForCheck();
|
|
1647
|
+
}
|
|
1648
|
+
clearCellPick() {
|
|
1649
|
+
if (!this.cellPick)
|
|
1650
|
+
return;
|
|
1651
|
+
this.cellPick.table.querySelectorAll('.wu-editor-cell-picked').forEach((c) => c.classList.remove('wu-editor-cell-picked'));
|
|
1652
|
+
this.area.classList.remove('wu-editor-picking');
|
|
1653
|
+
this.cellPick = null;
|
|
1654
|
+
this.cdr.markForCheck();
|
|
1655
|
+
}
|
|
1656
|
+
/** The column whose right edge is under the pointer (within 4px), or null. */
|
|
1657
|
+
columnEdgeAt(event) {
|
|
1658
|
+
var _a, _b, _c;
|
|
1659
|
+
const cell = (_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, 'td, th');
|
|
1660
|
+
if (!cell || !this.area.contains(cell))
|
|
1661
|
+
return null;
|
|
1662
|
+
const r = cell.getBoundingClientRect();
|
|
1663
|
+
const rtl = ((_c = this.doc.defaultView) === null || _c === void 0 ? void 0 : _c.getComputedStyle(cell).direction) === 'rtl';
|
|
1664
|
+
const edge = rtl ? r.left : r.right;
|
|
1665
|
+
if (Math.abs(event.clientX - edge) > 4)
|
|
1666
|
+
return null;
|
|
1667
|
+
const table = cell.closest('table');
|
|
1668
|
+
const g = tableGrid(table);
|
|
1669
|
+
let col = -1;
|
|
1670
|
+
for (const row of g.grid) {
|
|
1671
|
+
const i = row.lastIndexOf(cell);
|
|
1672
|
+
if (i >= 0) {
|
|
1673
|
+
col = i;
|
|
1674
|
+
break;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
return col >= 0 ? { table, col } : null;
|
|
1678
|
+
}
|
|
1679
|
+
/** Drags a column's edge: the column and its right neighbour share the width; the last edge resizes the table. */
|
|
1680
|
+
startColumnResize(table, col, event) {
|
|
1681
|
+
var _a;
|
|
1682
|
+
const cols = ensureTableCols(table);
|
|
1683
|
+
const tableWidth = table.getBoundingClientRect().width || 1;
|
|
1684
|
+
const host = Math.max(1, ((_a = table.parentElement) === null || _a === void 0 ? void 0 : _a.clientWidth) || tableWidth);
|
|
1685
|
+
const start = event.clientX;
|
|
1686
|
+
const startW = cols.map((c) => ((parseFloat(c.style.width) || 100 / cols.length) / 100) * tableWidth);
|
|
1687
|
+
const startTable = tableWidth;
|
|
1688
|
+
const min = 24;
|
|
1689
|
+
const last = col >= cols.length - 1;
|
|
1690
|
+
const doc = this.doc;
|
|
1691
|
+
this.area.classList.add('wu-editor-resizing');
|
|
1692
|
+
const move = (e) => {
|
|
1693
|
+
const dx = e.clientX - start;
|
|
1694
|
+
if (last) {
|
|
1695
|
+
// The table itself: as wide as the text at most.
|
|
1696
|
+
const w = Math.min(host, Math.max(min * cols.length, startTable + dx));
|
|
1697
|
+
table.style.width = percent((w / host) * 100);
|
|
1698
|
+
const total = startW.reduce((a, b) => a + b, 0) - startW[col] + Math.max(min, startW[col] + (w - startTable));
|
|
1699
|
+
cols.forEach((c, i) => (c.style.width = percent(((i === col ? Math.max(min, startW[col] + (w - startTable)) : startW[i]) / total) * 100)));
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
const pair = startW[col] + startW[col + 1];
|
|
1703
|
+
const a = Math.min(pair - min, Math.max(min, startW[col] + dx));
|
|
1704
|
+
const widths = startW.slice();
|
|
1705
|
+
widths[col] = a;
|
|
1706
|
+
widths[col + 1] = pair - a;
|
|
1707
|
+
const sum = widths.reduce((x, y) => x + y, 0) || 1;
|
|
1708
|
+
cols.forEach((c, i) => (c.style.width = percent((widths[i] / sum) * 100)));
|
|
1709
|
+
};
|
|
1710
|
+
const up = () => {
|
|
1711
|
+
doc.removeEventListener('pointermove', move);
|
|
1712
|
+
doc.removeEventListener('pointerup', up);
|
|
1713
|
+
this.area.classList.remove('wu-editor-resizing');
|
|
1714
|
+
this.zone.run(() => this.afterTableResize());
|
|
1715
|
+
};
|
|
1716
|
+
doc.addEventListener('pointermove', move);
|
|
1717
|
+
doc.addEventListener('pointerup', up);
|
|
1718
|
+
}
|
|
1719
|
+
afterTableResize() {
|
|
1720
|
+
this.pushHistory(false);
|
|
1721
|
+
this.emit('user');
|
|
1722
|
+
}
|
|
1723
|
+
canMerge(direction) {
|
|
1724
|
+
var _a;
|
|
1725
|
+
const cell = this.currentCell();
|
|
1726
|
+
if (!cell)
|
|
1727
|
+
return false;
|
|
1728
|
+
const clone = cell.closest('table').cloneNode(true);
|
|
1729
|
+
const path = [];
|
|
1730
|
+
// Try the merge on a copy so the menu can say whether it would work.
|
|
1731
|
+
const rows = Array.from(cell.closest('table').rows);
|
|
1732
|
+
const r = rows.indexOf(cell.parentElement);
|
|
1733
|
+
const c = Array.from(cell.parentElement.cells).indexOf(cell);
|
|
1734
|
+
path.push(r, c);
|
|
1735
|
+
const copy = (_a = clone.rows[r]) === null || _a === void 0 ? void 0 : _a.cells[c];
|
|
1736
|
+
return !!copy && mergeCells(copy, direction);
|
|
1737
|
+
}
|
|
1738
|
+
canSplit() {
|
|
1739
|
+
const cell = this.currentCell();
|
|
1740
|
+
return !!cell && ((cell.rowSpan || 1) > 1 || (cell.colSpan || 1) > 1);
|
|
1741
|
+
}
|
|
1742
|
+
get inHeaderRow() {
|
|
1743
|
+
const cell = this.currentCell();
|
|
1744
|
+
return !!(cell === null || cell === void 0 ? void 0 : cell.closest('thead'));
|
|
1745
|
+
}
|
|
1746
|
+
// ---------- links ----------
|
|
1747
|
+
applyLink() {
|
|
1748
|
+
const url = this.linkForm.url.trim();
|
|
1749
|
+
if (!url)
|
|
1750
|
+
return this.unlink();
|
|
1751
|
+
const href = /^[a-z][a-z0-9+.-]*:|^[/#?.]/i.test(url) ? url : `https://${url}`;
|
|
1752
|
+
if (!safeEditorUrl(href, this.opts.link.protocols)) {
|
|
1753
|
+
this.linkForm.error = this.m.invalidUrl;
|
|
1754
|
+
this.cdr.markForCheck();
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
const newTab = this.linkForm.newTab;
|
|
1758
|
+
const text = this.linkForm.text.trim();
|
|
1759
|
+
this.closePanel(false);
|
|
1760
|
+
this.exec(() => {
|
|
1761
|
+
const r = rangeIn(this.area);
|
|
1762
|
+
const existing = r ? closestIn(r.startContainer, this.area, 'a') : null;
|
|
1763
|
+
if (existing && (!r || r.collapsed)) {
|
|
1764
|
+
existing.setAttribute('href', href);
|
|
1765
|
+
if (text && text !== existing.textContent)
|
|
1766
|
+
existing.textContent = text;
|
|
1767
|
+
this.setLinkTarget(existing, newTab);
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
if (!r || r.collapsed) {
|
|
1771
|
+
const a = this.doc.createElement('a');
|
|
1772
|
+
a.setAttribute('href', href);
|
|
1773
|
+
a.textContent = text || url;
|
|
1774
|
+
this.setLinkTarget(a, newTab);
|
|
1775
|
+
this.doc.execCommand('insertHTML', false, a.outerHTML + ' ');
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
this.doc.execCommand('createLink', false, href);
|
|
1779
|
+
const sel = rangeIn(this.area);
|
|
1780
|
+
const anchors = new Set();
|
|
1781
|
+
this.area.querySelectorAll('a').forEach((a) => {
|
|
1782
|
+
if (a.getAttribute('href') === href && sel && sel.intersectsNode(a))
|
|
1783
|
+
anchors.add(a);
|
|
1784
|
+
});
|
|
1785
|
+
anchors.forEach((a) => this.setLinkTarget(a, newTab));
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
unlink() {
|
|
1789
|
+
this.closePanel(false);
|
|
1790
|
+
this.exec(() => {
|
|
1791
|
+
const r = rangeIn(this.area);
|
|
1792
|
+
const a = r ? closestIn(r.startContainer, this.area, 'a') : null;
|
|
1793
|
+
if (a && (r === null || r === void 0 ? void 0 : r.collapsed)) {
|
|
1794
|
+
a.replaceWith(...Array.from(a.childNodes));
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
this.doc.execCommand('unlink', false);
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
currentLinkHref() {
|
|
1801
|
+
const r = this.savedRange;
|
|
1802
|
+
const a = r ? closestIn(r.startContainer, this.area, 'a') : null;
|
|
1803
|
+
return (a === null || a === void 0 ? void 0 : a.getAttribute('href')) || '';
|
|
1804
|
+
}
|
|
1805
|
+
// ---------- images ----------
|
|
1806
|
+
chooseImage() {
|
|
1807
|
+
var _a;
|
|
1808
|
+
(_a = this.imageInputRef) === null || _a === void 0 ? void 0 : _a.nativeElement.click();
|
|
1809
|
+
}
|
|
1810
|
+
imageFilesChosen(event) {
|
|
1811
|
+
const input = event.target;
|
|
1812
|
+
const files = Array.from(input.files || []);
|
|
1813
|
+
input.value = '';
|
|
1814
|
+
this.closePanel(false);
|
|
1815
|
+
this.restore();
|
|
1816
|
+
void this.insertImageFiles(files);
|
|
1817
|
+
}
|
|
1818
|
+
insertImageUrl() {
|
|
1819
|
+
const url = this.imageForm.url.trim();
|
|
1820
|
+
if (!url || !safeEditorImage(url)) {
|
|
1821
|
+
this.imageForm.error = this.m.invalidUrl;
|
|
1822
|
+
this.cdr.markForCheck();
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
const alt = this.imageForm.alt.trim();
|
|
1826
|
+
this.closePanel(false);
|
|
1827
|
+
this.exec(() => {
|
|
1828
|
+
const img = this.doc.createElement('img');
|
|
1829
|
+
img.setAttribute('src', url);
|
|
1830
|
+
img.setAttribute('alt', alt);
|
|
1831
|
+
this.doc.execCommand('insertHTML', false, img.outerHTML);
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
imagePanelDrop(event) {
|
|
1835
|
+
var _a;
|
|
1836
|
+
event.preventDefault();
|
|
1837
|
+
const files = Array.from(((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) || []);
|
|
1838
|
+
this.closePanel(false);
|
|
1839
|
+
this.restore();
|
|
1840
|
+
void this.insertImageFiles(files);
|
|
1841
|
+
}
|
|
1842
|
+
/** Picture menu: alignment, width, alternative text, remove. */
|
|
1843
|
+
setImageAlign(a) {
|
|
1844
|
+
const img = this.selectedImage;
|
|
1845
|
+
if (!img)
|
|
1846
|
+
return;
|
|
1847
|
+
setPrefixedClass(img, 'wu-image-', a === 'inline' ? null : a);
|
|
1848
|
+
this.afterDomChange();
|
|
1849
|
+
this.placeFrame();
|
|
1850
|
+
}
|
|
1851
|
+
setImageWidth(percent) {
|
|
1852
|
+
const img = this.selectedImage;
|
|
1853
|
+
if (!img)
|
|
1854
|
+
return;
|
|
1855
|
+
if (percent === null)
|
|
1856
|
+
img.removeAttribute('width');
|
|
1857
|
+
else {
|
|
1858
|
+
const box = this.area.clientWidth - 32;
|
|
1859
|
+
img.setAttribute('width', String(Math.round((box * percent) / 100)));
|
|
1860
|
+
}
|
|
1861
|
+
img.removeAttribute('height');
|
|
1862
|
+
this.afterDomChange();
|
|
1863
|
+
this.placeFrame();
|
|
1864
|
+
}
|
|
1865
|
+
setImageAlt(event) {
|
|
1866
|
+
const img = this.selectedImage;
|
|
1867
|
+
if (!img)
|
|
1868
|
+
return;
|
|
1869
|
+
img.setAttribute('alt', event.target.value);
|
|
1870
|
+
this.afterDomChange();
|
|
1871
|
+
}
|
|
1872
|
+
removeImage() {
|
|
1873
|
+
const img = this.selectedImage;
|
|
1874
|
+
if (!img)
|
|
1875
|
+
return;
|
|
1876
|
+
this.closePanel(false);
|
|
1877
|
+
this.selectImage(null);
|
|
1878
|
+
img.remove();
|
|
1879
|
+
this.afterDomChange();
|
|
1880
|
+
this.area.focus();
|
|
1881
|
+
}
|
|
1882
|
+
/** Drag on the frame's corner handle resizes the picture, keeping its proportions. */
|
|
1883
|
+
resizeStart(event) {
|
|
1884
|
+
var _a;
|
|
1885
|
+
const img = this.selectedImage;
|
|
1886
|
+
if (!img || this.locked)
|
|
1887
|
+
return;
|
|
1888
|
+
event.preventDefault();
|
|
1889
|
+
const handle = event.currentTarget;
|
|
1890
|
+
(_a = handle.setPointerCapture) === null || _a === void 0 ? void 0 : _a.call(handle, event.pointerId);
|
|
1891
|
+
const startX = event.clientX;
|
|
1892
|
+
const startW = img.getBoundingClientRect().width;
|
|
1893
|
+
const max = this.area.clientWidth - 16;
|
|
1894
|
+
const move = (e) => {
|
|
1895
|
+
const w = Math.max(24, Math.min(max, Math.round(startW + (e.clientX - startX))));
|
|
1896
|
+
img.setAttribute('width', String(w));
|
|
1897
|
+
img.removeAttribute('height');
|
|
1898
|
+
this.placeFrame();
|
|
1899
|
+
};
|
|
1900
|
+
const up = () => {
|
|
1901
|
+
handle.removeEventListener('pointermove', move);
|
|
1902
|
+
handle.removeEventListener('pointerup', up);
|
|
1903
|
+
handle.removeEventListener('pointercancel', up);
|
|
1904
|
+
this.zone.run(() => this.afterDomChange());
|
|
1905
|
+
};
|
|
1906
|
+
this.zone.runOutsideAngular(() => {
|
|
1907
|
+
handle.addEventListener('pointermove', move);
|
|
1908
|
+
handle.addEventListener('pointerup', up);
|
|
1909
|
+
handle.addEventListener('pointercancel', up);
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
/** Uploads or embeds pictures and puts them at the caret. */
|
|
1913
|
+
insertImageFiles(files) {
|
|
1914
|
+
var _a, _b, _c, _d;
|
|
1915
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1916
|
+
const cfg = this.uploadConfig;
|
|
1917
|
+
for (const file of files) {
|
|
1918
|
+
if (!acceptsFile(file, cfg.accept || ACCEPT_IMAGES)) {
|
|
1919
|
+
this.fail(file, 'type', this.m.imageWrongType.replace('{0}', file.name));
|
|
1920
|
+
continue;
|
|
1921
|
+
}
|
|
1922
|
+
if (cfg.maxSize && file.size > cfg.maxSize) {
|
|
1923
|
+
this.fail(file, 'size', this.m.imageTooLarge.replace('{0}', file.name).replace('{1}', formatFileSize(cfg.maxSize, this.t.fileSizeTypes)));
|
|
1924
|
+
continue;
|
|
1925
|
+
}
|
|
1926
|
+
if (this.uploadMode === 'base64') {
|
|
1927
|
+
const data = yield this.readAsDataUrl(file);
|
|
1928
|
+
this.exec(() => this.doc.execCommand('insertHTML', false, `<img src="${data}" alt="">`));
|
|
1929
|
+
continue;
|
|
1930
|
+
}
|
|
1931
|
+
// Show the picture at once, from memory, while it uploads.
|
|
1932
|
+
const win = this.doc.defaultView;
|
|
1933
|
+
const temp = ((_a = win === null || win === void 0 ? void 0 : win.URL) === null || _a === void 0 ? void 0 : _a.createObjectURL) ? win.URL.createObjectURL(file) : yield this.readAsDataUrl(file);
|
|
1934
|
+
const marker = `wu-up-${Math.random().toString(36).slice(2)}`;
|
|
1935
|
+
this.exec(() => this.doc.execCommand('insertHTML', false, `<img src="${temp}" alt="" class="wu-image-uploading" data-wu-upload="${marker}">`));
|
|
1936
|
+
try {
|
|
1937
|
+
const url = yield this.upload(file);
|
|
1938
|
+
const img = this.area.querySelector(`img[data-wu-upload="${marker}"]`);
|
|
1939
|
+
if (img) {
|
|
1940
|
+
img.setAttribute('src', url);
|
|
1941
|
+
img.classList.remove('wu-image-uploading');
|
|
1942
|
+
if (!img.classList.length)
|
|
1943
|
+
img.removeAttribute('class');
|
|
1944
|
+
img.removeAttribute('data-wu-upload');
|
|
1945
|
+
}
|
|
1946
|
+
this.onImageUpload.emit({ file, url });
|
|
1947
|
+
this.afterDomChange();
|
|
1948
|
+
}
|
|
1949
|
+
catch (error) {
|
|
1950
|
+
(_b = this.area.querySelector(`img[data-wu-upload="${marker}"]`)) === null || _b === void 0 ? void 0 : _b.remove();
|
|
1951
|
+
this.fail(file, 'upload', this.m.uploadFailed, error);
|
|
1952
|
+
this.afterDomChange();
|
|
1953
|
+
}
|
|
1954
|
+
finally {
|
|
1955
|
+
if (temp.startsWith('blob:'))
|
|
1956
|
+
(_d = (_c = win === null || win === void 0 ? void 0 : win.URL) === null || _c === void 0 ? void 0 : _c.revokeObjectURL) === null || _d === void 0 ? void 0 : _d.call(_c, temp);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
/** Puts the keyboard in the content, where the caret last was. */
|
|
1962
|
+
focus() {
|
|
1963
|
+
if (this.sourceMode)
|
|
1964
|
+
return;
|
|
1965
|
+
this.restore();
|
|
1966
|
+
}
|
|
1967
|
+
// ---------- content events ----------
|
|
1968
|
+
areaInput() {
|
|
1969
|
+
this.normalizeEmpty();
|
|
1970
|
+
this.pushHistory(true);
|
|
1971
|
+
this.emit('user');
|
|
1972
|
+
}
|
|
1973
|
+
areaFocus(event) {
|
|
1974
|
+
this.focused = true;
|
|
1975
|
+
this.onFocus.emit(event);
|
|
1976
|
+
this.cdr.markForCheck();
|
|
1977
|
+
}
|
|
1978
|
+
areaBlur(event) {
|
|
1979
|
+
this.focused = false;
|
|
1980
|
+
this.onTouched();
|
|
1981
|
+
this.onBlur.emit(event);
|
|
1982
|
+
this.cdr.markForCheck();
|
|
1983
|
+
}
|
|
1984
|
+
areaKeydown(event) {
|
|
1985
|
+
if (this.locked)
|
|
1986
|
+
return;
|
|
1987
|
+
if (this.cellPick && !['Shift', 'Control', 'Meta', 'Alt'].includes(event.key)) {
|
|
1988
|
+
const pick = this.cellPick;
|
|
1989
|
+
if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
1990
|
+
event.preventDefault();
|
|
1991
|
+
this.exec(() => {
|
|
1992
|
+
for (const c of cellsInRect(pick.table, cellRect(pick.table, pick.from, pick.to)))
|
|
1993
|
+
c.innerHTML = '<br>';
|
|
1994
|
+
caretIn(pick.from);
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
this.clearCellPick();
|
|
1998
|
+
if (event.defaultPrevented)
|
|
1999
|
+
return;
|
|
2000
|
+
}
|
|
2001
|
+
const mod = event.ctrlKey || event.metaKey;
|
|
2002
|
+
const key = event.key.toLowerCase();
|
|
2003
|
+
if (mod && !event.altKey) {
|
|
2004
|
+
if (key === 'z') {
|
|
2005
|
+
event.preventDefault();
|
|
2006
|
+
return event.shiftKey ? this.redo() : this.undo();
|
|
2007
|
+
}
|
|
2008
|
+
if (key === 'y') {
|
|
2009
|
+
event.preventDefault();
|
|
2010
|
+
return this.redo();
|
|
2011
|
+
}
|
|
2012
|
+
if (key === 'k') {
|
|
2013
|
+
event.preventDefault();
|
|
2014
|
+
return this.openPanel('link', this.toolbarButton('link') || this.area);
|
|
2015
|
+
}
|
|
2016
|
+
if (key === 'b' || key === 'i' || key === 'u') {
|
|
2017
|
+
event.preventDefault();
|
|
2018
|
+
return this.runTool(key === 'b' ? 'bold' : key === 'i' ? 'italic' : 'underline', event);
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
if (event.key === 'Tab' && !mod && !event.altKey) {
|
|
2022
|
+
const cell = this.currentCell();
|
|
2023
|
+
if (cell) {
|
|
2024
|
+
event.preventDefault();
|
|
2025
|
+
const next = adjacentCell(cell, event.shiftKey);
|
|
2026
|
+
if (next)
|
|
2027
|
+
caretIn(next, true);
|
|
2028
|
+
else if (!event.shiftKey)
|
|
2029
|
+
this.exec(() => {
|
|
2030
|
+
const added = insertRow(cell, true);
|
|
2031
|
+
if (added)
|
|
2032
|
+
caretIn(added);
|
|
2033
|
+
}, true);
|
|
2034
|
+
return;
|
|
2035
|
+
}
|
|
2036
|
+
if (this.state.bulletList || this.state.orderedList) {
|
|
2037
|
+
event.preventDefault();
|
|
2038
|
+
return this.exec(() => this.doc.execCommand(event.shiftKey ? 'outdent' : 'indent', false));
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
if ((event.key === 'Delete' || event.key === 'Backspace') && this.selectedImage) {
|
|
2042
|
+
event.preventDefault();
|
|
2043
|
+
return this.removeImage();
|
|
2044
|
+
}
|
|
2045
|
+
if (event.key === 'Escape' && this.fullscreen) {
|
|
2046
|
+
event.preventDefault();
|
|
2047
|
+
this.toggleFullscreen();
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
areaClick(event) {
|
|
2051
|
+
var _a;
|
|
2052
|
+
const t = event.target;
|
|
2053
|
+
if (t.tagName === 'IMG' && this.area.contains(t)) {
|
|
2054
|
+
this.selectImage(t);
|
|
2055
|
+
if (!this.locked)
|
|
2056
|
+
this.openPanel('imageMenu', t);
|
|
2057
|
+
return;
|
|
2058
|
+
}
|
|
2059
|
+
this.selectImage(null);
|
|
2060
|
+
const table = t.closest('table');
|
|
2061
|
+
if (table && this.area.contains(table) && !this.locked && !t.closest('a')) {
|
|
2062
|
+
if (this.panel !== 'tableBar' || this.panelAnchor !== table)
|
|
2063
|
+
this.openPanel('tableBar', table);
|
|
2064
|
+
return;
|
|
2065
|
+
}
|
|
2066
|
+
const a = t.closest('a');
|
|
2067
|
+
if (a && this.area.contains(a) && !this.locked) {
|
|
2068
|
+
// Ctrl / ⌘ + click opens the link, as in other editors.
|
|
2069
|
+
if (event.ctrlKey || event.metaKey) {
|
|
2070
|
+
const href = a.getAttribute('href');
|
|
2071
|
+
if (href)
|
|
2072
|
+
(_a = this.doc.defaultView) === null || _a === void 0 ? void 0 : _a.open(href, '_blank', 'noopener');
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
this.saveRange();
|
|
2076
|
+
this.openPanel('linkMenu', a);
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
areaPaste(event) {
|
|
2080
|
+
if (this.locked)
|
|
2081
|
+
return;
|
|
2082
|
+
const dt = event.clipboardData;
|
|
2083
|
+
if (!dt)
|
|
2084
|
+
return;
|
|
2085
|
+
const files = Array.from(dt.files || []).filter((f) => /^image\//.test(f.type));
|
|
2086
|
+
const html = dt.getData('text/html');
|
|
2087
|
+
if (files.length && !html) {
|
|
2088
|
+
event.preventDefault();
|
|
2089
|
+
void this.insertImageFiles(files);
|
|
2090
|
+
return;
|
|
2091
|
+
}
|
|
2092
|
+
event.preventDefault();
|
|
2093
|
+
if (html) {
|
|
2094
|
+
this.insertHtml(cleanEditorHtml(html.replace(/<!--StartFragment-->|<!--EndFragment-->/g, ''), this.doc, this.cleanOpts));
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
const text = dt.getData('text/plain');
|
|
2098
|
+
if (!text)
|
|
2099
|
+
return;
|
|
2100
|
+
if (this.state.codeBlock || !/\r?\n/.test(text)) {
|
|
2101
|
+
this.exec(() => this.doc.execCommand('insertText', false, text));
|
|
2102
|
+
return;
|
|
2103
|
+
}
|
|
2104
|
+
const esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
2105
|
+
const paragraphs = text.replace(/\r\n/g, '\n').split(/\n/).map((line) => `<p>${line ? esc(line) : '<br>'}</p>`);
|
|
2106
|
+
this.insertHtml(paragraphs.join(''));
|
|
2107
|
+
}
|
|
2108
|
+
areaDragOver(event) {
|
|
2109
|
+
var _a;
|
|
2110
|
+
if (!this.locked && Array.from(((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) || []).includes('Files'))
|
|
2111
|
+
event.preventDefault();
|
|
2112
|
+
}
|
|
2113
|
+
areaDrop(event) {
|
|
2114
|
+
var _a;
|
|
2115
|
+
const files = Array.from(((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) || []).filter((f) => /^image\//.test(f.type));
|
|
2116
|
+
if (!files.length || this.locked)
|
|
2117
|
+
return;
|
|
2118
|
+
event.preventDefault();
|
|
2119
|
+
const d = this.doc;
|
|
2120
|
+
let r = null;
|
|
2121
|
+
if (d.caretRangeFromPoint)
|
|
2122
|
+
r = d.caretRangeFromPoint(event.clientX, event.clientY);
|
|
2123
|
+
else if (d.caretPositionFromPoint) {
|
|
2124
|
+
const p = d.caretPositionFromPoint(event.clientX, event.clientY);
|
|
2125
|
+
if (p) {
|
|
2126
|
+
r = this.doc.createRange();
|
|
2127
|
+
r.setStart(p.offsetNode, p.offset);
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
this.area.focus();
|
|
2131
|
+
if (r && this.area.contains(r.startContainer))
|
|
2132
|
+
selectRange(r);
|
|
2133
|
+
void this.insertImageFiles(files);
|
|
2134
|
+
}
|
|
2135
|
+
sourceInput(event) {
|
|
2136
|
+
this.sourceText = event.target.value;
|
|
2137
|
+
}
|
|
2138
|
+
dismissNotice(i) {
|
|
2139
|
+
this.notices = this.notices.filter((_, k) => k !== i);
|
|
2140
|
+
this.cdr.markForCheck();
|
|
2141
|
+
}
|
|
2142
|
+
// ---------- panels ----------
|
|
2143
|
+
openPanel(kind, anchor) {
|
|
2144
|
+
var _a;
|
|
2145
|
+
if (this.panel === kind && this.panelAnchor === anchor)
|
|
2146
|
+
return this.closePanel(true);
|
|
2147
|
+
this.closePanel(false);
|
|
2148
|
+
if (!['imageMenu', 'linkMenu', 'tableBar'].includes(kind))
|
|
2149
|
+
this.saveRange();
|
|
2150
|
+
this.panel = kind;
|
|
2151
|
+
this.panelAnchor = anchor || this.area;
|
|
2152
|
+
if (kind === 'link') {
|
|
2153
|
+
const r = this.savedRange;
|
|
2154
|
+
const a = r ? closestIn(r.startContainer, this.area, 'a') : null;
|
|
2155
|
+
this.linkForm = {
|
|
2156
|
+
url: (a === null || a === void 0 ? void 0 : a.getAttribute('href')) || '',
|
|
2157
|
+
text: a ? a.textContent || '' : '',
|
|
2158
|
+
newTab: a ? a.getAttribute('target') === '_blank' : this.opts.link.newTab,
|
|
2159
|
+
showText: !!a || !r || r.collapsed,
|
|
2160
|
+
error: '',
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
else if (kind === 'image') {
|
|
2164
|
+
this.imageForm = { tab: 'upload', url: '', alt: '', error: '' };
|
|
2165
|
+
}
|
|
2166
|
+
else if (kind === 'table') {
|
|
2167
|
+
this.gridHover = { rows: 0, cols: 0 };
|
|
2168
|
+
}
|
|
2169
|
+
this.cdr.detectChanges();
|
|
2170
|
+
const panel = (_a = this.panelRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2171
|
+
if (!panel)
|
|
2172
|
+
return;
|
|
2173
|
+
this.popup = new ɵWuPopup(this.panelAnchor, panel, {
|
|
2174
|
+
onOutside: () => this.zone.run(() => this.closePanel(false)),
|
|
2175
|
+
onEscape: (e) => this.zone.run(() => {
|
|
2176
|
+
e.preventDefault();
|
|
2177
|
+
this.closePanel(true);
|
|
2178
|
+
}),
|
|
2179
|
+
sheetClass: 'wu-editor-panel-sheet',
|
|
2180
|
+
modalClass: 'wu-editor-panel-modal',
|
|
2181
|
+
sheet: false,
|
|
2182
|
+
gap: 6,
|
|
2183
|
+
});
|
|
2184
|
+
this.popup.open();
|
|
2185
|
+
// Menus get the keyboard; balloons over the content leave it in the text.
|
|
2186
|
+
if (kind !== 'linkMenu' && kind !== 'tableBar') {
|
|
2187
|
+
const first = panel.querySelector('input:not([type="checkbox"]):not([type="color"]):not([type="file"]), [role="menuitemradio"][aria-checked="true"], [role="menuitem"], [role="menuitemradio"], button, [tabindex="0"]');
|
|
2188
|
+
first === null || first === void 0 ? void 0 : first.focus();
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
closePanel(returnFocus) {
|
|
2192
|
+
var _a;
|
|
2193
|
+
if (!this.panel)
|
|
2194
|
+
return;
|
|
2195
|
+
const was = this.panel;
|
|
2196
|
+
const anchor = this.panelAnchor;
|
|
2197
|
+
(_a = this.popup) === null || _a === void 0 ? void 0 : _a.close();
|
|
2198
|
+
this.popup = null;
|
|
2199
|
+
this.panel = null;
|
|
2200
|
+
this.panelAnchor = null;
|
|
2201
|
+
this.cdr.markForCheck();
|
|
2202
|
+
if (returnFocus) {
|
|
2203
|
+
if (was === 'imageMenu' || was === 'linkMenu' || was === 'tableBar' || !anchor || anchor === this.area || !this.host.contains(anchor))
|
|
2204
|
+
this.restore();
|
|
2205
|
+
else
|
|
2206
|
+
anchor.focus();
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
/** ↑ / ↓ inside a menu panel. */
|
|
2210
|
+
panelKeydown(event) {
|
|
2211
|
+
var _a;
|
|
2212
|
+
if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key))
|
|
2213
|
+
return;
|
|
2214
|
+
const panel = (_a = this.panelRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2215
|
+
if (!panel)
|
|
2216
|
+
return;
|
|
2217
|
+
const items = Array.from(panel.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')).filter((el) => !el.disabled);
|
|
2218
|
+
if (!items.length)
|
|
2219
|
+
return;
|
|
2220
|
+
const at = items.indexOf(this.doc.activeElement);
|
|
2221
|
+
event.preventDefault();
|
|
2222
|
+
const next = event.key === 'Home' ? 0 : event.key === 'End' ? items.length - 1 : (at + (event.key === 'ArrowDown' ? 1 : -1) + items.length) % items.length;
|
|
2223
|
+
items[next].focus();
|
|
2224
|
+
}
|
|
2225
|
+
// ---------- internals: commands ----------
|
|
2226
|
+
/** Runs a change on the content with the selection back in place, then records and reports it. */
|
|
2227
|
+
exec(change, structural = false) {
|
|
2228
|
+
if (this.locked || this.sourceMode)
|
|
2229
|
+
return;
|
|
2230
|
+
this.restore();
|
|
2231
|
+
change();
|
|
2232
|
+
if (structural)
|
|
2233
|
+
this.normalizeEmpty();
|
|
2234
|
+
this.afterDomChange();
|
|
2235
|
+
}
|
|
2236
|
+
afterDomChange() {
|
|
2237
|
+
this.normalizeMarkup();
|
|
2238
|
+
this.normalizeEmpty();
|
|
2239
|
+
this.pushHistory(false);
|
|
2240
|
+
this.emit('user');
|
|
2241
|
+
this.updateState();
|
|
2242
|
+
}
|
|
2243
|
+
undo() {
|
|
2244
|
+
const s = this.history.undo();
|
|
2245
|
+
if (s)
|
|
2246
|
+
this.applySnapshot(s.html, s.selection);
|
|
2247
|
+
}
|
|
2248
|
+
redo() {
|
|
2249
|
+
const s = this.history.redo();
|
|
2250
|
+
if (s)
|
|
2251
|
+
this.applySnapshot(s.html, s.selection);
|
|
2252
|
+
}
|
|
2253
|
+
applySnapshot(html, selection) {
|
|
2254
|
+
this.selectImage(null);
|
|
2255
|
+
this.area.innerHTML = html;
|
|
2256
|
+
this.area.focus();
|
|
2257
|
+
if (!restoreSelection(this.area, selection))
|
|
2258
|
+
caretIn(this.area, true);
|
|
2259
|
+
this.canUndo = this.history.canUndo;
|
|
2260
|
+
this.canRedo = this.history.canRedo;
|
|
2261
|
+
this.emit('user');
|
|
2262
|
+
this.updateState();
|
|
2263
|
+
}
|
|
2264
|
+
beforeInput(event) {
|
|
2265
|
+
if (event.inputType === 'historyUndo' || event.inputType === 'historyRedo') {
|
|
2266
|
+
event.preventDefault();
|
|
2267
|
+
this.zone.run(() => (event.inputType === 'historyUndo' ? this.undo() : this.redo()));
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
formatBlock(tag) {
|
|
2271
|
+
this.doc.execCommand('formatBlock', false, `<${tag}>`);
|
|
2272
|
+
}
|
|
2273
|
+
setAlign(a) {
|
|
2274
|
+
const r = rangeIn(this.area);
|
|
2275
|
+
if (!r)
|
|
2276
|
+
return;
|
|
2277
|
+
const blocks = blocksIn(this.area, r);
|
|
2278
|
+
for (const b of blocks) {
|
|
2279
|
+
setPrefixedClass(b, 'ql-align-', a === 'left' ? null : a);
|
|
2280
|
+
b.style.removeProperty('text-align');
|
|
2281
|
+
if (!b.getAttribute('style'))
|
|
2282
|
+
b.removeAttribute('style');
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
/** Indent for paragraphs (Quill's `ql-indent-N` classes); lists nest instead. */
|
|
2286
|
+
indent(step) {
|
|
2287
|
+
if (this.state.bulletList || this.state.orderedList) {
|
|
2288
|
+
this.doc.execCommand(step > 0 ? 'indent' : 'outdent', false);
|
|
2289
|
+
return;
|
|
2290
|
+
}
|
|
2291
|
+
const r = rangeIn(this.area);
|
|
2292
|
+
if (!r)
|
|
2293
|
+
return;
|
|
2294
|
+
for (const b of blocksIn(this.area, r)) {
|
|
2295
|
+
if (b.tagName === 'TD' || b.tagName === 'TH')
|
|
2296
|
+
continue;
|
|
2297
|
+
const cur = Number(prefixedClass(b, 'ql-indent-') || 0);
|
|
2298
|
+
const next = Math.max(0, Math.min(MAX_INDENT, cur + step));
|
|
2299
|
+
setPrefixedClass(b, 'ql-indent-', next ? String(next) : null);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
toggleInlineCode() {
|
|
2303
|
+
const r = rangeIn(this.area);
|
|
2304
|
+
if (!r)
|
|
2305
|
+
return;
|
|
2306
|
+
const code = closestIn(r.startContainer, this.area, 'code');
|
|
2307
|
+
if (code && !closestIn(code, this.area, 'pre')) {
|
|
2308
|
+
code.replaceWith(...Array.from(code.childNodes));
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
if (r.collapsed)
|
|
2312
|
+
return;
|
|
2313
|
+
const el = this.doc.createElement('code');
|
|
2314
|
+
el.appendChild(r.extractContents());
|
|
2315
|
+
el.querySelectorAll('code').forEach((c) => c.replaceWith(...Array.from(c.childNodes)));
|
|
2316
|
+
r.insertNode(el);
|
|
2317
|
+
const after = this.doc.createRange();
|
|
2318
|
+
after.selectNodeContents(el);
|
|
2319
|
+
selectRange(after);
|
|
2320
|
+
}
|
|
2321
|
+
/** Font size / family: Quill's classes for its own sizes and fonts, an inline style for anything else. */
|
|
2322
|
+
applyInlineStyle(kind, value) {
|
|
2323
|
+
const r = rangeIn(this.area);
|
|
2324
|
+
if (!r || r.collapsed)
|
|
2325
|
+
return;
|
|
2326
|
+
// The browser wraps the selection in <font>; each one becomes a span with our class or style.
|
|
2327
|
+
this.doc.execCommand('styleWithCSS', false, 'false');
|
|
2328
|
+
this.doc.execCommand(kind === 'fontSize' ? 'fontSize' : 'fontName', false, kind === 'fontSize' ? '7' : 'wu-marker');
|
|
2329
|
+
const fonts = Array.from(this.area.querySelectorAll(kind === 'fontSize' ? 'font[size="7"]' : 'font[face="wu-marker"]'));
|
|
2330
|
+
for (const f of fonts) {
|
|
2331
|
+
// Inner spans carrying the same property give way to the new value.
|
|
2332
|
+
f.querySelectorAll('span').forEach((s) => {
|
|
2333
|
+
if (kind === 'fontSize') {
|
|
2334
|
+
setPrefixedClass(s, 'ql-size-', null);
|
|
2335
|
+
s.style.removeProperty('font-size');
|
|
2336
|
+
}
|
|
2337
|
+
else {
|
|
2338
|
+
setPrefixedClass(s, 'ql-font-', null);
|
|
2339
|
+
s.style.removeProperty('font-family');
|
|
2340
|
+
}
|
|
2341
|
+
if (!s.attributes.length)
|
|
2342
|
+
s.replaceWith(...Array.from(s.childNodes));
|
|
2343
|
+
});
|
|
2344
|
+
if (!value) {
|
|
2345
|
+
f.replaceWith(...Array.from(f.childNodes));
|
|
2346
|
+
continue;
|
|
2347
|
+
}
|
|
2348
|
+
const span = this.doc.createElement('span');
|
|
2349
|
+
if (kind === 'fontSize') {
|
|
2350
|
+
if (QUILL_SIZES[value])
|
|
2351
|
+
span.className = `ql-size-${QUILL_SIZES[value]}`;
|
|
2352
|
+
else
|
|
2353
|
+
span.style.fontSize = value;
|
|
2354
|
+
}
|
|
2355
|
+
else if (value === 'serif' || value === 'monospace')
|
|
2356
|
+
span.className = `ql-font-${value}`;
|
|
2357
|
+
else
|
|
2358
|
+
span.style.fontFamily = value;
|
|
2359
|
+
while (f.firstChild)
|
|
2360
|
+
span.appendChild(f.firstChild);
|
|
2361
|
+
f.replaceWith(span);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
removeInlineStyle(prop) {
|
|
2365
|
+
const r = rangeIn(this.area);
|
|
2366
|
+
if (!r)
|
|
2367
|
+
return;
|
|
2368
|
+
const spans = new Set();
|
|
2369
|
+
const start = closestIn(r.startContainer, this.area, 'span');
|
|
2370
|
+
if (start)
|
|
2371
|
+
spans.add(start);
|
|
2372
|
+
this.area.querySelectorAll('span[style], font').forEach((s) => {
|
|
2373
|
+
if (r.intersectsNode(s))
|
|
2374
|
+
spans.add(s);
|
|
2375
|
+
});
|
|
2376
|
+
for (const s of spans) {
|
|
2377
|
+
if (s.tagName === 'FONT') {
|
|
2378
|
+
s.removeAttribute('color');
|
|
2379
|
+
continue;
|
|
2380
|
+
}
|
|
2381
|
+
s.style.removeProperty(prop);
|
|
2382
|
+
if (!s.getAttribute('style'))
|
|
2383
|
+
s.removeAttribute('style');
|
|
2384
|
+
if (!s.attributes.length)
|
|
2385
|
+
s.replaceWith(...Array.from(s.childNodes));
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
clearFormatting() {
|
|
2389
|
+
const r = rangeIn(this.area);
|
|
2390
|
+
if (!r)
|
|
2391
|
+
return;
|
|
2392
|
+
this.doc.execCommand('removeFormat', false);
|
|
2393
|
+
this.doc.execCommand('unlink', false);
|
|
2394
|
+
const r2 = rangeIn(this.area) || r;
|
|
2395
|
+
this.area.querySelectorAll('code, span').forEach((el) => {
|
|
2396
|
+
if (r2.intersectsNode(el) && !closestIn(el, this.area, 'pre'))
|
|
2397
|
+
el.replaceWith(...Array.from(el.childNodes));
|
|
2398
|
+
});
|
|
2399
|
+
for (const b of blocksIn(this.area, r2)) {
|
|
2400
|
+
setPrefixedClass(b, 'ql-align-', null);
|
|
2401
|
+
setPrefixedClass(b, 'ql-indent-', null);
|
|
2402
|
+
b.removeAttribute('style');
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
setLinkTarget(a, newTab) {
|
|
2406
|
+
if (newTab) {
|
|
2407
|
+
a.setAttribute('target', '_blank');
|
|
2408
|
+
a.setAttribute('rel', 'noopener noreferrer');
|
|
2409
|
+
}
|
|
2410
|
+
else {
|
|
2411
|
+
a.removeAttribute('target');
|
|
2412
|
+
a.removeAttribute('rel');
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
insertHtml(html) {
|
|
2416
|
+
this.exec(() => this.doc.execCommand('insertHTML', false, html), true);
|
|
2417
|
+
}
|
|
2418
|
+
toggleSource() {
|
|
2419
|
+
if (!this.sourceMode) {
|
|
2420
|
+
this.closePanel(false);
|
|
2421
|
+
this.selectImage(null);
|
|
2422
|
+
this.sourceText = this.prettyHtml(this.html());
|
|
2423
|
+
this.sourceMode = true;
|
|
2424
|
+
}
|
|
2425
|
+
else {
|
|
2426
|
+
this.sourceMode = false;
|
|
2427
|
+
this.cdr.detectChanges();
|
|
2428
|
+
this.area.innerHTML = this.toEditable(cleanEditorHtml(this.sourceText, this.doc, this.cleanOpts));
|
|
2429
|
+
this.pushHistory(false);
|
|
2430
|
+
this.emit('user');
|
|
2431
|
+
}
|
|
2432
|
+
this.cdr.markForCheck();
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Full screen in the top layer, so no parent with a transform, filter or container query can trap it, and it stays
|
|
2436
|
+
* above dialogs. Browsers without popovers get a fixed overlay.
|
|
2437
|
+
*/
|
|
2438
|
+
toggleFullscreen() {
|
|
2439
|
+
var _a, _b;
|
|
2440
|
+
this.fullscreen = !this.fullscreen;
|
|
2441
|
+
const root = this.host.querySelector('.wu-editor');
|
|
2442
|
+
if (this.fullscreen) {
|
|
2443
|
+
this.unlockScroll = ɵlockScroll(this.doc);
|
|
2444
|
+
if (root && typeof root.showPopover === 'function') {
|
|
2445
|
+
root.setAttribute('popover', 'manual');
|
|
2446
|
+
try {
|
|
2447
|
+
root.showPopover();
|
|
2448
|
+
}
|
|
2449
|
+
catch (_c) {
|
|
2450
|
+
root.removeAttribute('popover');
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
else {
|
|
2455
|
+
(_a = this.unlockScroll) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2456
|
+
this.unlockScroll = null;
|
|
2457
|
+
if (root === null || root === void 0 ? void 0 : root.hasAttribute('popover')) {
|
|
2458
|
+
try {
|
|
2459
|
+
(_b = root.hidePopover) === null || _b === void 0 ? void 0 : _b.call(root);
|
|
2460
|
+
}
|
|
2461
|
+
catch (_d) {
|
|
2462
|
+
/* not shown */
|
|
2463
|
+
}
|
|
2464
|
+
root.removeAttribute('popover');
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
this.cdr.markForCheck();
|
|
2468
|
+
setTimeout(() => {
|
|
2469
|
+
this.placeFrame();
|
|
2470
|
+
if (this.fullscreen)
|
|
2471
|
+
this.restore();
|
|
2472
|
+
});
|
|
2473
|
+
}
|
|
2474
|
+
// ---------- internals: state ----------
|
|
2475
|
+
selectionChanged() {
|
|
2476
|
+
const r = rangeIn(this.area);
|
|
2477
|
+
if (r)
|
|
2478
|
+
this.savedRange = r.cloneRange();
|
|
2479
|
+
const win = this.doc.defaultView;
|
|
2480
|
+
if (!win || this.stateFrame)
|
|
2481
|
+
return;
|
|
2482
|
+
this.stateFrame = win.requestAnimationFrame(() => {
|
|
2483
|
+
this.stateFrame = 0;
|
|
2484
|
+
if (!rangeIn(this.area)) {
|
|
2485
|
+
if (this.lastSelection && this.doc.activeElement !== this.area) {
|
|
2486
|
+
const old = this.lastSelection;
|
|
2487
|
+
this.lastSelection = null;
|
|
2488
|
+
this.zone.run(() => this.onSelectionChange.emit({ range: null, oldRange: old, source: 'user' }));
|
|
2489
|
+
}
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
this.zone.run(() => {
|
|
2493
|
+
if (this.panel === 'tableBar' && this.panelAnchor) {
|
|
2494
|
+
const r2 = rangeIn(this.area);
|
|
2495
|
+
if (r2 && !this.panelAnchor.contains(r2.startContainer))
|
|
2496
|
+
this.closePanel(false);
|
|
2497
|
+
}
|
|
2498
|
+
this.updateState();
|
|
2499
|
+
this.reportSelection();
|
|
2500
|
+
});
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
reportSelection() {
|
|
2504
|
+
if (!this.onSelectionChange.observed)
|
|
2505
|
+
return;
|
|
2506
|
+
const r = rangeIn(this.area);
|
|
2507
|
+
if (!r)
|
|
2508
|
+
return;
|
|
2509
|
+
const pre = this.doc.createRange();
|
|
2510
|
+
pre.selectNodeContents(this.area);
|
|
2511
|
+
pre.setEnd(r.startContainer, r.startOffset);
|
|
2512
|
+
const range = { index: pre.toString().length, length: r.toString().length };
|
|
2513
|
+
const old = this.lastSelection;
|
|
2514
|
+
if (old && old.index === range.index && old.length === range.length)
|
|
2515
|
+
return;
|
|
2516
|
+
this.lastSelection = range;
|
|
2517
|
+
this.onSelectionChange.emit({ range, oldRange: old, source: 'user' });
|
|
2518
|
+
}
|
|
2519
|
+
updateState() {
|
|
2520
|
+
const r = rangeIn(this.area);
|
|
2521
|
+
if (!r)
|
|
2522
|
+
return;
|
|
2523
|
+
const q = (cmd) => {
|
|
2524
|
+
try {
|
|
2525
|
+
return this.doc.queryCommandState(cmd);
|
|
2526
|
+
}
|
|
2527
|
+
catch (_a) {
|
|
2528
|
+
return false;
|
|
2529
|
+
}
|
|
2530
|
+
};
|
|
2531
|
+
const node = r.startContainer;
|
|
2532
|
+
const block = blockOf(node, this.area);
|
|
2533
|
+
const headingEl = closestIn(node, this.area, 'h1, h2, h3, h4, h5, h6');
|
|
2534
|
+
const sizeSpan = closestIn(node, this.area, '[class*="ql-size-"], span[style*="font-size"]');
|
|
2535
|
+
const fontSpan = closestIn(node, this.area, '[class*="ql-font-"], span[style*="font-family"]');
|
|
2536
|
+
const size = prefixedClass(sizeSpan, 'ql-size-');
|
|
2537
|
+
const font = prefixedClass(fontSpan, 'ql-font-');
|
|
2538
|
+
this.state = {
|
|
2539
|
+
bold: q('bold'),
|
|
2540
|
+
italic: q('italic'),
|
|
2541
|
+
underline: q('underline'),
|
|
2542
|
+
strike: q('strikeThrough'),
|
|
2543
|
+
subscript: q('subscript'),
|
|
2544
|
+
superscript: q('superscript'),
|
|
2545
|
+
code: !!closestIn(node, this.area, 'code') && !closestIn(node, this.area, 'pre'),
|
|
2546
|
+
bulletList: !!closestIn(node, this.area, 'ul'),
|
|
2547
|
+
orderedList: !!closestIn(node, this.area, 'ol') && !closestIn(node, this.area, 'ul'),
|
|
2548
|
+
blockquote: !!closestIn(node, this.area, 'blockquote'),
|
|
2549
|
+
codeBlock: !!closestIn(node, this.area, 'pre'),
|
|
2550
|
+
link: !!closestIn(node, this.area, 'a'),
|
|
2551
|
+
table: !!closestIn(node, this.area, 'td, th'),
|
|
2552
|
+
heading: headingEl ? Number(headingEl.tagName.slice(1)) : 0,
|
|
2553
|
+
align: ((block && (prefixedClass(block, 'ql-align-') || block.style.textAlign)) || 'left'),
|
|
2554
|
+
fontSize: size ? Object.keys(QUILL_SIZES).find((k) => QUILL_SIZES[k] === size) || '' : (sizeSpan === null || sizeSpan === void 0 ? void 0 : sizeSpan.style.fontSize) || '',
|
|
2555
|
+
fontFamily: font || (fontSpan === null || fontSpan === void 0 ? void 0 : fontSpan.style.fontFamily) || '',
|
|
2556
|
+
};
|
|
2557
|
+
this.syncQuillToolbar();
|
|
2558
|
+
this.cdr.markForCheck();
|
|
2559
|
+
}
|
|
2560
|
+
refreshMeta() {
|
|
2561
|
+
const html = this.area.innerHTML;
|
|
2562
|
+
this.empty = isEmptyEditorHtml(html);
|
|
2563
|
+
this.canUndo = this.history.canUndo;
|
|
2564
|
+
this.canRedo = this.history.canRedo;
|
|
2565
|
+
if (this._showCount)
|
|
2566
|
+
this.counts = editorCounts(editorHtmlToText(html));
|
|
2567
|
+
}
|
|
2568
|
+
pushHistory(merge) {
|
|
2569
|
+
this.history.push({ html: this.area.innerHTML, selection: saveSelection(this.area) }, { merge });
|
|
2570
|
+
this.refreshMeta();
|
|
2571
|
+
}
|
|
2572
|
+
emit(source) {
|
|
2573
|
+
const html = this.html();
|
|
2574
|
+
const value = isEmptyEditorHtml(html) ? null : html;
|
|
2575
|
+
this.refreshMeta();
|
|
2576
|
+
if (value === this.lastEmitted) {
|
|
2577
|
+
this.cdr.markForCheck();
|
|
2578
|
+
return;
|
|
2579
|
+
}
|
|
2580
|
+
this.lastEmitted = value;
|
|
2581
|
+
this.value = value;
|
|
2582
|
+
this.onChange(value);
|
|
2583
|
+
this.onTextChange.emit({ htmlValue: value, textValue: editorHtmlToText(value), delta: null, source });
|
|
2584
|
+
this.cdr.markForCheck();
|
|
2585
|
+
}
|
|
2586
|
+
/** The value: the content cleaned, without the editor's own marks (pictures still uploading are left out). */
|
|
2587
|
+
html() {
|
|
2588
|
+
if (!this.viewReady)
|
|
2589
|
+
return this.value || '';
|
|
2590
|
+
if (this.sourceMode)
|
|
2591
|
+
return cleanEditorHtml(this.sourceText, this.doc, this.cleanOpts);
|
|
2592
|
+
const copy = this.area.cloneNode(true);
|
|
2593
|
+
copy.querySelectorAll('img.wu-image-uploading').forEach((i) => i.remove());
|
|
2594
|
+
copy.querySelectorAll('.wu-image-selected').forEach((i) => i.classList.remove('wu-image-selected'));
|
|
2595
|
+
const html = cleanEditorHtml(copy.innerHTML, this.doc, this.cleanOpts);
|
|
2596
|
+
return html === '<p><br></p>' ? '' : html;
|
|
2597
|
+
}
|
|
2598
|
+
toEditable(html) {
|
|
2599
|
+
const clean = cleanEditorHtml(html || '', this.doc, this.cleanOpts);
|
|
2600
|
+
return clean.trim() ? clean : '<p><br></p>';
|
|
2601
|
+
}
|
|
2602
|
+
setContent(html, emit) {
|
|
2603
|
+
if (!this.viewReady) {
|
|
2604
|
+
this.value = html;
|
|
2605
|
+
return;
|
|
2606
|
+
}
|
|
2607
|
+
this.area.innerHTML = this.toEditable(html);
|
|
2608
|
+
this.pushHistory(false);
|
|
2609
|
+
if (emit)
|
|
2610
|
+
this.emit('api');
|
|
2611
|
+
}
|
|
2612
|
+
/** `<b>` from the browser becomes `<strong>`, `<font>` from colours a span, and so on. */
|
|
2613
|
+
normalizeMarkup() {
|
|
2614
|
+
const area = this.area;
|
|
2615
|
+
const rename = (from, to) => area.querySelectorAll(from).forEach((el) => {
|
|
2616
|
+
const n = this.doc.createElement(to);
|
|
2617
|
+
for (const a of Array.from(el.attributes))
|
|
2618
|
+
n.setAttribute(a.name, a.value);
|
|
2619
|
+
while (el.firstChild)
|
|
2620
|
+
n.appendChild(el.firstChild);
|
|
2621
|
+
el.replaceWith(n);
|
|
2622
|
+
});
|
|
2623
|
+
const sel = saveSelection(area);
|
|
2624
|
+
let changed = false;
|
|
2625
|
+
const renameAll = (from, to) => {
|
|
2626
|
+
if (area.querySelector(from)) {
|
|
2627
|
+
changed = true;
|
|
2628
|
+
rename(from, to);
|
|
2629
|
+
}
|
|
2630
|
+
};
|
|
2631
|
+
renameAll('b', 'strong');
|
|
2632
|
+
renameAll('i', 'em');
|
|
2633
|
+
renameAll('strike', 's');
|
|
2634
|
+
area.querySelectorAll('font').forEach((f) => {
|
|
2635
|
+
changed = true;
|
|
2636
|
+
const span = this.doc.createElement('span');
|
|
2637
|
+
const color = f.getAttribute('color');
|
|
2638
|
+
if (color)
|
|
2639
|
+
span.style.color = color;
|
|
2640
|
+
const face = f.getAttribute('face');
|
|
2641
|
+
if (face && face !== 'wu-marker')
|
|
2642
|
+
span.style.fontFamily = face;
|
|
2643
|
+
while (f.firstChild)
|
|
2644
|
+
span.appendChild(f.firstChild);
|
|
2645
|
+
f.replaceWith(span);
|
|
2646
|
+
if (!span.attributes.length)
|
|
2647
|
+
span.replaceWith(...Array.from(span.childNodes));
|
|
2648
|
+
});
|
|
2649
|
+
// Chrome's formatBlock and Enter can leave <div>s at the top level.
|
|
2650
|
+
Array.from(area.children).forEach((el) => {
|
|
2651
|
+
if (el.tagName === 'DIV') {
|
|
2652
|
+
changed = true;
|
|
2653
|
+
const p = this.doc.createElement('p');
|
|
2654
|
+
for (const a of Array.from(el.attributes))
|
|
2655
|
+
p.setAttribute(a.name, a.value);
|
|
2656
|
+
while (el.firstChild)
|
|
2657
|
+
p.appendChild(el.firstChild);
|
|
2658
|
+
el.replaceWith(p);
|
|
2659
|
+
}
|
|
2660
|
+
});
|
|
2661
|
+
// Setting the selection again (when nothing moved) would drop a pending bold / italic at the caret.
|
|
2662
|
+
if (changed)
|
|
2663
|
+
restoreSelection(area, sel);
|
|
2664
|
+
}
|
|
2665
|
+
/** An empty editor holds one empty paragraph, so typing starts in a paragraph. */
|
|
2666
|
+
normalizeEmpty() {
|
|
2667
|
+
const area = this.area;
|
|
2668
|
+
if (!area.firstChild || (area.childNodes.length === 1 && area.firstChild.nodeName === 'BR')) {
|
|
2669
|
+
area.innerHTML = '<p><br></p>';
|
|
2670
|
+
caretIn(area.firstChild);
|
|
2671
|
+
}
|
|
2672
|
+
this.empty = isEmptyEditorHtml(area.innerHTML);
|
|
2673
|
+
}
|
|
2674
|
+
saveRange() {
|
|
2675
|
+
const r = rangeIn(this.area);
|
|
2676
|
+
if (r)
|
|
2677
|
+
this.savedRange = r.cloneRange();
|
|
2678
|
+
}
|
|
2679
|
+
/** Focus back in the content with the selection it had. */
|
|
2680
|
+
restore() {
|
|
2681
|
+
const area = this.area;
|
|
2682
|
+
// Still in the content (a toolbar press keeps focus there): use the selection as it is now. selectionchange fires
|
|
2683
|
+
// a task later, so the saved range may be one step behind (a shortcut right after Shift + arrow).
|
|
2684
|
+
const live = this.doc.activeElement === area ? rangeIn(area) : null;
|
|
2685
|
+
if (live) {
|
|
2686
|
+
this.savedRange = live.cloneRange();
|
|
2687
|
+
return;
|
|
2688
|
+
}
|
|
2689
|
+
if (this.doc.activeElement !== area)
|
|
2690
|
+
area.focus({ preventScroll: true });
|
|
2691
|
+
const r = this.savedRange;
|
|
2692
|
+
if (r && area.contains(r.startContainer) && area.contains(r.endContainer))
|
|
2693
|
+
selectRange(r);
|
|
2694
|
+
else if (!rangeIn(area))
|
|
2695
|
+
caretIn(area, true);
|
|
2696
|
+
}
|
|
2697
|
+
currentCell() {
|
|
2698
|
+
const r = rangeIn(this.area) || this.savedRange;
|
|
2699
|
+
return r ? closestIn(r.startContainer, this.area, 'td, th') : null;
|
|
2700
|
+
}
|
|
2701
|
+
syncEditable() {
|
|
2702
|
+
if (!this.viewReady)
|
|
2703
|
+
return;
|
|
2704
|
+
const editable = !this.locked;
|
|
2705
|
+
this.area.setAttribute('contenteditable', editable ? 'true' : 'false');
|
|
2706
|
+
if (!editable)
|
|
2707
|
+
this.selectImage(null);
|
|
2708
|
+
}
|
|
2709
|
+
selectImage(img) {
|
|
2710
|
+
var _a;
|
|
2711
|
+
if (this.selectedImage === img)
|
|
2712
|
+
return;
|
|
2713
|
+
(_a = this.selectedImage) === null || _a === void 0 ? void 0 : _a.classList.remove('wu-image-selected');
|
|
2714
|
+
this.selectedImage = img;
|
|
2715
|
+
img === null || img === void 0 ? void 0 : img.classList.add('wu-image-selected');
|
|
2716
|
+
this.placeFrame();
|
|
2717
|
+
}
|
|
2718
|
+
/** The resize frame follows the selected picture. */
|
|
2719
|
+
placeFrame() {
|
|
2720
|
+
var _a;
|
|
2721
|
+
const img = this.selectedImage;
|
|
2722
|
+
const frame = (_a = this.frameRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2723
|
+
if (!frame)
|
|
2724
|
+
return;
|
|
2725
|
+
if (!img || !img.isConnected) {
|
|
2726
|
+
frame.style.display = 'none';
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
const body = frame.parentElement.getBoundingClientRect();
|
|
2730
|
+
const r = img.getBoundingClientRect();
|
|
2731
|
+
frame.style.display = '';
|
|
2732
|
+
frame.style.top = `${r.top - body.top}px`;
|
|
2733
|
+
frame.style.left = `${r.left - body.left}px`;
|
|
2734
|
+
frame.style.width = `${r.width}px`;
|
|
2735
|
+
frame.style.height = `${r.height}px`;
|
|
2736
|
+
}
|
|
2737
|
+
toolbarItems() {
|
|
2738
|
+
var _a;
|
|
2739
|
+
const bar = (_a = this.toolbarRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2740
|
+
if (!bar)
|
|
2741
|
+
return [];
|
|
2742
|
+
return Array.from(bar.querySelectorAll('button, select')).filter((el) => !el.disabled && el.offsetParent !== null && !el.closest('.wu-editor-hidden'));
|
|
2743
|
+
}
|
|
2744
|
+
syncToolbarTabStops() {
|
|
2745
|
+
const items = this.toolbarItems();
|
|
2746
|
+
if (!items.length)
|
|
2747
|
+
return;
|
|
2748
|
+
const current = items.find((el) => el.getAttribute('tabindex') === '0') || items[0];
|
|
2749
|
+
items.forEach((el) => el.setAttribute('tabindex', el === current ? '0' : '-1'));
|
|
2750
|
+
}
|
|
2751
|
+
toolbarButton(tool) {
|
|
2752
|
+
var _a;
|
|
2753
|
+
return ((_a = this.toolbarRef) === null || _a === void 0 ? void 0 : _a.nativeElement.querySelector(`[data-wu-tool="${tool}"]`)) || null;
|
|
2754
|
+
}
|
|
2755
|
+
fail(file, reason, message, error) {
|
|
2756
|
+
this.onImageUploadError.emit({ file, reason, message, error });
|
|
2757
|
+
this.notices = [...this.notices, message];
|
|
2758
|
+
this.cdr.markForCheck();
|
|
2759
|
+
setTimeout(() => {
|
|
2760
|
+
this.notices = this.notices.filter((n) => n !== message);
|
|
2761
|
+
this.cdr.markForCheck();
|
|
2762
|
+
}, 6000);
|
|
2763
|
+
}
|
|
2764
|
+
get uploadConfig() {
|
|
2765
|
+
return Object.assign(Object.assign({}, (this.defaults.imageUpload || {})), (this.imageUpload || {}));
|
|
2766
|
+
}
|
|
2767
|
+
get uploadMode() {
|
|
2768
|
+
const c = this.uploadConfig;
|
|
2769
|
+
return c.mode || (c.url || c.upload ? 'upload' : 'base64');
|
|
2770
|
+
}
|
|
2771
|
+
get cleanOpts() {
|
|
2772
|
+
return { protocols: this.opts.link.protocols };
|
|
2773
|
+
}
|
|
2774
|
+
readAsDataUrl(file) {
|
|
2775
|
+
return new Promise((resolve, reject) => {
|
|
2776
|
+
const reader = new FileReader();
|
|
2777
|
+
reader.onload = () => resolve(String(reader.result || ''));
|
|
2778
|
+
reader.onerror = () => reject(reader.error);
|
|
2779
|
+
reader.readAsDataURL(file);
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
/** Sends a picture to the configured endpoint (or the app's own `upload`) and resolves with its URL. */
|
|
2783
|
+
upload(file) {
|
|
2784
|
+
const c = this.uploadConfig;
|
|
2785
|
+
if (c.upload)
|
|
2786
|
+
return c.upload(file);
|
|
2787
|
+
if (!c.url)
|
|
2788
|
+
return Promise.reject(new Error('imageUpload.url is not set'));
|
|
2789
|
+
return new Promise((resolve, reject) => {
|
|
2790
|
+
const xhr = new XMLHttpRequest();
|
|
2791
|
+
const form = new FormData();
|
|
2792
|
+
form.append(c.fieldName || 'file', file, file.name);
|
|
2793
|
+
xhr.open(c.method || 'POST', c.url, true);
|
|
2794
|
+
for (const [k, v] of headerEntries(c.headers))
|
|
2795
|
+
xhr.setRequestHeader(k, v);
|
|
2796
|
+
xhr.withCredentials = !!c.withCredentials;
|
|
2797
|
+
xhr.onload = () => {
|
|
2798
|
+
if (xhr.status < 200 || xhr.status >= 300)
|
|
2799
|
+
return reject(new Error(`HTTP ${xhr.status}`));
|
|
2800
|
+
let body = xhr.responseText;
|
|
2801
|
+
try {
|
|
2802
|
+
body = JSON.parse(xhr.responseText);
|
|
2803
|
+
}
|
|
2804
|
+
catch (_a) {
|
|
2805
|
+
/* a plain-text URL */
|
|
2806
|
+
}
|
|
2807
|
+
let url;
|
|
2808
|
+
if (typeof c.responseUrl === 'function')
|
|
2809
|
+
url = c.responseUrl(body);
|
|
2810
|
+
else if (c.responseUrl)
|
|
2811
|
+
url = pathValue(body, c.responseUrl);
|
|
2812
|
+
else if (typeof body === 'string')
|
|
2813
|
+
url = body.trim();
|
|
2814
|
+
else
|
|
2815
|
+
for (const p of ['url', 'data.url', 'location', 'path', 'data.path', 'file.url'])
|
|
2816
|
+
if (!url)
|
|
2817
|
+
url = pathValue(body, p);
|
|
2818
|
+
if (typeof url !== 'string' || !url)
|
|
2819
|
+
return reject(new Error('No image URL in the response'));
|
|
2820
|
+
const full = c.baseUrl && !/^[a-z][a-z0-9+.-]*:|^\/\//i.test(url) ? c.baseUrl.replace(/\/$/, '') + '/' + url.replace(/^\//, '') : url;
|
|
2821
|
+
resolve(full);
|
|
2822
|
+
};
|
|
2823
|
+
xhr.onerror = () => reject(new Error('Network error'));
|
|
2824
|
+
xhr.send(form);
|
|
2825
|
+
});
|
|
2826
|
+
}
|
|
2827
|
+
prettyHtml(html) {
|
|
2828
|
+
return html.replace(/(<\/(p|h[1-6]|li|ul|ol|blockquote|pre|table|thead|tbody|tr)>)/g, '$1\n').replace(/(<(ul|ol|table|thead|tbody|tr)>)/g, '$1\n').trim();
|
|
2829
|
+
}
|
|
2830
|
+
// ---------- the app's own header template (Quill toolbar markup) ----------
|
|
2831
|
+
/** Gives `ql-*` buttons and selects of a `header` template their icons, labels and actions. */
|
|
2832
|
+
wireQuillToolbar() {
|
|
2833
|
+
var _a;
|
|
2834
|
+
const bar = (_a = this.toolbarRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2835
|
+
if (!bar)
|
|
2836
|
+
return;
|
|
2837
|
+
const wire = () => {
|
|
2838
|
+
bar.querySelectorAll('button[class*="ql-"], select[class*="ql-"]').forEach((el) => {
|
|
2839
|
+
if (el.dataset['wuWired'])
|
|
2840
|
+
return;
|
|
2841
|
+
el.dataset['wuWired'] = '1';
|
|
2842
|
+
const info = ɵquillTool(el);
|
|
2843
|
+
if (!info) {
|
|
2844
|
+
el.classList.add('wu-editor-hidden');
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
if (el.tagName === 'SELECT') {
|
|
2848
|
+
// A Quill select becomes one of our dropdown buttons; the select stays hidden.
|
|
2849
|
+
el.classList.add('wu-editor-hidden');
|
|
2850
|
+
const btn = this.doc.createElement('button');
|
|
2851
|
+
btn.type = 'button';
|
|
2852
|
+
btn.className = 'wu-editor-tool wu-editor-tool-quill' + (info.dropdown ? ' wu-editor-dropdown' : '');
|
|
2853
|
+
btn.setAttribute('aria-haspopup', 'true');
|
|
2854
|
+
btn.setAttribute('aria-label', this.toolLabel(info.tool));
|
|
2855
|
+
btn.title = this.toolLabel(info.tool);
|
|
2856
|
+
btn.dataset['wuTool'] = info.tool;
|
|
2857
|
+
btn.innerHTML = info.dropdown
|
|
2858
|
+
? `<span class="wu-editor-dropdown-label"></span>${this.icons['chevron']}`
|
|
2859
|
+
: this.icons[this.toolIcon(info.tool)] || '';
|
|
2860
|
+
if (info.tool === 'align')
|
|
2861
|
+
btn.dataset['wuAlignIcon'] = this.toolIcon('align');
|
|
2862
|
+
el.insertAdjacentElement('afterend', btn);
|
|
2863
|
+
const values = Array.from(el.options).map((o) => o.value);
|
|
2864
|
+
btn.addEventListener('mousedown', (e) => e.preventDefault());
|
|
2865
|
+
btn.addEventListener('click', () => this.zone.run(() => {
|
|
2866
|
+
// The header's select lists the blocks it offers (quotes and code have their own ql-* buttons).
|
|
2867
|
+
if (info.tool === 'heading')
|
|
2868
|
+
this.opts = Object.assign(Object.assign({}, this.opts), { headings: values.map((v) => Number(v) || 0), blocks: [] });
|
|
2869
|
+
if ((info.tool === 'color' || info.tool === 'highlight') && values.some(Boolean)) {
|
|
2870
|
+
const palette = values.filter(Boolean);
|
|
2871
|
+
this.opts = info.tool === 'color' ? Object.assign(Object.assign({}, this.opts), { colors: palette }) : Object.assign(Object.assign({}, this.opts), { highlights: palette });
|
|
2872
|
+
}
|
|
2873
|
+
if (info.tool === 'align')
|
|
2874
|
+
this.opts = Object.assign(Object.assign({}, this.opts), { alignments: values.map((v) => (v || 'left')) });
|
|
2875
|
+
this.runTool(info.tool, { currentTarget: btn });
|
|
2876
|
+
}));
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
const b = el;
|
|
2880
|
+
b.type = 'button';
|
|
2881
|
+
b.classList.add('wu-editor-tool');
|
|
2882
|
+
b.dataset['wuTool'] = info.tool;
|
|
2883
|
+
if (!b.getAttribute('aria-label'))
|
|
2884
|
+
b.setAttribute('aria-label', this.toolLabel(info.tool));
|
|
2885
|
+
if (!b.title)
|
|
2886
|
+
b.title = this.toolLabel(info.tool);
|
|
2887
|
+
if (info.heading) {
|
|
2888
|
+
b.dataset['wuHeading'] = String(info.heading);
|
|
2889
|
+
if (!b.innerHTML.trim())
|
|
2890
|
+
b.innerHTML = `<span class="wu-editor-heading-mark">H${info.heading}</span>`;
|
|
2891
|
+
b.setAttribute('aria-label', this.headingLabel(info.heading));
|
|
2892
|
+
}
|
|
2893
|
+
if (!b.innerHTML.trim())
|
|
2894
|
+
b.innerHTML = this.icons[info.tool] || '';
|
|
2895
|
+
b.addEventListener('mousedown', (e) => e.preventDefault());
|
|
2896
|
+
b.addEventListener('click', () => this.zone.run(() => {
|
|
2897
|
+
if (info.heading)
|
|
2898
|
+
this.pickHeading(this.state.heading === info.heading ? 0 : info.heading);
|
|
2899
|
+
else
|
|
2900
|
+
this.runTool(info.tool, { currentTarget: b });
|
|
2901
|
+
}));
|
|
2902
|
+
});
|
|
2903
|
+
this.syncQuillToolbar();
|
|
2904
|
+
this.syncToolbarTabStops();
|
|
2905
|
+
};
|
|
2906
|
+
wire();
|
|
2907
|
+
// Templates with *ngIf inside re-render: wire new buttons as they appear.
|
|
2908
|
+
const win = this.doc.defaultView;
|
|
2909
|
+
if (win === null || win === void 0 ? void 0 : win.MutationObserver) {
|
|
2910
|
+
// Only new, unwired controls matter; our own label updates must not set it off again.
|
|
2911
|
+
this.quillObserver = new win.MutationObserver(() => {
|
|
2912
|
+
if (bar.querySelector('button[class*="ql-"]:not([data-wu-wired]), select[class*="ql-"]:not([data-wu-wired])'))
|
|
2913
|
+
wire();
|
|
2914
|
+
});
|
|
2915
|
+
this.quillObserver.observe(bar, { childList: true, subtree: true });
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
syncQuillToolbar() {
|
|
2919
|
+
var _a;
|
|
2920
|
+
const bar = (_a = this.toolbarRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
2921
|
+
if (!bar || !this.headerTemplate)
|
|
2922
|
+
return;
|
|
2923
|
+
bar.querySelectorAll('[data-wu-tool]').forEach((el) => {
|
|
2924
|
+
const tool = el.dataset['wuTool'];
|
|
2925
|
+
const level = Number(el.dataset['wuHeading'] || 0);
|
|
2926
|
+
const on = level ? this.state.heading === level : this.isOn(tool);
|
|
2927
|
+
el.classList.toggle('ql-active', on);
|
|
2928
|
+
el.classList.toggle('wu-editor-tool-on', on);
|
|
2929
|
+
if (el.tagName === 'BUTTON' && (level || !this.hasMenu(tool)))
|
|
2930
|
+
el.setAttribute('aria-pressed', String(on));
|
|
2931
|
+
const off = this.isDisabled(tool);
|
|
2932
|
+
if (el.disabled !== off)
|
|
2933
|
+
el.disabled = off;
|
|
2934
|
+
// The align button shows the current alignment.
|
|
2935
|
+
const alignIcon = el.dataset['wuAlignIcon'];
|
|
2936
|
+
if (alignIcon && alignIcon !== this.toolIcon('align')) {
|
|
2937
|
+
el.dataset['wuAlignIcon'] = this.toolIcon('align');
|
|
2938
|
+
el.innerHTML = this.icons[this.toolIcon('align')] || '';
|
|
2939
|
+
}
|
|
2940
|
+
const label = el.querySelector('.wu-editor-dropdown-label');
|
|
2941
|
+
const text = this.dropdownLabel(tool);
|
|
2942
|
+
if (label && label.textContent !== text)
|
|
2943
|
+
label.textContent = text;
|
|
2944
|
+
});
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
ɵWuEditorBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2948
|
+
ɵWuEditorBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ɵWuEditorBase, inputs: { toolbar: "toolbar", toolOptions: "toolOptions", imageUpload: "imageUpload", placeholder: "placeholder", readonly: "readonly", style: "style", styleClass: "styleClass", showCount: "showCount", stickyToolbar: "stickyToolbar", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", id: "id", formats: "formats", modules: "modules", bounds: "bounds", scrollingContainer: "scrollingContainer", debug: "debug" }, outputs: { onTextChange: "onTextChange", onSelectionChange: "onSelectionChange", onInit: "onInit", onFocus: "onFocus", onBlur: "onBlur", onImageUpload: "onImageUpload", onImageUploadError: "onImageUploadError" }, queries: [{ propertyName: "headerRef", first: true, predicate: ["header"] }, { propertyName: "templates", predicate: WuTemplate }], viewQueries: [{ propertyName: "areaRef", first: true, predicate: ["area"], descendants: true }, { propertyName: "toolbarRef", first: true, predicate: ["toolbarEl"], descendants: true }, { propertyName: "panelRef", first: true, predicate: ["panelEl"], descendants: true }, { propertyName: "imageInputRef", first: true, predicate: ["imageInput"], descendants: true }, { propertyName: "frameRef", first: true, predicate: ["frameEl"], descendants: true }], ngImport: i0 });
|
|
2949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorBase, decorators: [{
|
|
2950
|
+
type: Directive
|
|
2951
|
+
}], ctorParameters: function () { return []; }, propDecorators: { toolbar: [{
|
|
2952
|
+
type: Input
|
|
2953
|
+
}], toolOptions: [{
|
|
2954
|
+
type: Input
|
|
2955
|
+
}], imageUpload: [{
|
|
2956
|
+
type: Input
|
|
2957
|
+
}], placeholder: [{
|
|
2958
|
+
type: Input
|
|
2959
|
+
}], readonly: [{
|
|
2960
|
+
type: Input
|
|
2961
|
+
}], style: [{
|
|
2962
|
+
type: Input
|
|
2963
|
+
}], styleClass: [{
|
|
2964
|
+
type: Input
|
|
2965
|
+
}], showCount: [{
|
|
2966
|
+
type: Input
|
|
2967
|
+
}], stickyToolbar: [{
|
|
2968
|
+
type: Input
|
|
2969
|
+
}], ariaLabel: [{
|
|
2970
|
+
type: Input
|
|
2971
|
+
}], ariaLabelledBy: [{
|
|
2972
|
+
type: Input
|
|
2973
|
+
}], id: [{
|
|
2974
|
+
type: Input
|
|
2975
|
+
}], formats: [{
|
|
2976
|
+
type: Input
|
|
2977
|
+
}], modules: [{
|
|
2978
|
+
type: Input
|
|
2979
|
+
}], bounds: [{
|
|
2980
|
+
type: Input
|
|
2981
|
+
}], scrollingContainer: [{
|
|
2982
|
+
type: Input
|
|
2983
|
+
}], debug: [{
|
|
2984
|
+
type: Input
|
|
2985
|
+
}], onTextChange: [{
|
|
2986
|
+
type: Output
|
|
2987
|
+
}], onSelectionChange: [{
|
|
2988
|
+
type: Output
|
|
2989
|
+
}], onInit: [{
|
|
2990
|
+
type: Output
|
|
2991
|
+
}], onFocus: [{
|
|
2992
|
+
type: Output
|
|
2993
|
+
}], onBlur: [{
|
|
2994
|
+
type: Output
|
|
2995
|
+
}], onImageUpload: [{
|
|
2996
|
+
type: Output
|
|
2997
|
+
}], onImageUploadError: [{
|
|
2998
|
+
type: Output
|
|
2999
|
+
}], templates: [{
|
|
3000
|
+
type: ContentChildren,
|
|
3001
|
+
args: [WuTemplate]
|
|
3002
|
+
}], headerRef: [{
|
|
3003
|
+
type: ContentChild,
|
|
3004
|
+
args: ['header', { descendants: false }]
|
|
3005
|
+
}], areaRef: [{
|
|
3006
|
+
type: ViewChild,
|
|
3007
|
+
args: ['area']
|
|
3008
|
+
}], toolbarRef: [{
|
|
3009
|
+
type: ViewChild,
|
|
3010
|
+
args: ['toolbarEl']
|
|
3011
|
+
}], panelRef: [{
|
|
3012
|
+
type: ViewChild,
|
|
3013
|
+
args: ['panelEl']
|
|
3014
|
+
}], imageInputRef: [{
|
|
3015
|
+
type: ViewChild,
|
|
3016
|
+
args: ['imageInput']
|
|
3017
|
+
}], frameRef: [{
|
|
3018
|
+
type: ViewChild,
|
|
3019
|
+
args: ['frameEl']
|
|
3020
|
+
}] } });
|
|
3021
|
+
|
|
3022
|
+
/** Draws one of the editor's built-in SVG icons: `<span wuEditorIcon="bold"></span>`. */
|
|
3023
|
+
class ɵWuEditorIcon {
|
|
3024
|
+
constructor() {
|
|
3025
|
+
this.el = inject(ElementRef).nativeElement;
|
|
3026
|
+
}
|
|
3027
|
+
set wuEditorIcon(name) {
|
|
3028
|
+
this.el.innerHTML = (name && ɵWU_EDITOR_ICONS[name]) || '';
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
ɵWuEditorIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3032
|
+
ɵWuEditorIcon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ɵWuEditorIcon, isStandalone: true, selector: "[wuEditorIcon]", inputs: { wuEditorIcon: "wuEditorIcon" }, ngImport: i0 });
|
|
3033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorIcon, decorators: [{
|
|
3034
|
+
type: Directive,
|
|
3035
|
+
args: [{
|
|
3036
|
+
selector: '[wuEditorIcon]',
|
|
3037
|
+
standalone: true,
|
|
3038
|
+
}]
|
|
3039
|
+
}], propDecorators: { wuEditorIcon: [{
|
|
3040
|
+
type: Input
|
|
3041
|
+
}] } });
|
|
3042
|
+
|
|
3043
|
+
/**
|
|
3044
|
+
* Rich-text editor: `<wu-editor [(ngModel)]="news.body" [style]="{ height: '320px' }" toolbar="full"
|
|
3045
|
+
* [imageUpload]="{ url: '/api/upload' }">`. The value is HTML (null when empty). The app's own `header` template
|
|
3046
|
+
* with the familiar `ql-*` buttons still works.
|
|
3047
|
+
*/
|
|
3048
|
+
class WuEditor extends ɵWuEditorBase {
|
|
3049
|
+
}
|
|
3050
|
+
WuEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditor, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3051
|
+
WuEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WuEditor, isStandalone: true, selector: "wu-editor", host: { classAttribute: "wu-editor-host" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WuEditor), multi: true }], exportAs: ["wuEditor"], usesInheritance: true, ngImport: i0, template: "<div\n class=\"wu-editor p-editor p-editor-container p-component\"\n [class.wu-editor-focused]=\"focused\"\n [class.wu-editor-disabled]=\"disabled\"\n [class.p-disabled]=\"disabled\"\n [class.wu-editor-readonly]=\"readonly\"\n [class.wu-editor-fullscreen]=\"fullscreen\"\n [class.wu-editor-sticky]=\"stickyToolbar\"\n [class.wu-editor-source-mode]=\"sourceMode\"\n [ngClass]=\"styleClass || ''\"\n>\n <div\n *ngIf=\"headerTemplate || groups.length\"\n #toolbarEl\n class=\"wu-editor-toolbar p-editor-toolbar\"\n role=\"toolbar\"\n [attr.aria-label]=\"m.toolbar\"\n [attr.aria-controls]=\"areaId\"\n (mousedown)=\"toolbarMouseDown($event)\"\n (keydown)=\"toolbarKeydown($event)\"\n >\n <ng-container *ngIf=\"headerTemplate; else ownTools\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #ownTools>\n <span *ngFor=\"let group of groups\" class=\"wu-editor-group\" role=\"group\">\n <button\n *ngFor=\"let t of group\"\n type=\"button\"\n class=\"wu-editor-tool\"\n tabindex=\"-1\"\n [class.wu-editor-dropdown]=\"isDropdown(t)\"\n [class.wu-editor-tool-on]=\"isOn(t)\"\n [class.wu-editor-tool-open]=\"panelOpenFor(t)\"\n [attr.data-wu-tool]=\"t\"\n [disabled]=\"isDisabled(t)\"\n [attr.aria-pressed]=\"hasMenu(t) ? null : isOn(t)\"\n [attr.aria-haspopup]=\"hasMenu(t) ? 'true' : null\"\n [attr.aria-expanded]=\"hasMenu(t) ? panelOpenFor(t) : null\"\n [attr.aria-label]=\"toolLabel(t)\"\n [attr.title]=\"toolLabel(t)\"\n (click)=\"runTool(t, $event)\"\n >\n <ng-container *ngIf=\"isDropdown(t); else iconTool\">\n <span class=\"wu-editor-dropdown-label\">{{ dropdownLabel(t) }}</span>\n <span class=\"wu-editor-chevron-wrap\" wuEditorIcon=\"chevron\"></span>\n </ng-container>\n <ng-template #iconTool><span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"toolIcon(t)\"></span></ng-template>\n </button>\n </span>\n </ng-template>\n </div>\n\n <div class=\"wu-editor-body\">\n <div\n #area\n class=\"wu-editor-area wu-editor-content p-editor-content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n spellcheck=\"true\"\n [id]=\"areaId\"\n [class.wu-editor-hidden]=\"sourceMode\"\n [class.wu-editor-empty]=\"empty\"\n [attr.aria-label]=\"ariaLabelledBy ? null : areaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-readonly]=\"readonly || null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.data-placeholder]=\"placeholder || null\"\n [ngStyle]=\"style || null\"\n (input)=\"areaInput()\"\n (keydown)=\"areaKeydown($event)\"\n (focus)=\"areaFocus($event)\"\n (blur)=\"areaBlur($event)\"\n (click)=\"areaClick($event)\"\n (paste)=\"areaPaste($event)\"\n (dragover)=\"areaDragOver($event)\"\n (drop)=\"areaDrop($event)\"\n ></div>\n <textarea\n *ngIf=\"sourceMode\"\n class=\"wu-editor-source wu-inputtext p-inputtext\"\n spellcheck=\"false\"\n [value]=\"sourceText\"\n [ngStyle]=\"style || null\"\n [attr.aria-label]=\"m.source\"\n (input)=\"sourceInput($event)\"\n ></textarea>\n <div #frameEl class=\"wu-editor-image-frame\" style=\"display: none\" aria-hidden=\"true\">\n <span class=\"wu-editor-image-handle\" [attr.title]=\"m.imageResize\" (pointerdown)=\"resizeStart($event)\"></span>\n </div>\n </div>\n\n <div *ngIf=\"notices.length || showCount\" class=\"wu-editor-footer\">\n <div *ngFor=\"let n of notices; let i = index\" class=\"wu-editor-notice\" role=\"alert\">\n <span>{{ n }}</span>\n <button type=\"button\" class=\"wu-editor-notice-close\" [attr.aria-label]=\"t.close\" (click)=\"dismissNotice(i)\">\u00D7</button>\n </div>\n <span *ngIf=\"showCount\" class=\"wu-editor-count\">{{ countText }}</span>\n </div>\n\n <input #imageInput type=\"file\" class=\"wu-editor-file\" tabindex=\"-1\" aria-hidden=\"true\" multiple [attr.accept]=\"acceptImages\" (change)=\"imageFilesChosen($event)\" />\n\n <div *ngIf=\"panel\" #panelEl class=\"wu-editor-panel\" popover=\"manual\" [attr.data-wu-panel]=\"panel\" (keydown)=\"panelKeydown($event)\" [ngSwitch]=\"panel\">\n <div *ngSwitchCase=\"'heading'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.blockStyle\">\n <button *ngFor=\"let h of opts.headings\" type=\"button\" role=\"menuitemradio\" [class]=\"'wu-editor-menu-item wu-editor-block-' + h\" [attr.aria-checked]=\"state.heading === h && !state.codeBlock && !state.blockquote\" (click)=\"pickHeading(h)\">\n {{ headingLabel(h) }}\n </button>\n <div *ngIf=\"opts.blocks.length\" class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button\n *ngFor=\"let b of opts.blocks\"\n type=\"button\"\n role=\"menuitemradio\"\n [class]=\"'wu-editor-menu-item wu-editor-block-' + b\"\n [attr.aria-checked]=\"b === 'blockquote' ? !!state.blockquote : !!state.codeBlock\"\n (click)=\"pickBlock(b)\"\n >\n {{ b === 'blockquote' ? m.blockquote : m.codeBlock }}\n </button>\n </div>\n <div *ngSwitchCase=\"'fontSize'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontSize\">\n <button *ngFor=\"let s of fontSizes\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-size]=\"s.value || null\" [attr.aria-checked]=\"state.fontSize === s.value\" (click)=\"pickSize(s.value)\">{{ s.label }}</button>\n </div>\n <div *ngSwitchCase=\"'fontFamily'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontFamily\">\n <button *ngFor=\"let f of fontFamilies\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-family]=\"f.value || null\" [attr.aria-checked]=\"state.fontFamily === f.value\" (click)=\"pickFont(f.value)\">{{ f.label }}</button>\n </div>\n <div *ngSwitchCase=\"'align'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.align\">\n <button *ngFor=\"let a of opts.alignments\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"state.align === a\" (click)=\"pickAlign(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"alignIcon(a)\"></span>\n <span>{{ alignLabel(a) }}</span>\n </button>\n </div>\n <ng-container *ngSwitchCase=\"'color'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'color', colors: opts.colors }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'highlight'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'highlight', colors: opts.highlights }\"></ng-container>\n </ng-container>\n <form *ngSwitchCase=\"'link'\" class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); applyLink()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.linkUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" autocomplete=\"off\" name=\"url\" placeholder=\"https://\" [value]=\"linkForm.url\" (input)=\"linkForm.url = $any($event.target).value; linkForm.error = ''\" />\n </label>\n <label *ngIf=\"linkForm.showText\" class=\"wu-editor-field\">\n <span>{{ m.linkText }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"text\" [value]=\"linkForm.text\" (input)=\"linkForm.text = $any($event.target).value\" />\n </label>\n <label class=\"wu-editor-check\">\n <input type=\"checkbox\" name=\"newTab\" [checked]=\"linkForm.newTab\" (change)=\"linkForm.newTab = $any($event.target).checked\" />\n <span>{{ m.linkNewTab }}</span>\n </label>\n <div *ngIf=\"linkForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ linkForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button *ngIf=\"state.link\" type=\"button\" [class]=\"buttonClass('p-button-text p-button-danger p-button-sm')\" (click)=\"unlink()\">{{ m.unlink }}</button>\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n <div *ngSwitchCase=\"'linkMenu'\" class=\"wu-editor-balloon\">\n <a class=\"wu-editor-balloon-link\" [attr.href]=\"currentLinkHref() || null\" target=\"_blank\" rel=\"noopener noreferrer\" [attr.title]=\"m.openLink\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"external\"></span>\n <span class=\"wu-editor-balloon-url\">{{ currentLinkHref() }}</span>\n </a>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.editLink\" [attr.title]=\"m.editLink\" (click)=\"openPanel('link', panelAnchor)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"edit\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.unlink\" [attr.title]=\"m.unlink\" (click)=\"unlink()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"unlink\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'image'\" class=\"wu-editor-image-form\">\n <div class=\"wu-editor-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'upload'\" (click)=\"imageForm.tab = 'upload'\">{{ m.imageUpload }}</button>\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'url'\" (click)=\"imageForm.tab = 'url'\">{{ m.imageFromUrl }}</button>\n </div>\n <button *ngIf=\"imageForm.tab === 'upload'; else urlForm\" type=\"button\" class=\"wu-editor-drop\" (click)=\"chooseImage()\" (dragover)=\"$event.preventDefault()\" (drop)=\"imagePanelDrop($event)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"upload\"></span>\n <span>{{ m.imageDrop }}</span>\n </button>\n <ng-template #urlForm>\n <form class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); insertImageUrl()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.imageUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" name=\"src\" placeholder=\"https://\" [value]=\"imageForm.url\" (input)=\"imageForm.url = $any($event.target).value; imageForm.error = ''\" />\n </label>\n <label class=\"wu-editor-field\">\n <span>{{ m.imageAlt }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"alt\" [value]=\"imageForm.alt\" (input)=\"imageForm.alt = $any($event.target).value\" />\n </label>\n <div *ngIf=\"imageForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ imageForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n </ng-template>\n </div>\n <div *ngSwitchCase=\"'imageMenu'\" class=\"wu-editor-balloon wu-editor-image-menu\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button\n *ngFor=\"let a of imageAligns\"\n type=\"button\"\n class=\"wu-editor-tool\"\n [class.wu-editor-tool-on]=\"imageAlignIs(a)\"\n [attr.aria-pressed]=\"imageAlignIs(a)\"\n [attr.aria-label]=\"imageAlignLabel(a)\"\n [attr.title]=\"imageAlignLabel(a)\"\n (click)=\"setImageAlign(a)\"\n >\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"'image' + a[0].toUpperCase() + a.slice(1)\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\" [attr.aria-label]=\"m.imageWidth\">\n <button *ngFor=\"let w of imageWidths\" type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(w)\">{{ w }}%</button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(null)\">{{ m.imageOriginal }}</button>\n </span>\n <input class=\"wu-inputtext p-inputtext wu-editor-alt\" type=\"text\" [attr.placeholder]=\"m.imageAlt\" [attr.aria-label]=\"m.imageAlt\" [value]=\"selectedImage?.getAttribute('alt') || ''\" (change)=\"setImageAlt($event)\" />\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.imageRemove\" [attr.title]=\"m.imageRemove\" (click)=\"removeImage()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'table'\" class=\"wu-editor-table-insert\">\n <div class=\"wu-editor-grid\" role=\"grid\" tabindex=\"0\" [attr.aria-label]=\"m.insertTable\" (keydown)=\"gridKeydown($event)\" (mouseleave)=\"gridMove(0, 0)\">\n <div *ngFor=\"let r of gridRows()\" class=\"wu-editor-grid-row\" role=\"row\">\n <button\n *ngFor=\"let c of gridCols()\"\n type=\"button\"\n role=\"gridcell\"\n tabindex=\"-1\"\n class=\"wu-editor-grid-cell\"\n [class.wu-editor-grid-on]=\"r <= gridHover.rows && c <= gridHover.cols\"\n [attr.aria-label]=\"m.tableSize.replace('{0}', '' + r).replace('{1}', '' + c)\"\n (mouseenter)=\"gridMove(r, c)\"\n (focus)=\"gridMove(r, c)\"\n (click)=\"insertTable(r, c)\"\n ></button>\n </div>\n <div class=\"wu-editor-grid-label\" aria-live=\"polite\">{{ gridLabel }}</div>\n </div>\n <div class=\"wu-editor-table-size\">\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableRows }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"100\" inputmode=\"numeric\" [value]=\"tableForm.rows\" (input)=\"setTableForm('rows', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableCols }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"30\" inputmode=\"numeric\" [value]=\"tableForm.cols\" (input)=\"setTableForm('cols', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-check wu-editor-table-size-header\">\n <input type=\"checkbox\" [checked]=\"tableForm.header\" (change)=\"setTableHeader($event)\" />\n <span>{{ m.headerRow }}</span>\n </label>\n <button type=\"button\" class=\"wu-btn p-button wu-btn-sm p-button-sm wu-editor-table-size-insert\" (click)=\"insertCustomTable()\">{{ m.insert }}</button>\n </div>\n </div>\n <div *ngSwitchCase=\"'tableBar'\" class=\"wu-editor-balloon wu-editor-table-bar\" role=\"toolbar\" [attr.aria-label]=\"m.tableTools\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"$any(m)[a]\" [attr.title]=\"$any(m)[a]\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canMergePicked\" [attr.aria-label]=\"cellPick ? m.mergeCells : m.mergeRight\" [attr.title]=\"cellPick ? m.mergeCells : m.mergeRight\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canSplit()\" [attr.aria-label]=\"m.splitCell\" [attr.title]=\"m.splitCell\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [class.wu-editor-tool-on]=\"inHeaderRow\" [attr.aria-pressed]=\"inHeaderRow\" [attr.aria-label]=\"m.headerRow\" [attr.title]=\"m.headerRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteRow\" [attr.title]=\"m.deleteRow\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteCol\" [attr.title]=\"m.deleteCol\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.deleteTable\" [attr.title]=\"m.deleteTable\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </span>\n </div>\n <div *ngSwitchCase=\"'tableMenu'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.table\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span><span>{{ $any(m)[a] }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitemcheckbox\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"inHeaderRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span><span>{{ m.headerRow }}</span>\n </button>\n <button *ngIf=\"cellPick\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMergePicked\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeCells }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('right')\" (click)=\"tableAction('mergeRight')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeRight }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('down')\" (click)=\"tableAction('mergeDown')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeDown\"></span><span>{{ m.mergeDown }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canSplit()\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span><span>{{ m.splitCell }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span><span>{{ m.deleteRow }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span><span>{{ m.deleteCol }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-menu-danger\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span><span>{{ m.deleteTable }}</span>\n </button>\n </div>\n </div>\n</div>\n\n<ng-template #palette let-kind=\"kind\" let-colors=\"colors\">\n <div class=\"wu-editor-palette\" role=\"menu\" [attr.aria-label]=\"kind === 'color' ? m.color : m.highlight\">\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-palette-none\" (click)=\"pickColor(kind, null)\">\n <span class=\"wu-editor-swatch wu-editor-swatch-none\" aria-hidden=\"true\"></span>{{ m.removeColor }}\n </button>\n <div class=\"wu-editor-swatches\">\n <button *ngFor=\"let c of colors\" type=\"button\" role=\"menuitem\" class=\"wu-editor-swatch\" [style.background]=\"c\" [attr.aria-label]=\"c\" [attr.title]=\"c\" (click)=\"pickColor(kind, c)\"></button>\n </div>\n <label class=\"wu-editor-custom-color\">\n <input type=\"color\" (change)=\"customColor(kind, $event)\" />\n <span>{{ m.customColor }}</span>\n </label>\n </div>\n</ng-template>\n", styles: ["@layer wiraui.components{wu-editor{display:block;max-width:100%}.wu-editor{position:relative;display:flex;flex-direction:column;min-width:0;font-family:var(--wu-font-family);font-size:var(--wu-font-size);color:var(--wu-text)}.wu-editor-hidden,.wu-editor-file{display:none!important}.wu-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:var(--wu-editor-toolbar-padding);border:1px solid var(--wu-field-border);border-bottom-color:var(--wu-border);border-radius:var(--wu-editor-radius) var(--wu-editor-radius) 0 0;background:var(--wu-editor-toolbar-bg)}.wu-editor-sticky .wu-editor-toolbar{position:sticky;top:var(--wu-editor-sticky-top, 0px);z-index:2}.wu-editor-group,.wu-editor-toolbar .ql-formats{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px}.wu-editor-group+.wu-editor-group,.wu-editor-toolbar .ql-formats+.ql-formats{margin-left:.125rem;padding-left:.375rem;border-left:1px solid var(--wu-border)}.wu-editor-tool,.wu-editor-toolbar .ql-formats>button{display:inline-flex;align-items:center;justify-content:center;gap:.25rem;box-sizing:border-box;min-width:var(--wu-editor-tool-size);height:var(--wu-editor-tool-size);margin:0;padding:0 .375rem;border:0;border-radius:var(--wu-editor-tool-radius);background:transparent;color:var(--wu-text);font:inherit;font-size:.875em;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color var(--wu-transition),color var(--wu-transition)}.wu-editor-tool:not(:disabled):hover{background:var(--wu-editor-tool-hover-bg)}.wu-editor-tool.wu-editor-tool-on,.wu-editor-tool.wu-editor-tool-open{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-tool:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-tool:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:-1px}.wu-editor-icon-wrap,.wu-editor-chevron-wrap{display:inline-flex}.wu-editor-icon{width:1.25rem;height:1.25rem}.wu-editor-chevron{width:.875rem;height:.875rem;opacity:.7}.wu-editor-dropdown{justify-content:space-between;padding:0 .375rem 0 .5rem}.wu-editor-dropdown-label{min-width:4.5rem;max-width:9rem;overflow:hidden;text-align:start;text-overflow:ellipsis}.wu-editor-heading-mark{font-weight:700;font-size:.875em}.wu-editor-tool-text{font-size:.8125em}.wu-editor-tool-danger:not(:disabled):hover{background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-body{position:relative;display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.wu-editor-area{position:relative;box-sizing:border-box;min-height:var(--wu-editor-content-min-height);padding:var(--wu-editor-content-padding-y) var(--wu-editor-content-padding-x);border:1px solid var(--wu-field-border);border-radius:var(--wu-editor-radius);background:var(--wu-field-bg);outline:none;overflow:auto;overscroll-behavior:contain;transition:border-color var(--wu-transition),box-shadow var(--wu-transition)}.wu-editor-toolbar+.wu-editor-body>.wu-editor-area,.wu-editor-toolbar+.wu-editor-body>.wu-editor-source{border-top:0;border-radius:0 0 var(--wu-editor-radius) var(--wu-editor-radius)}.wu-editor-focused .wu-editor-area{border-color:var(--wu-primary-color);box-shadow:var(--wu-control-focus-shadow)}.wu-editor-area.wu-editor-empty:before{content:attr(data-placeholder);position:absolute;top:var(--wu-editor-content-padding-y);right:var(--wu-editor-content-padding-x);left:var(--wu-editor-content-padding-x);color:var(--wu-field-placeholder);pointer-events:none}.wu-editor-disabled .wu-editor-area{opacity:var(--wu-disabled-opacity)}.wu-editor-readonly .wu-editor-area{background:var(--wu-editor-toolbar-bg)}.wu-editor-source{box-sizing:border-box;width:100%;min-height:var(--wu-editor-content-min-height);resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;line-height:1.5}.wu-editor-content{line-height:1.6;overflow-wrap:break-word;white-space:pre-wrap;tab-size:4}.wu-editor-view{display:block;color:var(--wu-text)}.wu-editor-content:after{content:\"\";display:table;clear:both}.wu-editor-content>:first-child{margin-top:0}.wu-editor-content :is(p,ol,ul,pre,blockquote,h1,h2,h3,h4,h5,h6){margin:0;padding:0}.wu-editor-content h1{font-size:2em;line-height:1.25}.wu-editor-content h2{font-size:1.5em;line-height:1.3}.wu-editor-content h3{font-size:1.25em}.wu-editor-content h4{font-size:1.1em}.wu-editor-content :is(h1,h2,h3,h4,h5,h6){font-weight:600}.wu-editor-content :is(ol,ul){padding-left:1.5em}.wu-editor-content li>:is(ol,ul){margin:0}.wu-editor-content blockquote{margin:.5em 0;padding:.25em 0 .25em 1em;border-left:4px solid var(--wu-border);color:var(--wu-text-muted)}.wu-editor-content pre{margin:.5em 0;padding:.75em 1em;border-radius:var(--wu-radius-sm);background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;white-space:pre-wrap;overflow-x:auto}.wu-editor-content code{padding:.1em .3em;border-radius:3px;background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-content pre code{padding:0;background:none;font-size:inherit}.wu-editor-content a{color:var(--wu-primary-color);text-decoration:underline}.wu-editor-content hr{margin:1em 0;border:0;border-top:1px solid var(--wu-border)}.wu-editor-content img{max-width:100%;height:auto;vertical-align:bottom}.wu-editor-content img.wu-image-left{float:left;margin:.25em 1em .5em 0}.wu-editor-content img.wu-image-right{float:right;margin:.25em 0 .5em 1em}.wu-editor-content img.wu-image-center{display:block;margin:.5em auto}.wu-editor-content table{margin:.5em 0;border-collapse:collapse;max-width:100%}.wu-editor-content :is(td,th){min-width:2.5em;padding:.375em .5em;border:1px solid var(--wu-border);text-align:start;vertical-align:top}.wu-editor-content th{background:var(--wu-hover-bg);font-weight:600}.wu-editor-content table:has(> colgroup){table-layout:fixed}.wu-editor-content :is(td,th){overflow-wrap:anywhere}.wu-editor-area .wu-editor-cell-picked{background:color-mix(in srgb,var(--wu-primary-color) 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--wu-primary-color) 60%,transparent)}.wu-editor-picking ::selection{background:transparent}.wu-editor-col-resize,.wu-editor-col-resize *,.wu-editor-resizing,.wu-editor-resizing *{cursor:col-resize!important}.wu-editor-resizing{-webkit-user-select:none;user-select:none}.wu-editor-content .ql-align-center{text-align:center}.wu-editor-content .ql-align-right{text-align:right}.wu-editor-content .ql-align-justify{text-align:justify}.wu-editor-content .ql-size-small{font-size:.75em}.wu-editor-content .ql-size-large{font-size:1.5em}.wu-editor-content .ql-size-huge{font-size:2.5em}.wu-editor-content .ql-font-serif{font-family:Georgia,Times New Roman,serif}.wu-editor-content .ql-font-monospace{font-family:Monaco,Courier New,monospace}.wu-editor-content .ql-indent-1{padding-left:3em}.wu-editor-content .ql-indent-2{padding-left:6em}.wu-editor-content .ql-indent-3{padding-left:9em}.wu-editor-content .ql-indent-4{padding-left:12em}.wu-editor-content .ql-indent-5{padding-left:15em}.wu-editor-content .ql-indent-6{padding-left:18em}.wu-editor-content .ql-indent-7{padding-left:21em}.wu-editor-content .ql-indent-8{padding-left:24em}.wu-editor-content li.ql-indent-1{margin-left:3em;padding-left:0}.wu-editor-content li.ql-indent-2{margin-left:6em;padding-left:0}.wu-editor-content li.ql-indent-3{margin-left:9em;padding-left:0}.wu-editor-content li.ql-indent-4{margin-left:12em;padding-left:0}.wu-editor-area img.wu-image-selected{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-area img.wu-image-uploading{opacity:.5;animation:wu-editor-pulse 1.2s ease-in-out infinite}.wu-editor-area :is(td,th):focus-within{outline:2px solid color-mix(in srgb,var(--wu-primary-color) 45%,transparent);outline-offset:-2px}.wu-editor-image-frame{position:absolute;box-sizing:border-box;pointer-events:none}.wu-editor-image-handle{position:absolute;right:-7px;bottom:-7px;box-sizing:border-box;width:14px;height:14px;border:2px solid var(--wu-card-bg);border-radius:3px;background:var(--wu-primary-color);cursor:nwse-resize;pointer-events:auto;touch-action:none}.wu-editor-readonly .wu-editor-image-frame,.wu-editor-disabled .wu-editor-image-frame{display:none!important}.wu-editor-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;padding:.375rem .125rem 0;font-size:.8125em;color:var(--wu-text-muted)}.wu-editor-count{margin-left:auto}.wu-editor-notice{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .5rem;border-radius:var(--wu-radius-sm);background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-notice-close{padding:0 .25rem;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.wu-editor.wu-editor-fullscreen{position:fixed;inset:0;z-index:1100;box-sizing:border-box;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:.75rem;border:0;overflow:hidden;background:var(--wu-ground, var(--wu-card-bg));color:var(--wu-text)}.wu-editor-fullscreen .wu-editor-area,.wu-editor-fullscreen .wu-editor-source{flex:1 1 auto;height:auto!important;max-height:none!important}.wu-editor-panel{position:fixed;inset:auto;z-index:1200;box-sizing:border-box;max-width:min(24rem,calc(100vw - 1rem));margin:0;padding:.375rem;overflow:auto;border:1px solid var(--wu-border);border-radius:var(--wu-radius-md);background:var(--wu-card-bg);color:var(--wu-text);box-shadow:var(--wu-shadow-md);font-family:var(--wu-font-family);font-size:var(--wu-font-size)}.wu-editor-menu{display:flex;flex-direction:column;gap:2px;min-width:11rem}.wu-editor-menu-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.4375rem .625rem;border:0;border-radius:var(--wu-radius-sm);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}.wu-editor-menu-item:not(:disabled):hover,.wu-editor-menu-item:focus-visible{background:var(--wu-editor-tool-hover-bg);outline:none}.wu-editor-menu-item[aria-checked=true]{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-menu-item:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-menu-danger{color:var(--wu-danger-color)}.wu-editor-menu-sep{height:1px;margin:.25rem 0;background:var(--wu-border)}.wu-editor-block-1{font-size:1.5em;font-weight:600}.wu-editor-block-2{font-size:1.3em;font-weight:600}.wu-editor-block-3{font-size:1.15em;font-weight:600}.wu-editor-block-4{font-size:1.05em;font-weight:600}.wu-editor-block-5{font-weight:600}.wu-editor-block-6{font-size:.875em;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.wu-editor-block-blockquote{border-left:3px solid var(--wu-border);font-style:italic}.wu-editor-block-codeBlock{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-palette{display:flex;flex-direction:column;gap:.375rem;width:14.5rem}.wu-editor-swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:.375rem}.wu-editor-swatch{box-sizing:border-box;width:100%;aspect-ratio:1;padding:0;border:1px solid color-mix(in srgb,var(--wu-text) 18%,transparent);border-radius:var(--wu-radius-sm);cursor:pointer}.wu-editor-palette-none .wu-editor-swatch{width:1.25rem;flex:none}.wu-editor-swatch-none{background:linear-gradient(135deg,transparent 45%,var(--wu-danger-color) 45%,var(--wu-danger-color) 55%,transparent 55%),var(--wu-card-bg)}.wu-editor-swatch:hover,.wu-editor-swatch:focus-visible{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-custom-color{display:flex;align-items:center;gap:.5rem;font-size:.875em;cursor:pointer}.wu-editor-custom-color input{width:2rem;height:1.75rem;padding:0;border:0;background:none;cursor:pointer}.wu-editor-form,.wu-editor-image-form{display:flex;flex-direction:column;gap:.625rem;width:min(20rem,calc(100vw - 2.5rem));padding:.25rem}.wu-editor-field{display:flex;flex-direction:column;gap:.25rem;font-size:.875em}.wu-editor-field .wu-inputtext{width:100%;box-sizing:border-box}.wu-editor-check{display:flex;align-items:center;gap:.5rem;font-size:.875em}.wu-editor-form-error{color:var(--wu-danger-color);font-size:.875em}.wu-editor-form-actions{display:flex;justify-content:flex-end;gap:.5rem}.wu-editor-tabs{display:flex;gap:.25rem;border-bottom:1px solid var(--wu-border)}.wu-editor-tab{margin-bottom:-1px;padding:.375rem .75rem;border:0;border-bottom:2px solid transparent;background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;cursor:pointer}.wu-editor-tab[aria-selected=true]{border-bottom-color:var(--wu-primary-color);color:var(--wu-primary-color);font-weight:600}.wu-editor-drop{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.25rem .75rem;border:1.5px dashed var(--wu-field-border);border-radius:var(--wu-radius-md);background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;text-align:center;cursor:pointer}.wu-editor-drop:hover,.wu-editor-drop:focus-visible{border-color:var(--wu-primary-color);color:var(--wu-primary-color);outline:none}.wu-editor-drop .wu-editor-icon{width:1.75rem;height:1.75rem}.wu-editor-grid{display:flex;flex-direction:column;gap:3px;padding:.125rem;outline:none}.wu-editor-grid-row{display:flex;gap:3px}.wu-editor-grid-cell{width:1.125rem;height:1.125rem;padding:0;border:1px solid var(--wu-field-border);border-radius:2px;background:var(--wu-field-bg);cursor:pointer}.wu-editor-grid-cell.wu-editor-grid-on{border-color:var(--wu-primary-color);background:color-mix(in srgb,var(--wu-primary-color) 22%,var(--wu-field-bg))}.wu-editor-grid:focus-visible{outline:var(--wu-control-focus-outline)}.wu-editor-grid-label{padding-top:.25rem;font-size:.8125em;text-align:center;color:var(--wu-text-muted)}.wu-editor-table-insert{display:flex;flex-direction:column;gap:.75rem}.wu-editor-table-size{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem;padding-top:.75rem;border-top:1px solid var(--wu-border)}.wu-editor-table-size-field{display:flex;flex-direction:column;gap:.25rem;min-width:0;color:var(--wu-text-muted);font-size:.875em}.wu-editor-table-size-field .wu-inputtext{box-sizing:border-box;width:100%;min-width:0}.wu-editor-table-size-header,.wu-editor-table-size-insert{grid-column:1 / -1}.wu-editor-table-size-insert{justify-self:end}.wu-editor-balloon{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem}.wu-editor-balloon-group{display:inline-flex;gap:2px}.wu-editor-balloon-group+.wu-editor-balloon-group{padding-left:.25rem;border-left:1px solid var(--wu-border)}.wu-editor-balloon-link{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:0 .375rem;color:var(--wu-primary-color);text-decoration:none}.wu-editor-balloon-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wu-editor-alt{width:9rem;min-width:0;height:var(--wu-editor-tool-size);box-sizing:border-box;font-size:.875em}@keyframes wu-editor-pulse{50%{opacity:.25}}@media (prefers-reduced-motion: reduce){.wu-editor-tool,.wu-editor-area{transition:none}.wu-editor-area img.wu-image-uploading{animation:none}}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ɵWuEditorIcon, selector: "[wuEditorIcon]", inputs: ["wuEditorIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3052
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditor, decorators: [{
|
|
3053
|
+
type: Component,
|
|
3054
|
+
args: [{ selector: 'wu-editor', standalone: true, exportAs: 'wuEditor', imports: [NgClass, NgFor, NgIf, NgStyle, NgSwitch, NgSwitchCase, NgTemplateOutlet, ɵWuEditorIcon], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WuEditor), multi: true }], host: { class: 'wu-editor-host' }, template: "<div\n class=\"wu-editor p-editor p-editor-container p-component\"\n [class.wu-editor-focused]=\"focused\"\n [class.wu-editor-disabled]=\"disabled\"\n [class.p-disabled]=\"disabled\"\n [class.wu-editor-readonly]=\"readonly\"\n [class.wu-editor-fullscreen]=\"fullscreen\"\n [class.wu-editor-sticky]=\"stickyToolbar\"\n [class.wu-editor-source-mode]=\"sourceMode\"\n [ngClass]=\"styleClass || ''\"\n>\n <div\n *ngIf=\"headerTemplate || groups.length\"\n #toolbarEl\n class=\"wu-editor-toolbar p-editor-toolbar\"\n role=\"toolbar\"\n [attr.aria-label]=\"m.toolbar\"\n [attr.aria-controls]=\"areaId\"\n (mousedown)=\"toolbarMouseDown($event)\"\n (keydown)=\"toolbarKeydown($event)\"\n >\n <ng-container *ngIf=\"headerTemplate; else ownTools\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #ownTools>\n <span *ngFor=\"let group of groups\" class=\"wu-editor-group\" role=\"group\">\n <button\n *ngFor=\"let t of group\"\n type=\"button\"\n class=\"wu-editor-tool\"\n tabindex=\"-1\"\n [class.wu-editor-dropdown]=\"isDropdown(t)\"\n [class.wu-editor-tool-on]=\"isOn(t)\"\n [class.wu-editor-tool-open]=\"panelOpenFor(t)\"\n [attr.data-wu-tool]=\"t\"\n [disabled]=\"isDisabled(t)\"\n [attr.aria-pressed]=\"hasMenu(t) ? null : isOn(t)\"\n [attr.aria-haspopup]=\"hasMenu(t) ? 'true' : null\"\n [attr.aria-expanded]=\"hasMenu(t) ? panelOpenFor(t) : null\"\n [attr.aria-label]=\"toolLabel(t)\"\n [attr.title]=\"toolLabel(t)\"\n (click)=\"runTool(t, $event)\"\n >\n <ng-container *ngIf=\"isDropdown(t); else iconTool\">\n <span class=\"wu-editor-dropdown-label\">{{ dropdownLabel(t) }}</span>\n <span class=\"wu-editor-chevron-wrap\" wuEditorIcon=\"chevron\"></span>\n </ng-container>\n <ng-template #iconTool><span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"toolIcon(t)\"></span></ng-template>\n </button>\n </span>\n </ng-template>\n </div>\n\n <div class=\"wu-editor-body\">\n <div\n #area\n class=\"wu-editor-area wu-editor-content p-editor-content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n spellcheck=\"true\"\n [id]=\"areaId\"\n [class.wu-editor-hidden]=\"sourceMode\"\n [class.wu-editor-empty]=\"empty\"\n [attr.aria-label]=\"ariaLabelledBy ? null : areaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-readonly]=\"readonly || null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.data-placeholder]=\"placeholder || null\"\n [ngStyle]=\"style || null\"\n (input)=\"areaInput()\"\n (keydown)=\"areaKeydown($event)\"\n (focus)=\"areaFocus($event)\"\n (blur)=\"areaBlur($event)\"\n (click)=\"areaClick($event)\"\n (paste)=\"areaPaste($event)\"\n (dragover)=\"areaDragOver($event)\"\n (drop)=\"areaDrop($event)\"\n ></div>\n <textarea\n *ngIf=\"sourceMode\"\n class=\"wu-editor-source wu-inputtext p-inputtext\"\n spellcheck=\"false\"\n [value]=\"sourceText\"\n [ngStyle]=\"style || null\"\n [attr.aria-label]=\"m.source\"\n (input)=\"sourceInput($event)\"\n ></textarea>\n <div #frameEl class=\"wu-editor-image-frame\" style=\"display: none\" aria-hidden=\"true\">\n <span class=\"wu-editor-image-handle\" [attr.title]=\"m.imageResize\" (pointerdown)=\"resizeStart($event)\"></span>\n </div>\n </div>\n\n <div *ngIf=\"notices.length || showCount\" class=\"wu-editor-footer\">\n <div *ngFor=\"let n of notices; let i = index\" class=\"wu-editor-notice\" role=\"alert\">\n <span>{{ n }}</span>\n <button type=\"button\" class=\"wu-editor-notice-close\" [attr.aria-label]=\"t.close\" (click)=\"dismissNotice(i)\">\u00D7</button>\n </div>\n <span *ngIf=\"showCount\" class=\"wu-editor-count\">{{ countText }}</span>\n </div>\n\n <input #imageInput type=\"file\" class=\"wu-editor-file\" tabindex=\"-1\" aria-hidden=\"true\" multiple [attr.accept]=\"acceptImages\" (change)=\"imageFilesChosen($event)\" />\n\n <div *ngIf=\"panel\" #panelEl class=\"wu-editor-panel\" popover=\"manual\" [attr.data-wu-panel]=\"panel\" (keydown)=\"panelKeydown($event)\" [ngSwitch]=\"panel\">\n <div *ngSwitchCase=\"'heading'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.blockStyle\">\n <button *ngFor=\"let h of opts.headings\" type=\"button\" role=\"menuitemradio\" [class]=\"'wu-editor-menu-item wu-editor-block-' + h\" [attr.aria-checked]=\"state.heading === h && !state.codeBlock && !state.blockquote\" (click)=\"pickHeading(h)\">\n {{ headingLabel(h) }}\n </button>\n <div *ngIf=\"opts.blocks.length\" class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button\n *ngFor=\"let b of opts.blocks\"\n type=\"button\"\n role=\"menuitemradio\"\n [class]=\"'wu-editor-menu-item wu-editor-block-' + b\"\n [attr.aria-checked]=\"b === 'blockquote' ? !!state.blockquote : !!state.codeBlock\"\n (click)=\"pickBlock(b)\"\n >\n {{ b === 'blockquote' ? m.blockquote : m.codeBlock }}\n </button>\n </div>\n <div *ngSwitchCase=\"'fontSize'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontSize\">\n <button *ngFor=\"let s of fontSizes\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-size]=\"s.value || null\" [attr.aria-checked]=\"state.fontSize === s.value\" (click)=\"pickSize(s.value)\">{{ s.label }}</button>\n </div>\n <div *ngSwitchCase=\"'fontFamily'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontFamily\">\n <button *ngFor=\"let f of fontFamilies\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-family]=\"f.value || null\" [attr.aria-checked]=\"state.fontFamily === f.value\" (click)=\"pickFont(f.value)\">{{ f.label }}</button>\n </div>\n <div *ngSwitchCase=\"'align'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.align\">\n <button *ngFor=\"let a of opts.alignments\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"state.align === a\" (click)=\"pickAlign(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"alignIcon(a)\"></span>\n <span>{{ alignLabel(a) }}</span>\n </button>\n </div>\n <ng-container *ngSwitchCase=\"'color'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'color', colors: opts.colors }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'highlight'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'highlight', colors: opts.highlights }\"></ng-container>\n </ng-container>\n <form *ngSwitchCase=\"'link'\" class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); applyLink()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.linkUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" autocomplete=\"off\" name=\"url\" placeholder=\"https://\" [value]=\"linkForm.url\" (input)=\"linkForm.url = $any($event.target).value; linkForm.error = ''\" />\n </label>\n <label *ngIf=\"linkForm.showText\" class=\"wu-editor-field\">\n <span>{{ m.linkText }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"text\" [value]=\"linkForm.text\" (input)=\"linkForm.text = $any($event.target).value\" />\n </label>\n <label class=\"wu-editor-check\">\n <input type=\"checkbox\" name=\"newTab\" [checked]=\"linkForm.newTab\" (change)=\"linkForm.newTab = $any($event.target).checked\" />\n <span>{{ m.linkNewTab }}</span>\n </label>\n <div *ngIf=\"linkForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ linkForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button *ngIf=\"state.link\" type=\"button\" [class]=\"buttonClass('p-button-text p-button-danger p-button-sm')\" (click)=\"unlink()\">{{ m.unlink }}</button>\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n <div *ngSwitchCase=\"'linkMenu'\" class=\"wu-editor-balloon\">\n <a class=\"wu-editor-balloon-link\" [attr.href]=\"currentLinkHref() || null\" target=\"_blank\" rel=\"noopener noreferrer\" [attr.title]=\"m.openLink\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"external\"></span>\n <span class=\"wu-editor-balloon-url\">{{ currentLinkHref() }}</span>\n </a>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.editLink\" [attr.title]=\"m.editLink\" (click)=\"openPanel('link', panelAnchor)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"edit\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.unlink\" [attr.title]=\"m.unlink\" (click)=\"unlink()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"unlink\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'image'\" class=\"wu-editor-image-form\">\n <div class=\"wu-editor-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'upload'\" (click)=\"imageForm.tab = 'upload'\">{{ m.imageUpload }}</button>\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'url'\" (click)=\"imageForm.tab = 'url'\">{{ m.imageFromUrl }}</button>\n </div>\n <button *ngIf=\"imageForm.tab === 'upload'; else urlForm\" type=\"button\" class=\"wu-editor-drop\" (click)=\"chooseImage()\" (dragover)=\"$event.preventDefault()\" (drop)=\"imagePanelDrop($event)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"upload\"></span>\n <span>{{ m.imageDrop }}</span>\n </button>\n <ng-template #urlForm>\n <form class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); insertImageUrl()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.imageUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" name=\"src\" placeholder=\"https://\" [value]=\"imageForm.url\" (input)=\"imageForm.url = $any($event.target).value; imageForm.error = ''\" />\n </label>\n <label class=\"wu-editor-field\">\n <span>{{ m.imageAlt }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"alt\" [value]=\"imageForm.alt\" (input)=\"imageForm.alt = $any($event.target).value\" />\n </label>\n <div *ngIf=\"imageForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ imageForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n </ng-template>\n </div>\n <div *ngSwitchCase=\"'imageMenu'\" class=\"wu-editor-balloon wu-editor-image-menu\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button\n *ngFor=\"let a of imageAligns\"\n type=\"button\"\n class=\"wu-editor-tool\"\n [class.wu-editor-tool-on]=\"imageAlignIs(a)\"\n [attr.aria-pressed]=\"imageAlignIs(a)\"\n [attr.aria-label]=\"imageAlignLabel(a)\"\n [attr.title]=\"imageAlignLabel(a)\"\n (click)=\"setImageAlign(a)\"\n >\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"'image' + a[0].toUpperCase() + a.slice(1)\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\" [attr.aria-label]=\"m.imageWidth\">\n <button *ngFor=\"let w of imageWidths\" type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(w)\">{{ w }}%</button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(null)\">{{ m.imageOriginal }}</button>\n </span>\n <input class=\"wu-inputtext p-inputtext wu-editor-alt\" type=\"text\" [attr.placeholder]=\"m.imageAlt\" [attr.aria-label]=\"m.imageAlt\" [value]=\"selectedImage?.getAttribute('alt') || ''\" (change)=\"setImageAlt($event)\" />\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.imageRemove\" [attr.title]=\"m.imageRemove\" (click)=\"removeImage()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'table'\" class=\"wu-editor-table-insert\">\n <div class=\"wu-editor-grid\" role=\"grid\" tabindex=\"0\" [attr.aria-label]=\"m.insertTable\" (keydown)=\"gridKeydown($event)\" (mouseleave)=\"gridMove(0, 0)\">\n <div *ngFor=\"let r of gridRows()\" class=\"wu-editor-grid-row\" role=\"row\">\n <button\n *ngFor=\"let c of gridCols()\"\n type=\"button\"\n role=\"gridcell\"\n tabindex=\"-1\"\n class=\"wu-editor-grid-cell\"\n [class.wu-editor-grid-on]=\"r <= gridHover.rows && c <= gridHover.cols\"\n [attr.aria-label]=\"m.tableSize.replace('{0}', '' + r).replace('{1}', '' + c)\"\n (mouseenter)=\"gridMove(r, c)\"\n (focus)=\"gridMove(r, c)\"\n (click)=\"insertTable(r, c)\"\n ></button>\n </div>\n <div class=\"wu-editor-grid-label\" aria-live=\"polite\">{{ gridLabel }}</div>\n </div>\n <div class=\"wu-editor-table-size\">\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableRows }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"100\" inputmode=\"numeric\" [value]=\"tableForm.rows\" (input)=\"setTableForm('rows', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableCols }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"30\" inputmode=\"numeric\" [value]=\"tableForm.cols\" (input)=\"setTableForm('cols', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-check wu-editor-table-size-header\">\n <input type=\"checkbox\" [checked]=\"tableForm.header\" (change)=\"setTableHeader($event)\" />\n <span>{{ m.headerRow }}</span>\n </label>\n <button type=\"button\" class=\"wu-btn p-button wu-btn-sm p-button-sm wu-editor-table-size-insert\" (click)=\"insertCustomTable()\">{{ m.insert }}</button>\n </div>\n </div>\n <div *ngSwitchCase=\"'tableBar'\" class=\"wu-editor-balloon wu-editor-table-bar\" role=\"toolbar\" [attr.aria-label]=\"m.tableTools\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"$any(m)[a]\" [attr.title]=\"$any(m)[a]\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canMergePicked\" [attr.aria-label]=\"cellPick ? m.mergeCells : m.mergeRight\" [attr.title]=\"cellPick ? m.mergeCells : m.mergeRight\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canSplit()\" [attr.aria-label]=\"m.splitCell\" [attr.title]=\"m.splitCell\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [class.wu-editor-tool-on]=\"inHeaderRow\" [attr.aria-pressed]=\"inHeaderRow\" [attr.aria-label]=\"m.headerRow\" [attr.title]=\"m.headerRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteRow\" [attr.title]=\"m.deleteRow\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteCol\" [attr.title]=\"m.deleteCol\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.deleteTable\" [attr.title]=\"m.deleteTable\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </span>\n </div>\n <div *ngSwitchCase=\"'tableMenu'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.table\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span><span>{{ $any(m)[a] }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitemcheckbox\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"inHeaderRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span><span>{{ m.headerRow }}</span>\n </button>\n <button *ngIf=\"cellPick\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMergePicked\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeCells }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('right')\" (click)=\"tableAction('mergeRight')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeRight }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('down')\" (click)=\"tableAction('mergeDown')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeDown\"></span><span>{{ m.mergeDown }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canSplit()\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span><span>{{ m.splitCell }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span><span>{{ m.deleteRow }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span><span>{{ m.deleteCol }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-menu-danger\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span><span>{{ m.deleteTable }}</span>\n </button>\n </div>\n </div>\n</div>\n\n<ng-template #palette let-kind=\"kind\" let-colors=\"colors\">\n <div class=\"wu-editor-palette\" role=\"menu\" [attr.aria-label]=\"kind === 'color' ? m.color : m.highlight\">\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-palette-none\" (click)=\"pickColor(kind, null)\">\n <span class=\"wu-editor-swatch wu-editor-swatch-none\" aria-hidden=\"true\"></span>{{ m.removeColor }}\n </button>\n <div class=\"wu-editor-swatches\">\n <button *ngFor=\"let c of colors\" type=\"button\" role=\"menuitem\" class=\"wu-editor-swatch\" [style.background]=\"c\" [attr.aria-label]=\"c\" [attr.title]=\"c\" (click)=\"pickColor(kind, c)\"></button>\n </div>\n <label class=\"wu-editor-custom-color\">\n <input type=\"color\" (change)=\"customColor(kind, $event)\" />\n <span>{{ m.customColor }}</span>\n </label>\n </div>\n</ng-template>\n", styles: ["@layer wiraui.components{wu-editor{display:block;max-width:100%}.wu-editor{position:relative;display:flex;flex-direction:column;min-width:0;font-family:var(--wu-font-family);font-size:var(--wu-font-size);color:var(--wu-text)}.wu-editor-hidden,.wu-editor-file{display:none!important}.wu-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:var(--wu-editor-toolbar-padding);border:1px solid var(--wu-field-border);border-bottom-color:var(--wu-border);border-radius:var(--wu-editor-radius) var(--wu-editor-radius) 0 0;background:var(--wu-editor-toolbar-bg)}.wu-editor-sticky .wu-editor-toolbar{position:sticky;top:var(--wu-editor-sticky-top, 0px);z-index:2}.wu-editor-group,.wu-editor-toolbar .ql-formats{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px}.wu-editor-group+.wu-editor-group,.wu-editor-toolbar .ql-formats+.ql-formats{margin-left:.125rem;padding-left:.375rem;border-left:1px solid var(--wu-border)}.wu-editor-tool,.wu-editor-toolbar .ql-formats>button{display:inline-flex;align-items:center;justify-content:center;gap:.25rem;box-sizing:border-box;min-width:var(--wu-editor-tool-size);height:var(--wu-editor-tool-size);margin:0;padding:0 .375rem;border:0;border-radius:var(--wu-editor-tool-radius);background:transparent;color:var(--wu-text);font:inherit;font-size:.875em;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color var(--wu-transition),color var(--wu-transition)}.wu-editor-tool:not(:disabled):hover{background:var(--wu-editor-tool-hover-bg)}.wu-editor-tool.wu-editor-tool-on,.wu-editor-tool.wu-editor-tool-open{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-tool:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-tool:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:-1px}.wu-editor-icon-wrap,.wu-editor-chevron-wrap{display:inline-flex}.wu-editor-icon{width:1.25rem;height:1.25rem}.wu-editor-chevron{width:.875rem;height:.875rem;opacity:.7}.wu-editor-dropdown{justify-content:space-between;padding:0 .375rem 0 .5rem}.wu-editor-dropdown-label{min-width:4.5rem;max-width:9rem;overflow:hidden;text-align:start;text-overflow:ellipsis}.wu-editor-heading-mark{font-weight:700;font-size:.875em}.wu-editor-tool-text{font-size:.8125em}.wu-editor-tool-danger:not(:disabled):hover{background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-body{position:relative;display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.wu-editor-area{position:relative;box-sizing:border-box;min-height:var(--wu-editor-content-min-height);padding:var(--wu-editor-content-padding-y) var(--wu-editor-content-padding-x);border:1px solid var(--wu-field-border);border-radius:var(--wu-editor-radius);background:var(--wu-field-bg);outline:none;overflow:auto;overscroll-behavior:contain;transition:border-color var(--wu-transition),box-shadow var(--wu-transition)}.wu-editor-toolbar+.wu-editor-body>.wu-editor-area,.wu-editor-toolbar+.wu-editor-body>.wu-editor-source{border-top:0;border-radius:0 0 var(--wu-editor-radius) var(--wu-editor-radius)}.wu-editor-focused .wu-editor-area{border-color:var(--wu-primary-color);box-shadow:var(--wu-control-focus-shadow)}.wu-editor-area.wu-editor-empty:before{content:attr(data-placeholder);position:absolute;top:var(--wu-editor-content-padding-y);right:var(--wu-editor-content-padding-x);left:var(--wu-editor-content-padding-x);color:var(--wu-field-placeholder);pointer-events:none}.wu-editor-disabled .wu-editor-area{opacity:var(--wu-disabled-opacity)}.wu-editor-readonly .wu-editor-area{background:var(--wu-editor-toolbar-bg)}.wu-editor-source{box-sizing:border-box;width:100%;min-height:var(--wu-editor-content-min-height);resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;line-height:1.5}.wu-editor-content{line-height:1.6;overflow-wrap:break-word;white-space:pre-wrap;tab-size:4}.wu-editor-view{display:block;color:var(--wu-text)}.wu-editor-content:after{content:\"\";display:table;clear:both}.wu-editor-content>:first-child{margin-top:0}.wu-editor-content :is(p,ol,ul,pre,blockquote,h1,h2,h3,h4,h5,h6){margin:0;padding:0}.wu-editor-content h1{font-size:2em;line-height:1.25}.wu-editor-content h2{font-size:1.5em;line-height:1.3}.wu-editor-content h3{font-size:1.25em}.wu-editor-content h4{font-size:1.1em}.wu-editor-content :is(h1,h2,h3,h4,h5,h6){font-weight:600}.wu-editor-content :is(ol,ul){padding-left:1.5em}.wu-editor-content li>:is(ol,ul){margin:0}.wu-editor-content blockquote{margin:.5em 0;padding:.25em 0 .25em 1em;border-left:4px solid var(--wu-border);color:var(--wu-text-muted)}.wu-editor-content pre{margin:.5em 0;padding:.75em 1em;border-radius:var(--wu-radius-sm);background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;white-space:pre-wrap;overflow-x:auto}.wu-editor-content code{padding:.1em .3em;border-radius:3px;background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-content pre code{padding:0;background:none;font-size:inherit}.wu-editor-content a{color:var(--wu-primary-color);text-decoration:underline}.wu-editor-content hr{margin:1em 0;border:0;border-top:1px solid var(--wu-border)}.wu-editor-content img{max-width:100%;height:auto;vertical-align:bottom}.wu-editor-content img.wu-image-left{float:left;margin:.25em 1em .5em 0}.wu-editor-content img.wu-image-right{float:right;margin:.25em 0 .5em 1em}.wu-editor-content img.wu-image-center{display:block;margin:.5em auto}.wu-editor-content table{margin:.5em 0;border-collapse:collapse;max-width:100%}.wu-editor-content :is(td,th){min-width:2.5em;padding:.375em .5em;border:1px solid var(--wu-border);text-align:start;vertical-align:top}.wu-editor-content th{background:var(--wu-hover-bg);font-weight:600}.wu-editor-content table:has(> colgroup){table-layout:fixed}.wu-editor-content :is(td,th){overflow-wrap:anywhere}.wu-editor-area .wu-editor-cell-picked{background:color-mix(in srgb,var(--wu-primary-color) 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--wu-primary-color) 60%,transparent)}.wu-editor-picking ::selection{background:transparent}.wu-editor-col-resize,.wu-editor-col-resize *,.wu-editor-resizing,.wu-editor-resizing *{cursor:col-resize!important}.wu-editor-resizing{-webkit-user-select:none;user-select:none}.wu-editor-content .ql-align-center{text-align:center}.wu-editor-content .ql-align-right{text-align:right}.wu-editor-content .ql-align-justify{text-align:justify}.wu-editor-content .ql-size-small{font-size:.75em}.wu-editor-content .ql-size-large{font-size:1.5em}.wu-editor-content .ql-size-huge{font-size:2.5em}.wu-editor-content .ql-font-serif{font-family:Georgia,Times New Roman,serif}.wu-editor-content .ql-font-monospace{font-family:Monaco,Courier New,monospace}.wu-editor-content .ql-indent-1{padding-left:3em}.wu-editor-content .ql-indent-2{padding-left:6em}.wu-editor-content .ql-indent-3{padding-left:9em}.wu-editor-content .ql-indent-4{padding-left:12em}.wu-editor-content .ql-indent-5{padding-left:15em}.wu-editor-content .ql-indent-6{padding-left:18em}.wu-editor-content .ql-indent-7{padding-left:21em}.wu-editor-content .ql-indent-8{padding-left:24em}.wu-editor-content li.ql-indent-1{margin-left:3em;padding-left:0}.wu-editor-content li.ql-indent-2{margin-left:6em;padding-left:0}.wu-editor-content li.ql-indent-3{margin-left:9em;padding-left:0}.wu-editor-content li.ql-indent-4{margin-left:12em;padding-left:0}.wu-editor-area img.wu-image-selected{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-area img.wu-image-uploading{opacity:.5;animation:wu-editor-pulse 1.2s ease-in-out infinite}.wu-editor-area :is(td,th):focus-within{outline:2px solid color-mix(in srgb,var(--wu-primary-color) 45%,transparent);outline-offset:-2px}.wu-editor-image-frame{position:absolute;box-sizing:border-box;pointer-events:none}.wu-editor-image-handle{position:absolute;right:-7px;bottom:-7px;box-sizing:border-box;width:14px;height:14px;border:2px solid var(--wu-card-bg);border-radius:3px;background:var(--wu-primary-color);cursor:nwse-resize;pointer-events:auto;touch-action:none}.wu-editor-readonly .wu-editor-image-frame,.wu-editor-disabled .wu-editor-image-frame{display:none!important}.wu-editor-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;padding:.375rem .125rem 0;font-size:.8125em;color:var(--wu-text-muted)}.wu-editor-count{margin-left:auto}.wu-editor-notice{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .5rem;border-radius:var(--wu-radius-sm);background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-notice-close{padding:0 .25rem;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.wu-editor.wu-editor-fullscreen{position:fixed;inset:0;z-index:1100;box-sizing:border-box;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:.75rem;border:0;overflow:hidden;background:var(--wu-ground, var(--wu-card-bg));color:var(--wu-text)}.wu-editor-fullscreen .wu-editor-area,.wu-editor-fullscreen .wu-editor-source{flex:1 1 auto;height:auto!important;max-height:none!important}.wu-editor-panel{position:fixed;inset:auto;z-index:1200;box-sizing:border-box;max-width:min(24rem,calc(100vw - 1rem));margin:0;padding:.375rem;overflow:auto;border:1px solid var(--wu-border);border-radius:var(--wu-radius-md);background:var(--wu-card-bg);color:var(--wu-text);box-shadow:var(--wu-shadow-md);font-family:var(--wu-font-family);font-size:var(--wu-font-size)}.wu-editor-menu{display:flex;flex-direction:column;gap:2px;min-width:11rem}.wu-editor-menu-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.4375rem .625rem;border:0;border-radius:var(--wu-radius-sm);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}.wu-editor-menu-item:not(:disabled):hover,.wu-editor-menu-item:focus-visible{background:var(--wu-editor-tool-hover-bg);outline:none}.wu-editor-menu-item[aria-checked=true]{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-menu-item:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-menu-danger{color:var(--wu-danger-color)}.wu-editor-menu-sep{height:1px;margin:.25rem 0;background:var(--wu-border)}.wu-editor-block-1{font-size:1.5em;font-weight:600}.wu-editor-block-2{font-size:1.3em;font-weight:600}.wu-editor-block-3{font-size:1.15em;font-weight:600}.wu-editor-block-4{font-size:1.05em;font-weight:600}.wu-editor-block-5{font-weight:600}.wu-editor-block-6{font-size:.875em;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.wu-editor-block-blockquote{border-left:3px solid var(--wu-border);font-style:italic}.wu-editor-block-codeBlock{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-palette{display:flex;flex-direction:column;gap:.375rem;width:14.5rem}.wu-editor-swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:.375rem}.wu-editor-swatch{box-sizing:border-box;width:100%;aspect-ratio:1;padding:0;border:1px solid color-mix(in srgb,var(--wu-text) 18%,transparent);border-radius:var(--wu-radius-sm);cursor:pointer}.wu-editor-palette-none .wu-editor-swatch{width:1.25rem;flex:none}.wu-editor-swatch-none{background:linear-gradient(135deg,transparent 45%,var(--wu-danger-color) 45%,var(--wu-danger-color) 55%,transparent 55%),var(--wu-card-bg)}.wu-editor-swatch:hover,.wu-editor-swatch:focus-visible{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-custom-color{display:flex;align-items:center;gap:.5rem;font-size:.875em;cursor:pointer}.wu-editor-custom-color input{width:2rem;height:1.75rem;padding:0;border:0;background:none;cursor:pointer}.wu-editor-form,.wu-editor-image-form{display:flex;flex-direction:column;gap:.625rem;width:min(20rem,calc(100vw - 2.5rem));padding:.25rem}.wu-editor-field{display:flex;flex-direction:column;gap:.25rem;font-size:.875em}.wu-editor-field .wu-inputtext{width:100%;box-sizing:border-box}.wu-editor-check{display:flex;align-items:center;gap:.5rem;font-size:.875em}.wu-editor-form-error{color:var(--wu-danger-color);font-size:.875em}.wu-editor-form-actions{display:flex;justify-content:flex-end;gap:.5rem}.wu-editor-tabs{display:flex;gap:.25rem;border-bottom:1px solid var(--wu-border)}.wu-editor-tab{margin-bottom:-1px;padding:.375rem .75rem;border:0;border-bottom:2px solid transparent;background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;cursor:pointer}.wu-editor-tab[aria-selected=true]{border-bottom-color:var(--wu-primary-color);color:var(--wu-primary-color);font-weight:600}.wu-editor-drop{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.25rem .75rem;border:1.5px dashed var(--wu-field-border);border-radius:var(--wu-radius-md);background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;text-align:center;cursor:pointer}.wu-editor-drop:hover,.wu-editor-drop:focus-visible{border-color:var(--wu-primary-color);color:var(--wu-primary-color);outline:none}.wu-editor-drop .wu-editor-icon{width:1.75rem;height:1.75rem}.wu-editor-grid{display:flex;flex-direction:column;gap:3px;padding:.125rem;outline:none}.wu-editor-grid-row{display:flex;gap:3px}.wu-editor-grid-cell{width:1.125rem;height:1.125rem;padding:0;border:1px solid var(--wu-field-border);border-radius:2px;background:var(--wu-field-bg);cursor:pointer}.wu-editor-grid-cell.wu-editor-grid-on{border-color:var(--wu-primary-color);background:color-mix(in srgb,var(--wu-primary-color) 22%,var(--wu-field-bg))}.wu-editor-grid:focus-visible{outline:var(--wu-control-focus-outline)}.wu-editor-grid-label{padding-top:.25rem;font-size:.8125em;text-align:center;color:var(--wu-text-muted)}.wu-editor-table-insert{display:flex;flex-direction:column;gap:.75rem}.wu-editor-table-size{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem;padding-top:.75rem;border-top:1px solid var(--wu-border)}.wu-editor-table-size-field{display:flex;flex-direction:column;gap:.25rem;min-width:0;color:var(--wu-text-muted);font-size:.875em}.wu-editor-table-size-field .wu-inputtext{box-sizing:border-box;width:100%;min-width:0}.wu-editor-table-size-header,.wu-editor-table-size-insert{grid-column:1 / -1}.wu-editor-table-size-insert{justify-self:end}.wu-editor-balloon{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem}.wu-editor-balloon-group{display:inline-flex;gap:2px}.wu-editor-balloon-group+.wu-editor-balloon-group{padding-left:.25rem;border-left:1px solid var(--wu-border)}.wu-editor-balloon-link{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:0 .375rem;color:var(--wu-primary-color);text-decoration:none}.wu-editor-balloon-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wu-editor-alt{width:9rem;min-width:0;height:var(--wu-editor-tool-size);box-sizing:border-box;font-size:.875em}@keyframes wu-editor-pulse{50%{opacity:.25}}@media (prefers-reduced-motion: reduce){.wu-editor-tool,.wu-editor-area{transition:none}.wu-editor-area img.wu-image-uploading{animation:none}}}\n"] }]
|
|
3055
|
+
}] });
|
|
3056
|
+
|
|
3057
|
+
/** Generated by tools/sync-sources.mjs from packages/styles/editor.css. */
|
|
3058
|
+
const WU_EDITOR_CSS = "/* wu-editor and wuEditorContent. Shared by wiraui v1, v2 and v3. A light toolbar of grouped icon buttons over a\n framed writing area, its menus in the top layer. Content keeps the spacing and class names of values saved with\n the earlier editor (paragraphs without margins, ql-align-*, ql-indent-*, ql-size-*, ql-font-*), so old and new\n content look the same in the editor and wherever wuEditorContent shows it. */\n@layer wiraui.components {\n wu-editor {\n display: block;\n max-width: 100%;\n }\n .wu-editor {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n font-family: var(--wu-font-family);\n font-size: var(--wu-font-size);\n color: var(--wu-text);\n }\n .wu-editor-hidden,\n .wu-editor-file {\n display: none !important;\n }\n\n /* ---------- toolbar ---------- */\n .wu-editor-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.25rem;\n padding: var(--wu-editor-toolbar-padding);\n border: 1px solid var(--wu-field-border);\n border-bottom-color: var(--wu-border);\n border-radius: var(--wu-editor-radius) var(--wu-editor-radius) 0 0;\n background: var(--wu-editor-toolbar-bg);\n }\n .wu-editor-sticky .wu-editor-toolbar {\n position: sticky;\n top: var(--wu-editor-sticky-top, 0px);\n z-index: 2;\n }\n .wu-editor-group,\n .wu-editor-toolbar .ql-formats {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 2px;\n }\n .wu-editor-group + .wu-editor-group,\n .wu-editor-toolbar .ql-formats + .ql-formats {\n margin-left: 0.125rem;\n padding-left: 0.375rem;\n border-left: 1px solid var(--wu-border);\n }\n .wu-editor-tool,\n .wu-editor-toolbar .ql-formats > button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n box-sizing: border-box;\n min-width: var(--wu-editor-tool-size);\n height: var(--wu-editor-tool-size);\n margin: 0;\n padding: 0 0.375rem;\n border: 0;\n border-radius: var(--wu-editor-tool-radius);\n background: transparent;\n color: var(--wu-text);\n font: inherit;\n font-size: 0.875em;\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n transition:\n background-color var(--wu-transition),\n color var(--wu-transition);\n }\n .wu-editor-tool:not(:disabled):hover {\n background: var(--wu-editor-tool-hover-bg);\n }\n .wu-editor-tool.wu-editor-tool-on,\n .wu-editor-tool.wu-editor-tool-open {\n background: var(--wu-editor-tool-on-bg);\n color: var(--wu-editor-tool-on-color);\n }\n .wu-editor-tool:disabled {\n opacity: var(--wu-disabled-opacity);\n cursor: default;\n }\n .wu-editor-tool:focus-visible {\n outline: var(--wu-control-focus-outline);\n outline-offset: -1px;\n }\n .wu-editor-icon-wrap,\n .wu-editor-chevron-wrap {\n display: inline-flex;\n }\n .wu-editor-icon {\n width: 1.25rem;\n height: 1.25rem;\n }\n .wu-editor-chevron {\n width: 0.875rem;\n height: 0.875rem;\n opacity: 0.7;\n }\n .wu-editor-dropdown {\n justify-content: space-between;\n padding: 0 0.375rem 0 0.5rem;\n }\n .wu-editor-dropdown-label {\n min-width: 4.5rem;\n max-width: 9rem;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n }\n .wu-editor-heading-mark {\n font-weight: 700;\n font-size: 0.875em;\n }\n .wu-editor-tool-text {\n font-size: 0.8125em;\n }\n .wu-editor-tool-danger:not(:disabled):hover {\n background: var(--wu-danger-bg);\n color: var(--wu-danger-text);\n }\n\n /* ---------- writing area ---------- */\n .wu-editor-body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n min-height: 0;\n }\n .wu-editor-area {\n position: relative;\n box-sizing: border-box;\n min-height: var(--wu-editor-content-min-height);\n padding: var(--wu-editor-content-padding-y) var(--wu-editor-content-padding-x);\n border: 1px solid var(--wu-field-border);\n border-radius: var(--wu-editor-radius);\n background: var(--wu-field-bg);\n outline: none;\n overflow: auto;\n overscroll-behavior: contain;\n transition:\n border-color var(--wu-transition),\n box-shadow var(--wu-transition);\n }\n .wu-editor-toolbar + .wu-editor-body > .wu-editor-area,\n .wu-editor-toolbar + .wu-editor-body > .wu-editor-source {\n border-top: 0;\n border-radius: 0 0 var(--wu-editor-radius) var(--wu-editor-radius);\n }\n .wu-editor-focused .wu-editor-area {\n border-color: var(--wu-primary-color);\n box-shadow: var(--wu-control-focus-shadow);\n }\n .wu-editor-area.wu-editor-empty::before {\n content: attr(data-placeholder);\n position: absolute;\n top: var(--wu-editor-content-padding-y);\n right: var(--wu-editor-content-padding-x);\n left: var(--wu-editor-content-padding-x);\n color: var(--wu-field-placeholder);\n pointer-events: none;\n }\n .wu-editor-disabled .wu-editor-area {\n opacity: var(--wu-disabled-opacity);\n }\n .wu-editor-readonly .wu-editor-area {\n background: var(--wu-editor-toolbar-bg);\n }\n .wu-editor-source {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--wu-editor-content-min-height);\n resize: vertical;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n line-height: 1.5;\n }\n\n /* ---------- content: in the editor and in wuEditorContent ---------- */\n .wu-editor-content {\n line-height: 1.6;\n overflow-wrap: break-word;\n white-space: pre-wrap;\n tab-size: 4;\n }\n .wu-editor-view {\n display: block;\n color: var(--wu-text);\n }\n .wu-editor-content::after {\n content: '';\n display: table;\n clear: both;\n }\n .wu-editor-content > :first-child {\n margin-top: 0;\n }\n .wu-editor-content :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {\n margin: 0;\n padding: 0;\n }\n .wu-editor-content h1 {\n font-size: 2em;\n line-height: 1.25;\n }\n .wu-editor-content h2 {\n font-size: 1.5em;\n line-height: 1.3;\n }\n .wu-editor-content h3 {\n font-size: 1.25em;\n }\n .wu-editor-content h4 {\n font-size: 1.1em;\n }\n .wu-editor-content :is(h1, h2, h3, h4, h5, h6) {\n font-weight: 600;\n }\n .wu-editor-content :is(ol, ul) {\n padding-left: 1.5em;\n }\n .wu-editor-content li > :is(ol, ul) {\n margin: 0;\n }\n .wu-editor-content blockquote {\n margin: 0.5em 0;\n padding: 0.25em 0 0.25em 1em;\n border-left: 4px solid var(--wu-border);\n color: var(--wu-text-muted);\n }\n .wu-editor-content pre {\n margin: 0.5em 0;\n padding: 0.75em 1em;\n border-radius: var(--wu-radius-sm);\n background: var(--wu-hover-bg);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n white-space: pre-wrap;\n overflow-x: auto;\n }\n .wu-editor-content code {\n padding: 0.1em 0.3em;\n border-radius: 3px;\n background: var(--wu-hover-bg);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n }\n .wu-editor-content pre code {\n padding: 0;\n background: none;\n font-size: inherit;\n }\n .wu-editor-content a {\n color: var(--wu-primary-color);\n text-decoration: underline;\n }\n .wu-editor-content hr {\n margin: 1em 0;\n border: 0;\n border-top: 1px solid var(--wu-border);\n }\n .wu-editor-content img {\n max-width: 100%;\n height: auto;\n vertical-align: bottom;\n }\n .wu-editor-content img.wu-image-left {\n float: left;\n margin: 0.25em 1em 0.5em 0;\n }\n .wu-editor-content img.wu-image-right {\n float: right;\n margin: 0.25em 0 0.5em 1em;\n }\n .wu-editor-content img.wu-image-center {\n display: block;\n margin: 0.5em auto;\n }\n .wu-editor-content table {\n margin: 0.5em 0;\n border-collapse: collapse;\n max-width: 100%;\n }\n .wu-editor-content :is(td, th) {\n min-width: 2.5em;\n padding: 0.375em 0.5em;\n border: 1px solid var(--wu-border);\n text-align: start;\n vertical-align: top;\n }\n .wu-editor-content th {\n background: var(--wu-hover-bg);\n font-weight: 600;\n }\n /* Column widths in % (set when the table is made or a column is dragged) are kept: the table follows the page width. */\n .wu-editor-content table:has(> colgroup) {\n table-layout: fixed;\n }\n .wu-editor-content :is(td, th) {\n overflow-wrap: anywhere;\n }\n /* Cells picked by dragging across them, for merging; the browser's own highlight hides meanwhile. */\n .wu-editor-area .wu-editor-cell-picked {\n background: color-mix(in srgb, var(--wu-primary-color) 14%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wu-primary-color) 60%, transparent);\n }\n .wu-editor-picking ::selection {\n background: transparent;\n }\n /* A column's right edge resizes it. */\n .wu-editor-col-resize,\n .wu-editor-col-resize *,\n .wu-editor-resizing,\n .wu-editor-resizing * {\n cursor: col-resize !important;\n }\n .wu-editor-resizing {\n user-select: none;\n }\n .wu-editor-content .ql-align-center {\n text-align: center;\n }\n .wu-editor-content .ql-align-right {\n text-align: right;\n }\n .wu-editor-content .ql-align-justify {\n text-align: justify;\n }\n .wu-editor-content .ql-size-small {\n font-size: 0.75em;\n }\n .wu-editor-content .ql-size-large {\n font-size: 1.5em;\n }\n .wu-editor-content .ql-size-huge {\n font-size: 2.5em;\n }\n .wu-editor-content .ql-font-serif {\n font-family: Georgia, 'Times New Roman', serif;\n }\n .wu-editor-content .ql-font-monospace {\n font-family: Monaco, 'Courier New', monospace;\n }\n .wu-editor-content .ql-indent-1 { padding-left: 3em; }\n .wu-editor-content .ql-indent-2 { padding-left: 6em; }\n .wu-editor-content .ql-indent-3 { padding-left: 9em; }\n .wu-editor-content .ql-indent-4 { padding-left: 12em; }\n .wu-editor-content .ql-indent-5 { padding-left: 15em; }\n .wu-editor-content .ql-indent-6 { padding-left: 18em; }\n .wu-editor-content .ql-indent-7 { padding-left: 21em; }\n .wu-editor-content .ql-indent-8 { padding-left: 24em; }\n .wu-editor-content li.ql-indent-1 { margin-left: 3em; padding-left: 0; }\n .wu-editor-content li.ql-indent-2 { margin-left: 6em; padding-left: 0; }\n .wu-editor-content li.ql-indent-3 { margin-left: 9em; padding-left: 0; }\n .wu-editor-content li.ql-indent-4 { margin-left: 12em; padding-left: 0; }\n /* Inside the editor: the picture being edited and pictures still uploading. */\n .wu-editor-area img.wu-image-selected {\n outline: 2px solid var(--wu-primary-color);\n outline-offset: 1px;\n }\n .wu-editor-area img.wu-image-uploading {\n opacity: 0.5;\n animation: wu-editor-pulse 1.2s ease-in-out infinite;\n }\n .wu-editor-area :is(td, th):focus-within {\n outline: 2px solid color-mix(in srgb, var(--wu-primary-color) 45%, transparent);\n outline-offset: -2px;\n }\n\n /* Picture resize frame. */\n .wu-editor-image-frame {\n position: absolute;\n box-sizing: border-box;\n pointer-events: none;\n }\n .wu-editor-image-handle {\n position: absolute;\n right: -7px;\n bottom: -7px;\n box-sizing: border-box;\n width: 14px;\n height: 14px;\n border: 2px solid var(--wu-card-bg);\n border-radius: 3px;\n background: var(--wu-primary-color);\n cursor: nwse-resize;\n pointer-events: auto;\n touch-action: none;\n }\n .wu-editor-readonly .wu-editor-image-frame,\n .wu-editor-disabled .wu-editor-image-frame {\n display: none !important;\n }\n\n /* ---------- footer ---------- */\n .wu-editor-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n padding: 0.375rem 0.125rem 0;\n font-size: 0.8125em;\n color: var(--wu-text-muted);\n }\n .wu-editor-count {\n margin-left: auto;\n }\n .wu-editor-notice {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.25rem 0.5rem;\n border-radius: var(--wu-radius-sm);\n background: var(--wu-danger-bg);\n color: var(--wu-danger-text);\n }\n .wu-editor-notice-close {\n padding: 0 0.25rem;\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n\n /* ---------- full screen ---------- */\n .wu-editor.wu-editor-fullscreen {\n position: fixed;\n inset: 0;\n z-index: 1100;\n box-sizing: border-box;\n width: 100%;\n max-width: none;\n height: 100%;\n max-height: none;\n margin: 0;\n padding: 0.75rem;\n border: 0;\n overflow: hidden;\n background: var(--wu-ground, var(--wu-card-bg));\n color: var(--wu-text);\n }\n .wu-editor-fullscreen .wu-editor-area,\n .wu-editor-fullscreen .wu-editor-source {\n flex: 1 1 auto;\n height: auto !important;\n max-height: none !important;\n }\n\n /* ---------- menus and balloons (top layer) ---------- */\n .wu-editor-panel {\n position: fixed;\n inset: auto;\n z-index: 1200;\n box-sizing: border-box;\n max-width: min(24rem, calc(100vw - 1rem));\n margin: 0;\n padding: 0.375rem;\n overflow: auto;\n border: 1px solid var(--wu-border);\n border-radius: var(--wu-radius-md);\n background: var(--wu-card-bg);\n color: var(--wu-text);\n box-shadow: var(--wu-shadow-md);\n font-family: var(--wu-font-family);\n font-size: var(--wu-font-size);\n }\n .wu-editor-menu {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 11rem;\n }\n .wu-editor-menu-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.4375rem 0.625rem;\n border: 0;\n border-radius: var(--wu-radius-sm);\n background: none;\n color: inherit;\n font: inherit;\n text-align: start;\n cursor: pointer;\n }\n .wu-editor-menu-item:not(:disabled):hover,\n .wu-editor-menu-item:focus-visible {\n background: var(--wu-editor-tool-hover-bg);\n outline: none;\n }\n .wu-editor-menu-item[aria-checked='true'] {\n background: var(--wu-editor-tool-on-bg);\n color: var(--wu-editor-tool-on-color);\n }\n .wu-editor-menu-item:disabled {\n opacity: var(--wu-disabled-opacity);\n cursor: default;\n }\n .wu-editor-menu-danger {\n color: var(--wu-danger-color);\n }\n .wu-editor-menu-sep {\n height: 1px;\n margin: 0.25rem 0;\n background: var(--wu-border);\n }\n .wu-editor-block-1 {\n font-size: 1.5em;\n font-weight: 600;\n }\n .wu-editor-block-2 {\n font-size: 1.3em;\n font-weight: 600;\n }\n .wu-editor-block-3 {\n font-size: 1.15em;\n font-weight: 600;\n }\n .wu-editor-block-4 {\n font-size: 1.05em;\n font-weight: 600;\n }\n .wu-editor-block-5 {\n font-weight: 600;\n }\n .wu-editor-block-6 {\n font-size: 0.875em;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.02em;\n }\n /* Quote and code block shown as they look in the text. */\n .wu-editor-block-blockquote {\n border-left: 3px solid var(--wu-border);\n font-style: italic;\n }\n .wu-editor-block-codeBlock {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n }\n .wu-editor-palette {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n width: 14.5rem;\n }\n .wu-editor-swatches {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 0.375rem;\n }\n .wu-editor-swatch {\n box-sizing: border-box;\n width: 100%;\n aspect-ratio: 1;\n padding: 0;\n border: 1px solid color-mix(in srgb, var(--wu-text) 18%, transparent);\n border-radius: var(--wu-radius-sm);\n cursor: pointer;\n }\n .wu-editor-palette-none .wu-editor-swatch {\n width: 1.25rem;\n flex: none;\n }\n .wu-editor-swatch-none {\n background: linear-gradient(135deg, transparent 45%, var(--wu-danger-color) 45%, var(--wu-danger-color) 55%, transparent 55%), var(--wu-card-bg);\n }\n .wu-editor-swatch:hover,\n .wu-editor-swatch:focus-visible {\n outline: 2px solid var(--wu-primary-color);\n outline-offset: 1px;\n }\n .wu-editor-custom-color {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 0.875em;\n cursor: pointer;\n }\n .wu-editor-custom-color input {\n width: 2rem;\n height: 1.75rem;\n padding: 0;\n border: 0;\n background: none;\n cursor: pointer;\n }\n .wu-editor-form,\n .wu-editor-image-form {\n display: flex;\n flex-direction: column;\n gap: 0.625rem;\n width: min(20rem, calc(100vw - 2.5rem));\n padding: 0.25rem;\n }\n .wu-editor-field {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n font-size: 0.875em;\n }\n .wu-editor-field .wu-inputtext {\n width: 100%;\n box-sizing: border-box;\n }\n .wu-editor-check {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 0.875em;\n }\n .wu-editor-form-error {\n color: var(--wu-danger-color);\n font-size: 0.875em;\n }\n .wu-editor-form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n }\n .wu-editor-tabs {\n display: flex;\n gap: 0.25rem;\n border-bottom: 1px solid var(--wu-border);\n }\n .wu-editor-tab {\n margin-bottom: -1px;\n padding: 0.375rem 0.75rem;\n border: 0;\n border-bottom: 2px solid transparent;\n background: none;\n color: var(--wu-text-muted);\n font: inherit;\n font-size: 0.875em;\n cursor: pointer;\n }\n .wu-editor-tab[aria-selected='true'] {\n border-bottom-color: var(--wu-primary-color);\n color: var(--wu-primary-color);\n font-weight: 600;\n }\n .wu-editor-drop {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.5rem;\n padding: 1.25rem 0.75rem;\n border: 1.5px dashed var(--wu-field-border);\n border-radius: var(--wu-radius-md);\n background: none;\n color: var(--wu-text-muted);\n font: inherit;\n font-size: 0.875em;\n text-align: center;\n cursor: pointer;\n }\n .wu-editor-drop:hover,\n .wu-editor-drop:focus-visible {\n border-color: var(--wu-primary-color);\n color: var(--wu-primary-color);\n outline: none;\n }\n .wu-editor-drop .wu-editor-icon {\n width: 1.75rem;\n height: 1.75rem;\n }\n .wu-editor-grid {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 0.125rem;\n outline: none;\n }\n .wu-editor-grid-row {\n display: flex;\n gap: 3px;\n }\n .wu-editor-grid-cell {\n width: 1.125rem;\n height: 1.125rem;\n padding: 0;\n border: 1px solid var(--wu-field-border);\n border-radius: 2px;\n background: var(--wu-field-bg);\n cursor: pointer;\n }\n .wu-editor-grid-cell.wu-editor-grid-on {\n border-color: var(--wu-primary-color);\n background: color-mix(in srgb, var(--wu-primary-color) 22%, var(--wu-field-bg));\n }\n .wu-editor-grid:focus-visible {\n outline: var(--wu-control-focus-outline);\n }\n .wu-editor-grid-label {\n padding-top: 0.25rem;\n font-size: 0.8125em;\n text-align: center;\n color: var(--wu-text-muted);\n }\n /* The insert-table panel: the grid, then the size typed in. */\n .wu-editor-table-insert {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n }\n .wu-editor-table-size {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n gap: 0.5rem;\n padding-top: 0.75rem;\n border-top: 1px solid var(--wu-border);\n }\n .wu-editor-table-size-field {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n min-width: 0;\n color: var(--wu-text-muted);\n font-size: 0.875em;\n }\n .wu-editor-table-size-field .wu-inputtext {\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n }\n .wu-editor-table-size-header,\n .wu-editor-table-size-insert {\n grid-column: 1 / -1;\n }\n .wu-editor-table-size-insert {\n justify-self: end;\n }\n .wu-editor-balloon {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.25rem;\n }\n .wu-editor-balloon-group {\n display: inline-flex;\n gap: 2px;\n }\n .wu-editor-balloon-group + .wu-editor-balloon-group {\n padding-left: 0.25rem;\n border-left: 1px solid var(--wu-border);\n }\n .wu-editor-balloon-link {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n max-width: 14rem;\n padding: 0 0.375rem;\n color: var(--wu-primary-color);\n text-decoration: none;\n }\n .wu-editor-balloon-url {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .wu-editor-alt {\n width: 9rem;\n min-width: 0;\n height: var(--wu-editor-tool-size);\n box-sizing: border-box;\n font-size: 0.875em;\n }\n @keyframes wu-editor-pulse {\n 50% {\n opacity: 0.25;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .wu-editor-tool,\n .wu-editor-area {\n transition: none;\n }\n .wu-editor-area img.wu-image-uploading {\n animation: none;\n }\n }\n}\n";
|
|
3059
|
+
|
|
3060
|
+
/**
|
|
3061
|
+
* Shows saved editor HTML the way the editor drew it (headings, lists, quotes, tables, pictures, the `ql-align-*` /
|
|
3062
|
+
* `ql-indent-*` / `ql-size-*` classes): `<div wuEditorContent [innerHTML]="news.body"></div>`.
|
|
3063
|
+
*/
|
|
3064
|
+
class WuEditorContent {
|
|
3065
|
+
constructor() {
|
|
3066
|
+
inject(ɵWuStyleLoader).load('editor', WU_EDITOR_CSS);
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
WuEditorContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3070
|
+
WuEditorContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: WuEditorContent, isStandalone: true, selector: "[wuEditorContent]", host: { classAttribute: "wu-editor-content wu-editor-view" }, ngImport: i0 });
|
|
3071
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorContent, decorators: [{
|
|
3072
|
+
type: Directive,
|
|
3073
|
+
args: [{
|
|
3074
|
+
selector: '[wuEditorContent]',
|
|
3075
|
+
standalone: true,
|
|
3076
|
+
host: { class: 'wu-editor-content wu-editor-view' },
|
|
3077
|
+
}]
|
|
3078
|
+
}], ctorParameters: function () { return []; } });
|
|
3079
|
+
|
|
3080
|
+
/** For NgModule apps: the editor, `wuEditorContent` for showing saved HTML, and `wuTemplate` (`pTemplate`). */
|
|
3081
|
+
class WuEditorModule {
|
|
3082
|
+
}
|
|
3083
|
+
WuEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3084
|
+
WuEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, imports: [WuEditor, WuEditorContent, WuTemplate], exports: [WuEditor, WuEditorContent, WuTemplate] });
|
|
3085
|
+
WuEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, imports: [WuEditor] });
|
|
3086
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, decorators: [{
|
|
3087
|
+
type: NgModule,
|
|
3088
|
+
args: [{
|
|
3089
|
+
imports: [WuEditor, WuEditorContent, WuTemplate],
|
|
3090
|
+
exports: [WuEditor, WuEditorContent, WuTemplate],
|
|
3091
|
+
}]
|
|
3092
|
+
}] });
|
|
3093
|
+
|
|
3094
|
+
/**
|
|
3095
|
+
* Generated bundle index. Do not edit.
|
|
3096
|
+
*/
|
|
3097
|
+
|
|
3098
|
+
export { WU_EDITOR_OPTIONS, WuEditor, WuEditorContent, WuEditorModule, cleanEditorHtml, provideEditorOptions, ɵWuEditorBase };
|
|
3099
|
+
//# sourceMappingURL=wirabyte-ui-editor.mjs.map
|