opentiny 6.9.0

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 (1962) hide show
  1. package/.eslintrc.json +11 -0
  2. package/CHANGELOG.md +3443 -0
  3. package/Gruntfile.js +966 -0
  4. package/README.md +87 -0
  5. package/package.json +41 -0
  6. package/project.json +32 -0
  7. package/src/core/demo/css/content_editable.css +47 -0
  8. package/src/core/demo/html/annotations_demo.html +29 -0
  9. package/src/core/demo/html/commands_demo.html +16 -0
  10. package/src/core/demo/html/content_editable_false_demo.html +61 -0
  11. package/src/core/demo/html/content_security_policy.html +22 -0
  12. package/src/core/demo/html/custom_theme_demo.html +14 -0
  13. package/src/core/demo/html/fixed_toolbar_container_demo.html +22 -0
  14. package/src/core/demo/html/full_demo.html +48 -0
  15. package/src/core/demo/html/iframe_demo.html +15 -0
  16. package/src/core/demo/html/iframe_demo_inner.html +20 -0
  17. package/src/core/demo/html/inline_demo.html +423 -0
  18. package/src/core/demo/html/jquery_integration.html +21 -0
  19. package/src/core/demo/html/responsive_demo.html +126 -0
  20. package/src/core/demo/html/shadow_dom_closed_demo.html +14 -0
  21. package/src/core/demo/html/shadow_dom_open_demo.html +15 -0
  22. package/src/core/demo/html/shadow_dom_open_inline_demo.html +14 -0
  23. package/src/core/demo/html/source_dump_demo.html +17 -0
  24. package/src/core/demo/html/sticky_toolbar_demo.html +151 -0
  25. package/src/core/demo/html/tiny_demo.html +13 -0
  26. package/src/core/demo/html/view_demo.html +24 -0
  27. package/src/core/demo/ts/demo/AnnotationsDemo.ts +95 -0
  28. package/src/core/demo/ts/demo/CommandsDemo.ts +114 -0
  29. package/src/core/demo/ts/demo/ContentEditableFalseDemo.ts +88 -0
  30. package/src/core/demo/ts/demo/ContentSecurityPolicyDemo.ts +132 -0
  31. package/src/core/demo/ts/demo/CustomThemeDemo.ts +59 -0
  32. package/src/core/demo/ts/demo/Demos.ts +35 -0
  33. package/src/core/demo/ts/demo/FixedToolbarContainerDemo.ts +11 -0
  34. package/src/core/demo/ts/demo/FullDemo.ts +171 -0
  35. package/src/core/demo/ts/demo/IframeDemo.ts +49 -0
  36. package/src/core/demo/ts/demo/InlineDemo.ts +32 -0
  37. package/src/core/demo/ts/demo/ResponsiveDemo.ts +125 -0
  38. package/src/core/demo/ts/demo/ShadowDomDemo.ts +22 -0
  39. package/src/core/demo/ts/demo/ShadowDomInlineDemo.ts +27 -0
  40. package/src/core/demo/ts/demo/SourceDumpDemo.ts +33 -0
  41. package/src/core/demo/ts/demo/StickyToolbarDemo.ts +86 -0
  42. package/src/core/demo/ts/demo/TinyMceDemo.ts +36 -0
  43. package/src/core/demo/ts/demo/ViewDemo.ts +113 -0
  44. package/src/core/main/js/GlobalsTemplate.js +4 -0
  45. package/src/core/main/json/globals.json +54 -0
  46. package/src/core/main/text/readme_lang.md +3 -0
  47. package/src/core/main/ts/Deprecations.ts +127 -0
  48. package/src/core/main/ts/DragDropOverrides.ts +472 -0
  49. package/src/core/main/ts/EditorRemove.ts +113 -0
  50. package/src/core/main/ts/EditorView.ts +60 -0
  51. package/src/core/main/ts/ErrorReporter.ts +84 -0
  52. package/src/core/main/ts/ForceBlocks.ts +141 -0
  53. package/src/core/main/ts/NodeChange.ts +161 -0
  54. package/src/core/main/ts/Rtc.ts +455 -0
  55. package/src/core/main/ts/SelectionOverrides.ts +393 -0
  56. package/src/core/main/ts/alien/Spot.ts +13 -0
  57. package/src/core/main/ts/alien/TextDescent.ts +32 -0
  58. package/src/core/main/ts/alien/TextSearch.ts +85 -0
  59. package/src/core/main/ts/annotate/AnnotationChanges.ts +126 -0
  60. package/src/core/main/ts/annotate/AnnotationContext.ts +63 -0
  61. package/src/core/main/ts/annotate/AnnotationFilter.ts +49 -0
  62. package/src/core/main/ts/annotate/AnnotationsRegistry.ts +45 -0
  63. package/src/core/main/ts/annotate/Identification.ts +69 -0
  64. package/src/core/main/ts/annotate/Markings.ts +18 -0
  65. package/src/core/main/ts/annotate/Wrapping.ts +188 -0
  66. package/src/core/main/ts/api/AddOnManager.ts +302 -0
  67. package/src/core/main/ts/api/Annotator.ts +135 -0
  68. package/src/core/main/ts/api/Editor.ts +1146 -0
  69. package/src/core/main/ts/api/EditorCommands.ts +203 -0
  70. package/src/core/main/ts/api/EditorManager.ts +744 -0
  71. package/src/core/main/ts/api/EditorObservable.ts +221 -0
  72. package/src/core/main/ts/api/EditorOptions.ts +309 -0
  73. package/src/core/main/ts/api/EditorUpload.ts +363 -0
  74. package/src/core/main/ts/api/Env.ts +130 -0
  75. package/src/core/main/ts/api/EventTypes.ts +265 -0
  76. package/src/core/main/ts/api/Events.ts +133 -0
  77. package/src/core/main/ts/api/FakeClipboard.ts +82 -0
  78. package/src/core/main/ts/api/FocusManager.ts +34 -0
  79. package/src/core/main/ts/api/Formatter.ts +205 -0
  80. package/src/core/main/ts/api/IconManager.ts +39 -0
  81. package/src/core/main/ts/api/Main.ts +23 -0
  82. package/src/core/main/ts/api/Mode.ts +97 -0
  83. package/src/core/main/ts/api/ModelManager.ts +21 -0
  84. package/src/core/main/ts/api/NotificationManager.ts +197 -0
  85. package/src/core/main/ts/api/OptionTypes.ts +360 -0
  86. package/src/core/main/ts/api/Options.ts +1100 -0
  87. package/src/core/main/ts/api/PluginManager.ts +15 -0
  88. package/src/core/main/ts/api/PublicApi.ts +137 -0
  89. package/src/core/main/ts/api/Resource.ts +90 -0
  90. package/src/core/main/ts/api/Shortcuts.ts +266 -0
  91. package/src/core/main/ts/api/ThemeManager.ts +27 -0
  92. package/src/core/main/ts/api/Tinymce.ts +268 -0
  93. package/src/core/main/ts/api/UndoManager.ts +177 -0
  94. package/src/core/main/ts/api/WindowManager.ts +202 -0
  95. package/src/core/main/ts/api/commands/AlignCommands.ts +52 -0
  96. package/src/core/main/ts/api/commands/ClipboardCommands.ts +38 -0
  97. package/src/core/main/ts/api/commands/Commands.ts +55 -0
  98. package/src/core/main/ts/api/commands/ContentCommands.ts +45 -0
  99. package/src/core/main/ts/api/commands/FormatCommands.ts +78 -0
  100. package/src/core/main/ts/api/commands/HistoryCommands.ts +21 -0
  101. package/src/core/main/ts/api/commands/IndentCommands.ts +18 -0
  102. package/src/core/main/ts/api/commands/LinkCommands.ts +45 -0
  103. package/src/core/main/ts/api/commands/NewBlockCommands.ts +14 -0
  104. package/src/core/main/ts/api/commands/NewlineCommands.ts +20 -0
  105. package/src/core/main/ts/api/commands/SelectionCommands.ts +32 -0
  106. package/src/core/main/ts/api/dom/BookmarkManager.ts +74 -0
  107. package/src/core/main/ts/api/dom/ControlSelection.ts +512 -0
  108. package/src/core/main/ts/api/dom/DOMUtils.ts +1817 -0
  109. package/src/core/main/ts/api/dom/EventUtils.ts +482 -0
  110. package/src/core/main/ts/api/dom/RangeUtils.ts +120 -0
  111. package/src/core/main/ts/api/dom/ScriptLoader.ts +284 -0
  112. package/src/core/main/ts/api/dom/Selection.ts +618 -0
  113. package/src/core/main/ts/api/dom/SelectorChanged.ts +98 -0
  114. package/src/core/main/ts/api/dom/Serializer.ts +142 -0
  115. package/src/core/main/ts/api/dom/StyleSheetLoader.ts +256 -0
  116. package/src/core/main/ts/api/dom/TextSeeker.ts +92 -0
  117. package/src/core/main/ts/api/dom/TreeWalker.ts +129 -0
  118. package/src/core/main/ts/api/file/BlobCache.ts +143 -0
  119. package/src/core/main/ts/api/fmt/Format.ts +16 -0
  120. package/src/core/main/ts/api/fmt/StyleFormat.ts +30 -0
  121. package/src/core/main/ts/api/geom/Rect.ts +210 -0
  122. package/src/core/main/ts/api/html/DomParser.ts +517 -0
  123. package/src/core/main/ts/api/html/Entities.ts +279 -0
  124. package/src/core/main/ts/api/html/Node.ts +566 -0
  125. package/src/core/main/ts/api/html/Schema.ts +764 -0
  126. package/src/core/main/ts/api/html/Serializer.ts +171 -0
  127. package/src/core/main/ts/api/html/StyleUtils.ts +66 -0
  128. package/src/core/main/ts/api/html/Styles.ts +367 -0
  129. package/src/core/main/ts/api/html/Writer.ts +204 -0
  130. package/src/core/main/ts/api/textpatterns/TextPatterns.ts +15 -0
  131. package/src/core/main/ts/api/ui/Registry.ts +246 -0
  132. package/src/core/main/ts/api/ui/Ui.ts +31 -0
  133. package/src/core/main/ts/api/util/Delay.ts +73 -0
  134. package/src/core/main/ts/api/util/EventDispatcher.ts +341 -0
  135. package/src/core/main/ts/api/util/FakeStorage.ts +35 -0
  136. package/src/core/main/ts/api/util/I18n.ts +187 -0
  137. package/src/core/main/ts/api/util/ImageUploader.ts +51 -0
  138. package/src/core/main/ts/api/util/LocalStorage.ts +28 -0
  139. package/src/core/main/ts/api/util/Observable.ts +164 -0
  140. package/src/core/main/ts/api/util/Tools.ts +296 -0
  141. package/src/core/main/ts/api/util/URI.ts +522 -0
  142. package/src/core/main/ts/api/util/VK.ts +60 -0
  143. package/src/core/main/ts/autocomplete/AutocompleteContext.ts +76 -0
  144. package/src/core/main/ts/autocomplete/AutocompleteLookup.ts +73 -0
  145. package/src/core/main/ts/autocomplete/AutocompleteTypes.ts +21 -0
  146. package/src/core/main/ts/autocomplete/AutocompleteUtils.ts +12 -0
  147. package/src/core/main/ts/autocomplete/Autocompleters.ts +39 -0
  148. package/src/core/main/ts/bookmark/BookmarkTypes.ts +52 -0
  149. package/src/core/main/ts/bookmark/Bookmarks.ts +25 -0
  150. package/src/core/main/ts/bookmark/CaretBookmark.ts +242 -0
  151. package/src/core/main/ts/bookmark/GetBookmark.ts +231 -0
  152. package/src/core/main/ts/bookmark/ResolveBookmark.ts +268 -0
  153. package/src/core/main/ts/caret/BlockBoundary.ts +41 -0
  154. package/src/core/main/ts/caret/CaretBr.ts +34 -0
  155. package/src/core/main/ts/caret/CaretCandidate.ts +77 -0
  156. package/src/core/main/ts/caret/CaretContainer.ts +185 -0
  157. package/src/core/main/ts/caret/CaretContainerInline.ts +76 -0
  158. package/src/core/main/ts/caret/CaretContainerInput.ts +50 -0
  159. package/src/core/main/ts/caret/CaretContainerRemove.ts +95 -0
  160. package/src/core/main/ts/caret/CaretFinder.ts +102 -0
  161. package/src/core/main/ts/caret/CaretPosition.ts +407 -0
  162. package/src/core/main/ts/caret/CaretPositionPredicates.ts +55 -0
  163. package/src/core/main/ts/caret/CaretUtils.ts +323 -0
  164. package/src/core/main/ts/caret/CaretWalker.ts +245 -0
  165. package/src/core/main/ts/caret/ClosestCaretCandidate.ts +145 -0
  166. package/src/core/main/ts/caret/FakeCaret.ts +230 -0
  167. package/src/core/main/ts/caret/FakeCaretUtils.ts +60 -0
  168. package/src/core/main/ts/caret/InsertText.ts +37 -0
  169. package/src/core/main/ts/caret/LineReader.ts +133 -0
  170. package/src/core/main/ts/caret/LineUtils.ts +34 -0
  171. package/src/core/main/ts/caret/LineWalker.ts +165 -0
  172. package/src/core/main/ts/caret/TableCells.ts +90 -0
  173. package/src/core/main/ts/commands/Font.ts +60 -0
  174. package/src/core/main/ts/commands/IndentOutdent.ts +81 -0
  175. package/src/core/main/ts/commands/LineHeight.ts +24 -0
  176. package/src/core/main/ts/content/ContentCleanup.ts +28 -0
  177. package/src/core/main/ts/content/ContentTypes.ts +54 -0
  178. package/src/core/main/ts/content/EditorContent.ts +11 -0
  179. package/src/core/main/ts/content/GetContent.ts +24 -0
  180. package/src/core/main/ts/content/GetContentImpl.ts +67 -0
  181. package/src/core/main/ts/content/InsertContent.ts +62 -0
  182. package/src/core/main/ts/content/InsertContentImpl.ts +378 -0
  183. package/src/core/main/ts/content/InsertList.ts +212 -0
  184. package/src/core/main/ts/content/NbspTrim.ts +30 -0
  185. package/src/core/main/ts/content/Placeholder.ts +115 -0
  186. package/src/core/main/ts/content/PrePostProcess.ts +86 -0
  187. package/src/core/main/ts/content/SetContent.ts +23 -0
  188. package/src/core/main/ts/content/SetContentImpl.ts +98 -0
  189. package/src/core/main/ts/content/TransparentElements.ts +168 -0
  190. package/src/core/main/ts/delete/BlockBoundaryDelete.ts +25 -0
  191. package/src/core/main/ts/delete/BlockMergeBoundary.ts +92 -0
  192. package/src/core/main/ts/delete/BlockRangeDelete.ts +68 -0
  193. package/src/core/main/ts/delete/CaretBoundaryDelete.ts +81 -0
  194. package/src/core/main/ts/delete/CefDelete.ts +115 -0
  195. package/src/core/main/ts/delete/CefDeleteAction.ts +141 -0
  196. package/src/core/main/ts/delete/DeleteCommands.ts +74 -0
  197. package/src/core/main/ts/delete/DeleteElement.ts +168 -0
  198. package/src/core/main/ts/delete/DeleteUtils.ts +111 -0
  199. package/src/core/main/ts/delete/DetailsDelete.ts +258 -0
  200. package/src/core/main/ts/delete/ImageBlockDelete.ts +22 -0
  201. package/src/core/main/ts/delete/InlineBoundaryDelete.ts +127 -0
  202. package/src/core/main/ts/delete/InlineFormatDelete.ts +169 -0
  203. package/src/core/main/ts/delete/MediaDelete.ts +47 -0
  204. package/src/core/main/ts/delete/MergeBlocks.ts +128 -0
  205. package/src/core/main/ts/delete/MergeText.ts +66 -0
  206. package/src/core/main/ts/delete/Outdent.ts +25 -0
  207. package/src/core/main/ts/delete/TableDelete.ts +293 -0
  208. package/src/core/main/ts/delete/TableDeleteAction.ts +214 -0
  209. package/src/core/main/ts/delete/TableDeleteUtils.ts +67 -0
  210. package/src/core/main/ts/dom/CefUtils.ts +18 -0
  211. package/src/core/main/ts/dom/Dimensions.ts +39 -0
  212. package/src/core/main/ts/dom/DomSerializerFilters.ts +230 -0
  213. package/src/core/main/ts/dom/DomSerializerImpl.ts +132 -0
  214. package/src/core/main/ts/dom/DomSerializerPreProcess.ts +58 -0
  215. package/src/core/main/ts/dom/ElementType.ts +44 -0
  216. package/src/core/main/ts/dom/ElementUtils.ts +135 -0
  217. package/src/core/main/ts/dom/Empty.ts +122 -0
  218. package/src/core/main/ts/dom/MousePosition.ts +76 -0
  219. package/src/core/main/ts/dom/NodePath.ts +39 -0
  220. package/src/core/main/ts/dom/NodeType.ts +142 -0
  221. package/src/core/main/ts/dom/PaddingBr.ts +62 -0
  222. package/src/core/main/ts/dom/Parents.ts +24 -0
  223. package/src/core/main/ts/dom/Position.ts +74 -0
  224. package/src/core/main/ts/dom/RangePoint.ts +15 -0
  225. package/src/core/main/ts/dom/RemoveTrailingBr.ts +85 -0
  226. package/src/core/main/ts/dom/ScrollIntoView.ts +193 -0
  227. package/src/core/main/ts/dom/StyleSheetLoaderRegistry.ts +33 -0
  228. package/src/core/main/ts/dom/TextWalker.ts +34 -0
  229. package/src/core/main/ts/dom/TrimBody.ts +107 -0
  230. package/src/core/main/ts/dom/TrimNode.ts +76 -0
  231. package/src/core/main/ts/events/DragEvents.ts +99 -0
  232. package/src/core/main/ts/events/EventUtils.ts +141 -0
  233. package/src/core/main/ts/events/InputEvents.ts +46 -0
  234. package/src/core/main/ts/events/TouchEvents.ts +87 -0
  235. package/src/core/main/ts/file/BlobCacheUtils.ts +65 -0
  236. package/src/core/main/ts/file/Conversions.ts +110 -0
  237. package/src/core/main/ts/file/ImageScanner.ts +101 -0
  238. package/src/core/main/ts/file/UploadStatus.ts +79 -0
  239. package/src/core/main/ts/file/Uploader.ts +211 -0
  240. package/src/core/main/ts/fmt/ApplyFormat.ts +383 -0
  241. package/src/core/main/ts/fmt/CaretFormat.ts +375 -0
  242. package/src/core/main/ts/fmt/DefaultFormats.ts +264 -0
  243. package/src/core/main/ts/fmt/ExpandRange.ts +373 -0
  244. package/src/core/main/ts/fmt/FontInfo.ts +60 -0
  245. package/src/core/main/ts/fmt/FormatChanged.ts +205 -0
  246. package/src/core/main/ts/fmt/FormatContainer.ts +24 -0
  247. package/src/core/main/ts/fmt/FormatRegistry.ts +92 -0
  248. package/src/core/main/ts/fmt/FormatTypes.ts +82 -0
  249. package/src/core/main/ts/fmt/FormatUtils.ts +366 -0
  250. package/src/core/main/ts/fmt/Hooks.ts +69 -0
  251. package/src/core/main/ts/fmt/ListItemFormat.ts +55 -0
  252. package/src/core/main/ts/fmt/MatchFormat.ts +242 -0
  253. package/src/core/main/ts/fmt/MergeFormats.ts +108 -0
  254. package/src/core/main/ts/fmt/MergeUtils.ts +128 -0
  255. package/src/core/main/ts/fmt/Preview.ts +336 -0
  256. package/src/core/main/ts/fmt/RemoveFormat.ts +679 -0
  257. package/src/core/main/ts/fmt/TableFormats.ts +51 -0
  258. package/src/core/main/ts/fmt/ToggleFormat.ts +20 -0
  259. package/src/core/main/ts/focus/CefFocus.ts +33 -0
  260. package/src/core/main/ts/focus/EditorFocus.ts +139 -0
  261. package/src/core/main/ts/focus/FocusController.ts +151 -0
  262. package/src/core/main/ts/focus/MediaFocus.ts +25 -0
  263. package/src/core/main/ts/frames/Frames.ts +22 -0
  264. package/src/core/main/ts/frames/Navigation.ts +21 -0
  265. package/src/core/main/ts/frames/OuterPosition.ts +26 -0
  266. package/src/core/main/ts/geom/ClientRect.ts +154 -0
  267. package/src/core/main/ts/html/AstNodeType.ts +10 -0
  268. package/src/core/main/ts/html/Embed.ts +55 -0
  269. package/src/core/main/ts/html/FilterNode.ts +111 -0
  270. package/src/core/main/ts/html/FilterRegistry.ts +58 -0
  271. package/src/core/main/ts/html/InvalidNodes.ts +189 -0
  272. package/src/core/main/ts/html/LegacyFilter.ts +80 -0
  273. package/src/core/main/ts/html/Namespace.ts +47 -0
  274. package/src/core/main/ts/html/NonEditableFilter.ts +108 -0
  275. package/src/core/main/ts/html/ParserFilters.ts +176 -0
  276. package/src/core/main/ts/html/ParserUtils.ts +62 -0
  277. package/src/core/main/ts/html/Sanitization.ts +268 -0
  278. package/src/core/main/ts/init/ContentCss.ts +46 -0
  279. package/src/core/main/ts/init/Init.ts +195 -0
  280. package/src/core/main/ts/init/InitContentBody.ts +509 -0
  281. package/src/core/main/ts/init/InitIframe.ts +127 -0
  282. package/src/core/main/ts/init/LicenseKeyValidation.ts +21 -0
  283. package/src/core/main/ts/init/Render.ts +263 -0
  284. package/src/core/main/ts/keyboard/ArrowKeys.ts +58 -0
  285. package/src/core/main/ts/keyboard/Autocompleter.ts +158 -0
  286. package/src/core/main/ts/keyboard/BoundaryCaret.ts +67 -0
  287. package/src/core/main/ts/keyboard/BoundaryLocation.ts +195 -0
  288. package/src/core/main/ts/keyboard/BoundarySelection.ts +139 -0
  289. package/src/core/main/ts/keyboard/CefNavigation.ts +124 -0
  290. package/src/core/main/ts/keyboard/CefUtils.ts +24 -0
  291. package/src/core/main/ts/keyboard/ContentEndpointNavigation.ts +46 -0
  292. package/src/core/main/ts/keyboard/DeleteBackspaceKeys.ts +127 -0
  293. package/src/core/main/ts/keyboard/DetailsNavigation.ts +50 -0
  294. package/src/core/main/ts/keyboard/EnterKey.ts +87 -0
  295. package/src/core/main/ts/keyboard/FormatShortcuts.ts +21 -0
  296. package/src/core/main/ts/keyboard/HomeEndKeys.ts +40 -0
  297. package/src/core/main/ts/keyboard/InlineUtils.ts +77 -0
  298. package/src/core/main/ts/keyboard/InputKeys.ts +15 -0
  299. package/src/core/main/ts/keyboard/InsertSpace.ts +72 -0
  300. package/src/core/main/ts/keyboard/KeyboardOverrides.ts +44 -0
  301. package/src/core/main/ts/keyboard/MatchKeys.ts +65 -0
  302. package/src/core/main/ts/keyboard/MediaNavigation.ts +36 -0
  303. package/src/core/main/ts/keyboard/NavigationUtils.ts +168 -0
  304. package/src/core/main/ts/keyboard/Nbsps.ts +213 -0
  305. package/src/core/main/ts/keyboard/PageUpDownKeys.ts +68 -0
  306. package/src/core/main/ts/keyboard/PreventNoneditableInput.ts +14 -0
  307. package/src/core/main/ts/keyboard/SpaceKey.ts +34 -0
  308. package/src/core/main/ts/keyboard/TabKey.ts +37 -0
  309. package/src/core/main/ts/keyboard/TableNavigation.ts +182 -0
  310. package/src/core/main/ts/mode/EditableRoot.ts +18 -0
  311. package/src/core/main/ts/mode/Mode.ts +69 -0
  312. package/src/core/main/ts/mode/Readonly.ts +179 -0
  313. package/src/core/main/ts/newline/ContextSelectors.ts +24 -0
  314. package/src/core/main/ts/newline/InsertBlock.ts +442 -0
  315. package/src/core/main/ts/newline/InsertBr.ts +177 -0
  316. package/src/core/main/ts/newline/InsertDetailsNewLine.ts +46 -0
  317. package/src/core/main/ts/newline/InsertLi.ts +141 -0
  318. package/src/core/main/ts/newline/InsertNewLine.ts +64 -0
  319. package/src/core/main/ts/newline/NewBlock.ts +44 -0
  320. package/src/core/main/ts/newline/NewLineAction.ts +121 -0
  321. package/src/core/main/ts/newline/NewLineUtils.ts +236 -0
  322. package/src/core/main/ts/options/NormalizeOptions.ts +152 -0
  323. package/src/core/main/ts/paste/Clipboard.ts +337 -0
  324. package/src/core/main/ts/paste/Commands.ts +38 -0
  325. package/src/core/main/ts/paste/CutCopy.ts +116 -0
  326. package/src/core/main/ts/paste/DragDrop.ts +159 -0
  327. package/src/core/main/ts/paste/InternalHtml.ts +21 -0
  328. package/src/core/main/ts/paste/Newlines.ts +46 -0
  329. package/src/core/main/ts/paste/Paste.ts +33 -0
  330. package/src/core/main/ts/paste/PasteBin.ts +135 -0
  331. package/src/core/main/ts/paste/PasteUtils.ts +150 -0
  332. package/src/core/main/ts/paste/PrePostProcess.ts +25 -0
  333. package/src/core/main/ts/paste/ProcessFilters.ts +58 -0
  334. package/src/core/main/ts/paste/Quirks.ts +97 -0
  335. package/src/core/main/ts/paste/SmartPaste.ts +81 -0
  336. package/src/core/main/ts/schema/CustomElementsRuleParser.ts +24 -0
  337. package/src/core/main/ts/schema/GlobalAttributesSet.ts +25 -0
  338. package/src/core/main/ts/schema/Presets.ts +27 -0
  339. package/src/core/main/ts/schema/SchemaElementSets.ts +70 -0
  340. package/src/core/main/ts/schema/SchemaLookupTable.ts +230 -0
  341. package/src/core/main/ts/schema/SchemaTypes.ts +80 -0
  342. package/src/core/main/ts/schema/SchemaUtils.ts +31 -0
  343. package/src/core/main/ts/schema/ValidChildrenRuleParser.ts +51 -0
  344. package/src/core/main/ts/schema/ValidElementsRuleParser.ts +138 -0
  345. package/src/core/main/ts/selection/CaretRangeFromPoint.ts +15 -0
  346. package/src/core/main/ts/selection/DetailsElement.ts +41 -0
  347. package/src/core/main/ts/selection/EditableRange.ts +9 -0
  348. package/src/core/main/ts/selection/ElementSelection.ts +148 -0
  349. package/src/core/main/ts/selection/EventProcessRanges.ts +12 -0
  350. package/src/core/main/ts/selection/FragmentReader.ts +87 -0
  351. package/src/core/main/ts/selection/GetSelectionContent.ts +11 -0
  352. package/src/core/main/ts/selection/GetSelectionContentImpl.ts +104 -0
  353. package/src/core/main/ts/selection/MultiClickSelection.ts +86 -0
  354. package/src/core/main/ts/selection/MultiRange.ts +33 -0
  355. package/src/core/main/ts/selection/NormalizeRange.ts +299 -0
  356. package/src/core/main/ts/selection/RangeCompare.ts +13 -0
  357. package/src/core/main/ts/selection/RangeInsertNode.ts +40 -0
  358. package/src/core/main/ts/selection/RangeMap.ts +31 -0
  359. package/src/core/main/ts/selection/RangeNodes.ts +40 -0
  360. package/src/core/main/ts/selection/RangeNormalizer.ts +38 -0
  361. package/src/core/main/ts/selection/RangeTypes.ts +6 -0
  362. package/src/core/main/ts/selection/RangeWalk.ts +107 -0
  363. package/src/core/main/ts/selection/SelectionBookmark.ts +107 -0
  364. package/src/core/main/ts/selection/SelectionRestore.ts +63 -0
  365. package/src/core/main/ts/selection/SelectionUtils.ts +144 -0
  366. package/src/core/main/ts/selection/SetSelectionContent.ts +124 -0
  367. package/src/core/main/ts/selection/SimpleTableModel.ts +168 -0
  368. package/src/core/main/ts/selection/SplitRange.ts +55 -0
  369. package/src/core/main/ts/selection/TableCellSelection.ts +31 -0
  370. package/src/core/main/ts/selection/WordSelection.ts +37 -0
  371. package/src/core/main/ts/text/Bidi.ts +7 -0
  372. package/src/core/main/ts/text/CharType.ts +18 -0
  373. package/src/core/main/ts/text/ExtendingChar.ts +42 -0
  374. package/src/core/main/ts/text/Whitespace.ts +53 -0
  375. package/src/core/main/ts/text/Zwsp.ts +27 -0
  376. package/src/core/main/ts/textpatterns/TextPatterns.ts +10 -0
  377. package/src/core/main/ts/textpatterns/core/BlockPattern.ts +62 -0
  378. package/src/core/main/ts/textpatterns/core/BlockPatternOnSpace.ts +29 -0
  379. package/src/core/main/ts/textpatterns/core/BlockPatternUtils.ts +90 -0
  380. package/src/core/main/ts/textpatterns/core/InlinePattern.ts +326 -0
  381. package/src/core/main/ts/textpatterns/core/Pattern.ts +141 -0
  382. package/src/core/main/ts/textpatterns/core/PatternTypes.ts +86 -0
  383. package/src/core/main/ts/textpatterns/keyboard/KeyHandler.ts +97 -0
  384. package/src/core/main/ts/textpatterns/keyboard/Keyboard.ts +75 -0
  385. package/src/core/main/ts/textpatterns/utils/Marker.ts +50 -0
  386. package/src/core/main/ts/textpatterns/utils/PathRange.ts +81 -0
  387. package/src/core/main/ts/textpatterns/utils/Utils.ts +71 -0
  388. package/src/core/main/ts/ui/NotificationManagerImpl.ts +13 -0
  389. package/src/core/main/ts/ui/WindowManagerImpl.ts +15 -0
  390. package/src/core/main/ts/undo/Diff.ts +151 -0
  391. package/src/core/main/ts/undo/Fragments.ts +89 -0
  392. package/src/core/main/ts/undo/Levels.ts +99 -0
  393. package/src/core/main/ts/undo/Locks.ts +4 -0
  394. package/src/core/main/ts/undo/Operations.ts +167 -0
  395. package/src/core/main/ts/undo/Setup.ts +157 -0
  396. package/src/core/main/ts/undo/TypingState.ts +22 -0
  397. package/src/core/main/ts/undo/UndoManagerTypes.ts +50 -0
  398. package/src/core/main/ts/util/ArrUtils.ts +149 -0
  399. package/src/core/main/ts/util/LazyEvaluator.ts +16 -0
  400. package/src/core/main/ts/util/Predicate.ts +29 -0
  401. package/src/core/main/ts/util/Quirks.ts +739 -0
  402. package/src/core/main/ts/util/Uuid.ts +25 -0
  403. package/src/core/main/ts/view/VisualAids.ts +5 -0
  404. package/src/core/main/ts/view/VisualAidsImpl.ts +41 -0
  405. package/src/core/test/assets/icons/custom/icons.js +6 -0
  406. package/src/core/test/assets/js/nested.js +2 -0
  407. package/src/core/test/assets/js/test.js +1 -0
  408. package/src/core/test/assets/langs/custom.js +3 -0
  409. package/src/core/test/json/routes.json +395 -0
  410. package/src/core/test/ts/atomic/autocomplete/ParserTest.ts +54 -0
  411. package/src/core/test/ts/atomic/file/ConversionsTest.ts +34 -0
  412. package/src/core/test/ts/atomic/html/FilterNodeTest.ts +57 -0
  413. package/src/core/test/ts/atomic/keyboard/MatchKeysTest.ts +123 -0
  414. package/src/core/test/ts/atomic/keyboard/NbspsTest.ts +22 -0
  415. package/src/core/test/ts/atomic/paste/InternalHtmlTest.ts +25 -0
  416. package/src/core/test/ts/atomic/paste/NewlinesTest.ts +60 -0
  417. package/src/core/test/ts/atomic/schema/CustomElementsRuleParserTest.ts +53 -0
  418. package/src/core/test/ts/atomic/schema/GlobalAttributesSetTest.ts +42 -0
  419. package/src/core/test/ts/atomic/schema/PresetsTest.ts +42 -0
  420. package/src/core/test/ts/atomic/schema/SchemaElementSetsTest.ts +122 -0
  421. package/src/core/test/ts/atomic/schema/SchemaLookupTableTest.ts +37 -0
  422. package/src/core/test/ts/atomic/schema/ValidChildrenRuleParserTest.ts +175 -0
  423. package/src/core/test/ts/atomic/schema/ValidElementsRuleParserTest.ts +331 -0
  424. package/src/core/test/ts/atomic/text/BidiTest.ts +12 -0
  425. package/src/core/test/ts/atomic/text/ExtendingCharTest.ts +11 -0
  426. package/src/core/test/ts/atomic/text/WhitespaceTest.ts +32 -0
  427. package/src/core/test/ts/atomic/text/ZwspTest.ts +12 -0
  428. package/src/core/test/ts/atomic/textpatterns/FindBlockPatternsTest.ts +47 -0
  429. package/src/core/test/ts/atomic/util/LazyEvaluatorTest.ts +26 -0
  430. package/src/core/test/ts/atomic/util/PredicateTest.ts +25 -0
  431. package/src/core/test/ts/browser/AddOnManagerTest.ts +90 -0
  432. package/src/core/test/ts/browser/ClickContentEditableFalseTest.ts +76 -0
  433. package/src/core/test/ts/browser/DragDropOverridesTest.ts +801 -0
  434. package/src/core/test/ts/browser/EditableRootTest.ts +97 -0
  435. package/src/core/test/ts/browser/EditorAutoFocusTest.ts +84 -0
  436. package/src/core/test/ts/browser/EditorCleanupTest.ts +65 -0
  437. package/src/core/test/ts/browser/EditorManagerCommandsTest.ts +87 -0
  438. package/src/core/test/ts/browser/EditorManagerSetupTest.ts +40 -0
  439. package/src/core/test/ts/browser/EditorManagerTest.ts +206 -0
  440. package/src/core/test/ts/browser/EditorOptionsTest.ts +227 -0
  441. package/src/core/test/ts/browser/EditorRemoveTest.ts +101 -0
  442. package/src/core/test/ts/browser/EditorRemovedApiTest.ts +43 -0
  443. package/src/core/test/ts/browser/EditorRtlTest.ts +36 -0
  444. package/src/core/test/ts/browser/EditorTest.ts +543 -0
  445. package/src/core/test/ts/browser/EditorUploadTest.ts +663 -0
  446. package/src/core/test/ts/browser/EditorViewTest.ts +101 -0
  447. package/src/core/test/ts/browser/FakeClipboardTest.ts +83 -0
  448. package/src/core/test/ts/browser/FontSelectCustomTest.ts +63 -0
  449. package/src/core/test/ts/browser/FontSelectTest.ts +172 -0
  450. package/src/core/test/ts/browser/ForceBlocksTest.ts +167 -0
  451. package/src/core/test/ts/browser/FormatterApplyTest.ts +2563 -0
  452. package/src/core/test/ts/browser/FormatterCheckTest.ts +358 -0
  453. package/src/core/test/ts/browser/FormatterClosestTest.ts +79 -0
  454. package/src/core/test/ts/browser/FormatterRemoveTest.ts +619 -0
  455. package/src/core/test/ts/browser/FormattingCommandsTest.ts +554 -0
  456. package/src/core/test/ts/browser/InlineEditorRemoveTest.ts +28 -0
  457. package/src/core/test/ts/browser/InlineEditorSaveTest.ts +27 -0
  458. package/src/core/test/ts/browser/MiscCommandsTest.ts +75 -0
  459. package/src/core/test/ts/browser/ModeTest.ts +111 -0
  460. package/src/core/test/ts/browser/NotificationManagerTest.ts +256 -0
  461. package/src/core/test/ts/browser/PadEmptyWithBrTest.ts +38 -0
  462. package/src/core/test/ts/browser/ReadOnlyModeTest.ts +305 -0
  463. package/src/core/test/ts/browser/ResourceTest.ts +86 -0
  464. package/src/core/test/ts/browser/SelectionOverridesTest.ts +338 -0
  465. package/src/core/test/ts/browser/ShortcutsTest.ts +106 -0
  466. package/src/core/test/ts/browser/UndoManagerTest.ts +759 -0
  467. package/src/core/test/ts/browser/WindowManagerTest.ts +46 -0
  468. package/src/core/test/ts/browser/annotate/AnnotateBlocksTest.ts +723 -0
  469. package/src/core/test/ts/browser/annotate/AnnotateTest.ts +209 -0
  470. package/src/core/test/ts/browser/annotate/AnnotationChangedTest.ts +352 -0
  471. package/src/core/test/ts/browser/annotate/AnnotationPersistenceTest.ts +129 -0
  472. package/src/core/test/ts/browser/annotate/AnnotationRemovedTest.ts +211 -0
  473. package/src/core/test/ts/browser/annotate/AnnotationStylingTest.ts +311 -0
  474. package/src/core/test/ts/browser/api/EditorCommandsTest.ts +341 -0
  475. package/src/core/test/ts/browser/api/OptionsTest.ts +34 -0
  476. package/src/core/test/ts/browser/api/commands/ContentCommandsTest.ts +91 -0
  477. package/src/core/test/ts/browser/api/commands/NewBlockCommandsTest.ts +251 -0
  478. package/src/core/test/ts/browser/api/commands/NewlineCommandsTest.ts +131 -0
  479. package/src/core/test/ts/browser/api/dom/RangeExpandTest.ts +77 -0
  480. package/src/core/test/ts/browser/api/dom/RangeUtilsTest.ts +45 -0
  481. package/src/core/test/ts/browser/bookmark/BookmarksTest.ts +313 -0
  482. package/src/core/test/ts/browser/bookmark/CaretBookmarkTest.ts +163 -0
  483. package/src/core/test/ts/browser/caret/CaretCandidateTest.ts +60 -0
  484. package/src/core/test/ts/browser/caret/CaretContainerRemoveTest.ts +63 -0
  485. package/src/core/test/ts/browser/caret/CaretContainerTest.ts +163 -0
  486. package/src/core/test/ts/browser/caret/CaretFinderTest.ts +410 -0
  487. package/src/core/test/ts/browser/caret/CaretPositionPredicatesTest.ts +59 -0
  488. package/src/core/test/ts/browser/caret/CaretPositionTest.ts +202 -0
  489. package/src/core/test/ts/browser/caret/CaretUtilsTest.ts +249 -0
  490. package/src/core/test/ts/browser/caret/CaretWalkerTest.ts +308 -0
  491. package/src/core/test/ts/browser/caret/ClosestCaretCandidateTest.ts +717 -0
  492. package/src/core/test/ts/browser/caret/FakeCaretTest.ts +143 -0
  493. package/src/core/test/ts/browser/caret/FakeCaretTypeTest.ts +29 -0
  494. package/src/core/test/ts/browser/caret/FirefoxFakeCaretBeforeTableTypeTest.ts +54 -0
  495. package/src/core/test/ts/browser/caret/LineReaderTest.ts +539 -0
  496. package/src/core/test/ts/browser/caret/LineUtilsTest.ts +22 -0
  497. package/src/core/test/ts/browser/caret/LineWalkerTest.ts +93 -0
  498. package/src/core/test/ts/browser/caret/TableCellsTest.ts +249 -0
  499. package/src/core/test/ts/browser/commands/ContentLangTest.ts +83 -0
  500. package/src/core/test/ts/browser/commands/LineHeightTest.ts +95 -0
  501. package/src/core/test/ts/browser/commands/OutdentCommandTest.ts +151 -0
  502. package/src/core/test/ts/browser/content/CustomElementsTest.ts +39 -0
  503. package/src/core/test/ts/browser/content/EditorContentEventsTest.ts +153 -0
  504. package/src/core/test/ts/browser/content/EditorContentForcedRootBlockTest.ts +20 -0
  505. package/src/core/test/ts/browser/content/EditorContentNotInitializedTest.ts +86 -0
  506. package/src/core/test/ts/browser/content/EditorContentTest.ts +704 -0
  507. package/src/core/test/ts/browser/content/EditorContentWsTest.ts +18 -0
  508. package/src/core/test/ts/browser/content/EditorGetContentRawTest.ts +86 -0
  509. package/src/core/test/ts/browser/content/EditorGetContentTextFormatTest.ts +35 -0
  510. package/src/core/test/ts/browser/content/EditorGetContentTreeTest.ts +49 -0
  511. package/src/core/test/ts/browser/content/EditorResetContentTest.ts +97 -0
  512. package/src/core/test/ts/browser/content/HTMLDataURLsTest.ts +32 -0
  513. package/src/core/test/ts/browser/content/InsertContentCommandTest.ts +429 -0
  514. package/src/core/test/ts/browser/content/InsertContentTest.ts +869 -0
  515. package/src/core/test/ts/browser/content/InsertContentWebKitBugs.ts +21 -0
  516. package/src/core/test/ts/browser/content/InsertListTest.ts +48 -0
  517. package/src/core/test/ts/browser/content/InsertUnsanitizedContentTest.ts +40 -0
  518. package/src/core/test/ts/browser/content/PlaceholderVisuallyEmptyTest.ts +54 -0
  519. package/src/core/test/ts/browser/content/TransparentElementsTest.ts +242 -0
  520. package/src/core/test/ts/browser/delete/BlockBoundaryDeleteTest.ts +494 -0
  521. package/src/core/test/ts/browser/delete/BlockMergeBoundaryTest.ts +113 -0
  522. package/src/core/test/ts/browser/delete/BlockRangeDeleteTest.ts +162 -0
  523. package/src/core/test/ts/browser/delete/CaretBoundaryDeleteTest.ts +123 -0
  524. package/src/core/test/ts/browser/delete/CefDeleteActionTest.ts +336 -0
  525. package/src/core/test/ts/browser/delete/CefDeleteNoneditableTest.ts +106 -0
  526. package/src/core/test/ts/browser/delete/CefDeleteTest.ts +321 -0
  527. package/src/core/test/ts/browser/delete/DeleteBeforeInputEventTest.ts +23 -0
  528. package/src/core/test/ts/browser/delete/DeleteCommandsTest.ts +106 -0
  529. package/src/core/test/ts/browser/delete/DeleteElementTest.ts +242 -0
  530. package/src/core/test/ts/browser/delete/DeleteUtilsTest.ts +119 -0
  531. package/src/core/test/ts/browser/delete/DetailsDeleteTest.ts +162 -0
  532. package/src/core/test/ts/browser/delete/ImageBlockDeleteTest.ts +66 -0
  533. package/src/core/test/ts/browser/delete/InlineBoundaryDeleteTest.ts +126 -0
  534. package/src/core/test/ts/browser/delete/InlineFormatDeleteTest.ts +986 -0
  535. package/src/core/test/ts/browser/delete/InlineFormatPostShortcutDeleteTest.ts +324 -0
  536. package/src/core/test/ts/browser/delete/MediaDeleteTest.ts +83 -0
  537. package/src/core/test/ts/browser/delete/MergeBlocksTest.ts +243 -0
  538. package/src/core/test/ts/browser/delete/OutdentTest.ts +43 -0
  539. package/src/core/test/ts/browser/delete/TableDeleteActionTest.ts +197 -0
  540. package/src/core/test/ts/browser/delete/TableDeleteTest.ts +671 -0
  541. package/src/core/test/ts/browser/dom/ContentCssCorsTest.ts +129 -0
  542. package/src/core/test/ts/browser/dom/ControlSelectionTest.ts +265 -0
  543. package/src/core/test/ts/browser/dom/DimensionsTest.ts +45 -0
  544. package/src/core/test/ts/browser/dom/DomUtilsTest.ts +991 -0
  545. package/src/core/test/ts/browser/dom/ElementTypeTest.ts +78 -0
  546. package/src/core/test/ts/browser/dom/EmptyTest.ts +79 -0
  547. package/src/core/test/ts/browser/dom/EventUtilsTest.ts +497 -0
  548. package/src/core/test/ts/browser/dom/NodePathTest.ts +41 -0
  549. package/src/core/test/ts/browser/dom/NodeTypeTest.ts +123 -0
  550. package/src/core/test/ts/browser/dom/PaddingBrTest.ts +59 -0
  551. package/src/core/test/ts/browser/dom/ParentsTest.ts +99 -0
  552. package/src/core/test/ts/browser/dom/RangePointTest.ts +42 -0
  553. package/src/core/test/ts/browser/dom/ReferrerPolicyTest.ts +45 -0
  554. package/src/core/test/ts/browser/dom/ScriptLoaderTest.ts +113 -0
  555. package/src/core/test/ts/browser/dom/ScrollIntoViewTest.ts +305 -0
  556. package/src/core/test/ts/browser/dom/SelectionEventsTest.ts +116 -0
  557. package/src/core/test/ts/browser/dom/SelectionQuirksTest.ts +84 -0
  558. package/src/core/test/ts/browser/dom/SelectionTest.ts +1380 -0
  559. package/src/core/test/ts/browser/dom/SerializerEventsTest.ts +50 -0
  560. package/src/core/test/ts/browser/dom/SerializerTest.ts +926 -0
  561. package/src/core/test/ts/browser/dom/StyleSheetLoaderRegistryTest.ts +40 -0
  562. package/src/core/test/ts/browser/dom/StyleSheetLoaderTest.ts +70 -0
  563. package/src/core/test/ts/browser/dom/TreeWalkerTest.ts +97 -0
  564. package/src/core/test/ts/browser/dom/TrimBodyTest.ts +188 -0
  565. package/src/core/test/ts/browser/dom/TrimNodeTest.ts +52 -0
  566. package/src/core/test/ts/browser/file/BlobCacheTest.ts +98 -0
  567. package/src/core/test/ts/browser/file/ConversionsTest.ts +25 -0
  568. package/src/core/test/ts/browser/file/ImageScannerTest.ts +71 -0
  569. package/src/core/test/ts/browser/file/UploadStatusTest.ts +33 -0
  570. package/src/core/test/ts/browser/fmt/BlockFormatsTest.ts +75 -0
  571. package/src/core/test/ts/browser/fmt/CaretFormatTest.ts +894 -0
  572. package/src/core/test/ts/browser/fmt/DefaultFormatsWithSchemaTest.ts +79 -0
  573. package/src/core/test/ts/browser/fmt/ExpandRangeTest.ts +311 -0
  574. package/src/core/test/ts/browser/fmt/FontInfoTest.ts +158 -0
  575. package/src/core/test/ts/browser/fmt/FontsizeFormatTest.ts +25 -0
  576. package/src/core/test/ts/browser/fmt/FormatChangeSelectionTest.ts +111 -0
  577. package/src/core/test/ts/browser/fmt/FormatChangeVarsTest.ts +191 -0
  578. package/src/core/test/ts/browser/fmt/FormatEmptyLineTest.ts +428 -0
  579. package/src/core/test/ts/browser/fmt/FormatNoneditableTest.ts +762 -0
  580. package/src/core/test/ts/browser/fmt/HooksTest.ts +67 -0
  581. package/src/core/test/ts/browser/fmt/ListItemFormatTest.ts +377 -0
  582. package/src/core/test/ts/browser/fmt/MediaAlignTest.ts +81 -0
  583. package/src/core/test/ts/browser/fmt/PreviewTest.ts +255 -0
  584. package/src/core/test/ts/browser/fmt/RemoveFormatTest.ts +284 -0
  585. package/src/core/test/ts/browser/fmt/RemoveHighlightFormatTest.ts +48 -0
  586. package/src/core/test/ts/browser/fmt/RemoveTrailingWhitespaceFormatTest.ts +44 -0
  587. package/src/core/test/ts/browser/fmt/TableFormatsTest.ts +178 -0
  588. package/src/core/test/ts/browser/fmt/TextDecorationColorTest.ts +197 -0
  589. package/src/core/test/ts/browser/focus/CefFocusTest.ts +34 -0
  590. package/src/core/test/ts/browser/focus/EditorFocusTest.ts +89 -0
  591. package/src/core/test/ts/browser/focus/FocusControllerTest.ts +83 -0
  592. package/src/core/test/ts/browser/focus/HighlightOnFocusTest.ts +146 -0
  593. package/src/core/test/ts/browser/focus/KeyboardShortcutElementPathFocusTest.ts +30 -0
  594. package/src/core/test/ts/browser/focus/KeyboardShortcutMenuFocusTest.ts +31 -0
  595. package/src/core/test/ts/browser/focus/MediaFocusTest.ts +27 -0
  596. package/src/core/test/ts/browser/geom/ClientRectTest.ts +118 -0
  597. package/src/core/test/ts/browser/geom/RectTest.ts +94 -0
  598. package/src/core/test/ts/browser/html/DomParserTest.ts +1702 -0
  599. package/src/core/test/ts/browser/html/EntitiesTest.ts +127 -0
  600. package/src/core/test/ts/browser/html/NamespaceTest.ts +61 -0
  601. package/src/core/test/ts/browser/html/NodeTest.ts +443 -0
  602. package/src/core/test/ts/browser/html/NonEditableFilterTest.ts +42 -0
  603. package/src/core/test/ts/browser/html/ParserUtilsTest.ts +78 -0
  604. package/src/core/test/ts/browser/html/SanitizationTest.ts +75 -0
  605. package/src/core/test/ts/browser/html/SchemaTest.ts +887 -0
  606. package/src/core/test/ts/browser/html/SerializerTest.ts +70 -0
  607. package/src/core/test/ts/browser/html/StylesTest.ts +269 -0
  608. package/src/core/test/ts/browser/html/WriterTest.ts +155 -0
  609. package/src/core/test/ts/browser/init/ContentCssTest.ts +49 -0
  610. package/src/core/test/ts/browser/init/ContentStylePositionTest.ts +28 -0
  611. package/src/core/test/ts/browser/init/EditorCustomThemeTest.ts +141 -0
  612. package/src/core/test/ts/browser/init/EditorInitializationTest.ts +245 -0
  613. package/src/core/test/ts/browser/init/InitContentBodyDirectionalityTest.ts +48 -0
  614. package/src/core/test/ts/browser/init/InitContentBodyEditInitialContentTest.ts +43 -0
  615. package/src/core/test/ts/browser/init/InitContentBodyFiltersTest.ts +29 -0
  616. package/src/core/test/ts/browser/init/InitContentBodySelectionTest.ts +47 -0
  617. package/src/core/test/ts/browser/init/InitDocumentWriteTest.ts +21 -0
  618. package/src/core/test/ts/browser/init/InitEditorIconTest.ts +41 -0
  619. package/src/core/test/ts/browser/init/InitEditorLanguageTest.ts +27 -0
  620. package/src/core/test/ts/browser/init/InitEditorNoThemeIframeTest.ts +33 -0
  621. package/src/core/test/ts/browser/init/InitEditorNoThemeInlineTest.ts +42 -0
  622. package/src/core/test/ts/browser/init/InitEditorOnHiddenElementTest.ts +16 -0
  623. package/src/core/test/ts/browser/init/InitEditorPluginInitErrorTest.ts +50 -0
  624. package/src/core/test/ts/browser/init/InitEditorThemeFunctionIframeTest.ts +41 -0
  625. package/src/core/test/ts/browser/init/InitEditorThemeFunctionInlineTest.ts +49 -0
  626. package/src/core/test/ts/browser/init/InitEventsOrderTest.ts +45 -0
  627. package/src/core/test/ts/browser/init/InitIframeAriaTextTest.ts +34 -0
  628. package/src/core/test/ts/browser/init/InitIframeEditorCookiesTest.ts +22 -0
  629. package/src/core/test/ts/browser/init/InitIframeEditorWithCustomAttrsTest.ts +26 -0
  630. package/src/core/test/ts/browser/init/InitIframeEditorWithTabindexTest.ts +29 -0
  631. package/src/core/test/ts/browser/init/InitUnsanitizedContentTest.ts +28 -0
  632. package/src/core/test/ts/browser/init/LicenseKeyValidationTest.ts +143 -0
  633. package/src/core/test/ts/browser/init/RegisterFormatsBeforeSetContentTest.ts +33 -0
  634. package/src/core/test/ts/browser/init/ShadowDomEditorTest.ts +81 -0
  635. package/src/core/test/ts/browser/keyboard/ArrowKeysAnchorTest.ts +251 -0
  636. package/src/core/test/ts/browser/keyboard/ArrowKeysCefTest.ts +208 -0
  637. package/src/core/test/ts/browser/keyboard/ArrowKeysContentEndpointTest.ts +80 -0
  638. package/src/core/test/ts/browser/keyboard/ArrowKeysEdgeCefTest.ts +322 -0
  639. package/src/core/test/ts/browser/keyboard/ArrowKeysInlineBoundariesTest.ts +388 -0
  640. package/src/core/test/ts/browser/keyboard/ArrowKeysTableTest.ts +250 -0
  641. package/src/core/test/ts/browser/keyboard/AutocompleterTest.ts +197 -0
  642. package/src/core/test/ts/browser/keyboard/BoundaryCaretTest.ts +49 -0
  643. package/src/core/test/ts/browser/keyboard/BoundaryLocationTest.ts +216 -0
  644. package/src/core/test/ts/browser/keyboard/CaretAfterKoreanTest.ts +139 -0
  645. package/src/core/test/ts/browser/keyboard/EnterKeyAnchorTest.ts +180 -0
  646. package/src/core/test/ts/browser/keyboard/EnterKeyCeFalseTest.ts +105 -0
  647. package/src/core/test/ts/browser/keyboard/EnterKeyHrTest.ts +66 -0
  648. package/src/core/test/ts/browser/keyboard/EnterKeyListsTest.ts +520 -0
  649. package/src/core/test/ts/browser/keyboard/EnterKeyTest.ts +684 -0
  650. package/src/core/test/ts/browser/keyboard/FormatShortcutsTest.ts +117 -0
  651. package/src/core/test/ts/browser/keyboard/HomeEndKeysTest.ts +165 -0
  652. package/src/core/test/ts/browser/keyboard/InlineUtilsTest.ts +199 -0
  653. package/src/core/test/ts/browser/keyboard/InsertKeysTest.ts +331 -0
  654. package/src/core/test/ts/browser/keyboard/KeyboardCellNavigationTest.ts +88 -0
  655. package/src/core/test/ts/browser/keyboard/KeyboardEventTest.ts +26 -0
  656. package/src/core/test/ts/browser/keyboard/MediaNavigationTest.ts +113 -0
  657. package/src/core/test/ts/browser/keyboard/PreventNoneditableInputTest.ts +92 -0
  658. package/src/core/test/ts/browser/keyboard/SpaceKeyBeforeInputEventTest.ts +23 -0
  659. package/src/core/test/ts/browser/keyboard/SpaceKeyTest.ts +144 -0
  660. package/src/core/test/ts/browser/keyboard/TableNavigationTest.ts +92 -0
  661. package/src/core/test/ts/browser/keyboard/TableTabKeyNavigationTest.ts +228 -0
  662. package/src/core/test/ts/browser/keyboard/TableTabNavigationDisabledTest.ts +22 -0
  663. package/src/core/test/ts/browser/keyboard/TypeTextAtCefTest.ts +43 -0
  664. package/src/core/test/ts/browser/newline/ForcedRootBlockTest.ts +172 -0
  665. package/src/core/test/ts/browser/newline/InsertBrTest.ts +128 -0
  666. package/src/core/test/ts/browser/newline/InsertNewLineTest.ts +853 -0
  667. package/src/core/test/ts/browser/newline/NewlineBeforeInputEventTest.ts +22 -0
  668. package/src/core/test/ts/browser/options/NormalizeOptionsTest.ts +254 -0
  669. package/src/core/test/ts/browser/paste/CutNoneditableTest.ts +26 -0
  670. package/src/core/test/ts/browser/paste/DragDropImageTest.ts +69 -0
  671. package/src/core/test/ts/browser/paste/DragDropSummaryTest.ts +60 -0
  672. package/src/core/test/ts/browser/paste/DragDropTransparentsTest.ts +57 -0
  673. package/src/core/test/ts/browser/paste/ImagePasteTest.ts +195 -0
  674. package/src/core/test/ts/browser/paste/InternalClipboardTest.ts +248 -0
  675. package/src/core/test/ts/browser/paste/PasteBinTest.ts +91 -0
  676. package/src/core/test/ts/browser/paste/PasteFormatToggleTest.ts +31 -0
  677. package/src/core/test/ts/browser/paste/PasteOptionsTest.ts +24 -0
  678. package/src/core/test/ts/browser/paste/PasteStylesTest.ts +79 -0
  679. package/src/core/test/ts/browser/paste/PasteTest.ts +580 -0
  680. package/src/core/test/ts/browser/paste/PlainTextPasteTest.ts +60 -0
  681. package/src/core/test/ts/browser/paste/ProcessFiltersTest.ts +150 -0
  682. package/src/core/test/ts/browser/paste/SmartPasteTest.ts +241 -0
  683. package/src/core/test/ts/browser/paste/UnsanitizedPasteTest.ts +38 -0
  684. package/src/core/test/ts/browser/selection/DetailsElementTest.ts +156 -0
  685. package/src/core/test/ts/browser/selection/FragmentReaderTest.ts +236 -0
  686. package/src/core/test/ts/browser/selection/GetSelectionContentTest.ts +151 -0
  687. package/src/core/test/ts/browser/selection/InlineBoundarySelectionTest.ts +42 -0
  688. package/src/core/test/ts/browser/selection/MultiClickSelectionTest.ts +224 -0
  689. package/src/core/test/ts/browser/selection/NoneditableRootElementSelectionTest.ts +100 -0
  690. package/src/core/test/ts/browser/selection/NormalizeRangeTest.ts +347 -0
  691. package/src/core/test/ts/browser/selection/RangeInsertNodeTest.ts +82 -0
  692. package/src/core/test/ts/browser/selection/RangeNormalizerTest.ts +98 -0
  693. package/src/core/test/ts/browser/selection/RangeWalkTest.ts +112 -0
  694. package/src/core/test/ts/browser/selection/SelectBeforeBlockTest.ts +33 -0
  695. package/src/core/test/ts/browser/selection/SelectionBookmarkInlineEditorTest.ts +148 -0
  696. package/src/core/test/ts/browser/selection/SelectionBookmarkTest.ts +189 -0
  697. package/src/core/test/ts/browser/selection/SelectionUtilsTest.ts +72 -0
  698. package/src/core/test/ts/browser/selection/SetSelectionContentTest.ts +297 -0
  699. package/src/core/test/ts/browser/selection/SimpleTableModelTest.ts +132 -0
  700. package/src/core/test/ts/browser/selection/TableCellSelectionTest.ts +46 -0
  701. package/src/core/test/ts/browser/text/ZwspInsertTest.ts +42 -0
  702. package/src/core/test/ts/browser/textpatterns/BlockPatternsOnSpaceTest.ts +288 -0
  703. package/src/core/test/ts/browser/textpatterns/FindBlockPatternsTest.ts +232 -0
  704. package/src/core/test/ts/browser/textpatterns/FindInlinePatternTest.ts +470 -0
  705. package/src/core/test/ts/browser/textpatterns/ReplacementTest.ts +197 -0
  706. package/src/core/test/ts/browser/textpatterns/TextPatternsFalseTest.ts +36 -0
  707. package/src/core/test/ts/browser/textpatterns/TextPatternsLookupTest.ts +38 -0
  708. package/src/core/test/ts/browser/textpatterns/TextPatternsPublicApiTest.ts +124 -0
  709. package/src/core/test/ts/browser/textpatterns/TextPatternsTest.ts +377 -0
  710. package/src/core/test/ts/browser/textpatterns/TextSearchTest.ts +139 -0
  711. package/src/core/test/ts/browser/textpatterns/TrailingPunctuationTest.ts +55 -0
  712. package/src/core/test/ts/browser/textpatterns/TriggerInlinePatternBeginningTest.ts +33 -0
  713. package/src/core/test/ts/browser/textpatterns/UndoTextPatternsTest.ts +35 -0
  714. package/src/core/test/ts/browser/undo/DiffTest.ts +22 -0
  715. package/src/core/test/ts/browser/undo/ForcedRootBlockTest.ts +48 -0
  716. package/src/core/test/ts/browser/undo/FragmentsTest.ts +44 -0
  717. package/src/core/test/ts/browser/undo/LevelsTest.ts +214 -0
  718. package/src/core/test/ts/browser/undo/UndoKeyboardShortcutsTest.ts +41 -0
  719. package/src/core/test/ts/browser/util/DelayTest.ts +51 -0
  720. package/src/core/test/ts/browser/util/EventDispatcherTest.ts +373 -0
  721. package/src/core/test/ts/browser/util/FakeStorageTest.ts +95 -0
  722. package/src/core/test/ts/browser/util/I18nTest.ts +124 -0
  723. package/src/core/test/ts/browser/util/ImageUploaderTest.ts +81 -0
  724. package/src/core/test/ts/browser/util/ObservableTest.ts +76 -0
  725. package/src/core/test/ts/browser/util/QuirksFirefoxTest.ts +101 -0
  726. package/src/core/test/ts/browser/util/QuirksWebkitTest.ts +360 -0
  727. package/src/core/test/ts/browser/util/ToolsTest.ts +11 -0
  728. package/src/core/test/ts/browser/util/UriTest.ts +175 -0
  729. package/src/core/test/ts/browser/util/UtilsTest.ts +22 -0
  730. package/src/core/test/ts/module/McAgar.ts +10 -0
  731. package/src/core/test/ts/module/test/AnnotationAsserts.ts +83 -0
  732. package/src/core/test/ts/module/test/BeforeInputEventUtils.ts +49 -0
  733. package/src/core/test/ts/module/test/CaretAsserts.ts +49 -0
  734. package/src/core/test/ts/module/test/DialogUtils.ts +30 -0
  735. package/src/core/test/ts/module/test/DragDropUtils.ts +22 -0
  736. package/src/core/test/ts/module/test/ErrorHelpers.ts +30 -0
  737. package/src/core/test/ts/module/test/HtmlUtils.ts +13 -0
  738. package/src/core/test/ts/module/test/InputEventUtils.ts +42 -0
  739. package/src/core/test/ts/module/test/KeyUtils.ts +113 -0
  740. package/src/core/test/ts/module/test/PasteEventUtils.ts +102 -0
  741. package/src/core/test/ts/module/test/PasteStrings.ts +13 -0
  742. package/src/core/test/ts/module/test/SingletonUtils.ts +7 -0
  743. package/src/core/test/ts/module/test/TableUtils.ts +21 -0
  744. package/src/core/test/ts/module/test/TextPatternsUtils.ts +145 -0
  745. package/src/core/test/ts/module/test/ViewBlock.ts +61 -0
  746. package/src/core/test/ts/webdriver/content/PlaceholderTest.ts +134 -0
  747. package/src/core/test/ts/webdriver/delete/InlineFormatRetentionTest.ts +42 -0
  748. package/src/core/test/ts/webdriver/delete/ShortcutDeleteTest.ts +215 -0
  749. package/src/core/test/ts/webdriver/keyboard/IframeTabfocusTest.ts +73 -0
  750. package/src/core/test/ts/webdriver/keyboard/PageUpDownKeysTest.ts +89 -0
  751. package/src/core/test/ts/webdriver/keyboard/SpaceKeyTest.ts +139 -0
  752. package/src/core/test/ts/webdriver/paste/CopyAndPasteTest.ts +275 -0
  753. package/src/core/test/ts/webdriver/paste/CutTest.ts +42 -0
  754. package/src/core/text/build-header.js +3 -0
  755. package/src/models/dom/demo/html/demo/basic-demo.html +28 -0
  756. package/src/models/dom/demo/ts/demo/Demo.ts +14 -0
  757. package/src/models/dom/main/ts/Main.ts +9 -0
  758. package/src/models/dom/main/ts/Model.ts +16 -0
  759. package/src/models/dom/main/ts/table/Table.ts +33 -0
  760. package/src/models/dom/main/ts/table/actions/Clipboard.ts +76 -0
  761. package/src/models/dom/main/ts/table/actions/InsertTable.ts +84 -0
  762. package/src/models/dom/main/ts/table/actions/TableActions.ts +213 -0
  763. package/src/models/dom/main/ts/table/api/Clipboard.ts +67 -0
  764. package/src/models/dom/main/ts/table/api/Commands.ts +253 -0
  765. package/src/models/dom/main/ts/table/api/Events.ts +77 -0
  766. package/src/models/dom/main/ts/table/api/Options.ts +181 -0
  767. package/src/models/dom/main/ts/table/api/QueryCommands.ts +30 -0
  768. package/src/models/dom/main/ts/table/api/TableCellSelectionHandler.ts +210 -0
  769. package/src/models/dom/main/ts/table/api/TableResizeHandler.ts +240 -0
  770. package/src/models/dom/main/ts/table/core/TableUtils.ts +69 -0
  771. package/src/models/dom/main/ts/table/core/TableWire.ts +36 -0
  772. package/src/models/dom/main/ts/table/queries/TableSize.ts +19 -0
  773. package/src/models/dom/main/ts/table/queries/TableTargets.ts +42 -0
  774. package/src/models/dom/main/ts/table/selection/Ephemera.ts +28 -0
  775. package/src/models/dom/main/ts/table/selection/TableSelection.ts +45 -0
  776. package/src/models/dom/test/ts/atomic/table/TableUtilsTest.ts +35 -0
  777. package/src/models/dom/test/ts/browser/table/DragEditorContentsOverTableTest.ts +25 -0
  778. package/src/models/dom/test/ts/browser/table/DragResizeTest.ts +453 -0
  779. package/src/models/dom/test/ts/browser/table/DragSelectionTest.ts +46 -0
  780. package/src/models/dom/test/ts/browser/table/EmptyRowTableTest.ts +28 -0
  781. package/src/models/dom/test/ts/browser/table/FakeSelectionTest.ts +279 -0
  782. package/src/models/dom/test/ts/browser/table/InsertColumnTableSizeTest.ts +175 -0
  783. package/src/models/dom/test/ts/browser/table/InsertRowTableResizeTest.ts +185 -0
  784. package/src/models/dom/test/ts/browser/table/InsertTableTest.ts +47 -0
  785. package/src/models/dom/test/ts/browser/table/InsertTableWidthsTest.ts +58 -0
  786. package/src/models/dom/test/ts/browser/table/InvalidColCountTest.ts +126 -0
  787. package/src/models/dom/test/ts/browser/table/ModifyColumnsTableResizeTest.ts +677 -0
  788. package/src/models/dom/test/ts/browser/table/NestedFakeSelectionTest.ts +289 -0
  789. package/src/models/dom/test/ts/browser/table/NewCellRowEventsTest.ts +42 -0
  790. package/src/models/dom/test/ts/browser/table/PasteTableTest.ts +65 -0
  791. package/src/models/dom/test/ts/browser/table/ResizeTableTest.ts +1035 -0
  792. package/src/models/dom/test/ts/browser/table/SwitchTableSectionTest.ts +352 -0
  793. package/src/models/dom/test/ts/browser/table/TableNoWidthTest.ts +41 -0
  794. package/src/models/dom/test/ts/browser/table/TableSectionApiTest.ts +406 -0
  795. package/src/models/dom/test/ts/browser/table/TableSizingModeTest.ts +98 -0
  796. package/src/models/dom/test/ts/browser/table/TwoCellsSelectionTest.ts +114 -0
  797. package/src/models/dom/test/ts/browser/table/UnmergeCellTableResizeTest.ts +304 -0
  798. package/src/models/dom/test/ts/browser/table/command/ApplyCellStyleCommandTest.ts +220 -0
  799. package/src/models/dom/test/ts/browser/table/command/CommandsOnLockedColumnsTest.ts +185 -0
  800. package/src/models/dom/test/ts/browser/table/command/InsertCommandsTest.ts +184 -0
  801. package/src/models/dom/test/ts/browser/table/command/InsertTableCommandTest.ts +110 -0
  802. package/src/models/dom/test/ts/browser/table/command/InsertTableCommandWithColGroupsTest.ts +97 -0
  803. package/src/models/dom/test/ts/browser/table/command/MergeCellCommandTest.ts +353 -0
  804. package/src/models/dom/test/ts/browser/table/command/ModifyClassesCommandsTest.ts +303 -0
  805. package/src/models/dom/test/ts/browser/table/command/TableDeleteColumnTest.ts +154 -0
  806. package/src/models/dom/test/ts/browser/table/command/TableDeleteCommandTest.ts +39 -0
  807. package/src/models/dom/test/ts/browser/table/command/TableDeleteRowTest.ts +152 -0
  808. package/src/models/dom/test/ts/browser/table/command/TableSizingModeCommandTest.ts +119 -0
  809. package/src/models/dom/test/ts/browser/table/command/TableSizingModeCommandWithColGroupsTest.ts +77 -0
  810. package/src/models/dom/test/ts/module/table/TableSizingModeCommandUtil.ts +92 -0
  811. package/src/models/dom/test/ts/module/table/TableTestUtils.ts +302 -0
  812. package/src/plugins/accordion/demo/html/demo.html +26 -0
  813. package/src/plugins/accordion/demo/ts/demo/Demo.ts +14 -0
  814. package/src/plugins/accordion/main/ts/Main.ts +9 -0
  815. package/src/plugins/accordion/main/ts/Plugin.ts +17 -0
  816. package/src/plugins/accordion/main/ts/api/Commands.ts +12 -0
  817. package/src/plugins/accordion/main/ts/api/Events.ts +13 -0
  818. package/src/plugins/accordion/main/ts/core/Actions.ts +90 -0
  819. package/src/plugins/accordion/main/ts/core/FilterContent.ts +153 -0
  820. package/src/plugins/accordion/main/ts/core/Identifiers.ts +14 -0
  821. package/src/plugins/accordion/main/ts/core/Keyboard.ts +27 -0
  822. package/src/plugins/accordion/main/ts/core/Quirks.ts +24 -0
  823. package/src/plugins/accordion/main/ts/core/Utils.ts +79 -0
  824. package/src/plugins/accordion/main/ts/ui/Buttons.ts +39 -0
  825. package/src/plugins/accordion/test/ts/browser/AccordionFormattingTest.ts +36 -0
  826. package/src/plugins/accordion/test/ts/browser/AccordionNavigationTest.ts +56 -0
  827. package/src/plugins/accordion/test/ts/browser/AccordionPluginTest.ts +241 -0
  828. package/src/plugins/accordion/test/ts/browser/DirectionalityTest.ts +58 -0
  829. package/src/plugins/accordion/test/ts/browser/FilterContentTest.ts +373 -0
  830. package/src/plugins/accordion/test/ts/browser/QuirksTest.ts +34 -0
  831. package/src/plugins/accordion/test/ts/module/AccordionUtils.ts +18 -0
  832. package/src/plugins/accordion/test/ts/webdriver/AccordionBackspaceDeleteTest.ts +649 -0
  833. package/src/plugins/accordion/test/ts/webdriver/AccordionEnterTest.ts +80 -0
  834. package/src/plugins/advlist/demo/html/demo.html +16 -0
  835. package/src/plugins/advlist/demo/ts/demo/Demo.ts +12 -0
  836. package/src/plugins/advlist/main/ts/Main.ts +9 -0
  837. package/src/plugins/advlist/main/ts/Plugin.ts +18 -0
  838. package/src/plugins/advlist/main/ts/api/Commands.ts +17 -0
  839. package/src/plugins/advlist/main/ts/api/Options.ts +31 -0
  840. package/src/plugins/advlist/main/ts/core/Actions.ts +10 -0
  841. package/src/plugins/advlist/main/ts/core/ListUtils.ts +58 -0
  842. package/src/plugins/advlist/main/ts/ui/Buttons.ts +97 -0
  843. package/src/plugins/advlist/test/ts/browser/AdvlistOptionsAndToolbarTest.ts +356 -0
  844. package/src/plugins/advlist/test/ts/browser/AdvlistPluginTest.ts +200 -0
  845. package/src/plugins/advlist/test/ts/browser/ChangeListStyleTest.ts +107 -0
  846. package/src/plugins/advlist/test/ts/browser/ContentEditableFalseTest.ts +97 -0
  847. package/src/plugins/advlist/test/ts/browser/ListUtilsTest.ts +22 -0
  848. package/src/plugins/advlist/test/ts/browser/NoneditableRootTest.ts +57 -0
  849. package/src/plugins/advlist/test/ts/browser/SplitButtonTest.ts +234 -0
  850. package/src/plugins/anchor/demo/html/demo.html +16 -0
  851. package/src/plugins/anchor/demo/ts/demo/Demo.ts +12 -0
  852. package/src/plugins/anchor/main/ts/Main.ts +9 -0
  853. package/src/plugins/anchor/main/ts/Plugin.ts +20 -0
  854. package/src/plugins/anchor/main/ts/api/Commands.ts +13 -0
  855. package/src/plugins/anchor/main/ts/api/Options.ts +24 -0
  856. package/src/plugins/anchor/main/ts/core/Anchor.ts +76 -0
  857. package/src/plugins/anchor/main/ts/core/FilterContent.ts +32 -0
  858. package/src/plugins/anchor/main/ts/core/Formats.ts +24 -0
  859. package/src/plugins/anchor/main/ts/core/Utils.ts +25 -0
  860. package/src/plugins/anchor/main/ts/ui/Buttons.ts +45 -0
  861. package/src/plugins/anchor/main/ts/ui/Dialog.ts +60 -0
  862. package/src/plugins/anchor/test/ts/browser/AnchorAlertTest.ts +32 -0
  863. package/src/plugins/anchor/test/ts/browser/AnchorAllowHtmlTest.ts +104 -0
  864. package/src/plugins/anchor/test/ts/browser/AnchorEditTest.ts +30 -0
  865. package/src/plugins/anchor/test/ts/browser/AnchorFormatsTest.ts +57 -0
  866. package/src/plugins/anchor/test/ts/browser/AnchorInlineTest.ts +26 -0
  867. package/src/plugins/anchor/test/ts/browser/AnchorSanityTest.ts +63 -0
  868. package/src/plugins/anchor/test/ts/browser/NoneditableRootTest.ts +40 -0
  869. package/src/plugins/anchor/test/ts/module/Helpers.ts +21 -0
  870. package/src/plugins/autolink/demo/html/demo.html +15 -0
  871. package/src/plugins/autolink/demo/ts/demo/Demo.ts +12 -0
  872. package/src/plugins/autolink/main/ts/Main.ts +9 -0
  873. package/src/plugins/autolink/main/ts/Plugin.ts +11 -0
  874. package/src/plugins/autolink/main/ts/api/Options.ts +42 -0
  875. package/src/plugins/autolink/main/ts/core/Keys.ts +151 -0
  876. package/src/plugins/autolink/main/ts/core/Utils.ts +50 -0
  877. package/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts +225 -0
  878. package/src/plugins/autolink/test/ts/browser/ConsecutiveLinkTest.ts +30 -0
  879. package/src/plugins/autolink/test/ts/browser/EnterKeyTest.ts +24 -0
  880. package/src/plugins/autolink/test/ts/browser/FragmentedTextTest.ts +60 -0
  881. package/src/plugins/autolink/test/ts/module/test/KeyUtils.ts +159 -0
  882. package/src/plugins/autoresize/demo/html/demo.html +15 -0
  883. package/src/plugins/autoresize/demo/ts/demo/Demo.ts +13 -0
  884. package/src/plugins/autoresize/main/ts/Main.ts +9 -0
  885. package/src/plugins/autoresize/main/ts/Plugin.ts +30 -0
  886. package/src/plugins/autoresize/main/ts/api/Commands.ts +15 -0
  887. package/src/plugins/autoresize/main/ts/api/Events.ts +9 -0
  888. package/src/plugins/autoresize/main/ts/api/Options.ts +35 -0
  889. package/src/plugins/autoresize/main/ts/core/Resize.ts +187 -0
  890. package/src/plugins/autoresize/test/ts/browser/AutoresizePluginTest.ts +230 -0
  891. package/src/plugins/autosave/demo/html/demo.html +15 -0
  892. package/src/plugins/autosave/demo/ts/demo/Demo.ts +16 -0
  893. package/src/plugins/autosave/main/ts/Main.ts +9 -0
  894. package/src/plugins/autosave/main/ts/Plugin.ts +30 -0
  895. package/src/plugins/autosave/main/ts/api/Api.ts +23 -0
  896. package/src/plugins/autosave/main/ts/api/Events.ts +17 -0
  897. package/src/plugins/autosave/main/ts/api/Options.ts +72 -0
  898. package/src/plugins/autosave/main/ts/core/BeforeUnload.ts +32 -0
  899. package/src/plugins/autosave/main/ts/core/Storage.ts +91 -0
  900. package/src/plugins/autosave/main/ts/core/Time.ts +13 -0
  901. package/src/plugins/autosave/main/ts/ui/Buttons.ts +42 -0
  902. package/src/plugins/autosave/test/ts/browser/AutoSavePluginTest.ts +141 -0
  903. package/src/plugins/autosave/test/ts/browser/ShouldRestoreWhenEmptyTest.ts +63 -0
  904. package/src/plugins/charmap/demo/html/demo.html +15 -0
  905. package/src/plugins/charmap/demo/ts/demo/Demo.ts +13 -0
  906. package/src/plugins/charmap/main/ts/Main.ts +9 -0
  907. package/src/plugins/charmap/main/ts/Plugin.ts +21 -0
  908. package/src/plugins/charmap/main/ts/api/Api.ts +28 -0
  909. package/src/plugins/charmap/main/ts/api/Commands.ts +16 -0
  910. package/src/plugins/charmap/main/ts/api/Events.ts +10 -0
  911. package/src/plugins/charmap/main/ts/api/Options.ts +36 -0
  912. package/src/plugins/charmap/main/ts/core/Actions.ts +12 -0
  913. package/src/plugins/charmap/main/ts/core/CharMap.ts +414 -0
  914. package/src/plugins/charmap/main/ts/core/Scan.ts +37 -0
  915. package/src/plugins/charmap/main/ts/ui/Autocompletion.ts +26 -0
  916. package/src/plugins/charmap/main/ts/ui/Buttons.ts +37 -0
  917. package/src/plugins/charmap/main/ts/ui/Dialog.ts +99 -0
  918. package/src/plugins/charmap/test/ts/atomic/ScanTest.ts +33 -0
  919. package/src/plugins/charmap/test/ts/browser/CharmapAutocompletionTest.ts +23 -0
  920. package/src/plugins/charmap/test/ts/browser/CharmapDialogHeightTest.ts +80 -0
  921. package/src/plugins/charmap/test/ts/browser/CharmapPluginTest.ts +108 -0
  922. package/src/plugins/charmap/test/ts/browser/CharmapSearchTest.ts +55 -0
  923. package/src/plugins/charmap/test/ts/browser/CharmapUserDefinedTest.ts +30 -0
  924. package/src/plugins/charmap/test/ts/browser/InsertQuotationMarkTest.ts +24 -0
  925. package/src/plugins/charmap/test/ts/browser/NoneditableRootTest.ts +40 -0
  926. package/src/plugins/charmap/test/ts/module/Helpers.ts +12 -0
  927. package/src/plugins/code/demo/html/demo.html +15 -0
  928. package/src/plugins/code/demo/ts/demo/Demo.ts +12 -0
  929. package/src/plugins/code/main/ts/Main.ts +9 -0
  930. package/src/plugins/code/main/ts/Plugin.ts +13 -0
  931. package/src/plugins/code/main/ts/api/Commands.ts +13 -0
  932. package/src/plugins/code/main/ts/core/Content.ts +24 -0
  933. package/src/plugins/code/main/ts/ui/Buttons.ts +22 -0
  934. package/src/plugins/code/main/ts/ui/Dialog.ts +45 -0
  935. package/src/plugins/code/test/ts/browser/CodeSanityTest.ts +51 -0
  936. package/src/plugins/code/test/ts/browser/CodeTextareaTest.ts +36 -0
  937. package/src/plugins/codesample/demo/html/demo.html +16 -0
  938. package/src/plugins/codesample/demo/ts/demo/Demo.ts +22 -0
  939. package/src/plugins/codesample/main/ts/Main.ts +9 -0
  940. package/src/plugins/codesample/main/ts/Plugin.ts +23 -0
  941. package/src/plugins/codesample/main/ts/api/Commands.ts +19 -0
  942. package/src/plugins/codesample/main/ts/api/Options.ts +32 -0
  943. package/src/plugins/codesample/main/ts/core/CodeSample.ts +44 -0
  944. package/src/plugins/codesample/main/ts/core/FilterContent.ts +70 -0
  945. package/src/plugins/codesample/main/ts/core/Languages.ts +41 -0
  946. package/src/plugins/codesample/main/ts/prism/Prism.ts +15 -0
  947. package/src/plugins/codesample/main/ts/prism/prismjs.d.ts +4 -0
  948. package/src/plugins/codesample/main/ts/ui/Buttons.ts +50 -0
  949. package/src/plugins/codesample/main/ts/ui/Dialog.ts +62 -0
  950. package/src/plugins/codesample/main/ts/util/Utils.ts +16 -0
  951. package/src/plugins/codesample/test/ts/browser/ChangeCodeSampleTest.ts +28 -0
  952. package/src/plugins/codesample/test/ts/browser/CodeSampleSanityTest.ts +52 -0
  953. package/src/plugins/codesample/test/ts/browser/CodeSampleSelectionTest.ts +46 -0
  954. package/src/plugins/codesample/test/ts/browser/NoneditableRootTest.ts +40 -0
  955. package/src/plugins/codesample/test/ts/module/CodeSampleTestUtils.ts +89 -0
  956. package/src/plugins/codesample/test/ts/webdriver/CodeSampleCopyAndPasteTest.ts +134 -0
  957. package/src/plugins/directionality/demo/html/demo.html +15 -0
  958. package/src/plugins/directionality/demo/ts/demo/Demo.ts +12 -0
  959. package/src/plugins/directionality/main/ts/Main.ts +9 -0
  960. package/src/plugins/directionality/main/ts/Plugin.ts +11 -0
  961. package/src/plugins/directionality/main/ts/api/Commands.ts +17 -0
  962. package/src/plugins/directionality/main/ts/core/Direction.ts +65 -0
  963. package/src/plugins/directionality/main/ts/ui/Buttons.ts +38 -0
  964. package/src/plugins/directionality/test/ts/browser/CommandsTest.ts +43 -0
  965. package/src/plugins/directionality/test/ts/browser/DirectionStyleTest.ts +319 -0
  966. package/src/plugins/directionality/test/ts/browser/DirectionalitySanityTest.ts +169 -0
  967. package/src/plugins/directionality/test/ts/browser/NoneditableRootTest.ts +36 -0
  968. package/src/plugins/emoticons/demo/html/demo.html +15 -0
  969. package/src/plugins/emoticons/demo/ts/demo/Demo.ts +19 -0
  970. package/src/plugins/emoticons/main/ts/Main.ts +9 -0
  971. package/src/plugins/emoticons/main/ts/Plugin.ts +34 -0
  972. package/src/plugins/emoticons/main/ts/api/Commands.ts +12 -0
  973. package/src/plugins/emoticons/main/ts/api/Options.ts +60 -0
  974. package/src/plugins/emoticons/main/ts/core/Actions.ts +9 -0
  975. package/src/plugins/emoticons/main/ts/core/EmojiDatabase.ts +150 -0
  976. package/src/plugins/emoticons/main/ts/core/Filters.ts +14 -0
  977. package/src/plugins/emoticons/main/ts/core/Lookup.ts +31 -0
  978. package/src/plugins/emoticons/main/ts/ui/Autocompletion.ts +28 -0
  979. package/src/plugins/emoticons/main/ts/ui/Buttons.ts +37 -0
  980. package/src/plugins/emoticons/main/ts/ui/Dialog.ts +134 -0
  981. package/src/plugins/emoticons/test/js/test-emojis-alt.js +717 -0
  982. package/src/plugins/emoticons/test/js/test-emojis.js +27 -0
  983. package/src/plugins/emoticons/test/ts/browser/DifferentEmojiDatabaseTest.ts +50 -0
  984. package/src/plugins/emoticons/test/ts/browser/EmojiAppendTest.ts +76 -0
  985. package/src/plugins/emoticons/test/ts/browser/EmojiSearchTest.ts +54 -0
  986. package/src/plugins/emoticons/test/ts/browser/EmoticonAutocompletionTest.ts +29 -0
  987. package/src/plugins/emoticons/test/ts/browser/EmoticonsPluginTest.ts +21 -0
  988. package/src/plugins/emoticons/test/ts/browser/ImageEmojiTest.ts +58 -0
  989. package/src/plugins/emoticons/test/ts/browser/NoneditableRootTest.ts +40 -0
  990. package/src/plugins/emoticons/test/ts/module/test/Utils.ts +12 -0
  991. package/src/plugins/fullscreen/demo/html/demo.html +18 -0
  992. package/src/plugins/fullscreen/demo/ts/demo/Demo.ts +20 -0
  993. package/src/plugins/fullscreen/main/ts/Main.ts +9 -0
  994. package/src/plugins/fullscreen/main/ts/Plugin.ts +27 -0
  995. package/src/plugins/fullscreen/main/ts/api/Api.ts +15 -0
  996. package/src/plugins/fullscreen/main/ts/api/Commands.ts +15 -0
  997. package/src/plugins/fullscreen/main/ts/api/Events.ts +10 -0
  998. package/src/plugins/fullscreen/main/ts/api/Options.ts +24 -0
  999. package/src/plugins/fullscreen/main/ts/core/Actions.ts +202 -0
  1000. package/src/plugins/fullscreen/main/ts/core/NativeFullscreen.ts +58 -0
  1001. package/src/plugins/fullscreen/main/ts/core/Thor.ts +68 -0
  1002. package/src/plugins/fullscreen/main/ts/ui/Buttons.ts +38 -0
  1003. package/src/plugins/fullscreen/test/ts/browser/FullScreenPluginTest.ts +219 -0
  1004. package/src/plugins/fullscreen/test/ts/browser/FullScreenSinkTest.ts +27 -0
  1005. package/src/plugins/fullscreen/test/ts/browser/FullscreenPluginInlineEditorTest.ts +22 -0
  1006. package/src/plugins/fullscreen/test/ts/browser/FullscreenRestoreScrollTest.ts +52 -0
  1007. package/src/plugins/fullscreen/test/ts/webdriver/FullscreenPluginNativeModeTest.ts +38 -0
  1008. package/src/plugins/help/demo/html/demo.html +26 -0
  1009. package/src/plugins/help/demo/ts/demo/Demo.ts +149 -0
  1010. package/src/plugins/help/i18n/keynav/ar.html +89 -0
  1011. package/src/plugins/help/i18n/keynav/bg_BG.html +89 -0
  1012. package/src/plugins/help/i18n/keynav/ca.html +89 -0
  1013. package/src/plugins/help/i18n/keynav/cs.html +89 -0
  1014. package/src/plugins/help/i18n/keynav/da.html +89 -0
  1015. package/src/plugins/help/i18n/keynav/de.html +89 -0
  1016. package/src/plugins/help/i18n/keynav/el.html +89 -0
  1017. package/src/plugins/help/i18n/keynav/en.html +89 -0
  1018. package/src/plugins/help/i18n/keynav/es.html +89 -0
  1019. package/src/plugins/help/i18n/keynav/eu.html +89 -0
  1020. package/src/plugins/help/i18n/keynav/fa.html +89 -0
  1021. package/src/plugins/help/i18n/keynav/fi.html +89 -0
  1022. package/src/plugins/help/i18n/keynav/fr_FR.html +89 -0
  1023. package/src/plugins/help/i18n/keynav/he_IL.html +89 -0
  1024. package/src/plugins/help/i18n/keynav/hi.html +89 -0
  1025. package/src/plugins/help/i18n/keynav/hr.html +89 -0
  1026. package/src/plugins/help/i18n/keynav/hu_HU.html +89 -0
  1027. package/src/plugins/help/i18n/keynav/id.html +89 -0
  1028. package/src/plugins/help/i18n/keynav/it.html +89 -0
  1029. package/src/plugins/help/i18n/keynav/ja.html +89 -0
  1030. package/src/plugins/help/i18n/keynav/kk.html +89 -0
  1031. package/src/plugins/help/i18n/keynav/ko_KR.html +89 -0
  1032. package/src/plugins/help/i18n/keynav/ms.html +89 -0
  1033. package/src/plugins/help/i18n/keynav/nb_NO.html +89 -0
  1034. package/src/plugins/help/i18n/keynav/nl.html +89 -0
  1035. package/src/plugins/help/i18n/keynav/pl.html +89 -0
  1036. package/src/plugins/help/i18n/keynav/pt_BR.html +89 -0
  1037. package/src/plugins/help/i18n/keynav/pt_PT.html +89 -0
  1038. package/src/plugins/help/i18n/keynav/ro.html +89 -0
  1039. package/src/plugins/help/i18n/keynav/ru.html +89 -0
  1040. package/src/plugins/help/i18n/keynav/sk.html +89 -0
  1041. package/src/plugins/help/i18n/keynav/sl_SI.html +89 -0
  1042. package/src/plugins/help/i18n/keynav/sv_SE.html +89 -0
  1043. package/src/plugins/help/i18n/keynav/th_TH.html +89 -0
  1044. package/src/plugins/help/i18n/keynav/tr.html +89 -0
  1045. package/src/plugins/help/i18n/keynav/uk.html +89 -0
  1046. package/src/plugins/help/i18n/keynav/vi.html +89 -0
  1047. package/src/plugins/help/i18n/keynav/zh_CN.html +83 -0
  1048. package/src/plugins/help/i18n/keynav/zh_TW.html +89 -0
  1049. package/src/plugins/help/main/ts/Main.ts +9 -0
  1050. package/src/plugins/help/main/ts/Plugin.ts +30 -0
  1051. package/src/plugins/help/main/ts/alien/ConvertShortcut.ts +34 -0
  1052. package/src/plugins/help/main/ts/api/Api.ts +24 -0
  1053. package/src/plugins/help/main/ts/api/Commands.ts +9 -0
  1054. package/src/plugins/help/main/ts/api/Options.ts +28 -0
  1055. package/src/plugins/help/main/ts/data/KeyboardShortcuts.ts +33 -0
  1056. package/src/plugins/help/main/ts/data/PluginUrls.ts +92 -0
  1057. package/src/plugins/help/main/ts/ui/Buttons.ts +20 -0
  1058. package/src/plugins/help/main/ts/ui/Dialog.ts +98 -0
  1059. package/src/plugins/help/main/ts/ui/KeyboardNavTab.ts +21 -0
  1060. package/src/plugins/help/main/ts/ui/KeyboardNavTabI18n.ts +21 -0
  1061. package/src/plugins/help/main/ts/ui/KeyboardShortcutsTab.ts +36 -0
  1062. package/src/plugins/help/main/ts/ui/PluginsTab.ts +119 -0
  1063. package/src/plugins/help/main/ts/ui/VersionTab.ts +27 -0
  1064. package/src/plugins/help/test/ts/browser/CustomTabsTest.ts +146 -0
  1065. package/src/plugins/help/test/ts/browser/DialogKeyboardNavTest.ts +106 -0
  1066. package/src/plugins/help/test/ts/browser/IgnoreForcedPluginsTest.ts +31 -0
  1067. package/src/plugins/help/test/ts/browser/KeyboardNavTabI18nTest.ts +59 -0
  1068. package/src/plugins/help/test/ts/browser/MetadataTest.ts +33 -0
  1069. package/src/plugins/help/test/ts/browser/PluginTabsOrderTest.ts +59 -0
  1070. package/src/plugins/help/test/ts/browser/PluginTest.ts +28 -0
  1071. package/src/plugins/help/test/ts/module/PluginAssert.ts +11 -0
  1072. package/src/plugins/help/test/ts/module/Selectors.ts +10 -0
  1073. package/src/plugins/help/test/ts/module/test/FakePlugin.ts +17 -0
  1074. package/src/plugins/help/test/ts/module/test/NoMetaFakePlugin.ts +7 -0
  1075. package/src/plugins/image/demo/html/demo.html +18 -0
  1076. package/src/plugins/image/demo/ts/demo/Demo.ts +34 -0
  1077. package/src/plugins/image/main/ts/Main.ts +9 -0
  1078. package/src/plugins/image/main/ts/Plugin.ts +15 -0
  1079. package/src/plugins/image/main/ts/api/Commands.ts +19 -0
  1080. package/src/plugins/image/main/ts/api/Options.ts +100 -0
  1081. package/src/plugins/image/main/ts/core/FilterContent.ts +38 -0
  1082. package/src/plugins/image/main/ts/core/ImageData.ts +308 -0
  1083. package/src/plugins/image/main/ts/core/ImageSelection.ts +142 -0
  1084. package/src/plugins/image/main/ts/core/ListUtils.ts +68 -0
  1085. package/src/plugins/image/main/ts/core/Utils.ts +179 -0
  1086. package/src/plugins/image/main/ts/ui/AdvTab.ts +56 -0
  1087. package/src/plugins/image/main/ts/ui/Buttons.ts +56 -0
  1088. package/src/plugins/image/main/ts/ui/Dialog.ts +405 -0
  1089. package/src/plugins/image/main/ts/ui/DialogInfo.ts +62 -0
  1090. package/src/plugins/image/main/ts/ui/DialogTypes.ts +75 -0
  1091. package/src/plugins/image/main/ts/ui/MainTab.ts +99 -0
  1092. package/src/plugins/image/main/ts/ui/UploadTab.ts +21 -0
  1093. package/src/plugins/image/test/ts/browser/A11yImageTest.ts +156 -0
  1094. package/src/plugins/image/test/ts/browser/ContextMenuTest.ts +93 -0
  1095. package/src/plugins/image/test/ts/browser/DecorativeImageDialogTest.ts +95 -0
  1096. package/src/plugins/image/test/ts/browser/DialogTest.ts +139 -0
  1097. package/src/plugins/image/test/ts/browser/DialogUpdateTest.ts +67 -0
  1098. package/src/plugins/image/test/ts/browser/FigureDeleteTest.ts +39 -0
  1099. package/src/plugins/image/test/ts/browser/FigureResizeTest.ts +66 -0
  1100. package/src/plugins/image/test/ts/browser/ImageListTest.ts +29 -0
  1101. package/src/plugins/image/test/ts/browser/ImagePluginTest.ts +217 -0
  1102. package/src/plugins/image/test/ts/browser/ImageResizeTest.ts +34 -0
  1103. package/src/plugins/image/test/ts/browser/NoneditableRootTest.ts +40 -0
  1104. package/src/plugins/image/test/ts/browser/UploadTabTest.ts +205 -0
  1105. package/src/plugins/image/test/ts/browser/api/CommandsTest.ts +157 -0
  1106. package/src/plugins/image/test/ts/browser/core/ImageAlignTest.ts +207 -0
  1107. package/src/plugins/image/test/ts/browser/core/ImageDataTest.ts +688 -0
  1108. package/src/plugins/image/test/ts/browser/core/ImageSelectionTest.ts +290 -0
  1109. package/src/plugins/image/test/ts/browser/plugin/DefaultEmptyTest.ts +39 -0
  1110. package/src/plugins/image/test/ts/browser/plugin/DimensionsFalseTest.ts +31 -0
  1111. package/src/plugins/image/test/ts/browser/plugin/MainTabTest.ts +98 -0
  1112. package/src/plugins/image/test/ts/browser/plugin/PrependAbsoluteTest.ts +36 -0
  1113. package/src/plugins/image/test/ts/browser/plugin/PrependRelativeTest.ts +36 -0
  1114. package/src/plugins/image/test/ts/module/Helpers.ts +140 -0
  1115. package/src/plugins/importcss/demo/css/rules.css +92 -0
  1116. package/src/plugins/importcss/demo/html/demo.html +15 -0
  1117. package/src/plugins/importcss/demo/ts/demo/Demo.ts +16 -0
  1118. package/src/plugins/importcss/main/ts/Main.ts +9 -0
  1119. package/src/plugins/importcss/main/ts/Plugin.ts +13 -0
  1120. package/src/plugins/importcss/main/ts/api/Api.ts +22 -0
  1121. package/src/plugins/importcss/main/ts/api/Options.ts +78 -0
  1122. package/src/plugins/importcss/main/ts/core/ImportCss.ts +287 -0
  1123. package/src/plugins/importcss/main/ts/core/SelectorModel.ts +59 -0
  1124. package/src/plugins/importcss/test/css/advanced.css +7 -0
  1125. package/src/plugins/importcss/test/css/basic.css +11 -0
  1126. package/src/plugins/importcss/test/css/clashing.css +3 -0
  1127. package/src/plugins/importcss/test/css/internal.css +18 -0
  1128. package/src/plugins/importcss/test/css/other-adv.css +3 -0
  1129. package/src/plugins/importcss/test/ts/browser/ImportCssGroupsPluginTest.ts +191 -0
  1130. package/src/plugins/importcss/test/ts/browser/ImportCssPluginTest.ts +342 -0
  1131. package/src/plugins/importcss/test/ts/module/MenuNavigationTestUtils.ts +58 -0
  1132. package/src/plugins/insertdatetime/demo/html/demo.html +15 -0
  1133. package/src/plugins/insertdatetime/demo/ts/demo/Demo.ts +16 -0
  1134. package/src/plugins/insertdatetime/main/ts/Main.ts +9 -0
  1135. package/src/plugins/insertdatetime/main/ts/Plugin.ts +13 -0
  1136. package/src/plugins/insertdatetime/main/ts/api/Commands.ts +18 -0
  1137. package/src/plugins/insertdatetime/main/ts/api/Options.ts +51 -0
  1138. package/src/plugins/insertdatetime/main/ts/core/Actions.ts +76 -0
  1139. package/src/plugins/insertdatetime/main/ts/ui/Buttons.ts +67 -0
  1140. package/src/plugins/insertdatetime/test/ts/browser/InsertDatetimeSanityTest.ts +35 -0
  1141. package/src/plugins/insertdatetime/test/ts/browser/NoneditableRootTest.ts +40 -0
  1142. package/src/plugins/link/demo/html/demo.html +21 -0
  1143. package/src/plugins/link/demo/ts/demo/Demo.ts +33 -0
  1144. package/src/plugins/link/main/ts/Main.ts +9 -0
  1145. package/src/plugins/link/main/ts/Plugin.ts +20 -0
  1146. package/src/plugins/link/main/ts/api/Commands.ts +24 -0
  1147. package/src/plugins/link/main/ts/api/Options.ts +112 -0
  1148. package/src/plugins/link/main/ts/api/Types.ts +6 -0
  1149. package/src/plugins/link/main/ts/core/Actions.ts +114 -0
  1150. package/src/plugins/link/main/ts/core/Keyboard.ts +11 -0
  1151. package/src/plugins/link/main/ts/core/ListOptions.ts +57 -0
  1152. package/src/plugins/link/main/ts/core/OpenUrl.ts +21 -0
  1153. package/src/plugins/link/main/ts/core/Utils.ts +333 -0
  1154. package/src/plugins/link/main/ts/ui/Controls.ts +172 -0
  1155. package/src/plugins/link/main/ts/ui/Dialog.ts +165 -0
  1156. package/src/plugins/link/main/ts/ui/DialogChanges.ts +105 -0
  1157. package/src/plugins/link/main/ts/ui/DialogConfirms.ts +64 -0
  1158. package/src/plugins/link/main/ts/ui/DialogInfo.ts +62 -0
  1159. package/src/plugins/link/main/ts/ui/DialogTypes.ts +81 -0
  1160. package/src/plugins/link/main/ts/ui/sections/AnchorListOptions.ts +21 -0
  1161. package/src/plugins/link/main/ts/ui/sections/ClassListOptions.ts +22 -0
  1162. package/src/plugins/link/main/ts/ui/sections/LinkListOptions.ts +45 -0
  1163. package/src/plugins/link/main/ts/ui/sections/RelOptions.ts +24 -0
  1164. package/src/plugins/link/main/ts/ui/sections/TargetOptions.ts +31 -0
  1165. package/src/plugins/link/test/ts/atomic/DialogChangesTest.ts +132 -0
  1166. package/src/plugins/link/test/ts/browser/AllowUnsafeLinkTargetTest.ts +80 -0
  1167. package/src/plugins/link/test/ts/browser/AnchorFalseTest.ts +40 -0
  1168. package/src/plugins/link/test/ts/browser/AssumeExternalTargetsTest.ts +108 -0
  1169. package/src/plugins/link/test/ts/browser/ContextMenuTest.ts +58 -0
  1170. package/src/plugins/link/test/ts/browser/ContextToolbarTest.ts +73 -0
  1171. package/src/plugins/link/test/ts/browser/DefaultLinkProtocolTest.ts +73 -0
  1172. package/src/plugins/link/test/ts/browser/DefaultLinkTargetTest.ts +81 -0
  1173. package/src/plugins/link/test/ts/browser/DialogFlowTest.ts +136 -0
  1174. package/src/plugins/link/test/ts/browser/DialogOpenTest.ts +143 -0
  1175. package/src/plugins/link/test/ts/browser/DialogSectionsTest.ts +159 -0
  1176. package/src/plugins/link/test/ts/browser/ImageFigureLinkTest.ts +50 -0
  1177. package/src/plugins/link/test/ts/browser/LinkContextMenuTest.ts +50 -0
  1178. package/src/plugins/link/test/ts/browser/LinkDialogOverrideTest.ts +69 -0
  1179. package/src/plugins/link/test/ts/browser/LinkJustFirstFieldTest.ts +40 -0
  1180. package/src/plugins/link/test/ts/browser/ListOptionsTest.ts +140 -0
  1181. package/src/plugins/link/test/ts/browser/NoneditableRootTest.ts +67 -0
  1182. package/src/plugins/link/test/ts/browser/PreventDefaultTest.ts +47 -0
  1183. package/src/plugins/link/test/ts/browser/QuickLinkTest.ts +219 -0
  1184. package/src/plugins/link/test/ts/browser/RemoveLinkTest.ts +70 -0
  1185. package/src/plugins/link/test/ts/browser/SelectedImageFigureLinkTest.ts +44 -0
  1186. package/src/plugins/link/test/ts/browser/SelectedImageLinkTest.ts +72 -0
  1187. package/src/plugins/link/test/ts/browser/SelectedLinkTest.ts +83 -0
  1188. package/src/plugins/link/test/ts/browser/SelectedTextLinkTest.ts +174 -0
  1189. package/src/plugins/link/test/ts/browser/UpdateLinkTest.ts +108 -0
  1190. package/src/plugins/link/test/ts/browser/UrlInputTest.ts +50 -0
  1191. package/src/plugins/link/test/ts/browser/UrlProtocolTest.ts +99 -0
  1192. package/src/plugins/link/test/ts/module/TestLinkUi.ts +137 -0
  1193. package/src/plugins/lists/demo/html/demo.html +15 -0
  1194. package/src/plugins/lists/demo/ts/demo/Demo.ts +13 -0
  1195. package/src/plugins/lists/main/ts/Main.ts +9 -0
  1196. package/src/plugins/lists/main/ts/Plugin.ts +28 -0
  1197. package/src/plugins/lists/main/ts/actions/Indendation.ts +45 -0
  1198. package/src/plugins/lists/main/ts/actions/ToggleList.ts +420 -0
  1199. package/src/plugins/lists/main/ts/actions/Update.ts +27 -0
  1200. package/src/plugins/lists/main/ts/api/Api.ts +17 -0
  1201. package/src/plugins/lists/main/ts/api/Commands.ts +65 -0
  1202. package/src/plugins/lists/main/ts/api/Events.ts +7 -0
  1203. package/src/plugins/lists/main/ts/api/Options.ts +28 -0
  1204. package/src/plugins/lists/main/ts/core/Bookmark.ts +126 -0
  1205. package/src/plugins/lists/main/ts/core/Delete.ts +317 -0
  1206. package/src/plugins/lists/main/ts/core/DlIndentation.ts +36 -0
  1207. package/src/plugins/lists/main/ts/core/FilterContent.ts +46 -0
  1208. package/src/plugins/lists/main/ts/core/Keyboard.ts +33 -0
  1209. package/src/plugins/lists/main/ts/core/ListAction.ts +15 -0
  1210. package/src/plugins/lists/main/ts/core/ListNumbering.ts +108 -0
  1211. package/src/plugins/lists/main/ts/core/NodeType.ts +84 -0
  1212. package/src/plugins/lists/main/ts/core/NormalizeLists.ts +44 -0
  1213. package/src/plugins/lists/main/ts/core/RangeUtils.ts +51 -0
  1214. package/src/plugins/lists/main/ts/core/Selection.ts +117 -0
  1215. package/src/plugins/lists/main/ts/core/SplitList.ts +56 -0
  1216. package/src/plugins/lists/main/ts/core/TextBlock.ts +52 -0
  1217. package/src/plugins/lists/main/ts/core/Util.ts +47 -0
  1218. package/src/plugins/lists/main/ts/listmodel/ComposeList.ts +130 -0
  1219. package/src/plugins/lists/main/ts/listmodel/Entry.ts +84 -0
  1220. package/src/plugins/lists/main/ts/listmodel/Indentation.ts +23 -0
  1221. package/src/plugins/lists/main/ts/listmodel/ListsIndendation.ts +65 -0
  1222. package/src/plugins/lists/main/ts/listmodel/NormalizeEntries.ts +46 -0
  1223. package/src/plugins/lists/main/ts/listmodel/ParseLists.ts +97 -0
  1224. package/src/plugins/lists/main/ts/listmodel/Util.ts +24 -0
  1225. package/src/plugins/lists/main/ts/ui/Buttons.ts +42 -0
  1226. package/src/plugins/lists/main/ts/ui/Dialog.ts +68 -0
  1227. package/src/plugins/lists/main/ts/ui/MenuItems.ts +35 -0
  1228. package/src/plugins/lists/test/ts/atomic/ListNumberingTest.ts +81 -0
  1229. package/src/plugins/lists/test/ts/browser/ApplyDlTest.ts +136 -0
  1230. package/src/plugins/lists/test/ts/browser/ApplyListOnCustomList.ts +46 -0
  1231. package/src/plugins/lists/test/ts/browser/ApplyListOnParagraphWithStylesTest.ts +30 -0
  1232. package/src/plugins/lists/test/ts/browser/ApplyTest.ts +949 -0
  1233. package/src/plugins/lists/test/ts/browser/ApplyToDivTest.ts +46 -0
  1234. package/src/plugins/lists/test/ts/browser/BackspaceDeleteFromBlockIntoLiTest.ts +147 -0
  1235. package/src/plugins/lists/test/ts/browser/BackspaceDeleteInlineTest.ts +59 -0
  1236. package/src/plugins/lists/test/ts/browser/BackspaceDeleteTest.ts +1003 -0
  1237. package/src/plugins/lists/test/ts/browser/ChangeListStyleTest.ts +86 -0
  1238. package/src/plugins/lists/test/ts/browser/ContentEditableFalseActionsTest.ts +171 -0
  1239. package/src/plugins/lists/test/ts/browser/CutDeleteTest.ts +44 -0
  1240. package/src/plugins/lists/test/ts/browser/FilterContentTest.ts +41 -0
  1241. package/src/plugins/lists/test/ts/browser/IndentTest.ts +698 -0
  1242. package/src/plugins/lists/test/ts/browser/InlineTest.ts +43 -0
  1243. package/src/plugins/lists/test/ts/browser/ListModelTest.ts +78 -0
  1244. package/src/plugins/lists/test/ts/browser/ListPropertiesTest.ts +254 -0
  1245. package/src/plugins/lists/test/ts/browser/NoneditableRootTest.ts +209 -0
  1246. package/src/plugins/lists/test/ts/browser/OutdentTest.ts +486 -0
  1247. package/src/plugins/lists/test/ts/browser/RemoveForcedRootBlockAttrsTest.ts +43 -0
  1248. package/src/plugins/lists/test/ts/browser/RemoveTest.ts +431 -0
  1249. package/src/plugins/lists/test/ts/browser/RetainContentTest.ts +164 -0
  1250. package/src/plugins/lists/test/ts/browser/StyleTest.ts +76 -0
  1251. package/src/plugins/lists/test/ts/browser/TableInListTest.ts +62 -0
  1252. package/src/plugins/lists/test/ts/browser/ToggleListInTableCell.ts +91 -0
  1253. package/src/plugins/lists/test/ts/browser/ToggleListWithEmptyLiTest.ts +24 -0
  1254. package/src/plugins/lists/test/ts/module/ArbList.ts +204 -0
  1255. package/src/plugins/lists/test/ts/webdriver/ContentEditableFalseTest.ts +111 -0
  1256. package/src/plugins/lists/test/ts/webdriver/ContextMenuTest.ts +30 -0
  1257. package/src/plugins/lists/test/ts/webdriver/DeleteTest.ts +64 -0
  1258. package/src/plugins/media/demo/html/demo.html +16 -0
  1259. package/src/plugins/media/demo/ts/demo/Demo.ts +28 -0
  1260. package/src/plugins/media/main/ts/Main.ts +9 -0
  1261. package/src/plugins/media/main/ts/Plugin.ts +21 -0
  1262. package/src/plugins/media/main/ts/api/Api.ts +21 -0
  1263. package/src/plugins/media/main/ts/api/Commands.ts +15 -0
  1264. package/src/plugins/media/main/ts/api/Options.ts +79 -0
  1265. package/src/plugins/media/main/ts/core/DataToHtml.ts +129 -0
  1266. package/src/plugins/media/main/ts/core/FilterContent.ts +105 -0
  1267. package/src/plugins/media/main/ts/core/HtmlToData.ts +81 -0
  1268. package/src/plugins/media/main/ts/core/Mime.ts +19 -0
  1269. package/src/plugins/media/main/ts/core/Nodes.ts +196 -0
  1270. package/src/plugins/media/main/ts/core/Parser.ts +9 -0
  1271. package/src/plugins/media/main/ts/core/ResolveName.ts +15 -0
  1272. package/src/plugins/media/main/ts/core/Sanitize.ts +16 -0
  1273. package/src/plugins/media/main/ts/core/Selection.ts +43 -0
  1274. package/src/plugins/media/main/ts/core/Service.ts +59 -0
  1275. package/src/plugins/media/main/ts/core/Types.ts +36 -0
  1276. package/src/plugins/media/main/ts/core/UpdateHtml.ts +126 -0
  1277. package/src/plugins/media/main/ts/core/UrlPatterns.ts +112 -0
  1278. package/src/plugins/media/main/ts/ui/Buttons.ts +48 -0
  1279. package/src/plugins/media/main/ts/ui/Dialog.ts +343 -0
  1280. package/src/plugins/media/test/ts/atomic/HtmlToDataTest.ts +96 -0
  1281. package/src/plugins/media/test/ts/atomic/UpdateHtmlTest.ts +38 -0
  1282. package/src/plugins/media/test/ts/atomic/UrlPatternsTest.ts +66 -0
  1283. package/src/plugins/media/test/ts/browser/ContentFormatsTest.ts +187 -0
  1284. package/src/plugins/media/test/ts/browser/DataAttributeTest.ts +58 -0
  1285. package/src/plugins/media/test/ts/browser/DataToHtmlTest.ts +157 -0
  1286. package/src/plugins/media/test/ts/browser/DataUnwrapTest.ts +61 -0
  1287. package/src/plugins/media/test/ts/browser/DimensionsFalseEmbedTest.ts +74 -0
  1288. package/src/plugins/media/test/ts/browser/EphoxEmbedTest.ts +108 -0
  1289. package/src/plugins/media/test/ts/browser/IsCachedResponseTest.ts +46 -0
  1290. package/src/plugins/media/test/ts/browser/LiveEmbedNodeTest.ts +153 -0
  1291. package/src/plugins/media/test/ts/browser/MediaAlignmentTest.ts +89 -0
  1292. package/src/plugins/media/test/ts/browser/MediaEmbedTest.ts +40 -0
  1293. package/src/plugins/media/test/ts/browser/MediaPluginSanityTest.ts +104 -0
  1294. package/src/plugins/media/test/ts/browser/NoAdvancedTabTest.ts +34 -0
  1295. package/src/plugins/media/test/ts/browser/NoneditableRootTest.ts +40 -0
  1296. package/src/plugins/media/test/ts/browser/PlaceholderTest.ts +138 -0
  1297. package/src/plugins/media/test/ts/browser/ReopenResizeTest.ts +52 -0
  1298. package/src/plugins/media/test/ts/browser/ScriptContentTest.ts +22 -0
  1299. package/src/plugins/media/test/ts/browser/SubmitTest.ts +173 -0
  1300. package/src/plugins/media/test/ts/browser/UpdateMediaPosterAttributeTest.ts +52 -0
  1301. package/src/plugins/media/test/ts/module/test/Utils.ts +212 -0
  1302. package/src/plugins/nonbreaking/demo/html/demo.html +15 -0
  1303. package/src/plugins/nonbreaking/demo/ts/demo/Demo.ts +14 -0
  1304. package/src/plugins/nonbreaking/main/ts/Main.ts +9 -0
  1305. package/src/plugins/nonbreaking/main/ts/Plugin.ts +22 -0
  1306. package/src/plugins/nonbreaking/main/ts/api/Commands.ts +13 -0
  1307. package/src/plugins/nonbreaking/main/ts/api/Options.ts +41 -0
  1308. package/src/plugins/nonbreaking/main/ts/core/Actions.ts +29 -0
  1309. package/src/plugins/nonbreaking/main/ts/core/Keyboard.ts +27 -0
  1310. package/src/plugins/nonbreaking/main/ts/ui/Buttons.ts +37 -0
  1311. package/src/plugins/nonbreaking/test/ts/browser/NonbreakingForceTabTest.ts +33 -0
  1312. package/src/plugins/nonbreaking/test/ts/browser/NonbreakingOptionsTest.ts +32 -0
  1313. package/src/plugins/nonbreaking/test/ts/browser/NonbreakingSanityTest.ts +37 -0
  1314. package/src/plugins/nonbreaking/test/ts/browser/NonbreakingVisualCharsTest.ts +69 -0
  1315. package/src/plugins/nonbreaking/test/ts/browser/NoneditableRootTest.ts +40 -0
  1316. package/src/plugins/nonbreaking/test/ts/webdriver/NonbreakingTypingTest.ts +117 -0
  1317. package/src/plugins/nonbreaking/test/ts/webdriver/NonbreakingVisualCharsTypingTest.ts +215 -0
  1318. package/src/plugins/nonbreaking/test/ts/webdriver/NonbreakingWrapTypingTest.ts +216 -0
  1319. package/src/plugins/pagebreak/demo/html/demo.html +15 -0
  1320. package/src/plugins/pagebreak/demo/ts/demo/Demo.ts +14 -0
  1321. package/src/plugins/pagebreak/main/ts/Main.ts +9 -0
  1322. package/src/plugins/pagebreak/main/ts/Plugin.ts +17 -0
  1323. package/src/plugins/pagebreak/main/ts/api/Commands.ts +14 -0
  1324. package/src/plugins/pagebreak/main/ts/api/Options.ts +31 -0
  1325. package/src/plugins/pagebreak/main/ts/core/FilterContent.ts +56 -0
  1326. package/src/plugins/pagebreak/main/ts/core/ResolveName.ts +15 -0
  1327. package/src/plugins/pagebreak/main/ts/ui/Buttons.ts +37 -0
  1328. package/src/plugins/pagebreak/test/ts/browser/NoneditableRootTest.ts +40 -0
  1329. package/src/plugins/pagebreak/test/ts/browser/PageBreakSanityTest.ts +34 -0
  1330. package/src/plugins/pagebreak/test/ts/browser/PageBreakSplitBlockTest.ts +129 -0
  1331. package/src/plugins/preview/demo/html/demo.html +34 -0
  1332. package/src/plugins/preview/demo/ts/demo/Demo.ts +14 -0
  1333. package/src/plugins/preview/main/ts/Main.ts +9 -0
  1334. package/src/plugins/preview/main/ts/Plugin.ts +11 -0
  1335. package/src/plugins/preview/main/ts/api/Commands.ts +13 -0
  1336. package/src/plugins/preview/main/ts/api/Options.ts +20 -0
  1337. package/src/plugins/preview/main/ts/core/IframeContent.ts +62 -0
  1338. package/src/plugins/preview/main/ts/ui/Buttons.ts +21 -0
  1339. package/src/plugins/preview/main/ts/ui/Dialog.ts +39 -0
  1340. package/src/plugins/preview/test/ts/browser/PreviewContentCssTest.ts +33 -0
  1341. package/src/plugins/preview/test/ts/browser/PreviewContentStyleTest.ts +47 -0
  1342. package/src/plugins/preview/test/ts/browser/PreviewSanityTest.ts +40 -0
  1343. package/src/plugins/quickbars/demo/html/demo.html +68 -0
  1344. package/src/plugins/quickbars/demo/ts/demo/Demo.ts +56 -0
  1345. package/src/plugins/quickbars/main/ts/Main.ts +9 -0
  1346. package/src/plugins/quickbars/main/ts/Plugin.ts +16 -0
  1347. package/src/plugins/quickbars/main/ts/api/Options.ts +56 -0
  1348. package/src/plugins/quickbars/main/ts/insert/Actions.ts +20 -0
  1349. package/src/plugins/quickbars/main/ts/insert/Buttons.ts +35 -0
  1350. package/src/plugins/quickbars/main/ts/insert/Conversions.ts +15 -0
  1351. package/src/plugins/quickbars/main/ts/insert/Picker.ts +56 -0
  1352. package/src/plugins/quickbars/main/ts/insert/Toolbars.ts +34 -0
  1353. package/src/plugins/quickbars/main/ts/selection/Bookmark.ts +122 -0
  1354. package/src/plugins/quickbars/main/ts/selection/Toolbars.ts +39 -0
  1355. package/src/plugins/quickbars/test/ts/browser/ContentEditableTest.ts +122 -0
  1356. package/src/plugins/quickbars/test/ts/browser/InsertToolbarPredicateTest.ts +70 -0
  1357. package/src/plugins/quickbars/test/ts/browser/KeyboardShortcutContextToolbarTest.ts +30 -0
  1358. package/src/plugins/quickbars/test/ts/browser/OptionsTest.ts +84 -0
  1359. package/src/plugins/quickbars/test/ts/browser/SelectionToolbarTest.ts +106 -0
  1360. package/src/plugins/quickbars/test/ts/browser/ToolbarFalseTest.ts +45 -0
  1361. package/src/plugins/quickbars/test/ts/browser/ToolbarPositionTest.ts +384 -0
  1362. package/src/plugins/quickbars/test/ts/module/test/Utils.ts +15 -0
  1363. package/src/plugins/save/demo/html/demo.html +18 -0
  1364. package/src/plugins/save/demo/ts/demo/Demo.ts +15 -0
  1365. package/src/plugins/save/main/ts/Main.ts +9 -0
  1366. package/src/plugins/save/main/ts/Plugin.ts +13 -0
  1367. package/src/plugins/save/main/ts/api/Commands.ts +17 -0
  1368. package/src/plugins/save/main/ts/api/Options.ts +36 -0
  1369. package/src/plugins/save/main/ts/core/Actions.ts +69 -0
  1370. package/src/plugins/save/main/ts/ui/Buttons.ts +39 -0
  1371. package/src/plugins/save/test/ts/browser/SaveSanityTest.ts +29 -0
  1372. package/src/plugins/searchreplace/demo/html/demo.html +21 -0
  1373. package/src/plugins/searchreplace/demo/ts/demo/Demo.ts +16 -0
  1374. package/src/plugins/searchreplace/main/ts/Main.ts +9 -0
  1375. package/src/plugins/searchreplace/main/ts/Plugin.ts +26 -0
  1376. package/src/plugins/searchreplace/main/ts/api/Api.ts +47 -0
  1377. package/src/plugins/searchreplace/main/ts/api/Commands.ts +16 -0
  1378. package/src/plugins/searchreplace/main/ts/core/Actions.ts +280 -0
  1379. package/src/plugins/searchreplace/main/ts/core/FindMark.ts +67 -0
  1380. package/src/plugins/searchreplace/main/ts/core/TextCollect.ts +190 -0
  1381. package/src/plugins/searchreplace/main/ts/core/TextPosition.ts +69 -0
  1382. package/src/plugins/searchreplace/main/ts/core/Types.ts +21 -0
  1383. package/src/plugins/searchreplace/main/ts/ui/Buttons.ts +32 -0
  1384. package/src/plugins/searchreplace/main/ts/ui/Dialog.ts +263 -0
  1385. package/src/plugins/searchreplace/test/ts/browser/SearchReplaceDialogCyclingTest.ts +109 -0
  1386. package/src/plugins/searchreplace/test/ts/browser/SearchReplaceDialogTest.ts +144 -0
  1387. package/src/plugins/searchreplace/test/ts/browser/SearchReplaceInSelectionTest.ts +240 -0
  1388. package/src/plugins/searchreplace/test/ts/browser/SearchReplaceKeyboardNavigationTest.ts +100 -0
  1389. package/src/plugins/searchreplace/test/ts/browser/SearchReplacePluginTest.ts +212 -0
  1390. package/src/plugins/searchreplace/test/ts/browser/SearchReplacePrevNextTest.ts +64 -0
  1391. package/src/plugins/searchreplace/test/ts/browser/UndoReplaceSpanTest.ts +35 -0
  1392. package/src/plugins/searchreplace/test/ts/module/test/Utils.ts +77 -0
  1393. package/src/plugins/table/demo/html/demo.html +123 -0
  1394. package/src/plugins/table/demo/ts/demo/Demo.ts +43 -0
  1395. package/src/plugins/table/main/ts/Main.ts +9 -0
  1396. package/src/plugins/table/main/ts/Plugin.ts +23 -0
  1397. package/src/plugins/table/main/ts/actions/Styles.ts +54 -0
  1398. package/src/plugins/table/main/ts/api/Clipboard.ts +67 -0
  1399. package/src/plugins/table/main/ts/api/Commands.ts +27 -0
  1400. package/src/plugins/table/main/ts/api/Events.ts +34 -0
  1401. package/src/plugins/table/main/ts/api/Options.ts +183 -0
  1402. package/src/plugins/table/main/ts/core/Utils.ts +45 -0
  1403. package/src/plugins/table/main/ts/queries/TableTargets.ts +33 -0
  1404. package/src/plugins/table/main/ts/selection/Ephemera.ts +28 -0
  1405. package/src/plugins/table/main/ts/selection/SelectionTargets.ts +194 -0
  1406. package/src/plugins/table/main/ts/selection/TableSelection.ts +54 -0
  1407. package/src/plugins/table/main/ts/ui/Buttons.ts +334 -0
  1408. package/src/plugins/table/main/ts/ui/CellAlignValues.ts +22 -0
  1409. package/src/plugins/table/main/ts/ui/CellDialog.ts +204 -0
  1410. package/src/plugins/table/main/ts/ui/CellDialogGeneralTab.ts +70 -0
  1411. package/src/plugins/table/main/ts/ui/DialogAdvancedTab.ts +46 -0
  1412. package/src/plugins/table/main/ts/ui/DomModifier.ts +40 -0
  1413. package/src/plugins/table/main/ts/ui/Helpers.ts +243 -0
  1414. package/src/plugins/table/main/ts/ui/MenuItems.ts +374 -0
  1415. package/src/plugins/table/main/ts/ui/RowDialog.ts +168 -0
  1416. package/src/plugins/table/main/ts/ui/RowDialogGeneralTab.ts +52 -0
  1417. package/src/plugins/table/main/ts/ui/TableDialog.ts +255 -0
  1418. package/src/plugins/table/main/ts/ui/TableDialogGeneralTab.ts +92 -0
  1419. package/src/plugins/table/main/ts/ui/UiUtils.ts +165 -0
  1420. package/src/plugins/table/test/ts/atomic/UtilsTest.ts +30 -0
  1421. package/src/plugins/table/test/ts/browser/AlignedCellRowStyleChangeTest.ts +71 -0
  1422. package/src/plugins/table/test/ts/browser/ClipboardTest.ts +794 -0
  1423. package/src/plugins/table/test/ts/browser/HelpersTest.ts +288 -0
  1424. package/src/plugins/table/test/ts/browser/IndentListsInTableTest.ts +46 -0
  1425. package/src/plugins/table/test/ts/browser/InlineEditorInsideTableTest.ts +119 -0
  1426. package/src/plugins/table/test/ts/browser/NoneditableRootTest.ts +201 -0
  1427. package/src/plugins/table/test/ts/browser/TableCellPropsStyleTest.ts +34 -0
  1428. package/src/plugins/table/test/ts/browser/TableRemoveTrailingBrTest.ts +128 -0
  1429. package/src/plugins/table/test/ts/browser/settings/CustomTableToolbarTest.ts +26 -0
  1430. package/src/plugins/table/test/ts/browser/settings/DefaultTableToolbarTest.ts +25 -0
  1431. package/src/plugins/table/test/ts/browser/settings/TableAppearanceOptionsTest.ts +57 -0
  1432. package/src/plugins/table/test/ts/browser/settings/TableCellClassListTest.ts +125 -0
  1433. package/src/plugins/table/test/ts/browser/settings/TableClassListTest.ts +96 -0
  1434. package/src/plugins/table/test/ts/browser/settings/TableDefaultAttributesTest.ts +54 -0
  1435. package/src/plugins/table/test/ts/browser/settings/TableDefaultAttributesWithColGroupsTest.ts +54 -0
  1436. package/src/plugins/table/test/ts/browser/settings/TableDefaultStylesTest.ts +139 -0
  1437. package/src/plugins/table/test/ts/browser/settings/TableGridFalseTest.ts +32 -0
  1438. package/src/plugins/table/test/ts/browser/settings/TableRowClassListTest.ts +125 -0
  1439. package/src/plugins/table/test/ts/browser/settings/TableToolbarTest.ts +51 -0
  1440. package/src/plugins/table/test/ts/browser/settings/ToolbarButtonDisplayTest.ts +44 -0
  1441. package/src/plugins/table/test/ts/browser/ui/ContextMenuTest.ts +210 -0
  1442. package/src/plugins/table/test/ts/browser/ui/ContextToolbarTest.ts +153 -0
  1443. package/src/plugins/table/test/ts/browser/ui/LockedColumnDisabledButtonsTest.ts +236 -0
  1444. package/src/plugins/table/test/ts/browser/ui/TableBorderStyleTest.ts +72 -0
  1445. package/src/plugins/table/test/ts/browser/ui/TableBorderWidthTest.ts +54 -0
  1446. package/src/plugins/table/test/ts/browser/ui/TableCaptionTest.ts +199 -0
  1447. package/src/plugins/table/test/ts/browser/ui/TableCellBackgroundColorTest.ts +48 -0
  1448. package/src/plugins/table/test/ts/browser/ui/TableCellBorderColorTest.ts +50 -0
  1449. package/src/plugins/table/test/ts/browser/ui/TableCellDialogTest.ts +533 -0
  1450. package/src/plugins/table/test/ts/browser/ui/TableClassListButtonsTest.ts +116 -0
  1451. package/src/plugins/table/test/ts/browser/ui/TableColumnHeaderUiTest.ts +89 -0
  1452. package/src/plugins/table/test/ts/browser/ui/TableDialogKeyboardNavTest.ts +88 -0
  1453. package/src/plugins/table/test/ts/browser/ui/TableDialogStyleWithCssTest.ts +263 -0
  1454. package/src/plugins/table/test/ts/browser/ui/TableDialogTest.ts +632 -0
  1455. package/src/plugins/table/test/ts/browser/ui/TableDialogWithoutCssTest.ts +85 -0
  1456. package/src/plugins/table/test/ts/browser/ui/TableRowDialogTest.ts +667 -0
  1457. package/src/plugins/table/test/ts/browser/ui/TableRowHeaderUiTest.ts +105 -0
  1458. package/src/plugins/table/test/ts/browser/ui/TableValignButtonsTest.ts +96 -0
  1459. package/src/plugins/table/test/ts/module/test/TableModifiersTestUtils.ts +242 -0
  1460. package/src/plugins/table/test/ts/module/test/TableTestUtils.ts +273 -0
  1461. package/src/plugins/visualblocks/demo/html/demo.html +32 -0
  1462. package/src/plugins/visualblocks/demo/ts/demo/Demo.ts +33 -0
  1463. package/src/plugins/visualblocks/main/img/address.gif +0 -0
  1464. package/src/plugins/visualblocks/main/img/article.gif +0 -0
  1465. package/src/plugins/visualblocks/main/img/aside.gif +0 -0
  1466. package/src/plugins/visualblocks/main/img/blockquote.gif +0 -0
  1467. package/src/plugins/visualblocks/main/img/div.gif +0 -0
  1468. package/src/plugins/visualblocks/main/img/dl.gif +0 -0
  1469. package/src/plugins/visualblocks/main/img/figure.gif +0 -0
  1470. package/src/plugins/visualblocks/main/img/h1.gif +0 -0
  1471. package/src/plugins/visualblocks/main/img/h2.gif +0 -0
  1472. package/src/plugins/visualblocks/main/img/h3.gif +0 -0
  1473. package/src/plugins/visualblocks/main/img/h4.gif +0 -0
  1474. package/src/plugins/visualblocks/main/img/h5.gif +0 -0
  1475. package/src/plugins/visualblocks/main/img/h6.gif +0 -0
  1476. package/src/plugins/visualblocks/main/img/hgroup.gif +0 -0
  1477. package/src/plugins/visualblocks/main/img/ol.gif +0 -0
  1478. package/src/plugins/visualblocks/main/img/p.gif +0 -0
  1479. package/src/plugins/visualblocks/main/img/pre.gif +0 -0
  1480. package/src/plugins/visualblocks/main/img/section.gif +0 -0
  1481. package/src/plugins/visualblocks/main/img/ul.gif +0 -0
  1482. package/src/plugins/visualblocks/main/ts/Main.ts +9 -0
  1483. package/src/plugins/visualblocks/main/ts/Plugin.ts +19 -0
  1484. package/src/plugins/visualblocks/main/ts/api/Commands.ts +15 -0
  1485. package/src/plugins/visualblocks/main/ts/api/Events.ts +9 -0
  1486. package/src/plugins/visualblocks/main/ts/api/Options.ts +24 -0
  1487. package/src/plugins/visualblocks/main/ts/core/Bindings.ts +25 -0
  1488. package/src/plugins/visualblocks/main/ts/core/VisualBlocks.ts +18 -0
  1489. package/src/plugins/visualblocks/main/ts/ui/Buttons.ts +34 -0
  1490. package/src/plugins/visualblocks/test/ts/browser/PreviewFormatTest.ts +57 -0
  1491. package/src/plugins/visualblocks/test/ts/browser/VisualBlocksSanityTest.ts +41 -0
  1492. package/src/plugins/visualchars/demo/html/demo.html +15 -0
  1493. package/src/plugins/visualchars/demo/ts/demo/Demo.ts +14 -0
  1494. package/src/plugins/visualchars/main/ts/Main.ts +9 -0
  1495. package/src/plugins/visualchars/main/ts/Plugin.ts +24 -0
  1496. package/src/plugins/visualchars/main/ts/api/Api.ts +19 -0
  1497. package/src/plugins/visualchars/main/ts/api/Commands.ts +15 -0
  1498. package/src/plugins/visualchars/main/ts/api/Events.ts +10 -0
  1499. package/src/plugins/visualchars/main/ts/api/Options.ts +24 -0
  1500. package/src/plugins/visualchars/main/ts/core/Actions.ts +31 -0
  1501. package/src/plugins/visualchars/main/ts/core/Bindings.ts +26 -0
  1502. package/src/plugins/visualchars/main/ts/core/Data.ts +35 -0
  1503. package/src/plugins/visualchars/main/ts/core/Html.ts +8 -0
  1504. package/src/plugins/visualchars/main/ts/core/Keyboard.ts +23 -0
  1505. package/src/plugins/visualchars/main/ts/core/Nodes.ts +68 -0
  1506. package/src/plugins/visualchars/main/ts/core/VisualChars.ts +61 -0
  1507. package/src/plugins/visualchars/main/ts/ui/Buttons.ts +34 -0
  1508. package/src/plugins/visualchars/test/ts/atomic/DataTest.ts +22 -0
  1509. package/src/plugins/visualchars/test/ts/atomic/HtmlTest.ts +23 -0
  1510. package/src/plugins/visualchars/test/ts/browser/DefaultStateTest.ts +30 -0
  1511. package/src/plugins/visualchars/test/ts/browser/InlinePluginTest.ts +33 -0
  1512. package/src/plugins/visualchars/test/ts/browser/NodesTest.ts +121 -0
  1513. package/src/plugins/visualchars/test/ts/browser/PluginTest.ts +121 -0
  1514. package/src/plugins/visualchars/test/ts/module/test/Utils.ts +42 -0
  1515. package/src/plugins/wordcount/demo/html/demo.html +18 -0
  1516. package/src/plugins/wordcount/demo/ts/demo/Demo.ts +12 -0
  1517. package/src/plugins/wordcount/main/ts/Main.ts +9 -0
  1518. package/src/plugins/wordcount/main/ts/Plugin.ts +17 -0
  1519. package/src/plugins/wordcount/main/ts/api/Api.ts +44 -0
  1520. package/src/plugins/wordcount/main/ts/api/Commands.ts +12 -0
  1521. package/src/plugins/wordcount/main/ts/api/Events.ts +17 -0
  1522. package/src/plugins/wordcount/main/ts/core/Count.ts +38 -0
  1523. package/src/plugins/wordcount/main/ts/core/GetText.ts +35 -0
  1524. package/src/plugins/wordcount/main/ts/core/WordCounter.ts +28 -0
  1525. package/src/plugins/wordcount/main/ts/ui/Buttons.ts +21 -0
  1526. package/src/plugins/wordcount/main/ts/ui/Dialog.ts +47 -0
  1527. package/src/plugins/wordcount/test/ts/browser/PluginTest.ts +228 -0
  1528. package/src/plugins/wordcount/test/ts/browser/api/ApiTest.ts +88 -0
  1529. package/src/plugins/wordcount/test/ts/browser/core/GetTextTest.ts +33 -0
  1530. package/src/themes/silver/demo/html/demo/demo-with-scrolling.html +347 -0
  1531. package/src/themes/silver/demo/html/demo/demo.html +125 -0
  1532. package/src/themes/silver/demo/html/demo/format-select-demo.html +61 -0
  1533. package/src/themes/silver/demo/html/demo/menu-item-demo.html +96 -0
  1534. package/src/themes/silver/demo/html/demo/sidebar-demo.html +97 -0
  1535. package/src/themes/silver/demo/html/demo/toolbar-button-demo.html +97 -0
  1536. package/src/themes/silver/demo/html/demo/tree-demo.html +21 -0
  1537. package/src/themes/silver/demo/ts/demo/ButtonSetupDemo.ts +247 -0
  1538. package/src/themes/silver/demo/ts/demo/Demos.ts +19 -0
  1539. package/src/themes/silver/demo/ts/demo/FormatSelectDemo.ts +70 -0
  1540. package/src/themes/silver/demo/ts/demo/MenuItemDemo.ts +135 -0
  1541. package/src/themes/silver/demo/ts/demo/MockDemo.ts +34 -0
  1542. package/src/themes/silver/demo/ts/demo/PlayDemo.ts +142 -0
  1543. package/src/themes/silver/demo/ts/demo/SidebarDemo.ts +49 -0
  1544. package/src/themes/silver/demo/ts/demo/ToolbarButtonDemo.ts +97 -0
  1545. package/src/themes/silver/demo/ts/demo/TreeDemo.ts +177 -0
  1546. package/src/themes/silver/main/resources/StatusbarLogo.d.ts +1 -0
  1547. package/src/themes/silver/main/resources/StatusbarLogo.js +3 -0
  1548. package/src/themes/silver/main/resources/statusbar-logo.svg +3 -0
  1549. package/src/themes/silver/main/ts/Autocompleter.ts +215 -0
  1550. package/src/themes/silver/main/ts/Channels.ts +7 -0
  1551. package/src/themes/silver/main/ts/Events.ts +153 -0
  1552. package/src/themes/silver/main/ts/Main.ts +9 -0
  1553. package/src/themes/silver/main/ts/ReadOnly.ts +67 -0
  1554. package/src/themes/silver/main/ts/Render.ts +571 -0
  1555. package/src/themes/silver/main/ts/Theme.ts +88 -0
  1556. package/src/themes/silver/main/ts/alien/NotificationManagerImpl.ts +143 -0
  1557. package/src/themes/silver/main/ts/api/Events.ts +82 -0
  1558. package/src/themes/silver/main/ts/api/Options.ts +490 -0
  1559. package/src/themes/silver/main/ts/autocomplete/AutocompleteEditorEvents.ts +78 -0
  1560. package/src/themes/silver/main/ts/backstage/Anchors.ts +184 -0
  1561. package/src/themes/silver/main/ts/backstage/Backstage.ts +109 -0
  1562. package/src/themes/silver/main/ts/backstage/ColorInputBackstage.ts +31 -0
  1563. package/src/themes/silver/main/ts/backstage/DialogBackstage.ts +13 -0
  1564. package/src/themes/silver/main/ts/backstage/HeaderBackstage.ts +21 -0
  1565. package/src/themes/silver/main/ts/backstage/StyleFormatsBackstage.ts +53 -0
  1566. package/src/themes/silver/main/ts/backstage/TooltipsBackstage.ts +62 -0
  1567. package/src/themes/silver/main/ts/backstage/UrlInputBackstage.ts +106 -0
  1568. package/src/themes/silver/main/ts/backstage/UrlInputHistory.ts +72 -0
  1569. package/src/themes/silver/main/ts/modes/Iframe.ts +210 -0
  1570. package/src/themes/silver/main/ts/modes/Inline.ts +219 -0
  1571. package/src/themes/silver/main/ts/modes/ScrollingContext.ts +70 -0
  1572. package/src/themes/silver/main/ts/modes/Toolbars.ts +32 -0
  1573. package/src/themes/silver/main/ts/modes/UiReferences.ts +70 -0
  1574. package/src/themes/silver/main/ts/ui/alien/ComposingConfigs.ts +25 -0
  1575. package/src/themes/silver/main/ts/ui/alien/ConvertShortcut.ts +36 -0
  1576. package/src/themes/silver/main/ts/ui/alien/DialogTabHeight.ts +171 -0
  1577. package/src/themes/silver/main/ts/ui/alien/DisablingConfigs.ts +30 -0
  1578. package/src/themes/silver/main/ts/ui/alien/FieldLabeller.ts +56 -0
  1579. package/src/themes/silver/main/ts/ui/alien/FlatgridAutodetect.ts +28 -0
  1580. package/src/themes/silver/main/ts/ui/alien/RepresentingConfigs.ts +75 -0
  1581. package/src/themes/silver/main/ts/ui/alien/SimpleBehaviours.ts +17 -0
  1582. package/src/themes/silver/main/ts/ui/alien/UiUtils.ts +8 -0
  1583. package/src/themes/silver/main/ts/ui/button/ButtonSlices.ts +37 -0
  1584. package/src/themes/silver/main/ts/ui/button/MenuButton.ts +144 -0
  1585. package/src/themes/silver/main/ts/ui/context/ContextEditorEvents.ts +10 -0
  1586. package/src/themes/silver/main/ts/ui/context/ContextForm.ts +73 -0
  1587. package/src/themes/silver/main/ts/ui/context/ContextFormButtons.ts +98 -0
  1588. package/src/themes/silver/main/ts/ui/context/ContextToolbar.ts +315 -0
  1589. package/src/themes/silver/main/ts/ui/context/ContextToolbarAnchor.ts +146 -0
  1590. package/src/themes/silver/main/ts/ui/context/ContextToolbarBounds.ts +132 -0
  1591. package/src/themes/silver/main/ts/ui/context/ContextToolbarLookup.ts +134 -0
  1592. package/src/themes/silver/main/ts/ui/context/ContextToolbarScopes.ts +81 -0
  1593. package/src/themes/silver/main/ts/ui/context/ContextUi.ts +128 -0
  1594. package/src/themes/silver/main/ts/ui/controls/Controls.ts +40 -0
  1595. package/src/themes/silver/main/ts/ui/core/AlignmentButtons.ts +34 -0
  1596. package/src/themes/silver/main/ts/ui/core/ChoiceControls.ts +137 -0
  1597. package/src/themes/silver/main/ts/ui/core/ComplexControls.ts +20 -0
  1598. package/src/themes/silver/main/ts/ui/core/ControlUtils.ts +80 -0
  1599. package/src/themes/silver/main/ts/ui/core/FormatControls.ts +28 -0
  1600. package/src/themes/silver/main/ts/ui/core/HtmlSanitizer.ts +3 -0
  1601. package/src/themes/silver/main/ts/ui/core/IndentOutdent.ts +33 -0
  1602. package/src/themes/silver/main/ts/ui/core/LinkTargets.ts +144 -0
  1603. package/src/themes/silver/main/ts/ui/core/PasteControls.ts +47 -0
  1604. package/src/themes/silver/main/ts/ui/core/SimpleControls.ts +144 -0
  1605. package/src/themes/silver/main/ts/ui/core/UndoRedo.ts +58 -0
  1606. package/src/themes/silver/main/ts/ui/core/VisualAid.ts +34 -0
  1607. package/src/themes/silver/main/ts/ui/core/color/ColorCache.ts +90 -0
  1608. package/src/themes/silver/main/ts/ui/core/color/ColorSwatch.ts +303 -0
  1609. package/src/themes/silver/main/ts/ui/core/color/Options.ts +175 -0
  1610. package/src/themes/silver/main/ts/ui/core/complex/AlignBespoke.ts +74 -0
  1611. package/src/themes/silver/main/ts/ui/core/complex/BespokeNumberInput.ts +239 -0
  1612. package/src/themes/silver/main/ts/ui/core/complex/BespokeSelect.ts +245 -0
  1613. package/src/themes/silver/main/ts/ui/core/complex/BlocksBespoke.ts +74 -0
  1614. package/src/themes/silver/main/ts/ui/core/complex/FontFamilyBespoke.ts +125 -0
  1615. package/src/themes/silver/main/ts/ui/core/complex/FontSizeBespoke.ts +195 -0
  1616. package/src/themes/silver/main/ts/ui/core/complex/SelectDatasets.ts +67 -0
  1617. package/src/themes/silver/main/ts/ui/core/complex/StyleFormat.ts +131 -0
  1618. package/src/themes/silver/main/ts/ui/core/complex/StylesBespoke.ts +83 -0
  1619. package/src/themes/silver/main/ts/ui/core/complex/utils/FormatDetection.ts +14 -0
  1620. package/src/themes/silver/main/ts/ui/core/complex/utils/FormatRegister.ts +73 -0
  1621. package/src/themes/silver/main/ts/ui/core/complex/utils/Tooltip.ts +8 -0
  1622. package/src/themes/silver/main/ts/ui/dialog/AlertDialog.ts +65 -0
  1623. package/src/themes/silver/main/ts/ui/dialog/Bar.ts +15 -0
  1624. package/src/themes/silver/main/ts/ui/dialog/BodyPanel.ts +74 -0
  1625. package/src/themes/silver/main/ts/ui/dialog/Collection.ts +195 -0
  1626. package/src/themes/silver/main/ts/ui/dialog/ColorInput.ts +183 -0
  1627. package/src/themes/silver/main/ts/ui/dialog/ColorPicker.ts +107 -0
  1628. package/src/themes/silver/main/ts/ui/dialog/ConfirmDialog.ts +77 -0
  1629. package/src/themes/silver/main/ts/ui/dialog/CustomEditor.ts +79 -0
  1630. package/src/themes/silver/main/ts/ui/dialog/Dialogs.ts +207 -0
  1631. package/src/themes/silver/main/ts/ui/dialog/Dropzone.ts +154 -0
  1632. package/src/themes/silver/main/ts/ui/dialog/Grid.ts +15 -0
  1633. package/src/themes/silver/main/ts/ui/dialog/IFrame.ts +188 -0
  1634. package/src/themes/silver/main/ts/ui/dialog/ImagePreview.ts +156 -0
  1635. package/src/themes/silver/main/ts/ui/dialog/Label.ts +45 -0
  1636. package/src/themes/silver/main/ts/ui/dialog/ListBox.ts +139 -0
  1637. package/src/themes/silver/main/ts/ui/dialog/Panel.ts +21 -0
  1638. package/src/themes/silver/main/ts/ui/dialog/SelectBox.ts +78 -0
  1639. package/src/themes/silver/main/ts/ui/dialog/SizeInput.ts +169 -0
  1640. package/src/themes/silver/main/ts/ui/dialog/Slider.ts +69 -0
  1641. package/src/themes/silver/main/ts/ui/dialog/TabPanel.ts +168 -0
  1642. package/src/themes/silver/main/ts/ui/dialog/Table.ts +46 -0
  1643. package/src/themes/silver/main/ts/ui/dialog/TextField.ts +161 -0
  1644. package/src/themes/silver/main/ts/ui/dialog/Tree.ts +405 -0
  1645. package/src/themes/silver/main/ts/ui/dialog/UrlInput.ts +296 -0
  1646. package/src/themes/silver/main/ts/ui/dialog/WindowManager.ts +393 -0
  1647. package/src/themes/silver/main/ts/ui/dropdown/CommonDropdown.ts +275 -0
  1648. package/src/themes/silver/main/ts/ui/general/AlertBanner.ts +62 -0
  1649. package/src/themes/silver/main/ts/ui/general/Button.ts +309 -0
  1650. package/src/themes/silver/main/ts/ui/general/Checkbox.ts +110 -0
  1651. package/src/themes/silver/main/ts/ui/general/FormEvents.ts +63 -0
  1652. package/src/themes/silver/main/ts/ui/general/FormValues.ts +21 -0
  1653. package/src/themes/silver/main/ts/ui/general/HtmlPanel.ts +62 -0
  1654. package/src/themes/silver/main/ts/ui/general/NavigableObject.ts +76 -0
  1655. package/src/themes/silver/main/ts/ui/general/Notification.ts +222 -0
  1656. package/src/themes/silver/main/ts/ui/general/OuterContainer.ts +463 -0
  1657. package/src/themes/silver/main/ts/ui/general/PanelButton.ts +67 -0
  1658. package/src/themes/silver/main/ts/ui/general/UiFactory.ts +110 -0
  1659. package/src/themes/silver/main/ts/ui/header/CommonHeader.ts +26 -0
  1660. package/src/themes/silver/main/ts/ui/header/InlineHeader.ts +379 -0
  1661. package/src/themes/silver/main/ts/ui/header/StaticHeader.ts +11 -0
  1662. package/src/themes/silver/main/ts/ui/header/StickyHeader.ts +311 -0
  1663. package/src/themes/silver/main/ts/ui/icons/Icons.ts +110 -0
  1664. package/src/themes/silver/main/ts/ui/menus/contextmenu/Coords.ts +85 -0
  1665. package/src/themes/silver/main/ts/ui/menus/contextmenu/Options.ts +66 -0
  1666. package/src/themes/silver/main/ts/ui/menus/contextmenu/SilverContextMenu.ts +192 -0
  1667. package/src/themes/silver/main/ts/ui/menus/contextmenu/platform/DesktopContextMenu.ts +44 -0
  1668. package/src/themes/silver/main/ts/ui/menus/contextmenu/platform/MobileContextMenu.ts +169 -0
  1669. package/src/themes/silver/main/ts/ui/menus/item/ItemClasses.ts +57 -0
  1670. package/src/themes/silver/main/ts/ui/menus/item/ItemEvents.ts +29 -0
  1671. package/src/themes/silver/main/ts/ui/menus/item/ItemResponse.ts +6 -0
  1672. package/src/themes/silver/main/ts/ui/menus/item/MenuItems.ts +28 -0
  1673. package/src/themes/silver/main/ts/ui/menus/item/build/AutocompleteMenuItem.ts +111 -0
  1674. package/src/themes/silver/main/ts/ui/menus/item/build/CardMenuItem.ts +84 -0
  1675. package/src/themes/silver/main/ts/ui/menus/item/build/ChoiceItem.ts +82 -0
  1676. package/src/themes/silver/main/ts/ui/menus/item/build/ColorSwatchItem.ts +57 -0
  1677. package/src/themes/silver/main/ts/ui/menus/item/build/CommonMenuItem.ts +99 -0
  1678. package/src/themes/silver/main/ts/ui/menus/item/build/FancyMenuItem.ts +19 -0
  1679. package/src/themes/silver/main/ts/ui/menus/item/build/InsertTableMenuItem.ts +142 -0
  1680. package/src/themes/silver/main/ts/ui/menus/item/build/NestedMenuItem.ts +51 -0
  1681. package/src/themes/silver/main/ts/ui/menus/item/build/NormalMenuItem.ts +40 -0
  1682. package/src/themes/silver/main/ts/ui/menus/item/build/SeparatorItem.ts +17 -0
  1683. package/src/themes/silver/main/ts/ui/menus/item/build/ToggleMenuItem.ts +62 -0
  1684. package/src/themes/silver/main/ts/ui/menus/item/structure/ItemSlices.ts +121 -0
  1685. package/src/themes/silver/main/ts/ui/menus/item/structure/ItemStructure.ts +149 -0
  1686. package/src/themes/silver/main/ts/ui/menus/menu/MenuChoice.ts +61 -0
  1687. package/src/themes/silver/main/ts/ui/menus/menu/MenuClasses.ts +31 -0
  1688. package/src/themes/silver/main/ts/ui/menus/menu/MenuConversion.ts +131 -0
  1689. package/src/themes/silver/main/ts/ui/menus/menu/MenuMovement.ts +63 -0
  1690. package/src/themes/silver/main/ts/ui/menus/menu/MenuParts.ts +56 -0
  1691. package/src/themes/silver/main/ts/ui/menus/menu/MenuStructures.ts +235 -0
  1692. package/src/themes/silver/main/ts/ui/menus/menu/MenuUtils.ts +104 -0
  1693. package/src/themes/silver/main/ts/ui/menus/menu/MenuWidgets.ts +55 -0
  1694. package/src/themes/silver/main/ts/ui/menus/menu/NestedMenus.ts +82 -0
  1695. package/src/themes/silver/main/ts/ui/menus/menu/SingleMenu.ts +228 -0
  1696. package/src/themes/silver/main/ts/ui/menus/menu/SingleMenuTypes.ts +4 -0
  1697. package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenu.ts +164 -0
  1698. package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenuEvents.ts +32 -0
  1699. package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenuField.ts +181 -0
  1700. package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenus.ts +23 -0
  1701. package/src/themes/silver/main/ts/ui/menus/menubar/Integration.ts +86 -0
  1702. package/src/themes/silver/main/ts/ui/menus/menubar/SilverMenubar.ts +152 -0
  1703. package/src/themes/silver/main/ts/ui/promotion/Promotion.ts +29 -0
  1704. package/src/themes/silver/main/ts/ui/selector/TableSelectorHandles.ts +230 -0
  1705. package/src/themes/silver/main/ts/ui/sidebar/Sidebar.ts +251 -0
  1706. package/src/themes/silver/main/ts/ui/sizeinput/SizeInputModel.ts +87 -0
  1707. package/src/themes/silver/main/ts/ui/sizing/EditorSize.ts +32 -0
  1708. package/src/themes/silver/main/ts/ui/sizing/Resize.ts +41 -0
  1709. package/src/themes/silver/main/ts/ui/sizing/Utils.ts +24 -0
  1710. package/src/themes/silver/main/ts/ui/skin/Loader.ts +98 -0
  1711. package/src/themes/silver/main/ts/ui/skin/SkinLoaded.ts +26 -0
  1712. package/src/themes/silver/main/ts/ui/statusbar/ElementPath.ts +132 -0
  1713. package/src/themes/silver/main/ts/ui/statusbar/ResizeHandle.ts +70 -0
  1714. package/src/themes/silver/main/ts/ui/statusbar/Statusbar.ts +144 -0
  1715. package/src/themes/silver/main/ts/ui/statusbar/WordCount.ts +67 -0
  1716. package/src/themes/silver/main/ts/ui/throbber/Throbber.ts +170 -0
  1717. package/src/themes/silver/main/ts/ui/toolbar/CommonToolbar.ts +231 -0
  1718. package/src/themes/silver/main/ts/ui/toolbar/Integration.ts +210 -0
  1719. package/src/themes/silver/main/ts/ui/toolbar/button/ButtonClasses.ts +17 -0
  1720. package/src/themes/silver/main/ts/ui/toolbar/button/ButtonEvents.ts +45 -0
  1721. package/src/themes/silver/main/ts/ui/toolbar/button/ToolbarButtons.ts +438 -0
  1722. package/src/themes/silver/main/ts/ui/urlinput/Completions.ts +86 -0
  1723. package/src/themes/silver/main/ts/ui/view/View.ts +160 -0
  1724. package/src/themes/silver/main/ts/ui/view/ViewButtons.ts +88 -0
  1725. package/src/themes/silver/main/ts/ui/view/ViewTypes.ts +3 -0
  1726. package/src/themes/silver/main/ts/ui/view/ViewWrapper.ts +174 -0
  1727. package/src/themes/silver/main/ts/ui/window/DialogChannels.ts +17 -0
  1728. package/src/themes/silver/main/ts/ui/window/SilverDialog.ts +102 -0
  1729. package/src/themes/silver/main/ts/ui/window/SilverDialogBody.ts +121 -0
  1730. package/src/themes/silver/main/ts/ui/window/SilverDialogCommon.ts +163 -0
  1731. package/src/themes/silver/main/ts/ui/window/SilverDialogEvents.ts +137 -0
  1732. package/src/themes/silver/main/ts/ui/window/SilverDialogFooter.ts +94 -0
  1733. package/src/themes/silver/main/ts/ui/window/SilverDialogHeader.ts +127 -0
  1734. package/src/themes/silver/main/ts/ui/window/SilverDialogInstanceApi.ts +168 -0
  1735. package/src/themes/silver/main/ts/ui/window/SilverInlineDialog.ts +184 -0
  1736. package/src/themes/silver/main/ts/ui/window/SilverUrlDialog.ts +158 -0
  1737. package/src/themes/silver/main/ts/ui/window/SilverUrlDialogInstanceApi.ts +52 -0
  1738. package/src/themes/silver/test/css/content.css +4 -0
  1739. package/src/themes/silver/test/html/iframe.html +25 -0
  1740. package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputConvertTest.ts +59 -0
  1741. package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputConverterTest.ts +73 -0
  1742. package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputFormatTest.ts +19 -0
  1743. package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputNuTest.ts +12 -0
  1744. package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputParsingTest.ts +75 -0
  1745. package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputShared.ts +5 -0
  1746. package/src/themes/silver/test/ts/atomic/context/ContextMenuTriggerTest.ts +36 -0
  1747. package/src/themes/silver/test/ts/atomic/menus/MenuConversionTest.ts +91 -0
  1748. package/src/themes/silver/test/ts/atomic/sizing/ResizeTest.ts +64 -0
  1749. package/src/themes/silver/test/ts/browser/editor/ContextFormTest.ts +228 -0
  1750. package/src/themes/silver/test/ts/browser/editor/DefaultHeightTest.ts +54 -0
  1751. package/src/themes/silver/test/ts/browser/editor/DisableTest.ts +57 -0
  1752. package/src/themes/silver/test/ts/browser/editor/EventsTest.ts +90 -0
  1753. package/src/themes/silver/test/ts/browser/editor/ForceHexColorTest.ts +131 -0
  1754. package/src/themes/silver/test/ts/browser/editor/MenuGroupHeadingTest.ts +52 -0
  1755. package/src/themes/silver/test/ts/browser/editor/NotificationManagerImplTest.ts +259 -0
  1756. package/src/themes/silver/test/ts/browser/editor/ResourceLoadingCssTest.ts +41 -0
  1757. package/src/themes/silver/test/ts/browser/editor/ShadowDomInlineTest.ts +18 -0
  1758. package/src/themes/silver/test/ts/browser/editor/ShowHideTest.ts +93 -0
  1759. package/src/themes/silver/test/ts/browser/editor/SilverDialogCancelTest.ts +34 -0
  1760. package/src/themes/silver/test/ts/browser/editor/SilverDialogCloseTest.ts +34 -0
  1761. package/src/themes/silver/test/ts/browser/editor/SilverDialogPopupsTest.ts +113 -0
  1762. package/src/themes/silver/test/ts/browser/editor/SilverDialogTreeTest.ts +108 -0
  1763. package/src/themes/silver/test/ts/browser/editor/SilverEditorDirectionalityTest.ts +55 -0
  1764. package/src/themes/silver/test/ts/browser/editor/SilverEditorTest.ts +422 -0
  1765. package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerPriorityTest.ts +38 -0
  1766. package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerTargetNotInlineTest.ts +34 -0
  1767. package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerTargetTest.ts +34 -0
  1768. package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerTest.ts +117 -0
  1769. package/src/themes/silver/test/ts/browser/editor/SilverInlineEditorTest.ts +430 -0
  1770. package/src/themes/silver/test/ts/browser/editor/SilverInlineEditorWidthTest.ts +113 -0
  1771. package/src/themes/silver/test/ts/browser/editor/SilverPopupSinkBoundsTest.ts +344 -0
  1772. package/src/themes/silver/test/ts/browser/editor/SilverRenderTest.ts +64 -0
  1773. package/src/themes/silver/test/ts/browser/editor/SilverUiModeTest.ts +218 -0
  1774. package/src/themes/silver/test/ts/browser/editor/ToolbarBottomTest.ts +166 -0
  1775. package/src/themes/silver/test/ts/browser/editor/ToolbarPersistTest.ts +40 -0
  1776. package/src/themes/silver/test/ts/browser/editor/ToxWrappingTest.ts +21 -0
  1777. package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteAriaTest.ts +179 -0
  1778. package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteCancelTest.ts +184 -0
  1779. package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteReloadTest.ts +117 -0
  1780. package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteTest.ts +769 -0
  1781. package/src/themes/silver/test/ts/browser/editor/backstage/BackstageSinkTest.ts +190 -0
  1782. package/src/themes/silver/test/ts/browser/editor/bespoke/BespokeSelectAriaLabelTest.ts +242 -0
  1783. package/src/themes/silver/test/ts/browser/editor/bespoke/SilverBespokeButtonsTest.ts +401 -0
  1784. package/src/themes/silver/test/ts/browser/editor/bespoke/StyleSelectFormatNamesTest.ts +114 -0
  1785. package/src/themes/silver/test/ts/browser/editor/buttons/GroupToolbarButtonTest.ts +148 -0
  1786. package/src/themes/silver/test/ts/browser/editor/buttons/UpdateToolbarButtonTextAndIconTest.ts +133 -0
  1787. package/src/themes/silver/test/ts/browser/editor/color/ColorAriaLabelTest.ts +285 -0
  1788. package/src/themes/silver/test/ts/browser/editor/color/ColorCacheTest.ts +64 -0
  1789. package/src/themes/silver/test/ts/browser/editor/color/ColorPickerSanityTest.ts +239 -0
  1790. package/src/themes/silver/test/ts/browser/editor/color/ColorSettingsTest.ts +115 -0
  1791. package/src/themes/silver/test/ts/browser/editor/color/GetCurrentColorTest.ts +32 -0
  1792. package/src/themes/silver/test/ts/browser/editor/color/NoneditableRootTest.ts +48 -0
  1793. package/src/themes/silver/test/ts/browser/editor/color/TextColorCommandsTest.ts +64 -0
  1794. package/src/themes/silver/test/ts/browser/editor/color/TextColorFormattingTest.ts +167 -0
  1795. package/src/themes/silver/test/ts/browser/editor/color/TextColorSanityTest.ts +504 -0
  1796. package/src/themes/silver/test/ts/browser/editor/contextmenu/ContextMenuPositionTest.ts +33 -0
  1797. package/src/themes/silver/test/ts/browser/editor/contextmenu/ContextMenuSettingsTest.ts +44 -0
  1798. package/src/themes/silver/test/ts/browser/editor/contextmenu/CustomContextMenuTest.ts +141 -0
  1799. package/src/themes/silver/test/ts/browser/editor/contextmenu/DesktopContextMenuTest.ts +183 -0
  1800. package/src/themes/silver/test/ts/browser/editor/contextmenu/MobileContextMenuTest.ts +212 -0
  1801. package/src/themes/silver/test/ts/browser/editor/contextmenu/img/dogleft.jpg +0 -0
  1802. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarBoundsTest.ts +332 -0
  1803. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarDistractionFreePositionTest.ts +120 -0
  1804. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarIframePositionTest.ts +385 -0
  1805. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarInlinePositionTest.ts +158 -0
  1806. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarLookupPositionPriorityTest.ts +51 -0
  1807. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarLookupPrioritisationTest.ts +76 -0
  1808. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarLookupTest.ts +160 -0
  1809. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarTest.ts +41 -0
  1810. package/src/themes/silver/test/ts/browser/editor/contexttoolbar/RemoveContextToolbarOnFocusoutTest.ts +64 -0
  1811. package/src/themes/silver/test/ts/browser/editor/core/AlignmentButtonsTest.ts +67 -0
  1812. package/src/themes/silver/test/ts/browser/editor/core/ChoiceControlsTest.ts +397 -0
  1813. package/src/themes/silver/test/ts/browser/editor/core/ContentLanguageHiddenTest.ts +26 -0
  1814. package/src/themes/silver/test/ts/browser/editor/core/PasteControlsTest.ts +41 -0
  1815. package/src/themes/silver/test/ts/browser/editor/core/SimpleControlsTest.ts +171 -0
  1816. package/src/themes/silver/test/ts/browser/editor/core/UndoRedoTest.ts +90 -0
  1817. package/src/themes/silver/test/ts/browser/editor/header/HeaderLocationTest.ts +56 -0
  1818. package/src/themes/silver/test/ts/browser/editor/header/InlineHeaderTest.ts +99 -0
  1819. package/src/themes/silver/test/ts/browser/editor/header/PromotionTest.ts +65 -0
  1820. package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderBottomTest.ts +11 -0
  1821. package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderInitialPlacementTest.ts +33 -0
  1822. package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderScrollIntoViewTest.ts +104 -0
  1823. package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderTopTest.ts +11 -0
  1824. package/src/themes/silver/test/ts/browser/editor/menubar/EditorMenubarOptionsTest.ts +77 -0
  1825. package/src/themes/silver/test/ts/browser/editor/menubar/EditorMenubarRenderTest.ts +41 -0
  1826. package/src/themes/silver/test/ts/browser/editor/scrolling/EditorInScrollingContainerTest.ts +959 -0
  1827. package/src/themes/silver/test/ts/browser/editor/sizing/GridSinkSizingTest.ts +36 -0
  1828. package/src/themes/silver/test/ts/browser/editor/sizing/ResizeNotInRootTest.ts +37 -0
  1829. package/src/themes/silver/test/ts/browser/editor/sizing/ResizeTest.ts +110 -0
  1830. package/src/themes/silver/test/ts/browser/editor/toolbar/EditorToolbarOptionsTest.ts +464 -0
  1831. package/src/themes/silver/test/ts/browser/editor/toolbar/IndentOutdentTest.ts +29 -0
  1832. package/src/themes/silver/test/ts/browser/editor/toolbar/InlineToolbarDrawerFloatingPositionTest.ts +77 -0
  1833. package/src/themes/silver/test/ts/browser/editor/toolbar/InlineToolbarPositionTest.ts +390 -0
  1834. package/src/themes/silver/test/ts/browser/editor/toolbar/MultipleInlineToolbarVisibilityTest.ts +54 -0
  1835. package/src/themes/silver/test/ts/browser/editor/toolbar/NumberInputTest.ts +462 -0
  1836. package/src/themes/silver/test/ts/browser/editor/toolbar/ReadonlyToolbarResizeTest.ts +172 -0
  1837. package/src/themes/silver/test/ts/browser/editor/toolbar/SplitFloatingToolbarKeyboardNavigationTest.ts +43 -0
  1838. package/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarDrawerFloatingPositionTest.ts +106 -0
  1839. package/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarDrawerToggleTest.ts +160 -0
  1840. package/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarFocusTest.ts +49 -0
  1841. package/src/themes/silver/test/ts/browser/editor/tooltip/AutocompleterTooltipTest.ts +157 -0
  1842. package/src/themes/silver/test/ts/browser/editor/tooltip/CollectionTooltipTest.ts +240 -0
  1843. package/src/themes/silver/test/ts/browser/editor/tooltip/DynamicTooltipTest.ts +289 -0
  1844. package/src/themes/silver/test/ts/browser/editor/tooltip/TooltipShortcutTest.ts +52 -0
  1845. package/src/themes/silver/test/ts/browser/editor/tooltip/TooltipTest.ts +505 -0
  1846. package/src/themes/silver/test/ts/browser/icons/IconsTest.ts +128 -0
  1847. package/src/themes/silver/test/ts/browser/sidebar/SidebarRoleAttributeTest.ts +83 -0
  1848. package/src/themes/silver/test/ts/browser/sidebar/SidebarShowOptionTest.ts +126 -0
  1849. package/src/themes/silver/test/ts/browser/sidebar/SidebarTest.ts +115 -0
  1850. package/src/themes/silver/test/ts/browser/skin/OxideBlockedDialogTest.ts +113 -0
  1851. package/src/themes/silver/test/ts/browser/skin/OxideCollectionComponentTest.ts +325 -0
  1852. package/src/themes/silver/test/ts/browser/skin/OxideColorSwatchMenuTest.ts +324 -0
  1853. package/src/themes/silver/test/ts/browser/skin/OxideFontFormatMenuTest.ts +209 -0
  1854. package/src/themes/silver/test/ts/browser/skin/OxideGridCollectionMenuTest.ts +79 -0
  1855. package/src/themes/silver/test/ts/browser/skin/OxideListCollectionMenuTest.ts +151 -0
  1856. package/src/themes/silver/test/ts/browser/skin/OxideTablePickerMenuTest.ts +124 -0
  1857. package/src/themes/silver/test/ts/browser/skin/OxideToolbarCollectionMenuTest.ts +156 -0
  1858. package/src/themes/silver/test/ts/browser/statusbar/StatusbarTest.ts +365 -0
  1859. package/src/themes/silver/test/ts/browser/throbber/ThrobberEditorTest.ts +82 -0
  1860. package/src/themes/silver/test/ts/browser/throbber/ThrobberFocusTest.ts +248 -0
  1861. package/src/themes/silver/test/ts/browser/throbber/ThrobberPopupTest.ts +121 -0
  1862. package/src/themes/silver/test/ts/browser/throbber/ThrobberTest.ts +93 -0
  1863. package/src/themes/silver/test/ts/browser/view/ViewButtonsTest.ts +134 -0
  1864. package/src/themes/silver/test/ts/browser/view/ViewTest.ts +504 -0
  1865. package/src/themes/silver/test/ts/browser/window/SilverDialogApiAccessTest.ts +175 -0
  1866. package/src/themes/silver/test/ts/browser/window/SilverDialogAriaLabelTest.ts +61 -0
  1867. package/src/themes/silver/test/ts/browser/window/SilverDialogBeforeEditorRenderedTest.ts +29 -0
  1868. package/src/themes/silver/test/ts/browser/window/SilverDialogBlockTest.ts +170 -0
  1869. package/src/themes/silver/test/ts/browser/window/SilverDialogFooterTest.ts +87 -0
  1870. package/src/themes/silver/test/ts/browser/window/SilverDialogPositioningTest.ts +191 -0
  1871. package/src/themes/silver/test/ts/browser/window/SilverInlineDialogPersistenceTest.ts +173 -0
  1872. package/src/themes/silver/test/ts/browser/window/SilverInlineDialogPositionTest.ts +451 -0
  1873. package/src/themes/silver/test/ts/browser/window/SilverInlineDialogTest.ts +270 -0
  1874. package/src/themes/silver/test/ts/headless/components/alertbanner/AlertBannerTest.ts +93 -0
  1875. package/src/themes/silver/test/ts/headless/components/checkbox/BasicCheckboxTest.ts +193 -0
  1876. package/src/themes/silver/test/ts/headless/components/checkbox/CheckboxFormChangeTest.ts +37 -0
  1877. package/src/themes/silver/test/ts/headless/components/colorinput/ColorInputTest.ts +202 -0
  1878. package/src/themes/silver/test/ts/headless/components/colorpicker/ColorPickerTest.ts +165 -0
  1879. package/src/themes/silver/test/ts/headless/components/customeditor/BasicCustomEditorTest.ts +101 -0
  1880. package/src/themes/silver/test/ts/headless/components/customeditor/CustomEditorSchemaTest.ts +92 -0
  1881. package/src/themes/silver/test/ts/headless/components/dialogbutton/DialogButtonTest.ts +99 -0
  1882. package/src/themes/silver/test/ts/headless/components/dialogbutton/DialogFooterButtonTest.ts +61 -0
  1883. package/src/themes/silver/test/ts/headless/components/dropzone/DropzoneTest.ts +76 -0
  1884. package/src/themes/silver/test/ts/headless/components/grid/BasicGridTest.ts +54 -0
  1885. package/src/themes/silver/test/ts/headless/components/htmlpanel/HtmlPanelTest.ts +62 -0
  1886. package/src/themes/silver/test/ts/headless/components/iframe/IframeTest.ts +343 -0
  1887. package/src/themes/silver/test/ts/headless/components/imagepreview/BasicImagePreviewTest.ts +119 -0
  1888. package/src/themes/silver/test/ts/headless/components/input/InputTest.ts +61 -0
  1889. package/src/themes/silver/test/ts/headless/components/label/LabelTest.ts +117 -0
  1890. package/src/themes/silver/test/ts/headless/components/listbox/ListBoxTest.ts +166 -0
  1891. package/src/themes/silver/test/ts/headless/components/selectbox/SelectboxTest.ts +85 -0
  1892. package/src/themes/silver/test/ts/headless/components/selectbox/SelectboxWithSizeTest.ts +67 -0
  1893. package/src/themes/silver/test/ts/headless/components/sizeinput/SizeInputTest.ts +131 -0
  1894. package/src/themes/silver/test/ts/headless/components/slider/SliderTest.ts +43 -0
  1895. package/src/themes/silver/test/ts/headless/components/table/TableTest.ts +49 -0
  1896. package/src/themes/silver/test/ts/headless/components/textarea/TextareaTest.ts +63 -0
  1897. package/src/themes/silver/test/ts/headless/components/tree/TreeTest.ts +286 -0
  1898. package/src/themes/silver/test/ts/headless/components/urlinput/HistoryTest.ts +35 -0
  1899. package/src/themes/silver/test/ts/headless/components/urlinput/UrlInputTest.ts +301 -0
  1900. package/src/themes/silver/test/ts/headless/configs/ControlOnSetupTest.ts +74 -0
  1901. package/src/themes/silver/test/ts/headless/modes/ScrollingContextTest.ts +271 -0
  1902. package/src/themes/silver/test/ts/headless/modes/UiReferencesTest.ts +73 -0
  1903. package/src/themes/silver/test/ts/headless/sketchers/SilverMenubarTest.ts +312 -0
  1904. package/src/themes/silver/test/ts/headless/toolbar/SearchableMenuButtonPlaceholderTest.ts +100 -0
  1905. package/src/themes/silver/test/ts/headless/toolbar/SearchableMenuButtonTest.ts +541 -0
  1906. package/src/themes/silver/test/ts/headless/toolbar/ToolbarButtonsTest.ts +384 -0
  1907. package/src/themes/silver/test/ts/headless/toolbar/ToolbarTest.ts +142 -0
  1908. package/src/themes/silver/test/ts/headless/window/CustomDialogTest.ts +271 -0
  1909. package/src/themes/silver/test/ts/headless/window/SilverDialogEventTest.ts +145 -0
  1910. package/src/themes/silver/test/ts/headless/window/SilverDialogReuseTest.ts +322 -0
  1911. package/src/themes/silver/test/ts/headless/window/SilverDialogTest.ts +90 -0
  1912. package/src/themes/silver/test/ts/headless/window/SilverUrlDialogTest.ts +80 -0
  1913. package/src/themes/silver/test/ts/headless/window/TabbedDialogTest.ts +128 -0
  1914. package/src/themes/silver/test/ts/headless/window/WindowManagerAlertTest.ts +225 -0
  1915. package/src/themes/silver/test/ts/headless/window/WindowManagerConfirmTest.ts +236 -0
  1916. package/src/themes/silver/test/ts/headless/window/WindowManagerRedialTest.ts +182 -0
  1917. package/src/themes/silver/test/ts/headless/window/WindowManagerTest.ts +396 -0
  1918. package/src/themes/silver/test/ts/module/Assets.ts +3 -0
  1919. package/src/themes/silver/test/ts/module/AutocompleterUtils.ts +153 -0
  1920. package/src/themes/silver/test/ts/module/CommonMailMergeFetch.ts +107 -0
  1921. package/src/themes/silver/test/ts/module/CommonMenuTestStructures.ts +80 -0
  1922. package/src/themes/silver/test/ts/module/ContextMenuUtils.ts +35 -0
  1923. package/src/themes/silver/test/ts/module/DialogUtils.ts +33 -0
  1924. package/src/themes/silver/test/ts/module/DomUtils.ts +21 -0
  1925. package/src/themes/silver/test/ts/module/MenuUtils.ts +75 -0
  1926. package/src/themes/silver/test/ts/module/PageScroll.ts +41 -0
  1927. package/src/themes/silver/test/ts/module/RepresentingUtils.ts +28 -0
  1928. package/src/themes/silver/test/ts/module/StickyHeaderStep.ts +226 -0
  1929. package/src/themes/silver/test/ts/module/StickyHeaderUtils.ts +250 -0
  1930. package/src/themes/silver/test/ts/module/TestBackstage.ts +88 -0
  1931. package/src/themes/silver/test/ts/module/TestExtras.ts +149 -0
  1932. package/src/themes/silver/test/ts/module/TestProviders.ts +25 -0
  1933. package/src/themes/silver/test/ts/module/ToolbarUtils.ts +44 -0
  1934. package/src/themes/silver/test/ts/module/TooltipUtils.ts +62 -0
  1935. package/src/themes/silver/test/ts/module/UiUtils.ts +55 -0
  1936. package/src/themes/silver/test/ts/webdriver/components/urlinput/UrlInputTest.ts +79 -0
  1937. package/src/themes/silver/test/ts/webdriver/dialogs/DialogFocusTest.ts +94 -0
  1938. package/src/themes/silver/test/ts/webdriver/dialogs/IFrameDialogTest.ts +169 -0
  1939. package/src/themes/silver/test/ts/webdriver/dialogs/SizeInputSpaceTest.ts +50 -0
  1940. package/src/themes/silver/test/ts/webdriver/editor/AutocompleteDelayedResponseTest.ts +101 -0
  1941. package/src/themes/silver/test/ts/webdriver/editor/DisabledNestedMenuItemTest.ts +115 -0
  1942. package/src/themes/silver/test/ts/webdriver/editor/SimpleControlsInlineTest.ts +30 -0
  1943. package/src/themes/silver/test/ts/webdriver/editor/TabbingTest.ts +26 -0
  1944. package/src/themes/silver/test/ts/webdriver/throbber/ThrobberTabbingTest.ts +120 -0
  1945. package/src/themes/silver/test/ts/webdriver/toolbar/SearchableMenuTypingTest.ts +369 -0
  1946. package/src/themes/silver/test/ts/webdriver/tooltip/HtmlPanelTooltipTest.ts +156 -0
  1947. package/tools/docs/tinymce.Editor.js +122 -0
  1948. package/tools/docs/tinymce.EditorManager.js +14 -0
  1949. package/tools/docs/tinymce.Env.js +174 -0
  1950. package/tools/docs/tinymce.Event.js +50 -0
  1951. package/tools/docs/tinymce.editor.ui.Ui.js +55 -0
  1952. package/tools/docs/tinymce.js +56 -0
  1953. package/tools/modules/grunt-utils.js +31 -0
  1954. package/tools/modules/grunt-webpack.js +204 -0
  1955. package/tools/modules/zip-helper.js +42 -0
  1956. package/tools/nuget/build/TinyMCE.targets +9 -0
  1957. package/tools/tasks/bundle.js +79 -0
  1958. package/tools/tasks/globals.js +97 -0
  1959. package/tools/tasks/html-i18n.js +35 -0
  1960. package/tools/tasks/moxiezip.js +98 -0
  1961. package/tools/tasks/validateVersion.js +20 -0
  1962. package/tsconfig.json +83 -0
