@windwalker-io/unicorn-next 0.1.0 → 0.1.1

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 (135) hide show
  1. package/.editorconfig +18 -18
  2. package/.gulp.json +7 -7
  3. package/bin/release.mjs +47 -47
  4. package/dist/chunks/button-radio.js.map +1 -1
  5. package/dist/chunks/checkboxes-multi-select.js.map +1 -1
  6. package/dist/chunks/field-cascade-select.js.map +1 -1
  7. package/dist/chunks/field-file-drag.js.map +1 -1
  8. package/dist/chunks/field-flatpickr.js.map +1 -1
  9. package/dist/chunks/field-modal-select.js.map +1 -1
  10. package/dist/chunks/field-modal-tree.js +2 -2
  11. package/dist/chunks/field-modal-tree.js.map +1 -1
  12. package/dist/chunks/field-multi-uploader.js.map +1 -1
  13. package/dist/chunks/field-repeatable.js.map +1 -1
  14. package/dist/chunks/field-single-image-drag.js.map +1 -1
  15. package/dist/chunks/form.js +1 -1
  16. package/dist/chunks/form.js.map +1 -1
  17. package/dist/chunks/grid.js.map +1 -1
  18. package/dist/chunks/http-client.js.map +1 -1
  19. package/dist/chunks/iframe-modal.js.map +1 -1
  20. package/dist/chunks/keep-tab.js +1 -1
  21. package/dist/chunks/keep-tab.js.map +1 -1
  22. package/dist/chunks/legacy.js +3 -3
  23. package/dist/chunks/legacy.js.map +1 -1
  24. package/dist/chunks/list-dependent.js.map +1 -1
  25. package/dist/chunks/s3-multipart-uploader.js.map +1 -1
  26. package/dist/chunks/s3-uploader.js.map +1 -1
  27. package/dist/chunks/show-on.js.map +1 -1
  28. package/dist/chunks/tinymce.js +14 -4
  29. package/dist/chunks/tinymce.js.map +1 -1
  30. package/dist/chunks/ui-bootstrap5.js +9 -2
  31. package/dist/chunks/ui-bootstrap5.js.map +1 -1
  32. package/dist/chunks/unicorn.js +94 -46
  33. package/dist/chunks/unicorn.js.map +1 -1
  34. package/dist/chunks/validation.js.map +1 -1
  35. package/dist/editor.css +1 -1
  36. package/dist/index.d.ts +55 -36
  37. package/dist/multi-level-menu.css +1 -1
  38. package/dist/switcher.css +1 -1
  39. package/dist/unicorn.js +22 -22
  40. package/fusionfile.mjs +155 -155
  41. package/package.json +102 -102
  42. package/scss/bootstrap/multi-level-menu.scss +121 -121
  43. package/scss/editor.scss +116 -116
  44. package/scss/field/file-drag.scss +102 -102
  45. package/scss/field/single-image-drag.scss +88 -88
  46. package/scss/field/vue-drag-uploader.scss +160 -160
  47. package/scss/switcher.scss +156 -156
  48. package/src/app.ts +128 -128
  49. package/src/bootstrap/button-radio.ts +208 -208
  50. package/src/bootstrap/keep-tab.ts +155 -155
  51. package/src/composable/index.ts +21 -21
  52. package/src/composable/useCheckboxesMultiSelect.ts +22 -22
  53. package/src/composable/useFieldCascadeSelect.ts +9 -9
  54. package/src/composable/useFieldFileDrag.ts +9 -9
  55. package/src/composable/useFieldFlatpickr.ts +3 -3
  56. package/src/composable/useFieldModalSelect.ts +6 -6
  57. package/src/composable/useFieldModalTree.ts +3 -3
  58. package/src/composable/useFieldMultiUploader.ts +3 -3
  59. package/src/composable/useFieldRepeatable.ts +9 -9
  60. package/src/composable/useFieldSingleImageDrag.ts +5 -5
  61. package/src/composable/useForm.ts +43 -43
  62. package/src/composable/useGrid.ts +57 -57
  63. package/src/composable/useHttp.ts +9 -8
  64. package/src/composable/useIframeModal.ts +9 -9
  65. package/src/composable/useListDependent.ts +26 -26
  66. package/src/composable/useQueue.ts +13 -13
  67. package/src/composable/useS3Uploader.ts +32 -32
  68. package/src/composable/useShowOn.ts +9 -9
  69. package/src/composable/useStack.ts +13 -13
  70. package/src/composable/useTinymce.ts +29 -29
  71. package/src/composable/useTomSelect.ts +72 -72
  72. package/src/composable/useUIBootstrap5.ts +48 -48
  73. package/src/composable/useUniDirective.ts +32 -32
  74. package/src/composable/useValidation.ts +39 -39
  75. package/src/data.ts +34 -36
  76. package/src/events.ts +82 -73
  77. package/src/legacy/legacy.ts +186 -186
  78. package/src/legacy/loader.ts +125 -125
  79. package/src/module/checkboxes-multi-select.ts +54 -54
  80. package/src/module/field-cascade-select.ts +292 -292
  81. package/src/module/field-file-drag.ts +292 -292
  82. package/src/module/field-flatpickr.ts +127 -127
  83. package/src/module/field-modal-select.ts +174 -174
  84. package/src/module/field-modal-tree.ts +27 -27
  85. package/src/module/field-multi-uploader.ts +361 -361
  86. package/src/module/field-repeatable.ts +202 -202
  87. package/src/module/field-single-image-drag.ts +468 -468
  88. package/src/module/form.ts +223 -223
  89. package/src/module/grid.ts +465 -465
  90. package/src/module/http-client.ts +248 -243
  91. package/src/module/iframe-modal.ts +167 -167
  92. package/src/module/list-dependent.ts +321 -321
  93. package/src/module/s3-multipart-uploader.ts +300 -300
  94. package/src/module/s3-uploader.ts +234 -234
  95. package/src/module/show-on.ts +173 -173
  96. package/src/module/tinymce.ts +279 -263
  97. package/src/module/ui-bootstrap5.ts +116 -107
  98. package/src/module/validation.ts +1019 -1019
  99. package/src/plugin/index.ts +1 -1
  100. package/src/plugin/php-adapter.ts +65 -65
  101. package/src/polyfill/form-request-submit.ts +31 -31
  102. package/src/polyfill/index.ts +9 -9
  103. package/src/service/animate.ts +58 -58
  104. package/src/service/crypto.ts +27 -27
  105. package/src/service/dom-watcher.ts +62 -62
  106. package/src/service/dom.ts +265 -265
  107. package/src/service/helper.ts +48 -48
  108. package/src/service/index.ts +10 -10
  109. package/src/service/lang.ts +122 -122
  110. package/src/service/loader.ts +152 -152
  111. package/src/service/router.ts +118 -118
  112. package/src/service/ui.ts +525 -497
  113. package/src/service/uri.ts +106 -106
  114. package/src/types/base.ts +9 -9
  115. package/src/types/index.ts +4 -4
  116. package/src/types/modal-tree.ts +12 -12
  117. package/src/types/plugin.ts +6 -6
  118. package/src/types/shims.d.ts +18 -18
  119. package/src/types/ui.ts +6 -6
  120. package/src/unicorn.ts +79 -63
  121. package/src/utilities/arr.ts +25 -25
  122. package/src/utilities/base.ts +9 -9
  123. package/src/utilities/data.ts +48 -48
  124. package/src/utilities/index.ts +5 -5
  125. package/src/utilities/tree.ts +20 -20
  126. package/src/vue/components/ModalTree/ModalTreeApp.vue +175 -175
  127. package/src/vue/components/ModalTree/TreeItem.vue +262 -262
  128. package/src/vue/components/ModalTree/TreeModal.vue +225 -225
  129. package/tests/test.js +4 -4
  130. package/tsconfig.js.json +25 -25
  131. package/tsconfig.json +17 -17
  132. package/vite.assets.config.ts +61 -61
  133. package/vite.config.test.ts +36 -36
  134. package/vite.config.ts +112 -112
  135. package/dist/unicorn-next.css +0 -12
