@ebl-vue/editor-full 2.31.35 → 2.31.36

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 (97) hide show
  1. package/.postcssrc.yml +33 -0
  2. package/dist/index.d.ts +3 -7
  3. package/dist/index.mjs +183 -182
  4. package/dist/index.mjs.map +1 -0
  5. package/package.json +1 -1
  6. package/postcss.config.js +15 -0
  7. package/src/components/Editor/Editor.vue +293 -0
  8. package/src/components/index.ts +27 -0
  9. package/src/constants/index.ts +1 -0
  10. package/src/i18n/zh-cn.ts +160 -0
  11. package/src/icons/index.ts +93 -0
  12. package/src/index.ts +21 -0
  13. package/src/installer.ts +21 -0
  14. package/src/plugins/alert/index.ts +455 -0
  15. package/src/plugins/block-alignment/index.ts +117 -0
  16. package/src/plugins/block-alignment/readme.md +1 -0
  17. package/src/plugins/code/LICENSE +21 -0
  18. package/src/plugins/code/index.ts +619 -0
  19. package/src/plugins/code/utils/string.ts +34 -0
  20. package/src/plugins/color-picker/index.ts +132 -0
  21. package/src/plugins/delimiter/index.ts +121 -0
  22. package/src/plugins/drag-drop/index.css +19 -0
  23. package/src/plugins/drag-drop/index.ts +151 -0
  24. package/src/plugins/drag-drop/readme.md +1 -0
  25. package/src/plugins/header/H1.ts +404 -0
  26. package/src/plugins/header/H2.ts +403 -0
  27. package/src/plugins/header/H3.ts +404 -0
  28. package/src/plugins/header/H4.ts +404 -0
  29. package/src/plugins/header/H5.ts +403 -0
  30. package/src/plugins/header/H6.ts +404 -0
  31. package/src/plugins/header/index.ts +15 -0
  32. package/src/plugins/header/types.d.ts +46 -0
  33. package/src/plugins/imageResizeCrop/ImageTune.ts +635 -0
  34. package/src/plugins/imageResizeCrop/index.css +230 -0
  35. package/src/plugins/imageResizeCrop/index.ts +5 -0
  36. package/src/plugins/imageResizeCrop/types.d.ts +23 -0
  37. package/src/plugins/imageTool/index.ts +510 -0
  38. package/src/plugins/imageTool/types/codexteam__ajax.d.ts +89 -0
  39. package/src/plugins/imageTool/types/types.ts +236 -0
  40. package/src/plugins/imageTool/ui.ts +313 -0
  41. package/src/plugins/imageTool/uploader.ts +287 -0
  42. package/src/plugins/imageTool/utils/dom.ts +24 -0
  43. package/src/plugins/imageTool/utils/index.ts +73 -0
  44. package/src/plugins/imageTool/utils/isPromise.ts +10 -0
  45. package/src/plugins/indent/index.ts +695 -0
  46. package/src/plugins/inline-code/index.ts +203 -0
  47. package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +208 -0
  48. package/src/plugins/list/ListRenderer/ListRenderer.ts +73 -0
  49. package/src/plugins/list/ListRenderer/OrderedListRenderer.ts +123 -0
  50. package/src/plugins/list/ListRenderer/UnorderedListRenderer.ts +123 -0
  51. package/src/plugins/list/ListRenderer/index.ts +6 -0
  52. package/src/plugins/list/ListTabulator/index.ts +1179 -0
  53. package/src/plugins/list/index.ts +488 -0
  54. package/src/plugins/list/styles/CssPrefix.ts +4 -0
  55. package/src/plugins/list/types/Elements.ts +14 -0
  56. package/src/plugins/list/types/ItemMeta.ts +40 -0
  57. package/src/plugins/list/types/ListParams.ts +102 -0
  58. package/src/plugins/list/types/ListRenderer.ts +6 -0
  59. package/src/plugins/list/types/OlCounterType.ts +63 -0
  60. package/src/plugins/list/types/index.ts +14 -0
  61. package/src/plugins/list/utils/focusItem.ts +18 -0
  62. package/src/plugins/list/utils/getChildItems.ts +40 -0
  63. package/src/plugins/list/utils/getItemChildWrapper.ts +10 -0
  64. package/src/plugins/list/utils/getItemContentElement.ts +10 -0
  65. package/src/plugins/list/utils/getSiblings.ts +52 -0
  66. package/src/plugins/list/utils/isLastItem.ts +9 -0
  67. package/src/plugins/list/utils/itemHasSublist.ts +10 -0
  68. package/src/plugins/list/utils/normalizeData.ts +83 -0
  69. package/src/plugins/list/utils/removeChildWrapperIfEmpty.ts +31 -0
  70. package/src/plugins/list/utils/renderToolboxInput.ts +113 -0
  71. package/src/plugins/list/utils/stripNumbers.ts +7 -0
  72. package/src/plugins/list/utils/type-guards.ts +8 -0
  73. package/src/plugins/marker/index.ts +199 -0
  74. package/src/plugins/outline/index.ts +62 -0
  75. package/src/plugins/outline/outline.css +52 -0
  76. package/src/plugins/paragraph/index.ts +384 -0
  77. package/src/plugins/paragraph/types/icons.d.ts +4 -0
  78. package/src/plugins/paragraph/utils/makeFragment.ts +17 -0
  79. package/src/plugins/quote/index.ts +203 -0
  80. package/src/plugins/table/index.ts +4 -0
  81. package/src/plugins/table/plugin.ts +255 -0
  82. package/src/plugins/table/table.ts +1202 -0
  83. package/src/plugins/table/toolbox.ts +166 -0
  84. package/src/plugins/table/utils/dom.ts +130 -0
  85. package/src/plugins/table/utils/popover.ts +185 -0
  86. package/src/plugins/table/utils/throttled.ts +22 -0
  87. package/src/plugins/underline/index.ts +214 -0
  88. package/src/plugins/undo/index.ts +526 -0
  89. package/src/plugins/undo/observer.ts +101 -0
  90. package/src/plugins/undo/vanilla-caret-js.ts +102 -0
  91. package/src/style.css +139 -0
  92. package/src/types.ts +3 -0
  93. package/src/utils/AxiosService.ts +87 -0
  94. package/src/utils/index.ts +15 -0
  95. package/src/utils/install.ts +19 -0
  96. package/tsconfig.json +37 -0
  97. package/vite.config.ts +81 -0
