@ebl-vue/editor-full 2.31.36 → 2.31.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/index.mjs +3 -4
  2. package/package.json +1 -1
  3. package/.postcssrc.yml +0 -33
  4. package/dist/index.mjs.map +0 -1
  5. package/postcss.config.js +0 -15
  6. package/src/components/Editor/Editor.vue +0 -293
  7. package/src/components/index.ts +0 -27
  8. package/src/constants/index.ts +0 -1
  9. package/src/i18n/zh-cn.ts +0 -160
  10. package/src/icons/index.ts +0 -93
  11. package/src/index.ts +0 -21
  12. package/src/installer.ts +0 -21
  13. package/src/plugins/alert/index.ts +0 -455
  14. package/src/plugins/block-alignment/index.ts +0 -117
  15. package/src/plugins/block-alignment/readme.md +0 -1
  16. package/src/plugins/code/LICENSE +0 -21
  17. package/src/plugins/code/index.ts +0 -619
  18. package/src/plugins/code/utils/string.ts +0 -34
  19. package/src/plugins/color-picker/index.ts +0 -132
  20. package/src/plugins/delimiter/index.ts +0 -121
  21. package/src/plugins/drag-drop/index.css +0 -19
  22. package/src/plugins/drag-drop/index.ts +0 -151
  23. package/src/plugins/drag-drop/readme.md +0 -1
  24. package/src/plugins/header/H1.ts +0 -404
  25. package/src/plugins/header/H2.ts +0 -403
  26. package/src/plugins/header/H3.ts +0 -404
  27. package/src/plugins/header/H4.ts +0 -404
  28. package/src/plugins/header/H5.ts +0 -403
  29. package/src/plugins/header/H6.ts +0 -404
  30. package/src/plugins/header/index.ts +0 -15
  31. package/src/plugins/header/types.d.ts +0 -46
  32. package/src/plugins/imageResizeCrop/ImageTune.ts +0 -635
  33. package/src/plugins/imageResizeCrop/index.css +0 -230
  34. package/src/plugins/imageResizeCrop/index.ts +0 -5
  35. package/src/plugins/imageResizeCrop/types.d.ts +0 -23
  36. package/src/plugins/imageTool/index.ts +0 -510
  37. package/src/plugins/imageTool/types/codexteam__ajax.d.ts +0 -89
  38. package/src/plugins/imageTool/types/types.ts +0 -236
  39. package/src/plugins/imageTool/ui.ts +0 -313
  40. package/src/plugins/imageTool/uploader.ts +0 -287
  41. package/src/plugins/imageTool/utils/dom.ts +0 -24
  42. package/src/plugins/imageTool/utils/index.ts +0 -73
  43. package/src/plugins/imageTool/utils/isPromise.ts +0 -10
  44. package/src/plugins/indent/index.ts +0 -695
  45. package/src/plugins/inline-code/index.ts +0 -203
  46. package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +0 -208
  47. package/src/plugins/list/ListRenderer/ListRenderer.ts +0 -73
  48. package/src/plugins/list/ListRenderer/OrderedListRenderer.ts +0 -123
  49. package/src/plugins/list/ListRenderer/UnorderedListRenderer.ts +0 -123
  50. package/src/plugins/list/ListRenderer/index.ts +0 -6
  51. package/src/plugins/list/ListTabulator/index.ts +0 -1179
  52. package/src/plugins/list/index.ts +0 -488
  53. package/src/plugins/list/styles/CssPrefix.ts +0 -4
  54. package/src/plugins/list/types/Elements.ts +0 -14
  55. package/src/plugins/list/types/ItemMeta.ts +0 -40
  56. package/src/plugins/list/types/ListParams.ts +0 -102
  57. package/src/plugins/list/types/ListRenderer.ts +0 -6
  58. package/src/plugins/list/types/OlCounterType.ts +0 -63
  59. package/src/plugins/list/types/index.ts +0 -14
  60. package/src/plugins/list/utils/focusItem.ts +0 -18
  61. package/src/plugins/list/utils/getChildItems.ts +0 -40
  62. package/src/plugins/list/utils/getItemChildWrapper.ts +0 -10
  63. package/src/plugins/list/utils/getItemContentElement.ts +0 -10
  64. package/src/plugins/list/utils/getSiblings.ts +0 -52
  65. package/src/plugins/list/utils/isLastItem.ts +0 -9
  66. package/src/plugins/list/utils/itemHasSublist.ts +0 -10
  67. package/src/plugins/list/utils/normalizeData.ts +0 -83
  68. package/src/plugins/list/utils/removeChildWrapperIfEmpty.ts +0 -31
  69. package/src/plugins/list/utils/renderToolboxInput.ts +0 -113
  70. package/src/plugins/list/utils/stripNumbers.ts +0 -7
  71. package/src/plugins/list/utils/type-guards.ts +0 -8
  72. package/src/plugins/marker/index.ts +0 -199
  73. package/src/plugins/outline/index.ts +0 -62
  74. package/src/plugins/outline/outline.css +0 -52
  75. package/src/plugins/paragraph/index.ts +0 -384
  76. package/src/plugins/paragraph/types/icons.d.ts +0 -4
  77. package/src/plugins/paragraph/utils/makeFragment.ts +0 -17
  78. package/src/plugins/quote/index.ts +0 -203
  79. package/src/plugins/table/index.ts +0 -4
  80. package/src/plugins/table/plugin.ts +0 -255
  81. package/src/plugins/table/table.ts +0 -1202
  82. package/src/plugins/table/toolbox.ts +0 -166
  83. package/src/plugins/table/utils/dom.ts +0 -130
  84. package/src/plugins/table/utils/popover.ts +0 -185
  85. package/src/plugins/table/utils/throttled.ts +0 -22
  86. package/src/plugins/underline/index.ts +0 -214
  87. package/src/plugins/undo/index.ts +0 -526
  88. package/src/plugins/undo/observer.ts +0 -101
  89. package/src/plugins/undo/vanilla-caret-js.ts +0 -102
  90. package/src/style.css +0 -139
  91. package/src/types.ts +0 -3
  92. package/src/utils/AxiosService.ts +0 -87
  93. package/src/utils/index.ts +0 -15
  94. package/src/utils/install.ts +0 -19
  95. package/tsconfig.json +0 -37
  96. package/vite.config.ts +0 -81
