fx-platform-ui 0.0.13-alpha15 → 0.0.13-alpha16

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 (127) hide show
  1. package/lib/fx-platform-ui.mjs +21119 -19921
  2. package/lib/fx-platform-ui.umd.js +51 -51
  3. package/lib/packages/components/area/src/index.vue.d.ts +2 -2
  4. package/lib/packages/components/confirm/index.d.ts +2 -0
  5. package/lib/packages/components/confirm/src/confirm.vue.d.ts +2 -0
  6. package/lib/packages/components/confirm/src/index.d.ts +2 -0
  7. package/lib/style.css +1 -1
  8. package/package.json +1 -1
  9. package/packages/.DS_Store +0 -0
  10. package/packages/component.ts +3 -2
  11. package/packages/components/confirm/index.ts +9 -0
  12. package/packages/components/confirm/src/confirm.vue +75 -0
  13. package/packages/components/confirm/src/index.module.less +61 -0
  14. package/packages/components/confirm/src/index.tsx +91 -0
  15. package/packages/components/confirm/src/plat-confirm-props.ts +40 -0
  16. package/packages/components/editor/src/index.vue +1 -0
  17. package/packages/components/table/src/hook/useTableMethods.tsx +1 -1
  18. package/packages/components/table/src/plat-table-emits.ts +1 -1
  19. package/CHANGELOG.md +0 -46
  20. package/lib/tinymce/CHANGELOG.md +0 -2957
  21. package/lib/tinymce/README.md +0 -71
  22. package/lib/tinymce/bower.json +0 -27
  23. package/lib/tinymce/composer.json +0 -52
  24. package/lib/tinymce/icons/default/icons.js +0 -182
  25. package/lib/tinymce/icons/default/icons.min.js +0 -1
  26. package/lib/tinymce/icons/default/index.js +0 -7
  27. package/lib/tinymce/license.txt +0 -21
  28. package/lib/tinymce/models/dom/index.js +0 -7
  29. package/lib/tinymce/models/dom/model.js +0 -7975
  30. package/lib/tinymce/models/dom/model.min.js +0 -4
  31. package/lib/tinymce/package.json +0 -32
  32. package/lib/tinymce/plugins/advlist/index.js +0 -7
  33. package/lib/tinymce/plugins/advlist/plugin.js +0 -246
  34. package/lib/tinymce/plugins/advlist/plugin.min.js +0 -4
  35. package/lib/tinymce/plugins/anchor/index.js +0 -7
  36. package/lib/tinymce/plugins/anchor/plugin.js +0 -195
  37. package/lib/tinymce/plugins/anchor/plugin.min.js +0 -4
  38. package/lib/tinymce/plugins/autolink/index.js +0 -7
  39. package/lib/tinymce/plugins/autolink/plugin.js +0 -232
  40. package/lib/tinymce/plugins/autolink/plugin.min.js +0 -4
  41. package/lib/tinymce/plugins/autoresize/index.js +0 -7
  42. package/lib/tinymce/plugins/autoresize/plugin.js +0 -156
  43. package/lib/tinymce/plugins/autoresize/plugin.min.js +0 -4
  44. package/lib/tinymce/plugins/autosave/index.js +0 -7
  45. package/lib/tinymce/plugins/autosave/plugin.js +0 -232
  46. package/lib/tinymce/plugins/autosave/plugin.min.js +0 -4
  47. package/lib/tinymce/plugins/charmap/index.js +0 -7
  48. package/lib/tinymce/plugins/charmap/plugin.js +0 -1636
  49. package/lib/tinymce/plugins/charmap/plugin.min.js +0 -4
  50. package/lib/tinymce/plugins/code/index.js +0 -7
  51. package/lib/tinymce/plugins/code/plugin.js +0 -85
  52. package/lib/tinymce/plugins/code/plugin.min.js +0 -4
  53. package/lib/tinymce/plugins/codesample/index.js +0 -7
  54. package/lib/tinymce/plugins/codesample/plugin.js +0 -2451
  55. package/lib/tinymce/plugins/codesample/plugin.min.js +0 -4
  56. package/lib/tinymce/plugins/directionality/index.js +0 -7
  57. package/lib/tinymce/plugins/directionality/plugin.js +0 -384
  58. package/lib/tinymce/plugins/directionality/plugin.min.js +0 -4
  59. package/lib/tinymce/plugins/emoticons/index.js +0 -7
  60. package/lib/tinymce/plugins/emoticons/js/emojiimages.js +0 -1
  61. package/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +0 -3
  62. package/lib/tinymce/plugins/emoticons/js/emojis.js +0 -1
  63. package/lib/tinymce/plugins/emoticons/js/emojis.min.js +0 -2
  64. package/lib/tinymce/plugins/emoticons/plugin.js +0 -577
  65. package/lib/tinymce/plugins/emoticons/plugin.min.js +0 -4
  66. package/lib/tinymce/plugins/fullscreen/index.js +0 -7
  67. package/lib/tinymce/plugins/fullscreen/plugin.js +0 -1190
  68. package/lib/tinymce/plugins/fullscreen/plugin.min.js +0 -4
  69. package/lib/tinymce/plugins/help/index.js +0 -7
  70. package/lib/tinymce/plugins/help/plugin.js +0 -848
  71. package/lib/tinymce/plugins/help/plugin.min.js +0 -4
  72. package/lib/tinymce/plugins/image/index.js +0 -7
  73. package/lib/tinymce/plugins/image/plugin.js +0 -1475
  74. package/lib/tinymce/plugins/image/plugin.min.js +0 -4
  75. package/lib/tinymce/plugins/importcss/index.js +0 -7
  76. package/lib/tinymce/plugins/importcss/plugin.js +0 -342
  77. package/lib/tinymce/plugins/importcss/plugin.min.js +0 -4
  78. package/lib/tinymce/plugins/insertdatetime/index.js +0 -7
  79. package/lib/tinymce/plugins/insertdatetime/plugin.js +0 -176
  80. package/lib/tinymce/plugins/insertdatetime/plugin.min.js +0 -4
  81. package/lib/tinymce/plugins/link/index.js +0 -7
  82. package/lib/tinymce/plugins/link/plugin.js +0 -1190
  83. package/lib/tinymce/plugins/link/plugin.min.js +0 -4
  84. package/lib/tinymce/plugins/lists/index.js +0 -7
  85. package/lib/tinymce/plugins/lists/plugin.js +0 -1820
  86. package/lib/tinymce/plugins/lists/plugin.min.js +0 -4
  87. package/lib/tinymce/plugins/media/index.js +0 -7
  88. package/lib/tinymce/plugins/media/plugin.js +0 -1157
  89. package/lib/tinymce/plugins/media/plugin.min.js +0 -4
  90. package/lib/tinymce/plugins/nonbreaking/index.js +0 -7
  91. package/lib/tinymce/plugins/nonbreaking/plugin.js +0 -111
  92. package/lib/tinymce/plugins/nonbreaking/plugin.min.js +0 -4
  93. package/lib/tinymce/plugins/pagebreak/index.js +0 -7
  94. package/lib/tinymce/plugins/pagebreak/plugin.js +0 -105
  95. package/lib/tinymce/plugins/pagebreak/plugin.min.js +0 -4
  96. package/lib/tinymce/plugins/preview/index.js +0 -7
  97. package/lib/tinymce/plugins/preview/plugin.js +0 -97
  98. package/lib/tinymce/plugins/preview/plugin.min.js +0 -4
  99. package/lib/tinymce/plugins/quickbars/index.js +0 -7
  100. package/lib/tinymce/plugins/quickbars/plugin.js +0 -421
  101. package/lib/tinymce/plugins/quickbars/plugin.min.js +0 -4
  102. package/lib/tinymce/plugins/save/index.js +0 -7
  103. package/lib/tinymce/plugins/save/plugin.js +0 -118
  104. package/lib/tinymce/plugins/save/plugin.min.js +0 -4
  105. package/lib/tinymce/plugins/searchreplace/index.js +0 -7
  106. package/lib/tinymce/plugins/searchreplace/plugin.js +0 -1079
  107. package/lib/tinymce/plugins/searchreplace/plugin.min.js +0 -4
  108. package/lib/tinymce/plugins/table/index.js +0 -7
  109. package/lib/tinymce/plugins/table/plugin.js +0 -3393
  110. package/lib/tinymce/plugins/table/plugin.min.js +0 -4
  111. package/lib/tinymce/plugins/template/index.js +0 -7
  112. package/lib/tinymce/plugins/template/plugin.js +0 -548
  113. package/lib/tinymce/plugins/template/plugin.min.js +0 -4
  114. package/lib/tinymce/plugins/visualblocks/index.js +0 -7
  115. package/lib/tinymce/plugins/visualblocks/plugin.js +0 -98
  116. package/lib/tinymce/plugins/visualblocks/plugin.min.js +0 -4
  117. package/lib/tinymce/plugins/visualchars/index.js +0 -7
  118. package/lib/tinymce/plugins/visualchars/plugin.js +0 -506
  119. package/lib/tinymce/plugins/visualchars/plugin.min.js +0 -4
  120. package/lib/tinymce/plugins/wordcount/index.js +0 -7
  121. package/lib/tinymce/plugins/wordcount/plugin.js +0 -404
  122. package/lib/tinymce/plugins/wordcount/plugin.min.js +0 -4
  123. package/lib/tinymce/themes/silver/index.js +0 -7
  124. package/lib/tinymce/themes/silver/theme.js +0 -26184
  125. package/lib/tinymce/themes/silver/theme.min.js +0 -4
  126. package/lib/tinymce/tinymce.d.ts +0 -2895
  127. package/lib/tinymce/tinymce.js +0 -29400