@@ -0,0 +1,455 @@
1
+ /**
2
+ * Alert block for the Editor.js.
3
+ *
4
+ * @author Vishal Telangre
5
+ * @license MIT
6
+ */
7
+
8
+ /**
9
+ * Build styles
10
+ */
11
+ import "@ebl-vue/editor-render/styles/alert.css"
12
+ import type { API,BlockTool,BlockToolConstructorOptions } from "@ebl-vue/editorjs/types";
13
+ import type { HTMLPasteEvent } from '@ebl-vue/editorjs';
14
+ import { IconToolboxAlert as ToolboxIcon } from "../../icons";
15
+
16
+
17
+ /**
18
+ * @class Alert
19
+ * @classdesc Alert Tool for Editor.js
20
+ * @property {AlertData} data - Alert Tool`s input and output data
21
+ * @property {object} api - Editor.js API instance
22
+ *
23
+ * @typedef {object} AlertData
24
+ * @description Alert Tool`s input and output data
25
+ * @property {string} type - Alert type
26
+ * @property {string} alignType - Alert align type
27
+ * @property {string} message - Alert message
28
+ *
29
+ * @typedef {object} AlertConfig
30
+ * @description Alert Tool`s initial configuration
31
+ * @property {string} defaultType - default Alert type
32
+ * @property {string} defaultAlignType - default align Alert type
33
+ * @property {string} messagePlaceholder - placeholder to show in Alert`s message input
34
+ */
35
+ export default class Alert implements BlockTool{
36
+ /**
37
+ * Get Toolbox settings
38
+ *
39
+ * @public
40
+ * @returns {string}
41
+ */
42
+ static get toolbox() {
43
+ return {
44
+ icon: ToolboxIcon,
45
+ title: 'Alert',
46
+ };
47
+ }
48
+
49
+ /**
50
+ * Allow to press Enter inside the Alert block
51
+ * @public
52
+ * @returns {boolean}
53
+ */
54
+ static get enableLineBreaks() {
55
+ return true;
56
+ }
57
+
58
+ /**
59
+ * Default Alert type
60
+ *
61
+ * @public
62
+ * @returns {string}
63
+ */
64
+ static get DEFAULT_TYPE() {
65
+ return 'info';
66
+ }
67
+
68
+ /**
69
+ * Default Alert align type
70
+ *
71
+ * @public
72
+ * @returns {string}
73
+ */
74
+ static get DEFAULT_ALIGN_TYPE() {
75
+ return 'left';
76
+ }
77
+
78
+ /**
79
+ * Default placeholder for Alert message
80
+ *
81
+ * @public
82
+ * @returns {string}
83
+ */
84
+ static get DEFAULT_MESSAGE_PLACEHOLDER() {
85
+ return 'Type here...';
86
+ }
87
+
88
+ /**
89
+ * Supported Alert types
90
+ *
91
+ * @public
92
+ * @returns {array}
93
+ */
94
+ static get ALERT_TYPES() {
95
+ return [
96
+ 'primary',
97
+ 'secondary',
98
+ 'info',
99
+ 'success',
100
+ 'warning',
101
+ 'danger',
102
+ 'light',
103
+ 'dark',
104
+ ];
105
+ }
106
+
107
+ /**
108
+ * Supported Align types
109
+ *
110
+ * @public
111
+ * @returns {array}
112
+ */
113
+ static get ALIGN_TYPES() {
114
+ return ['left', 'center', 'right'];
115
+ }
116
+
117
+ /**
118
+ * Alert Tool`s styles
119
+ *
120
+ * @returns {Object}
121
+ */
122
+ get CSS() {
123
+ return {
124
+ wrapper: 'cdx-alert',
125
+ wrapperForType: (type:string) => `cdx-alert-${type}`,
126
+ wrapperForAlignType: (alignType:string) => `cdx-alert-align-${alignType}`,
127
+ message: 'cdx-alert__message',
128
+ };
129
+ }
130
+ private alertTypes: string[];
131
+ private defaultType: string;
132
+ private defaultAlign: string;
133
+ private messagePlaceholder: string;
134
+ private data: any;
135
+ private api: API;
136
+ private container: any;
137
+ private readOnly: boolean;
138
+
139
+ /**
140
+ * Render plugin`s main Element and fill it with saved data
141
+ *
142
+ * @param {AlertData} data — previously saved data
143
+ * @param {AlertConfig} config — user config for Tool
144
+ * @param {Object} api - Editor.js API
145
+ * @param {boolean} readOnly - read only mode flag
146
+ */
147
+ constructor({ data, config, api, readOnly }:BlockToolConstructorOptions) {
148
+ this.api = api;
149
+
150
+ this.alertTypes = config.alertTypes || Alert.ALERT_TYPES;
151
+ this.defaultType = config.defaultType || Alert.DEFAULT_TYPE;
152
+ this.defaultAlign = config.defaultAlign || Alert.DEFAULT_ALIGN_TYPE;
153
+ this.messagePlaceholder =
154
+ this.api.i18n.t(config.messagePlaceholder || Alert.DEFAULT_MESSAGE_PLACEHOLDER);
155
+
156
+ this.data = {
157
+ type: this.alertTypes.includes(data.type)
158
+ ? data.type
159
+ : this.defaultType,
160
+ align: Alert.ALIGN_TYPES.includes(data.align)
161
+ ? data.align
162
+ : this.defaultAlign,
163
+ message: data.message || '',
164
+ };
165
+
166
+ this.container = undefined;
167
+
168
+ this.readOnly = readOnly;
169
+ }
170
+
171
+ /**
172
+ * Returns true to notify the core that read-only mode is supported
173
+ *
174
+ * @return {boolean}
175
+ */
176
+ static get isReadOnlySupported() {
177
+ return true;
178
+ }
179
+
180
+ /**
181
+ * Create Alert Tool container
182
+ *
183
+ * @returns {Element}
184
+ */
185
+ render() {
186
+ const containerClasses = [
187
+ this.CSS.wrapper,
188
+ this.CSS.wrapperForType(this.data.type),
189
+ //this.CSS.wrapperForAlignType(this.data.align),
190
+ ];
191
+
192
+ this.container = this._make('div', containerClasses);
193
+
194
+ const messageEl = this._make('div', [this.CSS.message], {
195
+ contentEditable: !this.readOnly,
196
+ innerHTML: this.data.message,
197
+ });
198
+
199
+ messageEl.dataset.placeholder = this.messagePlaceholder;
200
+
201
+ this.container.appendChild(messageEl);
202
+
203
+ return this.container;
204
+ }
205
+ _getSettingIconStyle(type: string) {
206
+ let classname = "";
207
+ switch (type) {
208
+ case 'primary':
209
+ classname = "cdx-alert-primary";
210
+ break;
211
+ case 'secondary':
212
+ classname = "cdx-alert-secondary";
213
+ break;
214
+ case 'info':
215
+ classname = "cdx-alert-info";
216
+ break;
217
+ case 'success':
218
+ classname = "cdx-alert-success";
219
+ break;
220
+ case 'warning':
221
+ classname = "cdx-alert-warning";
222
+ break;
223
+ case 'danger':
224
+ classname = "cdx-alert-danger";
225
+ break;
226
+ case 'light':
227
+ classname = "cdx-alert-light";
228
+ break;
229
+ case 'dark':
230
+ classname = "cdx-alert-dark";
231
+ break;
232
+ }
233
+ const iconWrap = this._make('div', ['cdx-alert_setting__icon',classname], {});
234
+ return iconWrap;
235
+ }
236
+
237
+ /**
238
+ * Create Block's settings block
239
+ *
240
+ * @returns {array}
241
+ */
242
+ renderSettings() {
243
+ const wrapper = document.createElement('div');
244
+ const alertWrapper = document.createElement('div');
245
+ const alignWrapper= document.createElement('div');
246
+ alertWrapper.classList.add('cdx-alert_setting__icon_wrapper');
247
+ alignWrapper.classList.add('cdx-alert_setting__icon_wrapper');
248
+ alignWrapper.classList.add("cdx-alert_setting__icon_wrapper_align");
249
+
250
+ this.alertTypes.map((type) => {
251
+ let button = this._getSettingIconStyle(type);
252
+ button.setAttribute('data-type', type);
253
+
254
+ this.api.tooltip.onHover(button, this.api.i18n.t(`alert-${type}`), {
255
+ placement: 'top',
256
+ });
257
+ button.innerText = "A";
258
+ alertWrapper.appendChild(button);
259
+ return button;
260
+ }).forEach((button, index, buttons) => {
261
+ const type: string = button.getAttribute('data-type') || "";
262
+ button.addEventListener('click', () => {
263
+ this._changeAlertType(type);
264
+ buttons.forEach((el, index) => {
265
+ const elType= el.getAttribute('data-type');
266
+ el.classList.toggle("cdx-alert_setting__icon_active", elType === this.data.type);
267
+ });
268
+ });
269
+
270
+
271
+ });
272
+
273
+
274
+ // Alert.ALIGN_TYPES.map((align) => {
275
+ // let button;
276
+ // if (align === "left") {
277
+ // button = document.createElement("div");
278
+ // button.classList.add("cdx-alert_setting__icon");
279
+ // button.innerHTML = AlignLeftIcon;
280
+ // }
281
+ // if (align === "right") {
282
+ // button = document.createElement("div");
283
+ // button.classList.add("cdx-alert_setting__icon");
284
+ // button.innerHTML = AlignRightIcon;
285
+
286
+ // }
287
+ // if (align === "center") {
288
+ // button = document.createElement("div");
289
+ // button.classList.add("cdx-alert_setting__icon");
290
+ // button.innerHTML = AlignCenterIcon;
291
+
292
+
293
+ // }
294
+
295
+ // button?.setAttribute("data-align", align);
296
+ // this.api.tooltip.onHover(button!, this.api.i18n.t(`align-${align}`), {
297
+ // placement: 'top',
298
+ // });
299
+ // alignWrapper.appendChild(button!);
300
+ // return button;
301
+ // }).forEach((button, index, buttons) => {
302
+ // const align: string = button!.getAttribute('data-align') || "";
303
+ // button!.addEventListener('click', () => {
304
+ // this._changeAlignType(align);
305
+ // buttons.forEach((el, index) => {
306
+ // const elAlign = el?.getAttribute('data-align');
307
+ // el?.classList.toggle("cdx-alert_setting__icon_active", elAlign === this.data.align);
308
+ // });
309
+ // });
310
+ // });
311
+
312
+ wrapper.appendChild(alertWrapper);
313
+ wrapper.appendChild(alignWrapper);
314
+ return wrapper;
315
+ }
316
+
317
+ /**
318
+ * Helper for formatting Alert Type / Align Type
319
+ *
320
+ * @param {string} type - Alert type or Align type
321
+ * @returns {string}
322
+ */
323
+ _getFormattedName(name: string) {
324
+ return this.api.i18n.t(name.charAt(0).toUpperCase() + name.slice(1));
325
+ }
326
+
327
+ /**
328
+ * Helper for changing style of Alert block with the selected Alert type
329
+ *
330
+ * @param {string} newType - new Alert type to be applied to the block
331
+ * @private
332
+ */
333
+ _changeAlertType(newType: string) {
334
+ // Save new type
335
+ this.data.type = newType;
336
+
337
+ this.alertTypes.forEach((type) => {
338
+ const alertClass = this.CSS.wrapperForType(type);
339
+
340
+ // Remove the old Alert type class
341
+ this.container.classList.remove(alertClass);
342
+
343
+ if (newType === type) {
344
+ // Add an Alert class for the selected Alert type
345
+ this.container.classList.add(alertClass);
346
+ }
347
+ });
348
+ }
349
+
350
+ /**
351
+ * Helper for changing align of Alert block with the selected Align type
352
+ *
353
+ * @param {string} newAlign - new align type to be applied to the block
354
+ * @private
355
+ */
356
+ _changeAlignType(newAlign: string) {
357
+ // Save new type
358
+ this.data.align = newAlign;
359
+
360
+ Alert.ALIGN_TYPES.forEach((align) => {
361
+ const alignClass = this.CSS.wrapperForAlignType(align);
362
+
363
+ // Remove the old Alert type class
364
+ this.container.classList.remove(alignClass);
365
+
366
+ if (newAlign === align) {
367
+ // Add an Alert class for the selected Alert type
368
+ this.container.classList.add(alignClass);
369
+ }
370
+ });
371
+ }
372
+
373
+ /**
374
+ * Extract Alert data from Alert Tool element
375
+ *
376
+ * @param {HTMLDivElement} alertElement - element to save
377
+ * @returns {AlertData}
378
+ */
379
+ save(alertElement: HTMLElement) {
380
+ const messageEl = alertElement.querySelector(`.${this.CSS.message}`);
381
+
382
+ const data = { ...this.data, message: messageEl?.innerHTML || '' };
383
+ console.log('save', data);
384
+ return data;
385
+ }
386
+
387
+ /**
388
+ * Helper for making Elements with attributes
389
+ *
390
+ * @param {string} tagName - new Element tag name
391
+ * @param {array|string} classNames - list or name of CSS classname(s)
392
+ * @param {Object} attributes - any attributes
393
+ * @returns {Element}
394
+ * @private
395
+ */
396
+ _make(tagName:string, classNames:string[]|string|null, attributes:Record<string, any> = {}) {
397
+ let el: HTMLElement = document.createElement(tagName);
398
+
399
+ if (Array.isArray(classNames)) {
400
+ el.classList.add(...classNames);
401
+ } else if (classNames) {
402
+ el.classList.add(classNames);
403
+ }
404
+
405
+ for (let attrName in attributes) {
406
+ (el as any)[attrName] = attributes[attrName];
407
+ }
408
+
409
+ return el;
410
+ }
411
+
412
+ /**
413
+ * Fill Alert's message with the pasted content
414
+ *
415
+ * @param {PasteEvent} event - event with pasted content
416
+ */
417
+ onPaste(event:HTMLPasteEvent) {
418
+ const { data } = event.detail;
419
+
420
+ this.data = {
421
+ type: this.defaultType,
422
+ message: data.innerHTML || '',
423
+ };
424
+ }
425
+
426
+ /**
427
+ * Allow Alert to be converted to/from other blocks
428
+ */
429
+ static get conversionConfig() {
430
+ return {
431
+ // export Alert's message for other blocks
432
+ export: (data:any) => data.message,
433
+ // fill Alert's message from other block's export string
434
+ import: (string:string) => {
435
+ return {
436
+ message: string,
437
+ type: this.DEFAULT_TYPE,
438
+ alignType: this.DEFAULT_ALIGN_TYPE,
439
+ };
440
+ },
441
+ };
442
+ }
443
+
444
+ /**
445
+ * Sanitizer config for Alert Tool saved data
446
+ * @returns {Object}
447
+ */
448
+ static get sanitize() {
449
+ return {
450
+ message: true,
451
+ type: false,
452
+ alignType: false,
453
+ };
454
+ }
455
+ }
@@ -0,0 +1,117 @@
1
+ import "@ebl-vue/editor-render/styles/block-alignment.css"
2
+ import type { API, BlockTune, ToolConfig } from "@ebl-vue/editorjs/types";
3
+ import { IconAlignLeft,IconAlignCenter,IconAlignRight } from "../../icons";
4
+
5
+ interface ConstructorArgs {
6
+ data: AlignmentData;
7
+ config?: ToolConfig;
8
+ api: API;
9
+ block?: any;
10
+ }
11
+ export interface AlignmentData {
12
+ text?: string;
13
+ alignment: string
14
+ }
15
+
16
+ export default class BlockAlignment implements BlockTune{
17
+ private settings: ToolConfig;
18
+ private block: any;
19
+ private api: API;
20
+ private data: AlignmentData;
21
+ private alignmentSettings: any[];
22
+ private _CSS: any;
23
+ private wrapper: HTMLElement | undefined;
24
+
25
+
26
+ static get DEFAULT_ALIGNMENT() {
27
+ return 'left';
28
+ }
29
+
30
+ static get isTune() {
31
+ return true;
32
+ }
33
+
34
+ getAlignment() {
35
+ if (!!this.settings?.blocks && this.settings.blocks.hasOwnProperty(this.block.name)) {
36
+ return this.settings.blocks[this.block.name]
37
+ }
38
+ if (!!this.settings?.default) {
39
+ return this.settings.default
40
+ }
41
+ return BlockAlignment.DEFAULT_ALIGNMENT
42
+ }
43
+
44
+ constructor({ api, data, config, block }: ConstructorArgs) {
45
+ this.api = api;
46
+ this.block = block;
47
+
48
+ this.settings = config;
49
+ this.data = data || { alignment: this.getAlignment() }
50
+ this.alignmentSettings = [
51
+ {
52
+ name: 'left',
53
+ icon: IconAlignLeft
54
+ },
55
+ {
56
+ name: 'center',
57
+ icon: IconAlignCenter
58
+ },
59
+ {
60
+ name: 'right',
61
+ icon: IconAlignRight
62
+ }
63
+ ];
64
+ this._CSS = {
65
+ alignment: {
66
+ left: 'ce-tune-alignment--left',
67
+ center: 'ce-tune-alignment--center',
68
+ right: 'ce-tune-alignment--right',
69
+ }
70
+ }
71
+ }
72
+
73
+
74
+ wrap(blockContent: HTMLElement) {
75
+ this.wrapper = document.createElement("div");
76
+ this.wrapper!.classList.toggle(this._CSS.alignment[this.data.alignment])
77
+ this.wrapper!.append(blockContent)
78
+ return this.wrapper
79
+ }
80
+
81
+
82
+ render() {
83
+ const wrapper = document.createElement("div");
84
+ this.alignmentSettings.map(align => {
85
+ const button = document.createElement('button');
86
+ button.classList.add(this.api.styles.settingsButton);
87
+ button.innerHTML = align.icon;
88
+ button.type = 'button';
89
+
90
+ button.classList.toggle(this.api.styles.settingsButtonActive, align.name === this.data.alignment);
91
+ const buttonTooltip = this.api.i18n.t(align.name + " align");
92
+ this.api.tooltip.onHover(button, buttonTooltip, {
93
+ placement: 'top',
94
+ });
95
+ wrapper.appendChild(button);
96
+ return button
97
+ }).forEach((element, index, elements) => {
98
+ element.addEventListener('click', () => {
99
+ this.data = {
100
+ alignment: this.alignmentSettings[index].name
101
+ }
102
+ elements.forEach((el, i) => {
103
+ const { name } = this.alignmentSettings[i];
104
+ el.classList.toggle(this.api.styles.settingsButtonActive, name === this.data.alignment);
105
+ this.wrapper!.classList.toggle(this._CSS.alignment[name], name === this.data.alignment)
106
+ });
107
+ });
108
+ });
109
+ return wrapper;
110
+ }
111
+
112
+
113
+ save() {
114
+ return this.data;
115
+ }
116
+ }
117
+
@@ -0,0 +1 @@
1
+ # 通用的对齐插件
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 CodeX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.