@@ -0,0 +1,1702 @@
1
+ import { context, describe, it } from '@ephox/bedrock-client';
2
+ import { Arr, Fun, Obj } from '@ephox/katamari';
3
+ import { PlatformDetection } from '@ephox/sand';
4
+ import { assert } from 'chai';
5
+
6
+ import Env from 'tinymce/core/api/Env';
7
+ import { BlobCache, BlobInfo } from 'tinymce/core/api/file/BlobCache';
8
+ import DomParser, { DomParserSettings, ParserArgs, ParserFilterCallback } from 'tinymce/core/api/html/DomParser';
9
+ import AstNode, { Attributes } from 'tinymce/core/api/html/Node';
10
+ import Schema, { SchemaElement, SchemaSettings } from 'tinymce/core/api/html/Schema';
11
+ import HtmlSerializer from 'tinymce/core/api/html/Serializer';
12
+
13
+ interface ParseTestResult {
14
+ readonly nodes: AstNode[];
15
+ readonly name: string;
16
+ readonly args: ParserArgs;
17
+ }
18
+
19
+ describe('browser.tinymce.core.html.DomParserTest', () => {
20
+ const browser = PlatformDetection.detect().browser;
21
+ const schema = Schema({ valid_elements: '*[class|title]' });
22
+ const serializer = HtmlSerializer({}, schema);
23
+
24
+ const countNodes = (node: AstNode, counter: Record<string, number> = {}) => {
25
+ if (node.name in counter) {
26
+ counter[node.name]++;
27
+ } else {
28
+ counter[node.name] = 1;
29
+ }
30
+
31
+ for (let sibling = node.firstChild; sibling; sibling = sibling.next) {
32
+ countNodes(sibling, counter);
33
+ }
34
+
35
+ return counter;
36
+ };
37
+
38
+ schema.addValidChildren('+body[style]');
39
+
40
+ Arr.each([{
41
+ name: 'sanitization enabled (default)',
42
+ isSanitizeEnabled: true,
43
+ settings: { }
44
+ },
45
+ {
46
+ name: 'TINY-9635: sanitization disabled',
47
+ isSanitizeEnabled: false,
48
+ settings: { sanitize: false }
49
+ }], (scenario) => {
50
+ context(scenario.name, () => {
51
+ it('Parse element', () => {
52
+ const parser = DomParser(scenario.settings, schema);
53
+ const root = parser.parse('<B title="title" class="class">test</B>');
54
+ assert.equal(serializer.serialize(root), '<b class="class" title="title">test</b>', 'Inline element');
55
+ assert.equal(root.firstChild?.type, 1, 'Element type');
56
+ assert.equal(root.firstChild?.name, 'b', 'Element name');
57
+ assert.deepEqual(
58
+ root.firstChild?.attributes, [
59
+ { name: 'title', value: 'title' },
60
+ { name: 'class', value: 'class' },
61
+ ] as unknown as Attributes,
62
+ 'Element attributes'
63
+ );
64
+ assert.deepEqual(countNodes(root), { 'body': 1, 'b': 1, '#text': 1 }, 'Element attributes (count)');
65
+ });
66
+
67
+ it('Retains code inside a script', () => {
68
+ const parser = DomParser(scenario.settings, schema);
69
+ const root = parser.parse(' \t\r\n <SCRIPT> \t\r\n a < b > \t\r\n </S' + 'CRIPT> \t\r\n ');
70
+ assert.equal(serializer.serialize(root), '<script> \t\n a < b > \t\n </s' + 'cript>', 'Retain code inside SCRIPT');
71
+ assert.deepEqual(countNodes(root), { 'body': 1, 'script': 1, '#text': 1 }, 'Retain code inside SCRIPT (count)');
72
+ });
73
+
74
+ it('Whitespace', () => {
75
+ let parser = DomParser(scenario.settings, schema);
76
+ let root = parser.parse(' \t\r\n <B> \t\r\n test \t\r\n </B> \t\r\n ');
77
+ assert.equal(serializer.serialize(root), ' <b> test </b> ', 'Redundant whitespace (inline element)');
78
+ assert.deepEqual(countNodes(root), { 'body': 1, 'b': 1, '#text': 3 }, 'Redundant whitespace (inline element) (count)');
79
+
80
+ parser = DomParser(scenario.settings, schema);
81
+ root = parser.parse(' \t\r\n <P> \t\r\n test \t\r\n </P> \t\r\n ');
82
+ assert.equal(serializer.serialize(root), '<p>test</p>', 'Redundant whitespace (block element)');
83
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 1, '#text': 1 }, 'Redundant whitespace (block element) (count)');
84
+
85
+ parser = DomParser(scenario.settings, schema);
86
+ root = parser.parse(' \t\r\n <SCRIPT> \t\r\n test \t\r\n </S' + 'CRIPT> \t\r\n ');
87
+ assert.equal(
88
+ serializer.serialize(root),
89
+ '<script> \t\n test \t\n </s' + 'cript>',
90
+ 'Whitespace around and inside SCRIPT'
91
+ );
92
+ assert.deepEqual(countNodes(root), { 'body': 1, 'script': 1, '#text': 1 }, 'Whitespace around and inside SCRIPT (count)');
93
+
94
+ parser = DomParser(scenario.settings, schema);
95
+ root = parser.parse(' \t\r\n <STYLE> \t\r\n test \t\r\n </STYLE> \t\r\n ');
96
+ assert.equal(serializer.serialize(root), '<style> \t\n test \t\n </style>', 'Whitespace around and inside STYLE');
97
+ assert.deepEqual(countNodes(root), { 'body': 1, 'style': 1, '#text': 1 }, 'Whitespace around and inside STYLE (count)');
98
+
99
+ parser = DomParser(scenario.settings, schema);
100
+ root = parser.parse('<ul>\n<li>Item 1\n<ul>\n<li>\n \t Indented \t \n</li>\n</ul>\n</li>\n</ul>\n');
101
+ assert.equal(
102
+ serializer.serialize(root),
103
+ '<ul><li>Item 1<ul><li>Indented</li></ul></li></ul>',
104
+ 'Whitespace around and inside blocks (ul/li)'
105
+ );
106
+ assert.deepEqual(countNodes(root), { 'body': 1, 'li': 2, 'ul': 2, '#text': 2 }, 'Whitespace around and inside blocks (ul/li) (count)');
107
+
108
+ parser = DomParser(scenario.settings, Schema({ invalid_elements: 'hr,br' }));
109
+ root = parser.parse(
110
+ '\n<hr />\n<br />\n<div>\n<hr />\n<br />\n<img src="file.gif" data-mce-src="file.gif" />\n<hr />\n<br />\n</div>\n<hr />\n<br />\n'
111
+ );
112
+ assert.equal(
113
+ serializer.serialize(root),
114
+ '<div><img src="file.gif" data-mce-src="file.gif"></div>',
115
+ 'Whitespace where the parser will produce multiple whitespace nodes'
116
+ );
117
+ assert.deepEqual(
118
+ countNodes(root),
119
+ { body: 1, div: 1, img: 1 },
120
+ 'Whitespace where the parser will produce multiple whitespace nodes (count)'
121
+ );
122
+ });
123
+
124
+ it('Whitespace before/after invalid element with text in block', () => {
125
+ const parser = DomParser(scenario.settings, Schema({ invalid_elements: 'em' }));
126
+ const root = parser.parse('<p>a <em>b</em> c</p>');
127
+ assert.equal(serializer.serialize(root), '<p>a b c</p>');
128
+ });
129
+
130
+ it('Whitespace before/after invalid element whitespace element in block', () => {
131
+ const parser = DomParser(scenario.settings, Schema({ invalid_elements: 'span' }));
132
+ const root = parser.parse('<p> <span></span> </p>');
133
+ assert.equal(serializer.serialize(root), '<p>\u00a0</p>');
134
+ });
135
+
136
+ it('Whitespace preserved in PRE', () => {
137
+ let parser = DomParser(scenario.settings, schema);
138
+ let root = parser.parse(' \t\r\n <PRE> \t\r\n test \t\r\n </PRE> \t\r\n ');
139
+ assert.equal(serializer.serialize(root), '<pre> \t\n test \t\n </pre>', 'Whitespace around and inside PRE');
140
+ assert.deepEqual(countNodes(root), { 'body': 1, 'pre': 1, '#text': 1 }, 'Whitespace around and inside PRE (count)');
141
+
142
+ parser = DomParser(scenario.settings, schema);
143
+ root = parser.parse('<PRE> </PRE>');
144
+ assert.equal(serializer.serialize(root), '<pre> </pre>', 'Whitespace around and inside PRE');
145
+ assert.deepEqual(countNodes(root), { 'body': 1, 'pre': 1, '#text': 1 }, 'Whitespace around and inside PRE (count)');
146
+ });
147
+
148
+ it('Whitespace preserved in SPAN inside PRE', () => {
149
+ const parser = DomParser(scenario.settings, schema);
150
+ const root = parser.parse(' \t\r\n <PRE> \t\r\n <span> test </span> \t\r\n </PRE> \t\r\n ');
151
+ assert.equal(
152
+ serializer.serialize(root),
153
+ '<pre> \t\n <span> test </span> \t\n </pre>',
154
+ 'Whitespace around and inside PRE'
155
+ );
156
+ assert.deepEqual(countNodes(root), { 'body': 1, 'pre': 1, 'span': 1, '#text': 3 }, 'Whitespace around and inside PRE (count)');
157
+ });
158
+
159
+ it('Whitespace preserved in code', () => {
160
+ let parser = DomParser(scenario.settings, schema);
161
+ let root = parser.parse('<code> a </code>');
162
+ assert.equal(serializer.serialize(root), '<code> a </code>', 'Whitespace inside code');
163
+ assert.deepEqual(countNodes(root), { 'body': 1, 'code': 1, '#text': 1 }, 'Whitespace inside code (count)');
164
+
165
+ parser = DomParser(scenario.settings, schema);
166
+ root = parser.parse('<code> </code>');
167
+ assert.equal(serializer.serialize(root), '<code> </code>', 'Whitespace inside code');
168
+ assert.deepEqual(countNodes(root), { 'body': 1, 'code': 1, '#text': 1 }, 'Whitespace inside code (count)');
169
+ });
170
+
171
+ it('Parse invalid contents', () => {
172
+ let parser = DomParser(scenario.settings, schema);
173
+ let root = parser.parse('<p class="a"><p class="b">123</p></p>');
174
+ assert.equal(serializer.serialize(root), '<p class="a"></p><p class="b">123</p><p></p>', 'P in P, splits outer P');
175
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 3, '#text': 1 }, 'P in P, splits outer P (count)');
176
+
177
+ parser = DomParser(scenario.settings, schema);
178
+ root = parser.parse('<p class="a">a<p class="b">b</p><p class="c">c</p>d</p>');
179
+ assert.equal(
180
+ serializer.serialize(root),
181
+ '<p class="a">a</p><p class="b">b</p><p class="c">c</p>d<p></p>',
182
+ 'Two P in P, splits outer P'
183
+ );
184
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 4, '#text': 4 }, 'Two P in P, splits outer P (count)');
185
+
186
+ parser = DomParser(scenario.settings, schema);
187
+ root = parser.parse('<p class="a">abc<p class="b">def</p></p>');
188
+ assert.equal(serializer.serialize(root), '<p class="a">abc</p><p class="b">def</p><p></p>', 'P in P with nodes before');
189
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 3, '#text': 2 }, 'P in P with nodes before (count)');
190
+
191
+ parser = DomParser(scenario.settings, schema);
192
+ root = parser.parse('<p class="a"><p class="b">abc</p>def</p>');
193
+ assert.equal(serializer.serialize(root), '<p class="a"></p><p class="b">abc</p>def<p></p>', 'P in P with nodes after');
194
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 3, '#text': 2 }, 'P in P with nodes after (count)');
195
+
196
+ parser = DomParser(scenario.settings, schema);
197
+ root = parser.parse('<p class="a"><p class="b">abc</p><br></p>');
198
+ assert.equal(serializer.serialize(root), '<p class="a"></p><p class="b">abc</p><br><p></p>', 'P in P with BR after');
199
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 3, 'br': 1, '#text': 1 }, 'P in P with BR after (count)');
200
+
201
+ parser = DomParser(scenario.settings, schema);
202
+ root = parser.parse('<p class="a">a<strong>b<span>c<em>d<p class="b">e</p>f</em>g</span>h</strong>i</p>');
203
+ assert.equal(
204
+ serializer.serialize(root),
205
+ '<p class="a">a<strong>b<span>c<em>d</em></span></strong></p>' +
206
+ '<p class="b"><strong><em>e</em></strong></p>' +
207
+ '<strong><em>f</em>gh</strong>i<p></p>',
208
+ 'P in P wrapped in inline elements'
209
+ );
210
+ assert.deepEqual(
211
+ countNodes(root),
212
+ { 'body': 1, 'p': 3, '#text': 8, 'strong': 3, 'span': 1, 'em': 3 },
213
+ 'P in P wrapped in inline elements (count)'
214
+ );
215
+
216
+ parser = DomParser(scenario.settings, schema);
217
+ root = parser.parse('<p class="a">a<p class="b">b<p class="c">c</p>d</p>e</p>');
218
+ assert.equal(
219
+ serializer.serialize(root),
220
+ '<p class="a">a</p><p class="b">b</p><p class="c">c</p>d<p></p>e<p></p>',
221
+ 'P in P in P with text before/after'
222
+ );
223
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 5, '#text': 5 }, 'P in P in P with text before/after (count)');
224
+
225
+ parser = DomParser(scenario.settings, schema);
226
+ root = parser.parse('<p>a<ul><li>b</li><li>c</li></ul>d</p>');
227
+ assert.equal(serializer.serialize(root), '<p>a</p><ul><li>b</li><li>c</li></ul>d<p></p>', 'UL inside P');
228
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 2, 'ul': 1, 'li': 2, '#text': 4 }, 'UL inside P (count)');
229
+
230
+ parser = DomParser(scenario.settings, schema);
231
+ root = parser.parse('<table><tr><td><tr>a</tr></td></tr></table>');
232
+ assert.equal(serializer.serialize(root), 'a<table><tbody><tr><td></td></tr><tr></tr></tbody></table>', 'TR inside TD');
233
+ assert.deepEqual(countNodes(root), { 'body': 1, 'table': 1, 'tbody': 1, 'tr': 2, 'td': 1, '#text': 1 }, 'TR inside TD (count)');
234
+
235
+ parser = DomParser(scenario.settings, Schema({ valid_elements: 'p,section,div' }));
236
+ root = parser.parse('<div><section><p>a</p></section></div>');
237
+ assert.equal(serializer.serialize(root), '<div><section><p>a</p></section></div>', 'P inside SECTION');
238
+ assert.deepEqual(countNodes(root), { 'body': 1, 'div': 1, 'section': 1, 'p': 1, '#text': 1 }, 'P inside SECTION (count)');
239
+ });
240
+
241
+ it('Remove empty nodes', () => {
242
+ const parser = DomParser(scenario.settings, Schema({ valid_elements: '-p,-span[id|style],-strong' }));
243
+ let root = parser.parse(
244
+ '<p>a<span></span><span> </span><span id="x">b</span><span id="y"></span></p><p></p><p><span></span></p><p> </p>'
245
+ );
246
+ assert.equal(serializer.serialize(root), '<p>a <span id="x">b</span><span id="y"></span></p>');
247
+
248
+ root = parser.parse('<p>a&nbsp;<span style="text-decoration: underline"> </span>&nbsp;b</p>');
249
+ assert.equal(serializer.serialize(root), '<p>a\u00a0<span style="text-decoration: underline"> </span>\u00a0b</p>');
250
+
251
+ root = parser.parse('<p>a&nbsp;<strong> </strong>&nbsp;b</p>');
252
+ assert.equal(serializer.serialize(root), '<p>a\u00a0<strong> </strong>\u00a0b</p>');
253
+
254
+ root = parser.parse('<p>a&nbsp;<span style="text-decoration: underline"></span>&nbsp;b</p>');
255
+ assert.equal(serializer.serialize(root), '<p>a\u00a0\u00a0b</p>');
256
+
257
+ root = parser.parse('<p>a&nbsp;<span> </span>&nbsp;b</p>');
258
+ assert.equal(serializer.serialize(root), '<p>a\u00a0 \u00a0b</p>');
259
+ });
260
+
261
+ it('Parse invalid contents with node filters', () => {
262
+ const parser = DomParser(scenario.settings, schema);
263
+ parser.addNodeFilter('p', (nodes) => {
264
+ Arr.each(nodes, (node) => {
265
+ node.attr('class', 'x');
266
+ });
267
+ });
268
+ const root = parser.parse('<p>a<p>123</p>b</p>');
269
+ assert.equal(serializer.serialize(root), '<p class="x">a</p><p class="x">123</p>b<p class="x"></p>', 'P should have class x');
270
+ });
271
+
272
+ it('Parse invalid contents with attribute filters', () => {
273
+ const parser = DomParser(scenario.settings, schema);
274
+ parser.addAttributeFilter('class', (nodes) => {
275
+ Arr.each(nodes, (node) => {
276
+ node.attr('class', 'x');
277
+ });
278
+ });
279
+ const root = parser.parse('<p class="y">a<p class="y">123</p>b</p>');
280
+ assert.equal(serializer.serialize(root), '<p class="x">a</p><p class="x">123</p>b<p></p>', 'P should have class x');
281
+ });
282
+
283
+ it('addNodeFilter', () => {
284
+ let result: ParseTestResult | undefined;
285
+
286
+ const parser = DomParser(scenario.settings, schema);
287
+ parser.addNodeFilter('#comment', (nodes, name, args) => {
288
+ result = { nodes, name, args };
289
+ });
290
+ parser.parse('text<!--text1-->text<!--text2-->');
291
+
292
+ assert.deepEqual(result?.args, {}, 'Parser args');
293
+ assert.equal(result?.name, '#comment', 'Parser filter result name');
294
+ assert.equal(result?.nodes.length, 2, 'Parser filter result node');
295
+ assert.equal(result?.nodes[0].name, '#comment', 'Parser filter result node(0) name');
296
+ assert.equal(result?.nodes[0].value, 'text1', 'Parser filter result node(0) value');
297
+ assert.equal(result?.nodes[1].name, '#comment', 'Parser filter result node(1) name');
298
+ assert.equal(result?.nodes[1].value, 'text2', 'Parser filter result node(1) value');
299
+ });
300
+
301
+ it('addNodeFilter multiple names', () => {
302
+ const results: Record<string, ParseTestResult> = {};
303
+
304
+ const parser = DomParser(scenario.settings, schema);
305
+ parser.addNodeFilter('#comment,#text', (nodes, name, args) => {
306
+ results[name] = { nodes, name, args };
307
+ });
308
+ parser.parse('text1<!--text1-->text2<!--text2-->');
309
+
310
+ assert.deepEqual(results['#comment'].args, {}, 'Parser args');
311
+ assert.equal(results['#comment'].name, '#comment', 'Parser filter result name');
312
+ assert.equal(results['#comment'].nodes.length, 2, 'Parser filter result node');
313
+ assert.equal(results['#comment'].nodes[0].name, '#comment', 'Parser filter result node(0) name');
314
+ assert.equal(results['#comment'].nodes[0].value, 'text1', 'Parser filter result node(0) value');
315
+ assert.equal(results['#comment'].nodes[1].name, '#comment', 'Parser filter result node(1) name');
316
+ assert.equal(results['#comment'].nodes[1].value, 'text2', 'Parser filter result node(1) value');
317
+ assert.deepEqual(results['#text'].args, {}, 'Parser args');
318
+ assert.equal(results['#text'].name, '#text', 'Parser filter result name');
319
+ assert.equal(results['#text'].nodes.length, 2, 'Parser filter result node');
320
+ assert.equal(results['#text'].nodes[0].name, '#text', 'Parser filter result node(0) name');
321
+ assert.equal(results['#text'].nodes[0].value, 'text1', 'Parser filter result node(0) value');
322
+ assert.equal(results['#text'].nodes[1].name, '#text', 'Parser filter result node(1) name');
323
+ assert.equal(results['#text'].nodes[1].value, 'text2', 'Parser filter result node(1) value');
324
+ });
325
+
326
+ it('addNodeFilter with parser args', () => {
327
+ let result: ParseTestResult | undefined;
328
+
329
+ const parser = DomParser(scenario.settings, schema);
330
+ parser.addNodeFilter('#comment', (nodes, name, args) => {
331
+ result = { nodes, name, args };
332
+ });
333
+ parser.parse('text<!--text1-->text<!--text2-->', { value: 1 });
334
+
335
+ assert.deepEqual(result?.args, { value: 1 }, 'Parser args');
336
+ });
337
+
338
+ it('TINY-7847: removeNodeFilter', () => {
339
+ const parser = DomParser(scenario.settings);
340
+ const numFilters = parser.getNodeFilters().length;
341
+ let called = false;
342
+
343
+ const filter = (_nodes: AstNode[]) => {
344
+ called = true;
345
+ };
346
+ parser.addNodeFilter('th,td', filter);
347
+ parser.addNodeFilter('th,td', Fun.noop);
348
+
349
+ assert.lengthOf(parser.getNodeFilters(), numFilters + 2, 'Before removing filters');
350
+ parser.removeNodeFilter('th', filter);
351
+ assert.lengthOf(parser.getNodeFilters(), numFilters + 2, 'After removing the first th node filter');
352
+ assert.lengthOf(parser.getNodeFilters()[numFilters].callbacks, 1, 'th node callbacks');
353
+ parser.removeNodeFilter('th', Fun.noop);
354
+ assert.lengthOf(parser.getNodeFilters(), numFilters + 1, 'After removing the second th node filter');
355
+ parser.removeNodeFilter('th,td');
356
+ assert.lengthOf(parser.getNodeFilters(), numFilters, 'After removing all th and td node filters');
357
+
358
+ // Ensure that after being removed the filters aren't called
359
+ parser.parse('<table><tr><th></th><td></td></tr></table>');
360
+ assert.isFalse(called);
361
+ });
362
+
363
+ it('addAttributeFilter', () => {
364
+ let result: ParseTestResult | undefined;
365
+
366
+ const parser = DomParser(scenario.settings);
367
+ parser.addAttributeFilter('src', (nodes, name, args) => {
368
+ result = { nodes, name, args };
369
+ });
370
+ parser.parse('<b>a<img src="1.gif" />b<img src="1.gif" />c</b>');
371
+
372
+ assert.deepEqual(result?.args, {}, 'Parser args');
373
+ assert.equal(result?.name, 'src', 'Parser filter result name');
374
+ assert.equal(result?.nodes.length, 2, 'Parser filter result node');
375
+ assert.equal(result?.nodes[0].name, 'img', 'Parser filter result node(0) name');
376
+ assert.equal(result?.nodes[0].attr('src'), '1.gif', 'Parser filter result node(0) attr');
377
+ assert.equal(result?.nodes[1].name, 'img', 'Parser filter result node(1) name');
378
+ assert.equal(result?.nodes[1].attr('src'), '1.gif', 'Parser filter result node(1) attr');
379
+ });
380
+
381
+ it('addAttributeFilter multiple', () => {
382
+ const results: any = {};
383
+
384
+ const parser = DomParser(scenario.settings);
385
+ parser.addAttributeFilter('src,href', (nodes, name, args) => {
386
+ results[name] = { nodes, name, args };
387
+ });
388
+ parser.parse('<b><a href="1.gif">a</a><img src="1.gif" />b<img src="1.gif" /><a href="2.gif">c</a></b>');
389
+
390
+ assert.deepEqual(results.src.args, {}, 'Parser args');
391
+ assert.equal(results.src.name, 'src', 'Parser filter result name');
392
+ assert.equal(results.src.nodes.length, 2, 'Parser filter result node');
393
+ assert.equal(results.src.nodes[0].name, 'img', 'Parser filter result node(0) name');
394
+ assert.equal(results.src.nodes[0].attr('src'), '1.gif', 'Parser filter result node(0) attr');
395
+ assert.equal(results.src.nodes[1].name, 'img', 'Parser filter result node(1) name');
396
+ assert.equal(results.src.nodes[1].attr('src'), '1.gif', 'Parser filter result node(1) attr');
397
+ assert.deepEqual(results.href.args, {}, 'Parser args');
398
+ assert.equal(results.href.name, 'href', 'Parser filter result name');
399
+ assert.equal(results.href.nodes.length, 2, 'Parser filter result node');
400
+ assert.equal(results.href.nodes[0].name, 'a', 'Parser filter result node(0) name');
401
+ assert.equal(results.href.nodes[0].attr('href'), '1.gif', 'Parser filter result node(0) attr');
402
+ assert.equal(results.href.nodes[1].name, 'a', 'Parser filter result node(1) name');
403
+ assert.equal(results.href.nodes[1].attr('href'), '2.gif', 'Parser filter result node(1) attr');
404
+ });
405
+
406
+ it('TINY-8888: mutating addNodeFilter -> addAttributeFilter', () => {
407
+ const parser = DomParser(scenario.settings);
408
+ parser.addNodeFilter('img', (nodes) => {
409
+ Arr.each(nodes, (node) => node.attr('src', null));
410
+ });
411
+ parser.addAttributeFilter('src', () => {
412
+ assert.fail('second src filter should not run, because src was removed');
413
+ });
414
+ parser.parse('<b>a<img src="1.gif" />b</b>');
415
+ });
416
+
417
+ it('TINY-8888: mutating addNodeFilter -> addNodeFilter', () => {
418
+ const parser = DomParser(scenario.settings);
419
+ parser.addNodeFilter('img', (nodes) => {
420
+ Arr.each(nodes, (node) => node.remove());
421
+ });
422
+ parser.addNodeFilter('img', () => {
423
+ assert.fail('second img filter should not run, because img was removed');
424
+ });
425
+ parser.parse('<b>a<img src="1.gif" />b</b>');
426
+ });
427
+
428
+ it('TINY-8888: mutating addAttributeFilter -> addAttributeFilter', () => {
429
+ const parser = DomParser(scenario.settings);
430
+ parser.addAttributeFilter('src', (nodes) => {
431
+ Arr.each(nodes, (node) => node.attr('src', null));
432
+ });
433
+ parser.addAttributeFilter('src', () => {
434
+ assert.fail('second src filter should not run, because src was removed');
435
+ });
436
+ parser.parse('<b>a<img src="1.gif" />b</b>');
437
+ });
438
+
439
+ it('TINY-8888: mutating addAttributeFilter only removes matching nodes', () => {
440
+ const parser = DomParser(scenario.settings);
441
+ parser.addAttributeFilter('src', (nodes) => {
442
+ nodes[0].attr('src', null);
443
+ });
444
+ let ranIdFilter = false;
445
+ parser.addAttributeFilter('src', (nodes) => {
446
+ ranIdFilter = true;
447
+ assert.lengthOf(nodes, 1);
448
+ assert.equal(nodes[0].attr('src'), '2.gif');
449
+ });
450
+ parser.parse('<b>a<img src="1.gif" />b<img src="2.gif" />c</b>');
451
+ assert.isTrue(ranIdFilter, 'second filter should run, because only one src attribute was removed');
452
+ });
453
+
454
+ it('TINY-7847: removeAttributeFilter', () => {
455
+ const parser = DomParser(scenario.settings);
456
+ const numFilters = parser.getAttributeFilters().length;
457
+ let called = false;
458
+
459
+ const filter = (_nodes: AstNode[]) => {
460
+ called = true;
461
+ };
462
+ parser.addAttributeFilter('controls,poster', filter);
463
+ parser.addAttributeFilter('controls,poster', Fun.noop);
464
+
465
+ assert.lengthOf(parser.getAttributeFilters(), numFilters + 2, 'Before removing filters');
466
+ parser.removeAttributeFilter('controls', filter);
467
+ assert.lengthOf(parser.getAttributeFilters(), numFilters + 2, 'After removing the first controls attribute filter');
468
+ assert.lengthOf(parser.getAttributeFilters()[numFilters].callbacks, 1, 'controls attribute node callbacks');
469
+ parser.removeAttributeFilter('controls', Fun.noop);
470
+ assert.lengthOf(parser.getAttributeFilters(), numFilters + 1, 'After removing the second controls attribute filter');
471
+ parser.removeAttributeFilter('controls,poster');
472
+ assert.lengthOf(parser.getAttributeFilters(), numFilters, 'After removing all controls and poster attribute filter');
473
+
474
+ // Ensure that after being removed the filters aren't called
475
+ parser.parse('<video controls poster="about:blank"></video>');
476
+ assert.isFalse(called);
477
+ });
478
+
479
+ it('Fix orphan LI elements', () => {
480
+ let parser = DomParser(scenario.settings, schema);
481
+ let root = parser.parse('<ul><li>a</li></ul><li>b</li>');
482
+ assert.equal(serializer.serialize(root), '<ul><li>a</li><li>b</li></ul>', 'LI moved to previous sibling UL');
483
+
484
+ parser = DomParser(scenario.settings, schema);
485
+ root = parser.parse('<li>a</li><ul><li>b</li></ul>');
486
+ assert.equal(serializer.serialize(root), '<ul><li>a</li><li>b</li></ul>', 'LI moved to next sibling UL');
487
+
488
+ parser = DomParser(scenario.settings, schema);
489
+ root = parser.parse('<ol><li>a</li></ol><li>b</li>');
490
+ assert.equal(serializer.serialize(root), '<ol><li>a</li><li>b</li></ol>', 'LI moved to previous sibling OL');
491
+
492
+ parser = DomParser(scenario.settings, schema);
493
+ root = parser.parse('<li>a</li><ol><li>b</li></ol>');
494
+ assert.equal(serializer.serialize(root), '<ol><li>a</li><li>b</li></ol>', 'LI moved to next sibling OL');
495
+
496
+ parser = DomParser(scenario.settings, schema);
497
+ root = parser.parse('<li>a</li>');
498
+ assert.equal(serializer.serialize(root), '<ul><li>a</li></ul>', 'LI wrapped in new UL');
499
+ });
500
+
501
+ it('Remove empty elements', () => {
502
+ const schema = Schema({ valid_elements: 'span,-a,img' });
503
+
504
+ let parser = DomParser(scenario.settings, schema);
505
+ let root = parser.parse('<span></span><a href="#"></a>');
506
+ assert.equal(serializer.serialize(root), '<span></span>', 'Remove empty a element');
507
+
508
+ parser = DomParser(scenario.settings, Schema({ valid_elements: 'span,a[name],img' }));
509
+ root = parser.parse('<span></span><a name="anchor"></a>');
510
+ assert.equal(serializer.serialize(root), '<span></span><a name="anchor"></a>', 'Leave a with name attribute');
511
+
512
+ parser = DomParser(scenario.settings, Schema({ valid_elements: 'span,a[href],img[src]' }));
513
+ root = parser.parse('<span></span><a href="#"><img src="about:blank" /></a>');
514
+ assert.equal(
515
+ serializer.serialize(root),
516
+ '<span></span><a href="#"><img src="about:blank"></a>',
517
+ 'Leave elements with img in it'
518
+ );
519
+ });
520
+
521
+ it('Self closing list elements', () => {
522
+ const schema = Schema();
523
+
524
+ const parser = DomParser(scenario.settings, schema);
525
+ const root = parser.parse('<ul><li>1<li><b>2</b><li><em><b>3</b></em></ul>');
526
+ assert.equal(
527
+ serializer.serialize(root),
528
+ '<ul><li>1</li><li><strong>2</strong></li><li><em><strong>3</strong></em></li></ul>',
529
+ 'Split out LI elements in LI elements.'
530
+ );
531
+ });
532
+
533
+ it('Forced root blocks', () => {
534
+ const schema = Schema();
535
+
536
+ const parser = DomParser({ forced_root_block: 'p', ...scenario.settings }, schema);
537
+ const root = parser.parse(
538
+ '<!-- a -->' +
539
+ 'b' +
540
+ '<b>c</b>' +
541
+ '<p>d</p>' +
542
+ '<p>e</p>' +
543
+ 'f' +
544
+ '<b>g</b>' +
545
+ 'h'
546
+ );
547
+ assert.equal(
548
+ serializer.serialize(root),
549
+ '<!-- a --><p>b<strong>c</strong></p><p>d</p><p>e</p><p>f<strong>g</strong>h</p>',
550
+ 'Mixed text nodes, inline elements and blocks.'
551
+ );
552
+ });
553
+
554
+ it('Forced root blocks attrs', () => {
555
+ const schema = Schema();
556
+
557
+ const parser = DomParser({ forced_root_block: 'p', forced_root_block_attrs: { class: 'class1' }, ...scenario.settings }, schema);
558
+ const root = parser.parse(
559
+ '<!-- a -->' +
560
+ 'b' +
561
+ '<b>c</b>' +
562
+ '<p>d</p>' +
563
+ '<p>e</p>' +
564
+ 'f' +
565
+ '<b>g</b>' +
566
+ 'h'
567
+ );
568
+ assert.equal(serializer.serialize(root), '<!-- a -->' +
569
+ '<p class="class1">b<strong>c</strong></p>' +
570
+ '<p>d</p>' +
571
+ '<p>e</p>' +
572
+ '<p class="class1">f<strong>g</strong>h</p>',
573
+ 'Mixed text nodes, inline elements and blocks.');
574
+ });
575
+
576
+ it('Parse html4 lists into html5 lists', () => {
577
+ const schema = Schema();
578
+
579
+ const parser = DomParser({ fix_list_elements: true, ...scenario.settings }, schema);
580
+ const root = parser.parse('<ul><ul><li>a</li></ul></ul><ul><li>a</li><ul><li>b</li></ul></ul>');
581
+ assert.equal(
582
+ serializer.serialize(root),
583
+ '<ul><li style="list-style-type: none"><ul><li>a</li></ul></li></ul><ul><li>a<ul><li>b</li></ul></li></ul>'
584
+ );
585
+ });
586
+
587
+ it('Parse contents with html4 anchors and allow_html_in_named_anchor: false', () => {
588
+ const schema = Schema();
589
+
590
+ const parser = DomParser({ allow_html_in_named_anchor: false, ...scenario.settings }, schema);
591
+ const root = parser.parse('<a name="x">a</a><a href="x">x</a>');
592
+ assert.equal(serializer.serialize(root), '<a name="x"></a>a<a href="x">x</a>');
593
+ });
594
+
595
+ it('Parse contents with html5 anchors and allow_html_in_named_anchor: false', () => {
596
+ const schema = Schema({ schema: 'html5' });
597
+
598
+ const parser = DomParser({ allow_html_in_named_anchor: false, ...scenario.settings }, schema);
599
+ const root = parser.parse('<a id="x">a</a><a href="x">x</a>');
600
+ assert.equal(serializer.serialize(root), '<a id="x"></a>a<a href="x">x</a>');
601
+ });
602
+
603
+ it('Parse contents with html4 anchors and allow_html_in_named_anchor: true', () => {
604
+ const schema = Schema();
605
+
606
+ const parser = DomParser({ allow_html_in_named_anchor: true, ...scenario.settings }, schema);
607
+ const root = parser.parse('<a name="x">a</a><a href="x">x</a>');
608
+ assert.equal(serializer.serialize(root), '<a name="x">a</a><a href="x">x</a>');
609
+ });
610
+
611
+ it('Parse contents with html5 anchors and allow_html_in_named_anchor: true', () => {
612
+ const schema = Schema({ schema: 'html5' });
613
+
614
+ const parser = DomParser({ allow_html_in_named_anchor: true, ...scenario.settings }, schema);
615
+ const root = parser.parse('<a id="x">a</a><a href="x">x</a>');
616
+ assert.equal(serializer.serialize(root), '<a id="x">a</a><a href="x">x</a>');
617
+ });
618
+
619
+ it('Parse contents with html5 self closing datalist options', () => {
620
+ const schema = Schema({ schema: 'html5' });
621
+
622
+ const parser = DomParser(scenario.settings, schema);
623
+ const root = parser.parse(
624
+ '<datalist><option label="a1" value="b1"><option label="a2" value="b2"><option label="a3" value="b3"></datalist>'
625
+ );
626
+ assert.equal(
627
+ serializer.serialize(root),
628
+ '<datalist><option label="a1" value="b1"></option><option label="a2" value="b2"></option>' +
629
+ '<option label="a3" value="b3"></option></datalist>'
630
+ );
631
+ });
632
+
633
+ it('Parse inline contents before block bug #5424', () => {
634
+ const schema = Schema({ schema: 'html5' });
635
+
636
+ const parser = DomParser(scenario.settings, schema);
637
+ const root = parser.parse('<strong>1</strong> 2<p>3</p>');
638
+ assert.equal(serializer.serialize(root), '<strong>1</strong> 2<p>3</p>');
639
+ });
640
+
641
+ it('Invalid text blocks within a li', () => {
642
+ const schema = Schema({ schema: 'html5', valid_children: '-li[p]' });
643
+
644
+ const parser = DomParser(scenario.settings, schema);
645
+ const root = parser.parse('<ul><li>1<p>2</p></li><li>a<p>b</p><p>c</p></li></ul>');
646
+ assert.equal(serializer.serialize(root), '<ul><li>12</li><li>ab</li><li>c</li></ul>');
647
+ });
648
+
649
+ it('Invalid inline element with space before', () => {
650
+ const schema = Schema();
651
+
652
+ const parser = DomParser(scenario.settings, schema);
653
+ const root = parser.parse('<p><span>1</span> <strong>2</strong></p>');
654
+ assert.equal(serializer.serialize(root), '<p>1 <strong>2</strong></p>');
655
+ });
656
+
657
+ it('Valid classes', () => {
658
+ const schema = Schema({ valid_classes: 'classA classB' });
659
+
660
+ const parser = DomParser(scenario.settings, schema);
661
+ const root = parser.parse('<p class="classA classB classC">a</p>');
662
+ assert.equal(serializer.serialize(root), '<p class="classA classB">a</p>');
663
+ });
664
+
665
+ it('Valid classes multiple elements', () => {
666
+ const schema = Schema({ valid_classes: { '*': 'classA classB', 'strong': 'classC' }});
667
+
668
+ const parser = DomParser(scenario.settings, schema);
669
+ const root = parser.parse('<p class="classA classB classC"><strong class="classA classB classC classD">a</strong></p>');
670
+ assert.equal(serializer.serialize(root), '<p class="classA classB"><strong class="classA classB classC">a</strong></p>');
671
+ });
672
+
673
+ it('Pad empty list blocks', () => {
674
+ const schema = Schema();
675
+
676
+ const parser = DomParser(scenario.settings, schema);
677
+ const root = parser.parse('<ul><li></li></ul><ul><li> </li></ul>');
678
+ assert.equal(serializer.serialize(root), '<ul><li>\u00a0</li></ul><ul><li>\u00a0</li></ul>');
679
+ });
680
+
681
+ it('TINY-9861: Pad empty with br', () => {
682
+ const schema = Schema();
683
+ const serializer = HtmlSerializer({ }, schema);
684
+
685
+ const parser1 = DomParser({ pad_empty_with_br: true }, schema);
686
+ const root1 = parser1.parse('<p>a</p><p></p>');
687
+ assert.equal(serializer.serialize(root1), '<p>a</p><p><br></p>');
688
+
689
+ const parser2 = DomParser({ pad_empty_with_br: false }, schema);
690
+ const root2 = parser2.parse('<p>a</p><p></p>');
691
+ assert.equal(serializer.serialize(root2), '<p>a</p><p>\u00A0</p>');
692
+ });
693
+
694
+ it('Pad empty and prefer br on insert', () => {
695
+ const schema = Schema();
696
+
697
+ const parser = DomParser(scenario.settings, schema);
698
+ const root = parser.parse('<ul><li></li><li> </li><li><br /></li><li>\u00a0</li><li>a</li></ul>', { insert: true });
699
+ assert.equal(serializer.serialize(root), '<ul><li><br data-mce-bogus="1"></li><li><br data-mce-bogus="1"></li><li><br></li><li><br data-mce-bogus="1"></li><li>a</li></ul>');
700
+ });
701
+
702
+ it('Preserve space in inline span', () => {
703
+ const schema = Schema();
704
+
705
+ const parser = DomParser(scenario.settings, schema);
706
+ const root = parser.parse('a<span> </span>b');
707
+ assert.equal(serializer.serialize(root), 'a b');
708
+ });
709
+
710
+ it('Bug #7543 removes whitespace between bogus elements before a block', () => {
711
+ const serializer = HtmlSerializer();
712
+
713
+ assert.equal(
714
+ serializer.serialize(DomParser(scenario.settings).parse(
715
+ '<div><b data-mce-bogus="1">a</b> <b data-mce-bogus="1">b</b><p>c</p></div>')
716
+ ),
717
+ '<div>a b<p>c</p></div>'
718
+ );
719
+ });
720
+
721
+ it('Bug #7582 removes whitespace between bogus elements before a block', () => {
722
+ const serializer = HtmlSerializer();
723
+
724
+ assert.equal(
725
+ serializer.serialize(DomParser(scenario.settings).parse(
726
+ '<div>1 <span data-mce-bogus="1">2</span><div>3</div></div>')
727
+ ),
728
+ '<div>1 2<div>3</div></div>'
729
+ );
730
+ });
731
+
732
+ it('do not replace starting linebreak with space', () => {
733
+ const serializer = HtmlSerializer();
734
+
735
+ assert.equal(
736
+ serializer.serialize(DomParser(scenario.settings).parse('<p>a<br />\nb</p>')),
737
+ '<p>a<br>b</p>'
738
+ );
739
+ });
740
+
741
+ it('Preserve internal elements', () => {
742
+ const html = '<span id="id" class="class"><b>text</b></span><span id="test" data-mce-type="something"></span>';
743
+
744
+ const parser1 = DomParser(scenario.settings, Schema({ valid_elements: 'b' }));
745
+ const serializerHtml1 = serializer.serialize(parser1.parse(html));
746
+ assert.equal(
747
+ serializerHtml1,
748
+ '<b>text</b><span id="test" data-mce-type="something"></span>',
749
+ 'Preserve internal span element without any span schema rule.'
750
+ );
751
+
752
+ const parser2 = DomParser(scenario.settings, Schema({ valid_elements: 'b,span[class]' }));
753
+ const serializerHtml2 = serializer.serialize(parser2.parse(html));
754
+ assert.equal(
755
+ serializerHtml2,
756
+ '<span class="class"><b>text</b></span><span id="test" data-mce-type="something"></span>',
757
+ 'Preserve internal span element with a span schema rule.'
758
+ );
759
+
760
+ const serializedHtml3 = serializer.serialize(parser1.parse('<b data-mce-type="test" id="x" style="color: red" src="1" data="2" onclick="3"></b>'));
761
+ assert.equal(
762
+ serializedHtml3,
763
+ '<b data-mce-type="test" id="x" style="color: red"></b>',
764
+ 'Removes disallowed elements'
765
+ );
766
+ });
767
+
768
+ // TINY-9624: Safari encodes the iframe innerHTML is `&lt;textarea&gt;`. On Chrome and Firefox, the innerHTML is `<textarea>`, causing
769
+ // the mXSS cleaner in DOMPurify to run and remove the iframe.
770
+ it('parse iframe XSS', () => {
771
+ const serializer = HtmlSerializer();
772
+
773
+ assert.equal(
774
+ serializer.serialize(DomParser(scenario.settings).parse('<iframe><textarea></iframe><img src="a" onerror="alert(document.domain)" />')),
775
+ browser.isSafari() || !scenario.isSanitizeEnabled ? '<iframe><textarea></iframe><img src="a">' : '<img src="a">'
776
+ );
777
+ });
778
+
779
+ it('Conditional comments (allowed)', () => {
780
+ const parser = DomParser({ allow_conditional_comments: true, validate: false, ...scenario.settings }, schema);
781
+ const html = '<!--[if gte IE 4]>alert(1)<![endif]-->';
782
+ const serializedHtml = serializer.serialize(parser.parse(html));
783
+ assert.equal(serializedHtml, '<!--[if gte IE 4]>alert(1)<![endif]-->');
784
+ });
785
+
786
+ it('Conditional comments (denied)', () => {
787
+ const parser = DomParser({ allow_conditional_comments: false, validate: false, ...scenario.settings }, schema);
788
+
789
+ let serializedHtml = serializer.serialize(parser.parse('<!--[if gte IE 4]>alert(1)<![endif]-->'));
790
+ assert.equal(serializedHtml, '<!-- [if gte IE 4]>alert(1)<![endif]-->');
791
+
792
+ serializedHtml = serializer.serialize(parser.parse('<!--[if !IE]>alert(1)<![endif]-->'));
793
+ assert.equal(serializedHtml, '<!-- [if !IE]>alert(1)<![endif]-->');
794
+
795
+ serializedHtml = serializer.serialize(parser.parse('<!--[iF !IE]>alert(1)<![endif]-->'));
796
+ assert.equal(serializedHtml, '<!-- [iF !IE]>alert(1)<![endif]-->');
797
+ });
798
+
799
+ it('allow_script_urls should allow any URIs', () => {
800
+ const parser = DomParser({ allow_script_urls: true, ...scenario.settings });
801
+ const html = '<a href="javascript:alert(1)">1</a>' +
802
+ '<a href="data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">3</a>';
803
+ const serializedHtml = serializer.serialize(parser.parse(html));
804
+
805
+ assert.equal(serializedHtml,
806
+ '<a href="javascript:alert(1)">1</a>' +
807
+ '<a href="data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">3</a>'
808
+ );
809
+ });
810
+
811
+ it('allow_html_data_urls should allow any data URIs, but not script URIs', () => {
812
+ const parser = DomParser({ allow_html_data_urls: true, ...scenario.settings });
813
+ const html = '<a href="javascript:alert(1)">1</a>' +
814
+ '<a href="data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">2</a>' +
815
+ '<a href="data:image/svg+xml;base64,x">3</a>';
816
+ const serializedHtml = serializer.serialize(parser.parse(html));
817
+
818
+ assert.equal(serializedHtml,
819
+ '<a>1</a>' +
820
+ '<a href="data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">2</a>' +
821
+ '<a href="data:image/svg+xml;base64,x">3</a>'
822
+ );
823
+ });
824
+
825
+ it('Parse script urls (disallow svg data image uris)', () => {
826
+ const parser = DomParser({ allow_svg_data_urls: false, allow_html_data_urls: false, validate: false, ...scenario.settings }, schema);
827
+ const html = '<a href="data:image/svg+xml;base64,x">1</a>' +
828
+ '<img src="data:image/svg+xml;base64,x">';
829
+ const serializedHtml = serializer.serialize(parser.parse(html));
830
+
831
+ assert.equal(
832
+ serializedHtml,
833
+ '<a>1</a>' +
834
+ '<img>'
835
+ );
836
+ });
837
+
838
+ it('Parse script urls (denied)', () => {
839
+ const parser = DomParser({ allow_script_urls: false, validate: false, ...scenario.settings }, schema);
840
+ const html = '<a href="jAvaScript:alert(1)">1</a>' +
841
+ '<a href="vbscript:alert(2)">2</a>' +
842
+ '<a href="javascript:alert(3)">3</a>' +
843
+ '<a href="\njavascript:alert(4)">4</a>' +
844
+ '<a href="java\nscript:alert(5)">5</a>' +
845
+ '<a href="java\tscript:alert(6)">6</a>' +
846
+ '<a href="%6aavascript:alert(7)">7</a>' +
847
+ '<a href="data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">8</a>' +
848
+ '<a href=" dAt%61: tExt/html ; bAse64 , PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">9</a>' +
849
+ '<object data="data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMik+">10</object>' +
850
+ '<button formaction="javascript:alert(11)">11</button>' +
851
+ '<form action="javascript:alert(12)">12</form>' +
852
+ '<table background="javascript:alert(13)"><tbody><tr><td>13</td></tr></tbody></table>' +
853
+ '<a href="mhtml:14">14</a>' +
854
+ '<a xlink:href="jAvaScript:alert(15)">15</a>' +
855
+ '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">' +
856
+ '<a href="%E3%82%AA%E3%83%BC%E3%83">Invalid url</a>';
857
+ const serializedHtml = serializer.serialize(parser.parse(html));
858
+
859
+ assert.equal(
860
+ serializedHtml,
861
+ '<a>1</a>' +
862
+ '<a>2</a>' +
863
+ '<a>3</a>' +
864
+ '<a>4</a>' +
865
+ '<a>5</a>' +
866
+ '<a>6</a>' +
867
+ '<a>7</a>' +
868
+ '<a>8</a>' +
869
+ '<a>9</a>' +
870
+ '<object>10</object>' +
871
+ '<button>11</button>' +
872
+ '<form>12</form>' +
873
+ '<table><tbody><tr><td>13</td></tr></tbody></table>' +
874
+ '<a>14</a>' +
875
+ '<a>15</a>' +
876
+ '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">' +
877
+ '<a href="%E3%82%AA%E3%83%BC%E3%83">Invalid url</a>'
878
+ );
879
+ });
880
+
881
+ it('Parse svg urls (default)', () => {
882
+ const parser = DomParser(scenario.settings);
883
+ const serializedHtml = serializer.serialize(parser.parse(
884
+ '<iframe src="data:image/svg+xml;base64,x"></iframe>' +
885
+ '<a href="data:image/svg+xml;base64,x">1</a>' +
886
+ '<object data="data:image/svg+xml;base64,x"></object>' +
887
+ '<img src="data:image/svg+xml;base64,x">' +
888
+ '<video poster="data:image/svg+xml;base64,x"></video>'
889
+ ));
890
+ assert.equal(serializedHtml,
891
+ '<iframe></iframe>' +
892
+ '<a>1</a>' +
893
+ '<object></object>' +
894
+ '<img src="data:image/svg+xml;base64,x">' +
895
+ // parser allows svg data urls in <img> and <video> by default but DOMPurify sanitization removes it for <video>
896
+ (scenario.isSanitizeEnabled ? '<video></video>' : '<video poster="data:image/svg+xml;base64,x"></video>')
897
+ );
898
+ });
899
+
900
+ it('Parse svg urls (allowed)', () => {
901
+ const parser = DomParser({ allow_svg_data_urls: true, ...scenario.settings });
902
+ const serializedHtml = serializer.serialize(parser.parse(
903
+ '<iframe src="data:image/svg+xml;base64,x"></iframe>' +
904
+ '<a href="data:image/svg+xml;base64,x">1</a>' +
905
+ '<object data="data:image/svg+xml;base64,x"></object>' +
906
+ '<img src="data:image/svg+xml;base64,x">' +
907
+ '<video poster="data:image/svg+xml;base64,x"></video>'
908
+ ));
909
+ assert.equal(serializedHtml,
910
+ '<iframe src="data:image/svg+xml;base64,x"></iframe>' +
911
+ '<a href="data:image/svg+xml;base64,x">1</a>' +
912
+ '<object data="data:image/svg+xml;base64,x"></object>' +
913
+ '<img src="data:image/svg+xml;base64,x">' +
914
+ '<video poster="data:image/svg+xml;base64,x"></video>'
915
+ );
916
+ });
917
+
918
+ it('Parse svg urls (denied)', () => {
919
+ const parser = DomParser({ allow_svg_data_urls: false, ...scenario.settings });
920
+ const serializedHtml = serializer.serialize(parser.parse(
921
+ '<iframe src="data:image/svg+xml;base64,x"></iframe>' +
922
+ '<a href="data:image/svg+xml;base64,x">1</a>' +
923
+ '<object data="data:image/svg+xml;base64,x"></object>' +
924
+ '<img src="data:image/svg+xml;base64,x">' +
925
+ '<video poster="data:image/svg+xml;base64,x"></video>'
926
+ ));
927
+ assert.equal(serializedHtml,
928
+ '<iframe></iframe>' +
929
+ '<a>1</a>' +
930
+ '<object></object>' +
931
+ '<img>' +
932
+ '<video></video>'
933
+ );
934
+ });
935
+
936
+ it('getAttributeFilters/getNodeFilters', () => {
937
+ const parser = DomParser(scenario.settings);
938
+ const cb1: ParserFilterCallback = (_nodes, _name, _args) => {};
939
+ const cb2: ParserFilterCallback = (_nodes, _name, _args) => {};
940
+
941
+ parser.addAttributeFilter('attr', cb1);
942
+ parser.addNodeFilter('node', cb2);
943
+
944
+ const attrFilters = parser.getAttributeFilters();
945
+ const nodeFilters = parser.getNodeFilters();
946
+
947
+ assert.deepEqual(attrFilters[attrFilters.length - 1], { name: 'attr', callbacks: [ cb1 ] }, 'Should be expected filter');
948
+ assert.deepEqual(nodeFilters[nodeFilters.length - 1], { name: 'node', callbacks: [ cb2 ] }, 'Should be expected filter');
949
+ });
950
+
951
+ it('extract base64 uris to blobcache if blob cache is provided', () => {
952
+ const blobCache = BlobCache();
953
+ const parser = DomParser({ blob_cache: blobCache, ...scenario.settings });
954
+ const base64 = 'R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==';
955
+ const base64Uri = `data:image/gif;base64,${base64}`;
956
+ const serializedHtml = serializer.serialize(parser.parse(`<p><img src="${base64Uri}" /></p>`));
957
+ const blobInfo = blobCache.findFirst((bi) => bi.base64() === base64) as BlobInfo;
958
+ const blobUri = blobInfo.blobUri();
959
+
960
+ assert.equal(
961
+ serializedHtml,
962
+ `<p><img src="${blobUri}"></p>`,
963
+ 'Should be html with blob uri'
964
+ );
965
+
966
+ blobCache.destroy();
967
+ });
968
+
969
+ it('duplicate base64 uris added only once to blobcache if blob cache is provided', () => {
970
+ const blobCache = BlobCache();
971
+ const parser = DomParser({ blob_cache: blobCache, ...scenario.settings });
972
+ const base64 = 'R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==';
973
+ const gifBase64Uri = `data:image/gif;base64,${base64}`;
974
+ const pngBase64Uri = `data:image/png;base64,${base64}`;
975
+ const images = `<img src="${gifBase64Uri}" /><img src="${pngBase64Uri}" />`;
976
+ const serializedHtml = serializer.serialize(parser.parse(`<p>${images}</p><p>${images}</p>`));
977
+ let count = 0;
978
+ blobCache.findFirst((bi) => {
979
+ if (bi.base64() === base64) {
980
+ count++;
981
+ }
982
+ return false;
983
+ });
984
+
985
+ assert.equal(count, 2, 'Only one image per mime type should be in the blob cache');
986
+ assert.notInclude(serializedHtml, base64, 'HTML shouldn\'t include a base64 data URI');
987
+ blobCache.destroy();
988
+ });
989
+
990
+ it('do not extract base64 uris for transparent or placeholder images used by for example the page break plugin', () => {
991
+ const blobCache = BlobCache();
992
+ const placeholderImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFklEQVR42mNk+P//PwMRgHFUIX0VAgAE3B3t0SaZ0AAAAABJRU5ErkJggg==';
993
+ const parser = DomParser({ blob_cache: blobCache, ...scenario.settings });
994
+ const html = `<p><img src="${Env.transparentSrc}" /><img src="${placeholderImg}" data-mce-placeholder="1"></p>`;
995
+ const root = parser.parse(html);
996
+
997
+ assert.equal(
998
+ root.getAll('img')[0].attr('src'),
999
+ Env.transparentSrc,
1000
+ 'Should be the unchanged transparent image source'
1001
+ );
1002
+ assert.equal(
1003
+ root.getAll('img')[1].attr('src'),
1004
+ placeholderImg,
1005
+ 'Should be the unchanged placeholder image source'
1006
+ );
1007
+
1008
+ blobCache.destroy();
1009
+ });
1010
+
1011
+ it('do not extract base64 uris if blob cache is not provided', () => {
1012
+ const parser = DomParser(scenario.settings);
1013
+ const html = '<p><img src="data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw=="></p>';
1014
+ const serializedHtml = serializer.serialize(parser.parse(html));
1015
+
1016
+ assert.equal(serializedHtml, html, 'Should be html with base64 uri retained');
1017
+ });
1018
+
1019
+ it('Parse away bogus elements', () => {
1020
+ const testBogusParsing = (inputHtml: string, outputHtml: string) => {
1021
+ const parser = DomParser(scenario.settings, schema);
1022
+ const serializedHtml = serializer.serialize(parser.parse(inputHtml));
1023
+ assert.equal(serializedHtml, outputHtml);
1024
+ };
1025
+
1026
+ testBogusParsing('a<b data-mce-bogus="1">b</b>c', 'abc');
1027
+ testBogusParsing('a<b data-mce-bogus="true">b</b>c', 'abc');
1028
+ testBogusParsing('a<b data-mce-bogus="1"></b>c', 'ac');
1029
+ testBogusParsing('a<b data-mce-bogus="all">b</b>c', 'ac');
1030
+ testBogusParsing('a<b data-mce-bogus="all"><!-- x --><?xml?></b>c', 'ac');
1031
+ testBogusParsing('a<b data-mce-bogus="all"><b>b</b></b>c', 'ac');
1032
+ testBogusParsing('a<b data-mce-bogus="all"><br>b</b><b>c</b>', 'a<b>c</b>');
1033
+ testBogusParsing('a<b data-mce-bogus="all"><img>b</b><b>c</b>', 'a<b>c</b>');
1034
+ testBogusParsing('a<b data-mce-bogus="all"><b attr="x">b</b></b>c', 'ac');
1035
+ testBogusParsing('a<b data-mce-bogus="all"></b>c', 'ac');
1036
+ testBogusParsing('a<b data-mce-bogus="all"></b><b>c</b>', 'a<b>c</b>');
1037
+ });
1038
+
1039
+ it('remove bogus elements even if not part of valid_elements', () => {
1040
+ const parser = DomParser(scenario.settings, Schema({ valid_elements: 'p,span,' }));
1041
+ const html = '<p>a <span data-mce-bogus="all">&nbsp;<span contenteditable="false">X</span>&nbsp;</span>b</p>';
1042
+ const serializedHtml = serializer.serialize(parser.parse(html));
1043
+
1044
+ assert.equal(serializedHtml, '<p>a b</p>');
1045
+ });
1046
+
1047
+ it('Parse cdata with comments', () => {
1048
+ const parser = DomParser(scenario.settings, schema);
1049
+
1050
+ const serializedHtml = serializer.serialize(parser.parse('<div><![CDATA[<!--x--><!--y--!>-->]]></div>', { format: 'html' }));
1051
+ assert.equal(serializedHtml, '<div><!--[CDATA[<!--x----><!--y-->--&gt;]]&gt;</div>');
1052
+
1053
+ const serializedXHtml = serializer.serialize(parser.parse('<div><![CDATA[<!--x--><!--y-->--><!--]]></div>', { format: 'xhtml' }));
1054
+ assert.equal(serializedXHtml, '<div><![CDATA[<!--x--><!--y-->--><!--]]></div>');
1055
+ });
1056
+
1057
+ it('TINY-7756: Parsing invalid nested children', () => {
1058
+ const schema = Schema({ valid_children: '-td[button|a|div]' });
1059
+ const parser = DomParser(scenario.settings, schema);
1060
+ const html = '<table><tr><td><button><a><meta /></a></button></td></tr></table>';
1061
+ const serializedHtml = serializer.serialize(parser.parse(html));
1062
+
1063
+ assert.equal(serializedHtml, '<table><tbody><tr><td></td></tr></tbody></table>', 'Should remove all invalid children but keep empty table');
1064
+ });
1065
+
1066
+ it('TINY-7756: Parsing invalid nested children with a valid child between', () => {
1067
+ const parser = DomParser(scenario.settings);
1068
+ const html =
1069
+ '<table>' +
1070
+ '<tbody>' +
1071
+ '<tr>' +
1072
+ '<td>' +
1073
+ '<meta>' +
1074
+ '<button>' +
1075
+ '<img />' +
1076
+ '<button>' +
1077
+ '<a>' +
1078
+ '<meta />' +
1079
+ '</a>' +
1080
+ '</button>' +
1081
+ '<img />' +
1082
+ '</button>' +
1083
+ '</meta>' +
1084
+ '</td>' +
1085
+ '</tr>' +
1086
+ '</tbody>' +
1087
+ '</table>';
1088
+ const serializedHtml = serializer.serialize(parser.parse(html));
1089
+
1090
+ assert.equal(
1091
+ serializedHtml,
1092
+ '<table>' +
1093
+ '<tbody>' +
1094
+ '<tr>' +
1095
+ '<td>' +
1096
+ '<button>' +
1097
+ '<img>' +
1098
+ '</button>' +
1099
+ '<button>' +
1100
+ '<a></a>' +
1101
+ '</button>' +
1102
+ '<img>' +
1103
+ '</td>' +
1104
+ '</tr>' +
1105
+ '</tbody>' +
1106
+ '</table>'
1107
+ );
1108
+ });
1109
+
1110
+ it('TINY-8205: Fixes up invalid children even when top-level element does not fit the context', () => {
1111
+ const parser = DomParser(scenario.settings);
1112
+ const html = '<p>Hello world! <button>This is a button with a meta tag in it<meta /></button></p>';
1113
+ const serializedHtml = serializer.serialize(parser.parse(html, { context: 'p' }));
1114
+
1115
+ assert.equal(serializedHtml, '<p>Hello world! <button>This is a button with a meta tag in it</button></p>');
1116
+ });
1117
+
1118
+ it('TINY-7756: should prevent dom clobbering overriding document/form properties', () => {
1119
+ const parser = DomParser(scenario.settings, Schema({ valid_elements: '*[id|src|name|class]' }));
1120
+ const html = '<img src="x" name="getElementById" />' +
1121
+ '<input id="attributes" />' +
1122
+ '<output id="style"></output>' +
1123
+ '<button name="action"></button>' +
1124
+ '<select name="getElementsByName"></select>' +
1125
+ '<fieldset name="method"></fieldset>' +
1126
+ '<textarea name="click"></textarea>';
1127
+ const serializedHtml = serializer.serialize(parser.parse(html));
1128
+
1129
+ assert.equal(serializedHtml,
1130
+ // dom clobbering prevention handled by DOMPurify sanitization
1131
+ scenario.isSanitizeEnabled
1132
+ ?
1133
+ ('<img src="x">' +
1134
+ '<input>' +
1135
+ '<output></output>' +
1136
+ '<button></button>' +
1137
+ '<select></select>' +
1138
+ '<fieldset></fieldset>' +
1139
+ '<textarea></textarea>')
1140
+ :
1141
+ ('<img src="x" name="getElementById">' +
1142
+ '<input id="attributes">' +
1143
+ '<output id="style"></output>' +
1144
+ '<button name="action"></button>' +
1145
+ '<select name="getElementsByName"></select>' +
1146
+ '<fieldset name="method"></fieldset>' +
1147
+ '<textarea name="click"></textarea>')
1148
+ );
1149
+ });
1150
+
1151
+ it('TINY-8639: handling empty text inline elements when root block is empty', () => {
1152
+ const html = '<p><strong></strong></p>' +
1153
+ '<p><s></s></p>' +
1154
+ '<p><span class="test"></span></p>' +
1155
+ '<p><span style="color: red;"></span></p>' +
1156
+ '<p><span></span></p>';
1157
+
1158
+ // Assert default behaviour when padd_empty_block_inline_children is not specified (should be equivalent to false)
1159
+ let parser = DomParser(scenario.settings, Schema({}));
1160
+ let serializedHtml = serializer.serialize(parser.parse(html));
1161
+
1162
+ assert.equal(serializedHtml,
1163
+ '<p>\u00a0</p>' +
1164
+ '<p>\u00a0</p>' +
1165
+ '<p>\u00a0</p>' +
1166
+ '<p>\u00a0</p>' +
1167
+ '<p>\u00a0</p>'
1168
+ );
1169
+
1170
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: false }));
1171
+ serializedHtml = serializer.serialize(parser.parse(html));
1172
+
1173
+ assert.equal(serializedHtml,
1174
+ '<p>\u00a0</p>' +
1175
+ '<p>\u00a0</p>' +
1176
+ '<p>\u00a0</p>' +
1177
+ '<p>\u00a0</p>' +
1178
+ '<p>\u00a0</p>'
1179
+ );
1180
+
1181
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: true }));
1182
+ serializedHtml = serializer.serialize(parser.parse(html));
1183
+
1184
+ assert.equal(serializedHtml,
1185
+ '<p><strong>\u00a0</strong></p>' +
1186
+ '<p><s>\u00a0</s></p>' +
1187
+ '<p><span class="test">\u00a0</span></p>' +
1188
+ '<p><span style="color: red;">\u00a0</span></p>' +
1189
+ '<p>\u00a0</p>'
1190
+ );
1191
+ });
1192
+
1193
+ it('TINY-8639: handling single space text inline elements when root block is otherwise empty', () => {
1194
+ const html = '<p><strong> </strong></p>' +
1195
+ '<p><s> </s></p>' +
1196
+ '<p><span class="test"> </span></p>' +
1197
+ '<p><span style="color: red;"> </span></p>' +
1198
+ '<p><span> </span></p>';
1199
+
1200
+ // Assert default behaviour when padd_empty_block_inline_children is not specified (should be equivalent to false)
1201
+ let parser = DomParser(scenario.settings, Schema({}));
1202
+ let serializedHtml = serializer.serialize(parser.parse(html));
1203
+
1204
+ assert.equal(serializedHtml,
1205
+ '<p><strong> </strong></p>' +
1206
+ '<p><s> </s></p>' +
1207
+ // isEmpty node logic considers a span with no style attribute and a single space to be empty (Node.ts -> isEmpty -> isEmptyTextNode)
1208
+ '<p> </p>' +
1209
+ '<p><span style="color: red;"> </span></p>' +
1210
+ '<p>\u00a0</p>'
1211
+ );
1212
+
1213
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: false }));
1214
+ serializedHtml = serializer.serialize(parser.parse(html));
1215
+
1216
+ assert.equal(serializedHtml,
1217
+ '<p><strong> </strong></p>' +
1218
+ '<p><s> </s></p>' +
1219
+ // isEmpty node logic considers a span with no style attribute and a single space to be empty (Node.ts -> isEmpty -> isEmptyTextNode)
1220
+ '<p> </p>' +
1221
+ '<p><span style="color: red;"> </span></p>' +
1222
+ '<p>\u00a0</p>'
1223
+ );
1224
+
1225
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: true }));
1226
+ serializedHtml = serializer.serialize(parser.parse(html));
1227
+
1228
+ assert.equal(serializedHtml,
1229
+ '<p><strong> </strong></p>' +
1230
+ '<p><s> </s></p>' +
1231
+ '<p><span class="test">\u00a0</span></p>' +
1232
+ '<p><span style="color: red;"> </span></p>' +
1233
+ '<p>\u00a0</p>'
1234
+ );
1235
+ });
1236
+
1237
+ it('TINY-8639: handling single nbsp text inline elements when root block is otherwise empty', () => {
1238
+ const html = '<p><strong>&nbsp;</strong></p>' +
1239
+ '<p><s>&nbsp;</s></p>' +
1240
+ '<p><span class="test">&nbsp;</span></p>' +
1241
+ '<p><span style="color: red;">&nbsp;</span></p>' +
1242
+ '<p><span>&nbsp;</span></p>';
1243
+
1244
+ // Assert default behaviour when padd_empty_block_inline_children is not specified (should be equivalent to false)
1245
+ let parser = DomParser(scenario.settings, Schema({}));
1246
+ let serializedHtml = serializer.serialize(parser.parse(html));
1247
+
1248
+ assert.equal(serializedHtml,
1249
+ '<p><strong>\u00a0</strong></p>' +
1250
+ '<p><s>\u00a0</s></p>' +
1251
+ '<p><span class="test">\u00a0</span></p>' +
1252
+ '<p><span style="color: red;">\u00a0</span></p>' +
1253
+ '<p>\u00a0</p>'
1254
+ );
1255
+
1256
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: false }));
1257
+ serializedHtml = serializer.serialize(parser.parse(html));
1258
+
1259
+ assert.equal(serializedHtml,
1260
+ '<p><strong>\u00a0</strong></p>' +
1261
+ '<p><s>\u00a0</s></p>' +
1262
+ '<p><span class="test">\u00a0</span></p>' +
1263
+ '<p><span style="color: red;">\u00a0</span></p>' +
1264
+ '<p>\u00a0</p>'
1265
+ );
1266
+
1267
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: true }));
1268
+ serializedHtml = serializer.serialize(parser.parse(html));
1269
+
1270
+ assert.equal(serializedHtml,
1271
+ '<p><strong>\u00a0</strong></p>' +
1272
+ '<p><s>\u00a0</s></p>' +
1273
+ '<p><span class="test">\u00a0</span></p>' +
1274
+ '<p><span style="color: red;">\u00a0</span></p>' +
1275
+ '<p>\u00a0</p>'
1276
+ );
1277
+ });
1278
+
1279
+ it('TINY-8639: should always remove empty inline element if it is not in an empty block', () => {
1280
+ const html = '<p>ab<strong></strong>cd</p>' +
1281
+ '<p>ab<s></s>cd</p>' +
1282
+ '<p>ab<span class="test"></span>cd</p>' +
1283
+ '<p>ab<span style="color: red;"></span>cd</p>' +
1284
+ '<p>ab<span></span>cd</p>';
1285
+
1286
+ // Assert default behaviour when padd_empty_block_inline_children is not specified (should be equivalent to false)
1287
+ let parser = DomParser(scenario.settings, Schema({}));
1288
+ let serializedHtml = serializer.serialize(parser.parse(html));
1289
+
1290
+ assert.equal(serializedHtml,
1291
+ '<p>abcd</p>' +
1292
+ '<p>abcd</p>' +
1293
+ '<p>abcd</p>' +
1294
+ '<p>abcd</p>' +
1295
+ '<p>abcd</p>'
1296
+ );
1297
+
1298
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: false }));
1299
+ serializedHtml = serializer.serialize(parser.parse(html));
1300
+
1301
+ assert.equal(serializedHtml,
1302
+ '<p>abcd</p>' +
1303
+ '<p>abcd</p>' +
1304
+ '<p>abcd</p>' +
1305
+ '<p>abcd</p>' +
1306
+ '<p>abcd</p>'
1307
+ );
1308
+
1309
+ parser = DomParser(scenario.settings, Schema({ padd_empty_block_inline_children: true }));
1310
+ serializedHtml = serializer.serialize(parser.parse(html));
1311
+
1312
+ assert.equal(serializedHtml,
1313
+ '<p>abcd</p>' +
1314
+ '<p>abcd</p>' +
1315
+ '<p>abcd</p>' +
1316
+ '<p>abcd</p>' +
1317
+ '<p>abcd</p>'
1318
+ );
1319
+ });
1320
+
1321
+ it('TINY-8780: Invalid special elements are removed entirely instead of being unwrapped', () => {
1322
+ const parser = DomParser({ forced_root_block: 'p', ...scenario.settings }, Schema({ invalid_elements: 'script,style,iframe,textarea,div' }));
1323
+ const html = '<script>var x = 1;</script>' +
1324
+ '<style>.red-text { color: red; }</style>' +
1325
+ '<iframe src="about:blank">content</iframe>' +
1326
+ '<textarea>content</textarea>' +
1327
+ '<p>paragraph</p>' +
1328
+ '<div>div</div>';
1329
+
1330
+ const serializedHtml = serializer.serialize(parser.parse(html));
1331
+ assert.equal(serializedHtml, '<p>paragraph</p><p>div</p>');
1332
+ });
1333
+
1334
+ context('validate: false', () => {
1335
+ it('invalid elements and attributes should not be removed', () => {
1336
+ const parser = DomParser({ validate: false, ...scenario.settings }, Schema({ valid_elements: 'span[id]' }));
1337
+ const html = '<p>Hello world! <strong>This is bold</strong> and <span style="text-decoration: underline">this is underlined content</span>.</p>';
1338
+ const serializedHtml = serializer.serialize(parser.parse(html));
1339
+
1340
+ assert.equal(serializedHtml, html);
1341
+ });
1342
+
1343
+ it('empty elements should not be removed', () => {
1344
+ const customSchema = Schema({ valid_elements: 'span[style],strong' });
1345
+ (customSchema.getElementRule('span') as SchemaElement).removeEmptyAttrs = true;
1346
+ (customSchema.getElementRule('strong') as SchemaElement).removeEmpty = true;
1347
+ const parser = DomParser({ validate: false, ...scenario.settings }, customSchema);
1348
+ const html = '<p>Hello world! This should keep empty <strong></strong>elements <span></span>.</p>';
1349
+ const serializedHtml = serializer.serialize(parser.parse(html));
1350
+
1351
+ assert.equal(serializedHtml, html);
1352
+ });
1353
+
1354
+ it('empty elements should not be padded', () => {
1355
+ const customSchema = Schema({ valid_elements: 'span' });
1356
+ (customSchema.getElementRule('span') as SchemaElement).paddEmpty = true;
1357
+ const parser = DomParser({ validate: false, ...scenario.settings }, customSchema);
1358
+ const html = '<p>Hello world! <span></span></p>';
1359
+ const serializedHtml = serializer.serialize(parser.parse(html));
1360
+
1361
+ assert.equal(serializedHtml, html);
1362
+ });
1363
+
1364
+ it('bogus elements should be removed', () => {
1365
+ const parser = DomParser({ validate: false, ...scenario.settings }, schema);
1366
+ const html = '<p>Hello world! <span data-mce-bogus="1">This is inside a bogus element.</span></p><div data-mce-bogus="all"><strong>This is bogus content</strong></div>';
1367
+ const serializedHtml = serializer.serialize(parser.parse(html));
1368
+
1369
+ assert.equal(serializedHtml, '<p>Hello world! This is inside a bogus element.</p>');
1370
+ });
1371
+
1372
+ it('redundant whitespace should still be removed', () => {
1373
+ const parser = DomParser({ validate: false, ...scenario.settings }, schema);
1374
+ let root = parser.parse(' \t\r\n <P> \t\r\n test \t\r\n </P> \t\r\n ');
1375
+ assert.equal(serializer.serialize(root), '<p>test</p>', 'Redundant whitespace (block element)');
1376
+ assert.deepEqual(countNodes(root), { 'body': 1, 'p': 1, '#text': 1 }, 'Redundant whitespace (block element) (count)');
1377
+
1378
+ root = parser.parse(' \t\r\n <PRE> \t\r\n test \t\r\n </PRE> \t\r\n ');
1379
+ assert.equal(serializer.serialize(root), '<pre> \t\n test \t\n </pre>', 'Whitespace around and inside PRE');
1380
+ assert.deepEqual(countNodes(root), { 'body': 1, 'pre': 1, '#text': 1 }, 'Whitespace around and inside PRE (count)');
1381
+ });
1382
+
1383
+ it('unsafe content should still be removed', () => {
1384
+ const parser = DomParser({ validate: false, ...scenario.settings }, schema);
1385
+ const html = '<p>Hello world!<a href="javascript:alert(1)">XSS</a></p>';
1386
+ const serializedHtml = serializer.serialize(parser.parse(html));
1387
+
1388
+ assert.equal(serializedHtml, '<p>Hello world!<a>XSS</a></p>');
1389
+ });
1390
+
1391
+ it('data and aria attributes should always be retained', () => {
1392
+ const parser = DomParser(scenario.settings);
1393
+ const html = '<p><a href="http://www.google.com/fake1" data-custom="custom" aria-invalid="true">Hello world!</a></p>';
1394
+ const serializedHtml = serializer.serialize(parser.parse(html));
1395
+
1396
+ assert.equal(serializedHtml, html);
1397
+ });
1398
+
1399
+ context('Transparent elements', () => {
1400
+ const getTransparentElements = (schema: Schema) => Arr.unique(Arr.map(Obj.keys(schema.getTransparentElements()), (s) => s.toLowerCase()));
1401
+
1402
+ const testTransparentElementsParsing = (testCase: { input: string; expected: string; domParserSettings?: DomParserSettings }) => {
1403
+ const parser = DomParser({ ...scenario.settings, ...testCase.domParserSettings });
1404
+ const serializedHtml = serializer.serialize(parser.parse(testCase.input));
1405
+
1406
+ assert.equal(serializedHtml, testCase.expected);
1407
+ };
1408
+
1409
+ it('TINY-9172: inline transparents should not get data-mce-block attribute', () => {
1410
+ const parser = DomParser(scenario.settings);
1411
+ const innerHtml = Arr.map(getTransparentElements(parser.schema), (name) => `<${name}>text</${name}>`).join('');
1412
+ const html = `<p>${innerHtml}</p>`;
1413
+ const serializedHtml = serializer.serialize(parser.parse(html));
1414
+
1415
+ assert.equal(serializedHtml, html);
1416
+ });
1417
+
1418
+ it('TINY-9172: root level transparents should not get data-mce-block attribute', () => {
1419
+ const parser = DomParser(scenario.settings);
1420
+ const html = Arr.map(getTransparentElements(parser.schema), (name) => `<${name}>text</${name}>`).join('');
1421
+ const expectedHtml = Arr.map(getTransparentElements(parser.schema), (name) => `<${name}>text</${name}>`).join('');
1422
+ const serializedHtml = serializer.serialize(parser.parse(html));
1423
+
1424
+ assert.equal(serializedHtml, expectedHtml);
1425
+ });
1426
+
1427
+ it('TINY-9172: transparents wrapping blocks should get data-mce-block attribute', () => {
1428
+ const parser = DomParser(scenario.settings);
1429
+ const innerHtml = Arr.map(getTransparentElements(parser.schema), (name) => `<${name}><p>text</p></${name}>`).join('');
1430
+ const html = `<div>${innerHtml}</div>`;
1431
+ const expectedInnerHtml = Arr.map(getTransparentElements(parser.schema), (name) => `<${name} data-mce-block="true"><p>text</p></${name}>`).join('');
1432
+ const expectedHtml = `<div>${expectedInnerHtml}</div>`;
1433
+ const serializedHtml = serializer.serialize(parser.parse(html));
1434
+
1435
+ assert.equal(serializedHtml, expectedHtml);
1436
+ });
1437
+
1438
+ it('TINY-9232: H1 in H1 should unwrap to single H1', () => testTransparentElementsParsing({
1439
+ input: '<h1><a href="#"><h1>foo</h1></a></h1>',
1440
+ expected: '<h1>foo</h1>'
1441
+ }));
1442
+
1443
+ it('TINY-9232: H1 and H2 in H1 should unwrap', () => testTransparentElementsParsing({
1444
+ input: '<h1><a href="#"><h1>a</h1><h2>b</h2></a></h1>',
1445
+ expected: '<h1>a</h1><h2>b</h2>'
1446
+ }));
1447
+
1448
+ it('TINY-9232: H1 and H2 in H1 should unwrap but text should remain links', () => testTransparentElementsParsing({
1449
+ input: '<h1><a href="#">a<h1>b</h1>c<h2>d</h2>e</a></h1>',
1450
+ expected: '<h1><a href="#">a</a></h1><h1>b</h1><h1><a href="#">c</a></h1><h2>d</h2><h1><a href="#">e</a></h1>'
1451
+ }));
1452
+
1453
+ it('TINY-9232: H1 in H1 in DIV should unwrap down to DIV', () => testTransparentElementsParsing({
1454
+ input: '<div>a<h1><a href="#"><h1>b</h1></a></h1>c</div>',
1455
+ expected: '<div>a<h1>b</h1>c</div>'
1456
+ }));
1457
+
1458
+ it('TINY-9232: Nested anchors wrapped in H1 and H2 should all unwrap', () => testTransparentElementsParsing({
1459
+ input: '<h1><a href="#1"><h2><a href="#2"><h3>foo</h3></a></h2></a></h1>',
1460
+ expected: '<h3>foo</h3>'
1461
+ }));
1462
+
1463
+ it('TINY-9232: H1 with content before and after anchor should be retained but the anchor should be unwrapped', () => testTransparentElementsParsing({
1464
+ input: '<h1>a<a href="#"><h1>foo</h1></a>b</h1>',
1465
+ expected: '<h1>a</h1><h1>foo</h1><h1>b</h1>'
1466
+ }));
1467
+
1468
+ it('TINY-9761: Transparent elements should not get paragraphs between them', () => testTransparentElementsParsing({
1469
+ input: '<a href="#"><p>foo</p></a>\n<a href="#"><p>bar</p></a> \t<a href="#"><p>baz</p></a>',
1470
+ expected: '<a href="#" data-mce-block="true"><p>foo</p></a><a href="#" data-mce-block="true"><p>bar</p></a><a href="#" data-mce-block="true"><p>baz</p></a>',
1471
+ domParserSettings: {
1472
+ forced_root_block: 'p'
1473
+ }
1474
+ }));
1475
+ });
1476
+ });
1477
+
1478
+ context('Sandboxing iframes', () => {
1479
+ context('sandbox_iframes', () => {
1480
+ const testSandboxIframe = (sandbox: boolean, expected: string) => () => {
1481
+ const parser = DomParser({ ...scenario.settings, sandbox_iframes: sandbox });
1482
+ const serialized = serializer.serialize(parser.parse('<iframe src="about:blank"></iframe>'));
1483
+ assert.equal(serialized, expected);
1484
+ };
1485
+
1486
+ it('TINY-10348: iframes should be sandboxed when sandbox_iframes: false',
1487
+ testSandboxIframe(false, '<iframe src="about:blank"></iframe>'));
1488
+
1489
+ it('TINY-10348: iframes should be sandboxed when sandbox_iframes: true',
1490
+ testSandboxIframe(true, '<iframe src="about:blank" sandbox=""></iframe>'));
1491
+ });
1492
+
1493
+ context('sandbox_iframes_exclusions', () => {
1494
+ const exclusions = [ 'tiny.cloud' ];
1495
+ const parser = DomParser({ ...scenario.settings, sandbox_iframes: true, sandbox_iframes_exclusions: exclusions });
1496
+
1497
+ const testSandboxIframeExclusions = (src: string, expected: string) => () => {
1498
+ const serialized = serializer.serialize(parser.parse(`<iframe src="${src}"></iframe>`));
1499
+ assert.equal(serialized, expected);
1500
+ };
1501
+
1502
+ it('TINY-10350: iframes should be sandboxed when sandbox_iframes: true and host is not excluded',
1503
+ testSandboxIframeExclusions('https://www.example.com', '<iframe src="https://www.example.com" sandbox=""></iframe>'));
1504
+
1505
+ it('TINY-10350: iframes should not be sandboxed when sandbox_iframes: true and host is excluded',
1506
+ testSandboxIframeExclusions('https://www.tiny.cloud', '<iframe src="https://www.tiny.cloud"></iframe>'));
1507
+
1508
+ it('TINY-10350: iframes with non-URL src should be sandboxed when sandbox_iframes: true',
1509
+ testSandboxIframeExclusions('abc', '<iframe src="abc" sandbox=""></iframe>'));
1510
+
1511
+ it('TINY-10350: iframes with no src should be sandboxed when sandbox_iframes: true', () => {
1512
+ const serialized = serializer.serialize(parser.parse('<iframe></iframe>'));
1513
+ assert.equal(serialized, '<iframe sandbox=""></iframe>');
1514
+ });
1515
+ });
1516
+ });
1517
+
1518
+ context('Convert unsafe embeds', () => {
1519
+ const serializeEmbedHtml = (embedHtml: string, convert: boolean): string => {
1520
+ const parser = DomParser({ ...scenario.settings, convert_unsafe_embeds: convert });
1521
+ return serializer.serialize(parser.parse(embedHtml));
1522
+ };
1523
+
1524
+ const testConversion = (embedHtml: string, expectedHtml: string) => () => {
1525
+ const serializedHtml = serializeEmbedHtml(embedHtml, true);
1526
+ assert.equal(serializedHtml, expectedHtml);
1527
+ };
1528
+
1529
+ context('convert_unsafe_embeds: false', () => {
1530
+ const testNoConversion = (embedHtml: string) => () => {
1531
+ const serializedHtml = serializeEmbedHtml(embedHtml, false);
1532
+ assert.equal(serializedHtml, embedHtml);
1533
+ };
1534
+
1535
+ it('TINY-10349: Object elements should not be converted', testNoConversion('<object data="about:blank"></object>'));
1536
+ it('TINY-10349: Object elements with a mime type should not be converted', testNoConversion('<object data="about:blank" type="image/png"></object>'));
1537
+ it('TINY-10349: Embed elements should notr be converted', testNoConversion('<embed src="about:blank">'));
1538
+ it('TINY-10349: Embed elements with a mime type should not be converted', testNoConversion('<embed src="about:blank" type="image/png">'));
1539
+ });
1540
+
1541
+ context('convert_unsafe_embeds: true', () => {
1542
+ it('TINY-10349: Object elements without a mime type should be converted to iframe',
1543
+ testConversion('<object data="about:blank"></object>', '<iframe src="about:blank"></iframe>'));
1544
+ it('TINY-10349: Object elements with an image mime type should be converted to img',
1545
+ testConversion('<object data="about:blank" type="image/png"></object>', '<img src="about:blank">'));
1546
+ it('TINY-10349: Object elements with a video mime type should be converted to video',
1547
+ testConversion('<object data="about:blank" type="video/mp4"></object>', '<video src="about:blank" controls=""></video>'));
1548
+ it('TINY-10349: Object elements with an audio mime type should be converted to audio',
1549
+ testConversion('<object data="about:blank" type="audio/mpeg"></object>', '<audio src="about:blank" controls=""></audio>'));
1550
+ it('TINY-10349: Object elements with other mime type should be converted to iframe',
1551
+ testConversion('<object data="about:blank" type="application/pdf"></object>', '<iframe src="about:blank"></iframe>'));
1552
+
1553
+ it('TINY-10349: Embed elements without a mime type should be converted to iframe',
1554
+ testConversion('<embed src="about:blank">', '<iframe src="about:blank"></iframe>'));
1555
+ it('TINY-10349: Embed elements with an image mime type should be converted to img',
1556
+ testConversion('<embed src="about:blank" type="image/png">', '<img src="about:blank">'));
1557
+ it('TINY-10349: Embed elements with a video mime type should be converted to video',
1558
+ testConversion('<embed src="about:blank" type="video/mp4">', '<video src="about:blank" controls=""></video>'));
1559
+ it('TINY-10349: Embed elements with an audio mime type should be converted to audio',
1560
+ testConversion('<embed src="about:blank" type="audio/mpeg">', '<audio src="about:blank" controls=""></audio>'));
1561
+ it('TINY-10349: Embed elements with other mime type should be converted to iframe',
1562
+ testConversion('<embed src="about:blank" type="application/pdf">', '<iframe src="about:blank"></iframe>'));
1563
+ });
1564
+
1565
+ context('convert_unsafe_embeds: true, sandbox_iframes: true', () => {
1566
+ const testSandboxedConversion = (embedHtml: string, expectedHtml: string) => () => {
1567
+ const parser = DomParser({ ...scenario.settings, convert_unsafe_embeds: true, sandbox_iframes: true });
1568
+ const serializedHtml = serializer.serialize(parser.parse(embedHtml));
1569
+ assert.equal(serializedHtml, expectedHtml);
1570
+ };
1571
+
1572
+ it('TINY-10349: Object elements without a mime type should be converted to sandboxed iframe',
1573
+ testSandboxedConversion('<object data="about:blank"></object>', '<iframe src="about:blank" sandbox=""></iframe>'));
1574
+
1575
+ it('TINY-10349: Embed elements without a mime type should be converted to sandboxed iframe',
1576
+ testSandboxedConversion('<embed src="about:blank">', '<iframe src="about:blank" sandbox=""></iframe>'));
1577
+ });
1578
+
1579
+ context('convert_unsafe_embeds: true, attribute preservation', () => {
1580
+ it('TINY-10349: Object elements should perserve width and height attributes only',
1581
+ testConversion('<object data="about:blank" width="100" height="100" style="color: red;"></object>', '<iframe src="about:blank" width="100" height="100"></iframe>'));
1582
+ it('TINY-10349: Object elements with an image mime type should perserve width and height attributes only',
1583
+ testConversion('<object data="about:blank" type="image/png" width="100" height="100" style="color: red;"></object>', '<img src="about:blank" width="100" height="100">'));
1584
+ it('TINY-10349: Object elements with a video mime type should perserve width and height attributes only',
1585
+ testConversion('<object data="about:blank" type="video/mp4" width="100" height="100" style="color: red;"></object>', '<video src="about:blank" width="100" height="100" controls=""></video>'));
1586
+ it('TINY-10349: Object elements with an audio mime type should not perserve other attributes only',
1587
+ testConversion('<object data="about:blank" type="audio/mpeg" width="100" height="100" style="color: red;"></object>', '<audio src="about:blank" controls=""></audio>'));
1588
+ it('TINY-10349: Object elements with other mime type should perserve width and height attributes only',
1589
+ testConversion('<object data="about:blank" type="application/pdf" width="100" height="100" style="color: red;"></object>', '<iframe src="about:blank" width="100" height="100"></iframe>'));
1590
+
1591
+ it('TINY-10349: Embed elements should preserve width and heigth attributes only',
1592
+ testConversion('<embed src="about:blank" width="100" height="100" style="color: red;">', '<iframe src="about:blank" width="100" height="100"></iframe>'));
1593
+ it('TINY-10349: Embed elements with an image mime type should preserve width and height attributes only',
1594
+ testConversion('<embed src="about:blank" type="image/png" width="100" height="100" style="color: red;">', '<img src="about:blank" width="100" height="100">'));
1595
+ it('TINY-10349: Embed elements with a video mime type should preserve width and height attributes only',
1596
+ testConversion('<embed src="about:blank" type="video/mp4" width="100" height="100" style="color: red;">', '<video src="about:blank" width="100" height="100" controls=""></video>'));
1597
+ it('TINY-10349: Embed elements with an audio mime type should not preserve other attributes',
1598
+ testConversion('<embed src="about:blank" type="audio/mpeg" width="100" height="100" style="color: red;">', '<audio src="about:blank" controls=""></audio>'));
1599
+ it('TINY-10349: Embed elements with other mime type should preserve width and height attributes only',
1600
+ testConversion('<embed src="about:blank" type="application/pdf" width="100" height="100" style="color: red;">', '<iframe src="about:blank" width="100" height="100"></iframe>'));
1601
+ });
1602
+ });
1603
+ });
1604
+ });
1605
+
1606
+ context('TINY-9600: sanitize: false with unsafe input', () => {
1607
+ const getNoSanitizeParser = (settings: DomParserSettings, schema: Schema): DomParser =>
1608
+ DomParser({ ...settings, sanitize: false }, schema);
1609
+
1610
+ const testDisablingSanitization = (outputs: string[], schemaSettings: SchemaSettings) => {
1611
+ Arr.each([
1612
+ {
1613
+ name: 'script tags',
1614
+ input: '<script>alert(1)</script>'
1615
+ }, {
1616
+ name: 'iframe tags with child nodes',
1617
+ input: '<iframe src="https://example.com"><p>Lorem ipsum</p></iframe>'
1618
+ }, {
1619
+ name: 'iframe tags with srcdoc attribute',
1620
+ input: '<iframe srcdoc="Lorem ipsum"></iframe>'
1621
+ }, {
1622
+ name: 'unsafe href attributes',
1623
+ input: '<p><a href="javascript:alert(1)">XSS</a></p>'
1624
+ },
1625
+ {
1626
+ name: 'svg tags',
1627
+ input: '<svg><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow"></circle></svg>'
1628
+ }
1629
+ ], (testCase, i) => {
1630
+ it(testCase.name, () => {
1631
+ const schema = Schema(schemaSettings);
1632
+ const serializedHtml = HtmlSerializer({}, schema).serialize(
1633
+ getNoSanitizeParser({}, schema).parse(testCase.input)
1634
+ );
1635
+ assert.equal(serializedHtml, outputs[i]);
1636
+ });
1637
+ });
1638
+ };
1639
+
1640
+ context('with default schema', () => {
1641
+ testDisablingSanitization([
1642
+ '',
1643
+ '<iframe src="https://example.com"><p>Lorem ipsum</p></iframe>',
1644
+ '<iframe></iframe>',
1645
+ '<p><a>XSS</a></p>',
1646
+ ''
1647
+ ], {});
1648
+ });
1649
+
1650
+ context('with valid_elements: \'*[*]\' schema', () => {
1651
+ testDisablingSanitization([
1652
+ '<script>alert(1)</script>',
1653
+ '<iframe src="https://example.com"><p>Lorem ipsum</p></iframe>',
1654
+ '<iframe srcdoc="Lorem ipsum"></iframe>',
1655
+ '<p><a>XSS</a></p>',
1656
+ '<svg><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow"></circle></svg>'
1657
+ ], { valid_elements: '*[*]' });
1658
+ });
1659
+ });
1660
+
1661
+ context('SVG elements', () => {
1662
+ it('TINY-10237: Should not wrap SVGs', () => {
1663
+ const schema = Schema();
1664
+ schema.addValidElements('svg[*]');
1665
+ const input = '<svg></svg>foo';
1666
+ const serializedHtml = HtmlSerializer({}, schema).serialize(DomParser({ forced_root_block: 'p' }, schema).parse(input));
1667
+ assert.equal(serializedHtml, '<svg></svg><p>foo</p>');
1668
+ });
1669
+
1670
+ it('TINY-10237: Should retain SVG elements as is but filter out scripts', () => {
1671
+ const schema = Schema();
1672
+ schema.addValidElements('svg[*]');
1673
+ const input = '<svg><circle><desc><b>foo</b><script>alert(1)</script></desc></circle></svg>foo';
1674
+ const serializedHtml = HtmlSerializer({}, schema).serialize(DomParser({ forced_root_block: 'p' }, schema).parse(input));
1675
+ assert.equal(serializedHtml, '<svg><circle><desc><b>foo</b></desc></circle></svg><p>foo</p>');
1676
+ });
1677
+
1678
+ it('TINY-10237: Should retain SVG elements and keep scripts if sanitize is set to false', () => {
1679
+ const schema = Schema();
1680
+ schema.addValidElements('svg[*]');
1681
+ const input = '<svg><circle><desc>foo<script>alert(1)</script></desc></circle></svg>foo';
1682
+ const serializedHtml = HtmlSerializer({}, schema).serialize(DomParser({ forced_root_block: 'p', sanitize: false }, schema).parse(input));
1683
+ assert.equal(serializedHtml, '<svg><circle><desc>foo<script>alert(1)</script></desc></circle></svg><p>foo</p>');
1684
+ });
1685
+
1686
+ it('TINY-10273: Trim whitespace before or after but not inside SVG elements at root level', () => {
1687
+ const schema = Schema();
1688
+ schema.addValidElements('svg[*]');
1689
+ const input = ' <svg> <circle> </circle> </svg> <svg> <circle> </circle> </svg> ';
1690
+ const serializedHtml = HtmlSerializer({}, schema).serialize(DomParser({ forced_root_block: 'p' }, schema).parse(input));
1691
+ assert.equal(serializedHtml, '<svg> <circle> </circle> </svg><svg> <circle> </circle> </svg>');
1692
+ });
1693
+
1694
+ it('TINY-10273: Trim whitespace before or after but not between or inside SVG elements when inside a block element', () => {
1695
+ const schema = Schema();
1696
+ schema.addValidElements('svg[*]');
1697
+ const input = '<div> <svg> <circle> </circle> </svg> <svg> <circle> </circle> </svg> </div>';
1698
+ const serializedHtml = HtmlSerializer({}, schema).serialize(DomParser({ forced_root_block: 'p' }, schema).parse(input));
1699
+ assert.equal(serializedHtml, '<div><svg> <circle> </circle> </svg> <svg> <circle> </circle> </svg></div>');
1700
+ });
1701
+ });
1702
+ });