@portabletext/editor 1.44.0 → 1.44.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs +3 -3
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-cjs/editor-provider.cjs +323 -490
  4. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  5. package/lib/_chunks-es/behavior.core.js +3 -3
  6. package/lib/_chunks-es/behavior.core.js.map +1 -1
  7. package/lib/_chunks-es/editor-provider.js +325 -492
  8. package/lib/_chunks-es/editor-provider.js.map +1 -1
  9. package/lib/behaviors/index.cjs +2 -2
  10. package/lib/behaviors/index.cjs.map +1 -1
  11. package/lib/behaviors/index.d.cts +8390 -16283
  12. package/lib/behaviors/index.d.ts +8390 -16283
  13. package/lib/behaviors/index.js +4 -4
  14. package/lib/behaviors/index.js.map +1 -1
  15. package/lib/index.cjs +2 -2
  16. package/lib/index.cjs.map +1 -1
  17. package/lib/index.d.cts +2237 -15969
  18. package/lib/index.d.ts +2237 -15969
  19. package/lib/index.js +2 -2
  20. package/lib/index.js.map +1 -1
  21. package/lib/plugins/index.d.cts +2088 -15821
  22. package/lib/plugins/index.d.ts +2088 -15821
  23. package/lib/selectors/index.d.cts +1738 -15472
  24. package/lib/selectors/index.d.ts +1738 -15472
  25. package/lib/utils/index.d.cts +1738 -15472
  26. package/lib/utils/index.d.ts +1738 -15472
  27. package/package.json +2 -2
  28. package/src/behavior-actions/behavior.actions.ts +1 -39
  29. package/src/behaviors/behavior.abstract.annotation.ts +26 -0
  30. package/src/behaviors/behavior.abstract.decorator.ts +47 -0
  31. package/src/behaviors/{behavior.internal.insert.ts → behavior.abstract.insert.ts} +1 -1
  32. package/src/behaviors/{behavior.internal.list-item.ts → behavior.abstract.list-item.ts} +1 -1
  33. package/src/behaviors/behavior.abstract.move.ts +78 -0
  34. package/src/behaviors/{behavior.internal.select.ts → behavior.abstract.select.ts} +1 -1
  35. package/src/behaviors/{behavior.internal.style.ts → behavior.abstract.style.ts} +1 -1
  36. package/src/behaviors/behavior.code-editor.ts +13 -8
  37. package/src/behaviors/behavior.default.ts +15 -78
  38. package/src/behaviors/behavior.perform-event.ts +4 -4
  39. package/src/behaviors/behavior.types.action.ts +3 -3
  40. package/src/behaviors/behavior.types.behavior.ts +4 -3
  41. package/src/behaviors/behavior.types.event.ts +164 -160
  42. package/src/editor/components/Leaf.tsx +2 -2
  43. package/src/editor/create-editor.ts +37 -11
  44. package/src/editor/editor-machine.ts +4 -76
  45. package/src/editor/editor-selector.ts +5 -2
  46. package/src/editor/editor-snapshot.ts +2 -7
  47. package/src/editor/plugins/create-with-event-listeners.ts +1 -64
  48. package/src/editor/plugins/createWithEditableAPI.ts +0 -30
  49. package/src/editor/plugins/createWithPortableTextMarkModel.ts +0 -29
  50. package/src/editor/plugins/with-plugins.ts +1 -4
  51. package/src/internal-utils/slate-children-to-blocks.ts +49 -0
  52. package/src/internal-utils/slate-utils.ts +6 -8
  53. package/src/type-utils.ts +2 -0
  54. package/src/behavior-actions/behavior.action.move.block-down.ts +0 -48
  55. package/src/behavior-actions/behavior.action.move.block-up.ts +0 -53
package/lib/index.js CHANGED
@@ -596,9 +596,9 @@ const debug$2 = debugWithName("components:Leaf"), EMPTY_MARKS = [], Leaf = (prop
596
596
  useEffect(() => {
597
597
  if (!shouldTrackSelectionAndFocus)
598
598
  return;
599
- const onBlur = editorActor.on("blur", () => {
599
+ const onBlur = editorActor.on("blurred", () => {
600
600
  setFocused(!1), setSelected(!1);
601
- }), onFocus = editorActor.on("focus", () => {
601
+ }), onFocus = editorActor.on("focused", () => {
602
602
  const sel_0 = PortableTextEditor.getSelection(portableTextEditor);
603
603
  sel_0 && isEqual(sel_0.focus.path, path) && PortableTextEditor.isCollapsedSelection(portableTextEditor) && setFocused(!0), setSelectedFromRange();
604
604
  }), onSelection = editorActor.on("selection", (event) => {