@@ -1,132 +0,0 @@
1
- import { API } from '@ebl-vue/editorjs';
2
- import { IconColor } from "../../icons";
3
- import type {SanitizerConfig,InlineTool,InlineToolConstructorOptions} from "@ebl-vue/editorjs/types";
4
-
5
-
6
- import '@ebl-vue/editor-render/styles/color.css';
7
-
8
-
9
-
10
-
11
-
12
- export default class ColorPicker implements InlineTool {
13
- private api: API;
14
-
15
- tag = 'SPAN';
16
- class = 'cdx-text-color';
17
- defaultColor = '#2644FF';
18
-
19
- lastRange: Range | null = null;
20
-
21
- colors: string[] = [
22
- '#182a4e',
23
- '#0055cc',
24
- '#1f6a83',
25
- '#206e4e',
26
- '#e56910',
27
- '#ae2e24',
28
- '#5e4db2',
29
- '#758195',
30
- '#1e7afd',
31
- '#2998bd',
32
- '#23a06b',
33
- '#fea363',
34
- '#c9372c',
35
- '#8270db',
36
- ];
37
- columns = 7;
38
-
39
- static get title() {
40
- return 'Color';
41
- }
42
-
43
- static get isInline() {
44
- return true;
45
- }
46
-
47
- constructor(args:InlineToolConstructorOptions) {
48
- const { api, config } = args;
49
- this.api = api;
50
-
51
- if (config.colors) {
52
- this.colors = config.colors;
53
- }
54
- if (config.columns) {
55
- this.columns = config.columns;
56
- }
57
- }
58
-
59
- render() {
60
- const button = document.createElement('button');
61
-
62
- button.type = 'button';
63
- button.innerHTML = IconColor;
64
- button.classList.add(this.api.styles.inlineToolButton);
65
-
66
- button.addEventListener('mousedown', (e) => {
67
- // prevent text deselection when clicking the button
68
- e.preventDefault();
69
- });
70
-
71
- return button;
72
- }
73
-
74
- surround(range: Range | null) {
75
- this.lastRange = range;
76
- }
77
-
78
- wrapAndColor(range: Range | null, color: string) {
79
- if (!range) {
80
- return;
81
- }
82
- const selectedText = range.extractContents();
83
- const span = document.createElement(this.tag);
84
- span.classList.add(this.class);
85
- span.appendChild(selectedText);
86
- span.style.color = color;
87
- span.innerHTML = span.textContent || '';
88
- range.insertNode(span);
89
-
90
- this.api.selection.expandToTag(span);
91
- }
92
-
93
- renderActions() {
94
- const container = document.createElement('div');
95
- container.classList.add('editorjs__color-selector-container');
96
- container.style.gridTemplateColumns = `repeat(${this.columns}, 1fr)`;
97
-
98
- this.colors.forEach((colorValue) => {
99
- const color = document.createElement('div');
100
- color.classList.add('editorjs__color-selector__container-item');
101
- color.style.backgroundColor = colorValue;
102
- color.onclick = () => {
103
- this.wrapAndColor(this.lastRange, colorValue);
104
- };
105
- container.append(color);
106
- });
107
-
108
- return container;
109
- }
110
- static get CSS() :string{
111
- return ColorPicker.CSS;
112
- }
113
- /**
114
- * Sanitizer rules
115
- *
116
- * @returns {object}
117
- */
118
- static get sanitize(): SanitizerConfig {
119
- return {
120
- span: {
121
- style: true,
122
- class:true
123
- },
124
- } as SanitizerConfig;
125
- }
126
- }
127
-
128
- export class ColorPickerWithoutSanitize extends ColorPicker {
129
- // static override get sanitize() {
130
- // return undefined;
131
- // }
132
- }
@@ -1,121 +0,0 @@
1
- /**
2
- * Build styles
3
- */
4
- import '@ebl-vue/editor-render/styles/delimiter.css';
5
- import {API, BlockTool, BlockToolConstructorOptions, BlockToolData, ToolboxConfig, PasteConfig, PasteEvent} from "@ebl-vue/editorjs";
6
-
7
- import {IconDelimiter} from '../../icons';
8
-
9
-
10
-
11
-
12
- export default class Delimiter implements BlockTool {
13
-
14
- static get isReadOnlySupported(): boolean {
15
- return true;
16
- }
17
-
18
-
19
- static get contentless(): boolean {
20
- return true;
21
- }
22
-
23
- private api: API
24
-
25
- private _CSS: {
26
- block: string
27
- wrapper: string
28
- }
29
-
30
-
31
-
32
- private _element: HTMLDivElement
33
- private data: any;
34
-
35
-
36
- constructor({data, config, api}: BlockToolConstructorOptions) {
37
- this.api = api;
38
-
39
- this._CSS = {
40
- block: this.api.styles.block,
41
- wrapper: 'ce-delimiter'
42
- };
43
-
44
- this._element = this.drawView();
45
- this.data = data;
46
-
47
- }
48
-
49
- /**
50
- * Create Tool's view
51
- * @return {HTMLDivElement}
52
- * @private
53
- */
54
- drawView(): HTMLDivElement {
55
- let wrapper = document.createElement('div');
56
- let lineWrapper = document.createElement('div');
57
- let lineDiv = document.createElement('div');
58
-
59
- wrapper.classList.add(this._CSS.wrapper, this._CSS.block);
60
- lineWrapper.classList.add('ce-delimiter__line__wrapper');
61
- lineDiv.classList.add('ce-delimiter__line');
62
-
63
- lineWrapper.appendChild(lineDiv);
64
- wrapper.appendChild(lineWrapper);
65
-
66
- return wrapper;
67
- }
68
-
69
- /**
70
- * Return Tool's view
71
- * @returns {HTMLDivElement}
72
- * @public
73
- */
74
- render(): HTMLDivElement {
75
- console.log(this.data);
76
- return this._element;
77
- }
78
-
79
- /**
80
- * Extract Tool's data from the view
81
- * @param {HTMLDivElement} toolsContent - Paragraph tools rendered view
82
- * @returns {DelimiterData} - saved data
83
- * @public
84
- */
85
- save(toolsContent: HTMLElement): BlockToolData {
86
- return {};
87
- }
88
-
89
- /**
90
- * Get Tool toolbox settings
91
- * icon - Tool icon's SVG
92
- * title - title to show in toolbox
93
- *
94
- * @return {{icon: string, title: string}}
95
- */
96
- static get toolbox(): ToolboxConfig {
97
- return {
98
- icon: IconDelimiter,
99
- title: 'Delimiter'
100
- };
101
- }
102
-
103
- /**
104
- * Delimiter onPaste configuration
105
- *
106
- * @public
107
- */
108
- static get pasteConfig(): PasteConfig {
109
- return { tags: ['HR'] };
110
- }
111
-
112
- /**
113
- * On paste callback that is fired from Editor
114
- *
115
- * @param {PasteEvent} event - event with pasted data
116
- */
117
- onPaste(event: PasteEvent): void {
118
- this.data = {};
119
- }
120
- }
121
-
@@ -1,19 +0,0 @@
1
- .ce-block--drop-target .ce-block__content:before {
2
- content: "";
3
- position: absolute;
4
- top: 50%;
5
- left: -20px;
6
- margin-top: -1px;
7
- height: 8px;
8
- width: 8px;
9
- border: solid #a0a0a0;
10
- border-width: 1px 1px 0 0;
11
- -webkit-transform-origin: right;
12
- transform-origin: right;
13
- -webkit-transform: rotate(45deg);
14
- transform: rotate(45deg);
15
- }
16
-
17
- .ce-block--drop-target .ce-block__content:after {
18
- background: none;
19
- }
@@ -1,151 +0,0 @@
1
- import './index.css';
2
-
3
- import type EditorJS from '@ebl-vue/editorjs/types';
4
-
5
- export default class DragDrop {
6
- private toolbar: any;
7
- private borderStyle: string;
8
- private api: any;
9
- private holder: HTMLElement;
10
- private readOnly: boolean | undefined;
11
- private startBlock: number | null;
12
- private endBlock: number | null;
13
-
14
- constructor(
15
- holderId: string,
16
- readonly: boolean,
17
- editor: EditorJS,
18
- borderStyle: string) {
19
- const {
20
- blocks,
21
- toolbar,
22
- } = editor;
23
- this.toolbar = toolbar;
24
- this.borderStyle = borderStyle || '1px dashed #aaa';
25
- this.api = blocks;
26
- this.holder = document.getElementById(holderId) as HTMLElement;
27
- this.readOnly =readonly;
28
- this.startBlock = null;
29
- this.endBlock = null;
30
-
31
-
32
- this.setDragListener();
33
- this.setDropListener();
34
- }
35
-
36
-
37
- setElementCursor(element: HTMLElement|null) {
38
- if (!element) return;
39
- const range = document.createRange();
40
- const selection = window.getSelection();
41
-
42
- range.setStart(element.childNodes[0], 0);
43
- range.collapse(true);
44
- selection?.removeAllRanges();
45
- selection?.addRange(range);
46
- element.focus();
47
- }
48
-
49
-
50
- setDragListener() {
51
- if (!this.readOnly) {
52
- const settingsButton = this.holder?.querySelector<HTMLElement>('.ce-toolbar__settings-btn');
53
- if (settingsButton) {
54
- this.initializeDragListener(settingsButton);
55
- } else {
56
- const observer = new MutationObserver((mutations, obs) => {
57
- const settingsButton = this.holder?.querySelector<HTMLElement>(
58
- ".ce-toolbar__settings-btn"
59
- );
60
- if (settingsButton) {
61
- this.initializeDragListener(settingsButton);
62
- obs.disconnect();
63
- }
64
- });
65
-
66
- observer.observe(this.holder, {
67
- childList: true,
68
- subtree: true,
69
- });
70
- }
71
- }
72
- }
73
-
74
- initializeDragListener(settingsButton: HTMLElement) {
75
- settingsButton.setAttribute("draggable", "true");
76
- settingsButton.addEventListener("dragstart", () => {
77
- this.startBlock = this.api.getCurrentBlockIndex();
78
- });
79
- settingsButton.addEventListener('drag', () => {
80
- this.toolbar.close();
81
- if (!this.isTheOnlyBlock()) {
82
- const allBlocks = this.holder.querySelectorAll('.ce-block') as NodeListOf<HTMLElement>;
83
- const blockFocused = this.holder.querySelector<HTMLElement>('.ce-block--drop-target');
84
- this.setElementCursor(blockFocused);
85
- this.setBorderBlocks(allBlocks, blockFocused);
86
- }
87
- });
88
- }
89
-
90
-
91
-
92
- setBorderBlocks(allBlocks: NodeListOf<HTMLElement>, blockFocused: HTMLElement|null) {
93
- Object.values(allBlocks).forEach((block: HTMLElement) => {
94
- const blockContent = block.querySelector<HTMLElement>('.ce-block__content');
95
- if (block !== blockFocused) {
96
- blockContent?.style.removeProperty('border-top');
97
- blockContent?.style.removeProperty('border-bottom');
98
- } else {
99
- const index = Object.keys(allBlocks).find((key) => allBlocks[Number(key)] === blockFocused);
100
- if (index && Number(index) > this.startBlock!) blockContent!.style.borderBottom = this.borderStyle;
101
- else blockContent!.style.borderTop = this.borderStyle;
102
- }
103
- });
104
- }
105
-
106
-
107
- setDropListener() {
108
- document.addEventListener('drop', (event: DragEvent) => {
109
- const { target } = event;
110
- if (this.holder.contains(target as HTMLElement) && this.startBlock !== null) {
111
- const dropTarget = this.getDropTarget(target as HTMLElement);
112
- if (dropTarget) {
113
- const blockContent = dropTarget.querySelector<HTMLElement>('.ce-block__content');
114
- blockContent?.style.removeProperty('border-top');
115
- blockContent?.style.removeProperty('border-bottom');
116
- this.endBlock = this.getTargetPosition(dropTarget as HTMLElement);
117
- this.moveBlocks();
118
- }
119
- }
120
- this.startBlock = null;
121
- });
122
- }
123
-
124
-
125
- static get isReadOnlySupported() {
126
- return true;
127
- }
128
-
129
-
130
- getDropTarget(target: HTMLElement) {
131
- return target.classList.contains('ce-block')
132
- ? target
133
- : target.closest('.ce-block');
134
- }
135
-
136
-
137
- getTargetPosition(target: HTMLElement) {
138
- return Array.from(target.parentNode!.children).indexOf(target);
139
- }
140
-
141
- isTheOnlyBlock() {
142
- return this.api.getBlocksCount() === 1;
143
- }
144
-
145
-
146
- moveBlocks() {
147
- if (!this.isTheOnlyBlock()) {
148
- this.api.move(this.endBlock, this.startBlock);
149
- }
150
- }
151
- }
@@ -1 +0,0 @@
1
- # 拖拽块插件