@portabletext/editor 1.45.3 → 1.45.4
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.
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/editor-provider.cjs +57 -57
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/editor-provider.js +57 -57
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/behaviors/index.d.cts +26 -36
- package/lib/behaviors/index.d.ts +26 -36
- package/lib/index.d.cts +26 -36
- package/lib/index.d.ts +26 -36
- package/lib/plugins/index.d.cts +26 -36
- package/lib/plugins/index.d.ts +26 -36
- package/lib/selectors/index.d.cts +26 -36
- package/lib/selectors/index.d.ts +26 -36
- package/lib/utils/index.d.cts +26 -36
- package/lib/utils/index.d.ts +26 -36
- package/package.json +1 -1
- package/src/behaviors/behavior.perform-event.ts +14 -16
- package/src/behaviors/behavior.types.action.ts +1 -6
- package/src/behaviors/behavior.types.guard.ts +1 -6
- package/src/editor/components/Synchronizer.tsx +6 -3
- package/src/editor/create-editor.ts +1 -1
- package/src/editor/editor-machine.ts +6 -4
|
@@ -213,7 +213,7 @@ export const editorMachine = setup({
|
|
|
213
213
|
initialReadOnly: boolean
|
|
214
214
|
maxBlocks: number | undefined
|
|
215
215
|
selection: EditorSelection
|
|
216
|
-
|
|
216
|
+
incomingValue: Array<PortableTextBlock> | undefined
|
|
217
217
|
internalDrag?: {
|
|
218
218
|
ghost?: HTMLElement
|
|
219
219
|
origin: Pick<EventPosition, 'selection'>
|
|
@@ -228,7 +228,7 @@ export const editorMachine = setup({
|
|
|
228
228
|
maxBlocks?: number
|
|
229
229
|
readOnly?: boolean
|
|
230
230
|
schema: EditorSchema
|
|
231
|
-
|
|
231
|
+
initialValue?: Array<PortableTextBlock>
|
|
232
232
|
},
|
|
233
233
|
tags: {} as 'dragging internally',
|
|
234
234
|
},
|
|
@@ -331,7 +331,7 @@ export const editorMachine = setup({
|
|
|
331
331
|
selection: null,
|
|
332
332
|
initialReadOnly: input.readOnly ?? false,
|
|
333
333
|
maxBlocks: input.maxBlocks,
|
|
334
|
-
|
|
334
|
+
incomingValue: input.initialValue,
|
|
335
335
|
}),
|
|
336
336
|
on: {
|
|
337
337
|
'notify.blurred': {
|
|
@@ -365,7 +365,9 @@ export const editorMachine = setup({
|
|
|
365
365
|
actions: assign({keyGenerator: ({event}) => event.keyGenerator}),
|
|
366
366
|
},
|
|
367
367
|
'update schema': {actions: 'assign schema'},
|
|
368
|
-
'update value': {
|
|
368
|
+
'update value': {
|
|
369
|
+
actions: assign({incomingValue: ({event}) => event.value}),
|
|
370
|
+
},
|
|
369
371
|
'update maxBlocks': {
|
|
370
372
|
actions: assign({maxBlocks: ({event}) => event.maxBlocks}),
|
|
371
373
|
},
|