@portabletext/editor 1.36.5 → 1.37.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 (46) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  2. package/lib/_chunks-cjs/behavior.markdown.cjs +1 -1
  3. package/lib/_chunks-cjs/editor-provider.cjs +104 -7
  4. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  5. package/lib/_chunks-cjs/util.block-offsets-to-selection.cjs.map +1 -1
  6. package/lib/_chunks-es/behavior.core.js.map +1 -1
  7. package/lib/_chunks-es/behavior.markdown.js +1 -1
  8. package/lib/_chunks-es/editor-provider.js +108 -11
  9. package/lib/_chunks-es/editor-provider.js.map +1 -1
  10. package/lib/_chunks-es/util.block-offsets-to-selection.js.map +1 -1
  11. package/lib/behaviors/index.d.cts +59 -0
  12. package/lib/behaviors/index.d.ts +59 -0
  13. package/lib/index.d.cts +59 -0
  14. package/lib/index.d.ts +59 -0
  15. package/lib/plugins/index.cjs +1 -1
  16. package/lib/plugins/index.d.cts +59 -0
  17. package/lib/plugins/index.d.ts +59 -0
  18. package/lib/plugins/index.js +1 -1
  19. package/lib/selectors/index.cjs +69 -14
  20. package/lib/selectors/index.cjs.map +1 -1
  21. package/lib/selectors/index.d.cts +75 -0
  22. package/lib/selectors/index.d.ts +75 -0
  23. package/lib/selectors/index.js +63 -8
  24. package/lib/selectors/index.js.map +1 -1
  25. package/lib/utils/index.d.cts +59 -0
  26. package/lib/utils/index.d.ts +59 -0
  27. package/package.json +7 -7
  28. package/src/behavior-actions/behavior.action.decorator.add.ts +1 -0
  29. package/src/behavior-actions/behavior.action.delete.text.ts +1 -0
  30. package/src/behavior-actions/behavior.action.delete.ts +1 -3
  31. package/src/behavior-actions/behavior.action.insert-blocks.ts +98 -2
  32. package/src/behavior-actions/behavior.actions.ts +1 -0
  33. package/src/behaviors/behavior.default.ts +1 -0
  34. package/src/behaviors/behavior.types.ts +1 -0
  35. package/src/editor/editor-machine.ts +16 -3
  36. package/src/editor/editor-selector.ts +1 -0
  37. package/src/editor/editor-snapshot.ts +4 -0
  38. package/src/internal-utils/create-test-snapshot.ts +1 -0
  39. package/src/internal-utils/parse-blocks.ts +22 -0
  40. package/src/selectors/index.ts +2 -0
  41. package/src/selectors/selector.get-focus-inline-object.ts +21 -0
  42. package/src/selectors/selector.is-overlapping-selection.test.ts +171 -0
  43. package/src/selectors/selector.is-overlapping-selection.ts +108 -4
  44. package/src/selectors/selector.is-point-after-selection.ts +3 -1
  45. package/src/selectors/selector.is-point-before-selection.ts +3 -1
  46. package/src/selectors/selector.is-selecting-entire-blocks.ts +34 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/selectors/selector.get-active-annotations.ts","../../src/selectors/selector.get-anchor-block.ts","../../src/selectors/selector.get-anchor-text-block.ts","../../src/selectors/selector.get-anchor-child.ts","../../src/selectors/selector.get-anchor-span.ts","../../src/selectors/selector.get-block-offsets.ts","../../src/selectors/selector.get-selection.ts","../../src/selectors/selector.get-value.ts","../../src/selectors/selector.is-point-after-selection.ts","../../src/selectors/selector.is-point-before-selection.ts","../../src/selectors/selector.is-overlapping-selection.ts"],"sourcesContent":["import {isPortableTextTextBlock, type PortableTextObject} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getSelectedSpans} from './selector.get-selected-spans'\nimport {getSelectedBlocks} from './selectors'\n\n/**\n * @public\n */\nexport const getActiveAnnotations: EditorSelector<Array<PortableTextObject>> = (\n snapshot,\n) => {\n if (!snapshot.context.selection) {\n return []\n }\n\n const selectedBlocks = getSelectedBlocks(snapshot)\n const selectedSpans = getSelectedSpans(snapshot)\n\n if (selectedSpans.length === 0) {\n return []\n }\n\n const selectionMarkDefs = selectedBlocks.flatMap((block) =>\n isPortableTextTextBlock(block.node) ? (block.node.markDefs ?? []) : [],\n )\n\n return selectionMarkDefs.filter((markDef) =>\n selectedSpans.some((span) => span.node.marks?.includes(markDef._key)),\n )\n}\n","import type {KeyedSegment, PortableTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {isKeyedSegment} from '../utils'\n\n/**\n * @public\n */\nexport const getAnchorBlock: EditorSelector<\n {node: PortableTextBlock; path: [KeyedSegment]} | undefined\n> = (snapshot) => {\n const key = snapshot.context.selection\n ? isKeyedSegment(snapshot.context.selection.anchor.path[0])\n ? snapshot.context.selection.anchor.path[0]._key\n : undefined\n : undefined\n\n const node = key\n ? snapshot.context.value.find((block) => block._key === key)\n : undefined\n\n return node && key ? {node, path: [{_key: key}]} : undefined\n}\n","import {\n isPortableTextTextBlock,\n type KeyedSegment,\n type PortableTextTextBlock,\n} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getAnchorBlock} from './selector.get-anchor-block'\n\n/**\n * @public\n */\nexport const getAnchorTextBlock: EditorSelector<\n {node: PortableTextTextBlock; path: [KeyedSegment]} | undefined\n> = (snapshot) => {\n const anchorBlock = getAnchorBlock(snapshot)\n\n return anchorBlock && isPortableTextTextBlock(anchorBlock.node)\n ? {node: anchorBlock.node, path: anchorBlock.path}\n : undefined\n}\n","import type {KeyedSegment} from '@portabletext/patches'\nimport type {PortableTextObject, PortableTextSpan} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {isKeyedSegment} from '../utils'\nimport {getAnchorTextBlock} from './selector.get-anchor-text-block'\n\n/**\n * @public\n */\nexport const getAnchorChild: EditorSelector<\n | {\n node: PortableTextObject | PortableTextSpan\n path: [KeyedSegment, 'children', KeyedSegment]\n }\n | undefined\n> = (snapshot) => {\n const anchorBlock = getAnchorTextBlock(snapshot)\n\n if (!anchorBlock) {\n return undefined\n }\n\n const key = snapshot.context.selection\n ? isKeyedSegment(snapshot.context.selection.anchor.path[2])\n ? snapshot.context.selection.anchor.path[2]._key\n : undefined\n : undefined\n\n const node = key\n ? anchorBlock.node.children.find((span) => span._key === key)\n : undefined\n\n return node && key\n ? {node, path: [...anchorBlock.path, 'children', {_key: key}]}\n : undefined\n}\n","import type {KeyedSegment} from '@portabletext/patches'\nimport {isPortableTextSpan, type PortableTextSpan} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getAnchorChild} from './selector.get-anchor-child'\n\n/**\n * @public\n */\nexport const getAnchorSpan: EditorSelector<\n | {node: PortableTextSpan; path: [KeyedSegment, 'children', KeyedSegment]}\n | undefined\n> = (snapshot) => {\n const anchorChild = getAnchorChild(snapshot)\n\n return anchorChild && isPortableTextSpan(anchorChild.node)\n ? {node: anchorChild.node, path: anchorChild.path}\n : undefined\n}\n","import type {EditorSelector} from '../editor/editor-selector'\nimport type {BlockOffset} from '../types/block-offset'\nimport * as utils from '../utils'\nimport {getSelectionEndPoint} from './selector.get-selection-end-point'\nimport {getSelectionStartPoint} from './selector.get-selection-start-point'\n\n/**\n * @public\n */\nexport const getBlockOffsets: EditorSelector<\n {start: BlockOffset; end: BlockOffset} | undefined\n> = (snapshot) => {\n if (!snapshot.context.selection) {\n return undefined\n }\n\n const selectionStartPoint = getSelectionStartPoint(snapshot)\n const selectionEndPoint = getSelectionEndPoint(snapshot)\n\n if (!selectionStartPoint || !selectionEndPoint) {\n return undefined\n }\n\n const start = utils.spanSelectionPointToBlockOffset({\n value: snapshot.context.value,\n selectionPoint: selectionStartPoint,\n })\n const end = utils.spanSelectionPointToBlockOffset({\n value: snapshot.context.value,\n selectionPoint: selectionEndPoint,\n })\n\n return start && end ? {start, end} : undefined\n}\n","import type {EditorSelection} from '..'\nimport type {EditorSelector} from '../editor/editor-selector'\n\n/**\n * @public\n */\nexport const getSelection: EditorSelector<EditorSelection> = (snapshot) => {\n return snapshot.context.selection\n}\n","import type {PortableTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\n\n/**\n * @public\n */\nexport const getValue: EditorSelector<Array<PortableTextBlock>> = (\n snapshot,\n) => {\n return snapshot.context.value\n}\n","import {isKeySegment, isPortableTextTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport type {EditorSelectionPoint} from '../types/editor'\nimport {reverseSelection} from '../utils/util.reverse-selection'\n\n/**\n * @public\n */\nexport function isPointAfterSelection(\n point: EditorSelectionPoint,\n): EditorSelector<boolean> {\n return (snapshot) => {\n if (!snapshot.context.selection) {\n return false\n }\n\n const selection = reverseSelection(snapshot.context.selection)\n\n const pointBlockKey = isKeySegment(point.path[0])\n ? point.path[0]._key\n : undefined\n const pointChildKey = isKeySegment(point.path[2])\n ? point.path[2]._key\n : undefined\n\n const endBlockKey = isKeySegment(selection.focus.path[0])\n ? selection.focus.path[0]._key\n : undefined\n const endChildKey = isKeySegment(selection.focus.path[2])\n ? selection.focus.path[2]._key\n : undefined\n\n if (!pointBlockKey || !endBlockKey) {\n return false\n }\n\n let after = false\n\n for (const block of snapshot.context.value) {\n if (block._key === endBlockKey) {\n if (block._key !== pointBlockKey) {\n after = true\n break\n }\n\n // Both the point and the selection end in this block\n\n if (!isPortableTextTextBlock(block)) {\n break\n }\n\n if (!pointChildKey || !endChildKey) {\n break\n }\n\n for (const child of block.children) {\n if (child._key === endChildKey) {\n if (child._key !== pointChildKey) {\n after = true\n break\n }\n\n // Both the point and the selection end in this child\n\n after = point.offset > selection.focus.offset\n break\n }\n\n if (child._key === pointChildKey) {\n break\n }\n }\n }\n\n if (block._key === pointBlockKey) {\n break\n }\n }\n\n return after\n }\n}\n","import {isKeySegment, isPortableTextTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport type {EditorSelectionPoint} from '../types/editor'\nimport {reverseSelection} from '../utils/util.reverse-selection'\n\n/**\n * @public\n */\nexport function isPointBeforeSelection(\n point: EditorSelectionPoint,\n): EditorSelector<boolean> {\n return (snapshot) => {\n if (!snapshot.context.selection) {\n return false\n }\n\n const selection = reverseSelection(snapshot.context.selection)\n\n const pointBlockKey = isKeySegment(point.path[0])\n ? point.path[0]._key\n : undefined\n const pointChildKey = isKeySegment(point.path[2])\n ? point.path[2]._key\n : undefined\n\n const startBlockKey = isKeySegment(selection.anchor.path[0])\n ? selection.anchor.path[0]._key\n : undefined\n const startChildKey = isKeySegment(selection.anchor.path[2])\n ? selection.anchor.path[2]._key\n : undefined\n\n if (!pointBlockKey || !startBlockKey) {\n return false\n }\n\n let before = false\n\n for (const block of snapshot.context.value) {\n if (block._key === pointBlockKey) {\n if (block._key !== startBlockKey) {\n before = true\n break\n }\n\n // Both the point and the selection start in this block\n\n if (!isPortableTextTextBlock(block)) {\n break\n }\n\n if (!pointChildKey || !startChildKey) {\n break\n }\n\n for (const child of block.children) {\n if (child._key === pointChildKey) {\n if (child._key !== startChildKey) {\n before = true\n break\n }\n\n // Both the point and the selection start in this child\n\n before = point.offset < selection.anchor.offset\n break\n }\n\n if (child._key === startChildKey) {\n break\n }\n }\n }\n\n if (block._key === startBlockKey) {\n break\n }\n }\n\n return before\n }\n}\n","import type {EditorSelection} from '../types/editor'\nimport type {EditorSelector} from './../editor/editor-selector'\nimport {getSelectionEndPoint} from './selector.get-selection-end-point'\nimport {getSelectionStartPoint} from './selector.get-selection-start-point'\nimport {isPointAfterSelection} from './selector.is-point-after-selection'\nimport {isPointBeforeSelection} from './selector.is-point-before-selection'\n\n/**\n * @public\n */\nexport function isOverlappingSelection(\n selection: EditorSelection,\n): EditorSelector<boolean> {\n return (snapshot) => {\n if (!selection || !snapshot.context.selection) {\n return false\n }\n\n const selectionStartPoint = getSelectionStartPoint({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection,\n },\n })\n const selectionEndPoint = getSelectionEndPoint({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection,\n },\n })\n\n if (!selectionStartPoint || !selectionEndPoint) {\n return false\n }\n\n if (!isPointAfterSelection(selectionStartPoint)(snapshot)) {\n return false\n }\n\n if (!isPointBeforeSelection(selectionEndPoint)(snapshot)) {\n return false\n }\n\n return true\n }\n}\n"],"names":["getActiveAnnotations","snapshot","context","selection","selectedBlocks","getSelectedBlocks","selectedSpans","getSelectedSpans","length","flatMap","block","isPortableTextTextBlock","node","markDefs","filter","markDef","some","span","marks","includes","_key","getAnchorBlock","key","isKeyedSegment","anchor","path","undefined","value","find","getAnchorTextBlock","anchorBlock","getAnchorChild","children","getAnchorSpan","anchorChild","isPortableTextSpan","getBlockOffsets","selectionStartPoint","getSelectionStartPoint","selectionEndPoint","getSelectionEndPoint","start","utils","selectionPoint","end","getSelection","getValue","isPointAfterSelection","point","reverseSelection","pointBlockKey","isKeySegment","pointChildKey","endBlockKey","focus","endChildKey","after","child","offset","isPointBeforeSelection","startBlockKey","startChildKey","before","isOverlappingSelection"],"mappings":";;;AAQO,MAAMA,uBACXC,CACG,aAAA;AACC,MAAA,CAACA,SAASC,QAAQC;AACpB,WAAO,CAAE;AAGX,QAAMC,iBAAiBC,6BAAAA,kBAAkBJ,QAAQ,GAC3CK,gBAAgBC,wCAAiBN,QAAQ;AAE/C,SAAIK,cAAcE,WAAW,IACpB,KAGiBJ,eAAeK,QAASC,CAChDC,UAAAA,MAAAA,wBAAwBD,MAAME,IAAI,IAAKF,MAAME,KAAKC,YAAY,CAAM,IAAA,CACtE,CAAA,EAEyBC,OAAQC,CAAAA,YAC/BT,cAAcU,KAAMC,CAAAA,SAASA,KAAKL,KAAKM,OAAOC,SAASJ,QAAQK,IAAI,CAAC,CACtE;AACF,GCtBaC,iBAERpB,CAAa,aAAA;AAChB,QAAMqB,MAAMrB,SAASC,QAAQC,aACzBoB,iBAAAA,eAAetB,SAASC,QAAQC,UAAUqB,OAAOC,KAAK,CAAC,CAAC,IACtDxB,SAASC,QAAQC,UAAUqB,OAAOC,KAAK,CAAC,EAAEL,OAE5CM,QAEEd,OAAOU,MACTrB,SAASC,QAAQyB,MAAMC,KAAMlB,CAAAA,UAAUA,MAAMU,SAASE,GAAG,IACzDI;AAEJ,SAAOd,QAAQU,MAAM;AAAA,IAACV;AAAAA,IAAMa,MAAM,CAAC;AAAA,MAACL,MAAME;AAAAA,IAAI,CAAA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UAAU;AAC9ByB,cAAAA,MAAMrC,SAASgC,eAAe;AAC5BK,gBAAAA,MAAMrC,SAASyC,eAAe;AACvB,uBAAA;AACT;AAAA,YAAA;AAKOb,qBAAAA,MAAMU,SAASvD,UAAUqB,OAAOkC;AACzC;AAAA,UAAA;AAGF,cAAID,MAAMrC,SAASyC;AACjB;AAAA,QAAA;AAAA,MAEJ;AAGF,UAAInD,MAAMU,SAASwC;AACjB;AAAA,IAAA;AAIGE,WAAAA;AAAAA,EACT;AACF;ACvEO,SAASC,uBACd5D,WACyB;AACzB,SAAQF,CAAa,aAAA;AACnB,QAAI,CAACE,aAAa,CAACF,SAASC,QAAQC;AAC3B,aAAA;AAGT,UAAMkC,sBAAsBC,6BAAAA,uBAAuB;AAAA,MACjD,GAAGrC;AAAAA,MACHC,SAAS;AAAA,QACP,GAAGD,SAASC;AAAAA,QACZC;AAAAA,MAAAA;AAAAA,IACF,CACD,GACKoC,oBAAoBC,kDAAqB;AAAA,MAC7C,GAAGvC;AAAAA,MACHC,SAAS;AAAA,QACP,GAAGD,SAASC;AAAAA,QACZC;AAAAA,MAAAA;AAAAA,IACF,CACD;AAUD,WARI,EAACkC,CAAAA,uBAAuB,CAACE,qBAIzB,CAACQ,sBAAsBV,mBAAmB,EAAEpC,QAAQ,KAIpD,CAAC0D,uBAAuBpB,iBAAiB,EAAEtC,QAAQ;AAAA,EAKzD;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/selectors/selector.is-selecting-entire-blocks.ts","../../src/selectors/selector.get-active-annotations.ts","../../src/selectors/selector.get-anchor-block.ts","../../src/selectors/selector.get-anchor-text-block.ts","../../src/selectors/selector.get-anchor-child.ts","../../src/selectors/selector.get-anchor-span.ts","../../src/selectors/selector.get-block-offsets.ts","../../src/selectors/selector.get-focus-inline-object.ts","../../src/selectors/selector.get-selection.ts","../../src/selectors/selector.get-value.ts","../../src/selectors/selector.is-point-after-selection.ts","../../src/selectors/selector.is-point-before-selection.ts","../../src/selectors/selector.is-overlapping-selection.ts"],"sourcesContent":["import type {EditorSelector} from '../editor/editor-selector'\nimport * as utils from '../utils'\nimport {getSelectionEndBlock, getSelectionStartBlock} from './selectors'\n\n/**\n * @public\n */\nexport const isSelectingEntireBlocks: EditorSelector<boolean> = (snapshot) => {\n if (!snapshot.context.selection) {\n return false\n }\n\n const startPoint = snapshot.context.selection.backward\n ? snapshot.context.selection.focus\n : snapshot.context.selection.anchor\n const endPoint = snapshot.context.selection.backward\n ? snapshot.context.selection.anchor\n : snapshot.context.selection.focus\n\n const startBlock = getSelectionStartBlock(snapshot)\n const endBlock = getSelectionEndBlock(snapshot)\n\n if (!startBlock || !endBlock) {\n return false\n }\n\n const startBlockStartPoint = utils.getBlockStartPoint(startBlock)\n const endBlockEndPoint = utils.getBlockEndPoint(endBlock)\n\n return (\n utils.isEqualSelectionPoints(startBlockStartPoint, startPoint) &&\n utils.isEqualSelectionPoints(endBlockEndPoint, endPoint)\n )\n}\n","import {isPortableTextTextBlock, type PortableTextObject} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getSelectedSpans} from './selector.get-selected-spans'\nimport {getSelectedBlocks} from './selectors'\n\n/**\n * @public\n */\nexport const getActiveAnnotations: EditorSelector<Array<PortableTextObject>> = (\n snapshot,\n) => {\n if (!snapshot.context.selection) {\n return []\n }\n\n const selectedBlocks = getSelectedBlocks(snapshot)\n const selectedSpans = getSelectedSpans(snapshot)\n\n if (selectedSpans.length === 0) {\n return []\n }\n\n const selectionMarkDefs = selectedBlocks.flatMap((block) =>\n isPortableTextTextBlock(block.node) ? (block.node.markDefs ?? []) : [],\n )\n\n return selectionMarkDefs.filter((markDef) =>\n selectedSpans.some((span) => span.node.marks?.includes(markDef._key)),\n )\n}\n","import type {KeyedSegment, PortableTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {isKeyedSegment} from '../utils'\n\n/**\n * @public\n */\nexport const getAnchorBlock: EditorSelector<\n {node: PortableTextBlock; path: [KeyedSegment]} | undefined\n> = (snapshot) => {\n const key = snapshot.context.selection\n ? isKeyedSegment(snapshot.context.selection.anchor.path[0])\n ? snapshot.context.selection.anchor.path[0]._key\n : undefined\n : undefined\n\n const node = key\n ? snapshot.context.value.find((block) => block._key === key)\n : undefined\n\n return node && key ? {node, path: [{_key: key}]} : undefined\n}\n","import {\n isPortableTextTextBlock,\n type KeyedSegment,\n type PortableTextTextBlock,\n} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getAnchorBlock} from './selector.get-anchor-block'\n\n/**\n * @public\n */\nexport const getAnchorTextBlock: EditorSelector<\n {node: PortableTextTextBlock; path: [KeyedSegment]} | undefined\n> = (snapshot) => {\n const anchorBlock = getAnchorBlock(snapshot)\n\n return anchorBlock && isPortableTextTextBlock(anchorBlock.node)\n ? {node: anchorBlock.node, path: anchorBlock.path}\n : undefined\n}\n","import type {KeyedSegment} from '@portabletext/patches'\nimport type {PortableTextObject, PortableTextSpan} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {isKeyedSegment} from '../utils'\nimport {getAnchorTextBlock} from './selector.get-anchor-text-block'\n\n/**\n * @public\n */\nexport const getAnchorChild: EditorSelector<\n | {\n node: PortableTextObject | PortableTextSpan\n path: [KeyedSegment, 'children', KeyedSegment]\n }\n | undefined\n> = (snapshot) => {\n const anchorBlock = getAnchorTextBlock(snapshot)\n\n if (!anchorBlock) {\n return undefined\n }\n\n const key = snapshot.context.selection\n ? isKeyedSegment(snapshot.context.selection.anchor.path[2])\n ? snapshot.context.selection.anchor.path[2]._key\n : undefined\n : undefined\n\n const node = key\n ? anchorBlock.node.children.find((span) => span._key === key)\n : undefined\n\n return node && key\n ? {node, path: [...anchorBlock.path, 'children', {_key: key}]}\n : undefined\n}\n","import type {KeyedSegment} from '@portabletext/patches'\nimport {isPortableTextSpan, type PortableTextSpan} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getAnchorChild} from './selector.get-anchor-child'\n\n/**\n * @public\n */\nexport const getAnchorSpan: EditorSelector<\n | {node: PortableTextSpan; path: [KeyedSegment, 'children', KeyedSegment]}\n | undefined\n> = (snapshot) => {\n const anchorChild = getAnchorChild(snapshot)\n\n return anchorChild && isPortableTextSpan(anchorChild.node)\n ? {node: anchorChild.node, path: anchorChild.path}\n : undefined\n}\n","import type {EditorSelector} from '../editor/editor-selector'\nimport type {BlockOffset} from '../types/block-offset'\nimport * as utils from '../utils'\nimport {getSelectionEndPoint} from './selector.get-selection-end-point'\nimport {getSelectionStartPoint} from './selector.get-selection-start-point'\n\n/**\n * @public\n */\nexport const getBlockOffsets: EditorSelector<\n {start: BlockOffset; end: BlockOffset} | undefined\n> = (snapshot) => {\n if (!snapshot.context.selection) {\n return undefined\n }\n\n const selectionStartPoint = getSelectionStartPoint(snapshot)\n const selectionEndPoint = getSelectionEndPoint(snapshot)\n\n if (!selectionStartPoint || !selectionEndPoint) {\n return undefined\n }\n\n const start = utils.spanSelectionPointToBlockOffset({\n value: snapshot.context.value,\n selectionPoint: selectionStartPoint,\n })\n const end = utils.spanSelectionPointToBlockOffset({\n value: snapshot.context.value,\n selectionPoint: selectionEndPoint,\n })\n\n return start && end ? {start, end} : undefined\n}\n","import {\n isPortableTextSpan,\n type KeyedSegment,\n type PortableTextObject,\n} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport {getFocusChild} from './selectors'\n\n/**\n * @public\n */\nexport const getFocusInlineObject: EditorSelector<\n | {node: PortableTextObject; path: [KeyedSegment, 'children', KeyedSegment]}\n | undefined\n> = (snapshot) => {\n const focusChild = getFocusChild(snapshot)\n\n return focusChild && !isPortableTextSpan(focusChild.node)\n ? {node: focusChild.node, path: focusChild.path}\n : undefined\n}\n","import type {EditorSelection} from '..'\nimport type {EditorSelector} from '../editor/editor-selector'\n\n/**\n * @public\n */\nexport const getSelection: EditorSelector<EditorSelection> = (snapshot) => {\n return snapshot.context.selection\n}\n","import type {PortableTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\n\n/**\n * @public\n */\nexport const getValue: EditorSelector<Array<PortableTextBlock>> = (\n snapshot,\n) => {\n return snapshot.context.value\n}\n","import {isKeySegment, isPortableTextTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport type {EditorSelectionPoint} from '../types/editor'\nimport {reverseSelection} from '../utils/util.reverse-selection'\n\n/**\n * @public\n */\nexport function isPointAfterSelection(\n point: EditorSelectionPoint,\n): EditorSelector<boolean> {\n return (snapshot) => {\n if (!snapshot.context.selection) {\n return false\n }\n\n const selection = snapshot.context.selection.backward\n ? reverseSelection(snapshot.context.selection)\n : snapshot.context.selection\n\n const pointBlockKey = isKeySegment(point.path[0])\n ? point.path[0]._key\n : undefined\n const pointChildKey = isKeySegment(point.path[2])\n ? point.path[2]._key\n : undefined\n\n const endBlockKey = isKeySegment(selection.focus.path[0])\n ? selection.focus.path[0]._key\n : undefined\n const endChildKey = isKeySegment(selection.focus.path[2])\n ? selection.focus.path[2]._key\n : undefined\n\n if (!pointBlockKey || !endBlockKey) {\n return false\n }\n\n let after = false\n\n for (const block of snapshot.context.value) {\n if (block._key === endBlockKey) {\n if (block._key !== pointBlockKey) {\n after = true\n break\n }\n\n // Both the point and the selection end in this block\n\n if (!isPortableTextTextBlock(block)) {\n break\n }\n\n if (!pointChildKey || !endChildKey) {\n break\n }\n\n for (const child of block.children) {\n if (child._key === endChildKey) {\n if (child._key !== pointChildKey) {\n after = true\n break\n }\n\n // Both the point and the selection end in this child\n\n after = point.offset > selection.focus.offset\n break\n }\n\n if (child._key === pointChildKey) {\n break\n }\n }\n }\n\n if (block._key === pointBlockKey) {\n break\n }\n }\n\n return after\n }\n}\n","import {isKeySegment, isPortableTextTextBlock} from '@sanity/types'\nimport type {EditorSelector} from '../editor/editor-selector'\nimport type {EditorSelectionPoint} from '../types/editor'\nimport {reverseSelection} from '../utils/util.reverse-selection'\n\n/**\n * @public\n */\nexport function isPointBeforeSelection(\n point: EditorSelectionPoint,\n): EditorSelector<boolean> {\n return (snapshot) => {\n if (!snapshot.context.selection) {\n return false\n }\n\n const selection = snapshot.context.selection.backward\n ? reverseSelection(snapshot.context.selection)\n : snapshot.context.selection\n\n const pointBlockKey = isKeySegment(point.path[0])\n ? point.path[0]._key\n : undefined\n const pointChildKey = isKeySegment(point.path[2])\n ? point.path[2]._key\n : undefined\n\n const startBlockKey = isKeySegment(selection.anchor.path[0])\n ? selection.anchor.path[0]._key\n : undefined\n const startChildKey = isKeySegment(selection.anchor.path[2])\n ? selection.anchor.path[2]._key\n : undefined\n\n if (!pointBlockKey || !startBlockKey) {\n return false\n }\n\n let before = false\n\n for (const block of snapshot.context.value) {\n if (block._key === pointBlockKey) {\n if (block._key !== startBlockKey) {\n before = true\n break\n }\n\n // Both the point and the selection start in this block\n\n if (!isPortableTextTextBlock(block)) {\n break\n }\n\n if (!pointChildKey || !startChildKey) {\n break\n }\n\n for (const child of block.children) {\n if (child._key === pointChildKey) {\n if (child._key !== startChildKey) {\n before = true\n break\n }\n\n // Both the point and the selection start in this child\n\n before = point.offset < selection.anchor.offset\n break\n }\n\n if (child._key === startChildKey) {\n break\n }\n }\n }\n\n if (block._key === startBlockKey) {\n break\n }\n }\n\n return before\n }\n}\n","import type {EditorSelection} from '../types/editor'\nimport {isEqualSelectionPoints} from '../utils'\nimport type {EditorSelector} from './../editor/editor-selector'\nimport {getSelectionEndPoint} from './selector.get-selection-end-point'\nimport {getSelectionStartPoint} from './selector.get-selection-start-point'\nimport {isPointAfterSelection} from './selector.is-point-after-selection'\nimport {isPointBeforeSelection} from './selector.is-point-before-selection'\n\n/**\n * @public\n */\nexport function isOverlappingSelection(\n selection: EditorSelection,\n): EditorSelector<boolean> {\n return (snapshot) => {\n if (!selection || !snapshot.context.selection) {\n return false\n }\n\n const selectionStartPoint = getSelectionStartPoint({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection,\n },\n })\n const selectionEndPoint = getSelectionEndPoint({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection,\n },\n })\n\n const originalSelectionStartPoint = getSelectionStartPoint(snapshot)\n const originalSelectionEndPoint = getSelectionEndPoint(snapshot)\n\n if (\n !selectionStartPoint ||\n !selectionEndPoint ||\n !originalSelectionStartPoint ||\n !originalSelectionEndPoint\n ) {\n return false\n }\n\n const startPointBeforeSelection =\n isPointBeforeSelection(selectionStartPoint)(snapshot)\n const startPointAfterSelection =\n isPointAfterSelection(selectionStartPoint)(snapshot)\n const endPointBeforeSelection =\n isPointBeforeSelection(selectionEndPoint)(snapshot)\n const endPointAfterSelection =\n isPointAfterSelection(selectionEndPoint)(snapshot)\n\n const originalStartPointBeforeStartPoint = isPointBeforeSelection(\n originalSelectionStartPoint,\n )({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection: {\n anchor: selectionStartPoint,\n focus: selectionStartPoint,\n },\n },\n })\n const originalStartPointAfterStartPoint = isPointAfterSelection(\n originalSelectionStartPoint,\n )({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection: {\n anchor: selectionStartPoint,\n focus: selectionStartPoint,\n },\n },\n })\n\n const originalEndPointBeforeEndPoint = isPointBeforeSelection(\n originalSelectionEndPoint,\n )({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection: {\n anchor: selectionEndPoint,\n focus: selectionEndPoint,\n },\n },\n })\n const originalEndPointAfterEndPoint = isPointAfterSelection(\n originalSelectionEndPoint,\n )({\n ...snapshot,\n context: {\n ...snapshot.context,\n selection: {\n anchor: selectionEndPoint,\n focus: selectionEndPoint,\n },\n },\n })\n\n const endPointEqualToOriginalStartPoint = isEqualSelectionPoints(\n selectionEndPoint,\n originalSelectionStartPoint,\n )\n const startPointEqualToOriginalEndPoint = isEqualSelectionPoints(\n selectionStartPoint,\n originalSelectionEndPoint,\n )\n\n if (endPointBeforeSelection && !endPointEqualToOriginalStartPoint) {\n return false\n }\n\n if (startPointAfterSelection && !startPointEqualToOriginalEndPoint) {\n return false\n }\n\n if (\n !originalStartPointBeforeStartPoint &&\n originalStartPointAfterStartPoint &&\n !originalEndPointBeforeEndPoint &&\n originalEndPointAfterEndPoint\n ) {\n return !endPointEqualToOriginalStartPoint\n }\n\n if (\n originalStartPointBeforeStartPoint &&\n !originalStartPointAfterStartPoint &&\n originalEndPointBeforeEndPoint &&\n !originalEndPointAfterEndPoint\n ) {\n return !startPointEqualToOriginalEndPoint\n }\n\n if (\n !startPointAfterSelection ||\n !startPointBeforeSelection ||\n !endPointAfterSelection ||\n !endPointBeforeSelection\n ) {\n return true\n }\n\n return false\n }\n}\n"],"names":["isSelectingEntireBlocks","snapshot","context","selection","startPoint","backward","focus","anchor","endPoint","startBlock","getSelectionStartBlock","endBlock","getSelectionEndBlock","startBlockStartPoint","utils","endBlockEndPoint","isEqualSelectionPoints","getActiveAnnotations","selectedBlocks","getSelectedBlocks","selectedSpans","getSelectedSpans","length","flatMap","block","isPortableTextTextBlock","node","markDefs","filter","markDef","some","span","marks","includes","_key","getAnchorBlock","key","isKeyedSegment","path","undefined","value","find","getAnchorTextBlock","anchorBlock","getAnchorChild","children","getAnchorSpan","anchorChild","isPortableTextSpan","getBlockOffsets","selectionStartPoint","getSelectionStartPoint","selectionEndPoint","getSelectionEndPoint","start","selectionPoint","end","getFocusInlineObject","focusChild","getFocusChild","getSelection","getValue","isPointAfterSelection","point","reverseSelection","pointBlockKey","isKeySegment","pointChildKey","endBlockKey","endChildKey","after","child","offset","isPointBeforeSelection","startBlockKey","startChildKey","before","isOverlappingSelection","originalSelectionStartPoint","originalSelectionEndPoint","startPointBeforeSelection","startPointAfterSelection","endPointBeforeSelection","endPointAfterSelection","originalStartPointBeforeStartPoint","originalStartPointAfterStartPoint","originalEndPointBeforeEndPoint","originalEndPointAfterEndPoint","endPointEqualToOriginalStartPoint","startPointEqualToOriginalEndPoint"],"mappings":";;;AAOO,MAAMA,0BAAoDC,CAAa,aAAA;AACxE,MAAA,CA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,CAACM,qCAI5BP,4BAA4B,CAACQ,oCACxB,KAIP,CAACL,sCACDC,qCACA,CAACC,kCACDC,gCAEO,CAACC,oCAIRJ,sCACA,CAACC,qCACDC,kCACA,CAACC,gCAEM,CAACE,oCAIR,CAACR,4BACD,CAACD,6BACD,CAACG,0BACD,CAACD;AAAAA,EAML;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -306,6 +306,7 @@ declare type EditorContext = {
306
306
  activeDecorators: Array<string>
307
307
  converters: Array<Converter>
308
308
  keyGenerator: () => string
309
+ readOnly: boolean
309
310
  schema: EditorSchema
310
311
  selection: EditorSelection
311
312
  value: Array<PortableTextBlock>
@@ -418,6 +419,7 @@ declare const editorMachine: StateMachine<
418
419
  | {
419
420
  type: 'insert.blocks'
420
421
  blocks: Array<PortableTextBlock>
422
+ placement: 'auto' | 'after' | 'before'
421
423
  }
422
424
  | {
423
425
  type: 'insert.block object'
@@ -852,6 +854,7 @@ declare const editorMachine: StateMachine<
852
854
  | {
853
855
  type: 'insert.blocks'
854
856
  blocks: Array<PortableTextBlock>
857
+ placement: 'auto' | 'after' | 'before'
855
858
  }
856
859
  | {
857
860
  type: 'insert.block object'
@@ -1176,6 +1179,7 @@ declare const editorMachine: StateMachine<
1176
1179
  | {
1177
1180
  type: 'insert.blocks'
1178
1181
  blocks: Array<PortableTextBlock>
1182
+ placement: 'auto' | 'after' | 'before'
1179
1183
  }
1180
1184
  | {
1181
1185
  type: 'insert.block object'
@@ -1533,6 +1537,7 @@ declare const editorMachine: StateMachine<
1533
1537
  | {
1534
1538
  type: 'insert.blocks'
1535
1539
  blocks: Array<PortableTextBlock>
1540
+ placement: 'auto' | 'after' | 'before'
1536
1541
  }
1537
1542
  | {
1538
1543
  type: 'insert.block object'
@@ -1914,6 +1919,7 @@ declare const editorMachine: StateMachine<
1914
1919
  | {
1915
1920
  type: 'insert.blocks'
1916
1921
  blocks: Array<PortableTextBlock>
1922
+ placement: 'auto' | 'after' | 'before'
1917
1923
  }
1918
1924
  | {
1919
1925
  type: 'insert.block object'
@@ -2269,6 +2275,7 @@ declare const editorMachine: StateMachine<
2269
2275
  | {
2270
2276
  type: 'insert.blocks'
2271
2277
  blocks: Array<PortableTextBlock>
2278
+ placement: 'auto' | 'after' | 'before'
2272
2279
  }
2273
2280
  | {
2274
2281
  type: 'insert.block object'
@@ -2561,6 +2568,7 @@ declare const editorMachine: StateMachine<
2561
2568
  | {
2562
2569
  type: 'insert.blocks'
2563
2570
  blocks: Array<PortableTextBlock>
2571
+ placement: 'auto' | 'after' | 'before'
2564
2572
  }
2565
2573
  | {
2566
2574
  type: 'insert.block object'
@@ -2916,6 +2924,7 @@ declare const editorMachine: StateMachine<
2916
2924
  | {
2917
2925
  type: 'insert.blocks'
2918
2926
  blocks: Array<PortableTextBlock>
2927
+ placement: 'auto' | 'after' | 'before'
2919
2928
  }
2920
2929
  | {
2921
2930
  type: 'insert.block object'
@@ -3211,6 +3220,7 @@ declare const editorMachine: StateMachine<
3211
3220
  | {
3212
3221
  type: 'insert.blocks'
3213
3222
  blocks: Array<PortableTextBlock>
3223
+ placement: 'auto' | 'after' | 'before'
3214
3224
  }
3215
3225
  | {
3216
3226
  type: 'insert.block object'
@@ -3566,6 +3576,7 @@ declare const editorMachine: StateMachine<
3566
3576
  | {
3567
3577
  type: 'insert.blocks'
3568
3578
  blocks: Array<PortableTextBlock>
3579
+ placement: 'auto' | 'after' | 'before'
3569
3580
  }
3570
3581
  | {
3571
3582
  type: 'insert.block object'
@@ -3860,6 +3871,7 @@ declare const editorMachine: StateMachine<
3860
3871
  | {
3861
3872
  type: 'insert.blocks'
3862
3873
  blocks: Array<PortableTextBlock>
3874
+ placement: 'auto' | 'after' | 'before'
3863
3875
  }
3864
3876
  | {
3865
3877
  type: 'insert.block object'
@@ -4215,6 +4227,7 @@ declare const editorMachine: StateMachine<
4215
4227
  | {
4216
4228
  type: 'insert.blocks'
4217
4229
  blocks: Array<PortableTextBlock>
4230
+ placement: 'auto' | 'after' | 'before'
4218
4231
  }
4219
4232
  | {
4220
4233
  type: 'insert.block object'
@@ -4508,6 +4521,7 @@ declare const editorMachine: StateMachine<
4508
4521
  | {
4509
4522
  type: 'insert.blocks'
4510
4523
  blocks: Array<PortableTextBlock>
4524
+ placement: 'auto' | 'after' | 'before'
4511
4525
  }
4512
4526
  | {
4513
4527
  type: 'insert.block object'
@@ -4863,6 +4877,7 @@ declare const editorMachine: StateMachine<
4863
4877
  | {
4864
4878
  type: 'insert.blocks'
4865
4879
  blocks: Array<PortableTextBlock>
4880
+ placement: 'auto' | 'after' | 'before'
4866
4881
  }
4867
4882
  | {
4868
4883
  type: 'insert.block object'
@@ -5157,6 +5172,7 @@ declare const editorMachine: StateMachine<
5157
5172
  | {
5158
5173
  type: 'insert.blocks'
5159
5174
  blocks: Array<PortableTextBlock>
5175
+ placement: 'auto' | 'after' | 'before'
5160
5176
  }
5161
5177
  | {
5162
5178
  type: 'insert.block object'
@@ -5530,6 +5546,7 @@ declare const editorMachine: StateMachine<
5530
5546
  | {
5531
5547
  type: 'insert.blocks'
5532
5548
  blocks: Array<PortableTextBlock>
5549
+ placement: 'auto' | 'after' | 'before'
5533
5550
  }
5534
5551
  | {
5535
5552
  type: 'insert.block object'
@@ -5885,6 +5902,7 @@ declare const editorMachine: StateMachine<
5885
5902
  | {
5886
5903
  type: 'insert.blocks'
5887
5904
  blocks: Array<PortableTextBlock>
5905
+ placement: 'auto' | 'after' | 'before'
5888
5906
  }
5889
5907
  | {
5890
5908
  type: 'insert.block object'
@@ -6179,6 +6197,7 @@ declare const editorMachine: StateMachine<
6179
6197
  | {
6180
6198
  type: 'insert.blocks'
6181
6199
  blocks: Array<PortableTextBlock>
6200
+ placement: 'auto' | 'after' | 'before'
6182
6201
  }
6183
6202
  | {
6184
6203
  type: 'insert.block object'
@@ -6534,6 +6553,7 @@ declare const editorMachine: StateMachine<
6534
6553
  | {
6535
6554
  type: 'insert.blocks'
6536
6555
  blocks: Array<PortableTextBlock>
6556
+ placement: 'auto' | 'after' | 'before'
6537
6557
  }
6538
6558
  | {
6539
6559
  type: 'insert.block object'
@@ -6826,6 +6846,7 @@ declare const editorMachine: StateMachine<
6826
6846
  | {
6827
6847
  type: 'insert.blocks'
6828
6848
  blocks: Array<PortableTextBlock>
6849
+ placement: 'auto' | 'after' | 'before'
6829
6850
  }
6830
6851
  | {
6831
6852
  type: 'insert.block object'
@@ -7181,6 +7202,7 @@ declare const editorMachine: StateMachine<
7181
7202
  | {
7182
7203
  type: 'insert.blocks'
7183
7204
  blocks: Array<PortableTextBlock>
7205
+ placement: 'auto' | 'after' | 'before'
7184
7206
  }
7185
7207
  | {
7186
7208
  type: 'insert.block object'
@@ -7474,6 +7496,7 @@ declare const editorMachine: StateMachine<
7474
7496
  | {
7475
7497
  type: 'insert.blocks'
7476
7498
  blocks: Array<PortableTextBlock>
7499
+ placement: 'auto' | 'after' | 'before'
7477
7500
  }
7478
7501
  | {
7479
7502
  type: 'insert.block object'
@@ -7829,6 +7852,7 @@ declare const editorMachine: StateMachine<
7829
7852
  | {
7830
7853
  type: 'insert.blocks'
7831
7854
  blocks: Array<PortableTextBlock>
7855
+ placement: 'auto' | 'after' | 'before'
7832
7856
  }
7833
7857
  | {
7834
7858
  type: 'insert.block object'
@@ -8125,6 +8149,7 @@ declare const editorMachine: StateMachine<
8125
8149
  | {
8126
8150
  type: 'insert.blocks'
8127
8151
  blocks: Array<PortableTextBlock>
8152
+ placement: 'auto' | 'after' | 'before'
8128
8153
  }
8129
8154
  | {
8130
8155
  type: 'insert.block object'
@@ -8480,6 +8505,7 @@ declare const editorMachine: StateMachine<
8480
8505
  | {
8481
8506
  type: 'insert.blocks'
8482
8507
  blocks: Array<PortableTextBlock>
8508
+ placement: 'auto' | 'after' | 'before'
8483
8509
  }
8484
8510
  | {
8485
8511
  type: 'insert.block object'
@@ -8776,6 +8802,7 @@ declare const editorMachine: StateMachine<
8776
8802
  | {
8777
8803
  type: 'insert.blocks'
8778
8804
  blocks: Array<PortableTextBlock>
8805
+ placement: 'auto' | 'after' | 'before'
8779
8806
  }
8780
8807
  | {
8781
8808
  type: 'insert.block object'
@@ -9154,6 +9181,7 @@ declare const editorMachine: StateMachine<
9154
9181
  | {
9155
9182
  type: 'insert.blocks'
9156
9183
  blocks: Array<PortableTextBlock>
9184
+ placement: 'auto' | 'after' | 'before'
9157
9185
  }
9158
9186
  | {
9159
9187
  type: 'insert.block object'
@@ -9529,6 +9557,7 @@ declare const editorMachine: StateMachine<
9529
9557
  | {
9530
9558
  type: 'insert.blocks'
9531
9559
  blocks: Array<PortableTextBlock>
9560
+ placement: 'auto' | 'after' | 'before'
9532
9561
  }
9533
9562
  | {
9534
9563
  type: 'insert.block object'
@@ -10054,6 +10083,7 @@ declare const editorMachine: StateMachine<
10054
10083
  | {
10055
10084
  type: 'insert.blocks'
10056
10085
  blocks: Array<PortableTextBlock>
10086
+ placement: 'auto' | 'after' | 'before'
10057
10087
  }
10058
10088
  | {
10059
10089
  type: 'insert.block object'
@@ -10411,6 +10441,7 @@ declare const editorMachine: StateMachine<
10411
10441
  | {
10412
10442
  type: 'insert.blocks'
10413
10443
  blocks: Array<PortableTextBlock>
10444
+ placement: 'auto' | 'after' | 'before'
10414
10445
  }
10415
10446
  | {
10416
10447
  type: 'insert.block object'
@@ -10710,6 +10741,7 @@ declare const editorMachine: StateMachine<
10710
10741
  | {
10711
10742
  type: 'insert.blocks'
10712
10743
  blocks: Array<PortableTextBlock>
10744
+ placement: 'auto' | 'after' | 'before'
10713
10745
  }
10714
10746
  | {
10715
10747
  type: 'insert.block object'
@@ -11067,6 +11099,7 @@ declare const editorMachine: StateMachine<
11067
11099
  | {
11068
11100
  type: 'insert.blocks'
11069
11101
  blocks: Array<PortableTextBlock>
11102
+ placement: 'auto' | 'after' | 'before'
11070
11103
  }
11071
11104
  | {
11072
11105
  type: 'insert.block object'
@@ -11359,6 +11392,7 @@ declare const editorMachine: StateMachine<
11359
11392
  | {
11360
11393
  type: 'insert.blocks'
11361
11394
  blocks: Array<PortableTextBlock>
11395
+ placement: 'auto' | 'after' | 'before'
11362
11396
  }
11363
11397
  | {
11364
11398
  type: 'insert.block object'
@@ -11716,6 +11750,7 @@ declare const editorMachine: StateMachine<
11716
11750
  | {
11717
11751
  type: 'insert.blocks'
11718
11752
  blocks: Array<PortableTextBlock>
11753
+ placement: 'auto' | 'after' | 'before'
11719
11754
  }
11720
11755
  | {
11721
11756
  type: 'insert.block object'
@@ -12008,6 +12043,7 @@ declare const editorMachine: StateMachine<
12008
12043
  | {
12009
12044
  type: 'insert.blocks'
12010
12045
  blocks: Array<PortableTextBlock>
12046
+ placement: 'auto' | 'after' | 'before'
12011
12047
  }
12012
12048
  | {
12013
12049
  type: 'insert.block object'
@@ -12365,6 +12401,7 @@ declare const editorMachine: StateMachine<
12365
12401
  | {
12366
12402
  type: 'insert.blocks'
12367
12403
  blocks: Array<PortableTextBlock>
12404
+ placement: 'auto' | 'after' | 'before'
12368
12405
  }
12369
12406
  | {
12370
12407
  type: 'insert.block object'
@@ -12670,6 +12707,7 @@ declare const editorMachine: StateMachine<
12670
12707
  | {
12671
12708
  type: 'insert.blocks'
12672
12709
  blocks: Array<PortableTextBlock>
12710
+ placement: 'auto' | 'after' | 'before'
12673
12711
  }
12674
12712
  | {
12675
12713
  type: 'insert.block object'
@@ -13027,6 +13065,7 @@ declare const editorMachine: StateMachine<
13027
13065
  | {
13028
13066
  type: 'insert.blocks'
13029
13067
  blocks: Array<PortableTextBlock>
13068
+ placement: 'auto' | 'after' | 'before'
13030
13069
  }
13031
13070
  | {
13032
13071
  type: 'insert.block object'
@@ -13333,6 +13372,7 @@ declare const editorMachine: StateMachine<
13333
13372
  | {
13334
13373
  type: 'insert.blocks'
13335
13374
  blocks: Array<PortableTextBlock>
13375
+ placement: 'auto' | 'after' | 'before'
13336
13376
  }
13337
13377
  | {
13338
13378
  type: 'insert.block object'
@@ -13690,6 +13730,7 @@ declare const editorMachine: StateMachine<
13690
13730
  | {
13691
13731
  type: 'insert.blocks'
13692
13732
  blocks: Array<PortableTextBlock>
13733
+ placement: 'auto' | 'after' | 'before'
13693
13734
  }
13694
13735
  | {
13695
13736
  type: 'insert.block object'
@@ -13982,6 +14023,7 @@ declare const editorMachine: StateMachine<
13982
14023
  | {
13983
14024
  type: 'insert.blocks'
13984
14025
  blocks: Array<PortableTextBlock>
14026
+ placement: 'auto' | 'after' | 'before'
13985
14027
  }
13986
14028
  | {
13987
14029
  type: 'insert.block object'
@@ -14339,6 +14381,7 @@ declare const editorMachine: StateMachine<
14339
14381
  | {
14340
14382
  type: 'insert.blocks'
14341
14383
  blocks: Array<PortableTextBlock>
14384
+ placement: 'auto' | 'after' | 'before'
14342
14385
  }
14343
14386
  | {
14344
14387
  type: 'insert.block object'
@@ -14634,6 +14677,7 @@ declare const editorMachine: StateMachine<
14634
14677
  | {
14635
14678
  type: 'insert.blocks'
14636
14679
  blocks: Array<PortableTextBlock>
14680
+ placement: 'auto' | 'after' | 'before'
14637
14681
  }
14638
14682
  | {
14639
14683
  type: 'insert.block object'
@@ -14991,6 +15035,7 @@ declare const editorMachine: StateMachine<
14991
15035
  | {
14992
15036
  type: 'insert.blocks'
14993
15037
  blocks: Array<PortableTextBlock>
15038
+ placement: 'auto' | 'after' | 'before'
14994
15039
  }
14995
15040
  | {
14996
15041
  type: 'insert.block object'
@@ -15191,6 +15236,7 @@ declare const editorMachine: StateMachine<
15191
15236
  | {
15192
15237
  type: 'insert.blocks'
15193
15238
  blocks: Array<PortableTextBlock>
15239
+ placement: 'auto' | 'after' | 'before'
15194
15240
  }
15195
15241
  | {
15196
15242
  type: 'insert.block object'
@@ -15337,6 +15383,7 @@ declare const editorMachine: StateMachine<
15337
15383
  | {
15338
15384
  type: 'insert.blocks'
15339
15385
  blocks: Array<PortableTextBlock>
15386
+ placement: 'auto' | 'after' | 'before'
15340
15387
  }
15341
15388
  | {
15342
15389
  type: 'insert.block object'
@@ -15694,6 +15741,7 @@ declare const editorMachine: StateMachine<
15694
15741
  | {
15695
15742
  type: 'insert.blocks'
15696
15743
  blocks: Array<PortableTextBlock>
15744
+ placement: 'auto' | 'after' | 'before'
15697
15745
  }
15698
15746
  | {
15699
15747
  type: 'insert.block object'
@@ -15995,6 +16043,7 @@ declare const editorMachine: StateMachine<
15995
16043
  | {
15996
16044
  type: 'insert.blocks'
15997
16045
  blocks: Array<PortableTextBlock>
16046
+ placement: 'auto' | 'after' | 'before'
15998
16047
  }
15999
16048
  | {
16000
16049
  type: 'insert.block object'
@@ -16352,6 +16401,7 @@ declare const editorMachine: StateMachine<
16352
16401
  | {
16353
16402
  type: 'insert.blocks'
16354
16403
  blocks: Array<PortableTextBlock>
16404
+ placement: 'auto' | 'after' | 'before'
16355
16405
  }
16356
16406
  | {
16357
16407
  type: 'insert.block object'
@@ -16654,6 +16704,7 @@ declare const editorMachine: StateMachine<
16654
16704
  | {
16655
16705
  type: 'insert.blocks'
16656
16706
  blocks: Array<PortableTextBlock>
16707
+ placement: 'auto' | 'after' | 'before'
16657
16708
  }
16658
16709
  | {
16659
16710
  type: 'insert.block object'
@@ -17011,6 +17062,7 @@ declare const editorMachine: StateMachine<
17011
17062
  | {
17012
17063
  type: 'insert.blocks'
17013
17064
  blocks: Array<PortableTextBlock>
17065
+ placement: 'auto' | 'after' | 'before'
17014
17066
  }
17015
17067
  | {
17016
17068
  type: 'insert.block object'
@@ -17304,6 +17356,7 @@ declare const editorMachine: StateMachine<
17304
17356
  | {
17305
17357
  type: 'insert.blocks'
17306
17358
  blocks: Array<PortableTextBlock>
17359
+ placement: 'auto' | 'after' | 'before'
17307
17360
  }
17308
17361
  | {
17309
17362
  type: 'insert.block object'
@@ -17661,6 +17714,7 @@ declare const editorMachine: StateMachine<
17661
17714
  | {
17662
17715
  type: 'insert.blocks'
17663
17716
  blocks: Array<PortableTextBlock>
17717
+ placement: 'auto' | 'after' | 'before'
17664
17718
  }
17665
17719
  | {
17666
17720
  type: 'insert.block object'
@@ -17956,6 +18010,7 @@ declare const editorMachine: StateMachine<
17956
18010
  | {
17957
18011
  type: 'insert.blocks'
17958
18012
  blocks: Array<PortableTextBlock>
18013
+ placement: 'auto' | 'after' | 'before'
17959
18014
  }
17960
18015
  | {
17961
18016
  type: 'insert.block object'
@@ -18313,6 +18368,7 @@ declare const editorMachine: StateMachine<
18313
18368
  | {
18314
18369
  type: 'insert.blocks'
18315
18370
  blocks: Array<PortableTextBlock>
18371
+ placement: 'auto' | 'after' | 'before'
18316
18372
  }
18317
18373
  | {
18318
18374
  type: 'insert.block object'
@@ -18614,6 +18670,7 @@ declare const editorMachine: StateMachine<
18614
18670
  | {
18615
18671
  type: 'insert.blocks'
18616
18672
  blocks: Array<PortableTextBlock>
18673
+ placement: 'auto' | 'after' | 'before'
18617
18674
  }
18618
18675
  | {
18619
18676
  type: 'insert.block object'
@@ -18971,6 +19028,7 @@ declare const editorMachine: StateMachine<
18971
19028
  | {
18972
19029
  type: 'insert.blocks'
18973
19030
  blocks: Array<PortableTextBlock>
19031
+ placement: 'auto' | 'after' | 'before'
18974
19032
  }
18975
19033
  | {
18976
19034
  type: 'insert.block object'
@@ -19432,6 +19490,17 @@ export declare const getFocusChild: EditorSelector<
19432
19490
  | undefined
19433
19491
  >
19434
19492
 
19493
+ /**
19494
+ * @public
19495
+ */
19496
+ export declare const getFocusInlineObject: EditorSelector<
19497
+ | {
19498
+ node: PortableTextObject
19499
+ path: [KeyedSegment, 'children', KeyedSegment]
19500
+ }
19501
+ | undefined
19502
+ >
19503
+
19435
19504
  /**
19436
19505
  * @public
19437
19506
  */
@@ -19705,6 +19774,11 @@ export declare function isPointBeforeSelection(
19705
19774
  point: EditorSelectionPoint,
19706
19775
  ): EditorSelector<boolean>
19707
19776
 
19777
+ /**
19778
+ * @public
19779
+ */
19780
+ export declare const isSelectingEntireBlocks: EditorSelector<boolean>
19781
+
19708
19782
  /**
19709
19783
  * @public
19710
19784
  */
@@ -19958,6 +20032,7 @@ declare type SyntheticBehaviorEvent =
19958
20032
  | {
19959
20033
  type: 'insert.blocks'
19960
20034
  blocks: Array<PortableTextBlock>
20035
+ placement: 'auto' | 'after' | 'before'
19961
20036
  }
19962
20037
  | {
19963
20038
  type: 'insert.block object'