@portabletext/editor 1.17.0 → 1.18.0

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 (56) hide show
  1. package/README.md +228 -261
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
  4. package/lib/_chunks-cjs/selector.is-selection-collapsed.cjs.map +1 -1
  5. package/lib/_chunks-es/behavior.core.js.map +1 -1
  6. package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
  7. package/lib/_chunks-es/selector.is-selection-collapsed.js.map +1 -1
  8. package/lib/behaviors/index.cjs +40 -38
  9. package/lib/behaviors/index.cjs.map +1 -1
  10. package/lib/behaviors/index.d.cts +23 -23
  11. package/lib/behaviors/index.d.ts +23 -23
  12. package/lib/behaviors/index.js +40 -38
  13. package/lib/behaviors/index.js.map +1 -1
  14. package/lib/index.cjs +301 -351
  15. package/lib/index.cjs.map +1 -1
  16. package/lib/index.d.cts +123 -753
  17. package/lib/index.d.ts +123 -753
  18. package/lib/index.js +301 -351
  19. package/lib/index.js.map +1 -1
  20. package/lib/selectors/index.cjs.map +1 -1
  21. package/lib/selectors/index.d.cts +30 -30
  22. package/lib/selectors/index.d.ts +30 -30
  23. package/lib/selectors/index.js.map +1 -1
  24. package/package.json +10 -10
  25. package/src/behaviors/behavior.code-editor.ts +2 -2
  26. package/src/behaviors/behavior.core.ts +2 -2
  27. package/src/behaviors/behavior.emoji-picker.ts +52 -41
  28. package/src/behaviors/behavior.links.ts +2 -2
  29. package/src/behaviors/behavior.markdown.ts +2 -2
  30. package/src/behaviors/behavior.types.ts +10 -10
  31. package/src/editor/PortableTextEditor.tsx +2 -0
  32. package/src/editor/__tests__/self-solving.test.tsx +14 -0
  33. package/src/editor/components/Synchronizer.tsx +6 -1
  34. package/src/editor/create-editor.ts +14 -3
  35. package/src/editor/define-schema.ts +4 -4
  36. package/src/editor/editor-event-listener.tsx +1 -1
  37. package/src/editor/editor-machine.ts +42 -52
  38. package/src/editor/editor-provider.tsx +3 -3
  39. package/src/editor/editor-selector.ts +31 -14
  40. package/src/editor/editor-snapshot.ts +2 -2
  41. package/src/editor/get-value.ts +12 -5
  42. package/src/editor/hooks/usePortableTextEditor.ts +1 -0
  43. package/src/editor/hooks/usePortableTextEditorSelection.tsx +1 -0
  44. package/src/selectors/selector.get-active-list-item.ts +1 -1
  45. package/src/selectors/selector.get-active-style.ts +1 -1
  46. package/src/selectors/selector.get-selected-spans.ts +1 -1
  47. package/src/selectors/selector.get-selection-text.ts +1 -1
  48. package/src/selectors/selector.get-text-before.ts +1 -1
  49. package/src/selectors/selector.is-active-annotation.ts +1 -1
  50. package/src/selectors/selector.is-active-decorator.ts +1 -1
  51. package/src/selectors/selector.is-active-list-item.ts +1 -1
  52. package/src/selectors/selector.is-active-style.ts +1 -1
  53. package/src/selectors/selector.is-selection-collapsed.ts +1 -1
  54. package/src/selectors/selector.is-selection-expanded.ts +1 -1
  55. package/src/selectors/selectors.ts +13 -13
  56. package/src/types/editor.ts +2 -2
@@ -3,7 +3,7 @@ import {isHotkey} from '../utils/is-hotkey'
3
3
  import {defineBehavior} from './behavior.types'
4
4
 
5
5
  /**
6
- * @alpha
6
+ * @beta
7
7
  */
