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.
- package/.eslintrc.json +11 -0
- package/CHANGELOG.md +3443 -0
- package/Gruntfile.js +966 -0
- package/README.md +87 -0
- package/package.json +41 -0
- package/project.json +32 -0
- package/src/core/demo/css/content_editable.css +47 -0
- package/src/core/demo/html/annotations_demo.html +29 -0
- package/src/core/demo/html/commands_demo.html +16 -0
- package/src/core/demo/html/content_editable_false_demo.html +61 -0
- package/src/core/demo/html/content_security_policy.html +22 -0
- package/src/core/demo/html/custom_theme_demo.html +14 -0
- package/src/core/demo/html/fixed_toolbar_container_demo.html +22 -0
- package/src/core/demo/html/full_demo.html +48 -0
- package/src/core/demo/html/iframe_demo.html +15 -0
- package/src/core/demo/html/iframe_demo_inner.html +20 -0
- package/src/core/demo/html/inline_demo.html +423 -0
- package/src/core/demo/html/jquery_integration.html +21 -0
- package/src/core/demo/html/responsive_demo.html +126 -0
- package/src/core/demo/html/shadow_dom_closed_demo.html +14 -0
- package/src/core/demo/html/shadow_dom_open_demo.html +15 -0
- package/src/core/demo/html/shadow_dom_open_inline_demo.html +14 -0
- package/src/core/demo/html/source_dump_demo.html +17 -0
- package/src/core/demo/html/sticky_toolbar_demo.html +151 -0
- package/src/core/demo/html/tiny_demo.html +13 -0
- package/src/core/demo/html/view_demo.html +24 -0
- package/src/core/demo/ts/demo/AnnotationsDemo.ts +95 -0
- package/src/core/demo/ts/demo/CommandsDemo.ts +114 -0
- package/src/core/demo/ts/demo/ContentEditableFalseDemo.ts +88 -0
- package/src/core/demo/ts/demo/ContentSecurityPolicyDemo.ts +132 -0
- package/src/core/demo/ts/demo/CustomThemeDemo.ts +59 -0
- package/src/core/demo/ts/demo/Demos.ts +35 -0
- package/src/core/demo/ts/demo/FixedToolbarContainerDemo.ts +11 -0
- package/src/core/demo/ts/demo/FullDemo.ts +171 -0
- package/src/core/demo/ts/demo/IframeDemo.ts +49 -0
- package/src/core/demo/ts/demo/InlineDemo.ts +32 -0
- package/src/core/demo/ts/demo/ResponsiveDemo.ts +125 -0
- package/src/core/demo/ts/demo/ShadowDomDemo.ts +22 -0
- package/src/core/demo/ts/demo/ShadowDomInlineDemo.ts +27 -0
- package/src/core/demo/ts/demo/SourceDumpDemo.ts +33 -0
- package/src/core/demo/ts/demo/StickyToolbarDemo.ts +86 -0
- package/src/core/demo/ts/demo/TinyMceDemo.ts +36 -0
- package/src/core/demo/ts/demo/ViewDemo.ts +113 -0
- package/src/core/main/js/GlobalsTemplate.js +4 -0
- package/src/core/main/json/globals.json +54 -0
- package/src/core/main/text/readme_lang.md +3 -0
- package/src/core/main/ts/Deprecations.ts +127 -0
- package/src/core/main/ts/DragDropOverrides.ts +472 -0
- package/src/core/main/ts/EditorRemove.ts +113 -0
- package/src/core/main/ts/EditorView.ts +60 -0
- package/src/core/main/ts/ErrorReporter.ts +84 -0
- package/src/core/main/ts/ForceBlocks.ts +141 -0
- package/src/core/main/ts/NodeChange.ts +161 -0
- package/src/core/main/ts/Rtc.ts +455 -0
- package/src/core/main/ts/SelectionOverrides.ts +393 -0
- package/src/core/main/ts/alien/Spot.ts +13 -0
- package/src/core/main/ts/alien/TextDescent.ts +32 -0
- package/src/core/main/ts/alien/TextSearch.ts +85 -0
- package/src/core/main/ts/annotate/AnnotationChanges.ts +126 -0
- package/src/core/main/ts/annotate/AnnotationContext.ts +63 -0
- package/src/core/main/ts/annotate/AnnotationFilter.ts +49 -0
- package/src/core/main/ts/annotate/AnnotationsRegistry.ts +45 -0
- package/src/core/main/ts/annotate/Identification.ts +69 -0
- package/src/core/main/ts/annotate/Markings.ts +18 -0
- package/src/core/main/ts/annotate/Wrapping.ts +188 -0
- package/src/core/main/ts/api/AddOnManager.ts +302 -0
- package/src/core/main/ts/api/Annotator.ts +135 -0
- package/src/core/main/ts/api/Editor.ts +1146 -0
- package/src/core/main/ts/api/EditorCommands.ts +203 -0
- package/src/core/main/ts/api/EditorManager.ts +744 -0
- package/src/core/main/ts/api/EditorObservable.ts +221 -0
- package/src/core/main/ts/api/EditorOptions.ts +309 -0
- package/src/core/main/ts/api/EditorUpload.ts +363 -0
- package/src/core/main/ts/api/Env.ts +130 -0
- package/src/core/main/ts/api/EventTypes.ts +265 -0
- package/src/core/main/ts/api/Events.ts +133 -0
- package/src/core/main/ts/api/FakeClipboard.ts +82 -0
- package/src/core/main/ts/api/FocusManager.ts +34 -0
- package/src/core/main/ts/api/Formatter.ts +205 -0
- package/src/core/main/ts/api/IconManager.ts +39 -0
- package/src/core/main/ts/api/Main.ts +23 -0
- package/src/core/main/ts/api/Mode.ts +97 -0
- package/src/core/main/ts/api/ModelManager.ts +21 -0
- package/src/core/main/ts/api/NotificationManager.ts +197 -0
- package/src/core/main/ts/api/OptionTypes.ts +360 -0
- package/src/core/main/ts/api/Options.ts +1100 -0
- package/src/core/main/ts/api/PluginManager.ts +15 -0
- package/src/core/main/ts/api/PublicApi.ts +137 -0
- package/src/core/main/ts/api/Resource.ts +90 -0
- package/src/core/main/ts/api/Shortcuts.ts +266 -0
- package/src/core/main/ts/api/ThemeManager.ts +27 -0
- package/src/core/main/ts/api/Tinymce.ts +268 -0
- package/src/core/main/ts/api/UndoManager.ts +177 -0
- package/src/core/main/ts/api/WindowManager.ts +202 -0
- package/src/core/main/ts/api/commands/AlignCommands.ts +52 -0
- package/src/core/main/ts/api/commands/ClipboardCommands.ts +38 -0
- package/src/core/main/ts/api/commands/Commands.ts +55 -0
- package/src/core/main/ts/api/commands/ContentCommands.ts +45 -0
- package/src/core/main/ts/api/commands/FormatCommands.ts +78 -0
- package/src/core/main/ts/api/commands/HistoryCommands.ts +21 -0
- package/src/core/main/ts/api/commands/IndentCommands.ts +18 -0
- package/src/core/main/ts/api/commands/LinkCommands.ts +45 -0
- package/src/core/main/ts/api/commands/NewBlockCommands.ts +14 -0
- package/src/core/main/ts/api/commands/NewlineCommands.ts +20 -0
- package/src/core/main/ts/api/commands/SelectionCommands.ts +32 -0
- package/src/core/main/ts/api/dom/BookmarkManager.ts +74 -0
- package/src/core/main/ts/api/dom/ControlSelection.ts +512 -0
- package/src/core/main/ts/api/dom/DOMUtils.ts +1817 -0
- package/src/core/main/ts/api/dom/EventUtils.ts +482 -0
- package/src/core/main/ts/api/dom/RangeUtils.ts +120 -0
- package/src/core/main/ts/api/dom/ScriptLoader.ts +284 -0
- package/src/core/main/ts/api/dom/Selection.ts +618 -0
- package/src/core/main/ts/api/dom/SelectorChanged.ts +98 -0
- package/src/core/main/ts/api/dom/Serializer.ts +142 -0
- package/src/core/main/ts/api/dom/StyleSheetLoader.ts +256 -0
- package/src/core/main/ts/api/dom/TextSeeker.ts +92 -0
- package/src/core/main/ts/api/dom/TreeWalker.ts +129 -0
- package/src/core/main/ts/api/file/BlobCache.ts +143 -0
- package/src/core/main/ts/api/fmt/Format.ts +16 -0
- package/src/core/main/ts/api/fmt/StyleFormat.ts +30 -0
- package/src/core/main/ts/api/geom/Rect.ts +210 -0
- package/src/core/main/ts/api/html/DomParser.ts +517 -0
- package/src/core/main/ts/api/html/Entities.ts +279 -0
- package/src/core/main/ts/api/html/Node.ts +566 -0
- package/src/core/main/ts/api/html/Schema.ts +764 -0
- package/src/core/main/ts/api/html/Serializer.ts +171 -0
- package/src/core/main/ts/api/html/StyleUtils.ts +66 -0
- package/src/core/main/ts/api/html/Styles.ts +367 -0
- package/src/core/main/ts/api/html/Writer.ts +204 -0
- package/src/core/main/ts/api/textpatterns/TextPatterns.ts +15 -0
- package/src/core/main/ts/api/ui/Registry.ts +246 -0
- package/src/core/main/ts/api/ui/Ui.ts +31 -0
- package/src/core/main/ts/api/util/Delay.ts +73 -0
- package/src/core/main/ts/api/util/EventDispatcher.ts +341 -0
- package/src/core/main/ts/api/util/FakeStorage.ts +35 -0
- package/src/core/main/ts/api/util/I18n.ts +187 -0
- package/src/core/main/ts/api/util/ImageUploader.ts +51 -0
- package/src/core/main/ts/api/util/LocalStorage.ts +28 -0
- package/src/core/main/ts/api/util/Observable.ts +164 -0
- package/src/core/main/ts/api/util/Tools.ts +296 -0
- package/src/core/main/ts/api/util/URI.ts +522 -0
- package/src/core/main/ts/api/util/VK.ts +60 -0
- package/src/core/main/ts/autocomplete/AutocompleteContext.ts +76 -0
- package/src/core/main/ts/autocomplete/AutocompleteLookup.ts +73 -0
- package/src/core/main/ts/autocomplete/AutocompleteTypes.ts +21 -0
- package/src/core/main/ts/autocomplete/AutocompleteUtils.ts +12 -0
- package/src/core/main/ts/autocomplete/Autocompleters.ts +39 -0
- package/src/core/main/ts/bookmark/BookmarkTypes.ts +52 -0
- package/src/core/main/ts/bookmark/Bookmarks.ts +25 -0
- package/src/core/main/ts/bookmark/CaretBookmark.ts +242 -0
- package/src/core/main/ts/bookmark/GetBookmark.ts +231 -0
- package/src/core/main/ts/bookmark/ResolveBookmark.ts +268 -0
- package/src/core/main/ts/caret/BlockBoundary.ts +41 -0
- package/src/core/main/ts/caret/CaretBr.ts +34 -0
- package/src/core/main/ts/caret/CaretCandidate.ts +77 -0
- package/src/core/main/ts/caret/CaretContainer.ts +185 -0
- package/src/core/main/ts/caret/CaretContainerInline.ts +76 -0
- package/src/core/main/ts/caret/CaretContainerInput.ts +50 -0
- package/src/core/main/ts/caret/CaretContainerRemove.ts +95 -0
- package/src/core/main/ts/caret/CaretFinder.ts +102 -0
- package/src/core/main/ts/caret/CaretPosition.ts +407 -0
- package/src/core/main/ts/caret/CaretPositionPredicates.ts +55 -0
- package/src/core/main/ts/caret/CaretUtils.ts +323 -0
- package/src/core/main/ts/caret/CaretWalker.ts +245 -0
- package/src/core/main/ts/caret/ClosestCaretCandidate.ts +145 -0
- package/src/core/main/ts/caret/FakeCaret.ts +230 -0
- package/src/core/main/ts/caret/FakeCaretUtils.ts +60 -0
- package/src/core/main/ts/caret/InsertText.ts +37 -0
- package/src/core/main/ts/caret/LineReader.ts +133 -0
- package/src/core/main/ts/caret/LineUtils.ts +34 -0
- package/src/core/main/ts/caret/LineWalker.ts +165 -0
- package/src/core/main/ts/caret/TableCells.ts +90 -0
- package/src/core/main/ts/commands/Font.ts +60 -0
- package/src/core/main/ts/commands/IndentOutdent.ts +81 -0
- package/src/core/main/ts/commands/LineHeight.ts +24 -0
- package/src/core/main/ts/content/ContentCleanup.ts +28 -0
- package/src/core/main/ts/content/ContentTypes.ts +54 -0
- package/src/core/main/ts/content/EditorContent.ts +11 -0
- package/src/core/main/ts/content/GetContent.ts +24 -0
- package/src/core/main/ts/content/GetContentImpl.ts +67 -0
- package/src/core/main/ts/content/InsertContent.ts +62 -0
- package/src/core/main/ts/content/InsertContentImpl.ts +378 -0
- package/src/core/main/ts/content/InsertList.ts +212 -0
- package/src/core/main/ts/content/NbspTrim.ts +30 -0
- package/src/core/main/ts/content/Placeholder.ts +115 -0
- package/src/core/main/ts/content/PrePostProcess.ts +86 -0
- package/src/core/main/ts/content/SetContent.ts +23 -0
- package/src/core/main/ts/content/SetContentImpl.ts +98 -0
- package/src/core/main/ts/content/TransparentElements.ts +168 -0
- package/src/core/main/ts/delete/BlockBoundaryDelete.ts +25 -0
- package/src/core/main/ts/delete/BlockMergeBoundary.ts +92 -0
- package/src/core/main/ts/delete/BlockRangeDelete.ts +68 -0
- package/src/core/main/ts/delete/CaretBoundaryDelete.ts +81 -0
- package/src/core/main/ts/delete/CefDelete.ts +115 -0
- package/src/core/main/ts/delete/CefDeleteAction.ts +141 -0
- package/src/core/main/ts/delete/DeleteCommands.ts +74 -0
- package/src/core/main/ts/delete/DeleteElement.ts +168 -0
- package/src/core/main/ts/delete/DeleteUtils.ts +111 -0
- package/src/core/main/ts/delete/DetailsDelete.ts +258 -0
- package/src/core/main/ts/delete/ImageBlockDelete.ts +22 -0
- package/src/core/main/ts/delete/InlineBoundaryDelete.ts +127 -0
- package/src/core/main/ts/delete/InlineFormatDelete.ts +169 -0
- package/src/core/main/ts/delete/MediaDelete.ts +47 -0
- package/src/core/main/ts/delete/MergeBlocks.ts +128 -0
- package/src/core/main/ts/delete/MergeText.ts +66 -0
- package/src/core/main/ts/delete/Outdent.ts +25 -0
- package/src/core/main/ts/delete/TableDelete.ts +293 -0
- package/src/core/main/ts/delete/TableDeleteAction.ts +214 -0
- package/src/core/main/ts/delete/TableDeleteUtils.ts +67 -0
- package/src/core/main/ts/dom/CefUtils.ts +18 -0
- package/src/core/main/ts/dom/Dimensions.ts +39 -0
- package/src/core/main/ts/dom/DomSerializerFilters.ts +230 -0
- package/src/core/main/ts/dom/DomSerializerImpl.ts +132 -0
- package/src/core/main/ts/dom/DomSerializerPreProcess.ts +58 -0
- package/src/core/main/ts/dom/ElementType.ts +44 -0
- package/src/core/main/ts/dom/ElementUtils.ts +135 -0
- package/src/core/main/ts/dom/Empty.ts +122 -0
- package/src/core/main/ts/dom/MousePosition.ts +76 -0
- package/src/core/main/ts/dom/NodePath.ts +39 -0
- package/src/core/main/ts/dom/NodeType.ts +142 -0
- package/src/core/main/ts/dom/PaddingBr.ts +62 -0
- package/src/core/main/ts/dom/Parents.ts +24 -0
- package/src/core/main/ts/dom/Position.ts +74 -0
- package/src/core/main/ts/dom/RangePoint.ts +15 -0
- package/src/core/main/ts/dom/RemoveTrailingBr.ts +85 -0
- package/src/core/main/ts/dom/ScrollIntoView.ts +193 -0
- package/src/core/main/ts/dom/StyleSheetLoaderRegistry.ts +33 -0
- package/src/core/main/ts/dom/TextWalker.ts +34 -0
- package/src/core/main/ts/dom/TrimBody.ts +107 -0
- package/src/core/main/ts/dom/TrimNode.ts +76 -0
- package/src/core/main/ts/events/DragEvents.ts +99 -0
- package/src/core/main/ts/events/EventUtils.ts +141 -0
- package/src/core/main/ts/events/InputEvents.ts +46 -0
- package/src/core/main/ts/events/TouchEvents.ts +87 -0
- package/src/core/main/ts/file/BlobCacheUtils.ts +65 -0
- package/src/core/main/ts/file/Conversions.ts +110 -0
- package/src/core/main/ts/file/ImageScanner.ts +101 -0
- package/src/core/main/ts/file/UploadStatus.ts +79 -0
- package/src/core/main/ts/file/Uploader.ts +211 -0
- package/src/core/main/ts/fmt/ApplyFormat.ts +383 -0
- package/src/core/main/ts/fmt/CaretFormat.ts +375 -0
- package/src/core/main/ts/fmt/DefaultFormats.ts +264 -0
- package/src/core/main/ts/fmt/ExpandRange.ts +373 -0
- package/src/core/main/ts/fmt/FontInfo.ts +60 -0
- package/src/core/main/ts/fmt/FormatChanged.ts +205 -0
- package/src/core/main/ts/fmt/FormatContainer.ts +24 -0
- package/src/core/main/ts/fmt/FormatRegistry.ts +92 -0
- package/src/core/main/ts/fmt/FormatTypes.ts +82 -0
- package/src/core/main/ts/fmt/FormatUtils.ts +366 -0
- package/src/core/main/ts/fmt/Hooks.ts +69 -0
- package/src/core/main/ts/fmt/ListItemFormat.ts +55 -0
- package/src/core/main/ts/fmt/MatchFormat.ts +242 -0
- package/src/core/main/ts/fmt/MergeFormats.ts +108 -0
- package/src/core/main/ts/fmt/MergeUtils.ts +128 -0
- package/src/core/main/ts/fmt/Preview.ts +336 -0
- package/src/core/main/ts/fmt/RemoveFormat.ts +679 -0
- package/src/core/main/ts/fmt/TableFormats.ts +51 -0
- package/src/core/main/ts/fmt/ToggleFormat.ts +20 -0
- package/src/core/main/ts/focus/CefFocus.ts +33 -0
- package/src/core/main/ts/focus/EditorFocus.ts +139 -0
- package/src/core/main/ts/focus/FocusController.ts +151 -0
- package/src/core/main/ts/focus/MediaFocus.ts +25 -0
- package/src/core/main/ts/frames/Frames.ts +22 -0
- package/src/core/main/ts/frames/Navigation.ts +21 -0
- package/src/core/main/ts/frames/OuterPosition.ts +26 -0
- package/src/core/main/ts/geom/ClientRect.ts +154 -0
- package/src/core/main/ts/html/AstNodeType.ts +10 -0
- package/src/core/main/ts/html/Embed.ts +55 -0
- package/src/core/main/ts/html/FilterNode.ts +111 -0
- package/src/core/main/ts/html/FilterRegistry.ts +58 -0
- package/src/core/main/ts/html/InvalidNodes.ts +189 -0
- package/src/core/main/ts/html/LegacyFilter.ts +80 -0
- package/src/core/main/ts/html/Namespace.ts +47 -0
- package/src/core/main/ts/html/NonEditableFilter.ts +108 -0
- package/src/core/main/ts/html/ParserFilters.ts +176 -0
- package/src/core/main/ts/html/ParserUtils.ts +62 -0
- package/src/core/main/ts/html/Sanitization.ts +268 -0
- package/src/core/main/ts/init/ContentCss.ts +46 -0
- package/src/core/main/ts/init/Init.ts +195 -0
- package/src/core/main/ts/init/InitContentBody.ts +509 -0
- package/src/core/main/ts/init/InitIframe.ts +127 -0
- package/src/core/main/ts/init/LicenseKeyValidation.ts +21 -0
- package/src/core/main/ts/init/Render.ts +263 -0
- package/src/core/main/ts/keyboard/ArrowKeys.ts +58 -0
- package/src/core/main/ts/keyboard/Autocompleter.ts +158 -0
- package/src/core/main/ts/keyboard/BoundaryCaret.ts +67 -0
- package/src/core/main/ts/keyboard/BoundaryLocation.ts +195 -0
- package/src/core/main/ts/keyboard/BoundarySelection.ts +139 -0
- package/src/core/main/ts/keyboard/CefNavigation.ts +124 -0
- package/src/core/main/ts/keyboard/CefUtils.ts +24 -0
- package/src/core/main/ts/keyboard/ContentEndpointNavigation.ts +46 -0
- package/src/core/main/ts/keyboard/DeleteBackspaceKeys.ts +127 -0
- package/src/core/main/ts/keyboard/DetailsNavigation.ts +50 -0
- package/src/core/main/ts/keyboard/EnterKey.ts +87 -0
- package/src/core/main/ts/keyboard/FormatShortcuts.ts +21 -0
- package/src/core/main/ts/keyboard/HomeEndKeys.ts +40 -0
- package/src/core/main/ts/keyboard/InlineUtils.ts +77 -0
- package/src/core/main/ts/keyboard/InputKeys.ts +15 -0
- package/src/core/main/ts/keyboard/InsertSpace.ts +72 -0
- package/src/core/main/ts/keyboard/KeyboardOverrides.ts +44 -0
- package/src/core/main/ts/keyboard/MatchKeys.ts +65 -0
- package/src/core/main/ts/keyboard/MediaNavigation.ts +36 -0
- package/src/core/main/ts/keyboard/NavigationUtils.ts +168 -0
- package/src/core/main/ts/keyboard/Nbsps.ts +213 -0
- package/src/core/main/ts/keyboard/PageUpDownKeys.ts +68 -0
- package/src/core/main/ts/keyboard/PreventNoneditableInput.ts +14 -0
- package/src/core/main/ts/keyboard/SpaceKey.ts +34 -0
- package/src/core/main/ts/keyboard/TabKey.ts +37 -0
- package/src/core/main/ts/keyboard/TableNavigation.ts +182 -0
- package/src/core/main/ts/mode/EditableRoot.ts +18 -0
- package/src/core/main/ts/mode/Mode.ts +69 -0
- package/src/core/main/ts/mode/Readonly.ts +179 -0
- package/src/core/main/ts/newline/ContextSelectors.ts +24 -0
- package/src/core/main/ts/newline/InsertBlock.ts +442 -0
- package/src/core/main/ts/newline/InsertBr.ts +177 -0
- package/src/core/main/ts/newline/InsertDetailsNewLine.ts +46 -0
- package/src/core/main/ts/newline/InsertLi.ts +141 -0
- package/src/core/main/ts/newline/InsertNewLine.ts +64 -0
- package/src/core/main/ts/newline/NewBlock.ts +44 -0
- package/src/core/main/ts/newline/NewLineAction.ts +121 -0
- package/src/core/main/ts/newline/NewLineUtils.ts +236 -0
- package/src/core/main/ts/options/NormalizeOptions.ts +152 -0
- package/src/core/main/ts/paste/Clipboard.ts +337 -0
- package/src/core/main/ts/paste/Commands.ts +38 -0
- package/src/core/main/ts/paste/CutCopy.ts +116 -0
- package/src/core/main/ts/paste/DragDrop.ts +159 -0
- package/src/core/main/ts/paste/InternalHtml.ts +21 -0
- package/src/core/main/ts/paste/Newlines.ts +46 -0
- package/src/core/main/ts/paste/Paste.ts +33 -0
- package/src/core/main/ts/paste/PasteBin.ts +135 -0
- package/src/core/main/ts/paste/PasteUtils.ts +150 -0
- package/src/core/main/ts/paste/PrePostProcess.ts +25 -0
- package/src/core/main/ts/paste/ProcessFilters.ts +58 -0
- package/src/core/main/ts/paste/Quirks.ts +97 -0
- package/src/core/main/ts/paste/SmartPaste.ts +81 -0
- package/src/core/main/ts/schema/CustomElementsRuleParser.ts +24 -0
- package/src/core/main/ts/schema/GlobalAttributesSet.ts +25 -0
- package/src/core/main/ts/schema/Presets.ts +27 -0
- package/src/core/main/ts/schema/SchemaElementSets.ts +70 -0
- package/src/core/main/ts/schema/SchemaLookupTable.ts +230 -0
- package/src/core/main/ts/schema/SchemaTypes.ts +80 -0
- package/src/core/main/ts/schema/SchemaUtils.ts +31 -0
- package/src/core/main/ts/schema/ValidChildrenRuleParser.ts +51 -0
- package/src/core/main/ts/schema/ValidElementsRuleParser.ts +138 -0
- package/src/core/main/ts/selection/CaretRangeFromPoint.ts +15 -0
- package/src/core/main/ts/selection/DetailsElement.ts +41 -0
- package/src/core/main/ts/selection/EditableRange.ts +9 -0
- package/src/core/main/ts/selection/ElementSelection.ts +148 -0
- package/src/core/main/ts/selection/EventProcessRanges.ts +12 -0
- package/src/core/main/ts/selection/FragmentReader.ts +87 -0
- package/src/core/main/ts/selection/GetSelectionContent.ts +11 -0
- package/src/core/main/ts/selection/GetSelectionContentImpl.ts +104 -0
- package/src/core/main/ts/selection/MultiClickSelection.ts +86 -0
- package/src/core/main/ts/selection/MultiRange.ts +33 -0
- package/src/core/main/ts/selection/NormalizeRange.ts +299 -0
- package/src/core/main/ts/selection/RangeCompare.ts +13 -0
- package/src/core/main/ts/selection/RangeInsertNode.ts +40 -0
- package/src/core/main/ts/selection/RangeMap.ts +31 -0
- package/src/core/main/ts/selection/RangeNodes.ts +40 -0
- package/src/core/main/ts/selection/RangeNormalizer.ts +38 -0
- package/src/core/main/ts/selection/RangeTypes.ts +6 -0
- package/src/core/main/ts/selection/RangeWalk.ts +107 -0
- package/src/core/main/ts/selection/SelectionBookmark.ts +107 -0
- package/src/core/main/ts/selection/SelectionRestore.ts +63 -0
- package/src/core/main/ts/selection/SelectionUtils.ts +144 -0
- package/src/core/main/ts/selection/SetSelectionContent.ts +124 -0
- package/src/core/main/ts/selection/SimpleTableModel.ts +168 -0
- package/src/core/main/ts/selection/SplitRange.ts +55 -0
- package/src/core/main/ts/selection/TableCellSelection.ts +31 -0
- package/src/core/main/ts/selection/WordSelection.ts +37 -0
- package/src/core/main/ts/text/Bidi.ts +7 -0
- package/src/core/main/ts/text/CharType.ts +18 -0
- package/src/core/main/ts/text/ExtendingChar.ts +42 -0
- package/src/core/main/ts/text/Whitespace.ts +53 -0
- package/src/core/main/ts/text/Zwsp.ts +27 -0
- package/src/core/main/ts/textpatterns/TextPatterns.ts +10 -0
- package/src/core/main/ts/textpatterns/core/BlockPattern.ts +62 -0
- package/src/core/main/ts/textpatterns/core/BlockPatternOnSpace.ts +29 -0
- package/src/core/main/ts/textpatterns/core/BlockPatternUtils.ts +90 -0
- package/src/core/main/ts/textpatterns/core/InlinePattern.ts +326 -0
- package/src/core/main/ts/textpatterns/core/Pattern.ts +141 -0
- package/src/core/main/ts/textpatterns/core/PatternTypes.ts +86 -0
- package/src/core/main/ts/textpatterns/keyboard/KeyHandler.ts +97 -0
- package/src/core/main/ts/textpatterns/keyboard/Keyboard.ts +75 -0
- package/src/core/main/ts/textpatterns/utils/Marker.ts +50 -0
- package/src/core/main/ts/textpatterns/utils/PathRange.ts +81 -0
- package/src/core/main/ts/textpatterns/utils/Utils.ts +71 -0
- package/src/core/main/ts/ui/NotificationManagerImpl.ts +13 -0
- package/src/core/main/ts/ui/WindowManagerImpl.ts +15 -0
- package/src/core/main/ts/undo/Diff.ts +151 -0
- package/src/core/main/ts/undo/Fragments.ts +89 -0
- package/src/core/main/ts/undo/Levels.ts +99 -0
- package/src/core/main/ts/undo/Locks.ts +4 -0
- package/src/core/main/ts/undo/Operations.ts +167 -0
- package/src/core/main/ts/undo/Setup.ts +157 -0
- package/src/core/main/ts/undo/TypingState.ts +22 -0
- package/src/core/main/ts/undo/UndoManagerTypes.ts +50 -0
- package/src/core/main/ts/util/ArrUtils.ts +149 -0
- package/src/core/main/ts/util/LazyEvaluator.ts +16 -0
- package/src/core/main/ts/util/Predicate.ts +29 -0
- package/src/core/main/ts/util/Quirks.ts +739 -0
- package/src/core/main/ts/util/Uuid.ts +25 -0
- package/src/core/main/ts/view/VisualAids.ts +5 -0
- package/src/core/main/ts/view/VisualAidsImpl.ts +41 -0
- package/src/core/test/assets/icons/custom/icons.js +6 -0
- package/src/core/test/assets/js/nested.js +2 -0
- package/src/core/test/assets/js/test.js +1 -0
- package/src/core/test/assets/langs/custom.js +3 -0
- package/src/core/test/json/routes.json +395 -0
- package/src/core/test/ts/atomic/autocomplete/ParserTest.ts +54 -0
- package/src/core/test/ts/atomic/file/ConversionsTest.ts +34 -0
- package/src/core/test/ts/atomic/html/FilterNodeTest.ts +57 -0
- package/src/core/test/ts/atomic/keyboard/MatchKeysTest.ts +123 -0
- package/src/core/test/ts/atomic/keyboard/NbspsTest.ts +22 -0
- package/src/core/test/ts/atomic/paste/InternalHtmlTest.ts +25 -0
- package/src/core/test/ts/atomic/paste/NewlinesTest.ts +60 -0
- package/src/core/test/ts/atomic/schema/CustomElementsRuleParserTest.ts +53 -0
- package/src/core/test/ts/atomic/schema/GlobalAttributesSetTest.ts +42 -0
- package/src/core/test/ts/atomic/schema/PresetsTest.ts +42 -0
- package/src/core/test/ts/atomic/schema/SchemaElementSetsTest.ts +122 -0
- package/src/core/test/ts/atomic/schema/SchemaLookupTableTest.ts +37 -0
- package/src/core/test/ts/atomic/schema/ValidChildrenRuleParserTest.ts +175 -0
- package/src/core/test/ts/atomic/schema/ValidElementsRuleParserTest.ts +331 -0
- package/src/core/test/ts/atomic/text/BidiTest.ts +12 -0
- package/src/core/test/ts/atomic/text/ExtendingCharTest.ts +11 -0
- package/src/core/test/ts/atomic/text/WhitespaceTest.ts +32 -0
- package/src/core/test/ts/atomic/text/ZwspTest.ts +12 -0
- package/src/core/test/ts/atomic/textpatterns/FindBlockPatternsTest.ts +47 -0
- package/src/core/test/ts/atomic/util/LazyEvaluatorTest.ts +26 -0
- package/src/core/test/ts/atomic/util/PredicateTest.ts +25 -0
- package/src/core/test/ts/browser/AddOnManagerTest.ts +90 -0
- package/src/core/test/ts/browser/ClickContentEditableFalseTest.ts +76 -0
- package/src/core/test/ts/browser/DragDropOverridesTest.ts +801 -0
- package/src/core/test/ts/browser/EditableRootTest.ts +97 -0
- package/src/core/test/ts/browser/EditorAutoFocusTest.ts +84 -0
- package/src/core/test/ts/browser/EditorCleanupTest.ts +65 -0
- package/src/core/test/ts/browser/EditorManagerCommandsTest.ts +87 -0
- package/src/core/test/ts/browser/EditorManagerSetupTest.ts +40 -0
- package/src/core/test/ts/browser/EditorManagerTest.ts +206 -0
- package/src/core/test/ts/browser/EditorOptionsTest.ts +227 -0
- package/src/core/test/ts/browser/EditorRemoveTest.ts +101 -0
- package/src/core/test/ts/browser/EditorRemovedApiTest.ts +43 -0
- package/src/core/test/ts/browser/EditorRtlTest.ts +36 -0
- package/src/core/test/ts/browser/EditorTest.ts +543 -0
- package/src/core/test/ts/browser/EditorUploadTest.ts +663 -0
- package/src/core/test/ts/browser/EditorViewTest.ts +101 -0
- package/src/core/test/ts/browser/FakeClipboardTest.ts +83 -0
- package/src/core/test/ts/browser/FontSelectCustomTest.ts +63 -0
- package/src/core/test/ts/browser/FontSelectTest.ts +172 -0
- package/src/core/test/ts/browser/ForceBlocksTest.ts +167 -0
- package/src/core/test/ts/browser/FormatterApplyTest.ts +2563 -0
- package/src/core/test/ts/browser/FormatterCheckTest.ts +358 -0
- package/src/core/test/ts/browser/FormatterClosestTest.ts +79 -0
- package/src/core/test/ts/browser/FormatterRemoveTest.ts +619 -0
- package/src/core/test/ts/browser/FormattingCommandsTest.ts +554 -0
- package/src/core/test/ts/browser/InlineEditorRemoveTest.ts +28 -0
- package/src/core/test/ts/browser/InlineEditorSaveTest.ts +27 -0
- package/src/core/test/ts/browser/MiscCommandsTest.ts +75 -0
- package/src/core/test/ts/browser/ModeTest.ts +111 -0
- package/src/core/test/ts/browser/NotificationManagerTest.ts +256 -0
- package/src/core/test/ts/browser/PadEmptyWithBrTest.ts +38 -0
- package/src/core/test/ts/browser/ReadOnlyModeTest.ts +305 -0
- package/src/core/test/ts/browser/ResourceTest.ts +86 -0
- package/src/core/test/ts/browser/SelectionOverridesTest.ts +338 -0
- package/src/core/test/ts/browser/ShortcutsTest.ts +106 -0
- package/src/core/test/ts/browser/UndoManagerTest.ts +759 -0
- package/src/core/test/ts/browser/WindowManagerTest.ts +46 -0
- package/src/core/test/ts/browser/annotate/AnnotateBlocksTest.ts +723 -0
- package/src/core/test/ts/browser/annotate/AnnotateTest.ts +209 -0
- package/src/core/test/ts/browser/annotate/AnnotationChangedTest.ts +352 -0
- package/src/core/test/ts/browser/annotate/AnnotationPersistenceTest.ts +129 -0
- package/src/core/test/ts/browser/annotate/AnnotationRemovedTest.ts +211 -0
- package/src/core/test/ts/browser/annotate/AnnotationStylingTest.ts +311 -0
- package/src/core/test/ts/browser/api/EditorCommandsTest.ts +341 -0
- package/src/core/test/ts/browser/api/OptionsTest.ts +34 -0
- package/src/core/test/ts/browser/api/commands/ContentCommandsTest.ts +91 -0
- package/src/core/test/ts/browser/api/commands/NewBlockCommandsTest.ts +251 -0
- package/src/core/test/ts/browser/api/commands/NewlineCommandsTest.ts +131 -0
- package/src/core/test/ts/browser/api/dom/RangeExpandTest.ts +77 -0
- package/src/core/test/ts/browser/api/dom/RangeUtilsTest.ts +45 -0
- package/src/core/test/ts/browser/bookmark/BookmarksTest.ts +313 -0
- package/src/core/test/ts/browser/bookmark/CaretBookmarkTest.ts +163 -0
- package/src/core/test/ts/browser/caret/CaretCandidateTest.ts +60 -0
- package/src/core/test/ts/browser/caret/CaretContainerRemoveTest.ts +63 -0
- package/src/core/test/ts/browser/caret/CaretContainerTest.ts +163 -0
- package/src/core/test/ts/browser/caret/CaretFinderTest.ts +410 -0
- package/src/core/test/ts/browser/caret/CaretPositionPredicatesTest.ts +59 -0
- package/src/core/test/ts/browser/caret/CaretPositionTest.ts +202 -0
- package/src/core/test/ts/browser/caret/CaretUtilsTest.ts +249 -0
- package/src/core/test/ts/browser/caret/CaretWalkerTest.ts +308 -0
- package/src/core/test/ts/browser/caret/ClosestCaretCandidateTest.ts +717 -0
- package/src/core/test/ts/browser/caret/FakeCaretTest.ts +143 -0
- package/src/core/test/ts/browser/caret/FakeCaretTypeTest.ts +29 -0
- package/src/core/test/ts/browser/caret/FirefoxFakeCaretBeforeTableTypeTest.ts +54 -0
- package/src/core/test/ts/browser/caret/LineReaderTest.ts +539 -0
- package/src/core/test/ts/browser/caret/LineUtilsTest.ts +22 -0
- package/src/core/test/ts/browser/caret/LineWalkerTest.ts +93 -0
- package/src/core/test/ts/browser/caret/TableCellsTest.ts +249 -0
- package/src/core/test/ts/browser/commands/ContentLangTest.ts +83 -0
- package/src/core/test/ts/browser/commands/LineHeightTest.ts +95 -0
- package/src/core/test/ts/browser/commands/OutdentCommandTest.ts +151 -0
- package/src/core/test/ts/browser/content/CustomElementsTest.ts +39 -0
- package/src/core/test/ts/browser/content/EditorContentEventsTest.ts +153 -0
- package/src/core/test/ts/browser/content/EditorContentForcedRootBlockTest.ts +20 -0
- package/src/core/test/ts/browser/content/EditorContentNotInitializedTest.ts +86 -0
- package/src/core/test/ts/browser/content/EditorContentTest.ts +704 -0
- package/src/core/test/ts/browser/content/EditorContentWsTest.ts +18 -0
- package/src/core/test/ts/browser/content/EditorGetContentRawTest.ts +86 -0
- package/src/core/test/ts/browser/content/EditorGetContentTextFormatTest.ts +35 -0
- package/src/core/test/ts/browser/content/EditorGetContentTreeTest.ts +49 -0
- package/src/core/test/ts/browser/content/EditorResetContentTest.ts +97 -0
- package/src/core/test/ts/browser/content/HTMLDataURLsTest.ts +32 -0
- package/src/core/test/ts/browser/content/InsertContentCommandTest.ts +429 -0
- package/src/core/test/ts/browser/content/InsertContentTest.ts +869 -0
- package/src/core/test/ts/browser/content/InsertContentWebKitBugs.ts +21 -0
- package/src/core/test/ts/browser/content/InsertListTest.ts +48 -0
- package/src/core/test/ts/browser/content/InsertUnsanitizedContentTest.ts +40 -0
- package/src/core/test/ts/browser/content/PlaceholderVisuallyEmptyTest.ts +54 -0
- package/src/core/test/ts/browser/content/TransparentElementsTest.ts +242 -0
- package/src/core/test/ts/browser/delete/BlockBoundaryDeleteTest.ts +494 -0
- package/src/core/test/ts/browser/delete/BlockMergeBoundaryTest.ts +113 -0
- package/src/core/test/ts/browser/delete/BlockRangeDeleteTest.ts +162 -0
- package/src/core/test/ts/browser/delete/CaretBoundaryDeleteTest.ts +123 -0
- package/src/core/test/ts/browser/delete/CefDeleteActionTest.ts +336 -0
- package/src/core/test/ts/browser/delete/CefDeleteNoneditableTest.ts +106 -0
- package/src/core/test/ts/browser/delete/CefDeleteTest.ts +321 -0
- package/src/core/test/ts/browser/delete/DeleteBeforeInputEventTest.ts +23 -0
- package/src/core/test/ts/browser/delete/DeleteCommandsTest.ts +106 -0
- package/src/core/test/ts/browser/delete/DeleteElementTest.ts +242 -0
- package/src/core/test/ts/browser/delete/DeleteUtilsTest.ts +119 -0
- package/src/core/test/ts/browser/delete/DetailsDeleteTest.ts +162 -0
- package/src/core/test/ts/browser/delete/ImageBlockDeleteTest.ts +66 -0
- package/src/core/test/ts/browser/delete/InlineBoundaryDeleteTest.ts +126 -0
- package/src/core/test/ts/browser/delete/InlineFormatDeleteTest.ts +986 -0
- package/src/core/test/ts/browser/delete/InlineFormatPostShortcutDeleteTest.ts +324 -0
- package/src/core/test/ts/browser/delete/MediaDeleteTest.ts +83 -0
- package/src/core/test/ts/browser/delete/MergeBlocksTest.ts +243 -0
- package/src/core/test/ts/browser/delete/OutdentTest.ts +43 -0
- package/src/core/test/ts/browser/delete/TableDeleteActionTest.ts +197 -0
- package/src/core/test/ts/browser/delete/TableDeleteTest.ts +671 -0
- package/src/core/test/ts/browser/dom/ContentCssCorsTest.ts +129 -0
- package/src/core/test/ts/browser/dom/ControlSelectionTest.ts +265 -0
- package/src/core/test/ts/browser/dom/DimensionsTest.ts +45 -0
- package/src/core/test/ts/browser/dom/DomUtilsTest.ts +991 -0
- package/src/core/test/ts/browser/dom/ElementTypeTest.ts +78 -0
- package/src/core/test/ts/browser/dom/EmptyTest.ts +79 -0
- package/src/core/test/ts/browser/dom/EventUtilsTest.ts +497 -0
- package/src/core/test/ts/browser/dom/NodePathTest.ts +41 -0
- package/src/core/test/ts/browser/dom/NodeTypeTest.ts +123 -0
- package/src/core/test/ts/browser/dom/PaddingBrTest.ts +59 -0
- package/src/core/test/ts/browser/dom/ParentsTest.ts +99 -0
- package/src/core/test/ts/browser/dom/RangePointTest.ts +42 -0
- package/src/core/test/ts/browser/dom/ReferrerPolicyTest.ts +45 -0
- package/src/core/test/ts/browser/dom/ScriptLoaderTest.ts +113 -0
- package/src/core/test/ts/browser/dom/ScrollIntoViewTest.ts +305 -0
- package/src/core/test/ts/browser/dom/SelectionEventsTest.ts +116 -0
- package/src/core/test/ts/browser/dom/SelectionQuirksTest.ts +84 -0
- package/src/core/test/ts/browser/dom/SelectionTest.ts +1380 -0
- package/src/core/test/ts/browser/dom/SerializerEventsTest.ts +50 -0
- package/src/core/test/ts/browser/dom/SerializerTest.ts +926 -0
- package/src/core/test/ts/browser/dom/StyleSheetLoaderRegistryTest.ts +40 -0
- package/src/core/test/ts/browser/dom/StyleSheetLoaderTest.ts +70 -0
- package/src/core/test/ts/browser/dom/TreeWalkerTest.ts +97 -0
- package/src/core/test/ts/browser/dom/TrimBodyTest.ts +188 -0
- package/src/core/test/ts/browser/dom/TrimNodeTest.ts +52 -0
- package/src/core/test/ts/browser/file/BlobCacheTest.ts +98 -0
- package/src/core/test/ts/browser/file/ConversionsTest.ts +25 -0
- package/src/core/test/ts/browser/file/ImageScannerTest.ts +71 -0
- package/src/core/test/ts/browser/file/UploadStatusTest.ts +33 -0
- package/src/core/test/ts/browser/fmt/BlockFormatsTest.ts +75 -0
- package/src/core/test/ts/browser/fmt/CaretFormatTest.ts +894 -0
- package/src/core/test/ts/browser/fmt/DefaultFormatsWithSchemaTest.ts +79 -0
- package/src/core/test/ts/browser/fmt/ExpandRangeTest.ts +311 -0
- package/src/core/test/ts/browser/fmt/FontInfoTest.ts +158 -0
- package/src/core/test/ts/browser/fmt/FontsizeFormatTest.ts +25 -0
- package/src/core/test/ts/browser/fmt/FormatChangeSelectionTest.ts +111 -0
- package/src/core/test/ts/browser/fmt/FormatChangeVarsTest.ts +191 -0
- package/src/core/test/ts/browser/fmt/FormatEmptyLineTest.ts +428 -0
- package/src/core/test/ts/browser/fmt/FormatNoneditableTest.ts +762 -0
- package/src/core/test/ts/browser/fmt/HooksTest.ts +67 -0
- package/src/core/test/ts/browser/fmt/ListItemFormatTest.ts +377 -0
- package/src/core/test/ts/browser/fmt/MediaAlignTest.ts +81 -0
- package/src/core/test/ts/browser/fmt/PreviewTest.ts +255 -0
- package/src/core/test/ts/browser/fmt/RemoveFormatTest.ts +284 -0
- package/src/core/test/ts/browser/fmt/RemoveHighlightFormatTest.ts +48 -0
- package/src/core/test/ts/browser/fmt/RemoveTrailingWhitespaceFormatTest.ts +44 -0
- package/src/core/test/ts/browser/fmt/TableFormatsTest.ts +178 -0
- package/src/core/test/ts/browser/fmt/TextDecorationColorTest.ts +197 -0
- package/src/core/test/ts/browser/focus/CefFocusTest.ts +34 -0
- package/src/core/test/ts/browser/focus/EditorFocusTest.ts +89 -0
- package/src/core/test/ts/browser/focus/FocusControllerTest.ts +83 -0
- package/src/core/test/ts/browser/focus/HighlightOnFocusTest.ts +146 -0
- package/src/core/test/ts/browser/focus/KeyboardShortcutElementPathFocusTest.ts +30 -0
- package/src/core/test/ts/browser/focus/KeyboardShortcutMenuFocusTest.ts +31 -0
- package/src/core/test/ts/browser/focus/MediaFocusTest.ts +27 -0
- package/src/core/test/ts/browser/geom/ClientRectTest.ts +118 -0
- package/src/core/test/ts/browser/geom/RectTest.ts +94 -0
- package/src/core/test/ts/browser/html/DomParserTest.ts +1702 -0
- package/src/core/test/ts/browser/html/EntitiesTest.ts +127 -0
- package/src/core/test/ts/browser/html/NamespaceTest.ts +61 -0
- package/src/core/test/ts/browser/html/NodeTest.ts +443 -0
- package/src/core/test/ts/browser/html/NonEditableFilterTest.ts +42 -0
- package/src/core/test/ts/browser/html/ParserUtilsTest.ts +78 -0
- package/src/core/test/ts/browser/html/SanitizationTest.ts +75 -0
- package/src/core/test/ts/browser/html/SchemaTest.ts +887 -0
- package/src/core/test/ts/browser/html/SerializerTest.ts +70 -0
- package/src/core/test/ts/browser/html/StylesTest.ts +269 -0
- package/src/core/test/ts/browser/html/WriterTest.ts +155 -0
- package/src/core/test/ts/browser/init/ContentCssTest.ts +49 -0
- package/src/core/test/ts/browser/init/ContentStylePositionTest.ts +28 -0
- package/src/core/test/ts/browser/init/EditorCustomThemeTest.ts +141 -0
- package/src/core/test/ts/browser/init/EditorInitializationTest.ts +245 -0
- package/src/core/test/ts/browser/init/InitContentBodyDirectionalityTest.ts +48 -0
- package/src/core/test/ts/browser/init/InitContentBodyEditInitialContentTest.ts +43 -0
- package/src/core/test/ts/browser/init/InitContentBodyFiltersTest.ts +29 -0
- package/src/core/test/ts/browser/init/InitContentBodySelectionTest.ts +47 -0
- package/src/core/test/ts/browser/init/InitDocumentWriteTest.ts +21 -0
- package/src/core/test/ts/browser/init/InitEditorIconTest.ts +41 -0
- package/src/core/test/ts/browser/init/InitEditorLanguageTest.ts +27 -0
- package/src/core/test/ts/browser/init/InitEditorNoThemeIframeTest.ts +33 -0
- package/src/core/test/ts/browser/init/InitEditorNoThemeInlineTest.ts +42 -0
- package/src/core/test/ts/browser/init/InitEditorOnHiddenElementTest.ts +16 -0
- package/src/core/test/ts/browser/init/InitEditorPluginInitErrorTest.ts +50 -0
- package/src/core/test/ts/browser/init/InitEditorThemeFunctionIframeTest.ts +41 -0
- package/src/core/test/ts/browser/init/InitEditorThemeFunctionInlineTest.ts +49 -0
- package/src/core/test/ts/browser/init/InitEventsOrderTest.ts +45 -0
- package/src/core/test/ts/browser/init/InitIframeAriaTextTest.ts +34 -0
- package/src/core/test/ts/browser/init/InitIframeEditorCookiesTest.ts +22 -0
- package/src/core/test/ts/browser/init/InitIframeEditorWithCustomAttrsTest.ts +26 -0
- package/src/core/test/ts/browser/init/InitIframeEditorWithTabindexTest.ts +29 -0
- package/src/core/test/ts/browser/init/InitUnsanitizedContentTest.ts +28 -0
- package/src/core/test/ts/browser/init/LicenseKeyValidationTest.ts +143 -0
- package/src/core/test/ts/browser/init/RegisterFormatsBeforeSetContentTest.ts +33 -0
- package/src/core/test/ts/browser/init/ShadowDomEditorTest.ts +81 -0
- package/src/core/test/ts/browser/keyboard/ArrowKeysAnchorTest.ts +251 -0
- package/src/core/test/ts/browser/keyboard/ArrowKeysCefTest.ts +208 -0
- package/src/core/test/ts/browser/keyboard/ArrowKeysContentEndpointTest.ts +80 -0
- package/src/core/test/ts/browser/keyboard/ArrowKeysEdgeCefTest.ts +322 -0
- package/src/core/test/ts/browser/keyboard/ArrowKeysInlineBoundariesTest.ts +388 -0
- package/src/core/test/ts/browser/keyboard/ArrowKeysTableTest.ts +250 -0
- package/src/core/test/ts/browser/keyboard/AutocompleterTest.ts +197 -0
- package/src/core/test/ts/browser/keyboard/BoundaryCaretTest.ts +49 -0
- package/src/core/test/ts/browser/keyboard/BoundaryLocationTest.ts +216 -0
- package/src/core/test/ts/browser/keyboard/CaretAfterKoreanTest.ts +139 -0
- package/src/core/test/ts/browser/keyboard/EnterKeyAnchorTest.ts +180 -0
- package/src/core/test/ts/browser/keyboard/EnterKeyCeFalseTest.ts +105 -0
- package/src/core/test/ts/browser/keyboard/EnterKeyHrTest.ts +66 -0
- package/src/core/test/ts/browser/keyboard/EnterKeyListsTest.ts +520 -0
- package/src/core/test/ts/browser/keyboard/EnterKeyTest.ts +684 -0
- package/src/core/test/ts/browser/keyboard/FormatShortcutsTest.ts +117 -0
- package/src/core/test/ts/browser/keyboard/HomeEndKeysTest.ts +165 -0
- package/src/core/test/ts/browser/keyboard/InlineUtilsTest.ts +199 -0
- package/src/core/test/ts/browser/keyboard/InsertKeysTest.ts +331 -0
- package/src/core/test/ts/browser/keyboard/KeyboardCellNavigationTest.ts +88 -0
- package/src/core/test/ts/browser/keyboard/KeyboardEventTest.ts +26 -0
- package/src/core/test/ts/browser/keyboard/MediaNavigationTest.ts +113 -0
- package/src/core/test/ts/browser/keyboard/PreventNoneditableInputTest.ts +92 -0
- package/src/core/test/ts/browser/keyboard/SpaceKeyBeforeInputEventTest.ts +23 -0
- package/src/core/test/ts/browser/keyboard/SpaceKeyTest.ts +144 -0
- package/src/core/test/ts/browser/keyboard/TableNavigationTest.ts +92 -0
- package/src/core/test/ts/browser/keyboard/TableTabKeyNavigationTest.ts +228 -0
- package/src/core/test/ts/browser/keyboard/TableTabNavigationDisabledTest.ts +22 -0
- package/src/core/test/ts/browser/keyboard/TypeTextAtCefTest.ts +43 -0
- package/src/core/test/ts/browser/newline/ForcedRootBlockTest.ts +172 -0
- package/src/core/test/ts/browser/newline/InsertBrTest.ts +128 -0
- package/src/core/test/ts/browser/newline/InsertNewLineTest.ts +853 -0
- package/src/core/test/ts/browser/newline/NewlineBeforeInputEventTest.ts +22 -0
- package/src/core/test/ts/browser/options/NormalizeOptionsTest.ts +254 -0
- package/src/core/test/ts/browser/paste/CutNoneditableTest.ts +26 -0
- package/src/core/test/ts/browser/paste/DragDropImageTest.ts +69 -0
- package/src/core/test/ts/browser/paste/DragDropSummaryTest.ts +60 -0
- package/src/core/test/ts/browser/paste/DragDropTransparentsTest.ts +57 -0
- package/src/core/test/ts/browser/paste/ImagePasteTest.ts +195 -0
- package/src/core/test/ts/browser/paste/InternalClipboardTest.ts +248 -0
- package/src/core/test/ts/browser/paste/PasteBinTest.ts +91 -0
- package/src/core/test/ts/browser/paste/PasteFormatToggleTest.ts +31 -0
- package/src/core/test/ts/browser/paste/PasteOptionsTest.ts +24 -0
- package/src/core/test/ts/browser/paste/PasteStylesTest.ts +79 -0
- package/src/core/test/ts/browser/paste/PasteTest.ts +580 -0
- package/src/core/test/ts/browser/paste/PlainTextPasteTest.ts +60 -0
- package/src/core/test/ts/browser/paste/ProcessFiltersTest.ts +150 -0
- package/src/core/test/ts/browser/paste/SmartPasteTest.ts +241 -0
- package/src/core/test/ts/browser/paste/UnsanitizedPasteTest.ts +38 -0
- package/src/core/test/ts/browser/selection/DetailsElementTest.ts +156 -0
- package/src/core/test/ts/browser/selection/FragmentReaderTest.ts +236 -0
- package/src/core/test/ts/browser/selection/GetSelectionContentTest.ts +151 -0
- package/src/core/test/ts/browser/selection/InlineBoundarySelectionTest.ts +42 -0
- package/src/core/test/ts/browser/selection/MultiClickSelectionTest.ts +224 -0
- package/src/core/test/ts/browser/selection/NoneditableRootElementSelectionTest.ts +100 -0
- package/src/core/test/ts/browser/selection/NormalizeRangeTest.ts +347 -0
- package/src/core/test/ts/browser/selection/RangeInsertNodeTest.ts +82 -0
- package/src/core/test/ts/browser/selection/RangeNormalizerTest.ts +98 -0
- package/src/core/test/ts/browser/selection/RangeWalkTest.ts +112 -0
- package/src/core/test/ts/browser/selection/SelectBeforeBlockTest.ts +33 -0
- package/src/core/test/ts/browser/selection/SelectionBookmarkInlineEditorTest.ts +148 -0
- package/src/core/test/ts/browser/selection/SelectionBookmarkTest.ts +189 -0
- package/src/core/test/ts/browser/selection/SelectionUtilsTest.ts +72 -0
- package/src/core/test/ts/browser/selection/SetSelectionContentTest.ts +297 -0
- package/src/core/test/ts/browser/selection/SimpleTableModelTest.ts +132 -0
- package/src/core/test/ts/browser/selection/TableCellSelectionTest.ts +46 -0
- package/src/core/test/ts/browser/text/ZwspInsertTest.ts +42 -0
- package/src/core/test/ts/browser/textpatterns/BlockPatternsOnSpaceTest.ts +288 -0
- package/src/core/test/ts/browser/textpatterns/FindBlockPatternsTest.ts +232 -0
- package/src/core/test/ts/browser/textpatterns/FindInlinePatternTest.ts +470 -0
- package/src/core/test/ts/browser/textpatterns/ReplacementTest.ts +197 -0
- package/src/core/test/ts/browser/textpatterns/TextPatternsFalseTest.ts +36 -0
- package/src/core/test/ts/browser/textpatterns/TextPatternsLookupTest.ts +38 -0
- package/src/core/test/ts/browser/textpatterns/TextPatternsPublicApiTest.ts +124 -0
- package/src/core/test/ts/browser/textpatterns/TextPatternsTest.ts +377 -0
- package/src/core/test/ts/browser/textpatterns/TextSearchTest.ts +139 -0
- package/src/core/test/ts/browser/textpatterns/TrailingPunctuationTest.ts +55 -0
- package/src/core/test/ts/browser/textpatterns/TriggerInlinePatternBeginningTest.ts +33 -0
- package/src/core/test/ts/browser/textpatterns/UndoTextPatternsTest.ts +35 -0
- package/src/core/test/ts/browser/undo/DiffTest.ts +22 -0
- package/src/core/test/ts/browser/undo/ForcedRootBlockTest.ts +48 -0
- package/src/core/test/ts/browser/undo/FragmentsTest.ts +44 -0
- package/src/core/test/ts/browser/undo/LevelsTest.ts +214 -0
- package/src/core/test/ts/browser/undo/UndoKeyboardShortcutsTest.ts +41 -0
- package/src/core/test/ts/browser/util/DelayTest.ts +51 -0
- package/src/core/test/ts/browser/util/EventDispatcherTest.ts +373 -0
- package/src/core/test/ts/browser/util/FakeStorageTest.ts +95 -0
- package/src/core/test/ts/browser/util/I18nTest.ts +124 -0
- package/src/core/test/ts/browser/util/ImageUploaderTest.ts +81 -0
- package/src/core/test/ts/browser/util/ObservableTest.ts +76 -0
- package/src/core/test/ts/browser/util/QuirksFirefoxTest.ts +101 -0
- package/src/core/test/ts/browser/util/QuirksWebkitTest.ts +360 -0
- package/src/core/test/ts/browser/util/ToolsTest.ts +11 -0
- package/src/core/test/ts/browser/util/UriTest.ts +175 -0
- package/src/core/test/ts/browser/util/UtilsTest.ts +22 -0
- package/src/core/test/ts/module/McAgar.ts +10 -0
- package/src/core/test/ts/module/test/AnnotationAsserts.ts +83 -0
- package/src/core/test/ts/module/test/BeforeInputEventUtils.ts +49 -0
- package/src/core/test/ts/module/test/CaretAsserts.ts +49 -0
- package/src/core/test/ts/module/test/DialogUtils.ts +30 -0
- package/src/core/test/ts/module/test/DragDropUtils.ts +22 -0
- package/src/core/test/ts/module/test/ErrorHelpers.ts +30 -0
- package/src/core/test/ts/module/test/HtmlUtils.ts +13 -0
- package/src/core/test/ts/module/test/InputEventUtils.ts +42 -0
- package/src/core/test/ts/module/test/KeyUtils.ts +113 -0
- package/src/core/test/ts/module/test/PasteEventUtils.ts +102 -0
- package/src/core/test/ts/module/test/PasteStrings.ts +13 -0
- package/src/core/test/ts/module/test/SingletonUtils.ts +7 -0
- package/src/core/test/ts/module/test/TableUtils.ts +21 -0
- package/src/core/test/ts/module/test/TextPatternsUtils.ts +145 -0
- package/src/core/test/ts/module/test/ViewBlock.ts +61 -0
- package/src/core/test/ts/webdriver/content/PlaceholderTest.ts +134 -0
- package/src/core/test/ts/webdriver/delete/InlineFormatRetentionTest.ts +42 -0
- package/src/core/test/ts/webdriver/delete/ShortcutDeleteTest.ts +215 -0
- package/src/core/test/ts/webdriver/keyboard/IframeTabfocusTest.ts +73 -0
- package/src/core/test/ts/webdriver/keyboard/PageUpDownKeysTest.ts +89 -0
- package/src/core/test/ts/webdriver/keyboard/SpaceKeyTest.ts +139 -0
- package/src/core/test/ts/webdriver/paste/CopyAndPasteTest.ts +275 -0
- package/src/core/test/ts/webdriver/paste/CutTest.ts +42 -0
- package/src/core/text/build-header.js +3 -0
- package/src/models/dom/demo/html/demo/basic-demo.html +28 -0
- package/src/models/dom/demo/ts/demo/Demo.ts +14 -0
- package/src/models/dom/main/ts/Main.ts +9 -0
- package/src/models/dom/main/ts/Model.ts +16 -0
- package/src/models/dom/main/ts/table/Table.ts +33 -0
- package/src/models/dom/main/ts/table/actions/Clipboard.ts +76 -0
- package/src/models/dom/main/ts/table/actions/InsertTable.ts +84 -0
- package/src/models/dom/main/ts/table/actions/TableActions.ts +213 -0
- package/src/models/dom/main/ts/table/api/Clipboard.ts +67 -0
- package/src/models/dom/main/ts/table/api/Commands.ts +253 -0
- package/src/models/dom/main/ts/table/api/Events.ts +77 -0
- package/src/models/dom/main/ts/table/api/Options.ts +181 -0
- package/src/models/dom/main/ts/table/api/QueryCommands.ts +30 -0
- package/src/models/dom/main/ts/table/api/TableCellSelectionHandler.ts +210 -0
- package/src/models/dom/main/ts/table/api/TableResizeHandler.ts +240 -0
- package/src/models/dom/main/ts/table/core/TableUtils.ts +69 -0
- package/src/models/dom/main/ts/table/core/TableWire.ts +36 -0
- package/src/models/dom/main/ts/table/queries/TableSize.ts +19 -0
- package/src/models/dom/main/ts/table/queries/TableTargets.ts +42 -0
- package/src/models/dom/main/ts/table/selection/Ephemera.ts +28 -0
- package/src/models/dom/main/ts/table/selection/TableSelection.ts +45 -0
- package/src/models/dom/test/ts/atomic/table/TableUtilsTest.ts +35 -0
- package/src/models/dom/test/ts/browser/table/DragEditorContentsOverTableTest.ts +25 -0
- package/src/models/dom/test/ts/browser/table/DragResizeTest.ts +453 -0
- package/src/models/dom/test/ts/browser/table/DragSelectionTest.ts +46 -0
- package/src/models/dom/test/ts/browser/table/EmptyRowTableTest.ts +28 -0
- package/src/models/dom/test/ts/browser/table/FakeSelectionTest.ts +279 -0
- package/src/models/dom/test/ts/browser/table/InsertColumnTableSizeTest.ts +175 -0
- package/src/models/dom/test/ts/browser/table/InsertRowTableResizeTest.ts +185 -0
- package/src/models/dom/test/ts/browser/table/InsertTableTest.ts +47 -0
- package/src/models/dom/test/ts/browser/table/InsertTableWidthsTest.ts +58 -0
- package/src/models/dom/test/ts/browser/table/InvalidColCountTest.ts +126 -0
- package/src/models/dom/test/ts/browser/table/ModifyColumnsTableResizeTest.ts +677 -0
- package/src/models/dom/test/ts/browser/table/NestedFakeSelectionTest.ts +289 -0
- package/src/models/dom/test/ts/browser/table/NewCellRowEventsTest.ts +42 -0
- package/src/models/dom/test/ts/browser/table/PasteTableTest.ts +65 -0
- package/src/models/dom/test/ts/browser/table/ResizeTableTest.ts +1035 -0
- package/src/models/dom/test/ts/browser/table/SwitchTableSectionTest.ts +352 -0
- package/src/models/dom/test/ts/browser/table/TableNoWidthTest.ts +41 -0
- package/src/models/dom/test/ts/browser/table/TableSectionApiTest.ts +406 -0
- package/src/models/dom/test/ts/browser/table/TableSizingModeTest.ts +98 -0
- package/src/models/dom/test/ts/browser/table/TwoCellsSelectionTest.ts +114 -0
- package/src/models/dom/test/ts/browser/table/UnmergeCellTableResizeTest.ts +304 -0
- package/src/models/dom/test/ts/browser/table/command/ApplyCellStyleCommandTest.ts +220 -0
- package/src/models/dom/test/ts/browser/table/command/CommandsOnLockedColumnsTest.ts +185 -0
- package/src/models/dom/test/ts/browser/table/command/InsertCommandsTest.ts +184 -0
- package/src/models/dom/test/ts/browser/table/command/InsertTableCommandTest.ts +110 -0
- package/src/models/dom/test/ts/browser/table/command/InsertTableCommandWithColGroupsTest.ts +97 -0
- package/src/models/dom/test/ts/browser/table/command/MergeCellCommandTest.ts +353 -0
- package/src/models/dom/test/ts/browser/table/command/ModifyClassesCommandsTest.ts +303 -0
- package/src/models/dom/test/ts/browser/table/command/TableDeleteColumnTest.ts +154 -0
- package/src/models/dom/test/ts/browser/table/command/TableDeleteCommandTest.ts +39 -0
- package/src/models/dom/test/ts/browser/table/command/TableDeleteRowTest.ts +152 -0
- package/src/models/dom/test/ts/browser/table/command/TableSizingModeCommandTest.ts +119 -0
- package/src/models/dom/test/ts/browser/table/command/TableSizingModeCommandWithColGroupsTest.ts +77 -0
- package/src/models/dom/test/ts/module/table/TableSizingModeCommandUtil.ts +92 -0
- package/src/models/dom/test/ts/module/table/TableTestUtils.ts +302 -0
- package/src/plugins/accordion/demo/html/demo.html +26 -0
- package/src/plugins/accordion/demo/ts/demo/Demo.ts +14 -0
- package/src/plugins/accordion/main/ts/Main.ts +9 -0
- package/src/plugins/accordion/main/ts/Plugin.ts +17 -0
- package/src/plugins/accordion/main/ts/api/Commands.ts +12 -0
- package/src/plugins/accordion/main/ts/api/Events.ts +13 -0
- package/src/plugins/accordion/main/ts/core/Actions.ts +90 -0
- package/src/plugins/accordion/main/ts/core/FilterContent.ts +153 -0
- package/src/plugins/accordion/main/ts/core/Identifiers.ts +14 -0
- package/src/plugins/accordion/main/ts/core/Keyboard.ts +27 -0
- package/src/plugins/accordion/main/ts/core/Quirks.ts +24 -0
- package/src/plugins/accordion/main/ts/core/Utils.ts +79 -0
- package/src/plugins/accordion/main/ts/ui/Buttons.ts +39 -0
- package/src/plugins/accordion/test/ts/browser/AccordionFormattingTest.ts +36 -0
- package/src/plugins/accordion/test/ts/browser/AccordionNavigationTest.ts +56 -0
- package/src/plugins/accordion/test/ts/browser/AccordionPluginTest.ts +241 -0
- package/src/plugins/accordion/test/ts/browser/DirectionalityTest.ts +58 -0
- package/src/plugins/accordion/test/ts/browser/FilterContentTest.ts +373 -0
- package/src/plugins/accordion/test/ts/browser/QuirksTest.ts +34 -0
- package/src/plugins/accordion/test/ts/module/AccordionUtils.ts +18 -0
- package/src/plugins/accordion/test/ts/webdriver/AccordionBackspaceDeleteTest.ts +649 -0
- package/src/plugins/accordion/test/ts/webdriver/AccordionEnterTest.ts +80 -0
- package/src/plugins/advlist/demo/html/demo.html +16 -0
- package/src/plugins/advlist/demo/ts/demo/Demo.ts +12 -0
- package/src/plugins/advlist/main/ts/Main.ts +9 -0
- package/src/plugins/advlist/main/ts/Plugin.ts +18 -0
- package/src/plugins/advlist/main/ts/api/Commands.ts +17 -0
- package/src/plugins/advlist/main/ts/api/Options.ts +31 -0
- package/src/plugins/advlist/main/ts/core/Actions.ts +10 -0
- package/src/plugins/advlist/main/ts/core/ListUtils.ts +58 -0
- package/src/plugins/advlist/main/ts/ui/Buttons.ts +97 -0
- package/src/plugins/advlist/test/ts/browser/AdvlistOptionsAndToolbarTest.ts +356 -0
- package/src/plugins/advlist/test/ts/browser/AdvlistPluginTest.ts +200 -0
- package/src/plugins/advlist/test/ts/browser/ChangeListStyleTest.ts +107 -0
- package/src/plugins/advlist/test/ts/browser/ContentEditableFalseTest.ts +97 -0
- package/src/plugins/advlist/test/ts/browser/ListUtilsTest.ts +22 -0
- package/src/plugins/advlist/test/ts/browser/NoneditableRootTest.ts +57 -0
- package/src/plugins/advlist/test/ts/browser/SplitButtonTest.ts +234 -0
- package/src/plugins/anchor/demo/html/demo.html +16 -0
- package/src/plugins/anchor/demo/ts/demo/Demo.ts +12 -0
- package/src/plugins/anchor/main/ts/Main.ts +9 -0
- package/src/plugins/anchor/main/ts/Plugin.ts +20 -0
- package/src/plugins/anchor/main/ts/api/Commands.ts +13 -0
- package/src/plugins/anchor/main/ts/api/Options.ts +24 -0
- package/src/plugins/anchor/main/ts/core/Anchor.ts +76 -0
- package/src/plugins/anchor/main/ts/core/FilterContent.ts +32 -0
- package/src/plugins/anchor/main/ts/core/Formats.ts +24 -0
- package/src/plugins/anchor/main/ts/core/Utils.ts +25 -0
- package/src/plugins/anchor/main/ts/ui/Buttons.ts +45 -0
- package/src/plugins/anchor/main/ts/ui/Dialog.ts +60 -0
- package/src/plugins/anchor/test/ts/browser/AnchorAlertTest.ts +32 -0
- package/src/plugins/anchor/test/ts/browser/AnchorAllowHtmlTest.ts +104 -0
- package/src/plugins/anchor/test/ts/browser/AnchorEditTest.ts +30 -0
- package/src/plugins/anchor/test/ts/browser/AnchorFormatsTest.ts +57 -0
- package/src/plugins/anchor/test/ts/browser/AnchorInlineTest.ts +26 -0
- package/src/plugins/anchor/test/ts/browser/AnchorSanityTest.ts +63 -0
- package/src/plugins/anchor/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/anchor/test/ts/module/Helpers.ts +21 -0
- package/src/plugins/autolink/demo/html/demo.html +15 -0
- package/src/plugins/autolink/demo/ts/demo/Demo.ts +12 -0
- package/src/plugins/autolink/main/ts/Main.ts +9 -0
- package/src/plugins/autolink/main/ts/Plugin.ts +11 -0
- package/src/plugins/autolink/main/ts/api/Options.ts +42 -0
- package/src/plugins/autolink/main/ts/core/Keys.ts +151 -0
- package/src/plugins/autolink/main/ts/core/Utils.ts +50 -0
- package/src/plugins/autolink/test/ts/browser/AutoLinkPluginTest.ts +225 -0
- package/src/plugins/autolink/test/ts/browser/ConsecutiveLinkTest.ts +30 -0
- package/src/plugins/autolink/test/ts/browser/EnterKeyTest.ts +24 -0
- package/src/plugins/autolink/test/ts/browser/FragmentedTextTest.ts +60 -0
- package/src/plugins/autolink/test/ts/module/test/KeyUtils.ts +159 -0
- package/src/plugins/autoresize/demo/html/demo.html +15 -0
- package/src/plugins/autoresize/demo/ts/demo/Demo.ts +13 -0
- package/src/plugins/autoresize/main/ts/Main.ts +9 -0
- package/src/plugins/autoresize/main/ts/Plugin.ts +30 -0
- package/src/plugins/autoresize/main/ts/api/Commands.ts +15 -0
- package/src/plugins/autoresize/main/ts/api/Events.ts +9 -0
- package/src/plugins/autoresize/main/ts/api/Options.ts +35 -0
- package/src/plugins/autoresize/main/ts/core/Resize.ts +187 -0
- package/src/plugins/autoresize/test/ts/browser/AutoresizePluginTest.ts +230 -0
- package/src/plugins/autosave/demo/html/demo.html +15 -0
- package/src/plugins/autosave/demo/ts/demo/Demo.ts +16 -0
- package/src/plugins/autosave/main/ts/Main.ts +9 -0
- package/src/plugins/autosave/main/ts/Plugin.ts +30 -0
- package/src/plugins/autosave/main/ts/api/Api.ts +23 -0
- package/src/plugins/autosave/main/ts/api/Events.ts +17 -0
- package/src/plugins/autosave/main/ts/api/Options.ts +72 -0
- package/src/plugins/autosave/main/ts/core/BeforeUnload.ts +32 -0
- package/src/plugins/autosave/main/ts/core/Storage.ts +91 -0
- package/src/plugins/autosave/main/ts/core/Time.ts +13 -0
- package/src/plugins/autosave/main/ts/ui/Buttons.ts +42 -0
- package/src/plugins/autosave/test/ts/browser/AutoSavePluginTest.ts +141 -0
- package/src/plugins/autosave/test/ts/browser/ShouldRestoreWhenEmptyTest.ts +63 -0
- package/src/plugins/charmap/demo/html/demo.html +15 -0
- package/src/plugins/charmap/demo/ts/demo/Demo.ts +13 -0
- package/src/plugins/charmap/main/ts/Main.ts +9 -0
- package/src/plugins/charmap/main/ts/Plugin.ts +21 -0
- package/src/plugins/charmap/main/ts/api/Api.ts +28 -0
- package/src/plugins/charmap/main/ts/api/Commands.ts +16 -0
- package/src/plugins/charmap/main/ts/api/Events.ts +10 -0
- package/src/plugins/charmap/main/ts/api/Options.ts +36 -0
- package/src/plugins/charmap/main/ts/core/Actions.ts +12 -0
- package/src/plugins/charmap/main/ts/core/CharMap.ts +414 -0
- package/src/plugins/charmap/main/ts/core/Scan.ts +37 -0
- package/src/plugins/charmap/main/ts/ui/Autocompletion.ts +26 -0
- package/src/plugins/charmap/main/ts/ui/Buttons.ts +37 -0
- package/src/plugins/charmap/main/ts/ui/Dialog.ts +99 -0
- package/src/plugins/charmap/test/ts/atomic/ScanTest.ts +33 -0
- package/src/plugins/charmap/test/ts/browser/CharmapAutocompletionTest.ts +23 -0
- package/src/plugins/charmap/test/ts/browser/CharmapDialogHeightTest.ts +80 -0
- package/src/plugins/charmap/test/ts/browser/CharmapPluginTest.ts +108 -0
- package/src/plugins/charmap/test/ts/browser/CharmapSearchTest.ts +55 -0
- package/src/plugins/charmap/test/ts/browser/CharmapUserDefinedTest.ts +30 -0
- package/src/plugins/charmap/test/ts/browser/InsertQuotationMarkTest.ts +24 -0
- package/src/plugins/charmap/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/charmap/test/ts/module/Helpers.ts +12 -0
- package/src/plugins/code/demo/html/demo.html +15 -0
- package/src/plugins/code/demo/ts/demo/Demo.ts +12 -0
- package/src/plugins/code/main/ts/Main.ts +9 -0
- package/src/plugins/code/main/ts/Plugin.ts +13 -0
- package/src/plugins/code/main/ts/api/Commands.ts +13 -0
- package/src/plugins/code/main/ts/core/Content.ts +24 -0
- package/src/plugins/code/main/ts/ui/Buttons.ts +22 -0
- package/src/plugins/code/main/ts/ui/Dialog.ts +45 -0
- package/src/plugins/code/test/ts/browser/CodeSanityTest.ts +51 -0
- package/src/plugins/code/test/ts/browser/CodeTextareaTest.ts +36 -0
- package/src/plugins/codesample/demo/html/demo.html +16 -0
- package/src/plugins/codesample/demo/ts/demo/Demo.ts +22 -0
- package/src/plugins/codesample/main/ts/Main.ts +9 -0
- package/src/plugins/codesample/main/ts/Plugin.ts +23 -0
- package/src/plugins/codesample/main/ts/api/Commands.ts +19 -0
- package/src/plugins/codesample/main/ts/api/Options.ts +32 -0
- package/src/plugins/codesample/main/ts/core/CodeSample.ts +44 -0
- package/src/plugins/codesample/main/ts/core/FilterContent.ts +70 -0
- package/src/plugins/codesample/main/ts/core/Languages.ts +41 -0
- package/src/plugins/codesample/main/ts/prism/Prism.ts +15 -0
- package/src/plugins/codesample/main/ts/prism/prismjs.d.ts +4 -0
- package/src/plugins/codesample/main/ts/ui/Buttons.ts +50 -0
- package/src/plugins/codesample/main/ts/ui/Dialog.ts +62 -0
- package/src/plugins/codesample/main/ts/util/Utils.ts +16 -0
- package/src/plugins/codesample/test/ts/browser/ChangeCodeSampleTest.ts +28 -0
- package/src/plugins/codesample/test/ts/browser/CodeSampleSanityTest.ts +52 -0
- package/src/plugins/codesample/test/ts/browser/CodeSampleSelectionTest.ts +46 -0
- package/src/plugins/codesample/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/codesample/test/ts/module/CodeSampleTestUtils.ts +89 -0
- package/src/plugins/codesample/test/ts/webdriver/CodeSampleCopyAndPasteTest.ts +134 -0
- package/src/plugins/directionality/demo/html/demo.html +15 -0
- package/src/plugins/directionality/demo/ts/demo/Demo.ts +12 -0
- package/src/plugins/directionality/main/ts/Main.ts +9 -0
- package/src/plugins/directionality/main/ts/Plugin.ts +11 -0
- package/src/plugins/directionality/main/ts/api/Commands.ts +17 -0
- package/src/plugins/directionality/main/ts/core/Direction.ts +65 -0
- package/src/plugins/directionality/main/ts/ui/Buttons.ts +38 -0
- package/src/plugins/directionality/test/ts/browser/CommandsTest.ts +43 -0
- package/src/plugins/directionality/test/ts/browser/DirectionStyleTest.ts +319 -0
- package/src/plugins/directionality/test/ts/browser/DirectionalitySanityTest.ts +169 -0
- package/src/plugins/directionality/test/ts/browser/NoneditableRootTest.ts +36 -0
- package/src/plugins/emoticons/demo/html/demo.html +15 -0
- package/src/plugins/emoticons/demo/ts/demo/Demo.ts +19 -0
- package/src/plugins/emoticons/main/ts/Main.ts +9 -0
- package/src/plugins/emoticons/main/ts/Plugin.ts +34 -0
- package/src/plugins/emoticons/main/ts/api/Commands.ts +12 -0
- package/src/plugins/emoticons/main/ts/api/Options.ts +60 -0
- package/src/plugins/emoticons/main/ts/core/Actions.ts +9 -0
- package/src/plugins/emoticons/main/ts/core/EmojiDatabase.ts +150 -0
- package/src/plugins/emoticons/main/ts/core/Filters.ts +14 -0
- package/src/plugins/emoticons/main/ts/core/Lookup.ts +31 -0
- package/src/plugins/emoticons/main/ts/ui/Autocompletion.ts +28 -0
- package/src/plugins/emoticons/main/ts/ui/Buttons.ts +37 -0
- package/src/plugins/emoticons/main/ts/ui/Dialog.ts +134 -0
- package/src/plugins/emoticons/test/js/test-emojis-alt.js +717 -0
- package/src/plugins/emoticons/test/js/test-emojis.js +27 -0
- package/src/plugins/emoticons/test/ts/browser/DifferentEmojiDatabaseTest.ts +50 -0
- package/src/plugins/emoticons/test/ts/browser/EmojiAppendTest.ts +76 -0
- package/src/plugins/emoticons/test/ts/browser/EmojiSearchTest.ts +54 -0
- package/src/plugins/emoticons/test/ts/browser/EmoticonAutocompletionTest.ts +29 -0
- package/src/plugins/emoticons/test/ts/browser/EmoticonsPluginTest.ts +21 -0
- package/src/plugins/emoticons/test/ts/browser/ImageEmojiTest.ts +58 -0
- package/src/plugins/emoticons/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/emoticons/test/ts/module/test/Utils.ts +12 -0
- package/src/plugins/fullscreen/demo/html/demo.html +18 -0
- package/src/plugins/fullscreen/demo/ts/demo/Demo.ts +20 -0
- package/src/plugins/fullscreen/main/ts/Main.ts +9 -0
- package/src/plugins/fullscreen/main/ts/Plugin.ts +27 -0
- package/src/plugins/fullscreen/main/ts/api/Api.ts +15 -0
- package/src/plugins/fullscreen/main/ts/api/Commands.ts +15 -0
- package/src/plugins/fullscreen/main/ts/api/Events.ts +10 -0
- package/src/plugins/fullscreen/main/ts/api/Options.ts +24 -0
- package/src/plugins/fullscreen/main/ts/core/Actions.ts +202 -0
- package/src/plugins/fullscreen/main/ts/core/NativeFullscreen.ts +58 -0
- package/src/plugins/fullscreen/main/ts/core/Thor.ts +68 -0
- package/src/plugins/fullscreen/main/ts/ui/Buttons.ts +38 -0
- package/src/plugins/fullscreen/test/ts/browser/FullScreenPluginTest.ts +219 -0
- package/src/plugins/fullscreen/test/ts/browser/FullScreenSinkTest.ts +27 -0
- package/src/plugins/fullscreen/test/ts/browser/FullscreenPluginInlineEditorTest.ts +22 -0
- package/src/plugins/fullscreen/test/ts/browser/FullscreenRestoreScrollTest.ts +52 -0
- package/src/plugins/fullscreen/test/ts/webdriver/FullscreenPluginNativeModeTest.ts +38 -0
- package/src/plugins/help/demo/html/demo.html +26 -0
- package/src/plugins/help/demo/ts/demo/Demo.ts +149 -0
- package/src/plugins/help/i18n/keynav/ar.html +89 -0
- package/src/plugins/help/i18n/keynav/bg_BG.html +89 -0
- package/src/plugins/help/i18n/keynav/ca.html +89 -0
- package/src/plugins/help/i18n/keynav/cs.html +89 -0
- package/src/plugins/help/i18n/keynav/da.html +89 -0
- package/src/plugins/help/i18n/keynav/de.html +89 -0
- package/src/plugins/help/i18n/keynav/el.html +89 -0
- package/src/plugins/help/i18n/keynav/en.html +89 -0
- package/src/plugins/help/i18n/keynav/es.html +89 -0
- package/src/plugins/help/i18n/keynav/eu.html +89 -0
- package/src/plugins/help/i18n/keynav/fa.html +89 -0
- package/src/plugins/help/i18n/keynav/fi.html +89 -0
- package/src/plugins/help/i18n/keynav/fr_FR.html +89 -0
- package/src/plugins/help/i18n/keynav/he_IL.html +89 -0
- package/src/plugins/help/i18n/keynav/hi.html +89 -0
- package/src/plugins/help/i18n/keynav/hr.html +89 -0
- package/src/plugins/help/i18n/keynav/hu_HU.html +89 -0
- package/src/plugins/help/i18n/keynav/id.html +89 -0
- package/src/plugins/help/i18n/keynav/it.html +89 -0
- package/src/plugins/help/i18n/keynav/ja.html +89 -0
- package/src/plugins/help/i18n/keynav/kk.html +89 -0
- package/src/plugins/help/i18n/keynav/ko_KR.html +89 -0
- package/src/plugins/help/i18n/keynav/ms.html +89 -0
- package/src/plugins/help/i18n/keynav/nb_NO.html +89 -0
- package/src/plugins/help/i18n/keynav/nl.html +89 -0
- package/src/plugins/help/i18n/keynav/pl.html +89 -0
- package/src/plugins/help/i18n/keynav/pt_BR.html +89 -0
- package/src/plugins/help/i18n/keynav/pt_PT.html +89 -0
- package/src/plugins/help/i18n/keynav/ro.html +89 -0
- package/src/plugins/help/i18n/keynav/ru.html +89 -0
- package/src/plugins/help/i18n/keynav/sk.html +89 -0
- package/src/plugins/help/i18n/keynav/sl_SI.html +89 -0
- package/src/plugins/help/i18n/keynav/sv_SE.html +89 -0
- package/src/plugins/help/i18n/keynav/th_TH.html +89 -0
- package/src/plugins/help/i18n/keynav/tr.html +89 -0
- package/src/plugins/help/i18n/keynav/uk.html +89 -0
- package/src/plugins/help/i18n/keynav/vi.html +89 -0
- package/src/plugins/help/i18n/keynav/zh_CN.html +83 -0
- package/src/plugins/help/i18n/keynav/zh_TW.html +89 -0
- package/src/plugins/help/main/ts/Main.ts +9 -0
- package/src/plugins/help/main/ts/Plugin.ts +30 -0
- package/src/plugins/help/main/ts/alien/ConvertShortcut.ts +34 -0
- package/src/plugins/help/main/ts/api/Api.ts +24 -0
- package/src/plugins/help/main/ts/api/Commands.ts +9 -0
- package/src/plugins/help/main/ts/api/Options.ts +28 -0
- package/src/plugins/help/main/ts/data/KeyboardShortcuts.ts +33 -0
- package/src/plugins/help/main/ts/data/PluginUrls.ts +92 -0
- package/src/plugins/help/main/ts/ui/Buttons.ts +20 -0
- package/src/plugins/help/main/ts/ui/Dialog.ts +98 -0
- package/src/plugins/help/main/ts/ui/KeyboardNavTab.ts +21 -0
- package/src/plugins/help/main/ts/ui/KeyboardNavTabI18n.ts +21 -0
- package/src/plugins/help/main/ts/ui/KeyboardShortcutsTab.ts +36 -0
- package/src/plugins/help/main/ts/ui/PluginsTab.ts +119 -0
- package/src/plugins/help/main/ts/ui/VersionTab.ts +27 -0
- package/src/plugins/help/test/ts/browser/CustomTabsTest.ts +146 -0
- package/src/plugins/help/test/ts/browser/DialogKeyboardNavTest.ts +106 -0
- package/src/plugins/help/test/ts/browser/IgnoreForcedPluginsTest.ts +31 -0
- package/src/plugins/help/test/ts/browser/KeyboardNavTabI18nTest.ts +59 -0
- package/src/plugins/help/test/ts/browser/MetadataTest.ts +33 -0
- package/src/plugins/help/test/ts/browser/PluginTabsOrderTest.ts +59 -0
- package/src/plugins/help/test/ts/browser/PluginTest.ts +28 -0
- package/src/plugins/help/test/ts/module/PluginAssert.ts +11 -0
- package/src/plugins/help/test/ts/module/Selectors.ts +10 -0
- package/src/plugins/help/test/ts/module/test/FakePlugin.ts +17 -0
- package/src/plugins/help/test/ts/module/test/NoMetaFakePlugin.ts +7 -0
- package/src/plugins/image/demo/html/demo.html +18 -0
- package/src/plugins/image/demo/ts/demo/Demo.ts +34 -0
- package/src/plugins/image/main/ts/Main.ts +9 -0
- package/src/plugins/image/main/ts/Plugin.ts +15 -0
- package/src/plugins/image/main/ts/api/Commands.ts +19 -0
- package/src/plugins/image/main/ts/api/Options.ts +100 -0
- package/src/plugins/image/main/ts/core/FilterContent.ts +38 -0
- package/src/plugins/image/main/ts/core/ImageData.ts +308 -0
- package/src/plugins/image/main/ts/core/ImageSelection.ts +142 -0
- package/src/plugins/image/main/ts/core/ListUtils.ts +68 -0
- package/src/plugins/image/main/ts/core/Utils.ts +179 -0
- package/src/plugins/image/main/ts/ui/AdvTab.ts +56 -0
- package/src/plugins/image/main/ts/ui/Buttons.ts +56 -0
- package/src/plugins/image/main/ts/ui/Dialog.ts +405 -0
- package/src/plugins/image/main/ts/ui/DialogInfo.ts +62 -0
- package/src/plugins/image/main/ts/ui/DialogTypes.ts +75 -0
- package/src/plugins/image/main/ts/ui/MainTab.ts +99 -0
- package/src/plugins/image/main/ts/ui/UploadTab.ts +21 -0
- package/src/plugins/image/test/ts/browser/A11yImageTest.ts +156 -0
- package/src/plugins/image/test/ts/browser/ContextMenuTest.ts +93 -0
- package/src/plugins/image/test/ts/browser/DecorativeImageDialogTest.ts +95 -0
- package/src/plugins/image/test/ts/browser/DialogTest.ts +139 -0
- package/src/plugins/image/test/ts/browser/DialogUpdateTest.ts +67 -0
- package/src/plugins/image/test/ts/browser/FigureDeleteTest.ts +39 -0
- package/src/plugins/image/test/ts/browser/FigureResizeTest.ts +66 -0
- package/src/plugins/image/test/ts/browser/ImageListTest.ts +29 -0
- package/src/plugins/image/test/ts/browser/ImagePluginTest.ts +217 -0
- package/src/plugins/image/test/ts/browser/ImageResizeTest.ts +34 -0
- package/src/plugins/image/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/image/test/ts/browser/UploadTabTest.ts +205 -0
- package/src/plugins/image/test/ts/browser/api/CommandsTest.ts +157 -0
- package/src/plugins/image/test/ts/browser/core/ImageAlignTest.ts +207 -0
- package/src/plugins/image/test/ts/browser/core/ImageDataTest.ts +688 -0
- package/src/plugins/image/test/ts/browser/core/ImageSelectionTest.ts +290 -0
- package/src/plugins/image/test/ts/browser/plugin/DefaultEmptyTest.ts +39 -0
- package/src/plugins/image/test/ts/browser/plugin/DimensionsFalseTest.ts +31 -0
- package/src/plugins/image/test/ts/browser/plugin/MainTabTest.ts +98 -0
- package/src/plugins/image/test/ts/browser/plugin/PrependAbsoluteTest.ts +36 -0
- package/src/plugins/image/test/ts/browser/plugin/PrependRelativeTest.ts +36 -0
- package/src/plugins/image/test/ts/module/Helpers.ts +140 -0
- package/src/plugins/importcss/demo/css/rules.css +92 -0
- package/src/plugins/importcss/demo/html/demo.html +15 -0
- package/src/plugins/importcss/demo/ts/demo/Demo.ts +16 -0
- package/src/plugins/importcss/main/ts/Main.ts +9 -0
- package/src/plugins/importcss/main/ts/Plugin.ts +13 -0
- package/src/plugins/importcss/main/ts/api/Api.ts +22 -0
- package/src/plugins/importcss/main/ts/api/Options.ts +78 -0
- package/src/plugins/importcss/main/ts/core/ImportCss.ts +287 -0
- package/src/plugins/importcss/main/ts/core/SelectorModel.ts +59 -0
- package/src/plugins/importcss/test/css/advanced.css +7 -0
- package/src/plugins/importcss/test/css/basic.css +11 -0
- package/src/plugins/importcss/test/css/clashing.css +3 -0
- package/src/plugins/importcss/test/css/internal.css +18 -0
- package/src/plugins/importcss/test/css/other-adv.css +3 -0
- package/src/plugins/importcss/test/ts/browser/ImportCssGroupsPluginTest.ts +191 -0
- package/src/plugins/importcss/test/ts/browser/ImportCssPluginTest.ts +342 -0
- package/src/plugins/importcss/test/ts/module/MenuNavigationTestUtils.ts +58 -0
- package/src/plugins/insertdatetime/demo/html/demo.html +15 -0
- package/src/plugins/insertdatetime/demo/ts/demo/Demo.ts +16 -0
- package/src/plugins/insertdatetime/main/ts/Main.ts +9 -0
- package/src/plugins/insertdatetime/main/ts/Plugin.ts +13 -0
- package/src/plugins/insertdatetime/main/ts/api/Commands.ts +18 -0
- package/src/plugins/insertdatetime/main/ts/api/Options.ts +51 -0
- package/src/plugins/insertdatetime/main/ts/core/Actions.ts +76 -0
- package/src/plugins/insertdatetime/main/ts/ui/Buttons.ts +67 -0
- package/src/plugins/insertdatetime/test/ts/browser/InsertDatetimeSanityTest.ts +35 -0
- package/src/plugins/insertdatetime/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/link/demo/html/demo.html +21 -0
- package/src/plugins/link/demo/ts/demo/Demo.ts +33 -0
- package/src/plugins/link/main/ts/Main.ts +9 -0
- package/src/plugins/link/main/ts/Plugin.ts +20 -0
- package/src/plugins/link/main/ts/api/Commands.ts +24 -0
- package/src/plugins/link/main/ts/api/Options.ts +112 -0
- package/src/plugins/link/main/ts/api/Types.ts +6 -0
- package/src/plugins/link/main/ts/core/Actions.ts +114 -0
- package/src/plugins/link/main/ts/core/Keyboard.ts +11 -0
- package/src/plugins/link/main/ts/core/ListOptions.ts +57 -0
- package/src/plugins/link/main/ts/core/OpenUrl.ts +21 -0
- package/src/plugins/link/main/ts/core/Utils.ts +333 -0
- package/src/plugins/link/main/ts/ui/Controls.ts +172 -0
- package/src/plugins/link/main/ts/ui/Dialog.ts +165 -0
- package/src/plugins/link/main/ts/ui/DialogChanges.ts +105 -0
- package/src/plugins/link/main/ts/ui/DialogConfirms.ts +64 -0
- package/src/plugins/link/main/ts/ui/DialogInfo.ts +62 -0
- package/src/plugins/link/main/ts/ui/DialogTypes.ts +81 -0
- package/src/plugins/link/main/ts/ui/sections/AnchorListOptions.ts +21 -0
- package/src/plugins/link/main/ts/ui/sections/ClassListOptions.ts +22 -0
- package/src/plugins/link/main/ts/ui/sections/LinkListOptions.ts +45 -0
- package/src/plugins/link/main/ts/ui/sections/RelOptions.ts +24 -0
- package/src/plugins/link/main/ts/ui/sections/TargetOptions.ts +31 -0
- package/src/plugins/link/test/ts/atomic/DialogChangesTest.ts +132 -0
- package/src/plugins/link/test/ts/browser/AllowUnsafeLinkTargetTest.ts +80 -0
- package/src/plugins/link/test/ts/browser/AnchorFalseTest.ts +40 -0
- package/src/plugins/link/test/ts/browser/AssumeExternalTargetsTest.ts +108 -0
- package/src/plugins/link/test/ts/browser/ContextMenuTest.ts +58 -0
- package/src/plugins/link/test/ts/browser/ContextToolbarTest.ts +73 -0
- package/src/plugins/link/test/ts/browser/DefaultLinkProtocolTest.ts +73 -0
- package/src/plugins/link/test/ts/browser/DefaultLinkTargetTest.ts +81 -0
- package/src/plugins/link/test/ts/browser/DialogFlowTest.ts +136 -0
- package/src/plugins/link/test/ts/browser/DialogOpenTest.ts +143 -0
- package/src/plugins/link/test/ts/browser/DialogSectionsTest.ts +159 -0
- package/src/plugins/link/test/ts/browser/ImageFigureLinkTest.ts +50 -0
- package/src/plugins/link/test/ts/browser/LinkContextMenuTest.ts +50 -0
- package/src/plugins/link/test/ts/browser/LinkDialogOverrideTest.ts +69 -0
- package/src/plugins/link/test/ts/browser/LinkJustFirstFieldTest.ts +40 -0
- package/src/plugins/link/test/ts/browser/ListOptionsTest.ts +140 -0
- package/src/plugins/link/test/ts/browser/NoneditableRootTest.ts +67 -0
- package/src/plugins/link/test/ts/browser/PreventDefaultTest.ts +47 -0
- package/src/plugins/link/test/ts/browser/QuickLinkTest.ts +219 -0
- package/src/plugins/link/test/ts/browser/RemoveLinkTest.ts +70 -0
- package/src/plugins/link/test/ts/browser/SelectedImageFigureLinkTest.ts +44 -0
- package/src/plugins/link/test/ts/browser/SelectedImageLinkTest.ts +72 -0
- package/src/plugins/link/test/ts/browser/SelectedLinkTest.ts +83 -0
- package/src/plugins/link/test/ts/browser/SelectedTextLinkTest.ts +174 -0
- package/src/plugins/link/test/ts/browser/UpdateLinkTest.ts +108 -0
- package/src/plugins/link/test/ts/browser/UrlInputTest.ts +50 -0
- package/src/plugins/link/test/ts/browser/UrlProtocolTest.ts +99 -0
- package/src/plugins/link/test/ts/module/TestLinkUi.ts +137 -0
- package/src/plugins/lists/demo/html/demo.html +15 -0
- package/src/plugins/lists/demo/ts/demo/Demo.ts +13 -0
- package/src/plugins/lists/main/ts/Main.ts +9 -0
- package/src/plugins/lists/main/ts/Plugin.ts +28 -0
- package/src/plugins/lists/main/ts/actions/Indendation.ts +45 -0
- package/src/plugins/lists/main/ts/actions/ToggleList.ts +420 -0
- package/src/plugins/lists/main/ts/actions/Update.ts +27 -0
- package/src/plugins/lists/main/ts/api/Api.ts +17 -0
- package/src/plugins/lists/main/ts/api/Commands.ts +65 -0
- package/src/plugins/lists/main/ts/api/Events.ts +7 -0
- package/src/plugins/lists/main/ts/api/Options.ts +28 -0
- package/src/plugins/lists/main/ts/core/Bookmark.ts +126 -0
- package/src/plugins/lists/main/ts/core/Delete.ts +317 -0
- package/src/plugins/lists/main/ts/core/DlIndentation.ts +36 -0
- package/src/plugins/lists/main/ts/core/FilterContent.ts +46 -0
- package/src/plugins/lists/main/ts/core/Keyboard.ts +33 -0
- package/src/plugins/lists/main/ts/core/ListAction.ts +15 -0
- package/src/plugins/lists/main/ts/core/ListNumbering.ts +108 -0
- package/src/plugins/lists/main/ts/core/NodeType.ts +84 -0
- package/src/plugins/lists/main/ts/core/NormalizeLists.ts +44 -0
- package/src/plugins/lists/main/ts/core/RangeUtils.ts +51 -0
- package/src/plugins/lists/main/ts/core/Selection.ts +117 -0
- package/src/plugins/lists/main/ts/core/SplitList.ts +56 -0
- package/src/plugins/lists/main/ts/core/TextBlock.ts +52 -0
- package/src/plugins/lists/main/ts/core/Util.ts +47 -0
- package/src/plugins/lists/main/ts/listmodel/ComposeList.ts +130 -0
- package/src/plugins/lists/main/ts/listmodel/Entry.ts +84 -0
- package/src/plugins/lists/main/ts/listmodel/Indentation.ts +23 -0
- package/src/plugins/lists/main/ts/listmodel/ListsIndendation.ts +65 -0
- package/src/plugins/lists/main/ts/listmodel/NormalizeEntries.ts +46 -0
- package/src/plugins/lists/main/ts/listmodel/ParseLists.ts +97 -0
- package/src/plugins/lists/main/ts/listmodel/Util.ts +24 -0
- package/src/plugins/lists/main/ts/ui/Buttons.ts +42 -0
- package/src/plugins/lists/main/ts/ui/Dialog.ts +68 -0
- package/src/plugins/lists/main/ts/ui/MenuItems.ts +35 -0
- package/src/plugins/lists/test/ts/atomic/ListNumberingTest.ts +81 -0
- package/src/plugins/lists/test/ts/browser/ApplyDlTest.ts +136 -0
- package/src/plugins/lists/test/ts/browser/ApplyListOnCustomList.ts +46 -0
- package/src/plugins/lists/test/ts/browser/ApplyListOnParagraphWithStylesTest.ts +30 -0
- package/src/plugins/lists/test/ts/browser/ApplyTest.ts +949 -0
- package/src/plugins/lists/test/ts/browser/ApplyToDivTest.ts +46 -0
- package/src/plugins/lists/test/ts/browser/BackspaceDeleteFromBlockIntoLiTest.ts +147 -0
- package/src/plugins/lists/test/ts/browser/BackspaceDeleteInlineTest.ts +59 -0
- package/src/plugins/lists/test/ts/browser/BackspaceDeleteTest.ts +1003 -0
- package/src/plugins/lists/test/ts/browser/ChangeListStyleTest.ts +86 -0
- package/src/plugins/lists/test/ts/browser/ContentEditableFalseActionsTest.ts +171 -0
- package/src/plugins/lists/test/ts/browser/CutDeleteTest.ts +44 -0
- package/src/plugins/lists/test/ts/browser/FilterContentTest.ts +41 -0
- package/src/plugins/lists/test/ts/browser/IndentTest.ts +698 -0
- package/src/plugins/lists/test/ts/browser/InlineTest.ts +43 -0
- package/src/plugins/lists/test/ts/browser/ListModelTest.ts +78 -0
- package/src/plugins/lists/test/ts/browser/ListPropertiesTest.ts +254 -0
- package/src/plugins/lists/test/ts/browser/NoneditableRootTest.ts +209 -0
- package/src/plugins/lists/test/ts/browser/OutdentTest.ts +486 -0
- package/src/plugins/lists/test/ts/browser/RemoveForcedRootBlockAttrsTest.ts +43 -0
- package/src/plugins/lists/test/ts/browser/RemoveTest.ts +431 -0
- package/src/plugins/lists/test/ts/browser/RetainContentTest.ts +164 -0
- package/src/plugins/lists/test/ts/browser/StyleTest.ts +76 -0
- package/src/plugins/lists/test/ts/browser/TableInListTest.ts +62 -0
- package/src/plugins/lists/test/ts/browser/ToggleListInTableCell.ts +91 -0
- package/src/plugins/lists/test/ts/browser/ToggleListWithEmptyLiTest.ts +24 -0
- package/src/plugins/lists/test/ts/module/ArbList.ts +204 -0
- package/src/plugins/lists/test/ts/webdriver/ContentEditableFalseTest.ts +111 -0
- package/src/plugins/lists/test/ts/webdriver/ContextMenuTest.ts +30 -0
- package/src/plugins/lists/test/ts/webdriver/DeleteTest.ts +64 -0
- package/src/plugins/media/demo/html/demo.html +16 -0
- package/src/plugins/media/demo/ts/demo/Demo.ts +28 -0
- package/src/plugins/media/main/ts/Main.ts +9 -0
- package/src/plugins/media/main/ts/Plugin.ts +21 -0
- package/src/plugins/media/main/ts/api/Api.ts +21 -0
- package/src/plugins/media/main/ts/api/Commands.ts +15 -0
- package/src/plugins/media/main/ts/api/Options.ts +79 -0
- package/src/plugins/media/main/ts/core/DataToHtml.ts +129 -0
- package/src/plugins/media/main/ts/core/FilterContent.ts +105 -0
- package/src/plugins/media/main/ts/core/HtmlToData.ts +81 -0
- package/src/plugins/media/main/ts/core/Mime.ts +19 -0
- package/src/plugins/media/main/ts/core/Nodes.ts +196 -0
- package/src/plugins/media/main/ts/core/Parser.ts +9 -0
- package/src/plugins/media/main/ts/core/ResolveName.ts +15 -0
- package/src/plugins/media/main/ts/core/Sanitize.ts +16 -0
- package/src/plugins/media/main/ts/core/Selection.ts +43 -0
- package/src/plugins/media/main/ts/core/Service.ts +59 -0
- package/src/plugins/media/main/ts/core/Types.ts +36 -0
- package/src/plugins/media/main/ts/core/UpdateHtml.ts +126 -0
- package/src/plugins/media/main/ts/core/UrlPatterns.ts +112 -0
- package/src/plugins/media/main/ts/ui/Buttons.ts +48 -0
- package/src/plugins/media/main/ts/ui/Dialog.ts +343 -0
- package/src/plugins/media/test/ts/atomic/HtmlToDataTest.ts +96 -0
- package/src/plugins/media/test/ts/atomic/UpdateHtmlTest.ts +38 -0
- package/src/plugins/media/test/ts/atomic/UrlPatternsTest.ts +66 -0
- package/src/plugins/media/test/ts/browser/ContentFormatsTest.ts +187 -0
- package/src/plugins/media/test/ts/browser/DataAttributeTest.ts +58 -0
- package/src/plugins/media/test/ts/browser/DataToHtmlTest.ts +157 -0
- package/src/plugins/media/test/ts/browser/DataUnwrapTest.ts +61 -0
- package/src/plugins/media/test/ts/browser/DimensionsFalseEmbedTest.ts +74 -0
- package/src/plugins/media/test/ts/browser/EphoxEmbedTest.ts +108 -0
- package/src/plugins/media/test/ts/browser/IsCachedResponseTest.ts +46 -0
- package/src/plugins/media/test/ts/browser/LiveEmbedNodeTest.ts +153 -0
- package/src/plugins/media/test/ts/browser/MediaAlignmentTest.ts +89 -0
- package/src/plugins/media/test/ts/browser/MediaEmbedTest.ts +40 -0
- package/src/plugins/media/test/ts/browser/MediaPluginSanityTest.ts +104 -0
- package/src/plugins/media/test/ts/browser/NoAdvancedTabTest.ts +34 -0
- package/src/plugins/media/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/media/test/ts/browser/PlaceholderTest.ts +138 -0
- package/src/plugins/media/test/ts/browser/ReopenResizeTest.ts +52 -0
- package/src/plugins/media/test/ts/browser/ScriptContentTest.ts +22 -0
- package/src/plugins/media/test/ts/browser/SubmitTest.ts +173 -0
- package/src/plugins/media/test/ts/browser/UpdateMediaPosterAttributeTest.ts +52 -0
- package/src/plugins/media/test/ts/module/test/Utils.ts +212 -0
- package/src/plugins/nonbreaking/demo/html/demo.html +15 -0
- package/src/plugins/nonbreaking/demo/ts/demo/Demo.ts +14 -0
- package/src/plugins/nonbreaking/main/ts/Main.ts +9 -0
- package/src/plugins/nonbreaking/main/ts/Plugin.ts +22 -0
- package/src/plugins/nonbreaking/main/ts/api/Commands.ts +13 -0
- package/src/plugins/nonbreaking/main/ts/api/Options.ts +41 -0
- package/src/plugins/nonbreaking/main/ts/core/Actions.ts +29 -0
- package/src/plugins/nonbreaking/main/ts/core/Keyboard.ts +27 -0
- package/src/plugins/nonbreaking/main/ts/ui/Buttons.ts +37 -0
- package/src/plugins/nonbreaking/test/ts/browser/NonbreakingForceTabTest.ts +33 -0
- package/src/plugins/nonbreaking/test/ts/browser/NonbreakingOptionsTest.ts +32 -0
- package/src/plugins/nonbreaking/test/ts/browser/NonbreakingSanityTest.ts +37 -0
- package/src/plugins/nonbreaking/test/ts/browser/NonbreakingVisualCharsTest.ts +69 -0
- package/src/plugins/nonbreaking/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/nonbreaking/test/ts/webdriver/NonbreakingTypingTest.ts +117 -0
- package/src/plugins/nonbreaking/test/ts/webdriver/NonbreakingVisualCharsTypingTest.ts +215 -0
- package/src/plugins/nonbreaking/test/ts/webdriver/NonbreakingWrapTypingTest.ts +216 -0
- package/src/plugins/pagebreak/demo/html/demo.html +15 -0
- package/src/plugins/pagebreak/demo/ts/demo/Demo.ts +14 -0
- package/src/plugins/pagebreak/main/ts/Main.ts +9 -0
- package/src/plugins/pagebreak/main/ts/Plugin.ts +17 -0
- package/src/plugins/pagebreak/main/ts/api/Commands.ts +14 -0
- package/src/plugins/pagebreak/main/ts/api/Options.ts +31 -0
- package/src/plugins/pagebreak/main/ts/core/FilterContent.ts +56 -0
- package/src/plugins/pagebreak/main/ts/core/ResolveName.ts +15 -0
- package/src/plugins/pagebreak/main/ts/ui/Buttons.ts +37 -0
- package/src/plugins/pagebreak/test/ts/browser/NoneditableRootTest.ts +40 -0
- package/src/plugins/pagebreak/test/ts/browser/PageBreakSanityTest.ts +34 -0
- package/src/plugins/pagebreak/test/ts/browser/PageBreakSplitBlockTest.ts +129 -0
- package/src/plugins/preview/demo/html/demo.html +34 -0
- package/src/plugins/preview/demo/ts/demo/Demo.ts +14 -0
- package/src/plugins/preview/main/ts/Main.ts +9 -0
- package/src/plugins/preview/main/ts/Plugin.ts +11 -0
- package/src/plugins/preview/main/ts/api/Commands.ts +13 -0
- package/src/plugins/preview/main/ts/api/Options.ts +20 -0
- package/src/plugins/preview/main/ts/core/IframeContent.ts +62 -0
- package/src/plugins/preview/main/ts/ui/Buttons.ts +21 -0
- package/src/plugins/preview/main/ts/ui/Dialog.ts +39 -0
- package/src/plugins/preview/test/ts/browser/PreviewContentCssTest.ts +33 -0
- package/src/plugins/preview/test/ts/browser/PreviewContentStyleTest.ts +47 -0
- package/src/plugins/preview/test/ts/browser/PreviewSanityTest.ts +40 -0
- package/src/plugins/quickbars/demo/html/demo.html +68 -0
- package/src/plugins/quickbars/demo/ts/demo/Demo.ts +56 -0
- package/src/plugins/quickbars/main/ts/Main.ts +9 -0
- package/src/plugins/quickbars/main/ts/Plugin.ts +16 -0
- package/src/plugins/quickbars/main/ts/api/Options.ts +56 -0
- package/src/plugins/quickbars/main/ts/insert/Actions.ts +20 -0
- package/src/plugins/quickbars/main/ts/insert/Buttons.ts +35 -0
- package/src/plugins/quickbars/main/ts/insert/Conversions.ts +15 -0
- package/src/plugins/quickbars/main/ts/insert/Picker.ts +56 -0
- package/src/plugins/quickbars/main/ts/insert/Toolbars.ts +34 -0
- package/src/plugins/quickbars/main/ts/selection/Bookmark.ts +122 -0
- package/src/plugins/quickbars/main/ts/selection/Toolbars.ts +39 -0
- package/src/plugins/quickbars/test/ts/browser/ContentEditableTest.ts +122 -0
- package/src/plugins/quickbars/test/ts/browser/InsertToolbarPredicateTest.ts +70 -0
- package/src/plugins/quickbars/test/ts/browser/KeyboardShortcutContextToolbarTest.ts +30 -0
- package/src/plugins/quickbars/test/ts/browser/OptionsTest.ts +84 -0
- package/src/plugins/quickbars/test/ts/browser/SelectionToolbarTest.ts +106 -0
- package/src/plugins/quickbars/test/ts/browser/ToolbarFalseTest.ts +45 -0
- package/src/plugins/quickbars/test/ts/browser/ToolbarPositionTest.ts +384 -0
- package/src/plugins/quickbars/test/ts/module/test/Utils.ts +15 -0
- package/src/plugins/save/demo/html/demo.html +18 -0
- package/src/plugins/save/demo/ts/demo/Demo.ts +15 -0
- package/src/plugins/save/main/ts/Main.ts +9 -0
- package/src/plugins/save/main/ts/Plugin.ts +13 -0
- package/src/plugins/save/main/ts/api/Commands.ts +17 -0
- package/src/plugins/save/main/ts/api/Options.ts +36 -0
- package/src/plugins/save/main/ts/core/Actions.ts +69 -0
- package/src/plugins/save/main/ts/ui/Buttons.ts +39 -0
- package/src/plugins/save/test/ts/browser/SaveSanityTest.ts +29 -0
- package/src/plugins/searchreplace/demo/html/demo.html +21 -0
- package/src/plugins/searchreplace/demo/ts/demo/Demo.ts +16 -0
- package/src/plugins/searchreplace/main/ts/Main.ts +9 -0
- package/src/plugins/searchreplace/main/ts/Plugin.ts +26 -0
- package/src/plugins/searchreplace/main/ts/api/Api.ts +47 -0
- package/src/plugins/searchreplace/main/ts/api/Commands.ts +16 -0
- package/src/plugins/searchreplace/main/ts/core/Actions.ts +280 -0
- package/src/plugins/searchreplace/main/ts/core/FindMark.ts +67 -0
- package/src/plugins/searchreplace/main/ts/core/TextCollect.ts +190 -0
- package/src/plugins/searchreplace/main/ts/core/TextPosition.ts +69 -0
- package/src/plugins/searchreplace/main/ts/core/Types.ts +21 -0
- package/src/plugins/searchreplace/main/ts/ui/Buttons.ts +32 -0
- package/src/plugins/searchreplace/main/ts/ui/Dialog.ts +263 -0
- package/src/plugins/searchreplace/test/ts/browser/SearchReplaceDialogCyclingTest.ts +109 -0
- package/src/plugins/searchreplace/test/ts/browser/SearchReplaceDialogTest.ts +144 -0
- package/src/plugins/searchreplace/test/ts/browser/SearchReplaceInSelectionTest.ts +240 -0
- package/src/plugins/searchreplace/test/ts/browser/SearchReplaceKeyboardNavigationTest.ts +100 -0
- package/src/plugins/searchreplace/test/ts/browser/SearchReplacePluginTest.ts +212 -0
- package/src/plugins/searchreplace/test/ts/browser/SearchReplacePrevNextTest.ts +64 -0
- package/src/plugins/searchreplace/test/ts/browser/UndoReplaceSpanTest.ts +35 -0
- package/src/plugins/searchreplace/test/ts/module/test/Utils.ts +77 -0
- package/src/plugins/table/demo/html/demo.html +123 -0
- package/src/plugins/table/demo/ts/demo/Demo.ts +43 -0
- package/src/plugins/table/main/ts/Main.ts +9 -0
- package/src/plugins/table/main/ts/Plugin.ts +23 -0
- package/src/plugins/table/main/ts/actions/Styles.ts +54 -0
- package/src/plugins/table/main/ts/api/Clipboard.ts +67 -0
- package/src/plugins/table/main/ts/api/Commands.ts +27 -0
- package/src/plugins/table/main/ts/api/Events.ts +34 -0
- package/src/plugins/table/main/ts/api/Options.ts +183 -0
- package/src/plugins/table/main/ts/core/Utils.ts +45 -0
- package/src/plugins/table/main/ts/queries/TableTargets.ts +33 -0
- package/src/plugins/table/main/ts/selection/Ephemera.ts +28 -0
- package/src/plugins/table/main/ts/selection/SelectionTargets.ts +194 -0
- package/src/plugins/table/main/ts/selection/TableSelection.ts +54 -0
- package/src/plugins/table/main/ts/ui/Buttons.ts +334 -0
- package/src/plugins/table/main/ts/ui/CellAlignValues.ts +22 -0
- package/src/plugins/table/main/ts/ui/CellDialog.ts +204 -0
- package/src/plugins/table/main/ts/ui/CellDialogGeneralTab.ts +70 -0
- package/src/plugins/table/main/ts/ui/DialogAdvancedTab.ts +46 -0
- package/src/plugins/table/main/ts/ui/DomModifier.ts +40 -0
- package/src/plugins/table/main/ts/ui/Helpers.ts +243 -0
- package/src/plugins/table/main/ts/ui/MenuItems.ts +374 -0
- package/src/plugins/table/main/ts/ui/RowDialog.ts +168 -0
- package/src/plugins/table/main/ts/ui/RowDialogGeneralTab.ts +52 -0
- package/src/plugins/table/main/ts/ui/TableDialog.ts +255 -0
- package/src/plugins/table/main/ts/ui/TableDialogGeneralTab.ts +92 -0
- package/src/plugins/table/main/ts/ui/UiUtils.ts +165 -0
- package/src/plugins/table/test/ts/atomic/UtilsTest.ts +30 -0
- package/src/plugins/table/test/ts/browser/AlignedCellRowStyleChangeTest.ts +71 -0
- package/src/plugins/table/test/ts/browser/ClipboardTest.ts +794 -0
- package/src/plugins/table/test/ts/browser/HelpersTest.ts +288 -0
- package/src/plugins/table/test/ts/browser/IndentListsInTableTest.ts +46 -0
- package/src/plugins/table/test/ts/browser/InlineEditorInsideTableTest.ts +119 -0
- package/src/plugins/table/test/ts/browser/NoneditableRootTest.ts +201 -0
- package/src/plugins/table/test/ts/browser/TableCellPropsStyleTest.ts +34 -0
- package/src/plugins/table/test/ts/browser/TableRemoveTrailingBrTest.ts +128 -0
- package/src/plugins/table/test/ts/browser/settings/CustomTableToolbarTest.ts +26 -0
- package/src/plugins/table/test/ts/browser/settings/DefaultTableToolbarTest.ts +25 -0
- package/src/plugins/table/test/ts/browser/settings/TableAppearanceOptionsTest.ts +57 -0
- package/src/plugins/table/test/ts/browser/settings/TableCellClassListTest.ts +125 -0
- package/src/plugins/table/test/ts/browser/settings/TableClassListTest.ts +96 -0
- package/src/plugins/table/test/ts/browser/settings/TableDefaultAttributesTest.ts +54 -0
- package/src/plugins/table/test/ts/browser/settings/TableDefaultAttributesWithColGroupsTest.ts +54 -0
- package/src/plugins/table/test/ts/browser/settings/TableDefaultStylesTest.ts +139 -0
- package/src/plugins/table/test/ts/browser/settings/TableGridFalseTest.ts +32 -0
- package/src/plugins/table/test/ts/browser/settings/TableRowClassListTest.ts +125 -0
- package/src/plugins/table/test/ts/browser/settings/TableToolbarTest.ts +51 -0
- package/src/plugins/table/test/ts/browser/settings/ToolbarButtonDisplayTest.ts +44 -0
- package/src/plugins/table/test/ts/browser/ui/ContextMenuTest.ts +210 -0
- package/src/plugins/table/test/ts/browser/ui/ContextToolbarTest.ts +153 -0
- package/src/plugins/table/test/ts/browser/ui/LockedColumnDisabledButtonsTest.ts +236 -0
- package/src/plugins/table/test/ts/browser/ui/TableBorderStyleTest.ts +72 -0
- package/src/plugins/table/test/ts/browser/ui/TableBorderWidthTest.ts +54 -0
- package/src/plugins/table/test/ts/browser/ui/TableCaptionTest.ts +199 -0
- package/src/plugins/table/test/ts/browser/ui/TableCellBackgroundColorTest.ts +48 -0
- package/src/plugins/table/test/ts/browser/ui/TableCellBorderColorTest.ts +50 -0
- package/src/plugins/table/test/ts/browser/ui/TableCellDialogTest.ts +533 -0
- package/src/plugins/table/test/ts/browser/ui/TableClassListButtonsTest.ts +116 -0
- package/src/plugins/table/test/ts/browser/ui/TableColumnHeaderUiTest.ts +89 -0
- package/src/plugins/table/test/ts/browser/ui/TableDialogKeyboardNavTest.ts +88 -0
- package/src/plugins/table/test/ts/browser/ui/TableDialogStyleWithCssTest.ts +263 -0
- package/src/plugins/table/test/ts/browser/ui/TableDialogTest.ts +632 -0
- package/src/plugins/table/test/ts/browser/ui/TableDialogWithoutCssTest.ts +85 -0
- package/src/plugins/table/test/ts/browser/ui/TableRowDialogTest.ts +667 -0
- package/src/plugins/table/test/ts/browser/ui/TableRowHeaderUiTest.ts +105 -0
- package/src/plugins/table/test/ts/browser/ui/TableValignButtonsTest.ts +96 -0
- package/src/plugins/table/test/ts/module/test/TableModifiersTestUtils.ts +242 -0
- package/src/plugins/table/test/ts/module/test/TableTestUtils.ts +273 -0
- package/src/plugins/visualblocks/demo/html/demo.html +32 -0
- package/src/plugins/visualblocks/demo/ts/demo/Demo.ts +33 -0
- package/src/plugins/visualblocks/main/img/address.gif +0 -0
- package/src/plugins/visualblocks/main/img/article.gif +0 -0
- package/src/plugins/visualblocks/main/img/aside.gif +0 -0
- package/src/plugins/visualblocks/main/img/blockquote.gif +0 -0
- package/src/plugins/visualblocks/main/img/div.gif +0 -0
- package/src/plugins/visualblocks/main/img/dl.gif +0 -0
- package/src/plugins/visualblocks/main/img/figure.gif +0 -0
- package/src/plugins/visualblocks/main/img/h1.gif +0 -0
- package/src/plugins/visualblocks/main/img/h2.gif +0 -0
- package/src/plugins/visualblocks/main/img/h3.gif +0 -0
- package/src/plugins/visualblocks/main/img/h4.gif +0 -0
- package/src/plugins/visualblocks/main/img/h5.gif +0 -0
- package/src/plugins/visualblocks/main/img/h6.gif +0 -0
- package/src/plugins/visualblocks/main/img/hgroup.gif +0 -0
- package/src/plugins/visualblocks/main/img/ol.gif +0 -0
- package/src/plugins/visualblocks/main/img/p.gif +0 -0
- package/src/plugins/visualblocks/main/img/pre.gif +0 -0
- package/src/plugins/visualblocks/main/img/section.gif +0 -0
- package/src/plugins/visualblocks/main/img/ul.gif +0 -0
- package/src/plugins/visualblocks/main/ts/Main.ts +9 -0
- package/src/plugins/visualblocks/main/ts/Plugin.ts +19 -0
- package/src/plugins/visualblocks/main/ts/api/Commands.ts +15 -0
- package/src/plugins/visualblocks/main/ts/api/Events.ts +9 -0
- package/src/plugins/visualblocks/main/ts/api/Options.ts +24 -0
- package/src/plugins/visualblocks/main/ts/core/Bindings.ts +25 -0
- package/src/plugins/visualblocks/main/ts/core/VisualBlocks.ts +18 -0
- package/src/plugins/visualblocks/main/ts/ui/Buttons.ts +34 -0
- package/src/plugins/visualblocks/test/ts/browser/PreviewFormatTest.ts +57 -0
- package/src/plugins/visualblocks/test/ts/browser/VisualBlocksSanityTest.ts +41 -0
- package/src/plugins/visualchars/demo/html/demo.html +15 -0
- package/src/plugins/visualchars/demo/ts/demo/Demo.ts +14 -0
- package/src/plugins/visualchars/main/ts/Main.ts +9 -0
- package/src/plugins/visualchars/main/ts/Plugin.ts +24 -0
- package/src/plugins/visualchars/main/ts/api/Api.ts +19 -0
- package/src/plugins/visualchars/main/ts/api/Commands.ts +15 -0
- package/src/plugins/visualchars/main/ts/api/Events.ts +10 -0
- package/src/plugins/visualchars/main/ts/api/Options.ts +24 -0
- package/src/plugins/visualchars/main/ts/core/Actions.ts +31 -0
- package/src/plugins/visualchars/main/ts/core/Bindings.ts +26 -0
- package/src/plugins/visualchars/main/ts/core/Data.ts +35 -0
- package/src/plugins/visualchars/main/ts/core/Html.ts +8 -0
- package/src/plugins/visualchars/main/ts/core/Keyboard.ts +23 -0
- package/src/plugins/visualchars/main/ts/core/Nodes.ts +68 -0
- package/src/plugins/visualchars/main/ts/core/VisualChars.ts +61 -0
- package/src/plugins/visualchars/main/ts/ui/Buttons.ts +34 -0
- package/src/plugins/visualchars/test/ts/atomic/DataTest.ts +22 -0
- package/src/plugins/visualchars/test/ts/atomic/HtmlTest.ts +23 -0
- package/src/plugins/visualchars/test/ts/browser/DefaultStateTest.ts +30 -0
- package/src/plugins/visualchars/test/ts/browser/InlinePluginTest.ts +33 -0
- package/src/plugins/visualchars/test/ts/browser/NodesTest.ts +121 -0
- package/src/plugins/visualchars/test/ts/browser/PluginTest.ts +121 -0
- package/src/plugins/visualchars/test/ts/module/test/Utils.ts +42 -0
- package/src/plugins/wordcount/demo/html/demo.html +18 -0
- package/src/plugins/wordcount/demo/ts/demo/Demo.ts +12 -0
- package/src/plugins/wordcount/main/ts/Main.ts +9 -0
- package/src/plugins/wordcount/main/ts/Plugin.ts +17 -0
- package/src/plugins/wordcount/main/ts/api/Api.ts +44 -0
- package/src/plugins/wordcount/main/ts/api/Commands.ts +12 -0
- package/src/plugins/wordcount/main/ts/api/Events.ts +17 -0
- package/src/plugins/wordcount/main/ts/core/Count.ts +38 -0
- package/src/plugins/wordcount/main/ts/core/GetText.ts +35 -0
- package/src/plugins/wordcount/main/ts/core/WordCounter.ts +28 -0
- package/src/plugins/wordcount/main/ts/ui/Buttons.ts +21 -0
- package/src/plugins/wordcount/main/ts/ui/Dialog.ts +47 -0
- package/src/plugins/wordcount/test/ts/browser/PluginTest.ts +228 -0
- package/src/plugins/wordcount/test/ts/browser/api/ApiTest.ts +88 -0
- package/src/plugins/wordcount/test/ts/browser/core/GetTextTest.ts +33 -0
- package/src/themes/silver/demo/html/demo/demo-with-scrolling.html +347 -0
- package/src/themes/silver/demo/html/demo/demo.html +125 -0
- package/src/themes/silver/demo/html/demo/format-select-demo.html +61 -0
- package/src/themes/silver/demo/html/demo/menu-item-demo.html +96 -0
- package/src/themes/silver/demo/html/demo/sidebar-demo.html +97 -0
- package/src/themes/silver/demo/html/demo/toolbar-button-demo.html +97 -0
- package/src/themes/silver/demo/html/demo/tree-demo.html +21 -0
- package/src/themes/silver/demo/ts/demo/ButtonSetupDemo.ts +247 -0
- package/src/themes/silver/demo/ts/demo/Demos.ts +19 -0
- package/src/themes/silver/demo/ts/demo/FormatSelectDemo.ts +70 -0
- package/src/themes/silver/demo/ts/demo/MenuItemDemo.ts +135 -0
- package/src/themes/silver/demo/ts/demo/MockDemo.ts +34 -0
- package/src/themes/silver/demo/ts/demo/PlayDemo.ts +142 -0
- package/src/themes/silver/demo/ts/demo/SidebarDemo.ts +49 -0
- package/src/themes/silver/demo/ts/demo/ToolbarButtonDemo.ts +97 -0
- package/src/themes/silver/demo/ts/demo/TreeDemo.ts +177 -0
- package/src/themes/silver/main/resources/StatusbarLogo.d.ts +1 -0
- package/src/themes/silver/main/resources/StatusbarLogo.js +3 -0
- package/src/themes/silver/main/resources/statusbar-logo.svg +3 -0
- package/src/themes/silver/main/ts/Autocompleter.ts +215 -0
- package/src/themes/silver/main/ts/Channels.ts +7 -0
- package/src/themes/silver/main/ts/Events.ts +153 -0
- package/src/themes/silver/main/ts/Main.ts +9 -0
- package/src/themes/silver/main/ts/ReadOnly.ts +67 -0
- package/src/themes/silver/main/ts/Render.ts +571 -0
- package/src/themes/silver/main/ts/Theme.ts +88 -0
- package/src/themes/silver/main/ts/alien/NotificationManagerImpl.ts +143 -0
- package/src/themes/silver/main/ts/api/Events.ts +82 -0
- package/src/themes/silver/main/ts/api/Options.ts +490 -0
- package/src/themes/silver/main/ts/autocomplete/AutocompleteEditorEvents.ts +78 -0
- package/src/themes/silver/main/ts/backstage/Anchors.ts +184 -0
- package/src/themes/silver/main/ts/backstage/Backstage.ts +109 -0
- package/src/themes/silver/main/ts/backstage/ColorInputBackstage.ts +31 -0
- package/src/themes/silver/main/ts/backstage/DialogBackstage.ts +13 -0
- package/src/themes/silver/main/ts/backstage/HeaderBackstage.ts +21 -0
- package/src/themes/silver/main/ts/backstage/StyleFormatsBackstage.ts +53 -0
- package/src/themes/silver/main/ts/backstage/TooltipsBackstage.ts +62 -0
- package/src/themes/silver/main/ts/backstage/UrlInputBackstage.ts +106 -0
- package/src/themes/silver/main/ts/backstage/UrlInputHistory.ts +72 -0
- package/src/themes/silver/main/ts/modes/Iframe.ts +210 -0
- package/src/themes/silver/main/ts/modes/Inline.ts +219 -0
- package/src/themes/silver/main/ts/modes/ScrollingContext.ts +70 -0
- package/src/themes/silver/main/ts/modes/Toolbars.ts +32 -0
- package/src/themes/silver/main/ts/modes/UiReferences.ts +70 -0
- package/src/themes/silver/main/ts/ui/alien/ComposingConfigs.ts +25 -0
- package/src/themes/silver/main/ts/ui/alien/ConvertShortcut.ts +36 -0
- package/src/themes/silver/main/ts/ui/alien/DialogTabHeight.ts +171 -0
- package/src/themes/silver/main/ts/ui/alien/DisablingConfigs.ts +30 -0
- package/src/themes/silver/main/ts/ui/alien/FieldLabeller.ts +56 -0
- package/src/themes/silver/main/ts/ui/alien/FlatgridAutodetect.ts +28 -0
- package/src/themes/silver/main/ts/ui/alien/RepresentingConfigs.ts +75 -0
- package/src/themes/silver/main/ts/ui/alien/SimpleBehaviours.ts +17 -0
- package/src/themes/silver/main/ts/ui/alien/UiUtils.ts +8 -0
- package/src/themes/silver/main/ts/ui/button/ButtonSlices.ts +37 -0
- package/src/themes/silver/main/ts/ui/button/MenuButton.ts +144 -0
- package/src/themes/silver/main/ts/ui/context/ContextEditorEvents.ts +10 -0
- package/src/themes/silver/main/ts/ui/context/ContextForm.ts +73 -0
- package/src/themes/silver/main/ts/ui/context/ContextFormButtons.ts +98 -0
- package/src/themes/silver/main/ts/ui/context/ContextToolbar.ts +315 -0
- package/src/themes/silver/main/ts/ui/context/ContextToolbarAnchor.ts +146 -0
- package/src/themes/silver/main/ts/ui/context/ContextToolbarBounds.ts +132 -0
- package/src/themes/silver/main/ts/ui/context/ContextToolbarLookup.ts +134 -0
- package/src/themes/silver/main/ts/ui/context/ContextToolbarScopes.ts +81 -0
- package/src/themes/silver/main/ts/ui/context/ContextUi.ts +128 -0
- package/src/themes/silver/main/ts/ui/controls/Controls.ts +40 -0
- package/src/themes/silver/main/ts/ui/core/AlignmentButtons.ts +34 -0
- package/src/themes/silver/main/ts/ui/core/ChoiceControls.ts +137 -0
- package/src/themes/silver/main/ts/ui/core/ComplexControls.ts +20 -0
- package/src/themes/silver/main/ts/ui/core/ControlUtils.ts +80 -0
- package/src/themes/silver/main/ts/ui/core/FormatControls.ts +28 -0
- package/src/themes/silver/main/ts/ui/core/HtmlSanitizer.ts +3 -0
- package/src/themes/silver/main/ts/ui/core/IndentOutdent.ts +33 -0
- package/src/themes/silver/main/ts/ui/core/LinkTargets.ts +144 -0
- package/src/themes/silver/main/ts/ui/core/PasteControls.ts +47 -0
- package/src/themes/silver/main/ts/ui/core/SimpleControls.ts +144 -0
- package/src/themes/silver/main/ts/ui/core/UndoRedo.ts +58 -0
- package/src/themes/silver/main/ts/ui/core/VisualAid.ts +34 -0
- package/src/themes/silver/main/ts/ui/core/color/ColorCache.ts +90 -0
- package/src/themes/silver/main/ts/ui/core/color/ColorSwatch.ts +303 -0
- package/src/themes/silver/main/ts/ui/core/color/Options.ts +175 -0
- package/src/themes/silver/main/ts/ui/core/complex/AlignBespoke.ts +74 -0
- package/src/themes/silver/main/ts/ui/core/complex/BespokeNumberInput.ts +239 -0
- package/src/themes/silver/main/ts/ui/core/complex/BespokeSelect.ts +245 -0
- package/src/themes/silver/main/ts/ui/core/complex/BlocksBespoke.ts +74 -0
- package/src/themes/silver/main/ts/ui/core/complex/FontFamilyBespoke.ts +125 -0
- package/src/themes/silver/main/ts/ui/core/complex/FontSizeBespoke.ts +195 -0
- package/src/themes/silver/main/ts/ui/core/complex/SelectDatasets.ts +67 -0
- package/src/themes/silver/main/ts/ui/core/complex/StyleFormat.ts +131 -0
- package/src/themes/silver/main/ts/ui/core/complex/StylesBespoke.ts +83 -0
- package/src/themes/silver/main/ts/ui/core/complex/utils/FormatDetection.ts +14 -0
- package/src/themes/silver/main/ts/ui/core/complex/utils/FormatRegister.ts +73 -0
- package/src/themes/silver/main/ts/ui/core/complex/utils/Tooltip.ts +8 -0
- package/src/themes/silver/main/ts/ui/dialog/AlertDialog.ts +65 -0
- package/src/themes/silver/main/ts/ui/dialog/Bar.ts +15 -0
- package/src/themes/silver/main/ts/ui/dialog/BodyPanel.ts +74 -0
- package/src/themes/silver/main/ts/ui/dialog/Collection.ts +195 -0
- package/src/themes/silver/main/ts/ui/dialog/ColorInput.ts +183 -0
- package/src/themes/silver/main/ts/ui/dialog/ColorPicker.ts +107 -0
- package/src/themes/silver/main/ts/ui/dialog/ConfirmDialog.ts +77 -0
- package/src/themes/silver/main/ts/ui/dialog/CustomEditor.ts +79 -0
- package/src/themes/silver/main/ts/ui/dialog/Dialogs.ts +207 -0
- package/src/themes/silver/main/ts/ui/dialog/Dropzone.ts +154 -0
- package/src/themes/silver/main/ts/ui/dialog/Grid.ts +15 -0
- package/src/themes/silver/main/ts/ui/dialog/IFrame.ts +188 -0
- package/src/themes/silver/main/ts/ui/dialog/ImagePreview.ts +156 -0
- package/src/themes/silver/main/ts/ui/dialog/Label.ts +45 -0
- package/src/themes/silver/main/ts/ui/dialog/ListBox.ts +139 -0
- package/src/themes/silver/main/ts/ui/dialog/Panel.ts +21 -0
- package/src/themes/silver/main/ts/ui/dialog/SelectBox.ts +78 -0
- package/src/themes/silver/main/ts/ui/dialog/SizeInput.ts +169 -0
- package/src/themes/silver/main/ts/ui/dialog/Slider.ts +69 -0
- package/src/themes/silver/main/ts/ui/dialog/TabPanel.ts +168 -0
- package/src/themes/silver/main/ts/ui/dialog/Table.ts +46 -0
- package/src/themes/silver/main/ts/ui/dialog/TextField.ts +161 -0
- package/src/themes/silver/main/ts/ui/dialog/Tree.ts +405 -0
- package/src/themes/silver/main/ts/ui/dialog/UrlInput.ts +296 -0
- package/src/themes/silver/main/ts/ui/dialog/WindowManager.ts +393 -0
- package/src/themes/silver/main/ts/ui/dropdown/CommonDropdown.ts +275 -0
- package/src/themes/silver/main/ts/ui/general/AlertBanner.ts +62 -0
- package/src/themes/silver/main/ts/ui/general/Button.ts +309 -0
- package/src/themes/silver/main/ts/ui/general/Checkbox.ts +110 -0
- package/src/themes/silver/main/ts/ui/general/FormEvents.ts +63 -0
- package/src/themes/silver/main/ts/ui/general/FormValues.ts +21 -0
- package/src/themes/silver/main/ts/ui/general/HtmlPanel.ts +62 -0
- package/src/themes/silver/main/ts/ui/general/NavigableObject.ts +76 -0
- package/src/themes/silver/main/ts/ui/general/Notification.ts +222 -0
- package/src/themes/silver/main/ts/ui/general/OuterContainer.ts +463 -0
- package/src/themes/silver/main/ts/ui/general/PanelButton.ts +67 -0
- package/src/themes/silver/main/ts/ui/general/UiFactory.ts +110 -0
- package/src/themes/silver/main/ts/ui/header/CommonHeader.ts +26 -0
- package/src/themes/silver/main/ts/ui/header/InlineHeader.ts +379 -0
- package/src/themes/silver/main/ts/ui/header/StaticHeader.ts +11 -0
- package/src/themes/silver/main/ts/ui/header/StickyHeader.ts +311 -0
- package/src/themes/silver/main/ts/ui/icons/Icons.ts +110 -0
- package/src/themes/silver/main/ts/ui/menus/contextmenu/Coords.ts +85 -0
- package/src/themes/silver/main/ts/ui/menus/contextmenu/Options.ts +66 -0
- package/src/themes/silver/main/ts/ui/menus/contextmenu/SilverContextMenu.ts +192 -0
- package/src/themes/silver/main/ts/ui/menus/contextmenu/platform/DesktopContextMenu.ts +44 -0
- package/src/themes/silver/main/ts/ui/menus/contextmenu/platform/MobileContextMenu.ts +169 -0
- package/src/themes/silver/main/ts/ui/menus/item/ItemClasses.ts +57 -0
- package/src/themes/silver/main/ts/ui/menus/item/ItemEvents.ts +29 -0
- package/src/themes/silver/main/ts/ui/menus/item/ItemResponse.ts +6 -0
- package/src/themes/silver/main/ts/ui/menus/item/MenuItems.ts +28 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/AutocompleteMenuItem.ts +111 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/CardMenuItem.ts +84 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/ChoiceItem.ts +82 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/ColorSwatchItem.ts +57 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/CommonMenuItem.ts +99 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/FancyMenuItem.ts +19 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/InsertTableMenuItem.ts +142 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/NestedMenuItem.ts +51 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/NormalMenuItem.ts +40 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/SeparatorItem.ts +17 -0
- package/src/themes/silver/main/ts/ui/menus/item/build/ToggleMenuItem.ts +62 -0
- package/src/themes/silver/main/ts/ui/menus/item/structure/ItemSlices.ts +121 -0
- package/src/themes/silver/main/ts/ui/menus/item/structure/ItemStructure.ts +149 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuChoice.ts +61 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuClasses.ts +31 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuConversion.ts +131 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuMovement.ts +63 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuParts.ts +56 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuStructures.ts +235 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuUtils.ts +104 -0
- package/src/themes/silver/main/ts/ui/menus/menu/MenuWidgets.ts +55 -0
- package/src/themes/silver/main/ts/ui/menus/menu/NestedMenus.ts +82 -0
- package/src/themes/silver/main/ts/ui/menus/menu/SingleMenu.ts +228 -0
- package/src/themes/silver/main/ts/ui/menus/menu/SingleMenuTypes.ts +4 -0
- package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenu.ts +164 -0
- package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenuEvents.ts +32 -0
- package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenuField.ts +181 -0
- package/src/themes/silver/main/ts/ui/menus/menu/searchable/SearchableMenus.ts +23 -0
- package/src/themes/silver/main/ts/ui/menus/menubar/Integration.ts +86 -0
- package/src/themes/silver/main/ts/ui/menus/menubar/SilverMenubar.ts +152 -0
- package/src/themes/silver/main/ts/ui/promotion/Promotion.ts +29 -0
- package/src/themes/silver/main/ts/ui/selector/TableSelectorHandles.ts +230 -0
- package/src/themes/silver/main/ts/ui/sidebar/Sidebar.ts +251 -0
- package/src/themes/silver/main/ts/ui/sizeinput/SizeInputModel.ts +87 -0
- package/src/themes/silver/main/ts/ui/sizing/EditorSize.ts +32 -0
- package/src/themes/silver/main/ts/ui/sizing/Resize.ts +41 -0
- package/src/themes/silver/main/ts/ui/sizing/Utils.ts +24 -0
- package/src/themes/silver/main/ts/ui/skin/Loader.ts +98 -0
- package/src/themes/silver/main/ts/ui/skin/SkinLoaded.ts +26 -0
- package/src/themes/silver/main/ts/ui/statusbar/ElementPath.ts +132 -0
- package/src/themes/silver/main/ts/ui/statusbar/ResizeHandle.ts +70 -0
- package/src/themes/silver/main/ts/ui/statusbar/Statusbar.ts +144 -0
- package/src/themes/silver/main/ts/ui/statusbar/WordCount.ts +67 -0
- package/src/themes/silver/main/ts/ui/throbber/Throbber.ts +170 -0
- package/src/themes/silver/main/ts/ui/toolbar/CommonToolbar.ts +231 -0
- package/src/themes/silver/main/ts/ui/toolbar/Integration.ts +210 -0
- package/src/themes/silver/main/ts/ui/toolbar/button/ButtonClasses.ts +17 -0
- package/src/themes/silver/main/ts/ui/toolbar/button/ButtonEvents.ts +45 -0
- package/src/themes/silver/main/ts/ui/toolbar/button/ToolbarButtons.ts +438 -0
- package/src/themes/silver/main/ts/ui/urlinput/Completions.ts +86 -0
- package/src/themes/silver/main/ts/ui/view/View.ts +160 -0
- package/src/themes/silver/main/ts/ui/view/ViewButtons.ts +88 -0
- package/src/themes/silver/main/ts/ui/view/ViewTypes.ts +3 -0
- package/src/themes/silver/main/ts/ui/view/ViewWrapper.ts +174 -0
- package/src/themes/silver/main/ts/ui/window/DialogChannels.ts +17 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialog.ts +102 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialogBody.ts +121 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialogCommon.ts +163 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialogEvents.ts +137 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialogFooter.ts +94 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialogHeader.ts +127 -0
- package/src/themes/silver/main/ts/ui/window/SilverDialogInstanceApi.ts +168 -0
- package/src/themes/silver/main/ts/ui/window/SilverInlineDialog.ts +184 -0
- package/src/themes/silver/main/ts/ui/window/SilverUrlDialog.ts +158 -0
- package/src/themes/silver/main/ts/ui/window/SilverUrlDialogInstanceApi.ts +52 -0
- package/src/themes/silver/test/css/content.css +4 -0
- package/src/themes/silver/test/html/iframe.html +25 -0
- package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputConvertTest.ts +59 -0
- package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputConverterTest.ts +73 -0
- package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputFormatTest.ts +19 -0
- package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputNuTest.ts +12 -0
- package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputParsingTest.ts +75 -0
- package/src/themes/silver/test/ts/atomic/components/sizeinput/SizeInputShared.ts +5 -0
- package/src/themes/silver/test/ts/atomic/context/ContextMenuTriggerTest.ts +36 -0
- package/src/themes/silver/test/ts/atomic/menus/MenuConversionTest.ts +91 -0
- package/src/themes/silver/test/ts/atomic/sizing/ResizeTest.ts +64 -0
- package/src/themes/silver/test/ts/browser/editor/ContextFormTest.ts +228 -0
- package/src/themes/silver/test/ts/browser/editor/DefaultHeightTest.ts +54 -0
- package/src/themes/silver/test/ts/browser/editor/DisableTest.ts +57 -0
- package/src/themes/silver/test/ts/browser/editor/EventsTest.ts +90 -0
- package/src/themes/silver/test/ts/browser/editor/ForceHexColorTest.ts +131 -0
- package/src/themes/silver/test/ts/browser/editor/MenuGroupHeadingTest.ts +52 -0
- package/src/themes/silver/test/ts/browser/editor/NotificationManagerImplTest.ts +259 -0
- package/src/themes/silver/test/ts/browser/editor/ResourceLoadingCssTest.ts +41 -0
- package/src/themes/silver/test/ts/browser/editor/ShadowDomInlineTest.ts +18 -0
- package/src/themes/silver/test/ts/browser/editor/ShowHideTest.ts +93 -0
- package/src/themes/silver/test/ts/browser/editor/SilverDialogCancelTest.ts +34 -0
- package/src/themes/silver/test/ts/browser/editor/SilverDialogCloseTest.ts +34 -0
- package/src/themes/silver/test/ts/browser/editor/SilverDialogPopupsTest.ts +113 -0
- package/src/themes/silver/test/ts/browser/editor/SilverDialogTreeTest.ts +108 -0
- package/src/themes/silver/test/ts/browser/editor/SilverEditorDirectionalityTest.ts +55 -0
- package/src/themes/silver/test/ts/browser/editor/SilverEditorTest.ts +422 -0
- package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerPriorityTest.ts +38 -0
- package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerTargetNotInlineTest.ts +34 -0
- package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerTargetTest.ts +34 -0
- package/src/themes/silver/test/ts/browser/editor/SilverFixedToolbarContainerTest.ts +117 -0
- package/src/themes/silver/test/ts/browser/editor/SilverInlineEditorTest.ts +430 -0
- package/src/themes/silver/test/ts/browser/editor/SilverInlineEditorWidthTest.ts +113 -0
- package/src/themes/silver/test/ts/browser/editor/SilverPopupSinkBoundsTest.ts +344 -0
- package/src/themes/silver/test/ts/browser/editor/SilverRenderTest.ts +64 -0
- package/src/themes/silver/test/ts/browser/editor/SilverUiModeTest.ts +218 -0
- package/src/themes/silver/test/ts/browser/editor/ToolbarBottomTest.ts +166 -0
- package/src/themes/silver/test/ts/browser/editor/ToolbarPersistTest.ts +40 -0
- package/src/themes/silver/test/ts/browser/editor/ToxWrappingTest.ts +21 -0
- package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteAriaTest.ts +179 -0
- package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteCancelTest.ts +184 -0
- package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteReloadTest.ts +117 -0
- package/src/themes/silver/test/ts/browser/editor/autocomplete/AutocompleteTest.ts +769 -0
- package/src/themes/silver/test/ts/browser/editor/backstage/BackstageSinkTest.ts +190 -0
- package/src/themes/silver/test/ts/browser/editor/bespoke/BespokeSelectAriaLabelTest.ts +242 -0
- package/src/themes/silver/test/ts/browser/editor/bespoke/SilverBespokeButtonsTest.ts +401 -0
- package/src/themes/silver/test/ts/browser/editor/bespoke/StyleSelectFormatNamesTest.ts +114 -0
- package/src/themes/silver/test/ts/browser/editor/buttons/GroupToolbarButtonTest.ts +148 -0
- package/src/themes/silver/test/ts/browser/editor/buttons/UpdateToolbarButtonTextAndIconTest.ts +133 -0
- package/src/themes/silver/test/ts/browser/editor/color/ColorAriaLabelTest.ts +285 -0
- package/src/themes/silver/test/ts/browser/editor/color/ColorCacheTest.ts +64 -0
- package/src/themes/silver/test/ts/browser/editor/color/ColorPickerSanityTest.ts +239 -0
- package/src/themes/silver/test/ts/browser/editor/color/ColorSettingsTest.ts +115 -0
- package/src/themes/silver/test/ts/browser/editor/color/GetCurrentColorTest.ts +32 -0
- package/src/themes/silver/test/ts/browser/editor/color/NoneditableRootTest.ts +48 -0
- package/src/themes/silver/test/ts/browser/editor/color/TextColorCommandsTest.ts +64 -0
- package/src/themes/silver/test/ts/browser/editor/color/TextColorFormattingTest.ts +167 -0
- package/src/themes/silver/test/ts/browser/editor/color/TextColorSanityTest.ts +504 -0
- package/src/themes/silver/test/ts/browser/editor/contextmenu/ContextMenuPositionTest.ts +33 -0
- package/src/themes/silver/test/ts/browser/editor/contextmenu/ContextMenuSettingsTest.ts +44 -0
- package/src/themes/silver/test/ts/browser/editor/contextmenu/CustomContextMenuTest.ts +141 -0
- package/src/themes/silver/test/ts/browser/editor/contextmenu/DesktopContextMenuTest.ts +183 -0
- package/src/themes/silver/test/ts/browser/editor/contextmenu/MobileContextMenuTest.ts +212 -0
- package/src/themes/silver/test/ts/browser/editor/contextmenu/img/dogleft.jpg +0 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarBoundsTest.ts +332 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarDistractionFreePositionTest.ts +120 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarIframePositionTest.ts +385 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarInlinePositionTest.ts +158 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarLookupPositionPriorityTest.ts +51 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarLookupPrioritisationTest.ts +76 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarLookupTest.ts +160 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/ContextToolbarTest.ts +41 -0
- package/src/themes/silver/test/ts/browser/editor/contexttoolbar/RemoveContextToolbarOnFocusoutTest.ts +64 -0
- package/src/themes/silver/test/ts/browser/editor/core/AlignmentButtonsTest.ts +67 -0
- package/src/themes/silver/test/ts/browser/editor/core/ChoiceControlsTest.ts +397 -0
- package/src/themes/silver/test/ts/browser/editor/core/ContentLanguageHiddenTest.ts +26 -0
- package/src/themes/silver/test/ts/browser/editor/core/PasteControlsTest.ts +41 -0
- package/src/themes/silver/test/ts/browser/editor/core/SimpleControlsTest.ts +171 -0
- package/src/themes/silver/test/ts/browser/editor/core/UndoRedoTest.ts +90 -0
- package/src/themes/silver/test/ts/browser/editor/header/HeaderLocationTest.ts +56 -0
- package/src/themes/silver/test/ts/browser/editor/header/InlineHeaderTest.ts +99 -0
- package/src/themes/silver/test/ts/browser/editor/header/PromotionTest.ts +65 -0
- package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderBottomTest.ts +11 -0
- package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderInitialPlacementTest.ts +33 -0
- package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderScrollIntoViewTest.ts +104 -0
- package/src/themes/silver/test/ts/browser/editor/header/StickyHeaderTopTest.ts +11 -0
- package/src/themes/silver/test/ts/browser/editor/menubar/EditorMenubarOptionsTest.ts +77 -0
- package/src/themes/silver/test/ts/browser/editor/menubar/EditorMenubarRenderTest.ts +41 -0
- package/src/themes/silver/test/ts/browser/editor/scrolling/EditorInScrollingContainerTest.ts +959 -0
- package/src/themes/silver/test/ts/browser/editor/sizing/GridSinkSizingTest.ts +36 -0
- package/src/themes/silver/test/ts/browser/editor/sizing/ResizeNotInRootTest.ts +37 -0
- package/src/themes/silver/test/ts/browser/editor/sizing/ResizeTest.ts +110 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/EditorToolbarOptionsTest.ts +464 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/IndentOutdentTest.ts +29 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/InlineToolbarDrawerFloatingPositionTest.ts +77 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/InlineToolbarPositionTest.ts +390 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/MultipleInlineToolbarVisibilityTest.ts +54 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/NumberInputTest.ts +462 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/ReadonlyToolbarResizeTest.ts +172 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/SplitFloatingToolbarKeyboardNavigationTest.ts +43 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarDrawerFloatingPositionTest.ts +106 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarDrawerToggleTest.ts +160 -0
- package/src/themes/silver/test/ts/browser/editor/toolbar/ToolbarFocusTest.ts +49 -0
- package/src/themes/silver/test/ts/browser/editor/tooltip/AutocompleterTooltipTest.ts +157 -0
- package/src/themes/silver/test/ts/browser/editor/tooltip/CollectionTooltipTest.ts +240 -0
- package/src/themes/silver/test/ts/browser/editor/tooltip/DynamicTooltipTest.ts +289 -0
- package/src/themes/silver/test/ts/browser/editor/tooltip/TooltipShortcutTest.ts +52 -0
- package/src/themes/silver/test/ts/browser/editor/tooltip/TooltipTest.ts +505 -0
- package/src/themes/silver/test/ts/browser/icons/IconsTest.ts +128 -0
- package/src/themes/silver/test/ts/browser/sidebar/SidebarRoleAttributeTest.ts +83 -0
- package/src/themes/silver/test/ts/browser/sidebar/SidebarShowOptionTest.ts +126 -0
- package/src/themes/silver/test/ts/browser/sidebar/SidebarTest.ts +115 -0
- package/src/themes/silver/test/ts/browser/skin/OxideBlockedDialogTest.ts +113 -0
- package/src/themes/silver/test/ts/browser/skin/OxideCollectionComponentTest.ts +325 -0
- package/src/themes/silver/test/ts/browser/skin/OxideColorSwatchMenuTest.ts +324 -0
- package/src/themes/silver/test/ts/browser/skin/OxideFontFormatMenuTest.ts +209 -0
- package/src/themes/silver/test/ts/browser/skin/OxideGridCollectionMenuTest.ts +79 -0
- package/src/themes/silver/test/ts/browser/skin/OxideListCollectionMenuTest.ts +151 -0
- package/src/themes/silver/test/ts/browser/skin/OxideTablePickerMenuTest.ts +124 -0
- package/src/themes/silver/test/ts/browser/skin/OxideToolbarCollectionMenuTest.ts +156 -0
- package/src/themes/silver/test/ts/browser/statusbar/StatusbarTest.ts +365 -0
- package/src/themes/silver/test/ts/browser/throbber/ThrobberEditorTest.ts +82 -0
- package/src/themes/silver/test/ts/browser/throbber/ThrobberFocusTest.ts +248 -0
- package/src/themes/silver/test/ts/browser/throbber/ThrobberPopupTest.ts +121 -0
- package/src/themes/silver/test/ts/browser/throbber/ThrobberTest.ts +93 -0
- package/src/themes/silver/test/ts/browser/view/ViewButtonsTest.ts +134 -0
- package/src/themes/silver/test/ts/browser/view/ViewTest.ts +504 -0
- package/src/themes/silver/test/ts/browser/window/SilverDialogApiAccessTest.ts +175 -0
- package/src/themes/silver/test/ts/browser/window/SilverDialogAriaLabelTest.ts +61 -0
- package/src/themes/silver/test/ts/browser/window/SilverDialogBeforeEditorRenderedTest.ts +29 -0
- package/src/themes/silver/test/ts/browser/window/SilverDialogBlockTest.ts +170 -0
- package/src/themes/silver/test/ts/browser/window/SilverDialogFooterTest.ts +87 -0
- package/src/themes/silver/test/ts/browser/window/SilverDialogPositioningTest.ts +191 -0
- package/src/themes/silver/test/ts/browser/window/SilverInlineDialogPersistenceTest.ts +173 -0
- package/src/themes/silver/test/ts/browser/window/SilverInlineDialogPositionTest.ts +451 -0
- package/src/themes/silver/test/ts/browser/window/SilverInlineDialogTest.ts +270 -0
- package/src/themes/silver/test/ts/headless/components/alertbanner/AlertBannerTest.ts +93 -0
- package/src/themes/silver/test/ts/headless/components/checkbox/BasicCheckboxTest.ts +193 -0
- package/src/themes/silver/test/ts/headless/components/checkbox/CheckboxFormChangeTest.ts +37 -0
- package/src/themes/silver/test/ts/headless/components/colorinput/ColorInputTest.ts +202 -0
- package/src/themes/silver/test/ts/headless/components/colorpicker/ColorPickerTest.ts +165 -0
- package/src/themes/silver/test/ts/headless/components/customeditor/BasicCustomEditorTest.ts +101 -0
- package/src/themes/silver/test/ts/headless/components/customeditor/CustomEditorSchemaTest.ts +92 -0
- package/src/themes/silver/test/ts/headless/components/dialogbutton/DialogButtonTest.ts +99 -0
- package/src/themes/silver/test/ts/headless/components/dialogbutton/DialogFooterButtonTest.ts +61 -0
- package/src/themes/silver/test/ts/headless/components/dropzone/DropzoneTest.ts +76 -0
- package/src/themes/silver/test/ts/headless/components/grid/BasicGridTest.ts +54 -0
- package/src/themes/silver/test/ts/headless/components/htmlpanel/HtmlPanelTest.ts +62 -0
- package/src/themes/silver/test/ts/headless/components/iframe/IframeTest.ts +343 -0
- package/src/themes/silver/test/ts/headless/components/imagepreview/BasicImagePreviewTest.ts +119 -0
- package/src/themes/silver/test/ts/headless/components/input/InputTest.ts +61 -0
- package/src/themes/silver/test/ts/headless/components/label/LabelTest.ts +117 -0
- package/src/themes/silver/test/ts/headless/components/listbox/ListBoxTest.ts +166 -0
- package/src/themes/silver/test/ts/headless/components/selectbox/SelectboxTest.ts +85 -0
- package/src/themes/silver/test/ts/headless/components/selectbox/SelectboxWithSizeTest.ts +67 -0
- package/src/themes/silver/test/ts/headless/components/sizeinput/SizeInputTest.ts +131 -0
- package/src/themes/silver/test/ts/headless/components/slider/SliderTest.ts +43 -0
- package/src/themes/silver/test/ts/headless/components/table/TableTest.ts +49 -0
- package/src/themes/silver/test/ts/headless/components/textarea/TextareaTest.ts +63 -0
- package/src/themes/silver/test/ts/headless/components/tree/TreeTest.ts +286 -0
- package/src/themes/silver/test/ts/headless/components/urlinput/HistoryTest.ts +35 -0
- package/src/themes/silver/test/ts/headless/components/urlinput/UrlInputTest.ts +301 -0
- package/src/themes/silver/test/ts/headless/configs/ControlOnSetupTest.ts +74 -0
- package/src/themes/silver/test/ts/headless/modes/ScrollingContextTest.ts +271 -0
- package/src/themes/silver/test/ts/headless/modes/UiReferencesTest.ts +73 -0
- package/src/themes/silver/test/ts/headless/sketchers/SilverMenubarTest.ts +312 -0
- package/src/themes/silver/test/ts/headless/toolbar/SearchableMenuButtonPlaceholderTest.ts +100 -0
- package/src/themes/silver/test/ts/headless/toolbar/SearchableMenuButtonTest.ts +541 -0
- package/src/themes/silver/test/ts/headless/toolbar/ToolbarButtonsTest.ts +384 -0
- package/src/themes/silver/test/ts/headless/toolbar/ToolbarTest.ts +142 -0
- package/src/themes/silver/test/ts/headless/window/CustomDialogTest.ts +271 -0
- package/src/themes/silver/test/ts/headless/window/SilverDialogEventTest.ts +145 -0
- package/src/themes/silver/test/ts/headless/window/SilverDialogReuseTest.ts +322 -0
- package/src/themes/silver/test/ts/headless/window/SilverDialogTest.ts +90 -0
- package/src/themes/silver/test/ts/headless/window/SilverUrlDialogTest.ts +80 -0
- package/src/themes/silver/test/ts/headless/window/TabbedDialogTest.ts +128 -0
- package/src/themes/silver/test/ts/headless/window/WindowManagerAlertTest.ts +225 -0
- package/src/themes/silver/test/ts/headless/window/WindowManagerConfirmTest.ts +236 -0
- package/src/themes/silver/test/ts/headless/window/WindowManagerRedialTest.ts +182 -0
- package/src/themes/silver/test/ts/headless/window/WindowManagerTest.ts +396 -0
- package/src/themes/silver/test/ts/module/Assets.ts +3 -0
- package/src/themes/silver/test/ts/module/AutocompleterUtils.ts +153 -0
- package/src/themes/silver/test/ts/module/CommonMailMergeFetch.ts +107 -0
- package/src/themes/silver/test/ts/module/CommonMenuTestStructures.ts +80 -0
- package/src/themes/silver/test/ts/module/ContextMenuUtils.ts +35 -0
- package/src/themes/silver/test/ts/module/DialogUtils.ts +33 -0
- package/src/themes/silver/test/ts/module/DomUtils.ts +21 -0
- package/src/themes/silver/test/ts/module/MenuUtils.ts +75 -0
- package/src/themes/silver/test/ts/module/PageScroll.ts +41 -0
- package/src/themes/silver/test/ts/module/RepresentingUtils.ts +28 -0
- package/src/themes/silver/test/ts/module/StickyHeaderStep.ts +226 -0
- package/src/themes/silver/test/ts/module/StickyHeaderUtils.ts +250 -0
- package/src/themes/silver/test/ts/module/TestBackstage.ts +88 -0
- package/src/themes/silver/test/ts/module/TestExtras.ts +149 -0
- package/src/themes/silver/test/ts/module/TestProviders.ts +25 -0
- package/src/themes/silver/test/ts/module/ToolbarUtils.ts +44 -0
- package/src/themes/silver/test/ts/module/TooltipUtils.ts +62 -0
- package/src/themes/silver/test/ts/module/UiUtils.ts +55 -0
- package/src/themes/silver/test/ts/webdriver/components/urlinput/UrlInputTest.ts +79 -0
- package/src/themes/silver/test/ts/webdriver/dialogs/DialogFocusTest.ts +94 -0
- package/src/themes/silver/test/ts/webdriver/dialogs/IFrameDialogTest.ts +169 -0
- package/src/themes/silver/test/ts/webdriver/dialogs/SizeInputSpaceTest.ts +50 -0
- package/src/themes/silver/test/ts/webdriver/editor/AutocompleteDelayedResponseTest.ts +101 -0
- package/src/themes/silver/test/ts/webdriver/editor/DisabledNestedMenuItemTest.ts +115 -0
- package/src/themes/silver/test/ts/webdriver/editor/SimpleControlsInlineTest.ts +30 -0
- package/src/themes/silver/test/ts/webdriver/editor/TabbingTest.ts +26 -0
- package/src/themes/silver/test/ts/webdriver/throbber/ThrobberTabbingTest.ts +120 -0
- package/src/themes/silver/test/ts/webdriver/toolbar/SearchableMenuTypingTest.ts +369 -0
- package/src/themes/silver/test/ts/webdriver/tooltip/HtmlPanelTooltipTest.ts +156 -0
- package/tools/docs/tinymce.Editor.js +122 -0
- package/tools/docs/tinymce.EditorManager.js +14 -0
- package/tools/docs/tinymce.Env.js +174 -0
- package/tools/docs/tinymce.Event.js +50 -0
- package/tools/docs/tinymce.editor.ui.Ui.js +55 -0
- package/tools/docs/tinymce.js +56 -0
- package/tools/modules/grunt-utils.js +31 -0
- package/tools/modules/grunt-webpack.js +204 -0
- package/tools/modules/zip-helper.js +42 -0
- package/tools/nuget/build/TinyMCE.targets +9 -0
- package/tools/tasks/bundle.js +79 -0
- package/tools/tasks/globals.js +97 -0
- package/tools/tasks/html-i18n.js +35 -0
- package/tools/tasks/moxiezip.js +98 -0
- package/tools/tasks/validateVersion.js +20 -0
- package/tsconfig.json +83 -0
|
@@ -0,0 +1,1817 @@
|
|
|
1
|
+
import { Arr, Fun, Obj, Optionals, Strings, Type } from '@ephox/katamari';
|
|
2
|
+
import { Attribute, Class, ContentEditable, Css, Html, Insert, Remove, Selectors, SugarElement, SugarNode, Traverse, WindowVisualViewport } from '@ephox/sugar';
|
|
3
|
+
|
|
4
|
+
import * as TransparentElements from '../../content/TransparentElements';
|
|
5
|
+
import * as Empty from '../../dom/Empty';
|
|
6
|
+
import * as NodeType from '../../dom/NodeType';
|
|
7
|
+
import * as Position from '../../dom/Position';
|
|
8
|
+
import * as StyleSheetLoaderRegistry from '../../dom/StyleSheetLoaderRegistry';
|
|
9
|
+
import * as TrimNode from '../../dom/TrimNode';
|
|
10
|
+
import { GeomRect } from '../geom/Rect';
|
|
11
|
+
import Entities from '../html/Entities';
|
|
12
|
+
import Schema from '../html/Schema';
|
|
13
|
+
import Styles, { StyleMap } from '../html/Styles';
|
|
14
|
+
import { ForceHexColor, URLConverter } from '../OptionTypes';
|
|
15
|
+
import { MappedEvent } from '../util/EventDispatcher';
|
|
16
|
+
import Tools from '../util/Tools';
|
|
17
|
+
import EventUtils, { EventUtilsCallback } from './EventUtils';
|
|
18
|
+
import StyleSheetLoader from './StyleSheetLoader';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Utility class for various DOM manipulation and retrieval functions.
|
|
22
|
+
*
|
|
23
|
+
* @class tinymce.dom.DOMUtils
|
|
24
|
+
* @example
|
|
25
|
+
* // Add a class to an element by id in the page
|
|
26
|
+
* tinymce.DOM.addClass('someid', 'someclass');
|
|
27
|
+
*
|
|
28
|
+
* // Add a class to an element by id inside the editor
|
|
29
|
+
* tinymce.activeEditor.dom.addClass('someid', 'someclass');
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
// Shorten names
|
|
33
|
+
const each = Tools.each;
|
|
34
|
+
const grep = Tools.grep;
|
|
35
|
+
|
|
36
|
+
const internalStyleName = 'data-mce-style';
|
|
37
|
+
const numericalCssMap = Tools.makeMap('fill-opacity font-weight line-height opacity orphans widows z-index zoom', ' ');
|
|
38
|
+
|
|
39
|
+
interface AttrHook {
|
|
40
|
+
set (elm: Element, value: string | boolean | number | null, name: string): void;
|
|
41
|
+
get (elm: Element, name: string): string | undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface AttrHooks {
|
|
45
|
+
style: AttrHook;
|
|
46
|
+
[key: string]: AttrHook;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SetAttribEvent {
|
|
50
|
+
attrElm: HTMLElement;
|
|
51
|
+
attrName: string;
|
|
52
|
+
attrValue: string | boolean | number | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface DOMUtilsSettings {
|
|
56
|
+
schema: Schema;
|
|
57
|
+
url_converter: URLConverter;
|
|
58
|
+
url_converter_scope: any;
|
|
59
|
+
ownEvents: boolean;
|
|
60
|
+
keep_values: boolean;
|
|
61
|
+
update_styles: boolean;
|
|
62
|
+
root_element: HTMLElement | null;
|
|
63
|
+
collect: boolean;
|
|
64
|
+
onSetAttrib: (event: SetAttribEvent) => void;
|
|
65
|
+
contentCssCors: boolean;
|
|
66
|
+
referrerPolicy: ReferrerPolicy;
|
|
67
|
+
force_hex_color: ForceHexColor;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type Target = Node | Window;
|
|
71
|
+
export type RunArguments<T extends Node = Node> = string | T | Array<string | T> | null;
|
|
72
|
+
export type BoundEvent = [ Target, string, EventUtilsCallback<any>, any ];
|
|
73
|
+
type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
|
|
74
|
+
type RunResult<T, R> = T extends Array<any> ? R[] : false | R;
|
|
75
|
+
|
|
76
|
+
interface DOMUtils {
|
|
77
|
+
doc: Document;
|
|
78
|
+
settings: Partial<DOMUtilsSettings>;
|
|
79
|
+
win: Window;
|
|
80
|
+
files: Record<string, boolean>;
|
|
81
|
+
stdMode: boolean;
|
|
82
|
+
boxModel: boolean;
|
|
83
|
+
styleSheetLoader: StyleSheetLoader;
|
|
84
|
+
boundEvents: BoundEvent[];
|
|
85
|
+
styles: Styles;
|
|
86
|
+
schema: Schema;
|
|
87
|
+
events: EventUtils;
|
|
88
|
+
root: Node | null;
|
|
89
|
+
|
|
90
|
+
isBlock: {
|
|
91
|
+
(node: Node | null): node is HTMLElement;
|
|
92
|
+
(node: string): boolean;
|
|
93
|
+
};
|
|
94
|
+
clone: (node: Node, deep: boolean) => Node;
|
|
95
|
+
getRoot: () => HTMLElement;
|
|
96
|
+
getViewPort: (argWin?: Window) => GeomRect;
|
|
97
|
+
getRect: (elm: string | HTMLElement) => GeomRect;
|
|
98
|
+
getSize: (elm: string | HTMLElement) => {
|
|
99
|
+
w: number;
|
|
100
|
+
h: number;
|
|
101
|
+
};
|
|
102
|
+
getParent: {
|
|
103
|
+
<K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
|
|
104
|
+
<T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null;
|
|
105
|
+
(node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null;
|
|
106
|
+
};
|
|
107
|
+
getParents: {
|
|
108
|
+
<K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
|
|
109
|
+
<T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[];
|
|
110
|
+
(elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[];
|
|
111
|
+
};
|
|
112
|
+
get: {
|
|
113
|
+
<T extends Node>(elm: T): T;
|
|
114
|
+
(elm: string): HTMLElement | null;
|
|
115
|
+
};
|
|
116
|
+
getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
|
|
117
|
+
getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
|
|
118
|
+
select: {
|
|
119
|
+
<K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
|
|
120
|
+
<T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
|
|
121
|
+
};
|
|
122
|
+
is: {
|
|
123
|
+
<T extends Element>(elm: Node | Node[] | null, selector: string): elm is T;
|
|
124
|
+
(elm: Node | Node[] | null, selector: string): boolean;
|
|
125
|
+
};
|
|
126
|
+
add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement;
|
|
127
|
+
create: {
|
|
128
|
+
<K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K];
|
|
129
|
+
(name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement;
|
|
130
|
+
};
|
|
131
|
+
createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string;
|
|
132
|
+
createFragment: (html?: string) => DocumentFragment;
|
|
133
|
+
remove: {
|
|
134
|
+
<T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T;
|
|
135
|
+
<T extends Node>(node: string, keepChildren?: boolean): T | false;
|
|
136
|
+
};
|
|
137
|
+
getStyle: {
|
|
138
|
+
(elm: Element, name: string, computed: true): string;
|
|
139
|
+
(elm: string | Element | null, name: string, computed?: boolean): string | undefined;
|
|
140
|
+
};
|
|
141
|
+
setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void;
|
|
142
|
+
setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void;
|
|
143
|
+
removeAllAttribs: (e: RunArguments<Element>) => void;
|
|
144
|
+
setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void;
|
|
145
|
+
setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void;
|
|
146
|
+
getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string;
|
|
147
|
+
getAttribs: (elm: string | Element) => NamedNodeMap | Attr[];
|
|
148
|
+
getPos: (elm: string | Element, rootElm?: Node) => {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
};
|
|
152
|
+
parseStyle: (cssText: string) => Record<string, string>;
|
|
153
|
+
serializeStyle: (stylesArg: StyleMap, name?: string) => string;
|
|
154
|
+
addStyle: (cssText: string) => void;
|
|
155
|
+
loadCSS: (url: string) => void;
|
|
156
|
+
hasClass: (elm: string | Element, cls: string) => boolean;
|
|
157
|
+
addClass: (elm: RunArguments<Element>, cls: string) => void;
|
|
158
|
+
removeClass: (elm: RunArguments<Element>, cls: string) => void;
|
|
159
|
+
toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void;
|
|
160
|
+
show: (elm: string | Node | Node[]) => void;
|
|
161
|
+
hide: (elm: string | Node | Node[]) => void;
|
|
162
|
+
isHidden: (elm: string | Node) => boolean;
|
|
163
|
+
uniqueId: (prefix?: string) => string;
|
|
164
|
+
setHTML: (elm: RunArguments<Element>, html: string) => void;
|
|
165
|
+
getOuterHTML: (elm: string | Node) => string;
|
|
166
|
+
setOuterHTML: (elm: string | Node | Node[], html: string) => void;
|
|
167
|
+
decode: (text: string) => string;
|
|
168
|
+
encode: (text: string) => string;
|
|
169
|
+
insertAfter: {
|
|
170
|
+
<T extends Node>(node: T | T[], reference: string | Node): T;
|
|
171
|
+
<T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>;
|
|
172
|
+
};
|
|
173
|
+
replace: {
|
|
174
|
+
<T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
|
|
175
|
+
<T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T;
|
|
176
|
+
};
|
|
177
|
+
rename: {
|
|
178
|
+
<K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
|
|
179
|
+
(elm: Element, name: string): Element;
|
|
180
|
+
};
|
|
181
|
+
findCommonAncestor: (a: Node, b: Node) => Node | null;
|
|
182
|
+
run <R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
|
|
183
|
+
run <R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
|
|
184
|
+
isEmpty: (node: Node, elements?: Record<string, any>, options?: Empty.IsEmptyOptions) => boolean;
|
|
185
|
+
createRng: () => Range;
|
|
186
|
+
nodeIndex: (node: Node, normalized?: boolean) => number;
|
|
187
|
+
split: {
|
|
188
|
+
<T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined;
|
|
189
|
+
<T extends Node>(parentElm: Node, splitElm: T): T | undefined;
|
|
190
|
+
};
|
|
191
|
+
bind: {
|
|
192
|
+
<K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
|
|
193
|
+
<K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[];
|
|
194
|
+
};
|
|
195
|
+
unbind: {
|
|
196
|
+
<K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils;
|
|
197
|
+
<K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
|
|
198
|
+
};
|
|
199
|
+
fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
|
200
|
+
dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
|
201
|
+
getContentEditable: (node: Node) => string | null;
|
|
202
|
+
getContentEditableParent: (node: Node) => string | null;
|
|
203
|
+
isEditable: (node: Node | null | undefined) => boolean;
|
|
204
|
+
destroy: () => void;
|
|
205
|
+
isChildOf: (node: Node, parent: Node) => boolean;
|
|
206
|
+
dumpRng: (r: Range) => string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const legacySetAttribute = (elm: SugarElement<Element>, name: string, value: string | number | boolean | null) => {
|
|
210
|
+
if (Type.isNullable(value) || value === '') {
|
|
211
|
+
Attribute.remove(elm, name);
|
|
212
|
+
} else {
|
|
213
|
+
Attribute.set(elm, name, value);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// Convert camel cased names back to hyphenated names
|
|
218
|
+
const camelCaseToHyphens = (name: string): string =>
|
|
219
|
+
name.replace(/[A-Z]/g, (v) => '-' + v.toLowerCase());
|
|
220
|
+
|
|
221
|
+
const findNodeIndex = (node: Node | null, normalized?: boolean) => {
|
|
222
|
+
let idx = 0;
|
|
223
|
+
|
|
224
|
+
if (node) {
|
|
225
|
+
for (let lastNodeType = node.nodeType, tempNode = node.previousSibling; tempNode; tempNode = tempNode.previousSibling) {
|
|
226
|
+
const nodeType = tempNode.nodeType;
|
|
227
|
+
|
|
228
|
+
// Normalize text nodes
|
|
229
|
+
if (normalized && NodeType.isText(tempNode)) {
|
|
230
|
+
if (nodeType === lastNodeType || !tempNode.data.length) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
idx++;
|
|
235
|
+
lastNodeType = nodeType;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return idx;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const updateInternalStyleAttr = (styles: Styles, elm: SugarElement<Element>) => {
|
|
243
|
+
const rawValue = Attribute.get(elm, 'style');
|
|
244
|
+
const value = styles.serialize(styles.parse(rawValue), SugarNode.name(elm));
|
|
245
|
+
legacySetAttribute(elm, internalStyleName, value);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const convertStyleToString = (cssValue: string | number, cssName: string): string => {
|
|
249
|
+
if (Type.isNumber(cssValue)) {
|
|
250
|
+
return Obj.has(numericalCssMap, cssName) ? cssValue + '' : cssValue + 'px';
|
|
251
|
+
} else {
|
|
252
|
+
return cssValue;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const applyStyle = ($elm: SugarElement<Node>, cssName: string, cssValue: string | number | null) => {
|
|
257
|
+
const normalizedName = camelCaseToHyphens(cssName);
|
|
258
|
+
if (Type.isNullable(cssValue) || cssValue === '') {
|
|
259
|
+
Css.remove($elm, normalizedName);
|
|
260
|
+
} else {
|
|
261
|
+
Css.set($elm, normalizedName, convertStyleToString(cssValue, normalizedName));
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
const setupAttrHooks = (styles: Styles, settings: Partial<DOMUtilsSettings>, getContext: () => any): AttrHooks => {
|
|
266
|
+
const keepValues = settings.keep_values;
|
|
267
|
+
const keepUrlHook: AttrHook = {
|
|
268
|
+
set: (elm, value, name) => {
|
|
269
|
+
const sugarElm = SugarElement.fromDom(elm);
|
|
270
|
+
if (Type.isFunction(settings.url_converter) && Type.isNonNullable(value)) {
|
|
271
|
+
value = settings.url_converter.call(settings.url_converter_scope || getContext(), String(value), name, elm);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const internalName = 'data-mce-' + name;
|
|
275
|
+
legacySetAttribute(sugarElm, internalName, value);
|
|
276
|
+
legacySetAttribute(sugarElm, name, value);
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
get: (elm, name) => {
|
|
280
|
+
const sugarElm = SugarElement.fromDom(elm);
|
|
281
|
+
return Attribute.get(sugarElm, 'data-mce-' + name) || Attribute.get(sugarElm, name);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const attrHooks: AttrHooks = {
|
|
286
|
+
style: {
|
|
287
|
+
set: (elm, value) => {
|
|
288
|
+
const sugarElm = SugarElement.fromDom(elm);
|
|
289
|
+
|
|
290
|
+
if (keepValues) {
|
|
291
|
+
legacySetAttribute(sugarElm, internalStyleName, value);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
Attribute.remove(sugarElm, 'style');
|
|
295
|
+
// If setting a style then delegate to the css api, otherwise
|
|
296
|
+
// this will cause issues when using a content security policy
|
|
297
|
+
if (Type.isString(value)) {
|
|
298
|
+
Css.setAll(sugarElm, styles.parse(value));
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
|
|
302
|
+
get: (elm) => {
|
|
303
|
+
const sugarElm = SugarElement.fromDom(elm);
|
|
304
|
+
const value = Attribute.get(sugarElm, internalStyleName) || Attribute.get(sugarElm, 'style');
|
|
305
|
+
return styles.serialize(styles.parse(value), SugarNode.name(sugarElm));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
if (keepValues) {
|
|
311
|
+
attrHooks.href = attrHooks.src = keepUrlHook;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return attrHooks;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Constructs a new DOMUtils instance. Consult the TinyMCE Documentation for more details on settings etc for this class.
|
|
319
|
+
*
|
|
320
|
+
* @private
|
|
321
|
+
* @constructor
|
|
322
|
+
* @method DOMUtils
|
|
323
|
+
* @param {Document} doc Document reference to bind the utility class to.
|
|
324
|
+
* @param {settings} settings Optional settings collection.
|
|
325
|
+
*/
|
|
326
|
+
const DOMUtils = (doc: Document, settings: Partial<DOMUtilsSettings> = {}): DOMUtils => {
|
|
327
|
+
const addedStyles: Record<string, boolean> = {};
|
|
328
|
+
const win = window;
|
|
329
|
+
const files: Record<string, boolean> = {};
|
|
330
|
+
let counter = 0;
|
|
331
|
+
const stdMode = true;
|
|
332
|
+
const boxModel = true;
|
|
333
|
+
const styleSheetLoader = StyleSheetLoaderRegistry.instance.forElement(SugarElement.fromDom(doc), {
|
|
334
|
+
contentCssCors: settings.contentCssCors,
|
|
335
|
+
referrerPolicy: settings.referrerPolicy
|
|
336
|
+
});
|
|
337
|
+
const boundEvents: Array<[ Target, string, Callback<any>, any ]> = [];
|
|
338
|
+
const schema = settings.schema ? settings.schema : Schema({});
|
|
339
|
+
const styles = Styles({
|
|
340
|
+
url_converter: settings.url_converter,
|
|
341
|
+
url_converter_scope: settings.url_converter_scope,
|
|
342
|
+
force_hex_color: settings.force_hex_color,
|
|
343
|
+
}, settings.schema);
|
|
344
|
+
|
|
345
|
+
const events = settings.ownEvents ? new EventUtils() : EventUtils.Event;
|
|
346
|
+
const blockElementsMap = schema.getBlockElements();
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Returns true/false if the specified element is a block element or not.
|
|
350
|
+
*
|
|
351
|
+
* @method isBlock
|
|
352
|
+
* @param {Node/String} node Element/Node to check.
|
|
353
|
+
* @return {Boolean} True/False state if the node is a block element or not.
|
|
354
|
+
*/
|
|
355
|
+
const isBlock = (node: string | Node | null) => {
|
|
356
|
+
if (Type.isString(node)) {
|
|
357
|
+
return Obj.has(blockElementsMap, node);
|
|
358
|
+
} else {
|
|
359
|
+
return NodeType.isElement(node) && (Obj.has(blockElementsMap, node.nodeName) || TransparentElements.isTransparentBlock(schema, node));
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
const get = <T extends Node | null | undefined>(elm: string | T): HTMLElement | T | null =>
|
|
364
|
+
elm && doc && Type.isString(elm)
|
|
365
|
+
? doc.getElementById(elm)
|
|
366
|
+
: elm as T;
|
|
367
|
+
|
|
368
|
+
const _get = <T extends Node>(elm: string | T | null | undefined): SugarElement<T | HTMLElement> | null => {
|
|
369
|
+
const value = get(elm);
|
|
370
|
+
return Type.isNonNullable(value) ? SugarElement.fromDom(value) : null;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
const getAttrib = (elm: string | Element | null, name: string, defaultVal: string = ''): string => {
|
|
374
|
+
let value: string | undefined;
|
|
375
|
+
|
|
376
|
+
const $elm = _get(elm);
|
|
377
|
+
|
|
378
|
+
if (Type.isNonNullable($elm) && SugarNode.isElement($elm)) {
|
|
379
|
+
const hook = attrHooks[name];
|
|
380
|
+
|
|
381
|
+
if (hook && hook.get) {
|
|
382
|
+
value = hook.get($elm.dom, name);
|
|
383
|
+
} else {
|
|
384
|
+
value = Attribute.get($elm, name);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return Type.isNonNullable(value) ? value : defaultVal;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
const getAttribs = (elm: string | Element): NamedNodeMap | Attr[] => {
|
|
392
|
+
const node = get(elm);
|
|
393
|
+
return Type.isNullable(node) ? [] : node.attributes;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
const setAttrib = (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => {
|
|
397
|
+
run(elm, (e) => {
|
|
398
|
+
if (NodeType.isElement(e)) {
|
|
399
|
+
const $elm = SugarElement.fromDom(e);
|
|
400
|
+
const val = value === '' ? null : value;
|
|
401
|
+
|
|
402
|
+
const originalValue = Attribute.get($elm, name);
|
|
403
|
+
const hook = attrHooks[name];
|
|
404
|
+
if (hook && hook.set) {
|
|
405
|
+
hook.set($elm.dom, val, name);
|
|
406
|
+
} else {
|
|
407
|
+
legacySetAttribute($elm, name, val);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (originalValue !== val && settings.onSetAttrib) {
|
|
411
|
+
settings.onSetAttrib({
|
|
412
|
+
attrElm: $elm.dom as HTMLElement, // We lie here to not break backwards compatibility
|
|
413
|
+
attrName: name,
|
|
414
|
+
attrValue: val
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
const clone = (node: Node, deep: boolean) => {
|
|
422
|
+
return node.cloneNode(deep);
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const getRoot = (): HTMLElement => settings.root_element || doc.body;
|
|
426
|
+
|
|
427
|
+
const getViewPort = (argWin?: Window): GeomRect => {
|
|
428
|
+
const vp = WindowVisualViewport.getBounds(argWin);
|
|
429
|
+
|
|
430
|
+
// Returns viewport size excluding scrollbars
|
|
431
|
+
return {
|
|
432
|
+
x: vp.x,
|
|
433
|
+
y: vp.y,
|
|
434
|
+
w: vp.width,
|
|
435
|
+
h: vp.height
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
const getPos = (elm: string | Element | null, rootElm?: Node) => Position.getPos(doc.body, get(elm), rootElm);
|
|
440
|
+
|
|
441
|
+
const setStyle = (elm: string | Element | Element[], name: string, value: string | number | null) => {
|
|
442
|
+
run(elm, (e) => {
|
|
443
|
+
const $elm = SugarElement.fromDom(e);
|
|
444
|
+
applyStyle($elm, name, value);
|
|
445
|
+
|
|
446
|
+
if (settings.update_styles) {
|
|
447
|
+
updateInternalStyleAttr(styles, $elm);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
const setStyles = (elm: string | Element | Element[], stylesArg: StyleMap) => {
|
|
453
|
+
run(elm, (e) => {
|
|
454
|
+
const $elm = SugarElement.fromDom(e);
|
|
455
|
+
Obj.each(stylesArg, (v, n) => {
|
|
456
|
+
applyStyle($elm, n, v);
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
if (settings.update_styles) {
|
|
460
|
+
updateInternalStyleAttr(styles, $elm);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
const getStyle = (elm: string | Element | null, name: string, computed?: boolean): string | undefined => {
|
|
466
|
+
const $elm = get(elm);
|
|
467
|
+
|
|
468
|
+
if (Type.isNullable($elm) || (!NodeType.isHTMLElement($elm) && !NodeType.isSVGElement($elm))) {
|
|
469
|
+
return undefined;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (computed) {
|
|
473
|
+
return Css.get(SugarElement.fromDom($elm), camelCaseToHyphens(name));
|
|
474
|
+
} else {
|
|
475
|
+
// Camelcase it, if needed
|
|
476
|
+
name = name.replace(/-(\D)/g, (a, b) => b.toUpperCase());
|
|
477
|
+
|
|
478
|
+
if (name === 'float') {
|
|
479
|
+
name = 'cssFloat';
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
return $elm.style ? ($elm.style as Record<string, any>)[name] : undefined;
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
const getSize = (elm: HTMLElement | string | null): { w: number; h: number } => {
|
|
487
|
+
const $elm = get(elm);
|
|
488
|
+
|
|
489
|
+
if (!$elm) {
|
|
490
|
+
return { w: 0, h: 0 };
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
let w = getStyle($elm, 'width');
|
|
494
|
+
let h = getStyle($elm, 'height');
|
|
495
|
+
|
|
496
|
+
// Non pixel value, then force offset/clientWidth
|
|
497
|
+
if (!w || w.indexOf('px') === -1) {
|
|
498
|
+
w = '0';
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Non pixel value, then force offset/clientWidth
|
|
502
|
+
if (!h || h.indexOf('px') === -1) {
|
|
503
|
+
h = '0';
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return {
|
|
507
|
+
w: parseInt(w, 10) || $elm.offsetWidth || $elm.clientWidth,
|
|
508
|
+
h: parseInt(h, 10) || $elm.offsetHeight || $elm.clientHeight
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
const getRect = (elm: string | HTMLElement): GeomRect => {
|
|
513
|
+
const $elm = get(elm);
|
|
514
|
+
const pos = getPos($elm);
|
|
515
|
+
const size = getSize($elm);
|
|
516
|
+
|
|
517
|
+
return {
|
|
518
|
+
x: pos.x, y: pos.y,
|
|
519
|
+
w: size.w, h: size.h
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
const is = <T extends Element>(elm: Node | Node[] | null, selector: string): elm is T => {
|
|
524
|
+
if (!elm) {
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const elms = Type.isArray(elm) ? elm : [ elm ];
|
|
529
|
+
|
|
530
|
+
return Arr.exists(elms, (e) => {
|
|
531
|
+
return Selectors.is<T>(SugarElement.fromDom(e), selector);
|
|
532
|
+
});
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
const getParents = (elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[] | null => {
|
|
536
|
+
const result: Node[] = [];
|
|
537
|
+
|
|
538
|
+
let node = get(elm);
|
|
539
|
+
collect = collect === undefined;
|
|
540
|
+
|
|
541
|
+
// Default root on inline mode
|
|
542
|
+
const resolvedRoot = root || (getRoot().nodeName !== 'BODY' ? getRoot().parentNode : null);
|
|
543
|
+
|
|
544
|
+
// Wrap node name as func
|
|
545
|
+
if (Type.isString(selector)) {
|
|
546
|
+
if (selector === '*') {
|
|
547
|
+
selector = NodeType.isElement;
|
|
548
|
+
} else {
|
|
549
|
+
const selectorVal = selector;
|
|
550
|
+
selector = (node) => is(node, selectorVal);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
while (node) {
|
|
555
|
+
// TODO: Remove nullable check once TINY-6599 is complete
|
|
556
|
+
if (node === resolvedRoot || Type.isNullable(node.nodeType) || NodeType.isDocument(node) || NodeType.isDocumentFragment(node)) {
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (!selector || selector(node)) {
|
|
561
|
+
if (collect) {
|
|
562
|
+
result.push(node);
|
|
563
|
+
} else {
|
|
564
|
+
return [ node ];
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
node = node.parentNode;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return collect ? result : null;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
const getParent = (node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null => {
|
|
575
|
+
const parents = getParents(node, selector, root, false);
|
|
576
|
+
return parents && parents.length > 0 ? parents[0] : null;
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
const _findSib = (node: Node | null, selector: string | ((node: Node) => boolean), name: 'previousSibling' | 'nextSibling') => {
|
|
580
|
+
let func = selector;
|
|
581
|
+
|
|
582
|
+
if (node) {
|
|
583
|
+
// If expression make a function of it using is
|
|
584
|
+
if (Type.isString(selector)) {
|
|
585
|
+
func = (node) => {
|
|
586
|
+
return is(node, selector);
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// Loop all siblings
|
|
591
|
+
for (let tempNode = node[name]; tempNode; tempNode = tempNode[name]) {
|
|
592
|
+
if (Type.isFunction(func) && func(tempNode)) {
|
|
593
|
+
return tempNode;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
return null;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
const getNext = (node: Node | null, selector: string | ((node: Node) => boolean)) => _findSib(node, selector, 'nextSibling');
|
|
602
|
+
|
|
603
|
+
const getPrev = (node: Node | null, selector: string | ((node: Node) => boolean)) => _findSib(node, selector, 'previousSibling');
|
|
604
|
+
|
|
605
|
+
const isParentNode = (node: Node): node is ParentNode =>
|
|
606
|
+
Type.isFunction((node as any).querySelectorAll);
|
|
607
|
+
|
|
608
|
+
const select = (selector: string, scope?: Node | string): Element[] => {
|
|
609
|
+
const elm = get(scope) ?? settings.root_element ?? doc;
|
|
610
|
+
return isParentNode(elm) ? Arr.from(elm.querySelectorAll(selector)) : [];
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const run = function <R, T extends Node> (this: any, elm: RunArguments<T>, func: (node: T, i?: number) => R, scope?: any): RunResult<typeof elm, R> {
|
|
614
|
+
const context = scope ?? this;
|
|
615
|
+
|
|
616
|
+
if (Type.isArray(elm)) {
|
|
617
|
+
const result: R[] = [];
|
|
618
|
+
|
|
619
|
+
each(elm, (e, i) => {
|
|
620
|
+
const node = get(e);
|
|
621
|
+
if (node) {
|
|
622
|
+
result.push(func.call(context, node as T, i));
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
return result;
|
|
627
|
+
} else {
|
|
628
|
+
const node = get(elm);
|
|
629
|
+
return !node ? false : func.call(context, node as T);
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
const setAttribs = (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => {
|
|
634
|
+
run(elm, ($elm) => {
|
|
635
|
+
Obj.each(attrs, (value, name) => {
|
|
636
|
+
setAttrib($elm, name, value);
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
const setHTML = (elm: RunArguments<Element>, html: string) => {
|
|
642
|
+
run(elm, (e) => {
|
|
643
|
+
const $elm = SugarElement.fromDom(e);
|
|
644
|
+
Html.set($elm, html);
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const add = (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean): HTMLElement =>
|
|
649
|
+
run(parentElm, (parentElm) => {
|
|
650
|
+
const newElm = Type.isString(name) ? doc.createElement(name) : name;
|
|
651
|
+
|
|
652
|
+
if (Type.isNonNullable(attrs)) {
|
|
653
|
+
setAttribs(newElm, attrs);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (html) {
|
|
657
|
+
if (!Type.isString(html) && html.nodeType) {
|
|
658
|
+
newElm.appendChild(html);
|
|
659
|
+
} else if (Type.isString(html)) {
|
|
660
|
+
setHTML(newElm, html);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
return !create ? parentElm.appendChild(newElm) : newElm;
|
|
665
|
+
}) as HTMLElement;
|
|
666
|
+
|
|
667
|
+
const create = (name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement =>
|
|
668
|
+
add(doc.createElement(name), name, attrs, html, true);
|
|
669
|
+
|
|
670
|
+
const decode = Entities.decode;
|
|
671
|
+
const encode = Entities.encodeAllRaw;
|
|
672
|
+
|
|
673
|
+
const createHTML = (name: string, attrs?: Record<string, string | null>, html: string = ''): string => {
|
|
674
|
+
let outHtml = '<' + name;
|
|
675
|
+
|
|
676
|
+
for (const key in attrs) {
|
|
677
|
+
if (Obj.hasNonNullableKey(attrs, key)) {
|
|
678
|
+
outHtml += ' ' + key + '="' + encode(attrs[key]) + '"';
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
if (Strings.isEmpty(html) && Obj.has(schema.getVoidElements(), name)) {
|
|
683
|
+
return outHtml + ' />';
|
|
684
|
+
} else {
|
|
685
|
+
return outHtml + '>' + html + '</' + name + '>';
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
const createFragment = (html?: string): DocumentFragment => {
|
|
690
|
+
const container = doc.createElement('div');
|
|
691
|
+
const frag = doc.createDocumentFragment();
|
|
692
|
+
|
|
693
|
+
// Append the container to the fragment so as to remove it from
|
|
694
|
+
// the current document context
|
|
695
|
+
frag.appendChild(container);
|
|
696
|
+
|
|
697
|
+
if (html) {
|
|
698
|
+
container.innerHTML = html;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
let node: Node | null;
|
|
702
|
+
while ((node = container.firstChild)) {
|
|
703
|
+
frag.appendChild(node);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// Remove the container now that all the children have been transferred
|
|
707
|
+
frag.removeChild(container);
|
|
708
|
+
|
|
709
|
+
return frag;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
const remove = <T extends Node>(node: string | T | T[], keepChildren?: boolean): RunResult<typeof node, T> => {
|
|
713
|
+
return run(node, (n) => {
|
|
714
|
+
const $node = SugarElement.fromDom(n);
|
|
715
|
+
|
|
716
|
+
if (keepChildren) {
|
|
717
|
+
// Unwrap but don't keep any empty text nodes
|
|
718
|
+
Arr.each(Traverse.children($node), (child) => {
|
|
719
|
+
if (SugarNode.isText(child) && child.dom.length === 0) {
|
|
720
|
+
Remove.remove(child);
|
|
721
|
+
} else {
|
|
722
|
+
Insert.before($node, child);
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
Remove.remove($node);
|
|
728
|
+
|
|
729
|
+
return $node.dom;
|
|
730
|
+
});
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
const removeAllAttribs = (e: RunArguments<Element>) => run(e, (e) => {
|
|
734
|
+
const attrs = e.attributes;
|
|
735
|
+
for (let i = attrs.length - 1; i >= 0; i--) {
|
|
736
|
+
e.removeAttributeNode(attrs.item(i) as Attr);
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
const parseStyle = (cssText: string): Record<string, string> => styles.parse(cssText);
|
|
741
|
+
|
|
742
|
+
const serializeStyle = (stylesArg: StyleMap, name?: string) => styles.serialize(stylesArg, name);
|
|
743
|
+
|
|
744
|
+
const addStyle = (cssText: string) => {
|
|
745
|
+
// Prevent inline from loading the same styles twice
|
|
746
|
+
if (self !== DOMUtils.DOM && doc === document) {
|
|
747
|
+
if (addedStyles[cssText]) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
addedStyles[cssText] = true;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// Create style element if needed
|
|
755
|
+
let styleElm = doc.getElementById('mceDefaultStyles') as HTMLStyleElement | null;
|
|
756
|
+
if (!styleElm) {
|
|
757
|
+
styleElm = doc.createElement('style');
|
|
758
|
+
styleElm.id = 'mceDefaultStyles';
|
|
759
|
+
styleElm.type = 'text/css';
|
|
760
|
+
|
|
761
|
+
const head = doc.head;
|
|
762
|
+
if (head.firstChild) {
|
|
763
|
+
head.insertBefore(styleElm, head.firstChild);
|
|
764
|
+
} else {
|
|
765
|
+
head.appendChild(styleElm);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Append style data to old or new style element
|
|
770
|
+
if ((styleElm as any).styleSheet) {
|
|
771
|
+
(styleElm as any).styleSheet.cssText += cssText;
|
|
772
|
+
} else {
|
|
773
|
+
styleElm.appendChild(doc.createTextNode(cssText));
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
const loadCSS = (urls: string) => {
|
|
778
|
+
if (!urls) {
|
|
779
|
+
urls = '';
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
Arr.each(urls.split(','), (url) => {
|
|
783
|
+
files[url] = true;
|
|
784
|
+
styleSheetLoader.load(url).catch(Fun.noop);
|
|
785
|
+
});
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
const toggleClass = (elm: RunArguments<Element>, cls: string, state?: boolean) => {
|
|
789
|
+
run(elm, (e) => {
|
|
790
|
+
if (NodeType.isElement(e)) {
|
|
791
|
+
const $elm = SugarElement.fromDom(e);
|
|
792
|
+
// TINY-4520: DomQuery used to handle specifying multiple classes and the
|
|
793
|
+
// formatter relies on it due to the changes made for TINY-7227
|
|
794
|
+
const classes = cls.split(' ');
|
|
795
|
+
Arr.each(classes, (c) => {
|
|
796
|
+
if (Type.isNonNullable(state)) {
|
|
797
|
+
const fn = state ? Class.add : Class.remove;
|
|
798
|
+
fn($elm, c);
|
|
799
|
+
} else {
|
|
800
|
+
Class.toggle($elm, c);
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
const addClass = (elm: RunArguments<Element>, cls: string) => {
|
|
808
|
+
toggleClass(elm, cls, true);
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
const removeClass = (elm: RunArguments<Element>, cls: string) => {
|
|
812
|
+
toggleClass(elm, cls, false);
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
const hasClass = (elm: string | Element, cls: string) => {
|
|
816
|
+
const $elm = _get(elm);
|
|
817
|
+
// TINY-4520: DomQuery used to handle specifying multiple classes and the
|
|
818
|
+
// formatter relies on it due to the changes made for TINY-7227
|
|
819
|
+
const classes = cls.split(' ');
|
|
820
|
+
return Type.isNonNullable($elm) && Arr.forall(classes, (c) => Class.has($elm, c));
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
const show = (elm: string | Node | Node[]) => {
|
|
824
|
+
run(elm, (e) => Css.remove(SugarElement.fromDom(e), 'display'));
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
const hide = (elm: string | Node | Node[]) => {
|
|
828
|
+
run(elm, (e) => Css.set(SugarElement.fromDom(e), 'display', 'none'));
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
const isHidden = (elm: string | Node): boolean => {
|
|
832
|
+
const $elm = _get(elm);
|
|
833
|
+
return Type.isNonNullable($elm) && Optionals.is(Css.getRaw($elm, 'display'), 'none');
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
const uniqueId = (prefix?: string) => (!prefix ? 'mce_' : prefix) + (counter++);
|
|
837
|
+
|
|
838
|
+
const getOuterHTML = (elm: string | Node): string => {
|
|
839
|
+
const $elm = _get(elm);
|
|
840
|
+
|
|
841
|
+
if (Type.isNonNullable($elm)) {
|
|
842
|
+
return NodeType.isElement($elm.dom) ? $elm.dom.outerHTML : Html.getOuter($elm);
|
|
843
|
+
} else {
|
|
844
|
+
return '';
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
const setOuterHTML = (elm: string | Node | Node[], html: string) => {
|
|
849
|
+
run(elm, ($elm) => {
|
|
850
|
+
if (NodeType.isElement($elm)) {
|
|
851
|
+
$elm.outerHTML = html;
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
const insertAfter = <T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T> => {
|
|
857
|
+
const referenceNode = get(reference);
|
|
858
|
+
|
|
859
|
+
return run(node, (node) => {
|
|
860
|
+
const parent = referenceNode?.parentNode;
|
|
861
|
+
const nextSibling = referenceNode?.nextSibling;
|
|
862
|
+
|
|
863
|
+
if (parent) {
|
|
864
|
+
if (nextSibling) {
|
|
865
|
+
parent.insertBefore(node, nextSibling);
|
|
866
|
+
} else {
|
|
867
|
+
parent.appendChild(node);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
return node;
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
const replace = <T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean) => run<T, T>(oldElm, (elm) => {
|
|
876
|
+
const replacee = Type.isArray(oldElm) ? newElm.cloneNode(true) : newElm;
|
|
877
|
+
|
|
878
|
+
if (keepChildren) {
|
|
879
|
+
each(grep(elm.childNodes), (node) => {
|
|
880
|
+
replacee.appendChild(node);
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
elm.parentNode?.replaceChild(replacee, elm);
|
|
885
|
+
return elm;
|
|
886
|
+
}) as T;
|
|
887
|
+
|
|
888
|
+
const rename = <K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K] => {
|
|
889
|
+
if (elm.nodeName !== name.toUpperCase()) {
|
|
890
|
+
// Rename block element
|
|
891
|
+
const newElm = create(name) as HTMLElementTagNameMap[K];
|
|
892
|
+
|
|
893
|
+
// Copy attribs to new block
|
|
894
|
+
each(getAttribs(elm), (attrNode) => {
|
|
895
|
+
setAttrib(newElm, attrNode.nodeName, getAttrib(elm, attrNode.nodeName));
|
|
896
|
+
});
|
|
897
|
+
|
|
898
|
+
// Replace block
|
|
899
|
+
replace(newElm, elm, true);
|
|
900
|
+
return newElm;
|
|
901
|
+
} else {
|
|
902
|
+
return elm as HTMLElementTagNameMap[K];
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
const findCommonAncestor = (a: Node, b: Node) => {
|
|
907
|
+
let ps: Node | null = a;
|
|
908
|
+
|
|
909
|
+
while (ps) {
|
|
910
|
+
let pe: Node | null = b;
|
|
911
|
+
|
|
912
|
+
while (pe && ps !== pe) {
|
|
913
|
+
pe = pe.parentNode;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
if (ps === pe) {
|
|
917
|
+
break;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
ps = ps.parentNode;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if (!ps && a.ownerDocument) {
|
|
924
|
+
return a.ownerDocument.documentElement;
|
|
925
|
+
} else {
|
|
926
|
+
return ps;
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
const isEmpty = (node: Node, elements?: Record<string, boolean>, options?: Empty.IsEmptyOptions) => {
|
|
931
|
+
if (Type.isPlainObject(elements)) {
|
|
932
|
+
const isContent = (node: Node): boolean => {
|
|
933
|
+
const name = node.nodeName.toLowerCase();
|
|
934
|
+
return Boolean(elements[name]);
|
|
935
|
+
};
|
|
936
|
+
return Empty.isEmptyNode(schema, node, { ...options, isContent });
|
|
937
|
+
} else {
|
|
938
|
+
return Empty.isEmptyNode(schema, node, options);
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
const createRng = () => doc.createRange();
|
|
943
|
+
|
|
944
|
+
const split = <T extends Node>(parentElm: Node, splitElm: T, replacementElm?: T): T | undefined => {
|
|
945
|
+
let range = createRng();
|
|
946
|
+
let beforeFragment: DocumentFragment;
|
|
947
|
+
let afterFragment: DocumentFragment;
|
|
948
|
+
|
|
949
|
+
if (parentElm && splitElm && parentElm.parentNode && splitElm.parentNode) {
|
|
950
|
+
const parentNode = parentElm.parentNode;
|
|
951
|
+
// Get before chunk
|
|
952
|
+
range.setStart(parentNode, findNodeIndex(parentElm));
|
|
953
|
+
range.setEnd(splitElm.parentNode, findNodeIndex(splitElm));
|
|
954
|
+
beforeFragment = range.extractContents();
|
|
955
|
+
|
|
956
|
+
// Get after chunk
|
|
957
|
+
range = createRng();
|
|
958
|
+
range.setStart(splitElm.parentNode, findNodeIndex(splitElm) + 1);
|
|
959
|
+
range.setEnd(parentNode, findNodeIndex(parentElm) + 1);
|
|
960
|
+
afterFragment = range.extractContents();
|
|
961
|
+
|
|
962
|
+
// Insert before chunk
|
|
963
|
+
parentNode.insertBefore(TrimNode.trimNode(self, beforeFragment, schema), parentElm);
|
|
964
|
+
|
|
965
|
+
// Insert middle chunk
|
|
966
|
+
if (replacementElm) {
|
|
967
|
+
parentNode.insertBefore(replacementElm, parentElm);
|
|
968
|
+
// pa.replaceChild(replacementElm, splitElm);
|
|
969
|
+
} else {
|
|
970
|
+
parentNode.insertBefore(splitElm, parentElm);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
// Insert after chunk
|
|
974
|
+
parentNode.insertBefore(TrimNode.trimNode(self, afterFragment, schema), parentElm);
|
|
975
|
+
remove(parentElm);
|
|
976
|
+
|
|
977
|
+
return replacementElm || splitElm;
|
|
978
|
+
} else {
|
|
979
|
+
return undefined;
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
const bind = <K extends string>(target: Target | Target[], name: K, func: Callback<K>, scope?: any): Callback<K> | Callback<K>[] => {
|
|
984
|
+
if (Type.isArray(target)) {
|
|
985
|
+
let i = target.length;
|
|
986
|
+
const rv: Callback<K>[] = [];
|
|
987
|
+
|
|
988
|
+
while (i--) {
|
|
989
|
+
rv[i] = bind(target[i], name, func, scope) as Callback<K>;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
return rv;
|
|
993
|
+
} else {
|
|
994
|
+
// Collect all window/document events bound by editor instance
|
|
995
|
+
if (settings.collect && (target === doc || target === win)) {
|
|
996
|
+
boundEvents.push([ target, name, func, scope ]);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
return events.bind(target, name, func, scope || self);
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
const unbind = <K extends string>(target: Target | Target[], name: K, func: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils | EventUtils[] => {
|
|
1004
|
+
if (Type.isArray(target)) {
|
|
1005
|
+
let i = target.length;
|
|
1006
|
+
const rv = [] as EventUtils[];
|
|
1007
|
+
|
|
1008
|
+
while (i--) {
|
|
1009
|
+
rv[i] = unbind(target[i], name, func) as EventUtils;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
return rv;
|
|
1013
|
+
} else {
|
|
1014
|
+
// Remove any bound events matching the input
|
|
1015
|
+
if (boundEvents.length > 0 && (target === doc || target === win)) {
|
|
1016
|
+
let i = boundEvents.length;
|
|
1017
|
+
|
|
1018
|
+
while (i--) {
|
|
1019
|
+
const [ boundTarget, boundName, boundFunc ] = boundEvents[i];
|
|
1020
|
+
|
|
1021
|
+
if (target === boundTarget && (!name || name === boundName) && (!func || func === boundFunc)) {
|
|
1022
|
+
events.unbind(boundTarget, boundName, boundFunc);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
return events.unbind(target, name, func);
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
const dispatch = (target: Target, name: string, evt?: {}) => events.dispatch(target, name, evt);
|
|
1031
|
+
const fire = (target: Target, name: string, evt?: {}) => events.dispatch(target, name, evt);
|
|
1032
|
+
|
|
1033
|
+
const getContentEditable = (node: Node) => {
|
|
1034
|
+
if (node && NodeType.isHTMLElement(node)) {
|
|
1035
|
+
// Check for fake content editable
|
|
1036
|
+
const contentEditable = node.getAttribute('data-mce-contenteditable');
|
|
1037
|
+
if (contentEditable && contentEditable !== 'inherit') {
|
|
1038
|
+
return contentEditable;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// Check for real content editable
|
|
1042
|
+
return node.contentEditable !== 'inherit' ? node.contentEditable : null;
|
|
1043
|
+
} else {
|
|
1044
|
+
return null;
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
const getContentEditableParent = (node: Node) => {
|
|
1049
|
+
const root = getRoot();
|
|
1050
|
+
let state: string | null = null;
|
|
1051
|
+
|
|
1052
|
+
for (let tempNode: Node | null = node; tempNode && tempNode !== root; tempNode = tempNode.parentNode) {
|
|
1053
|
+
state = getContentEditable(tempNode);
|
|
1054
|
+
|
|
1055
|
+
if (state !== null) {
|
|
1056
|
+
break;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
return state;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
const isEditable = (node: Node | null | undefined) => {
|
|
1064
|
+
if (Type.isNonNullable(node)) {
|
|
1065
|
+
const scope = NodeType.isElement(node) ? node : node.parentElement;
|
|
1066
|
+
return Type.isNonNullable(scope) && NodeType.isHTMLElement(scope) && ContentEditable.isEditable(SugarElement.fromDom(scope));
|
|
1067
|
+
} else {
|
|
1068
|
+
return false;
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
const destroy = () => {
|
|
1073
|
+
// Unbind all events bound to window/document by editor instance
|
|
1074
|
+
if (boundEvents.length > 0) {
|
|
1075
|
+
let i = boundEvents.length;
|
|
1076
|
+
|
|
1077
|
+
while (i--) {
|
|
1078
|
+
const [ boundTarget, boundName, boundFunc ] = boundEvents[i];
|
|
1079
|
+
events.unbind(boundTarget, boundName, boundFunc);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// Remove CSS files added to the dom
|
|
1084
|
+
Obj.each(files, (_, url) => {
|
|
1085
|
+
styleSheetLoader.unload(url);
|
|
1086
|
+
delete files[url];
|
|
1087
|
+
});
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
const isChildOf = (node: Node, parent: Node) => {
|
|
1091
|
+
return node === parent || parent.contains(node);
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
const dumpRng = (r: Range) => (
|
|
1095
|
+
'startContainer: ' + r.startContainer.nodeName +
|
|
1096
|
+
', startOffset: ' + r.startOffset +
|
|
1097
|
+
', endContainer: ' + r.endContainer.nodeName +
|
|
1098
|
+
', endOffset: ' + r.endOffset
|
|
1099
|
+
);
|
|
1100
|
+
|
|
1101
|
+
const self: DOMUtils = {
|
|
1102
|
+
doc,
|
|
1103
|
+
settings,
|
|
1104
|
+
win,
|
|
1105
|
+
files,
|
|
1106
|
+
stdMode,
|
|
1107
|
+
boxModel,
|
|
1108
|
+
styleSheetLoader,
|
|
1109
|
+
boundEvents,
|
|
1110
|
+
styles,
|
|
1111
|
+
schema,
|
|
1112
|
+
events,
|
|
1113
|
+
isBlock: isBlock as DOMUtils['isBlock'],
|
|
1114
|
+
|
|
1115
|
+
root: null,
|
|
1116
|
+
|
|
1117
|
+
clone,
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not
|
|
1121
|
+
* go above the point of this root node.
|
|
1122
|
+
*
|
|
1123
|
+
* @method getRoot
|
|
1124
|
+
* @return {Element} Root element for the utility class.
|
|
1125
|
+
*/
|
|
1126
|
+
getRoot,
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Returns the viewport of the window.
|
|
1130
|
+
*
|
|
1131
|
+
* @method getViewPort
|
|
1132
|
+
* @param {Window} win Optional window to get viewport of.
|
|
1133
|
+
* @return {Object} Viewport object with fields x, y, w and h.
|
|
1134
|
+
*/
|
|
1135
|
+
getViewPort,
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Returns the rectangle for a specific element.
|
|
1139
|
+
*
|
|
1140
|
+
* @method getRect
|
|
1141
|
+
* @param {Element/String} elm Element object or element ID to get rectangle from.
|
|
1142
|
+
* @return {Object} Rectangle for specified element object with x, y, w, h fields.
|
|
1143
|
+
*/
|
|
1144
|
+
getRect,
|
|
1145
|
+
|
|
1146
|
+
/**
|
|
1147
|
+
* Returns the size dimensions of the specified element.
|
|
1148
|
+
*
|
|
1149
|
+
* @method getSize
|
|
1150
|
+
* @param {Element/String} elm Element object or element ID to get rectangle from.
|
|
1151
|
+
* @return {Object} Rectangle for specified element object with w, h fields.
|
|
1152
|
+
*/
|
|
1153
|
+
getSize,
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Returns a node by the specified selector function. This function will
|
|
1157
|
+
* loop through all parent nodes and call the specified function for each node.
|
|
1158
|
+
* If the function then returns true indicating that it has found what it was looking for, the loop execution will then end
|
|
1159
|
+
* and the node it found will be returned.
|
|
1160
|
+
*
|
|
1161
|
+
* @method getParent
|
|
1162
|
+
* @param {Node/String} node DOM node to search parents on or ID string.
|
|
1163
|
+
* @param {Function} selector Selection function or CSS selector to execute on each node.
|
|
1164
|
+
* @param {Node} root Optional root element, never go beyond this point.
|
|
1165
|
+
* @return {Node} DOM Node or null if it wasn't found.
|
|
1166
|
+
*/
|
|
1167
|
+
getParent,
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Returns a node list of all parents matching the specified selector function or pattern.
|
|
1171
|
+
* If the function then returns true indicating that it has found what it was looking for and that node will be collected.
|
|
1172
|
+
*
|
|
1173
|
+
* @method getParents
|
|
1174
|
+
* @param {Node/String} node DOM node to search parents on or ID string.
|
|
1175
|
+
* @param {Function} selector Selection function to execute on each node or CSS pattern.
|
|
1176
|
+
* @param {Node} root Optional root element, never go beyond this point.
|
|
1177
|
+
* @return {Array} Array of nodes or null if it wasn't found.
|
|
1178
|
+
*/
|
|
1179
|
+
getParents: getParents as DOMUtils['getParents'],
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Returns the specified element by ID or the input element if it isn't a string.
|
|
1183
|
+
*
|
|
1184
|
+
* @method get
|
|
1185
|
+
* @param {String/Element} n Element id to look for or element to just pass though.
|
|
1186
|
+
* @return {Element} Element matching the specified id or null if it wasn't found.
|
|
1187
|
+
*/
|
|
1188
|
+
get,
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Returns the next node that matches selector or function
|
|
1192
|
+
*
|
|
1193
|
+
* @method getNext
|
|
1194
|
+
* @param {Node} node Node to find siblings from.
|
|
1195
|
+
* @param {String/function} selector Selector CSS expression or function.
|
|
1196
|
+
* @return {Node} Next node item matching the selector or null if it wasn't found.
|
|
1197
|
+
*/
|
|
1198
|
+
getNext,
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Returns the previous node that matches selector or function
|
|
1202
|
+
*
|
|
1203
|
+
* @method getPrev
|
|
1204
|
+
* @param {Node} node Node to find siblings from.
|
|
1205
|
+
* @param {String/function} selector Selector CSS expression or function.
|
|
1206
|
+
* @return {Node} Previous node item matching the selector or null if it wasn't found.
|
|
1207
|
+
*/
|
|
1208
|
+
getPrev,
|
|
1209
|
+
|
|
1210
|
+
// #ifndef jquery
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Returns a list of the elements specified by the given CSS selector. For example: `div#a1 p.test`
|
|
1214
|
+
*
|
|
1215
|
+
* @method select
|
|
1216
|
+
* @param {String} selector Target CSS selector.
|
|
1217
|
+
* @param {Object} scope Optional root element/scope element to search in.
|
|
1218
|
+
* @return {Array} Array with all matched elements.
|
|
1219
|
+
* @example
|
|
1220
|
+
* // Adds a class to all paragraphs in the currently active editor
|
|
1221
|
+
* tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass');
|
|
1222
|
+
*
|
|
1223
|
+
* // Adds a class to all spans that have the test class in the currently active editor
|
|
1224
|
+
* tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass')
|
|
1225
|
+
*/
|
|
1226
|
+
select,
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* Returns true/false if the specified element matches the specified css pattern.
|
|
1230
|
+
*
|
|
1231
|
+
* @method is
|
|
1232
|
+
* @param {Node/NodeList} elm DOM node to match or an array of nodes to match.
|
|
1233
|
+
* @param {String} selector CSS pattern to match the element against.
|
|
1234
|
+
*/
|
|
1235
|
+
is,
|
|
1236
|
+
|
|
1237
|
+
// #endif
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Adds the specified element to another element or elements.
|
|
1241
|
+
*
|
|
1242
|
+
* @method add
|
|
1243
|
+
* @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to.
|
|
1244
|
+
* @param {String/Element} name Name of new element to add or existing element to add.
|
|
1245
|
+
* @param {Object} attrs Optional object collection with arguments to add to the new element(s).
|
|
1246
|
+
* @param {String} html Optional inner HTML contents to add for each element.
|
|
1247
|
+
* @param {Boolean} create Optional flag if the element should be created or added.
|
|
1248
|
+
* @return {Element/Array} Element that got created, or an array of created elements if multiple input elements
|
|
1249
|
+
* were passed in.
|
|
1250
|
+
* @example
|
|
1251
|
+
* // Adds a new paragraph to the end of the active editor
|
|
1252
|
+
* tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', { title: 'my title' }, 'Some content');
|
|
1253
|
+
*/
|
|
1254
|
+
add,
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* Creates a new element.
|
|
1258
|
+
*
|
|
1259
|
+
* @method create
|
|
1260
|
+
* @param {String} name Name of new element.
|
|
1261
|
+
* @param {Object} attrs Optional object name/value collection with element attributes.
|
|
1262
|
+
* @param {String} html Optional HTML string to set as inner HTML of the element.
|
|
1263
|
+
* @return {Element} HTML DOM node element that got created.
|
|
1264
|
+
* @example
|
|
1265
|
+
* // Adds an element where the caret/selection is in the active editor
|
|
1266
|
+
* var el = tinymce.activeEditor.dom.create('div', { id: 'test', 'class': 'myclass' }, 'some content');
|
|
1267
|
+
* tinymce.activeEditor.selection.setNode(el);
|
|
1268
|
+
*/
|
|
1269
|
+
create,
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in.
|
|
1273
|
+
*
|
|
1274
|
+
* @method createHTML
|
|
1275
|
+
* @param {String} name Name of new element.
|
|
1276
|
+
* @param {Object} attrs Optional object name/value collection with element attributes.
|
|
1277
|
+
* @param {String} html Optional HTML string to set as inner HTML of the element.
|
|
1278
|
+
* @return {String} String with new HTML element, for example: <a href="#">test</a>.
|
|
1279
|
+
* @example
|
|
1280
|
+
* // Creates a html chunk and inserts it at the current selection/caret location
|
|
1281
|
+
* tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', { href: 'test.html' }, 'some line'));
|
|
1282
|
+
*/
|
|
1283
|
+
createHTML,
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* Creates a document fragment out of the specified HTML string.
|
|
1287
|
+
*
|
|
1288
|
+
* @method createFragment
|
|
1289
|
+
* @param {String} html Html string to create fragment from.
|
|
1290
|
+
* @return {DocumentFragment} Document fragment node.
|
|
1291
|
+
*/
|
|
1292
|
+
createFragment,
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Removes/deletes the specified element(s) from the DOM.
|
|
1296
|
+
*
|
|
1297
|
+
* @method remove
|
|
1298
|
+
* @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids.
|
|
1299
|
+
* @param {Boolean} keepChildren Optional state to keep children or not. If set to true all children will be
|
|
1300
|
+
* placed at the location of the removed element.
|
|
1301
|
+
* @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements
|
|
1302
|
+
* were passed in.
|
|
1303
|
+
* @example
|
|
1304
|
+
* // Removes all paragraphs in the active editor
|
|
1305
|
+
* tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p'));
|
|
1306
|
+
*
|
|
1307
|
+
* // Removes an element by id in the document
|
|
1308
|
+
* tinymce.DOM.remove('mydiv');
|
|
1309
|
+
*/
|
|
1310
|
+
remove,
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Sets the CSS style value on a HTML element. The name can be a camelcase string
|
|
1314
|
+
* or the CSS style name like background-color.
|
|
1315
|
+
*
|
|
1316
|
+
* @method setStyle
|
|
1317
|
+
* @param {String/Element/Array} elm HTML element/Array of elements to set CSS style value on.
|
|
1318
|
+
* @param {String} name Name of the style value to set.
|
|
1319
|
+
* @param {String} value Value to set on the style.
|
|
1320
|
+
* @example
|
|
1321
|
+
* // Sets a style value on all paragraphs in the currently active editor
|
|
1322
|
+
* tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red');
|
|
1323
|
+
*
|
|
1324
|
+
* // Sets a style value to an element by id in the current document
|
|
1325
|
+
* tinymce.DOM.setStyle('mydiv', 'background-color', 'red');
|
|
1326
|
+
*/
|
|
1327
|
+
setStyle,
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* Returns the current style or runtime/computed value of an element.
|
|
1331
|
+
*
|
|
1332
|
+
* @method getStyle
|
|
1333
|
+
* @param {String/Element} elm HTML element or element id string to get style from.
|
|
1334
|
+
* @param {String} name Style name to return.
|
|
1335
|
+
* @param {Boolean} computed Computed style.
|
|
1336
|
+
* @return {String} Current style or computed style value of an element.
|
|
1337
|
+
*/
|
|
1338
|
+
getStyle: getStyle as DOMUtils['getStyle'],
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* Sets multiple styles on the specified element(s).
|
|
1342
|
+
*
|
|
1343
|
+
* @method setStyles
|
|
1344
|
+
* @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set styles on.
|
|
1345
|
+
* @param {Object} styles Name/Value collection of style items to add to the element(s).
|
|
1346
|
+
* @example
|
|
1347
|
+
* // Sets styles on all paragraphs in the currently active editor
|
|
1348
|
+
* tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), { 'background-color': 'red', 'color': 'green' });
|
|
1349
|
+
*
|
|
1350
|
+
* // Sets styles to an element by id in the current document
|
|
1351
|
+
* tinymce.DOM.setStyles('mydiv', { 'background-color': 'red', 'color': 'green' });
|
|
1352
|
+
*/
|
|
1353
|
+
setStyles,
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Removes all attributes from an element or elements.
|
|
1357
|
+
*
|
|
1358
|
+
* @method removeAllAttribs
|
|
1359
|
+
* @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from.
|
|
1360
|
+
*/
|
|
1361
|
+
removeAllAttribs,
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Sets the specified attribute of an element or elements.
|
|
1365
|
+
*
|
|
1366
|
+
* @method setAttrib
|
|
1367
|
+
* @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attribute on.
|
|
1368
|
+
* @param {String} name Name of attribute to set.
|
|
1369
|
+
* @param {String} value Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove
|
|
1370
|
+
* the attribute instead.
|
|
1371
|
+
* @example
|
|
1372
|
+
* // Sets class attribute on all paragraphs in the active editor
|
|
1373
|
+
* tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');
|
|
1374
|
+
*
|
|
1375
|
+
* // Sets class attribute on a specific element in the current page
|
|
1376
|
+
* tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
|
|
1377
|
+
*/
|
|
1378
|
+
setAttrib,
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* Sets two or more specified attributes of an element or elements.
|
|
1382
|
+
*
|
|
1383
|
+
* @method setAttribs
|
|
1384
|
+
* @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on.
|
|
1385
|
+
* @param {Object} attrs Name/Value collection of attribute items to add to the element(s).
|
|
1386
|
+
* @example
|
|
1387
|
+
* // Sets class and title attributes on all paragraphs in the active editor
|
|
1388
|
+
* tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), { 'class': 'myclass', title: 'some title' });
|
|
1389
|
+
*
|
|
1390
|
+
* // Sets class and title attributes on a specific element in the current page
|
|
1391
|
+
* tinymce.DOM.setAttribs('mydiv', { 'class': 'myclass', title: 'some title' });
|
|
1392
|
+
*/
|
|
1393
|
+
setAttribs,
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Returns the specified attribute by name.
|
|
1397
|
+
*
|
|
1398
|
+
* @method getAttrib
|
|
1399
|
+
* @param {String/Element} elm Element string id or DOM element to get attribute from.
|
|
1400
|
+
* @param {String} name Name of attribute to get.
|
|
1401
|
+
* @param {String} defaultVal Optional default value to return if the attribute didn't exist.
|
|
1402
|
+
* @return {String} Attribute value string, default value or null if the attribute wasn't found.
|
|
1403
|
+
*/
|
|
1404
|
+
getAttrib,
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields.
|
|
1408
|
+
*
|
|
1409
|
+
* @method getPos
|
|
1410
|
+
* @param {Element/String} elm HTML element or element id to get x, y position from.
|
|
1411
|
+
* @param {Element} rootElm Optional root element to stop calculations at.
|
|
1412
|
+
* @return {Object} Absolute position of the specified element object with x, y fields.
|
|
1413
|
+
*/
|
|
1414
|
+
getPos,
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Parses the specified style value into an object collection. This parser will also
|
|
1418
|
+
* merge and remove any redundant items that browsers might have added. It will also convert non-hex
|
|
1419
|
+
* colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings.
|
|
1420
|
+
*
|
|
1421
|
+
* @method parseStyle
|
|
1422
|
+
* @param {String} cssText Style value to parse, for example: border:1px solid red;.
|
|
1423
|
+
* @return {Object} Object representation of that style, for example: {border: '1px solid red'}
|
|
1424
|
+
*/
|
|
1425
|
+
parseStyle,
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Serializes the specified style object into a string.
|
|
1429
|
+
*
|
|
1430
|
+
* @method serializeStyle
|
|
1431
|
+
* @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'}
|
|
1432
|
+
* @param {String} name Optional element name.
|
|
1433
|
+
* @return {String} String representation of the style object, for example: border: 1px solid red.
|
|
1434
|
+
*/
|
|
1435
|
+
serializeStyle,
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* Adds a style element at the top of the document with the specified cssText content.
|
|
1439
|
+
*
|
|
1440
|
+
* @method addStyle
|
|
1441
|
+
* @param {String} cssText CSS Text style to add to top of head of document.
|
|
1442
|
+
*/
|
|
1443
|
+
addStyle,
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* Imports/loads the specified CSS file into the document bound to the class.
|
|
1447
|
+
*
|
|
1448
|
+
* @method loadCSS
|
|
1449
|
+
* @param {String} url URL to CSS file to load.
|
|
1450
|
+
* @example
|
|
1451
|
+
* // Loads a CSS file dynamically into the current document
|
|
1452
|
+
* tinymce.DOM.loadCSS('somepath/some.css');
|
|
1453
|
+
*
|
|
1454
|
+
* // Loads a CSS file into the currently active editor instance
|
|
1455
|
+
* tinymce.activeEditor.dom.loadCSS('somepath/some.css');
|
|
1456
|
+
*
|
|
1457
|
+
* // Loads a CSS file into an editor instance by id
|
|
1458
|
+
* tinymce.get('someid').dom.loadCSS('somepath/some.css');
|
|
1459
|
+
*
|
|
1460
|
+
* // Loads multiple CSS files into the current document
|
|
1461
|
+
* tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css');
|
|
1462
|
+
*/
|
|
1463
|
+
loadCSS,
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Adds a class to the specified element or elements.
|
|
1467
|
+
*
|
|
1468
|
+
* @method addClass
|
|
1469
|
+
* @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
|
|
1470
|
+
* @param {String} cls Class name to add to each element.
|
|
1471
|
+
* @return {String/Array} String with new class value or array with new class values for all elements.
|
|
1472
|
+
* @example
|
|
1473
|
+
* // Adds a class to all paragraphs in the active editor
|
|
1474
|
+
* tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass');
|
|
1475
|
+
*
|
|
1476
|
+
* // Adds a class to a specific element in the current page
|
|
1477
|
+
* tinymce.DOM.addClass('mydiv', 'myclass');
|
|
1478
|
+
*/
|
|
1479
|
+
addClass,
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Removes a class from the specified element or elements.
|
|
1483
|
+
*
|
|
1484
|
+
* @method removeClass
|
|
1485
|
+
* @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs.
|
|
1486
|
+
* @param {String} cls Class name to remove from each element.
|
|
1487
|
+
* @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements
|
|
1488
|
+
* were passed in.
|
|
1489
|
+
* @example
|
|
1490
|
+
* // Removes a class from all paragraphs in the active editor
|
|
1491
|
+
* tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass');
|
|
1492
|
+
*
|
|
1493
|
+
* // Removes a class from a specific element in the current page
|
|
1494
|
+
* tinymce.DOM.removeClass('mydiv', 'myclass');
|
|
1495
|
+
*/
|
|
1496
|
+
removeClass,
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Returns true if the specified element has the specified class.
|
|
1500
|
+
*
|
|
1501
|
+
* @method hasClass
|
|
1502
|
+
* @param {String/Element} elm HTML element or element id string to check CSS class on.
|
|
1503
|
+
* @param {String} cls CSS class to check for.
|
|
1504
|
+
* @return {Boolean} true/false if the specified element has the specified class.
|
|
1505
|
+
*/
|
|
1506
|
+
hasClass,
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Toggles the specified class on/off.
|
|
1510
|
+
*
|
|
1511
|
+
* @method toggleClass
|
|
1512
|
+
* @param {Element} elm Element to toggle class on.
|
|
1513
|
+
* @param {String} cls Class to toggle on/off.
|
|
1514
|
+
* @param {Boolean} state Optional state to set.
|
|
1515
|
+
*/
|
|
1516
|
+
toggleClass,
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* Shows the specified element(s) by ID by setting the "display" style.
|
|
1520
|
+
*
|
|
1521
|
+
* @method show
|
|
1522
|
+
* @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show.
|
|
1523
|
+
*/
|
|
1524
|
+
show,
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* Hides the specified element(s) by ID by setting the "display" style.
|
|
1528
|
+
*
|
|
1529
|
+
* @method hide
|
|
1530
|
+
* @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to hide.
|
|
1531
|
+
* @example
|
|
1532
|
+
* // Hides an element by id in the document
|
|
1533
|
+
* tinymce.DOM.hide('myid');
|
|
1534
|
+
*/
|
|
1535
|
+
hide,
|
|
1536
|
+
|
|
1537
|
+
/**
|
|
1538
|
+
* Returns true/false if the element is hidden or not by checking the "display" style.
|
|
1539
|
+
*
|
|
1540
|
+
* @method isHidden
|
|
1541
|
+
* @param {String/Element} elm Id or element to check display state on.
|
|
1542
|
+
* @return {Boolean} true/false if the element is hidden or not.
|
|
1543
|
+
*/
|
|
1544
|
+
isHidden,
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Returns a unique id. This can be useful when generating elements on the fly.
|
|
1548
|
+
* This method will not check if the element already exists.
|
|
1549
|
+
*
|
|
1550
|
+
* @method uniqueId
|
|
1551
|
+
* @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_".
|
|
1552
|
+
* @return {String} Unique id.
|
|
1553
|
+
*/
|
|
1554
|
+
uniqueId,
|
|
1555
|
+
|
|
1556
|
+
/**
|
|
1557
|
+
* Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means
|
|
1558
|
+
* URLs will get converted, hex color values fixed etc. Check processHTML for details.
|
|
1559
|
+
*
|
|
1560
|
+
* @method setHTML
|
|
1561
|
+
* @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set HTML inside of.
|
|
1562
|
+
* @param {String} html HTML content to set as inner HTML of the element.
|
|
1563
|
+
* @example
|
|
1564
|
+
* // Sets the inner HTML of all paragraphs in the active editor
|
|
1565
|
+
* tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html');
|
|
1566
|
+
*
|
|
1567
|
+
* // Sets the inner HTML of an element by id in the document
|
|
1568
|
+
* tinymce.DOM.setHTML('mydiv', 'some inner html');
|
|
1569
|
+
*/
|
|
1570
|
+
setHTML,
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Returns the outer HTML of an element.
|
|
1574
|
+
*
|
|
1575
|
+
* @method getOuterHTML
|
|
1576
|
+
* @param {String/Element} elm Element ID or element object to get outer HTML from.
|
|
1577
|
+
* @return {String} Outer HTML string.
|
|
1578
|
+
* @example
|
|
1579
|
+
* tinymce.DOM.getOuterHTML(editorElement);
|
|
1580
|
+
* tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody());
|
|
1581
|
+
*/
|
|
1582
|
+
getOuterHTML,
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* Sets the specified outer HTML on an element or elements.
|
|
1586
|
+
*
|
|
1587
|
+
* @method setOuterHTML
|
|
1588
|
+
* @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on.
|
|
1589
|
+
* @param {Object} html HTML code to set as outer value for the element.
|
|
1590
|
+
* @example
|
|
1591
|
+
* // Sets the outer HTML of all paragraphs in the active editor
|
|
1592
|
+
* tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '<div>some html</div>');
|
|
1593
|
+
*
|
|
1594
|
+
* // Sets the outer HTML of an element by id in the document
|
|
1595
|
+
* tinymce.DOM.setOuterHTML('mydiv', '<div>some html</div>');
|
|
1596
|
+
*/
|
|
1597
|
+
setOuterHTML,
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Entity decodes a string. This method decodes any HTML entities, such as `&aring;`.
|
|
1601
|
+
*
|
|
1602
|
+
* @method decode
|
|
1603
|
+
* @param {String} s String to decode entities on.
|
|
1604
|
+
* @return {String} Entity decoded string.
|
|
1605
|
+
*/
|
|
1606
|
+
decode,
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* Entity encodes a string. This method encodes the most common entities, such as `<`, `>`, `"` and `&`.
|
|
1610
|
+
*
|
|
1611
|
+
* @method encode
|
|
1612
|
+
* @param {String} text String to encode with entities.
|
|
1613
|
+
* @return {String} Entity encoded string.
|
|
1614
|
+
*/
|
|
1615
|
+
encode,
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* Inserts an element after the reference element.
|
|
1619
|
+
*
|
|
1620
|
+
* @method insertAfter
|
|
1621
|
+
* @param {Element} node Element to insert after the reference.
|
|
1622
|
+
* @param {Element/String/Array} referenceNode Reference element, element id or array of elements to insert after.
|
|
1623
|
+
* @return {Element/Array} Element that got added or an array with elements.
|
|
1624
|
+
*/
|
|
1625
|
+
insertAfter,
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* Replaces the specified element or elements with the new element specified. The new element will
|
|
1629
|
+
* be cloned if multiple input elements are passed in.
|
|
1630
|
+
*
|
|
1631
|
+
* @method replace
|
|
1632
|
+
* @param {Element} newElm New element to replace old ones with.
|
|
1633
|
+
* @param {Element/String/Array} oldElm Element DOM node, element id or array of elements or ids to replace.
|
|
1634
|
+
* @param {Boolean} keepChildren Optional keep children state, if set to true child nodes from the old object will be added
|
|
1635
|
+
* to new ones.
|
|
1636
|
+
*/
|
|
1637
|
+
replace,
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Renames the specified element and keeps its attributes and children.
|
|
1641
|
+
*
|
|
1642
|
+
* @method rename
|
|
1643
|
+
* @param {Element} elm Element to rename.
|
|
1644
|
+
* @param {String} name Name of the new element.
|
|
1645
|
+
* @return {Element} New element or the old element if it needed renaming.
|
|
1646
|
+
*/
|
|
1647
|
+
rename,
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
|
|
1651
|
+
*
|
|
1652
|
+
* @method findCommonAncestor
|
|
1653
|
+
* @param {Element} a Element to find common ancestor of.
|
|
1654
|
+
* @param {Element} b Element to find common ancestor of.
|
|
1655
|
+
* @return {Element} Common ancestor element of the two input elements.
|
|
1656
|
+
*/
|
|
1657
|
+
findCommonAncestor,
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Executes the specified function on the element by id or dom element node or array of elements/id.
|
|
1661
|
+
*
|
|
1662
|
+
* @method run
|
|
1663
|
+
* @param {String/Element/Array} elm ID or DOM element object or array with ids or elements.
|
|
1664
|
+
* @param {Function} func Function to execute for each item.
|
|
1665
|
+
* @param {Object} scope Optional scope to execute the function in.
|
|
1666
|
+
* @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in.
|
|
1667
|
+
*/
|
|
1668
|
+
run,
|
|
1669
|
+
|
|
1670
|
+
/**
|
|
1671
|
+
* Returns a NodeList with attributes for the element.
|
|
1672
|
+
*
|
|
1673
|
+
* @method getAttribs
|
|
1674
|
+
* @param {HTMLElement/string} elm Element node or string id to get attributes from.
|
|
1675
|
+
* @return {NodeList} NodeList with attributes.
|
|
1676
|
+
*/
|
|
1677
|
+
getAttribs,
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* Returns true/false if the specified node is to be considered empty or not.
|
|
1681
|
+
*
|
|
1682
|
+
* @method isEmpty
|
|
1683
|
+
* @param {Node} node The target node to check if it's empty.
|
|
1684
|
+
* @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements.
|
|
1685
|
+
* @return {Boolean} true/false if the node is empty or not.
|
|
1686
|
+
* @example
|
|
1687
|
+
* tinymce.DOM.isEmpty(node, { img: true });
|
|
1688
|
+
*/
|
|
1689
|
+
isEmpty,
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Creates a new DOM Range object. This will use the native DOM Range API if it's
|
|
1693
|
+
* available. If it's not, it will fall back to the custom TinyMCE implementation.
|
|
1694
|
+
*
|
|
1695
|
+
* @method createRng
|
|
1696
|
+
* @return {DOMRange} DOM Range object.
|
|
1697
|
+
* @example
|
|
1698
|
+
* const rng = tinymce.DOM.createRng();
|
|
1699
|
+
* alert(rng.startContainer + "," + rng.startOffset);
|
|
1700
|
+
*/
|
|
1701
|
+
createRng,
|
|
1702
|
+
|
|
1703
|
+
/**
|
|
1704
|
+
* Returns the index of the specified node within its parent.
|
|
1705
|
+
*
|
|
1706
|
+
* @method nodeIndex
|
|
1707
|
+
* @param {Node} node Node to look for.
|
|
1708
|
+
* @param {Boolean} normalized Optional true/false state if the index is what it would be after a normalization.
|
|
1709
|
+
* @return {Number} Index of the specified node.
|
|
1710
|
+
*/
|
|
1711
|
+
nodeIndex: findNodeIndex,
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Splits an element into two new elements and places the specified split
|
|
1715
|
+
* element or elements between the new ones. For example splitting the paragraph at the bold element in
|
|
1716
|
+
* this example `<p>abc<b>abc</b>123</p>` would produce `<p>abc</p><b>abc</b><p>123</p>`.
|
|
1717
|
+
*
|
|
1718
|
+
* @method split
|
|
1719
|
+
* @param {Element} parentElm Parent element to split.
|
|
1720
|
+
* @param {Element} splitElm Element to split at.
|
|
1721
|
+
* @param {Element} replacementElm Optional replacement element to replace the split element with.
|
|
1722
|
+
* @return {Element} Returns the split element or the replacement element if that is specified.
|
|
1723
|
+
*/
|
|
1724
|
+
split,
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Adds an event handler to the specified object.
|
|
1728
|
+
*
|
|
1729
|
+
* @method bind
|
|
1730
|
+
* @param {Element/Document/Window/Array} target Target element to bind events to.
|
|
1731
|
+
* handler to or an array of elements/ids/documents.
|
|
1732
|
+
* @param {String} name Name of event handler to add, for example: click.
|
|
1733
|
+
* @param {Function} func Function to execute when the event occurs.
|
|
1734
|
+
* @param {Object} scope Optional scope to execute the function in.
|
|
1735
|
+
* @return {Function} Function callback handler the same as the one passed in.
|
|
1736
|
+
*/
|
|
1737
|
+
bind: bind as DOMUtils['bind'],
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* Removes the specified event handler by name and function from an element or collection of elements.
|
|
1741
|
+
*
|
|
1742
|
+
* @method unbind
|
|
1743
|
+
* @param {Element/Document/Window/Array} target Target element to unbind events on.
|
|
1744
|
+
* @param {String} name Event handler name, for example: "click"
|
|
1745
|
+
* @param {Function} func Function to remove.
|
|
1746
|
+
* @return {Boolean/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements
|
|
1747
|
+
* were passed in.
|
|
1748
|
+
*/
|
|
1749
|
+
unbind: unbind as DOMUtils['unbind'],
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Fires the specified event name and optional object on the specified target.
|
|
1753
|
+
* <br>
|
|
1754
|
+
* <em>Deprecated in TinyMCE 6.0 and has been marked for removal in TinyMCE 7.0. Use <code>dispatch</code> instead.</em>
|
|
1755
|
+
*
|
|
1756
|
+
* @method fire
|
|
1757
|
+
* @param {Node/Document/Window} target Target element or object to fire event on.
|
|
1758
|
+
* @param {String} name Event name to fire.
|
|
1759
|
+
* @param {Object} evt Event object to send.
|
|
1760
|
+
* @return {Event} Event object.
|
|
1761
|
+
* @deprecated Use dispatch() instead
|
|
1762
|
+
*/
|
|
1763
|
+
fire,
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* Dispatches the specified event name and optional object on the specified target.
|
|
1767
|
+
*
|
|
1768
|
+
* @method dispatch
|
|
1769
|
+
* @param {Node/Document/Window} target Target element or object to dispatch event on.
|
|
1770
|
+
* @param {String} name Name of the event to fire.
|
|
1771
|
+
* @param {Object} evt Event object to send.
|
|
1772
|
+
* @return {Event} Event object.
|
|
1773
|
+
*/
|
|
1774
|
+
dispatch,
|
|
1775
|
+
|
|
1776
|
+
// Returns the content editable state of a node
|
|
1777
|
+
getContentEditable,
|
|
1778
|
+
getContentEditableParent,
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Checks if the specified node is editable within the given context of its parents.
|
|
1782
|
+
*
|
|
1783
|
+
* @method isEditable
|
|
1784
|
+
* @param {Node} node Node to check if it's editable.
|
|
1785
|
+
* @return {Boolean} Will be true if the node is editable and false if it's not editable.
|
|
1786
|
+
*/
|
|
1787
|
+
isEditable,
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* Destroys all internal references to the DOM to solve memory leak issues.
|
|
1791
|
+
*
|
|
1792
|
+
* @method destroy
|
|
1793
|
+
*/
|
|
1794
|
+
destroy,
|
|
1795
|
+
isChildOf,
|
|
1796
|
+
dumpRng
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
const attrHooks = setupAttrHooks(styles, settings, Fun.constant(self));
|
|
1800
|
+
|
|
1801
|
+
return self;
|
|
1802
|
+
};
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* Instance of DOMUtils for the current document.
|
|
1806
|
+
*
|
|
1807
|
+
* @static
|
|
1808
|
+
* @property DOM
|
|
1809
|
+
* @type tinymce.dom.DOMUtils
|
|
1810
|
+
* @example
|
|
1811
|
+
* // Example of how to add a class to some element by id
|
|
1812
|
+
* tinymce.DOM.addClass('someid', 'someclass');
|
|
1813
|
+
*/
|
|
1814
|
+
DOMUtils.DOM = DOMUtils(document);
|
|
1815
|
+
DOMUtils.nodeIndex = findNodeIndex;
|
|
1816
|
+
|
|
1817
|
+
export default DOMUtils;
|