@portabletext/editor 1.47.3 → 1.47.5

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 (39) hide show
  1. package/lib/_chunks-cjs/editor-provider.cjs +125 -100
  2. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  3. package/lib/_chunks-cjs/util.is-selection-collapsed.cjs +0 -5
  4. package/lib/_chunks-cjs/util.is-selection-collapsed.cjs.map +1 -1
  5. package/lib/_chunks-es/editor-provider.js +126 -101
  6. package/lib/_chunks-es/editor-provider.js.map +1 -1
  7. package/lib/_chunks-es/util.is-selection-collapsed.js +0 -5
  8. package/lib/_chunks-es/util.is-selection-collapsed.js.map +1 -1
  9. package/lib/behaviors/index.d.cts +404 -543
  10. package/lib/behaviors/index.d.ts +404 -543
  11. package/lib/index.cjs +6 -14
  12. package/lib/index.cjs.map +1 -1
  13. package/lib/index.d.cts +411 -34
  14. package/lib/index.d.ts +411 -34
  15. package/lib/index.js +7 -15
  16. package/lib/index.js.map +1 -1
  17. package/lib/plugins/index.d.cts +411 -34
  18. package/lib/plugins/index.d.ts +411 -34
  19. package/lib/selectors/index.d.cts +404 -33
  20. package/lib/selectors/index.d.ts +404 -33
  21. package/lib/utils/index.cjs +4 -1
  22. package/lib/utils/index.cjs.map +1 -1
  23. package/lib/utils/index.d.cts +404 -33
  24. package/lib/utils/index.d.ts +404 -33
  25. package/lib/utils/index.js +6 -3
  26. package/lib/utils/index.js.map +1 -1
  27. package/package.json +3 -3
  28. package/src/behavior-actions/behavior.action.insert.text.ts +10 -1
  29. package/src/behavior-actions/behavior.actions.ts +0 -18
  30. package/src/behaviors/behavior.perform-event.ts +55 -65
  31. package/src/behaviors/behavior.types.event.ts +7 -9
  32. package/src/editor/Editable.tsx +14 -27
  33. package/src/editor/create-editor.ts +14 -0
  34. package/src/editor/editor-machine.ts +76 -5
  35. package/src/editor/plugins/create-with-event-listeners.ts +0 -6
  36. package/src/editor/plugins/createWithEditableAPI.ts +2 -8
  37. package/src/editor/with-applying-behavior-actions.ts +2 -2
  38. package/src/behavior-actions/behavior.action.blur.ts +0 -8
  39. package/src/behavior-actions/behavior.action.focus.ts +0 -8
@@ -28,7 +28,7 @@ export function withApplyingBehaviorActionSet(editor: Editor, fn: () => void) {
28
28
  const current = CURRENT_BEHAVIOR_ACTION_SET.get(editor)
29
29
 
30
30
  if (current) {
31
- withApplyingBehaviorActions(editor, fn)
31
+ fn()
32
32
  return
33
33
  }
34
34
 
@@ -38,7 +38,7 @@ export function withApplyingBehaviorActionSet(editor: Editor, fn: () => void) {
38
38
  actionSetId: defaultKeyGenerator(),
39
39
  },
40
40
  )
41
- withApplyingBehaviorActions(editor, fn)
41
+ fn()
42
42
  CURRENT_BEHAVIOR_ACTION_SET.set(editor, undefined)
43
43
  }
44
44
 
@@ -1,8 +0,0 @@
1
- import {ReactEditor} from 'slate-react'
2
- import type {BehaviorActionImplementation} from './behavior.actions'
3
-
4
- export const blurActionImplementation: BehaviorActionImplementation<'blur'> = ({
5
- action,
6
- }) => {
7
- ReactEditor.blur(action.editor)
8
- }
@@ -1,8 +0,0 @@
1
- import {ReactEditor} from 'slate-react'
2
- import type {BehaviorActionImplementation} from './behavior.actions'
3
-
4
- export const focusActionImplementation: BehaviorActionImplementation<
5
- 'focus'
6
- > = ({action}) => {
7
- ReactEditor.focus(action.editor)
8
- }