├── .github
└── workflows
│ ├── build.yml
│ ├── docs.yml
│ └── test.yml
├── .gitignore
├── .vscode
└── extensions.json
├── License.md
├── README.md
├── docs
├── App.vue
├── components
│ ├── Button.vue
│ ├── CodeBlock.vue
│ ├── Header.vue
│ ├── Markdown.vue
│ ├── Menu.vue
│ └── Toolbar.vue
├── custom-types.d.ts
├── index.css
├── main.ts
├── pages
│ ├── android
│ │ ├── index.vue
│ │ └── test-case.vue
│ ├── comps
│ │ ├── editable.md
│ │ ├── editable.vue
│ │ ├── index.vue
│ │ ├── slate.md
│ │ └── slate.vue
│ ├── examples
│ │ ├── check-lists
│ │ │ ├── CheckListsItem.vue
│ │ │ ├── index.vue
│ │ │ └── plugin.ts
│ │ ├── code-highlighting
│ │ │ ├── LanguageSelect.vue
│ │ │ └── index.vue
│ │ ├── cursor-segmentation
│ │ │ └── index.vue
│ │ ├── custom-placeholder
│ │ │ └── index.vue
│ │ ├── editable-voids
│ │ │ ├── EditableVoid.vue
│ │ │ └── index.vue
│ │ ├── embeds
│ │ │ ├── VideoElement.vue
│ │ │ └── index.vue
│ │ ├── forced-layout
│ │ │ └── index.vue
│ │ ├── hovering-toolbar
│ │ │ ├── HoveringToolbar.vue
│ │ │ └── index.vue
│ │ ├── huge-document
│ │ │ └── index.vue
│ │ ├── images
│ │ │ ├── ImageComp.vue
│ │ │ └── index.vue
│ │ ├── index.vue
│ │ ├── inlines
│ │ │ ├── BadgeComponent.vue
│ │ │ ├── ButtonComponent.vue
│ │ │ ├── InlineChromiumBugfix.vue
│ │ │ ├── LinkComponent.vue
│ │ │ └── index.vue
│ │ ├── markdown-preview
│ │ │ └── index.vue
│ │ ├── markdown-shortcuts
│ │ │ ├── index.vue
│ │ │ └── plugin.ts
│ │ ├── mentions
│ │ │ ├── Mention.vue
│ │ │ ├── index.vue
│ │ │ └── utils.ts
│ │ ├── paste-html
│ │ │ ├── ImageElement.vue
│ │ │ └── index.vue
│ │ ├── plain-text
│ │ │ └── index.vue
│ │ ├── read-only
│ │ │ └── index.vue
│ │ ├── remote-cursor
│ │ │ ├── RemoteOverlay.vue
│ │ │ ├── YjsEditor.vue
│ │ │ └── index.vue
│ │ ├── remote-decorate-cursor
│ │ │ ├── YjsEditor.vue
│ │ │ └── index.vue
│ │ ├── remote-simple
│ │ │ ├── YjsEditor.vue
│ │ │ └── index.vue
│ │ ├── render-in-iframe
│ │ │ └── index.vue
│ │ ├── rich-text
│ │ │ ├── BlockButton.vue
│ │ │ ├── MarkButton.vue
│ │ │ └── index.vue
│ │ ├── search-highlighting
│ │ │ └── index.vue
│ │ ├── shadow-dom
│ │ │ ├── ShadowEditor.vue
│ │ │ └── index.vue
│ │ ├── styling
│ │ │ └── index.vue
│ │ └── tables
│ │ │ └── index.vue
│ ├── hooks
│ │ ├── index.vue
│ │ ├── use-composing.md
│ │ ├── use-composing.vue
│ │ ├── use-editor.md
│ │ ├── use-editor.vue
│ │ ├── use-focused.md
│ │ ├── use-focused.vue
│ │ ├── use-inherit-ref.md
│ │ ├── use-inherit-ref.vue
│ │ ├── use-read-only.md
│ │ ├── use-read-only.vue
│ │ ├── use-selected.md
│ │ ├── use-selected.vue
│ │ ├── use-selection.md
│ │ └── use-selection.vue
│ ├── introduction
│ │ ├── get-start.md
│ │ ├── get-start.vue
│ │ ├── index.vue
│ │ ├── what-difference.md
│ │ └── what-difference.vue
│ └── packages
│ │ ├── core.md
│ │ ├── core.vue
│ │ ├── dom.md
│ │ ├── dom.vue
│ │ ├── history.md
│ │ ├── history.vue
│ │ ├── hyperscript.md
│ │ ├── hyperscript.vue
│ │ ├── index.vue
│ │ ├── yjs.md
│ │ └── yjs.vue
├── routes.ts
├── tsconfig.json
└── utils
│ └── normalize-tokens.ts
├── e2e
├── check-lists.test.ts
├── code-highlighting.test.ts
├── editable-voids.test.ts
├── embeds.test.ts
├── forced-layout.test.ts
├── hovering-toolbar.test.ts
├── huge-document.test.ts
├── iframe.test.ts
├── images.test.ts
├── inlines.test.ts
├── markdown-preview.test.ts
├── markdown-shortcuts.test.ts
├── mentions.test.ts
├── paste-html.test.ts
├── placeholder.test.ts
├── plain-text.test.ts
├── read-only.test.ts
├── rich-text.test.ts
├── search-highlighting.test.ts
├── select.test.ts
├── shadow-dom.test.ts
├── styling.test.ts
└── tables.test.ts
├── index.html
├── package.json
├── packages
├── share-tools
│ └── index.ts
├── slate-dom
│ ├── custom-types.ts
│ ├── index.ts
│ ├── plugin
│ │ ├── dom-editor.ts
│ │ └── with-dom.ts
│ └── utils
│ │ ├── diff-text.ts
│ │ ├── dom.ts
│ │ ├── environment.ts
│ │ ├── hotkeys.ts
│ │ ├── key.ts
│ │ ├── lines.ts
│ │ ├── range-list.ts
│ │ ├── types.ts
│ │ └── weak-maps.ts
├── slate-history
│ ├── history-editor.ts
│ ├── history.ts
│ ├── index.ts
│ └── with-history.ts
├── slate-hyperscript
│ ├── creators.ts
│ ├── hyperscript.ts
│ ├── index.ts
│ └── tokens.ts
├── slate-vue
│ ├── components
│ │ ├── children.ts
│ │ ├── editable.ts
│ │ ├── element.ts
│ │ ├── placeholder.ts
│ │ ├── slate.ts
│ │ ├── string.ts
│ │ ├── text.ts
│ │ └── utils.ts
│ ├── hooks
│ │ ├── use-android-manager.ts
│ │ ├── use-composing.ts
│ │ ├── use-decorate.ts
│ │ ├── use-editor.ts
│ │ ├── use-focused.ts
│ │ ├── use-inherit-ref.ts
│ │ ├── use-read-only.ts
│ │ ├── use-render.ts
│ │ ├── use-selected.ts
│ │ └── use-selection.ts
│ ├── index.ts
│ └── utils
│ │ ├── constants.ts
│ │ └── interface.ts
├── slate-yjs
│ ├── applyToSlate
│ │ ├── index.ts
│ │ └── textEvent.ts
│ ├── applyToYjs
│ │ ├── index.ts
│ │ ├── node
│ │ │ ├── index.ts
│ │ │ ├── insertNode.ts
│ │ │ ├── mergeNode.ts
│ │ │ ├── moveNode.ts
│ │ │ ├── removeNode.ts
│ │ │ ├── setNode.ts
│ │ │ └── splitNode.ts
│ │ ├── text
│ │ │ ├── index.ts
│ │ │ ├── insertText.ts
│ │ │ └── removeText.ts
│ │ └── types.ts
│ ├── hooks
│ │ ├── useDecorateRemoteCursors.ts
│ │ ├── useRemoteCursorOverlayPositions.ts
│ │ ├── useRemoteCursorStates.ts
│ │ ├── useUnsetCursorPositionOnBlur.ts
│ │ └── utils.ts
│ ├── index.ts
│ ├── model
│ │ └── types.ts
│ ├── plugins
│ │ ├── index.ts
│ │ ├── withCursors.ts
│ │ ├── withYHistory.ts
│ │ └── withYjs.ts
│ └── utils
│ │ ├── clone.ts
│ │ ├── convert.ts
│ │ ├── delta.ts
│ │ ├── location.ts
│ │ ├── object.ts
│ │ ├── position.ts
│ │ ├── slate.ts
│ │ └── yjs.ts
└── slate
│ ├── core
│ ├── apply.ts
│ ├── batch-dirty-paths.ts
│ ├── get-dirty-paths.ts
│ ├── get-fragment.ts
│ ├── index.ts
│ ├── normalize-node.ts
│ ├── should-normalize.ts
│ └── update-dirty-paths.ts
│ ├── create-editor.ts
│ ├── editor
│ ├── above.ts
│ ├── add-mark.ts
│ ├── after.ts
│ ├── before.ts
│ ├── delete-backward.ts
│ ├── delete-forward.ts
│ ├── delete-fragment.ts
│ ├── edges.ts
│ ├── element-read-only.ts
│ ├── end.ts
│ ├── first.ts
│ ├── fragment.ts
│ ├── get-void.ts
│ ├── has-blocks.ts
│ ├── has-inlines.ts
│ ├── has-path.ts
│ ├── has-texts.ts
│ ├── index.ts
│ ├── insert-break.ts
│ ├── insert-node.ts
│ ├── insert-soft-break.ts
│ ├── insert-text.ts
│ ├── is-block.ts
│ ├── is-edge.ts
│ ├── is-editor.ts
│ ├── is-empty.ts
│ ├── is-end.ts
│ ├── is-normalizing.ts
│ ├── is-start.ts
│ ├── last.ts
│ ├── leaf.ts
│ ├── levels.ts
│ ├── marks.ts
│ ├── next.ts
│ ├── node.ts
│ ├── nodes.ts
│ ├── normalize.ts
│ ├── parent.ts
│ ├── path-ref.ts
│ ├── path-refs.ts
│ ├── path.ts
│ ├── point-ref.ts
│ ├── point-refs.ts
│ ├── point.ts
│ ├── positions.ts
│ ├── previous.ts
│ ├── range-ref.ts
│ ├── range-refs.ts
│ ├── range.ts
│ ├── remove-mark.ts
│ ├── set-normalizing.ts
│ ├── should-merge-nodes-remove-prev-node.ts
│ ├── start.ts
│ ├── string.ts
│ ├── unhang-range.ts
│ └── without-normalizing.ts
│ ├── index.ts
│ ├── interfaces
│ ├── editor.ts
│ ├── element.ts
│ ├── index.ts
│ ├── location.ts
│ ├── node.ts
│ ├── operation.ts
│ ├── path-ref.ts
│ ├── path.ts
│ ├── point-ref.ts
│ ├── point.ts
│ ├── range-ref.ts
│ ├── range.ts
│ ├── scrubber.ts
│ ├── text.ts
│ └── transforms
│ │ ├── general.ts
│ │ ├── index.ts
│ │ ├── node.ts
│ │ ├── selection.ts
│ │ └── text.ts
│ ├── transforms-node
│ ├── index.ts
│ ├── insert-nodes.ts
│ ├── lift-nodes.ts
│ ├── merge-nodes.ts
│ ├── move-nodes.ts
│ ├── remove-nodes.ts
│ ├── set-nodes.ts
│ ├── split-nodes.ts
│ ├── unset-nodes.ts
│ ├── unwrap-nodes.ts
│ └── wrap-nodes.ts
│ ├── transforms-selection
│ ├── collapse.ts
│ ├── deselect.ts
│ ├── index.ts
│ ├── move.ts
│ ├── select.ts
│ ├── set-point.ts
│ └── set-selection.ts
│ ├── transforms-text
│ ├── delete-text.ts
│ ├── index.ts
│ └── insert-fragment.ts
│ ├── types
│ ├── custom-types.ts
│ ├── index.ts
│ └── types.ts
│ └── utils
│ ├── deep-equal.ts
│ ├── get-default-insert-location.ts
│ ├── index.ts
│ ├── is-object.ts
│ ├── match-path.ts
│ ├── string.ts
│ ├── types.ts
│ └── weak-maps.ts
├── playwright.config.ts
├── pnpm-lock.yaml
├── public
├── 404.html
├── banner.png
├── consolas.ttf
├── example.png
├── favicon.ico
└── material.woff2
├── test
├── slate-history
│ ├── isHistory
│ │ ├── after-edit.jsx
│ │ ├── after-redo.jsx
│ │ ├── after-undo.jsx
│ │ ├── before-edit.jsx
│ │ └── index.spec.js
│ └── undo
│ │ ├── block-join-reverse.jsx
│ │ ├── block-nested-reverse.jsx
│ │ ├── block-text.jsx
│ │ ├── contiguous.jsx
│ │ ├── custom-prop.jsx
│ │ ├── index.spec.js
│ │ ├── inline-across.jsx
│ │ ├── insert-break.jsx
│ │ ├── insert-fragment.jsx
│ │ ├── insert-text.jsx
│ │ ├── keep-after-focus-and-remove-text-undo.jsx
│ │ └── no-contiguous.jsx
├── slate-hyperscript
│ ├── fixtures
│ │ ├── cursor-across-element.jsx
│ │ ├── cursor-across-elements-empty.jsx
│ │ ├── cursor-across-elements-end.jsx
│ │ ├── cursor-across-elements-middle.jsx
│ │ ├── cursor-across-elements-start.jsx
│ │ ├── cursor-element-empty.jsx
│ │ ├── cursor-element-end.jsx
│ │ ├── cursor-element-middle.jsx
│ │ ├── cursor-element-nested-end.jsx
│ │ ├── cursor-element-nested-middle.jsx
│ │ ├── cursor-element-nested-start.jsx
│ │ ├── cursor-element-start.jsx
│ │ ├── cursor-text-empty.jsx
│ │ ├── element-custom.jsx
│ │ ├── element-empty.jsx
│ │ ├── element-nested-empty.jsx
│ │ ├── element-nested-string.jsx
│ │ ├── element-string.jsx
│ │ ├── element-text-empty.jsx
│ │ ├── element-text-string.jsx
│ │ ├── fragment-element.jsx
│ │ ├── fragment-empty.jsx
│ │ ├── fragment-string.jsx
│ │ ├── selection-offset-start.jsx
│ │ ├── selection.jsx
│ │ ├── text-empty.jsx
│ │ ├── text-full.jsx
│ │ ├── text-nested.jsx
│ │ └── value-empty.jsx
│ └── index.spec.js
├── slate-vue
│ ├── VueEditor.vue
│ ├── editable
│ │ └── index.spec.js
│ └── editor
│ │ └── index.spec.js
├── slate-yjs
│ ├── addMark
│ │ ├── acrossMarks.jsx
│ │ ├── acrossMarksSame.jsx
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfDocument.jsx
│ │ └── withOtherMarks.jsx
│ ├── index.spec.js
│ ├── insertNode
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfDocument.jsx
│ │ └── inTheMiddle.jsx
│ ├── insertText
│ │ ├── atBeginningOfBlock.jsx
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfBlock.jsx
│ │ ├── atEndOfDocument.jsx
│ │ ├── inTheMiddle.jsx
│ │ ├── inTheMiddleOfNestedBlock.jsx
│ │ ├── insideMarks.jsx
│ │ ├── withEmptyString.jsx
│ │ ├── withEntities.jsx
│ │ ├── withMarks.jsx
│ │ └── withUnicode.jsx
│ ├── mergeNode
│ │ ├── afterADeleteBackward.jsx
│ │ ├── inSameParent.jsx
│ │ ├── onMixedNestedNodes.jsx
│ │ ├── onMixedTypeNodes.jsx
│ │ └── withUnicode.jsx
│ ├── moveNode
│ │ ├── downward
│ │ │ ├── whenBlockBecomesNested.jsx
│ │ │ ├── whenBlockBecomesNonNested.jsx
│ │ │ ├── whenBlockStaysNested.jsx
│ │ │ └── whenBlockStaysNonNested.jsx
│ │ └── upward
│ │ │ ├── whenBlockBecomesNested.jsx
│ │ │ ├── whenBlockBecomesNonNested.jsx
│ │ │ ├── whenBlockStaysNested.jsx
│ │ │ └── whenBlockStaysNonNested.jsx
│ ├── removeMark
│ │ ├── inTheMiddleOfText.jsx
│ │ ├── withAddMark.jsx
│ │ └── withOtherMarks.jsx
│ ├── removeNode
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfDocument.jsx
│ │ ├── nestedBlock.jsx
│ │ └── wrapperBlock.jsx
│ ├── removeText
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfDocument.jsx
│ │ └── withUnicode.jsx
│ ├── setNode
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfDocument.jsx
│ │ ├── onDataChange.jsx
│ │ ├── onDataChangeOnInline.jsx
│ │ ├── onResetBlock.jsx
│ │ └── withAChangeOfType.jsx
│ └── splitNode
│ │ ├── atBeginningOfDocument.jsx
│ │ ├── atEndOfBlock.jsx
│ │ ├── atEndOfDocument.jsx
│ │ ├── onNonDefaultBlock.jsx
│ │ ├── withMultipleSubNodes.jsx
│ │ └── withUnicode.jsx
├── slate
│ ├── interfaces
│ │ ├── CustomTypes
│ │ │ ├── boldText-false.jsx
│ │ │ ├── boldText-true.jsx
│ │ │ ├── custom-types.ts
│ │ │ ├── customOperation-false.jsx
│ │ │ ├── customOperation-true.jsx
│ │ │ ├── customText-false.jsx
│ │ │ ├── customText-true.jsx
│ │ │ ├── headingElement-false.jsx
│ │ │ ├── headingElement-true.jsx
│ │ │ └── type-guards.ts
│ │ ├── Editor
│ │ │ ├── above
│ │ │ │ ├── block-highest.jsx
│ │ │ │ ├── block-lowest.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── potential-parent.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── after
│ │ │ │ ├── end.jsx
│ │ │ │ ├── non-selectable-inline.jsx
│ │ │ │ ├── path-void.jsx
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point-void.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-void.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── before
│ │ │ │ ├── non-selectable-inline.jsx
│ │ │ │ ├── path-void.jsx
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point-void.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-void.jsx
│ │ │ │ ├── range.jsx
│ │ │ │ └── start.jsx
│ │ │ ├── edges
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── end
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── hasBlocks
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline-nested.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── hasInlines
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline-nested.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── hasTexts
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline-nested.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── isBlock
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── isEdge
│ │ │ │ ├── path-end.jsx
│ │ │ │ ├── path-middle.jsx
│ │ │ │ └── path-start.jsx
│ │ │ ├── isEmpty
│ │ │ │ ├── block-blank.jsx
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-full.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ ├── inline-blank.jsx
│ │ │ │ ├── inline-empty.jsx
│ │ │ │ ├── inline-full.jsx
│ │ │ │ └── inline-void.jsx
│ │ │ ├── isEnd
│ │ │ │ ├── path-end.jsx
│ │ │ │ ├── path-middle.jsx
│ │ │ │ └── path-start.jsx
│ │ │ ├── isInline
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── isStart
│ │ │ │ ├── path-end.jsx
│ │ │ │ ├── path-middle.jsx
│ │ │ │ └── path-start.jsx
│ │ │ ├── isVoid
│ │ │ │ ├── block-void.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline-void.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── levels
│ │ │ │ ├── match.jsx
│ │ │ │ ├── reverse.jsx
│ │ │ │ ├── success.jsx
│ │ │ │ ├── voids-false.jsx
│ │ │ │ └── voids-true.jsx
│ │ │ ├── marks
│ │ │ │ ├── firefox-double-click.jsx
│ │ │ │ ├── focus-block-end.jsx
│ │ │ │ ├── markable-void-collapsed.jsx
│ │ │ │ ├── markable-voids-mixed.jsx
│ │ │ │ ├── mixed-text.jsx
│ │ │ │ └── text-collapsed.jsx
│ │ │ ├── next
│ │ │ │ ├── block.jsx
│ │ │ │ ├── default.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── node
│ │ │ │ ├── pass.jsx
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-end.jsx
│ │ │ │ ├── range-start.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── nodes
│ │ │ │ ├── ignore-non-selectable
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ │ ├── match-function
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ ├── editor.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ │ ├── mode-all
│ │ │ │ │ └── block.jsx
│ │ │ │ ├── mode-highest
│ │ │ │ │ └── block.jsx
│ │ │ │ ├── mode-lowest
│ │ │ │ │ └── block.jsx
│ │ │ │ ├── mode-universal
│ │ │ │ │ ├── all-nested.jsx
│ │ │ │ │ ├── all.jsx
│ │ │ │ │ ├── branch-nested.jsx
│ │ │ │ │ ├── none-nested.jsx
│ │ │ │ │ ├── none.jsx
│ │ │ │ │ ├── some-nested.jsx
│ │ │ │ │ └── some.jsx
│ │ │ │ ├── no-match
│ │ │ │ │ ├── block-multiple.jsx
│ │ │ │ │ ├── block-nested.jsx
│ │ │ │ │ ├── block-reverse.jsx
│ │ │ │ │ ├── block-void.jsx
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ ├── inline-multiple.jsx
│ │ │ │ │ ├── inline-nested.jsx
│ │ │ │ │ ├── inline-reverse.jsx
│ │ │ │ │ ├── inline-void.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ │ └── voids-true
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ ├── parent
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-end.jsx
│ │ │ │ ├── range-start.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── path
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-end.jsx
│ │ │ │ ├── range-start.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── point
│ │ │ │ ├── path-end.jsx
│ │ │ │ ├── path-start.jsx
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-end.jsx
│ │ │ │ ├── range-start.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── positions
│ │ │ │ ├── all
│ │ │ │ │ ├── block-multiple-reverse.jsx
│ │ │ │ │ ├── block-multiple.jsx
│ │ │ │ │ ├── block-nested.jsx
│ │ │ │ │ ├── block-reverse.jsx
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ ├── inline-fragmentation-empty-text.jsx
│ │ │ │ │ ├── inline-fragmentation-reverse.jsx
│ │ │ │ │ ├── inline-fragmentation.jsx
│ │ │ │ │ ├── inline-multiple.jsx
│ │ │ │ │ ├── inline-nested.jsx
│ │ │ │ │ ├── inline-normalized.jsx
│ │ │ │ │ ├── inline-reverse.jsx
│ │ │ │ │ ├── inline.jsx
│ │ │ │ │ ├── unit-block-reverse.jsx
│ │ │ │ │ ├── unit-block.jsx
│ │ │ │ │ ├── unit-character-inline-fragmentation-multibyte.jsx
│ │ │ │ │ ├── unit-character-inline-fragmentation-reverse.jsx
│ │ │ │ │ ├── unit-character-inline-fragmentation.jsx
│ │ │ │ │ ├── unit-character-reverse.jsx
│ │ │ │ │ ├── unit-character.jsx
│ │ │ │ │ ├── unit-line-inline-fragmentation-reverse.jsx
│ │ │ │ │ ├── unit-line-inline-fragmentation.jsx
│ │ │ │ │ ├── unit-line-reverse.jsx
│ │ │ │ │ ├── unit-line.jsx
│ │ │ │ │ ├── unit-word-inline-fragmentation.jsx
│ │ │ │ │ ├── unit-word-reverse.jsx
│ │ │ │ │ └── unit-word.jsx
│ │ │ │ ├── ignore-non-selectable
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ │ ├── path
│ │ │ │ │ ├── block-nested.jsx
│ │ │ │ │ ├── block-reverse.jsx
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ ├── inline-nested.jsx
│ │ │ │ │ ├── inline-reverse.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ │ ├── range
│ │ │ │ │ ├── block-reverse.jsx
│ │ │ │ │ ├── block.jsx
│ │ │ │ │ └── inline.jsx
│ │ │ │ └── voids-true
│ │ │ │ │ ├── block-all-reverse.jsx
│ │ │ │ │ ├── block-all.jsx
│ │ │ │ │ ├── inline-all-reverse.jsx
│ │ │ │ │ └── inline-all.jsx
│ │ │ ├── previous
│ │ │ │ ├── block.jsx
│ │ │ │ ├── default.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── range
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── range-backward.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── start
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ └── range.jsx
│ │ │ ├── string
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ ├── block-voids-true.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ └── text.jsx
│ │ │ └── unhangRange
│ │ │ │ ├── block-hanging-over-non-empty-void-with-voids-option.jsx
│ │ │ │ ├── block-hanging-over-void-with-voids-option.jsx
│ │ │ │ ├── block-hanging-over-void.jsx
│ │ │ │ ├── block-hanging.jsx
│ │ │ │ ├── collapsed.jsx
│ │ │ │ ├── inline-at-end.jsx
│ │ │ │ ├── inline-range-normal.jsx
│ │ │ │ ├── multi-block-inline-at-end.jsx
│ │ │ │ ├── not-hanging-inline-at-end.jsx
│ │ │ │ ├── not-hanging-multi-block-inline-at-end.jsx
│ │ │ │ ├── text-hanging.jsx
│ │ │ │ ├── void-hanging-with-voids-option.jsx
│ │ │ │ └── void-hanging.jsx
│ │ ├── Element
│ │ │ ├── isElement
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── custom-property.jsx
│ │ │ │ ├── editor.jsx
│ │ │ │ ├── element.jsx
│ │ │ │ ├── isElementDiscriminant.jsx
│ │ │ │ ├── isElementDiscriminantFalse.jsx
│ │ │ │ ├── isElementType.jsx
│ │ │ │ ├── isElementTypeFalse.jsx
│ │ │ │ ├── nodes-full.jsx
│ │ │ │ ├── object.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── isElementList
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── element.jsx
│ │ │ │ ├── empty.jsx
│ │ │ │ ├── full-editor.jsx
│ │ │ │ ├── full-element.jsx
│ │ │ │ ├── full-text.jsx
│ │ │ │ └── not-full-element.jsx
│ │ │ └── matches
│ │ │ │ ├── custom-prop-match.jsx
│ │ │ │ ├── custom-prop-not-match.jsx
│ │ │ │ └── empty-match.jsx
│ │ ├── Node
│ │ │ ├── ancestor
│ │ │ │ └── success.jsx
│ │ │ ├── ancestors
│ │ │ │ ├── reverse.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── child
│ │ │ │ └── success.jsx
│ │ │ ├── children
│ │ │ │ ├── all.jsx
│ │ │ │ └── reverse.jsx
│ │ │ ├── descendant
│ │ │ │ └── success.jsx
│ │ │ ├── descendants
│ │ │ │ ├── all.jsx
│ │ │ │ ├── from.jsx
│ │ │ │ ├── reverse.jsx
│ │ │ │ └── to.jsx
│ │ │ ├── elements
│ │ │ │ ├── all.jsx
│ │ │ │ ├── path.jsx
│ │ │ │ ├── range.jsx
│ │ │ │ └── reverse.jsx
│ │ │ ├── first
│ │ │ │ └── success.jsx
│ │ │ ├── get
│ │ │ │ ├── root.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── getIf
│ │ │ │ ├── root.jsx
│ │ │ │ ├── success.jsx
│ │ │ │ └── undefined.jsx
│ │ │ ├── isNode
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── custom-property.jsx
│ │ │ │ ├── element.jsx
│ │ │ │ ├── object.jsx
│ │ │ │ ├── text.jsx
│ │ │ │ └── value.jsx
│ │ │ ├── isNodeList
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── element.jsx
│ │ │ │ ├── empty.jsx
│ │ │ │ ├── full-element.jsx
│ │ │ │ ├── full-text.jsx
│ │ │ │ ├── full-value.jsx
│ │ │ │ └── not-full-node.jsx
│ │ │ ├── leaf
│ │ │ │ └── success.jsx
│ │ │ ├── levels
│ │ │ │ ├── reverse.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── nodes
│ │ │ │ ├── all.jsx
│ │ │ │ ├── multiple-elements.jsx
│ │ │ │ ├── nested-elements.jsx
│ │ │ │ ├── pass.jsx
│ │ │ │ └── to.jsx
│ │ │ ├── parent
│ │ │ │ └── success.jsx
│ │ │ ├── string
│ │ │ │ ├── across-elements.jsx
│ │ │ │ ├── element.jsx
│ │ │ │ └── text.jsx
│ │ │ └── texts
│ │ │ │ ├── all.jsx
│ │ │ │ ├── from.jsx
│ │ │ │ ├── multiple-elements.jsx
│ │ │ │ ├── reverse.jsx
│ │ │ │ └── to.jsx
│ │ ├── Operation
│ │ │ ├── inverse
│ │ │ │ └── moveNode
│ │ │ │ │ ├── backward-in-parent.jsx
│ │ │ │ │ ├── child-to-ends-after-parent.jsx
│ │ │ │ │ ├── child-to-ends-before-parent.jsx
│ │ │ │ │ ├── child-to-parent.jsx
│ │ │ │ │ ├── ends-after-parent-to-child.jsx
│ │ │ │ │ ├── ends-before-parent-to-child.jsx
│ │ │ │ │ ├── forward-in-parent.jsx
│ │ │ │ │ └── non-sibling.jsx
│ │ │ ├── isOperation
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── custom-property.jsx
│ │ │ │ ├── insert_node.jsx
│ │ │ │ ├── insert_text.jsx
│ │ │ │ ├── merge_node.jsx
│ │ │ │ ├── move_node.jsx
│ │ │ │ ├── object.jsx
│ │ │ │ ├── remove_node.jsx
│ │ │ │ ├── remove_text.jsx
│ │ │ │ ├── set_node.jsx
│ │ │ │ ├── set_selection.jsx
│ │ │ │ ├── split_node.jsx
│ │ │ │ └── without-type.jsx
│ │ │ └── isOperationList
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── empty.jsx
│ │ │ │ ├── full.jsx
│ │ │ │ ├── not-full-operaion.jsx
│ │ │ │ └── operation.jsx
│ │ ├── Path
│ │ │ ├── ancestors
│ │ │ │ ├── reverse.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── common
│ │ │ │ ├── equal.jsx
│ │ │ │ ├── root.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── compare
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ ├── equal.jsx
│ │ │ │ └── root.jsx
│ │ │ ├── endsAfter
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ ├── ends-after.jsx
│ │ │ │ ├── ends-at.jsx
│ │ │ │ ├── ends-before.jsx
│ │ │ │ ├── equal.jsx
│ │ │ │ └── root.jsx
│ │ │ ├── endsAt
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── ends-after.jsx
│ │ │ │ ├── ends-at.jsx
│ │ │ │ ├── ends-before.jsx
│ │ │ │ ├── equal.jsx
│ │ │ │ └── root.jsx
│ │ │ ├── endsBefore
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ ├── ends-after.jsx
│ │ │ │ ├── ends-at.jsx
│ │ │ │ ├── ends-before.jsx
│ │ │ │ ├── equal.jsx
│ │ │ │ └── root.jsx
│ │ │ ├── equals
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ ├── equal.jsx
│ │ │ │ └── root.jsx
│ │ │ ├── hasPrevious
│ │ │ │ ├── root.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── isAfter
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── isAncestor
│ │ │ │ ├── above-grandparent.jsx
│ │ │ │ ├── above-parent.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.js
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── isBefore
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── isChild
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.js
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below-child.jsx
│ │ │ │ ├── below-grandchild.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── isDescendant
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below-child.jsx
│ │ │ │ ├── below-grandchild.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── isParent
│ │ │ │ ├── above-grandparent.jsx
│ │ │ │ ├── above-parent.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── isPath
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── empty.jsx
│ │ │ │ ├── full.jsx
│ │ │ │ └── strings.jsx
│ │ │ ├── isSibling
│ │ │ │ ├── above.jsx
│ │ │ │ ├── after-sibling.jsx
│ │ │ │ ├── after.jsx
│ │ │ │ ├── before-sibling.jsx
│ │ │ │ ├── before.jsx
│ │ │ │ ├── below.jsx
│ │ │ │ └── equal.jsx
│ │ │ ├── levels
│ │ │ │ ├── reverse.jsx
│ │ │ │ └── success.jsx
│ │ │ ├── next
│ │ │ │ └── success.jsx
│ │ │ ├── parent
│ │ │ │ └── success.jsx
│ │ │ ├── previous
│ │ │ │ └── success.jsx
│ │ │ ├── relative
│ │ │ │ ├── grandparent.jsx
│ │ │ │ ├── parent.jsx
│ │ │ │ └── root.jsx
│ │ │ └── transform
│ │ │ │ └── move_node
│ │ │ │ ├── ancestor-sibling-ends-after-to-ancestor.jsx
│ │ │ │ ├── ancestor-sibling-ends-after-to-ends-after.jsx
│ │ │ │ ├── ancestor-sibling-ends-before-to-ancestor.jsx
│ │ │ │ ├── ancestor-sibling-ends-before-to-ends-after.jsx
│ │ │ │ ├── ancestor-to-ends-after.jsx
│ │ │ │ ├── ancestor-to-ends-before.jsx
│ │ │ │ ├── ends-after-to-no-relation.jsx
│ │ │ │ ├── ends-before-to-no-relation.jsx
│ │ │ │ ├── equal-to-ends-after.jsx
│ │ │ │ ├── equal-to-ends-before.js
│ │ │ │ ├── equal-to-ends-before.jsx
│ │ │ │ ├── no-relation-to-ends-after.jsx
│ │ │ │ ├── no-relation-to-ends-before.jsx
│ │ │ │ ├── parent-to-ends-after.jsx
│ │ │ │ ├── parent-to-ends-before.jsx
│ │ │ │ ├── sibling-ends-after-to-ends-equal.jsx
│ │ │ │ ├── sibling-ends-after-to-sibling-ends-before.jsx
│ │ │ │ ├── sibling-ends-before-to-ends-equal.jsx
│ │ │ │ └── sibling-ends-before-to-sibling-ends-after.jsx
│ │ ├── Point
│ │ │ ├── compare
│ │ │ │ ├── path-after-offset-after.jsx
│ │ │ │ ├── path-after-offset-before.jsx
│ │ │ │ ├── path-after-offset-equal.jsx
│ │ │ │ ├── path-before-offset-after.jsx
│ │ │ │ ├── path-before-offset-before.jsx
│ │ │ │ ├── path-before-offset-equal.jsx
│ │ │ │ ├── path-equal-offset-after.jsx
│ │ │ │ ├── path-equal-offset-before.jsx
│ │ │ │ └── path-equal-offset-equal.jsx
│ │ │ ├── equals
│ │ │ │ ├── path-after-offset-after.jsx
│ │ │ │ ├── path-after-offset-before.jsx
│ │ │ │ ├── path-after-offset-equal.jsx
│ │ │ │ ├── path-before-offset-after.jsx
│ │ │ │ ├── path-before-offset-before.jsx
│ │ │ │ ├── path-before-offset-equal.jsx
│ │ │ │ ├── path-equal-offset-after.jsx
│ │ │ │ ├── path-equal-offset-before.jsx
│ │ │ │ └── path-equal-offset-equal.jsx
│ │ │ ├── isAfter
│ │ │ │ ├── path-after-offset-after.jsx
│ │ │ │ ├── path-after-offset-before.jsx
│ │ │ │ ├── path-after-offset-equal.jsx
│ │ │ │ ├── path-before-offset-after.jsx
│ │ │ │ ├── path-before-offset-before.jsx
│ │ │ │ ├── path-before-offset-equal.jsx
│ │ │ │ ├── path-equal-offset-after.jsx
│ │ │ │ ├── path-equal-offset-before.jsx
│ │ │ │ └── path-equal-offset-equal.jsx
│ │ │ ├── isBefore
│ │ │ │ ├── path-after-offset-after.jsx
│ │ │ │ ├── path-after-offset-before.jsx
│ │ │ │ ├── path-after-offset-equal.jsx
│ │ │ │ ├── path-before-offset-after.jsx
│ │ │ │ ├── path-before-offset-before.jsx
│ │ │ │ ├── path-before-offset-equal.jsx
│ │ │ │ ├── path-equal-offset-after.jsx
│ │ │ │ ├── path-equal-offset-before.jsx
│ │ │ │ └── path-equal-offset-equal.jsx
│ │ │ ├── isPoint
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── custom-property.jsx
│ │ │ │ ├── object.jsx
│ │ │ │ ├── offset.jsx
│ │ │ │ ├── path.jsx
│ │ │ │ ├── point.jsx
│ │ │ │ ├── without-offset.jsx
│ │ │ │ └── without-path.jsx
│ │ │ └── transform
│ │ │ │ ├── backward-insert-text-after-point.jsx
│ │ │ │ ├── backward-insert-text-at-point.jsx
│ │ │ │ ├── backward-insert-text-before-point.jsx
│ │ │ │ ├── forward-insert-text-after-point.jsx
│ │ │ │ ├── forward-insert-text-at-point.jsx
│ │ │ │ └── forward-insert-text-before-point.jsx
│ │ ├── Range
│ │ │ ├── edges
│ │ │ │ └── collapsed.jsx
│ │ │ ├── equals
│ │ │ │ ├── equal.jsx
│ │ │ │ └── not-equal.jsx
│ │ │ ├── includes
│ │ │ │ ├── path-after.jsx
│ │ │ │ ├── path-before.jsx
│ │ │ │ ├── path-end.jsx
│ │ │ │ ├── path-inside.jsx
│ │ │ │ ├── path-start.jsx
│ │ │ │ ├── point-inside.jsx
│ │ │ │ ├── point-offset-before.jsx
│ │ │ │ ├── point-path-after.jsx
│ │ │ │ ├── point-path-before.jsx
│ │ │ │ └── point-start.jsx
│ │ │ ├── isBackward
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── collapsed.jsx
│ │ │ │ └── forward.jsx
│ │ │ ├── isCollapsed
│ │ │ │ ├── collapsed.jsx
│ │ │ │ └── expanded.jsx
│ │ │ ├── isExpanded
│ │ │ │ ├── collapsed.jsx
│ │ │ │ └── expanded.jsx
│ │ │ ├── isForward
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── collapsed.jsx
│ │ │ │ └── forward.jsx
│ │ │ ├── isRange
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── custom-property.jsx
│ │ │ │ ├── object.jsx
│ │ │ │ ├── range.jsx
│ │ │ │ ├── without-anchor.jsx
│ │ │ │ └── without-focus.jsx
│ │ │ ├── points
│ │ │ │ └── full-selection.jsx
│ │ │ └── transform
│ │ │ │ ├── inward-collapsed.jsx
│ │ │ │ └── outward-collapsed.jsx
│ │ ├── Scrubber
│ │ │ └── scrubber.ts
│ │ ├── Text
│ │ │ ├── decorations
│ │ │ │ ├── adjacent.js
│ │ │ │ ├── collapse.js
│ │ │ │ ├── end.jsx
│ │ │ │ ├── intersect.js
│ │ │ │ ├── merge.ts
│ │ │ │ ├── middle.jsx
│ │ │ │ ├── overlapping.jsx
│ │ │ │ └── start.jsx
│ │ │ ├── equals
│ │ │ │ ├── complex-exact-equals.js
│ │ │ │ ├── complex-exact-not-equal.js
│ │ │ │ ├── complex-loose-equals.js
│ │ │ │ ├── complex-loose-not-equal.js
│ │ │ │ ├── exact-equals.js
│ │ │ │ ├── exact-not-equal.js
│ │ │ │ ├── loose-equals.js
│ │ │ │ └── loose-not-equal.js
│ │ │ ├── isText
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── custom-property.jsx
│ │ │ │ ├── object.jsx
│ │ │ │ ├── text-full.jsx
│ │ │ │ ├── text.jsx
│ │ │ │ └── without-text.jsx
│ │ │ ├── isTextList
│ │ │ │ ├── boolean.jsx
│ │ │ │ ├── empty.jsx
│ │ │ │ ├── full-element.jsx
│ │ │ │ ├── full-text.jsx
│ │ │ │ ├── full-value.jsx
│ │ │ │ ├── not-full-text.jsx
│ │ │ │ └── text.jsx
│ │ │ └── matches
│ │ │ │ ├── empty-true.jsx
│ │ │ │ ├── match-false.jsx
│ │ │ │ ├── match-true.jsx
│ │ │ │ ├── partial-false.jsx
│ │ │ │ ├── partial-true.jsx
│ │ │ │ ├── undefined-false.js
│ │ │ │ └── undefined-true.js
│ │ └── index.spec.js
│ ├── normalization
│ │ ├── block
│ │ │ ├── insert-custom-block.jsx
│ │ │ ├── insert-text.jsx
│ │ │ ├── remove-block.jsx
│ │ │ ├── remove-inline-with-wrapping.jsx
│ │ │ └── remove-inline.jsx
│ │ ├── editor
│ │ │ ├── remove-inline-with-wrapping.jsx
│ │ │ ├── remove-inline.jsx
│ │ │ ├── remove-text-with-wrapping.jsx
│ │ │ └── remove-text.jsx
│ │ ├── index.spec.js
│ │ ├── inline
│ │ │ ├── insert-adjacent-text.jsx
│ │ │ └── remove-block.jsx
│ │ ├── text
│ │ │ ├── merge-adjacent-empty-after-nested.jsx
│ │ │ ├── merge-adjacent-empty-after.jsx
│ │ │ ├── merge-adjacent-empty-before-inline.jsx
│ │ │ ├── merge-adjacent-empty.jsx
│ │ │ ├── merge-adjacent-match-empty.jsx
│ │ │ └── merge-adjacent-match.jsx
│ │ └── void
│ │ │ ├── block-insert-text.jsx
│ │ │ └── inline-insert-text.jsx
│ ├── operations
│ │ ├── index.spec.js
│ │ ├── move_node
│ │ │ ├── path-equals-new-path.jsx
│ │ │ └── path-not-equals-new-path.jsx
│ │ ├── remove_node
│ │ │ ├── cursor-nested.jsx
│ │ │ └── cursor.jsx
│ │ ├── remove_text
│ │ │ ├── anchor-after.jsx
│ │ │ ├── anchor-before.jsx
│ │ │ ├── anchor-middle.jsx
│ │ │ ├── cursor-after.jsx
│ │ │ ├── cursor-before.jsx
│ │ │ ├── cursor-middle.jsx
│ │ │ ├── focus-after.jsx
│ │ │ ├── focus-before.jsx
│ │ │ └── focus-middle.jsx
│ │ ├── set_node
│ │ │ ├── remove-null.jsx
│ │ │ ├── remove-omit.jsx
│ │ │ └── remove-undefined.jsx
│ │ ├── set_selection
│ │ │ ├── custom-props.jsx
│ │ │ └── remove.jsx
│ │ └── split_node
│ │ │ ├── element-empty-properties.jsx
│ │ │ ├── element.jsx
│ │ │ ├── text-empty-properties.jsx
│ │ │ └── text.jsx
│ ├── test-batch-dirty
│ │ └── index.spec.js
│ ├── transforms
│ │ ├── delete
│ │ │ ├── emojis
│ │ │ │ ├── inline-end-reverse.jsx
│ │ │ │ ├── inline-middle-reverse.jsx
│ │ │ │ ├── inline-middle.jsx
│ │ │ │ ├── inline-only-reverse.jsx
│ │ │ │ ├── inline-start.jsx
│ │ │ │ ├── text-end-reverse.jsx
│ │ │ │ └── text-start.jsx
│ │ │ ├── path
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ ├── selection-inside.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── point
│ │ │ │ ├── basic-reverse.jsx
│ │ │ │ ├── basic.jsx
│ │ │ │ ├── depths-reverse.jsx
│ │ │ │ ├── inline-before-reverse.jsx
│ │ │ │ ├── inline-before.jsx
│ │ │ │ ├── inline-end.jsx
│ │ │ │ ├── inline-inside-reverse.jsx
│ │ │ │ ├── inline-void-reverse.jsx
│ │ │ │ ├── inline-void.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ ├── nested-reverse.jsx
│ │ │ │ └── nested.jsx
│ │ │ ├── selection
│ │ │ │ ├── block-across-multiple.jsx
│ │ │ │ ├── block-across-nested.jsx
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-depths-nested.jsx
│ │ │ │ ├── block-depths.jsx
│ │ │ │ ├── block-hanging-multiple.jsx
│ │ │ │ ├── block-hanging-single.jsx
│ │ │ │ ├── block-inline-across.jsx
│ │ │ │ ├── block-inline-over.jsx
│ │ │ │ ├── block-join-edges.jsx
│ │ │ │ ├── block-join-inline.jsx
│ │ │ │ ├── block-join-nested.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block-void-end-hanging.jsx
│ │ │ │ ├── block-void-end.jsx
│ │ │ │ ├── character-end.jsx
│ │ │ │ ├── character-middle.jsx
│ │ │ │ ├── character-start.jsx
│ │ │ │ ├── inline-after.jsx
│ │ │ │ ├── inline-inside.jsx
│ │ │ │ ├── inline-over.jsx
│ │ │ │ ├── inline-whole.jsx
│ │ │ │ └── word.jsx
│ │ │ ├── unit-character
│ │ │ │ ├── document-end.jsx
│ │ │ │ ├── document-start-reverse.jsx
│ │ │ │ ├── empty-reverse.jsx
│ │ │ │ ├── empty.jsx
│ │ │ │ ├── end.jsx
│ │ │ │ ├── first-reverse.jsx
│ │ │ │ ├── first.jsx
│ │ │ │ ├── inline-after-reverse.jsx
│ │ │ │ ├── inline-after.jsx
│ │ │ │ ├── inline-before-reverse.jsx
│ │ │ │ ├── inline-before.jsx
│ │ │ │ ├── inline-end-reverse.jsx
│ │ │ │ ├── inline-inside-reverse.jsx
│ │ │ │ ├── inline-inside.jsx
│ │ │ │ ├── last.jsx
│ │ │ │ ├── middle-reverse.jsx
│ │ │ │ ├── middle.jsx
│ │ │ │ ├── multiple-reverse.jsx
│ │ │ │ ├── multiple.jsx
│ │ │ │ ├── thai-multiple-reverse.jsx
│ │ │ │ └── thai-reverse.jsx
│ │ │ ├── unit-line
│ │ │ │ ├── text-end-reverse.jsx
│ │ │ │ ├── text-end.jsx
│ │ │ │ ├── text-middle-reverse.jsx
│ │ │ │ ├── text-middle.jsx
│ │ │ │ ├── text-start-reverse.jsx
│ │ │ │ └── text-start.jsx
│ │ │ ├── unit-word
│ │ │ │ ├── block-join-reverse.jsx
│ │ │ │ ├── block-join.jsx
│ │ │ │ ├── text-end-reverse.jsx
│ │ │ │ ├── text-middle-reverse.jsx
│ │ │ │ ├── text-middle.jsx
│ │ │ │ └── text-start.jsx
│ │ │ ├── voids-false
│ │ │ │ ├── block-across-backward.jsx
│ │ │ │ ├── block-after-reverse.jsx
│ │ │ │ ├── block-before.jsx
│ │ │ │ ├── block-both.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-hanging-from.jsx
│ │ │ │ ├── block-hanging-into.jsx
│ │ │ │ ├── block-only.jsx
│ │ │ │ ├── block-start-multiple.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ ├── inline-after-reverse.jsx
│ │ │ │ ├── inline-before.jsx
│ │ │ │ ├── inline-into.jsx
│ │ │ │ ├── inline-over.jsx
│ │ │ │ ├── inline-start-across.jsx
│ │ │ │ ├── inline-start.jsx
│ │ │ │ ├── read-only-inline-after-reverse.jsx
│ │ │ │ └── read-only-inline-within.jsx
│ │ │ └── voids-true
│ │ │ │ ├── across-blocks.jsx
│ │ │ │ └── path.jsx
│ │ ├── deselect
│ │ │ └── basic.jsx
│ │ ├── general
│ │ │ └── invalid-insert_node.jsx
│ │ ├── index.spec.js
│ │ ├── insertFragment
│ │ │ ├── of-blocks
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-hanging.jsx
│ │ │ │ ├── block-middle-3.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ ├── blocks-middle-1.jsx
│ │ │ │ ├── blocks-middle-2.jsx
│ │ │ │ └── with-inline.jsx
│ │ │ ├── of-inlines
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ ├── inline-empty.jsx
│ │ │ │ ├── inline-middle.jsx
│ │ │ │ ├── with-multiple.jsx
│ │ │ │ └── with-text.jsx
│ │ │ ├── of-lists
│ │ │ │ └── merge-lists.jsx
│ │ │ ├── of-mixed
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-empty2.jsx
│ │ │ │ ├── block-empty3.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-end2.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ └── block-start2.jsx
│ │ │ ├── of-tables
│ │ │ │ ├── merge-cells-with-nested-blocks.jsx
│ │ │ │ ├── merge-into-empty-cells.jsx
│ │ │ │ └── merge-into-full-cells.jsx
│ │ │ ├── of-texts
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ ├── inline-empty.jsx
│ │ │ │ ├── inline-middle.jsx
│ │ │ │ └── with-multiple.jsx
│ │ │ ├── voids-false
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ │ └── voids-true
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ ├── insertNodes
│ │ │ ├── block
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ └── inline-void.jsx
│ │ │ ├── inline
│ │ │ │ ├── block-empty.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ └── inline-middle.jsx
│ │ │ ├── path
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ ├── multiple-inline-not-end.jsx
│ │ │ │ ├── multiple-inline.jsx
│ │ │ │ ├── multiple.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── select-true
│ │ │ │ └── block.jsx
│ │ │ ├── selection
│ │ │ │ ├── none-empty.jsx
│ │ │ │ └── none-end.jsx
│ │ │ ├── void
│ │ │ │ ├── at-path.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ │ └── voids-true
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ ├── insertText
│ │ │ ├── path
│ │ │ │ ├── block.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── point
│ │ │ │ ├── selection-after.jsx
│ │ │ │ ├── selection-before.jsx
│ │ │ │ ├── selection-end.jsx
│ │ │ │ ├── selection-middle.jsx
│ │ │ │ ├── selection-start.jsx
│ │ │ │ ├── text-end.jsx
│ │ │ │ ├── text-middle.jsx
│ │ │ │ └── text-start.jsx
│ │ │ ├── selection
│ │ │ │ ├── block-across-inline-wold.jsx
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-end-words.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-hanging-across.jsx
│ │ │ │ ├── block-hanging.jsx
│ │ │ │ ├── block-middle-words.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-start-words.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ └── inline-end.jsx
│ │ │ ├── voids-false
│ │ │ │ ├── block.jsx
│ │ │ │ ├── read-only-inline.jsx
│ │ │ │ └── text.jsx
│ │ │ └── voids-true
│ │ │ │ ├── block.jsx
│ │ │ │ └── text.jsx
│ │ ├── liftNodes
│ │ │ ├── path
│ │ │ │ ├── block.jsx
│ │ │ │ ├── first-block.jsx
│ │ │ │ ├── last-block.jsx
│ │ │ │ └── middle-block.jsx
│ │ │ ├── selection
│ │ │ │ ├── block-full.jsx
│ │ │ │ └── block-nested.jsx
│ │ │ └── voids-true
│ │ │ │ └── block.jsx
│ │ ├── mergeNodes
│ │ │ ├── depth-block
│ │ │ │ ├── block-nested-multi-child.jsx
│ │ │ │ ├── block-nested-only-child.jsx
│ │ │ │ └── block.jsx
│ │ │ ├── path
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── text-across.jsx
│ │ │ │ ├── text-hanging-nested.jsx
│ │ │ │ └── text-hanging.jsx
│ │ │ └── voids-true
│ │ │ │ └── block.jsx
│ │ ├── move
│ │ │ ├── anchor
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── basic.jsx
│ │ │ │ ├── collapsed.jsx
│ │ │ │ ├── distance.jsx
│ │ │ │ ├── reverse-backward.jsx
│ │ │ │ ├── reverse-basic.jsx
│ │ │ │ └── reverse-distance.jsx
│ │ │ ├── both
│ │ │ │ ├── backward-reverse.jsx
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── basic-reverse.jsx
│ │ │ │ ├── collapsed.jsx
│ │ │ │ ├── distance-reverse.jsx
│ │ │ │ ├── distance.jsx
│ │ │ │ ├── expanded-reverse.jsx
│ │ │ │ ├── expanded.jsx
│ │ │ │ ├── unit-word-reverse.jsx
│ │ │ │ └── unit-word.jsx
│ │ │ ├── emojis
│ │ │ │ ├── keycap-reverse.jsx
│ │ │ │ ├── keycap.jsx
│ │ │ │ ├── ri-reverse.jsx
│ │ │ │ ├── ri.jsx
│ │ │ │ ├── tag-reverse.jsx
│ │ │ │ ├── tag.jsx
│ │ │ │ ├── zwj-reverse.jsx
│ │ │ │ └── zwj.jsx
│ │ │ ├── end
│ │ │ │ ├── backward-reverse.jsx
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── collapsed-reverse.jsx
│ │ │ │ ├── distance-reverse.jsx
│ │ │ │ ├── distance.jsx
│ │ │ │ ├── expanded-reverse.jsx
│ │ │ │ ├── expanded.jsx
│ │ │ │ ├── from-backward-reverse.jsx
│ │ │ │ └── to-backward-reverse.jsx
│ │ │ ├── focus
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── collapsed-reverse.jsx
│ │ │ │ ├── distance-reverse.jsx
│ │ │ │ ├── distance.jsx
│ │ │ │ ├── expanded-reverse.jsx
│ │ │ │ ├── expanded.jsx
│ │ │ │ └── to-backward-reverse.jsx
│ │ │ └── start
│ │ │ │ ├── backward-reverse.jsx
│ │ │ │ ├── backward.jsx
│ │ │ │ ├── distance-reverse.jsx
│ │ │ │ ├── distance.jsx
│ │ │ │ ├── expanded-reverse.jsx
│ │ │ │ ├── expanded.jsx
│ │ │ │ ├── from-backward.jsx
│ │ │ │ └── to-backward.jsx
│ │ ├── moveNodes
│ │ │ ├── path
│ │ │ │ ├── inside-next.jsx
│ │ │ │ ├── nested.jsx
│ │ │ │ ├── noop-equal.jsx
│ │ │ │ ├── text-nodes.jsx
│ │ │ │ ├── text.jsx
│ │ │ │ └── to-sibling.jsx
│ │ │ ├── selection
│ │ │ │ ├── block-nested-after.jsx
│ │ │ │ ├── block-nested-before.jsx
│ │ │ │ ├── block-siblings-after.jsx
│ │ │ │ ├── block-siblings-before.jsx
│ │ │ │ └── block.jsx
│ │ │ └── voids-true
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ ├── normalization
│ │ │ ├── move_node.jsx
│ │ │ ├── set_node.jsx
│ │ │ └── split_node-and-insert_node.jsx
│ │ ├── removeNodes
│ │ │ ├── path
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── select
│ │ │ │ ├── block-only-void.jsx
│ │ │ │ ├── block-void-multiple-texts.jsx
│ │ │ │ └── block-void.jsx
│ │ │ ├── selection
│ │ │ │ ├── block-across.jsx
│ │ │ │ └── block-all.jsx
│ │ │ └── voids-true
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ ├── select
│ │ │ ├── path.jsx
│ │ │ ├── point.jsx
│ │ │ └── range.jsx
│ │ ├── setNodes
│ │ │ ├── basic-structure
│ │ │ │ ├── can-be-serialized.jsx
│ │ │ │ └── invert-after-serialization.jsx
│ │ │ ├── block
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-hanging.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ └── block.jsx
│ │ │ ├── inline
│ │ │ │ ├── inline-across.jsx
│ │ │ │ ├── inline-block-hanging.jsx
│ │ │ │ ├── inline-hanging.jsx
│ │ │ │ ├── inline-nested.jsx
│ │ │ │ ├── inline-void-2.jsx
│ │ │ │ ├── inline-void.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── marks
│ │ │ │ ├── mark-across-range.jsx
│ │ │ │ ├── mark-void-collapsed.jsx
│ │ │ │ ├── mark-void-range-hanging.jsx
│ │ │ │ └── mark-void-range.jsx
│ │ │ ├── merge
│ │ │ │ └── text.jsx
│ │ │ ├── path
│ │ │ │ ├── block.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── split
│ │ │ │ ├── noop-collapsed.jsx
│ │ │ │ ├── text-remove.jsx
│ │ │ │ └── text.jsx
│ │ │ ├── text
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── merge-across.jsx
│ │ │ │ └── text.jsx
│ │ │ └── voids-true
│ │ │ │ └── block.jsx
│ │ ├── setPoint
│ │ │ └── offset.jsx
│ │ ├── splitNodes
│ │ │ ├── always
│ │ │ │ ├── after-inline-void.jsx
│ │ │ │ ├── after-inline.jsx
│ │ │ │ ├── before-inline.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ └── block-start.jsx
│ │ │ ├── match-any
│ │ │ │ └── zero.jsx
│ │ │ ├── match-block
│ │ │ │ ├── block-middle-multiple-texts.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ └── inline-middle.jsx
│ │ │ ├── match-inline
│ │ │ │ └── inline-middle.jsx
│ │ │ ├── path
│ │ │ │ ├── block-inline.jsx
│ │ │ │ ├── block-nested-void.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block-void.jsx
│ │ │ │ ├── block-with-attributes.jsx
│ │ │ │ ├── inline-void.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── point
│ │ │ │ ├── block-void.jsx
│ │ │ │ ├── inline-void.jsx
│ │ │ │ ├── inline.jsx
│ │ │ │ └── text-with-marks.jsx
│ │ │ ├── selection
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-expanded.jsx
│ │ │ │ ├── block-hanging.jsx
│ │ │ │ ├── block-nested-void.jsx
│ │ │ │ ├── block-void-end.jsx
│ │ │ │ ├── block-void-middle.jsx
│ │ │ │ ├── block-void-start.jsx
│ │ │ │ ├── inline-across.jsx
│ │ │ │ ├── inline-expanded.jsx
│ │ │ │ ├── inline-void-end.jsx
│ │ │ │ └── inline-void.jsx
│ │ │ └── voids-true
│ │ │ │ ├── block.jsx
│ │ │ │ └── inline.jsx
│ │ ├── unsetNodes
│ │ │ ├── operation-contents-check.jsx
│ │ │ └── text.jsx
│ │ ├── unwrapNodes
│ │ │ ├── match-block
│ │ │ │ ├── block-across.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-inline.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ └── block.jsx
│ │ │ ├── match-inline
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── inline-across.jsx
│ │ │ │ ├── inline-over.jsx
│ │ │ │ └── inline.jsx
│ │ │ ├── mode-all
│ │ │ │ ├── match-ancestors.jsx
│ │ │ │ ├── match-siblings-and-parent.jsx
│ │ │ │ ├── match-siblings.jsx
│ │ │ │ ├── match-some-siblings-and-parent-split.jsx
│ │ │ │ ├── match-some-siblings-and-parent.jsx
│ │ │ │ └── match-some-siblings.jsx
│ │ │ ├── path
│ │ │ │ ├── block-multiple.jsx
│ │ │ │ └── block.jsx
│ │ │ └── split-block
│ │ │ │ ├── block-all-nested.jsx
│ │ │ │ ├── block-all.jsx
│ │ │ │ ├── block-end.jsx
│ │ │ │ ├── block-middle.jsx
│ │ │ │ ├── block-nested.jsx
│ │ │ │ ├── block-start.jsx
│ │ │ │ └── block.jsx
│ │ └── wrapNodes
│ │ │ ├── block
│ │ │ ├── block-across-nested.jsx
│ │ │ ├── block-across-uneven.jsx
│ │ │ ├── block-across.jsx
│ │ │ ├── block-end.jsx
│ │ │ ├── block-nested.jsx
│ │ │ ├── block.jsx
│ │ │ ├── inline-across.jsx
│ │ │ ├── omit-all.jsx
│ │ │ └── omit-nodes.jsx
│ │ │ ├── inline
│ │ │ ├── inline-across-nested.jsx
│ │ │ ├── inline-across.jsx
│ │ │ ├── inline.jsx
│ │ │ └── text.jsx
│ │ │ ├── path
│ │ │ └── block.jsx
│ │ │ ├── selection
│ │ │ └── depth-text.jsx
│ │ │ ├── split-block
│ │ │ ├── block-across.jsx
│ │ │ ├── block-end.jsx
│ │ │ ├── block-middle.jsx
│ │ │ ├── block-nested.jsx
│ │ │ ├── block-start.jsx
│ │ │ └── block.jsx
│ │ │ ├── split-inline
│ │ │ └── inline.jsx
│ │ │ └── voids-true
│ │ │ └── block.jsx
│ └── utils
│ │ ├── deep-equal
│ │ ├── deep-equals-with-array.js
│ │ ├── deep-equals.js
│ │ ├── deep-not-equal-multiple-objects.js
│ │ ├── deep-not-equal-nested-undefined.js
│ │ ├── deep-not-equal.js
│ │ ├── deep-not-equals-with-array.js
│ │ ├── index.spec.js
│ │ ├── simple-equals.js
│ │ ├── simple-not-equal.js
│ │ ├── undefined-key-equal-backward.js
│ │ └── undefined-key-equal-forward.js
│ │ └── string
│ │ └── index.spec.js
└── utils.ts
├── tsconfig.json
└── vite.config.ts
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar"]
3 | }
4 |
--------------------------------------------------------------------------------
/docs/components/Toolbar.vue:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/pages/comps/editable.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/comps/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/docs/pages/comps/slate.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/examples/inlines/InlineChromiumBugfix.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ String.fromCodePoint(160) }}
4 |
5 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-composing.md:
--------------------------------------------------------------------------------
1 | > Get the current composing state of the editor, it deals with compositionstart, compositionupdate, compositionend events
2 |
3 | ```typescript
4 | import { useComposing } from "slate-vue3";
5 |
6 | const useComposing: () => Ref;
7 |
8 | const composing = useComposing();
9 | ```
10 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-composing.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-editor.md:
--------------------------------------------------------------------------------
1 | > Get the current editor object from the context, the returned result is a proxy object
2 |
3 | ```typescript
4 | import { useEditor } from "slate-vue3";
5 |
6 | const useEditor: () => DOMEditor;
7 |
8 | const editor = useEditor();
9 | ```
10 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-editor.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-focused.md:
--------------------------------------------------------------------------------
1 | > Get the current focused state of the editor
2 |
3 | ```typescript
4 | import { useFocused } from "slate-vue3";
5 |
6 | const useFocused: () => Ref;
7 |
8 | const focused = useFocused();
9 | ```
10 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-focused.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-inherit-ref.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-read-only.md:
--------------------------------------------------------------------------------
1 | > Get the current readOnly state of the editor
2 |
3 | ```typescript
4 | import { useReadOnly } from "slate-vue3";
5 |
6 | const useReadOnly: () => Ref;
7 |
8 | const readonly = useReadOnly();
9 | ```
10 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-read-only.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-selected.md:
--------------------------------------------------------------------------------
1 | > Get the current selected state of an element
2 |
3 | ```typescript
4 | import { useSelected } from "slate-vue3";
5 |
6 | const useSelected: () => ComputedRef;
7 |
8 | const selected = useSelected();
9 | ```
10 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-selected.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-selection.md:
--------------------------------------------------------------------------------
1 | > Get the current editor selection from the context
2 |
3 | ```typescript
4 | import { useSelection } from "slate-vue3";
5 |
6 | const useSelection: () => ComputedRef;
7 |
8 | const selection = useSelection();
9 | ```
10 |
--------------------------------------------------------------------------------
/docs/pages/hooks/use-selection.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/docs/pages/introduction/get-start.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/introduction/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/docs/pages/introduction/what-difference.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/packages/core.md:
--------------------------------------------------------------------------------
1 | Provides the same interface as the [**`slate`**](https://docs.slatejs.org/concepts) library
--------------------------------------------------------------------------------
/docs/pages/packages/core.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/packages/dom.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/packages/history.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/packages/hyperscript.md:
--------------------------------------------------------------------------------
1 | Complie `jsx` to slate descendant, work for unit test
2 |
--------------------------------------------------------------------------------
/docs/pages/packages/hyperscript.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/docs/pages/packages/yjs.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/e2e/images.test.ts:
--------------------------------------------------------------------------------
1 | import { test, expect } from '@playwright/test'
2 | import { E2E_BASE_URL } from '../test/utils'
3 |
4 | test.describe('images example', () => {
5 | test.beforeEach(async ({ page }) => {
6 | await page.goto(`${E2E_BASE_URL}images`)
7 | })
8 |
9 | test('contains image', async ({ page }) => {
10 | await expect(page.getByRole('textbox').locator('img')).toHaveCount(2)
11 | })
12 | })
13 |
--------------------------------------------------------------------------------
/e2e/tables.test.ts:
--------------------------------------------------------------------------------
1 | import { test, expect } from '@playwright/test'
2 | import { E2E_BASE_URL } from '../test/utils'
3 |
4 | test.describe('table example', () => {
5 | test.beforeEach(async ({ page }) => {
6 | await page.goto(`${E2E_BASE_URL}tables`)
7 | })
8 |
9 | test('table tag rendered', async ({ page }) => {
10 | await expect(page.getByRole('textbox').locator('table')).toHaveCount(1)
11 | })
12 | })
13 |
--------------------------------------------------------------------------------
/packages/slate-dom/utils/key.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * An auto-incrementing identifier for keys.
3 | */
4 |
5 | let n = 0
6 |
7 | /**
8 | * A class that keeps track of a key string. We use a full class here because we
9 | * want to be able to use them as keys in `WeakMap` objects.
10 | */
11 |
12 | export class Key {
13 | id: string
14 |
15 | constructor() {
16 | this.id = `${n++}`
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/slate-dom/utils/types.ts:
--------------------------------------------------------------------------------
1 | export type OmitFirstArg = F extends (x: any, ...args: infer P) => infer R
2 | ? (...args: P) => R
3 | : never
4 |
--------------------------------------------------------------------------------
/packages/slate-history/index.ts:
--------------------------------------------------------------------------------
1 | export * from './history'
2 | export * from './history-editor'
3 | export * from './with-history'
4 |
--------------------------------------------------------------------------------
/packages/slate-yjs/applyToYjs/text/index.ts:
--------------------------------------------------------------------------------
1 | import { TextOperation } from 'slate';
2 | import { OpMapper } from '../types';
3 | import { insertText } from './insertText';
4 | import { removeText } from './removeText';
5 |
6 | export const TEXT_MAPPER: OpMapper = {
7 | insert_text: insertText,
8 | remove_text: removeText,
9 | };
10 |
--------------------------------------------------------------------------------
/packages/slate-yjs/applyToYjs/types.ts:
--------------------------------------------------------------------------------
1 | import { Node, Operation } from "slate";
2 | import { XmlText } from "yjs";
3 |
4 | export type ApplyFunc = (
5 | sharedRoot: XmlText,
6 | slateRoot: Node,
7 | op: O
8 | ) => void;
9 |
10 | export type OpMapper = {
11 | [K in O["type"]]: O extends { type: K } ? ApplyFunc : never;
12 | };
13 |
--------------------------------------------------------------------------------
/packages/slate-yjs/plugins/index.ts:
--------------------------------------------------------------------------------
1 | export * from './withYjs';
2 | export * from './withYHistory';
3 | export * from './withCursors';
4 |
--------------------------------------------------------------------------------
/packages/slate-yjs/utils/slate.ts:
--------------------------------------------------------------------------------
1 | import { BaseText, Descendant, Text } from 'slate';
2 | import { omit } from './object';
3 |
4 | export function getProperties(
5 | node: TNode
6 | ): Omit {
7 | return omit(
8 | node,
9 | (Text.isText(node) ? 'text' : 'children') as keyof TNode
10 | ) as Omit;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/slate-yjs/utils/yjs.ts:
--------------------------------------------------------------------------------
1 | import { AbstractType } from "yjs";
2 |
3 | export function assertDocumentAttachment>(
4 | sharedType: T
5 | ): asserts sharedType is T & { doc: NonNullable } {
6 | if (!sharedType.doc) {
7 | throw new Error("shared type isn't attached to a document");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/slate/core/get-fragment.ts:
--------------------------------------------------------------------------------
1 | import { Editor, Node } from '../interfaces'
2 | import { WithEditorFirstArg } from '../utils'
3 |
4 | export const getFragment: WithEditorFirstArg<
5 | Editor['getFragment']
6 | > = editor => {
7 | const { selection } = editor
8 |
9 | if (selection) {
10 | return Node.fragment(editor, selection)
11 | }
12 | return []
13 | }
14 |
--------------------------------------------------------------------------------
/packages/slate/core/index.ts:
--------------------------------------------------------------------------------
1 | export * from './apply'
2 | export * from './get-dirty-paths'
3 | export * from './get-fragment'
4 | export * from './normalize-node'
5 | export * from './should-normalize'
6 |
--------------------------------------------------------------------------------
/packages/slate/editor/edges.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const edges: EditorInterface['edges'] = (editor, at) => {
4 | return [Editor.start(editor, at), Editor.end(editor, at)]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/slate/editor/element-read-only.ts:
--------------------------------------------------------------------------------
1 | import { Element } from '../interfaces/element'
2 | import { Editor, EditorInterface } from '../interfaces/editor'
3 |
4 | export const elementReadOnly: EditorInterface['elementReadOnly'] = (
5 | editor,
6 | options = {}
7 | ) => {
8 | return Editor.above(editor, {
9 | ...options,
10 | match: n => Element.isElement(n) && Editor.isElementReadOnly(editor, n),
11 | })
12 | }
13 |
--------------------------------------------------------------------------------
/packages/slate/editor/end.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const end: EditorInterface['end'] = (editor, at) => {
4 | return Editor.point(editor, at, { edge: 'end' })
5 | }
6 |
--------------------------------------------------------------------------------
/packages/slate/editor/first.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const first: EditorInterface['first'] = (editor, at) => {
4 | const path = Editor.path(editor, at, { edge: 'start' })
5 | return Editor.node(editor, path)
6 | }
7 |
--------------------------------------------------------------------------------
/packages/slate/editor/fragment.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Node } from '../interfaces/node'
3 |
4 | export const fragment: EditorInterface['fragment'] = (editor, at) => {
5 | const range = Editor.range(editor, at)
6 | return Node.fragment(editor, range)
7 | }
8 |
--------------------------------------------------------------------------------
/packages/slate/editor/get-void.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Element } from '../interfaces/element'
3 |
4 | export const getVoid: EditorInterface['void'] = (editor, options = {}) => {
5 | return Editor.above(editor, {
6 | ...options,
7 | match: n => Element.isElement(n) && Editor.isVoid(editor, n),
8 | })
9 | }
10 |
--------------------------------------------------------------------------------
/packages/slate/editor/has-blocks.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Element } from '../interfaces/element'
3 |
4 | export const hasBlocks: EditorInterface['hasBlocks'] = (editor, element) => {
5 | return element.children.some(
6 | n => Element.isElement(n) && Editor.isBlock(editor, n)
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/packages/slate/editor/has-inlines.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Text } from '../interfaces/text'
3 |
4 | export const hasInlines: EditorInterface['hasInlines'] = (editor, element) => {
5 | return element.children.some(
6 | n => Text.isText(n) || Editor.isInline(editor, n)
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/packages/slate/editor/has-path.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { Node } from '../interfaces/node'
3 |
4 | export const hasPath: EditorInterface['hasPath'] = (editor, path) => {
5 | return Node.has(editor, path)
6 | }
7 |
--------------------------------------------------------------------------------
/packages/slate/editor/has-texts.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { Text } from '../interfaces/text'
3 |
4 | export const hasTexts: EditorInterface['hasTexts'] = (editor, element) => {
5 | return element.children.every(n => Text.isText(n))
6 | }
7 |
--------------------------------------------------------------------------------
/packages/slate/editor/insert-break.ts:
--------------------------------------------------------------------------------
1 | import { Transforms } from '../interfaces/transforms'
2 | import { EditorInterface } from '../interfaces/editor'
3 |
4 | export const insertBreak: EditorInterface['insertBreak'] = editor => {
5 | Transforms.splitNodes(editor, { always: true })
6 | }
7 |
--------------------------------------------------------------------------------
/packages/slate/editor/insert-node.ts:
--------------------------------------------------------------------------------
1 | import { Transforms } from '../interfaces/transforms'
2 | import { EditorInterface } from '../interfaces/editor'
3 |
4 | export const insertNode: EditorInterface['insertNode'] = (
5 | editor,
6 | node,
7 | options
8 | ) => {
9 | Transforms.insertNodes(editor, node, options)
10 | }
11 |
--------------------------------------------------------------------------------
/packages/slate/editor/insert-soft-break.ts:
--------------------------------------------------------------------------------
1 | import { Transforms } from '../interfaces/transforms'
2 | import { EditorInterface } from '../interfaces/editor'
3 |
4 | export const insertSoftBreak: EditorInterface['insertSoftBreak'] = editor => {
5 | Transforms.splitNodes(editor, { always: true })
6 | }
7 |
--------------------------------------------------------------------------------
/packages/slate/editor/is-block.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 |
3 | export const isBlock: EditorInterface['isBlock'] = (editor, value) => {
4 | return !editor.isInline(value)
5 | }
6 |
--------------------------------------------------------------------------------
/packages/slate/editor/is-edge.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const isEdge: EditorInterface['isEdge'] = (editor, point, at) => {
4 | return Editor.isStart(editor, point, at) || Editor.isEnd(editor, point, at)
5 | }
6 |
--------------------------------------------------------------------------------
/packages/slate/editor/is-end.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Point } from '../interfaces/point'
3 |
4 | export const isEnd: EditorInterface['isEnd'] = (editor, point, at) => {
5 | const end = Editor.end(editor, at)
6 | return Point.equals(point, end)
7 | }
8 |
--------------------------------------------------------------------------------
/packages/slate/editor/is-normalizing.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { NORMALIZING } from '../utils/weak-maps'
3 |
4 | export const isNormalizing: EditorInterface['isNormalizing'] = editor => {
5 | const isNormalizing = NORMALIZING.get(editor)
6 | return isNormalizing === undefined ? true : isNormalizing
7 | }
8 |
--------------------------------------------------------------------------------
/packages/slate/editor/is-start.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Point } from '../interfaces/point'
3 |
4 | export const isStart: EditorInterface['isStart'] = (editor, point, at) => {
5 | // PERF: If the offset isn't `0` we know it's not the start.
6 | if (point.offset !== 0) {
7 | return false
8 | }
9 |
10 | const start = Editor.start(editor, at)
11 | return Point.equals(point, start)
12 | }
13 |
--------------------------------------------------------------------------------
/packages/slate/editor/last.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const last: EditorInterface['last'] = (editor, at) => {
4 | const path = Editor.path(editor, at, { edge: 'end' })
5 | return Editor.node(editor, path)
6 | }
7 |
--------------------------------------------------------------------------------
/packages/slate/editor/leaf.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Node } from '../interfaces/node'
3 |
4 | export const leaf: EditorInterface['leaf'] = (editor, at, options = {}) => {
5 | const path = Editor.path(editor, at, options)
6 | const node = Node.leaf(editor, path)
7 | return [node, path]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/slate/editor/node.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Node } from '../interfaces/node'
3 |
4 | export const node: EditorInterface['node'] = (editor, at, options = {}) => {
5 | const path = Editor.path(editor, at, options)
6 | const node = Node.get(editor, path)
7 | return [node, path]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/slate/editor/path-refs.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { PATH_REFS } from '../utils/weak-maps'
3 |
4 | export const pathRefs: EditorInterface['pathRefs'] = editor => {
5 | let refs = PATH_REFS.get(editor)
6 |
7 | if (!refs) {
8 | refs = new Set()
9 | PATH_REFS.set(editor, refs)
10 | }
11 |
12 | return refs
13 | }
14 |
--------------------------------------------------------------------------------
/packages/slate/editor/point-refs.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { POINT_REFS } from '../utils/weak-maps'
3 |
4 | export const pointRefs: EditorInterface['pointRefs'] = editor => {
5 | let refs = POINT_REFS.get(editor)
6 |
7 | if (!refs) {
8 | refs = new Set()
9 | POINT_REFS.set(editor, refs)
10 | }
11 |
12 | return refs
13 | }
14 |
--------------------------------------------------------------------------------
/packages/slate/editor/range-refs.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { RANGE_REFS } from '../utils/weak-maps'
3 |
4 | export const rangeRefs: EditorInterface['rangeRefs'] = editor => {
5 | let refs = RANGE_REFS.get(editor)
6 |
7 | if (!refs) {
8 | refs = new Set()
9 | RANGE_REFS.set(editor, refs)
10 | }
11 |
12 | return refs
13 | }
14 |
--------------------------------------------------------------------------------
/packages/slate/editor/range.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 | import { Range } from '../interfaces/range'
3 |
4 | export const range: EditorInterface['range'] = (editor, at, to) => {
5 | if (Range.isRange(at) && !to) {
6 | return at
7 | }
8 |
9 | const start = Editor.start(editor, at)
10 | const end = Editor.end(editor, to || at)
11 | return { anchor: start, focus: end }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/slate/editor/set-normalizing.ts:
--------------------------------------------------------------------------------
1 | import { EditorInterface } from '../interfaces/editor'
2 | import { NORMALIZING } from '../utils/weak-maps'
3 |
4 | export const setNormalizing: EditorInterface['setNormalizing'] = (
5 | editor,
6 | isNormalizing
7 | ) => {
8 | NORMALIZING.set(editor, isNormalizing)
9 | }
10 |
--------------------------------------------------------------------------------
/packages/slate/editor/start.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const start: EditorInterface['start'] = (editor, at) => {
4 | return Editor.point(editor, at, { edge: 'start' })
5 | }
6 |
--------------------------------------------------------------------------------
/packages/slate/editor/without-normalizing.ts:
--------------------------------------------------------------------------------
1 | import { Editor, EditorInterface } from '../interfaces/editor'
2 |
3 | export const withoutNormalizing: EditorInterface['withoutNormalizing'] = (
4 | editor,
5 | fn
6 | ) => {
7 | const value = Editor.isNormalizing(editor)
8 | Editor.setNormalizing(editor, false)
9 | try {
10 | fn()
11 | } finally {
12 | Editor.setNormalizing(editor, value)
13 | }
14 | Editor.normalize(editor)
15 | }
16 |
--------------------------------------------------------------------------------
/packages/slate/interfaces/index.ts:
--------------------------------------------------------------------------------
1 | export * from './editor'
2 | export * from './element'
3 | export * from './location'
4 | export * from './node'
5 | export * from './operation'
6 | export * from './path-ref'
7 | export * from './path'
8 | export * from './point-ref'
9 | export * from './point'
10 | export * from './range-ref'
11 | export * from './range'
12 | export * from './scrubber'
13 | export * from './text'
14 | export * from './transforms/index'
15 |
--------------------------------------------------------------------------------
/packages/slate/transforms-node/index.ts:
--------------------------------------------------------------------------------
1 | export * from './insert-nodes'
2 | export * from './lift-nodes'
3 | export * from './merge-nodes'
4 | export * from './move-nodes'
5 | export * from './remove-nodes'
6 | export * from './set-nodes'
7 | export * from './split-nodes'
8 | export * from './unset-nodes'
9 | export * from './unwrap-nodes'
10 | export * from './wrap-nodes'
11 |
--------------------------------------------------------------------------------
/packages/slate/transforms-selection/deselect.ts:
--------------------------------------------------------------------------------
1 | import { SelectionTransforms } from '../interfaces/transforms/selection'
2 |
3 | export const deselect: SelectionTransforms['deselect'] = editor => {
4 | const { selection } = editor
5 |
6 | if (selection) {
7 | editor.apply({
8 | type: 'set_selection',
9 | properties: selection,
10 | newProperties: null,
11 | })
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/slate/transforms-selection/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collapse'
2 | export * from './deselect'
3 | export * from './move'
4 | export * from './select'
5 | export * from './set-point'
6 | export * from './set-selection'
7 |
--------------------------------------------------------------------------------
/packages/slate/transforms-text/index.ts:
--------------------------------------------------------------------------------
1 | export * from './delete-text'
2 | export * from './insert-fragment'
3 |
--------------------------------------------------------------------------------
/packages/slate/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './custom-types'
2 | export * from './types'
3 |
--------------------------------------------------------------------------------
/packages/slate/utils/index.ts:
--------------------------------------------------------------------------------
1 | export * from './deep-equal'
2 | export * from './get-default-insert-location'
3 | export * from './is-object'
4 | export * from './match-path'
5 | export * from './string'
6 | export * from './types'
7 | export * from './weak-maps'
8 |
--------------------------------------------------------------------------------
/packages/slate/utils/is-object.ts:
--------------------------------------------------------------------------------
1 | export const isObject = (value: any) =>
2 | typeof value === 'object' && value !== null
3 |
--------------------------------------------------------------------------------
/packages/slate/utils/match-path.ts:
--------------------------------------------------------------------------------
1 | import { Editor } from '../interfaces/editor'
2 | import { Path } from '../interfaces/path'
3 | import { Node } from '../interfaces/node'
4 |
5 | export const matchPath = (
6 | editor: Editor,
7 | path: Path
8 | ): ((node: Node) => boolean) => {
9 | const [node] = Editor.node(editor, path)
10 | return n => n === node
11 | }
12 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 | 404
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/public/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guan-Erjia/slate-vue3/471e2db96318ea811274bfefc8f7e35684aee938/public/banner.png
--------------------------------------------------------------------------------
/public/consolas.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guan-Erjia/slate-vue3/471e2db96318ea811274bfefc8f7e35684aee938/public/consolas.ttf
--------------------------------------------------------------------------------
/public/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guan-Erjia/slate-vue3/471e2db96318ea811274bfefc8f7e35684aee938/public/example.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guan-Erjia/slate-vue3/471e2db96318ea811274bfefc8f7e35684aee938/public/favicon.ico
--------------------------------------------------------------------------------
/public/material.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Guan-Erjia/slate-vue3/471e2db96318ea811274bfefc8f7e35684aee938/public/material.woff2
--------------------------------------------------------------------------------
/test/slate-history/isHistory/after-edit.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from "@test-utils";
3 | import { Transforms } from "slate-vue3/core";
4 |
5 | export const input = (
6 |
7 |
8 | Initial text
9 |
10 |
11 | );
12 | export const run = (editor) => {
13 | Transforms.insertText(editor, "additional text");
14 | };
15 |
--------------------------------------------------------------------------------
/test/slate-history/isHistory/after-redo.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from "@test-utils";
3 | import { Transforms } from "slate-vue3/core";
4 | export const input = (
5 |
6 |
7 | Initial text
8 |
9 |
10 | );
11 | export const run = (editor) => {
12 | Transforms.insertText(editor, "additional text");
13 | editor.undo();
14 | editor.redo();
15 | };
16 |
--------------------------------------------------------------------------------
/test/slate-history/isHistory/after-undo.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from "@test-utils";
3 | import { Transforms } from "slate-vue3/core";
4 | export const input = (
5 |
6 |
7 | Initial text
8 |
9 |
10 | );
11 | export const run = (editor) => {
12 | Transforms.insertText(editor, "additional text");
13 | editor.undo();
14 | };
15 |
--------------------------------------------------------------------------------
/test/slate-history/isHistory/before-edit.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from "@test-utils";
3 | export const input = (
4 |
5 |
6 | Initial text
7 |
8 |
9 | );
10 | export const run = () => {};
11 |
--------------------------------------------------------------------------------
/test/slate-history/undo/insert-text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from "@test-utils";
3 | import { cloneDeep } from "lodash-es";
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 |
12 | );
13 |
14 | export const output = cloneDeep(input);
15 |
16 | export const run = (editor) => {
17 | editor.insertText("text");
18 | };
19 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-custom.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { createHyperscript } from 'slate-hyperscript'
3 |
4 | const jsx = createHyperscript({
5 | elements: {
6 | paragraph: { type: 'paragraph' },
7 | },
8 | })
9 | export const input = word
10 | export const output = {
11 | type: 'paragraph',
12 | children: [
13 | {
14 | text: 'word',
15 | },
16 | ],
17 | }
18 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input =
5 | export const output = {
6 | children: [],
7 | }
8 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-nested-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 |
8 | )
9 | export const output = {
10 | children: [
11 | {
12 | children: [],
13 | },
14 | ],
15 | }
16 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-nested-string.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 | word
7 |
8 | )
9 | export const output = {
10 | children: [
11 | {
12 | children: [
13 | {
14 | text: 'word',
15 | },
16 | ],
17 | },
18 | ],
19 | }
20 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-string.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = word
5 | export const output = {
6 | children: [
7 | {
8 | text: 'word',
9 | },
10 | ],
11 | }
12 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-text-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 |
8 | )
9 | export const output = {
10 | children: [
11 | {
12 | text: '',
13 | },
14 | ],
15 | }
16 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/element-text-string.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 | word
7 |
8 | )
9 | export const output = {
10 | children: [
11 | {
12 | text: 'word',
13 | },
14 | ],
15 | }
16 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/fragment-element.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 | word
7 |
8 | )
9 | export const output = [
10 | {
11 | children: [
12 | {
13 | text: 'word',
14 | },
15 | ],
16 | },
17 | ]
18 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/fragment-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input =
5 | export const output = []
6 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/fragment-string.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = word
5 | export const output = [
6 | {
7 | text: 'word',
8 | },
9 | ]
10 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/text-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input =
5 | export const output = {
6 | text: '',
7 | a: true,
8 | }
9 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/text-full.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = word
5 | export const output = {
6 | text: 'word',
7 | a: true,
8 | }
9 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/text-nested.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 | word
7 |
8 | )
9 | export const output = {
10 | text: 'word',
11 | a: true,
12 | b: true,
13 | }
14 |
--------------------------------------------------------------------------------
/test/slate-hyperscript/fixtures/value-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input =
5 | export const output = {
6 | children: [],
7 | selection: null,
8 | }
9 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/boldText-false.jsx:
--------------------------------------------------------------------------------
1 | import { isBoldText } from './type-guards'
2 |
3 | export const input = {
4 | placeholder: 'heading',
5 | bold: false,
6 | italic: false,
7 | text: 'mytext',
8 | }
9 |
10 | export const test = isBoldText
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/boldText-true.jsx:
--------------------------------------------------------------------------------
1 | // show that regular methods that are imported work as expected
2 | import { isBoldText } from './type-guards'
3 |
4 | export const input = {
5 | bold: true,
6 | text: 'mytext',
7 | }
8 |
9 | export const test = isBoldText
10 |
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/customOperation-false.jsx:
--------------------------------------------------------------------------------
1 | import { isCustomOperation } from './type-guards'
2 |
3 | export const input = {
4 | type: 'insert_text',
5 | path: [0, 0],
6 | offset: 0,
7 | text: 'text',
8 | }
9 |
10 | export const test = isCustomOperation
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/customOperation-true.jsx:
--------------------------------------------------------------------------------
1 | import { isCustomOperation } from './type-guards'
2 |
3 | export const input = {
4 | type: 'custom_op',
5 | value: 'some value',
6 | }
7 |
8 | export const test = isCustomOperation
9 |
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/customText-false.jsx:
--------------------------------------------------------------------------------
1 | import { isCustomText } from './type-guards'
2 |
3 | export const input = {
4 | bold: true,
5 | text: 'mytext',
6 | }
7 |
8 | export const test = isCustomText
9 |
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/customText-true.jsx:
--------------------------------------------------------------------------------
1 | import { isCustomText } from './type-guards'
2 |
3 | export const input = {
4 | placeholder: 'mystring',
5 | text: 'mytext',
6 | }
7 |
8 | export const test = isCustomText
9 |
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/headingElement-false.jsx:
--------------------------------------------------------------------------------
1 | import { isHeadingElement } from './type-guards'
2 |
3 | export const input = {
4 | type: 'list-item',
5 | depth: 5,
6 | children: [],
7 | }
8 |
9 | export const test = isHeadingElement
10 |
11 | export const output = false
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/CustomTypes/headingElement-true.jsx:
--------------------------------------------------------------------------------
1 | import { isHeadingElement } from './type-guards'
2 |
3 | export const input = {
4 | type: 'heading',
5 | level: 5,
6 | children: [],
7 | }
8 |
9 | export const test = isHeadingElement
10 |
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/above/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 |
9 | one
10 |
11 |
12 | )
13 |
14 | export const test = editor => {
15 | return Editor.above(editor, { at: { path: [0, 0, 0], offset: 1 } })
16 | }
17 |
18 | export const output = [one, [0, 0]]
19 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/after/end.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 | two
10 |
11 | )
12 |
13 | export const test = editor => {
14 | return Editor.after(editor, [1, 0])
15 | }
16 |
17 | export const output = undefined
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/after/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 | two
10 |
11 | )
12 |
13 | export const test = editor => {
14 | return Editor.after(editor, [0, 0])
15 | }
16 |
17 | export const output = { path: [1, 0], offset: 0 }
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/after/point-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 |
10 | )
11 |
12 | export const test = editor => {
13 | return Editor.after(editor, { path: [0, 0], offset: 1 }, { voids: true })
14 | }
15 |
16 | export const output = { path: [0, 0], offset: 2 }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/after/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 |
10 | )
11 |
12 | export const test = editor => {
13 | return Editor.after(editor, { path: [0, 0], offset: 1 })
14 | }
15 |
16 | export const output = { path: [0, 0], offset: 2 }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/before/path-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 | two
10 |
11 | )
12 |
13 | export const test = editor => {
14 | return Editor.before(editor, [1, 0], { voids: true })
15 | }
16 |
17 | export const output = { path: [0, 0], offset: 3 }
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/before/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 | two
10 |
11 | )
12 |
13 | export const test = editor => {
14 | return Editor.before(editor, [1, 0])
15 | }
16 |
17 | export const output = { path: [0, 0], offset: 3 }
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/before/point-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 |
10 | )
11 |
12 | export const test = editor => {
13 | return Editor.before(editor, { path: [0, 0], offset: 1 }, { voids: true })
14 | }
15 |
16 | export const output = { path: [0, 0], offset: 0 }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/before/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 |
10 | )
11 |
12 | export const test = editor => {
13 | return Editor.before(editor, { path: [0, 0], offset: 1 })
14 | }
15 |
16 | export const output = { path: [0, 0], offset: 0 }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/before/start.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 | two
10 |
11 | )
12 |
13 | export const test = editor => {
14 | return Editor.before(editor, [0, 0])
15 | }
16 |
17 | export const output = undefined
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/edges/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 |
10 | )
11 |
12 | export const test = editor => {
13 | return Editor.edges(editor, [0])
14 | }
15 |
16 | export const output = [
17 | { path: [0, 0], offset: 0 },
18 | { path: [0, 0], offset: 3 },
19 | ]
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/edges/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 |
3 | import { Editor } from 'slate'
4 | import { jsx } from '@test-utils'
5 |
6 | export const input = (
7 |
8 | one
9 |
10 | )
11 |
12 | export const test = editor => {
13 | return Editor.edges(editor, { path: [0, 0], offset: 1 })
14 | }
15 |
16 | export const output = [
17 | { path: [0, 0], offset: 1 },
18 | { path: [0, 0], offset: 1 },
19 | ]
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/end/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.end(editor, [0])
12 | }
13 | export const output = { path: [0, 0], offset: 3 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/end/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.end(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = { path: [0, 0], offset: 1 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/end/range.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.end(editor, {
12 | anchor: { path: [0, 0], offset: 1 },
13 | focus: { path: [0, 0], offset: 2 },
14 | })
15 | }
16 | export const output = { path: [0, 0], offset: 2 }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasBlocks/block-nested.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.hasBlocks(editor, block)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasBlocks/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.hasBlocks(editor, block)
13 | }
14 | export const output = false
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasBlocks/inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.hasBlocks(editor, block)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasInlines/block-nested.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.hasInlines(editor, block)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasInlines/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.hasInlines(editor, block)
13 | }
14 | export const output = true
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasInlines/inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.hasInlines(editor, block)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasTexts/block-nested.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.hasTexts(editor, block)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasTexts/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.hasTexts(editor, block)
13 | }
14 | export const output = true
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/hasTexts/inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const inline = editor.children[0].children[1]
14 | return Editor.hasTexts(editor, inline)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isBlock/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor, Element } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Element.isElement(block) && Editor.isBlock(editor, block)
13 | }
14 | export const output = true
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEdge/path-end.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isEdge(editor, anchor, [0])
16 | }
17 | export const output = true
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEdge/path-middle.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | on
9 | e
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isEdge(editor, anchor, [0])
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEdge/path-start.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 | one
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isEdge(editor, anchor, [0])
16 | }
17 | export const output = true
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEmpty/block-blank.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.isEmpty(editor, block)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEmpty/block-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.isEmpty(editor, block)
13 | }
14 | export const output = true
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEmpty/block-full.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.isEmpty(editor, block)
13 | }
14 | export const output = false
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEmpty/block-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const block = editor.children[0]
14 | return Editor.isEmpty(editor, block)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEmpty/inline-full.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const inline = editor.children[0].children[1]
14 | return Editor.isEmpty(editor, inline)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEnd/path-end.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isEnd(editor, anchor, [0])
16 | }
17 | export const output = true
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEnd/path-middle.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | on
9 | e
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isEnd(editor, anchor, [0])
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isEnd/path-start.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 | one
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isEnd(editor, anchor, [0])
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isInline/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.isInline(editor, block)
13 | }
14 | export const output = false
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isInline/inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const inline = editor.children[0].children[1]
14 | return Editor.isInline(editor, inline)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isStart/path-end.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 |
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isStart(editor, anchor, [0])
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isStart/path-middle.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | on
9 | e
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isStart(editor, anchor, [0])
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isStart/path-start.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 | one
10 |
11 |
12 | )
13 | export const test = editor => {
14 | const { anchor } = editor.selection
15 | return Editor.isStart(editor, anchor, [0])
16 | }
17 | export const output = true
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isVoid/block-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.isVoid(editor, block)
13 | }
14 | export const output = true
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isVoid/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | const block = editor.children[0]
12 | return Editor.isVoid(editor, block)
13 | }
14 | export const output = false
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isVoid/inline-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const inline = editor.children[0].children[1]
14 | return Editor.isVoid(editor, inline)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/isVoid/inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | const inline = editor.children[0].children[1]
14 | return Editor.isVoid(editor, inline)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/next/default.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const test = editor => {
12 | return Editor.next(editor, { at: [0] })
13 | }
14 | export const output = [two, [1]]
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/next/text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor, Text } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const test = editor => {
12 | return Editor.next(editor, { at: [0], match: Text.isText })
13 | }
14 | export const output = [two, [1, 0]]
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/node/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.node(editor, [0])
12 | }
13 | export const output = [one, [0]]
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/node/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.node(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = [one, [0, 0]]
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/nodes/no-match/block-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Array.from(Editor.nodes(editor, { at: [] }))
12 | }
13 | export const output = [
14 | [input, []],
15 | [one, [0]],
16 | ]
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/nodes/voids-true/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor, Text } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Array.from(
12 | Editor.nodes(editor, { at: [], match: Text.isText, voids: true })
13 | )
14 | }
15 | export const output = [[one, [0, 0]]]
16 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/parent/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.parent(editor, [0, 0])
12 | }
13 | export const output = [one, [0]]
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/parent/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.parent(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = [one, [0]]
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/path/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.path(editor, [0])
12 | }
13 | export const output = [0]
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/path/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.path(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = [0, 0]
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/point/path-end.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.point(editor, [0], { edge: 'end' })
12 | }
13 | export const output = { path: [0, 0], offset: 3 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/point/path-start.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.point(editor, [0], { edge: 'start' })
12 | }
13 | export const output = { path: [0, 0], offset: 0 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/point/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.point(editor, [0])
12 | }
13 | export const output = { path: [0, 0], offset: 0 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/point/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.point(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = { path: [0, 0], offset: 1 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/positions/ignore-non-selectable/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Array.from(
12 | Editor.positions(editor, { at: [], ignoreNonSelectable: true })
13 | )
14 | }
15 | export const output = []
16 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/previous/default.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const test = editor => {
12 | return Editor.previous(editor, { at: [1] })
13 | }
14 | export const output = [one, [0]]
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/previous/text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor, Text } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const test = editor => {
12 | return Editor.previous(editor, { at: [1], match: Text.isText })
13 | }
14 | export const output = [one, [0, 0]]
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/range/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.range(editor, [0])
12 | }
13 | export const output = {
14 | anchor: { path: [0, 0], offset: 0 },
15 | focus: { path: [0, 0], offset: 3 },
16 | }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/range/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.range(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = {
14 | anchor: { path: [0, 0], offset: 1 },
15 | focus: { path: [0, 0], offset: 1 },
16 | }
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/start/path.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.start(editor, [0])
12 | }
13 | export const output = { path: [0, 0], offset: 0 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/start/point.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 |
9 | )
10 | export const test = editor => {
11 | return Editor.start(editor, { path: [0, 0], offset: 1 })
12 | }
13 | export const output = { path: [0, 0], offset: 1 }
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/string/block-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 | two
10 |
11 |
12 | )
13 | export const test = editor => {
14 | return Editor.string(editor, [0])
15 | }
16 | export const output = ``
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/string/block-voids-true.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 | two
10 |
11 |
12 | )
13 | export const test = editor => {
14 | return Editor.string(editor, [0], { voids: true })
15 | }
16 | export const output = `onetwo`
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/string/inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | onetwothree
9 |
10 |
11 | )
12 | export const test = editor => {
13 | return Editor.string(editor, [0, 1])
14 | }
15 | export const output = `two`
16 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Editor/string/text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Editor } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 | one
9 | two
10 |
11 |
12 | )
13 | export const test = editor => {
14 | return Editor.string(editor, [0, 0])
15 | }
16 | export const output = `one`
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Element.isElement(value)
6 | }
7 |
8 | export const output = false
9 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/custom-property.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | custom: 'value',
6 | }
7 | export const test = value => {
8 | return Element.isElement(value)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/element.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | }
6 | export const test = value => {
7 | return Element.isElement(value)
8 | }
9 | export const output = true
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/isElementDiscriminant.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | source: 'heading-large',
5 | children: [{ text: '' }],
6 | }
7 | export const test = value =>
8 | Element.isElementType(value, 'heading-large', 'source')
9 |
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/isElementDiscriminantFalse.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | type: 'heading-large',
5 | children: [{ text: '' }],
6 | }
7 | export const test = value => Element.isElementType(value, 'paragraph', 'source')
8 |
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/isElementType.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | type: 'paragraph',
5 | children: [{ text: '' }],
6 | }
7 | export const test = value => Element.isElementType(value, 'paragraph')
8 |
9 | export const output = true
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/isElementTypeFalse.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | type: 'heading-large',
5 | children: [{ text: '' }],
6 | }
7 | export const test = value => Element.isElementType(value, 'paragraph')
8 |
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/nodes-full.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | children: [
5 | {
6 | children: [],
7 | },
8 | ],
9 | }
10 | export const test = value => {
11 | return Element.isElement(value)
12 | }
13 | export const output = true
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/object.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Element.isElement(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElement/text.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | text: '',
5 | }
6 | export const test = value => {
7 | return Element.isElement(value)
8 | }
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElementList/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Element.isElementList(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElementList/element.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | }
6 | export const test = value => {
7 | return Element.isElementList(value)
8 | }
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElementList/empty.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = []
4 | export const test = value => {
5 | return Element.isElementList(value)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElementList/full-element.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | },
7 | ]
8 | export const test = value => {
9 | return Element.isElementList(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElementList/full-text.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = [
4 | {
5 | text: '',
6 | },
7 | ]
8 | export const test = value => {
9 | return Element.isElementList(value)
10 | }
11 | export const output = false
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/isElementList/not-full-element.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | },
7 | {
8 | type: 'set_node',
9 | path: [0],
10 | properties: {},
11 | newProperties: {},
12 | },
13 | ]
14 | export const test = value => {
15 | return Element.isElementList(value)
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/matches/custom-prop-match.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | element: { children: [], type: 'bold' },
5 | props: { type: 'bold' },
6 | }
7 | export const test = ({ element, props }) => {
8 | return Element.matches(element, props)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/matches/custom-prop-not-match.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | element: { children: [], type: 'bold' },
5 | props: { type: 'italic' },
6 | }
7 | export const test = ({ element, props }) => {
8 | return Element.matches(element, props)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Element/matches/empty-match.jsx:
--------------------------------------------------------------------------------
1 | import { Element } from 'slate'
2 |
3 | export const input = {
4 | element: { children: [] },
5 | props: {},
6 | }
7 | export const test = ({ element, props }) => {
8 | return Element.matches(element, props)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/ancestor/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 | import { cloneDeep } from 'lodash-es'
5 |
6 | export const input = (
7 |
8 |
9 |
10 |
11 |
12 | )
13 | export const test = value => {
14 | return Node.ancestor(value, [0])
15 | }
16 | export const output = cloneDeep(input.children[0])
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/ancestors/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = value => {
13 | return Array.from(Node.ancestors(value, [0, 0]))
14 | }
15 | export const output = [
16 | [input, []],
17 | [input.children[0], [0]],
18 | ]
19 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/child/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 | import { cloneDeep } from 'lodash-es'
5 |
6 | export const input = (
7 |
8 |
9 |
10 |
11 |
12 | )
13 | export const test = value => {
14 | return Node.child(value, 0)
15 | }
16 | export const output = cloneDeep(input.children[0])
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/descendant/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 | import { cloneDeep } from 'lodash-es'
5 |
6 | export const input = (
7 |
8 |
9 |
10 |
11 |
12 | )
13 | export const test = value => {
14 | return Node.descendant(value, [0])
15 | }
16 | export const output = cloneDeep(input.children[0])
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/first/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | export const test = value => {
14 | return Node.first(value, [0])
15 | }
16 | export const output = [, [0, 0]]
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/get/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = value => {
13 | return Node.get(value, [0])
14 | }
15 | export const output = (
16 |
17 |
18 |
19 | )
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/getIf/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = value => {
13 | return Node.getIf(value, [0])
14 | }
15 | export const output = (
16 |
17 |
18 |
19 | )
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/getIf/undefined.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = value => {
13 | return Node.getIf(value, [0, 0, 0])
14 | }
15 | export const output = undefined
16 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNode/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Node.isNode(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNode/custom-property.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | custom: true,
6 | }
7 | export const test = value => {
8 | return Node.isNode(value)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNode/element.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | }
6 | export const test = value => {
7 | return Node.isNode(value)
8 | }
9 | export const output = true
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNode/object.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Node.isNode(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNode/text.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = {
4 | text: '',
5 | }
6 | export const test = value => {
7 | return Node.isNode(value)
8 | }
9 | export const output = true
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNode/value.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | selection: null,
6 | }
7 | export const test = value => {
8 | return Node.isNode(value)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Node.isNodeList(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/element.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = {
4 | children: [],
5 | }
6 | export const test = value => {
7 | return Node.isNodeList(value)
8 | }
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/empty.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = []
4 | export const test = value => {
5 | return Node.isNodeList(value)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/full-element.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | },
7 | ]
8 | export const test = value => {
9 | return Node.isNodeList(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/full-text.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = [
4 | {
5 | text: '',
6 | },
7 | ]
8 | export const test = value => {
9 | return Node.isNodeList(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/full-value.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | selection: null,
7 | },
8 | ]
9 | export const test = value => {
10 | return Node.isNodeList(value)
11 | }
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/isNodeList/not-full-node.jsx:
--------------------------------------------------------------------------------
1 | import { Node } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | selection: null,
7 | },
8 | 'a string',
9 | ]
10 | export const test = value => {
11 | return Node.isNodeList(value)
12 | }
13 | export const output = false
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/leaf/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = value => {
13 | return Node.leaf(value, [0, 0])
14 | }
15 | export const output =
16 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/parent/success.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const test = value => {
13 | return Node.parent(value, [0, 0])
14 | }
15 | export const output = (
16 |
17 |
18 |
19 | )
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/string/element.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const test = value => {
12 | return Node.string(value, [1])
13 | }
14 | export const output = `onetwo`
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/string/text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = one
6 | export const test = value => {
7 | return Node.string(value)
8 | }
9 | export const output = `one`
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Node/texts/from.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Node } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | export const test = value => {
14 | return Array.from(Node.texts(value, { from: [0, 1] }))
15 | }
16 | export const output = [[, [0, 1]]]
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/backward-in-parent.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 2], newPath: [0, 1] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | export const output = { type: 'move_node', path: [0, 1], newPath: [0, 2] }
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/child-to-ends-after-parent.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 2, 1], newPath: [0, 3] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | export const output = { type: 'move_node', path: [0, 3], newPath: [0, 2, 1] }
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/child-to-ends-before-parent.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 2, 1], newPath: [0, 1] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | export const output = { type: 'move_node', path: [0, 1], newPath: [0, 3, 1] }
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/ends-after-parent-to-child.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 3], newPath: [0, 2, 1] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | export const output = { type: 'move_node', path: [0, 2, 1], newPath: [0, 3] }
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/ends-before-parent-to-child.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 1], newPath: [0, 2, 1] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | // The path has changed here because the removal of [0, 1] caused [0, 2] to shift forward into its location.
8 | export const output = { type: 'move_node', path: [0, 1, 1], newPath: [0, 1] }
9 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/forward-in-parent.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 1], newPath: [0, 2] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | export const output = { type: 'move_node', path: [0, 2], newPath: [0, 1] }
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/inverse/moveNode/non-sibling.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = { type: 'move_node', path: [0, 2], newPath: [1, 0, 0] }
4 | export const test = value => {
5 | return Operation.inverse(value)
6 | }
7 | export const output = { type: 'move_node', path: [1, 0, 0], newPath: [0, 2] }
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Operation.isOperation(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/custom-property.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'set_node',
5 | path: [0],
6 | properties: {},
7 | newProperties: {},
8 | custom: true,
9 | }
10 | export const test = value => {
11 | return Operation.isOperation(value)
12 | }
13 | export const output = true
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/insert_node.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'insert_node',
5 | path: [0],
6 | node: {
7 | children: [],
8 | },
9 | }
10 | export const test = value => {
11 | return Operation.isOperation(value)
12 | }
13 | export const output = true
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/insert_text.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'insert_text',
5 | path: [0],
6 | offset: 0,
7 | text: 'string',
8 | }
9 | export const test = value => {
10 | return Operation.isOperation(value)
11 | }
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/merge_node.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'merge_node',
5 | path: [0],
6 | position: 0,
7 | properties: {},
8 | }
9 | export const test = value => {
10 | return Operation.isOperation(value)
11 | }
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/move_node.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'move_node',
5 | path: [0],
6 | newPath: [1],
7 | }
8 | export const test = value => {
9 | return Operation.isOperation(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/object.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Operation.isOperation(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/remove_node.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'remove_node',
5 | path: [0],
6 | node: {
7 | children: [],
8 | },
9 | }
10 | export const test = value => {
11 | return Operation.isOperation(value)
12 | }
13 | export const output = true
14 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/remove_text.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'remove_text',
5 | path: [0],
6 | offset: 0,
7 | text: 'string',
8 | }
9 | export const test = value => {
10 | return Operation.isOperation(value)
11 | }
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/set_node.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'set_node',
5 | path: [0],
6 | properties: {},
7 | newProperties: {},
8 | }
9 | export const test = value => {
10 | return Operation.isOperation(value)
11 | }
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/set_selection.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'set_selection',
5 | properties: {},
6 | newProperties: {},
7 | }
8 | export const test = value => {
9 | return Operation.isOperation(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/split_node.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'split_node',
5 | path: [0],
6 | position: 0,
7 | properties: {},
8 | }
9 | export const test = value => {
10 | return Operation.isOperation(value)
11 | }
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperation/without-type.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | properties: {},
6 | newProperties: {},
7 | }
8 | export const test = value => {
9 | return Operation.isOperation(value)
10 | }
11 | export const output = false
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperationList/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Operation.isOperationList(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperationList/empty.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = []
4 | export const test = value => {
5 | return Operation.isOperationList(value)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperationList/full.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = [
4 | {
5 | type: 'set_node',
6 | path: [0],
7 | properties: {},
8 | newProperties: {},
9 | },
10 | ]
11 | export const test = value => {
12 | return Operation.isOperationList(value)
13 | }
14 | export const output = true
15 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperationList/not-full-operaion.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = [
4 | {
5 | type: 'set_node',
6 | path: [0],
7 | properties: {},
8 | newProperties: {},
9 | },
10 | {
11 | text: '',
12 | },
13 | ]
14 | export const test = value => {
15 | return Operation.isOperationList(value)
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Operation/isOperationList/operation.jsx:
--------------------------------------------------------------------------------
1 | import { Operation } from 'slate'
2 |
3 | export const input = {
4 | type: 'set_node',
5 | path: [0],
6 | properties: {},
7 | newProperties: {},
8 | }
9 | export const test = value => {
10 | return Operation.isOperationList(value)
11 | }
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/ancestors/reverse.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1, 2]
4 | export const test = path => {
5 | return Path.ancestors(path, { reverse: true })
6 | }
7 | export const output = [[0, 1], [0], []]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/ancestors/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1, 2]
4 | export const test = path => {
5 | return Path.ancestors(path)
6 | }
7 | export const output = [[], [0], [0, 1]]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/common/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.common(path, another)
9 | }
10 | export const output = [0, 1, 2]
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/common/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [3, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.common(path, another)
9 | }
10 | export const output = []
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/common/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.common(path, another)
9 | }
10 | export const output = [0]
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/compare/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.compare(path, another)
9 | }
10 | export const output = 0
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/compare/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.compare(path, another)
9 | }
10 | export const output = 1
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/compare/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.compare(path, another)
9 | }
10 | export const output = -1
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/compare/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.compare(path, another)
9 | }
10 | export const output = 0
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/compare/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.compare(path, another)
9 | }
10 | export const output = 0
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/compare/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.compare(path, another)
9 | }
10 | export const output = 0
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/ends-at.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAfter/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/ends-at.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsAt/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsAt(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/ends-at.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/endsBefore/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.endsBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/equals/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.equals(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/equals/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.equals(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/equals/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.equals(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/equals/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.equals(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/equals/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.equals(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/equals/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.equals(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/hasPrevious/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 0]
4 | export const test = path => {
5 | return Path.hasPrevious(path)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/hasPrevious/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1]
4 | export const test = path => {
5 | return Path.hasPrevious(path)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAfter/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAfter/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAfter(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAfter/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAfter/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAfter/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAfter(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/above-grandparent.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAncestor(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/above-parent.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAncestor(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAncestor(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/before.js:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 |
8 | export const test = ({ path, another }) => {
9 | return Path.isAncestor(path, another)
10 | }
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAncestor(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAncestor(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isAncestor/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isAncestor(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isBefore/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isBefore/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isBefore/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isBefore(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isBefore/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isBefore/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isBefore(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isChild(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isChild(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/before.js:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 |
8 | export const test = ({ path, another }) => {
9 | return Path.isChild(path, another)
10 | }
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isChild(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/below-child.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isChild(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/below-grandchild.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isChild(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isChild/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isChild(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isDescendant/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isDescendant(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isDescendant/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isDescendant(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isDescendant/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isDescendant(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isDescendant/below-child.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isDescendant(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isDescendant/below-grandchild.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isDescendant(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isDescendant/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isDescendant(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isParent/above-grandparent.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isParent(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isParent/above-parent.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isParent(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isParent/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isParent(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isParent/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isParent(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isParent/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isParent(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isParent/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0, 1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isParent(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isPath/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = true
4 | export const test = path => {
5 | return Path.isPath(path)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isPath/empty.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = []
4 | export const test = path => {
5 | return Path.isPath(path)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isPath/full.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1]
4 | export const test = path => {
5 | return Path.isPath(path)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isPath/strings.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = ['a', 'b']
4 | export const test = path => {
5 | return Path.isPath(path)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/above.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/after-sibling.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 4],
5 | another: [1, 2],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/before-sibling.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [0, 3],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 2],
5 | another: [1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/below.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/isSibling/equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [0, 1],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.isSibling(path, another)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/levels/reverse.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1, 2]
4 | export const test = path => {
5 | return Path.levels(path, { reverse: true })
6 | }
7 | export const output = [[0, 1, 2], [0, 1], [0], []]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/levels/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1, 2]
4 | export const test = path => {
5 | return Path.levels(path)
6 | }
7 | export const output = [[], [0], [0, 1], [0, 1, 2]]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/next/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1]
4 | export const test = path => {
5 | return Path.next(path)
6 | }
7 | export const output = [0, 2]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/parent/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1]
4 | export const test = path => {
5 | return Path.parent(path)
6 | }
7 | export const output = [0]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/previous/success.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = [0, 1]
4 | export const test = path => {
5 | return Path.previous(path)
6 | }
7 | export const output = [0, 0]
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/relative/grandparent.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1, 2],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.relative(path, another)
9 | }
10 | export const output = [1, 2]
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/relative/parent.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [0],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.relative(path, another)
9 | }
10 | export const output = [1]
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/relative/root.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | another: [],
6 | }
7 | export const test = ({ path, another }) => {
8 | return Path.relative(path, another)
9 | }
10 | export const output = [0, 1]
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ancestor-sibling-ends-after-to-ancestor.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [4],
7 | newPath: [3],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [4, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ancestor-sibling-ends-after-to-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [4],
7 | newPath: [2],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [4, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ancestor-sibling-ends-before-to-ancestor.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [2],
7 | newPath: [3],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [2, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ancestor-sibling-ends-before-to-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [2],
7 | newPath: [4],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [2, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ancestor-to-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3],
7 | newPath: [5, 1],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [4, 1, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ancestor-to-ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3],
7 | newPath: [2, 5],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [2, 5, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ends-after-to-no-relation.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 4],
7 | newPath: [3, 0, 0],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [3, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/ends-before-to-no-relation.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 2],
7 | newPath: [3, 0, 0],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [3, 2, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/equal-to-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 3],
7 | newPath: [3, 5, 0],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [3, 4, 0]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/equal-to-ends-before.js:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3]
4 |
5 | const op = {
6 | type: 'move_node',
7 | path: [3, 3],
8 | newPath: [3, 1, 0],
9 | }
10 |
11 | export const test = () => {
12 | return Path.transform(path, op)
13 | }
14 |
15 | export const output = [3, 1, 0]
16 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/equal-to-ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 3],
7 | newPath: [3, 1, 0],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [3, 1, 0]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/no-relation-to-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 0, 0],
7 | newPath: [3, 4],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [3, 3, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/no-relation-to-ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 0, 0],
7 | newPath: [3, 2],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [3, 4, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/parent-to-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 3],
7 | newPath: [5, 1],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [5, 1, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/parent-to-ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [3, 3, 3]
4 | const op = {
5 | type: 'move_node',
6 | path: [3, 3],
7 | newPath: [2, 1],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [2, 1, 3]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/sibling-ends-after-to-ends-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [0, 1]
4 | const op = {
5 | type: 'move_node',
6 | path: [0, 3],
7 | newPath: [0, 1],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [0, 2]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/sibling-ends-after-to-sibling-ends-before.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [0, 1]
4 | const op = {
5 | type: 'move_node',
6 | path: [0, 3],
7 | newPath: [0, 0],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [0, 2]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/sibling-ends-before-to-ends-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [0, 1]
4 | const op = {
5 | type: 'move_node',
6 | path: [0, 0],
7 | newPath: [0, 1],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [0, 0]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Path/transform/move_node/sibling-ends-before-to-sibling-ends-after.jsx:
--------------------------------------------------------------------------------
1 | import { Path } from 'slate'
2 |
3 | const path = [0, 1]
4 | const op = {
5 | type: 'move_node',
6 | path: [0, 0],
7 | newPath: [0, 3],
8 | }
9 | export const test = () => {
10 | return Path.transform(path, op)
11 | }
12 | export const output = [0, 0]
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-after-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = 1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-after-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = 1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-after-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 3,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = 1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-before-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 4,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = -1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-before-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = -1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-before-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = -1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-equal-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = 1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-equal-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = -1
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/compare/path-equal-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 7,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.compare(point, another)
15 | }
16 | export const output = 0
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-after-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-after-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-after-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 3,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-before-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 4,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-before-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-before-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-equal-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-equal-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/equals/path-equal-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 7,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.equals(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-after-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-after-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-after-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 3,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-before-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 4,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-before-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-before-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-equal-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-equal-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isAfter/path-equal-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 7,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isAfter(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-after-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-after-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-after-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 4],
6 | offset: 3,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-before-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 4,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-before-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-before-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 0],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-equal-offset-after.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-equal-offset-before.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 3,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isBefore/path-equal-offset-equal.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | point: {
5 | path: [0, 1],
6 | offset: 7,
7 | },
8 | another: {
9 | path: [0, 1],
10 | offset: 7,
11 | },
12 | }
13 | export const test = ({ point, another }) => {
14 | return Point.isBefore(point, another)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Point.isPoint(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/custom-property.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | offset: 0,
6 | custom: 'value',
7 | }
8 | export const test = value => {
9 | return Point.isPoint(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/object.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Point.isPoint(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/offset.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = 42
4 | export const test = value => {
5 | return Point.isPoint(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/path.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = [0, 1]
4 | export const test = value => {
5 | return Point.isPoint(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/point.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | offset: 0,
6 | }
7 | export const test = value => {
8 | return Point.isPoint(value)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/without-offset.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | path: [0, 1],
5 | }
6 | export const test = value => {
7 | return Point.isPoint(value)
8 | }
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Point/isPoint/without-path.jsx:
--------------------------------------------------------------------------------
1 | import { Point } from 'slate'
2 |
3 | export const input = {
4 | offset: 0,
5 | }
6 | export const test = value => {
7 | return Point.isPoint(value)
8 | }
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/includes/path-after.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | range: {
5 | anchor: {
6 | path: [1],
7 | offset: 0,
8 | },
9 | focus: {
10 | path: [3],
11 | offset: 0,
12 | },
13 | },
14 | target: [4],
15 | }
16 | export const test = ({ range, target }) => {
17 | return Range.includes(range, target)
18 | }
19 | export const output = false
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/includes/path-before.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | range: {
5 | anchor: {
6 | path: [1],
7 | offset: 0,
8 | },
9 | focus: {
10 | path: [3],
11 | offset: 0,
12 | },
13 | },
14 | target: [0],
15 | }
16 | export const test = ({ range, target }) => {
17 | return Range.includes(range, target)
18 | }
19 | export const output = false
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/includes/path-end.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | range: {
5 | anchor: {
6 | path: [1],
7 | offset: 0,
8 | },
9 | focus: {
10 | path: [3],
11 | offset: 0,
12 | },
13 | },
14 | target: [3],
15 | }
16 | export const test = ({ range, target }) => {
17 | return Range.includes(range, target)
18 | }
19 | export const output = true
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/includes/path-inside.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | range: {
5 | anchor: {
6 | path: [1],
7 | offset: 0,
8 | },
9 | focus: {
10 | path: [3],
11 | offset: 0,
12 | },
13 | },
14 | target: [2],
15 | }
16 | export const test = ({ range, target }) => {
17 | return Range.includes(range, target)
18 | }
19 | export const output = true
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/includes/path-start.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | range: {
5 | anchor: {
6 | path: [1],
7 | offset: 0,
8 | },
9 | focus: {
10 | path: [3],
11 | offset: 0,
12 | },
13 | },
14 | target: [1],
15 | }
16 | export const test = ({ range, target }) => {
17 | return Range.includes(range, target)
18 | }
19 | export const output = true
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isBackward/backward.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [3],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isBackward(range)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isBackward/collapsed.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isBackward(range)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isBackward/forward.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [3],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isBackward(range)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isCollapsed/collapsed.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isCollapsed(range)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isCollapsed/expanded.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [3],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isCollapsed(range)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isExpanded/collapsed.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isExpanded(range)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isExpanded/expanded.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [3],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isExpanded(range)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isForward/backward.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [3],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isForward(range)
15 | }
16 | export const output = false
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isForward/collapsed.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isForward(range)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isForward/forward.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [3],
10 | offset: 0,
11 | },
12 | }
13 | export const test = range => {
14 | return Range.isForward(range)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isRange/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Range.isRange(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isRange/custom-property.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | custom: 'value',
13 | }
14 | export const test = value => {
15 | return Range.isRange(value)
16 | }
17 | export const output = true
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isRange/object.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Range.isRange(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isRange/range.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0, 1],
10 | offset: 0,
11 | },
12 | }
13 | export const test = value => {
14 | return Range.isRange(value)
15 | }
16 | export const output = true
17 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isRange/without-anchor.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | focus: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | }
9 | export const test = value => {
10 | return Range.isRange(value)
11 | }
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/isRange/without-focus.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0, 1],
6 | offset: 0,
7 | },
8 | }
9 | export const test = value => {
10 | return Range.isRange(value)
11 | }
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Range/points/full-selection.jsx:
--------------------------------------------------------------------------------
1 | import { Range } from 'slate'
2 |
3 | export const input = {
4 | anchor: {
5 | path: [0],
6 | offset: 0,
7 | },
8 | focus: {
9 | path: [0],
10 | offset: 0,
11 | },
12 | }
13 | export const test = value => {
14 | return Array.from(Range.points(value))
15 | }
16 | export const output = [
17 | [input.anchor, 'anchor'],
18 | [input.focus, 'focus'],
19 | ]
20 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/equals/exact-equals.js:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | textNodeA: { text: 'same text', bold: true },
5 | textNodeB: { text: 'same text', bold: true },
6 | }
7 |
8 | export const test = ({ textNodeA, textNodeB }) => {
9 | return Text.equals(textNodeA, textNodeB, { loose: false })
10 | }
11 |
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/equals/exact-not-equal.js:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | textNodeA: { text: 'same text', bold: true },
5 | textNodeB: { text: 'same text', bold: true, italic: true },
6 | }
7 |
8 | export const test = ({ textNodeA, textNodeB }) => {
9 | return Text.equals(textNodeA, textNodeB, { loose: false })
10 | }
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/equals/loose-equals.js:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | textNodeA: { text: 'some text', bold: true },
5 | textNodeB: { text: 'diff text', bold: true },
6 | }
7 |
8 | export const test = ({ textNodeA, textNodeB }) => {
9 | return Text.equals(textNodeA, textNodeB, { loose: true })
10 | }
11 |
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/equals/loose-not-equal.js:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | textNodeA: { text: 'same text', bold: true },
5 | textNodeB: { text: 'same text', bold: true, italic: true },
6 | }
7 |
8 | export const test = ({ textNodeA, textNodeB }) => {
9 | return Text.equals(textNodeA, textNodeB, { loose: true })
10 | }
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isText/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Text.isText(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isText/custom-property.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: '',
5 | custom: true,
6 | }
7 | export const test = value => {
8 | return Text.isText(value)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isText/object.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Text.isText(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isText/text-full.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: 'string',
5 | }
6 | export const test = value => {
7 | return Text.isText(value)
8 | }
9 | export const output = true
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isText/text.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: '',
5 | }
6 | export const test = value => {
7 | return Text.isText(value)
8 | }
9 | export const output = true
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isText/without-text.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {}
4 | export const test = value => {
5 | return Text.isText(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/boolean.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = true
4 | export const test = value => {
5 | return Text.isTextList(value)
6 | }
7 | export const output = false
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/empty.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = []
4 | export const test = value => {
5 | return Text.isTextList(value)
6 | }
7 | export const output = true
8 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/full-element.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | },
7 | ]
8 | export const test = value => {
9 | return Text.isTextList(value)
10 | }
11 | export const output = false
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/full-text.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = [
4 | {
5 | text: '',
6 | },
7 | ]
8 | export const test = value => {
9 | return Text.isTextList(value)
10 | }
11 | export const output = true
12 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/full-value.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = [
4 | {
5 | children: [],
6 | selection: null,
7 | },
8 | ]
9 | export const test = value => {
10 | return Text.isTextList(value)
11 | }
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/not-full-text.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = [
4 | {
5 | text: '',
6 | },
7 | {
8 | type: 'set_node',
9 | path: [0],
10 | properties: {},
11 | newProperties: {},
12 | },
13 | ]
14 | export const test = value => {
15 | return Text.isTextList(value)
16 | }
17 | export const output = false
18 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/isTextList/text.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: '',
5 | }
6 | export const test = value => {
7 | return Text.isTextList(value)
8 | }
9 | export const output = false
10 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/empty-true.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { text: '', bold: true },
5 | props: {},
6 | }
7 | export const test = ({ text, props }) => {
8 | return Text.matches(text, props)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/match-false.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { text: '', bold: true },
5 | props: { italic: true },
6 | }
7 | export const test = ({ text, props }) => {
8 | return Text.matches(text, props)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/match-true.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { text: '', bold: true },
5 | props: { bold: true },
6 | }
7 | export const test = ({ text, props }) => {
8 | return Text.matches(text, props)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/partial-false.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { text: '', bold: true, italic: true },
5 | props: { underline: true },
6 | }
7 | export const test = ({ text, props }) => {
8 | return Text.matches(text, props)
9 | }
10 | export const output = false
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/partial-true.jsx:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { text: '', bold: true, italic: true },
5 | props: { bold: true },
6 | }
7 | export const test = ({ text, props }) => {
8 | return Text.matches(text, props)
9 | }
10 | export const output = true
11 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/undefined-false.js:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { foo: undefined },
5 | props: { bar: undefined },
6 | }
7 |
8 | export const test = ({ text, props }) => {
9 | return Text.matches(text, props)
10 | }
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/interfaces/Text/matches/undefined-true.js:
--------------------------------------------------------------------------------
1 | import { Text } from 'slate'
2 |
3 | export const input = {
4 | text: { foo: undefined },
5 | props: { foo: undefined },
6 | }
7 |
8 | export const test = ({ text, props }) => {
9 | return Text.matches(text, props)
10 | }
11 |
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/normalization/block/insert-text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 |
8 | )
9 | export const output = (
10 |
11 |
12 |
13 |
14 |
15 | )
16 |
--------------------------------------------------------------------------------
/test/slate/normalization/block/remove-block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 | one
8 | two
9 |
10 |
11 | )
12 | export const output = (
13 |
14 |
15 | onetwo
16 |
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/normalization/editor/remove-inline.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 | one
7 | two
8 | three
9 | four
10 |
11 | )
12 | export const output = (
13 |
14 | two
15 | four
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/normalization/editor/remove-text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 | one
7 | two
8 | three
9 | four
10 |
11 | )
12 | export const output = (
13 |
14 | two
15 | four
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/normalization/text/merge-adjacent-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 |
8 |
9 |
10 |
11 | )
12 | export const output = (
13 |
14 |
15 |
16 |
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/normalization/text/merge-adjacent-match-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 | 1
8 | 2
9 |
10 |
11 | )
12 | export const output = (
13 |
14 |
15 | 12
16 |
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/normalization/text/merge-adjacent-match.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 | 1
8 | 2
9 |
10 |
11 | )
12 | export const output = (
13 |
14 |
15 | 12
16 |
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/normalization/void/block-insert-text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from '@test-utils'
3 |
4 | export const input = (
5 |
6 |
7 |
8 | )
9 | export const output = (
10 |
11 |
12 |
13 |
14 |
15 | )
16 |
--------------------------------------------------------------------------------
/test/slate/transforms/delete/path/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const run = editor => {
12 | Transforms.delete(editor, { at: [1] })
13 | }
14 | export const output = (
15 |
16 | one
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/transforms/delete/voids-false/block-only.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const run = editor => {
6 | Transforms.delete(editor)
7 | }
8 | export const input = (
9 |
10 |
11 |
12 |
13 |
14 | )
15 | export const output =
16 |
--------------------------------------------------------------------------------
/test/slate/transforms/deselect/basic.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const run = editor => {
6 | Transforms.deselect(editor)
7 | }
8 | export const input = (
9 |
10 |
11 |
12 | one
13 |
14 |
15 | )
16 | export const output = (
17 |
18 | one
19 |
20 | )
21 |
--------------------------------------------------------------------------------
/test/slate/transforms/insertNodes/selection/none-empty.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input =
6 | export const run = (editor, options = {}) => {
7 | Transforms.insertNodes(editor, one, options)
8 | }
9 | export const output = (
10 |
11 |
12 | one
13 |
14 |
15 |
16 | )
17 |
--------------------------------------------------------------------------------
/test/slate/transforms/insertText/path/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | word
8 |
9 | )
10 | export const run = editor => {
11 | Transforms.insertText(editor, 'x', { at: [0] })
12 | }
13 | export const output = (
14 |
15 | x
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/transforms/insertText/path/text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | word
8 |
9 | )
10 | export const run = editor => {
11 | Transforms.insertText(editor, 'x', { at: [0, 0] })
12 | }
13 | export const output = (
14 |
15 | x
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/transforms/insertText/voids-false/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | word
8 |
9 | )
10 | export const run = editor => {
11 | Transforms.insertText(editor, 'x', { at: [0] })
12 | }
13 | export const output = (
14 |
15 | word
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/transforms/insertText/voids-false/text.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | word
8 |
9 | )
10 | export const run = editor => {
11 | Transforms.insertText(editor, 'x', { at: [0, 0] })
12 | }
13 | export const output = (
14 |
15 | word
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/transforms/insertText/voids-true/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | word
8 |
9 | )
10 | export const run = editor => {
11 | Transforms.insertText(editor, 'x', { at: [0], voids: true })
12 | }
13 | export const output = (
14 |
15 | x
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/transforms/mergeNodes/path/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const run = editor => {
12 | Transforms.mergeNodes(editor, { at: [1] })
13 | }
14 | export const output = (
15 |
16 | onetwo
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/transforms/removeNodes/path/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | one
8 | two
9 |
10 | )
11 | export const run = editor => {
12 | Transforms.removeNodes(editor, { at: [0] })
13 | }
14 | export const output = (
15 |
16 | two
17 |
18 | )
19 |
--------------------------------------------------------------------------------
/test/slate/transforms/removeNodes/select/block-only-void.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 |
8 |
9 | one
10 |
11 |
12 | )
13 | export const run = editor => {
14 | Transforms.removeNodes(editor, { at: [0] })
15 | }
16 | export const output =
17 |
--------------------------------------------------------------------------------
/test/slate/transforms/setNodes/path/block.jsx:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Transforms } from 'slate'
3 | import { jsx } from '@test-utils'
4 |
5 | export const input = (
6 |
7 | word
8 |
9 | )
10 | export const run = editor => {
11 | Transforms.setNodes(editor, { key: 'a' }, { at: [0] })
12 | }
13 | export const output = (
14 |
15 | word
16 |
17 | )
18 |
--------------------------------------------------------------------------------
/test/slate/utils/deep-equal/simple-equals.js:
--------------------------------------------------------------------------------
1 | import { isDeepEqual } from '@test-utils'
2 |
3 | export const input = {
4 | objectA: { text: 'same text', bold: true },
5 | objectB: { text: 'same text', bold: true },
6 | }
7 |
8 | export const test = ({ objectA, objectB }) => {
9 | return isDeepEqual(objectA, objectB)
10 | }
11 |
12 | export const output = true
13 |
--------------------------------------------------------------------------------
/test/slate/utils/deep-equal/simple-not-equal.js:
--------------------------------------------------------------------------------
1 | import { isDeepEqual } from '@test-utils'
2 |
3 | export const input = {
4 | objectA: { text: 'same text', bold: true },
5 | objectB: { text: 'same text', bold: true, italic: true },
6 | }
7 |
8 | export const test = ({ objectA, objectB }) => {
9 | return isDeepEqual(objectA, objectB)
10 | }
11 |
12 | export const output = false
13 |
--------------------------------------------------------------------------------
/test/slate/utils/deep-equal/undefined-key-equal-backward.js:
--------------------------------------------------------------------------------
1 | import { isDeepEqual } from '@test-utils'
2 |
3 | export const input = {
4 | objectA: {
5 | text: 'same text',
6 | },
7 | objectB: {
8 | text: 'same text',
9 | bold: undefined,
10 | },
11 | }
12 |
13 | export const test = ({ objectA, objectB }) => {
14 | return isDeepEqual(objectA, objectB)
15 | }
16 |
17 | export const output = true
18 |
--------------------------------------------------------------------------------
/test/slate/utils/deep-equal/undefined-key-equal-forward.js:
--------------------------------------------------------------------------------
1 | import { isDeepEqual } from '@test-utils'
2 |
3 | export const input = {
4 | objectA: {
5 | text: 'same text',
6 | bold: undefined,
7 | },
8 | objectB: {
9 | text: 'same text',
10 | },
11 | }
12 |
13 | export const test = ({ objectA, objectB }) => {
14 | return isDeepEqual(objectA, objectB)
15 | }
16 |
17 | export const output = true
18 |
--------------------------------------------------------------------------------