@ncino/web-components 4.3.0-preview.1 → 4.3.0-preview.11
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/external3.js +1 -0
- package/dist/_virtual/index10.js +1 -1
- package/dist/_virtual/index11.js +1 -1
- package/dist/_virtual/index12.js +1 -0
- package/dist/_virtual/index13.js +1 -0
- package/dist/_virtual/index2.js +1 -1
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index7.js +1 -1
- package/dist/_virtual/index8.js +1 -1
- package/dist/_virtual/index9.js +1 -1
- package/dist/_virtual/index_react.js +1 -0
- package/dist/_virtual/index_react2.js +1 -0
- package/dist/_virtual/react.production.js +1 -0
- package/dist/assets/node_modules/.pnpm/{ckeditor5@45.1.0 → ckeditor5@45.2.1}/node_modules/ckeditor5/dist/ckeditor5.css +1 -1
- package/dist/components/alert/alert.gator.figma.js +7 -0
- package/dist/components/avatar/gator/avatar.gator.figma.js +9 -0
- package/dist/components/banner/gator/banner.gator.figma.js +8 -0
- package/dist/components/banner/gator/banner.gator.js +6 -5
- package/dist/components/boolean/boolean.gator.figma.js +11 -0
- package/dist/components/button/gator/button.gator.figma.js +12 -4
- package/dist/components/button-group/gator/button-group.gator.figma.js +7 -0
- package/dist/components/checkbox/checkbox.gator.js +9 -6
- package/dist/components/icon/gator/icon.gator.figma.js +7 -2
- package/dist/components/icon/gator/icons.gator.figma.js +1 -0
- package/dist/components/input/gator/dropdown/input-dropdown.gator.js +1 -1
- package/dist/components/input/gator/input-date/input-date.gator.js +1 -1
- package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
- package/dist/components/input/gator/input-time/input-time.gator.js +1 -1
- package/dist/components/input-rich-text/ckeditor-config.js +1 -1
- package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
- package/dist/components/menu/base/gator/menu.gator.js +1 -1
- package/dist/components/menu/menu-item/gator/menu-item.gator.js +2 -2
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/components/popover/gator/popover.gator.js +1 -1
- package/dist/components/table/gator/__tests__/test-table-data.js +1 -1
- package/dist/components/table/gator/table.gator.js +77 -32
- package/dist/components/tooltip/gator/tooltip.gator.js +1 -1
- package/dist/components/tooltip/slds/tooltip.slds.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@45.1.0 → @ckeditor_ckeditor5-alignment@45.2.1}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@45.1.0 → @ckeditor_ckeditor5-autoformat@45.2.1}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@45.1.0 → @ckeditor_ckeditor5-autosave@45.2.1}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@45.1.0 → @ckeditor_ckeditor5-basic-styles@45.2.1}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@45.1.0 → @ckeditor_ckeditor5-block-quote@45.2.1}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-clipboard@45.1.0 → @ckeditor_ckeditor5-clipboard@45.2.1}/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@45.1.0 → @ckeditor_ckeditor5-cloud-services@45.2.1}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@45.1.0 → @ckeditor_ckeditor5-code-block@45.2.1}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-core@45.1.0 → @ckeditor_ckeditor5-core@45.2.1}/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@45.1.0 → @ckeditor_ckeditor5-editor-classic@45.2.1}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-engine@45.1.0 → @ckeditor_ckeditor5-engine@45.2.1}/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +10 -10
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@45.1.0 → @ckeditor_ckeditor5-enter@45.2.1}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@45.1.0 → @ckeditor_ckeditor5-essentials@45.2.1}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@45.1.0 → @ckeditor_ckeditor5-find-and-replace@45.2.1}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@45.1.0 → @ckeditor_ckeditor5-font@45.2.1}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@45.1.0 → @ckeditor_ckeditor5-heading@45.2.1}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@45.1.0 → @ckeditor_ckeditor5-highlight@45.2.1}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@45.1.0 → @ckeditor_ckeditor5-horizontal-line@45.2.1}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-embed@45.1.0 → @ckeditor_ckeditor5-html-embed@45.2.1}/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-support@45.1.0 → @ckeditor_ckeditor5-html-support@45.2.1}/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-image@45.1.0 → @ckeditor_ckeditor5-image@45.2.1}/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-indent@45.1.0 → @ckeditor_ckeditor5-indent@45.2.1}/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@45.1.0 → @ckeditor_ckeditor5-language@45.2.1}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-link@45.1.0 → @ckeditor_ckeditor5-link@45.2.1}/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-list@45.1.0 → @ckeditor_ckeditor5-list@45.2.1}/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@45.1.0 → @ckeditor_ckeditor5-markdown-gfm@45.2.1}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-media-embed@45.1.0 → @ckeditor_ckeditor5-media-embed@45.2.1}/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@45.1.0 → @ckeditor_ckeditor5-mention@45.2.1}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-page-break@45.1.0 → @ckeditor_ckeditor5-page-break@45.2.1}/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@45.1.0 → @ckeditor_ckeditor5-paragraph@45.2.1}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@45.2.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +28 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@45.1.0 → @ckeditor_ckeditor5-remove-format@45.2.1}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@45.1.0 → @ckeditor_ckeditor5-select-all@45.2.1}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@45.1.0 → @ckeditor_ckeditor5-show-blocks@45.2.1}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@45.2.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-special-characters@45.1.0 → @ckeditor_ckeditor5-special-characters@45.2.1}/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@45.1.0 → @ckeditor_ckeditor5-style@45.2.1}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-table@45.1.0 → @ckeditor_ckeditor5-table@45.2.1}/node_modules/@ckeditor/ckeditor5-table/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +13 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-ui@45.1.0 → @ckeditor_ckeditor5-ui@45.2.1}/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@45.1.0 → @ckeditor_ckeditor5-undo@45.2.1}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@45.1.0 → @ckeditor_ckeditor5-upload@45.2.1}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +112 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-widget@45.1.0 → @ckeditor_ckeditor5-widget@45.2.1}/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/client/external.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/common/updates.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/react/external.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.3/node_modules/@figma/code-connect/dist/react/index_react.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +1 -0
- package/dist/node_modules/.pnpm/{@storybook_instrumenter@8.6.14_storybook@8.6.14_prettier@3.5.3_ → @storybook_instrumenter@8.6.14_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/instrumenter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@storybook_test@8.6.14_storybook@8.6.14_prettier@3.5.3_ → @storybook_test@8.6.14_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/test/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@vitest_expect@3.2.0 → @vitest_expect@3.2.4}/node_modules/@vitest/expect/dist/index.js +10 -10
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +5 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +27 -0
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@vitest_utils@3.2.0 → @vitest_utils@3.2.4}/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +1 -1
- package/dist/node_modules/.pnpm/{@vitest_utils@3.2.0 → @vitest_utils@3.2.4}/node_modules/@vitest/utils/dist/diff.js +1 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +2 -0
- package/dist/node_modules/.pnpm/{@vitest_utils@3.2.0 → @vitest_utils@3.2.4}/node_modules/@vitest/utils/dist/helpers.js +1 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +1 -1
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js +1 -1
- package/dist/node_modules/.pnpm/call-bind@1.0.8/node_modules/call-bind/index.js +1 -1
- package/dist/node_modules/.pnpm/color-parse@1.4.2/node_modules/color-parse/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/js-tokens@9.0.1/node_modules/js-tokens/index.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.9/node_modules/libphonenumber-js/metadata.min.json.js +1 -0
- package/dist/node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/html.js +2 -0
- package/dist/node_modules/.pnpm/loupe@3.1.4/node_modules/loupe/lib/index.js +1 -0
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js +9 -0
- package/dist/node_modules/.pnpm/react@19.1.0/node_modules/react/index.js +1 -0
- package/dist/node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js +1 -1
- package/dist/node_modules/.pnpm/strip-literal@3.0.0/node_modules/strip-literal/dist/index.js +1 -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/api/index.js +1 -1
- package/dist/node_modules/.pnpm/{vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.29_@vitest_browser@3.2.0_@vitest_ui@_380928fb48d45118a64498d466bac5bf → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +1 -1
- package/dist/node_modules/.pnpm/{vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.29_@vitest_browser@3.2.0_@vitest_ui@_380928fb48d45118a64498d466bac5bf → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +1 -1
- package/dist/packages/web-components/src/components/banner/gator/banner.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/table/gator/table.gator.scss.js +1 -1
- package/dist/types/components/alert/alert.gator.figma.d.ts +1 -0
- package/dist/types/components/avatar/gator/avatar.gator.figma.d.ts +1 -0
- package/dist/types/components/banner/gator/banner.gator.d.ts +5 -0
- package/dist/types/components/banner/gator/banner.gator.figma.d.ts +1 -0
- package/dist/types/components/boolean/boolean.gator.figma.d.ts +1 -0
- package/dist/types/components/button-group/gator/button-group.gator.figma.d.ts +1 -0
- package/dist/types/components/checkbox/checkbox.gator.d.ts +4 -0
- package/dist/types/components/icon/gator/icons.gator.figma.d.ts +1 -0
- package/dist/types/components/menu/menu-item/gator/menu-item.gator.d.ts +1 -0
- package/dist/types/components/table/gator/__tests__/test-table-data.d.ts +31 -0
- package/dist/types/components/table/gator/table.gator.d.ts +5 -0
- package/dist/types/components/table/table.d.ts +2 -0
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +21 -20
- package/web-types.json +11 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@45.1.0/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +0 -28
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@45.1.0/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +0 -12
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@45.1.0/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +0 -13
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@45.1.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +0 -104
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.1/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.1/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -1
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.0/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -5
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.0/node_modules/@vitest/snapshot/dist/index.js +0 -27
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.0/node_modules/@vitest/spy/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/error.js +0 -2
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.0/node_modules/@vitest/utils/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.8/node_modules/libphonenumber-js/metadata.min.json.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/html.js +0 -2
- package/dist/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/index.js +0 -1
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@45.1.0 → @ckeditor_ckeditor5-icons@45.2.1}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@45.1.0 → @ckeditor_ckeditor5-watchdog@45.2.1}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.14_prettier@3.5.3_storybook@8.6.14_prettier@3.5.3_ → @storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/core/dist/channels/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.14_prettier@3.5.3_storybook@8.6.14_prettier@3.5.3_ → @storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/core/dist/client-logger/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.14_prettier@3.5.3_storybook@8.6.14_prettier@3.5.3_ → @storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/core/dist/core-events/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.14_prettier@3.5.3_storybook@8.6.14_prettier@3.5.3_ → @storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/core/dist/csf/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.14_prettier@3.5.3_storybook@8.6.14_prettier@3.5.3_ → @storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/core/dist/preview-api/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@storybook_core@8.6.14_prettier@3.5.3_storybook@8.6.14_prettier@3.5.3_ → @storybook_core@8.6.14_prettier@3.6.2_storybook@8.6.14_prettier@3.6.2_}/node_modules/@storybook/core/dist/preview-errors.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_browser@3.2.0_msw@2.7.3_@types_node@22.15.29_typescript@5.8.3__playwright@1.52._b8e25df0066052f4b376435335cc964b → @vitest_browser@3.2.4_msw@2.7.3_@types_node@24.0.7_typescript@5.8.3__playwright@1.53.1__894c207534f0ba223b8299d9f5ff1049}/node_modules/@vitest/browser/context.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_pretty-format@3.2.0 → @vitest_pretty-format@3.2.4}/node_modules/@vitest/pretty-format/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_utils@3.2.0 → @vitest_utils@3.2.4}/node_modules/@vitest/utils/dist/source-map.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/format.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/isPossible.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/metadata.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/parse.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.8 → libphonenumber-js@1.12.9}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/arguments.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/array.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/bigint.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/class.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/date.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/error.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/function.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/map.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/number.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/object.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/promise.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/regexp.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/set.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/string.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/symbol.js +0 -0
- /package/dist/node_modules/.pnpm/{loupe@3.1.3 → loupe@3.1.4}/node_modules/loupe/lib/typedarray.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.29_@vitest_browser@3.2.0_@vitest_ui@_380928fb48d45118a64498d466bac5bf → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.0_@types_debug@4.1.12_@types_node@22.15.29_@vitest_browser@3.2.0_@vitest_ui@_380928fb48d45118a64498d466bac5bf → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.7_@vitest_browser@3.2.4_@vitest_ui@3._93f645c93c51b497c065da8f21fff0a5}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var Y=Object.defineProperty;var J=(o,r,e)=>r in o?Y(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e;var h=(o,r,e)=>J(o,typeof r!="symbol"?r+"":r,e);import{Plugin as O,Command as $}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{keyCodes as E,ObservableMixin as X,env as T,count as Z,isInsideSurrogatePair as ee,isInsideCombinedSymbol as te,isInsideEmojiSequence as ne,EventInfo as ie}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{_tryFixingModelRange as W,BubblingEventInfo as F,DomEventData as R,Observer as U,MouseObserver as se,TouchObserver as oe,LiveRange as re,FocusObserver as ce}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{escapeRegExp as le}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/string/escapeRegExp.js";import{debounce as ae}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/debounce.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
|
+
*/class Q{constructor(r,e=20){h(this,"model");h(this,"limit");h(this,"_isLocked");h(this,"_size");h(this,"_batch",null);h(this,"_changeCallback");h(this,"_selectionChangeCallback");this.model=r,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(t,n)=>{n.isLocal&&n.isUndoable&&n!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(r){this._size+=r,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(r=!1){(!this.isLocked||r)&&(this._batch=null,this._size=0)}}class ue extends ${constructor(e,t){super(e);h(this,"_buffer");this._buffer=new Q(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",s=i.length;let l=n.selection;if(e.selection?l=e.selection:e.range&&(l=t.createSelection(e.range)),!t.canEditAt(l))return;const c=e.resultRange;t.enqueueChange(this._buffer.batch,a=>{this._buffer.lock();const u=Array.from(n.selection.getAttributes());t.deleteContent(l),i&&t.insertContent(a.createText(i,u),l),c?a.setSelection(c):l.is("documentSelection")||a.setSelection(l),this._buffer.unlock(),this._buffer.input(s)})}}const j=["insertText","insertReplacementText"],de=[...j,"insertCompositionText"];class fe extends U{constructor(e){super(e);h(this,"focusObserver");this.focusObserver=e.getObserver(ce);const t=T.isAndroid?de:j,n=e.document;n.on("beforeinput",(i,s)=>{if(!this.isEnabled)return;const{data:l,targetRanges:c,inputType:a,domEvent:u,isComposing:d}=s;if(!t.includes(a))return;this.focusObserver.flush();const f=new ie(n,"insertText");n.fire(f,new R(e,u,{text:l,selection:e.createSelection(c),isComposing:d})),f.stop.called&&i.stop()}),T.isAndroid||n.on("compositionend",(i,{data:s,domEvent:l})=>{this.isEnabled&&s&&n.fire("insertText",new R(e,l,{text:s,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}}class he extends O{constructor(){super(...arguments);h(this,"_typingQueue")}static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.editing.mapper,s=t.document.selection;this._typingQueue=new me(e),n.addObserver(fe);const l=new ue(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",l),e.commands.add("input",l),this.listenTo(n.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(n.document,"insertText",(c,a)=>{const{text:u,selection:d}=a;if(n.document.selection.isFake&&d&&n.document.selection.isSimilar(d)&&a.preventDefault(),d&&Array.from(d.getRanges()).some(m=>!m.isCollapsed)&&a.preventDefault(),!l.isEnabled){a.preventDefault();return}let f;d?f=Array.from(d.getRanges()).map(m=>i.toModelRange(m)).map(m=>W(m,t.schema)||m):f=Array.from(s.getRanges());let g=u;if(T.isAndroid){const m=Array.from(f[0].getItems()).reduce((_,w)=>_+(w.is("$textProxy")?w.data:""),"");if(m&&(m.length<=g.length?g.startsWith(m)&&(g=g.substring(m.length),f[0].start=f[0].start.getShiftedBy(m.length)):m.startsWith(g)&&(f[0].start=f[0].start.getShiftedBy(g.length),g="")),g.length==0&&f[0].isCollapsed)return}const p={text:g,selection:t.createSelection(f)};this._typingQueue.push(p,!!a.isComposing),a.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),T.isAndroid?this.listenTo(n.document,"keydown",(c,a)=>{s.isCollapsed||a.keyCode!=229||!n.document.isComposing||I(t,l)}):this.listenTo(n.document,"compositionstart",()=>{s.isCollapsed||I(t,l)},{priority:"high"}),this.listenTo(n.document,"mutations",(c,{mutations:a})=>{if(this._typingQueue.hasAffectedElements())for(const{node:u}of a){const d=pe(u,i),f=i.toModelElement(d);if(this._typingQueue.isElementAffected(f)){this._typingQueue.flush("mutations");return}}}),this.listenTo(n.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(n.document,"compositionend",()=>{this._typingQueue.flush("after composition end");const c=[];if(this._typingQueue.hasAffectedElements())for(const a of this._typingQueue.flushAffectedElements()){const u=i.toViewElement(a);u&&c.push({type:"children",node:u})}(c.length||!T.isAndroid)&&n.document.fire("mutations",{mutations:c})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}}class me{constructor(r){h(this,"editor");h(this,"flushDebounced",ae(()=>this.flush("timeout"),50));h(this,"_queue",[]);h(this,"_isComposing",!1);h(this,"_affectedElements",new Set);this.editor=r}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(r,e){const t={text:r.text};if(r.selection){t.selectionRanges=[];for(const n of r.selection.getRanges())t.selectionRanges.push(re.fromRange(n)),this._affectedElements.add(n.start.parent)}this._queue.push(t),this._isComposing||(this._isComposing=e),this.flushDebounced()}shift(){const r=this._queue.shift(),e={text:r.text};if(r.selectionRanges){const t=r.selectionRanges.map(n=>ge(n)).filter(n=>!!n);t.length&&(e.selection=this.editor.model.createSelection(t))}return e}flush(r){const e=this.editor,t=e.model,n=e.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const s=e.commands.get("insertText").buffer;t.enqueueChange(s.batch,()=>{for(s.lock();this._queue.length;){const l=this.shift();e.execute("insertText",l)}s.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),n.scrollToTheSelection()}isElementAffected(r){return this._affectedElements.has(r)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){const r=Array.from(this._affectedElements);return this._affectedElements.clear(),r}}function I(o,r){if(!r.isEnabled)return;const e=r.buffer;e.lock(),o.enqueueChange(e.batch,()=>{o.deleteContent(o.document.selection)}),e.unlock()}function ge(o){const r=o.toRange();return o.detach(),r.root.rootName=="$graveyard"?null:r}function pe(o,r){let e=o.is("$text")?o.parent:o;for(;!r.toModelElement(e);)e=e.parent;return e}class L extends ${constructor(e,t){super(e);h(this,"direction");h(this,"_buffer");this.direction=t,this._buffer=new Q(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const s=i.createSelection(e.selection||n.selection);if(!t.canEditAt(s))return;const l=e.sequence||1,c=s.isCollapsed;if(s.isCollapsed&&t.modifySelection(s,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(l)){this._replaceEntireContentWithParagraph(i);return}if(this._shouldReplaceFirstBlockWithParagraph(s,l)){this.editor.execute("paragraph",{selection:s});return}if(s.isCollapsed)return;let a=0;s.getFirstRange().getMinimalFlatRanges().forEach(u=>{a+=Z(u.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(s,{doNotResetEntireContent:c,direction:this.direction}),this._buffer.input(a),i.setSelection(s),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,s=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(s))||!t.schema.checkChild(s,"paragraph"))return!1;const c=s.getChild(0);return!(c&&c.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,s=t.schema.getLimitElement(i),l=e.createElement("paragraph");e.remove(e.createRangeIn(s)),e.insert(l,s),e.setSelection(l,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const i=e.getFirstPosition(),s=n.schema.getLimitElement(i),l=s.getChild(0);return!(i.parent!=l||!e.containsEntireContent(l)||!n.schema.checkChild(s,"paragraph")||l.name=="paragraph")}}const be="character",q="word",_e="codePoint",y="selection",x="backward",k="forward",H={deleteContent:{unit:y,direction:x},deleteContentBackward:{unit:_e,direction:x},deleteWordBackward:{unit:q,direction:x},deleteHardLineBackward:{unit:y,direction:x},deleteSoftLineBackward:{unit:y,direction:x},deleteContentForward:{unit:be,direction:k},deleteWordForward:{unit:q,direction:k},deleteHardLineForward:{unit:y,direction:k},deleteSoftLineForward:{unit:y,direction:k}};class ve extends U{constructor(r){super(r);const e=r.document;let t=0;e.on("keydown",()=>{t++}),e.on("keyup",()=>{t=0}),e.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:l,inputType:c}=i,a=H[c];if(!a)return;const u={direction:a.direction,unit:a.unit,sequence:t};u.unit==y&&(u.selectionToRemove=r.createSelection(s[0])),c==="deleteContentBackward"&&(T.isAndroid&&(u.sequence=1),Ee(s)&&(u.unit=y,u.selectionToRemove=r.createSelection(s)));const d=new F(e,"delete",s[0]);e.fire(d,new R(r,l,u)),d.stop.called&&n.stop()}),T.isBlink&&ye(this)}observe(){}stopObserving(){}}function ye(o){const r=o.view,e=r.document;let t=null,n=!1;e.on("keydown",(l,{keyCode:c})=>{t=c,n=!1}),e.on("keyup",(l,{keyCode:c,domEvent:a})=>{const u=e.selection,d=o.isEnabled&&c==t&&i(c)&&!u.isCollapsed&&!n;if(t=null,d){const f=u.getFirstRange(),g=new F(e,"delete",f),p={unit:y,direction:s(c),selectionToRemove:u};e.fire(g,new R(r,a,p))}}),e.on("beforeinput",(l,{inputType:c})=>{const a=H[c];i(t)&&a&&a.direction==s(t)&&(n=!0)},{priority:"high"}),e.on("beforeinput",(l,{inputType:c,data:a})=>{t==E.delete&&c=="insertText"&&a==""&&l.stop()},{priority:"high"});function i(l){return l==E.backspace||l==E.delete}function s(l){return l==E.backspace?x:k}}function Ee(o){if(o.length!=1||o[0].isCollapsed)return!1;const r=o[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let e=0;for(const{nextPosition:t,item:n}of r){if(t.parent.is("$text")){const i=t.parent.data,s=t.offset;if(ee(i,s)||te(i,s)||ne(i,s))continue;e++}else(n.is("containerElement")||n.is("emptyElement"))&&e++;if(e>1)return!0}return!1}class Te extends O{constructor(){super(...arguments);h(this,"_undoOnBackspace")}static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,n=t.document,i=e.model.document;t.addObserver(ve),this._undoOnBackspace=!1;const s=new L(e,"forward");e.commands.add("deleteForward",s),e.commands.add("forwardDelete",s),e.commands.add("delete",new L(e,"backward")),this.listenTo(n,"delete",(l,c)=>{n.isComposing||c.preventDefault();const{direction:a,sequence:u,selectionToRemove:d,unit:f}=c,g=a==="forward"?"deleteForward":"delete",p={sequence:u};if(f=="selection"){const m=Array.from(d.getRanges()).map(_=>e.editing.mapper.toModelRange(_)).map(_=>W(_,e.model.schema)||_);p.selection=e.model.createSelection(m)}else p.unit=f;e.execute(g,p),t.scrollToTheSelection()},{priority:"low"}),this.listenTo(n,"keydown",(l,c)=>{if(n.isComposing||c.keyCode!=E.backspace||!i.selection.isCollapsed)return;const a=e.model.schema.getLimitElement(i.selection),u=e.model.createPositionAt(a,0);if(u.isTouching(i.selection.getFirstPosition())){c.preventDefault();const d=e.model.schema.getNearestSelectionRange(u,"forward");if(!d)return;const f=t.createSelection(e.editing.mapper.toViewRange(d)),g=f.getFirstRange(),p=new F(document,"delete",g),m={unit:"selection",direction:"backward",selectionToRemove:f};n.fire(p,new R(t,c.domEvent,m))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(l,c)=>{this._undoOnBackspace&&c.direction=="backward"&&c.sequence==1&&c.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),c.preventDefault(),l.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Ne extends O{static get requires(){return[he,Te]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}/**
|
|
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 Ce(o,r){let e=o.start;return{text:Array.from(o.getWalker({ignoreElementEnd:!1})).reduce((n,{item:i})=>i.is("$text")||i.is("$textProxy")?n+i.data:(e=r.createPositionAfter(i),""),""),range:r.createRange(e,o.end)}}class xe extends X(){constructor(e,t){super();h(this,"model");h(this,"testCallback");h(this,"_hasMatch");this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(n,{directChange:i})=>{if(i){if(!t.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(t,"change:data",(n,i)=>{i.isUndo||!i.isLocal||this._evaluateTextBeforeSelection("data",{batch:i})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,s=n.document.selection,l=n.createRange(n.createPositionAt(s.focus.parent,0),s.focus),{text:c,range:a}=Ce(l,n),u=this.testCallback(c);if(!u&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!u,u){const d=Object.assign(t,{text:c,range:a});typeof u=="object"&&Object.assign(d,u),this.fire(`matched:${e}`,d)}}}class Me extends O{constructor(e){super(e);h(this,"attributes");h(this,"_overrideUid");h(this,"_isNextGravityRestorationSkipped",!1);this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,s=t.document.selection;this.listenTo(n.document,"arrowKey",(l,c)=>{if(!s.isCollapsed||c.shiftKey||c.altKey||c.ctrlKey)return;const a=c.keyCode==E.arrowright,u=c.keyCode==E.arrowleft;if(!a&&!u)return;const d=i.contentLanguageDirection;let f=!1;d==="ltr"&&a||d==="rtl"&&u?f=this._handleForwardMovement(c):f=this._handleBackwardMovement(c),f===!0&&l.stop()},{context:"$text",priority:"highest"}),this.listenTo(s,"change:range",(l,c)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!c.directChange&&b(s.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,s=i.getFirstPosition();return this._isGravityOverridden||s.isAtStart&&v(i,t)?!1:b(s,t)?(e&&S(e),v(i,t)&&b(s,t,!0)?A(n,t):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,s=i.getFirstPosition();return this._isGravityOverridden?(e&&S(e),this._restoreGravity(),b(s,t,!0)?A(n,t):P(n,t,s),!0):s.isAtStart?v(i,t)?(e&&S(e),P(n,t,s),!0):!1:!v(i,t)&&b(s,t,!0)?(e&&S(e),P(n,t,s),!0):N(s,t)?s.isAtEnd&&!v(i,t)&&b(s,t)?(e&&S(e),P(n,t,s),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view.document;e.editing.view.addObserver(se),e.editing.view.addObserver(oe);let s=!1,l=!1;this.listenTo(i,"touchstart",()=>{l=!1,s=!0}),this.listenTo(i,"mousedown",()=>{l=!0}),this.listenTo(i,"selectionChange",()=>{const c=this.attributes;if(!l&&!s||(l=!1,s=!1,!n.isCollapsed)||!v(n,c))return;const a=n.getFirstPosition();b(a,c)&&(a.isAtStart||b(a,c,!0)?A(t,c):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,n=t.document.selection,i=this.attributes;this.listenTo(t,"insertContent",()=>{const s=n.getFirstPosition();v(n,i)&&b(s,i)&&A(t,i)},{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let s=!1,l=!1;this.listenTo(i.document,"delete",(c,a)=>{s=a.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!s)return;const c=n.getFirstPosition();l=v(n,this.attributes)&&!N(c,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s&&(s=!1,!l&&e.model.enqueueChange(()=>{const c=n.getFirstPosition();v(n,this.attributes)&&b(c,this.attributes)&&(c.isAtStart||b(c,this.attributes,!0)?A(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function v(o,r){for(const e of r)if(o.hasAttribute(e))return!0;return!1}function P(o,r,e){const t=e.nodeBefore;o.change(n=>{if(t){const i=[],s=o.schema.isObject(t)&&o.schema.isInline(t);for(const[l,c]of t.getAttributes())o.schema.checkAttribute("$text",l)&&(!s||o.schema.getAttributeProperties(l).copyFromObject!==!1)&&i.push([l,c]);n.setSelectionAttribute(i)}else n.removeSelectionAttribute(r)})}function A(o,r){o.change(e=>{e.removeSelectionAttribute(r)})}function S(o){o.preventDefault()}function N(o,r){const e=o.getShiftedBy(-1);return b(e,r)}function b(o,r,e=!1){const{nodeBefore:t,nodeAfter:n}=o;for(const i of r){const s=t?t.getAttribute(i):void 0,l=n?n.getAttribute(i):void 0;if(!(e&&(s===void 0||l===void 0))&&l!==s)return!0}return!1}const M={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:C('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:C("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:C("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:C('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:C('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:C("'"),to:[null,"‚",null,"’"]}},G={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},we=["symbols","mathematical","typography","quotes"];class Ge extends O{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}static get isOfficialPlugin(){return!0}constructor(r){super(r),r.config.define("typing",{transformations:{include:we}})}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const r=this.editor,e=r.model,t=r.plugins.get("Delete"),n=Re(r.config.get("typing.transformations")),i=l=>{for(const c of n)if(c.from.test(l))return{normalizedTransformation:c}},s=new xe(r.model,i);s.on("matched:data",(l,c)=>{if(!c.batch.isTyping)return;const{from:a,to:u}=c.normalizedTransformation,d=a.exec(c.text),f=u(d.slice(1)),g=c.range;let p=d.index;e.enqueueChange(m=>{for(let _=1;_<d.length;_++){const w=d[_],D=f[_-1];if(D==null){p+=w.length;continue}const B=g.start.getShiftedBy(p),K=e.createRange(B,B.getShiftedBy(w.length)),V=ke(B);e.insertContent(m.createText(D,V),K),p+=D.length}e.enqueueChange(()=>{t.requestUndoOnBackspace()})})}),s.bind("isEnabled").to(this)}}function Ae(o){return typeof o=="string"?new RegExp(`(${le(o)})$`):o}function Se(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function ke(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function C(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function Re(o){const r=o.extra||[],e=o.remove||[],t=i=>!e.includes(i),n=o.include.concat(r).filter(t);return Oe(n).filter(t).map(i=>typeof i=="string"&&M[i]?M[i]:i).filter(i=>typeof i=="object").map(i=>({from:Ae(i.from),to:Se(i.to)}))}function Oe(o){const r=new Set;for(const e of o)if(typeof e=="string"&&G[e])for(const t of G[e])r.add(t);else r.add(e);return Array.from(r)}/**
|
|
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 Pe(o,r,e,t){return t.createRange(z(o,r,e,!0,t),z(o,r,e,!1,t))}function z(o,r,e,t,n){let i=o.textNode||(t?o.nodeBefore:o.nodeAfter),s=null;for(;i&&i.getAttribute(r)==e;)s=i,i=t?i.previousSibling:i.nextSibling;return s?n.createPositionAt(s,t?"before":"after"):o}function ze(o,r,e,t){const n=o.editing.view,i=new Set;n.document.registerPostFixer(s=>{const l=o.model.document.selection;let c=!1;if(l.hasAttribute(r)){const a=Pe(l.getFirstPosition(),r,l.getAttribute(r),o.model),u=o.editing.mapper.toViewRange(a);for(const d of u.getItems())d.is("element",e)&&!d.hasClass(t)&&(s.addClass(t,d),i.add(d),c=!0)}return c}),o.conversion.for("editingDowncast").add(s=>{s.on("insert",l,{priority:"highest"}),s.on("remove",l,{priority:"highest"}),s.on("attribute",l,{priority:"highest"}),s.on("selection",l,{priority:"highest"});function l(){n.change(c=>{for(const a of i.values())c.removeClass(t,a),i.delete(a)})}})}export{Te as Delete,he as Input,ue as InsertTextCommand,Ge as TextTransformation,xe as TextWatcher,Me as TwoStepCaretMovement,Ne as Typing,Pe as findAttributeRange,z as findAttributeRangeBound,Ce as getLastTextLine,ze as inlineHighlight};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Rt=Object.defineProperty;var Ht=(s,o,e)=>o in s?Rt(s,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[o]=e;var l=(s,o,e)=>Ht(s,typeof o!="symbol"?o+"":o,e);import{getEnvKeystrokeText as ee,uid as te,env as S,delay as zt,createElement as I,KeystrokeHandler as O,FocusTracker as T,toUnit as le,global as f,Rect as C,DomEmitterMixin as ae,ObservableMixin as ce,Collection as Ve,isIterable as Se,CKEditorError as V,getOptimalPosition as xe,logWarning as x,EmitterMixin as at,getVisualViewportOffset as Y,isVisible as B,isNode as ct,priorities as Ut,isText as $t,ResizeObserver as ht,toArray as he,first as Kt,parseBase64EncodedObject as ut,isRange as jt}from"../../../../../@ckeditor_ckeditor5-utils@45.1
|
|
1
|
+
var Rt=Object.defineProperty;var Ht=(s,o,e)=>o in s?Rt(s,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[o]=e;var l=(s,o,e)=>Ht(s,typeof o!="symbol"?o+"":o,e);import{getEnvKeystrokeText as ee,uid as te,env as S,delay as zt,createElement as I,KeystrokeHandler as O,FocusTracker as T,toUnit as le,global as f,Rect as C,DomEmitterMixin as ae,ObservableMixin as ce,Collection as Ve,isIterable as Se,CKEditorError as V,getOptimalPosition as xe,logWarning as x,EmitterMixin as at,getVisualViewportOffset as Y,isVisible as B,isNode as ct,priorities as Ut,isText as $t,ResizeObserver as ht,toArray as he,first as Kt,parseBase64EncodedObject as ut,isRange as jt}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Plugin as Ee,ContextPlugin as Xt}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconAccessibility as Me,IconCancel as dt,IconDropdownArrow as ue,IconDragIndicator as qt,IconPilcrow as Yt,IconThreeVerticalDots as Ie,IconText as Qt,IconPlus as Zt,IconParagraph as Jt,IconImportExport as ei,IconBold as ti,IconAlignLeft as ii,IconCheck as ft,IconPreviousArrow as si,IconNextArrow as oi,IconColorPalette as ni,IconEraser as ri,IconProjectLogo as li,IconColorTileCheck as ai}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import Ne from"../../../../../color-parse@1.4.2/node_modules/color-parse/index.js";import*as pt from"../../../../../../../_virtual/index.js";import{HexBase as ci}from"../../../../../vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/entrypoints/hex.js";import"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{assignIn as hi}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/assignIn.js";import{isObject as ie}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{cloneDeep as Oe}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeep.js";import{debounce as _e}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/debounce.js";import{isElement as Pe}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{cloneDeepWith as ui}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{throttle as di}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/throttle.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class A extends Ve{constructor(e=[]){super(e,{idProperty:"viewUid"});l(this,"_parentElement");this.on("add",(t,i,n)=>{this._renderViewIntoCollectionParent(i,n)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!fi(e))throw new V("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const n of e)i.delegate(n).to(t);this.on("add",(i,n)=>{for(const r of e)n.delegate(r).to(t)}),this.on("remove",(i,n)=>{for(const r of e)n.stopDelegating(r,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}function fi(s){return s.every(o=>typeof o=="string")}const pi="http://www.w3.org/1999/xhtml";class E extends at(){constructor(e){super();l(this,"ns");l(this,"tag");l(this,"text");l(this,"attributes");l(this,"children");l(this,"eventListeners");l(this,"_isRendered");l(this,"_revertData");Object.assign(this,Ge(We(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=ze(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new V("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(const i of t.children)se(i)?yield i:Be(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,n){return new mi({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n})},if(i,n,r){return new mt({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:r})}}}static extend(e,t){if(e._isRendered)throw new V("template-extend-render",[this,e]);_t(e,Ge(We(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new V("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||pi,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Q(this.text)?this._bindToObservable({schema:this.text,updater:bi(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const n in this.attributes){const r=t.getAttribute(n),a=this.attributes[n];i&&(i.attributes[n]=r);const u=He(a)?a[0].ns:null;if(Q(a)){const c=He(a)?a[0].value:a;i&&Ue(n)&&c.unshift(r),this._bindToObservable({schema:c,updater:gi(t,n,u),data:e})}else if(n=="style"&&typeof a[0]!="string")this._renderStyleAttribute(a[0],e);else{i&&r&&Ue(n)&&a.unshift(r);const c=a.map(h=>h&&(h.value||h)).reduce((h,p)=>h.concat(p),[]).reduce(gt,"");G(c)||t.setAttributeNS(u,n,c)}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const r=e[n];Q(r)?this._bindToObservable({schema:[r],updater:_i(i,n),data:t}):i.style[n]=r}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,n=e.isApplying;let r=0;for(const a of this.children)if(Le(a)){if(!n){a.setParent(t);for(const u of a)i.appendChild(u.element)}}else if(se(a))n||(a.isRendered||a.render(),i.appendChild(a.element));else if(ct(a))i.appendChild(a);else if(n){const u=e.revertData,c=ze();u.children.push(c),a._renderNode({intoFragment:!1,node:i.childNodes[r++],isApplying:!0,revertData:c})}else i.appendChild(a.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map(n=>{const[r,a]=t.split("@");return n.activateDomEventListener(r,a,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;wt(e,t,i);const r=e.filter(a=>!G(a)).filter(a=>a.observable).map(a=>a.activateAttributeListener(e,t,i));n&&n.bindings.push(r)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const r of n)r();if(t.text){e.textContent=t.text;return}const i=e;for(const n in t.attributes){const r=t.attributes[n];r===null?i.removeAttribute(n):i.setAttribute(n,r)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(i.childNodes[n],t.children[n])}}class K{constructor(o){l(this,"attribute");l(this,"observable");l(this,"emitter");l(this,"callback");this.attribute=o.attribute,this.observable=o.observable,this.emitter=o.emitter,this.callback=o.callback}getValue(o){const e=this.observable[this.attribute];return this.callback?this.callback(e,o):e}activateAttributeListener(o,e,t){const i=()=>wt(o,e,t);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,i),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,i)}}}class mi extends K{constructor(e){super(e);l(this,"eventNameOrFunction");this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const n=(r,a)=>{(!t||a.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(a):this.observable.fire(this.eventNameOrFunction,a))};return this.emitter.listenTo(i.node,e,n),()=>{this.emitter.stopListening(i.node,e,n)}}}class mt extends K{constructor(e){super(e);l(this,"valueIfTrue");this.valueIfTrue=e.valueIfTrue}getValue(e){const t=super.getValue(e);return G(t)?!1:this.valueIfTrue||!0}}function Q(s){return s?(s.value&&(s=s.value),Array.isArray(s)?s.some(Q):s instanceof K):!1}function wi(s,o){return s.map(e=>e instanceof K?e.getValue(o):e)}function wt(s,o,{node:e}){const t=wi(s,e);let i;s.length==1&&s[0]instanceof mt?i=t[0]:i=t.reduce(gt,""),G(i)?o.remove():o.set(i)}function bi(s){return{set(o){s.textContent=o},remove(){s.textContent=""}}}function gi(s,o,e){return{set(t){s.setAttributeNS(e,o,t)},remove(){s.removeAttributeNS(e,o)}}}function _i(s,o){return{set(e){s.style[o]=e},remove(){s.style[o]=null}}}function We(s){return ui(s,e=>{if(e&&(e instanceof K||Be(e)||se(e)||Le(e)))return e})}function Ge(s){if(typeof s=="string"?s=vi(s):s.text&&yi(s),s.on&&(s.eventListeners=Ti(s.on),delete s.on),!s.text){s.attributes&&ki(s.attributes);const o=[];if(s.children)if(Le(s.children))o.push(s.children);else for(const e of s.children)Be(e)||se(e)||ct(e)?o.push(e):o.push(new E(e));s.children=o}return s}function ki(s){for(const o in s)s[o].value&&(s[o].value=he(s[o].value)),bt(s,o)}function Ti(s){for(const o in s)bt(s,o);return s}function vi(s){return{text:[s]}}function yi(s){s.text=he(s.text)}function bt(s,o){s[o]=he(s[o])}function gt(s,o){return G(o)?s:G(s)?o:`${s} ${o}`}function Re(s,o){for(const e in o)s[e]?s[e].push(...o[e]):s[e]=o[e]}function _t(s,o){if(o.attributes&&(s.attributes||(s.attributes={}),Re(s.attributes,o.attributes)),o.eventListeners&&(s.eventListeners||(s.eventListeners={}),Re(s.eventListeners,o.eventListeners)),o.text&&s.text.push(...o.text),o.children&&o.children.length){if(s.children.length!=o.children.length)throw new V("ui-template-extend-children-mismatch",s);let e=0;for(const t of o.children)_t(s.children[e++],t)}}function G(s){return!s&&s!==0}function se(s){return s instanceof d}function Be(s){return s instanceof E}function Le(s){return s instanceof A}function He(s){return ie(s[0])&&s[0].ns}function ze(){return{children:[],bindings:[],attributes:{}}}function Ue(s){return s=="class"||s=="style"}class d extends ae(ce()){constructor(e){super();l(this,"element");l(this,"isRendered");l(this,"locale");l(this,"t");l(this,"template");l(this,"_viewCollections");l(this,"_unboundChildren");l(this,"_bindTemplate");this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Ve,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=E.bind(this,this)}createCollection(e){const t=new A(e);return this._viewCollections.add(t),t}registerChild(e){Se(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Se(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new E(e)}extendTemplate(e){E.extend(this.template,e)}render(){if(this.isRendered)throw new V("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var b=Object.defineProperty;var y=(i,e,t)=>e in i?b(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var u=(i,e,t)=>y(i,typeof e!="symbol"?e+"":e,t);import{Plugin as f,Command as R}from"../../../../../@ckeditor_ckeditor5-core@45.1
|
|
1
|
+
var b=Object.defineProperty;var y=(i,e,t)=>e in i?b(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var u=(i,e,t)=>y(i,typeof e!="symbol"?e+"":e,t);import{Plugin as f,Command as R}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{transformSets as k,NoOperation as C}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ButtonView as T,MenuBarMenuListItemButtonView as U}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconUndo as g,IconRedo as _}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class B extends R{constructor(t){super(t);u(this,"_stack",[]);u(this,"_createdBatches",new WeakSet);this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(o,s)=>{s[1]={...s[1]};const n=s[1];n.batchType||(n.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(o,s)=>{s[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const o=this.editor.model.document.selection,s={ranges:o.hasOwnRange?Array.from(o.getRanges()):[],isBackward:o.isBackward};this._stack.push({batch:t,selection:s}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,o,s){const n=this.editor.model,r=n.document,a=[],h=t.map(l=>l.getTransformedByOperations(s)),c=h.flat();for(const l of h){const m=l.filter(d=>d.root!=r.graveyard).filter(d=>!w(d,c));m.length&&(O(m),a.push(m[0]))}a.length&&n.change(l=>{l.setSelection(a,{backward:o})})}_undo(t,o){const s=this.editor.model,n=s.document;this._createdBatches.add(o);const r=t.operations.slice().filter(a=>a.isDocumentOperation);r.reverse();for(const a of r){const h=a.baseVersion+1,c=Array.from(n.history.getOperations(h)),m=k([a.getReversed()],c,{useRelations:!0,document:this.editor.model.document,forceWeakRemove:!0}).operationsA;for(let d of m){const p=d.affectedSelectable;p&&!s.canEditAt(p)&&(d=new C(d.baseVersion)),o.addOperation(d),s.applyOperation(d),n.history.setOperationAsUndone(a,d)}}}}function O(i){i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<i.length;e++){const o=i[e-1].getJoined(i[e],!0);o&&(e--,i.splice(e,2,o))}}function w(i,e){return e.some(t=>t!==i&&t.containsRange(i,!0))}class S extends B{execute(e=null){const t=e?this._stack.findIndex(n=>n.batch==e):this._stack.length-1,o=this._stack.splice(t,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,()=>{this._undo(o.batch,s);const n=this.editor.model.document.history.getOperations(o.batch.baseVersion);this._restoreSelection(o.selection.ranges,o.selection.isBackward,n)}),this.fire("revert",o.batch,s),this.refresh()}}class v extends B{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const s=e.batch.operations[e.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(s);this._restoreSelection(e.selection.ranges,e.selection.isBackward,n),this._undo(e.batch,t)}),this.refresh()}}class x extends f{constructor(){super(...arguments);u(this,"_undoCommand");u(this,"_redoCommand");u(this,"_batchRegistry",new WeakSet)}static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,o=t.t;this._undoCommand=new S(t),this._redoCommand=new v(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(s,n)=>{const r=n[0];if(!r.isDocumentOperation)return;const a=r.batch,h=this._redoCommand.createdBatches.has(a),c=this._undoCommand.createdBatches.has(a);this._batchRegistry.has(a)||(this._batchRegistry.add(a),a.isUndoable&&(h?this._undoCommand.addBatch(a):c||(this._undoCommand.addBatch(a),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(s,n,r)=>{this._redoCommand.addBatch(r)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Undo"),keystroke:"CTRL+Z"},{label:o("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class I extends f{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,o=e.t,s=t.uiLanguageDirection=="ltr"?g:_,n=t.uiLanguageDirection=="ltr"?_:g;this._addButtonsToFactory("undo",o("Undo"),"CTRL+Z",s),this._addButtonsToFactory("redo",o("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,o,s){const n=this.editor;n.ui.componentFactory.add(e,()=>{const r=this._createButton(T,e,t,o,s);return r.set({tooltip:!0}),r}),n.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(U,e,t,o,s))}_createButton(e,t,o,s,n){const r=this.editor,a=r.locale,h=r.commands.get(t),c=new e(a);return c.set({label:o,icon:n,keystroke:s}),c.bind("isEnabled").to(h,"isEnabled"),this.listenTo(c,"execute",()=>{r.execute(t),r.editing.view.focus()}),c}}class P extends f{static get requires(){return[x,I]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}export{P as Undo,x as UndoEditing,I as UndoUI};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var g=Object.defineProperty;var _=(o,a,e)=>a in o?g(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e;var i=(o,a,e)=>_(o,typeof a!="symbol"?a+"":a,e);import{Plugin as u,PendingActions as n}from"../../../../../@ckeditor_ckeditor5-core@45.1
|
|
1
|
+
var g=Object.defineProperty;var _=(o,a,e)=>a in o?g(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e;var i=(o,a,e)=>_(o,typeof a!="symbol"?a+"":a,e);import{Plugin as u,PendingActions as n}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Collection as f,logWarning as w,ObservableMixin as c,uid as m,CKEditorError as l}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class b extends c(){constructor(){super();i(this,"total");i(this,"_reader");i(this,"_data");const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((r,s)=>{t.onload=()=>{const d=t.result;this._data=d,r(d)},t.onerror=()=>{s("error")},t.onabort=()=>{s("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class h extends u{constructor(){super(...arguments);i(this,"loaders",new f);i(this,"_loadersMap",new Map);i(this,"_pendingAction",null)}static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[n]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return w("filerepository-no-upload-adapter"),null;const t=new p(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(r=>{this._loadersMap.set(r,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let r=0;for(const s of this.loaders)r+=s.uploaded;this.uploaded=r}),t.on("change:uploadTotal",()=>{let r=0;for(const s of this.loaders)s.uploadTotal&&(r+=s.uploadTotal);this.uploadTotal=r}),t}destroyLoader(e){const t=e instanceof p?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((r,s)=>{r===t&&this._loadersMap.delete(s)})}_updatePendingAction(){const e=this.editor.plugins.get(n);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,r=s=>`${t("Upload in progress")} ${parseInt(s)}%.`;this._pendingAction=e.add(r(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",r)}}else e.remove(this._pendingAction),this._pendingAction=null}}class p extends c(){constructor(e,t){super();i(this,"id");i(this,"_filePromiseWrapper");i(this,"_adapter");i(this,"_reader");this.id=m(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new b,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(r,s)=>s?r/s*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new l("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new l("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((r,s)=>{t.rejecter=s,t.isFulfilled=!1,e.then(d=>{t.isFulfilled=!0,r(d)}).catch(d=>{t.isFulfilled=!0,s(d)})}),t}}class R extends u{static get requires(){return[h]}static get pluginName(){return"Base64UploadAdapter"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(h).createUploadAdapter=a=>new P(a)}}let P=class{constructor(a){i(this,"loader");i(this,"reader");this.loader=a}upload(){return new Promise((a,e)=>{const t=this.reader=new window.FileReader;t.addEventListener("load",()=>{a({default:t.result})}),t.addEventListener("error",r=>{e(r)}),t.addEventListener("abort",()=>{e()}),this.loader.file.then(r=>{t.readAsDataURL(r)})})}abort(){this.reader.abort()}};export{R as Base64UploadAdapter,h as FileRepository};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var Gt=Object.defineProperty;var qt=(t,n,e)=>n in t?Gt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var u=(t,n,e)=>qt(t,typeof n!="symbol"?n+"":n,e);import{isObject as Yt}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{isString as ot}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isString.js";import{isFunction as rt}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/predicate/isFunction.js";import{isElement as Lt}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{isPlainObject as k}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";import{cloneDeepWith as zt}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{merge as Xt}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/object/merge.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
|
+
*/let G;try{G={window,document}}catch{/* istanbul ignore next -- @preserve */G={window:{},document:{}}}var T=G;function Jt(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const A=Jt(),F={isMac:At(A),isWindows:Qt(A),isGecko:Zt(A),isSafari:te(A),isiOS:ee(A),isAndroid:ne(A),isBlink:ie(A),get isMediaForcedColors(){return se()}};function At(t){return t.indexOf("macintosh")>-1}function Qt(t){return t.indexOf("windows")>-1}function Zt(t){return!!t.match(/gecko\/\d+/)}function te(t){return t.indexOf(" applewebkit/")>-1&&t.indexOf("chrome")===-1}function ee(t){return!!t.match(/iphone|ipad/i)||At(t)&&navigator.maxTouchPoints>0}function ne(t){return t.indexOf("android")>-1}function ie(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}function se(){return T.window.matchMedia?T.window.matchMedia("(forced-colors: active)").matches:!1}/**
|
|
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 oe(t,n,e,i){e=e||function(a,l){return a===l};const s=Array.isArray(t)?t:Array.prototype.slice.call(t),o=Array.isArray(n)?n:Array.prototype.slice.call(n),r=re(s,o,e);return i?ce(r,o.length):le(o,r)}function re(t,n,e){const i=lt(t,n,e);if(i===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=ct(t,i),o=ct(n,i),r=lt(s,o,e),c=t.length-r,a=n.length-r;return{firstIndex:i,lastIndexOld:c,lastIndexNew:a}}function lt(t,n,e){for(let i=0;i<Math.max(t.length,n.length);i++)if(t[i]===void 0||n[i]===void 0||!e(t[i],n[i]))return i;return-1}function ct(t,n){return t.slice(n).reverse()}function le(t,n){const e=[],{firstIndex:i,lastIndexOld:s,lastIndexNew:o}=n;return o-i>0&&e.push({index:i,type:"insert",values:t.slice(i,o)}),s-i>0&&e.push({index:i+(o-i),type:"delete",howMany:s-i}),e}function ce(t,n){const{firstIndex:e,lastIndexOld:i,lastIndexNew:s}=t;if(e===-1)return Array(n).fill("equal");let o=[];return e>0&&(o=o.concat(Array(e).fill("equal"))),s-e>0&&(o=o.concat(Array(s-e).fill("insert"))),i-e>0&&(o=o.concat(Array(i-e).fill("delete"))),s<n&&(o=o.concat(Array(n-s).fill("equal"))),o}function vt(t,n,e){e=e||function(b,x){return b===x};const i=t.length,s=n.length;if(i>200||s>200||i+s>300)return vt.fastDiff(t,n,e,!0);let o,r;if(s<i){const b=t;t=n,n=b,o="delete",r="insert"}else o="insert",r="delete";const c=t.length,a=n.length,l=a-c,f={},d={};function h(b){const x=(d[b-1]!==void 0?d[b-1]:-1)+1,C=d[b+1]!==void 0?d[b+1]:-1,st=x>C?-1:1;f[b+st]&&(f[b]=f[b+st].slice(0)),f[b]||(f[b]=[]),f[b].push(x>C?o:r);let M=Math.max(x,C),W=M-b;for(;W<c&&M<a&&e(t[W],n[M]);)W++,M++,f[b].push("equal");return M}let _=0,m;do{for(m=-_;m<l;m++)d[m]=h(m);for(m=l+_;m>l;m--)d[m]=h(m);d[l]=h(l),_++}while(d[l]!==a);return f[l].slice(1)}vt.fastDiff=oe;/**
|
|
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 at(){return function t(){t.called=!0}}class q{constructor(n,e){u(this,"source");u(this,"name");u(this,"path");u(this,"stop");u(this,"off");u(this,"return");this.source=n,this.name=e,this.path=[],this.stop=at(),this.off=at()}}/**
|
|
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
|
+
*/const E=new Array(256).fill("").map((t,n)=>("0"+n.toString(16)).slice(-2));function Q(){const[t,n,e,i]=crypto.getRandomValues(new Uint32Array(4));return"e"+E[t>>0&255]+E[t>>8&255]+E[t>>16&255]+E[t>>24&255]+E[n>>0&255]+E[n>>8&255]+E[n>>16&255]+E[n>>24&255]+E[e>>0&255]+E[e>>8&255]+E[e>>16&255]+E[e>>24&255]+E[i>>0&255]+E[i>>8&255]+E[i>>16&255]+E[i>>24&255]}/**
|
|
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
|
+
*/const Y={get(t="normal"){return typeof t!="number"?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function ae(t,n){const e=Y.get(n.priority);let i=0,s=t.length;for(;i<s;){const o=i+s>>1;Y.get(t[o].priority)<e?s=o:i=o+1}t.splice(i,0,n)}/**
|
|
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
|
+
*/const fe="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class p extends Error{constructor(e,i,s){super(ue(e,s));u(this,"context");u(this,"data");this.name="CKEditorError",this.context=i,this.data=s}is(e){return e==="CKEditorError"}static rethrowUnexpectedError(e,i){if(e.is&&e.is("CKEditorError"))throw e;const s=new p(e.message,i);throw s.stack=e.stack,s}}function bn(t,n){console.warn(...Rt(t,n))}function _n(t,n){console.error(...Rt(t,n))}function Ct(t){return`
|
|
23
|
+
Read more: ${fe}#error-${t}`}function ue(t,n){const e=new WeakSet,s=n?` ${JSON.stringify(n,(r,c)=>{if(typeof c=="object"&&c!==null){if(e.has(c))return`[object ${c.constructor.name}]`;e.add(c)}return c})}`:"",o=Ct(t);return t+s+o}function Rt(t,n){const e=Ct(t);return n?[t,n,e]:[t,e]}const de="45.2.1",wn=new Date(2025,5,24);/* istanbul ignore next -- @preserve */if(globalThis.CKEDITOR_VERSION)throw new p("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=de;const R=Symbol("listeningTo"),z=Symbol("emitterId"),I=Symbol("delegations"),Ft=L(Object);function L(t){if(!t)return Ft;class n extends t{on(i,s,o){this.listenTo(this,i,s,o)}once(i,s,o){let r=!1;const c=(a,...l)=>{r||(r=!0,a.off(),s.call(this,a,...l))};this.listenTo(this,i,c,o)}off(i,s){this.stopListening(this,i,s)}listenTo(i,s,o,r={}){let c,a;this[R]||(this[R]={});const l=this[R];K(i)||Mt(i);const f=K(i);(c=l[f])||(c=l[f]={emitter:i,callbacks:{}}),(a=c.callbacks[s])||(a=c.callbacks[s]=[]),a.push(o),be(this,i,s,o,r)}stopListening(i,s,o){const r=this[R];let c=i&&K(i);const a=r&&c?r[c]:void 0,l=a&&s?a.callbacks[s]:void 0;if(!(!r||i&&!a||s&&!l))if(o)H(this,i,s,o),l.indexOf(o)!==-1&&(l.length===1?delete a.callbacks[s]:H(this,i,s,o));else if(l){for(;o=l.pop();)H(this,i,s,o);delete a.callbacks[s]}else if(a){for(s in a.callbacks)this.stopListening(i,s);delete r[c]}else{for(c in r)this.stopListening(r[c].emitter);delete this[R]}}fire(i,...s){try{const o=i instanceof q?i:new q(this,i),r=o.name;let c=me(this,r);if(o.path.push(this),c){c=c.slice();for(let l=0;l<c.length;l++){const f=c[l].callback;if(f.call(this,o,...s),o.off.called&&(delete o.off.called,this._removeEventListener(r,f)),o.stop.called)break}}const a=this[I];if(a){const l=a.get(r),f=a.get("*");l&&ft(l,o,s),f&&ft(f,o,s)}return o.return}catch(o){/* istanbul ignore next -- @preserve */p.rethrowUnexpectedError(o,this)}}delegate(...i){return{to:(s,o)=>{this[I]||(this[I]=new Map),i.forEach(r=>{const c=this[I].get(r);c?c.set(s,o):this[I].set(r,new Map([[s,o]]))})}}}stopDelegating(i,s){if(this[I])if(!i)this[I].clear();else if(!s)this[I].delete(i);else{const o=this[I].get(i);o&&o.delete(s)}}_addEventListener(i,s,o){ge(this,i);const r=X(this,i),c=Y.get(o.priority),a={callback:s,priority:c};for(const l of r)ae(l,a)}_removeEventListener(i,s){const o=X(this,i);for(const r of o)for(let c=0;c<r.length;c++)r[c].callback==s&&(r.splice(c,1),c--)}}return n}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(t=>{L[t]=Ft.prototype[t]});function he(t,n){const e=t[R];return e&&e[n]?e[n].emitter:null}function Mt(t,n){t[z]||(t[z]=n||Q())}function K(t){return t[z]}function kt(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function pe(){return{callbacks:[],childEvents:[]}}function ge(t,n){const e=kt(t);if(e[n])return;let i=n,s=null;const o=[];for(;i!==""&&!e[i];)e[i]=pe(),o.push(e[i]),s&&e[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(i!==""){for(const r of o)r.callbacks=e[i].callbacks.slice();e[i].childEvents.push(s)}}function X(t,n){const e=kt(t)[n];if(!e)return[];let i=[e.callbacks];for(let s=0;s<e.childEvents.length;s++){const o=X(t,e.childEvents[s]);i=i.concat(o)}return i}function me(t,n){if(!t._events)return null;let e=n;do{const i=t._events[e];if(i&&i.callbacks&&i.callbacks.length)return i.callbacks;const s=e.lastIndexOf(":");e=s>-1?e.substring(0,s):""}while(e);return null}function ft(t,n,e){for(let[i,s]of t){s?typeof s=="function"&&(s=s(n.name)):s=n.name;const o=new q(n.source,s);o.path=[...n.path],i.fire(o,...e)}}function be(t,n,e,i,s){n._addEventListener?n._addEventListener(e,i,s):t._addEventListener.call(n,e,i,s)}function H(t,n,e,i){n._removeEventListener?n._removeEventListener(e,i):t._removeEventListener.call(n,e,i)}const S=Symbol("observableProperties"),P=Symbol("boundObservables"),V=Symbol("boundProperties"),v=Symbol("decoratedMethods"),ut=Symbol("decoratedOriginal"),St=Z(L());function Z(t){var e,i,s,o,r;if(!t)return St;class n extends(r=t,o=S,s=v,i=V,e=P,r){constructor(){super(...arguments);u(this,o);u(this,s);u(this,i);u(this,e)}set(l,f){if(Yt(l)){Object.keys(l).forEach(h=>{this.set(h,l[h])},this);return}U(this);const d=this[S];if(l in this&&!d.has(l))throw new p("observable-set-cannot-override",this);Object.defineProperty(this,l,{enumerable:!0,configurable:!0,get(){return d.get(l)},set(h){const _=d.get(l);let m=this.fire(`set:${l}`,l,h,_);m===void 0&&(m=h),(_!==m||!d.has(l))&&(d.set(l,m),this.fire(`change:${l}`,l,m,_))}}),this[l]=f}bind(...l){if(!l.length||!dt(l))throw new p("observable-bind-wrong-properties",this);if(new Set(l).size!==l.length)throw new p("observable-bind-duplicate-properties",this);U(this);const f=this[V];l.forEach(h=>{if(f.has(h))throw new p("observable-bind-rebind",this)});const d=new Map;return l.forEach(h=>{const _={property:h,to:[]};f.set(h,_),d.set(h,_)}),{to:_e,toMany:we,_observable:this,_bindProperties:l,_to:[],_bindings:d}}unbind(...l){if(!this[S])return;const f=this[V],d=this[P];if(l.length){if(!dt(l))throw new p("observable-unbind-wrong-properties",this);l.forEach(h=>{const _=f.get(h);_&&(_.to.forEach(([m,b])=>{const x=d.get(m),C=x[b];C.delete(_),C.size||delete x[b],Object.keys(x).length||(d.delete(m),this.stopListening(m,"change"))}),f.delete(h))})}else d.forEach((h,_)=>{this.stopListening(_,"change")}),d.clear(),f.clear()}decorate(l){U(this);const f=this[l];if(!f)throw new p("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:l});this.on(l,(d,h)=>{d.return=f.apply(this,h)}),this[l]=function(...d){return this.fire(l,d)},this[l][ut]=f,this[v]||(this[v]=[]),this[v].push(l)}stopListening(l,f,d){if(!l&&this[v]){for(const h of this[v])this[h]=this[h][ut];delete this[v]}super.stopListening(l,f,d)}}return n}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(t=>{Z[t]=St.prototype[t]});function U(t){t[S]||(Object.defineProperty(t,S,{value:new Map}),Object.defineProperty(t,P,{value:new Map}),Object.defineProperty(t,V,{value:new Map}))}function _e(...t){const n=Ee(...t),e=Array.from(this._bindings.keys()),i=e.length;if(!n.callback&&n.to.length>1)throw new p("observable-bind-to-no-callback",this);if(i>1&&n.callback)throw new p("observable-bind-to-extra-callback",this);n.to.forEach(s=>{if(s.properties.length&&s.properties.length!==i)throw new p("observable-bind-to-properties-length",this);s.properties.length||(s.properties=this._bindProperties)}),this._to=n.to,n.callback&&(this._bindings.get(e[0]).callback=n.callback),Ie(this._observable,this._to),xe(this),this._bindProperties.forEach(s=>{Vt(this._observable,s)})}function we(t,n,e){if(this._bindings.size>1)throw new p("observable-bind-to-many-not-one-binding",this);this.to(...ye(t,n),e)}function ye(t,n){const e=t.map(i=>[i,n]);return Array.prototype.concat.apply([],e)}function dt(t){return t.every(n=>typeof n=="string")}function Ee(...t){if(!t.length)throw new p("observable-bind-to-parse-error",null);const n={to:[]};let e;return typeof t[t.length-1]=="function"&&(n.callback=t.pop()),t.forEach(i=>{if(typeof i=="string")e.properties.push(i);else if(typeof i=="object")e={observable:i,properties:[]},n.to.push(e);else throw new p("observable-bind-to-parse-error",null)}),n}function Te(t,n,e,i){const s=t[P],o=s.get(e),r=o||{};r[i]||(r[i]=new Set),r[i].add(n),o||s.set(e,r)}function xe(t){let n;t._bindings.forEach((e,i)=>{t._to.forEach(s=>{n=s.properties[e.callback?0:t._bindProperties.indexOf(i)],e.to.push([s.observable,n]),Te(t._observable,e,s.observable,n)})})}function Vt(t,n){const i=t[V].get(n);let s;i.callback?s=i.callback.apply(t,i.to.map(o=>o[0][o[1]])):(s=i.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(t,n)?t[n]=s:t.set(n,s)}function Ie(t,n){n.forEach(e=>{const i=t[P];let s;i.get(e.observable)||t.listenTo(e.observable,"change",(o,r)=>{s=i.get(e.observable)[r],s&&s.forEach(c=>{Vt(t,c.property)})})})}/**
|
|
24
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
25
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
26
|
+
*/class yn{constructor(){u(this,"_replacedElements");this._replacedElements=[]}replace(n,e){this._replacedElements.push({element:n,newElement:e}),n.style.display="none",e&&n.parentNode.insertBefore(e,n.nextSibling)}restore(){this._replacedElements.forEach(({element:n,newElement:e})=>{n.style.display="",e&&e.remove()}),this._replacedElements=[]}}/**
|
|
27
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
28
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
29
|
+
*/function En(t){let n=0;for(const e of t)n++;return n}/**
|
|
30
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
31
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
32
|
+
*/function Tn(t,n){const e=Math.min(t.length,n.length);for(let i=0;i<e;i++)if(t[i]!=n[i])return i;return t.length==n.length?"same":t.length<n.length?"prefix":"extension"}/**
|
|
33
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
34
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
35
|
+
*/function tt(t){return!!(t&&t[Symbol.iterator])}function xn(t,n,e={},i=[]){const s=e&&e.xmlns,o=s?t.createElementNS(s,n):t.createElement(n);for(const r in e)o.setAttribute(r,e[r]);(ot(i)||!tt(i))&&(i=[i]);for(let r of i)ot(r)&&(r=t.createTextNode(r)),o.appendChild(r);return o}class In{constructor(n,e){u(this,"_config");this._config=Object.create(null),e&&this.define(ht(e)),n&&this._setObjectToTarget(this._config,n)}set(n,e){this._setToTarget(this._config,n,e)}define(n,e){this._setToTarget(this._config,n,e,!0)}get(n){return this._getFromSource(this._config,n)}*names(){for(const n of Object.keys(this._config))yield n}_setToTarget(n,e,i,s=!1){if(k(e)){this._setObjectToTarget(n,e,s);return}const o=e.split(".");e=o.pop();for(const r of o)k(n[r])||(n[r]=Object.create(null)),n=n[r];if(k(i)){k(n[e])||(n[e]=Object.create(null)),n=n[e],this._setObjectToTarget(n,i,s);return}s&&typeof n[e]<"u"||(n[e]=i)}_getFromSource(n,e){const i=e.split(".");e=i.pop();for(const s of i){if(!k(n[s])){n=null;break}n=n[s]}return n?ht(n[e]):void 0}_setObjectToTarget(n,e,i){Object.keys(e).forEach(s=>{this._setToTarget(n,s,e[s],i)})}}function ht(t){return zt(t,Le)}function Le(t){return Lt(t)||typeof t=="function"?t:void 0}/**
|
|
36
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
37
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
38
|
+
*/function pt(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}/**
|
|
39
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
40
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
41
|
+
*/function O(t){const n=Object.prototype.toString.apply(t);return n=="[object Window]"||n=="[object global]"}const Pt=j(L());function j(t){if(!t)return Pt;class n extends t{listenTo(i,s,o,r={}){if(pt(i)||O(i)||i instanceof T.window.EventTarget){const c={capture:!!r.useCapture,passive:!!r.usePassive},a=this._getProxyEmitter(i,c)||new Ae(i,c);this.listenTo(a,s,o,r)}else super.listenTo(i,s,o,r)}stopListening(i,s,o){if(pt(i)||O(i)||i instanceof T.window.EventTarget){const r=this._getAllProxyEmitters(i);for(const c of r)this.stopListening(c,s,o)}else super.stopListening(i,s,o)}_getProxyEmitter(i,s){return he(this,Nt(i,s))}_getAllProxyEmitters(i){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(s=>this._getProxyEmitter(i,s)).filter(s=>!!s)}}return n}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(t=>{j[t]=Pt.prototype[t]});class Ae extends L(){constructor(e,i){super();u(this,"_domNode");u(this,"_options");u(this,"_domListeners");Mt(this,Nt(e,i)),this._domNode=e,this._options=i}attach(e){if(this._domListeners&&this._domListeners[e])return;const i=this._createDomListener(e);this._domNode.addEventListener(e,i,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=i}detach(e){let i;this._domListeners[e]&&(!(i=this._events[e])||!i.callbacks.length)&&this._domListeners[e].removeListener()}_addEventListener(e,i,s){this.attach(e),L().prototype._addEventListener.call(this,e,i,s)}_removeEventListener(e,i){L().prototype._removeEventListener.call(this,e,i),this.detach(e)}_createDomListener(e){const i=s=>{this.fire(e,s)};return i.removeListener=()=>{this._domNode.removeEventListener(e,i,this._options),delete this._domListeners[e]},i}}function ve(t){return t["data-ck-expando"]||(t["data-ck-expando"]=Q())}function Nt(t,n){let e=ve(t);for(const i of Object.keys(n).sort())n[i]&&(e+="-"+i);return e}/**
|
|
42
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
43
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
44
|
+
*/function Ln(t){const n=[];let e=t;for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)n.unshift(e),e=e.parentNode;return n}/**
|
|
45
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
46
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
47
|
+
*/function An(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}/**
|
|
48
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
49
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
50
|
+
*/function Bt(t){const n=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(n.borderTopWidth,10),right:parseInt(n.borderRightWidth,10),bottom:parseInt(n.borderBottomWidth,10),left:parseInt(n.borderLeftWidth,10)}}/**
|
|
51
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
52
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
53
|
+
*/function vn(t){if(!t.target)return null;const n=t.target.ownerDocument,e=t.clientX,i=t.clientY;let s=null;return n.caretRangeFromPoint&&n.caretRangeFromPoint(e,i)?s=n.caretRangeFromPoint(e,i):t.rangeParent&&(s=n.createRange(),s.setStart(t.rangeParent,t.rangeOffset),s.collapse(!0)),s}/**
|
|
54
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
55
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
56
|
+
*/function et(t){return Object.prototype.toString.call(t)=="[object Text]"}/**
|
|
57
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
58
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
59
|
+
*/function nt(t){return Object.prototype.toString.apply(t)=="[object Range]"}function Ot(t){return!t||!t.parentNode||t.offsetParent===T.document.body?null:t.offsetParent}const Dt=["top","right","bottom","left","width","height"];class y{constructor(n){u(this,"top");u(this,"right");u(this,"bottom");u(this,"left");u(this,"width");u(this,"height");u(this,"_source");const e=nt(n);if(Object.defineProperty(this,"_source",{value:n._source||n,writable:!0,enumerable:!1}),J(n)||e)if(e){const i=y.getDomRangeRects(n);N(this,y.getBoundingRect(i))}else N(this,n.getBoundingClientRect());else if(O(n)){const{innerWidth:i,innerHeight:s}=n;N(this,{top:0,right:i,bottom:s,left:0,width:i,height:s})}else N(this,n)}clone(){return new y(this)}moveTo(n,e){return this.top=e,this.right=n+this.width,this.bottom=e+this.height,this.left=n,this}moveBy(n,e){return this.top+=e,this.right+=n,this.left+=n,this.bottom+=e,this}getIntersection(n){const e={top:Math.max(this.top,n.top),right:Math.min(this.right,n.right),bottom:Math.min(this.bottom,n.bottom),left:Math.max(this.left,n.left),width:0,height:0};if(e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0)return null;{const i=new y(e);return i._source=this._source,i}}getIntersectionArea(n){const e=this.getIntersection(n);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const n=this._source;let e=this.clone();if(gt(n))return e;let i=n,s=n.parentNode||n.commonAncestorContainer,o;for(;s&&!gt(s);){const r=Ce(s)==="visible";i instanceof HTMLElement&&mt(i)==="absolute"&&(o=i);const c=mt(s);if(r||o&&(c==="relative"&&r||c!=="relative")){i=s,s=s.parentNode;continue}const a=new y(s),l=e.getIntersection(a);if(l)l.getArea()<e.getArea()&&(e=l);else return null;i=s,s=s.parentNode}return e}isEqual(n){for(const e of Dt)if(this[e]!==n[e])return!1;return!0}contains(n){const e=this.getIntersection(n);return!!(e&&e.isEqual(n))}toAbsoluteRect(){const{scrollX:n,scrollY:e}=T.window,i=this.clone().moveBy(n,e);if(J(i._source)){const s=Ot(i._source);s&&Re(i,s)}return i}excludeScrollbarsAndBorders(){const n=this._source;let e,i,s;if(O(n))e=n.innerWidth-n.document.documentElement.clientWidth,i=n.innerHeight-n.document.documentElement.clientHeight,s=n.getComputedStyle(n.document.documentElement).direction;else{const o=Bt(n);e=n.offsetWidth-n.clientWidth-o.left-o.right,i=n.offsetHeight-n.clientHeight-o.top-o.bottom,s=n.ownerDocument.defaultView.getComputedStyle(n).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,s==="ltr"?this.right-=e:this.left+=e,this.height-=i,this.bottom-=i,this}static getDomRangeRects(n){const e=[],i=Array.from(n.getClientRects());if(i.length)for(const s of i)e.push(new y(s));else{let s=n.startContainer;et(s)&&(s=s.parentNode);const o=new y(s.getBoundingClientRect());o.right=o.left,o.width=0,e.push(o)}return e}static getBoundingRect(n){const e={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const s of n)i++,e.left=Math.min(e.left,s.left),e.top=Math.min(e.top,s.top),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom);return i==0?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new y(e))}}function N(t,n){for(const e of Dt)t[e]=n[e]}function gt(t){return J(t)?t===t.ownerDocument.body:!1}function J(t){return t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.getBoundingClientRect=="function"}function mt(t){return t instanceof HTMLElement?t.ownerDocument.defaultView.getComputedStyle(t).position:"static"}function Ce(t){return t instanceof HTMLElement?t.ownerDocument.defaultView.getComputedStyle(t).overflow:"visible"}function Re(t,n){const e=new y(n),i=Bt(n);let s=0,o=0;s-=e.left,o-=e.top,s+=n.scrollLeft,o+=n.scrollTop,s-=i.left,o-=i.top,t.moveBy(s,o)}const g=class g{constructor(n,e){u(this,"_element");u(this,"_callback");g._observerInstance||g._createObserver(),this._element=n,this._callback=e,g._addElementCallback(n,e),g._observerInstance.observe(n)}get element(){return this._element}destroy(){g._deleteElementCallback(this._element,this._callback)}static _addElementCallback(n,e){g._elementCallbacks||(g._elementCallbacks=new Map);let i=g._elementCallbacks.get(n);i||(i=new Set,g._elementCallbacks.set(n,i)),i.add(e)}static _deleteElementCallback(n,e){const i=g._getElementCallbacks(n);i&&(i.delete(e),i.size||(g._elementCallbacks.delete(n),g._observerInstance.unobserve(n))),g._elementCallbacks&&!g._elementCallbacks.size&&(g._observerInstance=null,g._elementCallbacks=null)}static _getElementCallbacks(n){return g._elementCallbacks?g._elementCallbacks.get(n):null}static _createObserver(){g._observerInstance=new T.window.ResizeObserver(n=>{for(const e of n){const i=g._getElementCallbacks(e.target);if(i)for(const s of i)s(e)}})}};u(g,"_observerInstance",null),u(g,"_elementCallbacks",null);let bt=g;/**
|
|
60
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
61
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
62
|
+
*/function Cn(t,n){t instanceof HTMLTextAreaElement&&(t.value=n),t.innerHTML=n}/**
|
|
63
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
64
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
65
|
+
*/function Rn(t){return n=>n+t}/**
|
|
66
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
67
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
68
|
+
*/function Fn(t){let n=0;for(;t.previousSibling;)t=t.previousSibling,n++;return n}/**
|
|
69
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
70
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
71
|
+
*/function Mn(t,n,e){t.insertBefore(e,t.childNodes[n]||null)}/**
|
|
72
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
73
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
74
|
+
*/function kn(t){return t&&t.nodeType===Node.COMMENT_NODE}function Sn(t){try{T.document.createAttribute(t)}catch{return!1}return!0}function Fe(t){return t?et(t)?Fe(t.parentElement):t.getClientRects?!!t.getClientRects().length:!1:!1}function Vn({element:t,target:n,positions:e,limiter:i,fitInViewport:s,viewportOffsetConfig:o}){rt(n)&&(n=n()),rt(i)&&(i=i());const r=Ot(t),c=Me(o),a=new y(t),l=_t(n,c);let f;if(!l||!c.getIntersection(l))return null;const d={targetRect:l,elementRect:a,positionedElementAncestor:r,viewportRect:c};if(!i&&!s)f=new jt(e[0],d);else{if(i){const h=_t(i,c);h&&(d.limiterRect=h)}f=ke(e,d)}return f}function _t(t,n){const e=new y(t).getVisible();return e?e.getIntersection(n):null}function Me(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const n=new y(T.window);return n.top+=t.top,n.height-=t.top,n.bottom-=t.bottom,n.height-=t.bottom,n}function ke(t,n){const{elementRect:e}=n,i=e.getArea(),s=t.map(c=>new jt(c,n)).filter(c=>!!c.name);let o=0,r=null;for(const c of s){const{limiterIntersectionArea:a,viewportIntersectionArea:l}=c;if(a===i)return c;const f=l**2+a**2;f>o&&(o=f,r=c)}return r}class jt{constructor(n,e){u(this,"name");u(this,"config");u(this,"_positioningFunctionCoordinates");u(this,"_options");u(this,"_cachedRect");u(this,"_cachedAbsoluteRect");const i=n(e.targetRect,e.elementRect,e.viewportRect,e.limiterRect);if(!i)return;const{left:s,top:o,name:r,config:c}=i;this.name=r,this.config=c,this._positioningFunctionCoordinates={left:s,top:o},this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const n=this._options.limiterRect;return n?n.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}}/**
|
|
75
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
76
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
77
|
+
*/function Pn(t){const n=t.parentNode;n&&n.removeChild(t)}function Nn(){const t=T.window.visualViewport;if(!t||!(F.isiOS||F.isSafari))return{left:0,top:0};const n=Math.max(Math.round(t.offsetLeft),0),e=Math.max(Math.round(t.offsetTop),0);return{left:n,top:e}}function Bn({target:t,viewportOffset:n=0,ancestorOffset:e=0,alignToTop:i,forceScroll:s}){const o=it(t);let r=o,c=null;for(n=Pe(n);r;){let a;r==o?a=wt(t):a=wt(c),Ve({parent:a,getRect:()=>$(t,r),alignToTop:i,ancestorOffset:e,forceScroll:s});let l=$(t,r);const f=$(a,r);if(l.height>f.height){const d=l.getIntersection(f);d&&(l=d)}if(Se({window:r,rect:l,viewportOffset:n,alignToTop:i,forceScroll:s}),r.parent!=r){if(c=r.frameElement,r=r.parent,!c)return}else r=null}}function Se({window:t,rect:n,alignToTop:e,forceScroll:i,viewportOffset:s}){const o=n.clone().moveBy(0,s.bottom),r=n.clone().moveBy(0,-s.top),c=new y(t).excludeScrollbarsAndBorders(),a=[r,o],l=e&&i,f=a.every(b=>c.contains(b));let{scrollX:d,scrollY:h}=t;const _=d,m=h;l?h-=c.top-n.top+s.top:f||(Kt(r,c)?h-=c.top-n.top+s.top:Wt(o,c)&&(e?h+=n.top-c.top-s.top:h+=n.bottom-c.bottom+s.bottom)),f||(Ht(n,c)?d-=c.left-n.left+s.left:Ut(n,c)&&(d+=n.right-c.right+s.right)),(d!=_||h!==m)&&t.scrollTo(d,h)}function Ve({parent:t,getRect:n,alignToTop:e,forceScroll:i,ancestorOffset:s=0,limiterElement:o}){const r=it(t),c=e&&i;let a,l,f;const d=o||r.document.body;for(;t!=d;)l=n(),a=new y(t).excludeScrollbarsAndBorders(),f=a.contains(l),c?t.scrollTop-=a.top-l.top+s:f||(Kt(l,a)?t.scrollTop-=a.top-l.top+s:Wt(l,a)&&(e?t.scrollTop+=l.top-a.top-s:t.scrollTop+=l.bottom-a.bottom+s)),f||(Ht(l,a)?t.scrollLeft-=a.left-l.left+s:Ut(l,a)&&(t.scrollLeft+=l.right-a.right+s)),t=t.parentNode}function Wt(t,n){return t.bottom>n.bottom}function Kt(t,n){return t.top<n.top}function Ht(t,n){return t.left<n.left}function Ut(t,n){return t.right>n.right}function it(t){return nt(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function wt(t){if(nt(t)){let n=t.commonAncestorContainer;return et(n)&&(n=n.parentNode),n}else return t.parentNode}function $(t,n){const e=it(t),i=new y(t);if(e===n)return i;{let s=e;for(;s!=n;){const o=s.frameElement,r=new y(o).excludeScrollbarsAndBorders();i.moveBy(r.left,r.top),s=s.parent}}return i}function Pe(t){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:t}const Ne={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Be={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},yt={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},w=We(),Oe=Object.fromEntries(Object.entries(w).map(([t,n])=>{let e;return n in yt?e=yt[n]:e=t.charAt(0).toUpperCase()+t.slice(1),[n,e]}));function D(t){let n;if(typeof t=="string"){if(n=w[t.toLowerCase()],!n)throw new p("keyboard-unknown-key",null,{key:t})}else n=t.keyCode+(t.altKey?w.alt:0)+(t.ctrlKey?w.ctrl:0)+(t.shiftKey?w.shift:0)+(t.metaKey?w.cmd:0);return n}function $t(t){return typeof t=="string"&&(t=Ke(t)),t.map(n=>typeof n=="string"?je(n):n).reduce((n,e)=>e+n,0)}function On(t,n){let e=$t(t);const i=F.isMac||F.isiOS;return Object.entries(i?Ne:Be).reduce((r,[c,a])=>((e&w[c])!=0&&(e&=~w[c],r+=a),r),"")+(e?Oe[e]:"")}function Dn(t){return t==w.arrowright||t==w.arrowleft||t==w.arrowup||t==w.arrowdown}function De(t,n){const e=n==="ltr";switch(t){case w.arrowleft:return e?"left":"right";case w.arrowright:return e?"right":"left";case w.arrowup:return"up";case w.arrowdown:return"down"}}function je(t){if(t.endsWith("!"))return D(t.slice(0,-1));const n=D(t);return(F.isMac||F.isiOS)&&n==w.ctrl?w.cmd:n}function jn(t,n){const e=De(t,n);return e==="down"||e==="right"}function We(){const t={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let n=65;n<=90;n++){const e=String.fromCharCode(n);t[e.toLowerCase()]=n}for(let n=48;n<=57;n++)t[n-48]=n;for(let n=112;n<=123;n++)t["f"+(n-111)]=n;return Object.assign(t,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),t}function Ke(t){return t.split("+").map(n=>n.trim())}/**
|
|
78
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
79
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
80
|
+
*/const He=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function Et(t){return He.includes(t)?"rtl":"ltr"}/**
|
|
81
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
82
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
83
|
+
*/function Ue(t){return Array.isArray(t)?t:[t]}/* istanbul ignore else -- @preserve */T.window.CKEDITOR_TRANSLATIONS||(T.window.CKEDITOR_TRANSLATIONS={});function $e(t,n,e=1,i){if(typeof e!="number")throw new p("translation-service-quantity-not-a-number",null,{quantity:e});const s=i||T.window.CKEDITOR_TRANSLATIONS,o=Ye(s);o===1&&(t=Object.keys(s)[0]);const r=n.id||n.string;if(o===0||!qe(t,r,s))return e!==1?n.plural:n.string;const c=s[t].dictionary,a=s[t].getPluralForm||(d=>d===1?0:1),l=c[r];if(typeof l=="string")return l;const f=Number(a(e));return l[f]}function Ge(t){return Array.isArray(t)?t.reduce((n,e)=>Xt(n,e)):t}function qe(t,n,e){return!!e[t]&&!!e[t].dictionary[n]}function Ye(t){return Object.keys(t).length}class Wn{constructor({uiLanguage:n="en",contentLanguage:e,translations:i}={}){u(this,"uiLanguage");u(this,"uiLanguageDirection");u(this,"contentLanguage");u(this,"contentLanguageDirection");u(this,"t");u(this,"translations");this.uiLanguage=n,this.contentLanguage=e||this.uiLanguage,this.uiLanguageDirection=Et(this.uiLanguage),this.contentLanguageDirection=Et(this.contentLanguage),this.translations=Ge(i),this.t=(s,o)=>this._t(s,o)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(n,e=[]){e=Ue(e),typeof n=="string"&&(n={string:n});const s=!!n.plural?e[0]:1,o=$e(this.uiLanguage,n,s,this.translations);return ze(o,e)}}function ze(t,n){return t.replace(/%(\d+)/g,(e,i)=>i<n.length?n[i]:e)}class Kn extends L(){constructor(e={},i={}){super();u(this,"_items");u(this,"_itemMap");u(this,"_idProperty");u(this,"_bindToCollection");u(this,"_bindToExternalToInternalMap");u(this,"_bindToInternalToExternalMap");u(this,"_skippedIndexesFromExternal");const s=tt(e);if(s||(i=e),this._items=[],this._itemMap=new Map,this._idProperty=i.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],s)for(const o of e)this._items.push(o),this._itemMap.set(this._getItemIdBeforeAdding(o),o)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,i){return this.addMany([e],i)}addMany(e,i){if(i===void 0)i=this._items.length;else if(i>this._items.length||i<0)throw new p("collection-add-item-invalid-index",this);let s=0;for(const o of e){const r=this._getItemIdBeforeAdding(o),c=i+s;this._items.splice(c,0,o),this._itemMap.set(r,o),this.fire("add",o,c),s++}return this.fire("change",{added:e,removed:[],index:i}),this}get(e){let i;if(typeof e=="string")i=this._itemMap.get(e);else if(typeof e=="number")i=this._items[e];else throw new p("collection-get-invalid-arg",this);return i||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const i=this._idProperty,s=e[i];return s&&this._itemMap.has(s)}}getIndex(e){let i;return typeof e=="string"?i=this._itemMap.get(e):i=e,i?this._items.indexOf(i):-1}remove(e){const[i,s]=this._remove(e);return this.fire("change",{added:[],removed:[i],index:s}),i}map(e,i){return this._items.map(e,i)}forEach(e,i){this._items.forEach(e,i)}find(e,i){return this._items.find(e,i)}filter(e,i){return this._items.filter(e,i)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new p("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:i=>{this._setUpBindToBinding(s=>new i(s))},using:i=>{typeof i=="function"?this._setUpBindToBinding(i):this._setUpBindToBinding(s=>s[i])}}}_setUpBindToBinding(e){const i=this._bindToCollection,s=(o,r,c)=>{const a=i._bindToCollection==this,l=i._bindToInternalToExternalMap.get(r);if(a&&l)this._bindToExternalToInternalMap.set(r,l),this._bindToInternalToExternalMap.set(l,r);else{const f=e(r);if(!f){this._skippedIndexesFromExternal.push(c);return}let d=c;for(const h of this._skippedIndexesFromExternal)c>h&&d--;for(const h of i._skippedIndexesFromExternal)d>=h&&d++;this._bindToExternalToInternalMap.set(r,f),this._bindToInternalToExternalMap.set(f,r),this.add(f,d);for(let h=0;h<i._skippedIndexesFromExternal.length;h++)d<=i._skippedIndexesFromExternal[h]&&i._skippedIndexesFromExternal[h]++}};for(const o of i)s(null,o,i.getIndex(o));this.listenTo(i,"add",s),this.listenTo(i,"remove",(o,r,c)=>{const a=this._bindToExternalToInternalMap.get(r);a&&this.remove(a),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((l,f)=>(c<f&&l.push(f-1),c>f&&l.push(f),l),[])})}_getItemIdBeforeAdding(e){const i=this._idProperty;let s;if(i in e){if(s=e[i],typeof s!="string")throw new p("collection-add-invalid-id",this);if(this.get(s))throw new p("collection-add-item-already-exists",this)}else e[i]=s=Q();return s}_remove(e){let i,s,o,r=!1;const c=this._idProperty;if(typeof e=="string"?(s=e,o=this._itemMap.get(s),r=!o,o&&(i=this._items.indexOf(o))):typeof e=="number"?(i=e,o=this._items[i],r=!o,o&&(s=o[c])):(o=e,s=o[c],i=this._items.indexOf(o),r=i==-1||!this._itemMap.get(s)),r)throw new p("collection-remove-404",this);this._items.splice(i,1),this._itemMap.delete(s);const a=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(a),this.fire("remove",o,i),[o,i]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}/**
|
|
84
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
85
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
86
|
+
*/function Hn(t){const n=t.next();return n.done?null:n.value}class Xe extends j(Z()){constructor(){super();u(this,"_elements",new Set);u(this,"_externalViews",new Set);u(this,"_blurTimeout",null);this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(xt(e))this._addElement(e);else if(Tt(e))this._addView(e);else{if(!e.element)throw new p("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){xt(e)?this._removeElement(e):Tt(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new p("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>{const i=this.externalViews.find(s=>Je(e,s));i?this._focus(i.element):this._focus(e)},{useCapture:!0}),this.listenTo(e,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()}),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){this.elements.find(s=>s.contains(document.activeElement))||this.externalViews.find(s=>s.focusTracker.isFocused&&!s.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function Tt(t){return"focusTracker"in t&&t.focusTracker instanceof Xe}function xt(t){return Lt(t)}function Je(t,n){return It(t,n)?!0:!!n.focusTracker.externalViews.find(e=>It(t,e))}function It(t,n){return!!n.element&&n.element.contains(document.activeElement)&&t.contains(n.element)}class Un{constructor(){u(this,"_listener");this._listener=new(j())}listenTo(n){this._listener.listenTo(n,"keydown",(e,i)=>{this._listener.fire("_keydown:"+D(i),i)})}set(n,e,i={}){const s=$t(n),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+s,(r,c)=>{i.filter&&!i.filter(c)||(e(c,()=>{c.preventDefault(),c.stopPropagation(),r.stop()}),r.return=!0)},{priority:o})}press(n){return!!this._listener.fire("_keydown:"+D(n),n)}stopListening(n){this._listener.stopListening(n)}destroy(){this.stopListening()}}/**
|
|
87
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
88
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
89
|
+
*/function Qe(t){const n=new Map;for(const e in t)n.set(e,t[e]);return n}function $n(t){return tt(t)?new Map(t):Qe(t)}/**
|
|
90
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
91
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
92
|
+
*/function Gn(t,n,e){const i=t.length,s=n.length;for(let o=i-1;o>=e;o--)t[o+s]=t[o];for(let o=0;o<s;o++)t[e+o]=n[o]}/**
|
|
93
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
94
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
95
|
+
*/function qn(t,n){let e;function i(...s){i.cancel(),e=setTimeout(()=>t(...s),n)}return i.cancel=()=>{clearTimeout(e)},i}/**
|
|
96
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
97
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
98
|
+
*/function Yn(t){try{if(!t.startsWith("ey"))return null;const n=atob(t.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(n)}catch{return null}}/**
|
|
99
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
100
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
101
|
+
*/function Ze(){const t=[];for(let n=0;n<256;n++){let e=n;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;t[n]=e}return t}function zn(t){const n=Array.isArray(t)?t:[t],e=Ze();let i=-1;const s=n.map(o=>Array.isArray(o)?o.join(""):String(o)).join("");for(let o=0;o<s.length;o++){const r=s.charCodeAt(o);i=i>>>8^e[(i^r)&255]}return i=(i^-1)>>>0,i.toString(16).padStart(8,"0")}/**
|
|
102
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
103
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
104
|
+
*/function Xn(t){const n=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],e=n.map(r=>r.name).join("|"),i=t.replace(new RegExp(`</?(${e})( .*?)?>`,"g"),`
|
|
105
|
+
$&
|
|
106
|
+
`).replace(/<br[^>]*>/g,`$&
|
|
107
|
+
`).split(`
|
|
108
|
+
`);let s=0,o=!1;return i.map(r=>(o=nn(r,o),!r.length&&!o?"":tn(r,n)?B(r,s++):en(r,n)?B(r,--s):o==="middle"||o==="last"?B(r,0):B(r,s))).join("").trimEnd()}function tn(t,n){return n.some(e=>!(e.isVoid||!new RegExp(`<${e.name}( .*?)?>`).test(t)))}function en(t,n){return n.some(e=>new RegExp(`</${e.name}>`).test(t))}function B(t,n,e=" "){return`${e.repeat(Math.max(0,n))}${t}
|
|
109
|
+
`}function nn(t,n){const e=/<pre( .*?)?>/.test(t),i=/<\/pre>/.test(t);return e&&i?!1:e?"first":i?"last":n==="first"||n==="middle"?"middle":!1}/**
|
|
110
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
111
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
112
|
+
*/function sn(t){return!!t&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t)}function on(t){return!!t&&t.length==1&&/[\ud800-\udbff]/.test(t)}function rn(t){return!!t&&t.length==1&&/[\udc00-\udfff]/.test(t)}function Jn(t,n){return on(t.charAt(n-1))&&rn(t.charAt(n))}function Qn(t,n){return sn(t.charAt(n))}const ln=cn();function Zn(t,n){const e=String(t).matchAll(ln);return Array.from(e).some(i=>i.index<n&&n<i.index+i[0].length)}function cn(){const t=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],n=new RegExp("\\p{Regional_Indicator}{2}","u").source,e="(?:"+t.map(s=>s.source).join("|")+")",i=`${n}|${e}(?:${e})*`;return new RegExp(i,"ug")}export{p as CKEditorError,Kn as Collection,In as Config,j as DomEmitterMixin,yn as ElementReplacer,L as EmitterMixin,q as EventInfo,Xe as FocusTracker,Un as KeystrokeHandler,Wn as Locale,Z as ObservableMixin,y as Rect,bt as ResizeObserver,Tn as compareArrays,En as count,zn as crc32,xn as createElement,qn as delay,vt as diff,F as env,oe as fastDiff,Hn as first,Xn as formatHtml,Ln as getAncestors,Bt as getBorderWidths,D as getCode,An as getDataFromElement,On as getEnvKeystrokeText,Et as getLanguageDirection,De as getLocalizedArrowKeyCodeDirection,Vn as getOptimalPosition,vn as getRangeFromMouseEvent,Nn as getVisualViewportOffset,T as global,Fn as indexOf,Mn as insertAt,ae as insertToPriorityArray,Dn as isArrowKeyCode,sn as isCombiningMark,kn as isComment,jn as isForwardArrowKeyCode,on as isHighSurrogateHalf,Qn as isInsideCombinedSymbol,Zn as isInsideEmojiSequence,Jn as isInsideSurrogatePair,tt as isIterable,rn as isLowSurrogateHalf,pt as isNode,nt as isRange,et as isText,Sn as isValidAttributeName,Tt as isViewWithFocusTracker,Fe as isVisible,w as keyCodes,_n as logError,bn as logWarning,Yn as parseBase64EncodedObject,$t as parseKeystroke,Y as priorities,wn as releaseDate,Pn as remove,Bn as scrollViewportToShowTarget,Cn as setDataInElement,Gn as spliceArray,Ue as toArray,$n as toMap,Rn as toUnit,Q as uid,de as version};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $=Object.defineProperty;var U=(n,s,e)=>s in n?$(n,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[s]=e;var p=(n,s,e)=>U(n,typeof s!="symbol"?s+"":s,e);import{Plugin as P}from"../../../../../@ckeditor_ckeditor5-core@45.1
|
|
1
|
+
var $=Object.defineProperty;var U=(n,s,e)=>s in n?$(n,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[s]=e;var p=(n,s,e)=>U(n,typeof s!="symbol"?s+"":s,e);import{Plugin as P}from"../../../../../@ckeditor_ckeditor5-core@45.2.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{MouseObserver as D,TreeWalker as q}from"../../../../../@ckeditor_ckeditor5-engine@45.2.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Delete as I}from"../../../../../@ckeditor_ckeditor5-typing@45.2.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{keyCodes as T,env as O,getLocalizedArrowKeyCodeDirection as G,logWarning as Y,CKEditorError as F,isForwardArrowKeyCode as X,getRangeFromMouseEvent as J,global as A,DomEmitterMixin as Q,toArray as N,Rect as v,ObservableMixin as M,compareArrays as Z,EmitterMixin as ee}from"../../../../../@ckeditor_ckeditor5-utils@45.2.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconReturnArrow as te,IconDragHandle as ie}from"../../../../../@ckeditor_ckeditor5-icons@45.2.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ContextualBalloon as oe,ToolbarView as ne,BalloonPanelView as se,IconView as re,Template as k,View as le}from"../../../../../@ckeditor_ckeditor5-ui@45.2.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{Enter as ce}from"../../../../../@ckeditor_ckeditor5-enter@45.2.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{throttle as ae}from"../../../../../es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/function/throttle.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class de extends ee(){constructor(){super(...arguments);p(this,"_stack",[])}add(e,t){const i=this._stack,o=i[0];this._insertDescriptor(e);const r=i[0];o!==r&&!C(o,r)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}remove(e,t){const i=this._stack,o=i[0];this._removeDescriptor(e);const r=i[0];o!==r&&!C(o,r)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex(r=>r.id===e.id);if(C(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&he(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex(o=>o.id===e);i>-1&&t.splice(i,1)}}function C(n,s){return n&&s&&n.priority==s.priority&&S(n.classes)==S(s.classes)}function he(n,s){return n.priority>s.priority?!0:n.priority<s.priority?!1:S(n.classes)>S(s.classes)}function S(n){return Array.isArray(n)?n.sort().join(","):n}const ue="ck-widget",R="ck-widget_selected";function m(n){return n.is("element")?!!n.getCustomProperty("widget"):!1}function nt(n,s,e={}){if(!n.is("containerElement"))throw new F("widget-to-widget-wrong-element-type",null,{element:n});return s.setAttribute("contenteditable","false",n),s.addClass(ue,n),s.setCustomProperty("widget",!0,n),n.getFillerOffset=we,s.setCustomProperty("widgetLabel",[],n),e.label&&fe(n,e.label),e.hasSelectionHandle&&_e(n,s),L(n,s),n}function ge(n,s,e){if(s.classes&&e.addClass(N(s.classes),n),s.attributes)for(const t in s.attributes)e.setAttribute(t,s.attributes[t],n)}function pe(n,s,e){if(s.classes&&e.removeClass(N(s.classes),n),s.attributes)for(const t in s.attributes)e.removeAttribute(t,n)}function L(n,s,e=ge,t=pe){const i=new de;i.on("change:top",(l,c)=>{c.oldDescriptor&&t(n,c.oldDescriptor,c.writer),c.newDescriptor&&e(n,c.newDescriptor,c.writer)});const o=(l,c,a)=>i.add(c,a),r=(l,c,a)=>i.remove(c,a);s.setCustomProperty("addHighlight",o,n),s.setCustomProperty("removeHighlight",r,n)}function fe(n,s){n.getCustomProperty("widgetLabel").push(s)}function me(n){return n.getCustomProperty("widgetLabel").reduce((e,t)=>typeof t=="function"?e?e+". "+t():t():e?e+". "+t:t,"")}function st(n,s,e={}){return s.addClass(["ck-editor__editable","ck-editor__nested-editable"],n),e.withAriaRole!==!1&&s.setAttribute("role","textbox",n),s.setAttribute("tabindex","-1",n),e.label&&s.setAttribute("aria-label",e.label,n),s.setAttribute("contenteditable",n.isReadOnly?"false":"true",n),n.on("change:isReadOnly",(t,i,o)=>{s.setAttribute("contenteditable",o?"false":"true",n)}),n.on("change:isFocused",(t,i,o)=>{o?s.addClass("ck-editor__nested-editable_focused",n):s.removeClass("ck-editor__nested-editable_focused",n)}),L(n,s),n}function rt(n,s){const e=n.getSelectedElement();if(e){const t=b(n);if(t)return s.createRange(s.createPositionAt(e,t))}return s.schema.findOptimalInsertionRange(n)}function we(){return null}function _e(n,s){const e=s.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(t){const i=this.toDomElement(t),o=new re;return o.set("content",ie),o.render(),i.appendChild(o.element),i});s.insert(s.createPositionAt(n,0),e),s.addClass(["ck-widget_with-selection-handle"],n)}function be(n){const s=l=>{const{width:c,paddingLeft:a,paddingRight:d}=l.ownerDocument.defaultView.getComputedStyle(l);return parseFloat(c)-(parseFloat(a)||0)-(parseFloat(d)||0)},e=n.parentElement;if(!e)return 0;let t=s(e);const i=5;let o=0,r=e;for(;isNaN(t);){if(r=r.parentElement,++o>i)return 0;t=s(r)}return t}function ye(n,s=new v(n)){const e=be(n);return e?s.width/e*100:0}const _="widget-type-around";function y(n,s,e){return!!n&&m(n)&&!e.isInline(s)}function ve(n){return n.closest(".ck-widget__type-around__button")}function Ee(n){return n.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function Se(n,s){const e=n.closest(".ck-widget");return s.mapDomToView(e)}function b(n){return n.getAttribute(_)}const B=["before","after"],Pe=new DOMParser().parseFromString(te,"image/svg+xml").firstChild,W="ck-widget__type-around_disabled";class Ce extends P{constructor(){super(...arguments);p(this,"_currentFakeCaretModelElement",null)}static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[ce,I]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(i,o,r)=>{t.change(l=>{for(const c of t.document.roots)r?l.removeClass(W,c):l.addClass(W,c)}),r||e.model.change(l=>{l.removeSelectionAttribute(_)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,o=i.editing.view,r=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:r}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,(...r)=>{this.isEnabled&&i(...r)},o)}_insertParagraphAccordingToFakeCaretPosition(){const i=this.editor.model.document.selection,o=b(i);if(!o)return!1;const r=i.getSelectedElement();return this._insertParagraph(r,o),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,l,c)=>{const a=c.mapper.toViewElement(l.item);a&&y(a,l.item,t)&&(Te(c.writer,o,a),a.getCustomProperty("widgetLabel").push(()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,o=t.schema,r=e.editing.view;this._listenToIfEnabled(r.document,"arrowKey",(c,a)=>{this._handleArrowKeyPress(c,a)},{context:[m,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(c,a)=>{a.directChange&&e.model.change(d=>{d.removeSelectionAttribute(_)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const c=i.getSelectedElement();if(c){const a=e.editing.mapper.toViewElement(c);if(y(a,c,o))return}e.model.change(a=>{a.removeSelectionAttribute(_)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(c,a,d)=>{const u=d.writer;if(this._currentFakeCaretModelElement){const w=d.mapper.toViewElement(this._currentFakeCaretModelElement);w&&(u.removeClass(B.map(l),w),this._currentFakeCaretModelElement=null)}const h=a.selection.getSelectedElement();if(!h)return;const f=d.mapper.toViewElement(h);if(!y(f,h,o))return;const g=b(a.selection);g&&(u.addClass(l(g),f),this._currentFakeCaretModelElement=h)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(c,a,d)=>{d||e.model.change(u=>{u.removeSelectionAttribute(_)})});function l(c){return`ck-widget_type-around_show-fake-caret_${c}`}}_handleArrowKeyPress(e,t){const i=this.editor,o=i.model,r=o.document.selection,l=o.schema,c=i.editing.view,a=t.keyCode,d=X(a,i.locale.contentLanguageDirection),u=c.document.selection.getSelectedElement(),h=i.editing.mapper.toModelElement(u);let f;y(u,h,l)?f=this._handleArrowKeyPressOnSelectedWidget(d):r.isCollapsed?f=this._handleArrowKeyPressWhenSelectionNextToAWidget(d):t.shiftKey||(f=this._handleArrowKeyPressWhenNonCollapsedSelection(d)),f&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const i=this.editor.model,o=i.document.selection,r=b(o);return i.change(l=>{if(r){if(!(r===(e?"after":"before")))return l.removeSelectionAttribute(_),!0}else return l.setSelectionAttribute(_,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,o=i.schema,r=t.plugins.get("Widget"),l=r._getObjectElementNextToSelection(e),c=t.editing.mapper.toViewElement(l);return y(c,l,o)?(i.change(a=>{r._setSelectionOverElement(l),a.setSelectionAttribute(_,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,o=i.schema,r=t.editing.mapper,l=i.document.selection,c=e?l.getLastPosition().nodeBefore:l.getFirstPosition().nodeAfter,a=r.toViewElement(c);return y(a,c,o)?(i.change(d=>{d.setSelection(c,"on"),d.setSelectionAttribute(_,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,o)=>{const r=ve(o.domTarget);if(!r)return;const l=Ee(r),c=Se(r,t.domConverter),a=e.editing.mapper.toModelElement(c);this._insertParagraph(a,l),o.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",(o,r)=>{if(o.eventPhase!="atTarget")return;const l=t.getSelectedElement(),c=e.editing.mapper.toViewElement(l),a=e.model.schema;let d;this._insertParagraphAccordingToFakeCaretPosition()?d=!0:y(c,l,a)&&(this._insertParagraph(l,r.isSoft?"before":"after"),d=!0),d&&(r.preventDefault(),o.stop())},{context:m})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(i,o)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(o.selection=t.selection)},{priority:"high"}),O.isAndroid?this._listenToIfEnabled(t,"keydown",(i,o)=>{o.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",(r,l)=>{if(r.eventPhase!="atTarget")return;const c=b(i.document.selection);if(!c)return;const a=l.direction,d=i.document.selection.getSelectedElement(),u=c==="before",h=a=="forward";if(u===h)e.execute("delete",{selection:i.createSelection(d,"on")});else{const g=o.getNearestSelectionRange(i.createPositionAt(d,c),a);if(g)if(!g.isCollapsed)i.change(w=>{w.setSelection(g),e.execute(h?"deleteForward":"delete")});else{const w=i.createSelection(g.start);if(i.modifySelection(w,{direction:a}),!w.focus.isEqual(g.start))i.change(E=>{E.setSelection(g),e.execute(h?"deleteForward":"delete")});else{const E=Re(o,g.start.parent);i.deleteContent(i.createSelection(E,"on"),{doNotAutoparagraph:!0})}}}l.preventDefault(),r.stop()},{context:m})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[r,l])=>{if(l&&!l.is("documentSelection"))return;const c=b(i);if(c)return o.stop(),t.change(a=>{const d=i.getSelectedElement(),u=t.createPositionAt(d,c),h=a.createSelection(u),f=t.insertContent(r,h);return a.setSelection(h),f})},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(o,r)=>{const[,l,c={}]=r;if(l&&!l.is("documentSelection"))return;const a=b(i);a&&(c.findOptimalPosition=a,r[3]=c)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(o,[r])=>{if(r&&!r.is("documentSelection"))return;b(i)&&o.stop()},{priority:"high"})}}function Te(n,s,e){const t=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(i){const o=this.toDomElement(i);return ke(o,s),Ae(o),o});n.insert(n.createPositionAt(e,"end"),t)}function ke(n,s){for(const e of B){const t=new k({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${e}`],title:s[e],"aria-hidden":"true"},children:[n.ownerDocument.importNode(Pe,!0)]});n.appendChild(t.render())}}function Ae(n){const s=new k({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});n.appendChild(s.render())}function Re(n,s){let e=s;for(const t of s.getAncestors({parentFirst:!0})){if(t.childCount>1||n.isLimit(t))break;e=t}return e}function We(n){const s=n.model;return(e,t)=>{const i=t.keyCode==T.arrowup,o=t.keyCode==T.arrowdown,r=t.shiftKey,l=s.document.selection;if(!i&&!o)return;const c=o;if(r&&He(l,c))return;const a=ze(n,l,c);if(a){if(a.isCollapsed){if(l.isCollapsed)return;if(r)return}(a.isCollapsed||xe(n,a,c))&&(s.change(d=>{const u=c?a.end:a.start;if(r){const h=s.createSelection(l.anchor);h.setFocus(u),d.setSelection(h)}else d.setSelection(u)}),e.stop(),t.preventDefault(),t.stopPropagation())}}}function ze(n,s,e){const t=n.model;if(e){const i=s.isCollapsed?s.focus:s.getLastPosition(),o=z(t,i,"forward");if(!o)return null;const r=t.createRange(i,o),l=x(t.schema,r,"backward");return l?t.createRange(i,l):null}else{const i=s.isCollapsed?s.focus:s.getFirstPosition(),o=z(t,i,"backward");if(!o)return null;const r=t.createRange(o,i),l=x(t.schema,r,"forward");return l?t.createRange(l,i):null}}function z(n,s,e){const t=n.schema,i=n.createRangeIn(s.root),o=e=="forward"?"elementStart":"elementEnd";for(const{previousPosition:r,item:l,type:c}of i.getWalker({startPosition:s,direction:e})){if(t.isLimit(l)&&!t.isInline(l))return r;if(c==o&&t.isBlock(l))return null}return null}function x(n,s,e){const t=e=="backward"?s.end:s.start;if(n.checkChild(t,"$text"))return t;for(const{nextPosition:i}of s.getWalker({direction:e}))if(n.checkChild(i,"$text"))return i;return null}function xe(n,s,e){const t=n.model,i=n.view.domConverter;if(e){const a=t.createSelection(s.start);t.modifySelection(a),!a.focus.isAtEnd&&!s.start.isEqual(a.focus)&&(s=t.createRange(a.focus,s.end))}const o=n.mapper.toViewRange(s),r=i.viewRangeToDom(o),l=v.getDomRangeRects(r);let c;for(const a of l){if(c===void 0){c=Math.round(a.bottom);continue}if(Math.round(a.top)>=c)return!1;c=Math.max(c,Math.round(a.bottom))}return!0}function He(n,s){return!n.isCollapsed&&n.isBackward==s}class lt extends P{constructor(){super(...arguments);p(this,"_previouslySelected",new Set)}static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[Ce,I]}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",(r,l,c)=>{const a=c.writer,d=l.selection;if(d.isCollapsed)return;const u=d.getSelectedElement();if(!u)return;const h=e.editing.mapper.toViewElement(u);m(h)&&c.consumable.consume(d,"selection")&&a.setSelection(a.createRangeOn(h),{fake:!0,label:me(h)})}),this.editor.editing.downcastDispatcher.on("selection",(r,l,c)=>{this._clearPreviouslySelectedWidgets(c.writer);const a=c.writer,d=a.document.selection;let u=null;for(const h of d.getRanges())for(const f of h){const g=f.item;m(g)&&!Ie(g,u)&&(a.addClass(R,g),this._previouslySelected.add(g),u=g)}},{priority:"low"}),t.addObserver(D),this.listenTo(i,"mousedown",(...r)=>this._onMousedown(...r)),this.listenTo(i,"arrowKey",(...r)=>{this._handleSelectionChangeOnArrowKeyPress(...r)},{context:[m,"$text"]}),this.listenTo(i,"arrowKey",(...r)=>{this._preventDefaultOnArrowKeyPress(...r)},{context:"$root"}),this.listenTo(i,"arrowKey",We(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",(r,l)=>{this._handleDelete(l.direction=="forward")&&(l.preventDefault(),r.stop())},{context:"$root"}),this.listenTo(i,"tab",(r,l)=>{r.eventPhase=="atTarget"&&(l.shiftKey||this._selectFirstNestedEditable()&&(l.preventDefault(),r.stop()))},{context:m,priority:"low"}),this.listenTo(i,"tab",(r,l)=>{l.shiftKey&&this._selectAncestorWidget()&&(l.preventDefault(),r.stop())},{priority:"low"}),this.listenTo(i,"keydown",(r,l)=>{l.keystroke==T.esc&&this._selectAncestorWidget()&&(l.preventDefault(),r.stop())},{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=this.editor,o=i.editing.view,r=o.document;let l=t.target;if(!l)return;if(t.domEvent.detail>=3){this._selectBlockContent(l)&&t.preventDefault();return}if(!m(l)){const a=Ve(l);if(!a)return;if(m(a))l=a;else{const d=De(o,t);if(d&&m(d))l=d;else return}}O.isAndroid&&t.preventDefault(),r.isFocused||o.focus();const c=i.editing.mapper.toModelElement(l);this._setSelectionOverElement(c)}_selectBlockContent(e){const t=this.editor,i=t.model,o=t.editing.mapper,r=i.schema,l=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),c=Oe(o.toModelElement(l),i.schema);return c?(i.change(a=>{const d=r.isLimit(c)?null:Fe(a.createPositionAfter(c),r),u=a.createPositionAt(c,0),h=d?a.createPositionAt(d,0):a.createPositionAt(c,"end");a.setSelection(a.createRange(u,h))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,o=this.editor.model,r=o.schema,l=o.document.selection,c=l.getSelectedElement(),a=G(i,this.editor.locale.contentLanguageDirection),d=a=="down"||a=="right",u=a=="up"||a=="down";if(c&&r.isObject(c)){const f=d?l.getLastPosition():l.getFirstPosition(),g=r.getNearestSelectionRange(f,d?"forward":"backward");g&&(o.change(w=>{w.setSelection(g)}),t.preventDefault(),e.stop());return}if(!l.isCollapsed&&!t.shiftKey){const f=l.getFirstPosition(),g=l.getLastPosition(),w=f.nodeAfter,E=g.nodeBefore;(w&&r.isObject(w)||E&&r.isObject(E))&&(o.change(j=>{j.setSelection(d?g:f)}),t.preventDefault(),e.stop());return}if(!l.isCollapsed)return;const h=this._getObjectElementNextToSelection(d);if(h&&r.isObject(h)){if(r.isInline(h)&&u)return;this._setSelectionOverElement(h),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema,r=i.document.selection.getSelectedElement();r&&o.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){const i=this.editor.model.document.selection;if(!this.editor.model.canEditAt(i)||!i.isCollapsed)return;const o=this._getObjectElementNextToSelection(e);if(o)return this.editor.model.change(r=>{let l=i.anchor.parent;for(;l.isEmpty;){const c=l;l=c.parent,r.remove(c)}this._setSelectionOverElement(o)}),!0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,o=t.document.selection,r=t.createSelection(o);if(t.modifySelection(r,{direction:e?"forward":"backward"}),r.isEqual(o))return null;const l=e?r.focus.nodeBefore:r.focus.nodeAfter;return l&&i.isObject(l)?l:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(R,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,i=this.editor.editing.view.document;for(const o of i.selection.getFirstRange().getItems())if(o.is("editableElement")){const r=e.editing.mapper.toModelElement(o);/* istanbul ignore next -- @preserve */if(!r)continue;const l=e.model.createPositionAt(r,0),c=e.model.schema.getNearestSelectionRange(l,"forward");return e.model.change(a=>{a.setSelection(c)}),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,o=e.editing.view.document.selection.getFirstPosition().parent,l=(o.is("$text")?o.parent:o).findAncestor(m);if(!l)return!1;const c=t.toModelElement(l);/* istanbul ignore next -- @preserve */return c?(e.model.change(a=>{a.setSelection(c,"on")}),!0):!1}}function Ve(n){let s=n;for(;s;){if(s.is("editableElement")||m(s))return s;s=s.parent}return null}function De(n,s){const e=J(s.domEvent);let t=null;if(e?t=n.domConverter.domRangeToView(e):t=n.createRange(n.createPositionAt(s.target,0)),!t)return null;const i=t.start;if(!i.parent)return null;let o=i.parent;return i.parent.is("editableElement")&&(i.isAtEnd&&i.nodeBefore?o=i.nodeBefore:i.isAtStart&&i.nodeAfter&&(o=i.nodeAfter)),o.is("$text")?o.parent:o}function Ie(n,s){return s?Array.from(n.getAncestors()).includes(s):!1}function Oe(n,s){for(const e of n.getAncestors({includeSelf:!0,parentFirst:!0})){if(s.checkChild(e,"$text"))return e;if(s.isLimit(e)&&!s.isObject(e))break}return null}function Fe(n,s){const e=new q({startPosition:n});for(const{item:t}of e){if(s.isLimit(t)||!t.is("element"))return null;if(s.checkChild(t,"$text"))return t}return null}class ct extends P{constructor(){super(...arguments);p(this,"_toolbarDefinitions",new Map);p(this,"_balloon")}static get requires(){return[oe]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",i=>{Ne(e.editing.view.document.selection)&&i.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:r="ck-toolbar-container",positions:l}){if(!i.length){Y("widget-toolbar-no-items",{toolbarId:e});return}const c=this.editor,a=c.t,d=new ne(c.locale);if(d.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new F("widget-toolbar-duplicated",this,{toolbarId:e});const u={view:d,getRelatedElement:o,balloonClassName:r,itemsConfig:i,positions:l,initialized:!1};c.ui.addToolbar(d,{isContextual:!0,beforeFocus:()=>{const h=o(c.editing.view.document.selection);h&&this._showToolbar(u,h)},afterBlur:()=>{this._hideToolbar(u)}}),this._toolbarDefinitions.set(e,u)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const o of this._toolbarDefinitions.values()){const r=o.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!r)this._isToolbarInBalloon(o)&&this._hideToolbar(o);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(o)&&this._hideToolbar(o);else{const l=r.getAncestors().length;l>e&&(e=l,t=r,i=o)}}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?H(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:K(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const i of this._toolbarDefinitions.values())if(this._isToolbarVisible(i)){const o=i.getRelatedElement(this.editor.editing.view.document.selection);H(this.editor,o,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function H(n,s,e){const t=n.plugins.get("ContextualBalloon"),i=K(n,s,e);t.updatePosition(i)}function K(n,s,e){const t=n.editing.view,i=se.defaultPositions;return{target:t.domConverter.mapViewToDom(s),positions:e||[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}function Ne(n){const s=n.getSelectedElement();return!!(s&&m(s))}class Me extends M(){constructor(e){super();p(this,"_referenceCoordinates");p(this,"_options");p(this,"_originalWidth");p(this,"_originalHeight");p(this,"_originalWidthPercents");p(this,"_aspectRatio");this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){const o=new v(t);this.activeHandlePosition=Ke(e),this._referenceCoordinates=Le(t,je(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;const r=i.style.width;r&&r.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(r):this._originalWidthPercents=ye(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Le(n,s){const e=new v(n),t=s.split("-"),i={x:t[1]=="right"?e.right:e.left,y:t[0]=="bottom"?e.bottom:e.top};return i.x+=n.ownerDocument.defaultView.scrollX,i.y+=n.ownerDocument.defaultView.scrollY,i}function Be(n){return`ck-widget__resizer__handle-${n}`}function Ke(n){const s=["top-left","top-right","bottom-right","bottom-left"];for(const e of s)if(n.classList.contains(Be(e)))return e}function je(n){const s=n.split("-"),e={top:"bottom",bottom:"top",left:"right",right:"left"};return`${e[s[0]]}-${e[s[1]]}`}class $e extends le{constructor(){super();const s=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",s.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:s.if("_isVisible","none",e=>!e)}},children:[{text:s.to("_label")}]})}_bindToState(s,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",(t,i)=>t!==null&&i!==null),this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(t,i,o)=>s.unit==="px"?`${t}×${i}`:`${o}%`),this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",(t,i,o)=>i<50||o<50?"above-center":t)}_dismiss(){this.unbind(),this._isVisible=!1}}class V extends M(){constructor(e){super();p(this,"_state");p(this,"_sizeView");p(this,"_options");p(this,"_viewResizerWrapper",null);p(this,"_initialViewWidth");this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(t,i)=>t&&i),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),t.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(t=>{t.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(t=>{t.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(o=>{const r=o.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(l){const c=this.toDomElement(l);return e._appendHandles(c),e._appendSizeUI(c),c});o.insert(o.createPositionAt(t,"end"),r),o.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=r,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new Me(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(d=>{const u=this._options.unit||"%",h=(u==="%"?t.widthPercents:t.width)+u;d.setStyle("width",h,this._options.viewElement)});const o=this._getHandleHost(),r=new v(o),l=Math.round(r.width),c=Math.round(r.height),a=new v(o);t.width=Math.round(a.width),t.height=Math.round(a.height),this.redraw(r),this.state.update({...t,handleHostWidth:l,handleHostHeight:c})}commit(){const e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!Ge(t))return;const i=t.parentElement,o=this._getHandleHost(),r=this._viewResizerWrapper,l=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let c;if(i.isSameNode(o)){const a=e||new v(o);c=[a.width+"px",a.height+"px",void 0,void 0]}else c=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];Z(l,c)!=="same"&&this._options.editor.editing.view.change(a=>{a.setStyle({width:c[0],height:c[1],left:c[2],top:c[3]},r)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,i=qe(e),o=this._options.isCentered?this._options.isCentered(this):!0,r={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(r.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(r.x*=2);let l=Math.abs(t.originalWidth+r.x),c=Math.abs(t.originalHeight+r.y);return(l/t.aspectRatio>c?"width":"height")=="width"?c=l/t.aspectRatio:l=c*t.aspectRatio,{width:Math.round(l),height:Math.round(c),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*l*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)e.appendChild(new k({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Ue(i)}`}}).render())}_appendSizeUI(e){this._sizeView=new $e,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Ue(n){return`ck-widget__resizer__handle-${n}`}function qe(n){return{x:n.pageX,y:n.pageY}}function Ge(n){return n&&n.ownerDocument&&n.ownerDocument.contains(n)}class at extends P{constructor(){super(...arguments);p(this,"_resizers",new Map);p(this,"_observer");p(this,"_redrawSelectedResizerThrottled")}static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,t=A.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(D),this._observer=new(Q()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=ae(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[o,r]of this._resizers)o.isAttached()||(this._resizers.delete(o),r.destroy())},{priority:"lowest"}),this._observer.listenTo(A.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const o=i.getSelectedElement(),r=this.getResizerByViewElement(o)||null;r?this.select(r):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new V(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const l=i.get("WidgetToolbarRepository");t.on("begin",()=>{l.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{l.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{l.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const r=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(r)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const i=t.domTarget;V.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}export{ue as WIDGET_CLASS_NAME,R as WIDGET_SELECTED_CLASS_NAME,lt as Widget,at as WidgetResize,ct as WidgetToolbarRepository,Ce as WidgetTypeAround,be as calculateResizeHostAncestorWidth,ye as calculateResizeHostPercentageWidth,rt as findOptimalInsertionRange,me as getLabel,m as isWidget,L as setHighlightHandling,fe as setLabel,nt as toWidget,st as toWidgetEditable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exports as r}from"../../../../../../../../_virtual/
|
|
1
|
+
import{__exports as r}from"../../../../../../../../_virtual/external3.js";import{__require as i}from"./figma_client.js";var t;function a(){return t?r:(t=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getComponents=void 0;var n=i();Object.defineProperty(e,"getComponents",{enumerable:!0,get:function(){return n.getComponents}})}(r),r)}export{a as __require};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__exports as r}from"../../../../../../../../_virtual/updates.js";import{__require as $}from"../../../../../../chalk@4.1.2/node_modules/chalk/source/index.js";import{__require as k}from"./logging.js";import w from"../../../../../../../../_virtual/___vite-browser-external.js";import b from"../../../../../../../../_virtual/
|
|
1
|
+
import{__exports as r}from"../../../../../../../../_virtual/updates.js";import{__require as $}from"../../../../../../chalk@4.1.2/node_modules/chalk/source/index.js";import{__require as k}from"./logging.js";import w from"../../../../../../../../_virtual/___vite-browser-external.js";import b from"../../../../../../../../_virtual/index5.js";import{__require as y}from"./fetch.js";import l from"../../package.json.js";var f;function S(){if(f)return r;f=1;var p=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.withUpdateCheck=g,r.exitWithUpdateCheck=q,r.updateCli=U;const o=p($()),d=k(),m=w,h=b,_=y();let i;function g(e){return(...t)=>{const n=t[t.length-2],c=t.slice(0,-2);if(n.skipUpdateCheck)return e(...c,n);v();const u=e(...c,n);u instanceof Promise?u.finally(a):a()}}function v(){_.request.get("https://api.github.com/repos/figma/code-connect/releases/latest").then(e=>{const t=e.data.tag_name.replace(/^v/,""),n=l.version;(0,h.compareVersions)(t,n)===1?i=t:i=!1}).catch(()=>{i=!1})}async function a(){for(let e=0;e<10&&i===void 0;e++)await new Promise(t=>setTimeout(t,100));s()}function q(e=1){s(),process.exit(e)}function C(){return"npm update -g @figma/code-connect"}function s(){i&&d.logger.warn(`
|
|
2
2
|
A new version of the Figma CLI is available. v${l.version} is currently installed, and the latest version available is v${i}.
|
|
3
3
|
|
|
4
4
|
To update, run ${o.default.whiteBright("npm install @figma/code-connect@latest")} for React or HTML, or ${o.default.whiteBright("npm install -g @figma/code-connect@latest")} for other targets (or if you have Code Connect installed globally).`)}function U(){(0,m.execSync)(C(),{stdio:"inherit"})}return r}export{S as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as u}from"../../../../../../../../_virtual/external2.js";import{__require as s}from"../../../../../../react@19.1.0/node_modules/react/index.js";import{__require as p}from"../connect/external_types.js";var f;function P(){return f?u:(f=1,function(t){var o=u&&u.__createBinding||(Object.create?function(e,n,r,a){a===void 0&&(a=r);var c=Object.getOwnPropertyDescriptor(n,r);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,a,c)}:function(e,n,r,a){a===void 0&&(a=r),e[a]=n[r]}),l=u&&u.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),_=u&&u.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&o(n,e,r);return l(n,e),n};Object.defineProperty(t,"__esModule",{value:!0}),t.instance=t.textContent=t.className=t.nestedProps=t.string=t.enum=t.boolean=void 0,t.connect=d,t.children=y;const b=_(s()),i=p();Object.defineProperty(t,"boolean",{enumerable:!0,get:function(){return i.booleanType}}),Object.defineProperty(t,"enum",{enumerable:!0,get:function(){return i.enumType}}),Object.defineProperty(t,"string",{enumerable:!0,get:function(){return i.stringType}}),Object.defineProperty(t,"nestedProps",{enumerable:!0,get:function(){return i.nestedPropsType}}),Object.defineProperty(t,"className",{enumerable:!0,get:function(){return i.classNameType}}),Object.defineProperty(t,"textContent",{enumerable:!0,get:function(){return i.textContentType}}),Object.defineProperty(t,"instance",{enumerable:!0,get:function(){return i.instanceType}});function d(e,n,r){}function y(e){return b.createElement("div")}}(u),u)}export{P as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as r}from"../../../../../../../../_virtual/index_react2.js";import{__require as s}from"./external.js";import{__require as p}from"../connect/index_common.js";var o;function x(){if(o)return r;o=1;var _=r&&r.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var u=Object.getOwnPropertyDescriptor(t,n);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,u)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),c=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return c(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.client=r.figma=void 0;const l=f(s()),d=(0,p().getClient)();r.client=d;const a=l;return r.figma=a,r.default=a,r}export{x as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getSideAxis as L,getAlignmentAxis as H,getSide as F,getAlignment as C,getAxisLength as J,evaluate as _,getOppositePlacement as K,getExpandedPlacements as N,getOppositeAxisPlacements as Q,getAlignmentSides as q,getPaddingObject as U,rectToClientRect as I,placements as X,getOppositeAlignmentPlacement as W}from"../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js";function Y(n,l,f){let{reference:t,floating:e}=n;const i=L(l),c=H(l),a=J(c),w=F(l),p=i==="y",g=t.x+t.width/2-e.width/2,r=t.y+t.height/2-e.height/2,d=t[a]/2-e[a]/2;let o;switch(w){case"top":o={x:g,y:t.y-e.height};break;case"bottom":o={x:g,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:r};break;case"left":o={x:t.x-e.width,y:r};break;default:o={x:t.x,y:t.y}}switch(C(l)){case"start":o[c]-=d*(f&&p?-1:1);break;case"end":o[c]+=d*(f&&p?-1:1);break}return o}const te=async(n,l,f)=>{const{placement:t="bottom",strategy:e="absolute",middleware:i=[],platform:c}=f,a=i.filter(Boolean),w=await(c.isRTL==null?void 0:c.isRTL(l));let p=await c.getElementRects({reference:n,floating:l,strategy:e}),{x:g,y:r}=Y(p,t,w),d=t,o={},x=0;for(let h=0;h<a.length;h++){const{name:y,fn:v}=a[h],{x:u,y:P,data:b,reset:s}=await v({x:g,y:r,initialPlacement:t,placement:d,strategy:e,middlewareData:o,rects:p,platform:c,elements:{reference:n,floating:l}});g=u??g,r=P??r,o={...o,[y]:{...o[y],...b}},s&&x<=50&&(x++,typeof s=="object"&&(s.placement&&(d=s.placement),s.rects&&(p=s.rects===!0?await c.getElementRects({reference:n,floating:l,strategy:e}):s.rects),{x:g,y:r}=Y(p,d,w)),h=-1)}return{x:g,y:r,placement:d,strategy:e,middlewareData:o}};async function z(n,l){var f;l===void 0&&(l={});const{x:t,y:e,platform:i,rects:c,elements:a,strategy:w}=n,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:r="floating",altBoundary:d=!1,padding:o=0}=_(l,n),x=U(o),y=a[d?r==="floating"?"reference":"floating":r],v=I(await i.getClippingRect({element:(f=await(i.isElement==null?void 0:i.isElement(y)))==null||f?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:p,rootBoundary:g,strategy:w})),u=r==="floating"?{x:t,y:e,width:c.floating.width,height:c.floating.height}:c.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(P))?await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1}:{x:1,y:1},s=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:u,offsetParent:P,strategy:w}):u);return{top:(v.top-s.top+x.top)/b.y,bottom:(s.bottom-v.bottom+x.bottom)/b.y,left:(v.left-s.left+x.left)/b.x,right:(s.right-v.right+x.right)/b.x}}function Z(n,l,f){return(n?[...f.filter(e=>C(e)===n),...f.filter(e=>C(e)!==n)]:f.filter(e=>F(e)===e)).filter(e=>n?C(e)===n||(l?W(e)!==e:!1):!0)}const ne=function(n){return n===void 0&&(n={}),{name:"autoPlacement",options:n,async fn(l){var f,t,e;const{rects:i,middlewareData:c,placement:a,platform:w,elements:p}=l,{crossAxis:g=!1,alignment:r,allowedPlacements:d=X,autoAlignment:o=!0,...x}=_(n,l),h=r!==void 0||d===X?Z(r||null,o,d):d,y=await z(l,x),v=((f=c.autoPlacement)==null?void 0:f.index)||0,u=h[v];if(u==null)return{};const P=q(u,i,await(w.isRTL==null?void 0:w.isRTL(p.floating)));if(a!==u)return{reset:{placement:h[0]}};const b=[y[F(u)],y[P[0]],y[P[1]]],s=[...((t=c.autoPlacement)==null?void 0:t.overflows)||[],{placement:u,overflows:b}],T=h[v+1];if(T)return{data:{index:v+1,overflows:s},reset:{placement:T}};const B=s.map(m=>{const O=C(m.placement);return[m.placement,O&&g?m.overflows.slice(0,2).reduce((j,M)=>j+M,0):m.overflows[0],m.overflows]}).sort((m,O)=>m[1]-O[1]),S=((e=B.filter(m=>m[2].slice(0,C(m[0])?2:3).every(O=>O<=0))[0])==null?void 0:e[0])||B[0][0];return S!==a?{data:{index:v+1,overflows:s},reset:{placement:S}}:{}}}},le=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(l){var f,t;const{placement:e,middlewareData:i,rects:c,initialPlacement:a,platform:w,elements:p}=l,{mainAxis:g=!0,crossAxis:r=!0,fallbackPlacements:d,fallbackStrategy:o="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...y}=_(n,l);if((f=i.arrow)!=null&&f.alignmentOffset)return{};const v=F(e),u=L(a),P=F(a)===a,b=await(w.isRTL==null?void 0:w.isRTL(p.floating)),s=d||(P||!h?[K(a)]:N(a)),T=x!=="none";!d&&T&&s.push(...Q(a,h,x,b));const B=[a,...s],$=await z(l,y),S=[];let m=((t=i.flip)==null?void 0:t.overflows)||[];if(g&&S.push($[v]),r){const k=q(e,c,b);S.push($[k[0]],$[k[1]])}if(m=[...m,{placement:e,overflows:S}],!S.every(k=>k<=0)){var O,j;const k=(((O=i.flip)==null?void 0:O.index)||0)+1,V=B[k];if(V&&(!(r==="alignment"?u!==L(V):!1)||m.every(A=>A.overflows[0]>0&&L(A.placement)===u)))return{data:{index:k,overflows:m},reset:{placement:V}};let D=(j=m.filter(E=>E.overflows[0]<=0).sort((E,A)=>E.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(o){case"bestFit":{var M;const E=(M=m.filter(A=>{if(T){const R=L(A.placement);return R===u||R==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(R=>R>0).reduce((R,G)=>R+G,0)]).sort((A,R)=>A[1]-R[1])[0])==null?void 0:M[0];E&&(D=E);break}case"initialPlacement":D=a;break}if(e!==D)return{reset:{placement:D}}}return{}}}};export{ne as autoPlacement,te as computePosition,z as detectOverflow,le as flip,I as rectToClientRect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computePosition as ot,flip as st,autoPlacement as rt}from"../../../../../@floating-ui_core@1.7.2/node_modules/@floating-ui/core/dist/floating-ui.core.js";import{createCoords as w,rectToClientRect as J,floor as A,max as E,round as H,min as z}from"../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js";import{getOverflowAncestors as M,isElement as v,getDocumentElement as O,getWindow as L,getFrameElement as K,getComputedStyle as R,isHTMLElement as b,isWebKit as Q,isTopLayer as S,getParentNode as W,isLastTraversableNode as N,isTableElement as ct,isContainingBlock as Y,getContainingBlock as lt,getNodeName as _,isOverflowElement as P,getNodeScroll as I}from"../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js";function Z(t){const e=R(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=b(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,c=H(n)!==r||H(i)!==s;return c&&(n=r,i=s),{width:n,height:i,$:c}}function $(t){return v(t)?t:t.contextElement}function F(t){const e=$(t);if(!b(e))return w(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=Z(e);let s=(r?H(n.width):n.width)/i,c=(r?H(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ft=w(0);function X(t){const e=L(t);return!Q()||!e.visualViewport?ft:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ut(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==L(t)?!1:e}function T(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=$(t);let s=w(1);e&&(i?v(i)&&(s=F(i)):s=F(t));const c=ut(r,n,i)?X(r):w(0);let l=(o.left+c.x)/s.x,f=(o.top+c.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(r){const p=L(r),a=i&&v(i)?L(i):i;let x=p,g=K(x);for(;g&&i&&a!==x;){const m=F(g),d=g.getBoundingClientRect(),y=R(g),C=d.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,B=d.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,f*=m.y,u*=m.x,h*=m.y,l+=C,f+=B,x=L(g),g=K(x)}}return J({width:u,height:h,x:l,y:f})}function q(t,e){const n=I(t).scrollLeft;return e?e.left+n:T(O(t)).left+n}function tt(t,e,n){n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:q(t,i)),r=i.top+e.scrollTop;return{x:o,y:r}}function ht(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r=o==="fixed",s=O(i),c=e?S(e.floating):!1;if(i===s||c&&r)return n;let l={scrollLeft:0,scrollTop:0},f=w(1);const u=w(0),h=b(i);if((h||!h&&!r)&&((_(i)!=="body"||P(s))&&(l=I(i)),b(i))){const a=T(i);f=F(i),u.x=a.x+i.clientLeft,u.y=a.y+i.clientTop}const p=s&&!h&&!r?tt(s,l,!0):w(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+p.x,y:n.y*f.y-l.scrollTop*f.y+u.y+p.y}}function at(t){return Array.from(t.getClientRects())}function dt(t){const e=O(t),n=I(t),i=t.ownerDocument.body,o=E(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=E(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+q(t);const c=-n.scrollTop;return R(i).direction==="rtl"&&(s+=E(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:c}}function gt(t,e){const n=L(t),i=O(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,c=0,l=0;if(o){r=o.width,s=o.height;const f=Q();(!f||f&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:c,y:l}}const pt=new Set(["absolute","fixed"]);function mt(t,e){const n=T(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=b(t)?F(t):w(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=o*r.x,f=i*r.y;return{width:s,height:c,x:l,y:f}}function j(t,e,n){let i;if(e==="viewport")i=gt(t,n);else if(e==="document")i=dt(O(t));else if(v(e))i=mt(e,n);else{const o=X(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return J(i)}function et(t,e){const n=W(t);return n===e||!v(n)||N(n)?!1:R(n).position==="fixed"||et(n,e)}function wt(t,e){const n=e.get(t);if(n)return n;let i=M(t,[],!1).filter(c=>v(c)&&_(c)!=="body"),o=null;const r=R(t).position==="fixed";let s=r?W(t):t;for(;v(s)&&!N(s);){const c=R(s),l=Y(s);!l&&c.position==="fixed"&&(o=null),(r?!l&&!o:!l&&c.position==="static"&&!!o&&pt.has(o.position)||P(s)&&!l&&et(t,s))?i=i.filter(u=>u!==s):o=c,s=W(s)}return e.set(t,i),i}function xt(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s=[...n==="clippingAncestors"?S(e)?[]:wt(e,this._c):[].concat(n),i],c=s[0],l=s.reduce((f,u)=>{const h=j(e,u,o);return f.top=E(h.top,f.top),f.right=z(h.right,f.right),f.bottom=z(h.bottom,f.bottom),f.left=E(h.left,f.left),f},j(e,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yt(t){const{width:e,height:n}=Z(t);return{width:e,height:n}}function vt(t,e,n){const i=b(e),o=O(e),r=n==="fixed",s=T(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=w(0);function f(){l.x=q(o)}if(i||!i&&!r)if((_(e)!=="body"||P(o))&&(c=I(e)),i){const a=T(e,!0,r,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else o&&f();r&&!i&&o&&f();const u=o&&!i&&!r?tt(o,c):w(0),h=s.left+c.scrollLeft-l.x-u.x,p=s.top+c.scrollTop-l.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function V(t){return R(t).position==="static"}function G(t,e){if(!b(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return O(t)===n&&(n=n.ownerDocument.body),n}function nt(t,e){const n=L(t);if(S(t))return n;if(!b(t)){let o=W(t);for(;o&&!N(o);){if(v(o)&&!V(o))return o;o=W(o)}return n}let i=G(t,e);for(;i&&ct(i)&&V(i);)i=G(i,e);return i&&N(i)&&V(i)&&!Y(i)?n:i||lt(t)||n}const Rt=async function(t){const e=this.getOffsetParent||nt,n=this.getDimensions,i=await n(t.floating);return{reference:vt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Ot(t){return R(t).direction==="rtl"}const bt={convertOffsetParentRelativeRectToViewportRelativeRect:ht,getDocumentElement:O,getClippingRect:xt,getOffsetParent:nt,getElementRects:Rt,getClientRects:at,getDimensions:yt,getScale:F,isElement:v,isRTL:Ot};function it(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ct(t,e){let n=null,i;const o=O(t);function r(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();const f=t.getBoundingClientRect(),{left:u,top:h,width:p,height:a}=f;if(c||e(),!p||!a)return;const x=A(h),g=A(o.clientWidth-(u+p)),m=A(o.clientHeight-(h+a)),d=A(u),C={rootMargin:-x+"px "+-g+"px "+-m+"px "+-d+"px",threshold:E(0,z(1,l))||1};let B=!0;function k(U){const D=U[0].intersectionRatio;if(D!==l){if(!B)return s();D?s(!1,D):i=setTimeout(()=>{s(!1,1e-7)},1e3)}D===1&&!it(f,t.getBoundingClientRect())&&s(),B=!1}try{n=new IntersectionObserver(k,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,C)}n.observe(t)}return s(!0),r}function Ft(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,f=$(t),u=o||r?[...f?M(f):[],...M(e)]:[];u.forEach(d=>{o&&d.addEventListener("scroll",n,{passive:!0}),r&&d.addEventListener("resize",n)});const h=f&&c?Ct(f,n):null;let p=-1,a=null;s&&(a=new ResizeObserver(d=>{let[y]=d;y&&y.target===f&&a&&(a.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=a)==null||C.observe(e)})),n()}),f&&!l&&a.observe(f),a.observe(e));let x,g=l?T(t):null;l&&m();function m(){const d=T(t);g&&!it(g,d)&&n(),g=d,x=requestAnimationFrame(m)}return n(),()=>{var d;u.forEach(y=>{o&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),h==null||h(),(d=a)==null||d.disconnect(),a=null,l&&cancelAnimationFrame(x)}}const Wt=rt,Bt=st,Dt=(t,e,n)=>{const i=new Map,o={platform:bt,...n},r={...o.platform,_c:i};return ot(t,e,{...o,platform:r})};export{Wt as autoPlacement,Ft as autoUpdate,Dt as computePosition,Bt as flip,M as getOverflowAncestors,bt as platform};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(){return typeof window<"u"}function u(t){return p(t)?(t.nodeName||"").toLowerCase():"#document"}function i(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(p(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function p(t){return c()?t instanceof Node||t instanceof i(t).Node:!1}function m(t){return c()?t instanceof Element||t instanceof i(t).Element:!1}function w(t){return c()?t instanceof HTMLElement||t instanceof i(t).HTMLElement:!1}function f(t){return!c()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof i(t).ShadowRoot}const E=new Set(["inline","contents"]);function y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=S(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!E.has(r)}const T=new Set(["table","td","th"]);function A(t){return T.has(u(t))}const v=[":popover-open",":modal"];function L(t){return v.some(e=>{try{return t.matches(e)}catch{return!1}})}const D=["transform","translate","scale","rotate","perspective"],C=["transform","translate","scale","rotate","perspective","filter"],k=["paint","layout","strict","content"];function V(t){const e=O(),n=m(t)?S(t):t;return D.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||C.some(o=>(n.willChange||"").includes(o))||k.some(o=>(n.contain||"").includes(o))}function B(t){let e=s(t);for(;w(e)&&!h(e);){if(V(e))return e;if(L(e))return null;e=s(e)}return null}function O(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const R=new Set(["html","body","#document"]);function h(t){return R.has(u(t))}function S(t){return i(t).getComputedStyle(t)}function F(t){return m(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function s(t){if(u(t)==="html")return t;const e=t.assignedSlot||t.parentNode||f(t)&&t.host||N(t);return f(e)?e.host:e}function b(t){const e=s(t);return h(e)?t.ownerDocument?t.ownerDocument.body:t.body:w(e)&&y(e)?e:b(e)}function d(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=b(t),g=r===((o=t.ownerDocument)==null?void 0:o.body),l=i(r);if(g){const a=_(l);return e.concat(l,l.visualViewport||[],y(r)?r:[],a&&n?d(a):[])}return e.concat(r,d(r,[],n))}function _(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}export{S as getComputedStyle,B as getContainingBlock,N as getDocumentElement,_ as getFrameElement,b as getNearestOverflowAncestor,u as getNodeName,F as getNodeScroll,d as getOverflowAncestors,s as getParentNode,i as getWindow,V as isContainingBlock,m as isElement,w as isHTMLElement,h as isLastTraversableNode,p as isNode,y as isOverflowElement,f as isShadowRoot,A as isTableElement,L as isTopLayer,O as isWebKit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const p=["top","right","bottom","left"],l=["start","end"],j=p.reduce((t,e)=>t.concat(e,e+"-"+l[0],e+"-"+l[1]),[]),C=Math.min,L=Math.max,E=Math.round,R=Math.floor,T=t=>({x:t,y:t}),h={left:"right",right:"left",bottom:"top",top:"bottom"},x={start:"end",end:"start"};function k(t,e){return typeof t=="function"?t(e):t}function g(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function b(t){return t==="x"?"y":"x"}function d(t){return t==="y"?"height":"width"}const A=new Set(["top","bottom"]);function P(t){return A.has(g(t))?"y":"x"}function y(t){return b(P(t))}function q(t,e,n){n===void 0&&(n=!1);const r=m(t),i=y(t),o=d(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(c=f(c)),[c,f(c)]}function z(t){const e=f(t);return[s(t),e,s(e)]}function s(t){return t.replace(/start|end/g,e=>x[e])}const u=["left","right"],a=["right","left"],M=["top","bottom"],O=["bottom","top"];function S(t,e,n){switch(t){case"top":case"bottom":return n?e?a:u:e?u:a;case"left":case"right":return e?M:O;default:return[]}}function B(t,e,n,r){const i=m(t);let o=S(g(t),n==="start",r);return i&&(o=o.map(c=>c+"-"+i),e&&(o=o.concat(o.map(s)))),o}function f(t){return t.replace(/left|right|bottom|top/g,e=>h[e])}function w(t){return{top:0,right:0,bottom:0,left:0,...t}}function D(t){return typeof t!="number"?w(t):{top:t,right:t,bottom:t,left:t}}function F(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}export{l as alignments,T as createCoords,k as evaluate,w as expandPaddingObject,R as floor,m as getAlignment,y as getAlignmentAxis,q as getAlignmentSides,d as getAxisLength,z as getExpandedPlacements,s as getOppositeAlignmentPlacement,b as getOppositeAxis,B as getOppositeAxisPlacements,f as getOppositePlacement,D as getPaddingObject,g as getSide,P as getSideAxis,L as max,C as min,j as placements,F as rectToClientRect,E as round,p as sides};
|