@@ -1,548 +0,0 @@
1
- /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
3
- */
4
-
5
- (function () {
6
- 'use strict';
7
-
8
- var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
-
10
- const hasProto = (v, constructor, predicate) => {
11
- var _a;
12
- if (predicate(v, constructor.prototype)) {
13
- return true;
14
- } else {
15
- return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
16
- }
17
- };
18
- const typeOf = x => {
19
- const t = typeof x;
20
- if (x === null) {
21
- return 'null';
22
- } else if (t === 'object' && Array.isArray(x)) {
23
- return 'array';
24
- } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
25
- return 'string';
26
- } else {
27
- return t;
28
- }
29
- };
30
- const isType = type => value => typeOf(value) === type;
31
- const isSimpleType = type => value => typeof value === type;
32
- const isString = isType('string');
33
- const isObject = isType('object');
34
- const isArray = isType('array');
35
- const isNullable = a => a === null || a === undefined;
36
- const isNonNullable = a => !isNullable(a);
37
- const isFunction = isSimpleType('function');
38
- const isArrayOf = (value, pred) => {
39
- if (isArray(value)) {
40
- for (let i = 0, len = value.length; i < len; ++i) {
41
- if (!pred(value[i])) {
42
- return false;
43
- }
44
- }
45
- return true;
46
- }
47
- return false;
48
- };
49
-
50
- const constant = value => {
51
- return () => {
52
- return value;
53
- };
54
- };
55
- function curry(fn, ...initialArgs) {
56
- return (...restArgs) => {
57
- const all = initialArgs.concat(restArgs);
58
- return fn.apply(null, all);
59
- };
60
- }
61
- const never = constant(false);
62
-
63
- const escape = text => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
64
-
65
- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
66
-
67
- const option = name => editor => editor.options.get(name);
68
- const register$2 = editor => {
69
- const registerOption = editor.options.register;
70
- registerOption('template_cdate_classes', {
71
- processor: 'string',
72
- default: 'cdate'
73
- });
74
- registerOption('template_mdate_classes', {
75
- processor: 'string',
76
- default: 'mdate'
77
- });
78
- registerOption('template_selected_content_classes', {
79
- processor: 'string',
80
- default: 'selcontent'
81
- });
82
- registerOption('template_preview_replace_values', { processor: 'object' });
83
- registerOption('template_replace_values', { processor: 'object' });
84
- registerOption('templates', { processor: value => isString(value) || isArrayOf(value, isObject) || isFunction(value) });
85
- registerOption('template_cdate_format', {
86
- processor: 'string',
87
- default: editor.translate('%Y-%m-%d')
88
- });
89
- registerOption('template_mdate_format', {
90
- processor: 'string',
91
- default: editor.translate('%Y-%m-%d')
92
- });
93
- };
94
- const getCreationDateClasses = option('template_cdate_classes');
95
- const getModificationDateClasses = option('template_mdate_classes');
96
- const getSelectedContentClasses = option('template_selected_content_classes');
97
- const getPreviewReplaceValues = option('template_preview_replace_values');
98
- const getTemplateReplaceValues = option('template_replace_values');
99
- const getTemplates = option('templates');
100
- const getCdateFormat = option('template_cdate_format');
101
- const getMdateFormat = option('template_mdate_format');
102
- const getContentStyle = option('content_style');
103
- const shouldUseContentCssCors = option('content_css_cors');
104
- const getBodyClass = option('body_class');
105
-
106
- const addZeros = (value, len) => {
107
- value = '' + value;
108
- if (value.length < len) {
109
- for (let i = 0; i < len - value.length; i++) {
110
- value = '0' + value;
111
- }
112
- }
113
- return value;
114
- };
115
- const getDateTime = (editor, fmt, date = new Date()) => {
116
- const daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
117
- const daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
118
- const monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
119
- const monthsLong = 'January February March April May June July August September October November December'.split(' ');
120
- fmt = fmt.replace('%D', '%m/%d/%Y');
121
- fmt = fmt.replace('%r', '%I:%M:%S %p');
122
- fmt = fmt.replace('%Y', '' + date.getFullYear());
123
- fmt = fmt.replace('%y', '' + date.getYear());
124
- fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2));
125
- fmt = fmt.replace('%d', addZeros(date.getDate(), 2));
126
- fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2));
127
- fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2));
128
- fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2));
129
- fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1));
130
- fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM'));
131
- fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()]));
132
- fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()]));
133
- fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()]));
134
- fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()]));
135
- fmt = fmt.replace('%%', '%');
136
- return fmt;
137
- };
138
-
139
- class Optional {
140
- constructor(tag, value) {
141
- this.tag = tag;
142
- this.value = value;
143
- }
144
- static some(value) {
145
- return new Optional(true, value);
146
- }
147
- static none() {
148
- return Optional.singletonNone;
149
- }
150
- fold(onNone, onSome) {
151
- if (this.tag) {
152
- return onSome(this.value);
153
- } else {
154
- return onNone();
155
- }
156
- }
157
- isSome() {
158
- return this.tag;
159
- }
160
- isNone() {
161
- return !this.tag;
162
- }
163
- map(mapper) {
164
- if (this.tag) {
165
- return Optional.some(mapper(this.value));
166
- } else {
167
- return Optional.none();
168
- }
169
- }
170
- bind(binder) {
171
- if (this.tag) {
172
- return binder(this.value);
173
- } else {
174
- return Optional.none();
175
- }
176
- }
177
- exists(predicate) {
178
- return this.tag && predicate(this.value);
179
- }
180
- forall(predicate) {
181
- return !this.tag || predicate(this.value);
182
- }
183
- filter(predicate) {
184
- if (!this.tag || predicate(this.value)) {
185
- return this;
186
- } else {
187
- return Optional.none();
188
- }
189
- }
190
- getOr(replacement) {
191
- return this.tag ? this.value : replacement;
192
- }
193
- or(replacement) {
194
- return this.tag ? this : replacement;
195
- }
196
- getOrThunk(thunk) {
197
- return this.tag ? this.value : thunk();
198
- }
199
- orThunk(thunk) {
200
- return this.tag ? this : thunk();
201
- }
202
- getOrDie(message) {
203
- if (!this.tag) {
204
- throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
205
- } else {
206
- return this.value;
207
- }
208
- }
209
- static from(value) {
210
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
211
- }
212
- getOrNull() {
213
- return this.tag ? this.value : null;
214
- }
215
- getOrUndefined() {
216
- return this.value;
217
- }
218
- each(worker) {
219
- if (this.tag) {
220
- worker(this.value);
221
- }
222
- }
223
- toArray() {
224
- return this.tag ? [this.value] : [];
225
- }
226
- toString() {
227
- return this.tag ? `some(${ this.value })` : 'none()';
228
- }
229
- }
230
- Optional.singletonNone = new Optional(false);
231
-
232
- const exists = (xs, pred) => {
233
- for (let i = 0, len = xs.length; i < len; i++) {
234
- const x = xs[i];
235
- if (pred(x, i)) {
236
- return true;
237
- }
238
- }
239
- return false;
240
- };
241
- const map = (xs, f) => {
242
- const len = xs.length;
243
- const r = new Array(len);
244
- for (let i = 0; i < len; i++) {
245
- const x = xs[i];
246
- r[i] = f(x, i);
247
- }
248
- return r;
249
- };
250
- const findUntil = (xs, pred, until) => {
251
- for (let i = 0, len = xs.length; i < len; i++) {
252
- const x = xs[i];
253
- if (pred(x, i)) {
254
- return Optional.some(x);
255
- } else if (until(x, i)) {
256
- break;
257
- }
258
- }
259
- return Optional.none();
260
- };
261
- const find = (xs, pred) => {
262
- return findUntil(xs, pred, never);
263
- };
264
-
265
- const hasOwnProperty = Object.hasOwnProperty;
266
- const get = (obj, key) => {
267
- return has(obj, key) ? Optional.from(obj[key]) : Optional.none();
268
- };
269
- const has = (obj, key) => hasOwnProperty.call(obj, key);
270
-
271
- const entitiesAttr = {
272
- '"': '&quot;',
273
- '<': '&lt;',
274
- '>': '&gt;',
275
- '&': '&amp;',
276
- '\'': '&#039;'
277
- };
278
- const htmlEscape = html => html.replace(/["'<>&]/g, match => get(entitiesAttr, match).getOr(match));
279
- const hasAnyClasses = (dom, n, classes) => exists(classes.split(/\s+/), c => dom.hasClass(n, c));
280
-
281
- const createTemplateList = (editor, callback) => {
282
- return () => {
283
- const templateList = getTemplates(editor);
284
- if (isFunction(templateList)) {
285
- templateList(callback);
286
- } else if (isString(templateList)) {
287
- fetch(templateList).then(res => {
288
- if (res.ok) {
289
- res.json().then(callback);
290
- }
291
- });
292
- } else {
293
- callback(templateList);
294
- }
295
- };
296
- };
297
- const replaceTemplateValues = (html, templateValues) => {
298
- global$1.each(templateValues, (v, k) => {
299
- if (isFunction(v)) {
300
- v = v(k);
301
- }
302
- html = html.replace(new RegExp('\\{\\$' + escape(k) + '\\}', 'g'), v);
303
- });
304
- return html;
305
- };
306
- const replaceVals = (editor, scope) => {
307
- const dom = editor.dom, vl = getTemplateReplaceValues(editor);
308
- global$1.each(dom.select('*', scope), e => {
309
- global$1.each(vl, (v, k) => {
310
- if (dom.hasClass(e, k)) {
311
- if (isFunction(v)) {
312
- v(e);
313
- }
314
- }
315
- });
316
- });
317
- };
318
- const insertTemplate = (editor, _ui, html) => {
319
- const dom = editor.dom;
320
- const sel = editor.selection.getContent();
321
- html = replaceTemplateValues(html, getTemplateReplaceValues(editor));
322
- let el = dom.create('div', null, html);
323
- const n = dom.select('.mceTmpl', el);
324
- if (n && n.length > 0) {
325
- el = dom.create('div', null);
326
- el.appendChild(n[0].cloneNode(true));
327
- }
328
- global$1.each(dom.select('*', el), n => {
329
- if (hasAnyClasses(dom, n, getCreationDateClasses(editor))) {
330
- n.innerHTML = getDateTime(editor, getCdateFormat(editor));
331
- }
332
- if (hasAnyClasses(dom, n, getModificationDateClasses(editor))) {
333
- n.innerHTML = getDateTime(editor, getMdateFormat(editor));
334
- }
335
- if (hasAnyClasses(dom, n, getSelectedContentClasses(editor))) {
336
- n.innerHTML = sel;
337
- }
338
- });
339
- replaceVals(editor, el);
340
- editor.execCommand('mceInsertContent', false, el.innerHTML);
341
- editor.addVisual();
342
- };
343
-
344
- var global = tinymce.util.Tools.resolve('tinymce.Env');
345
-
346
- const getPreviewContent = (editor, html) => {
347
- var _a;
348
- if (html.indexOf('<html>') === -1) {
349
- let contentCssEntries = '';
350
- const contentStyle = (_a = getContentStyle(editor)) !== null && _a !== void 0 ? _a : '';
351
- const cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
352
- global$1.each(editor.contentCSS, url => {
353
- contentCssEntries += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '"' + cors + '>';
354
- });
355
- if (contentStyle) {
356
- contentCssEntries += '<style type="text/css">' + contentStyle + '</style>';
357
- }
358
- const bodyClass = getBodyClass(editor);
359
- const encode = editor.dom.encode;
360
- const isMetaKeyPressed = global.os.isMacOS() || global.os.isiOS() ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
361
- const preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
362
- const directionality = editor.getBody().dir;
363
- const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
364
- html = '<!DOCTYPE html>' + '<html>' + '<head>' + '<base href="' + encode(editor.documentBaseURI.getURI()) + '">' + contentCssEntries + preventClicksOnLinksScript + '</head>' + '<body class="' + encode(bodyClass) + '"' + dirAttr + '>' + html + '</body>' + '</html>';
365
- }
366
- return replaceTemplateValues(html, getPreviewReplaceValues(editor));
367
- };
368
- const open = (editor, templateList) => {
369
- const createTemplates = () => {
370
- if (!templateList || templateList.length === 0) {
371
- const message = editor.translate('No templates defined.');
372
- editor.notificationManager.open({
373
- text: message,
374
- type: 'info'
375
- });
376
- return Optional.none();
377
- }
378
- return Optional.from(global$1.map(templateList, (template, index) => {
379
- const isUrlTemplate = t => t.url !== undefined;
380
- return {
381
- selected: index === 0,
382
- text: template.title,
383
- value: {
384
- url: isUrlTemplate(template) ? Optional.from(template.url) : Optional.none(),
385
- content: !isUrlTemplate(template) ? Optional.from(template.content) : Optional.none(),
386
- description: template.description
387
- }
388
- };
389
- }));
390
- };
391
- const createSelectBoxItems = templates => map(templates, t => ({
392
- text: t.text,
393
- value: t.text
394
- }));
395
- const findTemplate = (templates, templateTitle) => find(templates, t => t.text === templateTitle);
396
- const loadFailedAlert = api => {
397
- editor.windowManager.alert('Could not load the specified template.', () => api.focus('template'));
398
- };
399
- const getTemplateContent = t => t.value.url.fold(() => Promise.resolve(t.value.content.getOr('')), url => fetch(url).then(res => res.ok ? res.text() : Promise.reject()));
400
- const onChange = (templates, updateDialog) => (api, change) => {
401
- if (change.name === 'template') {
402
- const newTemplateTitle = api.getData().template;
403
- findTemplate(templates, newTemplateTitle).each(t => {
404
- api.block('Loading...');
405
- getTemplateContent(t).then(previewHtml => {
406
- updateDialog(api, t, previewHtml);
407
- }).catch(() => {
408
- updateDialog(api, t, '');
409
- api.setEnabled('save', false);
410
- loadFailedAlert(api);
411
- });
412
- });
413
- }
414
- };
415
- const onSubmit = templates => api => {
416
- const data = api.getData();
417
- findTemplate(templates, data.template).each(t => {
418
- getTemplateContent(t).then(previewHtml => {
419
- editor.execCommand('mceInsertTemplate', false, previewHtml);
420
- api.close();
421
- }).catch(() => {
422
- api.setEnabled('save', false);
423
- loadFailedAlert(api);
424
- });
425
- });
426
- };
427
- const openDialog = templates => {
428
- const selectBoxItems = createSelectBoxItems(templates);
429
- const buildDialogSpec = (bodyItems, initialData) => ({
430
- title: 'Insert Template',
431
- size: 'large',
432
- body: {
433
- type: 'panel',
434
- items: bodyItems
435
- },
436
- initialData,
437
- buttons: [
438
- {
439
- type: 'cancel',
440
- name: 'cancel',
441
- text: 'Cancel'
442
- },
443
- {
444
- type: 'submit',
445
- name: 'save',
446
- text: 'Save',
447
- primary: true
448
- }
449
- ],
450
- onSubmit: onSubmit(templates),
451
- onChange: onChange(templates, updateDialog)
452
- });
453
- const updateDialog = (dialogApi, template, previewHtml) => {
454
- const content = getPreviewContent(editor, previewHtml);
455
- const bodyItems = [
456
- {
457
- type: 'selectbox',
458
- name: 'template',
459
- label: 'Templates',
460
- items: selectBoxItems
461
- },
462
- {
463
- type: 'htmlpanel',
464
- html: `<p aria-live="polite">${ htmlEscape(template.value.description) }</p>`
465
- },
466
- {
467
- label: 'Preview',
468
- type: 'iframe',
469
- name: 'preview',
470
- sandboxed: false,
471
- transparent: false
472
- }
473
- ];
474
- const initialData = {
475
- template: template.text,
476
- preview: content
477
- };
478
- dialogApi.unblock();
479
- dialogApi.redial(buildDialogSpec(bodyItems, initialData));
480
- dialogApi.focus('template');
481
- };
482
- const dialogApi = editor.windowManager.open(buildDialogSpec([], {
483
- template: '',
484
- preview: ''
485
- }));
486
- dialogApi.block('Loading...');
487
- getTemplateContent(templates[0]).then(previewHtml => {
488
- updateDialog(dialogApi, templates[0], previewHtml);
489
- }).catch(() => {
490
- updateDialog(dialogApi, templates[0], '');
491
- dialogApi.setEnabled('save', false);
492
- loadFailedAlert(dialogApi);
493
- });
494
- };
495
- const optTemplates = createTemplates();
496
- optTemplates.each(openDialog);
497
- };
498
-
499
- const showDialog = editor => templates => {
500
- open(editor, templates);
501
- };
502
- const register$1 = editor => {
503
- editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor));
504
- editor.addCommand('mceTemplate', createTemplateList(editor, showDialog(editor)));
505
- };
506
-
507
- const setup = editor => {
508
- editor.on('PreProcess', o => {
509
- const dom = editor.dom, dateFormat = getMdateFormat(editor);
510
- global$1.each(dom.select('div', o.node), e => {
511
- if (dom.hasClass(e, 'mceTmpl')) {
512
- global$1.each(dom.select('*', e), e => {
513
- if (hasAnyClasses(dom, e, getModificationDateClasses(editor))) {
514
- e.innerHTML = getDateTime(editor, dateFormat);
515
- }
516
- });
517
- replaceVals(editor, e);
518
- }
519
- });
520
- });
521
- };
522
-
523
- const register = editor => {
524
- const onAction = () => editor.execCommand('mceTemplate');
525
- editor.ui.registry.addButton('template', {
526
- icon: 'template',
527
- tooltip: 'Insert template',
528
- onAction
529
- });
530
- editor.ui.registry.addMenuItem('template', {
531
- icon: 'template',
532
- text: 'Insert template...',
533
- onAction
534
- });
535
- };
536
-
537
- var Plugin = () => {
538
- global$2.add('template', editor => {
539
- register$2(editor);
540
- register(editor);
541
- register$1(editor);
542
- setup(editor);
543
- });
544
- };
545
-
546
- Plugin();
547
-
548
- })();
@@ -1,4 +0,0 @@
1
- /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
3
- */
4
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(a=n=e,(r=String).prototype.isPrototypeOf(a)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var a,n,r,s})(t)===e,a=t("string"),n=t("object"),r=t("array"),s=("function",e=>"function"==typeof e);const l=(!1,()=>false);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=e=>t=>t.options.get(e),i=c("template_cdate_classes"),u=c("template_mdate_classes"),m=c("template_selected_content_classes"),p=c("template_preview_replace_values"),d=c("template_replace_values"),h=c("templates"),g=c("template_cdate_format"),v=c("template_mdate_format"),f=c("content_style"),y=c("content_css_cors"),_=c("body_class"),b=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},M=(e,t,a=new Date)=>{const n="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" ");return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",b(a.getMonth()+1,2))).replace("%d",b(a.getDate(),2))).replace("%H",""+b(a.getHours(),2))).replace("%M",""+b(a.getMinutes(),2))).replace("%S",""+b(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(l[a.getMonth()]))).replace("%b",""+e.translate(s[a.getMonth()]))).replace("%A",""+e.translate(r[a.getDay()]))).replace("%a",""+e.translate(n[a.getDay()]))).replace("%%","%")};class T{constructor(e,t){this.tag=e,this.value=t}static some(e){return new T(!0,e)}static none(){return T.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?T.some(e(this.value)):T.none()}bind(e){return this.tag?e(this.value):T.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:T.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?T.none():T.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}T.singletonNone=new T(!1);const x=Object.hasOwnProperty,S={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"},w=e=>e.replace(/["'<>&]/g,(e=>{return(t=S,a=e,((e,t)=>x.call(e,t))(t,a)?T.from(t[a]):T.none()).getOr(e);var t,a})),C=(e,t,a)=>((a,n)=>{for(let n=0,s=a.length;n<s;n++)if(r=a[n],e.hasClass(t,r))return!0;var r;return!1})(a.split(/\s+/)),O=(e,t)=>(o.each(t,((t,a)=>{s(t)&&(t=t(a)),e=e.replace(new RegExp("\\{\\$"+a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\}","g"),t)})),e),A=(e,t)=>{const a=e.dom,n=d(e);o.each(a.select("*",t),(e=>{o.each(n,((t,n)=>{a.hasClass(e,n)&&s(t)&&t(e)}))}))},D=(e,t,a)=>{const n=e.dom,r=e.selection.getContent();a=O(a,d(e));let s=n.create("div",null,a);const l=n.select(".mceTmpl",s);l&&l.length>0&&(s=n.create("div",null),s.appendChild(l[0].cloneNode(!0))),o.each(n.select("*",s),(t=>{C(n,t,i(e))&&(t.innerHTML=M(e,g(e))),C(n,t,u(e))&&(t.innerHTML=M(e,v(e))),C(n,t,m(e))&&(t.innerHTML=r)})),A(e,s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()};var I=tinymce.util.Tools.resolve("tinymce.Env");const N=(e,t)=>{const a=(e,t)=>((e,t,a)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return T.some(r);if(a(r,n))break}return T.none()})(e,(e=>e.text===t),l),n=t=>{e.windowManager.alert("Could not load the specified template.",(()=>t.focus("template")))},r=e=>e.value.url.fold((()=>Promise.resolve(e.value.content.getOr(""))),(e=>fetch(e).then((e=>e.ok?e.text():Promise.reject())))),s=(e,t)=>(s,l)=>{if("template"===l.name){const l=s.getData().template;a(e,l).each((e=>{s.block("Loading..."),r(e).then((a=>{t(s,e,a)})).catch((()=>{t(s,e,""),s.setEnabled("save",!1),n(s)}))}))}},c=t=>s=>{const l=s.getData();a(t,l.template).each((t=>{r(t).then((t=>{e.execCommand("mceInsertTemplate",!1,t),s.close()})).catch((()=>{s.setEnabled("save",!1),n(s)}))}))};(()=>{if(!t||0===t.length){const t=e.translate("No templates defined.");return e.notificationManager.open({text:t,type:"info"}),T.none()}return T.from(o.map(t,((e,t)=>{const a=e=>void 0!==e.url;return{selected:0===t,text:e.title,value:{url:a(e)?T.from(e.url):T.none(),content:a(e)?T.none():T.from(e.content),description:e.description}}})))})().each((t=>{const a=(e=>((e,t)=>{const a=e.length,n=new Array(a);for(let t=0;t<a;t++){const a=e[t];n[t]={text:(r=a).text,value:r.text}}var r;return n})(e))(t),l=(e,a)=>({title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:c(t),onChange:s(t,i)}),i=(t,n,r)=>{const s=((e,t)=>{var a;if(-1===t.indexOf("<html>")){let n="";const r=null!==(a=f(e))&&void 0!==a?a:"",s=y(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{n+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'"'+s+">"})),r&&(n+='<style type="text/css">'+r+"</style>");const l=_(e),c=e.dom.encode,i='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(I.os.isMacOS()||I.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",u=e.getBody().dir,m=u?' dir="'+c(u)+'"':"";t='<!DOCTYPE html><html><head><base href="'+c(e.documentBaseURI.getURI())+'">'+n+i+'</head><body class="'+c(l)+'"'+m+">"+t+"</body></html>"}return O(t,p(e))})(e,r),c=[{type:"selectbox",name:"template",label:"Templates",items:a},{type:"htmlpanel",html:`<p aria-live="polite">${w(n.value.description)}</p>`},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1,transparent:!1}],i={template:n.text,preview:s};t.unblock(),t.redial(l(c,i)),t.focus("template")},u=e.windowManager.open(l([],{template:"",preview:""}));u.block("Loading..."),r(t[0]).then((e=>{i(u,t[0],e)})).catch((()=>{i(u,t[0],""),u.setEnabled("save",!1),n(u)}))}))};e.add("template",(e=>{(e=>{const t=e.options.register;t("template_cdate_classes",{processor:"string",default:"cdate"}),t("template_mdate_classes",{processor:"string",default:"mdate"}),t("template_selected_content_classes",{processor:"string",default:"selcontent"}),t("template_preview_replace_values",{processor:"object"}),t("template_replace_values",{processor:"object"}),t("templates",{processor:e=>a(e)||((e,t)=>{if(r(e)){for(let a=0,n=e.length;a<n;++a)if(!t(e[a]))return!1;return!0}return!1})(e,n)||s(e)}),t("template_cdate_format",{processor:"string",default:e.translate("%Y-%m-%d")}),t("template_mdate_format",{processor:"string",default:e.translate("%Y-%m-%d")})})(e),(e=>{const t=()=>e.execCommand("mceTemplate");e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:t}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:t})})(e),(e=>{e.addCommand("mceInsertTemplate",function(e,...t){return(...a)=>{const n=t.concat(a);return e.apply(null,n)}}(D,e)),e.addCommand("mceTemplate",((e,t)=>()=>{const n=h(e);s(n)?n(t):a(n)?fetch(n).then((e=>{e.ok&&e.json().then(t)})):t(n)})(e,(e=>t=>{N(e,t)})(e)))})(e),(e=>{e.on("PreProcess",(t=>{const a=e.dom,n=v(e);o.each(a.select("div",t.node),(t=>{a.hasClass(t,"mceTmpl")&&(o.each(a.select("*",t),(t=>{C(a,t,u(e))&&(t.innerHTML=M(e,n))})),A(e,t))}))}))})(e)}))}();
@@ -1,7 +0,0 @@
1
- // Exports the "visualblocks" plugin for usage with module loaders
2
- // Usage:
3
- // CommonJS:
4
- // require('tinymce/plugins/visualblocks')
5
- // ES2015:
6
- // import 'tinymce/plugins/visualblocks'
7
- require('./plugin.js');
@@ -1,98 +0,0 @@
1
- /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
3
- */
4
-
5
- (function () {
6
- 'use strict';
7
-
8
- const Cell = initial => {
9
- let value = initial;
10
- const get = () => {
11
- return value;
12
- };
13
- const set = v => {
14
- value = v;
15
- };
16
- return {
17
- get,
18
- set
19
- };
20
- };
21
-
22
- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
23
-
24
- const fireVisualBlocks = (editor, state) => {
25
- editor.dispatch('VisualBlocks', { state });
26
- };
27
-
28
- const toggleVisualBlocks = (editor, pluginUrl, enabledState) => {
29
- const dom = editor.dom;
30
- dom.toggleClass(editor.getBody(), 'mce-visualblocks');
31
- enabledState.set(!enabledState.get());
32
- fireVisualBlocks(editor, enabledState.get());
33
- };
34
-
35
- const register$2 = (editor, pluginUrl, enabledState) => {
36
- editor.addCommand('mceVisualBlocks', () => {
37
- toggleVisualBlocks(editor, pluginUrl, enabledState);
38
- });
39
- };
40
-
41
- const option = name => editor => editor.options.get(name);
42
- const register$1 = editor => {
43
- const registerOption = editor.options.register;
44
- registerOption('visualblocks_default_state', {
45
- processor: 'boolean',
46
- default: false
47
- });
48
- };
49
- const isEnabledByDefault = option('visualblocks_default_state');
50
-
51
- const setup = (editor, pluginUrl, enabledState) => {
52
- editor.on('PreviewFormats AfterPreviewFormats', e => {
53
- if (enabledState.get()) {
54
- editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats');
55
- }
56
- });
57
- editor.on('init', () => {
58
- if (isEnabledByDefault(editor)) {
59
- toggleVisualBlocks(editor, pluginUrl, enabledState);
60
- }
61
- });
62
- };
63
-
64
- const toggleActiveState = (editor, enabledState) => api => {
65
- api.setActive(enabledState.get());
66
- const editorEventCallback = e => api.setActive(e.state);
67
- editor.on('VisualBlocks', editorEventCallback);
68
- return () => editor.off('VisualBlocks', editorEventCallback);
69
- };
70
- const register = (editor, enabledState) => {
71
- const onAction = () => editor.execCommand('mceVisualBlocks');
72
- editor.ui.registry.addToggleButton('visualblocks', {
73
- icon: 'visualblocks',
74
- tooltip: 'Show blocks',
75
- onAction,
76
- onSetup: toggleActiveState(editor, enabledState)
77
- });
78
- editor.ui.registry.addToggleMenuItem('visualblocks', {
79
- text: 'Show blocks',
80
- icon: 'visualblocks',
81
- onAction,
82
- onSetup: toggleActiveState(editor, enabledState)
83
- });
84
- };
85
-
86
- var Plugin = () => {
87
- global.add('visualblocks', (editor, pluginUrl) => {
88
- register$1(editor);
89
- const enabledState = Cell(false);
90
- register$2(editor, pluginUrl, enabledState);
91
- register(editor, enabledState);
92
- setup(editor, pluginUrl, enabledState);
93
- });
94
- };
95
-
96
- Plugin();
97
-
98
- })();
@@ -1,4 +0,0 @@
1
- /**
2
- * TinyMCE version 6.1.2 (2022-07-29)
3
- */
4
- !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(t,s,o)=>{t.dom.toggleClass(t.getBody(),"mce-visualblocks"),o.set(!o.get()),((t,s)=>{t.dispatch("VisualBlocks",{state:s})})(t,o.get())},o=("visualblocks_default_state",t=>t.options.get("visualblocks_default_state"));const e=(t,s)=>o=>{o.setActive(s.get());const e=t=>o.setActive(t.state);return t.on("VisualBlocks",e),()=>t.off("VisualBlocks",e)};t.add("visualblocks",((t,l)=>{(t=>{(0,t.options.register)("visualblocks_default_state",{processor:"boolean",default:!1})})(t);const a=(t=>{let s=!1;return{get:()=>s,set:t=>{s=t}}})();((t,o,e)=>{t.addCommand("mceVisualBlocks",(()=>{s(t,0,e)}))})(t,0,a),((t,s)=>{const o=()=>t.execCommand("mceVisualBlocks");t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:o,onSetup:e(t,s)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:o,onSetup:e(t,s)})})(t,a),((t,e,l)=>{t.on("PreviewFormats AfterPreviewFormats",(s=>{l.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===s.type)})),t.on("init",(()=>{o(t)&&s(t,0,l)}))})(t,0,a)}))}();