8
8
  export type CodeEditorBehaviorsConfig = {
9
9
  moveBlockUpShortcut: string
@@ -11,7 +11,7 @@ export type CodeEditorBehaviorsConfig = {
11
11
  }
12
12
 
13
13
  /**
14
- * @alpha
14
+ * @beta
15
15
  */
16
16
  export function createCodeEditorBehaviors(config: CodeEditorBehaviorsConfig) {
17
17
  return [
@@ -9,7 +9,7 @@ const softReturn = defineBehavior({
9
9
  })
10
10
 
11
11
  /**
12
- * @alpha
12
+ * @beta
13
13
  */
14
14
  export const coreBehaviors = [
15
15
  softReturn,
@@ -29,7 +29,7 @@ export const coreBehaviors = [
29
29
  ]
30
30
 
31
31
  /**
32
- * @alpha
32
+ * @beta
33
33
  */
34
34
  export const coreBehavior = {
35
35
  softReturn,
@@ -8,7 +8,7 @@ const incompleteEmojiRegEx = /:([a-zA-Z-_0-9]+)$/
8
8
  const emojiRegEx = /:([a-zA-Z-_0-9]+):$/
9
9
 
10
10
  /**
11
- * @alpha
11
+ * @beta
12
12
  */
13
13
  export type EmojiPickerBehaviorsConfig<TEmojiMatch> = {
14
14
  /**
@@ -24,7 +24,7 @@ export type EmojiPickerBehaviorsConfig<TEmojiMatch> = {
24
24
  }
25
25
 
26
26
  /**
27
- * @alpha
27
+ * @beta
28
28
  */
29
29
  export function createEmojiPickerBehaviors<TEmojiMatch>(
30
30
  config: EmojiPickerBehaviorsConfig<TEmojiMatch>,
@@ -37,6 +37,43 @@ export function createEmojiPickerBehaviors<TEmojiMatch>(
37
37
  })
38
38
 
39
39
  return [
40
+ defineBehavior({
41
+ on: 'insert.text',
42
+ guard: ({context, event}) => {
43
+ const isEmojiChar = emojiCharRegEx.test(event.text)
44
+
45
+ if (!isEmojiChar) {
46
+ return {emojis: []}
47
+ }
48
+
49
+ const focusBlock = selectors.getFocusTextBlock({context})
50
+ const textBefore = selectors.getBlockTextBefore({context})
51
+ const emojiKeyword = `${textBefore}${event.text}`.match(
52
+ incompleteEmojiRegEx,
53
+ )?.[1]
54
+
55
+ if (!focusBlock || emojiKeyword === undefined) {
56
+ return {emojis: []}
57
+ }
58
+
59
+ const emojis = config.matchEmojis({keyword: emojiKeyword})
60
+
61
+ return {emojis}
62
+ },
63
+ actions: [
64
+ (_, params) => [
65
+ {
66
+ type: 'effect',
67
+ effect: () => {
68
+ emojiPickerActor.send({
69
+ type: 'emojis found',
70
+ matches: params.emojis,
71
+ })
72
+ },
73
+ },
74
+ ],
75
+ ],
76
+ }),
40
77
  defineBehavior({
41
78
  on: 'insert.text',
42
79
  guard: ({context, event}) => {
@@ -107,45 +144,14 @@ export function createEmojiPickerBehaviors<TEmojiMatch>(
107
144
  ],
108
145
  }),
109
146
  defineBehavior({
110
- on: 'insert.text',
147
+ on: 'key.down',
111
148
  guard: ({context, event}) => {
112
- const isEmojiChar = emojiCharRegEx.test(event.text)
113
-
114
- if (!isEmojiChar) {
115
- return {emojis: []}
116
- }
117
-
118
- const focusBlock = selectors.getFocusTextBlock({context})
119
- const textBefore = selectors.getBlockTextBefore({context})
120
- const emojiKeyword = `${textBefore}${event.text}`.match(
121
- incompleteEmojiRegEx,
122
- )?.[1]
149
+ const matches = emojiPickerActor.getSnapshot().context.matches
123
150
 
124
- if (!focusBlock || emojiKeyword === undefined) {
125
- return {emojis: []}
151
+ if (matches.length === 0) {
152
+ return false
126
153
  }
127
154
 
128
- const emojis = config.matchEmojis({keyword: emojiKeyword})
129
-
130
- return {emojis}
131
- },
132
- actions: [
133
- (_, params) => [
134
- {
135
- type: 'effect',
136
- effect: () => {
137
- emojiPickerActor.send({
138
- type: 'emojis found',
139
- matches: params.emojis,
140
- })
141
- },
142
- },
143
- ],
144
- ],
145
- }),
146
- defineBehavior({
147
- on: 'key.down',
148
- guard: ({context, event}) => {
149
155
  const isShift = isHotkey('Shift', event.keyboardEvent)
150
156
  const isColon = event.keyboardEvent.key === ':'
151
157
  const isEmojiChar = emojiCharRegEx.test(event.keyboardEvent.key)
@@ -160,7 +166,6 @@ export function createEmojiPickerBehaviors<TEmojiMatch>(
160
166
  const isTab = isHotkey('Tab', event.keyboardEvent)
161
167
 
162
168
  if (isEnter || isTab) {
163
- const matches = emojiPickerActor.getSnapshot().context.matches
164
169
  const selectedIndex =
165
170
  emojiPickerActor.getSnapshot().context.selectedIndex
166
171
 
@@ -195,11 +200,11 @@ export function createEmojiPickerBehaviors<TEmojiMatch>(
195
200
  return false
196
201
  }
197
202
 
198
- if (isArrowDown) {
203
+ if (isArrowDown && matches.length > 0) {
199
204
  return {action: 'navigate down' as const}
200
205
  }
201
206
 
202
- if (isArrowUp) {
207
+ if (isArrowUp && matches.length > 0) {
203
208
  return {action: 'navigate up' as const}
204
209
  }
205
210
 
@@ -283,6 +288,12 @@ export function createEmojiPickerBehaviors<TEmojiMatch>(
283
288
  return false
284
289
  }
285
290
 
291
+ const matches = emojiPickerActor.getSnapshot().context.matches
292
+
293
+ if (matches.length === 0) {
294
+ return false
295
+ }
296
+
286
297
  const focusBlock = selectors.getFocusTextBlock({context})
287
298
  const textBefore = selectors.getBlockTextBefore({context})
288
299
  const emojiKeyword = textBefore
@@ -290,7 +301,7 @@ export function createEmojiPickerBehaviors<TEmojiMatch>(
290
301
  .match(incompleteEmojiRegEx)?.[1]
291
302
 
292
303
  if (!focusBlock || emojiKeyword === undefined) {
293
- return {emojis: [], event}
304
+ return {emojis: []}
294
305
  }
295
306
 
296
307
  const emojis = config.matchEmojis({keyword: emojiKeyword})
@@ -3,7 +3,7 @@ import * as selectors from '../selectors'
3
3
  import {defineBehavior} from './behavior.types'
4
4
 
5
5
  /**
6
- * @alpha
6
+ * @beta
7
7
  */
8
8
  export type LinkBehaviorsConfig = {
9
9
  linkAnnotation?: (context: {
@@ -13,7 +13,7 @@ export type LinkBehaviorsConfig = {
13
13
  }
14
14
 
15
15
  /**
16
- * @alpha
16
+ * @beta
17
17
  */
18
18
  export function createLinkBehaviors(config: LinkBehaviorsConfig) {
19
19
  const pasteLinkOnSelection = defineBehavior({
@@ -7,7 +7,7 @@ import {getBlockTextBefore} from '../selectors/selector.get-text-before'
7
7
  import {defineBehavior} from './behavior.types'
8
8
 
9
9
  /**
10
- * @alpha
10
+ * @beta
11
11
  */
12
12
  export type MarkdownBehaviorsConfig = {
13
13
  horizontalRuleObject?: (context: {
@@ -24,7 +24,7 @@ export type MarkdownBehaviorsConfig = {
24
24
  }
25
25
 
26
26
  /**
27
- * @alpha
27
+ * @beta
28
28
  */
29
29
  export function createMarkdownBehaviors(config: MarkdownBehaviorsConfig) {
30
30
  const automaticBlockquoteOnSpace = defineBehavior({
@@ -6,7 +6,7 @@ import type {PickFromUnion} from '../type-utils'
6
6
  import type {EditorSelection, PortableTextSlateEditor} from '../types/editor'
7
7
 
8
8
  /**
9
- * @alpha
9
+ * @beta
10
10
  */
11
11
  export type SyntheticBehaviorEvent =
12
12
  | {
@@ -91,7 +91,7 @@ export type SyntheticBehaviorEvent =
91
91
  }
92
92
 
93
93
  /**
94
- * @alpha
94
+ * @beta
95
95
  */
96
96
  export type NativeBehaviorEvent =
97
97
  | {
@@ -118,7 +118,7 @@ export type NativeBehaviorEvent =
118
118
  }
119
119
 
120
120
  /**
121
- * @alpha
121
+ * @beta
122
122
  */
123
123
  export type BehaviorActionIntend =
124
124
  | SyntheticBehaviorEvent
@@ -210,19 +210,19 @@ export type BehaviorActionIntend =
210
210
  }
211
211
 
212
212
  /**
213
- * @alpha
213
+ * @beta
214
214
  */
215
215
  export type BehaviorAction = BehaviorActionIntend & {
216
216
  editor: PortableTextSlateEditor
217
217
  }
218
218
 
219
219
  /**
220
- * @alpha
220
+ * @beta
221
221
  */
222
222
  export type BehaviorEvent = SyntheticBehaviorEvent | NativeBehaviorEvent
223
223
 
224
224
  /**
225
- * @alpha
225
+ * @beta
226
226
  */
227
227
  export type Behavior<
228
228
  TBehaviorEventType extends BehaviorEvent['type'] = BehaviorEvent['type'],
@@ -248,7 +248,7 @@ export type Behavior<
248
248
  }
249
249
 
250
250
  /**
251
- * @alpha
251
+ * @beta
252
252
  */
253
253
  export type BehaviorGuard<
254
254
  TBehaviorEvent extends BehaviorEvent,
@@ -262,7 +262,7 @@ export type BehaviorGuard<
262
262
  }) => TGuardResponse | false
263
263
 
264
264
  /**
265
- * @alpha
265
+ * @beta
266
266
  */
267
267
  export type BehaviorActionIntendSet<
268
268
  TBehaviorEventType extends BehaviorEvent['type'] = BehaviorEvent['type'],
@@ -279,7 +279,7 @@ export type BehaviorActionIntendSet<
279
279
  ) => Array<BehaviorActionIntend>
280
280
 
281
281
  /**
282
- * @alpha
282
+ * @beta
283
283
  */
284
284
  export function defineBehavior<
285
285
  TAnyBehaviorEventType extends BehaviorEvent['type'],
@@ -289,7 +289,7 @@ export function defineBehavior<
289
289
  }
290
290
 
291
291
  /**
292
- * @alpha
292
+ * @beta
293
293
  */
294
294
  export type BlockOffset = {
295
295
  path: [KeyedSegment]
@@ -42,6 +42,7 @@ const debug = debugWithName('component:PortableTextEditor')
42
42
  * Props for the PortableTextEditor component
43
43
  *
44
44
  * @public
45
+ * @deprecated Use `EditorProvider` instead
45
46
  */
46
47
  export type PortableTextEditorProps<
47
48
  TEditor extends Editor | undefined = undefined,
@@ -106,6 +107,7 @@ export type PortableTextEditorProps<
106
107
  /**
107
108
  * The main Portable Text Editor component.
108
109
  * @public
110
+ * @deprecated Use `EditorProvider` instead
109
111
  */
110
112
  export class PortableTextEditor extends Component<
111
113
  PortableTextEditorProps<Editor | undefined>
@@ -169,6 +169,20 @@ describe('Feature: Self-solving', () => {
169
169
  markDefs: [],
170
170
  }),
171
171
  ],
172
+ value: [
173
+ block({
174
+ _key: 'b1',
175
+ children: [
176
+ span({
177
+ _key: 's1',
178
+ text: 'foo',
179
+ marks: ['strong'],
180
+ }),
181
+ ],
182
+ style: 'normal',
183
+ markDefs: [],
184
+ }),
185
+ ],
172
186
  })
173
187
  }
174
188
  })
@@ -51,7 +51,12 @@ export function Synchronizer(props: SynchronizerProps) {
51
51
  }
52
52
  if (event.type === 'mutation') {
53
53
  syncActorRef.send({type: 'mutation'})
54
- editorActor.send(event)
54
+ editorActor.send({
55
+ type: 'mutation',
56
+ patches: event.patches,
57
+ snapshot: event.snapshot,
58
+ value: event.snapshot,
59
+ })
55
60
  }
56
61
  })
57
62
 
@@ -24,13 +24,18 @@ import {
24
24
  type EditorEmittedEvent,
25
25
  type InternalEditorEvent,
26
26
  } from './editor-machine'
27
+ import {getEditorSnapshot} from './editor-selector'
28
+ import type {EditorSnapshot} from './editor-snapshot'
27
29
  import {defaultKeyGenerator} from './key-generator'
28
30
  import {createEditableAPI} from './plugins/createWithEditableAPI'
29
31
 
30
32
  /**
31
- * @alpha
33
+ * @public
32
34
  */
33
35
  export type EditorConfig = {
36
+ /**
37
+ * @beta
38
+ */
34
39
  behaviors?: Array<Behavior>
35
40
  keyGenerator?: () => string
36
41
  /**
@@ -51,7 +56,7 @@ export type EditorConfig = {
51
56
  )
52
57
 
53
58
  /**
54
- * @alpha
59
+ * @public
55
60
  */
56
61
  export type EditorEvent = PickFromUnion<
57
62
  InternalEditorEvent,
@@ -75,9 +80,10 @@ export type EditorEvent = PickFromUnion<
75
80
  >
76
81
 
77
82
  /**
78
- * @alpha
83
+ * @public
79
84
  */
80
85
  export type Editor = {
86
+ getSnapshot: () => EditorSnapshot
81
87
  send: (event: EditorEvent) => void
82
88
  on: ActorRef<Snapshot<unknown>, EventObject, EditorEmittedEvent>['on']
83
89
  _internal: {
@@ -126,6 +132,11 @@ function createEditorFromActor(editorActor: EditorActor): Editor {
126
132
  const editable = createEditableAPI(slateEditor.instance, editorActor)
127
133
 
128
134
  return {
135
+ getSnapshot: () =>
136
+ getEditorSnapshot({
137
+ editorActorSnapshot: editorActor.getSnapshot(),
138
+ slateEditorInstance: slateEditor.instance,
139
+ }),
129
140
  send: (event) => {
130
141
  editorActor.send(event)
131
142
  },
@@ -10,7 +10,7 @@ import type {PortableTextMemberSchemaTypes} from '../types/editor'
10
10
  import {createEditorSchema} from './create-editor-schema'
11
11
 
12
12
  /**
13
- * @alpha
13
+ * @public
14
14
  */
15
15
  export type BaseDefinition = {
16
16
  name: string
@@ -19,7 +19,7 @@ export type BaseDefinition = {
19
19
  }
20
20
 
21
21
  /**
22
- * @alpha
22
+ * @public
23
23
  */
24
24
  export type SchemaDefinition<
25
25
  TBaseDefinition extends BaseDefinition = BaseDefinition,
@@ -33,7 +33,7 @@ export type SchemaDefinition<
33
33
  }
34
34
 
35
35
  /**
36
- * @alpha
36
+ * @public
37
37
  */
38
38
  export function defineSchema<const TSchemaDefinition extends SchemaDefinition>(
39
39
  definition: TSchemaDefinition,
@@ -42,7 +42,7 @@ export function defineSchema<const TSchemaDefinition extends SchemaDefinition>(
42
42
  }
43
43
 
44
44
  /**
45
- * @alpha
45
+ * @public
46
46
  */
47
47
  export type EditorSchema = PortableTextMemberSchemaTypes
48
48
 
@@ -4,7 +4,7 @@ import type {EditorEmittedEvent} from './editor-machine'
4
4
  import {useEditor} from './editor-provider'
5
5
 
6
6
  /**
7
- * @alpha
7
+ * @public
8
8
  */
9
9
  export function EditorEventListener(props: {
10
10
  on: (event: EditorEmittedEvent) => void
@@ -15,7 +15,6 @@ import {coreBehaviors} from '../behaviors/behavior.core'
15
15
  import type {
16
16
  Behavior,
17
17
  BehaviorAction,
18
- BehaviorActionIntend,
19
18
  NativeBehaviorEvent,
20
19
  SyntheticBehaviorEvent,
21
20
  } from '../behaviors/behavior.types'
@@ -59,7 +58,11 @@ export type PatchesEvent = {
59
58
  export type MutationEvent = {
60
59
  type: 'mutation'
61
60
  patches: Array<Patch>
61
+ /**
62
+ * @deprecated Use `value` instead
63
+ */
62
64
  snapshot: Array<PortableTextBlock> | undefined
65
+ value: Array<PortableTextBlock> | undefined
63
66
  }
64
67
 
65
68
  /**
@@ -75,11 +78,6 @@ export type InternalEditorEvent =
75
78
  editor: PortableTextSlateEditor
76
79
  nativeEvent?: {preventDefault: () => void}
77
80
  }
78
- | {
79
- type: 'behavior action intends'
80
- editor: PortableTextSlateEditor
81
- actionIntends: Array<BehaviorActionIntend>
82
- }
83
81
  | {
84
82
  type: 'update readOnly'
85
83
  readOnly: boolean
@@ -107,7 +105,7 @@ export type InternalEditorEvent =
107
105
  >
108
106
 
109
107
  /**
110
- * @alpha
108
+ * @public
111
109
  */
112
110
  export type EditorEmittedEvent = PickFromUnion<
113
111
  InternalEditorEmittedEvent,
@@ -265,11 +263,13 @@ export const editorMachine = setup({
265
263
  return
266
264
  }
267
265
 
268
- enqueue.raise({
269
- type: 'behavior action intends',
270
- editor: event.editor,
271
- actionIntends: [defaultAction],
266
+ Editor.withoutNormalizing(event.editor, () => {
267
+ performAction({
268
+ context,
269
+ action: defaultAction,
270
+ })
272
271
  })
272
+ event.editor.onChange()
273
273
  return
274
274
  }
275
275
 
@@ -324,11 +324,32 @@ export const editorMachine = setup({
324
324
  (actionIntend) => actionIntend.type !== 'effect',
325
325
  ))
326
326
 
327
- enqueue.raise({
328
- type: 'behavior action intends',
329
- editor: event.editor,
330
- actionIntends,
327
+ Editor.withoutNormalizing(event.editor, () => {
328
+ for (const actionIntend of actionIntends) {
329
+ const action = {
330
+ ...actionIntend,
331
+ editor: event.editor,
332
+ }
333
+
334
+ performAction({context, action})
335
+ }
331
336
  })
337
+ event.editor.onChange()
338
+
339
+ if (
340
+ actionIntends.some(
341
+ (actionIntend) => actionIntend.type === 'reselect',
342
+ )
343
+ ) {
344
+ enqueue.raise({
345
+ type: 'selection',
346
+ selection: toPortableTextRange(
347
+ event.editor.children,
348
+ event.editor.selection,
349
+ context.schema,
350
+ ),
351
+ })
352
+ }
332
353
  }
333
354
 
334
355
  if (behaviorOverwritten) {
@@ -342,11 +363,13 @@ export const editorMachine = setup({
342
363
  return
343
364
  }
344
365
 
345
- enqueue.raise({
346
- type: 'behavior action intends',
347
- editor: event.editor,
348
- actionIntends: [defaultAction],
366
+ Editor.withoutNormalizing(event.editor, () => {
367
+ performAction({
368
+ context,
369
+ action: defaultAction,
370
+ })
349
371
  })
372
+ event.editor.onChange()
350
373
  }
351
374
  }),
352
375
  },
@@ -384,39 +407,6 @@ export const editorMachine = setup({
384
407
  'update maxBlocks': {
385
408
  actions: assign({maxBlocks: ({event}) => event.maxBlocks}),
386
409
  },
387
- 'behavior action intends': {
388
- actions: [
389
- ({context, event}) => {
390
- Editor.withoutNormalizing(event.editor, () => {
391
- for (const actionIntend of event.actionIntends) {
392
- const action = {
393
- ...actionIntend,
394
- editor: event.editor,
395
- }
396
-
397
- performAction({context, action})
398
- }
399
- })
400
- event.editor.onChange()
401
- },
402
- enqueueActions(({context, event, enqueue}) => {
403
- if (
404
- event.actionIntends.some(
405
- (actionIntend) => actionIntend.type === 'reselect',
406
- )
407
- ) {
408
- enqueue.raise({
409
- type: 'selection',
410
- selection: toPortableTextRange(
411
- event.editor.children,
412
- event.editor.selection,
413
- context.schema,
414
- ),
415
- })
416
- }
417
- }),
418
- ],
419
- },
420
410
  },
421
411
  type: 'parallel',
422
412
  states: {
@@ -14,7 +14,7 @@ import {
14
14
  const EditorContext = React.createContext<Editor | undefined>(undefined)
15
15
 
16
16
  /**
17
- * @alpha
17
+ * @public
18
18
  */
19
19
  export type EditorProviderProps = {
20
20
  initialConfig: EditorConfig
@@ -22,7 +22,7 @@ export type EditorProviderProps = {
22
22
  }
23
23
 
24
24
  /**
25
- * @alpha
25
+ * @public
26
26
  */
27
27
  export function EditorProvider(props: EditorProviderProps) {
28
28
  const editor = useCreateEditor(props.initialConfig)
@@ -65,7 +65,7 @@ export function EditorProvider(props: EditorProviderProps) {
65
65
  }
66
66
 
67
67
  /**
68
- * @alpha
68
+ * @public
69
69
  */
70
70
  export function useEditor() {
71
71
  const editor = React.useContext(EditorContext)