From 718844b1dd38c92313b6b75c531a3b4a29e02a52 Mon Sep 17 00:00:00 2001 From: splincode Date: Mon, 10 Jul 2023 16:05:23 +0300 Subject: [PATCH] deprecate(addon-editor): replace to `@tinkoff/tui-editor` --- .github/workflows/e2e.yml | 1 - .github/workflows/test.yml | 6 - package-lock.json | 1112 +---------------- projects/addon-editor/LICENSE | 190 --- projects/addon-editor/README.md | 36 - .../abstract/editor-adapter.abstract.ts | 100 -- projects/addon-editor/abstract/index.ts | 1 - .../addon-editor/abstract/ng-package.json | 8 - .../color-edit/color-edit.component.ts | 64 - .../color-edit/color-edit.module.ts | 35 - .../color-edit/color-edit.style.less | 11 - .../color-edit/color-edit.template.html | 66 - .../test/color-edit.component.spec.ts | 48 - .../color-picker/color-picker.component.ts | 91 -- .../color-picker/color-picker.module.ts | 13 - .../color-picker/color-picker.style.less | 79 -- .../color-picker/color-picker.template.html | 23 - .../test/color-picker.component.spec.ts | 39 - .../color-selector.component.ts | 261 ---- .../color-selector/color-selector.module.ts | 37 - .../color-selector/color-selector.style.less | 105 -- .../color-selector.template.html | 93 -- .../flat-picker/flat-picker.component.ts | 42 - .../flat-picker/flat-picker.module.ts | 11 - .../flat-picker/flat-picker.style.less | 13 - .../flat-picker/flat-picker.template.html | 5 - .../components/color-selector/index.ts | 14 - .../linear-multi-picker.component.ts | 79 -- .../linear-multi-picker.module.ts | 11 - .../linear-multi-picker.style.less | 15 - .../linear-multi-picker.template.html | 7 - .../linear-picker/linear-picker.component.ts | 38 - .../linear-picker/linear-picker.module.ts | 11 - .../linear-picker/linear-picker.style.less | 15 - .../linear-picker/linear-picker.template.html | 4 - .../components/color-selector/ng-package.json | 8 - .../palette/palette.component.ts | 27 - .../color-selector/palette/palette.module.ts | 12 - .../color-selector/palette/palette.style.less | 17 - .../palette/palette.template.html | 10 - .../test/color-selector.component.spec.ts | 49 - .../edit-link/edit-link.component.ts | 230 ---- .../components/edit-link/edit-link.module.ts | 32 - .../components/edit-link/edit-link.style.less | 98 -- .../edit-link/edit-link.template.html | 98 -- .../components/edit-link/index.ts | 5 - .../components/edit-link/ng-package.json | 8 - .../edit-link/pipes/filter-anchors.pipe.ts | 8 - .../edit-link/pipes/short-url.pipe.ts | 14 - .../edit-link/test/edit-link-parse.spec.ts | 143 --- .../edit-link/utils/edit-link-parse-url.ts | 51 - .../editor-resizable.abstract.ts | 45 - .../editor-resizable.component.html | 26 - .../editor-resizable.component.less | 62 - .../editor-resizable.component.ts | 43 - .../editor-resizable.module.ts | 12 - .../components/editor-resizable/index.ts | 3 - .../editor-resizable/ng-package.json | 8 - .../editor-socket.component.less | 35 - .../editor-socket/editor-socket.component.ts | 78 -- .../editor-socket/editor-socket.module.ts | 9 - .../components/editor-socket/index.ts | 2 - .../components/editor-socket/ng-package.json | 8 - .../editor-socket/styles/code-blocks.less | 12 - .../editor-socket/styles/details.less | 111 -- .../editor-socket/styles/groups.less | 29 - .../components/editor-socket/styles/link.less | 36 - .../components/editor-socket/styles/list.less | 71 -- .../editor-socket/styles/media.less | 16 - .../editor-socket/styles/placeholder.less | 9 - .../editor-socket/styles/table.less | 79 -- .../components/editor-socket/styles/text.less | 66 - .../components/editor/editor.component.html | 68 - .../components/editor/editor.component.less | 62 - .../components/editor/editor.component.ts | 235 ---- .../components/editor/editor.module.ts | 33 - .../components/editor/editor.providers.ts | 66 - .../addon-editor/components/editor/index.ts | 6 - .../components/editor/ng-package.json | 8 - .../portal/editor-portal-host.component.ts | 23 - .../portal/editor-portal-host.style.less | 6 - .../editor/portal/editor-portal.directive.ts | 24 - .../editor/portal/editor-portal.service.ts | 5 - projects/addon-editor/components/index.ts | 8 - .../components/input-color/index.ts | 2 - .../input-color/input-color.component.ts | 104 -- .../input-color/input-color.module.ts | 25 - .../input-color/input-color.style.less | 24 - .../input-color/input-color.template.html | 40 - .../components/input-color/ng-package.json | 8 - .../test/input-color.component.spec.ts | 46 - .../addon-editor/components/ng-package.json | 8 - .../align-content/align-content.component.ts | 35 - .../align-content/align-content.module.ts | 19 - .../align-content/align-content.template.html | 69 - .../toolbar-tools/align-content/index.ts | 2 - .../align-content/ng-package.json | 8 - .../toolbar-tools/code/code.component.html | 28 - .../toolbar-tools/code/code.component.ts | 40 - .../toolbar-tools/code/code.module.ts | 23 - .../components/toolbar-tools/code/index.ts | 2 - .../toolbar-tools/code/ng-package.json | 8 - .../details-remove.component.ts | 29 - .../details-remove.template.html | 14 - .../details/details.component.ts | 23 - .../toolbar-tools/details/details.module.ts | 13 - .../details/details.template.html | 13 - .../components/toolbar-tools/details/index.ts | 3 - .../toolbar-tools/details/ng-package.json | 8 - .../font-size/font-size.component.ts | 67 - .../font-size/font-size.module.ts | 23 - .../font-size/font-size.template.html | 34 - .../toolbar-tools/font-size/index.ts | 2 - .../toolbar-tools/font-size/ng-package.json | 8 - .../font-style/font-style.component.ts | 50 - .../font-style/font-style.module.ts | 12 - .../font-style/font-style.template.html | 74 -- .../toolbar-tools/font-style/index.ts | 2 - .../toolbar-tools/font-style/ng-package.json | 8 - .../toolbar-tools/group/group.component.html | 24 - .../toolbar-tools/group/group.component.ts | 37 - .../toolbar-tools/group/group.module.ts | 12 - .../components/toolbar-tools/group/index.ts | 2 - .../toolbar-tools/group/ng-package.json | 8 - .../highlight-color.component.ts | 41 - .../highlight-color/highlight-color.module.ts | 28 - .../highlight-color.template.html | 38 - .../toolbar-tools/highlight-color/index.ts | 2 - .../highlight-color/ng-package.json | 8 - .../components/toolbar-tools/index.ts | 14 - .../toolbar-tools/list-configs/index.ts | 2 - .../list-configs/list-configs.component.ts | 39 - .../list-configs/list-configs.module.ts | 19 - .../list-configs/list-configs.template.html | 70 -- .../list-configs/ng-package.json | 8 - .../components/toolbar-tools/ng-package.json | 8 - .../toolbar-tools/table-cell-color/index.ts | 2 - .../table-cell-color/ng-package.json | 8 - .../table-cell-color.component.ts | 66 - .../table-cell-color.module.ts | 28 - .../table-cell-color.template.html | 39 - .../toolbar-tools/table-create/index.ts | 2 - .../table-create/ng-package.json | 8 - .../table-create/table-create.component.ts | 37 - .../table-create/table-create.module.ts | 25 - .../table-create/table-create.template.html | 22 - .../toolbar-tools/table-merge-cells/index.ts | 2 - .../table-merge-cells/ng-package.json | 8 - .../table-merge-cells.component.ts | 38 - .../table-merge-cells.module.ts | 13 - .../table-merge-cells.template.html | 21 - .../table-row-column-manager/index.ts | 2 - .../table-row-column-manager/ng-package.json | 8 - .../table-row-column-manager.component.ts | 55 - .../table-row-column-manager.module.ts | 25 - .../table-row-column-manager.template.html | 34 - .../table-size-selector/index.ts | 2 - .../table-size-selector/ng-package.json | 8 - .../table-size-selector.component.ts | 69 - .../table-size-selector.module.ts | 12 - .../table-size-selector.style.less | 27 - .../table-size-selector.template.html | 13 - .../toolbar-tools/text-color/index.ts | 2 - .../toolbar-tools/text-color/ng-package.json | 8 - .../text-color/text-color.component.ts | 37 - .../text-color/text-color.module.ts | 28 - .../text-color/text-color.template.html | 37 - .../toolbar-tools/tools-common.less | 36 - .../addon-editor/components/toolbar/index.ts | 3 - .../components/toolbar/ng-package.json | 8 - .../toolbar-navigation-manager.directive.ts | 92 -- .../components/toolbar/toolbar.component.ts | 325 ----- .../components/toolbar/toolbar.module.ts | 51 - .../components/toolbar/toolbar.style.less | 101 -- .../components/toolbar/toolbar.template.html | 398 ------ .../constants/default-editor-colors.ts | 29 - .../constants/default-editor-tools.ts | 25 - .../constants/default-font-options-handler.ts | 35 - .../default-html5-media-attributes.ts | 14 - .../constants/default-link-options-handler.ts | 23 - projects/addon-editor/constants/index.ts | 5 - .../addon-editor/constants/ng-package.json | 5 - .../image-preview/image-preview.directive.ts | 17 - .../image-preview/image-preview.module.ts | 9 - .../directives/image-preview/index.ts | 2 - .../directives/image-preview/ng-package.json | 5 - projects/addon-editor/directives/index.ts | 2 - .../addon-editor/directives/ng-package.json | 5 - .../directives/tiptap-editor/index.ts | 3 - .../directives/tiptap-editor/ng-package.json | 5 - .../tiptap-editor/tiptap-editor.directive.ts | 55 - .../tiptap-editor/tiptap-editor.module.ts | 9 - .../tiptap-editor/tiptap-editor.service.ts | 406 ------ .../tiptap-editor/tiptap-editor.types.ts | 44 - .../tiptap-editor/utils/is-empty-paragraph.ts | 10 - projects/addon-editor/enums/editor-tool.ts | 31 - projects/addon-editor/enums/index.ts | 1 - projects/addon-editor/enums/ng-package.json | 5 - .../background-color/background-color.ts | 70 -- .../extensions/background-color/index.ts | 1 - .../background-color/ng-package.json | 8 - .../default-editor-extensions.ts | 52 - .../default-editor-extensions/index.ts | 1 - .../default-editor-extensions/ng-package.json | 8 - .../details/details-content.extension.ts | 33 - .../extensions/details/details.extension.ts | 105 -- .../addon-editor/extensions/details/index.ts | 3 - .../extensions/details/ng-package.json | 8 - .../extensions/details/summary.extension.ts | 35 - .../extensions/file-link/file-link.ts | 43 - .../extensions/file-link/index.ts | 1 - .../extensions/file-link/ng-package.json | 8 - .../extensions/font-color/font-color.ts | 69 - .../extensions/font-color/index.ts | 1 - .../extensions/font-color/ng-package.json | 8 - .../font-size/font-size.extension.ts | 62 - .../extensions/font-size/index.ts | 1 - .../extensions/font-size/ng-package.json | 8 - .../extensions/group/group.extension.ts | 142 --- .../extensions/group/group.options.ts | 15 - .../addon-editor/extensions/group/index.ts | 2 - .../extensions/group/ng-package.json | 8 - .../iframe-editor.component.html | 16 - .../iframe-editor.component.less | 4 - .../iframe-editor/iframe-editor.component.ts | 47 - .../iframe-editor/iframe-editor.extension.ts | 99 -- .../iframe-editor/iframe-editor.module.ts | 11 - .../iframe-editor/iframe-editor.options.ts | 31 - .../extensions/iframe-editor/index.ts | 4 - .../extensions/iframe-editor/ng-package.json | 8 - .../image-editor/image-editor.component.html | 30 - .../image-editor/image-editor.component.less | 15 - .../image-editor/image-editor.component.ts | 98 -- .../image-editor/image-editor.extension.ts | 160 --- .../image-editor/image-editor.module.ts | 12 - .../image-editor/image-editor.options.ts | 51 - .../extensions/image-editor/index.ts | 4 - .../extensions/image-editor/ng-package.json | 8 - .../indent-outdent/indent-outdent.ts | 18 - .../extensions/indent-outdent/index.ts | 1 - .../extensions/indent-outdent/ng-package.json | 8 - projects/addon-editor/extensions/index.ts | 15 - .../extensions/jump-anchor/index.ts | 1 - .../jump-anchor/jump-anchor.extension.ts | 61 - .../extensions/jump-anchor/ng-package.json | 8 - .../addon-editor/extensions/link/index.ts | 1 - projects/addon-editor/extensions/link/link.ts | 47 - .../extensions/link/ng-package.json | 8 - .../extensions/media/audio.extension.ts | 22 - .../addon-editor/extensions/media/index.ts | 3 - .../extensions/media/ng-package.json | 8 - .../extensions/media/source.extension.ts | 27 - .../extensions/media/video.extension.ts | 22 - .../addon-editor/extensions/ng-package.json | 5 - .../extensions/starter-kit/index.ts | 1 - .../extensions/starter-kit/ng-package.json | 8 - .../extensions/starter-kit/starter-kit.ts | 132 -- .../extensions/table-cell-background/index.ts | 1 - .../table-cell-background/ng-package.json | 8 - .../table-cell-background.ts | 55 - .../addon-editor/extensions/table/index.ts | 1 - .../extensions/table/ng-package.json | 8 - .../addon-editor/extensions/table/table.ts | 55 - .../tiptap-node-view/component-render.ts | 57 - .../extensions/tiptap-node-view/index.ts | 2 - .../tiptap-node-view/ng-package.json | 5 - .../tiptap-node-view/node-view-render.ts | 174 --- .../addon-editor/extensions/youtube/index.ts | 1 - .../extensions/youtube/ng-package.json | 8 - .../extensions/youtube/youtube.ts | 32 - projects/addon-editor/index.ts | 9 - projects/addon-editor/interfaces/attached.ts | 10 - .../interfaces/editor-font-option.ts | 15 - projects/addon-editor/interfaces/index.ts | 3 - .../addon-editor/interfaces/ng-package.json | 5 - .../interfaces/parsed-gradient.ts | 9 - projects/addon-editor/jest.config.ts | 12 - projects/addon-editor/ng-package.json | 13 - projects/addon-editor/package.json | 83 -- projects/addon-editor/project.json | 57 - projects/addon-editor/services/index.ts | 1 - .../addon-editor/services/ng-package.json | 5 - .../addon-editor/services/picker.service.ts | 43 - .../addon-editor/tokens/editor-extensions.ts | 17 - .../addon-editor/tokens/editor-options.ts | 45 - .../addon-editor/tokens/editor-processor.ts | 12 - .../tokens/editor-value-transformer.ts | 6 - projects/addon-editor/tokens/files-loader.ts | 24 - projects/addon-editor/tokens/i18n.ts | 66 - projects/addon-editor/tokens/image-loader.ts | 20 - projects/addon-editor/tokens/index.ts | 8 - projects/addon-editor/tokens/ng-package.json | 5 - projects/addon-editor/tokens/tiptap-editor.ts | 29 - .../addon-editor/types/gradient-direction.ts | 9 - projects/addon-editor/types/index.ts | 1 - projects/addon-editor/types/ng-package.json | 5 - projects/addon-editor/utils/delete-nodes.ts | 28 - .../addon-editor/utils/get-element-point.ts | 8 - .../addon-editor/utils/get-gradient-data.ts | 5 - projects/addon-editor/utils/get-mark-range.ts | 73 -- .../addon-editor/utils/get-nested-nodes.ts | 14 - .../utils/get-selected-content.ts | 11 - projects/addon-editor/utils/index.ts | 15 - projects/addon-editor/utils/insert-html.ts | 34 - projects/addon-editor/utils/insert-text.ts | 33 - .../addon-editor/utils/is-selection-in.ts | 20 - .../addon-editor/utils/legacy-converter.ts | 96 -- projects/addon-editor/utils/ng-package.json | 5 - projects/addon-editor/utils/parse-gradient.ts | 76 -- .../utils/parse-node-attributes.ts | 13 - projects/addon-editor/utils/parse-style.ts | 13 - .../addon-editor/utils/safe-link-range.ts | 11 - .../utils/test/legacy-converter.spec.ts | 52 - .../utils/test/parse-gradient.spec.ts | 76 -- .../utils/test/to-gradient.spec.ts | 43 - projects/addon-editor/utils/to-gradient.ts | 10 - projects/cdk/package.json | 1 - .../cypress/tests/addon-editor/anchor.cy.ts | 61 - .../tests/addon-editor/color-picker.cy.ts | 47 - .../tests/addon-editor/editor-api.cy.ts | 359 ------ .../tests/addon-editor/editor-font.cy.ts | 41 - .../tests/addon-editor/editor-groups.cy.ts | 53 - .../tests/addon-editor/editor-img.cy.ts | 66 - .../tests/addon-editor/editor-links.cy.ts | 137 -- .../tests/addon-editor/editor-toolbar.cy.ts | 254 ---- projects/demo/src/modules/app/app.routes.ts | 220 ---- projects/demo/src/modules/app/pages.ts | 164 --- .../app/stackblitz/stackblitz-deps.service.ts | 8 - .../demo/src/modules/app/stackblitz/utils.ts | 8 +- .../color-picker/color-picker.component.ts | 35 - .../color-picker/color-picker.module.ts | 63 - .../color-picker/color-picker.template.html | 97 -- .../color-picker/examples/1/index.html | 23 - .../color-picker/examples/1/index.ts | 16 - .../color-picker/examples/2/index.html | 25 - .../color-picker/examples/2/index.less | 4 - .../color-picker/examples/2/index.ts | 21 - .../color-picker/examples/3/index.html | 21 - .../color-picker/examples/3/index.ts | 24 - .../color-picker/examples/4/index.html | 22 - .../color-picker/examples/4/index.less | 19 - .../color-picker/examples/4/index.ts | 16 - .../examples/import/import-module.md | 14 - .../examples/import/insert-template.md | 3 - .../anchors/editor-anchors.component.html | 33 - .../anchors/editor-anchors.component.ts | 24 - .../editor/anchors/editor-anchors.module.ts | 35 - .../editor/anchors/examples/1/index.html | 11 - .../editor/anchors/examples/1/index.ts | 49 - .../editor-color-picker.component.html | 33 - .../editor-color-picker.component.ts | 29 - .../editor-color-picker.module.ts | 32 - .../custom-color-picker.component.html | 41 - .../custom-color-picker.component.less | 14 - .../custom-color-picker.component.ts | 51 - .../custom-color-picker.module.ts | 34 - .../color-picker/examples/1/index.html | 17 - .../color-picker/examples/1/index.ts | 36 - .../editor-paste-emoji.component.html | 58 - .../editor-paste-emoji.component.ts | 40 - .../paste-emoji/editor-paste-emoji.module.ts | 45 - .../paste-emoji/examples/1/index.html | 16 - .../paste-emoji/examples/1/index.less | 6 - .../paste-emoji/examples/1/index.ts | 30 - .../examples/1/smiles-tool/emoji.extension.ts | 25 - .../1/smiles-tool/smiles-tool.component.ts | 41 - .../1/smiles-tool/smiles-tool.module.ts | 23 - .../1/smiles-tool/smiles-tool.styles.less | 31 - .../1/smiles-tool/smiles-tool.template.html | 35 - .../editor-paste-image-tool.component.html | 58 - .../editor-paste-image-tool.component.ts | 40 - .../editor-paste-image-tool.module.ts | 45 - .../1/image-tool/image-tool.component.ts | 35 - .../1/image-tool/image-tool.module.ts | 27 - .../1/image-tool/image-tool.styles.less | 42 - .../1/image-tool/image-tool.template.html | 42 - .../examples/1/image-tool/paste.extension.ts | 40 - .../paste-image/examples/1/index.html | 14 - .../paste-image/examples/1/index.less | 6 - .../paste-image/examples/1/index.ts | 36 - .../html5/editor-embed-html5.component.html | 32 - .../html5/editor-embed-html5.component.ts | 24 - .../embed/html5/editor-embed-html5.module.ts | 35 - .../editor/embed/html5/examples/1/index.html | 12 - .../editor/embed/html5/examples/1/index.less | 11 - .../editor/embed/html5/examples/1/index.ts | 147 --- .../iframe/editor-embed-iframe.component.html | 32 - .../iframe/editor-embed-iframe.component.ts | 37 - .../iframe/editor-embed-iframe.module.ts | 37 - .../1/embed-tool/embed-tool.component.ts | 34 - .../1/embed-tool/embed-tool.module.ts | 27 - .../1/embed-tool/embed-tool.styles.less | 34 - .../1/embed-tool/embed-tool.template.html | 42 - .../editor/embed/iframe/examples/1/index.html | 20 - .../editor/embed/iframe/examples/1/index.less | 6 - .../editor/embed/iframe/examples/1/index.ts | 72 -- .../editor-embed-youtube.component.html | 32 - .../youtube/editor-embed-youtube.component.ts | 37 - .../youtube/editor-embed-youtube.module.ts | 37 - .../embed/youtube/examples/1/index.html | 20 - .../embed/youtube/examples/1/index.less | 6 - .../editor/embed/youtube/examples/1/index.ts | 51 - .../1/youtube-tool/youtube-tool.component.ts | 48 - .../1/youtube-tool/youtube-tool.module.ts | 27 - .../1/youtube-tool/youtube-tool.styles.less | 34 - .../1/youtube-tool/youtube-tool.template.html | 42 - .../editor/focus/editor-focus.component.html | 33 - .../editor/focus/editor-focus.component.ts | 24 - .../editor/focus/editor-focus.module.ts | 35 - .../editor/focus/examples/1/index.html | 11 - .../editor/focus/examples/1/index.less | 7 - .../editor/focus/examples/1/index.ts | 114 -- .../editor/font/editor-font.component.html | 31 - .../editor/font/editor-font.component.ts | 37 - .../editor/font/editor-font.module.ts | 31 - .../editor/font/examples/1/index.html | 11 - .../editor/font/examples/1/index.less | 38 - .../editor/font/examples/1/index.ts | 115 -- .../editor/font/examples/2/index.html | 11 - .../editor/font/examples/2/index.ts | 59 - .../font-size-tool.component.ts | 70 -- .../3/font-size-tool/font-size-tool.module.ts | 23 - .../font-size-tool.template.html | 42 - .../editor/font/examples/3/index.html | 15 - .../editor/font/examples/3/index.ts | 36 - .../groups/editor-groups.component.html | 48 - .../editor/groups/editor-groups.component.ts | 36 - .../editor/groups/editor-groups.module.ts | 44 - .../editor/groups/examples/1/index.html | 11 - .../editor/groups/examples/1/index.ts | 47 - .../editor/groups/examples/2/index.html | 11 - .../editor/groups/examples/2/index.less | 8 - .../editor/groups/examples/2/index.ts | 53 - .../editor/groups/examples/3/index.html | 11 - .../editor/groups/examples/3/index.less | 13 - .../editor/groups/examples/3/index.ts | 46 - .../code/editor-code-block.component.html | 32 - .../code/editor-code-block.component.ts | 19 - .../code/editor-code-block.module.ts | 27 - .../highlight/code/examples/1/example.md | 20 - .../highlight/code/examples/1/index.html | 11 - .../highlight/code/examples/1/index.less | 12 - .../editor/highlight/code/examples/1/index.ts | 39 - .../text/editor-mark-text.component.html | 33 - .../text/editor-mark-text.component.ts | 18 - .../highlight/text/editor-mark-text.module.ts | 27 - .../highlight/text/examples/1/index.html | 24 - .../highlight/text/examples/1/index.less | 7 - .../editor/highlight/text/examples/1/index.ts | 65 - .../editor-preview-images.component.html | 32 - .../editor-preview-images.component.ts | 36 - .../preview/editor-preview-images.module.ts | 42 - .../image-preview/image-preview.component.ts | 29 - .../1/image-preview/image-preview.module.ts | 25 - .../1/image-preview/image-preview.style.less | 3 - .../image-preview/image-preview.template.html | 23 - .../images/preview/examples/1/index.html | 13 - .../editor/images/preview/examples/1/index.ts | 42 - .../editor-resizable-images.component.html | 32 - .../editor-resizable-images.component.ts | 24 - .../editor-resizable-images.module.ts | 40 - .../images/resizable/examples/1/index.html | 8 - .../images/resizable/examples/1/index.ts | 65 - .../editor-upload-images.component.html | 32 - .../upload/editor-upload-images.component.ts | 26 - .../upload/editor-upload-images.module.ts | 47 - .../images/upload/examples/1/image-loader.ts | 20 - .../images/upload/examples/1/imgbb.service.ts | 61 - .../images/upload/examples/1/index.html | 22 - .../editor/images/upload/examples/1/index.ts | 90 -- .../editor-cleanup-html.component.html | 32 - .../editor-cleanup-html.component.ts | 18 - .../editor-cleanup-html.module.ts | 35 - .../cleanup-html/examples/1/index.html | 15 - .../cleanup-html/examples/1/index.ts | 34 - .../cleanup-html/examples/1/transformer.ts | 22 - .../editor-legacy-html.component.html | 32 - .../editor-legacy-html.component.ts | 21 - .../legacy-html/editor-legacy-html.module.ts | 40 - .../legacy-html/examples/1/index.html | 15 - .../legacy-html/examples/1/index.ts | 35 - .../legacy-html/examples/1/transformer.ts | 14 - .../markdown/editor-markdown.component.html | 33 - .../markdown/editor-markdown.component.ts | 37 - .../markdown/editor-markdown.module.ts | 35 - .../processing/markdown/examples/1/example.md | 209 ---- .../processing/markdown/examples/1/index.html | 17 - .../processing/markdown/examples/1/index.less | 13 - .../processing/markdown/examples/1/index.ts | 44 - .../starter/editor-starter.component.ts | 56 - .../editor/starter/editor-starter.module.ts | 44 - .../starter/editor-starter.template.html | 187 --- .../starter/import/editor-options-token.md | 20 - .../editor/starter/import/import-module.md | 16 - .../editor/starter/import/insert-template.md | 8 - .../starter/import/provide-extensions.md | 16 - .../editor-upload-files.component.html | 33 - .../editor-upload-files.component.ts | 27 - .../editor-upload-files.module.ts | 37 - .../upload-files/examples/1/file-loader.ts | 17 - .../examples/1/filesio.service.ts | 38 - .../editor/upload-files/examples/1/index.html | 14 - .../editor/upload-files/examples/1/index.less | 5 - .../editor/upload-files/examples/1/index.ts | 70 -- .../icons-bundled/icons-bundled.template.html | 2 +- tsconfig.build.json | 2 - tsconfig.json | 2 - 507 files changed, 30 insertions(+), 19032 deletions(-) delete mode 100644 projects/addon-editor/LICENSE delete mode 100644 projects/addon-editor/README.md delete mode 100644 projects/addon-editor/abstract/editor-adapter.abstract.ts delete mode 100644 projects/addon-editor/abstract/index.ts delete mode 100644 projects/addon-editor/abstract/ng-package.json delete mode 100644 projects/addon-editor/components/color-selector/color-edit/color-edit.component.ts delete mode 100644 projects/addon-editor/components/color-selector/color-edit/color-edit.module.ts delete mode 100644 projects/addon-editor/components/color-selector/color-edit/color-edit.style.less delete mode 100644 projects/addon-editor/components/color-selector/color-edit/color-edit.template.html delete mode 100644 projects/addon-editor/components/color-selector/color-edit/test/color-edit.component.spec.ts delete mode 100644 projects/addon-editor/components/color-selector/color-picker/color-picker.component.ts delete mode 100644 projects/addon-editor/components/color-selector/color-picker/color-picker.module.ts delete mode 100644 projects/addon-editor/components/color-selector/color-picker/color-picker.style.less delete mode 100644 projects/addon-editor/components/color-selector/color-picker/color-picker.template.html delete mode 100644 projects/addon-editor/components/color-selector/color-picker/test/color-picker.component.spec.ts delete mode 100644 projects/addon-editor/components/color-selector/color-selector.component.ts delete mode 100644 projects/addon-editor/components/color-selector/color-selector.module.ts delete mode 100644 projects/addon-editor/components/color-selector/color-selector.style.less delete mode 100644 projects/addon-editor/components/color-selector/color-selector.template.html delete mode 100644 projects/addon-editor/components/color-selector/flat-picker/flat-picker.component.ts delete mode 100644 projects/addon-editor/components/color-selector/flat-picker/flat-picker.module.ts delete mode 100644 projects/addon-editor/components/color-selector/flat-picker/flat-picker.style.less delete mode 100644 projects/addon-editor/components/color-selector/flat-picker/flat-picker.template.html delete mode 100644 projects/addon-editor/components/color-selector/index.ts delete mode 100644 projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.component.ts delete mode 100644 projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.module.ts delete mode 100644 projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.style.less delete mode 100644 projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.template.html delete mode 100644 projects/addon-editor/components/color-selector/linear-picker/linear-picker.component.ts delete mode 100644 projects/addon-editor/components/color-selector/linear-picker/linear-picker.module.ts delete mode 100644 projects/addon-editor/components/color-selector/linear-picker/linear-picker.style.less delete mode 100644 projects/addon-editor/components/color-selector/linear-picker/linear-picker.template.html delete mode 100644 projects/addon-editor/components/color-selector/ng-package.json delete mode 100644 projects/addon-editor/components/color-selector/palette/palette.component.ts delete mode 100644 projects/addon-editor/components/color-selector/palette/palette.module.ts delete mode 100644 projects/addon-editor/components/color-selector/palette/palette.style.less delete mode 100644 projects/addon-editor/components/color-selector/palette/palette.template.html delete mode 100644 projects/addon-editor/components/color-selector/test/color-selector.component.spec.ts delete mode 100644 projects/addon-editor/components/edit-link/edit-link.component.ts delete mode 100644 projects/addon-editor/components/edit-link/edit-link.module.ts delete mode 100644 projects/addon-editor/components/edit-link/edit-link.style.less delete mode 100644 projects/addon-editor/components/edit-link/edit-link.template.html delete mode 100644 projects/addon-editor/components/edit-link/index.ts delete mode 100644 projects/addon-editor/components/edit-link/ng-package.json delete mode 100644 projects/addon-editor/components/edit-link/pipes/filter-anchors.pipe.ts delete mode 100644 projects/addon-editor/components/edit-link/pipes/short-url.pipe.ts delete mode 100644 projects/addon-editor/components/edit-link/test/edit-link-parse.spec.ts delete mode 100644 projects/addon-editor/components/edit-link/utils/edit-link-parse-url.ts delete mode 100644 projects/addon-editor/components/editor-resizable/editor-resizable.abstract.ts delete mode 100644 projects/addon-editor/components/editor-resizable/editor-resizable.component.html delete mode 100644 projects/addon-editor/components/editor-resizable/editor-resizable.component.less delete mode 100644 projects/addon-editor/components/editor-resizable/editor-resizable.component.ts delete mode 100644 projects/addon-editor/components/editor-resizable/editor-resizable.module.ts delete mode 100644 projects/addon-editor/components/editor-resizable/index.ts delete mode 100644 projects/addon-editor/components/editor-resizable/ng-package.json delete mode 100644 projects/addon-editor/components/editor-socket/editor-socket.component.less delete mode 100644 projects/addon-editor/components/editor-socket/editor-socket.component.ts delete mode 100644 projects/addon-editor/components/editor-socket/editor-socket.module.ts delete mode 100644 projects/addon-editor/components/editor-socket/index.ts delete mode 100644 projects/addon-editor/components/editor-socket/ng-package.json delete mode 100644 projects/addon-editor/components/editor-socket/styles/code-blocks.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/details.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/groups.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/link.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/list.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/media.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/placeholder.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/table.less delete mode 100644 projects/addon-editor/components/editor-socket/styles/text.less delete mode 100644 projects/addon-editor/components/editor/editor.component.html delete mode 100644 projects/addon-editor/components/editor/editor.component.less delete mode 100644 projects/addon-editor/components/editor/editor.component.ts delete mode 100644 projects/addon-editor/components/editor/editor.module.ts delete mode 100644 projects/addon-editor/components/editor/editor.providers.ts delete mode 100644 projects/addon-editor/components/editor/index.ts delete mode 100644 projects/addon-editor/components/editor/ng-package.json delete mode 100644 projects/addon-editor/components/editor/portal/editor-portal-host.component.ts delete mode 100644 projects/addon-editor/components/editor/portal/editor-portal-host.style.less delete mode 100644 projects/addon-editor/components/editor/portal/editor-portal.directive.ts delete mode 100644 projects/addon-editor/components/editor/portal/editor-portal.service.ts delete mode 100644 projects/addon-editor/components/index.ts delete mode 100644 projects/addon-editor/components/input-color/index.ts delete mode 100644 projects/addon-editor/components/input-color/input-color.component.ts delete mode 100644 projects/addon-editor/components/input-color/input-color.module.ts delete mode 100644 projects/addon-editor/components/input-color/input-color.style.less delete mode 100644 projects/addon-editor/components/input-color/input-color.template.html delete mode 100644 projects/addon-editor/components/input-color/ng-package.json delete mode 100644 projects/addon-editor/components/input-color/test/input-color.component.spec.ts delete mode 100644 projects/addon-editor/components/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/align-content/align-content.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/align-content/align-content.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/align-content/align-content.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/align-content/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/align-content/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/code/code.component.html delete mode 100644 projects/addon-editor/components/toolbar-tools/code/code.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/code/code.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/code/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/code/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/details/details.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/details/details.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/details/details.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/details/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/details/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/font-size/font-size.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/font-size/font-size.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/font-size/font-size.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/font-size/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/font-size/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/font-style/font-style.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/font-style/font-style.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/font-style/font-style.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/font-style/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/font-style/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/group/group.component.html delete mode 100644 projects/addon-editor/components/toolbar-tools/group/group.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/group/group.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/group/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/group/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/highlight-color/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/highlight-color/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/list-configs/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/list-configs/list-configs.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/list-configs/list-configs.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/list-configs/list-configs.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/list-configs/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/table-cell-color/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-cell-color/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/table-create/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-create/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/table-create/table-create.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-create/table-create.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-create/table-create.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/table-merge-cells/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-merge-cells/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/table-row-column-manager/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-row-column-manager/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/table-size-selector/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-size-selector/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.style.less delete mode 100644 projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/text-color/index.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/text-color/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar-tools/text-color/text-color.component.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/text-color/text-color.module.ts delete mode 100644 projects/addon-editor/components/toolbar-tools/text-color/text-color.template.html delete mode 100644 projects/addon-editor/components/toolbar-tools/tools-common.less delete mode 100644 projects/addon-editor/components/toolbar/index.ts delete mode 100644 projects/addon-editor/components/toolbar/ng-package.json delete mode 100644 projects/addon-editor/components/toolbar/toolbar-navigation-manager.directive.ts delete mode 100644 projects/addon-editor/components/toolbar/toolbar.component.ts delete mode 100644 projects/addon-editor/components/toolbar/toolbar.module.ts delete mode 100644 projects/addon-editor/components/toolbar/toolbar.style.less delete mode 100644 projects/addon-editor/components/toolbar/toolbar.template.html delete mode 100644 projects/addon-editor/constants/default-editor-colors.ts delete mode 100644 projects/addon-editor/constants/default-editor-tools.ts delete mode 100644 projects/addon-editor/constants/default-font-options-handler.ts delete mode 100644 projects/addon-editor/constants/default-html5-media-attributes.ts delete mode 100644 projects/addon-editor/constants/default-link-options-handler.ts delete mode 100644 projects/addon-editor/constants/index.ts delete mode 100644 projects/addon-editor/constants/ng-package.json delete mode 100644 projects/addon-editor/directives/image-preview/image-preview.directive.ts delete mode 100644 projects/addon-editor/directives/image-preview/image-preview.module.ts delete mode 100644 projects/addon-editor/directives/image-preview/index.ts delete mode 100644 projects/addon-editor/directives/image-preview/ng-package.json delete mode 100644 projects/addon-editor/directives/index.ts delete mode 100644 projects/addon-editor/directives/ng-package.json delete mode 100644 projects/addon-editor/directives/tiptap-editor/index.ts delete mode 100644 projects/addon-editor/directives/tiptap-editor/ng-package.json delete mode 100644 projects/addon-editor/directives/tiptap-editor/tiptap-editor.directive.ts delete mode 100644 projects/addon-editor/directives/tiptap-editor/tiptap-editor.module.ts delete mode 100644 projects/addon-editor/directives/tiptap-editor/tiptap-editor.service.ts delete mode 100644 projects/addon-editor/directives/tiptap-editor/tiptap-editor.types.ts delete mode 100644 projects/addon-editor/directives/tiptap-editor/utils/is-empty-paragraph.ts delete mode 100644 projects/addon-editor/enums/editor-tool.ts delete mode 100644 projects/addon-editor/enums/index.ts delete mode 100644 projects/addon-editor/enums/ng-package.json delete mode 100644 projects/addon-editor/extensions/background-color/background-color.ts delete mode 100644 projects/addon-editor/extensions/background-color/index.ts delete mode 100644 projects/addon-editor/extensions/background-color/ng-package.json delete mode 100644 projects/addon-editor/extensions/default-editor-extensions/default-editor-extensions.ts delete mode 100644 projects/addon-editor/extensions/default-editor-extensions/index.ts delete mode 100644 projects/addon-editor/extensions/default-editor-extensions/ng-package.json delete mode 100644 projects/addon-editor/extensions/details/details-content.extension.ts delete mode 100644 projects/addon-editor/extensions/details/details.extension.ts delete mode 100644 projects/addon-editor/extensions/details/index.ts delete mode 100644 projects/addon-editor/extensions/details/ng-package.json delete mode 100644 projects/addon-editor/extensions/details/summary.extension.ts delete mode 100644 projects/addon-editor/extensions/file-link/file-link.ts delete mode 100644 projects/addon-editor/extensions/file-link/index.ts delete mode 100644 projects/addon-editor/extensions/file-link/ng-package.json delete mode 100644 projects/addon-editor/extensions/font-color/font-color.ts delete mode 100644 projects/addon-editor/extensions/font-color/index.ts delete mode 100644 projects/addon-editor/extensions/font-color/ng-package.json delete mode 100644 projects/addon-editor/extensions/font-size/font-size.extension.ts delete mode 100644 projects/addon-editor/extensions/font-size/index.ts delete mode 100644 projects/addon-editor/extensions/font-size/ng-package.json delete mode 100644 projects/addon-editor/extensions/group/group.extension.ts delete mode 100644 projects/addon-editor/extensions/group/group.options.ts delete mode 100644 projects/addon-editor/extensions/group/index.ts delete mode 100644 projects/addon-editor/extensions/group/ng-package.json delete mode 100644 projects/addon-editor/extensions/iframe-editor/iframe-editor.component.html delete mode 100644 projects/addon-editor/extensions/iframe-editor/iframe-editor.component.less delete mode 100644 projects/addon-editor/extensions/iframe-editor/iframe-editor.component.ts delete mode 100644 projects/addon-editor/extensions/iframe-editor/iframe-editor.extension.ts delete mode 100644 projects/addon-editor/extensions/iframe-editor/iframe-editor.module.ts delete mode 100644 projects/addon-editor/extensions/iframe-editor/iframe-editor.options.ts delete mode 100644 projects/addon-editor/extensions/iframe-editor/index.ts delete mode 100644 projects/addon-editor/extensions/iframe-editor/ng-package.json delete mode 100644 projects/addon-editor/extensions/image-editor/image-editor.component.html delete mode 100644 projects/addon-editor/extensions/image-editor/image-editor.component.less delete mode 100644 projects/addon-editor/extensions/image-editor/image-editor.component.ts delete mode 100644 projects/addon-editor/extensions/image-editor/image-editor.extension.ts delete mode 100644 projects/addon-editor/extensions/image-editor/image-editor.module.ts delete mode 100644 projects/addon-editor/extensions/image-editor/image-editor.options.ts delete mode 100644 projects/addon-editor/extensions/image-editor/index.ts delete mode 100644 projects/addon-editor/extensions/image-editor/ng-package.json delete mode 100644 projects/addon-editor/extensions/indent-outdent/indent-outdent.ts delete mode 100644 projects/addon-editor/extensions/indent-outdent/index.ts delete mode 100644 projects/addon-editor/extensions/indent-outdent/ng-package.json delete mode 100644 projects/addon-editor/extensions/index.ts delete mode 100644 projects/addon-editor/extensions/jump-anchor/index.ts delete mode 100644 projects/addon-editor/extensions/jump-anchor/jump-anchor.extension.ts delete mode 100644 projects/addon-editor/extensions/jump-anchor/ng-package.json delete mode 100644 projects/addon-editor/extensions/link/index.ts delete mode 100644 projects/addon-editor/extensions/link/link.ts delete mode 100644 projects/addon-editor/extensions/link/ng-package.json delete mode 100644 projects/addon-editor/extensions/media/audio.extension.ts delete mode 100644 projects/addon-editor/extensions/media/index.ts delete mode 100644 projects/addon-editor/extensions/media/ng-package.json delete mode 100644 projects/addon-editor/extensions/media/source.extension.ts delete mode 100644 projects/addon-editor/extensions/media/video.extension.ts delete mode 100644 projects/addon-editor/extensions/ng-package.json delete mode 100644 projects/addon-editor/extensions/starter-kit/index.ts delete mode 100644 projects/addon-editor/extensions/starter-kit/ng-package.json delete mode 100644 projects/addon-editor/extensions/starter-kit/starter-kit.ts delete mode 100644 projects/addon-editor/extensions/table-cell-background/index.ts delete mode 100644 projects/addon-editor/extensions/table-cell-background/ng-package.json delete mode 100644 projects/addon-editor/extensions/table-cell-background/table-cell-background.ts delete mode 100644 projects/addon-editor/extensions/table/index.ts delete mode 100644 projects/addon-editor/extensions/table/ng-package.json delete mode 100644 projects/addon-editor/extensions/table/table.ts delete mode 100644 projects/addon-editor/extensions/tiptap-node-view/component-render.ts delete mode 100644 projects/addon-editor/extensions/tiptap-node-view/index.ts delete mode 100644 projects/addon-editor/extensions/tiptap-node-view/ng-package.json delete mode 100644 projects/addon-editor/extensions/tiptap-node-view/node-view-render.ts delete mode 100644 projects/addon-editor/extensions/youtube/index.ts delete mode 100644 projects/addon-editor/extensions/youtube/ng-package.json delete mode 100644 projects/addon-editor/extensions/youtube/youtube.ts delete mode 100644 projects/addon-editor/index.ts delete mode 100644 projects/addon-editor/interfaces/attached.ts delete mode 100644 projects/addon-editor/interfaces/editor-font-option.ts delete mode 100644 projects/addon-editor/interfaces/index.ts delete mode 100644 projects/addon-editor/interfaces/ng-package.json delete mode 100644 projects/addon-editor/interfaces/parsed-gradient.ts delete mode 100644 projects/addon-editor/jest.config.ts delete mode 100644 projects/addon-editor/ng-package.json delete mode 100644 projects/addon-editor/package.json delete mode 100644 projects/addon-editor/project.json delete mode 100644 projects/addon-editor/services/index.ts delete mode 100644 projects/addon-editor/services/ng-package.json delete mode 100644 projects/addon-editor/services/picker.service.ts delete mode 100644 projects/addon-editor/tokens/editor-extensions.ts delete mode 100644 projects/addon-editor/tokens/editor-options.ts delete mode 100644 projects/addon-editor/tokens/editor-processor.ts delete mode 100644 projects/addon-editor/tokens/editor-value-transformer.ts delete mode 100644 projects/addon-editor/tokens/files-loader.ts delete mode 100644 projects/addon-editor/tokens/i18n.ts delete mode 100644 projects/addon-editor/tokens/image-loader.ts delete mode 100644 projects/addon-editor/tokens/index.ts delete mode 100644 projects/addon-editor/tokens/ng-package.json delete mode 100644 projects/addon-editor/tokens/tiptap-editor.ts delete mode 100644 projects/addon-editor/types/gradient-direction.ts delete mode 100644 projects/addon-editor/types/index.ts delete mode 100644 projects/addon-editor/types/ng-package.json delete mode 100644 projects/addon-editor/utils/delete-nodes.ts delete mode 100644 projects/addon-editor/utils/get-element-point.ts delete mode 100644 projects/addon-editor/utils/get-gradient-data.ts delete mode 100644 projects/addon-editor/utils/get-mark-range.ts delete mode 100644 projects/addon-editor/utils/get-nested-nodes.ts delete mode 100644 projects/addon-editor/utils/get-selected-content.ts delete mode 100644 projects/addon-editor/utils/index.ts delete mode 100644 projects/addon-editor/utils/insert-html.ts delete mode 100644 projects/addon-editor/utils/insert-text.ts delete mode 100644 projects/addon-editor/utils/is-selection-in.ts delete mode 100644 projects/addon-editor/utils/legacy-converter.ts delete mode 100644 projects/addon-editor/utils/ng-package.json delete mode 100644 projects/addon-editor/utils/parse-gradient.ts delete mode 100644 projects/addon-editor/utils/parse-node-attributes.ts delete mode 100644 projects/addon-editor/utils/parse-style.ts delete mode 100644 projects/addon-editor/utils/safe-link-range.ts delete mode 100644 projects/addon-editor/utils/test/legacy-converter.spec.ts delete mode 100644 projects/addon-editor/utils/test/parse-gradient.spec.ts delete mode 100644 projects/addon-editor/utils/test/to-gradient.spec.ts delete mode 100644 projects/addon-editor/utils/to-gradient.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/anchor.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/color-picker.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/editor-font.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/editor-groups.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/editor-img.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/editor-links.cy.ts delete mode 100644 projects/demo-integrations/cypress/tests/addon-editor/editor-toolbar.cy.ts delete mode 100644 projects/demo/src/modules/components/color-picker/color-picker.component.ts delete mode 100644 projects/demo/src/modules/components/color-picker/color-picker.module.ts delete mode 100644 projects/demo/src/modules/components/color-picker/color-picker.template.html delete mode 100644 projects/demo/src/modules/components/color-picker/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/color-picker/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/color-picker/examples/2/index.html delete mode 100644 projects/demo/src/modules/components/color-picker/examples/2/index.less delete mode 100644 projects/demo/src/modules/components/color-picker/examples/2/index.ts delete mode 100644 projects/demo/src/modules/components/color-picker/examples/3/index.html delete mode 100644 projects/demo/src/modules/components/color-picker/examples/3/index.ts delete mode 100644 projects/demo/src/modules/components/color-picker/examples/4/index.html delete mode 100644 projects/demo/src/modules/components/color-picker/examples/4/index.less delete mode 100644 projects/demo/src/modules/components/color-picker/examples/4/index.ts delete mode 100644 projects/demo/src/modules/components/color-picker/examples/import/import-module.md delete mode 100644 projects/demo/src/modules/components/color-picker/examples/import/insert-template.md delete mode 100644 projects/demo/src/modules/components/editor/anchors/editor-anchors.component.html delete mode 100644 projects/demo/src/modules/components/editor/anchors/editor-anchors.component.ts delete mode 100644 projects/demo/src/modules/components/editor/anchors/editor-anchors.module.ts delete mode 100644 projects/demo/src/modules/components/editor/anchors/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/anchors/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.module.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.less delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.module.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.module.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/emoji.extension.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.component.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.module.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.styles.less delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.template.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.module.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.component.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.module.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.styles.less delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.template.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/paste.extension.ts delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.html delete mode 100644 projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.module.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/html5/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/embed/html5/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/embed/html5/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.html delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.module.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.component.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.module.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.styles.less delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.template.html delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.html delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.module.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.component.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.module.ts delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.styles.less delete mode 100644 projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.template.html delete mode 100644 projects/demo/src/modules/components/editor/focus/editor-focus.component.html delete mode 100644 projects/demo/src/modules/components/editor/focus/editor-focus.component.ts delete mode 100644 projects/demo/src/modules/components/editor/focus/editor-focus.module.ts delete mode 100644 projects/demo/src/modules/components/editor/focus/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/focus/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/focus/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/font/editor-font.component.html delete mode 100644 projects/demo/src/modules/components/editor/font/editor-font.component.ts delete mode 100644 projects/demo/src/modules/components/editor/font/editor-font.module.ts delete mode 100644 projects/demo/src/modules/components/editor/font/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/font/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/font/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/font/examples/2/index.html delete mode 100644 projects/demo/src/modules/components/editor/font/examples/2/index.ts delete mode 100644 projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.component.ts delete mode 100644 projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.module.ts delete mode 100644 projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.template.html delete mode 100644 projects/demo/src/modules/components/editor/font/examples/3/index.html delete mode 100644 projects/demo/src/modules/components/editor/font/examples/3/index.ts delete mode 100644 projects/demo/src/modules/components/editor/groups/editor-groups.component.html delete mode 100644 projects/demo/src/modules/components/editor/groups/editor-groups.component.ts delete mode 100644 projects/demo/src/modules/components/editor/groups/editor-groups.module.ts delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/2/index.html delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/2/index.less delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/2/index.ts delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/3/index.html delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/3/index.less delete mode 100644 projects/demo/src/modules/components/editor/groups/examples/3/index.ts delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.html delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.ts delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/editor-code-block.module.ts delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/examples/1/example.md delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/highlight/code/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.html delete mode 100644 projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.ts delete mode 100644 projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.module.ts delete mode 100644 projects/demo/src/modules/components/editor/highlight/text/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/highlight/text/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/highlight/text/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.html delete mode 100644 projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.ts delete mode 100644 projects/demo/src/modules/components/editor/images/preview/editor-preview-images.module.ts delete mode 100644 projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.component.ts delete mode 100644 projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.module.ts delete mode 100644 projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.style.less delete mode 100644 projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.template.html delete mode 100644 projects/demo/src/modules/components/editor/images/preview/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/images/preview/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.html delete mode 100644 projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.ts delete mode 100644 projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.module.ts delete mode 100644 projects/demo/src/modules/components/editor/images/resizable/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/images/resizable/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.html delete mode 100644 projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.ts delete mode 100644 projects/demo/src/modules/components/editor/images/upload/editor-upload-images.module.ts delete mode 100644 projects/demo/src/modules/components/editor/images/upload/examples/1/image-loader.ts delete mode 100644 projects/demo/src/modules/components/editor/images/upload/examples/1/imgbb.service.ts delete mode 100644 projects/demo/src/modules/components/editor/images/upload/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/images/upload/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.html delete mode 100644 projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.module.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/transformer.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.html delete mode 100644 projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.module.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/transformer.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.html delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.module.ts delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/examples/1/example.md delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.ts delete mode 100644 projects/demo/src/modules/components/editor/starter/editor-starter.component.ts delete mode 100644 projects/demo/src/modules/components/editor/starter/editor-starter.module.ts delete mode 100644 projects/demo/src/modules/components/editor/starter/editor-starter.template.html delete mode 100644 projects/demo/src/modules/components/editor/starter/import/editor-options-token.md delete mode 100644 projects/demo/src/modules/components/editor/starter/import/import-module.md delete mode 100644 projects/demo/src/modules/components/editor/starter/import/insert-template.md delete mode 100644 projects/demo/src/modules/components/editor/starter/import/provide-extensions.md delete mode 100644 projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.html delete mode 100644 projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.ts delete mode 100644 projects/demo/src/modules/components/editor/upload-files/editor-upload-files.module.ts delete mode 100644 projects/demo/src/modules/components/editor/upload-files/examples/1/file-loader.ts delete mode 100644 projects/demo/src/modules/components/editor/upload-files/examples/1/filesio.service.ts delete mode 100644 projects/demo/src/modules/components/editor/upload-files/examples/1/index.html delete mode 100644 projects/demo/src/modules/components/editor/upload-files/examples/1/index.less delete mode 100644 projects/demo/src/modules/components/editor/upload-files/examples/1/index.ts diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fdeed5fdcfca..356e02630a56 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -50,7 +50,6 @@ jobs: addon-doc, addon-charts, addon-commerce, - addon-editor, addon-mobile, addon-preview, addon-table, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40a96a970967..7fa1b214783b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,6 @@ jobs: addon-charts, addon-commerce, addon-doc, - addon-editor, addon-mobile, addon-preview, addon-table, @@ -88,11 +87,6 @@ jobs: directory: ./coverage/addon-mobile/ flags: summary,addon-mobile name: addon-mobile - - uses: codecov/codecov-action@v3.1.4 - with: - directory: ./coverage/addon-editor/ - flags: summary,addon-editor - name: addon-editor - uses: codecov/codecov-action@v3.1.4 with: directory: ./coverage/addon-doc/ diff --git a/package-lock.json b/package-lock.json index cd62ff855e7f..1df4a7eaf4aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -810,6 +810,7 @@ "version": "7.22.6", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -963,6 +964,7 @@ "version": "7.22.6", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz", "integrity": "sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA==", + "dev": true, "dependencies": { "@babel/compat-data": "^7.22.6", "@babel/helper-validator-option": "^7.22.5", @@ -1147,6 +1149,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -1158,6 +1161,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", + "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.5", "@babel/helper-module-imports": "^7.22.5", @@ -1176,6 +1180,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/parser": "^7.22.5", @@ -1201,6 +1206,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -1270,6 +1276,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -1320,6 +1327,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -1524,6 +1532,7 @@ "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.9", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" @@ -1783,6 +1792,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -1794,6 +1804,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.3" }, @@ -2389,6 +2400,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", + "dev": true, "dependencies": { "@babel/helper-module-transforms": "^7.22.5", "@babel/helper-plugin-utils": "^7.22.5", @@ -5249,152 +5261,6 @@ "schema-utils": "^2.7.0" } }, - "node_modules/@linaria/core": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/@linaria/core/-/core-4.2.9.tgz", - "integrity": "sha512-ELcu37VNVOT/PU0L6WDIN+aLzNFyJrqoBYT0CucGOCAmODbojUMCv8oJYRbWzA3N34w1t199dN4UFdfRWFG2rg==", - "dependencies": { - "@linaria/logger": "^4.0.0", - "@linaria/tags": "^4.3.4", - "@linaria/utils": "^4.3.3" - }, - "engines": { - "node": "^12.16.0 || >=13.7.0" - } - }, - "node_modules/@linaria/logger": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@linaria/logger/-/logger-4.0.0.tgz", - "integrity": "sha512-YnBq0JlDWMEkTOK+tMo5yEVR0f5V//6qMLToGcLhTyM9g9i+IDFn51Z+5q2hLk7RdG4NBPgbcCXYi2w4RKsPeg==", - "dependencies": { - "debug": "^4.1.1", - "picocolors": "^1.0.0" - }, - "engines": { - "node": "^12.16.0 || >=13.7.0" - } - }, - "node_modules/@linaria/tags": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@linaria/tags/-/tags-4.3.5.tgz", - "integrity": "sha512-PgaIi8Vv89YOjc6rpKL/uPg2w4k0rAwAYxcqeXqzKqsEAste5rgB8xp1/KUOG0oAOkPd3MRL6Duj+m0ZwJ3g+g==", - "dependencies": { - "@babel/generator": "^7.20.4", - "@linaria/logger": "^4.0.0", - "@linaria/utils": "^4.3.4" - }, - "engines": { - "node": "^12.16.0 || >=13.7.0" - } - }, - "node_modules/@linaria/tags/node_modules/@babel/generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", - "dependencies": { - "@babel/types": "^7.22.5", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@linaria/utils": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@linaria/utils/-/utils-4.3.4.tgz", - "integrity": "sha512-vt6WJG54n+KANaqxOfzIIU7aSfFHEWFbnGLsgxL7nASHqO0zezrNA2y2Rrp80zSeTW+wSpbmDM4uJyC9UW1qoA==", - "dependencies": { - "@babel/core": "^7.20.2", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-transform-modules-commonjs": "^7.19.6", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2", - "@linaria/logger": "^4.0.0", - "babel-merge": "^3.0.0" - }, - "engines": { - "node": "^12.16.0 || >=13.7.0" - } - }, - "node_modules/@linaria/utils/node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@linaria/utils/node_modules/@babel/core": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", - "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-compilation-targets": "^7.22.5", - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helpers": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@linaria/utils/node_modules/@babel/generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", - "dependencies": { - "@babel/types": "^7.22.5", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@linaria/utils/node_modules/@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", - "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@linaria/utils/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@maskito/angular": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@maskito/angular/-/angular-1.2.0.tgz", @@ -5597,6 +5463,7 @@ "version": "6.3.3", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz", "integrity": "sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -6732,15 +6599,6 @@ "typescript": "^3 || ^4 || ^5" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@prettier/plugin-xml": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-2.0.1.tgz", @@ -6751,76 +6609,6 @@ "prettier": ">=2.4.0" } }, - "node_modules/@remirror/core-constants": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-2.0.1.tgz", - "integrity": "sha512-ZR4aihtnnT9lMbhh5DEbsriJRlukRXmLZe7HmM+6ufJNNUDoazc75UX26xbgQlNUqgAqMcUdGFAnPc1JwgAdLQ==", - "dependencies": { - "@babel/runtime": "^7.21.0" - } - }, - "node_modules/@remirror/core-constants/node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@remirror/core-constants/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - }, - "node_modules/@remirror/core-helpers": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@remirror/core-helpers/-/core-helpers-2.0.3.tgz", - "integrity": "sha512-LqIPF4stGG69l9qu/FFicv9d9B+YaItzgDMC5A0CEvDQfKkGD3BfabLmfpnuWbsc06oKGdTduilgWcALLZoYLg==", - "dependencies": { - "@babel/runtime": "^7.21.0", - "@linaria/core": "4.2.9", - "@remirror/core-constants": "^2.0.1", - "@remirror/types": "^1.0.1", - "@types/object.omit": "^3.0.0", - "@types/object.pick": "^1.3.2", - "@types/throttle-debounce": "^2.1.0", - "case-anything": "^2.1.10", - "dash-get": "^1.0.2", - "deepmerge": "^4.3.1", - "fast-deep-equal": "^3.1.3", - "make-error": "^1.3.6", - "object.omit": "^3.0.0", - "object.pick": "^1.3.0", - "throttle-debounce": "^3.0.1" - } - }, - "node_modules/@remirror/core-helpers/node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@remirror/core-helpers/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - }, - "node_modules/@remirror/types": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@remirror/types/-/types-1.0.1.tgz", - "integrity": "sha512-VlZQxwGnt1jtQ18D6JqdIF+uFZo525WEqrfp9BOc3COPpK4+AWCgdnAWL+ho6imWcoINlGjR/+3b6y5C1vBVEA==", - "dependencies": { - "type-fest": "^2.19.0" - } - }, "node_modules/@rollup/plugin-commonjs": { "version": "20.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz", @@ -7058,10 +6846,6 @@ "resolved": "projects/addon-doc", "link": true }, - "node_modules/@taiga-ui/addon-editor": { - "resolved": "projects/addon-editor", - "link": true - }, "node_modules/@taiga-ui/addon-mobile": { "resolved": "projects/addon-mobile", "link": true @@ -7815,517 +7599,6 @@ "stylelint-order": "^5.0.0" } }, - "node_modules/@tiptap/core": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.3.tgz", - "integrity": "sha512-jLyVIWAdjjlNzrsRhSE2lVL/7N8228/1R1QtaVU85UlMIwHFAcdzhD8FeiKkqxpTnGpaDVaTy7VNEtEgaYdCyA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-blockquote": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.3.tgz", - "integrity": "sha512-rkUcFv2iL6f86DBBHoa4XdKNG2StvkJ7tfY9GoMpT46k3nxOaMTqak9/qZOo79TWxMLYtXzoxtKIkmWsbbcj4A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-bold": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.3.tgz", - "integrity": "sha512-OGT62fMRovSSayjehumygFWTg2Qn0IDbqyMpigg/RUAsnoOI2yBZFVrdM2gk1StyoSay7gTn2MLw97IUfr7FXg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-bubble-menu": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.3.tgz", - "integrity": "sha512-lPt1ELrYCuoQrQEUukqjp9xt38EwgPUwaKHI3wwt2Rbv+C6q1gmRsK1yeO/KqCNmFxNqF2p9ZF9srOnug/RZDQ==", - "dependencies": { - "tippy.js": "^6.3.7" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-bullet-list": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.3.tgz", - "integrity": "sha512-RtaLiRvZbMTOje+FW5bn+mYogiIgNxOm065wmyLPypnTbLSeHeYkoqVSqzZeqUn+7GLnwgn1shirUe6csVE/BA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.3.tgz", - "integrity": "sha512-LsVCKVxgBtkstAr1FjxN8T3OjlC76a2X8ouoZpELMp+aXbjqyanCKzt+sjjUhE4H0yLFd4v+5v6UFoCv4EILiw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-code-block": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.3.tgz", - "integrity": "sha512-F4xMy18EwgpyY9f5Te7UuF7UwxRLptOtCq1p2c2DfxBvHDWhAjQqVqcW/sq/I/WuED7FwCnPLyyAasPiVPkLPw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-document": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.0.3.tgz", - "integrity": "sha512-PsYeNQQBYIU9ayz1R11Kv/kKNPFNIV8tApJ9pxelXjzcAhkjncNUazPN/dyho60mzo+WpsmS3ceTj/gK3bCtWA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-dropcursor": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.0.3.tgz", - "integrity": "sha512-McthMrfusn6PjcaynJLheZJcXto8TaIW5iVitYh8qQrDXr31MALC/5GvWuiswmQ8bAXiWPwlLDYE/OJfwtggaw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-focus": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-focus/-/extension-focus-2.0.3.tgz", - "integrity": "sha512-WTJEmbGyHK8F/v1k5/5viLAa7PqtNoWOO4Qt4PBoUPlFDW97QMEh5m8Cvqw/RtbxTiGDHz6T+I5IJsKXGJed/A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-gapcursor": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.0.3.tgz", - "integrity": "sha512-6I9EzzsYOyyqDvDvxIK6Rv3EXB+fHKFj8ntHO8IXmeNJ6pkhOinuXVsW6Yo7TcDYoTj4D5I2MNFAW2rIkgassw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-hard-break": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.0.3.tgz", - "integrity": "sha512-RCln6ARn16jvKTjhkcAD5KzYXYS0xRMc0/LrHeV8TKdCd4Yd0YYHe0PU4F9gAgAfPQn7Dgt4uTVJLN11ICl8sQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-heading": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.3.tgz", - "integrity": "sha512-f0IEv5ms6aCzL80WeZ1qLCXTkRVwbpRr1qAETjg3gG4eoJN18+lZNOJYpyZy3P92C5KwF2T3Av00eFyVLIbb8Q==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-highlight": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-highlight/-/extension-highlight-2.0.3.tgz", - "integrity": "sha512-NrtibY8cZkIjZMQuHRrKd4php+plOvAoSo8g3uVFu275I/Ixt5HqJ53R4voCXs8W8BOBRs2HS2QX8Cjh79XhtA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-history": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.0.3.tgz", - "integrity": "sha512-00KHIcJ8kivn2ARI6NQYphv2LfllVCXViHGm0EhzDW6NQxCrriJKE3tKDcTFCu7LlC5doMpq9Z6KXdljc4oVeQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-horizontal-rule": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.0.3.tgz", - "integrity": "sha512-SZRUSh07b/M0kJHNKnfBwBMWrZBEm/E2LrK1NbluwT3DBhE+gvwiEdBxgB32zKHNxaDEXUJwUIPNC3JSbKvPUA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-image": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.0.3.tgz", - "integrity": "sha512-hS9ZJwz0md07EHsC+o4NuuJkhCZsZn7TuRz/2CvRSj2fWFIz+40CyNAHf/2J0qNugG9ommXaemetsADeEZP9ag==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-italic": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.3.tgz", - "integrity": "sha512-cfS5sW0gu7qf4ihwnLtW/QMTBrBEXaT0sJl3RwkhjIBg/65ywJKE5Nz9ewnQHmDeT18hvMJJ1VIb4j4ze9jj9A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-link": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-2.0.3.tgz", - "integrity": "sha512-H72tXQ5rkVCkAhFaf08fbEU7EBUCK0uocsqOF+4th9sOlrhfgyJtc8Jv5EXPDpxNgG5jixSqWBo0zKXQm9s9eg==", - "dependencies": { - "linkifyjs": "^4.1.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-list-item": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.3.tgz", - "integrity": "sha512-p7cUsk0LpM1PfdAuFE8wYBNJ3gvA0UhNGR08Lo++rt9UaCeFLSN1SXRxg97c0oa5+Ski7SrCjIJ5Ynhz0viTjQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-ordered-list": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.3.tgz", - "integrity": "sha512-ZB3MpZh/GEy1zKgw7XDQF4FIwycZWNof1k9WbDZOI063Ch4qHZowhVttH2mTCELuyvTMM/o9a8CS7qMqQB48bw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-paragraph": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.3.tgz", - "integrity": "sha512-a+tKtmj4bU3GVCH1NE8VHWnhVexxX5boTVxsHIr4yGG3UoKo1c5AO7YMaeX2W5xB5iIA+BQqOPCDPEAx34dd2A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-placeholder": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-2.0.3.tgz", - "integrity": "sha512-Z42jo0termRAf0S0L8oxrts94IWX5waU4isS2CUw8xCUigYyCFslkhQXkWATO1qRbjNFLKN2C9qvCgGf4UeBrw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-strike": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.3.tgz", - "integrity": "sha512-RO4/EYe2iPD6ifDHORT8fF6O9tfdtnzxLGwZIKZXnEgtweH+MgoqevEzXYdS+54Wraq4TUQGNcsYhe49pv7Rlw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-subscript": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-subscript/-/extension-subscript-2.0.3.tgz", - "integrity": "sha512-XFAEUaKxWRmTq7ePEF4aj7knelJPr2fTz0y/iSXydtS094LKwBHBzxatIZY3phrgfpDc+f51ycwarsgz27UJfg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-superscript": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-superscript/-/extension-superscript-2.0.3.tgz", - "integrity": "sha512-5EBjUvkw2SXL1e8C1i0UF26/GBNHxEbiNQKw7Shy88omVa4HTY+D8KWC/j29ZW/IomUbGPlbpXp1z+1TETzmyw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-table": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-table/-/extension-table-2.0.3.tgz", - "integrity": "sha512-8swHqm8vRM1w9WzaAhLmY24gGoTozctz4KHKBjvFY/Ka0yXabT0+hoCCdkZLnXWi15H3pbHs2HnDBaTGL9bZTw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0", - "@tiptap/pm": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-table-cell": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-table-cell/-/extension-table-cell-2.0.3.tgz", - "integrity": "sha512-d0vpwQfRIOhqKJdoiOJybwWhjnug3QA4Mkgccp378moDRyOer3hPKavG1Ljgz087qHrN4WfdUlMGEvasYsWE7w==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-table-header": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-table-header/-/extension-table-header-2.0.3.tgz", - "integrity": "sha512-SnGl1U6usRRS6LyAjSdhaCYLF6NWbGhjVFSmiPrjb0pOzsiVeDOiUNCyUAIYaDNnjAF2pfK6+H+uHzYPqTi+/w==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-table-row": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-table-row/-/extension-table-row-2.0.3.tgz", - "integrity": "sha512-tyqeXmQLNSBsYyiNsnQuJMxNbz6dYt+P5W58+h10mjbt+hERA5+alQQyP06O2DggsT3Z0LPt7QRAlNmOBe7cyQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-text": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.0.3.tgz", - "integrity": "sha512-LvzChcTCcPSMNLUjZe/A9SHXWGDHtvk73fR7CBqAeNU0MxhBPEBI03GFQ6RzW3xX0CmDmjpZoDxFMB+hDEtW1A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-text-align": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.3.tgz", - "integrity": "sha512-VlLgqncKdjMjVjbU60/ALYhFs0wUdjAyvjDXnH1OoM/HuzbILvufPMYz4DUieJIWVJOYUKHQgg4XwBWceAM2Tw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-text-style": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-2.0.3.tgz", - "integrity": "sha512-yHIYtZVewSwfBfI6TffnsDRiOuXzytppcCsaDlsZFm8OtLG8v9ioH0ItMoOstmZZBiWJOm8iOy2yWSc4rNQEJw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-underline": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.3.tgz", - "integrity": "sha512-oMYa7qib/5wJjpUp79GZEe+E/iyf1oZBsgiG26IspEtVTHZmpn3+Ktud7l43y/hpTeEzFTKOF1/uVbayHtSERg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/extension-youtube": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/extension-youtube/-/extension-youtube-2.0.3.tgz", - "integrity": "sha512-iZsMr+88I3hvfbJNLmiPsz2/8ZGpMucyCxRbrZGg1D6wBw4oiUhRPHzGJ3APlECzpanCjyQNMHIk/gvSDDX3ig==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/pm": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.0.3.tgz", - "integrity": "sha512-I9dsInD89Agdm1QjFRO9dmJtU1ldVSILNPW0pEhv9wYqYVvl4HUj/JMtYNqu2jWrCHNXQcaX/WkdSdvGJtmg5g==", - "dependencies": { - "prosemirror-changeset": "^2.2.0", - "prosemirror-collab": "^1.3.0", - "prosemirror-commands": "^1.3.1", - "prosemirror-dropcursor": "^1.5.0", - "prosemirror-gapcursor": "^1.3.1", - "prosemirror-history": "^1.3.0", - "prosemirror-inputrules": "^1.2.0", - "prosemirror-keymap": "^1.2.0", - "prosemirror-markdown": "^1.10.1", - "prosemirror-menu": "^1.2.1", - "prosemirror-model": "^1.18.1", - "prosemirror-schema-basic": "^1.2.0", - "prosemirror-schema-list": "^1.2.2", - "prosemirror-state": "^1.4.1", - "prosemirror-tables": "^1.3.0", - "prosemirror-trailing-node": "^2.0.2", - "prosemirror-transform": "^1.7.0", - "prosemirror-view": "^1.28.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^2.0.0" - } - }, - "node_modules/@tiptap/prosemirror-tables": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@tiptap/prosemirror-tables/-/prosemirror-tables-1.1.4.tgz", - "integrity": "sha512-O2XnDhZV7xTHSFxMMl8Ei3UVeCxuMlbGYZ+J2QG8CzkK8mxDpBa66kFr5DdyAhvdi1ptpcH9u7/GMwItQpN4sA==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "peerDependencies": { - "prosemirror-keymap": "^1.1.2", - "prosemirror-model": "^1.8.1", - "prosemirror-state": "^1.3.1", - "prosemirror-transform": "^1.2.1", - "prosemirror-view": "^1.13.3" - } - }, - "node_modules/@tiptap/starter-kit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.3.tgz", - "integrity": "sha512-t4WG4w93zTpL2VxhVyJJvl3kdLF001ZrhpOuEiZqEMBMUMbM56Uiigv1CnUQpTFrjDAh3IM8hkqzAh20TYw2iQ==", - "dependencies": { - "@tiptap/core": "^2.0.3", - "@tiptap/extension-blockquote": "^2.0.3", - "@tiptap/extension-bold": "^2.0.3", - "@tiptap/extension-bullet-list": "^2.0.3", - "@tiptap/extension-code": "^2.0.3", - "@tiptap/extension-code-block": "^2.0.3", - "@tiptap/extension-document": "^2.0.3", - "@tiptap/extension-dropcursor": "^2.0.3", - "@tiptap/extension-gapcursor": "^2.0.3", - "@tiptap/extension-hard-break": "^2.0.3", - "@tiptap/extension-heading": "^2.0.3", - "@tiptap/extension-history": "^2.0.3", - "@tiptap/extension-horizontal-rule": "^2.0.3", - "@tiptap/extension-italic": "^2.0.3", - "@tiptap/extension-list-item": "^2.0.3", - "@tiptap/extension-ordered-list": "^2.0.3", - "@tiptap/extension-paragraph": "^2.0.3", - "@tiptap/extension-strike": "^2.0.3", - "@tiptap/extension-text": "^2.0.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - } - }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -8717,16 +7990,6 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, - "node_modules/@types/object.omit": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/object.omit/-/object.omit-3.0.0.tgz", - "integrity": "sha512-I27IoPpH250TUzc9FzXd0P1BV/BMJuzqD3jOz98ehf9dQqGkxlq+hO1bIqZGWqCg5bVOy0g4AUVJtnxe0klDmw==" - }, - "node_modules/@types/object.pick": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/object.pick/-/object.pick-1.3.2.tgz", - "integrity": "sha512-sn7L+qQ6RLPdXRoiaE7bZ/Ek+o4uICma/lBFPyJEKDTPTBP1W8u0c4baj3EiS4DiqLs+Hk+KUGvMVJtAw3ePJg==" - }, "node_modules/@types/parse-author": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/parse-author/-/parse-author-2.0.1.tgz", @@ -8838,11 +8101,6 @@ "@types/node": "*" } }, - "node_modules/@types/throttle-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz", - "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==" - }, "node_modules/@types/tough-cookie": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", @@ -11109,26 +10367,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/babel-merge": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/babel-merge/-/babel-merge-3.0.0.tgz", - "integrity": "sha512-eBOBtHnzt9xvnjpYNI5HmaPp/b2vMveE5XggzqHnQeHJ8mFIBrBv6WZEVIj5jJ2uwTItkqKo9gWzEEcBxEq0yw==", - "dependencies": { - "deepmerge": "^2.2.1", - "object.omit": "^3.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/babel-merge/node_modules/deepmerge": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", - "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/babel-plugin-const-enum": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/babel-plugin-const-enum/-/babel-plugin-const-enum-1.2.0.tgz", @@ -11922,6 +11160,7 @@ "version": "4.21.9", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "dev": true, "funding": [ { "type": "opencollective", @@ -12315,6 +11554,7 @@ "version": "1.0.30001511", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001511.tgz", "integrity": "sha512-NaWPJawcoedlghN4P7bDNeADD7K+rZaY6V8ZcME7PkEZo/nfOg+lnrUgRWiKbNxcQ4/toFKSxnS4WdbyPZnKkw==", + "dev": true, "funding": [ { "type": "opencollective", @@ -12336,17 +11576,6 @@ "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", "dev": true }, - "node_modules/case-anything": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", - "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", - "engines": { - "node": ">=12.13" - }, - "funding": { - "url": "https://github.com/sponsors/mesqueeb" - } - }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -14454,11 +13683,6 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, - "node_modules/crelt": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", - "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" - }, "node_modules/critters": { "version": "0.0.12", "resolved": "https://registry.npmjs.org/critters/-/critters-0.0.12.tgz", @@ -15956,11 +15180,6 @@ "node": ">=8" } }, - "node_modules/dash-get": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/dash-get/-/dash-get-1.0.2.tgz", - "integrity": "sha512-4FbVrHDwfOASx7uQVxeiCTo7ggSdYZbqs8lH+WU6ViypPlDbe9y6IP5VVUDQBv9DcnyaiPT5XT0UWHgJ64zLeQ==" - }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -16139,6 +15358,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -16923,7 +16143,8 @@ "node_modules/electron-to-chromium": { "version": "1.4.447", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.447.tgz", - "integrity": "sha512-sxX0LXh+uL41hSJsujAN86PjhrV/6c79XmpY0TvjZStV6VxIgarf8SRkUoUTuYmFcZQTemsoqo8qXOGw5npWfw==" + "integrity": "sha512-sxX0LXh+uL41hSJsujAN86PjhrV/6c79XmpY0TvjZStV6VxIgarf8SRkUoUTuYmFcZQTemsoqo8qXOGw5npWfw==", + "dev": true }, "node_modules/ember-rfc176-data": { "version": "0.3.18", @@ -25831,11 +25052,6 @@ "uc.micro": "^1.0.1" } }, - "node_modules/linkifyjs": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.1.1.tgz", - "integrity": "sha512-zFN/CTVmbcVef+WaDXT63dNzzkfRBKT1j464NJQkV7iSgJU0sLBus9W0HBwnXK13/hf168pbrx/V/bjEHOXNHA==" - }, "node_modules/lint-staged": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.2.3.tgz", @@ -26717,6 +25933,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, "dependencies": { "yallist": "^3.0.2" } @@ -26765,7 +25982,8 @@ "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true }, "node_modules/make-fetch-happen": { "version": "9.1.0", @@ -27999,7 +27217,8 @@ "node_modules/node-releases": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", - "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==" + "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", + "dev": true }, "node_modules/node-sass-tilde-importer": { "version": "1.0.2", @@ -28969,39 +28188,6 @@ "node": ">= 0.4" } }, - "node_modules/object.omit": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-3.0.0.tgz", - "integrity": "sha512-EO+BCv6LJfu+gBIF3ggLicFebFLN5zqzz/WWJlMFfkMyGth+oBkhxzDl0wx2W4GkLzuQs/FsSkXZb2IMWQqmBQ==", - "dependencies": { - "is-extendable": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.omit/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.omit/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -29235,11 +28421,6 @@ "node": ">=8" } }, - "node_modules/orderedmap": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz", - "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==" - }, "node_modules/os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -32535,221 +31716,6 @@ "integrity": "sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA==", "dev": true }, - "node_modules/prosemirror-changeset": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.2.1.tgz", - "integrity": "sha512-J7msc6wbxB4ekDFj+n9gTW/jav/p53kdlivvuppHsrZXCaQdVgRghoZbSS3kwrRyAstRVQ4/+u5k7YfLgkkQvQ==", - "dependencies": { - "prosemirror-transform": "^1.0.0" - } - }, - "node_modules/prosemirror-collab": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/prosemirror-collab/-/prosemirror-collab-1.3.1.tgz", - "integrity": "sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ==", - "dependencies": { - "prosemirror-state": "^1.0.0" - } - }, - "node_modules/prosemirror-commands": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.5.2.tgz", - "integrity": "sha512-hgLcPaakxH8tu6YvVAaILV2tXYsW3rAdDR8WNkeKGcgeMVQg3/TMhPdVoh7iAmfgVjZGtcOSjKiQaoeKjzd2mQ==", - "dependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" - } - }, - "node_modules/prosemirror-dropcursor": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.1.tgz", - "integrity": "sha512-M30WJdJZLyXHi3N8vxN6Zh5O8ZBbQCz0gURTfPmTIBNQ5pxrdU7A58QkNqfa98YEjSAL1HUyyU34f6Pm5xBSGw==", - "dependencies": { - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.1.0", - "prosemirror-view": "^1.1.0" - } - }, - "node_modules/prosemirror-gapcursor": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.3.2.tgz", - "integrity": "sha512-wtjswVBd2vaQRrnYZaBCbyDqr232Ed4p2QPtRIUK5FuqHYKGWkEwl08oQM4Tw7DOR0FsasARV5uJFvMZWxdNxQ==", - "dependencies": { - "prosemirror-keymap": "^1.0.0", - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.0", - "prosemirror-view": "^1.0.0" - } - }, - "node_modules/prosemirror-history": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.3.2.tgz", - "integrity": "sha512-/zm0XoU/N/+u7i5zepjmZAEnpvjDtzoPWW6VmKptcAnPadN/SStsBjMImdCEbb3seiNTpveziPTIrXQbHLtU1g==", - "dependencies": { - "prosemirror-state": "^1.2.2", - "prosemirror-transform": "^1.0.0", - "prosemirror-view": "^1.31.0", - "rope-sequence": "^1.3.0" - } - }, - "node_modules/prosemirror-inputrules": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.2.1.tgz", - "integrity": "sha512-3LrWJX1+ULRh5SZvbIQlwZafOXqp1XuV21MGBu/i5xsztd+9VD15x6OtN6mdqSFI7/8Y77gYUbQ6vwwJ4mr6QQ==", - "dependencies": { - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" - } - }, - "node_modules/prosemirror-keymap": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.2.tgz", - "integrity": "sha512-EAlXoksqC6Vbocqc0GtzCruZEzYgrn+iiGnNjsJsH4mrnIGex4qbLdWWNza3AW5W36ZRrlBID0eM6bdKH4OStQ==", - "dependencies": { - "prosemirror-state": "^1.0.0", - "w3c-keyname": "^2.2.0" - } - }, - "node_modules/prosemirror-markdown": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.11.1.tgz", - "integrity": "sha512-CLOieKoaSSEusKyYcXIj8v2qHGLW+tnuffci+8678Sen48NEFQE7M3o0Nx0gj9v63iVDj+yLibj2gCe8eb3jIw==", - "dependencies": { - "markdown-it": "^13.0.1", - "prosemirror-model": "^1.0.0" - } - }, - "node_modules/prosemirror-menu": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/prosemirror-menu/-/prosemirror-menu-1.2.2.tgz", - "integrity": "sha512-437HIWTq4F9cTX+kPfqZWWm+luJm95Aut/mLUy+9OMrOml0bmWDS26ceC6SNfb2/S94et1sZ186vLO7pDHzxSw==", - "dependencies": { - "crelt": "^1.0.0", - "prosemirror-commands": "^1.0.0", - "prosemirror-history": "^1.0.0", - "prosemirror-state": "^1.0.0" - } - }, - "node_modules/prosemirror-model": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.19.2.tgz", - "integrity": "sha512-RXl0Waiss4YtJAUY3NzKH0xkJmsZupCIccqcIFoLTIKFlKNbIvFDRl27/kQy1FP8iUAxrjRRfIVvOebnnXJgqQ==", - "dependencies": { - "orderedmap": "^2.0.0" - } - }, - "node_modules/prosemirror-schema-basic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.2.tgz", - "integrity": "sha512-/dT4JFEGyO7QnNTe9UaKUhjDXbTNkiWTq/N4VpKaF79bBjSExVV2NXmJpcM7z/gD7mbqNjxbmWW5nf1iNSSGnw==", - "dependencies": { - "prosemirror-model": "^1.19.0" - } - }, - "node_modules/prosemirror-schema-list": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.3.0.tgz", - "integrity": "sha512-Hz/7gM4skaaYfRPNgr421CU4GSwotmEwBVvJh5ltGiffUJwm7C8GfN/Bc6DR1EKEp5pDKhODmdXXyi9uIsZl5A==", - "dependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.7.3" - } - }, - "node_modules/prosemirror-state": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.3.tgz", - "integrity": "sha512-goFKORVbvPuAQaXhpbemJFRKJ2aixr+AZMGiquiqKxaucC6hlpHNZHWgz5R7dS4roHiwq9vDctE//CZ++o0W1Q==", - "dependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-transform": "^1.0.0", - "prosemirror-view": "^1.27.0" - } - }, - "node_modules/prosemirror-tables": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.3.4.tgz", - "integrity": "sha512-z6uLSQ1BLC3rgbGwZmpfb+xkdvD7W/UOsURDfognZFYaTtc0gsk7u/t71Yijp2eLflVpffMk6X0u0+u+MMDvIw==", - "dependencies": { - "prosemirror-keymap": "^1.1.2", - "prosemirror-model": "^1.8.1", - "prosemirror-state": "^1.3.1", - "prosemirror-transform": "^1.2.1", - "prosemirror-view": "^1.13.3" - } - }, - "node_modules/prosemirror-trailing-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-2.0.4.tgz", - "integrity": "sha512-0Yl9w7IdHkaCdqR+NE3FOucePME4OmiGcybnF1iasarEILP5U8+4xTnl53yafULjmwcg1SrSG65Hg7Zk2H2v3g==", - "dependencies": { - "@babel/runtime": "^7.21.0", - "@remirror/core-constants": "^2.0.1", - "@remirror/core-helpers": "^2.0.2", - "escape-string-regexp": "^4.0.0" - }, - "peerDependencies": { - "prosemirror-model": "^1.19.0", - "prosemirror-state": "^1.4.2", - "prosemirror-view": "^1.30.2" - } - }, - "node_modules/prosemirror-trailing-node/node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/prosemirror-trailing-node/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/prosemirror-trailing-node/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - }, - "node_modules/prosemirror-transform": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.7.3.tgz", - "integrity": "sha512-qDapyx5lqYfxVeUWEw0xTGgeP2S8346QtE7DxkalsXlX89lpzkY6GZfulgfHyk1n4tf74sZ7CcXgcaCcGjsUtA==", - "dependencies": { - "prosemirror-model": "^1.0.0" - } - }, - "node_modules/prosemirror-utils": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/prosemirror-utils/-/prosemirror-utils-0.9.6.tgz", - "integrity": "sha512-UC+j9hQQ1POYfMc5p7UFxBTptRiGPR7Kkmbl3jVvU8VgQbkI89tR/GK+3QYC8n+VvBZrtAoCrJItNhWSxX3slA==", - "peerDependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.1", - "prosemirror-tables": "^0.9.1" - } - }, - "node_modules/prosemirror-view": { - "version": "1.31.5", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.5.tgz", - "integrity": "sha512-tobRCDeCp61elR1d97XE/JTL9FDIfswZpWeNs7GKJjAJvWyMGHWYFCq29850p6bbG2bckP+i9n1vT56RifosbA==", - "dependencies": { - "prosemirror-model": "^1.16.0", - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.1.0" - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -33833,11 +32799,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/rope-sequence": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", - "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==" - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -36928,14 +35889,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/throttle-debounce": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-3.0.1.tgz", - "integrity": "sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==", - "engines": { - "node": ">=10" - } - }, "node_modules/throttleit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", @@ -36963,14 +35916,6 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, - "node_modules/tippy.js": { - "version": "6.3.7", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", - "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", - "dependencies": { - "@popperjs/core": "^2.9.0" - } - }, "node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -37542,6 +36487,7 @@ "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, "engines": { "node": ">=12.20" }, @@ -37846,6 +36792,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, "funding": [ { "type": "opencollective", @@ -38053,11 +37000,6 @@ "browser-process-hrtime": "^1.0.0" } }, - "node_modules/w3c-keyname": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", - "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" - }, "node_modules/w3c-xmlserializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", @@ -39588,7 +38530,8 @@ "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true }, "node_modules/yaml": { "version": "1.10.2", @@ -39776,6 +38719,7 @@ "projects/addon-editor": { "name": "@taiga-ui/addon-editor", "version": "3.35.0", + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@tiptap/core": "2.0.3", diff --git a/projects/addon-editor/LICENSE b/projects/addon-editor/LICENSE deleted file mode 100644 index fe7dafb2fba0..000000000000 --- a/projects/addon-editor/LICENSE +++ /dev/null @@ -1,190 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2020 Tinkoff Bank - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/projects/addon-editor/README.md b/projects/addon-editor/README.md deleted file mode 100644 index 2afbe9ba8a80..000000000000 --- a/projects/addon-editor/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Taiga UI — Editor - -[![npm version](https://img.shields.io/npm/v/@taiga-ui/addon-editor.svg)](https://npmjs.com/package/@taiga-ui/addon-editor) -[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@taiga-ui/addon-editor)](https://bundlephobia.com/result?p=@taiga-ui/addon-editor) -[![Discord](https://img.shields.io/discord/748677963142135818?color=7289DA&label=%23taiga-ui&logo=discord&logoColor=white)](https://discord.gg/Us8d8JVaTg) - -[Website](https://taiga-ui.dev) • [Documentation](https://taiga-ui.dev/getting-started) • -[Core team](https://github.com/tinkoff/taiga-ui/#core-team) - -`WORK IN PROGRESS` - -> Tools for creating rich text editor in Angular - -It's a part of [**Taiga UI**](https://github.com/tinkoff/taiga-ui) that is fully-treeshakable Angular UI Kit consisting -of multiple base libraries and several add-ons - -## How to install - -Install base packages: - -``` -npm i @taiga-ui/{cdk,core,kit} -``` - -Install addon-editor: - -``` -npm i @taiga-ui/addon-editor -``` - -Don't forget that Taiga UI is fully-treeshakable. **You can import even just one entity from our library** and be sure -that there is no redundant code in your bundle. Bundlphobia badge shows size of the whole library. - -## Docs - -See our [Documentation](https://taiga-ui.dev/getting-started) diff --git a/projects/addon-editor/abstract/editor-adapter.abstract.ts b/projects/addon-editor/abstract/editor-adapter.abstract.ts deleted file mode 100644 index 7de8c472f0ac..000000000000 --- a/projects/addon-editor/abstract/editor-adapter.abstract.ts +++ /dev/null @@ -1,100 +0,0 @@ -import {Directive} from '@angular/core'; -import type {TuiEditableIframe} from '@taiga-ui/addon-editor/extensions/iframe-editor'; -import type {TuiYoutubeOptions} from '@taiga-ui/addon-editor/extensions/youtube'; -import type {TuiEditorAttachedFile} from '@taiga-ui/addon-editor/interfaces'; -import type {Editor, Range} from '@tiptap/core'; -import type {MarkType} from '@tiptap/pm/model'; -import type {EditorState} from 'prosemirror-state'; -import {Observable, Subject} from 'rxjs'; - -@Directive() -export abstract class AbstractTuiEditor { - abstract readonly isFocused: boolean; - abstract readonly html: string; - abstract editable: boolean; - - readonly stateChange$ = new Subject(); - readonly valueChange$ = new Subject(); - - abstract get state(): EditorState; - - abstract isActive$(name: Record | string): Observable; - - abstract isActive(name: Record | string): boolean; - abstract undoDisabled(): boolean; - abstract redoDisabled(): boolean; - abstract getFontColor(): string; - abstract getFontSize(): number; - abstract setFontSize(size: number): void; - abstract getBackgroundColor(): string; - abstract getCellColor(): string; - abstract getGroupColor(): string; - abstract onAlign(align: string): void; - abstract setImage(src: string): void; - abstract undo(): void; - abstract redo(): void; - abstract setHorizontalRule(): void; - abstract removeFormat(): void; - abstract setFontColor(color: string): void; - abstract setBackgroundColor(color: string): void; - abstract toggleBold(): void; - abstract toggleItalic(): void; - abstract toggleUnderline(): void; - abstract toggleBlockquote(): void; - abstract toggleStrike(): void; - abstract toggleOrderedList(): void; - abstract toggleUnorderedList(): void; - abstract toggleCode(): void; - abstract togglePre(): void; - abstract toggleSubscript(): void; - abstract toggleSuperscript(): void; - abstract toggleCodeBlock(): void; - abstract liftListItem(): void; - abstract sinkListItem(): void; - abstract insertTable(rows: number, cols: number): void; - abstract addColumnAfter(): void; - abstract addColumnBefore(): void; - abstract addRowAfter(): void; - abstract addRowBefore(): void; - abstract deleteColumn(): void; - abstract deleteRow(): void; - abstract mergeCells(): void; - abstract canMergeCells(): boolean; - abstract canSplitCells(): boolean; - abstract splitCell(): void; - abstract setHeading(level: number): void; - abstract removeEmptyTextStyle(): void; - abstract toggleMark( - typeOrName: MarkType | string, - attributes?: Record, - options?: { - /** - * Removes the mark even across the current selection. Defaults to `false`. - */ - extendEmptyMarkRange?: boolean; - }, - ): void; - abstract setParagraph(options?: {fontSize: string}): void; - abstract setHardBreak(): void; - abstract setTextSelection(value: Range | number): void; - abstract toggleLink(href: string): void; - abstract setLink(href: string): void; - abstract unsetLink(): void; - abstract destroy(): void; - abstract selectClosest(): void; - abstract focus(): void; - abstract setValue(value: string): void; - abstract setCellColor(color: string): void; - abstract getOriginTiptapEditor(): Editor; - abstract enter(): void; - abstract setDetails(): void; - abstract removeDetails(): void; - abstract setGroup(): void; - abstract setGroupHilite(color: string): void; - abstract removeGroup(): void; - abstract setAnchor(id: string): void; - abstract removeAnchor(): void; - abstract setFileLink(preview: TuiEditorAttachedFile): void; - abstract setYoutubeVideo(options: TuiYoutubeOptions): void; - abstract setIframe(options: TuiEditableIframe): void; -} diff --git a/projects/addon-editor/abstract/index.ts b/projects/addon-editor/abstract/index.ts deleted file mode 100644 index 6475d5894732..000000000000 --- a/projects/addon-editor/abstract/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './editor-adapter.abstract'; diff --git a/projects/addon-editor/abstract/ng-package.json b/projects/addon-editor/abstract/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/abstract/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/color-selector/color-edit/color-edit.component.ts b/projects/addon-editor/components/color-selector/color-edit/color-edit.component.ts deleted file mode 100644 index 11e0e38c4495..000000000000 --- a/projects/addon-editor/components/color-selector/color-edit/color-edit.component.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Input, - Output, -} from '@angular/core'; -import {MaskitoOptions} from '@maskito/core'; -import {tuiHexToRgb, tuiRgbToHex} from '@taiga-ui/cdk'; - -const HEX_MODE_LENGTH = 6; - -@Component({ - selector: 'tui-color-edit', - templateUrl: './color-edit.template.html', - styleUrls: ['./color-edit.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiColorEditComponent { - @Input() - color: [number, number, number, number] = [0, 0, 0, 1]; - - @Output() - readonly colorChange = new EventEmitter<[number, number, number, number]>(); - - readonly hexMask: MaskitoOptions = { - mask: new RegExp(`^[A-F\\d]{0,${HEX_MODE_LENGTH}}$`, 'gi'), - }; - - readonly modes = ['HEX', 'RGB']; - - mode = this.modes[0]; - - get isHex(): boolean { - return this.mode === this.modes[0]; - } - - get hex(): string { - return tuiRgbToHex(this.color[0], this.color[1], this.color[2]).replace('#', ''); - } - - get opacity(): number { - return Math.round(this.color[3] * 100); - } - - onHexChange(hex: string): void { - if (hex.length !== HEX_MODE_LENGTH) { - return; - } - - const rgb = tuiHexToRgb(hex); - - this.updateColor([rgb[0], rgb[1], rgb[2], this.color[3]]); - } - - onRgbChange(...rgba: [number, number, number, number]): void { - this.updateColor(rgba); - } - - private updateColor(color: [number, number, number, number]): void { - this.color = color; - this.colorChange.emit(color); - } -} diff --git a/projects/addon-editor/components/color-selector/color-edit/color-edit.module.ts b/projects/addon-editor/components/color-selector/color-edit/color-edit.module.ts deleted file mode 100644 index 0ca636987fab..000000000000 --- a/projects/addon-editor/components/color-selector/color-edit/color-edit.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MaskitoModule} from '@maskito/angular'; -import { - TuiDataListModule, - TuiDropdownModule, - TuiPrimitiveTextfieldModule, - TuiTextfieldControllerModule, -} from '@taiga-ui/core'; -import { - TuiInputCountModule, - TuiSelectModule, - TuiValueAccessorModule, -} from '@taiga-ui/kit'; - -import {TuiColorEditComponent} from './color-edit.component'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MaskitoModule, - TuiValueAccessorModule, - TuiSelectModule, - TuiPrimitiveTextfieldModule, - TuiTextfieldControllerModule, - TuiDropdownModule, - TuiInputCountModule, - TuiDataListModule, - ], - declarations: [TuiColorEditComponent], - exports: [TuiColorEditComponent], -}) -export class TuiColorEditModule {} diff --git a/projects/addon-editor/components/color-selector/color-edit/color-edit.style.less b/projects/addon-editor/components/color-selector/color-edit/color-edit.style.less deleted file mode 100644 index 5377d81dbaf7..000000000000 --- a/projects/addon-editor/components/color-selector/color-edit/color-edit.style.less +++ /dev/null @@ -1,11 +0,0 @@ -:host { - display: flex; -} - -.t-select { - width: 4.875rem; -} - -.t-opacity { - width: 4.275rem; -} diff --git a/projects/addon-editor/components/color-selector/color-edit/color-edit.template.html b/projects/addon-editor/components/color-selector/color-edit/color-edit.template.html deleted file mode 100644 index 1c352a7681b2..000000000000 --- a/projects/addon-editor/components/color-selector/color-edit/color-edit.template.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - diff --git a/projects/addon-editor/components/color-selector/color-edit/test/color-edit.component.spec.ts b/projects/addon-editor/components/color-selector/color-edit/test/color-edit.component.spec.ts deleted file mode 100644 index bac409a2c01d..000000000000 --- a/projects/addon-editor/components/color-selector/color-edit/test/color-edit.component.spec.ts +++ /dev/null @@ -1,48 +0,0 @@ -import {Component, ViewChild} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {TuiColorEditComponent, TuiColorEditModule} from '@taiga-ui/addon-editor'; - -@Component({ - template: ` - - `, -}) -class TestComponent { - @ViewChild(TuiColorEditComponent) - component!: TuiColorEditComponent; - - color = [255, 0, 0, 1]; -} - -describe(`ColorEdit`, () => { - let fixture: ComponentFixture; - let testComponent: TestComponent; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [TuiColorEditModule, NoopAnimationsModule], - declarations: [TestComponent], - }); - - fixture = TestBed.createComponent(TestComponent); - testComponent = fixture.componentInstance; - fixture.detectChanges(); - }); - - it(`HEX`, () => { - expect(testComponent.component.hex).toBe(`ff0000`); - }); - - it(`Updates`, () => { - testComponent.component.onHexChange(`00ff00`); - - expect(testComponent.color).toEqual([0, 255, 0, 1]); - }); - - it(`Does not trigger if HEX is not fully entered`, () => { - testComponent.component.onHexChange(`00ff`); - - expect(testComponent.color).toEqual([255, 0, 0, 1]); - }); -}); diff --git a/projects/addon-editor/components/color-selector/color-picker/color-picker.component.ts b/projects/addon-editor/components/color-selector/color-picker/color-picker.component.ts deleted file mode 100644 index ec126ee6a749..000000000000 --- a/projects/addon-editor/components/color-selector/color-picker/color-picker.component.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Inject, - Input, - Output, -} from '@angular/core'; -import {DomSanitizer, SafeStyle} from '@angular/platform-browser'; -import {tuiHsvToRgb, tuiPure, tuiRgbToHsv, tuiRound} from '@taiga-ui/cdk'; -import {TuiPoint} from '@taiga-ui/core'; - -@Component({ - selector: 'tui-color-picker', - templateUrl: './color-picker.template.html', - styleUrls: ['./color-picker.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiColorPickerComponent { - @Input() - set color(color: [h: number, s: number, v: number, opacity: number]) { - if ( - this.currentColor.every((item, index) => item === color[index]) && - color[3] === this.opacity - ) { - return; - } - - const [h, s, v] = tuiRgbToHsv(color[0], color[1], color[2]); - - this.opacity = color[3]; - this.hue = h / 360; - this.point = [s, 1 - v / 255]; - } - - @Output() - readonly colorChange = new EventEmitter< - [h: number, s: number, v: number, opacity: number] - >(); - - point: TuiPoint = [0, 1]; - - hue = 0; - - opacity = 1; - - constructor(@Inject(DomSanitizer) private readonly sanitizer: DomSanitizer) {} - - get currentColor(): [h: number, s: number, v: number] { - return this.getCurrentColor(this.hue, this.point); - } - - get base(): string { - return `rgb(${tuiHsvToRgb(this.hue * 360, 1, 255)})`; - } - - get gradient(): SafeStyle { - return this.sanitizer.bypassSecurityTrustStyle( - `linear-gradient(to right, rgba(${this.currentColor.join( - ',', - )}, 0), rgb(${this.currentColor.join(',')}))`, - ); - } - - onPointChange(point: TuiPoint): void { - this.point = point; - this.updateColor(); - } - - onHueChange(hue: number): void { - this.hue = hue; - this.updateColor(); - } - - onOpacityChange(opacity: number): void { - this.opacity = tuiRound(opacity, 2); - this.updateColor(); - } - - @tuiPure - private getCurrentColor( - hue: number, - point: TuiPoint, - ): [h: number, s: number, v: number] { - return tuiHsvToRgb(hue * 360, point[0], (1 - point[1]) * 255); - } - - private updateColor(): void { - this.colorChange.emit([...this.currentColor, this.opacity]); - } -} diff --git a/projects/addon-editor/components/color-selector/color-picker/color-picker.module.ts b/projects/addon-editor/components/color-selector/color-picker/color-picker.module.ts deleted file mode 100644 index 651a30280297..000000000000 --- a/projects/addon-editor/components/color-selector/color-picker/color-picker.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; - -import {TuiFlatPickerModule} from '../flat-picker/flat-picker.module'; -import {TuiLinearPickerModule} from '../linear-picker/linear-picker.module'; -import {TuiColorPickerComponent} from './color-picker.component'; - -@NgModule({ - imports: [CommonModule, TuiFlatPickerModule, TuiLinearPickerModule], - declarations: [TuiColorPickerComponent], - exports: [TuiColorPickerComponent], -}) -export class TuiColorPickerModule {} diff --git a/projects/addon-editor/components/color-selector/color-picker/color-picker.style.less b/projects/addon-editor/components/color-selector/color-picker/color-picker.style.less deleted file mode 100644 index c7b5e3dcbbdf..000000000000 --- a/projects/addon-editor/components/color-selector/color-picker/color-picker.style.less +++ /dev/null @@ -1,79 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - .createStackingContext(); - display: block; -} - -.t-flat { - height: 14rem; - background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 1)), - linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); - margin-bottom: 0.25rem; - overflow: hidden; -} - -.t-wrapper { - position: relative; - margin: 1rem 1.25rem; - border-radius: 0.5rem; - - &:after { - .fullsize(); - content: ''; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); - pointer-events: none; - border-radius: inherit; - } - - &_hue { - background: rgb(255, 0, 0); - } - - &_opacity { - &:before { - .fullsize(); - content: ''; - z-index: -1; - background-image: linear-gradient( - 45deg, - var(--tui-base-03) 25%, - transparent 25%, - transparent 75%, - var(--tui-base-03) 75%, - var(--tui-base-03) - ), - linear-gradient( - 45deg, - var(--tui-base-03) 25%, - transparent 25%, - transparent 75%, - var(--tui-base-03) 75%, - var(--tui-base-03) - ); - background-size: 0.375rem 0.375rem; - background-position: 0 0, 0.1875rem 0.1875rem; - border-radius: inherit; - } - } -} - -.t-hue { - background: linear-gradient( - to right, - rgb(255, 0, 0), - rgb(255, 255, 0), - rgb(0, 255, 0), - rgb(0, 255, 255), - rgb(0, 0, 255), - rgb(255, 0, 255), - rgb(255, 0, 0) - ); - border-radius: inherit; - margin: 0 0.5rem; -} - -.t-opacity { - border-radius: inherit; - margin: 0 0.5rem; -} diff --git a/projects/addon-editor/components/color-selector/color-picker/color-picker.template.html b/projects/addon-editor/components/color-selector/color-picker/color-picker.template.html deleted file mode 100644 index ed2e2589623b..000000000000 --- a/projects/addon-editor/components/color-selector/color-picker/color-picker.template.html +++ /dev/null @@ -1,23 +0,0 @@ - -
- -
-
- -
diff --git a/projects/addon-editor/components/color-selector/color-picker/test/color-picker.component.spec.ts b/projects/addon-editor/components/color-selector/color-picker/test/color-picker.component.spec.ts deleted file mode 100644 index 7b5b7ed4ae4f..000000000000 --- a/projects/addon-editor/components/color-selector/color-picker/test/color-picker.component.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {Component, ViewChild} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {TuiColorPickerComponent, TuiColorPickerModule} from '@taiga-ui/addon-editor'; - -@Component({ - template: ` - - `, -}) -class TestComponent { - @ViewChild(TuiColorPickerComponent) - component!: TuiColorPickerComponent; - - color = [0, 255, 0, 1]; -} - -describe(`ColorPicker`, () => { - let fixture: ComponentFixture; - let testComponent: TestComponent; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [TuiColorPickerModule, NoopAnimationsModule], - declarations: [TestComponent], - }); - - fixture = TestBed.createComponent(TestComponent); - testComponent = fixture.componentInstance; - fixture.detectChanges(); - }); - - it(`Parses color`, () => { - expect(testComponent.component.currentColor).toEqual([0, 255, 0]); - expect(testComponent.component.point).toEqual([1, 0]); - expect(testComponent.component.opacity).toBe(1); - expect(testComponent.component.hue).toBe(1 / 3); - }); -}); diff --git a/projects/addon-editor/components/color-selector/color-selector.component.ts b/projects/addon-editor/components/color-selector/color-selector.component.ts deleted file mode 100644 index a93da820ece2..000000000000 --- a/projects/addon-editor/components/color-selector/color-selector.component.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Inject, - Input, - Output, -} from '@angular/core'; -import {DomSanitizer, SafeStyle} from '@angular/platform-browser'; -import {TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES} from '@taiga-ui/addon-editor/tokens'; -import {TuiGradientDirection} from '@taiga-ui/addon-editor/types'; -import {tuiGetGradientData, tuiParseGradient} from '@taiga-ui/addon-editor/utils'; -import {tuiDefaultSort, tuiParseColor, tuiPure} from '@taiga-ui/cdk'; -import {TuiHostedDropdownComponent} from '@taiga-ui/core'; - -const EMPTY_STOP: [number, number, number, number] = [0, 0, 0, 0]; -const DEFAULT_STEPS: ReadonlyArray<[number, [number, number, number, number]]> = [ - [0, [0, 0, 0, 1]], - [1, [255, 255, 255, 1]], -]; -const ICONS: Record = { - 'to top right': 'tuiIconArrowUpRight', - 'to right': 'tuiIconArrowRight', - 'to bottom right': 'tuiIconArrowDownRight', - 'to bottom': 'tuiIconArrowDown', - 'to bottom left': 'tuiIconArrowDownLeft', - 'to left': 'tuiIconArrowLeft', - 'to top left': 'tuiIconArrowUpLeft', - 'to top': 'tuiIconArrowUp', -}; - -@Component({ - selector: 'tui-color-selector', - templateUrl: './color-selector.template.html', - styleUrls: ['./color-selector.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiColorSelectorComponent { - private stops = new Map(DEFAULT_STEPS); - private currentStop = 0; - private direction: TuiGradientDirection = 'to bottom'; - - @Input() - colors: ReadonlyMap = new Map(); - - @Input('color') - set colorSetter(color: string) { - this.parse(color); - } - - @Output() - readonly colorChange = new EventEmitter(); - - color: [number, number, number, number] = [0, 0, 0, 1]; - - currentMode = this.modes[0]; - - readonly buttons: readonly TuiGradientDirection[] = [ - 'to top right', - 'to right', - 'to bottom right', - 'to bottom', - 'to bottom left', - 'to left', - 'to top left', - 'to top', - ]; - - constructor( - @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer, - @Inject(TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES) readonly modes: [string, string], - ) {} - - get palette(): Map { - return this.filterPalette(this.colors, this.isGradient); - } - - get stopsKeys(): number[] { - return this.getStopsKeys(this.stops); - } - - get currentColor(): [number, number, number, number] { - return this.isGradient ? this.getStop(this.currentStop) : this.color; - } - - get gradient(): SafeStyle { - return this.sanitizer.bypassSecurityTrustStyle(this.getGradient('to right')); - } - - get isGradient(): boolean { - return this.currentMode === this.modes[1]; - } - - getIcon(direction: TuiGradientDirection): string { - return ICONS[direction]; - } - - isModeActive(mode: string): boolean { - return this.currentMode === mode; - } - - isDirectionActive(direction: TuiGradientDirection): boolean { - return this.direction === direction; - } - - onPalettePick(color: string): void { - this.updateColor(color); - } - - onDirectionChange(direction: TuiGradientDirection): void { - this.direction = direction; - this.updateColor(this.getGradient(direction)); - } - - onModeSelect(mode: string, dropdown: TuiHostedDropdownComponent): void { - this.currentMode = mode; - dropdown.open = false; - this.updateColor( - mode === this.modes[0] - ? `rgba(${this.color.join(', ')})` - : this.getGradient(this.direction), - ); - } - - onIndexChange(index: number): void { - this.currentStop = this.stopsKeys[index]; - } - - onColorChange(color: [number, number, number, number]): void { - if (!this.isGradient) { - this.updateColor(`rgba(${color.join(', ')})`); - - return; - } - - this.stops.set(this.currentStop, color); - this.updateColor(this.getGradient(this.direction)); - } - - onStopsChange(stopsKeys: readonly number[]): void { - const removed = this.stopsKeys.find(item => !stopsKeys.includes(item)); - const added = stopsKeys.find(item => !this.stopsKeys.includes(item)); - - if (removed === undefined && added !== undefined) { - this.addStop(added); - } - - if (removed !== undefined && added === undefined) { - this.removeStop(removed); - } - - if (removed !== undefined && added !== undefined) { - this.replaceStop(removed, added); - } - - this.updateColor(this.getGradient(this.direction)); - } - - @tuiPure - private getStopsKeys(stops: Map): number[] { - return Array.from(stops.keys()); - } - - @tuiPure - private filterPalette( - colors: ReadonlyMap, - isGradient: boolean, - ): Map { - const map = new Map(colors); - - map.forEach((value, key) => { - if ( - (value.startsWith('linear-gradient') && !isGradient) || - (!value.startsWith('linear-gradient') && isGradient) - ) { - map.delete(key); - } - }); - - return map; - } - - private updateColor(color: string): void { - this.colorChange.emit(color); - } - - private getGradient(direction: TuiGradientDirection): string { - return `linear-gradient(${direction}, ${[...this.stopsKeys] - .sort(tuiDefaultSort) - .map(key => `rgba(${this.getStop(key).join(', ')}) ${key * 100}%`) - .join(', ')})`; - } - - private getStop(stop: number): [number, number, number, number] { - return this.stops.get(stop) || EMPTY_STOP; - } - - private addStop(stop: number): void { - const closest = this.stopsKeys.reduce( - (prev, curr) => (Math.abs(curr - stop) < Math.abs(prev - stop) ? curr : prev), - this.stopsKeys[0], - ); - - this.stops.set(stop, this.getStop(closest)); - this.stops = new Map(this.stops); - this.currentStop = stop; - } - - private removeStop(stop: number): void { - this.stops.delete(stop); - this.stops = new Map(this.stops); - this.currentStop = this.stopsKeys[0]; - } - - private replaceStop(removed: number, added: number): void { - const value = this.getStop(removed); - - this.currentStop = added; - this.stops = new Map( - this.stopsKeys.map<[number, [number, number, number, number]]>(key => - key === removed ? [added, value] : [key, this.getStop(key)], - ), - ); - } - - private parse(color: string): void { - if (color.startsWith('linear-gradient')) { - this.parseGradient(color); - } else { - this.parseColor(color); - } - } - - private parseGradient(color: string): void { - if (color === this.getGradient(this.direction)) { - return; - } - - const gradient = tuiParseGradient(tuiGetGradientData(color)); - - this.currentMode = this.modes[1]; - this.direction = gradient.side; - this.currentStop = 0; - this.stops = new Map( - gradient.stops.length - ? gradient.stops.map<[number, [number, number, number, number]]>( - ({color, position}) => [ - parseFloat(position) / 100, - tuiParseColor(color), - ], - ) - : DEFAULT_STEPS, - ); - } - - private parseColor(color: string): void { - this.currentMode = this.modes[0]; - this.currentStop = 0; - this.color = tuiParseColor(color); - } -} diff --git a/projects/addon-editor/components/color-selector/color-selector.module.ts b/projects/addon-editor/components/color-selector/color-selector.module.ts deleted file mode 100644 index b617256a7391..000000000000 --- a/projects/addon-editor/components/color-selector/color-selector.module.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDataListModule, - TuiGroupModule, - TuiHintModule, - TuiHostedDropdownModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {TuiColorEditModule} from './color-edit/color-edit.module'; -import {TuiColorPickerModule} from './color-picker/color-picker.module'; -import {TuiColorSelectorComponent} from './color-selector.component'; -import {TuiLinearMultiPickerModule} from './linear-multi-picker/linear-multi-picker.module'; -import {TuiPaletteModule} from './palette/palette.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiColorPickerModule, - TuiLinearMultiPickerModule, - TuiHintModule, - TuiSvgModule, - TuiDataListModule, - TuiActiveZoneModule, - TuiColorEditModule, - TuiGroupModule, - TuiPaletteModule, - ], - declarations: [TuiColorSelectorComponent], - exports: [TuiColorSelectorComponent], -}) -export class TuiColorSelectorModule {} diff --git a/projects/addon-editor/components/color-selector/color-selector.style.less b/projects/addon-editor/components/color-selector/color-selector.style.less deleted file mode 100644 index 7fd6c876e74b..000000000000 --- a/projects/addon-editor/components/color-selector/color-selector.style.less +++ /dev/null @@ -1,105 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - .createStackingContext(); - display: block; - width: 22.6rem; -} - -.t-wrapper { - position: relative; - margin: 1.25rem; - border-radius: 0.5rem; - - &:after { - .fullsize(); - content: ''; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); - pointer-events: none; - border-radius: inherit; - } - - &:before { - .fullsize(); - content: ''; - z-index: -1; - background-image: linear-gradient( - 45deg, - var(--tui-base-03) 25%, - transparent 25%, - transparent 75%, - var(--tui-base-03) 75%, - var(--tui-base-03) - ), - linear-gradient( - 45deg, - var(--tui-base-03) 25%, - transparent 25%, - transparent 75%, - var(--tui-base-03) 75%, - var(--tui-base-03) - ); - background-size: 0.375rem 0.375rem; - background-position: 0 0, 0.1875rem 0.1875rem; - border-radius: inherit; - } -} - -.t-hr { - height: 1px; - margin: 0 0 0 -1px; - border: none; - background: var(--tui-base-03); -} - -.t-gradient { - margin: 0 0.5rem; - border-radius: inherit; -} - -.t-select { - margin: 0.75rem 0.5rem; -} - -.t-arrow { - .transition(transform); - - &_rotated { - transform: rotate(180deg); - } -} - -.t-menu { - width: 11.25rem; -} - -.t-checkmark { - margin-left: auto; - width: 1rem; - height: 1rem; -} - -.t-buttons { - display: flex; - padding: 0 0.75rem 1.25rem; -} - -.t-direction { - color: var(--tui-text-02); - margin: 0 0.375rem; - - &:hover, - &_active { - color: var(--tui-text-01); - background: var(--tui-secondary-hover); - } -} - -.t-edit { - margin: 1.25rem; -} - -.t-palette { - box-sizing: border-box; - box-shadow: inset 0 1px var(--tui-base-03); -} diff --git a/projects/addon-editor/components/color-selector/color-selector.template.html b/projects/addon-editor/components/color-selector/color-selector.template.html deleted file mode 100644 index 5c3c86bf0774..000000000000 --- a/projects/addon-editor/components/color-selector/color-selector.template.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- - -
-
- - - diff --git a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.component.ts b/projects/addon-editor/components/color-selector/flat-picker/flat-picker.component.ts deleted file mode 100644 index 437bd0a71ff6..000000000000 --- a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Inject, - Input, - Output, -} from '@angular/core'; -import {TuiPickerService} from '@taiga-ui/addon-editor/services'; -import {TuiDestroyService} from '@taiga-ui/cdk'; -import {TuiPoint} from '@taiga-ui/core'; -import {Observable} from 'rxjs'; - -@Component({ - selector: 'tui-flat-picker', - templateUrl: './flat-picker.template.html', - styleUrls: ['./flat-picker.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [TuiDestroyService, TuiPickerService], -}) -export class TuiFlatPickerComponent { - @Input() - value: TuiPoint = [0, 0]; - - @Output() - readonly valueChange = new EventEmitter<[number, number]>(); - - constructor(@Inject(TuiPickerService) point$: Observable) { - point$.subscribe(point => { - this.value = point; - this.valueChange.emit([point[0], point[1]]); - }); - } - - get left(): number { - return this.value[0] * 100; - } - - get top(): number { - return this.value[1] * 100; - } -} diff --git a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.module.ts b/projects/addon-editor/components/color-selector/flat-picker/flat-picker.module.ts deleted file mode 100644 index 437ce4f748bd..000000000000 --- a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; - -import {TuiFlatPickerComponent} from './flat-picker.component'; - -@NgModule({ - imports: [CommonModule], - declarations: [TuiFlatPickerComponent], - exports: [TuiFlatPickerComponent], -}) -export class TuiFlatPickerModule {} diff --git a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.style.less b/projects/addon-editor/components/color-selector/flat-picker/flat-picker.style.less deleted file mode 100644 index c1b1c8bcc7e5..000000000000 --- a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.style.less +++ /dev/null @@ -1,13 +0,0 @@ -:host { - position: relative; - display: block; -} - -.t-circle { - position: absolute; - width: 1rem; - height: 1rem; - border-radius: 100%; - margin: -0.5rem 0 0 -0.5rem; - box-shadow: inset 0 0 0 1px var(--tui-base-01), 0 0 0 1px var(--tui-base-03); -} diff --git a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.template.html b/projects/addon-editor/components/color-selector/flat-picker/flat-picker.template.html deleted file mode 100644 index 074dc08a5c97..000000000000 --- a/projects/addon-editor/components/color-selector/flat-picker/flat-picker.template.html +++ /dev/null @@ -1,5 +0,0 @@ -
diff --git a/projects/addon-editor/components/color-selector/index.ts b/projects/addon-editor/components/color-selector/index.ts deleted file mode 100644 index 269a97f2475b..000000000000 --- a/projects/addon-editor/components/color-selector/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from './color-edit/color-edit.component'; -export * from './color-edit/color-edit.module'; -export * from './color-picker/color-picker.component'; -export * from './color-picker/color-picker.module'; -export * from './color-selector.component'; -export * from './color-selector.module'; -export * from './flat-picker/flat-picker.component'; -export * from './flat-picker/flat-picker.module'; -export * from './linear-multi-picker/linear-multi-picker.component'; -export * from './linear-multi-picker/linear-multi-picker.module'; -export * from './linear-picker/linear-picker.component'; -export * from './linear-picker/linear-picker.module'; -export * from './palette/palette.component'; -export * from './palette/palette.module'; diff --git a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.component.ts b/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.component.ts deleted file mode 100644 index 5bd1e4e3bf6e..000000000000 --- a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.component.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - HostListener, - Inject, - Input, - Output, -} from '@angular/core'; -import {TuiPickerService} from '@taiga-ui/addon-editor/services'; -import {TuiDestroyService} from '@taiga-ui/cdk'; -import {TuiPoint} from '@taiga-ui/core'; -import {Observable} from 'rxjs'; - -@Component({ - selector: 'tui-linear-multi-picker', - templateUrl: './linear-multi-picker.template.html', - styleUrls: ['./linear-multi-picker.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [TuiDestroyService, TuiPickerService], -}) -export class TuiLinearMultiPickerComponent { - @Input() - value = [0, 1]; - - @Output() - readonly valueChange = new EventEmitter(); - - @Output() - readonly indexChange = new EventEmitter(); - - index = NaN; - - constructor(@Inject(TuiPickerService) point$: Observable) { - point$.subscribe(([x]) => { - this.onPicker(x); - }); - } - - @HostListener('document:mouseup') - onMouseUp(): void { - this.index = NaN; - } - - onMouseDown(index: number): void { - this.updateIndex(index); - } - - onClick(index: number): void { - if (this.value.length > 2) { - this.updateValue(this.value.filter((_, i) => i !== index)); - } - } - - private onPicker(x: number): void { - if (Number.isNaN(this.index)) { - this.updateIndex(this.value.length); - this.value = [...this.value, 0]; - } - - if (this.value.some((item, index) => item === x && index !== this.index)) { - return; - } - - this.updateValue( - this.value.map((item, index) => (index === this.index ? x : item)), - ); - } - - private updateIndex(index: number): void { - this.index = index; - this.indexChange.emit(index); - } - - private updateValue(value: number[]): void { - this.value = value; - this.valueChange.emit(value); - } -} diff --git a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.module.ts b/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.module.ts deleted file mode 100644 index 16df50624690..000000000000 --- a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; - -import {TuiLinearMultiPickerComponent} from './linear-multi-picker.component'; - -@NgModule({ - imports: [CommonModule], - declarations: [TuiLinearMultiPickerComponent], - exports: [TuiLinearMultiPickerComponent], -}) -export class TuiLinearMultiPickerModule {} diff --git a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.style.less b/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.style.less deleted file mode 100644 index 9625336ea738..000000000000 --- a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.style.less +++ /dev/null @@ -1,15 +0,0 @@ -:host { - position: relative; - display: block; - height: 1rem; - box-sizing: border-box; -} - -.t-circle { - position: absolute; - width: 1rem; - height: 1rem; - border-radius: 100%; - margin: 0 -0.5rem; - box-shadow: inset 0 0 0 2px var(--tui-base-01), 0 0 0 1px var(--tui-base-03); -} diff --git a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.template.html b/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.template.html deleted file mode 100644 index fd7fb58626a9..000000000000 --- a/projects/addon-editor/components/color-selector/linear-multi-picker/linear-multi-picker.template.html +++ /dev/null @@ -1,7 +0,0 @@ -
diff --git a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.component.ts b/projects/addon-editor/components/color-selector/linear-picker/linear-picker.component.ts deleted file mode 100644 index d3b7cd5bacbc..000000000000 --- a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Inject, - Input, - Output, -} from '@angular/core'; -import {TuiPickerService} from '@taiga-ui/addon-editor/services'; -import {TuiDestroyService} from '@taiga-ui/cdk'; -import {TuiPoint} from '@taiga-ui/core'; -import {Observable} from 'rxjs'; - -@Component({ - selector: 'tui-linear-picker', - templateUrl: './linear-picker.template.html', - styleUrls: ['./linear-picker.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [TuiDestroyService, TuiPickerService], -}) -export class TuiLinearPickerComponent { - @Input() - value = 0; - - @Output() - readonly valueChange = new EventEmitter(); - - constructor(@Inject(TuiPickerService) point$: Observable) { - point$.subscribe(([x]) => { - this.value = x; - this.valueChange.emit(x); - }); - } - - get left(): number { - return this.value * 100; - } -} diff --git a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.module.ts b/projects/addon-editor/components/color-selector/linear-picker/linear-picker.module.ts deleted file mode 100644 index 963d1f25acf8..000000000000 --- a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; - -import {TuiLinearPickerComponent} from './linear-picker.component'; - -@NgModule({ - imports: [CommonModule], - declarations: [TuiLinearPickerComponent], - exports: [TuiLinearPickerComponent], -}) -export class TuiLinearPickerModule {} diff --git a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.style.less b/projects/addon-editor/components/color-selector/linear-picker/linear-picker.style.less deleted file mode 100644 index 9625336ea738..000000000000 --- a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.style.less +++ /dev/null @@ -1,15 +0,0 @@ -:host { - position: relative; - display: block; - height: 1rem; - box-sizing: border-box; -} - -.t-circle { - position: absolute; - width: 1rem; - height: 1rem; - border-radius: 100%; - margin: 0 -0.5rem; - box-shadow: inset 0 0 0 2px var(--tui-base-01), 0 0 0 1px var(--tui-base-03); -} diff --git a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.template.html b/projects/addon-editor/components/color-selector/linear-picker/linear-picker.template.html deleted file mode 100644 index 6da3605fede3..000000000000 --- a/projects/addon-editor/components/color-selector/linear-picker/linear-picker.template.html +++ /dev/null @@ -1,4 +0,0 @@ -
diff --git a/projects/addon-editor/components/color-selector/ng-package.json b/projects/addon-editor/components/color-selector/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/color-selector/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/color-selector/palette/palette.component.ts b/projects/addon-editor/components/color-selector/palette/palette.component.ts deleted file mode 100644 index 468400de0518..000000000000 --- a/projects/addon-editor/components/color-selector/palette/palette.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {KeyValue} from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Input, - Output, -} from '@angular/core'; - -@Component({ - selector: 'tui-palette', - templateUrl: './palette.template.html', - styleUrls: ['./palette.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiPaletteComponent { - @Input() - colors: ReadonlyMap = new Map(); - - @Output() - readonly selectedColor = new EventEmitter(); - - originalOrder = ( - _a: KeyValue, - _b: KeyValue, - ): number => 0; -} diff --git a/projects/addon-editor/components/color-selector/palette/palette.module.ts b/projects/addon-editor/components/color-selector/palette/palette.module.ts deleted file mode 100644 index 81442f13a547..000000000000 --- a/projects/addon-editor/components/color-selector/palette/palette.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiHintModule} from '@taiga-ui/core'; - -import {TuiPaletteComponent} from './palette.component'; - -@NgModule({ - imports: [CommonModule, TuiHintModule], - declarations: [TuiPaletteComponent], - exports: [TuiPaletteComponent], -}) -export class TuiPaletteModule {} diff --git a/projects/addon-editor/components/color-selector/palette/palette.style.less b/projects/addon-editor/components/color-selector/palette/palette.style.less deleted file mode 100644 index eabd3edcc5b4..000000000000 --- a/projects/addon-editor/components/color-selector/palette/palette.style.less +++ /dev/null @@ -1,17 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - display: flex; - flex-wrap: wrap; - padding: 0.875rem; -} - -.t-button { - .clearbtn(); - width: 1.5625rem; - height: 1.5625rem; - box-sizing: border-box; - margin: 0.375rem; - border-radius: var(--tui-radius-m); - border: 1px solid rgba(0, 0, 0, 0.08); -} diff --git a/projects/addon-editor/components/color-selector/palette/palette.template.html b/projects/addon-editor/components/color-selector/palette/palette.template.html deleted file mode 100644 index 7b738a472c39..000000000000 --- a/projects/addon-editor/components/color-selector/palette/palette.template.html +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/projects/addon-editor/components/color-selector/test/color-selector.component.spec.ts b/projects/addon-editor/components/color-selector/test/color-selector.component.spec.ts deleted file mode 100644 index 90b02fcf34cc..000000000000 --- a/projects/addon-editor/components/color-selector/test/color-selector.component.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {Component, ViewChild} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {TuiColorSelectorComponent, TuiColorSelectorModule} from '@taiga-ui/addon-editor'; - -@Component({ - template: ` - - `, -}) -class TestComponent { - @ViewChild(TuiColorSelectorComponent) - component!: TuiColorSelectorComponent; - - colors = new Map([ - [`hap`, `#ff0000`], - [`ica`, `linear-gradient(red, blue)`], - ]); - - color = `#0000ff`; -} - -describe(`ColorSelector`, () => { - let fixture: ComponentFixture; - let testComponent: TestComponent; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [TuiColorSelectorModule, NoopAnimationsModule], - declarations: [TestComponent], - }); - - fixture = TestBed.createComponent(TestComponent); - testComponent = fixture.componentInstance; - fixture.detectChanges(); - }); - - it(`Parses color`, () => { - expect(testComponent.component.color).toEqual([0, 0, 255, 1]); - }); - - it(`Filters out gradients from palette`, () => { - expect(testComponent.component.palette.get(`hap`)).toBe(`#ff0000`); - expect(testComponent.component.palette.get(`ica`)).toBeUndefined(); - }); -}); diff --git a/projects/addon-editor/components/edit-link/edit-link.component.ts b/projects/addon-editor/components/edit-link/edit-link.component.ts deleted file mode 100644 index 368a4de12d1b..000000000000 --- a/projects/addon-editor/components/edit-link/edit-link.component.ts +++ /dev/null @@ -1,230 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - HostListener, - Inject, - Input, - Output, -} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import { - TUI_EDITOR_LINK_HASH_PREFIX, - TUI_EDITOR_LINK_HTTPS_PREFIX, - TuiEditorLinkPrefix, - TuiEditorLinkProtocol, -} from '@taiga-ui/addon-editor/constants'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - TUI_EDITOR_LINK_TEXTS, - TUI_EDITOR_OPTIONS, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiInjectionTokenType, tuiIsElement} from '@taiga-ui/cdk'; - -import {tuiEditLinkParseUrl} from './utils/edit-link-parse-url'; - -@Component({ - selector: 'tui-edit-link', - templateUrl: './edit-link.template.html', - styleUrls: ['./edit-link.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiEditLinkComponent { - private isOnlyAnchorMode: boolean = this.detectAnchorMode(); - - @Output() - readonly addLink = new EventEmitter(); - - @Output() - readonly removeLink = new EventEmitter(); - - url: string = this.getHrefOrAnchorId(); - - edit = !this.url; - - prefix: TuiEditorLinkPrefix = this.makeDefaultPrefix(); - - anchorIds = this.getAllAnchorsIds(); - - constructor( - @Inject(DOCUMENT) - private readonly doc: Document, - @Inject(TUI_EDITOR_LINK_TEXTS) - readonly texts$: TuiInjectionTokenType, - @Inject(TuiTiptapEditorService) private readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_OPTIONS) - private readonly options: TuiEditorOptions, - ) {} - - get defaultProtocol(): TuiEditorLinkProtocol { - return this.options.linkOptions?.protocol ?? TUI_EDITOR_LINK_HTTPS_PREFIX; - } - - @Input() - set anchorMode(mode: boolean) { - this.isOnlyAnchorMode = mode; - this.prefix = mode ? TUI_EDITOR_LINK_HASH_PREFIX : this.makeDefaultPrefix(); - } - - get anchorMode(): boolean { - return this.isOnlyAnchorMode; - } - - get prefixIsHashMode(): boolean { - return this.prefix === TUI_EDITOR_LINK_HASH_PREFIX; - } - - get hasUrl(): boolean { - return !!this.url; - } - - get href(): string { - return `${this.prefix}${this.url}`; - } - - get showAnchorsList(): boolean { - return !this.anchorMode && this.edit && this.anchorIds.length > 0; - } - - private get isViewMode(): boolean { - return !this.edit; - } - - @HostListener('document:selectionchange') - onSelectionChange(): void { - if (this.isViewMode) { - this.url = this.getHrefOrAnchorId(); - this.anchorMode = this.detectAnchorMode(); - } - } - - @HostListener('mousedown', ['$event']) - onMouseDown(event: MouseEvent): void { - if (tuiIsElement(event.target) && !event.target.matches('a, button, input')) { - event.preventDefault(); - } - } - - setAnchor(anchor: string): void { - this.url = anchor; - this.changePrefix(true); - } - - changePrefix(isPrefix: boolean): void { - this.prefix = isPrefix ? TUI_EDITOR_LINK_HASH_PREFIX : this.defaultProtocol; - } - - onSave(): void { - if (this.url) { - this.addLink.emit(this.href); - } else { - this.removeLink.emit(); - } - } - - onBackspace(): void { - if (!this.url) { - this.prefix = this.isOnlyAnchorMode - ? TUI_EDITOR_LINK_HASH_PREFIX - : this.defaultProtocol; - } - } - - onEdit(): void { - this.edit = true; - } - - onRemove(): void { - this.removeLink.emit(); - } - - onChange(url: string): void { - this.url = this.removePrefix(url); - } - - onClear(): void { - this.url = ''; - } - - private makeDefaultPrefix(): TuiEditorLinkPrefix { - const a = this.getAnchorElement(); - const defaultPrefix = - (tuiEditLinkParseUrl(a?.getAttribute('href') ?? '') - .prefix as TuiEditorLinkPrefix) || this.defaultProtocol; - - if (a) { - return (!a.getAttribute('href') && a.getAttribute('id')) || - a.getAttribute('href')?.startsWith(TUI_EDITOR_LINK_HASH_PREFIX) - ? TUI_EDITOR_LINK_HASH_PREFIX - : defaultPrefix; - } - - return defaultPrefix; - } - - private detectAnchorMode(): boolean { - const a = this.getAnchorElement(); - - return !a?.href && !!a?.getAttribute('id'); - } - - private getFocusedParentElement(): HTMLElement | null { - return this.doc.getSelection()?.focusNode?.parentElement || null; - } - - private getAnchorElement(): HTMLAnchorElement | null { - const focusable = this.getFocusedParentElement(); - - return ( - focusable?.closest('a') ?? - focusable?.querySelector('img')?.closest('a') ?? - null - ); - } - - private getHrefOrAnchorId(): string { - const a = this.getAnchorElement(); - - return a - ? this.removePrefix(a.getAttribute('href') || a.getAttribute('id') || '') - : this.url; - } - - private removePrefix(url: string): string { - const fullPath = - url.startsWith(TUI_EDITOR_LINK_HASH_PREFIX) || - this.prefix === TUI_EDITOR_LINK_HASH_PREFIX - ? url - : `${this.prefix ?? ''}${url}`; - - const {prefix, path} = tuiEditLinkParseUrl(fullPath); - const expectAnchorMode = - this.isOnlyAnchorMode || - prefix === TUI_EDITOR_LINK_HASH_PREFIX || - (prefix === '' && this.prefix === TUI_EDITOR_LINK_HASH_PREFIX); - - if (expectAnchorMode) { - this.prefix = TUI_EDITOR_LINK_HASH_PREFIX; - } else if (prefix === '') { - this.prefix = this.defaultProtocol; - } else { - this.prefix = prefix as TuiEditorLinkPrefix; - } - - return path; - } - - private getAllAnchorsIds(): string[] { - const nodes: Element[] = Array.from( - this.editor - .getOriginTiptapEditor() - .view.dom.querySelectorAll('[data-type="jump-anchor"]') ?? [], - ); - - return Array.from(nodes) - .map(node => node.getAttribute('id') || '') - .filter(Boolean); - } -} diff --git a/projects/addon-editor/components/edit-link/edit-link.module.ts b/projects/addon-editor/components/edit-link/edit-link.module.ts deleted file mode 100644 index 34692938107b..000000000000 --- a/projects/addon-editor/components/edit-link/edit-link.module.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {TuiAutoFocusModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiLinkModule, - TuiScrollbarModule, - TuiSvgModule, -} from '@taiga-ui/core'; -import {TuiInputInlineModule, TuiToggleModule} from '@taiga-ui/kit'; - -import {TuiEditLinkComponent} from './edit-link.component'; -import {TuiFilterAnchorsPipe} from './pipes/filter-anchors.pipe'; -import {TuiShortUrlPipe} from './pipes/short-url.pipe'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - TuiAutoFocusModule, - TuiButtonModule, - TuiSvgModule, - TuiLinkModule, - TuiInputInlineModule, - TuiToggleModule, - TuiScrollbarModule, - ], - declarations: [TuiEditLinkComponent, TuiShortUrlPipe, TuiFilterAnchorsPipe], - exports: [TuiEditLinkComponent], -}) -export class TuiEditLinkModule {} diff --git a/projects/addon-editor/components/edit-link/edit-link.style.less b/projects/addon-editor/components/edit-link/edit-link.style.less deleted file mode 100644 index 8f4bf4764d65..000000000000 --- a/projects/addon-editor/components/edit-link/edit-link.style.less +++ /dev/null @@ -1,98 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - display: block; - min-width: 18.75rem; -} - -.t-edit-link { - display: flex; - min-height: 4rem; - align-items: center; - padding-right: 0.75rem; -} - -.t-label { - font: var(--tui-font-text-s); - height: var(--tui-height-l); - box-sizing: border-box; - padding: 0.4375rem 1rem; - min-width: 12.5rem; - max-width: 25rem; - width: 100%; -} - -.t-label-properties { - display: flex; - align-items: center; - max-width: 8.375rem; - justify-content: space-between; -} - -.t-property_inactive { - opacity: 0.5; -} - -.t-url { - display: flex; - font: var(--tui-font-text-m); - color: var(--tui-text-02); -} - -.t-input { - flex: 1; - - &_filled { - color: var(--tui-text-01); - } -} - -.t-button { - width: 2rem; - height: 2rem; - margin: 0 @space; - transition: background 0.2s; -} - -.t-edit-button { - margin-left: auto; -} - -.t-link { - margin: 0 1rem; -} - -.t-cleaner { - .transition(color); - color: var(--tui-base-06); - cursor: pointer; - margin-left: auto; - - &:hover { - color: var(--tui-base-07); - } - - &_hidden { - visibility: hidden; - } -} - -.t-anchor-list { - display: flex; - max-height: 12.5rem; - flex-direction: column; -} - -.t-anchor { - .clearbtn(); - min-height: 2.75rem; - padding: 0.375rem 0.5rem; - margin: 0.125rem 0.5rem; - border-radius: var(--tui-radius-m); - text-align: left; - - &:hover { - background: var(--tui-base-02); - cursor: pointer; - } -} diff --git a/projects/addon-editor/components/edit-link/edit-link.template.html b/projects/addon-editor/components/edit-link/edit-link.template.html deleted file mode 100644 index 2964f09d7ae8..000000000000 --- a/projects/addon-editor/components/edit-link/edit-link.template.html +++ /dev/null @@ -1,98 +0,0 @@ - - - -
- -
- -
-
-
diff --git a/projects/addon-editor/components/edit-link/index.ts b/projects/addon-editor/components/edit-link/index.ts deleted file mode 100644 index 4c504f5d3aff..000000000000 --- a/projects/addon-editor/components/edit-link/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './edit-link.component'; -export * from './edit-link.module'; -export * from './pipes/filter-anchors.pipe'; -export * from './pipes/short-url.pipe'; -export * from './utils/edit-link-parse-url'; diff --git a/projects/addon-editor/components/edit-link/ng-package.json b/projects/addon-editor/components/edit-link/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/edit-link/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/edit-link/pipes/filter-anchors.pipe.ts b/projects/addon-editor/components/edit-link/pipes/filter-anchors.pipe.ts deleted file mode 100644 index 8f6d042a6602..000000000000 --- a/projects/addon-editor/components/edit-link/pipes/filter-anchors.pipe.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {Pipe, PipeTransform} from '@angular/core'; - -@Pipe({name: `tuiFilterAnchors`}) -export class TuiFilterAnchorsPipe implements PipeTransform { - transform(anchors: string[], prefix: string, currentUrl: string): string[] { - return prefix === `#` ? anchors.filter(anchor => anchor !== currentUrl) : anchors; - } -} diff --git a/projects/addon-editor/components/edit-link/pipes/short-url.pipe.ts b/projects/addon-editor/components/edit-link/pipes/short-url.pipe.ts deleted file mode 100644 index 7ae5bb5e5ea2..000000000000 --- a/projects/addon-editor/components/edit-link/pipes/short-url.pipe.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {Pipe, PipeTransform} from '@angular/core'; - -const MAX_LENGTH = 60; -const START = MAX_LENGTH - 20; -const END = MAX_LENGTH - START - 10; - -@Pipe({name: `tuiShortUrl`}) -export class TuiShortUrlPipe implements PipeTransform { - transform(url: string): string { - return url.length < MAX_LENGTH - ? url - : `${url.slice(0, Math.max(0, START))}...${url.slice(url.length - END)}`; - } -} diff --git a/projects/addon-editor/components/edit-link/test/edit-link-parse.spec.ts b/projects/addon-editor/components/edit-link/test/edit-link-parse.spec.ts deleted file mode 100644 index a4285577e684..000000000000 --- a/projects/addon-editor/components/edit-link/test/edit-link-parse.spec.ts +++ /dev/null @@ -1,143 +0,0 @@ -import {tuiEditLinkParseUrl} from '@taiga-ui/addon-editor'; - -describe(`tuiEditLinkParseUrl`, () => { - it(`mailto`, () => { - expect(tuiEditLinkParseUrl(`mailto:user1@example.com`)).toEqual({ - prefix: `mailto:`, - path: `user1@example.com`, - }); - - expect( - tuiEditLinkParseUrl( - `mailto:user1@example.com%2C%20user2@example.com?to=user3@example.com%2C%20user4@example.com`, - ), - ).toEqual({ - prefix: `mailto:`, - path: `user1@example.com%2C%20user2@example.com?to=user3@example.com%2C%20user4@example.com`, - }); - }); - - it(`custom protocol schema`, () => { - expect(tuiEditLinkParseUrl(`web+burger:Burger handler`)).toEqual({ - prefix: `web+burger:`, - path: `Burger handler`, - }); - }); - - it(`without protocol`, () => { - expect(tuiEditLinkParseUrl(`hello.com`)).toEqual({ - prefix: ``, - path: `hello.com`, - }); - - expect(tuiEditLinkParseUrl(``)).toEqual({prefix: ``, path: ``}); - }); - - it(`anchor`, () => { - expect(tuiEditLinkParseUrl(`#path-to-anchor`)).toEqual({ - prefix: `#`, - path: `path-to-anchor`, - }); - }); - - it(`custom value`, () => { - expect(tuiEditLinkParseUrl(`://hello.com`)).toEqual({ - prefix: `://`, - path: `hello.com`, - }); - - expect(tuiEditLinkParseUrl(`//hello.com`)).toEqual({ - prefix: ``, - path: `//hello.com`, - }); - - expect(tuiEditLinkParseUrl(`/hello.com/a/b/c`)).toEqual({ - prefix: ``, - path: `/hello.com/a/b/c`, - }); - }); - - it(`duplicate protocols`, () => { - expect(tuiEditLinkParseUrl(`http://tel:+79001111111`)).toEqual({ - prefix: `tel:`, - path: `+79001111111`, - }); - - expect(tuiEditLinkParseUrl(`https://ssh`)).toEqual({ - prefix: `https://`, - path: `ssh`, - }); - - expect(tuiEditLinkParseUrl(`https://ssh:`)).toEqual({ - prefix: `https://`, - path: `ssh:`, - }); - - expect(tuiEditLinkParseUrl(`https://ssh:/`)).toEqual({ - prefix: `ssh:`, - path: `/`, - }); - - expect(tuiEditLinkParseUrl(`https://ssh://`)).toEqual({ - prefix: `ssh://`, - path: ``, - }); - - expect(tuiEditLinkParseUrl(`https://ssh://abc`)).toEqual({ - prefix: `ssh://`, - path: `abc`, - }); - - expect(tuiEditLinkParseUrl(`https://a://b://c://d://e`)).toEqual({ - prefix: `d://`, - path: `e`, - }); - - expect(tuiEditLinkParseUrl(`a:b:c:d:e`)).toEqual({ - prefix: `d:`, - path: `e`, - }); - }); - - it(`URLs`, () => { - expect(tuiEditLinkParseUrl(`https://taiga-ui.dev`)).toEqual({ - prefix: `https://`, - path: `taiga-ui.dev`, - }); - - expect(tuiEditLinkParseUrl(`https://tinkoff-group.com/`)).toEqual({ - prefix: `https://`, - path: `tinkoff-group.com/`, - }); - - expect(tuiEditLinkParseUrl(`www.jsowl.com`)).toEqual({ - prefix: ``, - path: `www.jsowl.com`, - }); - - expect(tuiEditLinkParseUrl(`burgers.example.com/?burger=%s`)).toEqual({ - prefix: ``, - path: `burgers.example.com/?burger=%s`, - }); - - expect(tuiEditLinkParseUrl(`http://localhost:3333/editor/API`)).toEqual({ - prefix: `http://`, - path: `localhost:3333/editor/API`, - }); - - expect(tuiEditLinkParseUrl(`127.0.0.1:8080`)).toEqual({ - prefix: ``, - path: `127.0.0.1:8080`, - }); - - expect(tuiEditLinkParseUrl(`localhost:3333`)).toEqual({ - prefix: ``, - path: `localhost:3333`, - }); - - expect(tuiEditLinkParseUrl(`ftp://ftp.example:21`)).toEqual({ - prefix: `ftp://`, - path: `ftp.example:21`, - }); - }); -}); diff --git a/projects/addon-editor/components/edit-link/utils/edit-link-parse-url.ts b/projects/addon-editor/components/edit-link/utils/edit-link-parse-url.ts deleted file mode 100644 index 8001c13ba2c4..000000000000 --- a/projects/addon-editor/components/edit-link/utils/edit-link-parse-url.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { - TUI_EDITOR_LINK_HASH_PREFIX as HASH_PREFIX, - TUI_EDITOR_LINK_OSI_PROTOCOL_DIVIDER as OSI_PROTOCOL_DIVIDER, - TUI_EDITOR_LINK_SIMPLE_PROTOCOL_DIVIDER as SIMPLE_PROTOCOL_DIVIDER, -} from '@taiga-ui/addon-editor/constants'; -import {tuiIsValidUrl} from '@taiga-ui/cdk'; - -interface TuiEditLinkParsed { - prefix: string; - path: string; -} - -export function tuiEditLinkParseUrl(url: string = ``): TuiEditLinkParsed { - if (url.startsWith(HASH_PREFIX)) { - return {prefix: HASH_PREFIX, path: url.slice(1)}; - } - - const [prefix = ``, path = ``] = url.includes(OSI_PROTOCOL_DIVIDER) - ? splitOsiProtocol(url) - : splitSimpleProtocol(url); - - if (path.includes(SIMPLE_PROTOCOL_DIVIDER)) { - const [protocol, otherPart] = splitSimpleProtocol(path); - - if (protocol && otherPart) { - return {prefix: protocol, path: otherPart}; - } - } - - return {prefix, path: prefix === `` ? url : path}; -} - -function splitOsiProtocol(url: string = ``): Array { - const protocolPosition = url.indexOf(OSI_PROTOCOL_DIVIDER) ?? -1; - const [prefix, path] = - protocolPosition > -1 - ? [ - url.slice(0, protocolPosition + OSI_PROTOCOL_DIVIDER.length), - url.slice(protocolPosition + OSI_PROTOCOL_DIVIDER.length, url.length), - ] - : [``, url]; - const result = [prefix, path].filter(Boolean); - - return path?.includes(`://`) && result.length > 1 ? splitOsiProtocol(path) : result; -} - -function splitSimpleProtocol(url: string = ``): Array { - const [prefix, path] = url.split(/:/).slice(-2).filter(Boolean); - - return prefix && path && !tuiIsValidUrl(url) ? [`${prefix}:`, path] : []; -} diff --git a/projects/addon-editor/components/editor-resizable/editor-resizable.abstract.ts b/projects/addon-editor/components/editor-resizable/editor-resizable.abstract.ts deleted file mode 100644 index 3f1fec0e237b..000000000000 --- a/projects/addon-editor/components/editor-resizable/editor-resizable.abstract.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {Directive} from '@angular/core'; -import {TuiNodeViewNgComponent} from '@taiga-ui/addon-editor/extensions/tiptap-node-view'; -import {TuiDestroyService, tuiTypedFromEvent} from '@taiga-ui/cdk'; -import {merge} from 'rxjs'; -import {takeUntil} from 'rxjs/operators'; - -export interface TuiEditorResizableContainer { - width?: number | string | null; - height?: number | string | null; -} - -@Directive() -export abstract class AbstractTuiEditorResizable< - T extends TuiEditorResizableContainer, -> extends TuiNodeViewNgComponent { - protected _height = 0; - protected _width = 0; - - protected constructor( - protected readonly doc: Document, - protected readonly destroy$: TuiDestroyService, - ) { - super(); - - merge(tuiTypedFromEvent(doc, `touchend`), tuiTypedFromEvent(doc, `mouseup`)) - .pipe(takeUntil(destroy$)) - .subscribe(() => - this.updateAttributes({width: this.width, height: this.height}), - ); - } - - get attrs(): T { - return (this.node?.attrs as T) || {src: ``}; - } - - get width(): number | string | null { - return this._width || this.attrs.width || null; - } - - get height(): number | string | null { - return this._height || this.attrs.height || null; - } - - abstract updateSize([width, height]: readonly [width: number, height: number]): void; -} diff --git a/projects/addon-editor/components/editor-resizable/editor-resizable.component.html b/projects/addon-editor/components/editor-resizable/editor-resizable.component.html deleted file mode 100644 index f91eb9f4123a..000000000000 --- a/projects/addon-editor/components/editor-resizable/editor-resizable.component.html +++ /dev/null @@ -1,26 +0,0 @@ -
- - -
- -
- -
-
diff --git a/projects/addon-editor/components/editor-resizable/editor-resizable.component.less b/projects/addon-editor/components/editor-resizable/editor-resizable.component.less deleted file mode 100644 index 08febebba155..000000000000 --- a/projects/addon-editor/components/editor-resizable/editor-resizable.component.less +++ /dev/null @@ -1,62 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - position: relative; - display: inline-block; - box-sizing: border-box; - - .t-resizable { - box-sizing: border-box; - - &-auto-height { - height: auto !important; - } - } - - iframe { - display: inline; - pointer-events: none; - } - - &:hover .t-handle:after { - opacity: 1; - } -} - -.t-handle { - position: absolute; - top: 0; - display: flex; - width: 0.75rem; - cursor: col-resize; - justify-content: center; - align-items: center; - height: 100%; - - &:after { - .transition(opacity); - content: ''; - width: 50%; - height: 33%; - box-sizing: border-box; - border-radius: var(--tui-radius-m); - background: var(--tui-base-08); - border: 1px solid var(--tui-base-03); - opacity: 0; - } - - &-left-side { - left: 0; - } - - &-bottom-side { - top: unset; - bottom: 0.3125rem; - height: 0.95rem; - width: 100%; - } - - &-right-side { - right: 0; - } -} diff --git a/projects/addon-editor/components/editor-resizable/editor-resizable.component.ts b/projects/addon-editor/components/editor-resizable/editor-resizable.component.ts deleted file mode 100644 index 97591e1a8588..000000000000 --- a/projects/addon-editor/components/editor-resizable/editor-resizable.component.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - HostBinding, - Input, - Output, -} from '@angular/core'; -import {tuiIsNumber, tuiPx} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-resizable', - templateUrl: './editor-resizable.component.html', - styleUrls: ['./editor-resizable.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiEditorResizableComponent { - @Input() - autoHeight = false; - - @Input() - width: number | string | null = null; - - @Input() - height: number | string | null = null; - - @Output() - readonly sizeChange = new EventEmitter(); - - @HostBinding('style.width') - get hostWidth(): number | string | null { - return tuiIsNumber(this.width) ? tuiPx(this.width) : this.width; - } - - @HostBinding('style.height') - get hostHeight(): number | string | null { - if (this.autoHeight) { - return null; - } - - return tuiIsNumber(this.height) ? tuiPx(this.height) : this.height; - } -} diff --git a/projects/addon-editor/components/editor-resizable/editor-resizable.module.ts b/projects/addon-editor/components/editor-resizable/editor-resizable.module.ts deleted file mode 100644 index ed59ccfa1310..000000000000 --- a/projects/addon-editor/components/editor-resizable/editor-resizable.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiResizeModule, TuiResizerModule} from '@taiga-ui/cdk'; - -import {TuiEditorResizableComponent} from './editor-resizable.component'; - -@NgModule({ - imports: [CommonModule, TuiResizeModule, TuiResizerModule], - declarations: [TuiEditorResizableComponent], - exports: [TuiEditorResizableComponent], -}) -export class TuiEditorResizableModule {} diff --git a/projects/addon-editor/components/editor-resizable/index.ts b/projects/addon-editor/components/editor-resizable/index.ts deleted file mode 100644 index 9a3ba19b103f..000000000000 --- a/projects/addon-editor/components/editor-resizable/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './editor-resizable.abstract'; -export * from './editor-resizable.component'; -export * from './editor-resizable.module'; diff --git a/projects/addon-editor/components/editor-resizable/ng-package.json b/projects/addon-editor/components/editor-resizable/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/editor-resizable/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/editor-socket/editor-socket.component.less b/projects/addon-editor/components/editor-socket/editor-socket.component.less deleted file mode 100644 index 77729dcf11fa..000000000000 --- a/projects/addon-editor/components/editor-socket/editor-socket.component.less +++ /dev/null @@ -1,35 +0,0 @@ -.tui-editor-socket { - display: block; - margin: 0; - color: var(--tui-text-01); - font: var(--tui-font-text-m); - - &[tuiTiptapEditor] { - overflow: hidden; - } - - .ProseMirror { - min-height: 5.375rem; - padding: 0.2rem 1rem; - outline: none; - white-space: pre-wrap; - } - - /* stylelint-disable-next-line */ - .resize-cursor { - cursor: ew-resize; - cursor: col-resize; - } - - /* stylelint-disable */ - @import './styles/text.less'; - @import './styles/link.less'; - @import './styles/list.less'; - @import './styles/media.less'; - @import './styles/placeholder.less'; - @import './styles/table.less'; - @import './styles/details.less'; - @import './styles/code-blocks.less'; - @import './styles/groups.less'; - /* stylelint-enable */ -} diff --git a/projects/addon-editor/components/editor-socket/editor-socket.component.ts b/projects/addon-editor/components/editor-socket/editor-socket.component.ts deleted file mode 100644 index c61fe89afd30..000000000000 --- a/projects/addon-editor/components/editor-socket/editor-socket.component.ts +++ /dev/null @@ -1,78 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, - ElementRef, - HostListener, - Inject, - Input, - Optional, - Renderer2, - Sanitizer, - SecurityContext, - ViewEncapsulation, -} from '@angular/core'; -import {TuiTiptapEditorDirective} from '@taiga-ui/addon-editor/directives/tiptap-editor'; -import {tuiIsElement} from '@taiga-ui/cdk'; -import {TUI_SANITIZER} from '@taiga-ui/core'; - -@Component({ - selector: 'tui-editor-socket', - template: '', - styleUrls: ['./editor-socket.component.less'], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - host: { - class: 'tui-editor-socket', - }, -}) -export class TuiEditorSocketComponent { - @Input() - set content(content: string) { - this.renderer.setProperty( - this.el.nativeElement, - 'innerHTML', - this.tuiSanitizer - ? this.tuiSanitizer.sanitize( - SecurityContext.HTML, - content.replace(/colwidth/g, 'width'), - ) - : this.sanitizer.sanitize(SecurityContext.HTML, content), - ); - } - - constructor( - @Inject(ElementRef) private readonly el: ElementRef, - @Inject(Renderer2) private readonly renderer: Renderer2, - @Inject(Sanitizer) private readonly sanitizer: Sanitizer, - @Optional() - @Inject(TUI_SANITIZER) - private readonly tuiSanitizer: Sanitizer | null, - @Inject(DOCUMENT) - private readonly document: Document, - @Optional() - @Inject(TuiTiptapEditorDirective) - private readonly editor: TuiTiptapEditorDirective | null, - ) {} - - /** - * @description: - * the main problem is that the external environment editor can use different base href="../" - * More information: https://rogerkeays.com/blog/using-base-href-with-anchors - */ - @HostListener('click', ['$event']) - click(event: Event): void { - if (this.editor || !tuiIsElement(event.target)) { - return; - } - - const href = event.target?.closest('a')?.getAttribute('href') || ''; - - if (!href.startsWith('#')) { - return; - } - - this.document.location.hash = href.replace('#', ''); - event.preventDefault(); - } -} diff --git a/projects/addon-editor/components/editor-socket/editor-socket.module.ts b/projects/addon-editor/components/editor-socket/editor-socket.module.ts deleted file mode 100644 index 88fb9f70afaf..000000000000 --- a/projects/addon-editor/components/editor-socket/editor-socket.module.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {NgModule} from '@angular/core'; - -import {TuiEditorSocketComponent} from './editor-socket.component'; - -@NgModule({ - declarations: [TuiEditorSocketComponent], - exports: [TuiEditorSocketComponent], -}) -export class TuiEditorSocketModule {} diff --git a/projects/addon-editor/components/editor-socket/index.ts b/projects/addon-editor/components/editor-socket/index.ts deleted file mode 100644 index bea55796ecfb..000000000000 --- a/projects/addon-editor/components/editor-socket/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './editor-socket.component'; -export * from './editor-socket.module'; diff --git a/projects/addon-editor/components/editor-socket/ng-package.json b/projects/addon-editor/components/editor-socket/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/editor-socket/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/editor-socket/styles/code-blocks.less b/projects/addon-editor/components/editor-socket/styles/code-blocks.less deleted file mode 100644 index 7da623a54701..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/code-blocks.less +++ /dev/null @@ -1,12 +0,0 @@ -@import 'taiga-ui-local'; - -pre { - white-space: pre-wrap; - word-break: break-word; - border-radius: 0.25rem; - margin: 1rem 0; - padding: 0.75rem 1rem; - font-family: Courier, monospace; - color: var(--tui-text-02); - background: var(--tui-base-02); -} diff --git a/projects/addon-editor/components/editor-socket/styles/details.less b/projects/addon-editor/components/editor-socket/styles/details.less deleted file mode 100644 index f64bb7ca1d94..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/details.less +++ /dev/null @@ -1,111 +0,0 @@ -@import 'taiga-ui-local'; - -// TODO: drop in v4.0 classes without prefix `t-` -summary { - display: flex; - align-items: center; - min-height: 3.5rem; - width: 100%; - padding: 0 1.25rem; - box-sizing: border-box; - border-radius: var(--tui-radius-l); - pointer-events: none; - outline: none; - - &:focus-visible { - outline: 2px solid var(--tui-link); - } - - p { - min-width: 1px; - margin: 0; - } - - &::-webkit-details-marker { - display: none; - } -} - -details[open] summary { - border-radius: var(--tui-radius-l) var(--tui-radius-l) 0 0; -} - -/* stylelint-disable-next-line */ -.details-arrow, -.t-details-arrow { - position: absolute; - top: 1.5rem; - right: 1.25rem; - height: 0.575rem; - width: 0.575rem; - border: 1px solid var(--tui-base-06); - border-width: 0 2px 2px 0; - transform: rotate(45deg); - transition: var(--tui-duration, 0.3s); - appearance: none; - box-sizing: border-box; - padding: 0; - background: none; - cursor: pointer; - outline: none; -} - -details { - width: 100%; - border: 1px solid var(--tui-base-04); - border-radius: var(--tui-radius-l); -} - -div[data-type='details-content'] { - padding: 1.25rem; - min-height: 3rem; - border: 1px solid var(--tui-base-04); - border-width: 1px 0 0; - - // Prevents extra margin between - // top border of details and content - h1:first-child, - h2:first-child, - pre:first-child, - ul:first-child, - ol:first-child, - ol li:first-child, - ul li:first-child { - margin-top: 0; - } -} - -/* stylelint-disable-next-line */ -.details-wrapper, -.t-details-wrapper { - .tui-space(bottom, 2); - position: relative; - display: flex; -} - -/* stylelint-disable-next-line */ -.details-wrapper_rendered, -.t-details-wrapper_rendered { - /* stylelint-disable-next-line */ - .details-arrow, - .t-details-arrow { - pointer-events: none; - } - - summary { - transition: transform var(--tui-duration, 0.3s); - cursor: pointer; - pointer-events: auto; - - &:hover { - background: var(--tui-base-02); - } - } -} - -/* stylelint-disable-next-line */ -details[open] + .details-arrow, -details[open] + .t-details-arrow { - top: 1.75rem; - transform: rotate(225deg); -} diff --git a/projects/addon-editor/components/editor-socket/styles/groups.less b/projects/addon-editor/components/editor-socket/styles/groups.less deleted file mode 100644 index 65a9150f3c96..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/groups.less +++ /dev/null @@ -1,29 +0,0 @@ -@import 'taiga-ui-local'; - -.tui-group-node { - display: flex; - flex-direction: row; -} - -.tui-group-node:hover > .tui-group-pointer { - pointer-events: auto; - opacity: 1; -} - -.tui-group-pointer { - opacity: 0; - min-height: 0.8125rem; - max-height: 0.8125rem; - min-width: 0.8125rem; - max-width: 0.8125rem; - margin: 0.3125rem 0.3125rem 0 0; - cursor: grab; - background-image: url('data:image/svg+xml;charset=UTF-8,'); - background-repeat: no-repeat; - background-size: contain; - background-position: center; -} - -[data-mode='onDark'] .tui-group-pointer { - background-image: url('data:image/svg+xml;charset=UTF-8,'); -} diff --git a/projects/addon-editor/components/editor-socket/styles/link.less b/projects/addon-editor/components/editor-socket/styles/link.less deleted file mode 100644 index bffc1d41fd7f..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/link.less +++ /dev/null @@ -1,36 +0,0 @@ -@import 'taiga-ui-local'; - -a:not([data-type='jump-anchor']) { - color: var(--tui-link); - text-decoration: none; - outline: none; - - &:hover { - color: var(--tui-link-hover); - text-decoration: underline; - } - - &:active { - color: var(--tui-primary-active); - } -} - -.ProseMirror { - a[data-type='jump-anchor'] { - text-decoration: underline; - text-decoration-color: var(--tui-link); - - &:before { - content: '#'; - } - - &:hover { - color: var(--tui-link); - } - } - - a:hover img[contenteditable='false'] { - cursor: pointer; - outline: 0.25rem solid var(--tui-link); - } -} diff --git a/projects/addon-editor/components/editor-socket/styles/list.less b/projects/addon-editor/components/editor-socket/styles/list.less deleted file mode 100644 index b5887c85ca4b..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/list.less +++ /dev/null @@ -1,71 +0,0 @@ -@import 'taiga-ui-local'; - -ul, -ol { - list-style-type: none; - margin: 1rem 1rem 1rem 1.5rem; - padding: 0; -} - -li { - margin: 1rem 0; -} - -li > p { - display: inline; - margin: 0 auto; - word-break: break-word; -} - -ul li > p { - display: block; -} - -li:before { - unicode-bidi: isolate; - font-variant-numeric: tabular-nums; - text-transform: none; - text-indent: 0; - text-align: start; - text-align-last: start; -} - -ul > li:before { - content: ''; - display: inline-block; - width: 0.5rem; - height: 0.5rem; - border-radius: 100%; - margin: 0.5rem 0.875rem 0.0625rem -1.375rem; - background-color: var(--tui-primary); - vertical-align: top; - box-sizing: border-box; - float: left; -} - -li ul > li:before { - background: none; - border: 0.125rem solid var(--tui-primary); -} - -li ul > li > ul > li:before { - background: var(--tui-primary); - border-radius: 0; - width: 0.375rem; - height: 0.375rem; -} - -ol { - counter-reset: item; -} - -ol > li:before { - content: counters(item, '.') '.'; - display: block; - margin: 0 0.75rem 0 -1.5rem; - counter-increment: item; - color: var(--tui-base-05); - vertical-align: top; - float: left; - white-space: nowrap; -} diff --git a/projects/addon-editor/components/editor-socket/styles/media.less b/projects/addon-editor/components/editor-socket/styles/media.less deleted file mode 100644 index ac86b315e873..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/media.less +++ /dev/null @@ -1,16 +0,0 @@ -@import 'taiga-ui-local'; - -&._preview-image img { - cursor: pointer; -} - -.ProseMirror { - video, - audio { - pointer-events: none; - } -} - -img.ProseMirror-selectednode { - outline: 0.25rem solid var(--tui-primary-hover); -} diff --git a/projects/addon-editor/components/editor-socket/styles/placeholder.less b/projects/addon-editor/components/editor-socket/styles/placeholder.less deleted file mode 100644 index 77856a695b99..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/placeholder.less +++ /dev/null @@ -1,9 +0,0 @@ -@import 'taiga-ui-local'; - -.t-editor-placeholder:before { - content: attr(data-placeholder); - float: left; - color: var(--tui-base-05); - pointer-events: none; - height: 0; -} diff --git a/projects/addon-editor/components/editor-socket/styles/table.less b/projects/addon-editor/components/editor-socket/styles/table.less deleted file mode 100644 index c419ee15bb7e..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/table.less +++ /dev/null @@ -1,79 +0,0 @@ -@import 'taiga-ui-local'; - -table { - border-collapse: collapse; - table-layout: fixed; - width: 100%; - margin: 0; - overflow: hidden; -} - -/* stylelint-disable-next-line */ -table .tableWrapper { - overflow-x: auto; -} - -/* stylelint-disable-next-line */ -.tableWrapper, -.tui-table-wrapper { - overflow-x: auto; -} - -table td { - position: relative; - min-width: 1em; - height: 2rem; - border: 2px solid var(--tui-base-03); - padding: 3px 5px; - vertical-align: top; - box-sizing: border-box; - word-break: break-word; -} - -table th { - position: relative; - min-width: 1em; - height: 2rem; - border: 2px solid var(--tui-base-03); - padding: 3px 5px; - vertical-align: top; - box-sizing: border-box; - word-break: break-word; - font-weight: bold; - text-align: left; - background-color: var(--tui-base-02); - min-height: 2rem; -} - -/* stylelint-disable-next-line */ -table .column-resize-handle { - position: absolute; - right: -2px; - top: 0; - bottom: -2px; - width: 4px; - background-color: #adf; - pointer-events: none; -} - -table td > * { - margin-top: 0; - margin-bottom: 0; -} - -table th > * { - margin-top: 0; - margin-bottom: 0; -} - -/* stylelint-disable-next-line */ -.selectedCell:after { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: var(--tui-selection); - pointer-events: none; -} diff --git a/projects/addon-editor/components/editor-socket/styles/text.less b/projects/addon-editor/components/editor-socket/styles/text.less deleted file mode 100644 index 867d2f85093e..000000000000 --- a/projects/addon-editor/components/editor-socket/styles/text.less +++ /dev/null @@ -1,66 +0,0 @@ -@import 'taiga-ui-local'; - -h1, -h2, -h3, -h4, -h5, -h6 { - word-break: break-word; - line-height: normal; -} - -// Prevents extra margin when tui-editor-socket is combined -// with components like tui-radio-labeled or tui-checkbox-labeled -h1:first-child, -h2:first-child, -p:last-child { - margin-bottom: 0; -} - -p:last-child, -pre:last-child { - margin-bottom: 0; -} - -p:empty:after { - content: ' '; - white-space: pre; -} - -p:first-child { - margin-top: 0; -} - -p { - margin: 1rem 0; -} - -p > span { - line-height: initial; -} - -blockquote { - margin: 1.25rem 0 1.25rem 1.5rem; - padding-left: 1.0625rem; - border-left: 1px solid var(--tui-base-04); -} - -hr { - border: none; - border-top: 1px solid var(--tui-base-03); - margin: 1rem 0; -} - -mark { - background: unset; - color: inherit; -} - -font[face='Courier New'] { - display: inline-block; - padding: 0.25rem 0.5rem; - border-radius: 0.25rem; - background-color: #ecf1f7; - word-break: break-word; -} diff --git a/projects/addon-editor/components/editor/editor.component.html b/projects/addon-editor/components/editor/editor.component.html deleted file mode 100644 index 08f372ab0679..000000000000 --- a/projects/addon-editor/components/editor/editor.component.html +++ /dev/null @@ -1,68 +0,0 @@ -
-
- - - -
- -
-
- {{ exampleText }} -
-
- - -
- -
- - - - - - -
-
diff --git a/projects/addon-editor/components/editor/editor.component.less b/projects/addon-editor/components/editor/editor.component.less deleted file mode 100644 index d7de44891f7c..000000000000 --- a/projects/addon-editor/components/editor/editor.component.less +++ /dev/null @@ -1,62 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - .createStackingContext(); - display: block; - font: var(--tui-font-text-m); - border-radius: var(--tui-radius-m); - max-height: inherit; - min-height: 10rem; - box-sizing: border-box; -} - -.t-wrapper { - display: flex; - max-height: inherit; - min-height: inherit; - cursor: text; - overflow: hidden; - flex-direction: column; - border-radius: inherit; -} - -.t-placeholder { - .textfield-placeholder(); - margin: 1rem 1rem -1rem; - min-height: 1.625rem; - width: 95%; - font-size: 0.9375rem; - - &_raised { - width: 110%; - } - - &:empty { - min-height: 0.8rem; - } -} - -.t-example-text { - position: absolute; - left: 1rem; - margin-top: 1.6rem; - color: var(--tui-base-06); - letter-spacing: normal; - text-transform: none; - - &_light { - color: var(--tui-text-03-night); - } - - &_dark { - color: var(--tui-text-03); - } -} - -.t-scrollbar { - display: flex; - border-bottom: 0.3125rem solid transparent; - padding-bottom: 1.3125rem; - box-sizing: border-box; - flex: 1; -} diff --git a/projects/addon-editor/components/editor/editor.component.ts b/projects/addon-editor/components/editor/editor.component.ts deleted file mode 100644 index c12877f2bede..000000000000 --- a/projects/addon-editor/components/editor/editor.component.ts +++ /dev/null @@ -1,235 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import { - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - ElementRef, - EventEmitter, - Inject, - Input, - OnDestroy, - Optional, - Output, - Self, - ViewChild, -} from '@angular/core'; -import {NgControl} from '@angular/forms'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiToolbarComponent} from '@taiga-ui/addon-editor/components/toolbar'; -import {defaultEditorTools} from '@taiga-ui/addon-editor/constants'; -import { - TuiTiptapEditorDirective, - TuiTiptapEditorService, -} from '@taiga-ui/addon-editor/directives'; -import {TuiEditorTool} from '@taiga-ui/addon-editor/enums'; -import {TuiEditorAttachedFile} from '@taiga-ui/addon-editor/interfaces'; -import { - TIPTAP_EDITOR, - TUI_EDITOR_CONTENT_PROCESSOR, - TUI_EDITOR_OPTIONS, - TUI_EDITOR_VALUE_TRANSFORMER, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import {tuiIsSafeLinkRange} from '@taiga-ui/addon-editor/utils'; -import { - AbstractTuiControl, - AbstractTuiValueTransformer, - ALWAYS_FALSE_HANDLER, - tuiAsFocusableItemAccessor, - tuiAutoFocusOptionsProvider, - TuiBooleanHandler, - TuiFocusableElementAccessor, - TuiStringHandler, -} from '@taiga-ui/cdk'; -import {TUI_ANIMATIONS_DEFAULT_DURATION} from '@taiga-ui/core'; -import {Editor} from '@tiptap/core'; -import {Observable} from 'rxjs'; -import {delay, takeUntil} from 'rxjs/operators'; - -import {TUI_EDITOR_PROVIDERS} from './editor.providers'; - -@Component({ - selector: 'tui-editor', - templateUrl: './editor.component.html', - styleUrls: ['./editor.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - tuiAsFocusableItemAccessor(TuiEditorComponent), - tuiAutoFocusOptionsProvider({delay: TUI_ANIMATIONS_DEFAULT_DURATION}), - TUI_EDITOR_PROVIDERS, - ], -}) -export class TuiEditorComponent - extends AbstractTuiControl - implements OnDestroy, TuiFocusableElementAccessor -{ - @ViewChild(TuiTiptapEditorDirective, {read: ElementRef}) - private readonly el?: ElementRef; - - @Input() - exampleText = ''; - - @Input() - tools: readonly TuiEditorTool[] = defaultEditorTools; - - @Output() - readonly fileAttached = new EventEmitter>>(); - - @ViewChild(TuiToolbarComponent) - readonly toolbar?: TuiToolbarComponent; - - focused = false; - - constructor( - @Optional() - @Self() - @Inject(NgControl) - control: NgControl | null, - @Inject(ChangeDetectorRef) cdr: ChangeDetectorRef, - @Inject(TIPTAP_EDITOR) readonly editorLoaded$: Observable, - @Inject(TuiTiptapEditorService) readonly editorService: AbstractTuiEditor, - @Inject(TUI_EDITOR_CONTENT_PROCESSOR) - private readonly contentProcessor: TuiStringHandler, - @Inject(DOCUMENT) - private readonly doc: Document, - @Optional() - @Inject(TUI_EDITOR_VALUE_TRANSFORMER) - transformer: AbstractTuiValueTransformer | null, - @Inject(TUI_EDITOR_OPTIONS) private readonly options: TuiEditorOptions, - ) { - super(control, cdr, transformer); - - this.editorLoaded$ - .pipe(delay(0), takeUntil(this.destroy$)) - .subscribe(() => this.patchContentEditableElement()); - } - - get nativeFocusableElement(): HTMLDivElement | null { - return this.computedDisabled - ? null - : this.el?.nativeElement?.querySelector('[contenteditable].ProseMirror') || - null; - } - - get dropdownSelectionHandler(): TuiBooleanHandler { - return this.focused ? this.isSelectionLink : ALWAYS_FALSE_HANDLER; - } - - get editor(): AbstractTuiEditor | null { - return this.editorService.getOriginTiptapEditor() ? this.editorService : null; - } - - get placeholderRaised(): boolean { - return (this.computedFocused && !this.readOnly) || this.hasValue; - } - - get hasExampleText(): boolean { - return ( - !!this.exampleText && this.computedFocused && !this.hasValue && !this.readOnly - ); - } - - override writeValue(value: string | null): void { - if (value === this.value) { - return; - } - - const processed = this.contentProcessor(value || ''); - - super.writeValue(processed); - - if (processed !== value) { - this.control?.setValue(processed, { - onlySelf: false, - emitEvent: false, - emitModelToViewChange: false, - emitViewToModelChange: false, - }); - } - } - - onActiveZone(focused: boolean): void { - this.focused = focused; - this.updateFocused(focused); - this.control?.updateValueAndValidity(); - } - - onModelChange(value: string): void { - this.value = value; - } - - addAnchor(anchor: string): void { - this.editor?.setAnchor(anchor); - } - - removeAnchor(): void { - this.editor?.removeAnchor(); - } - - addLink(link: string): void { - this.editor?.selectClosest(); - this.editor?.setLink(link); - } - - removeLink(): void { - this.editor?.unsetLink(); - } - - focus(event: MouseEvent): void { - if (this.nativeFocusableElement?.contains(event.target as Node | null)) { - return; - } - - event.preventDefault(); - this.nativeFocusableElement?.focus(); - } - - override ngOnDestroy(): void { - this.editor?.destroy(); - } - - protected getFallbackValue(): string { - return ''; - } - - private readonly isSelectionLink = (range: Range): boolean => - this.currentFocusedNodeIsTextAnchor(range) || - this.currentFocusedNodeIsImageAnchor; - - /** - * @description: - * The commonAncestorContainer not always relevant node element in Range, - * so the focusNode is used for the correct behaviour from the selection, - * which is the actual element at the moment - */ - private currentFocusedNodeIsTextAnchor(range: Range): boolean { - return ( - !!range.startContainer.parentElement - ?.closest('a') - ?.contains(this.focusNode) && tuiIsSafeLinkRange(range) - ); - } - - private get focusNode(): Node | null { - return this.doc.getSelection()?.focusNode ?? null; - } - - private get hasValue(): boolean { - return !!this.value; - } - - private get currentFocusedNodeIsImageAnchor(): boolean { - return ( - this.focusNode?.nodeName === 'A' && - ['IMG', 'TUI-IMAGE-EDITOR'].includes(this.focusNode?.childNodes[0]?.nodeName) - ); - } - - private patchContentEditableElement(): void { - this.nativeFocusableElement?.setAttribute('translate', this.options.translate); - this.nativeFocusableElement?.setAttribute( - 'spellcheck', - String(this.options.spellcheck), - ); - } -} diff --git a/projects/addon-editor/components/editor/editor.module.ts b/projects/addon-editor/components/editor/editor.module.ts deleted file mode 100644 index bcee1b5ea5fc..000000000000 --- a/projects/addon-editor/components/editor/editor.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiEditLinkModule} from '@taiga-ui/addon-editor/components/edit-link'; -import {TuiEditorSocketModule} from '@taiga-ui/addon-editor/components/editor-socket'; -import {TuiToolbarModule} from '@taiga-ui/addon-editor/components/toolbar'; -import {TuiTiptapEditorModule} from '@taiga-ui/addon-editor/directives'; -import {TuiActiveZoneModule, TuiItemDirective} from '@taiga-ui/cdk'; -import {TuiDropdownModule, TuiScrollbarModule, TuiWrapperModule} from '@taiga-ui/core'; - -import {TuiEditorComponent} from './editor.component'; -import {TuiEditorPortalDirective} from './portal/editor-portal.directive'; -import {TuiEditorPortalHostComponent} from './portal/editor-portal-host.component'; - -@NgModule({ - declarations: [ - TuiEditorComponent, - TuiEditorPortalHostComponent, - TuiEditorPortalDirective, - ], - imports: [ - CommonModule, - TuiToolbarModule, - TuiWrapperModule, - TuiScrollbarModule, - TuiEditLinkModule, - TuiActiveZoneModule, - TuiDropdownModule, - TuiTiptapEditorModule, - TuiEditorSocketModule, - ], - exports: [TuiEditorComponent, TuiItemDirective], -}) -export class TuiEditorModule {} diff --git a/projects/addon-editor/components/editor/editor.providers.ts b/projects/addon-editor/components/editor/editor.providers.ts deleted file mode 100644 index a4b039969612..000000000000 --- a/projects/addon-editor/components/editor/editor.providers.ts +++ /dev/null @@ -1,66 +0,0 @@ -import {Renderer2} from '@angular/core'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - INITIALIZATION_TIPTAP_CONTAINER, - LAZY_EDITOR_EXTENSIONS, - LAZY_TIPTAP_EDITOR, - TIPTAP_EDITOR, - TUI_EDITOR_EXTENSIONS, -} from '@taiga-ui/addon-editor/tokens'; -import type {Extension, Mark, Node} from '@tiptap/core'; -import {Editor} from '@tiptap/core'; -import {combineLatest, Observable, ReplaySubject} from 'rxjs'; -import {map, shareReplay, take} from 'rxjs/operators'; - -import {TuiEditorPortalService} from './portal/editor-portal.service'; - -export const TUI_EDITOR_PROVIDERS = [ - { - provide: LAZY_EDITOR_EXTENSIONS, - deps: [TUI_EDITOR_EXTENSIONS], - useFactory: ( - extensions: Array>, - ): Observable> => { - const extensions$ = new ReplaySubject>( - 1, - ); - - // eslint-disable-next-line @typescript-eslint/no-floating-promises - Promise.all(extensions).then(extensions => extensions$.next(extensions)); - - return extensions$; - }, - }, - { - provide: INITIALIZATION_TIPTAP_CONTAINER, - deps: [Renderer2], - useFactory: (renderer: Renderer2): HTMLElement => renderer.createElement(`div`), - }, - { - provide: TIPTAP_EDITOR, - deps: [ - INITIALIZATION_TIPTAP_CONTAINER, - LAZY_EDITOR_EXTENSIONS, - LAZY_TIPTAP_EDITOR, - ], - useFactory: ( - element: HTMLElement, - extensions: Observable>, - editor: Observable, - ): Observable => { - return combineLatest([editor, extensions]).pipe( - take(1), - map( - ([LazyEditor, extensions]) => - new LazyEditor({ - element, - extensions, - }), - ), - shareReplay({bufferSize: 1, refCount: true}), - ); - }, - }, - TuiTiptapEditorService, - TuiEditorPortalService, -]; diff --git a/projects/addon-editor/components/editor/index.ts b/projects/addon-editor/components/editor/index.ts deleted file mode 100644 index 453933bf5468..000000000000 --- a/projects/addon-editor/components/editor/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './editor.component'; -export * from './editor.module'; -export * from './editor.providers'; -export * from './portal/editor-portal.directive'; -export * from './portal/editor-portal.service'; -export * from './portal/editor-portal-host.component'; diff --git a/projects/addon-editor/components/editor/ng-package.json b/projects/addon-editor/components/editor/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/editor/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/editor/portal/editor-portal-host.component.ts b/projects/addon-editor/components/editor/portal/editor-portal-host.component.ts deleted file mode 100644 index d2c87c62d6b8..000000000000 --- a/projects/addon-editor/components/editor/portal/editor-portal-host.component.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {ChangeDetectionStrategy, Component} from '@angular/core'; -import { - AbstractTuiPortalHostComponent, - AbstractTuiPortalService, - TuiDropdownPortalService, -} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-portal-host', - template: ` - - `, - styleUrls: ['./editor-portal-host.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - {provide: AbstractTuiPortalService, useExisting: TuiDropdownPortalService}, - { - provide: AbstractTuiPortalHostComponent, - useExisting: TuiEditorPortalHostComponent, - }, - ], -}) -export class TuiEditorPortalHostComponent extends AbstractTuiPortalHostComponent {} diff --git a/projects/addon-editor/components/editor/portal/editor-portal-host.style.less b/projects/addon-editor/components/editor/portal/editor-portal-host.style.less deleted file mode 100644 index f43da74c6476..000000000000 --- a/projects/addon-editor/components/editor/portal/editor-portal-host.style.less +++ /dev/null @@ -1,6 +0,0 @@ -:host { - position: relative; - z-index: 1; - display: block; - height: 100%; -} diff --git a/projects/addon-editor/components/editor/portal/editor-portal.directive.ts b/projects/addon-editor/components/editor/portal/editor-portal.directive.ts deleted file mode 100644 index c7f32d5fbdd3..000000000000 --- a/projects/addon-editor/components/editor/portal/editor-portal.directive.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Directive, ElementRef, Inject} from '@angular/core'; -import {TuiDropdownPortalService} from '@taiga-ui/cdk'; -import {tuiAsViewport, TuiRectAccessor} from '@taiga-ui/core'; - -import {TuiEditorPortalService} from './editor-portal.service'; - -@Directive({ - selector: '[tuiEditorPortal]', - providers: [ - {provide: TuiDropdownPortalService, useExisting: TuiEditorPortalService}, - tuiAsViewport(TuiEditorPortalDirective), - ], -}) -export class TuiEditorPortalDirective extends TuiRectAccessor { - readonly type = 'viewport'; - - constructor(@Inject(ElementRef) private readonly el: ElementRef) { - super(); - } - - getClientRect(): ClientRect { - return this.el.nativeElement.getBoundingClientRect(); - } -} diff --git a/projects/addon-editor/components/editor/portal/editor-portal.service.ts b/projects/addon-editor/components/editor/portal/editor-portal.service.ts deleted file mode 100644 index 228a267a6d91..000000000000 --- a/projects/addon-editor/components/editor/portal/editor-portal.service.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {Injectable} from '@angular/core'; -import {AbstractTuiPortalService} from '@taiga-ui/cdk'; - -@Injectable() -export class TuiEditorPortalService extends AbstractTuiPortalService {} diff --git a/projects/addon-editor/components/index.ts b/projects/addon-editor/components/index.ts deleted file mode 100644 index d4e4f71dbdf8..000000000000 --- a/projects/addon-editor/components/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from '@taiga-ui/addon-editor/components/color-selector'; -export * from '@taiga-ui/addon-editor/components/edit-link'; -export * from '@taiga-ui/addon-editor/components/editor'; -export * from '@taiga-ui/addon-editor/components/editor-resizable'; -export * from '@taiga-ui/addon-editor/components/editor-socket'; -export * from '@taiga-ui/addon-editor/components/input-color'; -export * from '@taiga-ui/addon-editor/components/toolbar'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools'; diff --git a/projects/addon-editor/components/input-color/index.ts b/projects/addon-editor/components/input-color/index.ts deleted file mode 100644 index 0f2b5ec9db9c..000000000000 --- a/projects/addon-editor/components/input-color/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './input-color.component'; -export * from './input-color.module'; diff --git a/projects/addon-editor/components/input-color/input-color.component.ts b/projects/addon-editor/components/input-color/input-color.component.ts deleted file mode 100644 index 9c40e5b07398..000000000000 --- a/projects/addon-editor/components/input-color/input-color.component.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - HostListener, - Inject, - Input, - Optional, - Self, - ViewChild, -} from '@angular/core'; -import {NgControl} from '@angular/forms'; -import {DomSanitizer, SafeStyle} from '@angular/platform-browser'; -import { - tuiGetGradientData, - tuiParseGradient, - tuiToGradient, -} from '@taiga-ui/addon-editor/utils'; -import { - AbstractTuiControl, - TuiFocusableElementAccessor, - TuiNativeFocusableElement, - tuiPure, -} from '@taiga-ui/cdk'; -import { - tuiDropdownOptionsProvider, - TuiHostedDropdownComponent, - TuiPrimitiveTextfieldComponent, -} from '@taiga-ui/core'; - -@Component({ - selector: 'tui-input-color', - templateUrl: './input-color.template.html', - styleUrls: ['./input-color.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - viewProviders: [tuiDropdownOptionsProvider({maxHeight: 600})], -}) -export class TuiInputColorComponent - extends AbstractTuiControl - implements TuiFocusableElementAccessor -{ - @ViewChild(TuiPrimitiveTextfieldComponent) - private readonly textfield?: TuiPrimitiveTextfieldComponent; - - @ViewChild(TuiHostedDropdownComponent) - private readonly dropdown?: TuiHostedDropdownComponent; - - @Input() - colors: ReadonlyMap = new Map(); - - open = false; - - constructor( - @Optional() - @Self() - @Inject(NgControl) - control: NgControl | null, - @Inject(ChangeDetectorRef) cdr: ChangeDetectorRef, - @Inject(DomSanitizer) private readonly domSanitizer: DomSanitizer, - ) { - super(control, cdr); - } - - get nativeFocusableElement(): TuiNativeFocusableElement | null { - return this.computedDisabled || !this.textfield - ? null - : this.textfield.nativeFocusableElement; - } - - get focused(): boolean { - return !!this.dropdown && this.dropdown.focused; - } - - get background(): SafeStyle { - return this.sanitize(this.value, this.domSanitizer); - } - - @HostListener('click') - onClick(): void { - this.open = !this.open; - } - - /** deprecated use 'value' setter */ - onValueChange(textValue: string): void { - this.value = textValue; - } - - onFocused(focused: boolean): void { - this.updateFocused(focused); - } - - protected getFallbackValue(): string { - return '#000000'; - } - - @tuiPure - private sanitize(value: string, domSanitizer: DomSanitizer): SafeStyle | string { - return value.startsWith('linear-gradient(') - ? domSanitizer.bypassSecurityTrustStyle( - tuiToGradient(tuiParseGradient(tuiGetGradientData(value))), - ) - : value; - } -} diff --git a/projects/addon-editor/components/input-color/input-color.module.ts b/projects/addon-editor/components/input-color/input-color.module.ts deleted file mode 100644 index 842ffc822710..000000000000 --- a/projects/addon-editor/components/input-color/input-color.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiColorSelectorModule} from '@taiga-ui/addon-editor/components/color-selector'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiHostedDropdownModule, - TuiPrimitiveTextfieldModule, - TuiTextfieldControllerModule, -} from '@taiga-ui/core'; - -import {TuiInputColorComponent} from './input-color.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiPrimitiveTextfieldModule, - TuiTextfieldControllerModule, - TuiHostedDropdownModule, - TuiColorSelectorModule, - TuiActiveZoneModule, - ], - declarations: [TuiInputColorComponent], - exports: [TuiInputColorComponent], -}) -export class TuiInputColorModule {} diff --git a/projects/addon-editor/components/input-color/input-color.style.less b/projects/addon-editor/components/input-color/input-color.style.less deleted file mode 100644 index 4a5a31ffc872..000000000000 --- a/projects/addon-editor/components/input-color/input-color.style.less +++ /dev/null @@ -1,24 +0,0 @@ -@import 'taiga-ui-local'; - -:host { - display: block; - border-radius: var(--tui-radius-m); - text-align: left; -} - -.t-wrapper { - display: flex; - border-radius: inherit; -} - -.t-textfield { - border-radius: inherit; - text-align: inherit; -} - -.t-color { - width: 1.5rem; - height: 1.5rem; - box-shadow: inset 0 0 0 1px var(--tui-base-03-dark); - border-radius: 0.125rem; -} diff --git a/projects/addon-editor/components/input-color/input-color.template.html b/projects/addon-editor/components/input-color/input-color.template.html deleted file mode 100644 index 896facdbaa53..000000000000 --- a/projects/addon-editor/components/input-color/input-color.template.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - -
-
- - - - diff --git a/projects/addon-editor/components/input-color/ng-package.json b/projects/addon-editor/components/input-color/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/input-color/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/input-color/test/input-color.component.spec.ts b/projects/addon-editor/components/input-color/test/input-color.component.spec.ts deleted file mode 100644 index 39338ddb73c9..000000000000 --- a/projects/addon-editor/components/input-color/test/input-color.component.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {Component, ViewChild} from '@angular/core'; -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {FormsModule} from '@angular/forms'; -import {NoopAnimationsModule} from '@angular/platform-browser/animations'; -import {TuiInputColorComponent, TuiInputColorModule} from '@taiga-ui/addon-editor'; - -@Component({ - template: ` - - `, -}) -class TestComponent { - @ViewChild(TuiInputColorComponent) - component!: TuiInputColorComponent; - - color = `#0000ff`; -} - -describe(`InputColor`, () => { - let fixture: ComponentFixture; - let testComponent: TestComponent; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [TuiInputColorModule, FormsModule, NoopAnimationsModule], - declarations: [TestComponent], - }); - - fixture = TestBed.createComponent(TestComponent); - testComponent = fixture.componentInstance; - fixture.detectChanges(); - }); - - it(`Plain string for single color`, () => { - expect(testComponent.component.background).toBe(testComponent.color); - }); - - it(`Sanitized value for gradient`, async () => { - testComponent.color = `linear-gradient(#ff0000, #00ff00)`; - fixture.detectChanges(); - - await fixture.whenStable(); - - expect(typeof testComponent.component.background).toBe(`object`); - }); -}); diff --git a/projects/addon-editor/components/ng-package.json b/projects/addon-editor/components/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/align-content/align-content.component.ts b/projects/addon-editor/components/toolbar-tools/align-content/align-content.component.ts deleted file mode 100644 index b79bf696b2df..000000000000 --- a/projects/addon-editor/components/toolbar-tools/align-content/align-content.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {combineLatest, Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-align-content', - templateUrl: './align-content.template.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiAlignContentComponent { - readonly alignState$ = combineLatest([ - this.editor.isActive$({textAlign: 'left'}), - this.editor.isActive$({textAlign: 'right'}), - this.editor.isActive$({textAlign: 'center'}), - this.editor.isActive$({textAlign: 'justify'}), - ]).pipe( - map(([left, right, center, justify]) => ({ - left, - right, - center, - justify, - })), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} -} diff --git a/projects/addon-editor/components/toolbar-tools/align-content/align-content.module.ts b/projects/addon-editor/components/toolbar-tools/align-content/align-content.module.ts deleted file mode 100644 index 9c700b043dca..000000000000 --- a/projects/addon-editor/components/toolbar-tools/align-content/align-content.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiLetModule} from '@taiga-ui/cdk'; -import {TuiButtonModule, TuiHintModule, TuiHostedDropdownModule} from '@taiga-ui/core'; - -import {TuiAlignContentComponent} from './align-content.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiHintModule, - TuiLetModule, - ], - declarations: [TuiAlignContentComponent], - exports: [TuiAlignContentComponent], -}) -export class TuiAlignContentModule {} diff --git a/projects/addon-editor/components/toolbar-tools/align-content/align-content.template.html b/projects/addon-editor/components/toolbar-tools/align-content/align-content.template.html deleted file mode 100644 index d08e952c201e..000000000000 --- a/projects/addon-editor/components/toolbar-tools/align-content/align-content.template.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -
- - - - -
-
-
-
diff --git a/projects/addon-editor/components/toolbar-tools/align-content/index.ts b/projects/addon-editor/components/toolbar-tools/align-content/index.ts deleted file mode 100644 index 678d5831b9e2..000000000000 --- a/projects/addon-editor/components/toolbar-tools/align-content/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './align-content.component'; -export * from './align-content.module'; diff --git a/projects/addon-editor/components/toolbar-tools/align-content/ng-package.json b/projects/addon-editor/components/toolbar-tools/align-content/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/align-content/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/code/code.component.html b/projects/addon-editor/components/toolbar-tools/code/code.component.html deleted file mode 100644 index eaa8fdd94d05..000000000000 --- a/projects/addon-editor/components/toolbar-tools/code/code.component.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - diff --git a/projects/addon-editor/components/toolbar-tools/code/code.component.ts b/projects/addon-editor/components/toolbar-tools/code/code.component.ts deleted file mode 100644 index ff43040f299c..000000000000 --- a/projects/addon-editor/components/toolbar-tools/code/code.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - TUI_EDITOR_CODE_OPTIONS, - TUI_EDITOR_TOOLBAR_TEXTS, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-code', - templateUrl: './code.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiCodeComponent { - readonly hintText$ = this.texts$.pipe(map(texts => texts.code)); - - readonly insideCode$ = this.editor.stateChange$.pipe( - map(() => this.editor.isActive('code') || this.editor.isActive('codeBlock')), - distinctUntilChanged(), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - @Inject(TUI_EDITOR_CODE_OPTIONS) - readonly codeOptionsTexts$: Observable, - ) {} - - onCode(isCodeBlock: boolean): void { - if (isCodeBlock) { - this.editor.toggleCodeBlock(); - } else { - this.editor.toggleCode(); - } - } -} diff --git a/projects/addon-editor/components/toolbar-tools/code/code.module.ts b/projects/addon-editor/components/toolbar-tools/code/code.module.ts deleted file mode 100644 index 9a759a4a1538..000000000000 --- a/projects/addon-editor/components/toolbar-tools/code/code.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import { - TuiButtonModule, - TuiDataListModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiCodeComponent} from './code.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiHintModule, - TuiDataListModule, - ], - declarations: [TuiCodeComponent], - exports: [TuiCodeComponent], -}) -export class TuiCodeModule {} diff --git a/projects/addon-editor/components/toolbar-tools/code/index.ts b/projects/addon-editor/components/toolbar-tools/code/index.ts deleted file mode 100644 index 86b23d0dee3e..000000000000 --- a/projects/addon-editor/components/toolbar-tools/code/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './code.component'; -export * from './code.module'; diff --git a/projects/addon-editor/components/toolbar-tools/code/ng-package.json b/projects/addon-editor/components/toolbar-tools/code/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/code/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.component.ts b/projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.component.ts deleted file mode 100644 index ea71d6312219..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-details-remove', - templateUrl: './details-remove.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiDetailsRemoveComponent { - readonly disabled$ = this.editor.stateChange$.pipe( - map(() => !this.editor.isActive('details')), - distinctUntilChanged(), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - removeDetails(): void { - this.editor.removeDetails(); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.template.html b/projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.template.html deleted file mode 100644 index 805070ef37ab..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/details-remove/details-remove.template.html +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/projects/addon-editor/components/toolbar-tools/details/details.component.ts b/projects/addon-editor/components/toolbar-tools/details/details.component.ts deleted file mode 100644 index 27379f957b62..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/details.component.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; - -@Component({ - selector: 'tui-details', - templateUrl: './details.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiDetailsComponent { - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - setDetails(): void { - this.editor.setDetails(); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/details/details.module.ts b/projects/addon-editor/components/toolbar-tools/details/details.module.ts deleted file mode 100644 index 080b9de37251..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/details.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiButtonModule, TuiHintModule} from '@taiga-ui/core'; - -import {TuiDetailsComponent} from './details.component'; -import {TuiDetailsRemoveComponent} from './details-remove/details-remove.component'; - -@NgModule({ - imports: [CommonModule, TuiButtonModule, TuiHintModule], - declarations: [TuiDetailsComponent, TuiDetailsRemoveComponent], - exports: [TuiDetailsComponent, TuiDetailsRemoveComponent], -}) -export class TuiDetailsModule {} diff --git a/projects/addon-editor/components/toolbar-tools/details/details.template.html b/projects/addon-editor/components/toolbar-tools/details/details.template.html deleted file mode 100644 index 4821af181468..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/details.template.html +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/projects/addon-editor/components/toolbar-tools/details/index.ts b/projects/addon-editor/components/toolbar-tools/details/index.ts deleted file mode 100644 index a5b44ec324fc..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './details.component'; -export * from './details.module'; -export * from './details-remove/details-remove.component'; diff --git a/projects/addon-editor/components/toolbar-tools/details/ng-package.json b/projects/addon-editor/components/toolbar-tools/details/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/details/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/font-size/font-size.component.ts b/projects/addon-editor/components/toolbar-tools/font-size/font-size.component.ts deleted file mode 100644 index 7d488741ceeb..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-size/font-size.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TuiEditorFontOption} from '@taiga-ui/addon-editor/interfaces'; -import { - TUI_EDITOR_FONT_OPTIONS, - TUI_EDITOR_OPTIONS, - TUI_EDITOR_TOOLBAR_TEXTS, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import {tuiAssert, tuiPx} from '@taiga-ui/cdk'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-font-size', - templateUrl: './font-size.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiFontSizeComponent { - readonly fontsOptions$: Observable>> = - this.fontOptionsTexts$.pipe(map(texts => this.options.fontOptions(texts))); - - readonly fontText$ = this.texts$.pipe(map(texts => texts.font)); - - constructor( - @Inject(TUI_EDITOR_OPTIONS) - private readonly options: TuiEditorOptions, - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - @Inject(TUI_EDITOR_FONT_OPTIONS) - private readonly fontOptionsTexts$: Observable< - TuiLanguageEditor['editorFontOptions'] - >, - ) {} - - /** - * @deprecated: - * use {@link setFontOption} - */ - onClick({headingLevel, px}: Partial): void { - this.setFontOption({headingLevel, px}); - } - - setFontOption({headingLevel, px}: Partial): void { - this.clearPreviousTextStyles(); - - if (headingLevel) { - ngDevMode && - tuiAssert.assert( - !px, - 'Do not use `px` together with `headingLevel` because `px` value does not affect anything', - ); - - this.editor.setHeading(headingLevel); - } else { - this.editor.setParagraph({fontSize: tuiPx(px || 0)}); - } - } - - private clearPreviousTextStyles(): void { - this.editor.removeEmptyTextStyle(); - this.editor.toggleMark('textStyle'); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/font-size/font-size.module.ts b/projects/addon-editor/components/toolbar-tools/font-size/font-size.module.ts deleted file mode 100644 index 2f1821076b28..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-size/font-size.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import { - TuiButtonModule, - TuiDataListModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiFontSizeComponent} from './font-size.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiHintModule, - TuiDataListModule, - ], - declarations: [TuiFontSizeComponent], - exports: [TuiFontSizeComponent], -}) -export class TuiFontSizeModule {} diff --git a/projects/addon-editor/components/toolbar-tools/font-size/font-size.template.html b/projects/addon-editor/components/toolbar-tools/font-size/font-size.template.html deleted file mode 100644 index 3faad170bc84..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-size/font-size.template.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - diff --git a/projects/addon-editor/components/toolbar-tools/font-size/index.ts b/projects/addon-editor/components/toolbar-tools/font-size/index.ts deleted file mode 100644 index 936b33be19c4..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-size/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './font-size.component'; -export * from './font-size.module'; diff --git a/projects/addon-editor/components/toolbar-tools/font-size/ng-package.json b/projects/addon-editor/components/toolbar-tools/font-size/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-size/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/font-style/font-style.component.ts b/projects/addon-editor/components/toolbar-tools/font-style/font-style.component.ts deleted file mode 100644 index b2a9eda1db61..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-style/font-style.component.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {defaultEditorTools} from '@taiga-ui/addon-editor/constants'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TuiEditorTool} from '@taiga-ui/addon-editor/enums'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {combineLatest, Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-font-style', - templateUrl: './font-style.template.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiFontStyleComponent { - private toolsSet = new Set(defaultEditorTools); - - @Input() - set enabledTools(value: Set | readonly TuiEditorTool[]) { - this.toolsSet = new Set(value); - } - - readonly TuiEditorTool: typeof TuiEditorTool = TuiEditorTool; - - readonly fontStyleState$ = combineLatest([ - this.editor.isActive$('bold'), - this.editor.isActive$('italic'), - this.editor.isActive$('underline'), - this.editor.isActive$('strike'), - ]).pipe( - map(([bold, italic, underline, strike]) => ({ - bold, - italic, - underline, - strike, - })), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - isEnabled(tool: TuiEditorTool): boolean { - return this.toolsSet.has(tool); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/font-style/font-style.module.ts b/projects/addon-editor/components/toolbar-tools/font-style/font-style.module.ts deleted file mode 100644 index 0b6b02dc5148..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-style/font-style.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiButtonModule, TuiHintModule, TuiHostedDropdownModule} from '@taiga-ui/core'; - -import {TuiFontStyleComponent} from './font-style.component'; - -@NgModule({ - imports: [CommonModule, TuiHostedDropdownModule, TuiButtonModule, TuiHintModule], - declarations: [TuiFontStyleComponent], - exports: [TuiFontStyleComponent], -}) -export class TuiFontStyleModule {} diff --git a/projects/addon-editor/components/toolbar-tools/font-style/font-style.template.html b/projects/addon-editor/components/toolbar-tools/font-style/font-style.template.html deleted file mode 100644 index 559e0b5fc9c4..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-style/font-style.template.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - -
- - - - -
-
-
-
diff --git a/projects/addon-editor/components/toolbar-tools/font-style/index.ts b/projects/addon-editor/components/toolbar-tools/font-style/index.ts deleted file mode 100644 index e5b9297a8392..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-style/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './font-style.component'; -export * from './font-style.module'; diff --git a/projects/addon-editor/components/toolbar-tools/font-style/ng-package.json b/projects/addon-editor/components/toolbar-tools/font-style/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/font-style/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/group/group.component.html b/projects/addon-editor/components/toolbar-tools/group/group.component.html deleted file mode 100644 index 0dc0a05e17b9..000000000000 --- a/projects/addon-editor/components/toolbar-tools/group/group.component.html +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/projects/addon-editor/components/toolbar-tools/group/group.component.ts b/projects/addon-editor/components/toolbar-tools/group/group.component.ts deleted file mode 100644 index 3ae829138ad0..000000000000 --- a/projects/addon-editor/components/toolbar-tools/group/group.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-editor-group-tool', - templateUrl: './group.component.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiEditorGroupToolComponent { - readonly insertGroupText$ = this.texts$.pipe(map(texts => texts.insertGroup)); - readonly removeGroupText$ = this.texts$.pipe(map(texts => texts.removeGroup)); - - readonly disabled$ = this.editor.stateChange$.pipe( - map(() => !this.editor.isActive('group')), - distinctUntilChanged(), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - addGroup(): void { - this.editor.setGroup(); - } - - removeGroup(): void { - this.editor.removeGroup(); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/group/group.module.ts b/projects/addon-editor/components/toolbar-tools/group/group.module.ts deleted file mode 100644 index c32f9aff0b1d..000000000000 --- a/projects/addon-editor/components/toolbar-tools/group/group.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiButtonModule, TuiHintModule} from '@taiga-ui/core'; - -import {TuiEditorGroupToolComponent} from './group.component'; - -@NgModule({ - imports: [CommonModule, TuiButtonModule, TuiHintModule], - declarations: [TuiEditorGroupToolComponent], - exports: [TuiEditorGroupToolComponent], -}) -export class TuiEditorToolGroup {} diff --git a/projects/addon-editor/components/toolbar-tools/group/index.ts b/projects/addon-editor/components/toolbar-tools/group/index.ts deleted file mode 100644 index 1d3fc6363690..000000000000 --- a/projects/addon-editor/components/toolbar-tools/group/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './group.component'; -export * from './group.module'; diff --git a/projects/addon-editor/components/toolbar-tools/group/ng-package.json b/projects/addon-editor/components/toolbar-tools/group/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/group/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.component.ts b/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.component.ts deleted file mode 100644 index de057a9d9caf..000000000000 --- a/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - TUI_EDITOR_OPTIONS, - TUI_EDITOR_TOOLBAR_TEXTS, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-highlight-color', - templateUrl: './highlight-color.template.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiHighlightColorComponent { - @Input() - colors: ReadonlyMap = this.defaultOptions.colors; - - readonly backgroundColor$ = this.editor.stateChange$.pipe( - map(() => this.editor.getBackgroundColor() || this.defaultOptions.blankColor), - distinctUntilChanged(), - ); - - readonly backColorText$ = this.texts$.pipe(map(texts => texts.backColor)); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - @Inject(TUI_EDITOR_OPTIONS) - private readonly defaultOptions: TuiEditorOptions, - ) {} - - isBlankColor(color: string): boolean { - return color === this.defaultOptions.blankColor; - } -} diff --git a/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.module.ts b/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.module.ts deleted file mode 100644 index 9aa95d23b719..000000000000 --- a/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiPaletteModule} from '@taiga-ui/addon-editor/components/color-selector'; -import {TuiActiveZoneModule, TuiLetModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiHighlightColorComponent} from './highlight-color.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiPaletteModule, - TuiHintModule, - TuiDropdownModule, - TuiActiveZoneModule, - TuiLetModule, - ], - declarations: [TuiHighlightColorComponent], - exports: [TuiHighlightColorComponent], -}) -export class TuiHighlightColorModule {} diff --git a/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.template.html b/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.template.html deleted file mode 100644 index 4807469ebcbd..000000000000 --- a/projects/addon-editor/components/toolbar-tools/highlight-color/highlight-color.template.html +++ /dev/null @@ -1,38 +0,0 @@ - - - -
- - - -
diff --git a/projects/addon-editor/components/toolbar-tools/highlight-color/index.ts b/projects/addon-editor/components/toolbar-tools/highlight-color/index.ts deleted file mode 100644 index 2f7dcc8b4f47..000000000000 --- a/projects/addon-editor/components/toolbar-tools/highlight-color/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './highlight-color.component'; -export * from './highlight-color.module'; diff --git a/projects/addon-editor/components/toolbar-tools/highlight-color/ng-package.json b/projects/addon-editor/components/toolbar-tools/highlight-color/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/highlight-color/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/index.ts b/projects/addon-editor/components/toolbar-tools/index.ts deleted file mode 100644 index 53ef18e74939..000000000000 --- a/projects/addon-editor/components/toolbar-tools/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from '@taiga-ui/addon-editor/components/toolbar-tools/align-content'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/code'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/details'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/font-size'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/font-style'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/group'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/highlight-color'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/list-configs'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/table-cell-color'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/table-create'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/table-merge-cells'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/table-row-column-manager'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/table-size-selector'; -export * from '@taiga-ui/addon-editor/components/toolbar-tools/text-color'; diff --git a/projects/addon-editor/components/toolbar-tools/list-configs/index.ts b/projects/addon-editor/components/toolbar-tools/list-configs/index.ts deleted file mode 100644 index 9cbec26e1e76..000000000000 --- a/projects/addon-editor/components/toolbar-tools/list-configs/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './list-configs.component'; -export * from './list-configs.module'; diff --git a/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.component.ts b/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.component.ts deleted file mode 100644 index 6ec1e2a3ef8e..000000000000 --- a/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.component.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {combineLatest, Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-list-configs', - templateUrl: './list-configs.template.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiListConfigsComponent { - readonly listState$ = combineLatest([ - this.editor.isActive$('orderedList'), - this.editor.isActive$('bulletList'), - ]).pipe( - map(([ordered, unordered]) => ({ - ordered, - unordered, - })), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - sinkListItem(): void { - this.editor.sinkListItem(); - } - - liftListItem(): void { - this.editor.liftListItem(); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.module.ts b/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.module.ts deleted file mode 100644 index 5aa631b3c7ba..000000000000 --- a/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiLetModule} from '@taiga-ui/cdk'; -import {TuiButtonModule, TuiHintModule, TuiHostedDropdownModule} from '@taiga-ui/core'; - -import {TuiListConfigsComponent} from './list-configs.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiHintModule, - TuiLetModule, - ], - declarations: [TuiListConfigsComponent], - exports: [TuiListConfigsComponent], -}) -export class TuiListConfigsModule {} diff --git a/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.template.html b/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.template.html deleted file mode 100644 index f710e2f79e79..000000000000 --- a/projects/addon-editor/components/toolbar-tools/list-configs/list-configs.template.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - -
- - - - -
-
-
-
diff --git a/projects/addon-editor/components/toolbar-tools/list-configs/ng-package.json b/projects/addon-editor/components/toolbar-tools/list-configs/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/list-configs/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/ng-package.json b/projects/addon-editor/components/toolbar-tools/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/toolbar-tools/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-cell-color/index.ts b/projects/addon-editor/components/toolbar-tools/table-cell-color/index.ts deleted file mode 100644 index 2457a08a9284..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-cell-color/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './table-cell-color.component'; -export * from './table-cell-color.module'; diff --git a/projects/addon-editor/components/toolbar-tools/table-cell-color/ng-package.json b/projects/addon-editor/components/toolbar-tools/table-cell-color/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-cell-color/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.component.ts b/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.component.ts deleted file mode 100644 index fa3dd867f599..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.component.ts +++ /dev/null @@ -1,66 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - TUI_EDITOR_OPTIONS, - TUI_EDITOR_TOOLBAR_TEXTS, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {combineLatest, Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-table-cell-color', - templateUrl: './table-cell-color.template.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiTableCellColorComponent { - @Input() - colors: ReadonlyMap = this.defaultOptions.colors; - - readonly colorText$ = this.texts$.pipe( - map( - texts => - (this.editor.isActive('group') && texts.hiliteGroup) || - (this.editor.isActive('table') && texts.cellColor) || - '', - ), - ); - - readonly isActive$ = combineLatest([ - this.editor.isActive$('table'), - this.editor.isActive$('group'), - ]).pipe(map(([table, group]) => table || group)); - - readonly color$ = this.editor.stateChange$.pipe( - map( - () => - this.editor.getCellColor() || - this.editor.getGroupColor() || - this.defaultOptions.blankColor, - ), - distinctUntilChanged(), - ); - - constructor( - @Inject(TUI_EDITOR_OPTIONS) - private readonly defaultOptions: TuiEditorOptions, - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - isBlankColor(color: string): boolean { - return color === this.defaultOptions.blankColor; - } - - setCellColor(color: string): void { - if (this.editor.isActive('group')) { - this.editor.setGroupHilite(color); - } else if (this.editor.isActive('table')) { - this.editor.setCellColor(color); - } - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.module.ts b/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.module.ts deleted file mode 100644 index 008270be2a0c..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiPaletteModule} from '@taiga-ui/addon-editor/components/color-selector'; -import {TuiActiveZoneModule, TuiLetModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiTableCellColorComponent} from './table-cell-color.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiPaletteModule, - TuiButtonModule, - TuiHintModule, - TuiActiveZoneModule, - TuiDropdownModule, - TuiLetModule, - ], - declarations: [TuiTableCellColorComponent], - exports: [TuiTableCellColorComponent], -}) -export class TuiTableCellColorModule {} diff --git a/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.template.html b/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.template.html deleted file mode 100644 index 7e9f87d613a2..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-cell-color/table-cell-color.template.html +++ /dev/null @@ -1,39 +0,0 @@ - - - -
- - - -
-
diff --git a/projects/addon-editor/components/toolbar-tools/table-create/index.ts b/projects/addon-editor/components/toolbar-tools/table-create/index.ts deleted file mode 100644 index 8866e039ca50..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-create/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './table-create.component'; -export * from './table-create.module'; diff --git a/projects/addon-editor/components/toolbar-tools/table-create/ng-package.json b/projects/addon-editor/components/toolbar-tools/table-create/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-create/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-create/table-create.component.ts b/projects/addon-editor/components/toolbar-tools/table-create/table-create.component.ts deleted file mode 100644 index ab57d60f17da..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-create/table-create.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-table-create', - templateUrl: './table-create.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiTableCreateComponent { - readonly insertTableText$ = this.texts$.pipe(map(texts => texts.insertTable)); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - addTable({rows, cols}: {rows: number; cols: number}): void { - this.editor.enter(); // @note: clear previous styles - - const prevLine = this.editor.state.selection.anchor; - - // @note: don't use `setHardBreak`, - // it inherits styles of previous lines - // required two line after - this.editor.enter(); - this.editor.enter(); - - this.editor.setTextSelection(prevLine); - this.editor.insertTable(rows, cols); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-create/table-create.module.ts b/projects/addon-editor/components/toolbar-tools/table-create/table-create.module.ts deleted file mode 100644 index 6ab97eec1001..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-create/table-create.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiTableSizeSelectorModule} from '@taiga-ui/addon-editor/components/toolbar-tools/table-size-selector'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiTableCreateComponent} from './table-create.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiDropdownModule, - TuiButtonModule, - TuiHintModule, - TuiTableSizeSelectorModule, - ], - declarations: [TuiTableCreateComponent], - exports: [TuiTableCreateComponent], -}) -export class TuiTableCreateModule {} diff --git a/projects/addon-editor/components/toolbar-tools/table-create/table-create.template.html b/projects/addon-editor/components/toolbar-tools/table-create/table-create.template.html deleted file mode 100644 index 9a2adc407b9b..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-create/table-create.template.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - diff --git a/projects/addon-editor/components/toolbar-tools/table-merge-cells/index.ts b/projects/addon-editor/components/toolbar-tools/table-merge-cells/index.ts deleted file mode 100644 index 0a6a8dd63211..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-merge-cells/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './table-merge-cells.component'; -export * from './table-merge-cells.module'; diff --git a/projects/addon-editor/components/toolbar-tools/table-merge-cells/ng-package.json b/projects/addon-editor/components/toolbar-tools/table-merge-cells/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-merge-cells/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.component.ts b/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.component.ts deleted file mode 100644 index fe5bbc7337a3..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-table-merge-cells', - templateUrl: './table-merge-cells.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiTableMergeCellsComponent { - readonly canMergeCells$ = this.editor.stateChange$.pipe( - map(() => this.editor.canMergeCells()), - distinctUntilChanged(), - ); - - readonly canSplitCells$ = this.editor.stateChange$.pipe( - map(() => this.editor.canSplitCells()), - distinctUntilChanged(), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} - - mergeCells(): void { - this.editor.mergeCells(); - } - - splitCell(): void { - this.editor.splitCell(); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.module.ts b/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.module.ts deleted file mode 100644 index 74cfe1460e23..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiLetModule} from '@taiga-ui/cdk'; -import {TuiButtonModule, TuiHintModule} from '@taiga-ui/core'; - -import {TuiTableMergeCellsComponent} from './table-merge-cells.component'; - -@NgModule({ - imports: [CommonModule, TuiButtonModule, TuiHintModule, TuiLetModule], - declarations: [TuiTableMergeCellsComponent], - exports: [TuiTableMergeCellsComponent], -}) -export class TuiTableMergeCellsModule {} diff --git a/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.template.html b/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.template.html deleted file mode 100644 index 4a0846cec5f2..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-merge-cells/table-merge-cells.template.html +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/index.ts b/projects/addon-editor/components/toolbar-tools/table-row-column-manager/index.ts deleted file mode 100644 index 848e7e91a0da..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './table-row-column-manager.component'; -export * from './table-row-column-manager.module'; diff --git a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/ng-package.json b/projects/addon-editor/components/toolbar-tools/table-row-column-manager/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.component.ts b/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.component.ts deleted file mode 100644 index 1e6d0cc6e408..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.component.ts +++ /dev/null @@ -1,55 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - TUI_EDITOR_TABLE_COMMANDS, - TUI_EDITOR_TOOLBAR_TEXTS, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -// TODO: change type in v4.0 -// eslint-disable-next-line no-restricted-syntax -export enum TuiTableCommands { - InsertColumnBefore, - InsertColumnAfter, - InsertRowBefore, - InsertRowAfter, - DeleteColumn, - DeleteRow, -} - -@Component({ - selector: 'tui-table-row-column-manager', - templateUrl: './table-row-column-manager.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiTableRowColumnManagerComponent { - private readonly commandsRegistry: Record void> = { - [TuiTableCommands.InsertColumnAfter]: () => this.editor.addColumnAfter(), - [TuiTableCommands.InsertColumnBefore]: () => this.editor.addColumnBefore(), - [TuiTableCommands.InsertRowAfter]: () => this.editor.addRowAfter(), - [TuiTableCommands.InsertRowBefore]: () => this.editor.addRowBefore(), - [TuiTableCommands.DeleteColumn]: () => this.editor.deleteColumn(), - [TuiTableCommands.DeleteRow]: () => this.editor.deleteRow(), - }; - - readonly isActive$ = this.editor.isActive$('table'); - - readonly rowsColumnsManagingText$ = this.texts$.pipe( - map(texts => texts.rowsColumnsManaging), - ); - - constructor( - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - @Inject(TUI_EDITOR_TABLE_COMMANDS) - readonly tableCommandTexts$: Observable, - ) {} - - onTableOption(command: TuiTableCommands): void { - this.commandsRegistry[command](); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.module.ts b/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.module.ts deleted file mode 100644 index 2f74c096a442..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiLetModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDataListModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiTableRowColumnManagerComponent} from './table-row-column-manager.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiHostedDropdownModule, - TuiHintModule, - TuiButtonModule, - TuiDataListModule, - TuiLetModule, - ], - declarations: [TuiTableRowColumnManagerComponent], - exports: [TuiTableRowColumnManagerComponent], -}) -export class TuiTableRowColumnManagerModule {} diff --git a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.template.html b/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.template.html deleted file mode 100644 index 59f6c2e533a2..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-row-column-manager/table-row-column-manager.template.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - diff --git a/projects/addon-editor/components/toolbar-tools/table-size-selector/index.ts b/projects/addon-editor/components/toolbar-tools/table-size-selector/index.ts deleted file mode 100644 index 248e26b41e4a..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-size-selector/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './table-size-selector.component'; -export * from './table-size-selector.module'; diff --git a/projects/addon-editor/components/toolbar-tools/table-size-selector/ng-package.json b/projects/addon-editor/components/toolbar-tools/table-size-selector/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-size-selector/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.component.ts b/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.component.ts deleted file mode 100644 index aebeb6b71b75..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.component.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - EventEmitter, - Inject, - Output, -} from '@angular/core'; -import {WINDOW} from '@ng-web-apis/common'; -import {tuiGetViewportWidth} from '@taiga-ui/core'; - -const MAX_COLS_NUMBER = 15; -const MAX_ROWS_NUMBER = 15; -const MIN_DISTANCE_PX = 70; - -@Component({ - selector: 'tui-table-size-selector', - templateUrl: './table-size-selector.template.html', - styleUrls: ['./table-size-selector.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiTableSizeSelectorComponent { - @Output() - readonly selectSize = new EventEmitter<{cols: number; rows: number}>(); - - /** - * @deprecated use {@link selectSize} - * TODO: remove in v4.0 - */ - @Output() - // eslint-disable-next-line @angular-eslint/no-output-on-prefix - readonly onSelectSize = this.selectSize; - - tableSize = { - rows: 1, - cols: 1, - }; - - constructor(@Inject(WINDOW) private readonly win: Window) {} - - get columnsNumber(): number { - return Math.min(Math.max(3, this.tableSize.cols + 1), MAX_COLS_NUMBER); - } - - get rowsNumber(): number { - return Math.min(Math.max(3, this.tableSize.rows + 1), MAX_ROWS_NUMBER); - } - - tableSelectHovered(x: number, y: number): boolean { - return x < this.tableSize.rows && y < this.tableSize.cols; - } - - updateCurrentSize(rows: number, cols: number, event: MouseEvent): void { - if (tuiGetViewportWidth(this.win) - event.clientX > MIN_DISTANCE_PX) { - this.tableSize = {rows, cols}; - } - } - - /** - * @deprecated use {@link select} - * TODO: remove in v4.0 - */ - onClick(): void { - this.select(); - } - - select(): void { - this.selectSize.emit(this.tableSize); - } -} diff --git a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.module.ts b/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.module.ts deleted file mode 100644 index c69f253a6827..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiRepeatTimesModule} from '@taiga-ui/cdk'; - -import {TuiTableSizeSelectorComponent} from './table-size-selector.component'; - -@NgModule({ - imports: [CommonModule, TuiRepeatTimesModule], - declarations: [TuiTableSizeSelectorComponent], - exports: [TuiTableSizeSelectorComponent], -}) -export class TuiTableSizeSelectorModule {} diff --git a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.style.less b/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.style.less deleted file mode 100644 index 7a512044c8f2..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.style.less +++ /dev/null @@ -1,27 +0,0 @@ -:host { - display: block; - padding: 0.75rem; -} - -.t-cell { - display: inline-block; - background-color: var(--tui-base-01); - width: 1.25rem; - height: 1.25rem; - border-radius: 0.25rem; - margin: 0.125rem; - border: 1px solid var(--tui-base-04); - cursor: pointer; - - &_hovered { - background-color: var(--tui-base-02); - } -} - -.t-column { - white-space: nowrap; -} - -.t-description { - text-align: center; -} diff --git a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.template.html b/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.template.html deleted file mode 100644 index 8d09595fa7bd..000000000000 --- a/projects/addon-editor/components/toolbar-tools/table-size-selector/table-size-selector.template.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
-
-
{{ tableSize.cols }}×{{ tableSize.rows }}
diff --git a/projects/addon-editor/components/toolbar-tools/text-color/index.ts b/projects/addon-editor/components/toolbar-tools/text-color/index.ts deleted file mode 100644 index ed77af172033..000000000000 --- a/projects/addon-editor/components/toolbar-tools/text-color/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './text-color.component'; -export * from './text-color.module'; diff --git a/projects/addon-editor/components/toolbar-tools/text-color/ng-package.json b/projects/addon-editor/components/toolbar-tools/text-color/ng-package.json deleted file mode 100644 index eb2d09547331..000000000000 --- a/projects/addon-editor/components/toolbar-tools/text-color/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar-tools/text-color/text-color.component.ts b/projects/addon-editor/components/toolbar-tools/text-color/text-color.component.ts deleted file mode 100644 index e22a8eec7c09..000000000000 --- a/projects/addon-editor/components/toolbar-tools/text-color/text-color.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import { - TUI_EDITOR_OPTIONS, - TUI_EDITOR_TOOLBAR_TEXTS, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-text-color', - templateUrl: './text-color.template.html', - styleUrls: ['../tools-common.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiTextColorComponent { - @Input() - colors: ReadonlyMap = this.defaultOptions.colors; - - readonly fontColor$ = this.editor.stateChange$.pipe( - map(() => this.editor.getFontColor() || this.defaultOptions.blankColor), - distinctUntilChanged(), - ); - - readonly foreColorText$ = this.texts$.pipe(map(texts => texts.foreColor)); - - constructor( - @Inject(TUI_EDITOR_OPTIONS) - private readonly defaultOptions: TuiEditorOptions, - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - ) {} -} diff --git a/projects/addon-editor/components/toolbar-tools/text-color/text-color.module.ts b/projects/addon-editor/components/toolbar-tools/text-color/text-color.module.ts deleted file mode 100644 index 152df835f2be..000000000000 --- a/projects/addon-editor/components/toolbar-tools/text-color/text-color.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiPaletteModule} from '@taiga-ui/addon-editor/components/color-selector'; -import {TuiActiveZoneModule, TuiLetModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {TuiTextColorComponent} from './text-color.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiDropdownModule, - TuiHintModule, - TuiPaletteModule, - TuiActiveZoneModule, - TuiLetModule, - ], - declarations: [TuiTextColorComponent], - exports: [TuiTextColorComponent], -}) -export class TuiTextColorModule {} diff --git a/projects/addon-editor/components/toolbar-tools/text-color/text-color.template.html b/projects/addon-editor/components/toolbar-tools/text-color/text-color.template.html deleted file mode 100644 index 2e668a65f913..000000000000 --- a/projects/addon-editor/components/toolbar-tools/text-color/text-color.template.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -
- - - -
diff --git a/projects/addon-editor/components/toolbar-tools/tools-common.less b/projects/addon-editor/components/toolbar-tools/tools-common.less deleted file mode 100644 index 35f222d9f59d..000000000000 --- a/projects/addon-editor/components/toolbar-tools/tools-common.less +++ /dev/null @@ -1,36 +0,0 @@ -@import 'taiga-ui-local'; - -.t-dropdown { - padding: 0.75rem; -} - -.t-option { - .transition(background); - - &:hover { - background: var(--tui-secondary-hover); - } - - &_margin { - margin: 0 @space; - } -} - -.t-plate { - position: absolute; - top: 1.375rem; - left: 0.25rem; - width: 1.5rem; - height: 0.25rem; - pointer-events: none; - - &_paint { - left: 0.375rem; - width: 1.25rem; - } -} - -.t-color-picker { - box-sizing: border-box; - max-width: 22.6rem; -} diff --git a/projects/addon-editor/components/toolbar/index.ts b/projects/addon-editor/components/toolbar/index.ts deleted file mode 100644 index 83685711ff54..000000000000 --- a/projects/addon-editor/components/toolbar/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './toolbar.component'; -export * from './toolbar.module'; -export * from './toolbar-navigation-manager.directive'; diff --git a/projects/addon-editor/components/toolbar/ng-package.json b/projects/addon-editor/components/toolbar/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/components/toolbar/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/components/toolbar/toolbar-navigation-manager.directive.ts b/projects/addon-editor/components/toolbar/toolbar-navigation-manager.directive.ts deleted file mode 100644 index 0a46bf1c85da..000000000000 --- a/projects/addon-editor/components/toolbar/toolbar-navigation-manager.directive.ts +++ /dev/null @@ -1,92 +0,0 @@ -import {Directive, ElementRef, HostListener, Inject} from '@angular/core'; -import { - tuiClamp, - tuiGetClosestFocusable, - tuiIsNativeFocusedIn, - tuiIsNativeMouseFocusable, - TuiNativeFocusableElement, -} from '@taiga-ui/cdk'; - -@Directive({ - selector: '[tuiToolbarNavigationManager]', -}) -export class TuiToolbarNavigationManagerDirective { - constructor(@Inject(ElementRef) private readonly el: ElementRef) {} - - private get toolsContainers(): readonly HTMLElement[] { - return Array.from( - this.el.nativeElement.querySelectorAll('[tuiItem]'), - ); - } - - @HostListener('keydown.arrowRight.prevent', ['false']) - @HostListener('keydown.arrowLeft.prevent', ['true']) - onHorizontalNavigation(toPrevious: boolean): void { - const {toolsContainers} = this; - const focusedToolIndex = toolsContainers.findIndex(tuiIsNativeFocusedIn); - - const targetToolIndex = tuiClamp( - focusedToolIndex + (toPrevious ? -1 : 1), - 0, - toolsContainers.length - 1, - ); - const targetToolWrapper = toolsContainers[targetToolIndex]; - const targetTool = toPrevious - ? this.findPreviousTool(targetToolWrapper) - : this.findNextTool(targetToolWrapper); - - if (targetTool) { - targetTool.focus(); - } - } - - findFirstFocusableTool(reversed: boolean = false): TuiNativeFocusableElement | null { - const tools = reversed - ? this.toolsContainers.slice().reverse() - : this.toolsContainers; - - for (const el of tools) { - const focusableElement = tuiIsNativeMouseFocusable(el) - ? el - : tuiGetClosestFocusable({initial: el, root: el, keyboard: false}); - - if (focusableElement) { - return focusableElement; - } - } - - return null; - } - - private findPreviousTool(wrapper: HTMLElement): HTMLElement | null { - if (tuiIsNativeMouseFocusable(wrapper)) { - return wrapper; - } - - const lookedInside = tuiGetClosestFocusable({ - initial: wrapper, - root: wrapper, - keyboard: false, - }); - - return ( - lookedInside || - tuiGetClosestFocusable({ - initial: wrapper, - root: this.el.nativeElement, - previous: true, - keyboard: false, - }) - ); - } - - private findNextTool(wrapper: HTMLElement): HTMLElement | null { - return tuiIsNativeMouseFocusable(wrapper) - ? wrapper - : tuiGetClosestFocusable({ - initial: wrapper, - root: this.el.nativeElement, - keyboard: false, - }); - } -} diff --git a/projects/addon-editor/components/toolbar/toolbar.component.ts b/projects/addon-editor/components/toolbar/toolbar.component.ts deleted file mode 100644 index 96ec30147458..000000000000 --- a/projects/addon-editor/components/toolbar/toolbar.component.ts +++ /dev/null @@ -1,325 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - ElementRef, - EventEmitter, - HostBinding, - HostListener, - Inject, - Input, - Optional, - Output, - QueryList, - Self, - ViewChild, - ViewChildren, -} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {defaultEditorTools} from '@taiga-ui/addon-editor/constants'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives'; -import {TuiEditorTool} from '@taiga-ui/addon-editor/enums'; -import {TuiEditorAttachedFile} from '@taiga-ui/addon-editor/interfaces'; -import { - TUI_ATTACH_FILES_LOADER, - TUI_ATTACH_FILES_OPTIONS, - TUI_EDITOR_OPTIONS, - TUI_EDITOR_TOOLBAR_TEXTS, - TUI_IMAGE_LOADER, - TuiEditorOptions, -} from '@taiga-ui/addon-editor/tokens'; -import { - EMPTY_QUERY, - tuiAssert, - TuiDestroyService, - TuiHandler, - TuiInjectionTokenType, - tuiIsNativeFocusedIn, -} from '@taiga-ui/cdk'; -import {TuiHostedDropdownComponent} from '@taiga-ui/core'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; -import {Observable} from 'rxjs'; -import {take, takeUntil} from 'rxjs/operators'; - -import {TuiToolbarNavigationManagerDirective} from './toolbar-navigation-manager.directive'; - -@Component({ - selector: 'tui-toolbar', - templateUrl: './toolbar.template.html', - styleUrls: ['./toolbar.style.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [TuiDestroyService], - host: { - role: 'toolbar', - }, -}) -export class TuiToolbarComponent { - @ViewChildren('dropdown', {read: ElementRef}) - private readonly dropdowns: QueryList> = EMPTY_QUERY; - - @ViewChild(TuiToolbarNavigationManagerDirective) - private readonly navigationManager?: TuiToolbarNavigationManagerDirective; - - @Input() - colors: ReadonlyMap = this.defaultOptions.colors; - - @Input() - @HostBinding('class._disabled') - disabled = false; - - @Output() - readonly linkAdded = new EventEmitter(); - - @Output() - readonly texClicked = new EventEmitter(); - - @Output() - readonly fileAttached = new EventEmitter(); - - readonly TuiEditorTool: typeof TuiEditorTool = TuiEditorTool; - - toolsSet = new Set(defaultEditorTools); - - @Input() - set tools(value: readonly TuiEditorTool[]) { - this.toolsSet = new Set(value); - } - - constructor( - @Optional() - @Inject(ElementRef) - private readonly el: ElementRef, - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(TUI_IMAGE_LOADER) - private readonly imageLoader: TuiHandler>, - @Inject(TUI_ATTACH_FILES_OPTIONS) - readonly attachOptions: TuiInjectionTokenType, - @Optional() - @Inject(TUI_ATTACH_FILES_LOADER) - private readonly filesLoader: TuiInjectionTokenType< - typeof TUI_ATTACH_FILES_LOADER - > | null, - @Inject(TUI_EDITOR_TOOLBAR_TEXTS) - readonly texts$: Observable, - @Inject(TUI_EDITOR_OPTIONS) - private readonly defaultOptions: TuiEditorOptions, - @Self() - @Inject(TuiDestroyService) - private readonly destroy$: TuiDestroyService, - ) {} - - get focused(): boolean { - return ( - tuiIsNativeFocusedIn(this.el.nativeElement) || - !!this.dropdowns.find(({nativeElement}) => - tuiIsNativeFocusedIn(nativeElement), - ) - ); - } - - get focusable(): boolean { - return !this.focused && !this.disabled; - } - - get unorderedList(): boolean { - return this.editor.isActive('bulletList'); - } - - get orderedList(): boolean { - return this.editor.isActive('orderedList'); - } - - get blockquote(): boolean { - return this.editor.isActive('blockquote'); - } - - get a(): boolean { - return this.editor.isActive('link'); - } - - get jumpAnchor(): boolean { - return this.editor.isActive('jumpAnchor'); - } - - get canOpenAnchor(): boolean { - return !this.a && !this.jumpAnchor; - } - - get undoDisabled(): boolean { - return this.editor.undoDisabled(); - } - - get redoDisabled(): boolean { - return this.editor.redoDisabled(); - } - - get subscript(): boolean { - return this.editor.isActive('subscript'); - } - - get superscript(): boolean { - return this.editor.isActive('superscript'); - } - - get formatEnabled(): boolean { - return ( - this.enabled(TuiEditorTool.Bold) || - this.enabled(TuiEditorTool.Italic) || - this.enabled(TuiEditorTool.Underline) || - this.enabled(TuiEditorTool.Strikethrough) - ); - } - - get firstBigBlockEnabled(): boolean { - return ( - this.formatEnabled || - this.enabled(TuiEditorTool.Align) || - this.enabled(TuiEditorTool.List) || - this.enabled(TuiEditorTool.Quote) || - this.enabled(TuiEditorTool.Link) || - this.enabled(TuiEditorTool.Anchor) || - this.enabled(TuiEditorTool.Attach) - ); - } - - get secondBigBlockEnabled(): boolean { - return ( - this.enabled(TuiEditorTool.Code) || - this.enabled(TuiEditorTool.Tex) || - this.enabled(TuiEditorTool.Img) || - this.enabled(TuiEditorTool.HR) - ); - } - - @HostListener('mousedown', ['$event', '$event.target']) - onMouseDown(event: MouseEvent, target: HTMLElement): void { - if (target.closest('button')) { - return; - } - - event.preventDefault(); - this.editor.focus(); - } - - onBottomFocus(): void { - this.focusLast(); - } - - onTopFocus(): void { - this.focusFirst(); - } - - onImage(input: HTMLInputElement): void { - const file = input.files?.[0]; - - input.value = ''; - - if (!file) { - return; - } - - this.imageLoader(file) - .pipe(take(1), takeUntil(this.destroy$)) - .subscribe(image => this.addImage(image)); - } - - onAttach(input: HTMLInputElement): void { - const files = Array.from(input.files || []); - - input.value = ''; - - if (!files) { - return; - } - - ngDevMode && - tuiAssert.assert( - !!this.filesLoader, - 'Please provide TUI_ATTACH_FILES_LOADER', - ); - - this.filesLoader?.(files) - .pipe(take(1), takeUntil(this.destroy$)) - .subscribe(attachedFiles => this.fileAttached.emit(attachedFiles)); - } - - onTeX(): void { - this.texClicked.emit(); - } - - onLink(hosted: TuiHostedDropdownComponent, url?: string): void { - hosted.open = false; - - if (url) { - this.editor.toggleLink(url); - } - } - - setAnchor(hosted: TuiHostedDropdownComponent, anchor?: string): void { - hosted.open = false; - - if (anchor) { - this.editor.setAnchor(anchor); - this.editor.selectClosest(); - } - } - - removeAnchor(): void { - this.editor.removeAnchor(); - } - - enabled(tool: TuiEditorTool): boolean { - return this.toolsSet.has(tool); - } - - undo(): void { - this.editor.undo(); - } - - redo(): void { - this.editor.redo(); - } - - insertHorizontalRule(): void { - this.editor.setHorizontalRule(); - } - - removeFormat(): void { - this.editor.removeFormat(); - } - - toggleOrderedList(): void { - this.editor.toggleOrderedList(); - } - - toggleQuote(): void { - this.editor.toggleBlockquote(); - } - - toggleSubscript(): void { - this.editor.toggleSubscript(); - } - - toggleSuperscript(): void { - this.editor.toggleSuperscript(); - } - - private addImage(image: string): void { - this.editor.setImage(image); - } - - private focusFirst(): void { - const firstButton = this.navigationManager?.findFirstFocusableTool(); - - if (firstButton) { - firstButton.focus(); - } - } - - private focusLast(): void { - const lastButton = this.navigationManager?.findFirstFocusableTool(true); - - if (lastButton) { - lastButton.focus(); - } - } -} diff --git a/projects/addon-editor/components/toolbar/toolbar.module.ts b/projects/addon-editor/components/toolbar/toolbar.module.ts deleted file mode 100644 index eae65d03fa85..000000000000 --- a/projects/addon-editor/components/toolbar/toolbar.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiEditLinkModule} from '@taiga-ui/addon-editor/components/edit-link'; -import { - TuiAlignContentModule, - TuiCodeModule, - TuiDetailsModule, - TuiEditorToolGroup, - TuiFontSizeModule, - TuiFontStyleModule, - TuiHighlightColorModule, - TuiListConfigsModule, - TuiTableCellColorModule, - TuiTableCreateModule, - TuiTableMergeCellsModule, - TuiTableRowColumnManagerModule, - TuiTextColorModule, -} from '@taiga-ui/addon-editor/components/toolbar-tools'; -import {TuiFocusableModule, TuiItemDirective, TuiItemModule} from '@taiga-ui/cdk'; -import {TuiButtonModule, TuiHintModule, TuiHostedDropdownModule} from '@taiga-ui/core'; - -import {TuiToolbarComponent} from './toolbar.component'; -import {TuiToolbarNavigationManagerDirective} from './toolbar-navigation-manager.directive'; - -@NgModule({ - imports: [ - CommonModule, - TuiHintModule, - TuiFocusableModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiEditLinkModule, - TuiTableMergeCellsModule, - TuiTableCellColorModule, - TuiTableRowColumnManagerModule, - TuiTableCreateModule, - TuiFontSizeModule, - TuiFontStyleModule, - TuiAlignContentModule, - TuiListConfigsModule, - TuiTextColorModule, - TuiHighlightColorModule, - TuiCodeModule, - TuiDetailsModule, - TuiItemModule, - TuiEditorToolGroup, - ], - declarations: [TuiToolbarComponent, TuiToolbarNavigationManagerDirective], - exports: [TuiToolbarComponent, TuiItemDirective], -}) -export class TuiToolbarModule {} diff --git a/projects/addon-editor/components/toolbar/toolbar.style.less b/projects/addon-editor/components/toolbar/toolbar.style.less deleted file mode 100644 index 28ddbd84e445..000000000000 --- a/projects/addon-editor/components/toolbar/toolbar.style.less +++ /dev/null @@ -1,101 +0,0 @@ -@import 'taiga-ui-local'; - -.t-tools-wrapper { - .scrollbar-hidden(); - display: flex; - padding: 0.25rem 0.75rem; - overflow: auto; - flex-wrap: wrap; - box-shadow: 0 0.125rem 0.1875rem rgba(0, 0, 0, 0.1); - - &._disabled { - pointer-events: none; - opacity: var(--tui-disabled-opacity); - } -} - -.t-block { - display: flex; - padding: 0.25rem 0; - - &:not(:last-child):after { - content: ''; - display: block; - margin: 0 @space; - width: 1px; - background: var(--tui-secondary-active); - } -} - -.t-tool { - .transition(background); - - button&:hover, - & ::ng-deep button:hover { - background: var(--tui-secondary-hover); - } - - &_margin { - margin: 0 @space; - } -} - -.t-dropdown { - padding: 0.75rem; -} - -.t-wrapper { - position: relative; - margin: 0 0.25rem; -} - -.t-plate { - position: absolute; - top: 1.375rem; - left: 0.25rem; - width: 1.5rem; - height: 0.25rem; - pointer-events: none; - - &_paint { - left: 0.375rem; - width: 1.25rem; - } -} - -.t-font { - padding: 0.3em 0; - outline: none; - width: 100%; - pointer-events: none; -} - -.t-image { - .fullsize(); - font-size: 0; - opacity: 0; - cursor: pointer; - - &::-webkit-file-upload-button { - display: none; - } -} - -.t-file-upload { - display: none; -} - -// TODO: remove when color picker is customizable -.t-color-picker { - ::ng-deep > { - & tui-hosted-dropdown, - & tui-color-picker, - & tui-color-edit { - display: none; - } - } -} - -.t-prevent-parent-label-behavior { - display: none; -} diff --git a/projects/addon-editor/components/toolbar/toolbar.template.html b/projects/addon-editor/components/toolbar/toolbar.template.html deleted file mode 100644 index 2665bfea171e..000000000000 --- a/projects/addon-editor/components/toolbar/toolbar.template.html +++ /dev/null @@ -1,398 +0,0 @@ - - -
-
- -
-
- - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
- - - -
-
- - - -
- - - -
- -
-
- -
-
- - - -
-
- - -
-
- - - - - - - -
-
- -
-
diff --git a/projects/addon-editor/constants/default-editor-colors.ts b/projects/addon-editor/constants/default-editor-colors.ts deleted file mode 100644 index dbed96b03011..000000000000 --- a/projects/addon-editor/constants/default-editor-colors.ts +++ /dev/null @@ -1,29 +0,0 @@ -export const defaultEditorColors = new Map([ - [`transparent`, `transparent`], - [`color-black-300`, `#333333`], - [`color-black-200`, `#666666`], - [`color-black-100`, `#909090`], - [`color-yellow-100`, `#FFDD2C`], - [`color-yellow-200`, `#FCC521`], - [`color-yellow-300`, `#FAB618`], - [`color-gray-100`, `#f5f5f6`], - [`color-gray-200`, `#e7e8ea`], - [`color-gray-300`, `#cbcfd3`], - [`color-gray-400`, `#959ba4`], - [`color-gray-500`, `#79818c`], - [`color-gray-600`, `#616871`], - [`color-light-blue-100`, `#ecf1f7`], - [`color-light-blue-200`, `#e4ebf3`], - [`color-light-blue-300`, `#dde4ed`], - [`color-blue-100`, `#1771e6`], - [`color-blue-200`, `#1464cc`], - [`color-blue-300`, `#0953b3`], - [`color-green-100`, `#39b54a`], - [`color-green-200`, `#2ca53a`], - [`color-green-300`, `#168a21`], - [`color-red-100`, `#e01f19`], - [`color-red-200`, `#d3120e`], - [`color-red-300`, `#c40b08`], -]); - -export const EDITOR_BLANK_COLOR = `rgb(51, 51, 51)`; diff --git a/projects/addon-editor/constants/default-editor-tools.ts b/projects/addon-editor/constants/default-editor-tools.ts deleted file mode 100644 index a726c71d4ff3..000000000000 --- a/projects/addon-editor/constants/default-editor-tools.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {TuiEditorTool} from '@taiga-ui/addon-editor/enums'; - -export const defaultEditorTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Size, - TuiEditorTool.Bold, - TuiEditorTool.Italic, - TuiEditorTool.Underline, - TuiEditorTool.Align, - TuiEditorTool.List, - TuiEditorTool.Quote, - TuiEditorTool.Link, - TuiEditorTool.Anchor, - TuiEditorTool.Color, - TuiEditorTool.Hilite, - TuiEditorTool.Clear, - TuiEditorTool.Strikethrough, - TuiEditorTool.Code, - TuiEditorTool.Img, - TuiEditorTool.HR, - TuiEditorTool.Sup, - TuiEditorTool.Sub, - TuiEditorTool.Table, - TuiEditorTool.Details, -]; diff --git a/projects/addon-editor/constants/default-font-options-handler.ts b/projects/addon-editor/constants/default-font-options-handler.ts deleted file mode 100644 index 94a779c0e71b..000000000000 --- a/projects/addon-editor/constants/default-font-options-handler.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {TuiEditorFontOption} from '@taiga-ui/addon-editor/interfaces'; -import {TuiLanguageEditor} from '@taiga-ui/i18n'; - -export function tuiDefaultFontOptionsHandler( - texts: TuiLanguageEditor['editorFontOptions'], -): ReadonlyArray> { - return [ - { - px: 13, - name: texts.small, - }, - { - px: 15, - name: texts.normal, - }, - { - px: 17, - name: texts.large, - }, - { - px: 24, - family: `var(--tui-font-heading)`, - name: texts.subtitle, - headingLevel: 2, - weight: `bold`, - }, - { - px: 30, - family: `var(--tui-font-heading)`, - name: texts.title, - headingLevel: 1, - weight: `bold`, - }, - ]; -} diff --git a/projects/addon-editor/constants/default-html5-media-attributes.ts b/projects/addon-editor/constants/default-html5-media-attributes.ts deleted file mode 100644 index b6d23ba76c99..000000000000 --- a/projects/addon-editor/constants/default-html5-media-attributes.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const TUI_DEFAULT_HTML5_MEDIA_ATTRIBUTES = [ - `id`, - `class`, - `src`, - `style`, - `controls`, - `loop`, - `muted`, - `preload`, - `autoplay`, - `width`, - `height`, - `controlsList`, -]; diff --git a/projects/addon-editor/constants/default-link-options-handler.ts b/projects/addon-editor/constants/default-link-options-handler.ts deleted file mode 100644 index 45b74826bbdc..000000000000 --- a/projects/addon-editor/constants/default-link-options-handler.ts +++ /dev/null @@ -1,23 +0,0 @@ -export const TUI_EDITOR_LINK_HASH_PREFIX = `#` as const; -export const TUI_EDITOR_LINK_HTTP_PREFIX = `http://` as const; -export const TUI_EDITOR_LINK_HTTPS_PREFIX = `https://` as const; -export const TUI_EDITOR_LINK_SIMPLE_PROTOCOL_DIVIDER = `:` as const; -export const TUI_EDITOR_LINK_OSI_PROTOCOL_DIVIDER = `://` as const; - -type Protocol = string; // ftp, ssh, http, https, mailto, etc.. - -export type TuiEditorLinkProtocol = - | `${Protocol}${typeof TUI_EDITOR_LINK_OSI_PROTOCOL_DIVIDER}` - | `${Protocol}${typeof TUI_EDITOR_LINK_SIMPLE_PROTOCOL_DIVIDER}`; - -export type TuiEditorLinkPrefix = - | TuiEditorLinkProtocol - | typeof TUI_EDITOR_LINK_HASH_PREFIX; - -export interface TuiEditorLinkOptions { - readonly protocol: TuiEditorLinkProtocol; -} - -export const TUI_DEFAULT_LINK_OPTIONS = { - protocol: TUI_EDITOR_LINK_HTTPS_PREFIX, -}; diff --git a/projects/addon-editor/constants/index.ts b/projects/addon-editor/constants/index.ts deleted file mode 100644 index 10e5d819c43d..000000000000 --- a/projects/addon-editor/constants/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './default-editor-colors'; -export * from './default-editor-tools'; -export * from './default-font-options-handler'; -export * from './default-html5-media-attributes'; -export * from './default-link-options-handler'; diff --git a/projects/addon-editor/constants/ng-package.json b/projects/addon-editor/constants/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/constants/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/directives/image-preview/image-preview.directive.ts b/projects/addon-editor/directives/image-preview/image-preview.directive.ts deleted file mode 100644 index 157cb92d9564..000000000000 --- a/projects/addon-editor/directives/image-preview/image-preview.directive.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {Directive, EventEmitter, HostListener, Output} from '@angular/core'; - -@Directive({ - selector: 'tui-editor-socket[imagePreview]', - host: {class: '_preview-image'}, -}) -export class TuiEditorImagePreviewDirective { - @Output() - readonly imagePreview = new EventEmitter(); - - @HostListener('click', ['$event.target']) - click(target: HTMLElement): void { - if (target instanceof HTMLImageElement) { - this.imagePreview.emit(target); - } - } -} diff --git a/projects/addon-editor/directives/image-preview/image-preview.module.ts b/projects/addon-editor/directives/image-preview/image-preview.module.ts deleted file mode 100644 index 47662a355991..000000000000 --- a/projects/addon-editor/directives/image-preview/image-preview.module.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {NgModule} from '@angular/core'; - -import {TuiEditorImagePreviewDirective} from './image-preview.directive'; - -@NgModule({ - declarations: [TuiEditorImagePreviewDirective], - exports: [TuiEditorImagePreviewDirective], -}) -export class TuiEditorImagePreviewModule {} diff --git a/projects/addon-editor/directives/image-preview/index.ts b/projects/addon-editor/directives/image-preview/index.ts deleted file mode 100644 index 85771cf75b3f..000000000000 --- a/projects/addon-editor/directives/image-preview/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './image-preview.directive'; -export * from './image-preview.module'; diff --git a/projects/addon-editor/directives/image-preview/ng-package.json b/projects/addon-editor/directives/image-preview/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/directives/image-preview/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/directives/index.ts b/projects/addon-editor/directives/index.ts deleted file mode 100644 index 37ddb35b0ffc..000000000000 --- a/projects/addon-editor/directives/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@taiga-ui/addon-editor/directives/image-preview'; -export * from '@taiga-ui/addon-editor/directives/tiptap-editor'; diff --git a/projects/addon-editor/directives/ng-package.json b/projects/addon-editor/directives/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/directives/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/directives/tiptap-editor/index.ts b/projects/addon-editor/directives/tiptap-editor/index.ts deleted file mode 100644 index 4ae7bdaabb84..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './tiptap-editor.directive'; -export * from './tiptap-editor.module'; -export * from './tiptap-editor.service'; diff --git a/projects/addon-editor/directives/tiptap-editor/ng-package.json b/projects/addon-editor/directives/tiptap-editor/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.directive.ts b/projects/addon-editor/directives/tiptap-editor/tiptap-editor.directive.ts deleted file mode 100644 index 5e8ffbf3c011..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.directive.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { - Directive, - ElementRef, - Inject, - Input, - Output, - Renderer2, - Self, -} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import { - INITIALIZATION_TIPTAP_CONTAINER, - TIPTAP_EDITOR, -} from '@taiga-ui/addon-editor/tokens'; -import {TuiDestroyService} from '@taiga-ui/cdk'; -import {Editor} from '@tiptap/core'; -import {Observable} from 'rxjs'; -import {takeUntil} from 'rxjs/operators'; - -import {TuiTiptapEditorService} from './tiptap-editor.service'; - -@Directive({ - selector: '[tuiTiptapEditor]', - providers: [TuiDestroyService], -}) -export class TuiTiptapEditorDirective { - @Input() - set value(value: string) { - this.editor.setValue(value); - } - - @Input() - set editable(editable: boolean) { - this.editor.editable = editable; - } - - @Output() - readonly valueChange = this.editor.valueChange$; - - @Output() - readonly stateChange = this.editor.stateChange$; - - constructor( - @Inject(ElementRef) private readonly el: ElementRef, - @Inject(Renderer2) private readonly renderer: Renderer2, - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - @Inject(INITIALIZATION_TIPTAP_CONTAINER) readonly editorContainer: HTMLElement, - @Inject(TIPTAP_EDITOR) private readonly editorLoaded$: Observable, - @Self() @Inject(TuiDestroyService) destroy$: TuiDestroyService, - ) { - this.editorLoaded$.pipe(takeUntil(destroy$)).subscribe(() => { - this.renderer.appendChild(this.el.nativeElement, this.editorContainer); - }); - } -} diff --git a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.module.ts b/projects/addon-editor/directives/tiptap-editor/tiptap-editor.module.ts deleted file mode 100644 index 06b7e15b262c..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.module.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {NgModule} from '@angular/core'; - -import {TuiTiptapEditorDirective} from './tiptap-editor.directive'; - -@NgModule({ - declarations: [TuiTiptapEditorDirective], - exports: [TuiTiptapEditorDirective], -}) -export class TuiTiptapEditorModule {} diff --git a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.service.ts b/projects/addon-editor/directives/tiptap-editor/tiptap-editor.service.ts deleted file mode 100644 index 72787e4400d9..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.service.ts +++ /dev/null @@ -1,406 +0,0 @@ -import './tiptap-editor.types'; - -import {Inject, Injectable} from '@angular/core'; -import {AbstractTuiEditor} from '@taiga-ui/addon-editor/abstract'; -import {EDITOR_BLANK_COLOR} from '@taiga-ui/addon-editor/constants'; -import type {TuiEditableIframe} from '@taiga-ui/addon-editor/extensions/iframe-editor'; -import type {TuiEditableImage} from '@taiga-ui/addon-editor/extensions/image-editor'; -import type {TuiYoutubeOptions} from '@taiga-ui/addon-editor/extensions/youtube'; -import {TuiEditorAttachedFile} from '@taiga-ui/addon-editor/interfaces'; -import {TIPTAP_EDITOR} from '@taiga-ui/addon-editor/tokens'; -import {tuiGetMarkRange, tuiParseStyle} from '@taiga-ui/addon-editor/utils'; -import {tuiPx} from '@taiga-ui/cdk'; -import type {Editor, Range} from '@tiptap/core'; -import {MarkType} from 'prosemirror-model'; -import {EditorState} from 'prosemirror-state'; -import {Observable} from 'rxjs'; -import {distinctUntilChanged, map, startWith} from 'rxjs/operators'; - -import {tuiIsEmptyParagraph} from './utils/is-empty-paragraph'; - -type Level = 1 | 2 | 3 | 4 | 5 | 6; - -@Injectable() -export class TuiTiptapEditorService extends AbstractTuiEditor { - get isFocused(): boolean { - return this.editor.isFocused; - } - - get html(): string { - return this.editor.getHTML(); - } - - get editable(): boolean { - return this.editor.isEditable; - } - - set editable(editable: boolean) { - this.editor.setEditable(editable); - } - - get state(): EditorState { - return this.editor.state; - } - - editor!: Editor; - - constructor(@Inject(TIPTAP_EDITOR) private readonly editorRef: Observable) { - super(); - - this.editorRef.subscribe(editor => { - this.editor = editor; - - editor.on(`transaction`, () => { - this.stateChange$.next(); - }); - - editor.on(`update`, () => { - const content = editor.getHTML(); - const json = editor.getJSON().content; - const value: string = tuiIsEmptyParagraph(json) ? `` : content; - - this.valueChange$.next(value); - }); - }); - } - - getOriginTiptapEditor(): Editor { - return this.editor; - } - - undoDisabled(): boolean { - return !this.editor.can().undo(); - } - - redoDisabled(): boolean { - return !this.editor.can().redo(); - } - - getFontColor(): string { - return this.editor.getAttributes(`textStyle`).fontColor || EDITOR_BLANK_COLOR; - } - - getFontSize(): number { - return parseInt(this.editor.getAttributes(`textStyle`).fontSize, 10); - } - - setFontSize(size: number): void { - this.editor - .chain() - .setMark(`textStyle`, {fontSize: tuiPx(size)}) - .run(); - } - - getBackgroundColor(): string { - return this.editor?.getAttributes(`textStyle`).backgroundColor || `transparent`; - } - - getCellColor(): string { - return ( - this.editor.getAttributes(`tableCell`).background || - this.editor.getAttributes(`tableHeader`).background - ); - } - - getGroupColor(): string { - if (this.editor.isActive(`group`)) { - const style = this.editor.getAttributes(`group`)?.style ?? ``; - const styles = tuiParseStyle(style); - - return styles[`background-color`] ?? styles[`background`] ?? ``; - } - - return ``; - } - - onAlign(align: string): void { - this.editor.chain().focus().setTextAlign(align).run(); - } - - setImage(src: string): void { - this.editor - .chain() - .focus() - .command(({commands, state}) => { - const setImage = (commands.setEditableImage ?? commands.setImage) as - | ((config: TuiEditableImage) => boolean) - | undefined; - - if (setImage) { - const anchor = state.selection.anchor; - - setImage({src}); - commands.setTextSelection(anchor); - - return true; - } - - return false; - }) - .run(); - } - - undo(): void { - this.editor.chain().undo().run(); - } - - redo(): void { - this.editor.chain().redo().run(); - } - - setHorizontalRule(): void { - this.editor.chain().focus().setHorizontalRule().run(); - } - - removeFormat(): void { - this.editor.commands.unsetAllMarks(); - this.editor.commands.clearNodes(); - } - - setFontColor(color: string): void { - this.editor.chain().focus().setFontColor(color).run(); - } - - setBackgroundColor(color: string): void { - this.editor.chain().focus().setBackgroundColor(color).run(); - } - - toggleUnderline(): void { - this.editor.chain().focus().toggleUnderline().run(); - } - - toggleStrike(): void { - this.editor.chain().focus().toggleStrike().run(); - } - - toggleOrderedList(): void { - this.editor.chain().focus().toggleOrderedList().run(); - } - - toggleUnorderedList(): void { - this.editor.chain().focus().toggleBulletList().run(); - } - - togglePre(): void { - this.editor.chain().focus().toggleCodeBlock().run(); - } - - sinkListItem(): void { - this.editor.chain().focus().sinkListItem(`listItem`).run(); - } - - liftListItem(): void { - this.editor.chain().focus().liftListItem(`listItem`).run(); - } - - isActive(nameOrAttributes: Record | string): boolean { - return this.editor.isActive(nameOrAttributes); - } - - isActive$(nameOrAttributes: Record | string): Observable { - return this.stateChange$.pipe( - startWith(null), - map(() => this.isActive(nameOrAttributes)), - distinctUntilChanged(), - ); - } - - toggleBold(): void { - this.editor.chain().focus().toggleBold().run(); - } - - toggleCode(): void { - this.editor.chain().focus().toggleCode().run(); - } - - toggleItalic(): void { - this.editor.chain().focus().toggleItalic().run(); - } - - toggleBlockquote(): void { - this.editor.chain().focus().toggleBlockquote().run(); - } - - toggleSubscript(): void { - this.editor.chain().focus().toggleSubscript().run(); - } - - toggleSuperscript(): void { - this.editor.chain().focus().toggleSuperscript().run(); - } - - toggleCodeBlock(): void { - this.editor.chain().focus().toggleCodeBlock().run(); - } - - insertTable(cols: number, rows: number): void { - this.editor.chain().focus().insertTable({cols, rows}).run(); - } - - addColumnAfter(): void { - this.editor.chain().focus().addColumnAfter().run(); - } - - addColumnBefore(): void { - this.editor.chain().focus().addColumnBefore().run(); - } - - addRowAfter(): void { - this.editor.chain().focus().addRowAfter().run(); - } - - addRowBefore(): void { - this.editor.chain().focus().addRowBefore().run(); - } - - deleteColumn(): void { - this.editor.chain().focus().deleteColumn().run(); - } - - deleteRow(): void { - this.editor.chain().focus().deleteRow().run(); - } - - mergeCells(): void { - this.editor.chain().focus().mergeCells().run(); - } - - splitCell(): void { - this.editor.chain().focus().splitCell().run(); - } - - canMergeCells(): boolean { - return this.editor.can().mergeCells(); - } - - canSplitCells(): boolean { - return this.editor.can().splitCell(); - } - - setHeading(level: Level): void { - this.editor.chain().focus().setHeading({level}).run(); - } - - setParagraph(options?: {fontSize: string}): void { - this.editor.chain().focus().setParagraph().run(); - - if (options) { - this.editor.chain().setMark(`textStyle`, options).run(); - } - } - - setHardBreak(): void { - this.editor.chain().setHardBreak().run(); - } - - setTextSelection(value: Range | number): void { - this.editor.commands.setTextSelection(value); - } - - toggleLink(href: string): void { - this.editor.chain().focus().toggleLink({href}).run(); - } - - setLink(href: string): void { - this.editor.chain().focus().setLink({href}).run(); - } - - unsetLink(): void { - this.editor.chain().focus().unsetLink().run(); - } - - focus(): void { - this.editor.chain().focus().run(); - } - - setValue(value: string): void { - if (value === this.html || (value === `` && this.html === `

`)) { - return; - } - - this.editor.commands.setContent(value); - this.editor.view.updateState( - EditorState.create({ - schema: this.editor.state.schema, - doc: this.editor.state.doc, - selection: this.editor.state.selection, - storedMarks: this.editor.state.storedMarks, - plugins: this.editor.state.plugins, - }), - ); - } - - destroy(): void { - this.editor.destroy(); - } - - setCellColor(color: string): void { - this.editor.chain().focus().setCellBackground(color).run(); - } - - selectClosest(): void { - const pos = this.editor.state.selection.anchor; - const {schema, doc} = this.editor.state; - const range = tuiGetMarkRange(doc.resolve(pos), schema.marks.link); - - if (range) { - this.editor.chain().setTextSelection(range).run(); - } - } - - enter(): void { - this.editor.commands.enter(); - } - - setDetails(): void { - this.editor.commands.setDetails(); - } - - removeDetails(): void { - this.editor.commands.removeDetails(); - } - - setGroup(): void { - this.editor.commands.setGroup(); - } - - removeGroup(): void { - this.editor.commands.removeGroup(); - } - - setGroupHilite(color: string): void { - this.editor.commands.setGroupHilite(color); - } - - setAnchor(anchor: string): void { - this.editor.commands.setAnchor(anchor.replace(`#`, ``)); - } - - removeAnchor(): void { - this.editor.commands.removeAnchor(); - } - - setFileLink(preview: TuiEditorAttachedFile): void { - this.editor.commands.setFileLink(preview); - } - - setYoutubeVideo(options: TuiYoutubeOptions): void { - this.editor.commands.setYoutubeVideo(options as any); - } - - setIframe(options: TuiEditableIframe): void { - this.editor.commands.setIframe(options); - } - - removeEmptyTextStyle(): void { - this.editor.commands.removeEmptyTextStyle(); - } - - toggleMark( - typeOrName: MarkType | string, - attributes?: Record, - options?: {extendEmptyMarkRange?: boolean}, - ): void { - this.editor.commands.toggleMark(typeOrName, attributes, options); - } -} diff --git a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.types.ts b/projects/addon-editor/directives/tiptap-editor/tiptap-editor.types.ts deleted file mode 100644 index 3112ecd53878..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/tiptap-editor.types.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @note: - * These types are required for build tiptap-editor service. - * don't use import directly as `import '@tiptap/*'` for provide types, - * because the source code of `@tiptap` will be included in bundle - */ -import type {BackgroundColor, FontColor} from '@taiga-ui/addon-editor/extensions'; -import type {TuiDetails} from '@taiga-ui/addon-editor/extensions/details'; -import type {TuiJumpAnchor} from '@taiga-ui/addon-editor/extensions/jump-anchor'; -import type {Youtube} from '@taiga-ui/addon-editor/extensions/youtube'; -import type Highlight from '@tiptap/extension-highlight'; -import type {Image} from '@tiptap/extension-image'; -import type Link from '@tiptap/extension-link'; -import type Subscript from '@tiptap/extension-subscript'; -import type Superscript from '@tiptap/extension-superscript'; -import type Table from '@tiptap/extension-table'; -import type TableCell from '@tiptap/extension-table-cell'; -import type TableHeader from '@tiptap/extension-table-header'; -import type TableRow from '@tiptap/extension-table-row'; -import type TextAlign from '@tiptap/extension-text-align'; -import type TextStyle from '@tiptap/extension-text-style'; -import type Underline from '@tiptap/extension-underline'; -import type StarterKit from '@tiptap/starter-kit'; - -export { - BackgroundColor, - FontColor, - Highlight, - Image, - Link, - StarterKit, - Subscript, - Superscript, - Table, - TableCell, - TableHeader, - TableRow, - TextAlign, - TextStyle, - TuiDetails, - TuiJumpAnchor, - Underline, - Youtube, -}; diff --git a/projects/addon-editor/directives/tiptap-editor/utils/is-empty-paragraph.ts b/projects/addon-editor/directives/tiptap-editor/utils/is-empty-paragraph.ts deleted file mode 100644 index fec73c310fe9..000000000000 --- a/projects/addon-editor/directives/tiptap-editor/utils/is-empty-paragraph.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {JSONContent} from '@tiptap/core'; - -export function tuiIsEmptyParagraph(json?: JSONContent[]): boolean { - return ( - Array.isArray(json) && - json.length === 1 && - json[0].type === `paragraph` && - !json[0].hasOwnProperty(`content`) - ); -} diff --git a/projects/addon-editor/enums/editor-tool.ts b/projects/addon-editor/enums/editor-tool.ts deleted file mode 100644 index c728397632dd..000000000000 --- a/projects/addon-editor/enums/editor-tool.ts +++ /dev/null @@ -1,31 +0,0 @@ -// TODO: change type in v4.0 -// eslint-disable-next-line no-restricted-syntax -export enum TuiEditorTool { - Undo = `undo`, - Anchor = `anchor`, - Size = `fontSize`, - Bold = `bold`, - Italic = `italic`, - Underline = `underline`, - Strikethrough = `strikeThrough`, - Align = `justify`, - List = `list`, - Quote = `quote`, - Color = `foreColor`, - Hilite = `hiliteColor`, - Clear = `clear`, - Link = `link`, - Attach = `attach`, - Tex = `tex`, // Todo - Code = `code`, - Img = `image`, - HR = `insertHorizontalRule`, - Sup = `superscript`, - Sub = `subscript`, - Table = `insertTable`, - MergeCells = `mergeCells`, - SplitCells = `splitCells`, - RowsColumnsManaging = `rowsColumnsManaging`, - Details = `details`, - Group = `group`, -} diff --git a/projects/addon-editor/enums/index.ts b/projects/addon-editor/enums/index.ts deleted file mode 100644 index d431dac97510..000000000000 --- a/projects/addon-editor/enums/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './editor-tool'; diff --git a/projects/addon-editor/enums/ng-package.json b/projects/addon-editor/enums/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/enums/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/extensions/background-color/background-color.ts b/projects/addon-editor/extensions/background-color/background-color.ts deleted file mode 100644 index 329fe71921b1..000000000000 --- a/projects/addon-editor/extensions/background-color/background-color.ts +++ /dev/null @@ -1,70 +0,0 @@ -import '@tiptap/extension-text-style'; - -import {Command, Extension, GlobalAttributes} from '@tiptap/core'; - -interface BackgroundColorOptions { - types: string[]; -} - -declare module '@tiptap/core' { - interface Commands { - backgroundColor: { - /** - * Set the background color - */ - setBackgroundColor: (backgroundColor: string) => ReturnType; - /** - * Unset the background color - */ - unsetBackgroundColor: () => ReturnType; - }; - } -} - -export const BackgroundColor = Extension.create({ - name: `backgroundColor`, - - addOptions(): BackgroundColorOptions { - return { - types: [`textStyle`], - }; - }, - - addGlobalAttributes(): GlobalAttributes { - return [ - { - types: this.options.types, - attributes: { - backgroundColor: { - default: null, - renderHTML: ({backgroundColor}) => - backgroundColor - ? { - style: `background-color: ${backgroundColor}`, - } - : {}, - parseHTML: ({style}) => - style.backgroundColor.replace(/['"]+/g, ``), - keepOnSplit: false, - }, - }, - }, - ]; - }, - - addCommands(): { - setBackgroundColor?: (backgroundColor: string) => Command; - unsetBackgroundColor?: () => Command; - } { - return { - setBackgroundColor: - backgroundColor => - ({chain}) => - chain().setMark(`textStyle`, {backgroundColor}).run(), - unsetBackgroundColor: - () => - ({chain}) => - chain().setMark(`textStyle`, {backgroundColor: null}).run(), - }; - }, -}); diff --git a/projects/addon-editor/extensions/background-color/index.ts b/projects/addon-editor/extensions/background-color/index.ts deleted file mode 100644 index 70aa323453cd..000000000000 --- a/projects/addon-editor/extensions/background-color/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './background-color'; diff --git a/projects/addon-editor/extensions/background-color/ng-package.json b/projects/addon-editor/extensions/background-color/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/background-color/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/default-editor-extensions/default-editor-extensions.ts b/projects/addon-editor/extensions/default-editor-extensions/default-editor-extensions.ts deleted file mode 100644 index 6eaf9759978a..000000000000 --- a/projects/addon-editor/extensions/default-editor-extensions/default-editor-extensions.ts +++ /dev/null @@ -1,52 +0,0 @@ -export const defaultEditorExtensions = [ - import(`@taiga-ui/addon-editor/extensions/starter-kit`) - .then(({StarterKit}) => StarterKit) - .then(extension => extension.configure({heading: {levels: [1, 2, 3, 4, 5, 6]}})), - import(`@tiptap/extension-text-align`).then(({default: TextAlign}) => - TextAlign.configure({types: [`heading`, `paragraph`]}), - ), - import(`@tiptap/extension-text-style`).then(({default: TextStyle}) => TextStyle), - import(`@tiptap/extension-underline`).then(({default: Underline}) => Underline), - import(`@tiptap/extension-subscript`).then(({default: Subscript}) => Subscript), - import(`@tiptap/extension-superscript`).then(({default: Superscript}) => Superscript), - import(`@taiga-ui/addon-editor/extensions/font-color`).then( - ({FontColor}) => FontColor, - ), - import(`@tiptap/extension-image`).then(({default: Image}) => - Image.configure({inline: true, allowBase64: true}), - ), - import(`@taiga-ui/addon-editor/extensions/link`).then(({TuiLink}) => TuiLink), - import(`@taiga-ui/addon-editor/extensions/jump-anchor`).then( - ({TuiJumpAnchor}) => TuiJumpAnchor, - ), - import(`@taiga-ui/addon-editor/extensions/file-link`).then( - ({TuiFileLink}) => TuiFileLink, - ), - import(`@taiga-ui/addon-editor/extensions/background-color`).then( - ({BackgroundColor}) => BackgroundColor, - ), - import(`@taiga-ui/addon-editor/extensions/table`).then(({TuiTable}) => - TuiTable.configure({resizable: true}), - ), - import(`@tiptap/extension-table-row`).then(({default: TableRow}) => TableRow), - import(`@tiptap/extension-table-cell`).then(({default: TableCell}) => TableCell), - import(`@tiptap/extension-table-header`).then(({TableHeader}) => TableHeader), - import(`@taiga-ui/addon-editor/extensions/indent-outdent`).then( - ({TuiTabExtension}) => TuiTabExtension, - ), - import(`@taiga-ui/addon-editor/extensions/table-cell-background`).then( - ({TableCellBackground}) => TableCellBackground, - ), - import(`@taiga-ui/addon-editor/extensions/details`).then( - ({TuiDetailsContent}) => TuiDetailsContent, - ), - import(`@taiga-ui/addon-editor/extensions/details`).then( - ({TuiDetails}) => TuiDetails, - ), - import(`@taiga-ui/addon-editor/extensions/details`).then( - ({TuiSummary}) => TuiSummary, - ), - import(`@taiga-ui/addon-editor/extensions/font-size`).then( - ({TuiFontSize}) => TuiFontSize, - ), -]; diff --git a/projects/addon-editor/extensions/default-editor-extensions/index.ts b/projects/addon-editor/extensions/default-editor-extensions/index.ts deleted file mode 100644 index b29de18d7922..000000000000 --- a/projects/addon-editor/extensions/default-editor-extensions/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './default-editor-extensions'; diff --git a/projects/addon-editor/extensions/default-editor-extensions/ng-package.json b/projects/addon-editor/extensions/default-editor-extensions/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/default-editor-extensions/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/details/details-content.extension.ts b/projects/addon-editor/extensions/details/details-content.extension.ts deleted file mode 100644 index 55812745df74..000000000000 --- a/projects/addon-editor/extensions/details/details-content.extension.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {mergeAttributes, Node} from '@tiptap/core'; - -export interface TuiDetailContentOptions { - readonly HTMLAttributes: Record; -} - -export const TuiDetailsContent = Node.create({ - name: `detailsContent`, - - content: `block+`, - - group: `block`, - - allowGapCursor: true, - - parseHTML() { - return [ - { - tag: `div[data-type="details-content"]`, - }, - ]; - }, - - renderHTML({HTMLAttributes}) { - return [ - `div`, - mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { - 'data-type': `details-content`, - }), - 0, - ]; - }, -}); diff --git a/projects/addon-editor/extensions/details/details.extension.ts b/projects/addon-editor/extensions/details/details.extension.ts deleted file mode 100644 index b0d1459dda7c..000000000000 --- a/projects/addon-editor/extensions/details/details.extension.ts +++ /dev/null @@ -1,105 +0,0 @@ -import {tuiDeleteNode, tuiGetSelectedContent} from '@taiga-ui/addon-editor/utils'; -import {mergeAttributes, Node, RawCommands} from '@tiptap/core'; - -export interface TuiDetailsOptions { - readonly HTMLAttributes: Record; -} - -declare module '@tiptap/core' { - interface Commands { - details: { - setDetails: () => ReturnType; - removeDetails: () => ReturnType; - }; - } -} - -export const TuiDetails = Node.create({ - name: `details`, - - addOptions() { - return { - HTMLAttributes: {}, - }; - }, - - addAttributes() { - return { - opened: { - default: true, - keepOnSplit: false, - parseHTML: element => element.getAttribute(`data-opened`) === `true`, - renderHTML: attributes => ({ - 'data-opened': attributes.opened, - }), - }, - }; - }, - - content: `summary detailsContent`, - - group: `block`, - - allowGapCursor: true, - isolating: true, - - parseHTML() { - return [ - { - tag: `details`, - }, - ]; - }, - - renderHTML({HTMLAttributes}) { - return [ - `div`, - {class: `t-details-wrapper t-details-wrapper_rendered`}, - [`details`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0], - [`button`, {class: `t-details-arrow`}], - ]; - }, - - addNodeView() { - return ({node}) => { - const wrapper = document.createElement(`div`); - const details = document.createElement(`details`); - const button = document.createElement(`button`); - - wrapper.className = `t-details-wrapper`; - button.className = `t-details-arrow`; - - details.open = node.attrs.opened; - - button.addEventListener(`click`, () => { - details.open = !details.open; - (node.attrs as unknown as Record).opened = details.open; - }); - - wrapper.append(details, button); - - return { - dom: wrapper, - contentDOM: details, - }; - }; - }, - - addCommands(): Partial { - return { - setDetails: - () => - ({commands, state}) => { - const content = tuiGetSelectedContent(state); - - return commands.insertContent( - `

${content}

`, - ); - }, - removeDetails: - () => - ({state, dispatch}) => - tuiDeleteNode(state, dispatch, this.name), - }; - }, -}); diff --git a/projects/addon-editor/extensions/details/index.ts b/projects/addon-editor/extensions/details/index.ts deleted file mode 100644 index 3d27b2027b1a..000000000000 --- a/projects/addon-editor/extensions/details/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './details.extension'; -export * from './details-content.extension'; -export * from './summary.extension'; diff --git a/projects/addon-editor/extensions/details/ng-package.json b/projects/addon-editor/extensions/details/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/details/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/details/summary.extension.ts b/projects/addon-editor/extensions/details/summary.extension.ts deleted file mode 100644 index 74c76987e0ac..000000000000 --- a/projects/addon-editor/extensions/details/summary.extension.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {mergeAttributes, Node} from '@tiptap/core'; - -export interface TuiSummaryOptions { - readonly HTMLAttributes: Record; -} - -export const TuiSummary = Node.create({ - name: `summary`, - - addOptions() { - return { - HTMLAttributes: {}, - }; - }, - - content: `paragraph`, - - group: `block`, - - parseHTML() { - return [ - { - tag: `summary`, - }, - ]; - }, - - renderHTML({HTMLAttributes}) { - return [ - `summary`, - mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), - 0, - ]; - }, -}); diff --git a/projects/addon-editor/extensions/file-link/file-link.ts b/projects/addon-editor/extensions/file-link/file-link.ts deleted file mode 100644 index 7795a5dd8fe1..000000000000 --- a/projects/addon-editor/extensions/file-link/file-link.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {TuiEditorAttachedFile} from '@taiga-ui/addon-editor/interfaces'; -import {Extension} from '@tiptap/core'; - -declare module '@tiptap/core' { - interface Commands { - fileLink: { - setFileLink: (preview: TuiEditorAttachedFile) => ReturnType; - }; - } -} - -export const TuiFileLink = Extension.create({ - name: `fileLink`, - - addCommands() { - return { - setFileLink: - fileLink => - ({state, chain}) => { - const {selection} = state; - const selectedSize = Math.abs(selection.to - selection.from); - const whitespace = ` `; - - return ( - selectedSize > 0 - ? chain() - .toggleMark( - `link`, - {href: fileLink.link}, - {extendEmptyMarkRange: true}, - ) - .setTextSelection(selection.to) - .insertContent(whitespace) - : chain().insertContent( - `${fileLink.name}${whitespace}`, - ) - ) - .setTextSelection(selection.to) - .run(); - }, - }; - }, -}); diff --git a/projects/addon-editor/extensions/file-link/index.ts b/projects/addon-editor/extensions/file-link/index.ts deleted file mode 100644 index bf9d3b01f4f6..000000000000 --- a/projects/addon-editor/extensions/file-link/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './file-link'; diff --git a/projects/addon-editor/extensions/file-link/ng-package.json b/projects/addon-editor/extensions/file-link/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/file-link/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/font-color/font-color.ts b/projects/addon-editor/extensions/font-color/font-color.ts deleted file mode 100644 index a329510ffe81..000000000000 --- a/projects/addon-editor/extensions/font-color/font-color.ts +++ /dev/null @@ -1,69 +0,0 @@ -import '@tiptap/extension-text-style'; - -import {Command, Extension, GlobalAttributes} from '@tiptap/core'; - -interface FontColorOptions { - types: string[]; -} - -declare module '@tiptap/core' { - interface Commands { - fontColor: { - /** - * Set the font color - */ - setFontColor: (fontColor: string) => ReturnType; - /** - * Unset the font color - */ - unsetFontColor: () => ReturnType; - }; - } -} - -export const FontColor = Extension.create({ - name: `fontColor`, - - addOptions(): FontColorOptions { - return { - types: [`textStyle`], - }; - }, - - addGlobalAttributes(): GlobalAttributes { - return [ - { - types: this.options.types, - attributes: { - fontColor: { - default: null, - renderHTML: ({fontColor}) => - fontColor - ? { - style: `color: ${fontColor}`, - } - : {}, - parseHTML: ({style}) => style.color.replace(/['"]+/g, ``), - keepOnSplit: false, - }, - }, - }, - ]; - }, - - addCommands(): { - setFontColor?: (fontColor: string) => Command; - unsetFontColor?: () => Command; - } { - return { - setFontColor: - fontColor => - ({chain}) => - chain().setMark(`textStyle`, {fontColor}).run(), - unsetFontColor: - () => - ({chain}) => - chain().setMark(`textStyle`, {fontColor: null}).run(), - }; - }, -}); diff --git a/projects/addon-editor/extensions/font-color/index.ts b/projects/addon-editor/extensions/font-color/index.ts deleted file mode 100644 index c6314861c095..000000000000 --- a/projects/addon-editor/extensions/font-color/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './font-color'; diff --git a/projects/addon-editor/extensions/font-color/ng-package.json b/projects/addon-editor/extensions/font-color/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/font-color/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/font-size/font-size.extension.ts b/projects/addon-editor/extensions/font-size/font-size.extension.ts deleted file mode 100644 index fb777690583b..000000000000 --- a/projects/addon-editor/extensions/font-size/font-size.extension.ts +++ /dev/null @@ -1,62 +0,0 @@ -import '@tiptap/extension-text-style'; - -import {Extension} from '@tiptap/core'; - -declare module '@tiptap/core' { - interface Commands { - fontSize: { - /** - * Set the font size - */ - setFontSize: (fontSize: string) => ReturnType; - /** - * Unset the font size - */ - unsetFontSize: () => ReturnType; - }; - } -} - -interface FontSizeOptions { - types: string[]; -} - -export const TuiFontSize = Extension.create({ - name: `fontSize`, - - addOptions(): FontSizeOptions { - return {types: [`textStyle`]}; - }, - - addGlobalAttributes() { - return [ - { - types: this.options.types, - attributes: { - fontSize: { - default: null, - parseHTML: ({style}) => style.fontSize, - renderHTML: ({fontSize}) => - fontSize ? {style: `font-size: ${fontSize}`} : {}, - }, - }, - }, - ]; - }, - - addCommands() { - return { - setFontSize: - (fontSize: string) => - ({chain}) => - chain().setMark(`textStyle`, {fontSize}).run(), - unsetFontSize: - () => - ({chain}) => - chain() - .setMark(`textStyle`, {fontSize: null}) - .removeEmptyTextStyle() - .run(), - }; - }, -}); diff --git a/projects/addon-editor/extensions/font-size/index.ts b/projects/addon-editor/extensions/font-size/index.ts deleted file mode 100644 index f7af148f62bc..000000000000 --- a/projects/addon-editor/extensions/font-size/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './font-size.extension'; diff --git a/projects/addon-editor/extensions/font-size/ng-package.json b/projects/addon-editor/extensions/font-size/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/font-size/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/group/group.extension.ts b/projects/addon-editor/extensions/group/group.extension.ts deleted file mode 100644 index 7eac5cac0830..000000000000 --- a/projects/addon-editor/extensions/group/group.extension.ts +++ /dev/null @@ -1,142 +0,0 @@ -import {tuiDeleteNode, tuiGetSelectedContent} from '@taiga-ui/addon-editor/utils'; -import {mergeAttributes, Node, RawCommands} from '@tiptap/core'; - -import {TUI_EDITOR_GROUP_DEFAULT_OPTIONS, TuiEditorGroupOptions} from './group.options'; - -declare module '@tiptap/core' { - interface Commands { - group: { - setGroup: () => ReturnType; - setGroupHilite: (color: string) => ReturnType; - removeGroup: () => ReturnType; - }; - } -} - -export const createGroupExtension = ( - options: Partial = {}, -): Node => { - const {draggable, nested, groupNodeClass, groupPointerNodeClass, createOnEnter} = { - ...TUI_EDITOR_GROUP_DEFAULT_OPTIONS, - ...options, - }; - - return Node.create({ - name: `group`, - draggable, - group: `block`, - content: nested ? `block+` : `block`, - - addAttributes() { - return { - style: { - default: null, - parseHTML: element => element.getAttribute(`style`), - renderHTML: attributes => { - if (!attributes.style) { - return {}; - } - - return {style: attributes.style}; - }, - }, - }; - }, - - parseHTML() { - return [{tag: `div[data-type="group"]`}]; - }, - - renderHTML({HTMLAttributes}) { - return [`div`, mergeAttributes(HTMLAttributes, {'data-type': `group`}), 0]; - }, - - addNodeView() { - return ({HTMLAttributes, node}) => { - const dom = document.createElement(`div`); - const content = document.createElement(`div`); - - dom.classList.add(groupNodeClass); - content.setAttribute(`data-type`, `group`); - - if (HTMLAttributes.style) { - (node.attrs as any).style = HTMLAttributes.style; - content.setAttribute(`style`, HTMLAttributes.style); - } - - if (draggable) { - const pointer = document.createElement(`div`); - - pointer.classList.add(groupPointerNodeClass); - pointer.innerHTML = ``; - pointer.contentEditable = `false`; - - dom.append(pointer, content); - } else { - dom.append(content); - } - - return {dom, contentDOM: content}; - }; - }, - - addCommands(): Partial { - return { - setGroup: - () => - ({commands, state}) => { - this.editor.chain().focus().run(); - - const content = tuiGetSelectedContent(state, ``); - const wrapped = content.trim().startsWith(`

`) - ? content - : `

${content}

`; - const result = `
${wrapped}
`; - - return commands.insertContent(result); - }, - setGroupHilite: - (color: string) => - ({editor}) => { - /** - * @note: - * we can't mutate DOM directly in tiptap - * find group element for update style attribute - */ - for ( - let position = editor.state.selection.$anchor, - depth = position.depth; - depth > 0; - depth-- - ) { - const node = position.node(depth); - - if (node.type.name === this.name) { - /** - * @note: - * workaround for `Applying a mismatched transaction` - */ - setTimeout(() => - editor.commands.updateAttributes(node.type, { - style: `background: ${color}`, - }), - ); - - break; - } - } - - return true; - }, - removeGroup: - () => - ({state, dispatch}) => - tuiDeleteNode(state, dispatch, this.name), - }; - }, - - addKeyboardShortcuts(): any { - return createOnEnter ? {Enter: () => this.editor.commands.setGroup()} : {}; - }, - }); -}; diff --git a/projects/addon-editor/extensions/group/group.options.ts b/projects/addon-editor/extensions/group/group.options.ts deleted file mode 100644 index 4fdef21ca76c..000000000000 --- a/projects/addon-editor/extensions/group/group.options.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface TuiEditorGroupOptions { - readonly groupNodeClass: string; - readonly groupPointerNodeClass: string; - readonly draggable: boolean; - readonly nested: boolean; - readonly createOnEnter: boolean; -} - -export const TUI_EDITOR_GROUP_DEFAULT_OPTIONS: TuiEditorGroupOptions = { - groupNodeClass: `tui-group-node`, - groupPointerNodeClass: `tui-group-pointer`, - nested: true, - draggable: true, - createOnEnter: false, -}; diff --git a/projects/addon-editor/extensions/group/index.ts b/projects/addon-editor/extensions/group/index.ts deleted file mode 100644 index 5e57dc209fc6..000000000000 --- a/projects/addon-editor/extensions/group/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './group.extension'; -export * from './group.options'; diff --git a/projects/addon-editor/extensions/group/ng-package.json b/projects/addon-editor/extensions/group/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/group/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.html b/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.html deleted file mode 100644 index 0ac8956e09e9..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.less b/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.less deleted file mode 100644 index dc7a3ccd2f2a..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.less +++ /dev/null @@ -1,4 +0,0 @@ -iframe { - display: inline; - pointer-events: none; -} diff --git a/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.ts b/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.ts deleted file mode 100644 index 41d73ab1137a..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/iframe-editor.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import {ChangeDetectionStrategy, Component, Inject, Self} from '@angular/core'; -import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser'; -import {AbstractTuiEditorResizable} from '@taiga-ui/addon-editor/components/editor-resizable'; -import {TuiDestroyService} from '@taiga-ui/cdk'; - -import { - TUI_IFRAME_EDITOR_OPTIONS, - TuiEditableIframe, - TuiEditableIframeOptions, -} from './iframe-editor.options'; - -@Component({ - selector: 'tui-iframe-editor', - templateUrl: './iframe-editor.component.html', - styleUrls: ['./iframe-editor.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [TuiDestroyService], -}) -export class TuiIframeEditorComponent extends AbstractTuiEditorResizable { - get src(): SafeResourceUrl { - return this.sanitizer.bypassSecurityTrustResourceUrl(this.attrs.src ?? ''); - } - - constructor( - @Inject(TUI_IFRAME_EDITOR_OPTIONS) readonly options: TuiEditableIframeOptions, - @Inject(DOCUMENT) doc: Document, - @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer, - @Self() - @Inject(TuiDestroyService) - destroy$: TuiDestroyService, - ) { - super(doc, destroy$); - } - - updateSize([width, height]: readonly [width: number, height: number]): void { - this._width = Math.max( - this.options.minWidth, - Math.min(this.options.maxWidth, width), - ); - - this._height = Math.max( - this.options.minHeight, - Math.min(this.options.maxHeight, height), - ); - } -} diff --git a/projects/addon-editor/extensions/iframe-editor/iframe-editor.extension.ts b/projects/addon-editor/extensions/iframe-editor/iframe-editor.extension.ts deleted file mode 100644 index d41903d9e28c..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/iframe-editor.extension.ts +++ /dev/null @@ -1,99 +0,0 @@ -import {Injector} from '@angular/core'; -import {TuiNodeView} from '@taiga-ui/addon-editor/extensions/tiptap-node-view'; -import { - Attribute, - mergeAttributes, - Node, - NodeViewRenderer, - NodeViewRendererProps, - RawCommands, -} from '@tiptap/core'; -import {DOMOutputSpec, NodeSpec} from 'prosemirror-model'; - -import {TuiIframeEditorComponent} from './iframe-editor.component'; -import {TuiEditableIframe} from './iframe-editor.options'; - -declare module '@tiptap/core' { - interface Commands { - iframe: { - setIframe: (options: TuiEditableIframe) => ReturnType; - }; - } -} - -export const createIframeEditorExtension = (injector: Injector): Node => { - return Node.create({ - name: `iframe`, - group: `block`, - atom: true, - draggable: false, - - parseHTML(): NodeSpec['parseDOM'] { - return [{tag: `iframe[data-type="iframe-editor"]`}]; - }, - - addAttributes(): Record { - return { - src: { - default: null, - keepOnSplit: false, - parseHTML: element => element.getAttribute(`src`), - }, - frameborder: { - default: 0, - keepOnSplit: false, - parseHTML: element => element.getAttribute(`frameborder`), - }, - width: { - default: `100%`, - keepOnSplit: false, - parseHTML: element => element.getAttribute(`width`), - }, - height: { - default: null, - keepOnSplit: false, - parseHTML: element => element.getAttribute(`height`), - }, - allowfullscreen: { - keepOnSplit: false, - default: this.options.allowFullscreen, - parseHTML: element => element.getAttribute(`allowfullscreen`), - }, - }; - }, - - renderHTML({HTMLAttributes}: Record): DOMOutputSpec { - return [ - `iframe`, - mergeAttributes(HTMLAttributes, {'data-type': `iframe-editor`}), - ]; - }, - - addNodeView(): NodeViewRenderer { - return (props: NodeViewRendererProps) => - new TuiNodeView(TuiIframeEditorComponent, props, {injector, ...props}); - }, - - addCommands(): Partial { - return { - setIframe: - attrs => - ({commands, state}) => { - const prevLine = state.selection.anchor; - - commands.enter(); - commands.setTextSelection(prevLine); - - commands.insertContent({ - type: this.name, - attrs, - }); - - commands.setTextSelection(state.selection.anchor); - - return true; - }, - }; - }, - }); -}; diff --git a/projects/addon-editor/extensions/iframe-editor/iframe-editor.module.ts b/projects/addon-editor/extensions/iframe-editor/iframe-editor.module.ts deleted file mode 100644 index c5b93e56feab..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/iframe-editor.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {NgModule} from '@angular/core'; -import {TuiEditorResizableModule} from '@taiga-ui/addon-editor/components/editor-resizable'; - -import {TuiIframeEditorComponent} from './iframe-editor.component'; - -@NgModule({ - imports: [TuiEditorResizableModule], - declarations: [TuiIframeEditorComponent], - exports: [TuiIframeEditorComponent], -}) -export class TuiIframeEditorModule {} diff --git a/projects/addon-editor/extensions/iframe-editor/iframe-editor.options.ts b/projects/addon-editor/extensions/iframe-editor/iframe-editor.options.ts deleted file mode 100644 index 34b14d0e34e7..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/iframe-editor.options.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {InjectionToken} from '@angular/core'; - -export interface TuiEditableIframeOptions { - minWidth: number; - maxWidth: number; - minHeight: number; - maxHeight: number; -} - -export interface TuiEditableIframe { - src: string | null; - frameborder?: number | null; - allowfullscreen?: boolean | null; - width?: number | string | null; - height?: number | string | null; -} - -/** - * Size of resizable iframe inside editor - */ -export const TUI_IFRAME_EDITOR_OPTIONS = new InjectionToken( - `[TUI_IFRAME_EDITOR_OPTIONS]`, - { - factory: () => ({ - minWidth: 100, - maxWidth: Infinity, - minHeight: 100, - maxHeight: Infinity, - }), - }, -); diff --git a/projects/addon-editor/extensions/iframe-editor/index.ts b/projects/addon-editor/extensions/iframe-editor/index.ts deleted file mode 100644 index 1dd601b6dac0..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './iframe-editor.component'; -export * from './iframe-editor.extension'; -export * from './iframe-editor.module'; -export * from './iframe-editor.options'; diff --git a/projects/addon-editor/extensions/iframe-editor/ng-package.json b/projects/addon-editor/extensions/iframe-editor/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/iframe-editor/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/image-editor/image-editor.component.html b/projects/addon-editor/extensions/image-editor/image-editor.component.html deleted file mode 100644 index 0ed02e1defef..000000000000 --- a/projects/addon-editor/extensions/image-editor/image-editor.component.html +++ /dev/null @@ -1,30 +0,0 @@ - - -

- - - -

diff --git a/projects/addon-editor/extensions/image-editor/image-editor.component.less b/projects/addon-editor/extensions/image-editor/image-editor.component.less deleted file mode 100644 index f141071d1317..000000000000 --- a/projects/addon-editor/extensions/image-editor/image-editor.component.less +++ /dev/null @@ -1,15 +0,0 @@ -:host { - &[data-drag-handle] { - cursor: move; - } -} - -img { - pointer-events: none; -} - -.t-emulate-inline-node { - display: inline-block; - margin: 0; - height: 0; -} diff --git a/projects/addon-editor/extensions/image-editor/image-editor.component.ts b/projects/addon-editor/extensions/image-editor/image-editor.component.ts deleted file mode 100644 index 5747e11f7839..000000000000 --- a/projects/addon-editor/extensions/image-editor/image-editor.component.ts +++ /dev/null @@ -1,98 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import { - ChangeDetectionStrategy, - Component, - ElementRef, - HostBinding, - HostListener, - Inject, - Self, -} from '@angular/core'; -import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser'; -import {WINDOW} from '@ng-web-apis/common'; -import {AbstractTuiEditorResizable} from '@taiga-ui/addon-editor/components/editor-resizable'; -import {TuiDestroyService} from '@taiga-ui/cdk'; - -import { - TUI_EDITOR_MAX_IMAGE_WIDTH, - TUI_EDITOR_MIN_IMAGE_WIDTH, - TUI_IMAGE_EDITOR_OPTIONS, - TuiEditableImage, - TuiImageEditorOptions, -} from './image-editor.options'; - -@Component({ - selector: 'tui-image-editor', - templateUrl: './image-editor.component.html', - styleUrls: ['./image-editor.component.less'], - providers: [TuiDestroyService], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class TuiImageEditorComponent extends AbstractTuiEditorResizable { - @HostBinding('attr.contenteditable') - contenteditable = true; - - focused = false; - - @HostBinding('attr.data-drag-handle') - get dragHandle(): '' | null { - return this.attrs.draggable ?? null; - } - - override get height(): number | string | null { - return null; - } - - get alt(): string { - return this.attrs.alt || ''; - } - - get title(): string { - return this.attrs.title || ''; - } - - get src(): SafeResourceUrl { - return this.sanitizer.bypassSecurityTrustResourceUrl(this.attrs.src); - } - - constructor( - @Inject(TUI_EDITOR_MIN_IMAGE_WIDTH) readonly minWidth: number | null, - @Inject(TUI_EDITOR_MAX_IMAGE_WIDTH) readonly maxWidth: number | null, - @Inject(TUI_IMAGE_EDITOR_OPTIONS) readonly options: TuiImageEditorOptions, - @Inject(DOCUMENT) doc: Document, - @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer, - @Self() - @Inject(TuiDestroyService) - destroy$: TuiDestroyService, - @Inject(ElementRef) private readonly el: ElementRef, - @Inject(WINDOW) private readonly win: Window, - ) { - super(doc, destroy$); - } - - @HostListener('document:click.silent', ['$event.target']) - currentTargetIsFocused(node: Node): void { - this.focused = this.el.nativeElement.contains(node); - - if (this.focused) { - this.selectFakeText(); - } - } - - updateSize([width]: readonly [width: number, height: number]): void { - const minWidth = this.minWidth ?? this.options.minWidth; - const maxWidth = this.maxWidth ?? this.options.maxWidth; - - this._width = Math.max(minWidth, Math.min(maxWidth, width)); - } - - private selectFakeText(): void { - const range = this.doc.createRange(); - - this.el.nativeElement.querySelector('p')?.focus(); - - range.selectNode(this.el.nativeElement); - this.win.getSelection()?.removeAllRanges(); - this.win.getSelection()?.addRange(range); - } -} diff --git a/projects/addon-editor/extensions/image-editor/image-editor.extension.ts b/projects/addon-editor/extensions/image-editor/image-editor.extension.ts deleted file mode 100644 index e3ce80a85eb7..000000000000 --- a/projects/addon-editor/extensions/image-editor/image-editor.extension.ts +++ /dev/null @@ -1,160 +0,0 @@ -import {Injector} from '@angular/core'; -import {TuiNodeView} from '@taiga-ui/addon-editor/extensions/tiptap-node-view'; -import {tuiIsPresent} from '@taiga-ui/cdk'; -import { - Attribute, - mergeAttributes, - Node, - NodeViewRenderer, - NodeViewRendererProps, - RawCommands, -} from '@tiptap/core'; -import {Image} from '@tiptap/extension-image'; -import {Plugin} from '@tiptap/pm/state'; -import {DOMOutputSpec, NodeSpec} from 'prosemirror-model'; -import {EditorView} from 'prosemirror-view'; - -import {TuiImageEditorComponent} from './image-editor.component'; -import type {TuiEditableImage} from './image-editor.options'; - -declare module '@tiptap/core' { - interface Commands { - imageEditor: { - setEditableImage: (imageConfigs: TuiEditableImage) => ReturnType; - }; - } -} - -const IMAGE_EDITOR_PARSE_META = [{tag: `img[data-type="image-editor"]`}]; - -const DEFAULT_IMAGE_ATTRS = { - src: { - default: ``, - keepOnSplit: false, - }, - width: { - default: 300, - keepOnSplit: false, - }, - alt: { - default: ``, - keepOnSplit: false, - }, - title: { - default: ``, - keepOnSplit: false, - }, -}; - -/** - * @deprecated: use {@link tuiCreateImageEditorExtension} - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -export function createImageEditorExtension( - injector: Injector, - {draggable}: Partial<{draggable: boolean}> = {}, -): Node { - const enableDraggable = tuiIsPresent(draggable) ? draggable : true; - - return Image.extend({ - name: `imageEditor`, - group: `inline`, - inline: true, - atom: true, - priority: 0, - selectable: true, - draggable: enableDraggable, - - parseHTML(): NodeSpec['parseDOM'] { - return IMAGE_EDITOR_PARSE_META; - }, - - addAttributes(): Record { - return { - ...DEFAULT_IMAGE_ATTRS, - draggable: { - default: enableDraggable ? `` : null, - keepOnSplit: false, - }, - }; - }, - - renderHTML({HTMLAttributes}: Record): DOMOutputSpec { - return [ - `img`, - mergeAttributes(HTMLAttributes, {'data-type': `image-editor`}), - ]; - }, - - addNodeView(): NodeViewRenderer { - return (props: NodeViewRendererProps) => - new TuiNodeView(TuiImageEditorComponent, props, {injector, ...props}); - }, - - addCommands(): Partial { - return { - setEditableImage: - attrs => - ({commands}) => - commands.insertContent({ - type: this.name, - attrs, - }), - }; - }, - - addProseMirrorPlugins() { - return [ - new Plugin({ - props: { - handleDOMEvents: { - paste: pasteImage, - drop: pasteImage, - }, - }, - }), - ]; - }, - }); -} - -function pasteImage(view: EditorView, event: ClipboardEvent | DragEvent): void { - const dataTransfer = - event instanceof DragEvent ? event.dataTransfer : event.clipboardData; - const images = Array.from(dataTransfer?.files ?? []).filter(file => - /image/i.test(file.type), - ); - - if (images.length) { - event.preventDefault(); - } - - for (const image of images) { - const reader = new FileReader(); - - reader.onload = readerEvent => { - const node = view.state.schema.nodes.imageEditor.create({ - src: readerEvent.target?.result, - }); - const transaction = view.state.tr.replaceSelectionWith(node); - - /** - * @note: - * workaround for `Applying a mismatched transaction` - */ - setTimeout(() => view.dispatch(transaction)); - }; - - reader.readAsDataURL(image); - } -} - -export function tuiCreateImageEditorExtension({ - injector, - draggable, -}: { - injector: Injector; - draggable?: boolean; -}): Node { - return createImageEditorExtension(injector, {draggable}); -} diff --git a/projects/addon-editor/extensions/image-editor/image-editor.module.ts b/projects/addon-editor/extensions/image-editor/image-editor.module.ts deleted file mode 100644 index dcfb6ecdd67a..000000000000 --- a/projects/addon-editor/extensions/image-editor/image-editor.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiEditorResizableModule} from '@taiga-ui/addon-editor/components/editor-resizable'; - -import {TuiImageEditorComponent} from './image-editor.component'; - -@NgModule({ - imports: [CommonModule, TuiEditorResizableModule], - declarations: [TuiImageEditorComponent], - exports: [TuiImageEditorComponent], -}) -export class TuiImageEditorModule {} diff --git a/projects/addon-editor/extensions/image-editor/image-editor.options.ts b/projects/addon-editor/extensions/image-editor/image-editor.options.ts deleted file mode 100644 index 56892acbbd22..000000000000 --- a/projects/addon-editor/extensions/image-editor/image-editor.options.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {InjectionToken} from '@angular/core'; - -export interface TuiImageEditorOptions { - minWidth: number; - maxWidth: number; -} - -export interface TuiEditableImage { - src: string; - width?: number | string; - alt?: string; - title?: string; - draggable?: '' | null; -} - -/** - * Min size of resizable image inside editor - * @deprecated use {@link TUI_IMAGE_EDITOR_OPTIONS} instead - * TODO: remove in v4.0 - */ -export const TUI_EDITOR_MIN_IMAGE_WIDTH = new InjectionToken( - `[TUI_EDITOR_MIN_IMAGE_WIDTH]`, - { - factory: () => null, - }, -); - -/** - * Max size of resizable image inside editor - * @deprecated use {@link TUI_IMAGE_EDITOR_OPTIONS} instead - * TODO: remove in v4.0 - */ -export const TUI_EDITOR_MAX_IMAGE_WIDTH = new InjectionToken( - `[TUI_EDITOR_MAX_IMAGE_WIDTH]`, - { - factory: () => null, - }, -); - -/** - * Size of resizable image inside editor - */ -export const TUI_IMAGE_EDITOR_OPTIONS = new InjectionToken( - `[TUI_IMAGE_EDITOR_OPTIONS]`, - { - factory: () => ({ - minWidth: 100, - maxWidth: Infinity, - }), - }, -); diff --git a/projects/addon-editor/extensions/image-editor/index.ts b/projects/addon-editor/extensions/image-editor/index.ts deleted file mode 100644 index 63f9e8f6f10f..000000000000 --- a/projects/addon-editor/extensions/image-editor/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './image-editor.component'; -export * from './image-editor.extension'; -export * from './image-editor.module'; -export * from './image-editor.options'; diff --git a/projects/addon-editor/extensions/image-editor/ng-package.json b/projects/addon-editor/extensions/image-editor/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/image-editor/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/indent-outdent/indent-outdent.ts b/projects/addon-editor/extensions/indent-outdent/indent-outdent.ts deleted file mode 100644 index 26faf9cb58d5..000000000000 --- a/projects/addon-editor/extensions/indent-outdent/indent-outdent.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {Editor, Extension} from '@tiptap/core'; - -export function tuiIsOrderedOrBulletList(editor: Editor): boolean { - return editor.isActive(`bulletList`) || editor.isActive(`orderedList`); -} - -export const TuiTabExtension = Extension.create({ - name: `indent`, - - addKeyboardShortcuts(): any { - return { - Tab: () => - tuiIsOrderedOrBulletList(this.editor) - ? null - : this.editor.commands.insertContent(`\t`), - }; - }, -}); diff --git a/projects/addon-editor/extensions/indent-outdent/index.ts b/projects/addon-editor/extensions/indent-outdent/index.ts deleted file mode 100644 index dc1be7678474..000000000000 --- a/projects/addon-editor/extensions/indent-outdent/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './indent-outdent'; diff --git a/projects/addon-editor/extensions/indent-outdent/ng-package.json b/projects/addon-editor/extensions/indent-outdent/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/indent-outdent/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/index.ts b/projects/addon-editor/extensions/index.ts deleted file mode 100644 index d775e21cb67c..000000000000 --- a/projects/addon-editor/extensions/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from '@taiga-ui/addon-editor/extensions/background-color'; -export * from '@taiga-ui/addon-editor/extensions/default-editor-extensions'; -export * from '@taiga-ui/addon-editor/extensions/file-link'; -export * from '@taiga-ui/addon-editor/extensions/font-color'; -export * from '@taiga-ui/addon-editor/extensions/font-size'; -export * from '@taiga-ui/addon-editor/extensions/group'; -export * from '@taiga-ui/addon-editor/extensions/iframe-editor'; -export * from '@taiga-ui/addon-editor/extensions/image-editor'; -export * from '@taiga-ui/addon-editor/extensions/indent-outdent'; -export * from '@taiga-ui/addon-editor/extensions/link'; -export * from '@taiga-ui/addon-editor/extensions/media'; -export * from '@taiga-ui/addon-editor/extensions/starter-kit'; -export * from '@taiga-ui/addon-editor/extensions/table'; -export * from '@taiga-ui/addon-editor/extensions/table-cell-background'; -export * from '@taiga-ui/addon-editor/extensions/tiptap-node-view'; diff --git a/projects/addon-editor/extensions/jump-anchor/index.ts b/projects/addon-editor/extensions/jump-anchor/index.ts deleted file mode 100644 index a003f0b7ea70..000000000000 --- a/projects/addon-editor/extensions/jump-anchor/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './jump-anchor.extension'; diff --git a/projects/addon-editor/extensions/jump-anchor/jump-anchor.extension.ts b/projects/addon-editor/extensions/jump-anchor/jump-anchor.extension.ts deleted file mode 100644 index 510bb99137ee..000000000000 --- a/projects/addon-editor/extensions/jump-anchor/jump-anchor.extension.ts +++ /dev/null @@ -1,61 +0,0 @@ -import {Mark, mergeAttributes} from '@tiptap/core'; - -declare module '@tiptap/core' { - interface Commands { - anchor: { - setAnchor: (id: string) => ReturnType; - removeAnchor: () => ReturnType; - }; - } -} - -export const TuiJumpAnchor = Mark.create({ - name: `jumpAnchor`, - priority: 1000, - keepOnSplit: false, - - addAttributes() { - return { - id: { - default: null, - parseHTML: element => element.getAttribute(`id`), - renderHTML: attributes => { - if (!attributes.id) { - return {}; - } - - return {id: attributes.id}; - }, - }, - }; - }, - - parseHTML() { - return [{tag: `a[data-type="jump-anchor"]`}]; - }, - - renderHTML({HTMLAttributes}) { - return [`a`, mergeAttributes({'data-type': `jump-anchor`}, HTMLAttributes), 0]; - }, - - addCommands() { - return { - setAnchor: - id => - ({chain}) => { - return chain() - .extendMarkRange(`jumpAnchor`) - .setMark(`jumpAnchor`, {id}) - .run(); - }, - - removeAnchor: - () => - ({chain}) => { - return chain() - .unsetMark(this.name, {extendEmptyMarkRange: true}) - .run(); - }, - }; - }, -}); diff --git a/projects/addon-editor/extensions/jump-anchor/ng-package.json b/projects/addon-editor/extensions/jump-anchor/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/jump-anchor/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/link/index.ts b/projects/addon-editor/extensions/link/index.ts deleted file mode 100644 index e33728e03e84..000000000000 --- a/projects/addon-editor/extensions/link/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './link'; diff --git a/projects/addon-editor/extensions/link/link.ts b/projects/addon-editor/extensions/link/link.ts deleted file mode 100644 index 70d7ae62dcdb..000000000000 --- a/projects/addon-editor/extensions/link/link.ts +++ /dev/null @@ -1,47 +0,0 @@ -import {tuiParseNodeAttributes} from '@taiga-ui/addon-editor/utils'; -import {getHTMLFromFragment} from '@tiptap/core'; -import {Link} from '@tiptap/extension-link'; - -export const TuiLink = Link.extend({ - addAttributes() { - return { - ...this.parent?.(), - ...tuiParseNodeAttributes([`download`]), - }; - }, - - addCommands() { - return { - ...this.parent?.(), - toggleLink: - attributes => - ({chain, state}) => { - // eslint-disable-next-line no-lone-blocks - { - const {selection, doc} = state; - const selected = doc.cut(selection.to, selection.to + 1); - const sliced = getHTMLFromFragment( - selected.content, - state.schema, - ).replace(/<\/?[^>]+(>|$)/g, ``); - const forwardSymbolIsWhitespace = sliced === ` `; - - const toggleMark = chain().toggleMark(this.name, attributes, { - extendEmptyMarkRange: true, - }); - - return ( - forwardSymbolIsWhitespace - ? toggleMark.setTextSelection(selection.to + 1) - : toggleMark.setTextSelection(selection.to).insertContent( - // require: `@tiptap/extension-text-style` - ` `, - ) - ).run(); - } - }, - }; - }, -}).configure({ - openOnClick: false, -}); diff --git a/projects/addon-editor/extensions/link/ng-package.json b/projects/addon-editor/extensions/link/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/link/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/media/audio.extension.ts b/projects/addon-editor/extensions/media/audio.extension.ts deleted file mode 100644 index ec02e5bb8a7f..000000000000 --- a/projects/addon-editor/extensions/media/audio.extension.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {TUI_DEFAULT_HTML5_MEDIA_ATTRIBUTES} from '@taiga-ui/addon-editor/constants'; -import {tuiGetNestedNodes, tuiParseNodeAttributes} from '@taiga-ui/addon-editor/utils'; -import {Node} from '@tiptap/core'; -import {MarkSpec} from 'prosemirror-model'; - -export const TuiAudio = Node.create({ - name: `audio`, - group: `block`, - content: `source+`, - - addAttributes() { - return tuiParseNodeAttributes(TUI_DEFAULT_HTML5_MEDIA_ATTRIBUTES); - }, - - parseHTML(): MarkSpec['parseDOM'] { - return [{tag: `audio`}]; - }, - - renderHTML({node, HTMLAttributes}) { - return [`audio`, HTMLAttributes, ...tuiGetNestedNodes(node)]; - }, -}); diff --git a/projects/addon-editor/extensions/media/index.ts b/projects/addon-editor/extensions/media/index.ts deleted file mode 100644 index 4dd920972e27..000000000000 --- a/projects/addon-editor/extensions/media/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './audio.extension'; -export * from './source.extension'; -export * from './video.extension'; diff --git a/projects/addon-editor/extensions/media/ng-package.json b/projects/addon-editor/extensions/media/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/media/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/media/source.extension.ts b/projects/addon-editor/extensions/media/source.extension.ts deleted file mode 100644 index 1c7e1a9c5d25..000000000000 --- a/projects/addon-editor/extensions/media/source.extension.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {tuiParseNodeAttributes} from '@taiga-ui/addon-editor/utils'; -import {mergeAttributes, Node} from '@tiptap/core'; -import {MarkSpec} from 'prosemirror-model'; - -export const TuiSource = Node.create({ - name: `source`, - - addAttributes() { - return tuiParseNodeAttributes([ - `src`, - `type`, - `width`, - `height`, - `media`, - `sizes`, - `srcset`, - ]); - }, - - parseHTML(): MarkSpec['parseDOM'] { - return [{tag: `source`}]; - }, - - renderHTML({HTMLAttributes}: Record) { - return [`source`, mergeAttributes(HTMLAttributes)]; - }, -}); diff --git a/projects/addon-editor/extensions/media/video.extension.ts b/projects/addon-editor/extensions/media/video.extension.ts deleted file mode 100644 index cb3c53105188..000000000000 --- a/projects/addon-editor/extensions/media/video.extension.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {TUI_DEFAULT_HTML5_MEDIA_ATTRIBUTES} from '@taiga-ui/addon-editor/constants'; -import {tuiGetNestedNodes, tuiParseNodeAttributes} from '@taiga-ui/addon-editor/utils'; -import {Node} from '@tiptap/core'; -import {MarkSpec} from 'prosemirror-model'; - -export const TuiVideo = Node.create({ - name: `video`, - group: `block`, - content: `source+`, - - addAttributes() { - return tuiParseNodeAttributes(TUI_DEFAULT_HTML5_MEDIA_ATTRIBUTES); - }, - - parseHTML(): MarkSpec['parseDOM'] { - return [{tag: `video`}]; - }, - - renderHTML({node, HTMLAttributes}) { - return [`video`, HTMLAttributes, ...tuiGetNestedNodes(node)]; - }, -}); diff --git a/projects/addon-editor/extensions/ng-package.json b/projects/addon-editor/extensions/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/extensions/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/extensions/starter-kit/index.ts b/projects/addon-editor/extensions/starter-kit/index.ts deleted file mode 100644 index 908bc6a009f9..000000000000 --- a/projects/addon-editor/extensions/starter-kit/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './starter-kit'; diff --git a/projects/addon-editor/extensions/starter-kit/ng-package.json b/projects/addon-editor/extensions/starter-kit/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/starter-kit/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/starter-kit/starter-kit.ts b/projects/addon-editor/extensions/starter-kit/starter-kit.ts deleted file mode 100644 index 8f0cfb8ceac3..000000000000 --- a/projects/addon-editor/extensions/starter-kit/starter-kit.ts +++ /dev/null @@ -1,132 +0,0 @@ -import {Extension} from '@tiptap/core'; -import {Blockquote, BlockquoteOptions} from '@tiptap/extension-blockquote'; -import {Bold, BoldOptions} from '@tiptap/extension-bold'; -import {BulletList, BulletListOptions} from '@tiptap/extension-bullet-list'; -import {Code, CodeOptions} from '@tiptap/extension-code'; -import {CodeBlock, CodeBlockOptions} from '@tiptap/extension-code-block'; -import {Document} from '@tiptap/extension-document'; -import {Dropcursor, DropcursorOptions} from '@tiptap/extension-dropcursor'; -import {Gapcursor} from '@tiptap/extension-gapcursor'; -import {HardBreak, HardBreakOptions} from '@tiptap/extension-hard-break'; -import {Heading, HeadingOptions} from '@tiptap/extension-heading'; -import {History, HistoryOptions} from '@tiptap/extension-history'; -import {HorizontalRule, HorizontalRuleOptions} from '@tiptap/extension-horizontal-rule'; -import {Italic, ItalicOptions} from '@tiptap/extension-italic'; -import {ListItem, ListItemOptions} from '@tiptap/extension-list-item'; -import {OrderedList, OrderedListOptions} from '@tiptap/extension-ordered-list'; -import {Paragraph, ParagraphOptions} from '@tiptap/extension-paragraph'; -import {Strike, StrikeOptions} from '@tiptap/extension-strike'; -import {Text} from '@tiptap/extension-text'; - -export interface TuiStarterKitOptions { - blockquote: Partial | false; - bold: Partial | false; - bulletList: Partial | false; - code: Partial | false; - codeBlock: Partial | false; - document: false; - dropcursor: Partial | false; - gapcursor: false; - hardBreak: Partial | false; - heading: Partial | false; - history: Partial | false; - horizontalRule: Partial | false; - italic: Partial | false; - listItem: Partial | false; - orderedList: Partial | false; - paragraph: Partial | false; - strike: Partial | false; - text: false; -} - -export const StarterKit = Extension.create({ - name: `starterKit`, - - // eslint-disable-next-line max-statements - addExtensions() { - const extensions = []; - - // note: in runtime it possibly be undefined - const options = this.options as Partial | undefined; - - if (options?.blockquote !== false) { - extensions.push(Blockquote.configure(options?.blockquote)); - } - - if (options?.bold !== false) { - extensions.push(Bold.configure(options?.bold)); - } - - if (options?.bulletList !== false) { - extensions.push(BulletList.configure(options?.bulletList)); - } - - if (options?.code !== false) { - extensions.push(Code.configure(options?.code)); - } - - if (options?.codeBlock !== false) { - extensions.push(CodeBlock.configure(options?.codeBlock)); - } - - if (options?.document !== false) { - extensions.push(Document.configure(options?.document)); - } - - if (options?.dropcursor !== false) { - extensions.push(Dropcursor.configure(options?.dropcursor)); - } - - if (options?.gapcursor !== false) { - extensions.push(Gapcursor.configure(options?.gapcursor)); - } - - if (options?.hardBreak !== false) { - extensions.push(HardBreak.configure(options?.hardBreak)); - } - - if (options?.heading !== false) { - extensions.push(Heading.configure(options?.heading)); - } - - if (options?.history !== false) { - extensions.push( - History.configure({ - depth: 10, - newGroupDelay: 100, - ...options?.history, - }), - ); - } - - if (options?.horizontalRule !== false) { - extensions.push(HorizontalRule.configure(options?.horizontalRule)); - } - - if (options?.italic !== false) { - extensions.push(Italic.configure(options?.italic)); - } - - if (options?.listItem !== false) { - extensions.push(ListItem.configure(options?.listItem)); - } - - if (options?.orderedList !== false) { - extensions.push(OrderedList.configure(options?.orderedList)); - } - - if (options?.paragraph !== false) { - extensions.push(Paragraph.configure(options?.paragraph)); - } - - if (options?.strike !== false) { - extensions.push(Strike.configure(options?.strike)); - } - - if (options?.text !== false) { - extensions.push(Text.configure(options?.text)); - } - - return extensions; - }, -}); diff --git a/projects/addon-editor/extensions/table-cell-background/index.ts b/projects/addon-editor/extensions/table-cell-background/index.ts deleted file mode 100644 index 29c93a95af7f..000000000000 --- a/projects/addon-editor/extensions/table-cell-background/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './table-cell-background'; diff --git a/projects/addon-editor/extensions/table-cell-background/ng-package.json b/projects/addon-editor/extensions/table-cell-background/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/table-cell-background/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/table-cell-background/table-cell-background.ts b/projects/addon-editor/extensions/table-cell-background/table-cell-background.ts deleted file mode 100644 index f4067f4a32e3..000000000000 --- a/projects/addon-editor/extensions/table-cell-background/table-cell-background.ts +++ /dev/null @@ -1,55 +0,0 @@ -import {Command, Extension, GlobalAttributes} from '@tiptap/core'; - -declare module '@tiptap/core' { - interface Commands { - cellBackground: { - setCellBackground: (background: string) => ReturnType; - unsetCellBackground: () => ReturnType; - }; - } -} - -export const TableCellBackground = Extension.create({ - addGlobalAttributes(): GlobalAttributes { - return [ - { - types: [`tableCell`, `tableHeader`], - attributes: { - background: { - default: null, - renderHTML: ({background}) => - background - ? { - style: `background: ${background}`, - } - : null, - parseHTML: ({style}) => style.background, - keepOnSplit: false, - }, - }, - }, - ]; - }, - - addCommands(): { - setCellBackground: (background: string) => Command; - unsetCellBackground: () => Command; - } { - return { - setCellBackground: - background => - ({chain}) => - chain() - .updateAttributes(`tableCell`, {background}) - .updateAttributes(`tableHeader`, {background}) - .run(), - unsetCellBackground: - () => - ({chain}) => - chain() - .updateAttributes(`tableCell`, {background: null}) - .updateAttributes(`tableHeader`, {background: null}) - .run(), - }; - }, -}); diff --git a/projects/addon-editor/extensions/table/index.ts b/projects/addon-editor/extensions/table/index.ts deleted file mode 100644 index 01643f0f57fd..000000000000 --- a/projects/addon-editor/extensions/table/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './table'; diff --git a/projects/addon-editor/extensions/table/ng-package.json b/projects/addon-editor/extensions/table/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/table/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/table/table.ts b/projects/addon-editor/extensions/table/table.ts deleted file mode 100644 index d6daf6905914..000000000000 --- a/projects/addon-editor/extensions/table/table.ts +++ /dev/null @@ -1,55 +0,0 @@ -import {mergeAttributes} from '@tiptap/core'; -import {Table} from '@tiptap/extension-table'; -import {Node as ProseMirrorNode} from 'prosemirror-model'; - -export const TuiTable = Table.extend({ - renderHTML({node, HTMLAttributes}) { - let totalWidth = 0; - let fixedWidth = true; - - try { - const tr = ( - (node.content as unknown as ProseMirrorNode) - ?.content as unknown as ProseMirrorNode[] - )[0]; // use first row to determine width of table; - - (tr?.content as unknown as ProseMirrorNode)?.content.forEach(td => { - if (td.attrs.colwidth) { - td.attrs.colwidth.forEach((col: any) => { - if (!col) { - fixedWidth = false; - totalWidth += this.options.cellMinWidth; - } else { - totalWidth += col; - } - }); - } else { - fixedWidth = false; - const colspan = td.attrs.colspan || 1; - - totalWidth += this.options.cellMinWidth * colspan; - } - }); - } catch (error) { - fixedWidth = false; - } - - if (fixedWidth && totalWidth > 0) { - HTMLAttributes.style = `width: ${totalWidth}px;`; - } else if (totalWidth && totalWidth > 0) { - HTMLAttributes.style = `min-width: ${totalWidth}px`; - } else { - HTMLAttributes.style = null; - } - - return [ - `div`, - {class: `tui-table-wrapper`}, - [ - `table`, - mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), - [`tbody`, 0], - ], - ]; - }, -}); diff --git a/projects/addon-editor/extensions/tiptap-node-view/component-render.ts b/projects/addon-editor/extensions/tiptap-node-view/component-render.ts deleted file mode 100644 index 37e141b126ec..000000000000 --- a/projects/addon-editor/extensions/tiptap-node-view/component-render.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { - ApplicationRef, - ComponentFactoryResolver, - ComponentRef, - ElementRef, - Injector, - Type, -} from '@angular/core'; - -/** - * Copied from - * {@link https://github.com/sibiraj-s/ngx-tiptap/blob/master/projects/ngx-tiptap/src/lib/AngularRenderer.ts ngx-tiptap} - */ -export class TuiComponentRenderer { - private readonly componentRef: ComponentRef; - - constructor(component: Type, injector: Injector, props: Partial

) { - const applicationRef = injector.get(ApplicationRef); - - const componentFactoryResolver = injector.get(ComponentFactoryResolver); - const factory = componentFactoryResolver.resolveComponentFactory(component); - - this.componentRef = factory.create(injector, []); - - // set input props to the component - this.updateProps(props); - - // Attach to the view so that the change detector knows to run - applicationRef.attachView(this.componentRef.hostView); - } - - get instance(): C { - return this.componentRef.instance; - } - - get el(): ElementRef { - return this.componentRef.injector.get(ElementRef); - } - - get dom(): HTMLElement { - return this.el.nativeElement; - } - - updateProps(props: Partial): void { - Object.entries(props).forEach(([key, value]) => { - this.instance[key as keyof C] = value as C[keyof C]; - }); - } - - detectChanges(): void { - this.componentRef.changeDetectorRef.detectChanges(); - } - - destroy(): void { - this.componentRef.destroy(); - } -} diff --git a/projects/addon-editor/extensions/tiptap-node-view/index.ts b/projects/addon-editor/extensions/tiptap-node-view/index.ts deleted file mode 100644 index dee48a90200c..000000000000 --- a/projects/addon-editor/extensions/tiptap-node-view/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './component-render'; -export * from './node-view-render'; diff --git a/projects/addon-editor/extensions/tiptap-node-view/ng-package.json b/projects/addon-editor/extensions/tiptap-node-view/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/extensions/tiptap-node-view/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/extensions/tiptap-node-view/node-view-render.ts b/projects/addon-editor/extensions/tiptap-node-view/node-view-render.ts deleted file mode 100644 index 27e22f685d19..000000000000 --- a/projects/addon-editor/extensions/tiptap-node-view/node-view-render.ts +++ /dev/null @@ -1,174 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import {Injector, Type} from '@angular/core'; -import { - DecorationWithType, - Editor, - NodeView, - NodeViewProps, - NodeViewRenderer, - NodeViewRendererOptions, - NodeViewRendererProps, -} from '@tiptap/core'; -import type {Node as ProseMirrorNode} from 'prosemirror-model'; -import type {Decoration} from 'prosemirror-view'; - -import {TuiComponentRenderer} from './component-render'; - -/** - * You should extend this class to create custom - * Tiptap's {@link https://tiptap.dev/guide/node-views NodeView} from angular component. - * It contains compulsory properties which component will get externally while NodeView's rendering. - */ -export class TuiNodeViewNgComponent implements NodeViewProps { - editor!: NodeViewProps['editor']; - node!: NodeViewProps['node']; - decorations!: NodeViewProps['decorations']; - selected!: NodeViewProps['selected']; - extension!: NodeViewProps['extension']; - getPos!: NodeViewProps['getPos']; - updateAttributes!: NodeViewProps['updateAttributes']; - deleteNode!: NodeViewProps['deleteNode']; -} - -export interface TuiNodeViewRendererOptions extends NodeViewRendererOptions { - update?: (node: ProseMirrorNode, decorations: Decoration[]) => boolean; - injector: Injector; -} - -/** - * Tiptap editor proposes concept of interactive {@link https://tiptap.dev/guide/node-views NodeViews}. - * It gives you opportunity to create custom complex Node inside editor. And it will look like native Tiptap's Node. - * Regard it like angular component inside editor. - * - * This solution is adaptation of official React implementation of NodeViews. - * It was copied from - * {@link https://github.com/sibiraj-s/ngx-tiptap/blob/master/projects/ngx-tiptap/src/lib/NodeViewRenderer.ts ngx-tiptap} - */ -export class TuiNodeView extends NodeView< - Type, - Editor, - TuiNodeViewRendererOptions -> { - renderer!: TuiComponentRenderer; - contentDOMElement: HTMLElement | null = null; - - /** - * @caretaker note: - * Class constructor NodeView cannot be invoked without 'new' - */ - constructor( - component: Type, - props: NodeViewRendererProps, - options?: Partial, - ) { - super(component, props, options); - } - - override mount(): void { - const injector = this.options.injector; - const doc = injector.get(DOCUMENT); - - const props: NodeViewProps = { - editor: this.editor, - node: this.node, - decorations: this.decorations, - selected: false, - extension: this.extension, - getPos: () => this.getPos(), - updateAttributes: (attributes = {}) => this.updateAttributes(attributes), - deleteNode: () => this.deleteNode(), - }; - - // create renderer - this.renderer = new TuiComponentRenderer(this.component, injector, props); - - // Register drag handler - if (this.extension.config.draggable) { - this.renderer.el.nativeElement.ondragstart = (e: DragEvent) => { - this.onDragStart(e); - }; - } - - this.contentDOMElement = this.node.isLeaf - ? null - : doc.createElement(this.node.isInline ? `span` : `div`); - - if (this.contentDOMElement) { - // For some reason the whiteSpace prop is not inherited properly in Chrome and Safari - // With this fix it seems to work fine - // See: https://github.com/ueberdosis/tiptap/issues/1197 - this.contentDOMElement.style.whiteSpace = `inherit`; - this.renderer.detectChanges(); - } - } - - override get dom(): HTMLElement { - return this.renderer.dom; - } - - override get contentDOM(): HTMLElement | null { - if (this.node.isLeaf) { - return null; - } - - this.maybeMoveContentDOM(); - - return this.contentDOMElement; - } - - update(node: ProseMirrorNode, decorations: DecorationWithType[]): boolean { - if (this.options.update) { - return this.options.update(node, decorations); - } - - if (node.type !== this.node.type) { - return false; - } - - if (node === this.node && this.decorations === decorations) { - return true; - } - - this.node = node; - this.decorations = decorations; - this.renderer.updateProps({node, decorations}); - this.maybeMoveContentDOM(); - - return true; - } - - selectNode(): void { - this.renderer.updateProps({selected: true}); - } - - deselectNode(): void { - this.renderer.updateProps({selected: false}); - } - - destroy(): void { - this.renderer.destroy(); - } - - private maybeMoveContentDOM(): void { - const contentElement = this.dom.querySelector(`[data-node-view-content]`); - - if ( - this.contentDOMElement && - contentElement && - !contentElement.contains(this.contentDOMElement) - ) { - contentElement.appendChild(this.contentDOMElement); - } - } -} - -/** - * @deprecated - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -export function TuiNodeViewRenderer( - component: Type, - options: Partial, -): NodeViewRenderer { - return (props: NodeViewRendererProps) => new TuiNodeView(component, props, options); -} diff --git a/projects/addon-editor/extensions/youtube/index.ts b/projects/addon-editor/extensions/youtube/index.ts deleted file mode 100644 index fe94db9309d5..000000000000 --- a/projects/addon-editor/extensions/youtube/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './youtube'; diff --git a/projects/addon-editor/extensions/youtube/ng-package.json b/projects/addon-editor/extensions/youtube/ng-package.json deleted file mode 100644 index bab5ebcdb74a..000000000000 --- a/projects/addon-editor/extensions/youtube/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../../../core/styles" - ] - } -} diff --git a/projects/addon-editor/extensions/youtube/youtube.ts b/projects/addon-editor/extensions/youtube/youtube.ts deleted file mode 100644 index ca2f48e5cc5d..000000000000 --- a/projects/addon-editor/extensions/youtube/youtube.ts +++ /dev/null @@ -1,32 +0,0 @@ -import YoutubeExtension from '@tiptap/extension-youtube'; - -export interface TuiYoutubeOptions { - src: string; - width?: number | string; - height?: number | string; - start?: number; -} - -declare module '@tiptap/core' { - interface Commands { - youtube: { - /** - * Insert a youtube video - */ - setYoutubeVideo: (options: { - src: string; - width?: number; - height?: number; - start?: number; - }) => ReturnType; - }; - } -} - -export const Youtube = YoutubeExtension.extend({}).configure({ - autoplay: false, - ccLanguage: `en`, - interfaceLanguage: `en`, - allowFullscreen: true, - disableKBcontrols: true, -}); diff --git a/projects/addon-editor/index.ts b/projects/addon-editor/index.ts deleted file mode 100644 index df0e267c9e7c..000000000000 --- a/projects/addon-editor/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from '@taiga-ui/addon-editor/abstract'; -export * from '@taiga-ui/addon-editor/components'; -export * from '@taiga-ui/addon-editor/constants'; -export * from '@taiga-ui/addon-editor/directives'; -export * from '@taiga-ui/addon-editor/enums'; -export * from '@taiga-ui/addon-editor/extensions'; -export * from '@taiga-ui/addon-editor/interfaces'; -export * from '@taiga-ui/addon-editor/tokens'; -export * from '@taiga-ui/addon-editor/utils'; diff --git a/projects/addon-editor/interfaces/attached.ts b/projects/addon-editor/interfaces/attached.ts deleted file mode 100644 index 044edbecb854..000000000000 --- a/projects/addon-editor/interfaces/attached.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface TuiEditorAttachedFile> { - name: string; - link: string; - attrs?: T; -} - -export interface TuiEditorAttachOptions { - accept: string; - multiple: boolean; -} diff --git a/projects/addon-editor/interfaces/editor-font-option.ts b/projects/addon-editor/interfaces/editor-font-option.ts deleted file mode 100644 index ad843ece82b3..000000000000 --- a/projects/addon-editor/interfaces/editor-font-option.ts +++ /dev/null @@ -1,15 +0,0 @@ -// @bad TODO: Make customizable -export interface TuiEditorFontOption { - /** - * @deprecated - * not used anywhere - */ - size?: string; - name: string; - family?: string; - weight?: string; - ngClass?: Record | Set | string[] | string; - ngStyle?: Record; - px?: number; - headingLevel?: 1 | 2 | 3 | 4 | 5 | 6; -} diff --git a/projects/addon-editor/interfaces/index.ts b/projects/addon-editor/interfaces/index.ts deleted file mode 100644 index e65423dea411..000000000000 --- a/projects/addon-editor/interfaces/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './attached'; -export * from './editor-font-option'; -export * from './parsed-gradient'; diff --git a/projects/addon-editor/interfaces/ng-package.json b/projects/addon-editor/interfaces/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/interfaces/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/interfaces/parsed-gradient.ts b/projects/addon-editor/interfaces/parsed-gradient.ts deleted file mode 100644 index 5c0f35749f9d..000000000000 --- a/projects/addon-editor/interfaces/parsed-gradient.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {TuiGradientDirection} from '@taiga-ui/addon-editor/types'; - -export interface TuiParsedGradient { - readonly stops: ReadonlyArray<{ - readonly color: string; - readonly position: string; - }>; - readonly side: TuiGradientDirection; -} diff --git a/projects/addon-editor/jest.config.ts b/projects/addon-editor/jest.config.ts deleted file mode 100644 index d195453d4b8b..000000000000 --- a/projects/addon-editor/jest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {Config} from 'jest'; - -import rootConfig from '../../jest.config'; - -const config: Config = { - ...rootConfig, - coverageDirectory: `/coverage/addon-editor`, - testMatch: [`/projects/addon-editor/**/*.spec.ts`], - collectCoverageFrom: [`/projects/addon-editor/**/*.ts`], -}; - -export default config; diff --git a/projects/addon-editor/ng-package.json b/projects/addon-editor/ng-package.json deleted file mode 100644 index e27786c50771..000000000000 --- a/projects/addon-editor/ng-package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "allowedNonPeerDependencies": [ - "." - ], - "dest": "../../dist/addon-editor", - "lib": { - "entryFile": "index.ts", - "styleIncludePaths": [ - "../core/styles" - ] - } -} diff --git a/projects/addon-editor/package.json b/projects/addon-editor/package.json deleted file mode 100644 index e74e2cf73599..000000000000 --- a/projects/addon-editor/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "@taiga-ui/addon-editor", - "version": "3.35.0", - "description": "Rich text editor extension package for Taiga UI", - "keywords": [ - "angular", - "component", - "wysiwyg", - "rich", - "text", - "editor" - ], - "homepage": "https://github.com/tinkoff/taiga-ui", - "repository": "https://github.com/tinkoff/taiga-ui", - "license": "Apache-2.0", - "dependencies": { - "@tiptap/core": "2.0.3", - "@tiptap/extension-blockquote": "2.0.3", - "@tiptap/extension-bold": "2.0.3", - "@tiptap/extension-bubble-menu": "2.0.3", - "@tiptap/extension-bullet-list": "2.0.3", - "@tiptap/extension-code": "2.0.3", - "@tiptap/extension-code-block": "2.0.3", - "@tiptap/extension-document": "2.0.3", - "@tiptap/extension-dropcursor": "2.0.3", - "@tiptap/extension-focus": "2.0.3", - "@tiptap/extension-gapcursor": "2.0.3", - "@tiptap/extension-hard-break": "2.0.3", - "@tiptap/extension-heading": "2.0.3", - "@tiptap/extension-highlight": "2.0.3", - "@tiptap/extension-history": "2.0.3", - "@tiptap/extension-horizontal-rule": "2.0.3", - "@tiptap/extension-image": "2.0.3", - "@tiptap/extension-italic": "2.0.3", - "@tiptap/extension-link": "2.0.3", - "@tiptap/extension-list-item": "2.0.3", - "@tiptap/extension-ordered-list": "2.0.3", - "@tiptap/extension-paragraph": "2.0.3", - "@tiptap/extension-placeholder": "2.0.3", - "@tiptap/extension-strike": "2.0.3", - "@tiptap/extension-subscript": "2.0.3", - "@tiptap/extension-superscript": "2.0.3", - "@tiptap/extension-table": "2.0.3", - "@tiptap/extension-table-cell": "2.0.3", - "@tiptap/extension-table-header": "2.0.3", - "@tiptap/extension-table-row": "2.0.3", - "@tiptap/extension-text": "2.0.3", - "@tiptap/extension-text-align": "2.0.3", - "@tiptap/extension-text-style": "2.0.3", - "@tiptap/extension-underline": "2.0.3", - "@tiptap/extension-youtube": "2.0.3", - "@tiptap/pm": "2.0.3", - "@tiptap/prosemirror-tables": "1.1.4", - "@tiptap/starter-kit": "2.0.3", - "prosemirror-collab": "1.3.1", - "prosemirror-commands": "1.5.2", - "prosemirror-dropcursor": "1.8.1", - "prosemirror-gapcursor": "1.3.2", - "prosemirror-history": "1.3.2", - "prosemirror-inputrules": "1.2.1", - "prosemirror-keymap": "1.2.2", - "prosemirror-model": "1.19.2", - "prosemirror-schema-list": "1.3.0", - "prosemirror-state": "1.4.3", - "prosemirror-tables": "1.3.4", - "prosemirror-transform": "1.7.3", - "prosemirror-utils": "0.9.6", - "prosemirror-view": "1.31.5" - }, - "peerDependencies": { - "@angular/common": ">=12.0.0", - "@angular/core": ">=12.0.0", - "@angular/forms": ">=12.0.0", - "@angular/platform-browser": ">=12.0.0", - "@ng-web-apis/common": ">=3.0.0", - "@taiga-ui/cdk": ">=3.35.0", - "@taiga-ui/core": ">=3.35.0", - "@taiga-ui/i18n": ">=3.35.0", - "@taiga-ui/kit": ">=3.35.0", - "rxjs": ">=6.0.0", - "tslib": ">=2.0.0" - } -} diff --git a/projects/addon-editor/project.json b/projects/addon-editor/project.json deleted file mode 100644 index 3ab0e759d074..000000000000 --- a/projects/addon-editor/project.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "addon-editor", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "projects/addon-editor", - "projectType": "library", - "prefix": "tui", - "implicitDependencies": ["!testing"], - "schematics": { - "@schematics/angular:component": { - "changeDetection": "OnPush", - "style": "less", - "displayBlock": true - } - }, - "targets": { - "lint": { - "executor": "nx:run-commands", - "options": { - "command": "eslint --no-error-on-unmatched-pattern \"**/projects/addon-editor/**/*\"" - } - }, - "stylelint": { - "executor": "nx:run-commands", - "options": { - "command": "stylelint \"**/addon-editor/**/*.{css,less}\" --allow-empty-input" - } - }, - "build": { - "executor": "@angular-devkit/build-angular:ng-packagr", - "outputs": ["{workspaceRoot}/dist/addon-editor"], - "options": { - "tsConfig": "tsconfig.build.json", - "project": "projects/addon-editor/ng-package.json" - }, - "dependsOn": [ - { - "target": "build", - "params": "forward", - "dependencies": true - } - ] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/addon-editor"], - "options": { - "jestConfig": "projects/addon-editor/jest.config.ts" - } - }, - "publish": { - "executor": "nx:run-commands", - "options": { - "command": "ts-node ./scripts/publish.ts --path ./dist/addon-editor --dry-run {args.dry-run} --customVersion {args.customVersion} --customTag {args.customTag}" - } - } - } -} diff --git a/projects/addon-editor/services/index.ts b/projects/addon-editor/services/index.ts deleted file mode 100644 index 2e98576654c9..000000000000 --- a/projects/addon-editor/services/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './picker.service'; diff --git a/projects/addon-editor/services/ng-package.json b/projects/addon-editor/services/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/services/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/services/picker.service.ts b/projects/addon-editor/services/picker.service.ts deleted file mode 100644 index f175cd9322fc..000000000000 --- a/projects/addon-editor/services/picker.service.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import {ElementRef, Inject, Injectable, Self} from '@angular/core'; -import {tuiGetElementPoint} from '@taiga-ui/addon-editor/utils'; -import {TuiDestroyService, tuiPreventDefault, tuiTypedFromEvent} from '@taiga-ui/cdk'; -import {TuiPoint} from '@taiga-ui/core'; -import {Observable} from 'rxjs'; -import {map, startWith, switchMap, takeUntil} from 'rxjs/operators'; - -@Injectable() -export class TuiPickerService extends Observable { - constructor( - @Self() @Inject(TuiDestroyService) destroy$: Observable, - @Inject(ElementRef) {nativeElement}: ElementRef, - @Inject(DOCUMENT) doc: Document, - ) { - const point$ = tuiTypedFromEvent(nativeElement, `mousedown`).pipe( - tuiPreventDefault(), - switchMap(event => { - const mouseMove$ = tuiTypedFromEvent(doc, `mousemove`).pipe( - map(({clientX, clientY}) => - tuiGetElementPoint(clientX, clientY, nativeElement), - ), - takeUntil(tuiTypedFromEvent(doc, `mouseup`)), - ); - - return event.target === nativeElement - ? mouseMove$.pipe( - startWith( - tuiGetElementPoint( - event.clientX, - event.clientY, - nativeElement, - ), - ), - ) - : mouseMove$; - }), - takeUntil(destroy$), - ); - - super(subscriber => point$.subscribe(subscriber)); - } -} diff --git a/projects/addon-editor/tokens/editor-extensions.ts b/projects/addon-editor/tokens/editor-extensions.ts deleted file mode 100644 index fb3febf4ab18..000000000000 --- a/projects/addon-editor/tokens/editor-extensions.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import {Extension, Mark, Node} from '@tiptap/core'; -import {Observable} from 'rxjs'; - -/** - * Extensions for editor - */ -export const TUI_EDITOR_EXTENSIONS = new InjectionToken< - ReadonlyArray> ->(`[TUI_EDITOR_EXTENSIONS]`); - -/** - * lazy extensions - */ -export const LAZY_EDITOR_EXTENSIONS = new InjectionToken< - Observable> ->(`[LAZY_EDITOR_EXTENSIONS]`); diff --git a/projects/addon-editor/tokens/editor-options.ts b/projects/addon-editor/tokens/editor-options.ts deleted file mode 100644 index 51cad3c9a6a9..000000000000 --- a/projects/addon-editor/tokens/editor-options.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {InjectionToken, ValueProvider} from '@angular/core'; -import { - defaultEditorColors, - EDITOR_BLANK_COLOR, - TUI_DEFAULT_LINK_OPTIONS, - tuiDefaultFontOptionsHandler, - TuiEditorLinkOptions, -} from '@taiga-ui/addon-editor/constants'; - -export interface TuiEditorOptions { - readonly translate: 'no' | 'yes'; - readonly spellcheck: boolean; - readonly blankColor: string; - readonly colors: ReadonlyMap; - readonly fontOptions: typeof tuiDefaultFontOptionsHandler; - readonly linkOptions?: TuiEditorLinkOptions; -} - -export const TUI_EDITOR_DEFAULT_OPTIONS: TuiEditorOptions = { - translate: `no`, - spellcheck: false, - colors: defaultEditorColors, - blankColor: EDITOR_BLANK_COLOR, - linkOptions: TUI_DEFAULT_LINK_OPTIONS, - fontOptions: tuiDefaultFontOptionsHandler, -}; - -/** - * Default Editor colors - */ -export const TUI_EDITOR_OPTIONS = new InjectionToken( - `[TUI_EDITOR_OPTIONS]`, - { - factory: () => TUI_EDITOR_DEFAULT_OPTIONS, - }, -); - -export function tuiEditorOptionsProvider( - options: Partial, -): ValueProvider { - return { - provide: TUI_EDITOR_OPTIONS, - useValue: {...TUI_EDITOR_DEFAULT_OPTIONS, ...options}, - }; -} diff --git a/projects/addon-editor/tokens/editor-processor.ts b/projects/addon-editor/tokens/editor-processor.ts deleted file mode 100644 index 88daff9a841f..000000000000 --- a/projects/addon-editor/tokens/editor-processor.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import {TuiStringHandler} from '@taiga-ui/cdk'; -import {identity} from 'rxjs'; - -/** - * @deprecated: drop in v4.0 - * use {@link TUI_EDITOR_VALUE_TRANSFORMER} - */ -export const TUI_EDITOR_CONTENT_PROCESSOR: InjectionToken> = - new InjectionToken>(`[TUI_EDITOR_CONTENT_PROCESSOR]`, { - factory: () => identity, - }); diff --git a/projects/addon-editor/tokens/editor-value-transformer.ts b/projects/addon-editor/tokens/editor-value-transformer.ts deleted file mode 100644 index 567ec9834375..000000000000 --- a/projects/addon-editor/tokens/editor-value-transformer.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import {AbstractTuiValueTransformer} from '@taiga-ui/cdk'; - -export const TUI_EDITOR_VALUE_TRANSFORMER = new InjectionToken< - AbstractTuiValueTransformer ->(`[TUI_EDITOR_VALUE_TRANSFORMER]`); diff --git a/projects/addon-editor/tokens/files-loader.ts b/projects/addon-editor/tokens/files-loader.ts deleted file mode 100644 index 1f4ac6f4ba60..000000000000 --- a/projects/addon-editor/tokens/files-loader.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import { - TuiEditorAttachedFile, - TuiEditorAttachOptions, -} from '@taiga-ui/addon-editor/interfaces'; -import {TuiHandler} from '@taiga-ui/cdk'; -import {Observable} from 'rxjs'; - -/** - * files loader options - */ -export const TUI_ATTACH_FILES_OPTIONS: InjectionToken = - new InjectionToken(`[TUI_ATTACH_FILES_OPTIONS]`, { - factory: () => ({accept: `*/*`, multiple: true}), - }); - -/** - * files loader handler - */ -export const TUI_ATTACH_FILES_LOADER: InjectionToken< - TuiHandler> -> = new InjectionToken>>( - `[TUI_ATTACH_FILES_LOADER]`, -); diff --git a/projects/addon-editor/tokens/i18n.ts b/projects/addon-editor/tokens/i18n.ts deleted file mode 100644 index 8525ee2e848d..000000000000 --- a/projects/addon-editor/tokens/i18n.ts +++ /dev/null @@ -1,66 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import {TuiEditorTool} from '@taiga-ui/addon-editor/enums'; -import {tuiExtractI18n} from '@taiga-ui/i18n'; - -/** - * tui-color-selector i18n - */ -export const TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES = new InjectionToken<[string, string]>( - `[TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES]`, - { - factory: () => [`Solid color`, `Gradient`], - }, -); - -export type EditorToolbarTexts = - | TuiEditorTool - | 'backColor' - | 'font' - | 'fontStyle' - | 'indent' - | 'justifyCenter' - | 'justifyFull' - | 'justifyLeft' - | 'justifyRight' - | 'orderedList' - | 'outdent' - | 'redo' - | 'unorderedList'; - -/** - * tui-editor-toolbar i18n - */ -export const TUI_EDITOR_TOOLBAR_TEXTS = new InjectionToken(`[TUI_EDITOR_TOOLBAR_TEXTS]`, { - factory: tuiExtractI18n(`toolbarTools`), -}); - -/** - * tui-editor-toolbar table i18n - */ -export const TUI_EDITOR_TABLE_COMMANDS = new InjectionToken( - `[TUI_EDITOR_TABLE_COMMANDS]`, - { - factory: tuiExtractI18n(`editorTableCommands`), - }, -); - -/** - * tui-editor-toolbar edit-link i18n - */ -export const TUI_EDITOR_LINK_TEXTS = new InjectionToken(`[TUI_EDITOR_LINK_TEXTS]`, { - factory: tuiExtractI18n(`editorEditLink`), -}); - -/** - * tui-editor-toolbar codes options - */ -export const TUI_EDITOR_CODE_OPTIONS = new InjectionToken(`[TUI_EDITOR_CODE_OPTIONS]`, { - factory: tuiExtractI18n(`editorCodeOptions`), -}); - -/** - * tui-editor-toolbar font options - */ -export const TUI_EDITOR_FONT_OPTIONS = new InjectionToken(`[TUI_EDITOR_FONT_OPTIONS]`, { - factory: tuiExtractI18n(`editorFontOptions`), -}); diff --git a/projects/addon-editor/tokens/image-loader.ts b/projects/addon-editor/tokens/image-loader.ts deleted file mode 100644 index 7f0c63b9cd37..000000000000 --- a/projects/addon-editor/tokens/image-loader.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import {TuiHandler, tuiTypedFromEvent} from '@taiga-ui/cdk'; -import {Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -/** - * Image loader handler - */ -export const TUI_IMAGE_LOADER: InjectionToken>> = - new InjectionToken>>(`[TUI_IMAGE_LOADER]`, { - factory: () => file => { - const fileReader = new FileReader(); - - fileReader.readAsDataURL(file); - - return tuiTypedFromEvent(fileReader, `load`).pipe( - map(() => String(fileReader.result)), - ); - }, - }); diff --git a/projects/addon-editor/tokens/index.ts b/projects/addon-editor/tokens/index.ts deleted file mode 100644 index b45eb7949388..000000000000 --- a/projects/addon-editor/tokens/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './editor-extensions'; -export * from './editor-options'; -export * from './editor-processor'; -export * from './editor-value-transformer'; -export * from './files-loader'; -export * from './i18n'; -export * from './image-loader'; -export * from './tiptap-editor'; diff --git a/projects/addon-editor/tokens/ng-package.json b/projects/addon-editor/tokens/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/tokens/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/tokens/tiptap-editor.ts b/projects/addon-editor/tokens/tiptap-editor.ts deleted file mode 100644 index 0579ea9e5008..000000000000 --- a/projects/addon-editor/tokens/tiptap-editor.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {InjectionToken} from '@angular/core'; -import type {Editor} from '@tiptap/core'; -import {Observable, ReplaySubject} from 'rxjs'; - -/** - * Token for Tiptap Editor - */ -export const TIPTAP_EDITOR = new InjectionToken>(`[TIPTAP_EDITOR]`); - -/** - * Lazy loaded Editor - */ -export const LAZY_TIPTAP_EDITOR = new InjectionToken(`[LAZY_TIPTAP_EDITOR]`, { - factory: () => { - const editor$ = new ReplaySubject(1); - - // eslint-disable-next-line @typescript-eslint/no-floating-promises - import(`@tiptap/core`).then(m => editor$.next(m.Editor)); - - return editor$; - }, -}); - -/** - * The container in which the tip-tap editor is initialized - */ -export const INITIALIZATION_TIPTAP_CONTAINER = new InjectionToken( - `[INITIALIZATION_TIPTAP_CONTAINER]`, -); diff --git a/projects/addon-editor/types/gradient-direction.ts b/projects/addon-editor/types/gradient-direction.ts deleted file mode 100644 index ec5f1f03f73c..000000000000 --- a/projects/addon-editor/types/gradient-direction.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type TuiGradientDirection = - | 'to bottom left' - | 'to bottom right' - | 'to bottom' - | 'to left' - | 'to right' - | 'to top left' - | 'to top right' - | 'to top'; diff --git a/projects/addon-editor/types/index.ts b/projects/addon-editor/types/index.ts deleted file mode 100644 index 4e0b19545956..000000000000 --- a/projects/addon-editor/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './gradient-direction'; diff --git a/projects/addon-editor/types/ng-package.json b/projects/addon-editor/types/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/types/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/utils/delete-nodes.ts b/projects/addon-editor/utils/delete-nodes.ts deleted file mode 100644 index ecafccb9ae6d..000000000000 --- a/projects/addon-editor/utils/delete-nodes.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {CommandProps} from '@tiptap/core'; -import {EditorState} from 'prosemirror-state'; - -export function tuiDeleteNode( - state: EditorState, - dispatch: CommandProps['dispatch'], - nodeName: string, -): boolean { - const position = state.selection.$anchor; - - for (let depth = position.depth; depth > 0; depth--) { - const node = position.node(depth); - - if (node.type.name === nodeName) { - if (dispatch) { - dispatch( - state.tr - .delete(position.before(depth), position.after(depth)) - .scrollIntoView(), - ); - } - - return true; - } - } - - return false; -} diff --git a/projects/addon-editor/utils/get-element-point.ts b/projects/addon-editor/utils/get-element-point.ts deleted file mode 100644 index 31bc076a45fb..000000000000 --- a/projects/addon-editor/utils/get-element-point.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {tuiClamp} from '@taiga-ui/cdk'; -import {TuiPoint} from '@taiga-ui/core'; - -export function tuiGetElementPoint(x: number, y: number, element: HTMLElement): TuiPoint { - const {left, top, width, height} = element.getBoundingClientRect(); - - return [tuiClamp(x - left, 0, width) / width, tuiClamp(y - top, 0, height) / height]; -} diff --git a/projects/addon-editor/utils/get-gradient-data.ts b/projects/addon-editor/utils/get-gradient-data.ts deleted file mode 100644 index 6d146812427f..000000000000 --- a/projects/addon-editor/utils/get-gradient-data.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function tuiGetGradientData(gradient: string): string { - return gradient - .slice(0, Math.max(0, gradient.length - 1)) - .replace(`linear-gradient(`, ``); -} diff --git a/projects/addon-editor/utils/get-mark-range.ts b/projects/addon-editor/utils/get-mark-range.ts deleted file mode 100644 index c7657bbcb4fd..000000000000 --- a/projects/addon-editor/utils/get-mark-range.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type {Range} from '@tiptap/core'; -import type {Mark as ProseMirrorMark, MarkType, ResolvedPos} from 'prosemirror-model'; - -function hasAttributes( - markAttributes: Record, - attributes: Record, -): boolean { - const keys = Object.keys(attributes); - - return ( - !keys.length || - !!keys.filter(key => attributes[key] === markAttributes[key]).length - ); -} - -function findMarkInSet( - marks: readonly ProseMirrorMark[], - markType: MarkType, - attributes: Record = {}, -): ProseMirrorMark | null { - return ( - marks.find( - ({attrs, type}) => type === markType && hasAttributes(attrs, attributes), - ) || null - ); -} - -export function tuiGetMarkRange( - pos?: ResolvedPos, - type?: MarkType, - attributes: Record = {}, -): Range | null { - if (!pos || !type) { - return null; - } - - const {node, offset} = pos.parent.childAfter(pos.parentOffset); - - if (!node) { - return null; - } - - const mark = findMarkInSet(node.marks, type, attributes); - - if (!mark) { - return null; - } - - let startIndex = pos.index(); - let startPos = pos.start() + offset; - let endIndex = startIndex + 1; - let endPos = startPos + node.nodeSize; - - findMarkInSet(node.marks, type, attributes); - - while (startIndex > 0 && mark.isInSet(pos.parent.child(startIndex - 1).marks)) { - startIndex -= 1; - startPos -= pos.parent.child(startIndex).nodeSize; - } - - while ( - endIndex < pos.parent.childCount && - !!findMarkInSet(pos.parent.child(endIndex).marks, type, attributes) - ) { - endPos += pos.parent.child(endIndex).nodeSize; - endIndex += 1; - } - - return { - from: startPos, - to: endPos, - }; -} diff --git a/projects/addon-editor/utils/get-nested-nodes.ts b/projects/addon-editor/utils/get-nested-nodes.ts deleted file mode 100644 index d74c9c9324c2..000000000000 --- a/projects/addon-editor/utils/get-nested-nodes.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {Attrs, Node as NodeElement} from 'prosemirror-model'; - -export function tuiGetNestedNodes(node: NodeElement): Array> { - const nodes: Array> = []; - - // @note: the content field is not array type - node.content.forEach(child => { - if (child instanceof NodeElement) { - nodes.push([child.type.name, child.attrs]); - } - }); - - return nodes; -} diff --git a/projects/addon-editor/utils/get-selected-content.ts b/projects/addon-editor/utils/get-selected-content.ts deleted file mode 100644 index 81c9edc686d6..000000000000 --- a/projects/addon-editor/utils/get-selected-content.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {getHTMLFromFragment} from '@tiptap/core'; -import {EditorState} from 'prosemirror-state'; - -export function tuiGetSelectedContent(state: EditorState, current?: string): string { - const currentNodeContent = current ?? state.selection.$head.parent.textContent; - const selected = state.doc.cut(state.selection.from, state.selection.to); - - return selected.content.size - ? getHTMLFromFragment(selected.content, state.schema) - : currentNodeContent; -} diff --git a/projects/addon-editor/utils/index.ts b/projects/addon-editor/utils/index.ts deleted file mode 100644 index d082f9aaad44..000000000000 --- a/projects/addon-editor/utils/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from './delete-nodes'; -export * from './get-element-point'; -export * from './get-gradient-data'; -export * from './get-mark-range'; -export * from './get-nested-nodes'; -export * from './get-selected-content'; -export * from './insert-html'; -export * from './insert-text'; -export * from './is-selection-in'; -export * from './legacy-converter'; -export * from './parse-gradient'; -export * from './parse-node-attributes'; -export * from './parse-style'; -export * from './safe-link-range'; -export * from './to-gradient'; diff --git a/projects/addon-editor/utils/insert-html.ts b/projects/addon-editor/utils/insert-html.ts deleted file mode 100644 index 1479461c7eaa..000000000000 --- a/projects/addon-editor/utils/insert-html.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {TuiDocumentSelectionException} from '@taiga-ui/cdk'; - -/** - * Provides document.execCommand('insertHTML', false, html) support to unsupported browser, - * taking Undo stack into account if possible - * - * @throws Will throw an error if selection could not be retrieved - * - * @param doc document to execute on - * @param html html to be inserted - */ -export function tuiInsertHtml(doc: Document, html: string): void { - if (doc.queryCommandSupported(`insertHTML`)) { - doc.execCommand(`insertHTML`, false, html); - - return; - } - - const selection = doc.getSelection(); - - if (!selection) { - throw new TuiDocumentSelectionException(); - } - - doc.execCommand(`ms-beginUndoUnit`); - - const range = selection.getRangeAt(0); - const documentFragment = range.createContextualFragment(html); - - range.deleteContents(); - range.insertNode(documentFragment); - - doc.execCommand(`ms-endUndoUnit`); -} diff --git a/projects/addon-editor/utils/insert-text.ts b/projects/addon-editor/utils/insert-text.ts deleted file mode 100644 index 515d0ccfeaad..000000000000 --- a/projects/addon-editor/utils/insert-text.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {TuiDocumentSelectionException} from '@taiga-ui/cdk'; - -/** - * Provides document.execCommand('insertText', false, text) support to unsupported browser, - * taking Undo stack into account if possible - * - * @throws Will throw an error if selection could not be retrieved - * - * @param doc document to execute on - * @param text text to be inserted - */ -export function tuiInsertText(doc: Document, text: string): void { - if (doc.queryCommandSupported(`insertText`)) { - doc.execCommand(`insertText`, false, text); - - return; - } - - const selection = doc.getSelection(); - - if (!selection) { - throw new TuiDocumentSelectionException(); - } - - doc.execCommand(`ms-beginUndoUnit`); - - const range = selection.getRangeAt(0); - - range.deleteContents(); - range.insertNode(doc.createTextNode(text)); - - doc.execCommand(`ms-endUndoUnit`); -} diff --git a/projects/addon-editor/utils/is-selection-in.ts b/projects/addon-editor/utils/is-selection-in.ts deleted file mode 100644 index 0a0c7d25b369..000000000000 --- a/projects/addon-editor/utils/is-selection-in.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {tuiIsNodeIn} from '@taiga-ui/cdk'; - -/** - * Checks if selection is inside a specific selector - * @param selection - * @param selector - * @return true if selection is completely inside a particular selector - */ -export function tuiIsSelectionIn( - {anchorNode, focusNode}: Selection, - selector: string, -): boolean { - // Even though focusNode/anchor-node are defined as Node, they can be null on initial nested document query - return ( - !!anchorNode && - !!focusNode && - tuiIsNodeIn(anchorNode, selector) && - tuiIsNodeIn(focusNode, selector) - ); -} diff --git a/projects/addon-editor/utils/legacy-converter.ts b/projects/addon-editor/utils/legacy-converter.ts deleted file mode 100644 index 251b0415d44a..000000000000 --- a/projects/addon-editor/utils/legacy-converter.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @description: - * This converter help you to painlessly migrate old tags to the tui-editor[new] - */ -export function tuiLegacyEditorConverter(content: string): string { - const tree = new DOMParser().parseFromString(content, `text/html`); - - migration(tree.body); - - return tree.body.innerHTML; -} - -function migration(element: Element): void { - for (const child of Array.from(element.children)) { - if (child.children.length) { - migration(child); - } - - if (child.tagName === `FONT`) { - if (child.hasAttribute(`size`)) { - switch (child.getAttribute(`size`)) { - case `6`: { - migrateHeading(`h1`, child); - break; - } - case `5`: { - migrateHeading(`h2`, child); - break; - } - - case `4`: { - migrateParagraph(`17px`, child); - break; - } - - case `3`: { - migrateParagraph(`15px`, child); - break; - } - - case `2`: { - migrateParagraph(`13px`, child); - break; - } - default: - break; - } - } else if (child.hasAttribute(`color`)) { - migrateFontHighlight(child); - } - } - } -} - -function migrateHeading(selector: string, element: Element): void { - const heading = document.createElement(selector); - - heading.innerHTML = element.innerHTML; - - if (element.parentElement?.tagName === `P`) { - const newRef = element.parentElement?.parentElement?.insertBefore( - heading, - element.parentElement, - ); - - element.parentElement?.removeChild(element); - - if (newRef?.nextSibling && !newRef?.nextSibling?.textContent?.trim()) { - newRef.nextSibling?.parentElement?.removeChild(newRef.nextSibling); - } - } else { - element.parentElement?.replaceChild(heading, element); - } -} - -function migrateParagraph(fontSize: string, element: Element): void { - const p = document.createElement(`p`); - const span = document.createElement(`span`); - - span.setAttribute(`style`, `font-size: ${fontSize}`); - span.innerHTML = element.innerHTML; - p.append(span); - - element.parentElement?.replaceChild( - element.parentElement.tagName === `P` ? span : p, - element, - ); -} - -function migrateFontHighlight(element: Element): void { - const span = document.createElement(`span`); - - span.setAttribute(`style`, `color: ${element.getAttribute(`color`)}`); - span.innerHTML = element.innerHTML; - element.parentElement?.replaceChild(span, element); -} diff --git a/projects/addon-editor/utils/ng-package.json b/projects/addon-editor/utils/ng-package.json deleted file mode 100644 index bebf62dcb5e5..000000000000 --- a/projects/addon-editor/utils/ng-package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/addon-editor/utils/parse-gradient.ts b/projects/addon-editor/utils/parse-gradient.ts deleted file mode 100644 index bfdd492012f6..000000000000 --- a/projects/addon-editor/utils/parse-gradient.ts +++ /dev/null @@ -1,76 +0,0 @@ -import {TuiParsedGradient} from '@taiga-ui/addon-editor/interfaces'; -import {TuiGradientDirection} from '@taiga-ui/addon-editor/types'; - -// -// TypeScript parser based on Dean Taylor's answer: -// https://stackoverflow.com/a/20238168/2706426 -// -// SETUP CODE -const COMMA = `\\s*,\\s*`; // Allow space around comma. -const HEX = `#(?:[a-f0-9]{6}|[a-f0-9]{3})`; // 3 or 6 character form -const RGB = `\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*\\)`; // "(1, 2, 3)" -const RGBA = `\\(\\s*(?:\\d{1,3}\\s*,\\s*){2}\\d{1,3}\\s*,\\s*\\d*\\.?\\d+\\)`; // "(1, 2, 3, 4)" -const VALUE = `(?:[+-]?\\d*\\.?\\d+)(?:%|[a-z]+)?`; // ".9", "-5px", "100%". -const KEYWORD = `[_a-z-][_a-z0-9-]*`; // "red", "transparent", "border-collapse". -const COLOR = [ - `(?:`, - HEX, - `|`, - `(?:rgb|hsl)`, - RGB, - `|`, - `(?:rgba|hsla)`, - RGBA, - `|`, - KEYWORD, - `)`, -]; -const REGEXP_ARRAY = [ - `\\s*(`, - ...COLOR, - `)`, - `(?:\\s+`, - `(`, - VALUE, - `))?`, - `(?:`, - COMMA, - `\\s*)?`, -]; - -export function tuiParseGradient(input: string): TuiParsedGradient { - const stopsRegexp = new RegExp(REGEXP_ARRAY.join(``), `gi`); - const stopsString = - input.startsWith(`to`) || input.match(/^\d/) - ? input.slice(Math.max(0, input.indexOf(`,`) + 1)).trim() - : input; - - const side = input.startsWith(`to`) - ? (input.split(`,`)[0] as TuiGradientDirection) - : `to bottom`; - let stops: TuiParsedGradient['stops'] = []; - - let matchColorStop = stopsRegexp.exec(stopsString); - - while (matchColorStop !== null) { - stops = stops.concat({ - color: matchColorStop[1], - position: getPosition(matchColorStop[2], stops.length), - }); - - matchColorStop = stopsRegexp.exec(stopsString); - } - - stops = stops.filter(({color}) => color.startsWith(`#`) || color.startsWith(`rgb`)); - - return { - stops, - side, - }; -} - -function getPosition(match: string, stops: number): string { - const fallback = stops === 1 ? `100%` : `${stops}%`; - - return match?.includes(`%`) ? match : fallback; -} diff --git a/projects/addon-editor/utils/parse-node-attributes.ts b/projects/addon-editor/utils/parse-node-attributes.ts deleted file mode 100644 index ec179498b269..000000000000 --- a/projects/addon-editor/utils/parse-node-attributes.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {Attribute} from '@tiptap/core'; - -export function tuiParseNodeAttributes( - attrs: string[], -): Record> { - return attrs.reduce((result, attribute) => { - result[attribute] = { - parseHTML: element => element?.getAttribute(`${attribute}`), - }; - - return result; - }, {} as Record>); -} diff --git a/projects/addon-editor/utils/parse-style.ts b/projects/addon-editor/utils/parse-style.ts deleted file mode 100644 index 66374d977680..000000000000 --- a/projects/addon-editor/utils/parse-style.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function tuiParseStyle(style: string): Record { - return style - .split(`;`) - .reduce((ruleMap: Record, ruleString: string) => { - const [left, right] = ruleString.split(`:`) ?? []; - - if (left && right) { - ruleMap[left.trim()] = right.trim(); - } - - return ruleMap; - }, {}); -} diff --git a/projects/addon-editor/utils/safe-link-range.ts b/projects/addon-editor/utils/safe-link-range.ts deleted file mode 100644 index 6cca4c76e4ba..000000000000 --- a/projects/addon-editor/utils/safe-link-range.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function tuiIsSafeLinkRange(range: Range): boolean { - const textNodeLength = range.endContainer.nodeValue?.length || 0; - - return ( - range.endOffset - range.startOffset > 0 || - (range.endOffset - range.startOffset === 0 && textNodeLength === 1) || - (range.startOffset !== 0 && - textNodeLength > 1 && - range.endOffset !== textNodeLength) - ); -} diff --git a/projects/addon-editor/utils/test/legacy-converter.spec.ts b/projects/addon-editor/utils/test/legacy-converter.spec.ts deleted file mode 100644 index 2054909de9ae..000000000000 --- a/projects/addon-editor/utils/test/legacy-converter.spec.ts +++ /dev/null @@ -1,52 +0,0 @@ -import {tuiLegacyEditorConverter} from '@taiga-ui/addon-editor'; - -// cspell:disable -describe(`tuiLegacyEditorConverter`, () => { - it(`works`, () => { - const before = `WYSIWYG (What you see is what you get) — Rich Text Editor for using with Angular forms. -

- Heading -

-

- Heading - Subtitle - Large - Normal - Small -

-

Normal

-

Small

- - Lorem ipsum dolor sit amet - consectetur adipiscing elit - , sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - Ut enim - -
- ad minim veniam, - quis nostrud exercitation - ullamco - , laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. -
-

- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

`; - - const after = `WYSIWYG (What you see is what you get) — Rich Text Editor for using with Angular forms. -

Heading

Heading

Subtitle

LargeNormalSmall

Normal

Small

- Lorem ipsum dolor sit amet - consectetur adipiscing elit - , sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - Ut enim

- ad minim veniam, - quis nostrud exercitationullamco - , laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. -

- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

`; - - expect(tuiLegacyEditorConverter(before).replace(/>\s+<`)).toEqual(after); - }); -}); diff --git a/projects/addon-editor/utils/test/parse-gradient.spec.ts b/projects/addon-editor/utils/test/parse-gradient.spec.ts deleted file mode 100644 index 611a6d43e07c..000000000000 --- a/projects/addon-editor/utils/test/parse-gradient.spec.ts +++ /dev/null @@ -1,76 +0,0 @@ -import {tuiParseGradient} from '@taiga-ui/addon-editor'; - -describe(`tuiParseGradient`, () => { - it(`test case 1`, () => { - expect( - tuiParseGradient( - `to bottom right, rgba(0, 255, 255, 1), rgba(255, 0, 255, 0)`, - ), - ).toEqual({ - stops: [ - { - color: `rgba(0, 255, 255, 1)`, - position: `0%`, - }, - { - color: `rgba(255, 0, 255, 0)`, - position: `100%`, - }, - ], - side: `to bottom right`, - }); - }); - - it(`test case 2`, () => { - expect(tuiParseGradient(`red 10%, blue 20%`)).toEqual({ - stops: [], - side: `to bottom`, - }); - }); - - it(`test case 3`, () => { - expect( - tuiParseGradient(`to top left, #ff0000 10%, rgb(0, 255, 255) 20%`), - ).toEqual({ - stops: [ - { - color: `#ff0000`, - position: `10%`, - }, - { - color: `rgb(0, 255, 255)`, - position: `20%`, - }, - ], - side: `to top left`, - }); - }); - - it(`test case 4`, () => { - expect( - tuiParseGradient( - `to top, #ff0000 10%, rgb(0, 255, 255) 20%, rgba(255, 0, 0, 0.1) 40%, #00ff00 100%`, - ), - ).toEqual({ - stops: [ - { - color: `#ff0000`, - position: `10%`, - }, - { - color: `rgb(0, 255, 255)`, - position: `20%`, - }, - { - color: `rgba(255, 0, 0, 0.1)`, - position: `40%`, - }, - { - color: `#00ff00`, - position: `100%`, - }, - ], - side: `to top`, - }); - }); -}); diff --git a/projects/addon-editor/utils/test/to-gradient.spec.ts b/projects/addon-editor/utils/test/to-gradient.spec.ts deleted file mode 100644 index 86d9d2993929..000000000000 --- a/projects/addon-editor/utils/test/to-gradient.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {tuiToGradient} from '@taiga-ui/addon-editor'; - -describe(`tuiToGradient`, () => { - it(`test case 1`, () => { - expect( - tuiToGradient({ - stops: [ - { - color: `rgba(0, 255, 0, 1)`, - position: `10%`, - }, - { - color: `#0000ff`, - position: `100%`, - }, - ], - side: `to bottom`, - }), - ).toBe( - `linear-gradient(to bottom, rgba(0, 255, 0, 1) 10%, rgba(0, 0, 255, 1) 100%)`, - ); - }); - - it(`test case 2`, () => { - expect( - tuiToGradient({ - stops: [ - { - color: `rgb(42, 237, 0)`, - position: `0%`, - }, - { - color: `rgb(237, 42, 0)`, - position: `100%`, - }, - ], - side: `to top left`, - }), - ).toBe( - `linear-gradient(to top left, rgba(42, 237, 0, 1) 0%, rgba(237, 42, 0, 1) 100%)`, - ); - }); -}); diff --git a/projects/addon-editor/utils/to-gradient.ts b/projects/addon-editor/utils/to-gradient.ts deleted file mode 100644 index a84a9a172d0b..000000000000 --- a/projects/addon-editor/utils/to-gradient.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {TuiParsedGradient} from '@taiga-ui/addon-editor/interfaces'; -import {tuiParseColor} from '@taiga-ui/cdk'; - -export function tuiToGradient({stops, side}: TuiParsedGradient): string { - return `linear-gradient(${side}, ${stops - .map( - ({color, position}) => `rgba(${tuiParseColor(color).join(`, `)}) ${position}`, - ) - .join(`, `)})`; -} diff --git a/projects/cdk/package.json b/projects/cdk/package.json index 87f805efe686..0474fd8139f1 100644 --- a/projects/cdk/package.json +++ b/projects/cdk/package.json @@ -49,7 +49,6 @@ "@taiga-ui/addon-preview", "@taiga-ui/addon-tablebars", "@taiga-ui/addon-table", - "@taiga-ui/addon-editor", "@taiga-ui/addon-mobile", "@taiga-ui/proprietary-banking", "@taiga-ui/proprietary-core", diff --git a/projects/demo-integrations/cypress/tests/addon-editor/anchor.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/anchor.cy.ts deleted file mode 100644 index 8c98dce19774..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/anchor.cy.ts +++ /dev/null @@ -1,61 +0,0 @@ -describe(`Editor's anchors`, () => { - beforeEach(() => { - cy.viewport(1280, 500).tuiVisit(`editor/anchors`); - - cy.get(`tui-doc-example[heading="Anchors"]`).tuiScrollIntoView().as(`wrapper`); - - cy.get(`@wrapper`).findByAutomationId(`tui-doc-example`).as(`example`); - }); - - it(`all content`, () => { - cy.get(`@example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`anchors-example-content`); - }); - - it(`editor`, () => { - cy.get(`@wrapper`) - .find(`tui-editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`anchors-editor-content`); - }); - - describe(`anchors`, () => { - beforeEach(() => { - cy.get(`@wrapper`) - .find(`tui-editor`) - .then(el => el.remove()); - - cy.get(`@wrapper`) - .find(`h4`) - .contains(`Text`) - .next() - .then(el => el.remove()); - - cy.get(`@wrapper`) - .find(`h4`) - .contains(`HTML`) - .next() - .tuiScrollIntoView() - .as(`content`); - }); - - for (const anchor of [ - `moser`, - `thirlwell`, - `briggs`, - `introduction`, - `knowles`, - `war`, - ]) { - it(`anchor is #${anchor}`, () => { - cy.get(`@example`) - .find(`a[href="#${anchor}"]`) - .click({force: true}) - .wait(2000); - - cy.matchImageSnapshot(`anchor-${anchor}`, {capture: `viewport`}); - }); - } - }); -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/color-picker.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/color-picker.cy.ts deleted file mode 100644 index d09e40ea8d66..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/color-picker.cy.ts +++ /dev/null @@ -1,47 +0,0 @@ -describe(`Editor's color picker`, () => { - beforeEach(() => cy.tuiVisit(`components/color-picker`)); - - it(`opened color picker`, () => { - openColorPicker(`wrapper`); - - cy.matchImageSnapshot(`1-color-picker-with-hex`); - }); - - it(`opened color picker and change rgb`, () => { - openColorPicker(`wrapper`); - changeToHex(); - - setInputBox(1, 255); - setInputBox(2, 255); - setInputBox(3, 255); - - cy.tuiWaitBeforeScreenshot().matchImageSnapshot(`2-color-picker-with-rgb`); - }); - - function openColorPicker(alias: string): void { - cy.get(`#dropdown`) - .findByAutomationId(`tui-doc-example`) - .tuiScrollIntoView() - .as(alias); - - cy.get(`@wrapper`) - .tuiScrollIntoView() - .findByAutomationId(`color-picker__button`) - .click(); - } - - function changeToHex(): void { - cy.get(`tui-color-edit`) - .find(`tui-select`) - .findByAutomationId(`tui-primitive-textfield__native-input`) - .click() - .get(`tui-data-list button:nth-of-type(2)`) - .click(); - } - - function setInputBox(index: 1 | 2 | 3, value: number): void { - cy.get(`tui-color-edit tui-input-count:nth-of-type(${index})`) - .findByAutomationId(`tui-primitive-textfield__native-input`) - .type(value.toString(), {force: true}); - } -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts deleted file mode 100644 index 5f7dde4490da..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-api.cy.ts +++ /dev/null @@ -1,359 +0,0 @@ -import { - tuiClearEditor, - tuiClearHint, - tuiFocusToStartInEditor, - tuiGetContentEditable, - tuiGetDemoContent, - tuiGetEditLinkInput, - tuiGetEditorScrollbarArea, - tuiGetNgModelValue, - tuiGetScreenshotArea, - tuiGetTipTapContentSelector, - tuiInsertLink, - tuiOpenAnchorDropdown, - tuiOpenFontTool, - tuiSelectTag, - tuiVisitEditorApiPage, -} from '@demo-integrations/support/editor/helpers'; -import { - HTML_EDITOR_EXAMPLE_BLOCKQUOTE, - HTML_EDITOR_EXAMPLE_DETAILS, - HTML_EDITOR_EXAMPLE_HIGHLIGHT_BLOCK, - HTML_EDITOR_EXAMPLE_LEGACY_DETAILS, - HTML_EDITOR_EXAMPLE_LONG_WORD_UL, - HTML_EDITOR_EXAMPLE_NESTED_OL_UL, - HTML_EDITOR_EXAMPLE_NESTED_UL, - HTML_EDITOR_EXAMPLE_NESTED_UL_OL, - HTML_EDITOR_EXAMPLE_PRE_CODE, - HTML_EDITOR_EXAMPLE_TABLE, - HTML_EDITOR_EXAMPLE_UL, - HTML_EDITOR_EXAMPLE_WITH_DETAILS_INSIDE_LIST, -} from '@demo-integrations/support/editor/html'; - -describe(`Editor API`, () => { - describe(`Check fonts in light and dark mode`, () => { - for (const [index, {enableNightMode}] of [ - {enableNightMode: true}, - {enableNightMode: false}, - ].entries()) { - it(`check font in editor, enableNightMode is ${enableNightMode}`, () => { - tuiVisitEditorApiPage({enableNightMode}); - tuiClearEditor(); - - for (const [position, type] of [ - `Small`, - `Normal`, - `Large`, - `Subtitle`, - `Title`, - ].entries()) { - const screenshot = `${ - index + 1 - }-1-night-mode-enabled-${enableNightMode}-font-${position}-${type}`; - - tuiOpenFontTool() - .findByAutomationId(`tui_font__${type.toLowerCase()}`) - .tuiWaitBeforeScreenshot() - .click({force: true}); - - tuiGetContentEditable() - .type(`${type}{enter}`) - .tuiWaitBeforeScreenshot(); - - tuiGetScreenshotArea().matchImageSnapshot(screenshot); - } - }); - } - }); - - describe(`Dark mode`, () => { - beforeEach(() => tuiVisitEditorApiPage({enableNightMode: true})); - - it(`supports dark mode (input)`, () => { - tuiGetDemoContent().find(`tui-editor`).as(`editor`); - - cy.get(`@editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`1-1-dark-mode-input`); - - cy.get(`@editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`1-2-dark-mode-input`); - }); - - it(`supports dark mode (output)`, () => { - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`2-1-dark-mode-output`); - }); - }); - - describe(`details`, () => { - it(`prevents extra margin between top border of details and content`, () => { - tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_DETAILS}); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`prevents-extra-margin-details`); - }); - - it(`legacy`, () => { - tuiVisitEditorApiPage({content: ``}); - - cy.get(`.t-table tr`) - .eq(2) - .findByAutomationId(`tui-primitive-textfield__native-input`) - .type(HTML_EDITOR_EXAMPLE_LEGACY_DETAILS, {force: true, delay: 0}); - - tuiGetDemoContent().tuiWaitBeforeScreenshot().matchImageSnapshot(`legacy`); - }); - }); - - describe(`highlight`, () => { - it(`code + pre/code`, () => { - tuiVisitEditorApiPage({content: ``}); - - cy.get(`.t-table tr`) - .eq(2) - .findByAutomationId(`tui-primitive-textfield__native-input`) - .type(HTML_EDITOR_EXAMPLE_HIGHLIGHT_BLOCK, { - delay: 0, - force: true, - parseSpecialCharSequences: false, - }); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`code-block-highlight`); - }); - }); - - describe(`ordered list / bullet list`, () => { - it(`flat`, () => { - tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_UL}); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`4-1-bullet-and-ordered-list`); - }); - - it(`nested ul`, () => { - tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_NESTED_UL}); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`5-1-bullet-and-ordered-nested-list`); - }); - - it(`nested ul and ol`, () => { - tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_NESTED_UL_OL}); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`5-1-bullet-and-ordered-nested--ol-ul-list`); - }); - - it(`long words`, () => { - tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_LONG_WORD_UL}); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`5-1-bullet-and-ordered-list-with-long-word`); - }); - - it(`nested ol and ul`, () => { - tuiVisitEditorApiPage({content: HTML_EDITOR_EXAMPLE_NESTED_OL_UL}); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`5-2-bullet-and-ordered-nested-list`); - }); - - it(`emulate user toggling`, () => { - tuiVisitEditorApiPage({content: ``}); - tuiGetDemoContent().as(`wrapper`); - - cy.get(`@wrapper`).find(tuiGetTipTapContentSelector()).as(`editor`); - - toggleBullet(`tuiIconListLarge`); - - cy.get(`@editor`).type(`1{enter}`).type(`{enter}`); - - toggleBullet(`tuiIconOLLarge`); - - cy.get(`@editor`).type(`A`); - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`6-1-bullet-and-ordered-list`); - - clearEditor(); - toggleBullet(`tuiIconListLarge`); - - cy.get(`@editor`).type( - `first line{shift+enter}second line{shift+enter}third line{shift+enter}{enter}first line`, - ); - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`6-2-bullet-and-ordered-list`); - - clearEditor(); - toggleBullet(`tuiIconOLLarge`); - - cy.get(`@editor`).type( - `first line{shift+enter}second line{shift+enter}third line{shift+enter}{enter}first line`, - ); - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`6-3-bullet-and-ordered-list`); - }); - - it(`nested`, () => { - tuiVisitEditorApiPage({content: ``}); - tuiGetDemoContent().as(`wrapper`); - - cy.get(`@wrapper`).find(tuiGetTipTapContentSelector()).as(`editor`); - - toggleBullet(`tuiIconListLarge`); - cy.get(`@editor`).type(`1{enter}`); - cy.get(`@editor`).type(`2`); - toggleBullet(`tuiIconIndentLarge`); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`7-1-nested-list`); - - cy.get(`@editor`).type(`{enter}`); - cy.get(`@editor`).type(`3`); - toggleBullet(`tuiIconIndentLarge`); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`7-2-nested-list`); - - cy.get(`@editor`).type(`{enter}`); - cy.get(`@editor`).type(`4`); - toggleBullet(`tuiIconIndentLarge`); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`7-3-nested-list`); - - cy.get(`@editor`).type(`{enter}`); - toggleBullet(`tuiIconOutdentLarge`); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`7-4-nested-list`); - - cy.get(`@editor`).type(`{enter}`); - toggleBullet(`tuiIconOutdentLarge`); - cy.get(`@editor`).type(`5`); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`7-6-nested-list`); - }); - - function toggleBullet(iconType: string): void { - cy.get(`@wrapper`) - .find(`button[icon="tuiIconListLarge"]`) - .click({force: true}); - cy.get(`tui-dropdown`) - .find(`button[icon="${iconType}"]`) - .click({force: true}); - } - - function clearEditor(): void { - cy.get(`@editor`).type(`{selectall}{backspace}`); - } - }); - - describe(`Editor and Dropdown`, () => { - beforeEach(() => tuiVisitEditorApiPage({maxHeight: 400})); - - it(`should not overlap tools`, () => { - tuiFocusToStartInEditor(); - tuiSelectTag(tuiGetContentEditable().find(`strong`)); - tuiInsertLink(); - tuiGetEditLinkInput().type(`wysiwyg.com`); - tuiGetEditLinkInput().type(`{enter}`); - - tuiClearHint(); - - tuiOpenAnchorDropdown({containHref: `https://wysiwyg.com`}); - tuiGetEditorScrollbarArea().scrollTo(0, 100); - tuiGetScreenshotArea().matchImageSnapshot(`8-1-added-new-link`); - - tuiGetEditorScrollbarArea().scrollTo(0, 0); - tuiGetScreenshotArea().matchImageSnapshot(`8-2-added-new-link`); - }); - }); - - describe(`Check editor styles without important`, () => { - for (const {name, content} of [ - { - name: `blockquote`, - content: HTML_EDITOR_EXAMPLE_BLOCKQUOTE, - }, - { - name: `code`, - content: HTML_EDITOR_EXAMPLE_PRE_CODE, - }, - { - name: `table`, - content: HTML_EDITOR_EXAMPLE_TABLE, - }, - ]) { - it(name, () => { - tuiVisitEditorApiPage({content, skipDecodingUrl: true}); - - cy.get(`[contenteditable]`).focus(); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`tui-editor-socket.tui-example-${name}`); - }); - } - }); - - describe(`Heading styles`, () => { - for (const heading of [`h1`, `h2`, `h3`, `h4`, `h5`, `h6`]) { - it(heading, () => { - tuiVisitEditorApiPage(); - tuiClearEditor(); - - tuiGetNgModelValue() - .invoke( - `val`, - `<${heading}>ываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываывамсываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываываывамс<${heading}>Lorem Ipsum is simply dummy text of the printing and typesetting industry.`, - ) - .trigger(`input`); - - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`tui-editor-socket.tui-example-${heading}`); - }); - } - }); - - describe(`Details inside list`, () => { - it(`support break line`, () => { - tuiVisitEditorApiPage({ - content: HTML_EDITOR_EXAMPLE_WITH_DETAILS_INSIDE_LIST, - }); - - tuiGetDemoContent() - .find(`[tuiTiptapEditor]`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`details-inside-list-in-editor`); - }); - }); -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-font.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-font.cy.ts deleted file mode 100644 index ba23041a2af8..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-font.cy.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { - tuiClearEditor, - tuiGetContentEditable, - tuiGetScreenshotArea, - tuiOpenFontTool, - tuiVisitEditorApiPage, -} from '@demo-integrations/support/editor/helpers'; - -describe(`Editor API fonts`, () => { - it(`previous text style should not be inherited`, () => { - tuiVisitEditorApiPage(); - tuiClearEditor(); - - // step 1 - tuiOpenFontTool() - .findByAutomationId(`tui_font__title`) - .tuiWaitBeforeScreenshot() - .click({force: true}); - - tuiGetContentEditable().type(`Hello world`).tuiWaitBeforeScreenshot(); - tuiGetScreenshotArea().matchImageSnapshot(`01-editor-font`); - - // step 2 - tuiGetContentEditable().type(`{selectall}`).tuiWaitBeforeScreenshot(); - tuiOpenFontTool() - .findByAutomationId(`tui_font__normal`) - .tuiWaitBeforeScreenshot() - .click({force: true}); - - tuiGetScreenshotArea().matchImageSnapshot(`02-editor-font`); - - // step 3 - tuiGetContentEditable().type(`{selectall}`).tuiWaitBeforeScreenshot(); - tuiOpenFontTool() - .findByAutomationId(`tui_font__title`) - .tuiWaitBeforeScreenshot() - .click({force: true}); - - tuiGetScreenshotArea().matchImageSnapshot(`03-editor-font`); - }); -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-groups.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-groups.cy.ts deleted file mode 100644 index 50f1a146f654..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-groups.cy.ts +++ /dev/null @@ -1,53 +0,0 @@ -import {tuiGetTipTapContentSelector} from '@demo-integrations/support/editor/helpers'; - -describe(`Examples with groups in editor`, () => { - beforeEach(() => cy.tuiVisit(`editor/groups`)); - - it(`Simple nested group`, () => { - makeWrapper(`#nested-groups`); - - cy.get(`@wrapper`).should(`be.visible`).tuiWaitBeforeAction().click(); // clear hints - - cy.get(`@editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`1-1-nested-groups`); - }); - - it(`Draggable groups`, () => { - makeWrapper(`#draggable-groups`); - - cy.get(`@editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`2-1-draggable-groups`); - - cy.get(`@wrapper`).find(`button[icon=tuiIconPlusLarge]`).click(); - cy.get(`@wrapper`).should(`be.visible`).click(); // clear hints - - cy.get(`@editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`2-2-draggable-groups`); - - cy.get(`@editor`).should(`be.visible`).type(`{selectall}{backspace}`); - cy.get(`@wrapper`).find(`button[icon=tuiIconPlusLarge]`).click(); - cy.document().then(doc => cy.wrap(doc.activeElement, {log: false}).type(`123`)); - - cy.get(`@wrapper`).find(`button[icon=tuiIconPlusLarge]`).click(); - cy.document().then(doc => cy.wrap(doc.activeElement, {log: false}).type(`456`)); - - cy.get(`@wrapper`).should(`be.visible`).tuiWaitBeforeAction().click(); // clear hints - - cy.get(`@editor`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`2-3-draggable-groups`); - }); - - function makeWrapper(exampleId: string): void { - cy.get(exampleId) - .findByAutomationId(`tui-doc-example`) - .tuiScrollIntoView() - .tuiWaitBeforeScreenshot() - .as(`wrapper`); - - cy.get(`@wrapper`).find(tuiGetTipTapContentSelector()).as(`editor`); - } -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-img.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-img.cy.ts deleted file mode 100644 index 3f9d2a5470b6..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-img.cy.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { - tuiGetDemoContent, - tuiVisitEditorApiPage, -} from '@demo-integrations/support/editor/helpers'; -import {HTML_BASE64_IMG} from '@demo-integrations/support/editor/html'; - -describe(`Examples images`, () => { - it(`base64`, () => { - tuiVisitEditorApiPage({content: HTML_BASE64_IMG, skipDecodingUrl: true}); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`2-1-support-base64-image`); - }); - - describe(`Preview`, () => { - beforeEach(() => cy.viewport(1650, 900).tuiVisit(`editor/images/preview`)); - - it(`preview display of images`, () => { - cy.get(`#preview-image`).findByAutomationId(`tui-doc-example`).as(`wrapper`); - - cy.get(`@wrapper`).tuiScrollIntoView().click(); - - cy.get(`@wrapper`) - .find(`.tui-editor-socket`) - .eq(1) - .tuiScrollIntoView() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`3-1-two-visible-image`, {capture: `viewport`}); - - cy.get(`@wrapper`) - .find(`tui-editor-socket._preview-image`) - .find(`img`) - .filter(`[src="assets/images/big-wallpaper.jpg"]`) - .filter(`:visible`) - .click(); - - cy.tuiHide(`tui-doc-page`); - cy.tuiWaitBeforeScreenshot().matchImageSnapshot(`3-2-preview-big-wallpaper`, { - capture: `viewport`, - }); - - cy.tuiShow(`tui-doc-page`); - closePreview(); - - cy.get(`@wrapper`) - .find(`tui-editor-socket._preview-image`) - .find(`img`) - .filter(`[src="assets/images/lumberjack.png"]`) - .filter(`:visible`) - .click(); - - cy.tuiHide(`tui-doc-page`); - cy.tuiWaitBeforeScreenshot().matchImageSnapshot(`3-3-preview-lumberjack`, { - capture: `viewport`, - }); - - cy.tuiShow(`tui-doc-page`); - closePreview(); - }); - - function closePreview(): void { - cy.get(`tui-preview`).find(`button[icon=tuiIconCloseLarge]`).click(); - } - }); -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-links.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-links.cy.ts deleted file mode 100644 index 44ed97a4b47c..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-links.cy.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { - tuiClearEditor, - tuiClearHint, - tuiFocusToStartInEditor, - tuiGetContentEditable, - tuiGetEditLinkInput, - tuiGetScreenshotArea, - tuiInsertLink, - tuiOpenAnchorDropdown, - tuiSelectTag, - tuiTrashValueByEditLink, - tuiVisitEditorApiPage, -} from '@demo-integrations/support/editor/helpers'; -import {HTML_EDITOR_EXAMPLE_LINK_WITH_FORMATTED_TEXT} from '@demo-integrations/support/editor/html'; - -describe(`Editing links in Editor`, () => { - beforeEach(() => { - tuiVisitEditorApiPage(); - tuiFocusToStartInEditor(); - }); - - it(`check if at least one link exists`, () => { - tuiGetContentEditable() - .find(`a`) - .first() - .contains(`adipiscing elit`) - .should(`have.attr`, `href`) - .and(`include`, `/taiga-ui.dev`); - - tuiClearHint(); - tuiFocusToStartInEditor(); - - tuiGetScreenshotArea().matchImageSnapshot(`1-exist-link`); - }); - - it(`switch links between`, () => { - tuiSelectTag(tuiGetContentEditable().find(`strong`)); - tuiInsertLink(); - tuiGetEditLinkInput().type(`wysiwyg.com`); - tuiGetEditLinkInput().type(`{enter}`); - - tuiClearHint(); - tuiFocusToStartInEditor(); - - tuiGetScreenshotArea().matchImageSnapshot(`2-1-added-new-link`); - tuiOpenAnchorDropdown({containHref: `https://wysiwyg.com`}); - tuiGetScreenshotArea().matchImageSnapshot(`2-2-focused-new-link`); - - tuiFocusToStartInEditor(); - - tuiSelectTag(tuiGetContentEditable().find(`sup`)); - tuiInsertLink(); - tuiGetEditLinkInput().type(`example.com`); - tuiGetEditLinkInput().type(`{enter}`); - - tuiClearHint(); - tuiFocusToStartInEditor(); - - tuiGetScreenshotArea().matchImageSnapshot(`2-3-added-new-link-2`); - tuiOpenAnchorDropdown({containHref: `https://example.com`}); - tuiGetContentEditable().find(`sup`).type(`{leftArrow}`); - - tuiGetScreenshotArea().matchImageSnapshot(`2-4-focused-new-link-2`); - - tuiOpenAnchorDropdown({containHref: `https://wysiwyg.com`}); - tuiGetScreenshotArea().matchImageSnapshot( - `2-5-correct-refresh-content-in-dropdown`, - ); - }); - - it(`deleting links`, () => { - tuiSelectTag(tuiGetContentEditable().find(`strong`)); - tuiInsertLink(); - tuiGetEditLinkInput().type(`wysiwyg.com`); - tuiGetEditLinkInput().type(`{enter}`); - - tuiClearHint(); - tuiFocusToStartInEditor(); - - tuiGetScreenshotArea().matchImageSnapshot(`3-1-before-remove-link`); - - tuiOpenAnchorDropdown({containHref: `https://wysiwyg.com`}); - tuiTrashValueByEditLink(); - - tuiClearHint(); - tuiFocusToStartInEditor(); - - tuiGetScreenshotArea().matchImageSnapshot(`3-2-after-remove-link`); - }); - - it(`single link`, () => { - tuiClearEditor(); - tuiGetContentEditable().type(`link{selectAll}`); - - tuiInsertLink(); - tuiGetEditLinkInput().type(`link.com{enter}`); - tuiClearHint(); - - tuiGetContentEditable().type(`{moveToStart}`); - tuiGetScreenshotArea().matchImageSnapshot(`startOffset-0`); - - tuiGetContentEditable().type(`{rightArrow}`).tuiWaitBeforeScreenshot(); - tuiGetScreenshotArea().matchImageSnapshot(`startOffset-1`); - - tuiGetContentEditable().type(`{rightArrow}`).tuiWaitBeforeScreenshot(); - tuiGetScreenshotArea().matchImageSnapshot(`startOffset-2`); - - tuiGetContentEditable().type(`{rightArrow}`).tuiWaitBeforeScreenshot(); - tuiGetScreenshotArea().matchImageSnapshot(`startOffset-3`); - - tuiGetContentEditable().type(`{rightArrow}`).tuiWaitBeforeScreenshot(); - tuiGetScreenshotArea().matchImageSnapshot(`startOffset-4`); - - tuiGetContentEditable().type(`{enter}{enter}`); - tuiGetScreenshotArea().matchImageSnapshot( - `break-line-should-not-overlap-by-link-modal`, - ); - - tuiGetContentEditable().type(`H`); - tuiGetScreenshotArea().matchImageSnapshot( - `word-should-not-overlap-by-link-modal`, - ); - }); - - it(`revisit with highlighted text`, () => { - tuiVisitEditorApiPage({ - content: HTML_EDITOR_EXAMPLE_LINK_WITH_FORMATTED_TEXT, - skipDecodingUrl: true, - }); - - tuiFocusToStartInEditor(); - - tuiOpenAnchorDropdown({containHref: `https://wysiwyg.com`}); - - tuiGetScreenshotArea().matchImageSnapshot(`link-with-formatted-nested-content`); - }); -}); diff --git a/projects/demo-integrations/cypress/tests/addon-editor/editor-toolbar.cy.ts b/projects/demo-integrations/cypress/tests/addon-editor/editor-toolbar.cy.ts deleted file mode 100644 index 6a544a222095..000000000000 --- a/projects/demo-integrations/cypress/tests/addon-editor/editor-toolbar.cy.ts +++ /dev/null @@ -1,254 +0,0 @@ -import { - tuiClearEditor, - tuiGetDemoContent, - tuiGetTipTapContentSelector, - tuiVisitEditorApiPage, -} from '@demo-integrations/support/editor/helpers'; - -describe(`Editor's toolbar`, () => { - beforeEach(() => tuiVisitEditorApiPage()); - - it(`closes tool's dropdown if opened new tool's dropdown`, () => { - tuiGetDemoContent().find(`tui-editor`).click(); - - tuiGetDemoContent() - .findByAutomationId(`toolbar__color-button`) - .should(`be.visible`) - .click(); - tuiGetDemoContent() - .findByAutomationId(`toolbar__hilite-button`) - .should(`be.visible`) - .click({force: true}) - .trigger(`mouseleave`, {force: true}); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`1-open-new-dropdown-close-old-dropdown`); - }); - - it(`closes tool's dropdown if clicked outside`, () => { - tuiGetDemoContent() - .findByAutomationId(`toolbar__color-button`) - .should(`be.visible`) - .click(); - - cy.get(`tui-palette`).should(`exist`); - tuiGetDemoContent() - .find(`tui-editor-socket.tui-example`) - .should(`be.visible`) - .click(); - cy.get(`tui-palette`).should(`not.exist`); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`1-1-tui-palette-not-exist`); - }); - - it(`has the possibility to add custom tool`, () => { - cy.tuiVisit(`editor/custom-tool/paste-emoji`); - - cy.get(`#custom-tool`) - .findByAutomationId(`tui-doc-example`) - .tuiScrollIntoView() - .as(`wrapper`); - - cy.get(`@wrapper`).find(tuiGetTipTapContentSelector()).as(`input`); - - cy.get(`.smiles`).should(`not.exist`); - cy.get(`@input`).should(`not.be.focused`); - - cy.get(`@wrapper`) - .findByAutomationId(`smiles-tool__button`) - .should(`be.visible`) - .click(); - - cy.get(`.smiles`).should(`exist`); - cy.get(`@input`).should(`not.be.focused`); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`2-1-opened-smiles-tool`); - - cy.get(`.smile`).first().should(`be.visible`).click(); - cy.get(`@input`).should(`be.focused`); - - cy.get(`@wrapper`).matchImageSnapshot(`2-2-inserted-smile`); - - cy.focused().type(`awesome library for awesome people`).tuiWaitBeforeAction(); - - cy.get(`@wrapper`) - .findByAutomationId(`smiles-tool__button`) - .should(`be.visible`) - .click(); - - cy.get(`.smiles`).should(`exist`); - cy.get(`@input`).should(`not.be.focused`); - - cy.get(`.smile`).last().should(`be.visible`).click(); - cy.get(`@input`).should(`be.focused`); - - cy.get(`@wrapper`).matchImageSnapshot(`2-3-inserted-new-smile`); - }); - - it(`make a html table by 2x2`, () => { - tuiGetDemoContent().as(`wrapper`); - - cy.get(`@wrapper`).find(tuiGetTipTapContentSelector()).as(`input`); - - cy.get(`@input`).type(`\n`, {force: true}).blur().tuiWaitBeforeAction(); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`3-1-editor-break-line`); - - cy.get(`@wrapper`).find(`button[icon="tuiIconTableLarge"]`).as(`tableTool`); - - cy.get(`@tableTool`).tuiFocus().click(); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`3-2-editor-table-tool`); - - cy.get(`@tableTool`) - .get(`tui-table-size-selector .t-column`) - .eq(1) - .find(`.t-cell`) - .eq(1) - .should(`be.visible`) - .click(); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`3-3-editor-table-2x2`); - }); - - it(`set table without style inheritance`, () => { - tuiGetDemoContent().as(`wrapper`); - cy.get(`@wrapper`).find(tuiGetTipTapContentSelector()).as(`input`); - - cy.get(`@input`) - .type(`{selectall}{backspace}`, {force: true}) - .should(`be.visible`) - .blur(); - - cy.get(`@wrapper`) - .findByAutomationId(`toolbar__ordering-list-button`) - .should(`be.visible`) - .click(); - - cy.get(`button[icon="tuiIconListLarge"].t-option`) - .should(`be.visible`) - .click({force: true}); - - cy.get(`@wrapper`) - .findByAutomationId(`toolbar__font-style-button`) - .should(`be.visible`) - .click(); - - cy.get(`@input`).type(`12345`).blur(); - - cy.get(`@wrapper`) - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`4-1-set-unordered-list`); - - cy.get(`@wrapper`).find(`button[icon="tuiIconTableLarge"]`).as(`tableTool`); - - cy.get(`@tableTool`).tuiFocus().click(); - - cy.get(`@tableTool`) - .get(`tui-table-size-selector .t-column`) - .eq(1) - .find(`.t-cell`) - .eq(1) - .should(`be.visible`) - .click(); - - tuiGetDemoContent() - .tuiWaitBeforeScreenshot() - .matchImageSnapshot(`4-2-set-table-without-style-inheritance`); - }); - - describe(`has keyboard horizontal navigation between tool-buttons`, () => { - it(`focuses nearest left/right active tool on "Arrow Right"/"Arrow Left"`, () => { - tuiGetDemoContent().as(`wrapper`); - - cy.get(`@wrapper`) - .find(`button[icon="tuiIconAlignLeftLarge"]`) - .as(`initialTool`); - cy.get(`@wrapper`).find(`button[icon="tuiIconFormatLarge"]`).as(`leftTool`); - cy.get(`@wrapper`).find(`button[icon="tuiIconListLarge"]`).as(`rightTool`); - - cy.get(`@initialTool`).tuiFocus(); - - // <== - cy.get(`body`).type(`{leftarrow}`); - cy.get(`@leftTool`).should(`be.focused`); - - // ==> ==> - cy.get(`body`).type(`{rightarrow}`); - cy.get(`@initialTool`).should(`be.focused`); - cy.get(`body`).type(`{rightarrow}`); - cy.get(`@rightTool`).should(`be.focused`); - }); - - it(`skips disabled tools and selects next tool after disabled`, () => { - tuiGetDemoContent().as(`wrapper`); - - tuiClearEditor(); - - cy.get(`@wrapper`) - .find(`button[icon="tuiIconUndoLarge"]`) - .as(`leftActiveTool`); - cy.get(`@wrapper`) - .find(`button[icon="tuiIconRedoLarge"]`) - .as(`betweenDisabledTool`); - cy.get(`@wrapper`) - .find(`button[icon="tuiIconFontLarge"]`) - .as(`rightActiveTool`); - - // | (active) | disabled | active | - // ==> - // | active | disabled | (active) | - cy.get(`@leftActiveTool`).tuiFocus(); - cy.get(`body`).type(`{rightarrow}`); - cy.get(`@betweenDisabledTool`).should(`not.be.focused`); - cy.get(`@rightActiveTool`).should(`be.focused`); - - // | active | disabled | (active) | - // <== - // | (active) | disabled | active | - cy.get(`body`).type(`{leftarrow}`); - cy.get(`@betweenDisabledTool`).should(`not.be.focused`); - cy.get(`@leftActiveTool`).should(`be.focused`); - }); - - it(`works with custom tools`, () => { - cy.tuiVisit(`editor/custom-tool/paste-emoji`); - - cy.get(`#custom-tool`) - .findByAutomationId(`tui-doc-example`) - .tuiScrollIntoView() - .as(`wrapper`); - - cy.get(`@wrapper`) - .find(tuiGetTipTapContentSelector()) - .type(`123`, {force: true}); - - cy.get(`@wrapper`) - .find(`button[icon="tuiIconUndoLarge"]`) - .as(`leftBuiltInTool`); - cy.get(`@wrapper`) - .find(`button[icon="tuiIconStarLarge"]`) - .as(`rightCustomTool`); - - // ==> - cy.get(`@leftBuiltInTool`).tuiFocus(); - cy.get(`body`).type(`{rightarrow}`); - cy.get(`@rightCustomTool`).should(`be.focused`); - - // <== - cy.get(`body`).type(`{leftarrow}`); - cy.get(`@leftBuiltInTool`).should(`be.focused`); - }); - }); -}); diff --git a/projects/demo/src/modules/app/app.routes.ts b/projects/demo/src/modules/app/app.routes.ts index 5d9eadc47a6d..ef0602557889 100644 --- a/projects/demo/src/modules/app/app.routes.ts +++ b/projects/demo/src/modules/app/app.routes.ts @@ -268,15 +268,6 @@ export const ROUTES: Routes = [ title: `CheckboxLabeled`, }, }, - { - path: `components/color-picker`, - loadChildren: async () => - (await import(`../components/color-picker/color-picker.module`)) - .ExampleTuiColorPickerModule, - data: { - title: `ColorPicker`, - }, - }, { path: `components/primitive-checkbox`, loadChildren: async () => @@ -994,217 +985,6 @@ export const ROUTES: Routes = [ title: `Tree`, }, }, - // EDITOR - { - path: `editor/API`, - loadChildren: async () => - (await import(`../components/editor/starter/editor-starter.module`)) - .ExampleTuiEditorStarterModule, - data: { - title: `Editor — Starter Kit`, - }, - }, - { - path: `editor/custom-tool/paste-emoji`, - loadChildren: async () => - ( - await import( - `../components/editor/custom-tool/paste-emoji/editor-paste-emoji.module` - ) - ).ExampleTuiEditorPasteEmojiToolModule, - data: { - title: `Editor — Paste emoji custom tool`, - }, - }, - { - path: `editor/custom-tool/color-picker`, - loadChildren: async () => - ( - await import( - `../components/editor/custom-tool/color-picker/editor-color-picker.module` - ) - ).ExampleTuiEditorColorPickerToolModule, - data: { - title: `Editor — Color picker custom tool`, - }, - }, - { - path: `editor/custom-tool/paste-image`, - loadChildren: async () => - ( - await import( - `../components/editor/custom-tool/paste-image/editor-paste-image-tool.module` - ) - ).ExampleTuiEditorPasteImageToolModule, - data: { - title: `Editor — Paste image custom tool`, - }, - }, - { - path: `editor/font`, - loadChildren: async () => - (await import(`../components/editor/font/editor-font.module`)) - .ExampleTuiEditorFontModule, - data: { - title: `Editor — Font`, - }, - }, - { - path: `editor/groups`, - loadChildren: async () => - (await import(`../components/editor/groups/editor-groups.module`)) - .ExampleTuiEditorGroupsModule, - data: { - title: `Editor — Groups`, - }, - }, - { - path: `editor/focus`, - loadChildren: async () => - (await import(`../components/editor/focus/editor-focus.module`)) - .ExampleTuiEditorFocusModule, - data: { - title: `Editor — Focus`, - }, - }, - { - path: `editor/anchors`, - loadChildren: async () => - (await import(`../components/editor/anchors/editor-anchors.module`)) - .ExampleTuiEditorAnchorsModule, - data: { - title: `Editor — Anchors`, - }, - }, - { - path: `editor/upload-files`, - loadChildren: async () => - (await import(`../components/editor/upload-files/editor-upload-files.module`)) - .ExampleTuiEditorUploadFilesModule, - data: { - title: `Editor — Upload files`, - }, - }, - { - path: `editor/highlight/text`, - loadChildren: async () => - (await import(`../components/editor/highlight/text/editor-mark-text.module`)) - .ExampleTuiEditorMarkTextModule, - data: { - title: `Editor — Highlight text`, - }, - }, - { - path: `editor/highlight/code`, - loadChildren: async () => - (await import(`../components/editor/highlight/code/editor-code-block.module`)) - .ExampleTuiEditorCodeBlockModule, - data: { - title: `Editor — Highlight code`, - }, - }, - { - path: `editor/processing/legacy-html`, - loadChildren: async () => - ( - await import( - `../components/editor/processing/legacy-html/editor-legacy-html.module` - ) - ).ExampleTuiEditorLegacyHtmlModule, - data: { - title: `Editor — Legacy html`, - }, - }, - { - path: `editor/processing/cleanup-html`, - loadChildren: async () => - ( - await import( - `../components/editor/processing/cleanup-html/editor-cleanup-html.module` - ) - ).ExampleTuiEditorCleanupHtmlModule, - data: { - title: `Editor — Cleanup html`, - }, - }, - { - path: `editor/processing/markdown`, - loadChildren: async () => - ( - await import( - `../components/editor/processing/markdown/editor-markdown.module` - ) - ).ExampleTuiEditorMarkdownModule, - data: { - title: `Editor — Markdown`, - }, - }, - { - path: `editor/images/resizable`, - loadChildren: async () => - ( - await import( - `../components/editor/images/resizable/editor-resizable-images.module` - ) - ).ExampleTuiEditorResizableImagesToolModule, - data: { - title: `Editor — Resizable images`, - }, - }, - { - path: `editor/images/preview`, - loadChildren: async () => - ( - await import( - `../components/editor/images/preview/editor-preview-images.module` - ) - ).ExampleTuiEditorPreviewImagesToolModule, - data: { - title: `Editor — Preview images`, - }, - }, - { - path: `editor/images/upload`, - loadChildren: async () => - ( - await import( - `../components/editor/images/upload/editor-upload-images.module` - ) - ).ExampleTuiEditorUploadImagesModule, - data: { - title: `Editor — Upload images`, - }, - }, - { - path: `editor/embed/youtube`, - loadChildren: async () => - ( - await import( - `../components/editor/embed/youtube/editor-embed-youtube.module` - ) - ).ExampleTuiEditorEmbedYoutubeModule, - data: { - title: `Editor — Youtube`, - }, - }, - { - path: `editor/embed/iframe`, - loadChildren: async () => - (await import(`../components/editor/embed/iframe/editor-embed-iframe.module`)) - .ExampleTuiEditorEmbedIframeModule, - data: { - title: `Editor — Iframe`, - }, - }, - { - path: `editor/embed/html5`, - loadChildren: async () => - (await import(`../components/editor/embed/html5/editor-embed-html5.module`)) - .ExampleTuiEditorEmbedHtml5Module, - data: { - title: `Editor — HTML5`, - }, - }, // ICONS { path: `icons/overview`, diff --git a/projects/demo/src/modules/app/pages.ts b/projects/demo/src/modules/app/pages.ts index 67665ac0ca53..b3d144eec0eb 100644 --- a/projects/demo/src/modules/app/pages.ts +++ b/projects/demo/src/modules/app/pages.ts @@ -246,12 +246,6 @@ export const pages: TuiDocPages = [ }, ], }, - { - section: `Components`, - title: `ColorPicker`, - keywords: `цвет, выбор, градиент, gradient, палитра, input, inputcolor`, - route: `/components/color-picker`, - }, { section: `Components`, title: `Dialog`, @@ -877,164 +871,6 @@ export const pages: TuiDocPages = [ keywords: `график, чарт, chart, graph, кольцо, круг, диаграмма`, route: `/charts/ring-chart`, }, - // Editor - { - section: `Editor`, - title: `Starter Kit`, - keywords: `editor, setup, starter kit, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/API`, - }, - { - section: `Editor`, - title: `Font`, - keywords: `editor, font, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/font`, - }, - { - section: `Editor`, - title: `Anchors`, - keywords: `editor, anchors, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/anchors`, - }, - { - section: `Editor`, - title: `Groups`, - keywords: `editor, draggable, nested, hilite, groups, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/groups`, - }, - { - section: `Editor`, - title: `Focus`, - keywords: `editor, focus, focusable, wysiwyg, редактор, фокус, html, rich, text`, - route: `/editor/focus`, - }, - { - section: `Editor`, - title: `Upload files`, - keywords: `editor, upload, files, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/upload-files`, - }, - { - section: `Editor`, - title: `Custom tool`, - subPages: [ - { - section: `Editor`, - title: `Paste emoji`, - keywords: `editor, custom, tool, emoji, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/custom-tool/paste-emoji`, - }, - { - section: `Editor`, - title: `Paste image`, - keywords: `editor, paste image, tool, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/custom-tool/paste-image`, - }, - { - section: `Editor`, - title: `Color picker`, - keywords: `editor, custom color picker, color picker, tool, wysiwyg, редактор, выбрать цвет, html, rich, text`, - route: `/editor/custom-tool/color-picker`, - }, - { - section: `Editor`, - title: `Font size tool`, - keywords: `editor, custom font size tool, tool, wysiwyg, редактор, выбрать размер, html, rich, text`, - route: `/editor/font`, - fragment: `custom-size-tool`, - }, - ], - }, - { - section: `Editor`, - title: `Highlight`, - subPages: [ - { - section: `Editor`, - title: `Mark text`, - keywords: `editor, highlight, text, wysiwyg, редактор, текст, подсветка, html, rich, text`, - route: `/editor/highlight/text`, - }, - { - section: `Editor`, - title: `Code block`, - keywords: `editor, highlight, code, block, pre, wysiwyg, редактор, текст, подсветка, html, rich, text`, - route: `/editor/highlight/code`, - }, - ], - }, - { - section: `Editor`, - title: `Processing`, - subPages: [ - { - section: `Editor`, - title: `Legacy html`, - keywords: `editor, processing, content, legacy html, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/processing/legacy-html`, - }, - { - section: `Editor`, - title: `Cleanup html`, - keywords: `editor, processing, content, cleanup html, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/processing/cleanup-html`, - }, - { - section: `Editor`, - title: `Markdown`, - keywords: `editor, markdown, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/processing/markdown`, - }, - ], - }, - { - section: `Editor`, - title: `Images`, - subPages: [ - { - section: `Editor`, - title: `Resizable`, - keywords: `editor, resizable, image, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/images/resizable`, - }, - { - section: `Editor`, - title: `Preview images`, - keywords: `editor, preview, images, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/images/preview`, - }, - { - section: `Editor`, - title: `Upload`, - keywords: `editor, upload, images, wysiwyg, редактор, текст, html, rich, text`, - route: `/editor/images/upload`, - }, - ], - }, - { - section: `Editor`, - title: `Embed`, - subPages: [ - { - section: `Editor`, - title: `Youtube`, - keywords: `editor, embed, video player, audio player, youtube, wysiwyg, редактор, плейер, плеер, ютуб, текст, html, rich, text`, - route: `/editor/embed/youtube`, - }, - { - section: `Editor`, - title: `Iframe`, - keywords: `editor, embed, iframe, wysiwyg, редактор, айфрейм, html, rich, text`, - route: `/editor/embed/iframe`, - }, - { - section: `Editor`, - title: `HTML5`, - keywords: `editor, embed, video player, audio player, html5, wysiwyg, редактор, плеер, html, rich, text`, - route: `/editor/embed/html5`, - }, - ], - }, // Icons { section: `Icons`, diff --git a/projects/demo/src/modules/app/stackblitz/stackblitz-deps.service.ts b/projects/demo/src/modules/app/stackblitz/stackblitz-deps.service.ts index 4329ba94c323..70cf6fd1291c 100644 --- a/projects/demo/src/modules/app/stackblitz/stackblitz-deps.service.ts +++ b/projects/demo/src/modules/app/stackblitz/stackblitz-deps.service.ts @@ -12,7 +12,6 @@ export class StackblitzDepsService { ...(await this.getAngularPackages()), ...this.getTaigaPackages(), ...(await this.getCommonPackages()), - ...(await this.getEditorPackagesOrEmpty()), }; } @@ -51,7 +50,6 @@ export class StackblitzDepsService { '@taiga-ui/styles': version, '@taiga-ui/addon-charts': version, '@taiga-ui/addon-commerce': version, - '@taiga-ui/addon-editor': version, '@taiga-ui/addon-mobile': version, '@taiga-ui/addon-preview': version, '@taiga-ui/addon-table': version, @@ -87,10 +85,4 @@ export class StackblitzDepsService { typescript: rootDevDeps.typescript, }; } - - private async getEditorPackagesOrEmpty(): Promise> { - return this.location.pathname.includes(`/editor/`) - ? (await import(`@taiga-ui/addon-editor/package.json`)).dependencies - : {}; - } } diff --git a/projects/demo/src/modules/app/stackblitz/utils.ts b/projects/demo/src/modules/app/stackblitz/utils.ts index 4599e19e45bf..b9f284ee70da 100644 --- a/projects/demo/src/modules/app/stackblitz/utils.ts +++ b/projects/demo/src/modules/app/stackblitz/utils.ts @@ -99,14 +99,13 @@ export async function getAllTaigaUIModulesFile( * You can't just iterate the array with package-names - it will cause error: * `Warning: Critical dependency: the request of a dependency is an expression` * */ - const [cdk, core, kit, charts, commerce, editor, mobile, preview, table, tablebars] = + const [cdk, core, kit, charts, commerce, mobile, preview, table, tablebars] = await Promise.all([ import(`@taiga-ui/cdk`), import(`@taiga-ui/core`), import(`@taiga-ui/kit`), import(`@taiga-ui/addon-charts`), import(`@taiga-ui/addon-commerce`), - import(`@taiga-ui/addon-editor`), import(`@taiga-ui/addon-mobile`), import(`@taiga-ui/addon-preview`), import(`@taiga-ui/addon-table`), @@ -136,9 +135,6 @@ import { import { ${commerce} } from '@taiga-ui/addon-commerce'; -import { - ${editor} -} from '@taiga-ui/addon-editor'; import { ${mobile} } from '@taiga-ui/addon-mobile'; @@ -180,8 +176,6 @@ export const ALL_TAIGA_UI_MODULES = [ ${charts}, /* ADDON-COMMERCE */ ${commerce}, - /* ADDON-EDITOR */ - ${editor}, /* ADDON-MOBILE */ ${mobile}, /* ADDON-PREVIEW */ diff --git a/projects/demo/src/modules/components/color-picker/color-picker.component.ts b/projects/demo/src/modules/components/color-picker/color-picker.component.ts deleted file mode 100644 index 3ed94099c314..000000000000 --- a/projects/demo/src/modules/components/color-picker/color-picker.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'example-tui-color-picker', - templateUrl: './color-picker.template.html', - changeDetection, -}) -export class ExampleTuiColorPickerComponent { - readonly exampleModule = import('./examples/import/import-module.md?raw'); - readonly exampleHtml = import('./examples/import/insert-template.md?raw'); - - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - }; - - readonly example2: TuiDocExample = { - TypeScript: import('./examples/2/index.ts?raw'), - HTML: import('./examples/2/index.html?raw'), - LESS: import('./examples/2/index.less?raw'), - }; - - readonly example3: TuiDocExample = { - TypeScript: import('./examples/3/index.ts?raw'), - HTML: import('./examples/3/index.html?raw'), - }; - - readonly example4: TuiDocExample = { - TypeScript: import('./examples/4/index.ts?raw'), - HTML: import('./examples/4/index.html?raw'), - LESS: import('./examples/4/index.less?raw'), - }; -} diff --git a/projects/demo/src/modules/components/color-picker/color-picker.module.ts b/projects/demo/src/modules/components/color-picker/color-picker.module.ts deleted file mode 100644 index 63c66c8856e7..000000000000 --- a/projects/demo/src/modules/components/color-picker/color-picker.module.ts +++ /dev/null @@ -1,63 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import { - TuiColorPickerModule, - TuiColorSelectorModule, - TuiInputColorModule, - TuiPaletteModule, -} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiNotificationModule, - TuiSvgModule, - TuiTextfieldControllerModule, - TuiWrapperModule, -} from '@taiga-ui/core'; -import {TuiInputModule} from '@taiga-ui/kit'; - -import {ExampleTuiColorPickerComponent} from './color-picker.component'; -import {TuiColorPickerExample1} from './examples/1'; -import {TuiColorPickerExample2} from './examples/2'; -import {TuiColorPickerExample3} from './examples/3'; -import {TuiColorPickerExample4} from './examples/4'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MaskitoModule, - TuiColorPickerModule, - TuiNotificationModule, - TuiInputModule, - TuiLinkModule, - TuiSvgModule, - TuiWrapperModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiColorSelectorModule, - TuiActiveZoneModule, - TuiDropdownModule, - TuiInputColorModule, - TuiTextfieldControllerModule, - TuiAddonDocModule, - TuiPaletteModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiColorPickerComponent)), - ], - declarations: [ - ExampleTuiColorPickerComponent, - TuiColorPickerExample1, - TuiColorPickerExample2, - TuiColorPickerExample3, - TuiColorPickerExample4, - ], - exports: [ExampleTuiColorPickerComponent], -}) -export class ExampleTuiColorPickerModule {} diff --git a/projects/demo/src/modules/components/color-picker/color-picker.template.html b/projects/demo/src/modules/components/color-picker/color-picker.template.html deleted file mode 100644 index 3366b5a0742d..000000000000 --- a/projects/demo/src/modules/components/color-picker/color-picker.template.html +++ /dev/null @@ -1,97 +0,0 @@ - - -

- ColorPicker allows to pick a color and its transparency. InputColor and ColorSelector are made with - ColorPicker -

- - - - - - - - You can easily integrative native color picker into input using interactive icon content and - - Maskito - - for masking - - - - - - - - - - - -
- - - - - - - - RGBA color tuple - - - - - -
    -
  1. -

    - Import - TuiColorPickerModule - into a module where you want to use our component -

    - - -
  2. - -
  3. -

    Add to the template:

    - - -
  4. -
-
-
diff --git a/projects/demo/src/modules/components/color-picker/examples/1/index.html b/projects/demo/src/modules/components/color-picker/examples/1/index.html deleted file mode 100644 index dc7edfd735c2..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/1/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - Background color - - - Background color - - - Background color - diff --git a/projects/demo/src/modules/components/color-picker/examples/1/index.ts b/projects/demo/src/modules/components/color-picker/examples/1/index.ts deleted file mode 100644 index 78d2e75a14bb..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/1/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {defaultEditorColors} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-color-picker-example-1', - templateUrl: './index.html', - changeDetection, - encapsulation, -}) -export class TuiColorPickerExample1 { - color = '#ffdd2d'; - - readonly palette = defaultEditorColors; -} diff --git a/projects/demo/src/modules/components/color-picker/examples/2/index.html b/projects/demo/src/modules/components/color-picker/examples/2/index.html deleted file mode 100644 index 1c003b3b084e..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/2/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/projects/demo/src/modules/components/color-picker/examples/2/index.less b/projects/demo/src/modules/components/color-picker/examples/2/index.less deleted file mode 100644 index e82e9601906b..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/2/index.less +++ /dev/null @@ -1,4 +0,0 @@ -.invert { - color: inherit; - filter: invert(1); -} diff --git a/projects/demo/src/modules/components/color-picker/examples/2/index.ts b/projects/demo/src/modules/components/color-picker/examples/2/index.ts deleted file mode 100644 index bfdba36db61f..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/2/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {Component, Inject} from '@angular/core'; -import {DomSanitizer, SafeStyle} from '@angular/platform-browser'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; - -@Component({ - selector: 'tui-color-picker-example-2', - templateUrl: './index.html', - styleUrls: ['./index.less'], - changeDetection, - encapsulation, -}) -export class TuiColorPickerExample2 { - color = '#ffdd2d'; - - constructor(@Inject(DomSanitizer) private readonly sanitizer: DomSanitizer) {} - - get background(): SafeStyle { - return this.sanitizer.bypassSecurityTrustStyle(this.color); - } -} diff --git a/projects/demo/src/modules/components/color-picker/examples/3/index.html b/projects/demo/src/modules/components/color-picker/examples/3/index.html deleted file mode 100644 index 887e93674930..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/3/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/projects/demo/src/modules/components/color-picker/examples/3/index.ts b/projects/demo/src/modules/components/color-picker/examples/3/index.ts deleted file mode 100644 index 44a89717934a..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/3/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {BehaviorSubject} from 'rxjs'; - -@Component({ - selector: 'tui-color-picker-example-3', - templateUrl: './index.html', - changeDetection, - encapsulation, -}) -export class TuiColorPickerExample3 { - colors = new Map([ - ['red', 'var(--tui-error-fill)'], - ['green', 'var(--tui-success-fill)'], - ['blue', 'var(--tui-info-fill)'], - ]); - - color$ = new BehaviorSubject('var(--tui-success-fill)'); - - updateColor(color: string): void { - this.color$.next(color); - } -} diff --git a/projects/demo/src/modules/components/color-picker/examples/4/index.html b/projects/demo/src/modules/components/color-picker/examples/4/index.html deleted file mode 100644 index 98b808cdf784..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/4/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - Input color - - - - -
-
diff --git a/projects/demo/src/modules/components/color-picker/examples/4/index.less b/projects/demo/src/modules/components/color-picker/examples/4/index.less deleted file mode 100644 index 8559e52db38c..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/4/index.less +++ /dev/null @@ -1,19 +0,0 @@ -@import 'taiga-ui-local'; - -input { - .fullsize(); - opacity: 0; - pointer-events: auto; - - &:hover + tui-svg { - opacity: 0.65; - } -} - -hr { - position: absolute; - width: 1.4rem; - height: 0.3rem; - bottom: 0.1rem; - border-radius: 0.125rem; -} diff --git a/projects/demo/src/modules/components/color-picker/examples/4/index.ts b/projects/demo/src/modules/components/color-picker/examples/4/index.ts deleted file mode 100644 index 16694a36c1a6..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/4/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; - -@Component({ - selector: 'tui-color-picker-example-4', - templateUrl: './index.html', - styleUrls: ['./index.less'], - changeDetection, - encapsulation, -}) -export class TuiColorPickerExample4 { - readonly mask = {mask: ['#', ...new Array(6).fill(/[0-9a-f]/i)]}; - - value = '#ffdd2d'; -} diff --git a/projects/demo/src/modules/components/color-picker/examples/import/import-module.md b/projects/demo/src/modules/components/color-picker/examples/import/import-module.md deleted file mode 100644 index 6ac10e31da40..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/import/import-module.md +++ /dev/null @@ -1,14 +0,0 @@ -```ts -import {TuiColorPickerModule} from '@taiga-ui/addon-editor'; - -// ... - -@NgModule({ - imports: [ - // ... - TuiColorPickerModule, - ], - // ... -}) -export class MyModule {} -``` diff --git a/projects/demo/src/modules/components/color-picker/examples/import/insert-template.md b/projects/demo/src/modules/components/color-picker/examples/import/insert-template.md deleted file mode 100644 index 927b30fcbbe3..000000000000 --- a/projects/demo/src/modules/components/color-picker/examples/import/insert-template.md +++ /dev/null @@ -1,3 +0,0 @@ -```html - -``` diff --git a/projects/demo/src/modules/components/editor/anchors/editor-anchors.component.html b/projects/demo/src/modules/components/editor/anchors/editor-anchors.component.html deleted file mode 100644 index 7bad72071aa6..000000000000 --- a/projects/demo/src/modules/components/editor/anchors/editor-anchors.component.html +++ /dev/null @@ -1,33 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/anchors/editor-anchors.component.ts b/projects/demo/src/modules/components/editor/anchors/editor-anchors.component.ts deleted file mode 100644 index 05e1ccd1b3c4..000000000000 --- a/projects/demo/src/modules/components/editor/anchors/editor-anchors.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-anchors', - templateUrl: './editor-anchors.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorAnchorsComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/anchors/editor-anchors.module.ts b/projects/demo/src/modules/components/editor/anchors/editor-anchors.module.ts deleted file mode 100644 index a3d1b1dcabaa..000000000000 --- a/projects/demo/src/modules/components/editor/anchors/editor-anchors.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorAnchorsComponent} from './editor-anchors.component'; -import {TuiEditorAnchorsExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorAnchorsComponent)), - ], - declarations: [TuiEditorAnchorsExample1, ExampleTuiEditorAnchorsComponent], -}) -export class ExampleTuiEditorAnchorsModule {} diff --git a/projects/demo/src/modules/components/editor/anchors/examples/1/index.html b/projects/demo/src/modules/components/editor/anchors/examples/1/index.html deleted file mode 100644 index a3a09b9f75fd..000000000000 --- a/projects/demo/src/modules/components/editor/anchors/examples/1/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/anchors/examples/1/index.ts b/projects/demo/src/modules/components/editor/anchors/examples/1/index.ts deleted file mode 100644 index 1198712c0ec1..000000000000 --- a/projects/demo/src/modules/components/editor/anchors/examples/1/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {Component, Injector} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-anchors-example-1', - templateUrl: './index.html', - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-image').then(({default: Image}) => - Image.configure({inline: true, allowBase64: true}), - ), - import('@taiga-ui/addon-editor/extensions/image-editor').then( - ({createImageEditorExtension}) => - createImageEditorExtension(injector), - ), - import('@tiptap/extension-text-style').then(({TextStyle}) => TextStyle), - import('@taiga-ui/addon-editor/extensions/link').then( - ({TuiLink}) => TuiLink, - ), - import('@taiga-ui/addon-editor/extensions/jump-anchor').then( - ({TuiJumpAnchor}) => TuiJumpAnchor, - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorAnchorsExample1 { - readonly builtInTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Img, - TuiEditorTool.Link, - TuiEditorTool.Anchor, - ]; - - control = new FormControl( - '

War and Peace (Russian: Война и мир, romanizedVoyna i mir; pre-reform Russian: Война и миръ; [vɐjˈna i ˈmʲir]) is a literary work by the Russian author Leo Tolstoy that mixes fictional narrative with chapters on history and philosophy. It was first published serially, then published in its entirety in 1869. It is regarded as Tolstoy\'s finest literary achievement and remains an internationally praised classic of world literature.[1][2][3]

The novel chronicles the French invasion of Russia and the impact of the Napoleonic era on Tsarist society through the stories of five Russian aristocratic families. Portions of an earlier version, titled The Year 1805,[4] were serialized in The Russian Messenger from 1865 to 1867 before the novel was published in its entirety in 1869.[5]

Tolstoy said that the best Russian literature does not conform to standards and hence hesitated to classify War and Peace, saying it is "not a novel, even less is it a poem, and still less a historical chronicle". Large sections, especially the later chapters, are philosophical discussions rather than narrative.[6] He regarded Anna Karenina as his first true novel.

References:

  1. Moser, Charles. 1992. Encyclopedia of Russian Literature. Cambridge University Press, pp. 298–300.

  2. Thirlwell, Adam "A masterpiece in miniature". The Guardian (London, UK) October 8, 2005

  3. Briggs, Anthony. 2005. "Introduction" to War and Peace. Penguin Classics.

  4. Pevear, Richard (2008). "Introduction". War and Peace. Trans. Pevear; Volokhonsky, Larissa. New York: Vintage Books. pp. VIII–IX. ISBN 978-1-4000-7998-8.

  5. Knowles, A. V. Leo Tolstoy, Routledge 1997.

  6. "Introduction?". War and Peace. Wordsworth Editions. 1993. ISBN 978-1-85326-062-9. Retrieved 2009-03-24.

', - ); -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.html b/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.html deleted file mode 100644 index 4b8d55d5933c..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.html +++ /dev/null @@ -1,33 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.ts b/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.ts deleted file mode 100644 index b6b5dc77822c..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'editor-color-picker-tool', - templateUrl: './editor-color-picker.component.html', - encapsulation, - changeDetection, -}) -export class ExampleTuiEditorColorPickerToolComponent { - readonly example1: TuiDocExample = { - HTML: import('./examples/1/index.html?raw'), - TypeScript: import('./examples/1/index.ts?raw'), - './custom-color-picker/custom-color-picker.component.ts': import( - './examples/1/custom-color-picker/custom-color-picker.component.ts?raw' - ), - './custom-color-picker/custom-color-picker.component.less': import( - './examples/1/custom-color-picker/custom-color-picker.component.less?raw' - ), - './custom-color-picker/custom-color-picker.component.html': import( - './examples/1/custom-color-picker/custom-color-picker.component.html?raw' - ), - './custom-color-picker/custom-color-picker.module.ts': import( - './examples/1/custom-color-picker/custom-color-picker.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.module.ts b/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.module.ts deleted file mode 100644 index 1331f1649409..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/editor-color-picker.module.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiButtonModule, TuiLinkModule} from '@taiga-ui/core'; - -import {ExampleTuiEditorColorPickerToolComponent} from './editor-color-picker.component'; -import {TuiEditorColorPickerToolExample1} from './examples/1'; -import {CustomColorPickerModule} from './examples/1/custom-color-picker/custom-color-picker.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiLinkModule, - TuiButtonModule, - TuiAddonDocModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - CustomColorPickerModule, - RouterModule.forChild( - tuiGenerateRoutes(ExampleTuiEditorColorPickerToolComponent), - ), - ], - declarations: [ - TuiEditorColorPickerToolExample1, - ExampleTuiEditorColorPickerToolComponent, - ], -}) -export class ExampleTuiEditorColorPickerToolModule {} diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.html b/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.html deleted file mode 100644 index 59699bef868e..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.html +++ /dev/null @@ -1,41 +0,0 @@ - - -
- - - - - -
diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.less b/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.less deleted file mode 100644 index b7e6e2bc25c8..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.less +++ /dev/null @@ -1,14 +0,0 @@ -@import '@taiga-ui/addon-editor/components/toolbar-tools/tools-common.less'; - -:host { - position: relative; -} - -.t-color-save { - position: sticky; - left: 0; - bottom: 0; - width: 100%; - box-shadow: inset 0 1px var(--tui-base-03); - background: var(--tui-base-01); -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.ts b/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.ts deleted file mode 100644 index 74e6db33211b..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core'; -import { - AbstractTuiEditor, - TUI_EDITOR_OPTIONS, - TuiEditorOptions, - TuiTiptapEditorService, -} from '@taiga-ui/addon-editor'; -import {distinctUntilChanged, map, share} from 'rxjs/operators'; - -@Component({ - selector: 'custom-color-picker', - templateUrl: './custom-color-picker.component.html', - styleUrls: ['./custom-color-picker.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class CustomColorPickerComponent { - @Input() - colors: ReadonlyMap = this.defaultOptions.colors; - - @Input() - icon?: string; - - @Input() - type!: 'BackgroundColor' | 'FontColor'; - - selectedColor = ''; - - readonly fontColor$ = this.editor.stateChange$.pipe( - map(() => - this.editor.getOriginTiptapEditor().isFocused - ? this.editor[`get${this.type}` as const]?.() || 'transparent' - : 'transparent', - ), - distinctUntilChanged(), - share(), - ); - - constructor( - @Inject(TUI_EDITOR_OPTIONS) - private readonly defaultOptions: TuiEditorOptions, - @Inject(TuiTiptapEditorService) readonly editor: AbstractTuiEditor, - ) {} - - onValueChange(color: string): void { - this.selectedColor = color; - } - - setColor(): void { - this.editor[`set${this.type}` as const]?.(this.selectedColor); - } -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.module.ts b/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.module.ts deleted file mode 100644 index 0e2cd819e31a..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/custom-color-picker/custom-color-picker.module.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import { - TuiColorPickerModule, - TuiColorSelectorModule, - TuiPaletteModule, -} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule, TuiLetModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHintModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {CustomColorPickerComponent} from './custom-color-picker.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiDropdownModule, - TuiHintModule, - TuiPaletteModule, - TuiActiveZoneModule, - TuiLetModule, - TuiColorPickerModule, - TuiColorSelectorModule, - ], - declarations: [CustomColorPickerComponent], - exports: [CustomColorPickerComponent], -}) -export class CustomColorPickerModule {} diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.html b/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.html deleted file mode 100644 index 6e310958f801..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - diff --git a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.ts b/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.ts deleted file mode 100644 index d8ed2e4048b0..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/color-picker/examples/1/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-color-picker-tool-example-1', - templateUrl: './index.html', - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-style').then( - ({default: TextStyle}) => TextStyle, - ), - import('@taiga-ui/addon-editor/extensions/font-color').then( - ({FontColor}) => FontColor, - ), - import('@taiga-ui/addon-editor/extensions/background-color').then( - ({BackgroundColor}) => BackgroundColor, - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorColorPickerToolExample1 { - readonly builtInTools = [TuiEditorTool.Undo]; - - readonly control = new FormControl(''); -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.html b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.html deleted file mode 100644 index 60ae2abb68fe..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.html +++ /dev/null @@ -1,58 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - You can create your own tool: -
    -
  • - Create component with tool button (which can get access to - - original TipTap editor API - - via - TuiTiptapEditorService - from - @taiga-ui/addon-editor - ). -
  • -
  • - Pass the component as content projection (with - ngProjectAs="tools" - ) to - - . -
  • -
- -
-
diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.ts deleted file mode 100644 index aec793f841e2..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-paste-emoji-tool', - templateUrl: './editor-paste-emoji.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorPasteEmojiToolComponent { - readonly example1: TuiDocExample = { - HTML: import('./examples/1/index.html?raw'), - TypeScript: import('./examples/1/index.ts?raw'), - LESS: import('./examples/1/index.less?raw'), - 'smiles-tool/emoji.extension.ts': import( - './examples/1/smiles-tool/emoji.extension.ts?raw' - ), - 'smiles-tool/smiles-tool.component.ts': import( - './examples/1/smiles-tool/smiles-tool.component.ts?raw' - ), - 'smiles-tool/smiles-tool.template.html': import( - './examples/1/smiles-tool/smiles-tool.template.html?raw' - ), - 'smiles-tool/smiles-tool.styles.less': import( - './examples/1/smiles-tool/smiles-tool.styles.less?raw' - ), - 'smiles-tool/smiles-tool.module.ts': import( - './examples/1/smiles-tool/smiles-tool.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.module.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.module.ts deleted file mode 100644 index d9374b1f0ee8..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/editor-paste-emoji.module.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import { - TuiAddonDocModule, - tuiGenerateRoutes, - TuiTextCodeModule, -} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorPasteEmojiToolComponent} from './editor-paste-emoji.component'; -import {TuiEditorPasteEmojiToolExample1} from './examples/1'; -import {ExampleTuiSmilesToolModule} from './examples/1/smiles-tool/smiles-tool.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - ExampleTuiSmilesToolModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorPasteEmojiToolComponent)), - TuiTextCodeModule, - ], - declarations: [ - TuiEditorPasteEmojiToolExample1, - ExampleTuiEditorPasteEmojiToolComponent, - ], -}) -export class ExampleTuiEditorPasteEmojiToolModule {} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.html b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.html deleted file mode 100644 index 8211976e2e3f..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - Smiles are custom tool. Try it. - - - - - - - click it - - - diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.less b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.less deleted file mode 100644 index a40ab39bf74f..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.less +++ /dev/null @@ -1,6 +0,0 @@ -.hint { - color: var(--tui-base-05); - height: 100%; - display: flex; - align-items: center; -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.ts deleted file mode 100644 index 1b7adb9db5f6..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-paste-emoji-tool-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('./smiles-tool/emoji.extension').then( - ({EmojiExtension}) => EmojiExtension, - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorPasteEmojiToolExample1 { - readonly builtInTools = [TuiEditorTool.Undo]; - readonly control = new FormControl(''); -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/emoji.extension.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/emoji.extension.ts deleted file mode 100644 index 87b5380f7043..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/emoji.extension.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {Extension, GlobalAttributes} from '@tiptap/core'; - -export const EmojiExtension = Extension.create({ - name: `emoji`, - addGlobalAttributes(): GlobalAttributes { - return [ - { - types: [`paragraph`], - attributes: { - dataType: { - default: ``, - keepOnSplit: false, - renderHTML: ({dataType}) => - dataType === `emoji` - ? { - style: `display: inline`, - } - : null, - parseHTML: element => element.getAttribute(`data-type`), - }, - }, - }, - ]; - }, -}); diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.component.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.component.ts deleted file mode 100644 index b0d90f9f345a..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'smiles-tool', - templateUrl: './smiles-tool.template.html', - styleUrls: ['./smiles-tool.styles.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ExampleTuiSmilesToolComponent { - /* More smiles: https://www.w3schools.com/charsets/ref_emoji.asp */ - readonly smiles = [ - '🦁', - '⏰', - '☕', - '✅', - '❌', - '❗', - '➕', - '👀', - '👆', - '👌', - '😊', - '🚀', - ]; - - constructor( - @Inject(TuiTiptapEditorService) - private readonly editor: TuiTiptapEditorService, - ) {} - - insertSmile(smile: string): void { - this.editor - .getOriginTiptapEditor() - .chain() - .focus() - .insertContent(`

${smile}

`) - .insertContent(' ') - .run(); - } -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.module.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.module.ts deleted file mode 100644 index 432fe99a033d..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {ExampleTuiSmilesToolComponent} from './smiles-tool.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiActiveZoneModule, - TuiDropdownModule, - ], - declarations: [ExampleTuiSmilesToolComponent], - exports: [ExampleTuiSmilesToolComponent], -}) -export class ExampleTuiSmilesToolModule {} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.styles.less b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.styles.less deleted file mode 100644 index 419e0ac46888..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.styles.less +++ /dev/null @@ -1,31 +0,0 @@ -@import 'taiga-ui-local'; - -.tool-button { - .transition(background); - - &:hover { - background: var(--tui-secondary-hover); - } -} - -.smiles { - max-width: 18rem; - display: flex; - flex-wrap: wrap; - justify-content: space-around; - align-items: center; -} - -.smile { - .clearbtn(); - .transition(background); - flex: 1 0 21%; - cursor: pointer; - border-radius: var(--tui-radius-s); - font: var(--tui-font-heading-4); - padding: 1rem; - - &:hover { - background: var(--tui-secondary-hover); - } -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.template.html b/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.template.html deleted file mode 100644 index a482357f1b55..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-emoji/examples/1/smiles-tool/smiles-tool.template.html +++ /dev/null @@ -1,35 +0,0 @@ - - - -
- -
-
-
diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.html b/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.html deleted file mode 100644 index f92b7b3873fc..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.html +++ /dev/null @@ -1,58 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - You can create your own tool: -
    -
  • - Create component with tool button (which can get access to - - original TipTap editor API - - via - TuiTiptapEditorService - from - @taiga-ui/addon-editor - ). -
  • -
  • - Pass the component as content projection (with - ngProjectAs="tools" - ) to - - . -
  • -
- -
-
diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.ts deleted file mode 100644 index 8868cfbdfcb0..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-emoji-tool', - templateUrl: './editor-paste-image-tool.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorPasteImageToolComponent { - readonly example1: TuiDocExample = { - HTML: import('./examples/1/index.html?raw'), - TypeScript: import('./examples/1/index.ts?raw'), - LESS: import('./examples/1/index.less?raw'), - 'image-tool/paste.extension.ts': import( - './examples/1/image-tool/paste.extension.ts?raw' - ), - 'image-tool/image-tool.component.ts': import( - './examples/1/image-tool/image-tool.component.ts?raw' - ), - 'image-tool/image-tool.template.html': import( - './examples/1/image-tool/image-tool.template.html?raw' - ), - 'image-tool/image-tool.styles.less': import( - './examples/1/image-tool/image-tool.styles.less?raw' - ), - 'image-tool/image-tool.module.ts': import( - './examples/1/image-tool/image-tool.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.module.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.module.ts deleted file mode 100644 index c08846f9f70d..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/editor-paste-image-tool.module.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import { - TuiAddonDocModule, - tuiGenerateRoutes, - TuiTextCodeModule, -} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorPasteImageToolComponent} from './editor-paste-image-tool.component'; -import {TuiEditorPasteImageToolExample1} from './examples/1'; -import {ExampleTuiPasteImageToolModule} from './examples/1/image-tool/image-tool.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - ExampleTuiPasteImageToolModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorPasteImageToolComponent)), - TuiTextCodeModule, - ], - declarations: [ - TuiEditorPasteImageToolExample1, - ExampleTuiEditorPasteImageToolComponent, - ], -}) -export class ExampleTuiEditorPasteImageToolModule {} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.component.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.component.ts deleted file mode 100644 index 42f72050f1bc..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject, ViewChild} from '@angular/core'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor'; -import {TuiHostedDropdownComponent} from '@taiga-ui/core'; - -@Component({ - selector: 'image-tool', - templateUrl: './image-tool.template.html', - styleUrls: ['./image-tool.styles.less'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ExampleTuiPasteImageToolComponent { - @ViewChild('dropdown') - private readonly dropdown?: TuiHostedDropdownComponent; - - // eslint-disable-next-line @typescript-eslint/quotes - youtubeLogo = ``; - - placeholder = 'https://image.com/etc.png'; - - url = ''; - - constructor( - @Inject(TuiTiptapEditorService) - private readonly editor: TuiTiptapEditorService, - ) {} - - insertImage(src: string): void { - if (!src) { - return; - } - - this.editor.setImage(src); - this.dropdown?.close(); - } -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.module.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.module.ts deleted file mode 100644 index 2047125b6870..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; -import {TuiInputInlineModule} from '@taiga-ui/kit'; - -import {ExampleTuiPasteImageToolComponent} from './image-tool.component'; - -@NgModule({ - imports: [ - FormsModule, - CommonModule, - TuiButtonModule, - TuiInputInlineModule, - TuiHostedDropdownModule, - TuiActiveZoneModule, - TuiDropdownModule, - ], - declarations: [ExampleTuiPasteImageToolComponent], - exports: [ExampleTuiPasteImageToolComponent], -}) -export class ExampleTuiPasteImageToolModule {} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.styles.less b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.styles.less deleted file mode 100644 index beedc9ef6138..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.styles.less +++ /dev/null @@ -1,42 +0,0 @@ -@import 'taiga-ui-local'; - -.tool-button { - .transition(background); - - &:hover { - background: var(--tui-secondary-hover); - } -} - -.youtube-tool-content { - display: flex; - min-height: 4rem; - align-items: center; - padding-right: 0.75rem; -} - -.t-label { - height: var(--tui-height-l); - box-sizing: border-box; - padding: 0.4375rem 1rem; - min-width: 12.5rem; - max-width: 25rem; - width: 100%; -} - -.t-input { - flex: 1; - color: var(--tui-text-02); - - &_filled { - color: var(--tui-text-01); - } -} - -.t-url { - max-width: 12.5rem; - min-width: 12.5rem; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.template.html b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.template.html deleted file mode 100644 index cb27f8788e3e..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/image-tool.template.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -
- -
-
-
diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/paste.extension.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/paste.extension.ts deleted file mode 100644 index 4ce94dd9bc95..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/image-tool/paste.extension.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {NodeConfig} from '@tiptap/core'; -import {Plugin} from '@tiptap/pm/state'; -import {EditorView} from 'prosemirror-view'; - -export const IMAGE_CLIPBOARD_PASTE_EXTENSION: Partial> = { - addProseMirrorPlugins() { - return [ - new Plugin({ - props: { - handleDOMEvents: { - paste: (view: EditorView, event: ClipboardEvent) => { - const url = event.clipboardData?.getData(`text/plain`) ?? ``; - const isImage = - /^https?:\/\/.+\.(jpg|jpeg|png|webp|avif|gif|svg)$/.test( - url, - ); - - if (isImage) { - const node = view.state.schema.nodes.imageEditor.create({ - src: url, - }); - - const transaction = - view.state.tr.replaceSelectionWith(node); - - /** - * @note: - * workaround for `Applying a mismatched transaction` - */ - setTimeout(() => view.dispatch(transaction)); - - event.preventDefault(); - } - }, - }, - }, - }), - ]; - }, -}; diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.html b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.html deleted file mode 100644 index 0d2f0ff7a4cb..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - click it - - - diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.less b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.less deleted file mode 100644 index a40ab39bf74f..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.less +++ /dev/null @@ -1,6 +0,0 @@ -.hint { - color: var(--tui-base-05); - height: 100%; - display: flex; - align-items: center; -} diff --git a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.ts b/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.ts deleted file mode 100644 index 381c3cf85e1a..000000000000 --- a/projects/demo/src/modules/components/editor/custom-tool/paste-image/examples/1/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component, Injector} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -import {IMAGE_CLIPBOARD_PASTE_EXTENSION} from './image-tool/paste.extension'; - -@Component({ - selector: 'tui-editor-paste-image-tool-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/image-editor').then( - ({tuiCreateImageEditorExtension}) => - tuiCreateImageEditorExtension({injector}).extend( - IMAGE_CLIPBOARD_PASTE_EXTENSION, - ), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorPasteImageToolExample1 { - readonly builtInTools = [TuiEditorTool.Undo]; - readonly control = new FormControl(''); -} diff --git a/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.html b/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.html deleted file mode 100644 index 115239430c28..000000000000 --- a/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.ts b/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.ts deleted file mode 100644 index f5e64ee09d5b..000000000000 --- a/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-embed-html5', - templateUrl: './editor-embed-html5.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorEmbedHtml5Component { - readonly example1: TuiDocExample = { - HTML: import('./examples/1/index.html?raw'), - TypeScript: import('./examples/1/index.ts?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.module.ts b/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.module.ts deleted file mode 100644 index b9ca8db35ba7..000000000000 --- a/projects/demo/src/modules/components/editor/embed/html5/editor-embed-html5.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorEmbedHtml5Component} from './editor-embed-html5.component'; -import {TuiEditorEmbedHtml5Example1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorEmbedHtml5Component)), - ], - declarations: [ExampleTuiEditorEmbedHtml5Component, TuiEditorEmbedHtml5Example1], -}) -export class ExampleTuiEditorEmbedHtml5Module {} diff --git a/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.html b/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.html deleted file mode 100644 index 1033ed4d698b..000000000000 --- a/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - -

HTML:

-
- -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.less b/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.less deleted file mode 100644 index 068c759ceab3..000000000000 --- a/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.less +++ /dev/null @@ -1,11 +0,0 @@ -:host { - &._cypress ::ng-deep { - //noinspection CssInvalidPseudoSelector - video::-webkit-media-controls-current-time-display, - video::-webkit-media-controls-time-remaining-display, - audio::-webkit-media-controls-current-time-display, - audio::-webkit-media-controls-time-remaining-display { - display: none; - } - } -} diff --git a/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.ts b/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.ts deleted file mode 100644 index 3c27cccccd77..000000000000 --- a/projects/demo/src/modules/components/editor/embed/html5/examples/1/index.ts +++ /dev/null @@ -1,147 +0,0 @@ -import {Component, Inject, Injector, ViewChild} from '@angular/core'; -import {FormControl, Validators} from '@angular/forms'; -import {DomSanitizer, SafeHtml} from '@angular/platform-browser'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_ATTACH_FILES_LOADER, - TUI_ATTACH_FILES_OPTIONS, - TUI_EDITOR_EXTENSIONS, - TuiEditorAttachedFile, - TuiEditorComponent, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; -import {TUI_IS_CYPRESS, tuiPure, tuiTypedFromEvent} from '@taiga-ui/cdk'; -import {Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -@Component({ - selector: 'tui-editor-embed-html5-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (_injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-style').then(({TextStyle}) => TextStyle), - import('@taiga-ui/addon-editor/extensions/link').then( - ({TuiLink}) => TuiLink, - ), - import('@taiga-ui/addon-editor/extensions/jump-anchor').then( - ({TuiJumpAnchor}) => TuiJumpAnchor, - ), - import('@taiga-ui/addon-editor/extensions/file-link').then( - ({TuiFileLink}) => TuiFileLink, - ), - import('@taiga-ui/addon-editor/extensions/media').then( - ({TuiVideo}) => TuiVideo, - ), - import('@taiga-ui/addon-editor/extensions/media').then( - ({TuiAudio}) => TuiAudio, - ), - import('@taiga-ui/addon-editor/extensions/media').then( - ({TuiSource}) => TuiSource, - ), - ], - }, - { - provide: TUI_ATTACH_FILES_LOADER, - deps: [], - useFactory: - () => - ([file]: File[]): Observable< - Array> - > => { - const fileReader = new FileReader(); - - // For example, instead of uploading to a file server, - // we convert the result immediately into content to base64 - fileReader.readAsDataURL(file); - - return tuiTypedFromEvent(fileReader, 'load').pipe( - map(() => [ - { - name: file.name, - - /* base64 or link to the file on your server */ - link: String(fileReader.result), - - attrs: { - type: file.type, - }, - }, - ]), - ); - }, - }, - { - provide: TUI_ATTACH_FILES_OPTIONS, - useValue: { - accept: 'video/mp4,video/x-m4v,video/*,audio/x-m4a,audio/*', - multiple: false, - }, - }, - ], - host: { - class: 'html5-editor-example', - '[class._cypress]': 'isCypress', - }, - encapsulation, - changeDetection, -}) -export class TuiEditorEmbedHtml5Example1 { - @ViewChild(TuiEditorComponent) - private readonly wysiwyg?: TuiEditorComponent; - - readonly builtInTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Link, - TuiEditorTool.Attach, - ]; - - readonly control = new FormControl( - ` -

Here is video:

- - - -

Here is audio:

- - -

- `, - Validators.required, - ); - - constructor( - @Inject(TUI_IS_CYPRESS) readonly isCypress: boolean, - @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer, - ) {} - - @tuiPure - safe(content: string): SafeHtml { - return this.sanitizer.bypassSecurityTrustHtml(content); - } - - attach([file]: Array>): void { - const tag = `${file.attrs?.type ?? ''}`.split('/')[0]; - - this.wysiwyg?.editor - ?.getOriginTiptapEditor() - .commands.insertContent( - `<${tag} controls width="100%">

Download ${file.name}

`, - ); - } -} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.html b/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.html deleted file mode 100644 index 1a5233381a60..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.ts b/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.ts deleted file mode 100644 index 07d6663534bf..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-embed-iframe', - templateUrl: './editor-embed-iframe.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorEmbedIframeComponent { - readonly example1: TuiDocExample = { - HTML: import('./examples/1/index.html?raw'), - TypeScript: import('./examples/1/index.ts?raw'), - LESS: import('./examples/1/index.less?raw'), - 'embed-tool/embed-tool.component.ts': import( - './examples/1/embed-tool/embed-tool.component.ts?raw' - ), - 'embed-tool/embed-tool.template.html': import( - './examples/1/embed-tool/embed-tool.template.html?raw' - ), - 'embed-tool/embed-tool.styles.less': import( - './examples/1/embed-tool/embed-tool.styles.less?raw' - ), - 'embed-tool/embed-tool.module.ts': import( - './examples/1/embed-tool/embed-tool.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.module.ts b/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.module.ts deleted file mode 100644 index 38a544f8a204..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/editor-embed-iframe.module.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorEmbedIframeComponent} from './editor-embed-iframe.component'; -import {TuiEditorEmbedIframeExample1} from './examples/1'; -import {ExampleTuiEmbedToolModule} from './examples/1/embed-tool/embed-tool.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - ExampleTuiEmbedToolModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorEmbedIframeComponent)), - ], - declarations: [ExampleTuiEditorEmbedIframeComponent, TuiEditorEmbedIframeExample1], -}) -export class ExampleTuiEditorEmbedIframeModule {} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.component.ts b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.component.ts deleted file mode 100644 index 77651b5a8953..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {Component, Inject, ViewChild} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor'; -import {TuiHostedDropdownComponent} from '@taiga-ui/core'; - -@Component({ - selector: 'embed-tool', - templateUrl: './embed-tool.template.html', - styleUrls: ['./embed-tool.styles.less'], - changeDetection, - encapsulation, -}) -export class ExampleTuiEmbedToolComponent { - @ViewChild('dropdown') - private readonly dropdown?: TuiHostedDropdownComponent; - - placeholder = 'https://my-embed.site.com/etc1235'; - url = ''; - - constructor( - @Inject(TuiTiptapEditorService) - private readonly editor: TuiTiptapEditorService, - ) {} - - embedSource(src: string): void { - if (src) { - this.editor.setIframe({src}); - - this.url = ''; - this.dropdown?.close(); - } - } -} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.module.ts b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.module.ts deleted file mode 100644 index 3a146ec90f1e..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; -import {TuiInputInlineModule} from '@taiga-ui/kit'; - -import {ExampleTuiEmbedToolComponent} from './embed-tool.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiActiveZoneModule, - TuiDropdownModule, - TuiInputInlineModule, - FormsModule, - ], - declarations: [ExampleTuiEmbedToolComponent], - exports: [ExampleTuiEmbedToolComponent], -}) -export class ExampleTuiEmbedToolModule {} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.styles.less b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.styles.less deleted file mode 100644 index c69f5b33c153..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.styles.less +++ /dev/null @@ -1,34 +0,0 @@ -@import 'taiga-ui-local'; - -.tool-button { - .transition(background); - - &:hover { - background: var(--tui-secondary-hover); - } -} - -.embed-tool-content { - display: flex; - min-height: 4rem; - align-items: center; - padding-right: 0.75rem; -} - -.t-label { - height: var(--tui-height-l); - box-sizing: border-box; - padding: 0.4375rem 1rem; - min-width: 12.5rem; - max-width: 25rem; - width: 100%; -} - -.t-input { - flex: 1; - color: var(--tui-text-02); - - &_filled { - color: var(--tui-text-01); - } -} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.template.html b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.template.html deleted file mode 100644 index 07c40826bc2f..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/embed-tool/embed-tool.template.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -
- -
-
-
diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.html b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.html deleted file mode 100644 index 48b22d239aeb..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - click it - - - - -

HTML:

-
- -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.less b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.less deleted file mode 100644 index a40ab39bf74f..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.less +++ /dev/null @@ -1,6 +0,0 @@ -.hint { - color: var(--tui-base-05); - height: 100%; - display: flex; - align-items: center; -} diff --git a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.ts b/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.ts deleted file mode 100644 index e2066e9cc094..000000000000 --- a/projects/demo/src/modules/components/editor/embed/iframe/examples/1/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -import {Component, Inject, Injector} from '@angular/core'; -import {FormControl, Validators} from '@angular/forms'; -import {DomSanitizer, SafeHtml} from '@angular/platform-browser'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {TUI_IS_CYPRESS, tuiPure} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-embed-iframe-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/iframe-editor').then( - ({createIframeEditorExtension}) => - createIframeEditorExtension(injector), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorEmbedIframeExample1 { - readonly builtInTools = [TuiEditorTool.Undo]; - - readonly control = new FormControl( - ` -

Here is an online IDE:

- - -

Here is a media player:

- -

- `, - Validators.required, - ); - - constructor( - @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer, - @Inject(TUI_IS_CYPRESS) private readonly isCypress: boolean, - ) {} - - @tuiPure - safe(content: string): SafeHtml { - return this.sanitizer.bypassSecurityTrustHtml(content); - } -} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.html b/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.html deleted file mode 100644 index 9733c896e5e8..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.ts b/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.ts deleted file mode 100644 index 3bf2ec17620b..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-embed-youtube', - templateUrl: './editor-embed-youtube.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorEmbedComponent { - readonly example1: TuiDocExample = { - HTML: import('./examples/1/index.html?raw'), - TypeScript: import('./examples/1/index.ts?raw'), - LESS: import('./examples/1/index.less?raw'), - 'youtube-tool/youtube-tool.component.ts': import( - './examples/1/youtube-tool/youtube-tool.component.ts?raw' - ), - 'youtube-tool/youtube-tool.template.html': import( - './examples/1/youtube-tool/youtube-tool.template.html?raw' - ), - 'youtube-tool/youtube-tool.styles.less': import( - './examples/1/youtube-tool/youtube-tool.styles.less?raw' - ), - 'youtube-tool/youtube-tool.module.ts': import( - './examples/1/youtube-tool/youtube-tool.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.module.ts b/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.module.ts deleted file mode 100644 index f6bc2ab2a887..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/editor-embed-youtube.module.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorEmbedComponent} from './editor-embed-youtube.component'; -import {TuiEditorEmbedYoutubeExample1} from './examples/1'; -import {ExampleTuiYoutubeToolModule} from './examples/1/youtube-tool/youtube-tool.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - ExampleTuiYoutubeToolModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorEmbedComponent)), - ], - declarations: [ExampleTuiEditorEmbedComponent, TuiEditorEmbedYoutubeExample1], -}) -export class ExampleTuiEditorEmbedYoutubeModule {} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.html b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.html deleted file mode 100644 index fa50a6b17d27..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - click it - - - - -

HTML:

-
- -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.less b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.less deleted file mode 100644 index a40ab39bf74f..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.less +++ /dev/null @@ -1,6 +0,0 @@ -.hint { - color: var(--tui-base-05); - height: 100%; - display: flex; - align-items: center; -} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.ts b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.ts deleted file mode 100644 index 58323700f63c..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {Component, Inject} from '@angular/core'; -import {FormControl, Validators} from '@angular/forms'; -import {DomSanitizer, SafeHtml} from '@angular/platform-browser'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {tuiPure} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-embed-youtube-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/youtube').then( - ({Youtube}) => Youtube, - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorEmbedYoutubeExample1 { - readonly builtInTools = [TuiEditorTool.Undo]; - readonly control = new FormControl( - ` -

Editor now supports YouTube embeds!

-
- -
-

Try adding your own video to this editor!

- `, - Validators.required, - ); - - constructor(@Inject(DomSanitizer) private readonly sanitizer: DomSanitizer) {} - - /** - * TUI_SANITIZER doesn't support iframe inside content - */ - @tuiPure - safe(content: string): SafeHtml { - return this.sanitizer.bypassSecurityTrustHtml(content); - } -} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.component.ts b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.component.ts deleted file mode 100644 index e3b254c6d73a..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.component.ts +++ /dev/null @@ -1,48 +0,0 @@ -import {Component, Inject, ViewChild} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor'; -import {TuiHostedDropdownComponent} from '@taiga-ui/core'; - -@Component({ - selector: 'youtube-tool', - templateUrl: './youtube-tool.template.html', - styleUrls: ['./youtube-tool.styles.less'], - changeDetection, - encapsulation, -}) -export class ExampleTuiYoutubeToolComponent { - @ViewChild('dropdown') - private readonly dropdown?: TuiHostedDropdownComponent; - - youtubeLogo = - ''; - - placeholder = 'https://www.youtube.com/embed/j2_NnV7nU6s'; - url = ''; - - constructor( - @Inject(TuiTiptapEditorService) - private readonly editor: TuiTiptapEditorService, - ) {} - - insertYoutubeVideo(src: string): void { - if (src) { - const prevLine = this.editor.state.selection.anchor; - - // @note: don't use `setHardBreak`, - // it inherits styles of previous lines - // required two line after - // this.editor.enter(); - this.editor.enter(); - this.editor.setTextSelection(prevLine); - this.editor.setYoutubeVideo({src, width: '100%'}); - - this.url = ''; - this.dropdown?.close(); - } - } -} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.module.ts b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.module.ts deleted file mode 100644 index be5380255459..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiDropdownModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; -import {TuiInputInlineModule} from '@taiga-ui/kit'; - -import {ExampleTuiYoutubeToolComponent} from './youtube-tool.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiActiveZoneModule, - TuiDropdownModule, - TuiInputInlineModule, - FormsModule, - ], - declarations: [ExampleTuiYoutubeToolComponent], - exports: [ExampleTuiYoutubeToolComponent], -}) -export class ExampleTuiYoutubeToolModule {} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.styles.less b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.styles.less deleted file mode 100644 index 37f88e93f2e4..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.styles.less +++ /dev/null @@ -1,34 +0,0 @@ -@import 'taiga-ui-local'; - -.tool-button { - .transition(background); - - &:hover { - background: var(--tui-secondary-hover); - } -} - -.youtube-tool-content { - display: flex; - min-height: 4rem; - align-items: center; - padding-right: 0.75rem; -} - -.t-label { - height: var(--tui-height-l); - box-sizing: border-box; - padding: 0.4375rem 1rem; - min-width: 12.5rem; - max-width: 25rem; - width: 100%; -} - -.t-input { - flex: 1; - color: var(--tui-text-02); - - &_filled { - color: var(--tui-text-01); - } -} diff --git a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.template.html b/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.template.html deleted file mode 100644 index d85fd992ff3e..000000000000 --- a/projects/demo/src/modules/components/editor/embed/youtube/examples/1/youtube-tool/youtube-tool.template.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -
- -
-
-
diff --git a/projects/demo/src/modules/components/editor/focus/editor-focus.component.html b/projects/demo/src/modules/components/editor/focus/editor-focus.component.html deleted file mode 100644 index 3fb44fd655ca..000000000000 --- a/projects/demo/src/modules/components/editor/focus/editor-focus.component.html +++ /dev/null @@ -1,33 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/focus/editor-focus.component.ts b/projects/demo/src/modules/components/editor/focus/editor-focus.component.ts deleted file mode 100644 index 39c038301911..000000000000 --- a/projects/demo/src/modules/components/editor/focus/editor-focus.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-focus', - templateUrl: './editor-focus.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorFocusComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/focus/editor-focus.module.ts b/projects/demo/src/modules/components/editor/focus/editor-focus.module.ts deleted file mode 100644 index db45e9a2834f..000000000000 --- a/projects/demo/src/modules/components/editor/focus/editor-focus.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorFocusComponent} from './editor-focus.component'; -import {TuiEditorFocusExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorFocusComponent)), - ], - declarations: [TuiEditorFocusExample1, ExampleTuiEditorFocusComponent], -}) -export class ExampleTuiEditorFocusModule {} diff --git a/projects/demo/src/modules/components/editor/focus/examples/1/index.html b/projects/demo/src/modules/components/editor/focus/examples/1/index.html deleted file mode 100644 index a3a09b9f75fd..000000000000 --- a/projects/demo/src/modules/components/editor/focus/examples/1/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/focus/examples/1/index.less b/projects/demo/src/modules/components/editor/focus/examples/1/index.less deleted file mode 100644 index 003b21015bae..000000000000 --- a/projects/demo/src/modules/components/editor/focus/examples/1/index.less +++ /dev/null @@ -1,7 +0,0 @@ -::ng-deep { - .has-focus:not(tui-image-editor), - tui-image-editor.has-focus img { - border-radius: 3px; - box-shadow: 0 0 0 3px #68cef8; - } -} diff --git a/projects/demo/src/modules/components/editor/focus/examples/1/index.ts b/projects/demo/src/modules/components/editor/focus/examples/1/index.ts deleted file mode 100644 index f9b59d3008e0..000000000000 --- a/projects/demo/src/modules/components/editor/focus/examples/1/index.ts +++ /dev/null @@ -1,114 +0,0 @@ -import {Component, Injector} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-focus-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit') - .then(({StarterKit}) => StarterKit) - .then(extension => extension.configure({heading: {levels: [1, 2]}})), - import('@tiptap/extension-text-align').then(({default: TextAlign}) => - TextAlign.configure({types: ['heading', 'paragraph']}), - ), - import('@tiptap/extension-text-style').then( - ({default: TextStyle}) => TextStyle, - ), - import('@tiptap/extension-underline').then( - ({default: Underline}) => Underline, - ), - import('@tiptap/extension-subscript').then( - ({default: Subscript}) => Subscript, - ), - import('@tiptap/extension-superscript').then( - ({default: Superscript}) => Superscript, - ), - import('@taiga-ui/addon-editor/extensions/font-color').then( - ({FontColor}) => FontColor, - ), - import('@taiga-ui/addon-editor/extensions/link').then( - ({TuiLink}) => TuiLink, - ), - import('@taiga-ui/addon-editor/extensions/jump-anchor').then( - ({TuiJumpAnchor}) => TuiJumpAnchor, - ), - import('@taiga-ui/addon-editor/extensions/file-link').then( - ({TuiFileLink}) => TuiFileLink, - ), - import('@taiga-ui/addon-editor/extensions/background-color').then( - ({BackgroundColor}) => BackgroundColor, - ), - import('@taiga-ui/addon-editor/extensions/table').then(({TuiTable}) => - TuiTable.configure({resizable: true}), - ), - import('@tiptap/extension-table-row').then( - ({default: TableRow}) => TableRow, - ), - import('@tiptap/extension-table-cell').then( - ({default: TableCell}) => TableCell, - ), - import('@tiptap/extension-table-header').then( - ({TableHeader}) => TableHeader, - ), - import('@taiga-ui/addon-editor/extensions/indent-outdent').then( - ({TuiTabExtension}) => TuiTabExtension, - ), - import('@taiga-ui/addon-editor/extensions/table-cell-background').then( - ({TableCellBackground}) => TableCellBackground, - ), - import('@taiga-ui/addon-editor/extensions/details').then( - ({TuiDetailsContent}) => TuiDetailsContent, - ), - import('@taiga-ui/addon-editor/extensions/details').then( - ({TuiDetails}) => TuiDetails, - ), - import('@taiga-ui/addon-editor/extensions/details').then( - ({TuiSummary}) => TuiSummary, - ), - import('@taiga-ui/addon-editor/extensions/font-size').then( - ({TuiFontSize}) => TuiFontSize, - ), - import('@taiga-ui/addon-editor/extensions/image-editor').then( - ({createImageEditorExtension}) => - createImageEditorExtension(injector), - ), - import('@tiptap/extension-focus').then(({FocusClasses}) => - FocusClasses.configure({ - className: 'has-focus', - - /** - * @description: - * Apply the class to 'all', the 'shallowest' or the 'deepest' node. - * - * Default: 'all' - */ - mode: 'shallowest', - }), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorFocusExample1 { - readonly builtInTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Img, - TuiEditorTool.Link, - TuiEditorTool.Anchor, - ]; - - control = new FormControl( - // eslint-disable-next-line @typescript-eslint/quotes - `

WYSIWYG (What you see is what you get) — Rich Text Editor for using with Angular forms.

Heading

Lorem ipsum dolor sit amet consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim

ad minim veniam, quis nostrud exercitation ullamco, laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

class EditorExample {}

Free

Pro

24/7 support

+

+

Code in text

`, - ); -} diff --git a/projects/demo/src/modules/components/editor/font/editor-font.component.html b/projects/demo/src/modules/components/editor/font/editor-font.component.html deleted file mode 100644 index 7676cb2edc8e..000000000000 --- a/projects/demo/src/modules/components/editor/font/editor-font.component.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/projects/demo/src/modules/components/editor/font/editor-font.component.ts b/projects/demo/src/modules/components/editor/font/editor-font.component.ts deleted file mode 100644 index 4fda44ab1af1..000000000000 --- a/projects/demo/src/modules/components/editor/font/editor-font.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'editor-font', - templateUrl: './editor-font.component.html', - encapsulation, - changeDetection, -}) -export class ExampleTuiEditorFontComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - LESS: import('./examples/1/index.less?raw'), - }; - - readonly example2: TuiDocExample = { - TypeScript: import('./examples/2/index.ts?raw'), - HTML: import('./examples/2/index.html?raw'), - }; - - readonly example3: TuiDocExample = { - TypeScript: import('./examples/3/index.ts?raw'), - HTML: import('./examples/3/index.html?raw'), - 'font-size-tool/font-size-tool.component.ts': import( - './examples/3/font-size-tool/font-size-tool.component.ts?raw' - ), - 'font-size-tool/font-size-tool.template.html': import( - './examples/3/font-size-tool/font-size-tool.template.html?raw' - ), - 'font-size-tool/font-size-tool.module.ts': import( - './examples/3/font-size-tool/font-size-tool.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/font/editor-font.module.ts b/projects/demo/src/modules/components/editor/font/editor-font.module.ts deleted file mode 100644 index f15e30fff4b6..000000000000 --- a/projects/demo/src/modules/components/editor/font/editor-font.module.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; - -import {ExampleTuiEditorFontComponent} from './editor-font.component'; -import {TuiEditorFontExample1} from './examples/1'; -import {TuiEditorFontExample2} from './examples/2'; -import {TuiEditorFontExample3} from './examples/3'; -import {ExampleTuiFontSizeToolModule} from './examples/3/font-size-tool/font-size-tool.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiAddonDocModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorFontComponent)), - ExampleTuiFontSizeToolModule, - ], - declarations: [ - TuiEditorFontExample1, - TuiEditorFontExample2, - TuiEditorFontExample3, - ExampleTuiEditorFontComponent, - ], -}) -export class ExampleTuiEditorFontModule {} diff --git a/projects/demo/src/modules/components/editor/font/examples/1/index.html b/projects/demo/src/modules/components/editor/font/examples/1/index.html deleted file mode 100644 index 587ae3cc8e09..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/1/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/font/examples/1/index.less b/projects/demo/src/modules/components/editor/font/examples/1/index.less deleted file mode 100644 index a71af8dc381b..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/1/index.less +++ /dev/null @@ -1,38 +0,0 @@ -.text-h1, -.text-h2, -.text-h3, -.text-h4, -.text-h5, -.text-h6 { - margin: 5px 0; -} - -.text-h1, -.text-h1[tuiOption] { - color: red; -} - -.text-h2, -.text-h2[tuiOption] { - color: blue; -} - -.text-h3, -.text-h3[tuiOption] { - color: green; -} - -.text-h4, -.text-h4[tuiOption] { - color: grey; -} - -.text-h5, -.text-h5[tuiOption] { - color: pink; -} - -.text-h6, -.text-h6[tuiOption] { - color: blueviolet; -} diff --git a/projects/demo/src/modules/components/editor/font/examples/1/index.ts b/projects/demo/src/modules/components/editor/font/examples/1/index.ts deleted file mode 100644 index 4d5a2908aec2..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/1/index.ts +++ /dev/null @@ -1,115 +0,0 @@ -import {Component, ViewEncapsulation} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import { - TUI_EDITOR_EXTENSIONS, - tuiEditorOptionsProvider, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; -import {mergeAttributes} from '@tiptap/core'; - -@Component({ - selector: 'tui-editor-font-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - tuiEditorOptionsProvider({ - fontOptions: () => [ - { - name: 'H1', - headingLevel: 1, - ngClass: 'text-h1', - }, - { - name: 'H2', - headingLevel: 2, - ngClass: 'text-h2', - }, - { - name: 'H3', - headingLevel: 3, - ngClass: 'text-h3', - }, - { - name: 'H4', - headingLevel: 4, - ngClass: 'text-h4', - }, - { - name: 'H5', - headingLevel: 5, - ngClass: 'text-h5', - }, - { - name: 'H6', - headingLevel: 6, - ngClass: 'text-h6', - }, - ], - }), - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-style').then( - ({default: TextStyle}) => TextStyle, - ), - import('@tiptap/extension-heading').then(({default: Heading}) => - Heading.configure({levels: [1, 2, 3, 4, 5, 6]}) - // @note: if you want to add custom css classes - // then you need customize Heading extension - .extend({ - renderHTML({node, HTMLAttributes}) { - type Levels = 1 | 2 | 3 | 4 | 5 | 6; - - const classes: Record = { - 1: 'text-h1', - 2: 'text-h2', - 3: 'text-h3', - 4: 'text-h4', - 5: 'text-h5', - 6: 'text-h6', - }; - - const hasLevel = this.options.levels.includes( - node.attrs.level, - ); - const level: Levels = hasLevel - ? node.attrs.level - : this.options.levels[0]; - - return [ - `h${level}`, - mergeAttributes( - this.options.HTMLAttributes, - HTMLAttributes, - { - class: `${classes[level]}`, - }, - ), - 0, - ]; - }, - }), - ), - ], - }, - ], - encapsulation: ViewEncapsulation.None, - changeDetection, -}) -export class TuiEditorFontExample1 { - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Size]; - - control = new FormControl(` -

This is a 1st level heading

-

This is a 2nd level heading

-

This is a 3rd level heading

-

This is a 4th level heading

-
This is a 5th level heading
-
This is a 6th level heading
-

This is a paragraph

- `); -} diff --git a/projects/demo/src/modules/components/editor/font/examples/2/index.html b/projects/demo/src/modules/components/editor/font/examples/2/index.html deleted file mode 100644 index 587ae3cc8e09..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/2/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/font/examples/2/index.ts b/projects/demo/src/modules/components/editor/font/examples/2/index.ts deleted file mode 100644 index 52ab165ca1ca..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/2/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_EDITOR_EXTENSIONS, - tuiEditorOptionsProvider, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-font-example-2', - templateUrl: './index.html', - providers: [ - tuiEditorOptionsProvider({ - fontOptions: () => - [8, 9, 10, 11, 12, 14, 18, 24, 30, 36, 48, 60, 72, 96].map(size => ({ - px: size, - name: `${size}`, - ngStyle: {'font-size': '1rem'}, - })), - }), - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-style').then( - ({default: TextStyle}) => TextStyle, - ), - import('@taiga-ui/addon-editor/extensions/font-size').then( - ({TuiFontSize}) => TuiFontSize, - ), - ], - }, - ], - encapsulation, - changeDetection, -}) -export class TuiEditorFontExample2 { - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Size]; - - control = new FormControl(` -

96

-

72

-

48

-

36

-

30

-

24

-

18

-

14

-

12

-

11

-

10

-

9

-

8

- `); -} diff --git a/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.component.ts b/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.component.ts deleted file mode 100644 index 8feee1044fd0..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.component.ts +++ /dev/null @@ -1,70 +0,0 @@ -import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {WINDOW} from '@ng-web-apis/common'; -import {TuiTiptapEditorService} from '@taiga-ui/addon-editor'; -import {tuiPure} from '@taiga-ui/cdk'; -import {distinctUntilChanged, map} from 'rxjs/operators'; - -@Component({ - selector: 'font-size-tool', - templateUrl: './font-size-tool.template.html', - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ExampleTuiFontSizeToolComponent { - readonly sizes = [8, 9, 10, 11, 12, 14, 16, 18, 24, 30]; - - readonly size$ = this.editor.stateChange$.pipe( - map(() => this.fontSize), - distinctUntilChanged(), - ); - - constructor( - @Inject(TuiTiptapEditorService) private readonly editor: TuiTiptapEditorService, - @Inject(WINDOW) private readonly win: Window, - ) {} - - setFontSize(size: number): void { - this.editor.setFontSize(size); - } - - get fontSize(): number { - return ( - this.editor.getFontSize() || - this.getDefaultFontSize(this.editor.getOriginTiptapEditor()?.view?.dom) || - 16 - ); - } - - increase(): void { - const newIndex = this.currentIndex + 1; - - if (newIndex <= this.sizes.length - 1) { - const newSize = this.sizes[newIndex]; - - this.setFontSize(newSize); - } - } - - decrease(): void { - const newIndex = this.currentIndex - 1; - - if (newIndex > 0) { - const newSize = this.sizes[newIndex]; - - this.setFontSize(newSize); - } - } - - private get currentIndex(): number { - return this.sizes.indexOf(this.fontSize); - } - - @tuiPure - private getDefaultFontSize(element: Element): number { - return Number( - this.win - .getComputedStyle(element) - .getPropertyValue('font-size') - .match(/\d+/)?.[0], - ); - } -} diff --git a/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.module.ts b/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.module.ts deleted file mode 100644 index 7f6a5732a1bc..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import { - TuiButtonModule, - TuiDataListModule, - TuiDropdownModule, - TuiHostedDropdownModule, -} from '@taiga-ui/core'; - -import {ExampleTuiFontSizeToolComponent} from './font-size-tool.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiHostedDropdownModule, - TuiDropdownModule, - TuiDataListModule, - ], - declarations: [ExampleTuiFontSizeToolComponent], - exports: [ExampleTuiFontSizeToolComponent], -}) -export class ExampleTuiFontSizeToolModule {} diff --git a/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.template.html b/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.template.html deleted file mode 100644 index a2da8950fb6a..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/3/font-size-tool/font-size-tool.template.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - diff --git a/projects/demo/src/modules/components/editor/font/examples/3/index.html b/projects/demo/src/modules/components/editor/font/examples/3/index.html deleted file mode 100644 index 69c16a655b0d..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/3/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/font/examples/3/index.ts b/projects/demo/src/modules/components/editor/font/examples/3/index.ts deleted file mode 100644 index 5ddc5a51f989..000000000000 --- a/projects/demo/src/modules/components/editor/font/examples/3/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-font-example-3', - templateUrl: './index.html', - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-style').then( - ({default: TextStyle}) => TextStyle, - ), - import('@taiga-ui/addon-editor/extensions/font-size').then( - ({TuiFontSize}) => TuiFontSize, - ), - ], - }, - ], - encapsulation, - changeDetection, -}) -export class TuiEditorFontExample3 { - readonly builtInTools = [TuiEditorTool.Undo]; - - control = new FormControl(` -

Hello

-

Hello world

- `); -} diff --git a/projects/demo/src/modules/components/editor/groups/editor-groups.component.html b/projects/demo/src/modules/components/editor/groups/editor-groups.component.html deleted file mode 100644 index c21838d66bd0..000000000000 --- a/projects/demo/src/modules/components/editor/groups/editor-groups.component.html +++ /dev/null @@ -1,48 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - - - - - - - - - -
diff --git a/projects/demo/src/modules/components/editor/groups/editor-groups.component.ts b/projects/demo/src/modules/components/editor/groups/editor-groups.component.ts deleted file mode 100644 index 712d849c0323..000000000000 --- a/projects/demo/src/modules/components/editor/groups/editor-groups.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-groups', - templateUrl: './editor-groups.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorDraggableGroupsComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - }; - - readonly example2: TuiDocExample = { - TypeScript: import('./examples/2/index.ts?raw'), - HTML: import('./examples/2/index.html?raw'), - LESS: import('./examples/2/index.less?raw'), - }; - - readonly example3: TuiDocExample = { - TypeScript: import('./examples/3/index.ts?raw'), - HTML: import('./examples/3/index.html?raw'), - LESS: import('./examples/3/index.less?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/groups/editor-groups.module.ts b/projects/demo/src/modules/components/editor/groups/editor-groups.module.ts deleted file mode 100644 index 9e8ff8b4f99e..000000000000 --- a/projects/demo/src/modules/components/editor/groups/editor-groups.module.ts +++ /dev/null @@ -1,44 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorDraggableGroupsComponent} from './editor-groups.component'; -import {TuiEditorGroupExample1} from './examples/1'; -import {TuiEditorGroupExample2} from './examples/2'; -import {TuiEditorGroupExample3} from './examples/3'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild( - tuiGenerateRoutes(ExampleTuiEditorDraggableGroupsComponent), - ), - ], - declarations: [ - TuiEditorGroupExample1, - TuiEditorGroupExample2, - TuiEditorGroupExample3, - ExampleTuiEditorDraggableGroupsComponent, - ], -}) -export class ExampleTuiEditorGroupsModule {} diff --git a/projects/demo/src/modules/components/editor/groups/examples/1/index.html b/projects/demo/src/modules/components/editor/groups/examples/1/index.html deleted file mode 100644 index 88701c7a0652..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/1/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/groups/examples/1/index.ts b/projects/demo/src/modules/components/editor/groups/examples/1/index.ts deleted file mode 100644 index ee66555280c2..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/1/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {TuiDestroyService} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-groups-example-1', - templateUrl: './index.html', - providers: [ - TuiDestroyService, - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-placeholder').then(({Placeholder}) => - Placeholder.configure({ - emptyNodeClass: 't-editor-placeholder', - // eslint-disable-next-line @typescript-eslint/quotes - placeholder: "Type '/' for command", // Notion like - includeChildren: true, - }), - ), - import('@taiga-ui/addon-editor/extensions/group').then( - ({createGroupExtension}) => - createGroupExtension({nested: false, createOnEnter: true}), - ), - ], - }, - ], - encapsulation, - changeDetection, -}) -export class TuiEditorGroupExample1 { - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Group]; - - control = new FormControl(''); - - constructor() { - this.control.patchValue( - '

This is a boring paragraph.

And another draggable paragraph.

Let’s finish with a boring paragraph.

', - ); - } -} diff --git a/projects/demo/src/modules/components/editor/groups/examples/2/index.html b/projects/demo/src/modules/components/editor/groups/examples/2/index.html deleted file mode 100644 index 9e2d283e5997..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/2/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/groups/examples/2/index.less b/projects/demo/src/modules/components/editor/groups/examples/2/index.less deleted file mode 100644 index 075bf4a249e1..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/2/index.less +++ /dev/null @@ -1,8 +0,0 @@ -:host { - ::ng-deep tui-editor-socket [data-type='group'] { - flex-direction: column; - padding: 0.5rem; - margin: 0.5rem 0; - border: 1px solid var(--tui-base-04); - } -} diff --git a/projects/demo/src/modules/components/editor/groups/examples/2/index.ts b/projects/demo/src/modules/components/editor/groups/examples/2/index.ts deleted file mode 100644 index 4fa8b4b16e03..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/2/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {TuiDestroyService} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-groups-example-2', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - TuiDestroyService, - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/group').then( - ({createGroupExtension}) => - createGroupExtension({ - nested: false, - draggable: false, - createOnEnter: true, - // @note: you can override css styles with your own classes - groupNodeClass: 'filled-group', - groupPointerNodeClass: '', // anyway element doesn't exists if `draggable` is false - }), - ), - import('@tiptap/extension-text-style').then(({TextStyle}) => TextStyle), - import('@taiga-ui/addon-editor/extensions/background-color').then( - ({BackgroundColor}) => BackgroundColor, - ), - ], - }, - ], - changeDetection, -}) -export class TuiEditorGroupExample2 { - readonly builtInTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Group, - TuiEditorTool.Hilite, - ]; - - control = new FormControl(''); - - constructor() { - this.control.patchValue( - '

This is a boring paragraph.

And another paragraph.

Let’s finish with a boring paragraph.

', - ); - } -} diff --git a/projects/demo/src/modules/components/editor/groups/examples/3/index.html b/projects/demo/src/modules/components/editor/groups/examples/3/index.html deleted file mode 100644 index a3a09b9f75fd..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/3/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/groups/examples/3/index.less b/projects/demo/src/modules/components/editor/groups/examples/3/index.less deleted file mode 100644 index e2833a909e5f..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/3/index.less +++ /dev/null @@ -1,13 +0,0 @@ -.editor { - min-height: 30rem; - - ::ng-deep .group { - position: relative; - display: flex; - flex-direction: column; - padding: 0.5rem; - margin: 0.5rem 0; - border-radius: 0.5rem; - border: 1px solid var(--tui-base-04); - } -} diff --git a/projects/demo/src/modules/components/editor/groups/examples/3/index.ts b/projects/demo/src/modules/components/editor/groups/examples/3/index.ts deleted file mode 100644 index e739d4f4e5e9..000000000000 --- a/projects/demo/src/modules/components/editor/groups/examples/3/index.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {TuiDestroyService} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-groups-example-3', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - TuiDestroyService, - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/group').then( - ({createGroupExtension}) => - createGroupExtension({ - draggable: false, - - // @note: you can override css styles with your own classes - groupNodeClass: 'group', - groupPointerNodeClass: '', // anyway element doesn't exists if `draggable` is false - }), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorGroupExample3 { - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Group]; - - control = new FormControl(''); - - constructor() { - this.control.patchValue( - '

This is a boring paragraph.

And another paragraph.

And a nested paragraph.

But can we go deeper?

Let’s finish with a boring paragraph.

', - ); - } -} diff --git a/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.html b/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.html deleted file mode 100644 index 92bcd7f321c8..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.ts b/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.ts deleted file mode 100644 index 4b26f4063276..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'editor-code-block', - templateUrl: './editor-code-block.component.html', - encapsulation, - changeDetection, -}) -export class ExampleTuiEditorCodeBlockComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - LESS: import('./examples/1/index.less?raw'), - './example.md': import('./examples/1/example.md?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.module.ts b/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.module.ts deleted file mode 100644 index 0e227cd40ffe..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/editor-code-block.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiButtonModule, TuiLinkModule, TuiSvgModule} from '@taiga-ui/core'; - -import {ExampleTuiEditorCodeBlockComponent} from './editor-code-block.component'; -import {TuiEditorCodeBlockExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiSvgModule, - TuiLinkModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorCodeBlockComponent)), - ], - declarations: [TuiEditorCodeBlockExample1, ExampleTuiEditorCodeBlockComponent], -}) -export class ExampleTuiEditorCodeBlockModule {} diff --git a/projects/demo/src/modules/components/editor/highlight/code/examples/1/example.md b/projects/demo/src/modules/components/editor/highlight/code/examples/1/example.md deleted file mode 100644 index d4332e580f85..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/examples/1/example.md +++ /dev/null @@ -1,20 +0,0 @@ -```html -
Hello world
-Tell me please, why? -
class Greeter {
-  greeting: string;
-
-  constructor(message: string) {
-    this.greeting = message;
-  }
-
-  greet() {
-    return "Hello, " + this.greeting;
-  }
-}
-
-let greeter = new Greeter("world");
-
-
https://github.com/tinkoff/taiga-ui
-

-``` diff --git a/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.html b/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.html deleted file mode 100644 index a3a09b9f75fd..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.less b/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.less deleted file mode 100644 index 7d0fe10bf379..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.less +++ /dev/null @@ -1,12 +0,0 @@ -:host { - ::ng-deep { - tui-editor-socket pre:has(code[class='language-ts']) { - background: var(--tui-base-08); - } - - code[class='language-ts'] { - color: var(--tui-base-01); - text-shadow: none; - } - } -} diff --git a/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.ts b/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.ts deleted file mode 100644 index fbe824ae6bca..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/code/examples/1/index.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {Component, OnInit} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {tuiRawLoad, tuiTryParseMarkdownCodeBlock} from '@taiga-ui/addon-doc'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-code-block-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useFactory: () => { - return [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - ]; - }, - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorCodeBlockExample1 implements OnInit { - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Code]; - - control = new FormControl(''); - - async ngOnInit(): Promise { - const [code] = tuiTryParseMarkdownCodeBlock( - await tuiRawLoad(import('./example.md?raw')), - ); - - this.control.patchValue(code); - } -} diff --git a/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.html b/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.html deleted file mode 100644 index 61f4548fa04a..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.html +++ /dev/null @@ -1,33 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.ts b/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.ts deleted file mode 100644 index 6312b133b198..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'editor-mark-text', - templateUrl: './editor-mark-text.component.html', - encapsulation, - changeDetection, -}) -export class ExampleTuiEditorMarkTextComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - LESS: import('./examples/1/index.less?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.module.ts b/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.module.ts deleted file mode 100644 index f7d4f3551daa..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/text/editor-mark-text.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiButtonModule, TuiLinkModule, TuiSvgModule} from '@taiga-ui/core'; - -import {ExampleTuiEditorMarkTextComponent} from './editor-mark-text.component'; -import {TuiEditorMarkTextExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiSvgModule, - TuiLinkModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorMarkTextComponent)), - ], - declarations: [TuiEditorMarkTextExample1, ExampleTuiEditorMarkTextComponent], -}) -export class ExampleTuiEditorMarkTextModule {} diff --git a/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.html b/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.html deleted file mode 100644 index 4b0d45596d44..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.less b/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.less deleted file mode 100644 index b68744493a40..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.less +++ /dev/null @@ -1,7 +0,0 @@ -::ng-deep .marked { - padding: 0.3125rem; - border-radius: 0.3125rem; - margin: 0 0.3125rem; - box-shadow: 0 0 0 2px rgb(0 123 255 / 25%); - line-height: 2.6rem; -} diff --git a/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.ts b/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.ts deleted file mode 100644 index 39bb1968430d..000000000000 --- a/projects/demo/src/modules/components/editor/highlight/text/examples/1/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -import {Component, ViewChild} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_EDITOR_EXTENSIONS, - TuiEditorComponent, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'tui-editor-mark-text-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-align').then(({default: TextAlign}) => - TextAlign.configure({types: ['heading', 'paragraph']}), - ), - import('@tiptap/extension-text-style').then( - ({default: TextStyle}) => TextStyle, - ), - import('@tiptap/extension-highlight').then(({Highlight}) => - Highlight.configure({ - multicolor: true, - HTMLAttributes: { - class: 'marked', - }, - }), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorMarkTextExample1 { - @ViewChild(TuiEditorComponent) - private readonly wysiwyg?: TuiEditorComponent; - - readonly builtInTools = [TuiEditorTool.Undo]; - - control = new FormControl( - ` -

This isn’t highlighted.

-

- Grammar - can be tricky, - especially - for the uninitiated -

- `, - ); - - toggleHighlight(): void { - this.wysiwyg?.editor - ?.getOriginTiptapEditor() - .commands.toggleHighlight({color: '#c8eefc'}); - } -} diff --git a/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.html b/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.html deleted file mode 100644 index 5a3315b676fa..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.ts b/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.ts deleted file mode 100644 index 0ff233b94c98..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-preview-images', - templateUrl: './editor-preview-images.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorResizableImagesComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - 'image-preview/image-preview.template.html': import( - './examples/1/image-preview/image-preview.template.html?raw' - ), - 'image-preview/image-preview.style.less': import( - './examples/1/image-preview/image-preview.style.less?raw' - ), - 'image-preview/image-preview.component.ts': import( - './examples/1/image-preview/image-preview.component.ts?raw' - ), - 'image-preview/image-preview.module.ts': import( - './examples/1/image-preview/image-preview.module.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.module.ts b/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.module.ts deleted file mode 100644 index 6856bb8c48a7..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/editor-preview-images.module.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorResizableImagesComponent} from './editor-preview-images.component'; -import {TuiEditorPreviewImagesExample1} from './examples/1'; -import {ImagePreviewExampleModule} from './examples/1/image-preview/image-preview.module'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - ImagePreviewExampleModule, - RouterModule.forChild( - tuiGenerateRoutes(ExampleTuiEditorResizableImagesComponent), - ), - ], - declarations: [ - TuiEditorPreviewImagesExample1, - ExampleTuiEditorResizableImagesComponent, - ], -}) -export class ExampleTuiEditorPreviewImagesToolModule {} diff --git a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.component.ts b/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.component.ts deleted file mode 100644 index d370983ba08d..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {Component, Inject, TemplateRef, ViewChild} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiPreviewDialogService} from '@taiga-ui/addon-preview'; -import {TuiDialogContext} from '@taiga-ui/core'; - -@Component({ - selector: 'image-preview-example', - templateUrl: './image-preview.template.html', - styleUrls: ['./image-preview.style.less'], - changeDetection, - encapsulation, -}) -export class ImagePreviewExampleComponent { - @ViewChild('previewImages') - template?: TemplateRef; - - image?: HTMLImageElement; - - constructor( - @Inject(TuiPreviewDialogService) - private readonly dialogs: TuiPreviewDialogService, - ) {} - - showImage(image: HTMLImageElement): void { - this.image = image; - this.dialogs.open(this.template || '').subscribe(); - } -} diff --git a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.module.ts b/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.module.ts deleted file mode 100644 index a136744c07c4..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {TuiEditorImagePreviewModule} from '@taiga-ui/addon-editor'; -import {TuiPreviewModule} from '@taiga-ui/addon-preview'; -import {TuiButtonModule} from '@taiga-ui/core'; -import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus'; - -import {ImagePreviewExampleComponent} from './image-preview.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiPreviewModule, - TuiButtonModule, - PolymorpheusModule, - TuiEditorImagePreviewModule, - ], - exports: [ - TuiEditorImagePreviewModule, - TuiEditorImagePreviewModule, - ImagePreviewExampleComponent, - ], - declarations: [ImagePreviewExampleComponent], -}) -export class ImagePreviewExampleModule {} diff --git a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.style.less b/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.style.less deleted file mode 100644 index 108117e5af37..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.style.less +++ /dev/null @@ -1,3 +0,0 @@ -.t-image-preview { - width: 100%; -} diff --git a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.template.html b/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.template.html deleted file mode 100644 index 3b8b5a05d5c7..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/examples/1/image-preview/image-preview.template.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/projects/demo/src/modules/components/editor/images/preview/examples/1/index.html b/projects/demo/src/modules/components/editor/images/preview/examples/1/index.html deleted file mode 100644 index fef0f7cc572a..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/examples/1/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - -

HTML:

- - - diff --git a/projects/demo/src/modules/components/editor/images/preview/examples/1/index.ts b/projects/demo/src/modules/components/editor/images/preview/examples/1/index.ts deleted file mode 100644 index 394153ab9413..000000000000 --- a/projects/demo/src/modules/components/editor/images/preview/examples/1/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {Component, Inject, Injector} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TUI_EDITOR_EXTENSIONS, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {TUI_IS_STACKBLITZ, TuiDestroyService} from '@taiga-ui/cdk'; - -@Component({ - selector: 'tui-editor-preview-images-example-1', - templateUrl: './index.html', - providers: [ - TuiDestroyService, - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/image-editor').then( - ({createImageEditorExtension}) => - createImageEditorExtension(injector), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorPreviewImagesExample1 { - private readonly relativePath = this.isStackblitz ? 'https://taiga-ui.dev/' : ''; - - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Img]; - - control = new FormControl(''); - - constructor(@Inject(TUI_IS_STACKBLITZ) private readonly isStackblitz: boolean) { - this.control.patchValue( - `

Small image

Big image

`, - ); - } -} diff --git a/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.html b/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.html deleted file mode 100644 index 6c9bfb511884..000000000000 --- a/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.ts b/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.ts deleted file mode 100644 index 860707482974..000000000000 --- a/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-resizable-images', - templateUrl: './editor-resizable-images.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorResizableImagesComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.module.ts b/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.module.ts deleted file mode 100644 index 0470cc5d095b..000000000000 --- a/projects/demo/src/modules/components/editor/images/resizable/editor-resizable-images.module.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorResizableImagesComponent} from './editor-resizable-images.component'; -import {TuiEditorResizableEditorExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild( - tuiGenerateRoutes(ExampleTuiEditorResizableImagesComponent), - ), - ], - declarations: [ - TuiEditorResizableEditorExample1, - ExampleTuiEditorResizableImagesComponent, - ], -}) -export class ExampleTuiEditorResizableImagesToolModule {} diff --git a/projects/demo/src/modules/components/editor/images/resizable/examples/1/index.html b/projects/demo/src/modules/components/editor/images/resizable/examples/1/index.html deleted file mode 100644 index c43f4d9ee36b..000000000000 --- a/projects/demo/src/modules/components/editor/images/resizable/examples/1/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - -

HTML:

- diff --git a/projects/demo/src/modules/components/editor/images/resizable/examples/1/index.ts b/projects/demo/src/modules/components/editor/images/resizable/examples/1/index.ts deleted file mode 100644 index 0ba15c5ba9da..000000000000 --- a/projects/demo/src/modules/components/editor/images/resizable/examples/1/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -import {HttpClient} from '@angular/common/http'; -import {Component, Inject, Injector, Self} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_EDITOR_EXTENSIONS, - TUI_IMAGE_LOADER, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; -import {TUI_IS_STACKBLITZ, TuiDestroyService, TuiHandler} from '@taiga-ui/cdk'; -import {Observable} from 'rxjs'; -import {switchMap, takeUntil} from 'rxjs/operators'; - -@Component({ - selector: 'tui-editor-resizable-editor-example-1', - templateUrl: './index.html', - providers: [ - TuiDestroyService, - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/image-editor').then( - ({tuiCreateImageEditorExtension}) => - tuiCreateImageEditorExtension({injector}), - ), - ], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorResizableEditorExample1 { - private readonly relativePath = this.isStackblitz ? 'https://taiga-ui.dev/' : ''; - - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Img]; - - base64Image$ = this.http - .get(`${this.relativePath}assets/images/lumberjack.png`, {responseType: 'blob'}) - .pipe(switchMap(file => this.imageLoader(file))); - - control = new FormControl(''); - - constructor( - @Inject(TUI_IMAGE_LOADER) - private readonly imageLoader: TuiHandler>, - @Inject(HttpClient) private readonly http: HttpClient, - @Self() @Inject(TuiDestroyService) destroy$: TuiDestroyService, - @Inject(TUI_IS_STACKBLITZ) private readonly isStackblitz: boolean, - ) { - this.base64Image$.pipe(takeUntil(destroy$)).subscribe(src => { - this.control.patchValue( - ` - -

Try to drag right border of image!

-

To change min/max size of image use token TUI_IMAGE_EDITOR_OPTIONS. - `, - ); - }); - } -} diff --git a/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.html b/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.html deleted file mode 100644 index bea3757a4fd1..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - - diff --git a/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.ts b/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.ts deleted file mode 100644 index bda255eedfa1..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-upload-images', - templateUrl: './editor-upload-images.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorUploadingImagesComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - 'image-loader.ts': import('./examples/1/image-loader.ts?raw'), - 'imgbb.service.ts': import('./examples/1/imgbb.service.ts?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.module.ts b/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.module.ts deleted file mode 100644 index f0442623d13c..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/editor-upload-images.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule, TuiValidatorModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiErrorModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiLoaderModule, - TuiSvgModule, -} from '@taiga-ui/core'; -import {TuiFieldErrorPipeModule} from '@taiga-ui/kit'; - -import {ExampleTuiEditorUploadingImagesComponent} from './editor-upload-images.component'; -import {TuiEditorUploadingImagesExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiLoaderModule, - TuiEditorSocketModule, - TuiErrorModule, - TuiFieldErrorPipeModule, - RouterModule.forChild( - tuiGenerateRoutes(ExampleTuiEditorUploadingImagesComponent), - ), - TuiValidatorModule, - ], - declarations: [ - TuiEditorUploadingImagesExample1, - ExampleTuiEditorUploadingImagesComponent, - ], -}) -export class ExampleTuiEditorUploadImagesModule {} diff --git a/projects/demo/src/modules/components/editor/images/upload/examples/1/image-loader.ts b/projects/demo/src/modules/components/editor/images/upload/examples/1/image-loader.ts deleted file mode 100644 index bf4c99b1877e..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/examples/1/image-loader.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {fromEvent, Observable} from 'rxjs'; -import {delay, finalize, map, switchMap} from 'rxjs/operators'; - -import {ImgbbService} from './imgbb.service'; - -export function imageLoader(service: ImgbbService): (file: File) => Observable { - return (file: File) => { - const fileReader = new FileReader(); - - service.loading$.next(true); - fileReader.readAsDataURL(file); - - return fromEvent(fileReader, `load`).pipe( - delay(2000), // for simulate throttle network - map(() => String(fileReader.result)), - switchMap(base64 => service.save(base64)), - finalize(() => service.loading$.next(false)), - ); - }; -} diff --git a/projects/demo/src/modules/components/editor/images/upload/examples/1/imgbb.service.ts b/projects/demo/src/modules/components/editor/images/upload/examples/1/imgbb.service.ts deleted file mode 100644 index 34467cb67107..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/examples/1/imgbb.service.ts +++ /dev/null @@ -1,61 +0,0 @@ -import {Injectable} from '@angular/core'; -import {BehaviorSubject, from, Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -/** - * @description: - * You can get your credentials for testing API on: - * https://api.imgbb.com/ - */ -const imgbb = { - host: `https://api.imgbb.com`, - apiKey: `3c1615980dcf693b282c4b0fb608b28a`, - expiration: 300, // 5min lifetime -}; - -interface ImgbbResponse { - data: { - id: string; - title: string; - url: string; - width: string; - height: string; - size: number; - time: string; - expiration: string; - }; - success: boolean; - status: number; -} - -@Injectable({ - providedIn: `root`, -}) -export class ImgbbService { - readonly loading$ = new BehaviorSubject(false); - - private static createBody(base64: string): URLSearchParams { - const formData = new FormData(); - - formData.append(`image`, base64.split(`,`).pop() || ``); - - return new URLSearchParams(formData as any); - } - - get isLoading(): boolean { - return this.loading$.getValue(); - } - - save(base64: string): Observable { - return from( - fetch( - `${imgbb.host}/1/upload?key=${imgbb.apiKey}&expiration=${imgbb.expiration}`, - { - method: `POST`, - body: ImgbbService.createBody(base64), - headers: {'Content-Type': `application/x-www-form-urlencoded`}, - }, - ).then(async (response: Response) => response.json()), - ).pipe(map((response: ImgbbResponse) => response.data.url)); - } -} diff --git a/projects/demo/src/modules/components/editor/images/upload/examples/1/index.html b/projects/demo/src/modules/components/editor/images/upload/examples/1/index.html deleted file mode 100644 index 3fa9e22950cf..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/examples/1/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/images/upload/examples/1/index.ts b/projects/demo/src/modules/components/editor/images/upload/examples/1/index.ts deleted file mode 100644 index a7600cd361a8..000000000000 --- a/projects/demo/src/modules/components/editor/images/upload/examples/1/index.ts +++ /dev/null @@ -1,90 +0,0 @@ -import {DOCUMENT} from '@angular/common'; -import {Component, Inject, Injector, ViewChild} from '@angular/core'; -import {AbstractControl, FormControl, ValidationErrors} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_EDITOR_EXTENSIONS, - TUI_EDITOR_MAX_IMAGE_WIDTH, - TUI_EDITOR_MIN_IMAGE_WIDTH, - TUI_IMAGE_LOADER, - TuiEditorComponent, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; -import {TUI_IS_STACKBLITZ, TuiDestroyService, TuiValidationError} from '@taiga-ui/cdk'; - -import {imageLoader} from './image-loader'; -import {ImgbbService} from './imgbb.service'; - -@Component({ - selector: 'tui-editor-upload-images-example-1', - templateUrl: './index.html', - providers: [ - TuiDestroyService, - { - provide: TUI_EDITOR_EXTENSIONS, - deps: [Injector], - useFactory: (injector: Injector) => [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@taiga-ui/addon-editor/extensions/image-editor').then( - ({createImageEditorExtension}) => - createImageEditorExtension(injector), - ), - import('@tiptap/extension-image').then(({default: Image}) => - Image.configure({inline: true, allowBase64: true}), - ), - ], - }, - { - provide: TUI_EDITOR_MIN_IMAGE_WIDTH, - useValue: 150, - }, - { - provide: TUI_EDITOR_MAX_IMAGE_WIDTH, - useValue: 400, - }, - { - provide: TUI_IMAGE_LOADER, - useFactory: imageLoader, - deps: [ImgbbService], - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorUploadingImagesExample1 { - @ViewChild(TuiEditorComponent, {static: true}) - private readonly editor?: TuiEditorComponent; - - private readonly relativePath = this.isStackblitz ? 'https://taiga-ui.dev/' : ''; - - readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Img]; - - control = new FormControl(''); - - constructor( - @Inject(DOCUMENT) readonly doc: Document, - @Inject(ImgbbService) readonly imgbbService: ImgbbService, - @Inject(TUI_IS_STACKBLITZ) private readonly isStackblitz: boolean, - ) { - this.control.patchValue( - ` - -

Try to drag right border of image!

-

To change min/max size of image use token TUI_IMAGE_EDITOR_OPTIONS.

- `, - ); - } - - readonly validator = ({value}: AbstractControl): ValidationErrors | null => - this.editor?.focused || - this.imgbbService.isLoading || - !this.doc.hasFocus() || // possible that file dialog is open - value.length - ? null - : { - empty: new TuiValidationError('ERROR: content must not be empty'), - }; -} diff --git a/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.html b/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.html deleted file mode 100644 index d4b695507834..000000000000 --- a/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.ts b/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.ts deleted file mode 100644 index 77bfb803f6a0..000000000000 --- a/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'editor-cleanup-html', - templateUrl: './editor-cleanup-html.component.html', - encapsulation, - changeDetection, -}) -export class ExampleTuiEditorCleanupHtmlComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - './transformer.ts': import('./examples/1/transformer.ts?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.module.ts b/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.module.ts deleted file mode 100644 index 13fa37db5062..000000000000 --- a/projects/demo/src/modules/components/editor/processing/cleanup-html/editor-cleanup-html.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorCleanupHtmlComponent} from './editor-cleanup-html.component'; -import {TuiEditorCleanupHtmlExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorCleanupHtmlComponent)), - ], - declarations: [TuiEditorCleanupHtmlExample1, ExampleTuiEditorCleanupHtmlComponent], -}) -export class ExampleTuiEditorCleanupHtmlModule {} diff --git a/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.html b/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.html deleted file mode 100644 index 0a553c86e94d..000000000000 --- a/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - Placeholder - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.ts b/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.ts deleted file mode 100644 index fc91a5b3ef5d..000000000000 --- a/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl, Validators} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - defaultEditorExtensions, - TUI_EDITOR_EXTENSIONS, - TUI_EDITOR_VALUE_TRANSFORMER, -} from '@taiga-ui/addon-editor'; - -import {ExampleEditorCleanupHtmlTransformer} from './transformer'; - -@Component({ - selector: 'tui-editor-cleanup-html-example-1', - templateUrl: './index.html', - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - { - provide: TUI_EDITOR_VALUE_TRANSFORMER, - useClass: ExampleEditorCleanupHtmlTransformer, - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorCleanupHtmlExample1 { - control = new FormControl( - '

TipTap Editor

', - Validators.required, - ); -} diff --git a/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/transformer.ts b/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/transformer.ts deleted file mode 100644 index b2ec4558644e..000000000000 --- a/projects/demo/src/modules/components/editor/processing/cleanup-html/examples/1/transformer.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {Injectable} from '@angular/core'; -import {AbstractTuiValueTransformer} from '@taiga-ui/cdk'; - -@Injectable() -export class ExampleEditorCleanupHtmlTransformer extends AbstractTuiValueTransformer { - fromControlValue(controlValue: string): string { - return controlValue; - } - - toControlValue(componentValue: string): string { - const tree = new DOMParser().parseFromString(componentValue, `text/html`); - - tree.body.querySelectorAll(`*`).forEach(element => { - // now we can manipulate with any elements - // and cleanup any attributes (class for example) - element.removeAttribute(`class`); - element.removeAttribute(`style`); - }); - - return tree.body.innerHTML; - } -} diff --git a/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.html b/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.html deleted file mode 100644 index 32ef9bf8f878..000000000000 --- a/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.html +++ /dev/null @@ -1,32 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.ts b/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.ts deleted file mode 100644 index 808280e6e70e..000000000000 --- a/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; - -@Component({ - selector: 'editor-legacy-html', - templateUrl: './editor-legacy-html.component.html', - encapsulation, - changeDetection, -}) -export class ExampleTuiEditorProcessingContentComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - './transformer.ts': import('./examples/1/transformer.ts?raw'), - './legacy-editor.ts': import( - '../../../../../../../addon-editor/utils/legacy-converter.ts?raw' - ), - }; -} diff --git a/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.module.ts b/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.module.ts deleted file mode 100644 index 16512949f359..000000000000 --- a/projects/demo/src/modules/components/editor/processing/legacy-html/editor-legacy-html.module.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorProcessingContentComponent} from './editor-legacy-html.component'; -import {TuiEditorLegacyHtmlExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild( - tuiGenerateRoutes(ExampleTuiEditorProcessingContentComponent), - ), - ], - declarations: [ - TuiEditorLegacyHtmlExample1, - ExampleTuiEditorProcessingContentComponent, - ], -}) -export class ExampleTuiEditorLegacyHtmlModule {} diff --git a/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.html b/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.html deleted file mode 100644 index 0a553c86e94d..000000000000 --- a/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - Placeholder - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.ts b/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.ts deleted file mode 100644 index 68f554f5ae81..000000000000 --- a/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Component} from '@angular/core'; -import {FormControl, Validators} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - defaultEditorExtensions, - TUI_EDITOR_EXTENSIONS, - TUI_EDITOR_VALUE_TRANSFORMER, -} from '@taiga-ui/addon-editor'; - -import {ExampleEditorConvertLegacyHtmlTransformer} from './transformer'; - -@Component({ - selector: 'tui-editor-legacy-html-example-1', - templateUrl: './index.html', - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - { - provide: TUI_EDITOR_VALUE_TRANSFORMER, - useClass: ExampleEditorConvertLegacyHtmlTransformer, - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorLegacyHtmlExample1 { - control = new FormControl( - // Legacy HTML markup from DB - 'WYSIWYG (What you see is what you get) — Rich Text Editor for using with Angular forms.

Heading

Lorem ipsum dolor sit amet consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco, laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', - Validators.required, - ); -} diff --git a/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/transformer.ts b/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/transformer.ts deleted file mode 100644 index 00f10d3b0a33..000000000000 --- a/projects/demo/src/modules/components/editor/processing/legacy-html/examples/1/transformer.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {Injectable} from '@angular/core'; -import {tuiLegacyEditorConverter} from '@taiga-ui/addon-editor'; -import {AbstractTuiValueTransformer} from '@taiga-ui/cdk'; - -@Injectable() -export class ExampleEditorConvertLegacyHtmlTransformer extends AbstractTuiValueTransformer { - fromControlValue(controlValue: string): string { - return tuiLegacyEditorConverter(controlValue); - } - - toControlValue(componentValue: string): string { - return componentValue; - } -} diff --git a/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.html b/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.html deleted file mode 100644 index a43bed23b80f..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.html +++ /dev/null @@ -1,33 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.ts b/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.ts deleted file mode 100644 index cfc132f7bb19..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR, - TuiDocExample, -} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-markdown', - templateUrl: './editor-markdown.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - { - /** - * @description: - * prevent parse 'example.md' - */ - provide: TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR, - useValue: (value: string): string[] => [value], - }, - ], -}) -export class ExampleTuiEditorMarkdownComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - LESS: import('./examples/1/index.less?raw'), - 'example.md': import('./examples/1/example.md?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.module.ts b/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.module.ts deleted file mode 100644 index 98fb97c98dfa..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/editor-markdown.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorMarkdownComponent} from './editor-markdown.component'; -import {TuiEditorEditorExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorMarkdownComponent)), - ], - declarations: [TuiEditorEditorExample1, ExampleTuiEditorMarkdownComponent], -}) -export class ExampleTuiEditorMarkdownModule {} diff --git a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/example.md b/projects/demo/src/modules/components/editor/processing/markdown/examples/1/example.md deleted file mode 100644 index 2e2ead6d8d95..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/example.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -__Advertisement 😃__ - -- __[pica](https://nodeca.github.io/pica/demo/)__ - high quality and fast image resize in browser. - -__[babelfish](https://github.com/nodeca/babelfish/)__ - developer friendly i18n with plurals support and easy syntax. - -You will like those projects! ---- - -# h1 Heading 😎 - -## h2 Heading - -### h3 Heading - -#### h4 Heading - -##### h5 Heading - -###### h6 Heading - -## Horizontal Rules - ---- - ---- - ---- - -## Typographic replacements - -Enable typographer option to see result. - -© © ® ® ™ ™ (p) (P) ± - -test.. test... test..... test?..... test!.... - -!!!!!! ???? ,, -- --- - -"Smartypants, double quotes" and 'single quotes' - -## Emphasis - -**This is bold text** - -**This is bold text** - -_This is italic text_ - -_This is italic text_ - -~~Strikethrough~~ - -## Blockquotes - -> Blockquotes can also be nested... -> -> > ...by using additional greater-than signs right next to each other... -> > -> > > ...or with spaces between arrows. - -## Lists - -Unordered - -- Create a list by starting a line with `+`, `-`, or `*` -- Sub-lists are made by indenting 2 spaces: - - Marker character change forces new list start: - - Ac tristique libero volutpat at - * Facilisis in pretium nisl aliquet - - Nulla volutpat aliquam velit -- Very easy! - -Ordered - -1. Lorem ipsum dolor sit amet -2. Consectetur adipiscing elit -3. Integer molestie lorem at massa - -4. You can use sequential numbers... -5. ...or keep all the numbers as `1.` - -Start numbering with offset: - -57. foo -1. bar - -## Code - -Inline `code` - -Indented code - - // Some comments - line 1 of code - line 2 of code - line 3 of code - -Block code "fences" - -``` - -Sample text here... - -``` - -## Tables - -| Option | Description | -| ------ | ------------------------------------------------------------------------- | -| data | path to data files to supply the data that will be passed into templates. | -| engine | engine to be used for processing templates. Handlebars is the default. | -| ext | extension to be used for dest files. | - -Right aligned columns - -| Option | Description | -| -----: | ------------------------------------------------------------------------: | -| data | path to data files to supply the data that will be passed into templates. | -| engine | engine to be used for processing templates. Handlebars is the default. | -| ext | extension to be used for dest files. | - -## Links - -[link text](http://dev.nodeca.com) - -[link with title](http://nodeca.github.io/pica/demo/ 'title text!') - -Auto converted link https://github.com/nodeca/pica (enable linkify to see) - -## Images - -![Minion](https://octodex.github.com/images/minion.png) - -Like links, Images also have a footnote style syntax - -## Plugins - -The killer feature of `markdown-it` is very effective support of -[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin). - -### [Emoji](https://github.com/markdown-it/markdown-it-emoji) - -> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum: -> -> Shortcuts (emoticons): :-) :-( 8-) ;) - -see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji. - -### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup) - -- 19^th^ -- H~2~O - -### [\](https://github.com/markdown-it/markdown-it-ins) - -++Inserted text++ - -### [\](https://github.com/markdown-it/markdown-it-mark) - -==Marked text== - -### [Footnotes](https://github.com/markdown-it/markdown-it-footnote) - -Footnote 1 link[^first]. - -Footnote 2 link[^second]. - -Inline footnote^[Text of inline footnote] definition. - -Duplicated footnote reference[^second]. - -[^first]: Footnote **can have markup** - - and multiple paragraphs. - -[^second]: Footnote text. - -### [Definition lists](https://github.com/markdown-it/markdown-it-deflist) - -Term 1 - -: Definition 1 with lazy continuation. - -Term 2 with _inline markup_ - -: Definition 2 - - { some code, part of Definition 2 } - - Third paragraph of definition 2. - -_Compact style:_ - -Term 1 ~ Definition 1 - -Term 2 ~ Definition 2a ~ Definition 2b - -### [Abbreviations](https://github.com/markdown-it/markdown-it-abbr) - -This is HTML abbreviation example. - -It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on. - -\*[HTML]: Hyper Text Markup Language - -### [Custom containers](https://github.com/markdown-it/markdown-it-container) - -::: warning _here be dragons_ ::: diff --git a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.html b/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.html deleted file mode 100644 index 7040d36635d4..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - Placeholder - - -

HTML:

- - -

Markdown:

-
{{ toMarkdown(control?.value) }}
diff --git a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.less b/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.less deleted file mode 100644 index 1b9fc3a1a0c3..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.less +++ /dev/null @@ -1,13 +0,0 @@ -.editor { - min-height: 30rem; -} - -.markdown { - font-family: monospace; - padding: 0.375rem 0.5rem; - background: var(--tui-base-02); - color: var(--tui-text-02); - box-shadow: inset 0 -2px var(--tui-secondary); - font-size: 0.875rem; - white-space: break-spaces; -} diff --git a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.ts b/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.ts deleted file mode 100644 index 1a1dc050008d..000000000000 --- a/projects/demo/src/modules/components/editor/processing/markdown/examples/1/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import {Component, OnInit} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {tuiRawLoad} from '@taiga-ui/addon-doc'; -import {TUI_EDITOR_CONTENT_PROCESSOR, TuiEditorTool} from '@taiga-ui/addon-editor'; -import {tuiPure} from '@taiga-ui/cdk'; -import MarkdownIt from 'markdown-it'; -import {Converter} from 'showdown'; - -@Component({ - selector: 'tui-editor-markdown-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_CONTENT_PROCESSOR, - useValue: (markdown: string): string => new MarkdownIt().render(markdown), - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorEditorExample1 implements OnInit { - readonly builtInTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Img, - TuiEditorTool.Link, - TuiEditorTool.Anchor, - ]; - - control: FormControl = new FormControl(''); - - @tuiPure - toMarkdown(html: string): string { - return new Converter().makeMarkdown(html); - } - - async ngOnInit(): Promise { - const md = await tuiRawLoad(import('./example.md?raw')); - - this.control.patchValue(md); - } -} diff --git a/projects/demo/src/modules/components/editor/starter/editor-starter.component.ts b/projects/demo/src/modules/components/editor/starter/editor-starter.component.ts deleted file mode 100644 index d425ef41f462..000000000000 --- a/projects/demo/src/modules/components/editor/starter/editor-starter.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -import {Component, forwardRef, Inject} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - defaultEditorExtensions, - defaultEditorTools, - TUI_EDITOR_EXTENSIONS, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; -import {TUI_IS_CYPRESS} from '@taiga-ui/cdk'; - -import {AbstractExampleTuiControl} from '../../abstract/control'; -import {ABSTRACT_PROPS_ACCESSOR} from '../../abstract/inherited-documentation/abstract-props-accessor'; - -@Component({ - selector: 'example-tui-editor-starter', - templateUrl: './editor-starter.template.html', - encapsulation, - changeDetection, - providers: [ - { - provide: ABSTRACT_PROPS_ACCESSOR, - useExisting: forwardRef(() => ExampleEditorStarterComponent), - }, - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleEditorStarterComponent extends AbstractExampleTuiControl { - readonly exampleModule = import('./import/import-module.md?raw'); - readonly exampleHtml = import('./import/insert-template.md?raw'); - readonly provideExtensions = import('./import/provide-extensions.md?raw'); - - readonly exampleEditorOptionsToken = import('./import/editor-options-token.md?raw'); - - readonly control = new FormControl(); - - readonly toolsVariants: readonly TuiEditorTool[][] = [ - defaultEditorTools, - [ - TuiEditorTool.Bold, - TuiEditorTool.Italic, - TuiEditorTool.Strikethrough, - TuiEditorTool.HR, - ], - ]; - - tools = this.toolsVariants[0]; - - constructor(@Inject(TUI_IS_CYPRESS) readonly isCypress: boolean) { - super(); - } -} diff --git a/projects/demo/src/modules/components/editor/starter/editor-starter.module.ts b/projects/demo/src/modules/components/editor/starter/editor-starter.module.ts deleted file mode 100644 index 05a931d95090..000000000000 --- a/projects/demo/src/modules/components/editor/starter/editor-starter.module.ts +++ /dev/null @@ -1,44 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import { - TuiAddonDocModule, - tuiGenerateRoutes, - TuiTextCodeModule, -} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiAutoFocusModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiLinkModule, - TuiLoaderModule, - TuiNotificationModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {InheritedDocumentationModule} from '../../abstract/inherited-documentation/inherited-documentation.module'; -import {ExampleEditorStarterComponent} from './editor-starter.component'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiEditorSocketModule, - TuiNotificationModule, - TuiButtonModule, - InheritedDocumentationModule, - TuiAddonDocModule, - TuiLinkModule, - TuiSvgModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleEditorStarterComponent)), - TuiLoaderModule, - TuiTextCodeModule, - TuiAutoFocusModule, - ], - declarations: [ExampleEditorStarterComponent], - exports: [ExampleEditorStarterComponent], -}) -export class ExampleTuiEditorStarterModule {} diff --git a/projects/demo/src/modules/components/editor/starter/editor-starter.template.html b/projects/demo/src/modules/components/editor/starter/editor-starter.template.html deleted file mode 100644 index dddc11c6d2d7..000000000000 --- a/projects/demo/src/modules/components/editor/starter/editor-starter.template.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Start typing - - -

HTML:

- - -

Text:

-

{{ control.value }}

-
- - - Disabled state (use - formControl.disable() - ) - - - Example pass HTML code - - - Example text shown on empty focused input - - - Allowed edit tools - - - - - Value of CSS-property "min-height" - - - Value of CSS-property "max-height" - - - -
    -
  1. -

    - Import an Angular module for forms and - TuiEditorModule - in the same module where you want to use our component: -

    - - -
  2. - -
  3. -

    Add to the template:

    - - -
  4. - -
  5. -

    Provide the required extensions or use the default ones:

    - - -
  6. -
- -

TUI_EDITOR_OPTIONS

- You can configure some editor's params via DI-token - TUI_EDITOR_OPTIONS - . - -

- Usage: -

- - -

- Description of the available configurations: -

-
-
- colors -
-
- map of colors in toolbar's dropdowns with color-selection. - -

- It accepts - - : the - key - is the name of the color (used only for hint and accessibility), the - value - – HTML color code. -

-
- -
- blankColor -
-
- Null color. It is used in situations when there is no color selected. - -

- it accepts - string - (HTML color code). -

-
- -
- fontOptions -
-
You can customize your own list of font sizes in editor.
- -
- translate -
-
- Although not all browsers recognize this attribute, it is respected by automatic translation systems - such as Google Translate, and may also be respected by tools used by human translators. As such it's - important that web authors use this attribute to mark content that should not be translated.. -
- -
- spellcheck -
-
Defines whether the editor may be checked for spelling errors.
-
-
-
-
diff --git a/projects/demo/src/modules/components/editor/starter/import/editor-options-token.md b/projects/demo/src/modules/components/editor/starter/import/editor-options-token.md deleted file mode 100644 index 891768e91c90..000000000000 --- a/projects/demo/src/modules/components/editor/starter/import/editor-options-token.md +++ /dev/null @@ -1,20 +0,0 @@ -```ts -import {tuiEditorOptionsProvider, TuiEditorOptions} from '@taiga-ui/addon-editor'; - -const CUSTOM_EDITOR_OPTIONS: Partial = { - colors: new Map([ - ['red', 'rgba(244, 87, 37, 1)'], - ['blue', 'var(--tui-primary)'], - ]), - //... -}; - -@Component({ - //... - providers: [ - // .. - tuiEditorOptionsProvider(CUSTOM_EDITOR_OPTIONS), - ], -}) -export class YourComponent {} -``` diff --git a/projects/demo/src/modules/components/editor/starter/import/import-module.md b/projects/demo/src/modules/components/editor/starter/import/import-module.md deleted file mode 100644 index 42f7494bb1d9..000000000000 --- a/projects/demo/src/modules/components/editor/starter/import/import-module.md +++ /dev/null @@ -1,16 +0,0 @@ -```ts -import {FormsModule} from '@angular/forms'; -import {TuiEditorModule} from '@taiga-ui/addon-editor'; - -// ... - -@NgModule({ - imports: [ - // ... - TuiEditorModule, - FormsModule, - ], - // ... -}) -export class MyModule {} -``` diff --git a/projects/demo/src/modules/components/editor/starter/import/insert-template.md b/projects/demo/src/modules/components/editor/starter/import/insert-template.md deleted file mode 100644 index 513fc3e5f6a7..000000000000 --- a/projects/demo/src/modules/components/editor/starter/import/insert-template.md +++ /dev/null @@ -1,8 +0,0 @@ -```html - - Placeholder - -``` diff --git a/projects/demo/src/modules/components/editor/starter/import/provide-extensions.md b/projects/demo/src/modules/components/editor/starter/import/provide-extensions.md deleted file mode 100644 index fe793c6ff741..000000000000 --- a/projects/demo/src/modules/components/editor/starter/import/provide-extensions.md +++ /dev/null @@ -1,16 +0,0 @@ -```typescript -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -// ... - -@Component({ - // ... - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class myComponent {} -``` diff --git a/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.html b/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.html deleted file mode 100644 index 2ee2d996a1ba..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.html +++ /dev/null @@ -1,33 +0,0 @@ - -

- Rich Text Editor based on - - TipTap Editor - - for using with Angular forms. For safety reasons use a - - sanitizer - - with this component. -

- - - - -
diff --git a/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.ts b/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.ts deleted file mode 100644 index 14cb54b30d11..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {Component} from '@angular/core'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import {TuiDocExample} from '@taiga-ui/addon-doc'; -import {defaultEditorExtensions, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/addon-editor'; - -@Component({ - selector: 'editor-upload-files', - templateUrl: './editor-upload-files.component.html', - encapsulation, - changeDetection, - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: defaultEditorExtensions, - }, - ], -}) -export class ExampleTuiEditorUploadFilesComponent { - readonly example1: TuiDocExample = { - TypeScript: import('./examples/1/index.ts?raw'), - HTML: import('./examples/1/index.html?raw'), - LESS: import('./examples/1/index.less?raw'), - './filesio.service.ts': import('./examples/1/filesio.service.ts?raw'), - './file-loader.ts': import('./examples/1/file-loader.ts?raw'), - }; -} diff --git a/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.module.ts b/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.module.ts deleted file mode 100644 index cc62ee79cb59..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/editor-upload-files.module.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiEditorModule, TuiEditorSocketModule} from '@taiga-ui/addon-editor'; -import {TuiActiveZoneModule} from '@taiga-ui/cdk'; -import { - TuiButtonModule, - TuiHostedDropdownModule, - TuiLinkModule, - TuiLoaderModule, - TuiSvgModule, -} from '@taiga-ui/core'; - -import {ExampleTuiEditorUploadFilesComponent} from './editor-upload-files.component'; -import {TuiEditorUploadFilesExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiActiveZoneModule, - TuiSvgModule, - TuiLinkModule, - TuiHostedDropdownModule, - TuiButtonModule, - TuiAddonDocModule, - FormsModule, - ReactiveFormsModule, - TuiEditorModule, - TuiLoaderModule, - TuiEditorSocketModule, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiEditorUploadFilesComponent)), - ], - declarations: [TuiEditorUploadFilesExample1, ExampleTuiEditorUploadFilesComponent], -}) -export class ExampleTuiEditorUploadFilesModule {} diff --git a/projects/demo/src/modules/components/editor/upload-files/examples/1/file-loader.ts b/projects/demo/src/modules/components/editor/upload-files/examples/1/file-loader.ts deleted file mode 100644 index 98f014e942c2..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/examples/1/file-loader.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {TuiEditorAttachedFile} from '@taiga-ui/addon-editor'; -import {forkJoin, Observable} from 'rxjs'; -import {finalize} from 'rxjs/operators'; - -import {FileIoService} from './filesio.service'; - -export function fileLoader( - service: FileIoService, -): (files: File[]) => Observable { - return (files: File[]) => { - service.loading$.next(true); - - return forkJoin(files.map(file => service.upload(file))).pipe( - finalize(() => service.loading$.next(false)), - ); - }; -} diff --git a/projects/demo/src/modules/components/editor/upload-files/examples/1/filesio.service.ts b/projects/demo/src/modules/components/editor/upload-files/examples/1/filesio.service.ts deleted file mode 100644 index 1860e134dabe..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/examples/1/filesio.service.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {Injectable} from '@angular/core'; -import {TuiEditorAttachedFile} from '@taiga-ui/addon-editor'; -import {BehaviorSubject, from, Observable} from 'rxjs'; -import {map} from 'rxjs/operators'; - -/** - * @description: - * You can get your credentials for testing API - * by free file.io account: - * https://www.file.io/plans - */ -const fileIO = { - host: `https://file.io/`, - autoDelete: `true`, - expires: `1d`, -}; - -@Injectable({ - providedIn: `root`, -}) -export class FileIoService { - readonly loading$ = new BehaviorSubject(false); - - upload(file: File): Observable { - const body = new FormData(); - - body.append(`file`, file, file.name); - body.append(`expires`, fileIO.expires); - body.append(`autoDelete`, fileIO.autoDelete); - - return from( - fetch(fileIO.host, { - method: `POST`, - body, - }).then(async (response: Response) => response.json()), - ).pipe(map(result => ({name: result.name, link: result.link}))); - } -} diff --git a/projects/demo/src/modules/components/editor/upload-files/examples/1/index.html b/projects/demo/src/modules/components/editor/upload-files/examples/1/index.html deleted file mode 100644 index 41f782a1fb16..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/examples/1/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - -

HTML:

- - -

Text:

-

{{ control.value }}

diff --git a/projects/demo/src/modules/components/editor/upload-files/examples/1/index.less b/projects/demo/src/modules/components/editor/upload-files/examples/1/index.less deleted file mode 100644 index ed1bc7b1424d..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/examples/1/index.less +++ /dev/null @@ -1,5 +0,0 @@ -.editor { - ::ng-deep .tui-editor-socket .ProseMirror { - min-height: 10rem; - } -} diff --git a/projects/demo/src/modules/components/editor/upload-files/examples/1/index.ts b/projects/demo/src/modules/components/editor/upload-files/examples/1/index.ts deleted file mode 100644 index b5d514dd8d6c..000000000000 --- a/projects/demo/src/modules/components/editor/upload-files/examples/1/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -import {Component, Inject, ViewChild} from '@angular/core'; -import {FormControl} from '@angular/forms'; -import {changeDetection} from '@demo/emulate/change-detection'; -import {encapsulation} from '@demo/emulate/encapsulation'; -import { - TUI_ATTACH_FILES_LOADER, - TUI_EDITOR_EXTENSIONS, - TuiEditorAttachedFile, - TuiEditorComponent, - TuiEditorTool, -} from '@taiga-ui/addon-editor'; - -import {fileLoader} from './file-loader'; -import {FileIoService} from './filesio.service'; - -@Component({ - selector: 'tui-editor-upload-files-example-1', - templateUrl: './index.html', - styleUrls: ['./index.less'], - providers: [ - { - provide: TUI_EDITOR_EXTENSIONS, - useValue: [ - import('@taiga-ui/addon-editor/extensions/starter-kit').then( - ({StarterKit}) => StarterKit, - ), - import('@tiptap/extension-text-style').then(({TextStyle}) => TextStyle), - import('@taiga-ui/addon-editor/extensions/link').then( - ({TuiLink}) => TuiLink, - ), - import('@taiga-ui/addon-editor/extensions/jump-anchor').then( - ({TuiJumpAnchor}) => TuiJumpAnchor, - ), - import('@taiga-ui/addon-editor/extensions/file-link').then( - ({TuiFileLink}) => TuiFileLink, - ), - ], - }, - { - provide: TUI_ATTACH_FILES_LOADER, - deps: [FileIoService], - useFactory: fileLoader, - }, - ], - changeDetection, - encapsulation, -}) -export class TuiEditorUploadFilesExample1 { - @ViewChild(TuiEditorComponent) - private readonly wysiwyg?: TuiEditorComponent; - - readonly builtInTools = [ - TuiEditorTool.Undo, - TuiEditorTool.Link, - TuiEditorTool.Attach, - ]; - - control = new FormControl(''); - - constructor(@Inject(FileIoService) readonly fileIoService: FileIoService) {} - - /** - * @note: attach file as a link - * you can also implement your own file mapping mechanism - * because you have all the necessary data for this - */ - attach(files: TuiEditorAttachedFile[]): void { - files.forEach(file => this.wysiwyg?.editor?.setFileLink(file)); - } -} diff --git a/projects/demo/src/modules/icons/icons-bundled/icons-bundled.template.html b/projects/demo/src/modules/icons/icons-bundled/icons-bundled.template.html index 11186f3093f1..a716ce24f5fb 100644 --- a/projects/demo/src/modules/icons/icons-bundled/icons-bundled.template.html +++ b/projects/demo/src/modules/icons/icons-bundled/icons-bundled.template.html @@ -19,7 +19,7 @@ If you use unsafe icons or Editor component diff --git a/tsconfig.build.json b/tsconfig.build.json index 999c4a266a21..ba8660808bc0 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -24,8 +24,6 @@ "@taiga-ui/addon-mobile": ["./dist/addon-mobile/index"], "@taiga-ui/addon-commerce/*": ["./dist/addon-commerce/*"], "@taiga-ui/addon-commerce": ["./dist/addon-commerce/index"], - "@taiga-ui/addon-editor/*": ["./dist/addon-editor/*"], - "@taiga-ui/addon-editor": ["./dist/addon-editor/index"], "@taiga-ui/addon-tablebars/*": ["./dist/addon-tablebars/*"], "@taiga-ui/addon-tablebars": ["./dist/addon-tablebars/index"], "@taiga-ui/addon-preview/*": ["./dist/addon-preview/*"], diff --git a/tsconfig.json b/tsconfig.json index 9d833d99d976..5efd24fa3119 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -71,8 +71,6 @@ "@taiga-ui/addon-commerce/*": ["projects/addon-commerce/*"], "@taiga-ui/addon-doc": ["projects/addon-doc/index"], "@taiga-ui/addon-doc/*": ["projects/addon-doc/*"], - "@taiga-ui/addon-editor": ["projects/addon-editor/index"], - "@taiga-ui/addon-editor/*": ["projects/addon-editor/*"], "@taiga-ui/addon-mobile": ["projects/addon-mobile/index"], "@taiga-ui/addon-mobile/*": ["projects/addon-mobile/*"], "@taiga-ui/addon-preview": ["projects/addon-preview/index"],