@dangl/angular-material-shared 2.9.0-beta0047 → 2.9.0-beta0048

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 (165) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/icons/default/icons.js +9 -46
  3. package/tinymce-assets/icons/default/icons.min.js +1 -1
  4. package/tinymce-assets/models/dom/model.js +7239 -8193
  5. package/tinymce-assets/models/dom/model.min.js +1 -1
  6. package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
  7. package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
  8. package/tinymce-assets/plugins/advlist/plugin.js +200 -412
  9. package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
  10. package/tinymce-assets/plugins/anchor/plugin.js +166 -189
  11. package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
  12. package/tinymce-assets/plugins/autolink/plugin.js +220 -310
  13. package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
  14. package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
  15. package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
  16. package/tinymce-assets/plugins/autosave/plugin.js +189 -208
  17. package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
  18. package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
  19. package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
  20. package/tinymce-assets/plugins/code/plugin.js +61 -73
  21. package/tinymce-assets/plugins/code/plugin.min.js +4 -0
  22. package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
  23. package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
  24. package/tinymce-assets/plugins/directionality/plugin.js +304 -545
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
  28. package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
  29. package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
  30. package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
  31. package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
  32. package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
  33. package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
  34. package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
  35. package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
  36. package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
  37. package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
  38. package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
  39. package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
  40. package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
  41. package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
  42. package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
  43. package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
  44. package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
  45. package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
  46. package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
  47. package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
  48. package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
  49. package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
  50. package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
  51. package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
  52. package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
  53. package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
  54. package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
  55. package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
  56. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
  57. package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
  58. package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
  59. package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
  60. package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
  61. package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
  62. package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
  63. package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
  64. package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
  65. package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
  66. package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
  67. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
  68. package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
  69. package/tinymce-assets/plugins/help/plugin.js +809 -739
  70. package/tinymce-assets/plugins/help/plugin.min.js +5 -1
  71. package/tinymce-assets/plugins/image/plugin.js +1291 -1475
  72. package/tinymce-assets/plugins/image/plugin.min.js +5 -1
  73. package/tinymce-assets/plugins/importcss/plugin.js +269 -328
  74. package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
  75. package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
  76. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
  77. package/tinymce-assets/plugins/link/plugin.js +1084 -1419
  78. package/tinymce-assets/plugins/link/plugin.min.js +5 -1
  79. package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
  80. package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
  81. package/tinymce-assets/plugins/media/plugin.js +1047 -1305
  82. package/tinymce-assets/plugins/media/plugin.min.js +5 -1
  83. package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
  84. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
  85. package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
  86. package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
  87. package/tinymce-assets/plugins/preview/plugin.js +74 -742
  88. package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
  89. package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
  90. package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
  91. package/tinymce-assets/plugins/save/plugin.js +82 -100
  92. package/tinymce-assets/plugins/save/plugin.min.js +5 -1
  93. package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
  94. package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
  95. package/tinymce-assets/plugins/table/plugin.js +3094 -3651
  96. package/tinymce-assets/plugins/table/plugin.min.js +5 -1
  97. package/tinymce-assets/plugins/template/index.js +7 -0
  98. package/tinymce-assets/plugins/template/plugin.js +567 -0
  99. package/tinymce-assets/plugins/template/plugin.min.js +5 -0
  100. package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
  101. package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
  102. package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
  103. package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
  104. package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
  105. package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
  106. package/tinymce-assets/skins/content/dark/content.css +4 -0
  107. package/tinymce-assets/skins/content/dark/content.js +6 -1
  108. package/tinymce-assets/skins/content/dark/content.min.css +4 -0
  109. package/tinymce-assets/skins/content/default/content.css +4 -0
  110. package/tinymce-assets/skins/content/default/content.js +6 -1
  111. package/tinymce-assets/skins/content/default/content.min.css +4 -0
  112. package/tinymce-assets/skins/content/document/content.css +4 -0
  113. package/tinymce-assets/skins/content/document/content.js +6 -1
  114. package/tinymce-assets/skins/content/document/content.min.css +4 -0
  115. package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
  116. package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
  117. package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
  118. package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
  119. package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
  120. package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
  121. package/tinymce-assets/skins/content/writer/content.css +4 -0
  122. package/tinymce-assets/skins/content/writer/content.js +6 -1
  123. package/tinymce-assets/skins/content/writer/content.min.css +4 -0
  124. package/tinymce-assets/skins/ui/oxide/content.css +53 -148
  125. package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
  126. package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
  127. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
  128. package/tinymce-assets/skins/ui/oxide/content.js +6 -1
  129. package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
  130. package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
  131. package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
  132. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  133. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
  134. package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
  135. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
  136. package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
  137. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
  138. package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
  139. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
  140. package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
  141. package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
  142. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  143. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
  144. package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
  145. package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
  146. package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
  147. package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
  148. package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
  149. package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
  150. package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
  151. package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
  152. package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
  153. package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
  154. package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
  155. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
  156. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
  157. package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
  158. package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
  159. package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
  160. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
  161. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
  162. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  163. package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
  164. package/tinymce-assets/themes/silver/theme.js +28439 -32466
  165. package/tinymce-assets/themes/silver/theme.min.js +1 -1
