Skip to content

Latest commit

 

History

History
123 lines (85 loc) · 7.13 KB

CHANGELOG.md

File metadata and controls

123 lines (85 loc) · 7.13 KB

@udecode/plate-core

1.0.0

Major Changes

🎉 The Slate Plugins project has evolved to Plate 🎉

To migrate, find and replace all occurrences of:

  • slate-plugins to plate
  • SlatePlugins to Plate
  • SlatePlugin to PlatePlugin

1.0.0-next.61

This is the last version of @udecode/slate-plugins[-x], please install @udecode/plate[-x].

Minor Changes

  • #869 7c26cf32 Thanks @zbeyens! - - New plugin option deserialize.getFragment: Function called on editor.insertData to filter the fragment to insert.
    • New plugin option deserialize.preInsert: Function called on editor.insertData just before editor.insertFragment. Default: if the block above the selection is empty and the first fragment node type is not inline, set the selected node type to the first fragment node type. If returns true, the next handlers will be skipped.

1.0.0-next.56

Patch Changes

  • #855 75b39f18 Thanks @zbeyens! - Sometimes we want to preventDefault without stopping the handler pipeline, so we remove this check. In summary, to stop the pipeline, a handler has to return true or run event.stopPropagation()

1.0.0-next.55

Major Changes

  • #853 abaf4a11 Thanks @zbeyens! - Before, the handlers had to return false to prevent the next handlers to be called. Now, we reuse isEventHandled internally used by [email protected] which has the opposite behavior: a handler has to return true to stop the pipeline. Additionally, the pipeline stops if at any moment event.isDefaultPrevented() or event.isPropagationStopped() returns true, except if the handler returns false. See the updated docs in "Creating Plugins".

1.0.0-next.53

Patch Changes

  • #840 42360b44 Thanks @zbeyens! - fix:
    • Plugin handlers are now run when a handler is passed to editableProps
    • If one handler returns true, slate internal corresponding handler is not called anymore

1.0.0-next.40

Patch Changes

  • #773 15048e6f Thanks @zbeyens! - fix: before, store setValue was called at the start of onChange pipeline. Now, it's called at the end of the pipeline so we can make use of this value as the "previous value" in plugins onChange.

1.0.0-next.39

Patch Changes

1.0.0-next.36

Minor Changes

  • #723 806e1632 Thanks @Aedron! - feat: new SlatePlugins option - renderEditable: Custom Editable node

1.0.0-next.30

Patch Changes

1.0.0-next.29

Major Changes

  • #687 dfbde8bd Thanks @zbeyens! - changes:
    • renamed:
      • useTSlate to useEditorState
      • useTSlateStatic to useEditorRef
      • useStoreEditor to useStoreEditorRef
    • removed:
      • useEditorId in favor of useEditorRef().id
      • useEditorOptions in favor of useEditorRef().options
      • useSlatePluginOptions in favor of getSlatePluginOptions(useEditorRef(), pluginKey)
      • useSlatePluginType in favor of getSlatePluginType(useEditorRef(), pluginKey)
      • pipeOnDOMBeforeInput in favor of pipeHandler
      • pipeOnKeyDown in favor of pipeHandler
    • types:
      • renamed:
        • SlatePluginsState to SlatePluginsStates
        • State to SlatePluginsState
      • removed:
        • OnDOMBeforeInput in favor of DOMHandler<'onDOMBeforeInput'>
        • OnKeyDown in favor of KeyboardHandler

Minor Changes

  • #687 dfbde8bd Thanks @zbeyens! - changes:
    • useEditableProps (used by SlatePlugins):
      • new fields returned: all handler props from the plugins (if defined)
      • new core plugins with the following fields:
        • onFocus: setEventEditorId('focus', id)
        • onBlur: setEventEditorId('blur', id)
        • You can add your own handlers in a plugin
    • EditorStateEffect: a new component used by SlatePlugins to update the editor state.
    • setEventEditorId: a new action. Set an editor id by event key.
    • eventEditorStore, useEventEditorStore: a new store. Store where the keys are event names and the values are editor ids.
    • useEventEditorId: a new selector. Get the editor id by event key.
    • useStoreEditorSelection: a new selector. Get the editor selection which is updated on editor change.
    • useStoreEditorState: a new selector. Get editor state which is updated on editor change. Similar to useSlate.
    • SlatePlugin: the previous plugin could implement the following handlers: onChange, onDOMBeforeInput and onKeyDown. The plugins now implement all DOM handlers: clipboard, composition, focus, form, image, keyboard, media, mouse, selection, touch, pointer, ui, wheel animation and transition events.
    • SlatePluginsState (store interface):
      • a new field keyChange incremented by SlatePlugins on useSlate update.
      • a new field selection = editor.selection updated on useSlate update.
    • pipeHandler: a new function. Generic pipe for handlers.

1.0.0-next.26

Patch Changes