@@ -1,263 +1,279 @@
1
- import type { Editor, EditorOptions, TinyMCE } from 'tinymce';
2
- import { useHttpClient, useStack } from '../composable';
3
- import { useImport } from '../service';
4
- import { Dictionary, MaybePromise } from '../types';
5
- import { mergeDeep } from '../utilities';
6
-
7
- const instances: Dictionary<TinymceController> = {};
8
- let hooks: ((tinymce: TinyMCE) => MaybePromise<any>)[] = [];
9
-
10
- let imported = false;
11
-
12
- declare type UploadHandlerParams = Parameters<NonNullable<EditorOptions['images_upload_handler']>>;
13
-
14
- export async function get(
15
- selector: string,
16
- options: Record<string, any> = {}
17
- ): Promise<TinymceController> {
18
- const tinymce = await loadTinymce();
19
-
20
- return instances[selector] ??= new TinymceController(tinymce, document.querySelector(selector)!, options);
21
- }
22
-
23
- export function destroy(selector: string): void {
24
- delete instances[selector];
25
- }
26
-
27
- export function addHook(handler: ((tinymce: TinyMCE) => MaybePromise<any>)) {
28
- hooks.push(handler);
29
- }
30
-
31
- export function clearHooks() {
32
- hooks = [];
33
- }
34
-
35
- async function loadTinymce(): Promise<TinyMCE> {
36
- await useImport('@tinymce');
37
-
38
- if (imported) {
39
- return tinymce;
40
- }
41
- imported = true;
42
- for (const hook of hooks) {
43
- hook(tinymce);
44
- }
45
- await registerDragPlugin(tinymce);
46
- return tinymce;
47
- }
48
-
49
- const defaultOptions: Record<string, any> = {};
50
-
51
- export class TinymceController {
52
- editor?: Editor;
53
- options: Record<string, any> = {};
54
-
55
- constructor(protected tinymce: TinyMCE, public element: HTMLElement, options: Record<string, any>) {
56
- options.target = element;
57
-
58
- this.options = mergeDeep(
59
- {
60
- unicorn: {
61
- stack_name: 'uploading'
62
- }
63
- },
64
- defaultOptions,
65
- this.prepareOptions(options, tinymce.majorVersion),
66
- );
67
-
68
- tinymce.EditorManager.init(this.options).then((editor) => {
69
- this.editor = editor[0];
70
- });
71
- }
72
-
73
- prepareOptions(options: Record<string, any>, version = '6') {
74
- const defaults: Partial<EditorOptions> = {};
75
-
76
- if (options.images_upload_url) {
77
- defaults.paste_data_images = true;
78
- defaults.remove_script_host = false;
79
- defaults.relative_urls = false;
80
-
81
- if (Number(version) >= 6) {
82
- defaults.images_upload_handler = (blobInfo, progress) =>
83
- this.imageUploadHandler(blobInfo, progress);
84
- } else {
85
- options.plugins.push('paste');
86
-
87
- // @ts-ignore
88
- defaults.images_upload_handler = (blobInfo, success, failure, progress) =>
89
- this.imageUploadHandler(blobInfo, progress)
90
- .then((url) => {
91
- success(url);
92
- return url;
93
- })
94
- .catch((e) => {
95
- failure(e.message, { remove: true });
96
- throw e;
97
- });
98
- }
99
- }
100
-
101
- // defaults.file_picker_callback = (...args) => this.filePickerCallback(...args);
102
-
103
- defaults.plugins = defaults.plugins || [];
104
-
105
- defaults.setup = (editor) => {
106
- editor.on('change', () => {
107
- this.tinymce.triggerSave();
108
- });
109
- };
110
-
111
- options = mergeDeep({}, defaults, options);
112
-
113
- if (options.plugins.indexOf('unicorndragdrop') === -1) {
114
- options.plugins.push('unicorndragdrop');
115
- }
116
-
117
- return options;
118
- }
119
-
120
- insert(text: string) {
121
- this.editor?.insertContent(text);
122
- }
123
-
124
- getValue(): string {
125
- return this.editor?.getContent() ?? '';
126
- }
127
-
128
- setValue(text: string): void {
129
- this.editor?.setContent(text);
130
- }
131
-
132
- // filePickerCallback(callback, value, meta) {
133
- // const input = document.createElement('input');
134
- // input.setAttribute('type', 'file');
135
- // input.style.display = 'none';
136
- //
137
- // if (meta.filetype === 'image') {
138
- // input.setAttribute('accept', `image/\*`);
139
- // }
140
- //
141
- // document.body.appendChild(input);
142
- //
143
- // input.onchange = function () {
144
- // const file = this.files[0];
145
- //
146
- // const reader = new FileReader();
147
- // reader.onload = function () {
148
- // const id = 'blobid' + (new Date()).getTime();
149
- // const blobCache = tinymce.activeEditor.editorUpload.blobCache;
150
- // const base64 = reader.result.split(',')[1];
151
- // const blobInfo = blobCache.create(id, file, base64);
152
- // blobCache.add(blobInfo);
153
- //
154
- // /* call the callback and populate the Title field with the file name */
155
- // callback(blobInfo.blobUri(), { title: file.name, text: file.name });
156
- // };
157
- // reader.readAsDataURL(file);
158
- // input.remove();
159
- // };
160
- //
161
- // input.click();
162
- // }
163
-
164
- async imageUploadHandler(blobInfo: UploadHandlerParams[0], progress: UploadHandlerParams[1]) {
165
- const element = this.element;
166
-
167
- element.dispatchEvent(new CustomEvent('upload-start'));
168
-
169
- const formData = new FormData();
170
- formData.append('file', blobInfo.blob(), blobInfo.filename());
171
-
172
- const stack = useStack(this.options.unicorn.stack_name);
173
- stack.push(true);
174
-
175
- const { post, isAxiosError } = await useHttpClient();
176
-
177
- try {
178
- let res = await post(
179
- this.options.images_upload_url,
180
- formData,
181
- {
182
- withCredentials: false,
183
- onUploadProgress: (e) => {
184
- progress(e.loaded / e.total! * 100);
185
- }
186
- }
187
- );
188
- element.dispatchEvent(new CustomEvent('upload-success'));
189
-
190
- return res.data.data.url;
191
- } catch (err) {
192
- if (isAxiosError(err)) {
193
- const message = err?.response?.data?.message || err.message;
194
- console.error(err?.response?.data?.message || err.message, err);
195
- element.dispatchEvent(new CustomEvent('upload-error', { detail: err }));
196
-
197
- return Promise.reject({ message, remove: true });
198
- }
199
-
200
- throw err;
201
- } finally {
202
- element.dispatchEvent(new CustomEvent('upload-complete'));
203
- stack.pop();
204
- }
205
- }
206
- }
207
-
208
- function registerDragPlugin(tinymce: TinyMCE) {
209
- tinymce.PluginManager.add('unicorndragdrop', function (editor) {
210
- // Reset the drop area border
211
- tinymce.DOM.bind(document, 'dragleave', function (e) {
212
- e.stopPropagation();
213
- e.preventDefault();
214
-
215
- if (tinymce.activeEditor) {
216
- tinymce.activeEditor.contentAreaContainer.style.transition = 'all .3s';
217
- tinymce.activeEditor.contentAreaContainer.style.borderWidth = '';
218
- }
219
-
220
- return false;
221
- });
222
-
223
- if (typeof FormData !== 'undefined') {
224
-
225
- // Fix for Chrome
226
- editor.on('dragenter', e => {
227
- e.stopPropagation();
228
- return false;
229
- });
230
-
231
- // Notify user when file is over the drop area
232
- editor.on('dragover', e => {
233
- e.preventDefault();
234
-
235
- if (tinymce.activeEditor) {
236
- tinymce.activeEditor.contentAreaContainer.style.transition = 'all .3s';
237
- tinymce.activeEditor.contentAreaContainer.style.border = '3px dashed rgba(0, 0, 0, .35)';
238
- }
239
-
240
- return false;
241
- });
242
-
243
- editor.on('drop', e => {
244
- editor.contentAreaContainer.style.borderWidth = '';
245
- editor.contentAreaContainer.style.borderWidth = '';
246
- });
247
- }
248
- });
249
-
250
- return Promise.resolve();
251
- }
252
-
253
- export interface TinymceModule {
254
- get: typeof get;
255
- destroy: typeof destroy;
256
- addHook: typeof addHook;
257
- clearHooks: typeof clearHooks;
258
- TinymceController: typeof TinymceController;
259
- }
260
-
261
- declare global {
262
- var tinymce: TinyMCE;
263
- }
1
+ import type { Editor, EditorOptions, TinyMCE } from 'tinymce';
2
+ import { useHttpClient, useStack } from '../composable';
3
+ import { useImport, useScriptImport } from '../service';
4
+ import { Dictionary, MaybePromise } from '../types';
5
+ import { mergeDeep } from '../utilities';
6
+
7
+ const instances: Dictionary<TinymceController> = {};
8
+ let hooks: ((tinymce: TinyMCE) => MaybePromise<any>)[] = [];
9
+
10
+ let imported = false;
11
+
12
+ declare type UploadHandlerParams = Parameters<NonNullable<EditorOptions['images_upload_handler']>>;
13
+
14
+ export async function get(
15
+ selector: string,
16
+ options: Record<string, any> = {}
17
+ ): Promise<TinymceController> {
18
+ return instances[selector] ??= await create(document.querySelector<HTMLElement>(selector)!, options);
19
+ }
20
+
21
+ export async function create(
22
+ selector: string | HTMLElement,
23
+ options: Record<string, any> = {}
24
+ ): Promise<TinymceController> {
25
+ const tinymce = await loadTinymce();
26
+ let el: HTMLElement;
27
+
28
+ if (typeof selector === 'string') {
29
+ el = document.querySelector<HTMLElement>(selector)!;
30
+ } else {
31
+ el = selector;
32
+ }
33
+
34
+ return new TinymceController(tinymce, el, options);
35
+ }
36
+
37
+ export function destroy(selector: string): void {
38
+ delete instances[selector];
39
+ }
40
+
41
+ export function addHook(handler: ((tinymce: TinyMCE) => MaybePromise<any>)) {
42
+ hooks.push(handler);
43
+ }
44
+
45
+ export function clearHooks() {
46
+ hooks = [];
47
+ }
48
+
49
+ async function loadTinymce(): Promise<TinyMCE> {
50
+ if (imported) {
51
+ return tinymce;
52
+ }
53
+
54
+ await useScriptImport('@tinymce');
55
+
56
+ for (const hook of hooks) {
57
+ hook(tinymce);
58
+ }
59
+ await registerDragPlugin(tinymce);
60
+ imported = true;
61
+ return tinymce;
62
+ }
63
+
64
+ const defaultOptions: Record<string, any> = {};
65
+
66
+ export class TinymceController {
67
+ editor?: Editor;
68
+ options: Record<string, any> = {};
69
+
70
+ constructor(protected tinymce: TinyMCE, public element: HTMLElement, options: Record<string, any>) {
71
+ options.target = element;
72
+
73
+ this.options = mergeDeep(
74
+ {
75
+ unicorn: {
76
+ stack_name: 'uploading'
77
+ }
78
+ },
79
+ defaultOptions,
80
+ this.prepareOptions(options, tinymce.majorVersion),
81
+ );
82
+
83
+ tinymce.EditorManager.init(this.options).then((editor) => {
84
+ this.editor = editor[0];
85
+ });
86
+ }
87
+
88
+ prepareOptions(options: Record<string, any>, version = '6') {
89
+ const defaults: Partial<EditorOptions> = {};
90
+
91
+ if (options.images_upload_url) {
92
+ defaults.paste_data_images = true;
93
+ defaults.remove_script_host = false;
94
+ defaults.relative_urls = false;
95
+
96
+ if (Number(version) >= 6) {
97
+ defaults.images_upload_handler = (blobInfo, progress) =>
98
+ this.imageUploadHandler(blobInfo, progress);
99
+ } else {
100
+ options.plugins.push('paste');
101
+
102
+ // @ts-ignore
103
+ defaults.images_upload_handler = (blobInfo, success, failure, progress) =>
104
+ this.imageUploadHandler(blobInfo, progress)
105
+ .then((url) => {
106
+ success(url);
107
+ return url;
108
+ })
109
+ .catch((e) => {
110
+ failure(e.message, { remove: true });
111
+ throw e;
112
+ });
113
+ }
114
+ }
115
+
116
+ // defaults.file_picker_callback = (...args) => this.filePickerCallback(...args);
117
+
118
+ defaults.plugins = defaults.plugins || [];
119
+
120
+ defaults.setup = (editor) => {
121
+ editor.on('change', () => {
122
+ this.tinymce.triggerSave();
123
+ });
124
+ };
125
+
126
+ options = mergeDeep({}, defaults, options);
127
+
128
+ if (options.plugins.indexOf('unicorndragdrop') === -1) {
129
+ options.plugins.push('unicorndragdrop');
130
+ }
131
+
132
+ return options;
133
+ }
134
+
135
+ insert(text: string) {
136
+ this.editor?.insertContent(text);
137
+ }
138
+
139
+ getValue(): string {
140
+ return this.editor?.getContent() ?? '';
141
+ }
142
+
143
+ setValue(text: string): void {
144
+ this.editor?.setContent(text);
145
+ }
146
+
147
+ // filePickerCallback(callback, value, meta) {
148
+ // const input = document.createElement('input');
149
+ // input.setAttribute('type', 'file');
150
+ // input.style.display = 'none';
151
+ //
152
+ // if (meta.filetype === 'image') {
153
+ // input.setAttribute('accept', `image/\*`);
154
+ // }
155
+ //
156
+ // document.body.appendChild(input);
157
+ //
158
+ // input.onchange = function () {
159
+ // const file = this.files[0];
160
+ //
161
+ // const reader = new FileReader();
162
+ // reader.onload = function () {
163
+ // const id = 'blobid' + (new Date()).getTime();
164
+ // const blobCache = tinymce.activeEditor.editorUpload.blobCache;
165
+ // const base64 = reader.result.split(',')[1];
166
+ // const blobInfo = blobCache.create(id, file, base64);
167
+ // blobCache.add(blobInfo);
168
+ //
169
+ // /* call the callback and populate the Title field with the file name */
170
+ // callback(blobInfo.blobUri(), { title: file.name, text: file.name });
171
+ // };
172
+ // reader.readAsDataURL(file);
173
+ // input.remove();
174
+ // };
175
+ //
176
+ // input.click();
177
+ // }
178
+
179
+ async imageUploadHandler(blobInfo: UploadHandlerParams[0], progress: UploadHandlerParams[1]) {
180
+ const element = this.element;
181
+
182
+ element.dispatchEvent(new CustomEvent('upload-start'));
183
+
184
+ const formData = new FormData();
185
+ formData.append('file', blobInfo.blob(), blobInfo.filename());
186
+
187
+ const stack = useStack(this.options.unicorn.stack_name);
188
+ stack.push(true);
189
+
190
+ const { post, isAxiosError } = await useHttpClient();
191
+
192
+ try {
193
+ let res = await post(
194
+ this.options.images_upload_url,
195
+ formData,
196
+ {
197
+ withCredentials: false,
198
+ onUploadProgress: (e) => {
199
+ progress(e.loaded / e.total! * 100);
200
+ }
201
+ }
202
+ );
203
+ element.dispatchEvent(new CustomEvent('upload-success'));
204
+
205
+ return res.data.data.url;
206
+ } catch (err) {
207
+ if (isAxiosError(err)) {
208
+ const message = err?.response?.data?.message || err.message;
209
+ console.error(err?.response?.data?.message || err.message, err);
210
+ element.dispatchEvent(new CustomEvent('upload-error', { detail: err }));
211
+
212
+ return Promise.reject({ message, remove: true });
213
+ }
214
+
215
+ throw err;
216
+ } finally {
217
+ element.dispatchEvent(new CustomEvent('upload-complete'));
218
+ stack.pop();
219
+ }
220
+ }
221
+ }
222
+
223
+ function registerDragPlugin(tinymce: TinyMCE) {
224
+ tinymce.PluginManager.add('unicorndragdrop', function (editor) {
225
+ // Reset the drop area border
226
+ tinymce.DOM.bind(document, 'dragleave', function (e) {
227
+ e.stopPropagation();
228
+ e.preventDefault();
229
+
230
+ if (tinymce.activeEditor) {
231
+ tinymce.activeEditor.contentAreaContainer.style.transition = 'all .3s';
232
+ tinymce.activeEditor.contentAreaContainer.style.borderWidth = '';
233
+ }
234
+
235
+ return false;
236
+ });
237
+
238
+ if (typeof FormData !== 'undefined') {
239
+
240
+ // Fix for Chrome
241
+ editor.on('dragenter', e => {
242
+ e.stopPropagation();
243
+ return false;
244
+ });
245
+
246
+ // Notify user when file is over the drop area
247
+ editor.on('dragover', e => {
248
+ e.preventDefault();
249
+
250
+ if (tinymce.activeEditor) {
251
+ tinymce.activeEditor.contentAreaContainer.style.transition = 'all .3s';
252
+ tinymce.activeEditor.contentAreaContainer.style.border = '3px dashed rgba(0, 0, 0, .35)';
253
+ }
254
+
255
+ return false;
256
+ });
257
+
258
+ editor.on('drop', e => {
259
+ editor.contentAreaContainer.style.borderWidth = '';
260
+ editor.contentAreaContainer.style.borderWidth = '';
261
+ });
262
+ }
263
+ });
264
+
265
+ return Promise.resolve();
266
+ }
267
+
268
+ export interface TinymceModule {
269
+ get: typeof get;
270
+ create: typeof create;
271
+ destroy: typeof destroy;
272
+ addHook: typeof addHook;
273
+ clearHooks: typeof clearHooks;
274
+ TinymceController: typeof TinymceController;
275
+ }
276
+
277
+ declare global {
278
+ var tinymce: TinyMCE;
279
+ }