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,1380 @@
|
|
|
1
|
+
import { context, describe, it } from '@ephox/bedrock-client';
|
|
2
|
+
import { LegacyUnit, TinyAssertions, TinyHooks, TinySelections } from '@ephox/wrap-mcagar';
|
|
3
|
+
import { assert } from 'chai';
|
|
4
|
+
|
|
5
|
+
import Editor from 'tinymce/core/api/Editor';
|
|
6
|
+
import { GetContentEvent, SetContentEvent } from 'tinymce/core/api/EventTypes';
|
|
7
|
+
import { EditorEvent } from 'tinymce/core/api/util/EventDispatcher';
|
|
8
|
+
import { Bookmark } from 'tinymce/core/bookmark/BookmarkTypes';
|
|
9
|
+
import * as CaretContainer from 'tinymce/core/caret/CaretContainer';
|
|
10
|
+
import * as Zwsp from 'tinymce/core/text/Zwsp';
|
|
11
|
+
|
|
12
|
+
describe('browser.tinymce.core.dom.SelectionTest', () => {
|
|
13
|
+
const hook = TinyHooks.bddSetupLight<Editor>({
|
|
14
|
+
add_unload_trigger: false,
|
|
15
|
+
entities: 'raw',
|
|
16
|
+
valid_styles: {
|
|
17
|
+
'*': 'color,font-size,font-family,background-color,font-weight,font-style,text-decoration,float,margin,' +
|
|
18
|
+
'margin-top,margin-right,margin-bottom,margin-left,display'
|
|
19
|
+
},
|
|
20
|
+
custom_elements: 'custom1,~custom2',
|
|
21
|
+
extended_valid_elements: 'custom1,custom2',
|
|
22
|
+
base_url: '/project/tinymce/js/tinymce'
|
|
23
|
+
}, [], true);
|
|
24
|
+
|
|
25
|
+
it('getContent', () => {
|
|
26
|
+
const editor = hook.editor();
|
|
27
|
+
let rng = editor.dom.createRng();
|
|
28
|
+
let eventObj: EditorEvent<GetContentEvent> | undefined;
|
|
29
|
+
|
|
30
|
+
// Get selected contents
|
|
31
|
+
editor.setContent('<p>text</p>');
|
|
32
|
+
rng.setStart(editor.getBody(), 0);
|
|
33
|
+
rng.setEnd(editor.getBody(), 1);
|
|
34
|
+
editor.selection.setRng(rng);
|
|
35
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>text</p>', 'Get selected contents');
|
|
36
|
+
|
|
37
|
+
// Get selected contents (collapsed)
|
|
38
|
+
editor.setContent('<p>text</p>');
|
|
39
|
+
rng = editor.dom.createRng();
|
|
40
|
+
rng.setStart(editor.getBody(), 0);
|
|
41
|
+
rng.setEnd(editor.getBody(), 0);
|
|
42
|
+
editor.selection.setRng(rng);
|
|
43
|
+
LegacyUnit.equal(editor.selection.getContent(), '', 'Get selected contents (collapsed)');
|
|
44
|
+
|
|
45
|
+
// Get selected contents, onGetContent event
|
|
46
|
+
const handler = (event: EditorEvent<GetContentEvent>) => {
|
|
47
|
+
eventObj = event;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
editor.on('GetContent', handler);
|
|
51
|
+
editor.setContent('<p>text</p>');
|
|
52
|
+
rng = editor.dom.createRng();
|
|
53
|
+
rng.setStart(editor.getBody(), 0);
|
|
54
|
+
rng.setEnd(editor.getBody(), 1);
|
|
55
|
+
editor.selection.setRng(rng);
|
|
56
|
+
editor.selection.getContent();
|
|
57
|
+
LegacyUnit.equal(eventObj?.content, '<p>text</p>', 'Get selected contents, onGetContent event');
|
|
58
|
+
editor.off('GetContent', handler);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('getContent contextual', () => {
|
|
62
|
+
const editor = hook.editor();
|
|
63
|
+
editor.setContent('<p><em>text</em></p>');
|
|
64
|
+
const rng = editor.dom.createRng();
|
|
65
|
+
rng.setStart(editor.dom.select('em')[0].firstChild as Text, 1);
|
|
66
|
+
rng.setEnd(editor.dom.select('em')[0].firstChild as Text, 3);
|
|
67
|
+
editor.selection.setRng(rng);
|
|
68
|
+
LegacyUnit.equal(editor.selection.getContent({ contextual: true }), '<em>ex</em>', 'Get selected contents');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('getContent of zwsp', () => {
|
|
72
|
+
const editor = hook.editor();
|
|
73
|
+
editor.setContent('<p>a' + Zwsp.ZWSP + 'b</p>');
|
|
74
|
+
const rng = editor.dom.createRng();
|
|
75
|
+
rng.setStart(editor.getBody(), 0);
|
|
76
|
+
rng.setEnd(editor.getBody(), 1);
|
|
77
|
+
editor.selection.setRng(rng);
|
|
78
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ab</p>', 'Get selected contents');
|
|
79
|
+
LegacyUnit.equal(editor.selection.getContent({ format: 'text' }), 'ab', 'Get selected contents');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('setContent', () => {
|
|
83
|
+
const editor = hook.editor();
|
|
84
|
+
let rng = editor.dom.createRng();
|
|
85
|
+
let eventObj: EditorEvent<SetContentEvent> | undefined;
|
|
86
|
+
|
|
87
|
+
// Set contents at selection
|
|
88
|
+
editor.setContent('<p>text</p>');
|
|
89
|
+
rng.setStart(editor.getBody(), 0);
|
|
90
|
+
rng.setEnd(editor.getBody(), 1);
|
|
91
|
+
editor.selection.setRng(rng);
|
|
92
|
+
editor.selection.setContent('<div>test</div>');
|
|
93
|
+
LegacyUnit.equal(editor.getContent(), '<div>test</div>', 'Set contents at selection');
|
|
94
|
+
|
|
95
|
+
// Insert XSS at selection
|
|
96
|
+
editor.setContent('<p>text</p>');
|
|
97
|
+
rng = editor.dom.createRng();
|
|
98
|
+
rng.setStart(editor.getBody(), 0);
|
|
99
|
+
rng.setEnd(editor.getBody(), 1);
|
|
100
|
+
editor.selection.setRng(rng);
|
|
101
|
+
editor.selection.setContent('<img src="a" onerror="alert(1)" />');
|
|
102
|
+
LegacyUnit.equal(editor.getContent(), '<p><img src="a"></p>', 'Set XSS at selection');
|
|
103
|
+
|
|
104
|
+
// Set contents at selection (collapsed)
|
|
105
|
+
editor.setContent('<p>text</p>');
|
|
106
|
+
rng = editor.dom.createRng();
|
|
107
|
+
rng.setStart(editor.getBody(), 0);
|
|
108
|
+
rng.setEnd(editor.getBody(), 0);
|
|
109
|
+
editor.selection.setRng(rng);
|
|
110
|
+
editor.selection.setContent('<div>test</div>');
|
|
111
|
+
LegacyUnit.equal(editor.getContent(), '<div>test</div>\n<p>text</p>', 'Set contents at selection (collapsed)');
|
|
112
|
+
|
|
113
|
+
// Insert in middle of paragraph
|
|
114
|
+
editor.setContent('<p>beforeafter</p>');
|
|
115
|
+
rng = editor.dom.createRng();
|
|
116
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 'before'.length);
|
|
117
|
+
rng.setEnd(editor.getBody().firstChild?.firstChild as Text, 'before'.length);
|
|
118
|
+
editor.selection.setRng(rng);
|
|
119
|
+
editor.selection.setContent('<br />');
|
|
120
|
+
LegacyUnit.equal(editor.getContent(), '<p>before<br>after</p>', 'Set contents at selection (inside paragraph)');
|
|
121
|
+
|
|
122
|
+
// Check the caret is left in the correct position.
|
|
123
|
+
rng = editor.selection.getRng();
|
|
124
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild as HTMLParagraphElement, 'Selection start container');
|
|
125
|
+
LegacyUnit.equal(rng.startOffset, 2, 'Selection start offset');
|
|
126
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild as HTMLParagraphElement, 'Selection end container');
|
|
127
|
+
LegacyUnit.equal(rng.endOffset, 2, 'Selection end offset');
|
|
128
|
+
|
|
129
|
+
editor.setContent('<p>text</p>');
|
|
130
|
+
rng = editor.dom.createRng();
|
|
131
|
+
rng.setStart(editor.getBody(), 0);
|
|
132
|
+
rng.setEnd(editor.getBody(), 0);
|
|
133
|
+
editor.selection.setRng(rng);
|
|
134
|
+
editor.selection.setContent('');
|
|
135
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>', 'Set contents to empty at selection (collapsed)');
|
|
136
|
+
rng = editor.selection.getRng();
|
|
137
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody(), 'Selection start container');
|
|
138
|
+
LegacyUnit.equal(rng.startOffset, 0, 'Selection start offset');
|
|
139
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody(), 'Selection end container');
|
|
140
|
+
LegacyUnit.equal(rng.endOffset, 0, 'Selection end offset');
|
|
141
|
+
|
|
142
|
+
// Set selected contents, onSetContent event
|
|
143
|
+
const handler = (event: EditorEvent<SetContentEvent>) => {
|
|
144
|
+
eventObj = event;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
editor.on('SetContent', handler);
|
|
148
|
+
editor.setContent('<p>text</p>');
|
|
149
|
+
rng = editor.dom.createRng();
|
|
150
|
+
rng.setStart(editor.getBody(), 0);
|
|
151
|
+
rng.setEnd(editor.getBody(), 1);
|
|
152
|
+
editor.selection.setRng(rng);
|
|
153
|
+
editor.selection.setContent('<div>text</div>');
|
|
154
|
+
LegacyUnit.equal(eventObj?.content, '<div>text</div>', 'Set selected contents, onSetContent event');
|
|
155
|
+
editor.off('SetContent', handler);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('getStart/getEnd', () => {
|
|
159
|
+
const editor = hook.editor();
|
|
160
|
+
let rng = editor.dom.createRng();
|
|
161
|
+
|
|
162
|
+
// Selected contents
|
|
163
|
+
editor.setContent('<p id="a">text</p><p id="b">text</p>');
|
|
164
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 0);
|
|
165
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 0);
|
|
166
|
+
editor.selection.setRng(rng);
|
|
167
|
+
LegacyUnit.equal(editor.selection.getStart().id, 'a', 'Selected contents (getStart)');
|
|
168
|
+
LegacyUnit.equal(editor.selection.getEnd().id, 'b', 'Selected contents (getEnd)');
|
|
169
|
+
|
|
170
|
+
// Selected contents (collapsed)
|
|
171
|
+
editor.setContent('<p id="a">text</p>\n<p id="b">text</p>');
|
|
172
|
+
rng = editor.dom.createRng();
|
|
173
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 0);
|
|
174
|
+
rng.setEnd(editor.getBody().firstChild?.firstChild as Text, 0);
|
|
175
|
+
editor.selection.setRng(rng);
|
|
176
|
+
LegacyUnit.equal(editor.selection.getStart().id, 'a', 'Selected contents (getStart, collapsed)');
|
|
177
|
+
LegacyUnit.equal(editor.selection.getEnd().id, 'a', 'Selected contents (getEnd, collapsed)');
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('getSelectedBlocks with collapsed selection between elements', () => {
|
|
181
|
+
const editor = hook.editor();
|
|
182
|
+
editor.setContent('<p>a</p><p>b</p><p>c</p>');
|
|
183
|
+
const rng = editor.dom.createRng();
|
|
184
|
+
rng.setStart(editor.getBody(), 1);
|
|
185
|
+
rng.setEnd(editor.getBody(), 1);
|
|
186
|
+
editor.selection.setRng(rng);
|
|
187
|
+
LegacyUnit.equal(editor.selection.getSelectedBlocks().length, 0, 'should return empty array');
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('getStart/getEnd on comment should return parent element', () => {
|
|
191
|
+
const editor = hook.editor();
|
|
192
|
+
editor.setContent('<p><!-- x --></p>');
|
|
193
|
+
const rng = editor.dom.createRng();
|
|
194
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 0);
|
|
195
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 0);
|
|
196
|
+
editor.selection.setRng(rng);
|
|
197
|
+
|
|
198
|
+
LegacyUnit.equal(editor.selection.getStart().nodeName, 'P', 'Node name should be paragraph');
|
|
199
|
+
LegacyUnit.equal(editor.selection.getStart(true).nodeName, 'P', 'Node name should be paragraph');
|
|
200
|
+
LegacyUnit.equal(editor.selection.getEnd().nodeName, 'P', 'Node name should be paragraph');
|
|
201
|
+
LegacyUnit.equal(editor.selection.getEnd(true).nodeName, 'P', 'Node name should be paragraph');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('getBookmark/setBookmark (persistent)', () => {
|
|
205
|
+
const editor = hook.editor();
|
|
206
|
+
let bookmark: Bookmark;
|
|
207
|
+
let rng = editor.dom.createRng();
|
|
208
|
+
|
|
209
|
+
// Get persistent bookmark simple text selection
|
|
210
|
+
editor.setContent('<p>text</p>');
|
|
211
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
212
|
+
rng.setEnd(editor.getBody().firstChild?.firstChild as Text, 3);
|
|
213
|
+
editor.selection.setRng(rng);
|
|
214
|
+
bookmark = editor.selection.getBookmark();
|
|
215
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>', 'Editor contents (text)');
|
|
216
|
+
editor.selection.moveToBookmark(bookmark);
|
|
217
|
+
LegacyUnit.equal(editor.selection.getContent(), 'ex', 'Selected contents (text)');
|
|
218
|
+
|
|
219
|
+
// Get persistent bookmark multiple elements text selection
|
|
220
|
+
editor.setContent('<p>text</p>\n<p>text</p>');
|
|
221
|
+
rng = editor.dom.createRng();
|
|
222
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
223
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 3);
|
|
224
|
+
editor.selection.setRng(rng);
|
|
225
|
+
bookmark = editor.selection.getBookmark();
|
|
226
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>\n<p>text</p>', 'Editor contents (elements)');
|
|
227
|
+
editor.selection.moveToBookmark(bookmark);
|
|
228
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ext</p>\n<p>tex</p>', 'Selected contents (elements)');
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it('getBookmark/setBookmark (simple)', () => {
|
|
232
|
+
const editor = hook.editor();
|
|
233
|
+
let bookmark: Bookmark;
|
|
234
|
+
let rng = editor.dom.createRng();
|
|
235
|
+
|
|
236
|
+
// Get persistent bookmark simple text selection
|
|
237
|
+
editor.setContent('<p>text</p>');
|
|
238
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
239
|
+
rng.setEnd(editor.getBody().firstChild?.firstChild as Text, 3);
|
|
240
|
+
editor.selection.setRng(rng);
|
|
241
|
+
bookmark = editor.selection.getBookmark(1);
|
|
242
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>', 'Editor contents (text)');
|
|
243
|
+
editor.selection.moveToBookmark(bookmark);
|
|
244
|
+
LegacyUnit.equal(editor.selection.getContent(), 'ex', 'Selected contents (text)');
|
|
245
|
+
|
|
246
|
+
// Get persistent bookmark multiple elements text selection
|
|
247
|
+
editor.setContent('<p>text</p>\n<p>text</p>');
|
|
248
|
+
rng = editor.dom.createRng();
|
|
249
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
250
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 3);
|
|
251
|
+
editor.selection.setRng(rng);
|
|
252
|
+
bookmark = editor.selection.getBookmark(1);
|
|
253
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>\n<p>text</p>', 'Editor contents (elements)');
|
|
254
|
+
editor.selection.moveToBookmark(bookmark);
|
|
255
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ext</p>\n<p>tex</p>', 'Selected contents (elements)');
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('getBookmark/setBookmark (nonintrusive) - simple text selection', () => {
|
|
259
|
+
const editor = hook.editor();
|
|
260
|
+
editor.setContent('<p>text</p>');
|
|
261
|
+
const rng = editor.dom.createRng();
|
|
262
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
263
|
+
rng.setEnd(editor.getBody().firstChild?.firstChild as Text, 3);
|
|
264
|
+
editor.selection.setRng(rng);
|
|
265
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
266
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>', 'Editor contents (text)');
|
|
267
|
+
editor.selection.moveToBookmark(bookmark);
|
|
268
|
+
LegacyUnit.equal(editor.selection.getContent(), 'ex', 'Selected contents (text)');
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('getBookmark/setBookmark (nonintrusive) - Get non intrusive bookmark simple element selection', () => {
|
|
272
|
+
const editor = hook.editor();
|
|
273
|
+
// Get non intrusive bookmark simple element selection
|
|
274
|
+
editor.setContent('<p>text<em>a<strong>b</strong>c</em></p>');
|
|
275
|
+
const rng = editor.dom.createRng();
|
|
276
|
+
rng.setStart(editor.dom.select('em')[0], 1);
|
|
277
|
+
rng.setEnd(editor.dom.select('em')[0], 2);
|
|
278
|
+
editor.selection.setRng(rng);
|
|
279
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
280
|
+
editor.selection.moveToBookmark(bookmark);
|
|
281
|
+
LegacyUnit.equal(editor.selection.getContent(), '<strong>b</strong>', 'Selected contents (element)');
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('getBookmark/setBookmark (nonintrusive) - Get non intrusive bookmark multiple elements text selection', () => {
|
|
285
|
+
const editor = hook.editor();
|
|
286
|
+
// Get non intrusive bookmark multiple elements text selection
|
|
287
|
+
editor.setContent('<p>text</p>\n<p>text</p>');
|
|
288
|
+
const rng = editor.dom.createRng();
|
|
289
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
290
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 3);
|
|
291
|
+
editor.selection.setRng(rng);
|
|
292
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
293
|
+
LegacyUnit.equal(editor.getContent(), '<p>text</p>\n<p>text</p>', 'Editor contents (elements)');
|
|
294
|
+
editor.selection.moveToBookmark(bookmark);
|
|
295
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ext</p>\n<p>tex</p>', 'Selected contents (elements)');
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
it('getBookmark/setBookmark (nonintrusive)', () => {
|
|
299
|
+
const editor = hook.editor();
|
|
300
|
+
// Get non intrusive bookmark multiple elements text selection fragmented
|
|
301
|
+
editor.setContent('<p>text</p><p>text</p>');
|
|
302
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
303
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
304
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
305
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('text'));
|
|
306
|
+
const rng = editor.dom.createRng();
|
|
307
|
+
rng.setStart(editor.getBody().firstChild?.lastChild as Text, 1);
|
|
308
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 3);
|
|
309
|
+
editor.selection.setRng(rng);
|
|
310
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
311
|
+
LegacyUnit.equal(editor.getContent(), '<p>textaaatext</p>\n<p>text</p>', 'Editor contents (fragmented, elements)');
|
|
312
|
+
editor.selection.moveToBookmark(bookmark);
|
|
313
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ext</p>\n<p>tex</p>', 'Selected contents (fragmented, elements)');
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it('getBookmark/setBookmark (nonintrusive) - fragmentext text (normalized)', () => {
|
|
317
|
+
const editor = hook.editor();
|
|
318
|
+
// Get non intrusive bookmark multiple elements text selection fragmented
|
|
319
|
+
editor.setContent('<p>text</p><p>text</p>');
|
|
320
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
321
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
322
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
323
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('text'));
|
|
324
|
+
const rng = editor.dom.createRng();
|
|
325
|
+
rng.setStart(editor.getBody().firstChild?.lastChild as Text, 1);
|
|
326
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 3);
|
|
327
|
+
editor.selection.setRng(rng);
|
|
328
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
329
|
+
editor.setContent(editor.getContent());
|
|
330
|
+
LegacyUnit.equal(editor.getContent(), '<p>textaaatext</p>\n<p>text</p>', 'Editor contents (fragmented, elements)');
|
|
331
|
+
editor.selection.moveToBookmark(bookmark);
|
|
332
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ext</p>\n<p>tex</p>', 'Selected contents (fragmented, elements)');
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('getBookmark/setBookmark (nonintrusive) - fragmentext text with zwsp (normalized)', () => {
|
|
336
|
+
const editor = hook.editor();
|
|
337
|
+
// Get non intrusive bookmark multiple elements text selection fragmented
|
|
338
|
+
editor.setContent('<p>text</p><p>text</p>');
|
|
339
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('a'));
|
|
340
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode(Zwsp.ZWSP));
|
|
341
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode(Zwsp.ZWSP));
|
|
342
|
+
editor.dom.select('p')[0].appendChild(editor.dom.doc.createTextNode('text'));
|
|
343
|
+
const rng = editor.dom.createRng();
|
|
344
|
+
rng.setStart(editor.getBody().firstChild?.lastChild as Text, 1);
|
|
345
|
+
rng.setEnd(editor.getBody().lastChild?.firstChild as Text, 3);
|
|
346
|
+
editor.selection.setRng(rng);
|
|
347
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
348
|
+
editor.setContent(editor.getContent());
|
|
349
|
+
LegacyUnit.equal(editor.getContent(), '<p>textatext</p>\n<p>text</p>', 'Editor contents (fragmented, elements)');
|
|
350
|
+
editor.selection.moveToBookmark(bookmark);
|
|
351
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>ext</p>\n<p>tex</p>', 'Selected contents (fragmented, elements)');
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark before image', () => {
|
|
355
|
+
const editor = hook.editor();
|
|
356
|
+
let rng = editor.dom.createRng();
|
|
357
|
+
|
|
358
|
+
editor.setContent('<p><img src="about:blank" /></p>');
|
|
359
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 0);
|
|
360
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 0);
|
|
361
|
+
editor.selection.setRng(rng);
|
|
362
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
363
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
364
|
+
editor.selection.moveToBookmark(bookmark);
|
|
365
|
+
rng = editor.selection.getRng();
|
|
366
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
367
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
368
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
369
|
+
LegacyUnit.equal(rng.endOffset, 0);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark before/after image', () => {
|
|
373
|
+
const editor = hook.editor();
|
|
374
|
+
let rng = editor.dom.createRng();
|
|
375
|
+
|
|
376
|
+
editor.setContent('<p><img src="about:blank" /></p>');
|
|
377
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 0);
|
|
378
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 1);
|
|
379
|
+
editor.selection.setRng(rng);
|
|
380
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
381
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
382
|
+
editor.selection.moveToBookmark(bookmark);
|
|
383
|
+
rng = editor.selection.getRng();
|
|
384
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
385
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
386
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
387
|
+
LegacyUnit.equal(rng.endOffset, 1);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark after image', () => {
|
|
391
|
+
const editor = hook.editor();
|
|
392
|
+
let rng = editor.dom.createRng();
|
|
393
|
+
|
|
394
|
+
editor.setContent('<p><img src="about:blank" /></p>');
|
|
395
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 1);
|
|
396
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 1);
|
|
397
|
+
editor.selection.setRng(rng);
|
|
398
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
399
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
400
|
+
editor.selection.moveToBookmark(bookmark);
|
|
401
|
+
rng = editor.selection.getRng();
|
|
402
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
403
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
404
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
405
|
+
LegacyUnit.equal(rng.endOffset, 1);
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark before element', () => {
|
|
409
|
+
const editor = hook.editor();
|
|
410
|
+
let rng = editor.dom.createRng();
|
|
411
|
+
|
|
412
|
+
editor.setContent('<p>abc<b>123</b></p>');
|
|
413
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 0);
|
|
414
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 2);
|
|
415
|
+
editor.selection.setRng(rng);
|
|
416
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
417
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
418
|
+
editor.selection.moveToBookmark(bookmark);
|
|
419
|
+
rng = editor.selection.getRng();
|
|
420
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
421
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
422
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild as HTMLParagraphElement);
|
|
423
|
+
LegacyUnit.equal(rng.endOffset, 2);
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark after element', () => {
|
|
427
|
+
const editor = hook.editor();
|
|
428
|
+
let rng = editor.dom.createRng();
|
|
429
|
+
|
|
430
|
+
// Get bookmark after element
|
|
431
|
+
editor.setContent('<p><b>123</b>abc</p>');
|
|
432
|
+
rng.setStart(editor.getBody().lastChild as HTMLParagraphElement, 1);
|
|
433
|
+
rng.setEnd(editor.getBody().lastChild as HTMLParagraphElement, 2);
|
|
434
|
+
editor.selection.setRng(rng);
|
|
435
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
436
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
437
|
+
editor.selection.moveToBookmark(bookmark);
|
|
438
|
+
rng = editor.selection.getRng();
|
|
439
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().lastChild as HTMLParagraphElement);
|
|
440
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
441
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().lastChild as HTMLParagraphElement);
|
|
442
|
+
LegacyUnit.equal(rng.endOffset, 2);
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark inside element', () => {
|
|
446
|
+
const editor = hook.editor();
|
|
447
|
+
let rng = editor.dom.createRng();
|
|
448
|
+
|
|
449
|
+
editor.setContent('<p>abc<b>123</b>abc</p>');
|
|
450
|
+
rng.setStart(editor.getBody().firstChild?.childNodes[1].firstChild as Text, 1);
|
|
451
|
+
rng.setEnd(editor.getBody().firstChild?.childNodes[1].firstChild as Text, 2);
|
|
452
|
+
editor.selection.setRng(rng);
|
|
453
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
454
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
455
|
+
editor.selection.moveToBookmark(bookmark);
|
|
456
|
+
rng = editor.selection.getRng();
|
|
457
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild?.childNodes[1].firstChild as Text);
|
|
458
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
459
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild?.childNodes[1].firstChild as Text);
|
|
460
|
+
LegacyUnit.equal(rng.endOffset, 2);
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark inside root text', () => {
|
|
464
|
+
const editor = hook.editor();
|
|
465
|
+
let rng = editor.dom.createRng();
|
|
466
|
+
|
|
467
|
+
editor.setContent('<p>abc</p>');
|
|
468
|
+
rng.setStart(editor.getBody().firstChild?.firstChild as Text, 1);
|
|
469
|
+
rng.setEnd(editor.getBody().firstChild?.firstChild as Text, 2);
|
|
470
|
+
editor.selection.setRng(rng);
|
|
471
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
472
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
473
|
+
editor.selection.moveToBookmark(bookmark);
|
|
474
|
+
rng = editor.selection.getRng();
|
|
475
|
+
LegacyUnit.equalDom(rng.startContainer, editor.getBody().firstChild?.firstChild as Text);
|
|
476
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
477
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody().firstChild?.firstChild as Text);
|
|
478
|
+
LegacyUnit.equal(rng.endOffset, 2);
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
it('getBookmark/setBookmark (nonintrusive) - Get bookmark inside complex html', () => {
|
|
482
|
+
const editor = hook.editor();
|
|
483
|
+
editor.setContent('<p>abc</p>123<p>123</p><p>123<b>123</b><table><tr><td>abc</td></tr></table></p>');
|
|
484
|
+
editor.execCommand('SelectAll');
|
|
485
|
+
LegacyUnit.setSelection(editor, 'td', 1, 'td', 2);
|
|
486
|
+
const bookmark = editor.selection.getBookmark(2, true);
|
|
487
|
+
editor.getBody().innerHTML = editor.getBody().innerHTML;
|
|
488
|
+
editor.selection.moveToBookmark(bookmark);
|
|
489
|
+
const rng = editor.selection.getRng();
|
|
490
|
+
LegacyUnit.equalDom(rng.startContainer, editor.dom.select('td')[0].firstChild as Text);
|
|
491
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
492
|
+
LegacyUnit.equalDom(rng.endContainer, editor.dom.select('td')[0].firstChild as Text);
|
|
493
|
+
LegacyUnit.equal(rng.endOffset, 2);
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
it('getBookmark/setBookmark on cE=false', () => {
|
|
497
|
+
const editor = hook.editor();
|
|
498
|
+
editor.setContent('<p>text<span contentEditable="false">1</span></p>');
|
|
499
|
+
editor.selection.select(editor.dom.select('span')[0]);
|
|
500
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
501
|
+
editor.setContent('<p>text<span contentEditable="false">1</span></p>');
|
|
502
|
+
editor.selection.moveToBookmark(bookmark);
|
|
503
|
+
LegacyUnit.equalDom(editor.selection.getNode(), editor.dom.select('span')[0]);
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
it('getBookmark/setBookmark before cE=false', () => {
|
|
507
|
+
const editor = hook.editor();
|
|
508
|
+
editor.setContent('<p><input><span contentEditable="false">1</span></p>');
|
|
509
|
+
CaretContainer.insertInline(editor.dom.select('span')[0], true);
|
|
510
|
+
const rng = editor.dom.createRng();
|
|
511
|
+
rng.setStart(editor.dom.select('span')[0].previousSibling as HTMLInputElement, 0);
|
|
512
|
+
rng.setEnd(editor.dom.select('span')[0].previousSibling as HTMLInputElement, 0);
|
|
513
|
+
editor.selection.setRng(rng);
|
|
514
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
515
|
+
editor.setContent('<p><input><span contentEditable="false">1</span></p>');
|
|
516
|
+
editor.selection.moveToBookmark(bookmark);
|
|
517
|
+
LegacyUnit.equalDom(editor.selection.getNode(), editor.dom.select('span')[0]);
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
it('getBookmark/setBookmark before cE=false block', () => {
|
|
521
|
+
const editor = hook.editor();
|
|
522
|
+
editor.setContent('<p contentEditable="false">1</p>');
|
|
523
|
+
CaretContainer.insertBlock('p', editor.dom.select('p')[0], true);
|
|
524
|
+
const rng = editor.dom.createRng();
|
|
525
|
+
rng.setStart(editor.dom.select('p')[0], 0);
|
|
526
|
+
rng.setEnd(editor.dom.select('p')[0], 0);
|
|
527
|
+
editor.selection.setRng(rng);
|
|
528
|
+
const bookmark = editor.selection.getBookmark(2);
|
|
529
|
+
editor.setContent('<p contentEditable="false">1</p>');
|
|
530
|
+
editor.selection.moveToBookmark(bookmark);
|
|
531
|
+
LegacyUnit.equalDom(editor.selection.getNode(), editor.dom.select('p')[0]);
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
it('select empty TD', () => {
|
|
535
|
+
const editor = hook.editor();
|
|
536
|
+
editor.getBody().innerHTML = '<table><tr><td><br></td></tr></table>';
|
|
537
|
+
editor.selection.select(editor.dom.select('td')[0], true);
|
|
538
|
+
LegacyUnit.equal(editor.selection.getRng().startContainer.nodeName, 'TD');
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
it('select first p', () => {
|
|
542
|
+
const editor = hook.editor();
|
|
543
|
+
editor.setContent('<p>text1</p><p>text2</p>');
|
|
544
|
+
editor.selection.select(editor.dom.select('p')[0]);
|
|
545
|
+
LegacyUnit.equal(editor.selection.getContent(), '<p>text1</p>', 'Select simple element, content');
|
|
546
|
+
LegacyUnit.equal(editor.selection.getStart().nodeName, 'P', 'Select simple element, nodeName');
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
it('select table', () => {
|
|
550
|
+
const editor = hook.editor();
|
|
551
|
+
editor.setContent('<table><tbody><tr><td>text1</td></tr></tbody></table>');
|
|
552
|
+
editor.selection.select(editor.dom.select('table')[0]);
|
|
553
|
+
LegacyUnit.equal(
|
|
554
|
+
editor.selection.getContent(),
|
|
555
|
+
'<table>\n<tbody>\n<tr>\n<td>text1</td>\n</tr>\n</tbody>\n</table>',
|
|
556
|
+
'Select complex element, content'
|
|
557
|
+
);
|
|
558
|
+
LegacyUnit.equal(editor.selection.getNode().nodeName, 'TABLE', 'Select complex element, nodeName');
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
it('select table text 1', () => {
|
|
562
|
+
const editor = hook.editor();
|
|
563
|
+
editor.setContent('<table><tbody><tr><td id="a">text1</td><td id="b">text2</td></tr></tbody></table>');
|
|
564
|
+
editor.selection.select(editor.dom.select('table')[0], true);
|
|
565
|
+
LegacyUnit.equal(editor.selection.getStart().id, 'a', 'Expand to text content 1 (start)');
|
|
566
|
+
LegacyUnit.equal(editor.selection.getEnd().id, 'b', 'Expand to text content 1 (end)');
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
it('select table text 2', () => {
|
|
570
|
+
const editor = hook.editor();
|
|
571
|
+
editor.setContent('<table><tbody><tr><td id="a"><br /></td><td id="b"><br /></td></tr></tbody></table>');
|
|
572
|
+
editor.selection.select(editor.dom.select('table')[0], true);
|
|
573
|
+
LegacyUnit.equal(editor.dom.getParent(editor.selection.getStart(), 'td')?.id, 'a', 'Expand to text content 2 (start)');
|
|
574
|
+
LegacyUnit.equal(editor.dom.getParent(editor.selection.getEnd(), 'td')?.id, 'b', 'Expand to text content 2 (end)');
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
it('getNode', () => {
|
|
578
|
+
const editor = hook.editor();
|
|
579
|
+
let rng = editor.dom.createRng();
|
|
580
|
+
|
|
581
|
+
editor.setContent('<p id="p1"><span id="s1">span1</span> word <span id="s2">span2</span> word <span id="s3">span3</span></p>');
|
|
582
|
+
const p1 = editor.dom.get('p1') as HTMLParagraphElement;
|
|
583
|
+
const s1 = editor.dom.get('s1') as HTMLSpanElement;
|
|
584
|
+
const s2 = editor.dom.get('s2') as HTMLSpanElement;
|
|
585
|
+
const s3 = editor.dom.get('s3') as HTMLSpanElement;
|
|
586
|
+
|
|
587
|
+
rng.setStart(s1.firstChild as Text, 0);
|
|
588
|
+
rng.setEnd(s1.nextSibling as Text, 0);
|
|
589
|
+
editor.selection.setRng(rng);
|
|
590
|
+
LegacyUnit.equalDom(
|
|
591
|
+
editor.selection.getNode(),
|
|
592
|
+
s1,
|
|
593
|
+
'Detect selection ends immediately after node at start of paragraph.'
|
|
594
|
+
);
|
|
595
|
+
|
|
596
|
+
rng = editor.dom.createRng();
|
|
597
|
+
rng.setStart(s2.previousSibling as Text, (s2.previousSibling as Text).length);
|
|
598
|
+
rng.setEnd(s2.nextSibling as Text, 0);
|
|
599
|
+
editor.selection.setRng(rng);
|
|
600
|
+
LegacyUnit.equalDom(
|
|
601
|
+
editor.selection.getNode(),
|
|
602
|
+
s2,
|
|
603
|
+
'Detect selection immediately surrounds node in middle of paragraph.'
|
|
604
|
+
);
|
|
605
|
+
|
|
606
|
+
rng = editor.dom.createRng();
|
|
607
|
+
rng.setStart(s3.previousSibling as Text, (s3.previousSibling as Text).length);
|
|
608
|
+
rng.setEnd(s3.lastChild as Text, (s3.lastChild as Text).length);
|
|
609
|
+
editor.selection.setRng(rng);
|
|
610
|
+
LegacyUnit.equalDom(
|
|
611
|
+
editor.selection.getNode(),
|
|
612
|
+
s3,
|
|
613
|
+
'Detect selection starts immediately before node at end of paragraph.'
|
|
614
|
+
);
|
|
615
|
+
|
|
616
|
+
rng = editor.dom.createRng();
|
|
617
|
+
rng.setStart(s2.previousSibling as Text, (s2.previousSibling as Text).length);
|
|
618
|
+
rng.setEnd(s3.lastChild as Text, (s3.lastChild as Text).length);
|
|
619
|
+
editor.selection.setRng(rng);
|
|
620
|
+
LegacyUnit.equalDom(
|
|
621
|
+
editor.selection.getNode(),
|
|
622
|
+
p1,
|
|
623
|
+
'Detect selection wrapping multiple nodes does not collapse.'
|
|
624
|
+
);
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
it('normalize to text node from document', () => {
|
|
628
|
+
const editor = hook.editor();
|
|
629
|
+
let rng = editor.dom.createRng();
|
|
630
|
+
|
|
631
|
+
editor.setContent('<p>text</p>');
|
|
632
|
+
rng.setStart(editor.getDoc(), 0);
|
|
633
|
+
rng.setEnd(editor.getDoc(), 0);
|
|
634
|
+
editor.selection.setRng(rng);
|
|
635
|
+
editor.selection.normalize();
|
|
636
|
+
|
|
637
|
+
rng = editor.selection.getRng();
|
|
638
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 3, 'startContainer node type');
|
|
639
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
640
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 3, 'endContainer node type');
|
|
641
|
+
LegacyUnit.equal(rng.endOffset, 0, 'endOffset offset');
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
it('normalize to br from document', () => {
|
|
645
|
+
const editor = hook.editor();
|
|
646
|
+
let rng = editor.dom.createRng();
|
|
647
|
+
|
|
648
|
+
editor.setContent('<p><br /></p>');
|
|
649
|
+
rng.setStart(editor.getDoc(), 0);
|
|
650
|
+
rng.setEnd(editor.getDoc(), 0);
|
|
651
|
+
editor.selection.setRng(rng);
|
|
652
|
+
editor.selection.normalize();
|
|
653
|
+
|
|
654
|
+
rng = editor.selection.getRng();
|
|
655
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P', 'startContainer node name');
|
|
656
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 1, 'startContainer node type');
|
|
657
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
658
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 1, 'endContainer node type');
|
|
659
|
+
LegacyUnit.equal(rng.endOffset, 0, 'endOffset offset');
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
it('normalize with contentEditable:false element', () => {
|
|
663
|
+
const editor = hook.editor();
|
|
664
|
+
let rng = editor.dom.createRng();
|
|
665
|
+
|
|
666
|
+
editor.setContent('<p>a<b contentEditable="false">b</b>c</p>');
|
|
667
|
+
rng.setStart(editor.getBody().firstChild?.lastChild as Text, 0);
|
|
668
|
+
rng.setEnd(editor.getBody().firstChild?.lastChild as Text, 0);
|
|
669
|
+
editor.selection.setRng(rng);
|
|
670
|
+
editor.selection.normalize();
|
|
671
|
+
|
|
672
|
+
rng = editor.selection.getRng();
|
|
673
|
+
LegacyUnit.equal(rng.collapsed, true);
|
|
674
|
+
LegacyUnit.equal(CaretContainer.isCaretContainer(rng.startContainer), true);
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
it('normalize with contentEditable:false parent and contentEditable:true child element', () => {
|
|
678
|
+
const editor = hook.editor();
|
|
679
|
+
editor.setContent('<p contentEditable="false">a<em contentEditable="true">b</em></p>');
|
|
680
|
+
LegacyUnit.setSelection(editor, 'em', 0);
|
|
681
|
+
editor.selection.normalize();
|
|
682
|
+
|
|
683
|
+
const rng = editor.selection.getRng();
|
|
684
|
+
LegacyUnit.equal(rng.collapsed, true);
|
|
685
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 3);
|
|
686
|
+
LegacyUnit.equal((rng.startContainer as Text).data, 'b');
|
|
687
|
+
|
|
688
|
+
// WebKit is in some state state here, so lets restore it
|
|
689
|
+
rng.setStart(editor.getBody(), 0);
|
|
690
|
+
rng.setEnd(editor.getBody(), 0);
|
|
691
|
+
editor.selection.setRng(rng);
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
it('normalize to text node from body', () => {
|
|
695
|
+
const editor = hook.editor();
|
|
696
|
+
let rng = editor.dom.createRng();
|
|
697
|
+
|
|
698
|
+
editor.setContent('<p>text</p>');
|
|
699
|
+
rng.setStart(editor.getBody(), 0);
|
|
700
|
+
rng.setEnd(editor.getBody(), 0);
|
|
701
|
+
editor.selection.setRng(rng);
|
|
702
|
+
editor.selection.normalize();
|
|
703
|
+
|
|
704
|
+
rng = editor.selection.getRng();
|
|
705
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 3, 'startContainer node type');
|
|
706
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
707
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 3, 'endContainer node type');
|
|
708
|
+
LegacyUnit.equal(rng.endOffset, 0, 'endOffset offset');
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
it('normalize to br from body', () => {
|
|
712
|
+
const editor = hook.editor();
|
|
713
|
+
let rng = editor.dom.createRng();
|
|
714
|
+
|
|
715
|
+
editor.setContent('<p><br /></p>');
|
|
716
|
+
rng.setStart(editor.getBody(), 0);
|
|
717
|
+
rng.setEnd(editor.getBody(), 0);
|
|
718
|
+
editor.selection.setRng(rng);
|
|
719
|
+
editor.selection.normalize();
|
|
720
|
+
|
|
721
|
+
rng = editor.selection.getRng();
|
|
722
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P', 'startContainer node name');
|
|
723
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 1, 'startContainer node type');
|
|
724
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
725
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 1, 'endContainer node type');
|
|
726
|
+
LegacyUnit.equal(rng.endOffset, 0, 'endOffset offset');
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
it('normalize ignore img', () => {
|
|
730
|
+
const editor = hook.editor();
|
|
731
|
+
let rng = editor.dom.createRng();
|
|
732
|
+
|
|
733
|
+
editor.getBody().innerHTML = '<img src="about:blank " />';
|
|
734
|
+
rng.setStart(editor.getBody(), 0);
|
|
735
|
+
rng.setEnd(editor.getBody(), 1);
|
|
736
|
+
editor.selection.setRng(rng);
|
|
737
|
+
editor.selection.normalize();
|
|
738
|
+
|
|
739
|
+
rng = editor.selection.getRng();
|
|
740
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'BODY', 'startContainer node name');
|
|
741
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 1, 'startContainer node type');
|
|
742
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
743
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'BODY', 'endContainer node name');
|
|
744
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 1, 'endContainer node type');
|
|
745
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
it('normalize to before/after img', () => {
|
|
749
|
+
const editor = hook.editor();
|
|
750
|
+
let rng = editor.dom.createRng();
|
|
751
|
+
|
|
752
|
+
editor.getBody().innerHTML = '<p><img src="about:blank " /></p>';
|
|
753
|
+
rng.setStart(editor.getBody(), 0);
|
|
754
|
+
rng.setEnd(editor.getBody(), 1);
|
|
755
|
+
editor.selection.setRng(rng);
|
|
756
|
+
editor.selection.normalize();
|
|
757
|
+
|
|
758
|
+
rng = editor.selection.getRng();
|
|
759
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P', 'startContainer node name');
|
|
760
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 1, 'startContainer node type');
|
|
761
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
762
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'P', 'endContainer node name');
|
|
763
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 1, 'endContainer node type');
|
|
764
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
it('normalize to before/after pre', () => {
|
|
768
|
+
const editor = hook.editor();
|
|
769
|
+
let rng = editor.dom.createRng();
|
|
770
|
+
|
|
771
|
+
editor.getBody().innerHTML = '<pre>a<pre>';
|
|
772
|
+
rng.setStart(editor.getBody(), 0);
|
|
773
|
+
rng.setEnd(editor.getBody(), 1);
|
|
774
|
+
editor.selection.setRng(rng);
|
|
775
|
+
editor.selection.normalize();
|
|
776
|
+
|
|
777
|
+
rng = editor.selection.getRng();
|
|
778
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'BODY', 'startContainer node name');
|
|
779
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 1, 'startContainer node type');
|
|
780
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
781
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'BODY', 'endContainer node name');
|
|
782
|
+
LegacyUnit.equal(rng.endContainer.nodeType, 1, 'endContainer node type');
|
|
783
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
it('normalize to text node inside P', () => {
|
|
787
|
+
const editor = hook.editor();
|
|
788
|
+
let rng = editor.dom.createRng();
|
|
789
|
+
|
|
790
|
+
editor.getBody().innerHTML = '<p>abc</p>';
|
|
791
|
+
rng.setStart(editor.getBody(), 0);
|
|
792
|
+
rng.setEnd(editor.getBody(), 1);
|
|
793
|
+
editor.selection.setRng(rng);
|
|
794
|
+
editor.selection.normalize();
|
|
795
|
+
|
|
796
|
+
rng = editor.selection.getRng();
|
|
797
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text', 'startContainer node name');
|
|
798
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
799
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text', 'endContainer node name');
|
|
800
|
+
LegacyUnit.equal(rng.endOffset, 3, 'endOffset offset');
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
it('normalize lean left if at the start of text node', () => {
|
|
804
|
+
const editor = hook.editor();
|
|
805
|
+
editor.getBody().innerHTML = '<p><b>a</b><i>b</i></p>';
|
|
806
|
+
LegacyUnit.setSelection(editor, 'i', 0);
|
|
807
|
+
editor.selection.normalize();
|
|
808
|
+
|
|
809
|
+
const rng = editor.selection.getRng();
|
|
810
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text', 'startContainer node name');
|
|
811
|
+
LegacyUnit.equal(rng.startContainer.parentNode?.nodeName, 'B');
|
|
812
|
+
LegacyUnit.equal(rng.startOffset, 1, 'startContainer offset');
|
|
813
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text');
|
|
814
|
+
LegacyUnit.equal(rng.endContainer.parentNode?.nodeName, 'B');
|
|
815
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
it('normalize lean start to the right if at end of text node', () => {
|
|
819
|
+
const editor = hook.editor();
|
|
820
|
+
editor.getBody().innerHTML = '<p><b>a</b><i>b</i></p>';
|
|
821
|
+
LegacyUnit.setSelection(editor, 'b', 1, 'i', 1);
|
|
822
|
+
editor.selection.normalize();
|
|
823
|
+
|
|
824
|
+
const rng = editor.selection.getRng();
|
|
825
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text', 'startContainer node name');
|
|
826
|
+
LegacyUnit.equal(rng.startContainer.parentNode?.nodeName, 'I');
|
|
827
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
828
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text');
|
|
829
|
+
LegacyUnit.equal(rng.endContainer.parentNode?.nodeName, 'I');
|
|
830
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
it('normalize lean left but break before br', () => {
|
|
834
|
+
const editor = hook.editor();
|
|
835
|
+
editor.getBody().innerHTML = '<p>a<br><b>b</b></p>';
|
|
836
|
+
LegacyUnit.setSelection(editor, 'b', 0);
|
|
837
|
+
editor.selection.normalize();
|
|
838
|
+
|
|
839
|
+
const rng = editor.selection.getRng();
|
|
840
|
+
LegacyUnit.equal(rng.startContainer.nodeValue, 'b');
|
|
841
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
it('normalize lean left but break before img', () => {
|
|
845
|
+
const editor = hook.editor();
|
|
846
|
+
editor.getBody().innerHTML = '<p>a<img><b>b</b></p>';
|
|
847
|
+
LegacyUnit.setSelection(editor, 'b', 0);
|
|
848
|
+
editor.selection.normalize();
|
|
849
|
+
|
|
850
|
+
const rng = editor.selection.getRng();
|
|
851
|
+
LegacyUnit.equal(rng.startContainer.nodeValue, 'b');
|
|
852
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
853
|
+
});
|
|
854
|
+
|
|
855
|
+
it(`normalize lean left but don't walk out the parent block`, () => {
|
|
856
|
+
const editor = hook.editor();
|
|
857
|
+
editor.getBody().innerHTML = '<p>a</p><p><b>b</b></p>';
|
|
858
|
+
LegacyUnit.setSelection(editor, 'b', 0);
|
|
859
|
+
editor.selection.normalize();
|
|
860
|
+
|
|
861
|
+
const rng = editor.selection.getRng();
|
|
862
|
+
LegacyUnit.equal(rng.startContainer.nodeValue, 'b');
|
|
863
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
it('normalize lean left into empty inline elements when caret is before br', () => {
|
|
867
|
+
const editor = hook.editor();
|
|
868
|
+
let rng = editor.dom.createRng();
|
|
869
|
+
|
|
870
|
+
editor.getBody().innerHTML = '<p><i><b></b></i><br /></p>';
|
|
871
|
+
rng.setStartBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
872
|
+
rng.setEndBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
873
|
+
editor.selection.setRng(rng);
|
|
874
|
+
editor.selection.normalize();
|
|
875
|
+
|
|
876
|
+
rng = editor.selection.getRng();
|
|
877
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'B');
|
|
878
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
879
|
+
});
|
|
880
|
+
|
|
881
|
+
it('normalize lean left from br into formatter caret container', () => {
|
|
882
|
+
const editor = hook.editor();
|
|
883
|
+
let rng = editor.dom.createRng();
|
|
884
|
+
|
|
885
|
+
editor.getBody().innerHTML = '<p><span id="_mce_caret">' + Zwsp.ZWSP + '</span><br /></p>';
|
|
886
|
+
rng.setStartBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
887
|
+
rng.setEndBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
888
|
+
editor.selection.setRng(rng);
|
|
889
|
+
editor.selection.normalize();
|
|
890
|
+
|
|
891
|
+
rng = editor.selection.getRng();
|
|
892
|
+
LegacyUnit.equal(rng.startContainer.nodeType, 3);
|
|
893
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
it(`normalize doesn't lean left into empty inline elements if there is a br element after caret`, () => {
|
|
897
|
+
const editor = hook.editor();
|
|
898
|
+
let rng = editor.dom.createRng();
|
|
899
|
+
|
|
900
|
+
editor.getBody().innerHTML = '<p><i><b></b></i><br /><br /></p>';
|
|
901
|
+
rng.setStartBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
902
|
+
rng.setEndBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
903
|
+
editor.selection.setRng(rng);
|
|
904
|
+
editor.selection.normalize();
|
|
905
|
+
|
|
906
|
+
rng = editor.selection.getRng();
|
|
907
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P');
|
|
908
|
+
LegacyUnit.equal(rng.startOffset, 2);
|
|
909
|
+
});
|
|
910
|
+
|
|
911
|
+
it(`normalize doesn't lean left into empty inline elements if there is a br element before caret`, () => {
|
|
912
|
+
const editor = hook.editor();
|
|
913
|
+
let rng = editor.dom.createRng();
|
|
914
|
+
|
|
915
|
+
editor.getBody().innerHTML = '<p><i><b><br /></b></i><br /></p>';
|
|
916
|
+
rng.setStartBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
917
|
+
rng.setEndBefore(editor.getBody().firstChild?.lastChild as HTMLBRElement);
|
|
918
|
+
editor.selection.setRng(rng);
|
|
919
|
+
editor.selection.normalize();
|
|
920
|
+
|
|
921
|
+
rng = editor.selection.getRng();
|
|
922
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P');
|
|
923
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
924
|
+
});
|
|
925
|
+
|
|
926
|
+
it(`normalize doesn't move start/end if it's before/after table`, () => {
|
|
927
|
+
const editor = hook.editor();
|
|
928
|
+
let rng = editor.dom.createRng();
|
|
929
|
+
|
|
930
|
+
editor.getBody().innerHTML = '<table><tr><td>X</td></tr></table>';
|
|
931
|
+
rng.setStartBefore(editor.getBody().firstChild as HTMLTableElement);
|
|
932
|
+
rng.setEndAfter(editor.getBody().lastChild as HTMLTableElement);
|
|
933
|
+
editor.selection.setRng(rng);
|
|
934
|
+
editor.selection.normalize();
|
|
935
|
+
|
|
936
|
+
rng = editor.selection.getRng();
|
|
937
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'BODY');
|
|
938
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
939
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'BODY');
|
|
940
|
+
LegacyUnit.equal(rng.endOffset, 1);
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
it('normalize after paragraph', () => {
|
|
944
|
+
const editor = hook.editor();
|
|
945
|
+
let rng = editor.dom.createRng();
|
|
946
|
+
|
|
947
|
+
editor.getBody().innerHTML = '<p>a</p>';
|
|
948
|
+
rng.setStartAfter(editor.getBody().firstChild as HTMLParagraphElement);
|
|
949
|
+
rng.setEndAfter(editor.getBody().lastChild as HTMLParagraphElement);
|
|
950
|
+
editor.selection.setRng(rng);
|
|
951
|
+
editor.selection.normalize();
|
|
952
|
+
|
|
953
|
+
rng = editor.selection.getRng();
|
|
954
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text');
|
|
955
|
+
LegacyUnit.equal(rng.startOffset, 1);
|
|
956
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text');
|
|
957
|
+
LegacyUnit.equal(rng.endOffset, 1);
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
it('normalize caret after trailing BR', () => {
|
|
961
|
+
const editor = hook.editor();
|
|
962
|
+
let rng = editor.dom.createRng();
|
|
963
|
+
|
|
964
|
+
editor.getBody().innerHTML = '<p>a<br /></p>';
|
|
965
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 2);
|
|
966
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 2);
|
|
967
|
+
editor.selection.setRng(rng);
|
|
968
|
+
editor.selection.normalize();
|
|
969
|
+
|
|
970
|
+
rng = editor.selection.getRng();
|
|
971
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text', 'startContainer node name');
|
|
972
|
+
LegacyUnit.equal(rng.startOffset, 1, 'startContainer offset');
|
|
973
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text', 'endContainer node name');
|
|
974
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
it('normalize caret after bogus block BR', () => {
|
|
978
|
+
const editor = hook.editor();
|
|
979
|
+
let rng = editor.dom.createRng();
|
|
980
|
+
|
|
981
|
+
editor.setContent('<p><br /></p>');
|
|
982
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 1);
|
|
983
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 1);
|
|
984
|
+
editor.selection.setRng(rng);
|
|
985
|
+
editor.selection.normalize();
|
|
986
|
+
|
|
987
|
+
rng = editor.selection.getRng();
|
|
988
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P', 'startContainer node name');
|
|
989
|
+
LegacyUnit.equal(rng.startOffset, 0, 'startContainer offset');
|
|
990
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'P', 'endContainer node name');
|
|
991
|
+
LegacyUnit.equal(rng.endOffset, 0, 'endOffset offset');
|
|
992
|
+
});
|
|
993
|
+
|
|
994
|
+
it('normalize after table should not move', () => {
|
|
995
|
+
const editor = hook.editor();
|
|
996
|
+
let rng = editor.dom.createRng();
|
|
997
|
+
|
|
998
|
+
editor.setContent('<p>a</p><table><tr><td>b</td></tr></table>');
|
|
999
|
+
rng.setStart(editor.getBody(), 0);
|
|
1000
|
+
rng.setEnd(editor.getBody(), 2);
|
|
1001
|
+
editor.selection.setRng(rng);
|
|
1002
|
+
editor.selection.normalize();
|
|
1003
|
+
|
|
1004
|
+
rng = editor.selection.getRng();
|
|
1005
|
+
LegacyUnit.equalDom(rng.endContainer, editor.getBody());
|
|
1006
|
+
LegacyUnit.equal(rng.endOffset, 2);
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
/*
|
|
1010
|
+
suite.test('normalize caret after last BR in block', function(editor) {
|
|
1011
|
+
var rng;
|
|
1012
|
+
|
|
1013
|
+
editor.setContent('<p><br /><br /></p>');
|
|
1014
|
+
rng = editor.dom.createRng();
|
|
1015
|
+
rng.setStart(editor.getBody().firstChild, 2);
|
|
1016
|
+
rng.setEnd(editor.getBody().firstChild, 2);
|
|
1017
|
+
editor.selection.setRng(rng);
|
|
1018
|
+
editor.selection.normalize();
|
|
1019
|
+
|
|
1020
|
+
rng = editor.selection.getRng();
|
|
1021
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P', 'startContainer node name');
|
|
1022
|
+
LegacyUnit.equal(rng.startOffset, 1, 'startContainer offset');
|
|
1023
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'P', 'endContainer node name');
|
|
1024
|
+
LegacyUnit.equal(rng.endOffset, 1, 'endOffset offset');
|
|
1025
|
+
});
|
|
1026
|
+
*/
|
|
1027
|
+
|
|
1028
|
+
it('normalize caret after double BR', () => {
|
|
1029
|
+
const editor = hook.editor();
|
|
1030
|
+
let rng = editor.dom.createRng();
|
|
1031
|
+
|
|
1032
|
+
editor.setContent('<p>a<br /><br /></p>');
|
|
1033
|
+
rng.setStart(editor.getBody().firstChild as HTMLParagraphElement, 3);
|
|
1034
|
+
rng.setEnd(editor.getBody().firstChild as HTMLParagraphElement, 3);
|
|
1035
|
+
editor.selection.setRng(rng);
|
|
1036
|
+
editor.selection.normalize();
|
|
1037
|
+
|
|
1038
|
+
rng = editor.selection.getRng();
|
|
1039
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P', 'startContainer node name');
|
|
1040
|
+
LegacyUnit.equal(rng.startOffset, 3, 'startContainer offset');
|
|
1041
|
+
LegacyUnit.equal(rng.endContainer.nodeName, 'P', 'endContainer node name');
|
|
1042
|
+
LegacyUnit.equal(rng.endOffset, 3, 'endOffset offset');
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
it('custom elements', () => {
|
|
1046
|
+
const editor = hook.editor();
|
|
1047
|
+
editor.setContent('<custom1>test</custom1><custom2>test</custom2>');
|
|
1048
|
+
|
|
1049
|
+
const rng = editor.dom.createRng();
|
|
1050
|
+
rng.setStart(editor.getBody(), 0);
|
|
1051
|
+
rng.setEnd(editor.getBody(), 2);
|
|
1052
|
+
editor.selection.setRng(rng);
|
|
1053
|
+
|
|
1054
|
+
// custom2 has been specified as an inline element in the editor config so expect it be wrapped in a p tag
|
|
1055
|
+
LegacyUnit.equal(editor.selection.getContent(), '<custom1>test</custom1>\n<p><custom2>test</custom2></p>');
|
|
1056
|
+
});
|
|
1057
|
+
|
|
1058
|
+
it('selectorChanged', () => {
|
|
1059
|
+
const editor = hook.editor();
|
|
1060
|
+
let newState: boolean | undefined;
|
|
1061
|
+
let newArgs: { node: Node; selector: String; parents: Node[] } | undefined;
|
|
1062
|
+
|
|
1063
|
+
editor.selection.selectorChanged('a[href]', (state, args) => {
|
|
1064
|
+
newState = state;
|
|
1065
|
+
newArgs = args;
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
editor.setContent('<p><a href="#">text</a></p>');
|
|
1069
|
+
LegacyUnit.setSelection(editor, 'a', 0, 'a', 4);
|
|
1070
|
+
editor.nodeChanged();
|
|
1071
|
+
|
|
1072
|
+
assert.isTrue(newState);
|
|
1073
|
+
assert.equal(newArgs?.selector, 'a[href]');
|
|
1074
|
+
LegacyUnit.equalDom(newArgs?.node as Node, editor.getBody().firstChild?.firstChild as HTMLAnchorElement);
|
|
1075
|
+
assert.lengthOf(newArgs?.parents ?? [], 2);
|
|
1076
|
+
|
|
1077
|
+
editor.setContent('<p>text</p>');
|
|
1078
|
+
LegacyUnit.setSelection(editor, 'p', 0, 'p', 4);
|
|
1079
|
+
editor.nodeChanged();
|
|
1080
|
+
assert.equal(newArgs?.selector, 'a[href]');
|
|
1081
|
+
LegacyUnit.equalDom(newArgs?.node as Node, editor.getBody().firstChild as HTMLParagraphElement);
|
|
1082
|
+
assert.lengthOf(newArgs?.parents ?? [], 1);
|
|
1083
|
+
});
|
|
1084
|
+
|
|
1085
|
+
it('selectorChangedWithUnbind', () => {
|
|
1086
|
+
const editor = hook.editor();
|
|
1087
|
+
let newState: boolean | undefined;
|
|
1088
|
+
let newArgs: { node: Node; selector: String; parents: Node[] } | undefined;
|
|
1089
|
+
let calls = 0;
|
|
1090
|
+
|
|
1091
|
+
const { unbind } = editor.selection.selectorChangedWithUnbind('a[href]', (state, args) => {
|
|
1092
|
+
newState = state;
|
|
1093
|
+
newArgs = args;
|
|
1094
|
+
calls++;
|
|
1095
|
+
});
|
|
1096
|
+
|
|
1097
|
+
editor.setContent('<p><a href="#">text</a></p>');
|
|
1098
|
+
LegacyUnit.setSelection(editor, 'a', 0, 'a', 4);
|
|
1099
|
+
editor.nodeChanged();
|
|
1100
|
+
|
|
1101
|
+
assert.isTrue(newState);
|
|
1102
|
+
assert.equal(newArgs?.selector, 'a[href]');
|
|
1103
|
+
LegacyUnit.equalDom(newArgs?.node as Node, editor.getBody().firstChild?.firstChild as HTMLAnchorElement);
|
|
1104
|
+
assert.lengthOf(newArgs?.parents ?? [], 2);
|
|
1105
|
+
assert.equal(calls, 1, 'selectorChangedWithUnbind callback is only called once');
|
|
1106
|
+
|
|
1107
|
+
unbind();
|
|
1108
|
+
|
|
1109
|
+
editor.setContent('<p>text</p>');
|
|
1110
|
+
LegacyUnit.setSelection(editor, 'p', 0, 'p', 4);
|
|
1111
|
+
editor.nodeChanged();
|
|
1112
|
+
|
|
1113
|
+
assert.equal(calls, 1, 'selectorChangedWithUnbind callback is only called once');
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
it('TINY-3463: selectorChanged should setup the active state if already selected', () => {
|
|
1117
|
+
const editor = hook.editor();
|
|
1118
|
+
let newState: boolean | undefined;
|
|
1119
|
+
let newArgs: { node: Node; selector: String; parents: Node[] } | undefined;
|
|
1120
|
+
|
|
1121
|
+
editor.setContent('<p>some <a href="#">text</a></p>');
|
|
1122
|
+
LegacyUnit.setSelection(editor, 'a', 0, 'a', 4);
|
|
1123
|
+
|
|
1124
|
+
editor.selection.selectorChanged('a[href]', (state, args) => {
|
|
1125
|
+
newState = state;
|
|
1126
|
+
newArgs = args;
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
LegacyUnit.setSelection(editor, 'p', 0, 'p', 4);
|
|
1130
|
+
editor.nodeChanged();
|
|
1131
|
+
|
|
1132
|
+
assert.isFalse(newState);
|
|
1133
|
+
assert.equal(newArgs?.selector, 'a[href]');
|
|
1134
|
+
assert.lengthOf(newArgs?.parents ?? [], 1);
|
|
1135
|
+
});
|
|
1136
|
+
|
|
1137
|
+
it('setRng', () => {
|
|
1138
|
+
const editor = hook.editor();
|
|
1139
|
+
let rng = editor.dom.createRng();
|
|
1140
|
+
|
|
1141
|
+
editor.setContent('<p>x</p>');
|
|
1142
|
+
rng.setStart(editor.dom.select('p')[0].firstChild as Text, 0);
|
|
1143
|
+
rng.setEnd(editor.dom.select('p')[0].firstChild as Text, 1);
|
|
1144
|
+
|
|
1145
|
+
editor.selection.setRng(rng);
|
|
1146
|
+
editor.selection.setRng(null as any);
|
|
1147
|
+
|
|
1148
|
+
rng = editor.selection.getRng();
|
|
1149
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text');
|
|
1150
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
1151
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text');
|
|
1152
|
+
LegacyUnit.equal(rng.endOffset, 1);
|
|
1153
|
+
});
|
|
1154
|
+
|
|
1155
|
+
it('setRng invalid range', () => {
|
|
1156
|
+
const editor = hook.editor();
|
|
1157
|
+
let rng = editor.dom.createRng();
|
|
1158
|
+
|
|
1159
|
+
editor.setContent('<p>x</p>');
|
|
1160
|
+
|
|
1161
|
+
rng.setStart(editor.dom.select('p')[0].firstChild as Text, 0);
|
|
1162
|
+
rng.setEnd(editor.dom.select('p')[0].firstChild as Text, 1);
|
|
1163
|
+
editor.selection.setRng(rng);
|
|
1164
|
+
|
|
1165
|
+
const tmpNode = document.createTextNode('y');
|
|
1166
|
+
const invalidRng = rng.cloneRange();
|
|
1167
|
+
invalidRng.setStart(tmpNode, 0);
|
|
1168
|
+
invalidRng.setEnd(tmpNode, 0);
|
|
1169
|
+
editor.selection.setRng(invalidRng);
|
|
1170
|
+
|
|
1171
|
+
rng = editor.selection.getRng();
|
|
1172
|
+
LegacyUnit.equal(rng.startContainer.nodeName, '#text');
|
|
1173
|
+
LegacyUnit.equal((rng.startContainer as Text).data, 'x');
|
|
1174
|
+
LegacyUnit.equal(rng.startOffset, 0);
|
|
1175
|
+
LegacyUnit.equal(rng.endContainer.nodeName, '#text');
|
|
1176
|
+
LegacyUnit.equal(rng.endOffset, 1);
|
|
1177
|
+
});
|
|
1178
|
+
|
|
1179
|
+
it('setRng invalid range removed parent context', () => {
|
|
1180
|
+
const editor = hook.editor();
|
|
1181
|
+
|
|
1182
|
+
editor.setContent('<p><strong><em>x</em></strong></p>');
|
|
1183
|
+
const textNode = editor.dom.select('em')[0].firstChild as Text;
|
|
1184
|
+
|
|
1185
|
+
editor.setContent('');
|
|
1186
|
+
|
|
1187
|
+
const rng = editor.dom.createRng();
|
|
1188
|
+
rng.setStart(textNode, 0);
|
|
1189
|
+
rng.setEnd(textNode, 1);
|
|
1190
|
+
editor.selection.setRng(rng);
|
|
1191
|
+
|
|
1192
|
+
const curRng = editor.selection.getRng();
|
|
1193
|
+
LegacyUnit.equal(curRng.startContainer.nodeName, 'P');
|
|
1194
|
+
LegacyUnit.equal(curRng.startOffset, 0);
|
|
1195
|
+
LegacyUnit.equal(curRng.endContainer.nodeName, 'P');
|
|
1196
|
+
LegacyUnit.equal(curRng.endOffset, 0);
|
|
1197
|
+
});
|
|
1198
|
+
|
|
1199
|
+
it('TINY-9001: Expanding a word expands the selection', () => {
|
|
1200
|
+
const editor = hook.editor();
|
|
1201
|
+
editor.setContent('A BCDE F');
|
|
1202
|
+
TinySelections.setCursor(editor, [ 0, 0 ], 4);
|
|
1203
|
+
editor.selection.expand();
|
|
1204
|
+
TinyAssertions.assertSelection(editor, [ 0, 0 ], 2, [ 0, 0 ], 6);
|
|
1205
|
+
});
|
|
1206
|
+
|
|
1207
|
+
it('TINY-9001: Expanding a word expands the selection, with a provided option', () => {
|
|
1208
|
+
const editor = hook.editor();
|
|
1209
|
+
editor.setContent('A BCDE F');
|
|
1210
|
+
TinySelections.setCursor(editor, [ 0, 0 ], 4);
|
|
1211
|
+
editor.selection.expand({ type: 'word' });
|
|
1212
|
+
TinyAssertions.assertSelection(editor, [ 0, 0 ], 2, [ 0, 0 ], 6);
|
|
1213
|
+
});
|
|
1214
|
+
|
|
1215
|
+
it('TINY-9259: Should be able to get selection range on hidden editors', () => {
|
|
1216
|
+
const editor = hook.editor();
|
|
1217
|
+
|
|
1218
|
+
editor.focus();
|
|
1219
|
+
editor.setContent('<p>ab</p>');
|
|
1220
|
+
TinySelections.setCursor(editor, [ 0, 0 ], 1);
|
|
1221
|
+
editor.getContainer().style.display = 'none';
|
|
1222
|
+
TinyAssertions.assertCursor(editor, [ 0, 0 ], 1);
|
|
1223
|
+
editor.getContainer().style.display = '';
|
|
1224
|
+
});
|
|
1225
|
+
|
|
1226
|
+
/*
|
|
1227
|
+
// TODO: Re-implement this test as a separate test if needed by destroying an editor etc
|
|
1228
|
+
it('getRng should return null if win.document is not defined or null', () => {
|
|
1229
|
+
const editor = hook.editor();
|
|
1230
|
+
const win = editor.selection.win;
|
|
1231
|
+
let rng = editor.dom.createRng();
|
|
1232
|
+
|
|
1233
|
+
editor.setContent('<p>x</p>');
|
|
1234
|
+
|
|
1235
|
+
rng.setStart(editor.dom.select('p')[0].firstChild, 0);
|
|
1236
|
+
rng.setEnd(editor.dom.select('p')[0].firstChild, 1);
|
|
1237
|
+
|
|
1238
|
+
editor.selection.setRng(rng);
|
|
1239
|
+
editor.selection.setRng(null);
|
|
1240
|
+
|
|
1241
|
+
editor.selection.win = {};
|
|
1242
|
+
rng = editor.selection.getRng();
|
|
1243
|
+
LegacyUnit.equal(rng, null);
|
|
1244
|
+
|
|
1245
|
+
editor.selection.win = { document: null };
|
|
1246
|
+
rng = editor.selection.getRng();
|
|
1247
|
+
LegacyUnit.equal(rng, null);
|
|
1248
|
+
|
|
1249
|
+
editor.selection.win = win;
|
|
1250
|
+
});
|
|
1251
|
+
*/
|
|
1252
|
+
it('image selection webkit bug', () => {
|
|
1253
|
+
const editor = hook.editor();
|
|
1254
|
+
const testImageSelection = (inputHtml: string, expectedContainerName: string, expectedOffset: number) => {
|
|
1255
|
+
editor.setContent(inputHtml);
|
|
1256
|
+
editor.selection.select(editor.dom.select('img')[0]);
|
|
1257
|
+
|
|
1258
|
+
const rng = editor.selection.getRng();
|
|
1259
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P');
|
|
1260
|
+
LegacyUnit.equal(rng.startOffset, expectedOffset);
|
|
1261
|
+
LegacyUnit.equal(rng.startContainer.nodeName, 'P');
|
|
1262
|
+
LegacyUnit.equal(rng.endOffset, expectedOffset + 1);
|
|
1263
|
+
LegacyUnit.equal(editor.selection.getNode().nodeName, 'IMG');
|
|
1264
|
+
LegacyUnit.equal(editor.selection.getStart().nodeName, 'IMG');
|
|
1265
|
+
LegacyUnit.equal(editor.selection.getEnd().nodeName, 'IMG');
|
|
1266
|
+
|
|
1267
|
+
const nativeSel = editor.selection.getSel() as Selection;
|
|
1268
|
+
const nativeRng = nativeSel.getRangeAt(0);
|
|
1269
|
+
LegacyUnit.equal(nativeRng.startContainer.nodeName, 'P');
|
|
1270
|
+
LegacyUnit.equal(nativeRng.startOffset, expectedOffset);
|
|
1271
|
+
LegacyUnit.equal(nativeRng.startContainer.nodeName, 'P');
|
|
1272
|
+
LegacyUnit.equal(nativeRng.endOffset, expectedOffset + 1);
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
testImageSelection('<p><img src="#"></p>', 'P', 0);
|
|
1276
|
+
testImageSelection('<p><img src="#">abc</p>', 'P', 0);
|
|
1277
|
+
testImageSelection('<p>abc<img src="#"></p>', 'P', 1);
|
|
1278
|
+
testImageSelection('<p>abc<img src="#">def</p>', 'P', 1);
|
|
1279
|
+
testImageSelection('<p><img style="float: right;" src="#"></p>', 'P', 0);
|
|
1280
|
+
testImageSelection('<p><img style="float: right;" src="#">abc</p>', 'P', 0);
|
|
1281
|
+
testImageSelection('<p>abc<img style="float: right;" src="#"></p>', 'P', 1);
|
|
1282
|
+
testImageSelection('<p>abc<img style="float: right;" src="#">def</p>', 'P', 1);
|
|
1283
|
+
testImageSelection('<p><img style="float: left;" src="#"></p>', 'P', 0);
|
|
1284
|
+
testImageSelection('<p><img style="float: left;" src="#">abc</p>', 'P', 0);
|
|
1285
|
+
testImageSelection('<p>abc<img style="float: left;" src="#"></p>', 'P', 1);
|
|
1286
|
+
testImageSelection('<p>abc<img style="float: left;" src="#">def</p>', 'P', 1);
|
|
1287
|
+
testImageSelection('<p dir="rtl"><img style="float: right;" src="#"></p>', 'P', 0);
|
|
1288
|
+
testImageSelection('<p dir="rtl"><img style="float: right;" src="#">abc</p>', 'P', 0);
|
|
1289
|
+
testImageSelection('<p dir="rtl">abc<img style="float: right;" src="#"></p>', 'P', 1);
|
|
1290
|
+
testImageSelection('<p dir="rtl">abc<img style="float: right;" src="#">def</p>', 'P', 1);
|
|
1291
|
+
testImageSelection('<p dir="rtl"><img style="float: left;" src="#"></p>', 'P', 0);
|
|
1292
|
+
testImageSelection('<p dir="rtl"><img style="float: left;" src="#">abc</p>', 'P', 0);
|
|
1293
|
+
testImageSelection('<p dir="rtl">abc<img style="float: left;" src="#"></p>', 'P', 1);
|
|
1294
|
+
testImageSelection('<p dir="rtl">abc<img style="float: left;" src="#">def</p>', 'P', 1);
|
|
1295
|
+
});
|
|
1296
|
+
|
|
1297
|
+
context('isEditable', () => {
|
|
1298
|
+
const testIsEditableSelection = (testCase: { input: string; editableRoot?: boolean; spath: number[]; soffset: number; fpath: number[]; foffset: number; expected: boolean }) => () => {
|
|
1299
|
+
const editor = hook.editor();
|
|
1300
|
+
const editable = testCase.editableRoot ?? true;
|
|
1301
|
+
|
|
1302
|
+
editor.getBody().contentEditable = editable ? 'true' : 'false';
|
|
1303
|
+
editor.setContent(testCase.input);
|
|
1304
|
+
TinySelections.setSelection(editor, testCase.spath, testCase.soffset, testCase.fpath, testCase.foffset);
|
|
1305
|
+
assert.equal(editor.selection.isEditable(), testCase.expected);
|
|
1306
|
+
editor.getBody().contentEditable = 'true';
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
const testIsEditableCaret = (testCase: { input: string; editableRoot?: boolean; path: number[]; offset: number; expected: boolean }) => testIsEditableSelection({
|
|
1310
|
+
input: testCase.input,
|
|
1311
|
+
editableRoot: testCase.editableRoot,
|
|
1312
|
+
spath: testCase.path,
|
|
1313
|
+
soffset: testCase.offset,
|
|
1314
|
+
fpath: testCase.path,
|
|
1315
|
+
foffset: testCase.offset,
|
|
1316
|
+
expected: testCase.expected
|
|
1317
|
+
});
|
|
1318
|
+
|
|
1319
|
+
it('TINY-9462: isEditable on paragraph in editable root', testIsEditableCaret({
|
|
1320
|
+
input: '<p>abc</p>',
|
|
1321
|
+
path: [ 0, 0 ],
|
|
1322
|
+
offset: 0,
|
|
1323
|
+
expected: true
|
|
1324
|
+
}));
|
|
1325
|
+
|
|
1326
|
+
it('TINY-9462: isEditable on paragraph in noneditable root', testIsEditableCaret({
|
|
1327
|
+
input: '<p>abc</p>',
|
|
1328
|
+
editableRoot: false,
|
|
1329
|
+
path: [ 0, 0 ],
|
|
1330
|
+
offset: 0,
|
|
1331
|
+
expected: false
|
|
1332
|
+
}));
|
|
1333
|
+
|
|
1334
|
+
it('TINY-9462: isEditable on expanded range in editable root', testIsEditableSelection({
|
|
1335
|
+
input: '<p>ab</p><p>cd</p>',
|
|
1336
|
+
spath: [ 0, 0 ],
|
|
1337
|
+
soffset: 1,
|
|
1338
|
+
fpath: [ 1, 0 ],
|
|
1339
|
+
foffset: 1,
|
|
1340
|
+
expected: true
|
|
1341
|
+
}));
|
|
1342
|
+
|
|
1343
|
+
it('TINY-9462: isEditable on expanded range in noneditable root', testIsEditableSelection({
|
|
1344
|
+
input: '<p>ab</p><p>cd</p>',
|
|
1345
|
+
editableRoot: false,
|
|
1346
|
+
spath: [ 0, 0 ],
|
|
1347
|
+
soffset: 1,
|
|
1348
|
+
fpath: [ 1, 0 ],
|
|
1349
|
+
foffset: 1,
|
|
1350
|
+
expected: false
|
|
1351
|
+
}));
|
|
1352
|
+
|
|
1353
|
+
it('TINY-9462: isEditable on expanded range where start is noneditable', testIsEditableSelection({
|
|
1354
|
+
input: '<p contenteditable="false">ab</p><p>cd</p>',
|
|
1355
|
+
spath: [ 1, 0 ], // Shifted by one due to fake caret before P
|
|
1356
|
+
soffset: 1,
|
|
1357
|
+
fpath: [ 2, 0 ], // Shifted by one due to fake caret before P
|
|
1358
|
+
foffset: 1,
|
|
1359
|
+
expected: false
|
|
1360
|
+
}));
|
|
1361
|
+
|
|
1362
|
+
it('TINY-9462: isEditable on expanded range where end is noneditable', testIsEditableSelection({
|
|
1363
|
+
input: '<p>ab</p><p contenteditable="false">cd</p>',
|
|
1364
|
+
spath: [ 0, 0 ],
|
|
1365
|
+
soffset: 1,
|
|
1366
|
+
fpath: [ 1, 0 ],
|
|
1367
|
+
foffset: 1,
|
|
1368
|
+
expected: false
|
|
1369
|
+
}));
|
|
1370
|
+
|
|
1371
|
+
it('TINY-9477: isEditable on selected noneditable table cells should be true since parent is editable', testIsEditableSelection({
|
|
1372
|
+
input: '<table><tbody><tr><td contenteditable="false" data-mce-selected="1">a</td><td contenteditable="false" data-mce-selected="1">b</td></tr></tbody></table>',
|
|
1373
|
+
spath: [ 0, 0, 0, 0, 0 ],
|
|
1374
|
+
soffset: 0,
|
|
1375
|
+
fpath: [ 0, 0, 0, 1, 0 ],
|
|
1376
|
+
foffset: 1,
|
|
1377
|
+
expected: true
|
|
1378
|
+
}));
|
|
1379
|
+
});
|
|
1380
|
+
});
|