@portabletext/editor 1.0.11 → 1.0.13

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.
@@ -78,7 +78,11 @@ export const withPlugins = <T extends Editor>(
78
78
  patches$,
79
79
  blockSchemaType: schemaTypes.block,
80
80
  })
81
- const withPortableTextMarkModel = createWithPortableTextMarkModel(schemaTypes, change$)
81
+ const withPortableTextMarkModel = createWithPortableTextMarkModel(
82
+ schemaTypes,
83
+ change$,
84
+ keyGenerator,
85
+ )
82
86
  const withPortableTextBlockStyle = createWithPortableTextBlockStyle(schemaTypes)
83
87
 
84
88
  const withPlaceholderBlock = createWithPlaceholderBlock()
@@ -101,6 +101,7 @@ Array [
101
101
  ],
102
102
  {schemaTypes},
103
103
  )
104
+
104
105
  expect(result).toMatchInlineSnapshot(`
105
106
  Array [
106
107
  Object {
@@ -28,7 +28,6 @@ import {debugWithName} from './debug'
28
28
  import {fromSlateValue} from './values'
29
29
 
30
30
  const debug = debugWithName('operationToPatches')
31
- debug.enabled = false
32
31
 
33
32
  export function createOperationToPatches(types: PortableTextMemberSchemaTypes): PatchFunctions {
34
33
  const textBlockName = types.block.name
@@ -9,6 +9,13 @@ export function withPreserveKeys(editor: Editor, fn: () => void): void {
9
9
  PRESERVE_KEYS.set(editor, prev)
10
10
  }
11
11
 
12
+ export function withoutPreserveKeys(editor: Editor, fn: () => void): void {
13
+ const prev = isPreservingKeys(editor)
14
+ PRESERVE_KEYS.set(editor, false)
15
+ fn()
16
+ PRESERVE_KEYS.set(editor, prev)
17
+ }
18
+
12
19
  export function isPreservingKeys(editor: Editor): boolean | undefined {
13
20
  return PRESERVE_KEYS.get(editor)
14
21
  }