@@ -1,318 +1,228 @@
1
1
  /**
2
- * TinyMCE version 7.9.3 (2026-05-19)
2
+ * TinyMCE version 6.8.6 (TBD)
3
3
  */
4
4
 
5
5
  (function () {
6
- 'use strict';
7
-
8
- var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
-
10
- /* eslint-disable @typescript-eslint/no-wrapper-object-types */
11
- const hasProto = (v, constructor, predicate) => {
12
- var _a;
13
- if (predicate(v, constructor.prototype)) {
14
- return true;
15
- }
16
- else {
17
- // String-based fallback time
18
- return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
19
- }
20
- };
21
- const typeOf = (x) => {
22
- const t = typeof x;
23
- if (x === null) {
24
- return 'null';
25
- }
26
- else if (t === 'object' && Array.isArray(x)) {
27
- return 'array';
28
- }
29
- else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
30
- return 'string';
31
- }
32
- else {
33
- return t;
34
- }
35
- };
36
- const isType = (type) => (value) => typeOf(value) === type;
37
- const eq = (t) => (a) => t === a;
38
- const isString = isType('string');
39
- const isUndefined = eq(undefined);
40
- const isNullable = (a) => a === null || a === undefined;
41
- const isNonNullable = (a) => !isNullable(a);
42
-
43
- const not = (f) => (t) => !f(t);
44
-
45
- // eslint-disable-next-line @typescript-eslint/unbound-method
46
- const hasOwnProperty = Object.hasOwnProperty;
47
- const has = (obj, key) => hasOwnProperty.call(obj, key);
48
-
49
- const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
50
- const contains = (str, substr, start = 0, end) => {
51
- const idx = str.indexOf(substr, start);
52
- if (idx !== -1) {
53
- return isUndefined(end) ? true : idx + substr.length <= end;
54
- }
55
- else {
56
- return false;
57
- }
58
- };
59
- /** Does 'str' start with 'prefix'?
60
- * Note: all strings start with the empty string.
61
- * More formally, for all strings x, startsWith(x, "").
62
- * This is so that for all strings x and y, startsWith(y + x, y)
63
- */
64
- const startsWith = (str, prefix) => {
65
- return checkRange(str, prefix, 0);
66
- };
67
-
68
- const zeroWidth = '\uFEFF';
69
- const isZwsp = (char) => char === zeroWidth;
70
- const removeZwsp = (s) => s.replace(/\uFEFF/g, '');
71
-
72
- /*
73
- The RegEx parses the following components (https://www.rfc-editor.org/rfc/rfc3986.txt):
74
-
75
- scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
76
-
77
- foo://example.com:8042/over/there?name=ferret#nose
78
- \_/ \______________/\_________/ \_________/ \__/
79
- | | | | |
80
- scheme authority path query fragment
81
-
82
- Originally from:
83
- http://blog.mattheworiordan.com/post/13174566389/url-regular-expression-for-links-with-or-without-the
84
-
85
- Modified to:
86
- - include port numbers
87
- - allow full stops in email addresses
88
- - allow [-.~*+=!&;:'%@?^${}(),\/\w] after the #
89
- - allow [-.~*+=!&;:'%@?^${}(),\/\w] after the ?
90
- - move allow -_.~*+=!&;:'%@?^${}() in email usernames to the first @ match (TBIO-4809)
91
- - enforce domains to be [A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)* so they can't end in a period (TBIO-4809)
92
- - removed a bunch of escaping, made every group non-capturing (during TBIO-4809)
93
- - colons are only valid when followed directly by // or some text and then @ (TBIO-4867)
94
- - only include the fragment '#' if it has 1 or more trailing matches
95
- - only include the query '?' if it has 1 or more trailing matches
96
- - allow commas in URL path
97
- - exclude trailing comma and period in URL path
98
- - allow up to 15 character schemes including all valid characters from the spec https://url.spec.whatwg.org/#url-scheme-string (TINY-5074)
99
- - changed instances of 0-9 to be \d (TINY-5074)
100
- - reduced duplication (TINY-5074)
101
- - allow [*!;:'@$] in the path segment as they are valid characters per the spec: https://url.spec.whatwg.org/#url-path-segment-string (TINY-8069)
102
-
103
- (?:
104
- (?:
105
- [A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?
106
- | www\.
107
- | [-;:&=+$,.\w]+@
108
- )
109
- [A-Za-z\d-]+
110
- (?:\.[A-Za-z\d-]+)*
111
- )
112
- (?::\d+)?
113
- (?:
114
- \/
115
- (?:
116
- [-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w]
117
- )?
118
- )?
119
- (?:
120
- \?
121
- (?:
122
- [-.~*+=!&;:'%@?^${}(),\/\w]+
123
- )
124
- )?
125
- (?:
126
- #
127
- (?:
128
- [-.~*+=!&;:'%@?^${}(),\/\w]+
129
- )
130
- )?
131
- */
132
- const link = () =>
133
- // eslint-disable-next-line max-len
134
- /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
135
-
136
- const option = (name) => (editor) => editor.options.get(name);
137
- const register = (editor) => {
138
- const registerOption = editor.options.register;
139
- registerOption('autolink_pattern', {
140
- processor: 'regexp',
141
- // Use the Polaris link detection, however for autolink we need to make it be an exact match
142
- default: new RegExp('^' + link().source + '$', 'i')
143
- });
144
- registerOption('link_default_target', {
145
- processor: 'string'
146
- });
147
- registerOption('link_default_protocol', {
148
- processor: 'string',
149
- default: 'https'
150
- });
151
- };
152
- const getAutoLinkPattern = option('autolink_pattern');
153
- const getDefaultLinkTarget = option('link_default_target');
154
- const getDefaultLinkProtocol = option('link_default_protocol');
155
- const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
156
-
157
- var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
158
-
159
- const isTextNode = (node) => node.nodeType === 3;
160
- const isElement = (node) => node.nodeType === 1;
161
- const isBracketOrSpace = (char) => /^[(\[{ \u00a0]$/.test(char);
162
- // Note: This is similar to the Polaris protocol detection, except it also handles `mailto` and any length scheme
163
- const hasProtocol = (url) => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
164
- // A limited list of punctuation characters that might be used after a link
165
- const isPunctuation = (char) => /[?!,.;:]/.test(char);
166
- const findChar = (text, index, predicate) => {
167
- for (let i = index - 1; i >= 0; i--) {
168
- const char = text.charAt(i);
169
- if (!isZwsp(char) && predicate(char)) {
170
- return i;
171
- }
172
- }
173
- return -1;
174
- };
175
- const freefallRtl = (container, offset) => {
176
- let tempNode = container;
177
- let tempOffset = offset;
178
- while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
179
- tempNode = tempNode.childNodes[tempOffset];
180
- tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
181
- }
182
- return { container: tempNode, offset: tempOffset };
183
- };
184
-
185
- const parseCurrentLine = (editor, offset) => {
186
- var _a;
187
- const voidElements = editor.schema.getVoidElements();
188
- const autoLinkPattern = getAutoLinkPattern(editor);
189
- const { dom, selection } = editor;
190
- // Never create a link when we are inside a link
191
- if (dom.getParent(selection.getNode(), 'a[href]') !== null || editor.mode.isReadOnly()) {
192
- return null;
193
- }
194
- const rng = selection.getRng();
195
- const textSeeker = global(dom, (node) => {
196
- return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false' || dom.getParent(node, 'a[href]') !== null;
197
- });
198
- // Descend down the end container to find the text node
199
- const { container: endContainer, offset: endOffset } = freefallRtl(rng.endContainer, rng.endOffset);
200
- // Find the root container to use when walking
201
- const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
202
- // Move the selection backwards to the start of the potential URL to account for the pressed character
203
- // while also excluding the last full stop from a word like "www.site.com."
204
- const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
205
- const text = node.data;
206
- const idx = findChar(text, offset, not(isBracketOrSpace));
207
- // Move forward one so the offset is after the found character unless the found char is a punctuation char
208
- return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
209
- }, root);
210
- if (!endSpot) {
211
- return null;
212
- }
213
- // Walk backwards until we find a boundary or a bracket/space
214
- let lastTextNode = endSpot.container;
215
- const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
216
- lastTextNode = node;
217
- const idx = findChar(node.data, offset, isBracketOrSpace);
218
- // Move forward one so that the offset is after the bracket/space
219
- return idx === -1 ? idx : idx + 1;
220
- }, root);
221
- const newRng = dom.createRng();
222
- if (!startSpot) {
223
- newRng.setStart(lastTextNode, 0);
224
- }
225
- else {
226
- newRng.setStart(startSpot.container, startSpot.offset);
227
- }
228
- newRng.setEnd(endSpot.container, endSpot.offset);
229
- const rngText = removeZwsp(newRng.toString());
230
- const matches = rngText.match(autoLinkPattern);
231
- if (matches) {
232
- let url = matches[0];
233
- if (startsWith(url, 'www.')) {
234
- const protocol = getDefaultLinkProtocol(editor);
235
- url = protocol + '://' + url;
236
- }
237
- else if (contains(url, '@') && !hasProtocol(url)) {
238
- url = 'mailto:' + url;
239
- }
240
- return { rng: newRng, url };
241
- }
242
- else {
243
- return null;
244
- }
245
- };
246
- const convertToLink = (editor, result) => {
247
- const { dom, selection } = editor;
248
- const { rng, url } = result;
249
- const bookmark = selection.getBookmark();
250
- selection.setRng(rng);
251
- // Needs to be a native createlink command since this is executed in a keypress event handler
252
- // so the pending character that is to be inserted needs to be inserted after the link. That will not
253
- // happen if we use the formatter create link version. Since we're using the native command
254
- // then we also need to ensure the exec command events are fired for backwards compatibility.
255
- const command = 'createlink';
256
- const args = { command, ui: false, value: url };
257
- const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
258
- if (!beforeExecEvent.isDefaultPrevented()) {
259
- editor.getDoc().execCommand(command, false, url);
260
- editor.dispatch('ExecCommand', args);
261
- const defaultLinkTarget = getDefaultLinkTarget(editor);
262
- if (isString(defaultLinkTarget)) {
263
- const anchor = selection.getNode();
264
- dom.setAttrib(anchor, 'target', defaultLinkTarget);
265
- // Ensure noopener is added for blank targets to prevent window opener attacks
266
- if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
267
- dom.setAttrib(anchor, 'rel', 'noopener');
268
- }
269
- }
270
- }
271
- selection.moveToBookmark(bookmark);
272
- editor.nodeChanged();
273
- };
274
- const handleSpacebar = (editor) => {
275
- const result = parseCurrentLine(editor, -1);
276
- if (isNonNullable(result)) {
277
- convertToLink(editor, result);
278
- }
279
- };
280
- const handleBracket = handleSpacebar;
281
- const handleEnter = (editor) => {
282
- const result = parseCurrentLine(editor, 0);
283
- if (isNonNullable(result)) {
284
- convertToLink(editor, result);
285
- }
6
+ 'use strict';
7
+
8
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
+
10
+ const link = () => /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
11
+
12
+ const option = name => editor => editor.options.get(name);
13
+ const register = editor => {
14
+ const registerOption = editor.options.register;
15
+ registerOption('autolink_pattern', {
16
+ processor: 'regexp',
17
+ default: new RegExp('^' + link().source + '$', 'i')
18
+ });
19
+ registerOption('link_default_target', { processor: 'string' });
20
+ registerOption('link_default_protocol', {
21
+ processor: 'string',
22
+ default: 'https'
23
+ });
24
+ };
25
+ const getAutoLinkPattern = option('autolink_pattern');
26
+ const getDefaultLinkTarget = option('link_default_target');
27
+ const getDefaultLinkProtocol = option('link_default_protocol');
28
+ const allowUnsafeLinkTarget = option('allow_unsafe_link_target');
29
+
30
+ const hasProto = (v, constructor, predicate) => {
31
+ var _a;
32
+ if (predicate(v, constructor.prototype)) {
33
+ return true;
34
+ } else {
35
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
36
+ }
37
+ };
38
+ const typeOf = x => {
39
+ const t = typeof x;
40
+ if (x === null) {
41
+ return 'null';
42
+ } else if (t === 'object' && Array.isArray(x)) {
43
+ return 'array';
44
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
45
+ return 'string';
46
+ } else {
47
+ return t;
48
+ }
49
+ };
50
+ const isType = type => value => typeOf(value) === type;
51
+ const eq = t => a => t === a;
52
+ const isString = isType('string');
53
+ const isUndefined = eq(undefined);
54
+ const isNullable = a => a === null || a === undefined;
55
+ const isNonNullable = a => !isNullable(a);
56
+
57
+ const not = f => t => !f(t);
58
+
59
+ const hasOwnProperty = Object.hasOwnProperty;
60
+ const has = (obj, key) => hasOwnProperty.call(obj, key);
61
+
62
+ const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
63
+ const contains = (str, substr, start = 0, end) => {
64
+ const idx = str.indexOf(substr, start);
65
+ if (idx !== -1) {
66
+ return isUndefined(end) ? true : idx + substr.length <= end;
67
+ } else {
68
+ return false;
69
+ }
70
+ };
71
+ const startsWith = (str, prefix) => {
72
+ return checkRange(str, prefix, 0);
73
+ };
74
+
75
+ const zeroWidth = '\uFEFF';
76
+ const isZwsp = char => char === zeroWidth;
77
+ const removeZwsp = s => s.replace(/\uFEFF/g, '');
78
+
79
+ var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
80
+
81
+ const isTextNode = node => node.nodeType === 3;
82
+ const isElement = node => node.nodeType === 1;
83
+ const isBracketOrSpace = char => /^[(\[{ \u00a0]$/.test(char);
84
+ const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
85
+ const isPunctuation = char => /[?!,.;:]/.test(char);
86
+ const findChar = (text, index, predicate) => {
87
+ for (let i = index - 1; i >= 0; i--) {
88
+ const char = text.charAt(i);
89
+ if (!isZwsp(char) && predicate(char)) {
90
+ return i;
91
+ }
92
+ }
93
+ return -1;
94
+ };
95
+ const freefallRtl = (container, offset) => {
96
+ let tempNode = container;
97
+ let tempOffset = offset;
98
+ while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
99
+ tempNode = tempNode.childNodes[tempOffset];
100
+ tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
101
+ }
102
+ return {
103
+ container: tempNode,
104
+ offset: tempOffset
286
105
  };
287
- const setup = (editor) => {
288
- editor.on('keydown', (e) => {
289
- if (e.keyCode === 13 && !e.isDefaultPrevented()) {
290
- handleEnter(editor);
291
- }
292
- });
293
- editor.on('keyup', (e) => {
294
- if (e.keyCode === 32) {
295
- handleSpacebar(editor);
296
- // One of the closing bracket keys: ), ] or }
297
- }
298
- else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
299
- handleBracket(editor);
300
- }
301
- });
106
+ };
107
+
108
+ const parseCurrentLine = (editor, offset) => {
109
+ var _a;
110
+ const voidElements = editor.schema.getVoidElements();
111
+ const autoLinkPattern = getAutoLinkPattern(editor);
112
+ const {dom, selection} = editor;
113
+ if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
114
+ return null;
115
+ }
116
+ const rng = selection.getRng();
117
+ const textSeeker = global(dom, node => {
118
+ return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false';
119
+ });
120
+ const {
121
+ container: endContainer,
122
+ offset: endOffset
123
+ } = freefallRtl(rng.endContainer, rng.endOffset);
124
+ const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
125
+ const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
126
+ const text = node.data;
127
+ const idx = findChar(text, offset, not(isBracketOrSpace));
128
+ return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
129
+ }, root);
130
+ if (!endSpot) {
131
+ return null;
132
+ }
133
+ let lastTextNode = endSpot.container;
134
+ const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
135
+ lastTextNode = node;
136
+ const idx = findChar(node.data, offset, isBracketOrSpace);
137
+ return idx === -1 ? idx : idx + 1;
138
+ }, root);
139
+ const newRng = dom.createRng();
140
+ if (!startSpot) {
141
+ newRng.setStart(lastTextNode, 0);
142
+ } else {
143
+ newRng.setStart(startSpot.container, startSpot.offset);
144
+ }
145
+ newRng.setEnd(endSpot.container, endSpot.offset);
146
+ const rngText = removeZwsp(newRng.toString());
147
+ const matches = rngText.match(autoLinkPattern);
148
+ if (matches) {
149
+ let url = matches[0];
150
+ if (startsWith(url, 'www.')) {
151
+ const protocol = getDefaultLinkProtocol(editor);
152
+ url = protocol + '://' + url;
153
+ } else if (contains(url, '@') && !hasProtocol(url)) {
154
+ url = 'mailto:' + url;
155
+ }
156
+ return {
157
+ rng: newRng,
158
+ url
159
+ };
160
+ } else {
161
+ return null;
162
+ }
163
+ };
164
+ const convertToLink = (editor, result) => {
165
+ const {dom, selection} = editor;
166
+ const {rng, url} = result;
167
+ const bookmark = selection.getBookmark();
168
+ selection.setRng(rng);
169
+ const command = 'createlink';
170
+ const args = {
171
+ command,
172
+ ui: false,
173
+ value: url
302
174
  };
303
-
304
- var Plugin = () => {
305
- global$1.add('autolink', (editor) => {
306
- register(editor);
307
- setup(editor);
308
- });
309
- };
310
-
311
- Plugin();
312
- /** *****
313
- * DO NOT EXPORT ANYTHING
314
- *
315
- * IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
316
- *******/
175
+ const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
176
+ if (!beforeExecEvent.isDefaultPrevented()) {
177
+ editor.getDoc().execCommand(command, false, url);
178
+ editor.dispatch('ExecCommand', args);
179
+ const defaultLinkTarget = getDefaultLinkTarget(editor);
180
+ if (isString(defaultLinkTarget)) {
181
+ const anchor = selection.getNode();
182
+ dom.setAttrib(anchor, 'target', defaultLinkTarget);
183
+ if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
184
+ dom.setAttrib(anchor, 'rel', 'noopener');
185
+ }
186
+ }
187
+ }
188
+ selection.moveToBookmark(bookmark);
189
+ editor.nodeChanged();
190
+ };
191
+ const handleSpacebar = editor => {
192
+ const result = parseCurrentLine(editor, -1);
193
+ if (isNonNullable(result)) {
194
+ convertToLink(editor, result);
195
+ }
196
+ };
197
+ const handleBracket = handleSpacebar;
198
+ const handleEnter = editor => {
199
+ const result = parseCurrentLine(editor, 0);
200
+ if (isNonNullable(result)) {
201
+ convertToLink(editor, result);
202
+ }
203
+ };
204
+ const setup = editor => {
205
+ editor.on('keydown', e => {
206
+ if (e.keyCode === 13 && !e.isDefaultPrevented()) {
207
+ handleEnter(editor);
208
+ }
209
+ });
210
+ editor.on('keyup', e => {
211
+ if (e.keyCode === 32) {
212
+ handleSpacebar(editor);
213
+ } else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
214
+ handleBracket(editor);
215
+ }
216
+ });
217
+ };
218
+
219
+ var Plugin = () => {
220
+ global$1.add('autolink', editor => {
221
+ register(editor);
222
+ setup(editor);
223
+ });
224
+ };
225
+
226
+ Plugin();
317
227
 
