@ncino/web-components 8.0.0 → 8.1.0-preview.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index_html.js +1 -1
- package/dist/_virtual/index_react.js +1 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@46.1.1/node_modules/ckeditor5/dist/ckeditor5.css +1 -4
- package/dist/components/accordion/gator/base/accordion.gator.js +1 -1
- package/dist/components/accordion/gator/group/accordion-group.gator.js +1 -1
- package/dist/components/alert/gator/base/alert.gator.js +1 -1
- package/dist/components/alert/gator/subtitle/alert-subtitle.gator.js +1 -1
- package/dist/components/alert/gator/title/alert-title.gator.js +1 -1
- package/dist/components/avatar/gator/avatar.gator.js +1 -1
- package/dist/components/badge/gator/badge.gator.js +1 -1
- package/dist/components/banner/gator/banner.gator.js +1 -1
- package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.js +10 -4
- package/dist/components/button/gator/button.gator.js +1 -1
- package/dist/components/button-card/gator/button-card.gator.js +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/gator/base/card.gator.js +1 -1
- package/dist/components/card/gator/content/card-content.gator.js +1 -1
- package/dist/components/card/gator/footer/card-footer.gator.js +1 -1
- package/dist/components/card/gator/header/card-header.gator.js +1 -1
- package/dist/components/checkbox/checkbox.gator.js +1 -1
- package/dist/components/chip/gator/chip.gator.js +1 -1
- package/dist/components/date-picker/base/gator/datepicker.gator.js +1 -1
- package/dist/components/date-picker/year-month-selector/year-month-selector.gator.js +1 -1
- package/dist/components/display-card/gator/display-card.gator.js +1 -1
- package/dist/components/divider/gator/divider.gator.js +2 -2
- package/dist/components/fab/gator/fab.gator.js +1 -1
- package/dist/components/icon-button/gator/icon-button.gator.js +1 -1
- package/dist/components/illustration/gator/illustration.gator.js +1 -1
- package/dist/components/image-card/gator/image-card.gator.js +23 -19
- package/dist/components/input/base/input-base.gator.js +1 -1
- package/dist/components/input/gator/dropdown/input-dropdown.gator.js +15 -15
- package/dist/components/input/gator/help-text/help-text.gator.js +1 -1
- package/dist/components/input/gator/input-date/input-date.gator.js +14 -17
- package/dist/components/input/gator/input-label/input-label.gator.js +3 -3
- package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
- package/dist/components/loading-spinner/gator/loading-spinner.gator.js +1 -1
- package/dist/components/menu/base/gator/menu.gator.js +1 -1
- package/dist/components/modal/gator/modal.gator.js +54 -50
- package/dist/components/page-header/gator/page-header.gator.js +3 -3
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/components/popover/gator/popover.gator.js +1 -1
- package/dist/components/progress-bar/gator/progress-bar.gator.js +18 -12
- package/dist/components/progress-ring/gator/progress-ring.gator.js +1 -1
- package/dist/components/selection-box/selection-box.gator.js +1 -1
- package/dist/components/selector/gator/selector.gator.js +1 -1
- package/dist/components/skeleton-loader/gator/skeleton-loader.gator.js +1 -1
- package/dist/components/switch/gator/switch.gator.js +1 -1
- package/dist/components/table/gator/table.gator.js +1 -1
- package/dist/components/tabs/gator/tabset/tabset.gator.js +1 -1
- package/dist/components/text-detail/gator/text-detail.gator.js +1 -1
- package/dist/components/text-link/gator/text-link.gator.js +1 -1
- package/dist/components/toast/gator/base/toast.gator.js +1 -1
- package/dist/components/toast/gator/subtitle/toast-subtitle.gator.js +1 -1
- package/dist/components/toast/gator/title/toast-title.gator.js +1 -1
- package/dist/components/toast-container/gator/toast-container.gator.js +1 -1
- package/dist/components/toaster/gator/toaster.gator.js +1 -1
- package/dist/components/tooltip/gator/tooltip.gator.js +1 -1
- package/dist/design-tokens.source.json +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-alignment@46.1.1/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autoformat@46.1.1/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autosave@46.1.1/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@46.1.1/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-block-quote@46.1.1/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +2 -14
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-cloud-services@46.1.1/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-code-block@46.1.1/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@46.1.1/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +2 -29
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-enter@46.1.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-essentials@46.1.1/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@46.1.1/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +2 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@46.1.1/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-heading@46.1.1/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-highlight@46.1.1/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-horizontal-line@46.1.1/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@46.1.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@46.1.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@46.1.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@46.1.1/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-language@46.1.1/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@46.1.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@46.1.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -13
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-markdown-gfm@46.1.1/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +2 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@46.1.1/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-mention@46.1.1/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@46.1.1/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paragraph@46.1.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@46.1.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -31
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-remove-format@46.1.1/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-select-all@46.1.1/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-show-blocks@46.1.1/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@46.1.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@46.1.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-style@46.1.1/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@46.1.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -16
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -13
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -25
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-upload@46.1.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +3 -108
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-watchdog@46.1.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/package.json.js +1 -0
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/default-msg.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/deferred.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/fnv1a64.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/locale-status-event.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-controller.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-element.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +1 -5
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1 -17
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +1 -1
- package/dist/node_modules/.pnpm/axe-core@4.11.0/node_modules/axe-core/axe.js +1 -11
- package/dist/node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js +1 -6
- package/dist/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js +1 -217
- package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/conversions.js +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/index.js +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/route.js +1 -0
- package/dist/node_modules/.pnpm/color-string@2.1.4/node_modules/color-string/index.js +1 -0
- package/dist/node_modules/.pnpm/{color@5.0.2 → color@5.0.3}/node_modules/color/index.js +1 -1
- package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js +1 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.26/node_modules/libphonenumber-js/metadata.min.json.js +1 -0
- package/dist/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/async-directive.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/ref.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +1 -5
- package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js +1 -9
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-JVSKG4YS.js +48 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-MM7DTO55.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-OPCDBBL3.js +6 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-SN4J4IQ3.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-VUAFL5XK.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/client-logger/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/core-events/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/instrumenter/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/test/index.js +152 -0
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/index.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +1 -1
- package/dist/packages/{web-components/src/tokens/semantic.tokens.scss.js → styles/src/gator/tokens/semantic.tokens.css.js} +1 -1
- package/dist/packages/web-components/src/components/alert/gator/title/alert-title.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/badge/gator/badge.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/button-card/gator/button-card.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/card/gator/base/card.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/card/gator/content/card-content.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/card/gator/footer/card-footer.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/card/gator/header/card-header.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/checkbox-group/checkbox-group.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/chip/gator/chip.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/date-picker/base/gator/datepicker.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/date-picker/year-month-selector/year-month-selector.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/display-card/gator/display-card.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/divider/gator/divider.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/fab/gator/fab.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/guided-nav/gator/guided-nav-substep/guided-nav-substep.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/headline-card/gator/headline-card.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/icon/gator/icon.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/illustration/gator/illustration.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/image-card/gator/image-card.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/dropdown/input-dropdown.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/help-text/help-text.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/input-date/input-date.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/input-file/file-uploaded-preview/file-upload-preview.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/input-file/input-file.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/input-label/input-label.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/input-search/input-search.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/input.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/list/gator/list-item/list-item.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/menu/base/gator/menu.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/modal/gator/modal.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/page-header/gator/page-header.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/panel/gator/panel.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/popover/gator/popover.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/progress-bar/gator/progress-bar.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/selection-box/selection-box.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/skip-link/gator/base/skip-link.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/skip-link/gator/list-item/skip-link-list-item.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/table/gator/table-bulk-controls/table-bulk-controls.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/table/gator/table-controls/table-controls.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/table/gator/table-pagination/table-pagination.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/table/gator/table.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/tabs/gator/tabs.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/text-detail/gator/text-detail.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/text-link/gator/text-link.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/time-picker/gator/time-picker.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/toast/gator/base/toast.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/toast/gator/title/toast-title.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/toaster/gator/toaster.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/tooltip/gator/tooltip.gator.scss.js +1 -1
- package/dist/packages/web-components/src/index.slds.scss.js +1 -1
- package/dist/types/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.d.ts +3 -5
- package/dist/types/components/image-card/gator/image-card.gator.d.ts +5 -1
- package/dist/types/components/input/gator/input-date/input-date.gator.d.ts +7 -0
- package/dist/types/components/modal/gator/modal.gator.d.ts +16 -3
- package/dist/types/components/page-header/gator/page-header.gator.d.ts +0 -1
- package/dist/types/components/progress-bar/gator/progress-bar.gator.d.ts +8 -0
- package/dist/types/generated/locale-codes.d.ts +10 -0
- package/dist/types/generated/locales/es-419.d.ts +6 -1
- package/dist/types/generated/locales/fr-CA.d.ts +6 -1
- package/dist/types/generated/locales/zh-Hans.d.ts +6 -1
- package/dist/utils/brand-color-utils.js +1 -1
- package/dist/utils/components/ngc-component.js +1 -1
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +21 -21
- package/web-types.json +15 -5
- package/dist/generated/locale-codes.d.js +0 -1
- package/dist/generated/locales/es-419.d.js +0 -1
- package/dist/generated/locales/fr-CA.d.js +0 -1
- package/dist/generated/locales/zh-Hans.d.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.7/node_modules/@figma/code-connect/package.json.js +0 -1
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/metadata.min.json.js +0 -1
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/client-logger/index.js +0 -1
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/core-events/index.js +0 -1
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/instrumenter/index.js +0 -48
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/test/index.js +0 -217
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/fetch.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/index_html.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/react/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/react/index_react.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.9.1_typescript@5.9.3__playwright@1.56.1__f267599ff27ed4cacb9e62a386256df6 → @vitest_browser@3.2.4_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3__playwright@1.56.1_fa5be4b0345b48b65ec4b7072214c2b3}/node_modules/@vitest/browser/context.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/format.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/isPossible.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/metadata.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parse.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -0
- /package/dist/packages/{web-components/src/tokens/primitive.tokens.scss.js → styles/src/gator/tokens/primitive.tokens.css.js} +0 -0
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import{Plugin as p}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{HtmlDataProcessor as _}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as T}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{unified as u}from"../../../../../unified@11.0.5/node_modules/unified/lib/index.js";import k from"../../../../../remark-parse@11.0.0/node_modules/remark-parse/lib/index.js";import h from"../../../../../remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js";import g from"../../../../../remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";import y from"../../../../../remark-rehype@11.1.2/node_modules/remark-rehype/lib/index.js";import D from"../../../../../rehype-dom-stringify@4.0.2/node_modules/rehype-dom-stringify/lib/index.js";import{toHtml as f}from"../../../../../hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js";import{h as P}from"../../../../../hastscript@9.0.1/node_modules/hastscript/lib/index.js";import v from"../../../../../rehype-dom-parse@5.0.2/node_modules/rehype-dom-parse/lib/index.js";import H from"../../../../../rehype-remark@10.0.1/node_modules/rehype-remark/lib/index.js";import M from"../../../../../remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.js";import{visit as m}from"../../../../../unist-util-visit@5.0.0/node_modules/unist-util-visit/lib/index.js";import{fromDom as b}from"../../../../../hast-util-from-dom@5.0.1/node_modules/hast-util-from-dom/lib/index.js"
|
|
2
|
-
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class R{_processor;constructor(){this._processor=u().use(k).use(h,{singleTilde:!0}).use(g).use(y,{allowDangerousHtml:!0}).use(A).use(N).use(D)}parse(e){return this._processor.processSync(e).toString().replaceAll(`
|
|
5
|
-
</code>`,"</code>")}}function N(){return s=>{m(s,"element",e=>{(e.tagName==="ul"||e.tagName==="ol"||e.tagName==="li")&&(e.children=e.children.filter(t=>t.type!=="text"||!!t.value.trim()),delete e.properties.className)})}}function A(){return s=>{m(s,["root","element"],e=>{/* istanbul ignore next -- @preserve */if(!F(e)||!e.children.some(r=>r.type==="raw"))return;const t=document.createElement("template");t.innerHTML=f({type:"root",children:e.children},{allowDangerousHtml:!0}),e.children=Array.from(t.content.childNodes).map(r=>b(r))})}}function F(s){return(s.type==="root"||s.type==="element")&&s.children}class S{_processor;_keepRawTags=[];constructor(){this._buildProcessor()}keep(e){this._keepRawTags.push(e.toLowerCase()),this._buildProcessor()}parse(e){return this._processor.processSync(e).toString().trim()}_getRawTagsHandlers(){return this._keepRawTags.reduce((e,t)=>(e[t]=(r,n)=>{const o=f(P(n.tagName,n.properties),{allowDangerousHtml:!0,closeSelfClosing:!0}),i=o.indexOf(">"),a=o.slice(0,i+1),l=o.slice(i+1);return[{type:"html",value:a},...r.all(n),{type:"html",value:l}]},e),{})}_buildProcessor(){this._processor=u().use(v).use(E).use(H,{handlers:this._getRawTagsHandlers()}).use(h,{singleTilde:!0}).use(g).use(M,{resourceLink:!0,emphasis:"_",rule:"-",handlers:{break:()=>`
|
|
1
|
+
import{Plugin as p}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{HtmlDataProcessor as _}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ClipboardPipeline as T}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{unified as u}from"../../../../../unified@11.0.5/node_modules/unified/lib/index.js";import k from"../../../../../remark-parse@11.0.0/node_modules/remark-parse/lib/index.js";import h from"../../../../../remark-gfm@4.0.1/node_modules/remark-gfm/lib/index.js";import g from"../../../../../remark-breaks@4.0.0/node_modules/remark-breaks/lib/index.js";import y from"../../../../../remark-rehype@11.1.2/node_modules/remark-rehype/lib/index.js";import D from"../../../../../rehype-dom-stringify@4.0.2/node_modules/rehype-dom-stringify/lib/index.js";import{toHtml as f}from"../../../../../hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js";import{h as P}from"../../../../../hastscript@9.0.1/node_modules/hastscript/lib/index.js";import v from"../../../../../rehype-dom-parse@5.0.2/node_modules/rehype-dom-parse/lib/index.js";import H from"../../../../../rehype-remark@10.0.1/node_modules/rehype-remark/lib/index.js";import M from"../../../../../remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.js";import{visit as m}from"../../../../../unist-util-visit@5.0.0/node_modules/unist-util-visit/lib/index.js";import{fromDom as b}from"../../../../../hast-util-from-dom@5.0.1/node_modules/hast-util-from-dom/lib/index.js";class R{_processor;constructor(){this._processor=u().use(k).use(h,{singleTilde:!0}).use(g).use(y,{allowDangerousHtml:!0}).use(A).use(N).use(D)}parse(e){return this._processor.processSync(e).toString().replaceAll(`
|
|
2
|
+
</code>`,"</code>")}}function N(){return s=>{m(s,"element",e=>{(e.tagName==="ul"||e.tagName==="ol"||e.tagName==="li")&&(e.children=e.children.filter(t=>t.type!=="text"||!!t.value.trim()),delete e.properties.className)})}}function A(){return s=>{m(s,["root","element"],e=>{if(!F(e)||!e.children.some(r=>r.type==="raw"))return;const t=document.createElement("template");t.innerHTML=f({type:"root",children:e.children},{allowDangerousHtml:!0}),e.children=Array.from(t.content.childNodes).map(r=>b(r))})}}function F(s){return(s.type==="root"||s.type==="element")&&s.children}class S{_processor;_keepRawTags=[];constructor(){this._buildProcessor()}keep(e){this._keepRawTags.push(e.toLowerCase()),this._buildProcessor()}parse(e){return this._processor.processSync(e).toString().trim()}_getRawTagsHandlers(){return this._keepRawTags.reduce((e,t)=>(e[t]=(r,n)=>{const o=f(P(n.tagName,n.properties),{allowDangerousHtml:!0,closeSelfClosing:!0}),i=o.indexOf(">"),a=o.slice(0,i+1),l=o.slice(i+1);return[{type:"html",value:a},...r.all(n),{type:"html",value:l}]},e),{})}_buildProcessor(){this._processor=u().use(v).use(E).use(H,{handlers:this._getRawTagsHandlers()}).use(h,{singleTilde:!0}).use(g).use(M,{resourceLink:!0,emphasis:"_",rule:"-",handlers:{break:()=>`
|
|
6
3
|
`},unsafe:[{character:"<"}]})}}function E(){return function(s){m(s,"element",(e,t,r)=>{t!==null&&e.tagName==="label"&&r.type==="element"&&r.tagName==="li"&&r.children.splice(t,1,...e.children)})}}class d{_htmlDP;_markdown2html;_html2markdown;constructor(e){this._htmlDP=new _(e),this._markdown2html=new R,this._html2markdown=new S}keepHtml(e){this._html2markdown.keep(e)}toView(e){const t=this._markdown2html.parse(e);return this._htmlDP.toView(t)}toData(e){const t=this._htmlDP.toData(e);return this._html2markdown.parse(t)}registerRawContentMatcher(e){this._htmlDP.registerRawContentMatcher(e)}useFillerType(){}}class X extends p{constructor(e){super(e),e.data.processor=new d(e.data.viewDocument)}static get pluginName(){return"Markdown"}static get isOfficialPlugin(){return!0}}const O=["SPAN","BR","PRE","CODE"];class Y extends p{_gfmDataProcessor;constructor(e){super(e),this._gfmDataProcessor=new d(e.data.viewDocument)}static get pluginName(){return"PasteFromMarkdownExperimental"}static get isOfficialPlugin(){return!0}static get requires(){return[T]}init(){const e=this.editor,r=e.editing.view.document,n=e.plugins.get("ClipboardPipeline");let o=!1;this.listenTo(r,"keydown",(i,a)=>{o=a.shiftKey}),this.listenTo(n,"inputTransformation",(i,a)=>{if(o)return;const l=a.dataTransfer.getData("text/html");if(!l){const w=a.dataTransfer.getData("text/plain");a.content=this._gfmDataProcessor.toView(w);return}const c=this._parseMarkdownFromHtml(l);c&&(a.content=this._gfmDataProcessor.toView(c))})}_parseMarkdownFromHtml(e){const t=this._removeOsSpecificTags(e);if(!this._containsOnlyAllowedFirstLevelTags(t))return null;const r=this._removeFirstLevelWrapperTagsAndBrs(t);return this._containsAnyRemainingHtmlTags(r)?null:this._replaceHtmlReservedEntitiesWithCharacters(r)}_removeOsSpecificTags(e){return e.replace(/^<meta\b[^>]*>/,"").trim().replace(/^<html>/,"").replace(/<\/html>$/,"").trim().replace(/^<body>/,"").replace(/<\/body>$/,"").trim().replace(/^<!--StartFragment-->/,"").replace(/<!--EndFragment-->$/,"").trim()}_containsOnlyAllowedFirstLevelTags(e){const t=new DOMParser,{body:r}=t.parseFromString(e,"text/html");return Array.from(r.children).map(o=>o.tagName).every(o=>O.includes(o))}_removeFirstLevelWrapperTagsAndBrs(e){const t=new DOMParser,{body:r}=t.parseFromString(e,"text/html"),n=r.querySelectorAll("br");for(const i of n)i.replaceWith(`
|
|
7
4
|
`);const o=r.querySelectorAll(":scope > *");for(const i of o){const a=i.cloneNode(!0);i.replaceWith(...a.childNodes)}return r.innerHTML}_containsAnyRemainingHtmlTags(e){return e.includes("<")}_replaceHtmlReservedEntitiesWithCharacters(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/ /g," ")}}export{X as Markdown,d as MarkdownGfmDataProcessor,S as MarkdownGfmHtmlToMd,R as MarkdownGfmMdToHtml,Y as PasteFromMarkdownExperimental};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import{Plugin as h,Command as M}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as T,toWidget as P,findOptimalInsertionRange as k}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{global as w,first as x,logWarning as R,toArray as D,FocusTracker as C,KeystrokeHandler as F}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Dialog as U,ButtonView as S,MenuBarMenuListItemButtonView as L,CssTransitionDisablerMixin as B,IconView as A,Template as N,View as O,submitHandler as $,LabeledFieldView as W,createLabeledInputText as H}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconMedia as q,IconMediaPlaceholder as j}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ModelLivePosition as f,ModelLiveRange as z}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Clipboard as G}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Delete as b}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{Undo as K}from"../../../../../@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*//**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/function _(n,e){const t=(i,o,r)=>{if(!r.consumable.consume(o.item,i.name))return;const a=o.attributeNewValue,s=r.writer,l=r.mapper.toViewElement(o.item),d=[...l.getChildren()].find(u=>u.getCustomProperty("media-content"));s.remove(d);const m=n.getMediaViewElement(s,a,e);s.insert(s.createPositionAt(l,0),m)};return i=>{i.on("attribute:url:media",t)}}function X(n,e,t){return e.setCustomProperty("media",!0,n),P(n,e,{label:t})}function v(n,e,t,i){return n.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(n,t,i),n.createSlot()])}function E(n){const e=n.getSelectedElement();return e&&e.is("element","media")?e:null}function V(n,e,t,i){n.change(o=>{const r=o.createElement("media",{url:e});n.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:i?"auto":void 0})})}class J extends M{refresh(){const e=this.editor.model,t=e.document.selection,i=E(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=Y(t)||Q(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,o=E(i);o?t.change(r=>{r.setAttribute("url",e,o)}):V(t,e,i,!0)}}function Q(n,e){let i=k(n,e).start.parent;return i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent),e.schema.checkChild(i,"media")}function Y(n){const e=n.getSelectedElement();return!!e&&e.name==="media"}const Z="0 0 64 42";class ee{locale;providerDefinitions;constructor(e,t){const i=t.providers,o=t.extraProviders||[],r=new Set(t.removeProviders),a=i.concat(o).filter(s=>{const l=s.name;return l?!r.has(l):(R("media-embed-no-provider-name",{provider:s}),!1)});this.locale=e,this.providerDefinitions=a}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new I(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,o=D(t.url);for(const r of o){const a=this._getUrlMatches(e,r);if(a)return new I(this.locale,e,a,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let o=e.replace(/^https?:\/\//,"");return i=o.match(t),i||(o=o.replace(/^www\./,""),i=o.match(t),i)?i:null}}class I{url;_locale;_match;_previewRenderer;constructor(e,t,i,o){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=o}getViewElement(e,t){const i={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const r=this._getPreviewHtml(t);o=e.createRawElement("div",i,(a,s)=>{s.setContentOf(a,r)})}else this.url&&(i.url=this.url),o=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new A,t=this._locale.t;return e.content=j,e.viewBox=Z,new N({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}class c extends h{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const i=t[1],o=t[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${i}${o?`?start=${o}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new ee(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),s=this.registry;e.commands.add("mediaEmbed",new J(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(l,{writer:d})=>{const m=l.getAttribute("url");return v(d,s,m,{elementName:a,renderMediaPreview:!!m&&r})}}),o.for("dataDowncast").add(_(s,{elementName:a,renderMediaPreview:r})),o.for("editingDowncast").elementToStructure({model:"media",view:(l,{writer:d})=>{const m=l.getAttribute("url"),u=v(d,s,m,{elementName:a,renderForEditingView:!0});return X(u,d,i("media widget"))}}),o.for("editingDowncast").add(_(s,{elementName:a,renderForEditingView:!0})),o.for("upcast").elementToElement({view:l=>["oembed",a].includes(l.name)&&l.getAttribute("url")?{name:!0}:null,model:(l,{writer:d})=>{const m=l.getAttribute("url");return s.hasMedia(m)?d.createElement("media",{url:m}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(l,{writer:d})=>{const m=l.getAttribute("data-oembed-url");return s.hasMedia(m)?d.createElement("media",{url:m}):null}}).add(l=>{const d=(m,u,g)=>{if(!g.consumable.consume(u.viewItem,{name:!0,classes:"media"}))return;const{modelRange:p,modelCursor:y}=g.convertChildren(u.viewItem,u.modelCursor);u.modelRange=p,u.modelCursor=y,x(p.getItems())||g.consumable.revert(u.viewItem,{name:!0,classes:"media"})};l.on("element:figure",d)})}}const te=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class ie extends h{static get requires(){return[G,b,K]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",()=>{const r=t.selection.getFirstRange(),a=f.fromPosition(r.start);a.stickiness="toPrevious";const s=f.fromPosition(r.end);s.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(a,s),a.detach(),s.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(w.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor,o=i.plugins.get(c).registry,r=new z(e,t),a=r.getWalker({ignoreElementEnd:!0});let s="";for(const d of a)d.item.is("$textProxy")&&(s+=d.item.data);if(s=s.trim(),!s.match(te)){r.detach();return}if(!o.hasMedia(s)){r.detach();return}if(!i.commands.get("mediaEmbed").isEnabled){r.detach();return}this._positionToInsert=f.fromPosition(e),this._timeoutId=w.window.setTimeout(()=>{i.model.change(d=>{this._timeoutId=null,d.remove(r),r.detach();let m=null;this._positionToInsert.root.rootName!=="$graveyard"&&(m=this._positionToInsert),V(i.model,s,m,!1),this._positionToInsert.detach(),this._positionToInsert=null}),i.plugins.get(b).requestUndoOnBackspace()},100)}}class oe extends O{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,t){super(t),this.focusTracker=new C,this.keystrokes=new F,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),$({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new W(this.locale,H),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),t}}class re extends h{static get requires(){return[c,U]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",()=>{const t=this.editor.locale.t,i=this._createDialogButton(S);return i.tooltip=!0,i.label=t("Insert media"),i}),e.ui.componentFactory.add("menuBar:mediaEmbed",()=>{const t=this.editor.locale.t,i=this._createDialogButton(L);return i.label=t("Media"),i})}_createDialogButton(e){const t=this.editor,i=new e(t.locale),o=t.commands.get("mediaEmbed"),r=this.editor.plugins.get("Dialog");return i.icon=q,i.bind("isEnabled").to(o,"isEnabled"),i.on("execute",()=>{r.id==="mediaEmbed"?r.hide():this._showDialog()}),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),o=e.locale.t,r=i.value!==void 0;if(!this._formView){const a=e.plugins.get(c).registry;this._formView=new(B(oe))(ne(e.t,a),e.locale),this._formView.on("submit",()=>this._handleSubmitForm())}t.show({id:"mediaEmbed",title:o("Media embed"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:o("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:o(r?"Save":"Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}function ne(n,e){return[t=>{if(!t.url.length)return n("The URL must not be empty.")},t=>{if(!e.hasMedia(t.url))return n("This media URL is not supported.")}]}class pe extends h{static get requires(){return[c,re,ie,T]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}}export{ie as AutoMediaEmbed,pe as MediaEmbed,J as MediaEmbedCommand,c as MediaEmbedEditing,re as MediaEmbedUI,ee as MediaRegistry,oe as _MediaFormView,v as _createMediaFigureElement,E as _getSelectedMediaModelWidget,V as _insertMedia,_ as _modelToViewUrlAttributeMediaConverter,X as _toMediaWidget};
|
|
1
|
+
import{Plugin as h,Command as M}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as T,toWidget as P,findOptimalInsertionRange as k}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{global as w,first as x,logWarning as R,toArray as D,FocusTracker as C,KeystrokeHandler as F}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Dialog as U,ButtonView as S,MenuBarMenuListItemButtonView as L,CssTransitionDisablerMixin as B,IconView as A,Template as N,View as O,submitHandler as $,LabeledFieldView as W,createLabeledInputText as H}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconMedia as q,IconMediaPlaceholder as j}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ModelLivePosition as f,ModelLiveRange as z}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Clipboard as G}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{Delete as b}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{Undo as K}from"../../../../../@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";function _(n,e){const t=(i,o,r)=>{if(!r.consumable.consume(o.item,i.name))return;const a=o.attributeNewValue,s=r.writer,l=r.mapper.toViewElement(o.item),d=[...l.getChildren()].find(u=>u.getCustomProperty("media-content"));s.remove(d);const m=n.getMediaViewElement(s,a,e);s.insert(s.createPositionAt(l,0),m)};return i=>{i.on("attribute:url:media",t)}}function X(n,e,t){return e.setCustomProperty("media",!0,n),P(n,e,{label:t})}function v(n,e,t,i){return n.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(n,t,i),n.createSlot()])}function E(n){const e=n.getSelectedElement();return e&&e.is("element","media")?e:null}function V(n,e,t,i){n.change(o=>{const r=o.createElement("media",{url:e});n.insertObject(r,t,null,{setSelection:"on",findOptimalPosition:i?"auto":void 0})})}class J extends M{refresh(){const e=this.editor.model,t=e.document.selection,i=E(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=Y(t)||Q(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,o=E(i);o?t.change(r=>{r.setAttribute("url",e,o)}):V(t,e,i,!0)}}function Q(n,e){let i=k(n,e).start.parent;return i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent),e.schema.checkChild(i,"media")}function Y(n){const e=n.getSelectedElement();return!!e&&e.name==="media"}const Z="0 0 64 42";class ee{locale;providerDefinitions;constructor(e,t){const i=t.providers,o=t.extraProviders||[],r=new Set(t.removeProviders),a=i.concat(o).filter(s=>{const l=s.name;return l?!r.has(l):(R("media-embed-no-provider-name",{provider:s}),!1)});this.locale=e,this.providerDefinitions=a}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new I(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,o=D(t.url);for(const r of o){const a=this._getUrlMatches(e,r);if(a)return new I(this.locale,e,a,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let o=e.replace(/^https?:\/\//,"");return i=o.match(t),i||(o=o.replace(/^www\./,""),i=o.match(t),i)?i:null}}class I{url;_locale;_match;_previewRenderer;constructor(e,t,i,o){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=o}getViewElement(e,t){const i={};let o;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const r=this._getPreviewHtml(t);o=e.createRawElement("div",i,(a,s)=>{s.setContentOf(a,r)})}else this.url&&(i.url=this.url),o=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,o),o}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new A,t=this._locale.t;return e.content=j,e.viewBox=Z,new N({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}class c extends h{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const i=t[1],o=t[2];return`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${i}${o?`?start=${o}`:""}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new ee(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,o=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),s=this.registry;e.commands.add("mediaEmbed",new J(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),o.for("dataDowncast").elementToStructure({model:"media",view:(l,{writer:d})=>{const m=l.getAttribute("url");return v(d,s,m,{elementName:a,renderMediaPreview:!!m&&r})}}),o.for("dataDowncast").add(_(s,{elementName:a,renderMediaPreview:r})),o.for("editingDowncast").elementToStructure({model:"media",view:(l,{writer:d})=>{const m=l.getAttribute("url"),u=v(d,s,m,{elementName:a,renderForEditingView:!0});return X(u,d,i("media widget"))}}),o.for("editingDowncast").add(_(s,{elementName:a,renderForEditingView:!0})),o.for("upcast").elementToElement({view:l=>["oembed",a].includes(l.name)&&l.getAttribute("url")?{name:!0}:null,model:(l,{writer:d})=>{const m=l.getAttribute("url");return s.hasMedia(m)?d.createElement("media",{url:m}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(l,{writer:d})=>{const m=l.getAttribute("data-oembed-url");return s.hasMedia(m)?d.createElement("media",{url:m}):null}}).add(l=>{const d=(m,u,g)=>{if(!g.consumable.consume(u.viewItem,{name:!0,classes:"media"}))return;const{modelRange:p,modelCursor:y}=g.convertChildren(u.viewItem,u.modelCursor);u.modelRange=p,u.modelCursor=y,x(p.getItems())||g.consumable.revert(u.viewItem,{name:!0,classes:"media"})};l.on("element:figure",d)})}}const te=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class ie extends h{static get requires(){return[G,b,K]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",()=>{const r=t.selection.getFirstRange(),a=f.fromPosition(r.start);a.stickiness="toPrevious";const s=f.fromPosition(r.end);s.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(a,s),a.detach(),s.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(w.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor,o=i.plugins.get(c).registry,r=new z(e,t),a=r.getWalker({ignoreElementEnd:!0});let s="";for(const d of a)d.item.is("$textProxy")&&(s+=d.item.data);if(s=s.trim(),!s.match(te)){r.detach();return}if(!o.hasMedia(s)){r.detach();return}if(!i.commands.get("mediaEmbed").isEnabled){r.detach();return}this._positionToInsert=f.fromPosition(e),this._timeoutId=w.window.setTimeout(()=>{i.model.change(d=>{this._timeoutId=null,d.remove(r),r.detach();let m=null;this._positionToInsert.root.rootName!=="$graveyard"&&(m=this._positionToInsert),V(i.model,s,m,!1),this._positionToInsert.detach(),this._positionToInsert=null}),i.plugins.get(b).requestUndoOnBackspace()},100)}}class oe extends O{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,t){super(t),this.focusTracker=new C,this.keystrokes=new F,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),$({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new W(this.locale,H),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),t}}class re extends h{static get requires(){return[c,U]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",()=>{const t=this.editor.locale.t,i=this._createDialogButton(S);return i.tooltip=!0,i.label=t("Insert media"),i}),e.ui.componentFactory.add("menuBar:mediaEmbed",()=>{const t=this.editor.locale.t,i=this._createDialogButton(L);return i.label=t("Media"),i})}_createDialogButton(e){const t=this.editor,i=new e(t.locale),o=t.commands.get("mediaEmbed"),r=this.editor.plugins.get("Dialog");return i.icon=q,i.bind("isEnabled").to(o,"isEnabled"),i.on("execute",()=>{r.id==="mediaEmbed"?r.hide():this._showDialog()}),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),o=e.locale.t,r=i.value!==void 0;if(!this._formView){const a=e.plugins.get(c).registry;this._formView=new(B(oe))(ne(e.t,a),e.locale),this._formView.on("submit",()=>this._handleSubmitForm())}t.show({id:"mediaEmbed",title:o("Media embed"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:o("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:o(r?"Save":"Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}function ne(n,e){return[t=>{if(!t.url.length)return n("The URL must not be empty.")},t=>{if(!e.hasMedia(t.url))return n("This media URL is not supported.")}]}class pe extends h{static get requires(){return[c,re,ie,T]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}}export{ie as AutoMediaEmbed,pe as MediaEmbed,J as MediaEmbedCommand,c as MediaEmbedEditing,re as MediaEmbedUI,ee as MediaRegistry,oe as _MediaFormView,v as _createMediaFigureElement,E as _getSelectedMediaModelWidget,V as _insertMedia,_ as _modelToViewUrlAttributeMediaConverter,X as _toMediaWidget};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{keyCodes as r}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/r.arrowup,r.arrowdown,r.esc;r.enter,r.tab;
|
|
1
|
+
import{keyCodes as r}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";r.arrowup,r.arrowdown,r.esc;r.enter,r.tab;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as l,Command as d}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as m,toWidget as p,findOptimalInsertionRange as k}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{IconPageBreak as B}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as f,MenuBarMenuListItemButtonView as b}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class h extends d{refresh(){const e=this.editor.model,t=e.schema,a=e.document.selection;this.isEnabled=P(a,t,e)}execute(){const e=this.editor.model;e.change(t=>{const a=t.createElement("pageBreak");e.insertObject(a,null,null,{setSelection:"after"})})}}function P(o,e,t){const a=E(o,t);return e.checkChild(a,"pageBreak")}function E(o,e){const a=k(o,e).start.parent;return a.isEmpty&&!a.is("element","$root")?a.parent:a}class y extends l{static get pluginName(){return"PageBreakEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,a=e.t,i=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),i.for("dataDowncast").elementToStructure({model:"pageBreak",view:(r,{writer:n})=>n.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},n.createContainerElement("span",{style:"display: none"}))}),i.for("editingDowncast").elementToStructure({model:"pageBreak",view:(r,{writer:n})=>{const c=a("Page break"),s=n.createContainerElement("div"),g=n.createRawElement("span",{class:"page-break__label"},function(u){u.innerText=a("Page break")});return n.addClass("page-break",s),n.insert(n.createPositionAt(s,0),g),v(s,n,c)}}),i.for("upcast").elementToElement({view:r=>{const n=r.getStyle("page-break-before")=="always",c=r.getStyle("page-break-after")=="always";if(!n&&!c)return null;if(r.childCount==1){const s=r.getChild(0);if(!s.is("element","span")||s.getStyle("display")!="none")return null}else if(r.childCount>1)return null;return{name:!0,styles:[...n?["page-break-before"]:[],...c?["page-break-after"]:[]],...r.hasClass("page-break")&&{classes:["page-break"]}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new h(e))}}function v(o,e,t){return e.setCustomProperty("pageBreak",!0,o),p(o,e,{label:t})}class w extends l{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("pageBreak",()=>{const t=this._createButton(f);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:pageBreak",()=>this._createButton(b))}_createButton(e){const t=this.editor,a=t.locale,i=t.commands.get("pageBreak"),r=new e(t.locale),n=a.t;return r.set({label:n("Page break"),icon:B}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",()=>{t.execute("pageBreak"),t.editing.view.focus()}),r}}class O extends l{static get requires(){return[y,w,m]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}}export{O as PageBreak,h as PageBreakCommand,y as PageBreakEditing,w as PageBreakUI};
|
|
1
|
+
import{Plugin as l,Command as d}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as m,toWidget as p,findOptimalInsertionRange as k}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{IconPageBreak as B}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as f,MenuBarMenuListItemButtonView as b}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class h extends d{refresh(){const e=this.editor.model,t=e.schema,a=e.document.selection;this.isEnabled=P(a,t,e)}execute(){const e=this.editor.model;e.change(t=>{const a=t.createElement("pageBreak");e.insertObject(a,null,null,{setSelection:"after"})})}}function P(o,e,t){const a=E(o,t);return e.checkChild(a,"pageBreak")}function E(o,e){const a=k(o,e).start.parent;return a.isEmpty&&!a.is("element","$root")?a.parent:a}class y extends l{static get pluginName(){return"PageBreakEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,a=e.t,i=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),i.for("dataDowncast").elementToStructure({model:"pageBreak",view:(r,{writer:n})=>n.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},n.createContainerElement("span",{style:"display: none"}))}),i.for("editingDowncast").elementToStructure({model:"pageBreak",view:(r,{writer:n})=>{const c=a("Page break"),s=n.createContainerElement("div"),g=n.createRawElement("span",{class:"page-break__label"},function(u){u.innerText=a("Page break")});return n.addClass("page-break",s),n.insert(n.createPositionAt(s,0),g),v(s,n,c)}}),i.for("upcast").elementToElement({view:r=>{const n=r.getStyle("page-break-before")=="always",c=r.getStyle("page-break-after")=="always";if(!n&&!c)return null;if(r.childCount==1){const s=r.getChild(0);if(!s.is("element","span")||s.getStyle("display")!="none")return null}else if(r.childCount>1)return null;return{name:!0,styles:[...n?["page-break-before"]:[],...c?["page-break-after"]:[]],...r.hasClass("page-break")&&{classes:["page-break"]}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new h(e))}}function v(o,e,t){return e.setCustomProperty("pageBreak",!0,o),p(o,e,{label:t})}class w extends l{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("pageBreak",()=>{const t=this._createButton(f);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:pageBreak",()=>this._createButton(b))}_createButton(e){const t=this.editor,a=t.locale,i=t.commands.get("pageBreak"),r=new e(t.locale),n=a.t;return r.set({label:n("Page break"),icon:B}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",()=>{t.execute("pageBreak"),t.editing.view.focus()}),r}}class O extends l{static get requires(){return[y,w,m]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}}export{O as PageBreak,h as PageBreakCommand,y as PageBreakEditing,w as PageBreakUI};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as h,Command as l}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{first as m}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class p extends l{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,r=e.document,t=m(r.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&c(t,e.schema)}execute(e={}){const r=this.editor.model,t=r.document,a=e.selection||t.selection;r.canEditAt(a)&&r.change(n=>{const s=a.getSelectedBlocks();for(const i of s)!i.is("element","paragraph")&&c(i,r.schema)&&n.rename(i,"paragraph")})}}function c(o,e){return e.checkChild(o.parent,"paragraph")&&!e.isObject(o)}class u extends l{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const r=this.editor.model,t=e.attributes;let a=e.position;return r.canEditAt(a)?r.change(n=>{if(a=this._findPositionToInsertParagraph(a,n),!a)return null;const s=n.createElement("paragraph");return t&&r.schema.setAllowedAttributes(s,t,n),r.insertContent(s,a),n.setSelection(s,"in"),n.createPositionAt(s,0)}):null}_findPositionToInsertParagraph(e,r){const t=this.editor.model;if(t.schema.checkChild(e,"paragraph"))return e;const a=t.schema.findAllowedParent(e,"paragraph");if(!a)return null;const n=e.parent,s=t.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?t.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?t.createPositionBefore(n):r.split(e,a).position}}class d extends h{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,r=e.model;e.commands.add("paragraph",new p(e)),e.commands.add("insertParagraph",new u(e)),r.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(t,{writer:a})=>!d.paragraphLikeElements.has(t.name)||t.isEmpty?null:a.createElement("paragraph"),view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}export{u as InsertParagraphCommand,d as Paragraph,p as ParagraphCommand};
|
|
1
|
+
import{Plugin as h,Command as l}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{first as m}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";class p extends l{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,r=e.document,t=m(r.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&c(t,e.schema)}execute(e={}){const r=this.editor.model,t=r.document,a=e.selection||t.selection;r.canEditAt(a)&&r.change(n=>{const s=a.getSelectedBlocks();for(const i of s)!i.is("element","paragraph")&&c(i,r.schema)&&n.rename(i,"paragraph")})}}function c(o,e){return e.checkChild(o.parent,"paragraph")&&!e.isObject(o)}class u extends l{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const r=this.editor.model,t=e.attributes;let a=e.position;return r.canEditAt(a)?r.change(n=>{if(a=this._findPositionToInsertParagraph(a,n),!a)return null;const s=n.createElement("paragraph");return t&&r.schema.setAllowedAttributes(s,t,n),r.insertContent(s,a),n.setSelection(s,"in"),n.createPositionAt(s,0)}):null}_findPositionToInsertParagraph(e,r){const t=this.editor.model;if(t.schema.checkChild(e,"paragraph"))return e;const a=t.schema.findAllowedParent(e,"paragraph");if(!a)return null;const n=e.parent,s=t.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?t.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?t.createPositionBefore(n):r.split(e,a).position}}class d extends h{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,r=e.model;e.commands.add("paragraph",new p(e)),e.commands.add("insertParagraph",new u(e)),r.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(t,{writer:a})=>!d.paragraphLikeElements.has(t.name)||t.isEmpty?null:a.createElement("paragraph"),view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}export{u as InsertParagraphCommand,d as Paragraph,p as ParagraphCommand};
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
import{Plugin as E}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ClipboardPipeline as M}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{UpcastWriter as y,ViewDocument as C,ViewDomConverter as P,Matcher as b}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*//**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/function T(t,e){const n=[];for(const s of e.createRangeIn(t)){const i=s.item;i.is("element","a")&&!i.hasAttribute("href")&&(i.hasAttribute("id")||i.hasAttribute("name"))&&n.push(i)}for(const s of n){const i=s.parent.getChildIndex(s)+1,r=s.getChildren();e.insertChild(i,r,s.parent)}}/**
|
|
8
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
9
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
10
|
-
*/function L(t){const e=parseFloat(t);return t.endsWith("pt")?h(e*96/72):t.endsWith("pc")?h(e*12*96/72):t.endsWith("in")?h(e*96):t.endsWith("cm")?h(e*96/2.54):t.endsWith("mm")?h(e/10*96/2.54):t}function S(t){return t!==void 0&&t.endsWith("px")}function h(t){return Math.round(t)+"px"}function O(t,e,n){if(!t.childCount)return;const s=new y(t.document),i=W(t,s);if(!i.length)return;const r={},l=[];for(const o of i)if(o.indent!==void 0){k(o)||(l.length=0);const c=`${o.id}:${o.indent}`,a=Math.min(o.indent-1,l.length);if(a<l.length&&l[a].id!==o.id&&(l.length=a),a<l.length-1)l.length=a+1;else{const f=_(o,e);if(a>l.length-1||l[a].listElement.name!=f.type){a==0&&f.type=="ol"&&o.id!==void 0&&r[c]&&(f.startIndex=r[c]);const d=$(f,s,n);if(S(o.marginLeft)&&(a==0||S(l[a-1].marginLeft))){let u=o.marginLeft;a>0&&(u=h(parseFloat(u)-parseFloat(l[a-1].marginLeft))),s.setStyle("padding-left",u,d)}if(l.length==0){const u=o.element.parent,p=u.getChildIndex(o.element)+1;s.insertChild(p,d,u)}else{const u=l[a-1].listItemElements;s.appendChild(d,u[u.length-1])}l[a]={...o,listElement:d,listItemElements:[]},a==0&&o.id!==void 0&&(r[c]=f.startIndex||1)}}const m=o.element.name=="li"?o.element:s.createElement("li");s.appendChild(m,l[a].listElement),l[a].listItemElements.push(m),a==0&&o.id!==void 0&&r[c]++,o.element!=m&&s.appendChild(o.element,m),F(o.element,s),s.removeStyle("text-indent",o.element),s.removeStyle("margin-left",o.element)}else{const c=l.find(a=>a.marginLeft==o.marginLeft);if(c){const a=c.listItemElements;s.appendChild(o.element,a[a.length-1]),s.removeStyle("margin-left",o.element)}else l.length=0}}function R(t,e){for(const n of e.createRangeIn(t)){const s=n.item;if(s.is("element","li")){const i=s.getChild(0);i&&i.is("element","p")&&e.unwrapElement(i)}}}function W(t,e){const n=e.createRangeIn(t),s=[],i=new Set;for(const r of n.getItems()){if(!r.is("element")||!r.name.match(/^(p|h\d+|li|div)$/))continue;let l=V(r);if(l!==void 0&&parseFloat(l)==0&&!Array.from(r.getClassNames()).find(o=>o.startsWith("MsoList"))&&(l=void 0),r.hasStyle("mso-list")||l!==void 0&&i.has(l)){const o=z(r);s.push({element:r,id:o.id,order:o.order,indent:o.indent,marginLeft:l}),l!==void 0&&i.add(l)}else i.clear()}return s}function k(t){const e=t.element.previousSibling;if(!e){const n=t.element.parent;return x(n)&&(!n.previousSibling||x(n.previousSibling))}return x(e)}function x(t){return t.is("element","ol")||t.is("element","ul")}function _(t,e){const n=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),s=/mso-level-number-format:([^;]{0,100});/gi,i=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${t.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),l=new RegExp(`@list l${t.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),o=r.exec(e),c=l.exec(e),a=o&&!c,m=n.exec(e);let f="decimal",d="ol",u=null;if(m&&m[1]){const p=s.exec(m[1]);if(p&&p[1]&&(f=p[1].trim(),d=f!=="bullet"&&f!=="image"?"ol":"ul"),f==="bullet"){const g=B(t.element);g&&(f=g)}else{const g=i.exec(m[1]);g&&g[1]&&(u=parseInt(g[1]))}a&&(d="ol")}return{type:d,startIndex:u,style:D(f),isLegalStyleList:a}}function B(t){if(t.name=="li"&&t.parent.name=="ul"&&t.parent.hasAttribute("type"))return t.parent.getAttribute("type");const e=N(t);if(!e)return null;const n=e._data;return n==="o"?"circle":n==="·"?"disc":n==="§"?"square":null}function N(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const n=e.getChild(0);if(n)return n.is("$text")?n:n.getChild(0)}/* istanbul ignore next -- @preserve */return null}function D(t){if(t.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(t){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function $(t,e,n){const s=e.createElement(t.type);return t.style&&e.setStyle("list-style-type",t.style,s),t.startIndex&&t.startIndex>1&&e.setAttribute("start",t.startIndex,s),t.isLegalStyleList&&n&&e.addClass("legal-list",s),s}function z(t){const e=t.getStyle("mso-list");if(e===void 0)return{};const n=e.match(/(^|\s{1,100})l(\d+)/i),s=e.match(/\s{0,100}lfo(\d+)/i),i=e.match(/\s{0,100}level(\d+)/i);return n&&s&&i?{id:n[2],order:s[1],indent:parseInt(i[1])}:{indent:1}}function F(t,e){const n=new b({name:"span",styles:{"mso-list":"Ignore"}}),s=e.createRangeIn(t);for(const i of s)i.type==="elementStart"&&n.match(i.item)&&e.remove(i.item)}function V(t){const e=t.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:L(e)}function j(t,e){if(!t.childCount)return;const n=new y(t.document),s=H(t,n);q(s,t,n),X(s,t,n),U(t,n);const i=J(t,n);i.length&&Q(i,K(e),n)}function G(t){return btoa(t.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}function H(t,e){const n=e.createRangeIn(t),s=new b({name:/v:(.+)/}),i=[];for(const r of n){if(r.type!="elementStart")continue;const l=r.item,o=l.previousSibling,c=o&&o.is("element")?o.name:null,a=["Chart"],m=s.match(l),f=l.getAttribute("o:gfxdata"),d=c==="v:shapetype",u=f&&a.some(p=>l.getAttribute("id").includes(p));m&&f&&!d&&!u&&i.push(r.item.getAttribute("id"))}return i}function q(t,e,n){const s=n.createRangeIn(e),i=new b({name:"img"}),r=[];for(const l of s)if(l.item.is("element")&&i.match(l.item)){const o=l.item,c=o.getAttribute("v:shapes")?o.getAttribute("v:shapes").split(" "):[];c.length&&c.every(a=>t.indexOf(a)>-1)?r.push(o):o.getAttribute("src")||r.push(o)}for(const l of r)n.remove(l)}function U(t,e){const n=e.createRangeIn(t),s=new b({name:/v:(.+)/}),i=[];for(const r of n)r.type=="elementStart"&&s.match(r.item)&&i.push(r.item);for(const r of i)e.remove(r)}function X(t,e,n){const s=n.createRangeIn(e),i=[];for(const o of s)if(o.type=="elementStart"&&o.item.is("element","v:shape")){const c=o.item.getAttribute("id");if(t.includes(c))continue;r(o.item.parent.getChildren(),c)||i.push(o.item)}for(const o of i){const c={src:l(o)};o.hasAttribute("alt")&&(c.alt=o.getAttribute("alt"));const a=n.createElement("img",c);n.insertChild(o.index+1,a,o.parent)}function r(o,c){for(const a of o){/* istanbul ignore else -- @preserve */if(a.is("element")&&(a.name=="img"&&a.getAttribute("v:shapes")==c||r(a.getChildren(),c)))return!0}return!1}function l(o){for(const c of o.getChildren()){/* istanbul ignore else -- @preserve */if(c.is("element")&&c.getAttribute("src"))return c.getAttribute("src")}}}function J(t,e){const n=e.createRangeIn(t),s=new b({name:"img"}),i=[];let r=0;for(const l of n)l.item.is("element")&&s.match(l.item)&&(l.item.getAttribute("src").startsWith("file://")&&i.push({element:l.item,imageIndex:r}),r++);return i}function K(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),s=t.match(n),i=[];if(s)for(const r of s){let l=!1;r.includes("\\pngblip")?l="image/png":r.includes("\\jpegblip")&&(l="image/jpeg"),l&&i.push({hex:r.replace(e,"").replace(/[^\da-fA-F]/g,""),type:l})}return i}function Q(t,e,n){for(let s=0;s<t.length;s++){const{element:i,imageIndex:r}=t[s],l=e[r];if(l){const o=`data:${l.type};base64,${G(l.hex)}`;n.setAttribute("src",o,i)}}}function Y(t){const e=[],n=new y(t.document);for(const{item:s}of n.createRangeIn(t))if(s.is("element")){for(const i of s.getClassNames())/\bmso/gi.exec(i)&&n.removeClass(i,s);for(const i of s.getStyleNames())/\bmso/gi.exec(i)&&n.removeStyle(i,s);(s.is("element","w:sdt")||s.is("element","w:sdtpr")&&s.isEmpty||s.is("element","o:p")&&s.isEmpty)&&e.push(s)}for(const s of e){const i=s.parent,r=i.getChildIndex(s);n.insertChild(r,s.getChildren(),i),n.remove(s)}}function Z(t,e){for(const n of e.createRangeIn(t).getItems()){if(!n.is("element","table")&&!n.is("element","td")&&!n.is("element","th"))continue;const s=["left","top","right","bottom"];if(s.every(r=>!n.hasStyle(`border-${r}-style`)))e.setStyle("border-style","none",n);else for(const r of s)n.hasStyle(`border-${r}-style`)||e.setStyle(`border-${r}-style`,"none",n);const i=["width","height",...s.map(r=>`border-${r}-width`),...s.map(r=>`padding-${r}`)];for(const r of i)n.hasStyle(r)&&e.setStyle(r,L(n.getStyle(r)),n)}}/**
|
|
11
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
12
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
13
|
-
*/function w(t,e){for(const n of e.createRangeIn(t).getItems())n.is("element","table")&&(n.getStyle("width")==="0px"&&e.removeStyle("width",n),n.getAttribute("width")==="0"&&e.removeAttribute("width",n))}const ee=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,te=/xmlns:o="urn:schemas-microsoft-com/i;class ne{document;hasMultiLevelListPlugin;constructor(e,n=!1){this.document=e,this.hasMultiLevelListPlugin=n}isActive(e){return ee.test(e)||te.test(e)}execute(e){const n=new y(this.document),{body:s,stylesString:i}=e._parsedData;T(s,n),O(s,i,this.hasMultiLevelListPlugin),j(s,e.dataTransfer.getData("text/rtf")),Z(s,n),w(s,n),Y(s),e.content=s}}/**
|
|
14
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
15
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
16
|
-
*/function se(t,e){for(const n of t.getChildren())if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}function ie(t,e){const n=new C(e.document.stylesProcessor),s=new P(n,{renderingMode:"data"}),i=s.blockElements,r=s.inlineObjectElements,l=[];for(const o of e.createRangeIn(t)){const c=o.item;if(c.is("element","br")){const a=v(c,"forward",e,{blockElements:i,inlineObjectElements:r}),m=v(c,"backward",e,{blockElements:i,inlineObjectElements:r}),f=I(a,i);(I(m,i)||f)&&l.push(c)}}for(const o of l)o.hasClass("Apple-interchange-newline")?e.remove(o):e.replace(o,e.createElement("p"))}function v(t,e,n,{blockElements:s,inlineObjectElements:i}){let r=n.createPositionAt(t,e=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:l})=>l.is("element")&&!s.includes(l.name)&&!i.includes(l.name),{direction:e}),e=="forward"?r.nodeAfter:r.nodeBefore}function I(t,e){return!!t&&t.is("element")&&e.includes(t.name)}/**
|
|
17
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
18
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
19
|
-
*/function oe(t,e,n){const s=new Set;for(const i of e.createRangeIn(t).getItems())!i.is("view:$textProxy")||!i.data.includes(" ")||re(i.parent)&&s.add(i.textNode);for(const i of s)le(i,e,n)}function re(t){let e=t;for(;e;){if(e.is("element")&&e.getStyle?.("white-space")==="pre-wrap")return!0;e=e.parent}return!1}function le(t,e,n){const{parent:s,data:i}=t,r=i.replaceAll(" "," ".repeat(n)),l=s.getChildIndex(t);e.remove(t),e.insertChild(l,e.createText(r),s)}const ae=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class ce{document;constructor(e){this.document=e}isActive(e){return ae.test(e)}execute(e){const n=new y(this.document),{body:s}=e._parsedData;se(s,n),R(s,n),ie(s,n),oe(s,n,8),e.content=s}}/**
|
|
20
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
21
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
22
|
-
*/function fe(t,e){for(const n of t.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&e.removeAttribute("xmlns",n)}/**
|
|
23
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
24
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
25
|
-
*/function me(t,e){for(const n of t.getChildren())if(n.is("element","google-sheets-html-origin")){const s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}/**
|
|
26
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
27
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
28
|
-
*/function ue(t,e){for(const n of Array.from(t.getChildren()))n.is("element","style")&&e.remove(n)}const de=/<google-sheets-html-origin/i;class pe{document;constructor(e){this.document=e}isActive(e){return de.test(e)}execute(e){const n=new y(this.document),{body:s}=e._parsedData;me(s,n),fe(s,n),w(s,n),ue(s,n),e.content=s}}/**
|
|
29
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
30
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
31
|
-
*/function ge(t){return A(A(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}function he(t){t.querySelectorAll("span[style*=spacerun]").forEach(e=>{const n=e,s=n.innerText.length||0;n.innerText=Array(s+1).join(" ").substr(0,s)})}function A(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,n)=>n.length===1?" ":Array(n.length+1).join(" ").substr(0,n.length))}function ye(t,e){const n=new DOMParser;t=t.replace(/<!--\[if gte vml 1]>/g,""),t=t.replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,"");const s=ge(Se(t)),i=n.parseFromString(s,"text/html");he(i);const r=i.body.innerHTML,l=be(i,e),o=xe(i);return{body:l,bodyString:r,styles:o.styles,stylesString:o.stylesString}}function be(t,e){const n=new C(e),s=new P(n,{renderingMode:"data"}),i=t.createDocumentFragment(),r=t.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);return s.domToView(i,{skipComments:!0})}function xe(t){const e=[],n=[],s=Array.from(t.getElementsByTagName("style"));for(const i of s)i.sheet&&i.sheet.cssRules&&i.sheet.cssRules.length&&(e.push(i.sheet),n.push(i.innerHTML));return{styles:e,stylesString:n.join(" ")}}function Se(t){const e="</body>",n="</html>",s=t.indexOf(e);if(s<0)return t;const i=t.indexOf(n,s+e.length);return t.substring(0,s+e.length)+(i>=0?t.substring(i):"")}class Ce extends E{static get pluginName(){return"PasteFromOffice"}static get isOfficialPlugin(){return!0}static get requires(){return[M]}init(){const e=this.editor,n=e.plugins.get("ClipboardPipeline"),s=e.editing.view.document,i=[],r=this.editor.plugins.has("MultiLevelList");i.push(new ne(s,r)),i.push(new ce(s)),i.push(new pe(s)),n.on("inputTransformation",(l,o)=>{if(o._isTransformedWithPasteFromOffice||e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const a=o.dataTransfer.getData("text/html"),m=i.find(f=>f.isActive(a));m&&(o._parsedData||(o._parsedData=ye(a,s.stylesProcessor)),m.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}}export{Ce as PasteFromOffice,ce as PasteFromOfficeGoogleDocsNormalizer,pe as PasteFromOfficeGoogleSheetsNormalizer,ne as PasteFromOfficeMSWordNormalizer,G as _convertHexToBase64,L as _convertPasteOfficeCssLengthToPx,S as _isPasteOfficePxValue,he as _normalizePasteOfficeSpaceRunSpans,ge as _normalizePasteOfficeSpacing,me as _removePasteGoogleOfficeSheetsTag,Y as _removePasteMSOfficeAttributes,se as _removePasteOfficeBoldWrapper,w as _removePasteOfficeInvalidTableWidths,ue as _removePasteOfficeStyleBlock,fe as _removePasteOfficeXmlnsAttributes,j as _replacePasteOfficeImagesSourceWithBase64,h as _toPasteOfficePxValue,ie as _transformPasteOfficeBlockBrsToParagraphs,T as _transformPasteOfficeBookmarks,O as _transformPasteOfficeListItemLikeElementsIntoLists,Z as _transformPasteOfficeTables,R as _unwrapPasteOfficeParagraphInListItem,ye as parsePasteOfficeHtml};
|
|
1
|
+
import{Plugin as E}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{ClipboardPipeline as M}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{UpcastWriter as y,ViewDocument as C,ViewDomConverter as P,Matcher as b}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";function T(t,e){const n=[];for(const s of e.createRangeIn(t)){const i=s.item;i.is("element","a")&&!i.hasAttribute("href")&&(i.hasAttribute("id")||i.hasAttribute("name"))&&n.push(i)}for(const s of n){const i=s.parent.getChildIndex(s)+1,r=s.getChildren();e.insertChild(i,r,s.parent)}}function L(t){const e=parseFloat(t);return t.endsWith("pt")?h(e*96/72):t.endsWith("pc")?h(e*12*96/72):t.endsWith("in")?h(e*96):t.endsWith("cm")?h(e*96/2.54):t.endsWith("mm")?h(e/10*96/2.54):t}function S(t){return t!==void 0&&t.endsWith("px")}function h(t){return Math.round(t)+"px"}function O(t,e,n){if(!t.childCount)return;const s=new y(t.document),i=W(t,s);if(!i.length)return;const r={},l=[];for(const o of i)if(o.indent!==void 0){k(o)||(l.length=0);const c=`${o.id}:${o.indent}`,a=Math.min(o.indent-1,l.length);if(a<l.length&&l[a].id!==o.id&&(l.length=a),a<l.length-1)l.length=a+1;else{const f=_(o,e);if(a>l.length-1||l[a].listElement.name!=f.type){a==0&&f.type=="ol"&&o.id!==void 0&&r[c]&&(f.startIndex=r[c]);const d=$(f,s,n);if(S(o.marginLeft)&&(a==0||S(l[a-1].marginLeft))){let u=o.marginLeft;a>0&&(u=h(parseFloat(u)-parseFloat(l[a-1].marginLeft))),s.setStyle("padding-left",u,d)}if(l.length==0){const u=o.element.parent,p=u.getChildIndex(o.element)+1;s.insertChild(p,d,u)}else{const u=l[a-1].listItemElements;s.appendChild(d,u[u.length-1])}l[a]={...o,listElement:d,listItemElements:[]},a==0&&o.id!==void 0&&(r[c]=f.startIndex||1)}}const m=o.element.name=="li"?o.element:s.createElement("li");s.appendChild(m,l[a].listElement),l[a].listItemElements.push(m),a==0&&o.id!==void 0&&r[c]++,o.element!=m&&s.appendChild(o.element,m),F(o.element,s),s.removeStyle("text-indent",o.element),s.removeStyle("margin-left",o.element)}else{const c=l.find(a=>a.marginLeft==o.marginLeft);if(c){const a=c.listItemElements;s.appendChild(o.element,a[a.length-1]),s.removeStyle("margin-left",o.element)}else l.length=0}}function R(t,e){for(const n of e.createRangeIn(t)){const s=n.item;if(s.is("element","li")){const i=s.getChild(0);i&&i.is("element","p")&&e.unwrapElement(i)}}}function W(t,e){const n=e.createRangeIn(t),s=[],i=new Set;for(const r of n.getItems()){if(!r.is("element")||!r.name.match(/^(p|h\d+|li|div)$/))continue;let l=V(r);if(l!==void 0&&parseFloat(l)==0&&!Array.from(r.getClassNames()).find(o=>o.startsWith("MsoList"))&&(l=void 0),r.hasStyle("mso-list")||l!==void 0&&i.has(l)){const o=z(r);s.push({element:r,id:o.id,order:o.order,indent:o.indent,marginLeft:l}),l!==void 0&&i.add(l)}else i.clear()}return s}function k(t){const e=t.element.previousSibling;if(!e){const n=t.element.parent;return x(n)&&(!n.previousSibling||x(n.previousSibling))}return x(e)}function x(t){return t.is("element","ol")||t.is("element","ul")}function _(t,e){const n=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),s=/mso-level-number-format:([^;]{0,100});/gi,i=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,r=new RegExp(`@list\\s+l${t.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),l=new RegExp(`@list l${t.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),o=r.exec(e),c=l.exec(e),a=o&&!c,m=n.exec(e);let f="decimal",d="ol",u=null;if(m&&m[1]){const p=s.exec(m[1]);if(p&&p[1]&&(f=p[1].trim(),d=f!=="bullet"&&f!=="image"?"ol":"ul"),f==="bullet"){const g=B(t.element);g&&(f=g)}else{const g=i.exec(m[1]);g&&g[1]&&(u=parseInt(g[1]))}a&&(d="ol")}return{type:d,startIndex:u,style:D(f),isLegalStyleList:a}}function B(t){if(t.name=="li"&&t.parent.name=="ul"&&t.parent.hasAttribute("type"))return t.parent.getAttribute("type");const e=N(t);if(!e)return null;const n=e._data;return n==="o"?"circle":n==="·"?"disc":n==="§"?"square":null}function N(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const n=e.getChild(0);if(n)return n.is("$text")?n:n.getChild(0)}return null}function D(t){if(t.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(t){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function $(t,e,n){const s=e.createElement(t.type);return t.style&&e.setStyle("list-style-type",t.style,s),t.startIndex&&t.startIndex>1&&e.setAttribute("start",t.startIndex,s),t.isLegalStyleList&&n&&e.addClass("legal-list",s),s}function z(t){const e=t.getStyle("mso-list");if(e===void 0)return{};const n=e.match(/(^|\s{1,100})l(\d+)/i),s=e.match(/\s{0,100}lfo(\d+)/i),i=e.match(/\s{0,100}level(\d+)/i);return n&&s&&i?{id:n[2],order:s[1],indent:parseInt(i[1])}:{indent:1}}function F(t,e){const n=new b({name:"span",styles:{"mso-list":"Ignore"}}),s=e.createRangeIn(t);for(const i of s)i.type==="elementStart"&&n.match(i.item)&&e.remove(i.item)}function V(t){const e=t.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:L(e)}function j(t,e){if(!t.childCount)return;const n=new y(t.document),s=H(t,n);q(s,t,n),X(s,t,n),U(t,n);const i=J(t,n);i.length&&Q(i,K(e),n)}function G(t){return btoa(t.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}function H(t,e){const n=e.createRangeIn(t),s=new b({name:/v:(.+)/}),i=[];for(const r of n){if(r.type!="elementStart")continue;const l=r.item,o=l.previousSibling,c=o&&o.is("element")?o.name:null,a=["Chart"],m=s.match(l),f=l.getAttribute("o:gfxdata"),d=c==="v:shapetype",u=f&&a.some(p=>l.getAttribute("id").includes(p));m&&f&&!d&&!u&&i.push(r.item.getAttribute("id"))}return i}function q(t,e,n){const s=n.createRangeIn(e),i=new b({name:"img"}),r=[];for(const l of s)if(l.item.is("element")&&i.match(l.item)){const o=l.item,c=o.getAttribute("v:shapes")?o.getAttribute("v:shapes").split(" "):[];c.length&&c.every(a=>t.indexOf(a)>-1)?r.push(o):o.getAttribute("src")||r.push(o)}for(const l of r)n.remove(l)}function U(t,e){const n=e.createRangeIn(t),s=new b({name:/v:(.+)/}),i=[];for(const r of n)r.type=="elementStart"&&s.match(r.item)&&i.push(r.item);for(const r of i)e.remove(r)}function X(t,e,n){const s=n.createRangeIn(e),i=[];for(const o of s)if(o.type=="elementStart"&&o.item.is("element","v:shape")){const c=o.item.getAttribute("id");if(t.includes(c))continue;r(o.item.parent.getChildren(),c)||i.push(o.item)}for(const o of i){const c={src:l(o)};o.hasAttribute("alt")&&(c.alt=o.getAttribute("alt"));const a=n.createElement("img",c);n.insertChild(o.index+1,a,o.parent)}function r(o,c){for(const a of o){if(a.is("element")&&(a.name=="img"&&a.getAttribute("v:shapes")==c||r(a.getChildren(),c)))return!0}return!1}function l(o){for(const c of o.getChildren()){if(c.is("element")&&c.getAttribute("src"))return c.getAttribute("src")}}}function J(t,e){const n=e.createRangeIn(t),s=new b({name:"img"}),i=[];let r=0;for(const l of n)l.item.is("element")&&s.match(l.item)&&(l.item.getAttribute("src").startsWith("file://")&&i.push({element:l.item,imageIndex:r}),r++);return i}function K(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),s=t.match(n),i=[];if(s)for(const r of s){let l=!1;r.includes("\\pngblip")?l="image/png":r.includes("\\jpegblip")&&(l="image/jpeg"),l&&i.push({hex:r.replace(e,"").replace(/[^\da-fA-F]/g,""),type:l})}return i}function Q(t,e,n){for(let s=0;s<t.length;s++){const{element:i,imageIndex:r}=t[s],l=e[r];if(l){const o=`data:${l.type};base64,${G(l.hex)}`;n.setAttribute("src",o,i)}}}function Y(t){const e=[],n=new y(t.document);for(const{item:s}of n.createRangeIn(t))if(s.is("element")){for(const i of s.getClassNames())/\bmso/gi.exec(i)&&n.removeClass(i,s);for(const i of s.getStyleNames())/\bmso/gi.exec(i)&&n.removeStyle(i,s);(s.is("element","w:sdt")||s.is("element","w:sdtpr")&&s.isEmpty||s.is("element","o:p")&&s.isEmpty)&&e.push(s)}for(const s of e){const i=s.parent,r=i.getChildIndex(s);n.insertChild(r,s.getChildren(),i),n.remove(s)}}function Z(t,e){for(const n of e.createRangeIn(t).getItems()){if(!n.is("element","table")&&!n.is("element","td")&&!n.is("element","th"))continue;const s=["left","top","right","bottom"];if(s.every(r=>!n.hasStyle(`border-${r}-style`)))e.setStyle("border-style","none",n);else for(const r of s)n.hasStyle(`border-${r}-style`)||e.setStyle(`border-${r}-style`,"none",n);const i=["width","height",...s.map(r=>`border-${r}-width`),...s.map(r=>`padding-${r}`)];for(const r of i)n.hasStyle(r)&&e.setStyle(r,L(n.getStyle(r)),n)}}function w(t,e){for(const n of e.createRangeIn(t).getItems())n.is("element","table")&&(n.getStyle("width")==="0px"&&e.removeStyle("width",n),n.getAttribute("width")==="0"&&e.removeAttribute("width",n))}const ee=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,te=/xmlns:o="urn:schemas-microsoft-com/i;class ne{document;hasMultiLevelListPlugin;constructor(e,n=!1){this.document=e,this.hasMultiLevelListPlugin=n}isActive(e){return ee.test(e)||te.test(e)}execute(e){const n=new y(this.document),{body:s,stylesString:i}=e._parsedData;T(s,n),O(s,i,this.hasMultiLevelListPlugin),j(s,e.dataTransfer.getData("text/rtf")),Z(s,n),w(s,n),Y(s),e.content=s}}function se(t,e){for(const n of t.getChildren())if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}function ie(t,e){const n=new C(e.document.stylesProcessor),s=new P(n,{renderingMode:"data"}),i=s.blockElements,r=s.inlineObjectElements,l=[];for(const o of e.createRangeIn(t)){const c=o.item;if(c.is("element","br")){const a=v(c,"forward",e,{blockElements:i,inlineObjectElements:r}),m=v(c,"backward",e,{blockElements:i,inlineObjectElements:r}),f=I(a,i);(I(m,i)||f)&&l.push(c)}}for(const o of l)o.hasClass("Apple-interchange-newline")?e.remove(o):e.replace(o,e.createElement("p"))}function v(t,e,n,{blockElements:s,inlineObjectElements:i}){let r=n.createPositionAt(t,e=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:l})=>l.is("element")&&!s.includes(l.name)&&!i.includes(l.name),{direction:e}),e=="forward"?r.nodeAfter:r.nodeBefore}function I(t,e){return!!t&&t.is("element")&&e.includes(t.name)}function oe(t,e,n){const s=new Set;for(const i of e.createRangeIn(t).getItems())!i.is("view:$textProxy")||!i.data.includes(" ")||re(i.parent)&&s.add(i.textNode);for(const i of s)le(i,e,n)}function re(t){let e=t;for(;e;){if(e.is("element")&&e.getStyle?.("white-space")==="pre-wrap")return!0;e=e.parent}return!1}function le(t,e,n){const{parent:s,data:i}=t,r=i.replaceAll(" "," ".repeat(n)),l=s.getChildIndex(t);e.remove(t),e.insertChild(l,e.createText(r),s)}const ae=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class ce{document;constructor(e){this.document=e}isActive(e){return ae.test(e)}execute(e){const n=new y(this.document),{body:s}=e._parsedData;se(s,n),R(s,n),ie(s,n),oe(s,n,8),e.content=s}}function fe(t,e){for(const n of t.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&e.removeAttribute("xmlns",n)}function me(t,e){for(const n of t.getChildren())if(n.is("element","google-sheets-html-origin")){const s=t.getChildIndex(n);e.remove(n),e.insertChild(s,n.getChildren(),t)}}function ue(t,e){for(const n of Array.from(t.getChildren()))n.is("element","style")&&e.remove(n)}const de=/<google-sheets-html-origin/i;class pe{document;constructor(e){this.document=e}isActive(e){return de.test(e)}execute(e){const n=new y(this.document),{body:s}=e._parsedData;me(s,n),fe(s,n),w(s,n),ue(s,n),e.content=s}}function ge(t){return A(A(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/(<span\s+style=['"]letter-spacing:[^'"]+?['"]>)[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}function he(t){t.querySelectorAll("span[style*=spacerun]").forEach(e=>{const n=e,s=n.innerText.length||0;n.innerText=Array(s+1).join(" ").substr(0,s)})}function A(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,n)=>n.length===1?" ":Array(n.length+1).join(" ").substr(0,n.length))}function ye(t,e){const n=new DOMParser;t=t.replace(/<!--\[if gte vml 1]>/g,""),t=t.replace(/<o:SmartTagType(?:\s+[^\s>=]+(?:="[^"]*")?)*\s*\/?>/gi,"");const s=ge(Se(t)),i=n.parseFromString(s,"text/html");he(i);const r=i.body.innerHTML,l=be(i,e),o=xe(i);return{body:l,bodyString:r,styles:o.styles,stylesString:o.stylesString}}function be(t,e){const n=new C(e),s=new P(n,{renderingMode:"data"}),i=t.createDocumentFragment(),r=t.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);return s.domToView(i,{skipComments:!0})}function xe(t){const e=[],n=[],s=Array.from(t.getElementsByTagName("style"));for(const i of s)i.sheet&&i.sheet.cssRules&&i.sheet.cssRules.length&&(e.push(i.sheet),n.push(i.innerHTML));return{styles:e,stylesString:n.join(" ")}}function Se(t){const e="</body>",n="</html>",s=t.indexOf(e);if(s<0)return t;const i=t.indexOf(n,s+e.length);return t.substring(0,s+e.length)+(i>=0?t.substring(i):"")}class Ce extends E{static get pluginName(){return"PasteFromOffice"}static get isOfficialPlugin(){return!0}static get requires(){return[M]}init(){const e=this.editor,n=e.plugins.get("ClipboardPipeline"),s=e.editing.view.document,i=[],r=this.editor.plugins.has("MultiLevelList");i.push(new ne(s,r)),i.push(new ce(s)),i.push(new pe(s)),n.on("inputTransformation",(l,o)=>{if(o._isTransformedWithPasteFromOffice||e.model.document.selection.getFirstPosition().parent.is("element","codeBlock"))return;const a=o.dataTransfer.getData("text/html"),m=i.find(f=>f.isActive(a));m&&(o._parsedData||(o._parsedData=ye(a,s.stylesProcessor)),m.execute(o),o._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}}export{Ce as PasteFromOffice,ce as PasteFromOfficeGoogleDocsNormalizer,pe as PasteFromOfficeGoogleSheetsNormalizer,ne as PasteFromOfficeMSWordNormalizer,G as _convertHexToBase64,L as _convertPasteOfficeCssLengthToPx,S as _isPasteOfficePxValue,he as _normalizePasteOfficeSpaceRunSpans,ge as _normalizePasteOfficeSpacing,me as _removePasteGoogleOfficeSheetsTag,Y as _removePasteMSOfficeAttributes,se as _removePasteOfficeBoldWrapper,w as _removePasteOfficeInvalidTableWidths,ue as _removePasteOfficeStyleBlock,fe as _removePasteOfficeXmlnsAttributes,j as _replacePasteOfficeImagesSourceWithBase64,h as _toPasteOfficePxValue,ie as _transformPasteOfficeBlockBrsToParagraphs,T as _transformPasteOfficeBookmarks,O as _transformPasteOfficeListItemLikeElementsIntoLists,Z as _transformPasteOfficeTables,R as _unwrapPasteOfficeParagraphInListItem,ye as parsePasteOfficeHtml};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as a,Command as d}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconRemoveFormat as l}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as g,MenuBarMenuListItemButtonView as f}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{first as c}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/const n="removeFormat";class F extends a{static get pluginName(){return"RemoveFormatUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add(n,()=>{const e=this._createButton(g);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add(`menuBar:${n}`,()=>this._createButton(f))}_createButton(t){const e=this.editor,i=e.locale,s=e.commands.get(n),o=new t(e.locale),r=i.t;return o.set({label:r("Remove Format"),icon:l}),o.bind("isEnabled").to(s,"isEnabled"),this.listenTo(o,"execute",()=>{e.execute(n),e.editing.view.focus()}),o}}class h extends d{_customAttributesHandlers=[];refresh(){const t=this.editor.model;this.isEnabled=!!c(this._getFormattingItems(t.document.selection))}execute(){const t=this.editor.model;t.change(e=>{for(const i of this._getFormattingItems(t.document.selection))if(i.is("selection"))for(const s of this._getFormattingAttributes(i))e.removeSelectionAttribute(s);else{const s=e.createRangeOn(i);for(const o of this._getFormattingAttributes(i))this._removeFormatting(o,i,s,e)}})}registerCustomAttribute(t,e){this._customAttributesHandlers.push({isFormatting:t,removeFormatting:e})}_removeFormatting(t,e,i,s){let o=!1;for(const{isFormatting:r,removeFormatting:u}of this._customAttributesHandlers)r(t,e)&&(u(t,i,s),o=!0);o||s.removeAttribute(t,i)}*_getFormattingItems(t){const e=this.editor.model,i=e.schema,s=o=>!!c(this._getFormattingAttributes(o));for(const o of t.getRanges())for(const r of o.getItems())i.isBlock(r)&&o.end.isTouching(e.createPositionAt(r,0))||s(r)&&(yield r);for(const o of t.getSelectedBlocks())s(o)&&(yield o);s(t)&&(yield t)}*_getFormattingAttributes(t){const e=this.editor.model.schema;for(const[i]of t.getAttributes()){for(const{isFormatting:o}of this._customAttributesHandlers)o(i,t)&&(yield i);const s=e.getAttributeProperties(i);s&&s.isFormatting&&(yield i)}}}class b extends a{static get pluginName(){return"RemoveFormatEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.commands.add("removeFormat",new h(t))}}class p extends a{static get requires(){return[b,F]}static get pluginName(){return"RemoveFormat"}static get isOfficialPlugin(){return!0}}export{p as RemoveFormat,h as RemoveFormatCommand,b as RemoveFormatEditing,F as RemoveFormatUI};
|
|
1
|
+
import{Plugin as a,Command as d}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconRemoveFormat as l}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as g,MenuBarMenuListItemButtonView as f}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{first as c}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";const n="removeFormat";class F extends a{static get pluginName(){return"RemoveFormatUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add(n,()=>{const e=this._createButton(g);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add(`menuBar:${n}`,()=>this._createButton(f))}_createButton(t){const e=this.editor,i=e.locale,s=e.commands.get(n),o=new t(e.locale),r=i.t;return o.set({label:r("Remove Format"),icon:l}),o.bind("isEnabled").to(s,"isEnabled"),this.listenTo(o,"execute",()=>{e.execute(n),e.editing.view.focus()}),o}}class h extends d{_customAttributesHandlers=[];refresh(){const t=this.editor.model;this.isEnabled=!!c(this._getFormattingItems(t.document.selection))}execute(){const t=this.editor.model;t.change(e=>{for(const i of this._getFormattingItems(t.document.selection))if(i.is("selection"))for(const s of this._getFormattingAttributes(i))e.removeSelectionAttribute(s);else{const s=e.createRangeOn(i);for(const o of this._getFormattingAttributes(i))this._removeFormatting(o,i,s,e)}})}registerCustomAttribute(t,e){this._customAttributesHandlers.push({isFormatting:t,removeFormatting:e})}_removeFormatting(t,e,i,s){let o=!1;for(const{isFormatting:r,removeFormatting:u}of this._customAttributesHandlers)r(t,e)&&(u(t,i,s),o=!0);o||s.removeAttribute(t,i)}*_getFormattingItems(t){const e=this.editor.model,i=e.schema,s=o=>!!c(this._getFormattingAttributes(o));for(const o of t.getRanges())for(const r of o.getItems())i.isBlock(r)&&o.end.isTouching(e.createPositionAt(r,0))||s(r)&&(yield r);for(const o of t.getSelectedBlocks())s(o)&&(yield o);s(t)&&(yield t)}*_getFormattingAttributes(t){const e=this.editor.model.schema;for(const[i]of t.getAttributes()){for(const{isFormatting:o}of this._customAttributesHandlers)o(i,t)&&(yield i);const s=e.getAttributeProperties(i);s&&s.isFormatting&&(yield i)}}}class b extends a{static get pluginName(){return"RemoveFormatEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.commands.add("removeFormat",new h(t))}}class p extends a{static get requires(){return[b,F]}static get pluginName(){return"RemoveFormat"}static get isOfficialPlugin(){return!0}}export{p as RemoveFormat,h as RemoveFormatCommand,b as RemoveFormatEditing,F as RemoveFormatUI};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as o,Command as a}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{getCode as u,parseKeystroke as d}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconSelectAll as m}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as g,MenuBarMenuListItemButtonView as f}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class A extends a{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!r(e.schema,i))do if(i=i.parent,!i)return;while(!r(e.schema,i));e.change(n=>{n.setSelection(i,"in")})}}function r(l,e){return l.isLimit(e)&&(l.checkChild(e,"$text")||l.checkChild(e,"paragraph"))}const p=d("Ctrl+A");class h extends o{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,n=e.editing.view.document;e.commands.add("selectAll",new A(e)),this.listenTo(n,"keydown",(c,s)=>{u(s)===p&&(e.execute("selectAll"),s.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class S extends o{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",()=>{const t=this._createButton(g);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(f))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("selectAll"),c=new e(t.locale),s=i.t;return c.set({label:s("Select all"),icon:m,keystroke:"Ctrl+A"}),c.bind("isEnabled").to(n,"isEnabled"),this.listenTo(c,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),c}}class E extends o{static get requires(){return[h,S]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}export{E as SelectAll,A as SelectAllCommand,h as SelectAllEditing,S as SelectAllUI};
|
|
1
|
+
import{Plugin as o,Command as a}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{getCode as u,parseKeystroke as d}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconSelectAll as m}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as g,MenuBarMenuListItemButtonView as f}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class A extends a{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!r(e.schema,i))do if(i=i.parent,!i)return;while(!r(e.schema,i));e.change(n=>{n.setSelection(i,"in")})}}function r(l,e){return l.isLimit(e)&&(l.checkChild(e,"$text")||l.checkChild(e,"paragraph"))}const p=d("Ctrl+A");class h extends o{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,n=e.editing.view.document;e.commands.add("selectAll",new A(e)),this.listenTo(n,"keydown",(c,s)=>{u(s)===p&&(e.execute("selectAll"),s.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class S extends o{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",()=>{const t=this._createButton(g);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(f))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("selectAll"),c=new e(t.locale),s=i.t;return c.set({label:s("Select all"),icon:m,keystroke:"Ctrl+A"}),c.bind("isEnabled").to(n,"isEnabled"),this.listenTo(c,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),c}}class E extends o{static get requires(){return[h,S]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}export{E as SelectAll,A as SelectAllCommand,h as SelectAllEditing,S as SelectAllUI};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as c,Command as u}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconShowBlocks as d}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as h,MenuBarMenuListItemButtonView as m}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class w extends u{constructor(t){super(t),this.affectsData=!1,this.value=!1}execute(){const t="ck-show-blocks",e=this.editor.editing.view;e.change(s=>{for(const o of e.document.roots)o.hasClass(t)?(s.removeClass(t,o),this.value=!1):(s.addClass(t,o),this.value=!0)})}}class g extends c{static get pluginName(){return"ShowBlocksEditing"}static get isOfficialPlugin(){return!0}init(){const{editor:t}=this;t.commands.add("showBlocks",new w(t))}}class B extends c{static get pluginName(){return"ShowBlocksUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("showBlocks",()=>{const e=this._createButton(h);return e.set({tooltip:!0,icon:d}),e}),t.ui.componentFactory.add("menuBar:showBlocks",()=>this._createButton(m))}_createButton(t){const e=this.editor,s=e.locale,o=e.commands.get("showBlocks"),i=new t(s),a=s.t;return i.set({label:a("Show blocks"),isToggleable:!0,role:"menuitemcheckbox"}),i.bind("isEnabled").to(o),i.bind("isOn").to(o,"value",o,"isEnabled",(l,r)=>l&&r),this.listenTo(i,"execute",()=>{e.execute("showBlocks"),e.editing.view.focus()}),i}}class S extends c{static get pluginName(){return"ShowBlocks"}static get isOfficialPlugin(){return!0}static get requires(){return[g,B]}}export{S as ShowBlocks,w as ShowBlocksCommand,g as ShowBlocksEditing,B as ShowBlocksUI};
|
|
1
|
+
import{Plugin as c,Command as u}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconShowBlocks as d}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as h,MenuBarMenuListItemButtonView as m}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";class w extends u{constructor(t){super(t),this.affectsData=!1,this.value=!1}execute(){const t="ck-show-blocks",e=this.editor.editing.view;e.change(s=>{for(const o of e.document.roots)o.hasClass(t)?(s.removeClass(t,o),this.value=!1):(s.addClass(t,o),this.value=!0)})}}class g extends c{static get pluginName(){return"ShowBlocksEditing"}static get isOfficialPlugin(){return!0}init(){const{editor:t}=this;t.commands.add("showBlocks",new w(t))}}class B extends c{static get pluginName(){return"ShowBlocksUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("showBlocks",()=>{const e=this._createButton(h);return e.set({tooltip:!0,icon:d}),e}),t.ui.componentFactory.add("menuBar:showBlocks",()=>this._createButton(m))}_createButton(t){const e=this.editor,s=e.locale,o=e.commands.get("showBlocks"),i=new t(s),a=s.t;return i.set({label:a("Show blocks"),isToggleable:!0,role:"menuitemcheckbox"}),i.bind("isEnabled").to(o),i.bind("isOn").to(o,"value",o,"isEnabled",(l,r)=>l&&r),this.listenTo(i,"execute",()=>{e.execute("showBlocks"),e.editing.view.focus()}),i}}class S extends c{static get pluginName(){return"ShowBlocks"}static get isOfficialPlugin(){return!0}static get requires(){return[g,B]}}export{S as ShowBlocks,w as ShowBlocksCommand,g as ShowBlocksEditing,B as ShowBlocksUI};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as g,PendingActions as l}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconSource as f}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as p,MenuBarMenuListItemButtonView as E}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{ElementReplacer as b,CKEditorError as _,createElement as u,formatHtml as w}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/const d="SourceEditingMode";class M extends g{static get pluginName(){return"SourceEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[l]}_elementReplacer;_replacedRoots;_dataFromRoots;constructor(e){super(e),this.set("isSourceEditingMode",!1),this._elementReplacer=new b,this._replacedRoots=new Map,this._dataFromRoots=new Map,e.config.define("sourceEditing.allowCollaborationFeatures",!1)}init(){this._checkCompatibility();const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("sourceEditing",()=>{const i=this._createButton(p);return i.set({label:t("Source"),icon:f,tooltip:!0,class:"ck-source-editing-button"}),i}),e.ui.componentFactory.add("menuBar:sourceEditing",()=>{const i=this._createButton(E);return i.set({label:t("Show source"),role:"menuitemcheckbox"}),i}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(i,o,n)=>{n?(this._hideVisibleDialog(),this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(i,o,n)=>this._handleReadOnlyMode(!n)),this.listenTo(e,"change:isReadOnly",(i,o,n)=>this._handleReadOnlyMode(n))),e.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}updateEditorData(){const e=this.editor,t={};for(const[i,o]of this._replacedRoots){const n=this._dataFromRoots.get(i),s=o.dataset.value;n!==s&&(t[i]=s,this._dataFromRoots.set(i,s))}Object.keys(t).length&&e.data.set(t,{batchType:{isUndoable:!0},suppressErrorInCollaboration:!0})}_checkCompatibility(){const e=this.editor,t=e.config.get("sourceEditing.allowCollaborationFeatures");if(!t&&e.plugins.has("RealTimeCollaborativeEditing"))throw new _("source-editing-incompatible-with-real-time-collaboration",null);!t&&["CommentsEditing","TrackChangesEditing","RevisionHistory"].some(o=>e.plugins.has(o))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),e.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}_showSourceEditing(){const e=this.editor,t=e.editing.view,i=e.model;i.change(o=>{o.setSelection(null),o.removeSelectionAttribute(i.document.selection.getAttributeKeys())});for(const[o,n]of t.domRoots){const s=R(e.data.get({rootName:o})),r=u(n.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),c=u(n.ownerDocument,"div",{class:"ck-source-editing-area","data-value":s},[r]);r.value=s,r.setSelectionRange(0,0),r.addEventListener("input",()=>{c.dataset.value=r.value,e.ui.update()}),t.change(h=>{const m=t.document.getRoot(o);h.addClass("ck-hidden",m)}),e.ui.setEditableElement("sourceEditing:"+o,r),this._replacedRoots.set(o,c),this._elementReplacer.replace(n,c),this._dataFromRoots.set(o,s)}this._hideDocumentOutline(),this._refreshAnnotationsVisibility(),this._focusSourceEditing()}_hideSourceEditing(){const t=this.editor.editing.view;this.updateEditorData(),t.change(i=>{for(const[o]of this._replacedRoots)i.removeClass("ck-hidden",t.document.getRoot(o))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),this._showDocumentOutline(),this._refreshAnnotationsVisibility(),t.focus()}_hideDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="none")}_showDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="")}_refreshAnnotationsVisibility(){this.editor.plugins.has("Annotations")&&this.editor.plugins.get("Annotations").refreshVisibility()}_focusSourceEditing(){const e=this.editor,[t]=this._replacedRoots.values(),i=t.querySelector("textarea");e.editing.view.document.isFocused=!1,i.focus()}_disableCommands(){const e=this.editor;for(const t of e.commands.commands())t.forceDisabled(d);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").forceDisabled(d)}_enableCommands(){const e=this.editor;for(const t of e.commands.commands())t.clearForceDisabled(d);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").clearForceDisabled(d)}_handleReadOnlyMode(e){if(this.isSourceEditingMode)for(const[,t]of this._replacedRoots)t.querySelector("textarea").readOnly=e}_isAllowedToHandleSourceEditingMode(){const t=this.editor.ui.view.editable;return t&&!t.hasExternalElement}_hideVisibleDialog(){if(this.editor.plugins.has("Dialog")){const e=this.editor.plugins.get("Dialog");e.isOpen&&e.hide()}}_createButton(e){const t=this.editor,i=new e(t.locale);return i.set({withText:!0,isToggleable:!0}),i.bind("isOn").to(this,"isSourceEditingMode"),i.bind("isEnabled").to(this,"isEnabled",t,"isReadOnly",t.plugins.get(l),"hasAny",(o,n,s)=>!(!o||n||s)),this.listenTo(i,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),i}}function R(a){return S(a)?w(a):a}function S(a){return a.startsWith("<")}export{M as SourceEditing};
|
|
1
|
+
import{Plugin as g,PendingActions as l}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconSource as f}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ButtonView as p,MenuBarMenuListItemButtonView as E}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{ElementReplacer as b,CKEditorError as _,createElement as u,formatHtml as w}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";const d="SourceEditingMode";class M extends g{static get pluginName(){return"SourceEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[l]}_elementReplacer;_replacedRoots;_dataFromRoots;constructor(e){super(e),this.set("isSourceEditingMode",!1),this._elementReplacer=new b,this._replacedRoots=new Map,this._dataFromRoots=new Map,e.config.define("sourceEditing.allowCollaborationFeatures",!1)}init(){this._checkCompatibility();const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("sourceEditing",()=>{const i=this._createButton(p);return i.set({label:t("Source"),icon:f,tooltip:!0,class:"ck-source-editing-button"}),i}),e.ui.componentFactory.add("menuBar:sourceEditing",()=>{const i=this._createButton(E);return i.set({label:t("Show source"),role:"menuitemcheckbox"}),i}),this._isAllowedToHandleSourceEditingMode()&&(this.on("change:isSourceEditingMode",(i,o,n)=>{n?(this._hideVisibleDialog(),this._showSourceEditing(),this._disableCommands()):(this._hideSourceEditing(),this._enableCommands())}),this.on("change:isEnabled",(i,o,n)=>this._handleReadOnlyMode(!n)),this.listenTo(e,"change:isReadOnly",(i,o,n)=>this._handleReadOnlyMode(n))),e.data.on("get",()=>{this.isSourceEditingMode&&this.updateEditorData()},{priority:"high"})}updateEditorData(){const e=this.editor,t={};for(const[i,o]of this._replacedRoots){const n=this._dataFromRoots.get(i),s=o.dataset.value;n!==s&&(t[i]=s,this._dataFromRoots.set(i,s))}Object.keys(t).length&&e.data.set(t,{batchType:{isUndoable:!0},suppressErrorInCollaboration:!0})}_checkCompatibility(){const e=this.editor,t=e.config.get("sourceEditing.allowCollaborationFeatures");if(!t&&e.plugins.has("RealTimeCollaborativeEditing"))throw new _("source-editing-incompatible-with-real-time-collaboration",null);!t&&["CommentsEditing","TrackChangesEditing","RevisionHistory"].some(o=>e.plugins.has(o))&&console.warn("You initialized the editor with the source editing feature and at least one of the collaboration features. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the collaboration features."),e.plugins.has("RestrictedEditingModeEditing")&&console.warn("You initialized the editor with the source editing feature and restricted editing feature. Please be advised that the source editing feature may not work, and be careful when editing document source that contains markers created by the restricted editing feature.")}_showSourceEditing(){const e=this.editor,t=e.editing.view,i=e.model;i.change(o=>{o.setSelection(null),o.removeSelectionAttribute(i.document.selection.getAttributeKeys())});for(const[o,n]of t.domRoots){const s=R(e.data.get({rootName:o})),r=u(n.ownerDocument,"textarea",{rows:"1","aria-label":"Source code editing area"}),c=u(n.ownerDocument,"div",{class:"ck-source-editing-area","data-value":s},[r]);r.value=s,r.setSelectionRange(0,0),r.addEventListener("input",()=>{c.dataset.value=r.value,e.ui.update()}),t.change(h=>{const m=t.document.getRoot(o);h.addClass("ck-hidden",m)}),e.ui.setEditableElement("sourceEditing:"+o,r),this._replacedRoots.set(o,c),this._elementReplacer.replace(n,c),this._dataFromRoots.set(o,s)}this._hideDocumentOutline(),this._refreshAnnotationsVisibility(),this._focusSourceEditing()}_hideSourceEditing(){const t=this.editor.editing.view;this.updateEditorData(),t.change(i=>{for(const[o]of this._replacedRoots)i.removeClass("ck-hidden",t.document.getRoot(o))}),this._elementReplacer.restore(),this._replacedRoots.clear(),this._dataFromRoots.clear(),this._showDocumentOutline(),this._refreshAnnotationsVisibility(),t.focus()}_hideDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="none")}_showDocumentOutline(){this.editor.plugins.has("DocumentOutlineUI")&&(this.editor.plugins.get("DocumentOutlineUI").view.element.style.display="")}_refreshAnnotationsVisibility(){this.editor.plugins.has("Annotations")&&this.editor.plugins.get("Annotations").refreshVisibility()}_focusSourceEditing(){const e=this.editor,[t]=this._replacedRoots.values(),i=t.querySelector("textarea");e.editing.view.document.isFocused=!1,i.focus()}_disableCommands(){const e=this.editor;for(const t of e.commands.commands())t.forceDisabled(d);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").forceDisabled(d)}_enableCommands(){const e=this.editor;for(const t of e.commands.commands())t.clearForceDisabled(d);e.plugins.has("CommentsArchiveUI")&&e.plugins.get("CommentsArchiveUI").clearForceDisabled(d)}_handleReadOnlyMode(e){if(this.isSourceEditingMode)for(const[,t]of this._replacedRoots)t.querySelector("textarea").readOnly=e}_isAllowedToHandleSourceEditingMode(){const t=this.editor.ui.view.editable;return t&&!t.hasExternalElement}_hideVisibleDialog(){if(this.editor.plugins.has("Dialog")){const e=this.editor.plugins.get("Dialog");e.isOpen&&e.hide()}}_createButton(e){const t=this.editor,i=new e(t.locale);return i.set({withText:!0,isToggleable:!0}),i.bind("isOn").to(this,"isSourceEditingMode"),i.bind("isEnabled").to(this,"isEnabled",t,"isReadOnly",t.plugins.get(l),"hasAny",(o,n,s)=>!(!o||n||s)),this.listenTo(i,"execute",()=>{this.isSourceEditingMode=!this.isSourceEditingMode}),i}}function R(a){return S(a)?w(a):a}function S(a){return a.startsWith("<")}export{M as SourceEditing};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as o}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Typing as f}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{IconSpecialCharacters as b}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as k,ButtonView as g,MenuBarMenuListItemButtonView as C,DialogViewPosition as _,View as h,LabeledFieldView as y,createLabeledDropdown as x,UIModel as v,addListToDropdown as V,addKeyboardHandlingForGrid as T,FocusCycler as S}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as w,Collection as D,FocusTracker as p,KeystrokeHandler as m,global as G}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class P extends h{tiles;focusTracker;keystrokes;constructor(e){super(e),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}}),this.focusTracker=new p,this.keystrokes=new m,T({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>G.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}createTile(e,t){const a=new g(this.locale);return a.set({label:e,withText:!0,class:"ck-character-grid__tile"}),a.extendTemplate({attributes:{title:t},on:{mouseover:a.bindTemplate.to("mouseover"),focus:a.bindTemplate.to("focus")}}),a.on("mouseover",()=>{this.fire("tileHover",{name:t,character:e})}),a.on("focus",()=>{this.fire("tileFocus",{name:t,character:e})}),a.on("execute",()=>{this.fire("execute",{name:t,character:e})}),a}render(){super.render();for(const e of this.tiles)this.focusTracker.add(e.element);this.tiles.on("change",(e,{added:t,removed:a})=>{if(t.length>0)for(const r of t)this.focusTracker.add(r.element);if(a.length>0)for(const r of a)this.focusTracker.remove(r.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}focus(){this.tiles.first.focus()}}class q extends h{constructor(e){super(e);const t=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",I),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:t.to("name",a=>a||"")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:t.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function I(c){return c===null?"":"U+"+("0000"+c.codePointAt(0).toString(16)).slice(-4)}class N extends h{items;focusTracker;keystrokes;_focusCycler;categoriesView;gridView;infoView;constructor(e,t,a,r){super(e),this.categoriesView=t,this.gridView=a,this.infoView=r,this.items=this.createCollection(),this.focusTracker=new p,this.keystrokes=new m,this._focusCycler=new S({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[this.categoriesView,this.gridView,this.infoView],attributes:{tabindex:"-1"}}),this.items.add(this.categoriesView),this.items.add(this.gridView)}render(){super.render(),this.focusTracker.add(this.categoriesView.element),this.focusTracker.add(this.gridView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class A extends h{_groupNames;_dropdownView;constructor(e,t){super(e),this.set("currentGroupName",Array.from(t.entries())[0][0]),this._groupNames=t,this._dropdownView=new y(e,x),this.setTemplate({tag:"div",attributes:{class:["ck","ck-character-categories"]},children:[this._dropdownView]})}render(){super.render(),this._setupDropdown()}focus(){this._dropdownView.focus()}_setupDropdown(){const e=new D;for(const[r,i]of this._groupNames){const s={type:"button",model:new v({name:r,label:i,role:"menuitemradio",withText:!0})};s.model.bind("isOn").to(this,"currentGroupName",l=>l===r),e.add(s)}const t=this.locale.t,a=t("Category");this._dropdownView.set({label:a,isEmpty:!1}),this._dropdownView.fieldView.panelPosition=this.locale.uiLanguageDirection==="rtl"?"se":"sw",this._dropdownView.fieldView.buttonView.set({withText:!0,tooltip:a,ariaLabel:a,ariaLabelledBy:void 0,isOn:!1}),this._dropdownView.fieldView.buttonView.bind("label").to(this,"currentGroupName",r=>this._groupNames.get(r)),this._dropdownView.fieldView.on("execute",({source:r})=>{this.currentGroupName=r.name}),V(this._dropdownView.fieldView,e,{ariaLabel:a,role:"menu"})}}const u="All";class K extends o{_characters;_groups;_allSpecialCharactersGroupLabel;static get requires(){return[f,k]}static get pluginName(){return"SpecialCharacters"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._characters=new Map,this._groups=new Map,this._allSpecialCharactersGroupLabel=t("All")}init(){const e=this.editor;e.ui.componentFactory.add("specialCharacters",()=>{const t=this._createDialogButton(g);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:specialCharacters",()=>this._createDialogButton(C))}addItems(e,t,a={label:e}){if(e===u)throw new w("special-character-invalid-group-name",null);const r=this._getGroup(e,a.label);for(const i of t)r.items.add(i.title),this._characters.set(i.title,i.character)}getGroups(){const e=Array.from(this._groups.keys()),t=this.editor.config.get("specialCharacters.order")||[],a=t.find(r=>!e.includes(r));if(a)throw new w("special-character-invalid-order-group-name",null,{invalidGroup:a});return new Set([...t,...e])}getCharactersForGroup(e){if(e===u)return new Set(this._characters.keys());const t=this._groups.get(e);if(t)return t.items}getCharacter(e){return this._characters.get(e)}_getGroup(e,t){return this._groups.has(e)||this._groups.set(e,{items:new Set,label:t}),this._groups.get(e)}_updateGrid(e,t){t.tiles.clear();const a=this.getCharactersForGroup(e);for(const r of a){const i=this.getCharacter(r);t.tiles.add(t.createTile(i,r))}}_createDropdownPanelContent(e){const t=Array.from(this.getGroups()).map(l=>[l,this._groups.get(l).label]),a=new Map([[u,this._allSpecialCharactersGroupLabel],...t]),r=new A(e,a),i=new P(e),s=new q(e);return i.on("tileHover",(l,n)=>{s.set(n)}),i.on("tileFocus",(l,n)=>{s.set(n)}),r.on("change:currentGroupName",(l,n,d)=>{this._updateGrid(d,i)}),this._updateGrid(r.currentGroupName,i),{categoriesView:r,gridView:i,infoView:s}}_createDialogButton(e){const t=this.editor,a=t.locale,r=new e(t.locale),i=t.commands.get("insertText"),s=a.t,l=this.editor.plugins.get("Dialog");return r.set({label:s("Special characters"),icon:b,isToggleable:!0}),r.bind("isOn").to(l,"id",n=>n==="specialCharacters"),r.bind("isEnabled").to(i,"isEnabled"),r.on("execute",()=>{if(l.id==="specialCharacters"){l.hide();return}this._showDialog()}),r}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),a=e.locale,r=a.t,{categoriesView:i,gridView:s,infoView:l}=this._createDropdownPanelContent(a),n=new N(a,i,s,l);s.on("execute",(d,L)=>{e.execute("insertText",{text:L.character})}),t.show({id:"specialCharacters",title:r("Special characters"),className:"ck-special-characters",content:n,position:_.EDITOR_TOP_SIDE})}}class E extends o{static get pluginName(){return"SpecialCharactersArrows"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Arrows",[{title:t("leftwards simple arrow"),character:"←"},{title:t("rightwards simple arrow"),character:"→"},{title:t("upwards simple arrow"),character:"↑"},{title:t("downwards simple arrow"),character:"↓"},{title:t("leftwards double arrow"),character:"⇐"},{title:t("rightwards double arrow"),character:"⇒"},{title:t("upwards double arrow"),character:"⇑"},{title:t("downwards double arrow"),character:"⇓"},{title:t("leftwards dashed arrow"),character:"⇠"},{title:t("rightwards dashed arrow"),character:"⇢"},{title:t("upwards dashed arrow"),character:"⇡"},{title:t("downwards dashed arrow"),character:"⇣"},{title:t("leftwards arrow to bar"),character:"⇤"},{title:t("rightwards arrow to bar"),character:"⇥"},{title:t("upwards arrow to bar"),character:"⤒"},{title:t("downwards arrow to bar"),character:"⤓"},{title:t("up down arrow with base"),character:"↨"},{title:t("back with leftwards arrow above"),character:"🔙"},{title:t("end with leftwards arrow above"),character:"🔚"},{title:t("on with exclamation mark with left right arrow above"),character:"🔛"},{title:t("soon with rightwards arrow above"),character:"🔜"},{title:t("top with upwards arrow above"),character:"🔝"}],{label:t("Arrows")})}}class M extends o{static get pluginName(){return"SpecialCharactersText"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:t("Single left-pointing angle quotation mark")},{character:"›",title:t("Single right-pointing angle quotation mark")},{character:"«",title:t("Left-pointing double angle quotation mark")},{character:"»",title:t("Right-pointing double angle quotation mark")},{character:"‘",title:t("Left single quotation mark")},{character:"’",title:t("Right single quotation mark")},{character:"“",title:t("Left double quotation mark")},{character:"”",title:t("Right double quotation mark")},{character:"‚",title:t("Single low-9 quotation mark")},{character:"„",title:t("Double low-9 quotation mark")},{character:"¡",title:t("Inverted exclamation mark")},{character:"¿",title:t("Inverted question mark")},{character:"‥",title:t("Two dot leader")},{character:"…",title:t("Horizontal ellipsis")},{character:"‡",title:t("Double dagger")},{character:"‰",title:t("Per mille sign")},{character:"‱",title:t("Per ten thousand sign")},{character:"‼",title:t("Double exclamation mark")},{character:"⁈",title:t("Question exclamation mark")},{character:"⁉",title:t("Exclamation question mark")},{character:"⁇",title:t("Double question mark")},{character:"©",title:t("Copyright sign")},{character:"®",title:t("Registered sign")},{character:"™",title:t("Trade mark sign")},{character:"§",title:t("Section sign")},{character:"¶",title:t("Paragraph sign")},{character:"⁋",title:t("Reversed paragraph sign")}],{label:t("Text")})}}class O extends o{static get pluginName(){return"SpecialCharactersMathematical"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:t("Less-than sign")},{character:">",title:t("Greater-than sign")},{character:"≤",title:t("Less-than or equal to")},{character:"≥",title:t("Greater-than or equal to")},{character:"–",title:t("En dash")},{character:"—",title:t("Em dash")},{character:"¯",title:t("Macron")},{character:"‾",title:t("Overline")},{character:"°",title:t("Degree sign")},{character:"−",title:t("Minus sign")},{character:"±",title:t("Plus-minus sign")},{character:"÷",title:t("Division sign")},{character:"⁄",title:t("Fraction slash")},{character:"×",title:t("Multiplication sign")},{character:"ƒ",title:t("Latin small letter f with hook")},{character:"∫",title:t("Integral")},{character:"∑",title:t("N-ary summation")},{character:"∞",title:t("Infinity")},{character:"√",title:t("Square root")},{character:"∼",title:t("Tilde operator")},{character:"≅",title:t("Approximately equal to")},{character:"≈",title:t("Almost equal to")},{character:"≠",title:t("Not equal to")},{character:"≡",title:t("Identical to")},{character:"∈",title:t("Element of")},{character:"∉",title:t("Not an element of")},{character:"∋",title:t("Contains as member")},{character:"∏",title:t("N-ary product")},{character:"∧",title:t("Logical and")},{character:"∨",title:t("Logical or")},{character:"¬",title:t("Not sign")},{character:"∩",title:t("Intersection")},{character:"∪",title:t("Union")},{character:"∂",title:t("Partial differential")},{character:"∀",title:t("For all")},{character:"∃",title:t("There exists")},{character:"∅",title:t("Empty set")},{character:"∇",title:t("Nabla")},{character:"∗",title:t("Asterisk operator")},{character:"∝",title:t("Proportional to")},{character:"∠",title:t("Angle")},{character:"¼",title:t("Vulgar fraction one quarter")},{character:"½",title:t("Vulgar fraction one half")},{character:"¾",title:t("Vulgar fraction three quarters")}],{label:t("Mathematical")})}}class F extends o{static get pluginName(){return"SpecialCharactersLatin"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:t("Latin capital letter a with macron")},{character:"ā",title:t("Latin small letter a with macron")},{character:"Ă",title:t("Latin capital letter a with breve")},{character:"ă",title:t("Latin small letter a with breve")},{character:"Ą",title:t("Latin capital letter a with ogonek")},{character:"ą",title:t("Latin small letter a with ogonek")},{character:"Ć",title:t("Latin capital letter c with acute")},{character:"ć",title:t("Latin small letter c with acute")},{character:"Ĉ",title:t("Latin capital letter c with circumflex")},{character:"ĉ",title:t("Latin small letter c with circumflex")},{character:"Ċ",title:t("Latin capital letter c with dot above")},{character:"ċ",title:t("Latin small letter c with dot above")},{character:"Č",title:t("Latin capital letter c with caron")},{character:"č",title:t("Latin small letter c with caron")},{character:"Ď",title:t("Latin capital letter d with caron")},{character:"ď",title:t("Latin small letter d with caron")},{character:"Đ",title:t("Latin capital letter d with stroke")},{character:"đ",title:t("Latin small letter d with stroke")},{character:"Ē",title:t("Latin capital letter e with macron")},{character:"ē",title:t("Latin small letter e with macron")},{character:"Ĕ",title:t("Latin capital letter e with breve")},{character:"ĕ",title:t("Latin small letter e with breve")},{character:"Ė",title:t("Latin capital letter e with dot above")},{character:"ė",title:t("Latin small letter e with dot above")},{character:"Ę",title:t("Latin capital letter e with ogonek")},{character:"ę",title:t("Latin small letter e with ogonek")},{character:"Ě",title:t("Latin capital letter e with caron")},{character:"ě",title:t("Latin small letter e with caron")},{character:"Ĝ",title:t("Latin capital letter g with circumflex")},{character:"ĝ",title:t("Latin small letter g with circumflex")},{character:"Ğ",title:t("Latin capital letter g with breve")},{character:"ğ",title:t("Latin small letter g with breve")},{character:"Ġ",title:t("Latin capital letter g with dot above")},{character:"ġ",title:t("Latin small letter g with dot above")},{character:"Ģ",title:t("Latin capital letter g with cedilla")},{character:"ģ",title:t("Latin small letter g with cedilla")},{character:"Ĥ",title:t("Latin capital letter h with circumflex")},{character:"ĥ",title:t("Latin small letter h with circumflex")},{character:"Ħ",title:t("Latin capital letter h with stroke")},{character:"ħ",title:t("Latin small letter h with stroke")},{character:"Ĩ",title:t("Latin capital letter i with tilde")},{character:"ĩ",title:t("Latin small letter i with tilde")},{character:"Ī",title:t("Latin capital letter i with macron")},{character:"ī",title:t("Latin small letter i with macron")},{character:"Ĭ",title:t("Latin capital letter i with breve")},{character:"ĭ",title:t("Latin small letter i with breve")},{character:"Į",title:t("Latin capital letter i with ogonek")},{character:"į",title:t("Latin small letter i with ogonek")},{character:"İ",title:t("Latin capital letter i with dot above")},{character:"ı",title:t("Latin small letter dotless i")},{character:"IJ",title:t("Latin capital ligature ij")},{character:"ij",title:t("Latin small ligature ij")},{character:"Ĵ",title:t("Latin capital letter j with circumflex")},{character:"ĵ",title:t("Latin small letter j with circumflex")},{character:"Ķ",title:t("Latin capital letter k with cedilla")},{character:"ķ",title:t("Latin small letter k with cedilla")},{character:"ĸ",title:t("Latin small letter kra")},{character:"Ĺ",title:t("Latin capital letter l with acute")},{character:"ĺ",title:t("Latin small letter l with acute")},{character:"Ļ",title:t("Latin capital letter l with cedilla")},{character:"ļ",title:t("Latin small letter l with cedilla")},{character:"Ľ",title:t("Latin capital letter l with caron")},{character:"ľ",title:t("Latin small letter l with caron")},{character:"Ŀ",title:t("Latin capital letter l with middle dot")},{character:"ŀ",title:t("Latin small letter l with middle dot")},{character:"Ł",title:t("Latin capital letter l with stroke")},{character:"ł",title:t("Latin small letter l with stroke")},{character:"Ń",title:t("Latin capital letter n with acute")},{character:"ń",title:t("Latin small letter n with acute")},{character:"Ņ",title:t("Latin capital letter n with cedilla")},{character:"ņ",title:t("Latin small letter n with cedilla")},{character:"Ň",title:t("Latin capital letter n with caron")},{character:"ň",title:t("Latin small letter n with caron")},{character:"ʼn",title:t("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:t("Latin capital letter eng")},{character:"ŋ",title:t("Latin small letter eng")},{character:"Ō",title:t("Latin capital letter o with macron")},{character:"ō",title:t("Latin small letter o with macron")},{character:"Ŏ",title:t("Latin capital letter o with breve")},{character:"ŏ",title:t("Latin small letter o with breve")},{character:"Ő",title:t("Latin capital letter o with double acute")},{character:"ő",title:t("Latin small letter o with double acute")},{character:"Œ",title:t("Latin capital ligature oe")},{character:"œ",title:t("Latin small ligature oe")},{character:"Ŕ",title:t("Latin capital letter r with acute")},{character:"ŕ",title:t("Latin small letter r with acute")},{character:"Ŗ",title:t("Latin capital letter r with cedilla")},{character:"ŗ",title:t("Latin small letter r with cedilla")},{character:"Ř",title:t("Latin capital letter r with caron")},{character:"ř",title:t("Latin small letter r with caron")},{character:"Ś",title:t("Latin capital letter s with acute")},{character:"ś",title:t("Latin small letter s with acute")},{character:"Ŝ",title:t("Latin capital letter s with circumflex")},{character:"ŝ",title:t("Latin small letter s with circumflex")},{character:"Ş",title:t("Latin capital letter s with cedilla")},{character:"ş",title:t("Latin small letter s with cedilla")},{character:"Š",title:t("Latin capital letter s with caron")},{character:"š",title:t("Latin small letter s with caron")},{character:"Ţ",title:t("Latin capital letter t with cedilla")},{character:"ţ",title:t("Latin small letter t with cedilla")},{character:"Ť",title:t("Latin capital letter t with caron")},{character:"ť",title:t("Latin small letter t with caron")},{character:"Ŧ",title:t("Latin capital letter t with stroke")},{character:"ŧ",title:t("Latin small letter t with stroke")},{character:"Ũ",title:t("Latin capital letter u with tilde")},{character:"ũ",title:t("Latin small letter u with tilde")},{character:"Ū",title:t("Latin capital letter u with macron")},{character:"ū",title:t("Latin small letter u with macron")},{character:"Ŭ",title:t("Latin capital letter u with breve")},{character:"ŭ",title:t("Latin small letter u with breve")},{character:"Ů",title:t("Latin capital letter u with ring above")},{character:"ů",title:t("Latin small letter u with ring above")},{character:"Ű",title:t("Latin capital letter u with double acute")},{character:"ű",title:t("Latin small letter u with double acute")},{character:"Ų",title:t("Latin capital letter u with ogonek")},{character:"ų",title:t("Latin small letter u with ogonek")},{character:"Ŵ",title:t("Latin capital letter w with circumflex")},{character:"ŵ",title:t("Latin small letter w with circumflex")},{character:"Ŷ",title:t("Latin capital letter y with circumflex")},{character:"ŷ",title:t("Latin small letter y with circumflex")},{character:"Ÿ",title:t("Latin capital letter y with diaeresis")},{character:"Ź",title:t("Latin capital letter z with acute")},{character:"ź",title:t("Latin small letter z with acute")},{character:"Ż",title:t("Latin capital letter z with dot above")},{character:"ż",title:t("Latin small letter z with dot above")},{character:"Ž",title:t("Latin capital letter z with caron")},{character:"ž",title:t("Latin small letter z with caron")},{character:"ſ",title:t("Latin small letter long s")}],{label:t("Latin")})}}class R extends o{static get pluginName(){return"SpecialCharactersCurrency"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:t("Dollar sign")},{character:"€",title:t("Euro sign")},{character:"¥",title:t("Yen sign")},{character:"£",title:t("Pound sign")},{character:"¢",title:t("Cent sign")},{character:"₠",title:t("Euro-currency sign")},{character:"₡",title:t("Colon sign")},{character:"₢",title:t("Cruzeiro sign")},{character:"₣",title:t("French franc sign")},{character:"₤",title:t("Lira sign")},{character:"¤",title:t("Currency sign")},{character:"₿",title:t("Bitcoin sign")},{character:"₥",title:t("Mill sign")},{character:"₦",title:t("Naira sign")},{character:"₧",title:t("Peseta sign")},{character:"₨",title:t("Rupee sign")},{character:"₩",title:t("Won sign")},{character:"₪",title:t("New sheqel sign")},{character:"₫",title:t("Dong sign")},{character:"₭",title:t("Kip sign")},{character:"₮",title:t("Tugrik sign")},{character:"₯",title:t("Drachma sign")},{character:"₰",title:t("German penny sign")},{character:"₱",title:t("Peso sign")},{character:"₲",title:t("Guarani sign")},{character:"₳",title:t("Austral sign")},{character:"₴",title:t("Hryvnia sign")},{character:"₵",title:t("Cedi sign")},{character:"₶",title:t("Livre tournois sign")},{character:"₷",title:t("Spesmilo sign")},{character:"₸",title:t("Tenge sign")},{character:"₹",title:t("Indian rupee sign")},{character:"₺",title:t("Turkish lira sign")},{character:"₻",title:t("Nordic mark sign")},{character:"₼",title:t("Manat sign")},{character:"₽",title:t("Ruble sign")}],{label:t("Currency")})}}class Q extends o{static get pluginName(){return"SpecialCharactersEssentials"}static get isOfficialPlugin(){return!0}static get requires(){return[R,M,O,E,F]}}export{K as SpecialCharacters,E as SpecialCharactersArrows,R as SpecialCharactersCurrency,Q as SpecialCharactersEssentials,F as SpecialCharactersLatin,O as SpecialCharactersMathematical,M as SpecialCharactersText,A as _SpecialCharactersCategoriesView,P as _SpecialCharactersGridView,q as _SpecialCharactersInfoView,N as _SpecialCharactersView};
|
|
1
|
+
import{Plugin as o}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Typing as f}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{IconSpecialCharacters as b}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{Dialog as k,ButtonView as g,MenuBarMenuListItemButtonView as C,DialogViewPosition as _,View as h,LabeledFieldView as y,createLabeledDropdown as x,UIModel as v,addListToDropdown as V,addKeyboardHandlingForGrid as T,FocusCycler as S}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{CKEditorError as w,Collection as D,FocusTracker as p,KeystrokeHandler as m,global as G}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";class P extends h{tiles;focusTracker;keystrokes;constructor(e){super(e),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}}),this.focusTracker=new p,this.keystrokes=new m,T({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.tiles,numberOfColumns:()=>G.window.getComputedStyle(this.element.firstChild).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}createTile(e,t){const a=new g(this.locale);return a.set({label:e,withText:!0,class:"ck-character-grid__tile"}),a.extendTemplate({attributes:{title:t},on:{mouseover:a.bindTemplate.to("mouseover"),focus:a.bindTemplate.to("focus")}}),a.on("mouseover",()=>{this.fire("tileHover",{name:t,character:e})}),a.on("focus",()=>{this.fire("tileFocus",{name:t,character:e})}),a.on("execute",()=>{this.fire("execute",{name:t,character:e})}),a}render(){super.render();for(const e of this.tiles)this.focusTracker.add(e.element);this.tiles.on("change",(e,{added:t,removed:a})=>{if(t.length>0)for(const r of t)this.focusTracker.add(r.element);if(a.length>0)for(const r of a)this.focusTracker.remove(r.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}focus(){this.tiles.first.focus()}}class q extends h{constructor(e){super(e);const t=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",I),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:t.to("name",a=>a||"")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:t.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function I(c){return c===null?"":"U+"+("0000"+c.codePointAt(0).toString(16)).slice(-4)}class N extends h{items;focusTracker;keystrokes;_focusCycler;categoriesView;gridView;infoView;constructor(e,t,a,r){super(e),this.categoriesView=t,this.gridView=a,this.infoView=r,this.items=this.createCollection(),this.focusTracker=new p,this.keystrokes=new m,this._focusCycler=new S({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",children:[this.categoriesView,this.gridView,this.infoView],attributes:{tabindex:"-1"}}),this.items.add(this.categoriesView),this.items.add(this.gridView)}render(){super.render(),this.focusTracker.add(this.categoriesView.element),this.focusTracker.add(this.gridView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class A extends h{_groupNames;_dropdownView;constructor(e,t){super(e),this.set("currentGroupName",Array.from(t.entries())[0][0]),this._groupNames=t,this._dropdownView=new y(e,x),this.setTemplate({tag:"div",attributes:{class:["ck","ck-character-categories"]},children:[this._dropdownView]})}render(){super.render(),this._setupDropdown()}focus(){this._dropdownView.focus()}_setupDropdown(){const e=new D;for(const[r,i]of this._groupNames){const s={type:"button",model:new v({name:r,label:i,role:"menuitemradio",withText:!0})};s.model.bind("isOn").to(this,"currentGroupName",l=>l===r),e.add(s)}const t=this.locale.t,a=t("Category");this._dropdownView.set({label:a,isEmpty:!1}),this._dropdownView.fieldView.panelPosition=this.locale.uiLanguageDirection==="rtl"?"se":"sw",this._dropdownView.fieldView.buttonView.set({withText:!0,tooltip:a,ariaLabel:a,ariaLabelledBy:void 0,isOn:!1}),this._dropdownView.fieldView.buttonView.bind("label").to(this,"currentGroupName",r=>this._groupNames.get(r)),this._dropdownView.fieldView.on("execute",({source:r})=>{this.currentGroupName=r.name}),V(this._dropdownView.fieldView,e,{ariaLabel:a,role:"menu"})}}const u="All";class K extends o{_characters;_groups;_allSpecialCharactersGroupLabel;static get requires(){return[f,k]}static get pluginName(){return"SpecialCharacters"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._characters=new Map,this._groups=new Map,this._allSpecialCharactersGroupLabel=t("All")}init(){const e=this.editor;e.ui.componentFactory.add("specialCharacters",()=>{const t=this._createDialogButton(g);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:specialCharacters",()=>this._createDialogButton(C))}addItems(e,t,a={label:e}){if(e===u)throw new w("special-character-invalid-group-name",null);const r=this._getGroup(e,a.label);for(const i of t)r.items.add(i.title),this._characters.set(i.title,i.character)}getGroups(){const e=Array.from(this._groups.keys()),t=this.editor.config.get("specialCharacters.order")||[],a=t.find(r=>!e.includes(r));if(a)throw new w("special-character-invalid-order-group-name",null,{invalidGroup:a});return new Set([...t,...e])}getCharactersForGroup(e){if(e===u)return new Set(this._characters.keys());const t=this._groups.get(e);if(t)return t.items}getCharacter(e){return this._characters.get(e)}_getGroup(e,t){return this._groups.has(e)||this._groups.set(e,{items:new Set,label:t}),this._groups.get(e)}_updateGrid(e,t){t.tiles.clear();const a=this.getCharactersForGroup(e);for(const r of a){const i=this.getCharacter(r);t.tiles.add(t.createTile(i,r))}}_createDropdownPanelContent(e){const t=Array.from(this.getGroups()).map(l=>[l,this._groups.get(l).label]),a=new Map([[u,this._allSpecialCharactersGroupLabel],...t]),r=new A(e,a),i=new P(e),s=new q(e);return i.on("tileHover",(l,n)=>{s.set(n)}),i.on("tileFocus",(l,n)=>{s.set(n)}),r.on("change:currentGroupName",(l,n,d)=>{this._updateGrid(d,i)}),this._updateGrid(r.currentGroupName,i),{categoriesView:r,gridView:i,infoView:s}}_createDialogButton(e){const t=this.editor,a=t.locale,r=new e(t.locale),i=t.commands.get("insertText"),s=a.t,l=this.editor.plugins.get("Dialog");return r.set({label:s("Special characters"),icon:b,isToggleable:!0}),r.bind("isOn").to(l,"id",n=>n==="specialCharacters"),r.bind("isEnabled").to(i,"isEnabled"),r.on("execute",()=>{if(l.id==="specialCharacters"){l.hide();return}this._showDialog()}),r}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),a=e.locale,r=a.t,{categoriesView:i,gridView:s,infoView:l}=this._createDropdownPanelContent(a),n=new N(a,i,s,l);s.on("execute",(d,L)=>{e.execute("insertText",{text:L.character})}),t.show({id:"specialCharacters",title:r("Special characters"),className:"ck-special-characters",content:n,position:_.EDITOR_TOP_SIDE})}}class E extends o{static get pluginName(){return"SpecialCharactersArrows"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Arrows",[{title:t("leftwards simple arrow"),character:"←"},{title:t("rightwards simple arrow"),character:"→"},{title:t("upwards simple arrow"),character:"↑"},{title:t("downwards simple arrow"),character:"↓"},{title:t("leftwards double arrow"),character:"⇐"},{title:t("rightwards double arrow"),character:"⇒"},{title:t("upwards double arrow"),character:"⇑"},{title:t("downwards double arrow"),character:"⇓"},{title:t("leftwards dashed arrow"),character:"⇠"},{title:t("rightwards dashed arrow"),character:"⇢"},{title:t("upwards dashed arrow"),character:"⇡"},{title:t("downwards dashed arrow"),character:"⇣"},{title:t("leftwards arrow to bar"),character:"⇤"},{title:t("rightwards arrow to bar"),character:"⇥"},{title:t("upwards arrow to bar"),character:"⤒"},{title:t("downwards arrow to bar"),character:"⤓"},{title:t("up down arrow with base"),character:"↨"},{title:t("back with leftwards arrow above"),character:"🔙"},{title:t("end with leftwards arrow above"),character:"🔚"},{title:t("on with exclamation mark with left right arrow above"),character:"🔛"},{title:t("soon with rightwards arrow above"),character:"🔜"},{title:t("top with upwards arrow above"),character:"🔝"}],{label:t("Arrows")})}}class M extends o{static get pluginName(){return"SpecialCharactersText"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:t("Single left-pointing angle quotation mark")},{character:"›",title:t("Single right-pointing angle quotation mark")},{character:"«",title:t("Left-pointing double angle quotation mark")},{character:"»",title:t("Right-pointing double angle quotation mark")},{character:"‘",title:t("Left single quotation mark")},{character:"’",title:t("Right single quotation mark")},{character:"“",title:t("Left double quotation mark")},{character:"”",title:t("Right double quotation mark")},{character:"‚",title:t("Single low-9 quotation mark")},{character:"„",title:t("Double low-9 quotation mark")},{character:"¡",title:t("Inverted exclamation mark")},{character:"¿",title:t("Inverted question mark")},{character:"‥",title:t("Two dot leader")},{character:"…",title:t("Horizontal ellipsis")},{character:"‡",title:t("Double dagger")},{character:"‰",title:t("Per mille sign")},{character:"‱",title:t("Per ten thousand sign")},{character:"‼",title:t("Double exclamation mark")},{character:"⁈",title:t("Question exclamation mark")},{character:"⁉",title:t("Exclamation question mark")},{character:"⁇",title:t("Double question mark")},{character:"©",title:t("Copyright sign")},{character:"®",title:t("Registered sign")},{character:"™",title:t("Trade mark sign")},{character:"§",title:t("Section sign")},{character:"¶",title:t("Paragraph sign")},{character:"⁋",title:t("Reversed paragraph sign")}],{label:t("Text")})}}class O extends o{static get pluginName(){return"SpecialCharactersMathematical"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:t("Less-than sign")},{character:">",title:t("Greater-than sign")},{character:"≤",title:t("Less-than or equal to")},{character:"≥",title:t("Greater-than or equal to")},{character:"–",title:t("En dash")},{character:"—",title:t("Em dash")},{character:"¯",title:t("Macron")},{character:"‾",title:t("Overline")},{character:"°",title:t("Degree sign")},{character:"−",title:t("Minus sign")},{character:"±",title:t("Plus-minus sign")},{character:"÷",title:t("Division sign")},{character:"⁄",title:t("Fraction slash")},{character:"×",title:t("Multiplication sign")},{character:"ƒ",title:t("Latin small letter f with hook")},{character:"∫",title:t("Integral")},{character:"∑",title:t("N-ary summation")},{character:"∞",title:t("Infinity")},{character:"√",title:t("Square root")},{character:"∼",title:t("Tilde operator")},{character:"≅",title:t("Approximately equal to")},{character:"≈",title:t("Almost equal to")},{character:"≠",title:t("Not equal to")},{character:"≡",title:t("Identical to")},{character:"∈",title:t("Element of")},{character:"∉",title:t("Not an element of")},{character:"∋",title:t("Contains as member")},{character:"∏",title:t("N-ary product")},{character:"∧",title:t("Logical and")},{character:"∨",title:t("Logical or")},{character:"¬",title:t("Not sign")},{character:"∩",title:t("Intersection")},{character:"∪",title:t("Union")},{character:"∂",title:t("Partial differential")},{character:"∀",title:t("For all")},{character:"∃",title:t("There exists")},{character:"∅",title:t("Empty set")},{character:"∇",title:t("Nabla")},{character:"∗",title:t("Asterisk operator")},{character:"∝",title:t("Proportional to")},{character:"∠",title:t("Angle")},{character:"¼",title:t("Vulgar fraction one quarter")},{character:"½",title:t("Vulgar fraction one half")},{character:"¾",title:t("Vulgar fraction three quarters")}],{label:t("Mathematical")})}}class F extends o{static get pluginName(){return"SpecialCharactersLatin"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:t("Latin capital letter a with macron")},{character:"ā",title:t("Latin small letter a with macron")},{character:"Ă",title:t("Latin capital letter a with breve")},{character:"ă",title:t("Latin small letter a with breve")},{character:"Ą",title:t("Latin capital letter a with ogonek")},{character:"ą",title:t("Latin small letter a with ogonek")},{character:"Ć",title:t("Latin capital letter c with acute")},{character:"ć",title:t("Latin small letter c with acute")},{character:"Ĉ",title:t("Latin capital letter c with circumflex")},{character:"ĉ",title:t("Latin small letter c with circumflex")},{character:"Ċ",title:t("Latin capital letter c with dot above")},{character:"ċ",title:t("Latin small letter c with dot above")},{character:"Č",title:t("Latin capital letter c with caron")},{character:"č",title:t("Latin small letter c with caron")},{character:"Ď",title:t("Latin capital letter d with caron")},{character:"ď",title:t("Latin small letter d with caron")},{character:"Đ",title:t("Latin capital letter d with stroke")},{character:"đ",title:t("Latin small letter d with stroke")},{character:"Ē",title:t("Latin capital letter e with macron")},{character:"ē",title:t("Latin small letter e with macron")},{character:"Ĕ",title:t("Latin capital letter e with breve")},{character:"ĕ",title:t("Latin small letter e with breve")},{character:"Ė",title:t("Latin capital letter e with dot above")},{character:"ė",title:t("Latin small letter e with dot above")},{character:"Ę",title:t("Latin capital letter e with ogonek")},{character:"ę",title:t("Latin small letter e with ogonek")},{character:"Ě",title:t("Latin capital letter e with caron")},{character:"ě",title:t("Latin small letter e with caron")},{character:"Ĝ",title:t("Latin capital letter g with circumflex")},{character:"ĝ",title:t("Latin small letter g with circumflex")},{character:"Ğ",title:t("Latin capital letter g with breve")},{character:"ğ",title:t("Latin small letter g with breve")},{character:"Ġ",title:t("Latin capital letter g with dot above")},{character:"ġ",title:t("Latin small letter g with dot above")},{character:"Ģ",title:t("Latin capital letter g with cedilla")},{character:"ģ",title:t("Latin small letter g with cedilla")},{character:"Ĥ",title:t("Latin capital letter h with circumflex")},{character:"ĥ",title:t("Latin small letter h with circumflex")},{character:"Ħ",title:t("Latin capital letter h with stroke")},{character:"ħ",title:t("Latin small letter h with stroke")},{character:"Ĩ",title:t("Latin capital letter i with tilde")},{character:"ĩ",title:t("Latin small letter i with tilde")},{character:"Ī",title:t("Latin capital letter i with macron")},{character:"ī",title:t("Latin small letter i with macron")},{character:"Ĭ",title:t("Latin capital letter i with breve")},{character:"ĭ",title:t("Latin small letter i with breve")},{character:"Į",title:t("Latin capital letter i with ogonek")},{character:"į",title:t("Latin small letter i with ogonek")},{character:"İ",title:t("Latin capital letter i with dot above")},{character:"ı",title:t("Latin small letter dotless i")},{character:"IJ",title:t("Latin capital ligature ij")},{character:"ij",title:t("Latin small ligature ij")},{character:"Ĵ",title:t("Latin capital letter j with circumflex")},{character:"ĵ",title:t("Latin small letter j with circumflex")},{character:"Ķ",title:t("Latin capital letter k with cedilla")},{character:"ķ",title:t("Latin small letter k with cedilla")},{character:"ĸ",title:t("Latin small letter kra")},{character:"Ĺ",title:t("Latin capital letter l with acute")},{character:"ĺ",title:t("Latin small letter l with acute")},{character:"Ļ",title:t("Latin capital letter l with cedilla")},{character:"ļ",title:t("Latin small letter l with cedilla")},{character:"Ľ",title:t("Latin capital letter l with caron")},{character:"ľ",title:t("Latin small letter l with caron")},{character:"Ŀ",title:t("Latin capital letter l with middle dot")},{character:"ŀ",title:t("Latin small letter l with middle dot")},{character:"Ł",title:t("Latin capital letter l with stroke")},{character:"ł",title:t("Latin small letter l with stroke")},{character:"Ń",title:t("Latin capital letter n with acute")},{character:"ń",title:t("Latin small letter n with acute")},{character:"Ņ",title:t("Latin capital letter n with cedilla")},{character:"ņ",title:t("Latin small letter n with cedilla")},{character:"Ň",title:t("Latin capital letter n with caron")},{character:"ň",title:t("Latin small letter n with caron")},{character:"ʼn",title:t("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:t("Latin capital letter eng")},{character:"ŋ",title:t("Latin small letter eng")},{character:"Ō",title:t("Latin capital letter o with macron")},{character:"ō",title:t("Latin small letter o with macron")},{character:"Ŏ",title:t("Latin capital letter o with breve")},{character:"ŏ",title:t("Latin small letter o with breve")},{character:"Ő",title:t("Latin capital letter o with double acute")},{character:"ő",title:t("Latin small letter o with double acute")},{character:"Œ",title:t("Latin capital ligature oe")},{character:"œ",title:t("Latin small ligature oe")},{character:"Ŕ",title:t("Latin capital letter r with acute")},{character:"ŕ",title:t("Latin small letter r with acute")},{character:"Ŗ",title:t("Latin capital letter r with cedilla")},{character:"ŗ",title:t("Latin small letter r with cedilla")},{character:"Ř",title:t("Latin capital letter r with caron")},{character:"ř",title:t("Latin small letter r with caron")},{character:"Ś",title:t("Latin capital letter s with acute")},{character:"ś",title:t("Latin small letter s with acute")},{character:"Ŝ",title:t("Latin capital letter s with circumflex")},{character:"ŝ",title:t("Latin small letter s with circumflex")},{character:"Ş",title:t("Latin capital letter s with cedilla")},{character:"ş",title:t("Latin small letter s with cedilla")},{character:"Š",title:t("Latin capital letter s with caron")},{character:"š",title:t("Latin small letter s with caron")},{character:"Ţ",title:t("Latin capital letter t with cedilla")},{character:"ţ",title:t("Latin small letter t with cedilla")},{character:"Ť",title:t("Latin capital letter t with caron")},{character:"ť",title:t("Latin small letter t with caron")},{character:"Ŧ",title:t("Latin capital letter t with stroke")},{character:"ŧ",title:t("Latin small letter t with stroke")},{character:"Ũ",title:t("Latin capital letter u with tilde")},{character:"ũ",title:t("Latin small letter u with tilde")},{character:"Ū",title:t("Latin capital letter u with macron")},{character:"ū",title:t("Latin small letter u with macron")},{character:"Ŭ",title:t("Latin capital letter u with breve")},{character:"ŭ",title:t("Latin small letter u with breve")},{character:"Ů",title:t("Latin capital letter u with ring above")},{character:"ů",title:t("Latin small letter u with ring above")},{character:"Ű",title:t("Latin capital letter u with double acute")},{character:"ű",title:t("Latin small letter u with double acute")},{character:"Ų",title:t("Latin capital letter u with ogonek")},{character:"ų",title:t("Latin small letter u with ogonek")},{character:"Ŵ",title:t("Latin capital letter w with circumflex")},{character:"ŵ",title:t("Latin small letter w with circumflex")},{character:"Ŷ",title:t("Latin capital letter y with circumflex")},{character:"ŷ",title:t("Latin small letter y with circumflex")},{character:"Ÿ",title:t("Latin capital letter y with diaeresis")},{character:"Ź",title:t("Latin capital letter z with acute")},{character:"ź",title:t("Latin small letter z with acute")},{character:"Ż",title:t("Latin capital letter z with dot above")},{character:"ż",title:t("Latin small letter z with dot above")},{character:"Ž",title:t("Latin capital letter z with caron")},{character:"ž",title:t("Latin small letter z with caron")},{character:"ſ",title:t("Latin small letter long s")}],{label:t("Latin")})}}class R extends o{static get pluginName(){return"SpecialCharactersCurrency"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;e.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:t("Dollar sign")},{character:"€",title:t("Euro sign")},{character:"¥",title:t("Yen sign")},{character:"£",title:t("Pound sign")},{character:"¢",title:t("Cent sign")},{character:"₠",title:t("Euro-currency sign")},{character:"₡",title:t("Colon sign")},{character:"₢",title:t("Cruzeiro sign")},{character:"₣",title:t("French franc sign")},{character:"₤",title:t("Lira sign")},{character:"¤",title:t("Currency sign")},{character:"₿",title:t("Bitcoin sign")},{character:"₥",title:t("Mill sign")},{character:"₦",title:t("Naira sign")},{character:"₧",title:t("Peseta sign")},{character:"₨",title:t("Rupee sign")},{character:"₩",title:t("Won sign")},{character:"₪",title:t("New sheqel sign")},{character:"₫",title:t("Dong sign")},{character:"₭",title:t("Kip sign")},{character:"₮",title:t("Tugrik sign")},{character:"₯",title:t("Drachma sign")},{character:"₰",title:t("German penny sign")},{character:"₱",title:t("Peso sign")},{character:"₲",title:t("Guarani sign")},{character:"₳",title:t("Austral sign")},{character:"₴",title:t("Hryvnia sign")},{character:"₵",title:t("Cedi sign")},{character:"₶",title:t("Livre tournois sign")},{character:"₷",title:t("Spesmilo sign")},{character:"₸",title:t("Tenge sign")},{character:"₹",title:t("Indian rupee sign")},{character:"₺",title:t("Turkish lira sign")},{character:"₻",title:t("Nordic mark sign")},{character:"₼",title:t("Manat sign")},{character:"₽",title:t("Ruble sign")}],{label:t("Currency")})}}class Q extends o{static get pluginName(){return"SpecialCharactersEssentials"}static get isOfficialPlugin(){return!0}static get requires(){return[R,M,O,E,F]}}export{K as SpecialCharacters,E as SpecialCharactersArrows,R as SpecialCharactersCurrency,Q as SpecialCharactersEssentials,F as SpecialCharactersLatin,O as SpecialCharactersMathematical,M as SpecialCharactersText,A as _SpecialCharactersCategoriesView,P as _SpecialCharactersGridView,q as _SpecialCharactersInfoView,N as _SpecialCharactersView};
|