2022-04-03 16:52:32 +01:00
|
|
|
import React, { useMemo, useRef, useEffect } from 'react'
|
2022-03-07 05:43:58 +01:00
|
|
|
import { Slate, Editable, withReact, useSlate, useFocused } from 'slate-react'
|
2021-03-11 11:48:31 -08:00
|
|
|
import {
|
|
|
|
Editor,
|
|
|
|
Transforms,
|
|
|
|
Text,
|
|
|
|
createEditor,
|
|
|
|
Descendant,
|
2021-08-05 06:56:45 +02:00
|
|
|
Range,
|
2021-03-11 11:48:31 -08:00
|
|
|
} from 'slate'
|
2022-01-11 15:36:04 +00:00
|
|
|
import { css } from '@emotion/css'
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
import { withHistory } from 'slate-history'
|
|
|
|
|
2024-09-26 12:54:11 +05:30
|
|
|
import { Button, Icon, Menu, Portal } from './components'
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
|
|
|
|
const HoveringMenuExample = () => {
|
2021-10-17 14:31:33 +01:00
|
|
|
const editor = useMemo(() => withHistory(withReact(createEditor())), [])
|
2019-12-05 11:36:44 -05:00
|
|
|
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
return (
|
2023-05-26 17:53:39 +03:00
|
|
|
<Slate editor={editor} initialValue={initialValue}>
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
<HoveringToolbar />
|
|
|
|
<Editable
|
2019-12-05 11:21:15 -05:00
|
|
|
renderLeaf={props => <Leaf {...props} />}
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
placeholder="Enter some text..."
|
2020-08-20 00:14:51 +08:00
|
|
|
onDOMBeforeInput={(event: InputEvent) => {
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
switch (event.inputType) {
|
|
|
|
case 'formatBold':
|
2022-09-10 00:15:34 -03:00
|
|
|
event.preventDefault()
|
2023-06-12 15:08:10 -07:00
|
|
|
return toggleMark(editor, 'bold')
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
case 'formatItalic':
|
2022-09-10 00:15:34 -03:00
|
|
|
event.preventDefault()
|
2023-06-12 15:08:10 -07:00
|
|
|
return toggleMark(editor, 'italic')
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
case 'formatUnderline':
|
2022-09-10 00:15:34 -03:00
|
|
|
event.preventDefault()
|
2023-06-12 15:08:10 -07:00
|
|
|
return toggleMark(editor, 'underlined')
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Slate>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-06-12 15:08:10 -07:00
|
|
|
const toggleMark = (editor, format) => {
|
|
|
|
const isActive = isMarkActive(editor, format)
|
|
|
|
|
|
|
|
if (isActive) {
|
|
|
|
Editor.removeMark(editor, format)
|
|
|
|
} else {
|
|
|
|
Editor.addMark(editor, format, true)
|
|
|
|
}
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
}
|
|
|
|
|
2023-06-12 15:08:10 -07:00
|
|
|
const isMarkActive = (editor, format) => {
|
|
|
|
const marks = Editor.marks(editor)
|
|
|
|
return marks ? marks[format] === true : false
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
}
|
|
|
|
|
2019-12-05 11:21:15 -05:00
|
|
|
const Leaf = ({ attributes, children, leaf }) => {
|
|
|
|
if (leaf.bold) {
|
|
|
|
children = <strong>{children}</strong>
|
|
|
|
}
|
|
|
|
|
|
|
|
if (leaf.italic) {
|
|
|
|
children = <em>{children}</em>
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
}
|
2019-12-05 11:21:15 -05:00
|
|
|
|
|
|
|
if (leaf.underlined) {
|
|
|
|
children = <u>{children}</u>
|
|
|
|
}
|
|
|
|
|
|
|
|
return <span {...attributes}>{children}</span>
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
const HoveringToolbar = () => {
|
2020-08-20 00:14:51 +08:00
|
|
|
const ref = useRef<HTMLDivElement | null>()
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
const editor = useSlate()
|
2022-03-07 05:43:58 +01:00
|
|
|
const inFocus = useFocused()
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
const el = ref.current
|
|
|
|
const { selection } = editor
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
|
|
!selection ||
|
2022-03-07 05:43:58 +01:00
|
|
|
!inFocus ||
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
Range.isCollapsed(selection) ||
|
2019-12-17 22:17:21 -05:00
|
|
|
Editor.string(editor, selection) === ''
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
) {
|
|
|
|
el.removeAttribute('style')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
const domSelection = window.getSelection()
|
|
|
|
const domRange = domSelection.getRangeAt(0)
|
|
|
|
const rect = domRange.getBoundingClientRect()
|
2020-08-20 00:14:51 +08:00
|
|
|
el.style.opacity = '1'
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
el.style.top = `${rect.top + window.pageYOffset - el.offsetHeight}px`
|
2023-10-20 08:34:24 -07:00
|
|
|
el.style.left = `${
|
|
|
|
rect.left + window.pageXOffset - el.offsetWidth / 2 + rect.width / 2
|
|
|
|
}px`
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Portal>
|
|
|
|
<Menu
|
|
|
|
ref={ref}
|
|
|
|
className={css`
|
|
|
|
padding: 8px 7px 6px;
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
top: -10000px;
|
|
|
|
left: -10000px;
|
|
|
|
margin-top: -6px;
|
|
|
|
opacity: 0;
|
|
|
|
background-color: #222;
|
|
|
|
border-radius: 4px;
|
|
|
|
transition: opacity 0.75s;
|
|
|
|
`}
|
2022-03-07 05:43:58 +01:00
|
|
|
onMouseDown={e => {
|
|
|
|
// prevent toolbar from taking focus away from editor
|
|
|
|
e.preventDefault()
|
|
|
|
}}
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
>
|
2019-12-05 11:21:15 -05:00
|
|
|
<FormatButton format="bold" icon="format_bold" />
|
|
|
|
<FormatButton format="italic" icon="format_italic" />
|
|
|
|
<FormatButton format="underlined" icon="format_underlined" />
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
</Menu>
|
|
|
|
</Portal>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2019-12-05 11:21:15 -05:00
|
|
|
const FormatButton = ({ format, icon }) => {
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
const editor = useSlate()
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
reversed
|
2023-06-12 15:08:10 -07:00
|
|
|
active={isMarkActive(editor, format)}
|
|
|
|
onClick={() => toggleMark(editor, format)}
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
>
|
|
|
|
<Icon>{icon}</Icon>
|
|
|
|
</Button>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-03-29 09:49:44 -07:00
|
|
|
const initialValue: Descendant[] = [
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
{
|
2021-03-11 11:48:31 -08:00
|
|
|
type: 'paragraph',
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
children: [
|
|
|
|
{
|
2023-10-20 08:34:24 -07:00
|
|
|
text: 'This example shows how you can make a hovering menu appear above your content, which you can use to make text ',
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
},
|
2019-12-05 11:21:15 -05:00
|
|
|
{ text: 'bold', bold: true },
|
|
|
|
{ text: ', ' },
|
|
|
|
{ text: 'italic', italic: true },
|
|
|
|
{ text: ', or anything else you might want to do!' },
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2021-03-11 11:48:31 -08:00
|
|
|
type: 'paragraph',
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
children: [
|
2019-12-05 11:21:15 -05:00
|
|
|
{ text: 'Try it out yourself! Just ' },
|
|
|
|
{ text: 'select any piece of text and the menu will appear', bold: true },
|
|
|
|
{ text: '.' },
|
Next (#3093)
* remove some key usage from core, refactor Operations.apply
* undeprecate some methods
* convert more key usage to paths
* update deprecations
* convert selection commands to use all paths
* refactor word boundary selection logic
* convert many at-range commands to use paths
* convert wrapBlock and wrapInline to not use keys
* cleanup
* remove chainability from editor
* simplify commands, queries and middleware
* convert deleteAtRange
* remove key usage from schema, deprecate *ByKey methods
* migrate *ByKey tests, remove index from *ByPath signatures
* rename at-current-range tests
* deprecate mode key usage, migrate more tests away from keys
* deprecate range and point methods which rely on keys to work
* refactor insertBlock, without fixing warnings
* add pathRef/pointRef, fix insertBlock/Inline deprecations, work on insertFragment
* refactor insertFragment
* get rich-text example rendering
* fix lint
* refactor query files, fix more tests
* remove unused queries, refactor others
* deprecate splitDescendantsByPath
* merge master
* add typescript, convert slate, slate-hyperscript, slate-plain-serializer
* add Point, Path, Range, Annotation tests
* add Annotation, Change, Element, Fragment, Mark, Range, Selection, Value interfaces tests
* add Operation and Text tests
* add Node tests
* get operations and normalization tests working for slate
* get *AtPath command tests passing
* rename *AtPath command tests
* rename
* get *AtPoint tests working
* rename
* rename
* add value queries tests
* add element, mark and path queries tests
* convert most on-selection tests
* convert on-selection commands
* rename
* get addMarks and delete commands working
* rename
* rename
* rename
* refactor value.positions(), work on delete tests
* progress on delete tests
* more delete work
* finish delete tests
* start converting to at-based commands
* restructure query tests
* restructure operations tests
* more work converting to multi-purpose commands
* lots of progress on converting to at-based commands
* add unwrapNodes
* remove setValue
* more progress
* refactor node commands to use consistent matching logic
* cleanup, get non-fragment commands passing
* remove annotations and isAtomic
* rename surround/pluck to cover/uncover
* add location concept, change at-path to from-path for iterables
* refactor batches
* add location-based queries
* refactor hanging logic
* more location query work
* renaming
* use getMatch more
* add split to wrap/unwrap
* flip levels/ancestors ordering
* switch splitNodes to use levels
* change split to always:false by default
* fix tests
* add more queries tests
* fixing more delete logic
* add more splitNodes tests
* get rest of delete tests passing
* fix location-based logic in some commands
* cleanup
* get previous packages tests passing again
* add slate-history package
* start slate-schema work
* start of react working
* rendering fixes
* get rich and plain text examples working
* get image example working with hooks and dropping
* refactor onDrop to be internal
* inline more event handlers
* refactor lots of event-related logic
* change rendering to use render props
* delete unused stuff
* cleanup dom utils
* remove unused deps
* remove unnecessary packages, add placeholder
* remove slate-react-placeholder package
* remove unused dep
* remove unnecessary tests, fix readonly example
* convert checklists example
* switch to next from webpack
* get link example working
* convert more examples
* preserve keys, memoized leafs/texts, fix node lookup
* fix to always useLayoutEffect for ordering
* fix annotations to be maps, memoize elements
* remove Change interface
* remove String interface
* rename Node.entries to Node.nodes
* remove unnecessary value queries
* default to selection when iterating, cleanup
* remove unused files
* update scroll into view logic
* fix undoing, remove constructor types
* dont sync selection while composing
* add workflows
* remove unused deps
* convert mentions example
* tweaks
* convert remaining examples
* rename h to jsx, update schema
* fix schema tests
* fix slate-schema logic and tests
* really fix slate-schema and forced-layout example
* get start of insertFragment tests working
* remove Fragment interface
* remove debugger
* get all non-skipped tests passing
* cleanup deps
* run prettier
* configure eslint for typescript
* more eslint fixes...
* more passing
* update some docs
* fix examples
* port windows undo hotkey change
* fix deps, add basic firefox support
* add event overriding, update walkthroughs
* add commands, remove classes, cleanup examples
* cleanup rollup config
* update tests
* rename queries tests
* update other tests
* update walkthroughs
* cleanup interface exports
* cleanup, change mark transforms to require location
* undo mark transform change
* more
* fix tests
* fix example
* update walkthroughs
* update docs
* update docs
* remove annotations
* remove value, move selection and children to editor
* add migrating doc
* fix lint
* fix tests
* fix DOM types aliasing
* add next export
* update deps, fix prod build
* fix prod build
* update scripts
* update docs and changelogs
* update workflow and pull request template
2019-11-27 20:54:42 -05:00
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
export default HoveringMenuExample
|