318
228
  })();
@@ -1 +1,5 @@
1
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e);const n=e=>undefined===e;const o=e=>!(e=>null==e)(e),r=Object.hasOwnProperty,a=e=>"\ufeff"===e,s=e=>t=>t.options.get(e),l=s("autolink_pattern"),i=s("link_default_target"),c=s("link_default_protocol"),d=s("allow_unsafe_link_target");var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!a(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=l(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]")||e.mode.isReadOnly())return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),r.call(t,n))||"false"===i.getContentEditable(e)||null!==i.getParent(e,"a[href]");var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),w=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),h=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),w);if(!h)return null;let v=h.container;const _=k.backwards(h.container,h.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),w),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(h.container,h.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return P="www.",(b=t).length>=4&&b.substr(0,4)===P?t=c(e)+"://"+t:((e,t,o=0,r)=>{const a=e.indexOf(t,o);return-1!==a&&(!!n(r)||a+t.length<=r)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,P;return null},k=(e,n)=>{const{dom:o,selection:r}=e,{rng:a,url:s}=n,l=r.getBookmark();r.setRng(a);const c="createlink",u={command:c,ui:!1,value:s};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(c,!1,s),e.dispatch("ExecCommand",u);const n=i(e);if(t(n)){const t=r.getNode();o.setAttrib(t,"target",n),"_blank"!==n||d(e)||o.setAttrib(t,"rel","noopener")}}r.moveToBookmark(l),e.nodeChanged()},p=e=>{const t=m(e,-1);o(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);o(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
1
+ /**
2
+ * TinyMCE version 6.8.6 (TBD)
3
+ */
4
+
5
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),w=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),h=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),w);if(!h)return null;let v=h.container;const _=k.backwards(h.container,h.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),w),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(h.container,h.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=4&&b.substr(0,4)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();