@portabletext/editor 7.5.0 → 7.5.2

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/index.js CHANGED
@@ -9,12 +9,12 @@ import { isSpan, isTextBlock, compileSchema } from "@portabletext/schema";
9
9
  import { defineSchema } from "@portabletext/schema";
10
10
  import scrollIntoView from "scroll-into-view-if-needed";
11
11
  import { createKeyboardShortcut, undo, redo, code, underline, italic as italic$1, bold as bold$1 } from "@portabletext/keyboard-shortcuts";
12
- import { rangesOverlap, isSelectionCollapsed as isSelectionCollapsed$1, getFocusInlineObject, getFocusTextBlock, getFocusSpan, getFragment, isSelectionExpanded, getSelectionStartBlock, getSelectionEndBlock, isOverlappingSelection, getFocusBlock, getSelectedBlocks, isSelectingEntireBlocks, getSelectedValue, isActiveAnnotation, getActiveAnnotationsMarks, getActiveDecorators, getCaretWordSelection, getSelectionStartChild, getSelectionEndChild, getPreviousSpan, getNextSpan, getSelectionStartPoint, getSelectionEndPoint, getFocusBlockObject, getLastBlock, getFirstBlock, isAtTheEndOfBlock, isAtTheStartOfBlock, getMarkState, getFocusListBlock, getNextBlock, getPreviousBlock, getSelectedTextBlocks, getRootAcceptedTypes, isActiveDecorator, getFocusChild, getActiveAnnotations, isActiveListItem, isActiveStyle } from "./_chunks-es/selector.is-at-the-start-of-block.js";
12
+ import { rangesOverlap, getFocusInlineObject, isSelectionCollapsed as isSelectionCollapsed$1, getFocusTextBlock, getFocusSpan, getFragment, isSelectionExpanded, getSelectionStartBlock, getSelectionEndBlock, isOverlappingSelection, getFocusBlock, getSelectedBlocks, isSelectingEntireBlocks, getSelectedValue, isActiveAnnotation, getActiveAnnotationsMarks, getActiveDecorators, getCaretWordSelection, getSelectionStartChild, getSelectionEndChild, getPreviousSpan, getNextSpan, getSelectionStartPoint, getSelectionEndPoint, getFocusBlockObject, getLastBlock, getFirstBlock, isAtTheEndOfBlock, isAtTheStartOfBlock, getMarkState, getFocusListBlock, getNextBlock, getPreviousBlock, getSelectedTextBlocks, getRootAcceptedTypes, isActiveDecorator, getFocusChild, getActiveAnnotations, isActiveListItem, isActiveStyle } from "./_chunks-es/selector.is-at-the-start-of-block.js";
13
13
  import { isEqualSelectionPoints, blockOffsetToSpanSelectionPoint, getBlockKeyFromSelectionPoint, getBlockEndPoint, getBlockStartPoint, isSelectionCollapsed, defaultKeyGenerator, parseBlocks, parseBlock, isListBlock, getSelectionStartPoint as getSelectionStartPoint$1, getSelectionEndPoint as getSelectionEndPoint$1, parseAnnotation, parseMarkDefs, parseSpan, parseInlineObject } from "./_chunks-es/util.slice-blocks.js";
14
14
  import rawDebug from "debug";
15
15
  import { isEmptyTextBlock, getTextBlockText } from "./_chunks-es/util.is-empty-text-block.js";
16
- import { setup, fromCallback, assign, and, assertEvent, enqueueActions, emit, not, raise as raise$1, createActor } from "xstate";
17
16
  import { defineBehavior, forward, raise, effect } from "./behaviors/index.js";
17
+ import { setup, fromCallback, assign, and, assertEvent, enqueueActions, emit, not, raise as raise$1, createActor } from "xstate";
18
18
  import { htmlToPortableText } from "@portabletext/html";
19
19
  import { toHTML } from "@portabletext/to-html";
20
20
  import { markdownToPortableText, portableTextToMarkdown } from "@portabletext/markdown";
@@ -2268,7 +2268,7 @@ const DecorateContext = createContext({}), useDecorations = (node, path2, parent
2268
2268
  const eventListeners = useRef(t0), latestDecorate = useRef(decorateProp);
2269
2269
  let t1, t2;
2270
2270
  $[1] !== decorateProp ? (t1 = () => {
2271
- latestDecorate.current = decorateProp, eventListeners.current.forEach(_temp$3);
2271
+ latestDecorate.current = decorateProp, eventListeners.current.forEach(_temp$4);
2272
2272
  }, t2 = [decorateProp], $[1] = decorateProp, $[2] = t1, $[3] = t2) : (t1 = $[2], t2 = $[3]), useIsomorphicLayoutEffect(t1, t2);
2273
2273
  let t3;
2274
2274
  $[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = (entry) => latestDecorate.current(entry), $[4] = t3) : t3 = $[4];
@@ -2284,7 +2284,7 @@ const DecorateContext = createContext({}), useDecorations = (node, path2, parent
2284
2284
  addEventListener
2285
2285
  }, $[6] = t5) : t5 = $[6], t5;
2286
2286
  };
2287
- function _temp$3(listener) {
2287
+ function _temp$4(listener) {
2288
2288
  listener();
2289
2289
  }
2290
2290
  const rtlRange = "\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC", ltrRange = "A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF", rtl = new RegExp(`^[^${ltrRange}]*[${rtlRange}]`), ltr = new RegExp(`^[^${rtlRange}]*[${ltrRange}]`);
@@ -4086,6 +4086,22 @@ function getEventPosition({
4086
4086
  editorEngine,
4087
4087
  event
4088
4088
  }), eventSelection = getSelectionFromEvent(editorEngine, event) ?? null;
4089
+ if (eventBlockPath && eventPositionBlock && !eventSelection && isLeafObject(editorEngine.snapshot, eventNode, eventPath) && eventPath.length > eventBlockPath.length)
4090
+ return {
4091
+ block: eventPositionBlock,
4092
+ isEditor: !1,
4093
+ isContainer: !1,
4094
+ selection: {
4095
+ anchor: {
4096
+ path: eventPath,
4097
+ offset: 0
4098
+ },
4099
+ focus: {
4100
+ path: eventPath,
4101
+ offset: 0
4102
+ }
4103
+ }
4104
+ };
4089
4105
  if (eventBlock && eventBlockPath && eventPositionBlock && !eventSelection && !isEventContainer(editorEngine, eventNode, eventPath))
4090
4106
  return {
4091
4107
  block: eventPositionBlock,
@@ -4228,7 +4244,230 @@ function getSelectionFromEvent(editor, event) {
4228
4244
  function isEventContainer(editorEngine, eventNode, eventPath) {
4229
4245
  return isEditor(eventNode) ? !0 : isEditableContainer(editorEngine.snapshot, eventNode, eventPath);
4230
4246
  }
4231
- const EditorActorContext = createContext({}), IS_MAC = typeof window < "u" && /Mac|iPod|iPhone|iPad/.test(window.navigator.userAgent), modifiers = {
4247
+ function createEditorPriority(config) {
4248
+ return {
4249
+ id: defaultKeyGenerator(),
4250
+ name: config?.name,
4251
+ reference: config?.reference
4252
+ };
4253
+ }
4254
+ const corePriority = createEditorPriority({
4255
+ name: "core"
4256
+ });
4257
+ function getDragSelection({
4258
+ eventSelection,
4259
+ snapshot
4260
+ }) {
4261
+ let dragSelection = eventSelection;
4262
+ if (getFocusInlineObject({
4263
+ ...snapshot,
4264
+ context: {
4265
+ ...snapshot.context,
4266
+ selection: eventSelection
4267
+ }
4268
+ }))
4269
+ return dragSelection;
4270
+ const draggingCollapsedSelection = isSelectionCollapsed$1({
4271
+ context: {
4272
+ ...snapshot.context,
4273
+ selection: eventSelection
4274
+ }
4275
+ }), draggedTextBlock = getFocusTextBlock({
4276
+ ...snapshot,
4277
+ context: {
4278
+ ...snapshot.context,
4279
+ selection: eventSelection
4280
+ }
4281
+ }), draggedSpan = getFocusSpan({
4282
+ ...snapshot,
4283
+ context: {
4284
+ ...snapshot.context,
4285
+ selection: eventSelection
4286
+ }
4287
+ });
4288
+ draggingCollapsedSelection && draggedTextBlock && draggedSpan && (dragSelection = {
4289
+ anchor: getBlockStartPoint({
4290
+ context: snapshot.context,
4291
+ block: draggedTextBlock
4292
+ }),
4293
+ focus: getBlockEndPoint({
4294
+ context: snapshot.context,
4295
+ block: draggedTextBlock
4296
+ })
4297
+ });
4298
+ const selectedBlocks = getFragment(snapshot);
4299
+ if (snapshot.context.selection && isSelectionExpanded(snapshot) && selectedBlocks.length > 1) {
4300
+ const selectionStartBlock = getSelectionStartBlock(snapshot), selectionEndBlock = getSelectionEndBlock(snapshot);
4301
+ if (!selectionStartBlock || !selectionEndBlock)
4302
+ return dragSelection;
4303
+ const selectionStartPoint = getBlockStartPoint({
4304
+ context: snapshot.context,
4305
+ block: selectionStartBlock
4306
+ }), selectionEndPoint = getBlockEndPoint({
4307
+ context: snapshot.context,
4308
+ block: selectionEndBlock
4309
+ });
4310
+ isOverlappingSelection(eventSelection)({
4311
+ ...snapshot,
4312
+ context: {
4313
+ ...snapshot.context,
4314
+ selection: {
4315
+ anchor: selectionStartPoint,
4316
+ focus: selectionEndPoint
4317
+ }
4318
+ }
4319
+ }) && (dragSelection = {
4320
+ anchor: selectionStartPoint,
4321
+ focus: selectionEndPoint
4322
+ });
4323
+ }
4324
+ return dragSelection;
4325
+ }
4326
+ function createDropPositionBehaviorsConfig({
4327
+ setDropPosition
4328
+ }) {
4329
+ return [{
4330
+ behavior: defineBehavior({
4331
+ on: "drag.dragover",
4332
+ guard: ({
4333
+ snapshot,
4334
+ event
4335
+ }) => {
4336
+ const dropFocusBlock = getFocusBlock({
4337
+ ...snapshot,
4338
+ context: {
4339
+ ...snapshot.context,
4340
+ selection: event.position.selection
4341
+ }
4342
+ });
4343
+ if (!dropFocusBlock)
4344
+ return !1;
4345
+ const dragOrigin = event.dragOrigin;
4346
+ if (!dragOrigin)
4347
+ return !1;
4348
+ const dragSelection = getDragSelection({
4349
+ eventSelection: dragOrigin.selection,
4350
+ snapshot
4351
+ });
4352
+ return getSelectedBlocks({
4353
+ ...snapshot,
4354
+ context: {
4355
+ ...snapshot.context,
4356
+ selection: dragSelection
4357
+ }
4358
+ }).some((draggedBlock) => draggedBlock.node._key === dropFocusBlock.node._key) || !isSelectingEntireBlocks({
4359
+ ...snapshot,
4360
+ context: {
4361
+ ...snapshot.context,
4362
+ selection: dragSelection
4363
+ }
4364
+ }) ? !1 : {
4365
+ dropFocusBlock
4366
+ };
4367
+ },
4368
+ actions: [({
4369
+ event
4370
+ }, {
4371
+ dropFocusBlock
4372
+ }) => [{
4373
+ type: "effect",
4374
+ effect: () => {
4375
+ setDropPosition({
4376
+ path: dropFocusBlock.path,
4377
+ position: event.position.block
4378
+ });
4379
+ }
4380
+ }]]
4381
+ }),
4382
+ priority: createEditorPriority({
4383
+ reference: {
4384
+ priority: corePriority,
4385
+ importance: "lower"
4386
+ }
4387
+ })
4388
+ }, {
4389
+ behavior: defineBehavior({
4390
+ on: "drag.*",
4391
+ guard: ({
4392
+ event
4393
+ }) => event.type !== "drag.dragover",
4394
+ actions: [({
4395
+ event
4396
+ }) => [{
4397
+ type: "effect",
4398
+ effect: () => {
4399
+ setDropPosition(void 0);
4400
+ }
4401
+ }, forward(event)]]
4402
+ }),
4403
+ priority: createEditorPriority({
4404
+ reference: {
4405
+ priority: corePriority,
4406
+ importance: "lower"
4407
+ }
4408
+ })
4409
+ }];
4410
+ }
4411
+ const EditorActorContext = createContext({});
4412
+ function resolveElementDropPosition(dropPosition, elementPath) {
4413
+ if (dropPosition && pathEquals(dropPosition.path, elementPath))
4414
+ return dropPosition.position;
4415
+ }
4416
+ const defaultStore$1 = {
4417
+ subscribe: () => () => {
4418
+ },
4419
+ getSnapshot: () => {
4420
+ }
4421
+ }, DropPositionStoreContext = createContext(defaultStore$1);
4422
+ function DropPositionStateProvider(t0) {
4423
+ const $ = c(6), {
4424
+ children
4425
+ } = t0, editorActor = useContext(EditorActorContext), [initialSubscribers] = useState(_temp$3), subscribersRef = useRef(initialSubscribers), stateRef = useRef(void 0);
4426
+ let t1, t2;
4427
+ $[0] !== editorActor ? (t1 = () => {
4428
+ const behaviorConfigs = createDropPositionBehaviorsConfig({
4429
+ setDropPosition: (next) => {
4430
+ const prev = stateRef.current;
4431
+ if (!(prev === next || prev !== void 0 && next !== void 0 && prev.position === next.position && pathEquals(prev.path, next.path))) {
4432
+ stateRef.current = next;
4433
+ for (const callback of subscribersRef.current)
4434
+ callback();
4435
+ }
4436
+ }
4437
+ });
4438
+ for (const behaviorConfig of behaviorConfigs)
4439
+ editorActor.send({
4440
+ type: "add behavior",
4441
+ behaviorConfig
4442
+ });
4443
+ return () => {
4444
+ for (const behaviorConfig_0 of behaviorConfigs)
4445
+ editorActor.send({
4446
+ type: "remove behavior",
4447
+ behaviorConfig: behaviorConfig_0
4448
+ });
4449
+ };
4450
+ }, t2 = [editorActor], $[0] = editorActor, $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useEffect(t1, t2);
4451
+ let t3;
4452
+ $[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = {
4453
+ subscribe: (callback_0) => (subscribersRef.current.add(callback_0), () => {
4454
+ subscribersRef.current.delete(callback_0);
4455
+ }),
4456
+ getSnapshot: () => stateRef.current
4457
+ }, $[3] = t3) : t3 = $[3];
4458
+ const store = t3;
4459
+ let t4;
4460
+ return $[4] !== children ? (t4 = /* @__PURE__ */ jsx(DropPositionStoreContext.Provider, { value: store, children }), $[4] = children, $[5] = t4) : t4 = $[5], t4;
4461
+ }
4462
+ function _temp$3() {
4463
+ return /* @__PURE__ */ new Set();
4464
+ }
4465
+ function useElementDropPosition(path2) {
4466
+ const $ = c(3), store = useContext(DropPositionStoreContext);
4467
+ let t0;
4468
+ return $[0] !== path2 || $[1] !== store ? (t0 = () => resolveElementDropPosition(store.getSnapshot(), path2), $[0] = path2, $[1] = store, $[2] = t0) : t0 = $[2], useSyncExternalStore(store.subscribe, t0);
4469
+ }
4470
+ const IS_MAC = typeof window < "u" && /Mac|iPod|iPhone|iPad/.test(window.navigator.userAgent), modifiers = {
4232
4471
  alt: "altKey",
4233
4472
  control: "ctrlKey",
4234
4473
  meta: "metaKey",
@@ -4945,7 +5184,7 @@ function RenderBlockObject(props) {
4945
5184
  const $ = c(50), blockObjectRef = useRef(null);
4946
5185
  let t0;
4947
5186
  $[0] !== props.path ? (t0 = serializePath(props.path), $[0] = props.path, $[1] = t0) : t0 = $[1];
4948
- const serializedPath = t0, selected = useIsSelectedLeaf(serializedPath), focused = useIsFocusedLeaf(serializedPath);
5187
+ const serializedPath = t0, selected = useIsSelectedLeaf(serializedPath), focused = useIsFocusedLeaf(serializedPath), dropPosition = useElementDropPosition(props.path);
4949
5188
  let t1;
4950
5189
  if ($[2] !== props.element || $[3] !== props.schema.blockObjects) {
4951
5190
  let t22;
@@ -5010,12 +5249,12 @@ function RenderBlockObject(props) {
5010
5249
  }, $[33] = props.attributes, $[34] = props.element._key, $[35] = props.element._type, $[36] = t3) : t3 = $[36];
5011
5250
  const attributes = t3;
5012
5251
  let t4;
5013
- $[37] !== props.dropPosition ? (t4 = props.dropPosition === "start" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[37] = props.dropPosition, $[38] = t4) : t4 = $[38];
5252
+ $[37] !== dropPosition ? (t4 = dropPosition === "start" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[37] = dropPosition, $[38] = t4) : t4 = $[38];
5014
5253
  const t5 = !props.readOnly;
5015
5254
  let t6;
5016
5255
  $[39] !== innerContent || $[40] !== t5 ? (t6 = /* @__PURE__ */ jsx("div", { ref: blockObjectRef, contentEditable: !1, draggable: t5, children: innerContent }), $[39] = innerContent, $[40] = t5, $[41] = t6) : t6 = $[41];
5017
5256
  let t7;
5018
- $[42] !== props.dropPosition ? (t7 = props.dropPosition === "end" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[42] = props.dropPosition, $[43] = t7) : t7 = $[43];
5257
+ $[42] !== dropPosition ? (t7 = dropPosition === "end" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[42] = dropPosition, $[43] = t7) : t7 = $[43];
5019
5258
  let t8;
5020
5259
  return $[44] !== attributes || $[45] !== props.children || $[46] !== t4 || $[47] !== t6 || $[48] !== t7 ? (t8 = /* @__PURE__ */ jsxs("div", { ...attributes, children: [
5021
5260
  t4,
@@ -5175,7 +5414,7 @@ function RenderTextBlock(props) {
5175
5414
  const schemaType = t1;
5176
5415
  let t2;
5177
5416
  $[5] !== props.path ? (t2 = serializePath(props.path), $[5] = props.path, $[6] = t2) : t2 = $[6];
5178
- const serializedPath = t2, selected = useIsSelectedContainer(serializedPath), focused = useIsFocusedContainer(serializedPath);
5417
+ const serializedPath = t2, selected = useIsSelectedContainer(serializedPath), focused = useIsFocusedContainer(serializedPath), dropPosition = useElementDropPosition(props.path);
5179
5418
  let t3;
5180
5419
  $[7] !== serializedPath ? (t3 = (editor) => editor.listIndexMap.get(serializedPath), $[7] = serializedPath, $[8] = t3) : t3 = $[8];
5181
5420
  const listIndex = useEngineSelector(t3), subSchema = useBlockSubSchema(props.path);
@@ -5238,7 +5477,7 @@ function RenderTextBlock(props) {
5238
5477
  "data-list-index": listIndex
5239
5478
  } : {}, $[52] = listIndex, $[53] = t12) : t12 = $[53];
5240
5479
  let t13;
5241
- $[54] !== props.dropPosition ? (t13 = props.dropPosition === "start" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[54] = props.dropPosition, $[55] = t13) : t13 = $[55];
5480
+ $[54] !== dropPosition ? (t13 = dropPosition === "start" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[54] = dropPosition, $[55] = t13) : t13 = $[55];
5242
5481
  let t14;
5243
5482
  $[56] !== children || $[57] !== focused || $[58] !== props.legacy.renderBlock || $[59] !== props.textBlock || $[60] !== schemaType || $[61] !== selected ? (t14 = props.legacy.renderBlock ? /* @__PURE__ */ jsx(RenderBlock, { renderBlock: props.legacy.renderBlock, editorElementRef: blockRef, focused, level: props.textBlock.level, listItem: props.textBlock.listItem, path: [{
5244
5483
  _key: props.textBlock._key
@@ -5246,7 +5485,7 @@ function RenderTextBlock(props) {
5246
5485
  let t15;
5247
5486
  $[63] !== t14 ? (t15 = /* @__PURE__ */ jsx("div", { ref: blockRef, children: t14 }), $[63] = t14, $[64] = t15) : t15 = $[64];
5248
5487
  let t16;
5249
- $[65] !== props.dropPosition ? (t16 = props.dropPosition === "end" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[65] = props.dropPosition, $[66] = t16) : t16 = $[66];
5488
+ $[65] !== dropPosition ? (t16 = dropPosition === "end" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[65] = dropPosition, $[66] = t16) : t16 = $[66];
5250
5489
  let t17;
5251
5490
  return $[67] !== props.attributes || $[68] !== props.textBlock._key || $[69] !== props.textBlock._type || $[70] !== t10 || $[71] !== t11 || $[72] !== t12 || $[73] !== t13 || $[74] !== t15 || $[75] !== t16 || $[76] !== t8 || $[77] !== t9 ? (t17 = /* @__PURE__ */ jsxs("div", { ...t4, className: t8, "data-block-key": props.textBlock._key, "data-block-name": props.textBlock._type, "data-block-type": "text", "data-pt-block": "text", ...t9, ...t10, ...t11, ...t12, children: [
5252
5491
  t13,
@@ -5326,10 +5565,6 @@ function RenderStyle({
5326
5565
  value
5327
5566
  });
5328
5567
  }
5329
- function resolveElementDropPosition(dropPosition, elementPath) {
5330
- if (dropPosition && pathEquals(dropPosition.path, elementPath))
5331
- return dropPosition.position;
5332
- }
5333
5568
  function tupleRefEqual(previous, next) {
5334
5569
  if (previous === null || previous.length !== next.length)
5335
5570
  return !1;
@@ -5339,7 +5574,7 @@ function tupleRefEqual(previous, next) {
5339
5574
  return !0;
5340
5575
  }
5341
5576
  function RenderElement(props) {
5342
- const $ = c(84), parentContainer = useContext(ParentContainerContext), parentTextBlock = useContext(ParentTextBlockContext), isInNewPipeline = useContext(NewPipelineContext), engineStatic = useEngineStatic(), schema = props.schema, type = props.element._type;
5577
+ const $ = c(75), parentContainer = useContext(ParentContainerContext), parentTextBlock = useContext(ParentTextBlockContext), isInNewPipeline = useContext(NewPipelineContext), engineStatic = useEngineStatic(), schema = props.schema, type = props.element._type;
5343
5578
  let t0;
5344
5579
  $[0] !== parentContainer || $[1] !== type ? (t0 = findBlockPositionalOverride(parentContainer, type), $[0] = parentContainer, $[1] = type, $[2] = t0) : t0 = $[2];
5345
5580
  const blockPositionalOverride = t0;
@@ -5421,14 +5656,14 @@ function RenderElement(props) {
5421
5656
  if (containerConfig) {
5422
5657
  let t82;
5423
5658
  $[8] !== containerConfig || $[9] !== props.attributes || $[10] !== props.children || $[11] !== props.element || $[12] !== props.path || $[13] !== props.readOnly ? (t82 = /* @__PURE__ */ jsx(RenderContainer, { attributes: props.attributes, element: props.element, containerConfig, path: props.path, readOnly: props.readOnly, children: props.children }), $[8] = containerConfig, $[9] = props.attributes, $[10] = props.children, $[11] = props.element, $[12] = props.path, $[13] = props.readOnly, $[14] = t82) : t82 = $[14];
5424
- let t92;
5425
- return $[15] !== containerConfig || $[16] !== t82 ? (t92 = /* @__PURE__ */ jsx(ParentContainerContext.Provider, { value: containerConfig, children: t82 }), $[15] = containerConfig, $[16] = t82, $[17] = t92) : t92 = $[17], t92;
5659
+ let t9;
5660
+ return $[15] !== containerConfig || $[16] !== t82 ? (t9 = /* @__PURE__ */ jsx(ParentContainerContext.Provider, { value: containerConfig, children: t82 }), $[15] = containerConfig, $[16] = t82, $[17] = t9) : t9 = $[17], t9;
5426
5661
  }
5427
5662
  if (isTextBlock({
5428
5663
  schema
5429
5664
  }, props.element)) {
5430
5665
  let rendered;
5431
- if ($[18] !== isInNewPipeline || $[19] !== props.attributes || $[20] !== props.children || $[21] !== props.dropPosition || $[22] !== props.element || $[23] !== props.legacy || $[24] !== props.path || $[25] !== props.readOnly || $[26] !== renderableTextBlockConfig || $[27] !== schema) {
5666
+ if ($[18] !== isInNewPipeline || $[19] !== props.attributes || $[20] !== props.children || $[21] !== props.element || $[22] !== props.legacy || $[23] !== props.path || $[24] !== props.readOnly || $[25] !== renderableTextBlockConfig || $[26] !== schema) {
5432
5667
  const {
5433
5668
  "data-slate-node": _sn,
5434
5669
  ...rest
@@ -5447,80 +5682,74 @@ function RenderElement(props) {
5447
5682
  children: props.children
5448
5683
  });
5449
5684
  else {
5450
- const t82 = props.attributes;
5451
- let t92;
5452
- $[29] !== props.dropPosition || $[30] !== props.path ? (t92 = resolveElementDropPosition(props.dropPosition, props.path), $[29] = props.dropPosition, $[30] = props.path, $[31] = t92) : t92 = $[31];
5453
- let t102;
5454
- $[32] !== props.attributes || $[33] !== props.children || $[34] !== props.element || $[35] !== props.legacy || $[36] !== props.path || $[37] !== props.readOnly || $[38] !== schema || $[39] !== t92 ? (t102 = /* @__PURE__ */ jsx(RenderTextBlock, { attributes: t82, dropPosition: t92, element: props.element, legacy: props.legacy, path: props.path, readOnly: props.readOnly, schema, textBlock: props.element, children: props.children }), $[32] = props.attributes, $[33] = props.children, $[34] = props.element, $[35] = props.legacy, $[36] = props.path, $[37] = props.readOnly, $[38] = schema, $[39] = t92, $[40] = t102) : t102 = $[40], rendered = t102;
5685
+ let t82;
5686
+ $[28] !== props.attributes || $[29] !== props.children || $[30] !== props.element || $[31] !== props.legacy || $[32] !== props.path || $[33] !== props.readOnly || $[34] !== schema ? (t82 = /* @__PURE__ */ jsx(RenderTextBlock, { attributes: props.attributes, element: props.element, legacy: props.legacy, path: props.path, readOnly: props.readOnly, schema, textBlock: props.element, children: props.children }), $[28] = props.attributes, $[29] = props.children, $[30] = props.element, $[31] = props.legacy, $[32] = props.path, $[33] = props.readOnly, $[34] = schema, $[35] = t82) : t82 = $[35], rendered = t82;
5455
5687
  }
5456
- $[18] = isInNewPipeline, $[19] = props.attributes, $[20] = props.children, $[21] = props.dropPosition, $[22] = props.element, $[23] = props.legacy, $[24] = props.path, $[25] = props.readOnly, $[26] = renderableTextBlockConfig, $[27] = schema, $[28] = rendered;
5688
+ $[18] = isInNewPipeline, $[19] = props.attributes, $[20] = props.children, $[21] = props.element, $[22] = props.legacy, $[23] = props.path, $[24] = props.readOnly, $[25] = renderableTextBlockConfig, $[26] = schema, $[27] = rendered;
5457
5689
  } else
5458
- rendered = $[28];
5690
+ rendered = $[27];
5459
5691
  if (textBlockScope) {
5460
5692
  let t82;
5461
- return $[41] !== rendered || $[42] !== textBlockScope ? (t82 = /* @__PURE__ */ jsx(ParentTextBlockContext.Provider, { value: textBlockScope, children: rendered }), $[41] = rendered, $[42] = textBlockScope, $[43] = t82) : t82 = $[43], t82;
5693
+ return $[36] !== rendered || $[37] !== textBlockScope ? (t82 = /* @__PURE__ */ jsx(ParentTextBlockContext.Provider, { value: textBlockScope, children: rendered }), $[36] = rendered, $[37] = textBlockScope, $[38] = t82) : t82 = $[38], t82;
5462
5694
  }
5463
5695
  return rendered;
5464
5696
  }
5465
5697
  if (isInline(engineStatic.snapshot, props.path)) {
5466
5698
  if (isInNewPipeline && !inlineObjectConfig) {
5467
5699
  let rest_0;
5468
- if ($[44] !== props.attributes) {
5700
+ if ($[39] !== props.attributes) {
5469
5701
  const {
5470
5702
  "data-slate-node": _sn_0,
5471
5703
  "data-slate-void": _sv,
5472
5704
  ...t84
5473
5705
  } = props.attributes;
5474
- rest_0 = t84, $[44] = props.attributes, $[45] = rest_0;
5706
+ rest_0 = t84, $[39] = props.attributes, $[40] = rest_0;
5475
5707
  } else
5476
- rest_0 = $[45];
5708
+ rest_0 = $[40];
5477
5709
  let t83;
5478
- $[46] !== props.element._key || $[47] !== props.element._type ? (t83 = /* @__PURE__ */ jsxs("span", { contentEditable: !1, children: [
5710
+ $[41] !== props.element._key || $[42] !== props.element._type ? (t83 = /* @__PURE__ */ jsxs("span", { contentEditable: !1, children: [
5479
5711
  "[",
5480
5712
  props.element._type,
5481
5713
  ": ",
5482
5714
  props.element._key,
5483
5715
  "]"
5484
- ] }), $[46] = props.element._key, $[47] = props.element._type, $[48] = t83) : t83 = $[48];
5485
- let t92;
5486
- return $[49] !== props.children || $[50] !== rest_0 || $[51] !== t83 ? (t92 = /* @__PURE__ */ jsxs("span", { ...rest_0, "data-pt-inline": "object", children: [
5716
+ ] }), $[41] = props.element._key, $[42] = props.element._type, $[43] = t83) : t83 = $[43];
5717
+ let t9;
5718
+ return $[44] !== props.children || $[45] !== rest_0 || $[46] !== t83 ? (t9 = /* @__PURE__ */ jsxs("span", { ...rest_0, "data-pt-inline": "object", children: [
5487
5719
  props.children,
5488
5720
  t83
5489
- ] }), $[49] = props.children, $[50] = rest_0, $[51] = t83, $[52] = t92) : t92 = $[52], t92;
5721
+ ] }), $[44] = props.children, $[45] = rest_0, $[46] = t83, $[47] = t9) : t9 = $[47], t9;
5490
5722
  }
5491
5723
  let t82;
5492
- return $[53] !== inlineObjectConfig || $[54] !== props.attributes || $[55] !== props.children || $[56] !== props.element || $[57] !== props.legacy || $[58] !== props.path || $[59] !== props.readOnly || $[60] !== schema ? (t82 = /* @__PURE__ */ jsx(RenderInlineObject, { attributes: props.attributes, element: props.element, inlineObjectConfig, legacy: props.legacy, path: props.path, readOnly: props.readOnly, schema, children: props.children }), $[53] = inlineObjectConfig, $[54] = props.attributes, $[55] = props.children, $[56] = props.element, $[57] = props.legacy, $[58] = props.path, $[59] = props.readOnly, $[60] = schema, $[61] = t82) : t82 = $[61], t82;
5724
+ return $[48] !== inlineObjectConfig || $[49] !== props.attributes || $[50] !== props.children || $[51] !== props.element || $[52] !== props.legacy || $[53] !== props.path || $[54] !== props.readOnly || $[55] !== schema ? (t82 = /* @__PURE__ */ jsx(RenderInlineObject, { attributes: props.attributes, element: props.element, inlineObjectConfig, legacy: props.legacy, path: props.path, readOnly: props.readOnly, schema, children: props.children }), $[48] = inlineObjectConfig, $[49] = props.attributes, $[50] = props.children, $[51] = props.element, $[52] = props.legacy, $[53] = props.path, $[54] = props.readOnly, $[55] = schema, $[56] = t82) : t82 = $[56], t82;
5493
5725
  }
5494
5726
  if (isInNewPipeline && !blockObjectConfig) {
5495
5727
  let rest_1;
5496
- if ($[62] !== props.attributes) {
5728
+ if ($[57] !== props.attributes) {
5497
5729
  const {
5498
5730
  "data-slate-node": _sn_1,
5499
5731
  "data-slate-void": _sv_0,
5500
5732
  ...t83
5501
5733
  } = props.attributes;
5502
- rest_1 = t83, $[62] = props.attributes, $[63] = rest_1;
5734
+ rest_1 = t83, $[57] = props.attributes, $[58] = rest_1;
5503
5735
  } else
5504
- rest_1 = $[63];
5736
+ rest_1 = $[58];
5505
5737
  let t82;
5506
- $[64] !== props.element._key || $[65] !== props.element._type ? (t82 = /* @__PURE__ */ jsxs("div", { contentEditable: !1, children: [
5738
+ $[59] !== props.element._key || $[60] !== props.element._type ? (t82 = /* @__PURE__ */ jsxs("div", { contentEditable: !1, children: [
5507
5739
  "[",
5508
5740
  props.element._type,
5509
5741
  ": ",
5510
5742
  props.element._key,
5511
5743
  "]"
5512
- ] }), $[64] = props.element._key, $[65] = props.element._type, $[66] = t82) : t82 = $[66];
5513
- let t92;
5514
- return $[67] !== props.children || $[68] !== rest_1 || $[69] !== t82 ? (t92 = /* @__PURE__ */ jsxs("div", { ...rest_1, "data-pt-block": "object", children: [
5744
+ ] }), $[59] = props.element._key, $[60] = props.element._type, $[61] = t82) : t82 = $[61];
5745
+ let t9;
5746
+ return $[62] !== props.children || $[63] !== rest_1 || $[64] !== t82 ? (t9 = /* @__PURE__ */ jsxs("div", { ...rest_1, "data-pt-block": "object", children: [
5515
5747
  props.children,
5516
5748
  t82
5517
- ] }), $[67] = props.children, $[68] = rest_1, $[69] = t82, $[70] = t92) : t92 = $[70], t92;
5749
+ ] }), $[62] = props.children, $[63] = rest_1, $[64] = t82, $[65] = t9) : t9 = $[65], t9;
5518
5750
  }
5519
- const t8 = props.attributes, t9 = props.element;
5520
- let t10;
5521
- $[71] !== props.dropPosition || $[72] !== props.path ? (t10 = resolveElementDropPosition(props.dropPosition, props.path), $[71] = props.dropPosition, $[72] = props.path, $[73] = t10) : t10 = $[73];
5522
- let t11;
5523
- return $[74] !== blockObjectConfig || $[75] !== props.attributes || $[76] !== props.children || $[77] !== props.element || $[78] !== props.legacy || $[79] !== props.path || $[80] !== props.readOnly || $[81] !== schema || $[82] !== t10 ? (t11 = /* @__PURE__ */ jsx(RenderBlockObject, { attributes: t8, blockObject: t9, dropPosition: t10, element: props.element, blockObjectConfig, legacy: props.legacy, path: props.path, readOnly: props.readOnly, schema, children: props.children }), $[74] = blockObjectConfig, $[75] = props.attributes, $[76] = props.children, $[77] = props.element, $[78] = props.legacy, $[79] = props.path, $[80] = props.readOnly, $[81] = schema, $[82] = t10, $[83] = t11) : t11 = $[83], t11;
5751
+ let t8;
5752
+ return $[66] !== blockObjectConfig || $[67] !== props.attributes || $[68] !== props.children || $[69] !== props.element || $[70] !== props.legacy || $[71] !== props.path || $[72] !== props.readOnly || $[73] !== schema ? (t8 = /* @__PURE__ */ jsx(RenderBlockObject, { attributes: props.attributes, blockObject: props.element, element: props.element, blockObjectConfig, legacy: props.legacy, path: props.path, readOnly: props.readOnly, schema, children: props.children }), $[66] = blockObjectConfig, $[67] = props.attributes, $[68] = props.children, $[69] = props.element, $[70] = props.legacy, $[71] = props.path, $[72] = props.readOnly, $[73] = schema, $[74] = t8) : t8 = $[74], t8;
5524
5753
  }
5525
5754
  function RenderTextBlockConfig(props) {
5526
5755
  const $ = c(11);
@@ -5733,191 +5962,6 @@ function RenderText(props) {
5733
5962
  let t0;
5734
5963
  return $[5] !== props.attributes || $[6] !== props.children || $[7] !== props.text._key || $[8] !== props.text._type ? (t0 = /* @__PURE__ */ jsx("span", { ...props.attributes, "data-child-key": props.text._key, "data-child-name": props.text._type, "data-child-type": "span", "data-pt-inline": "span", children: props.children }), $[5] = props.attributes, $[6] = props.children, $[7] = props.text._key, $[8] = props.text._type, $[9] = t0) : t0 = $[9], t0;
5735
5964
  }
5736
- function createEditorPriority(config) {
5737
- return {
5738
- id: defaultKeyGenerator(),
5739
- name: config?.name,
5740
- reference: config?.reference
5741
- };
5742
- }
5743
- const corePriority = createEditorPriority({
5744
- name: "core"
5745
- });
5746
- function getDragSelection({
5747
- eventSelection,
5748
- snapshot
5749
- }) {
5750
- let dragSelection = eventSelection;
5751
- if (getFocusInlineObject({
5752
- ...snapshot,
5753
- context: {
5754
- ...snapshot.context,
5755
- selection: eventSelection
5756
- }
5757
- }))
5758
- return dragSelection;
5759
- const draggingCollapsedSelection = isSelectionCollapsed$1({
5760
- context: {
5761
- ...snapshot.context,
5762
- selection: eventSelection
5763
- }
5764
- }), draggedTextBlock = getFocusTextBlock({
5765
- ...snapshot,
5766
- context: {
5767
- ...snapshot.context,
5768
- selection: eventSelection
5769
- }
5770
- }), draggedSpan = getFocusSpan({
5771
- ...snapshot,
5772
- context: {
5773
- ...snapshot.context,
5774
- selection: eventSelection
5775
- }
5776
- });
5777
- draggingCollapsedSelection && draggedTextBlock && draggedSpan && (dragSelection = {
5778
- anchor: getBlockStartPoint({
5779
- context: snapshot.context,
5780
- block: draggedTextBlock
5781
- }),
5782
- focus: getBlockEndPoint({
5783
- context: snapshot.context,
5784
- block: draggedTextBlock
5785
- })
5786
- });
5787
- const selectedBlocks = getFragment(snapshot);
5788
- if (snapshot.context.selection && isSelectionExpanded(snapshot) && selectedBlocks.length > 1) {
5789
- const selectionStartBlock = getSelectionStartBlock(snapshot), selectionEndBlock = getSelectionEndBlock(snapshot);
5790
- if (!selectionStartBlock || !selectionEndBlock)
5791
- return dragSelection;
5792
- const selectionStartPoint = getBlockStartPoint({
5793
- context: snapshot.context,
5794
- block: selectionStartBlock
5795
- }), selectionEndPoint = getBlockEndPoint({
5796
- context: snapshot.context,
5797
- block: selectionEndBlock
5798
- });
5799
- isOverlappingSelection(eventSelection)({
5800
- ...snapshot,
5801
- context: {
5802
- ...snapshot.context,
5803
- selection: {
5804
- anchor: selectionStartPoint,
5805
- focus: selectionEndPoint
5806
- }
5807
- }
5808
- }) && (dragSelection = {
5809
- anchor: selectionStartPoint,
5810
- focus: selectionEndPoint
5811
- });
5812
- }
5813
- return dragSelection;
5814
- }
5815
- function createDropPositionBehaviorsConfig({
5816
- setDropPosition
5817
- }) {
5818
- return [{
5819
- behavior: defineBehavior({
5820
- on: "drag.dragover",
5821
- guard: ({
5822
- snapshot,
5823
- event
5824
- }) => {
5825
- const dropFocusBlock = getFocusBlock({
5826
- ...snapshot,
5827
- context: {
5828
- ...snapshot.context,
5829
- selection: event.position.selection
5830
- }
5831
- });
5832
- if (!dropFocusBlock)
5833
- return !1;
5834
- const dragOrigin = event.dragOrigin;
5835
- if (!dragOrigin)
5836
- return !1;
5837
- const dragSelection = getDragSelection({
5838
- eventSelection: dragOrigin.selection,
5839
- snapshot
5840
- });
5841
- return getSelectedBlocks({
5842
- ...snapshot,
5843
- context: {
5844
- ...snapshot.context,
5845
- selection: dragSelection
5846
- }
5847
- }).some((draggedBlock) => draggedBlock.node._key === dropFocusBlock.node._key) || !isSelectingEntireBlocks({
5848
- ...snapshot,
5849
- context: {
5850
- ...snapshot.context,
5851
- selection: dragSelection
5852
- }
5853
- }) ? !1 : {
5854
- dropFocusBlock
5855
- };
5856
- },
5857
- actions: [({
5858
- event
5859
- }, {
5860
- dropFocusBlock
5861
- }) => [{
5862
- type: "effect",
5863
- effect: () => {
5864
- setDropPosition({
5865
- path: dropFocusBlock.path,
5866
- position: event.position.block
5867
- });
5868
- }
5869
- }]]
5870
- }),
5871
- priority: createEditorPriority({
5872
- reference: {
5873
- priority: corePriority,
5874
- importance: "lower"
5875
- }
5876
- })
5877
- }, {
5878
- behavior: defineBehavior({
5879
- on: "drag.*",
5880
- guard: ({
5881
- event
5882
- }) => event.type !== "drag.dragover",
5883
- actions: [({
5884
- event
5885
- }) => [{
5886
- type: "effect",
5887
- effect: () => {
5888
- setDropPosition(void 0);
5889
- }
5890
- }, forward(event)]]
5891
- }),
5892
- priority: createEditorPriority({
5893
- reference: {
5894
- priority: corePriority,
5895
- importance: "lower"
5896
- }
5897
- })
5898
- }];
5899
- }
5900
- function useDropPosition() {
5901
- const $ = c(3), editorActor = useContext(EditorActorContext), [dropPosition, setDropPosition] = useState();
5902
- let t0, t1;
5903
- return $[0] !== editorActor ? (t0 = () => {
5904
- const behaviorConfigs = createDropPositionBehaviorsConfig({
5905
- setDropPosition
5906
- });
5907
- for (const behaviorConfig of behaviorConfigs)
5908
- editorActor.send({
5909
- type: "add behavior",
5910
- behaviorConfig
5911
- });
5912
- return () => {
5913
- for (const behaviorConfig_0 of behaviorConfigs)
5914
- editorActor.send({
5915
- type: "remove behavior",
5916
- behaviorConfig: behaviorConfig_0
5917
- });
5918
- };
5919
- }, t1 = [editorActor, setDropPosition], $[0] = editorActor, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1), dropPosition;
5920
- }
5921
5965
  const PortableTextEditorContext = createContext(null), usePortableTextEditor = () => {
5922
5966
  const editor = useContext(PortableTextEditorContext);
5923
5967
  if (!editor)
@@ -6001,7 +6045,7 @@ function validateSelection(editorEngine, editorElement) {
6001
6045
  }
6002
6046
  }
6003
6047
  const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6004
- const $ = c(180);
6048
+ const $ = c(179);
6005
6049
  let hotkeys, onBeforeInput, onBlur, onClick, onCopy, onCut, onDrag, onDragEnd, onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop, onFocus, onPaste, propsSelection, rangeDecorations, renderAnnotation, renderBlock, renderChild, renderDecorator, renderListItem, renderPlaceholder, renderStyle, restProps, scrollSelectionIntoView;
6006
6050
  $[0] !== props ? ({
6007
6051
  hotkeys,
@@ -6056,7 +6100,7 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6056
6100
  skipSetup: t3
6057
6101
  }
6058
6102
  }, $[33] = editorEngine, $[34] = readOnly, $[35] = schema, $[36] = t1, $[37] = t3, $[38] = t4) : t4 = $[38];
6059
- const rangeDecorationsActor = useActorRef(rangeDecorationsMachine, t4), decorate = useSelector(rangeDecorationsActor, _temp2), dropPosition = useDropPosition();
6103
+ const rangeDecorationsActor = useActorRef(rangeDecorationsMachine, t4), decorate = useSelector(rangeDecorationsActor, _temp2);
6060
6104
  let t5, t6;
6061
6105
  $[39] !== rangeDecorationsActor || $[40] !== readOnly ? (t5 = () => {
6062
6106
  rangeDecorationsActor.send({
@@ -6080,13 +6124,13 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6080
6124
  }, $[47] = renderBlock, $[48] = renderChild, $[49] = renderListItem, $[50] = renderStyle, $[51] = t9) : t9 = $[51];
6081
6125
  const legacy = t9;
6082
6126
  let t10;
6083
- $[52] !== dropPosition || $[53] !== legacy || $[54] !== readOnly || $[55] !== schema ? (t10 = (eProps) => /* @__PURE__ */ jsx(RenderElement, { ...eProps, dropPosition, legacy, readOnly, schema }), $[52] = dropPosition, $[53] = legacy, $[54] = readOnly, $[55] = schema, $[56] = t10) : t10 = $[56];
6127
+ $[52] !== legacy || $[53] !== readOnly || $[54] !== schema ? (t10 = (eProps) => /* @__PURE__ */ jsx(RenderElement, { ...eProps, legacy, readOnly, schema }), $[52] = legacy, $[53] = readOnly, $[54] = schema, $[55] = t10) : t10 = $[55];
6084
6128
  const renderElement = t10;
6085
6129
  let t11;
6086
- $[57] !== readOnly || $[58] !== renderAnnotation || $[59] !== renderChild || $[60] !== renderDecorator || $[61] !== renderPlaceholder || $[62] !== schema ? (t11 = (leafProps) => /* @__PURE__ */ jsx(RenderLeaf, { ...leafProps, readOnly, renderAnnotation, renderChild, renderDecorator, renderPlaceholder, schema }), $[57] = readOnly, $[58] = renderAnnotation, $[59] = renderChild, $[60] = renderDecorator, $[61] = renderPlaceholder, $[62] = schema, $[63] = t11) : t11 = $[63];
6130
+ $[56] !== readOnly || $[57] !== renderAnnotation || $[58] !== renderChild || $[59] !== renderDecorator || $[60] !== renderPlaceholder || $[61] !== schema ? (t11 = (leafProps) => /* @__PURE__ */ jsx(RenderLeaf, { ...leafProps, readOnly, renderAnnotation, renderChild, renderDecorator, renderPlaceholder, schema }), $[56] = readOnly, $[57] = renderAnnotation, $[58] = renderChild, $[59] = renderDecorator, $[60] = renderPlaceholder, $[61] = schema, $[62] = t11) : t11 = $[62];
6087
6131
  const renderLeaf = t11, renderText = _temp3;
6088
6132
  let t12;
6089
- $[64] !== editorActor || $[65] !== editorEngine || $[66] !== propsSelection ? (t12 = () => {
6133
+ $[63] !== editorActor || $[64] !== editorEngine || $[65] !== propsSelection ? (t12 = () => {
6090
6134
  if (propsSelection) {
6091
6135
  debug.selection.enabled && debug.selection(`Selection from props ${safeStringify(propsSelection)}`);
6092
6136
  const resolvedSelection = resolveSelection(editorEngine, propsSelection);
@@ -6095,10 +6139,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6095
6139
  selection: resolvedSelection
6096
6140
  }), editorEngine.onChange());
6097
6141
  }
6098
- }, $[64] = editorActor, $[65] = editorEngine, $[66] = propsSelection, $[67] = t12) : t12 = $[67];
6142
+ }, $[63] = editorActor, $[64] = editorEngine, $[65] = propsSelection, $[66] = t12) : t12 = $[66];
6099
6143
  const restoreSelectionFromProps = t12;
6100
6144
  let t13, t14;
6101
- $[68] !== editorActor || $[69] !== rangeDecorationsActor || $[70] !== restoreSelectionFromProps ? (t13 = () => {
6145
+ $[67] !== editorActor || $[68] !== rangeDecorationsActor || $[69] !== restoreSelectionFromProps ? (t13 = () => {
6102
6146
  const onReady = editorActor.on("ready", () => {
6103
6147
  rangeDecorationsActor.send({
6104
6148
  type: "ready"
@@ -6111,13 +6155,13 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6111
6155
  return () => {
6112
6156
  onReady.unsubscribe(), onInvalidValue.unsubscribe(), onValueChanged.unsubscribe();
6113
6157
  };
6114
- }, t14 = [rangeDecorationsActor, editorActor, restoreSelectionFromProps], $[68] = editorActor, $[69] = rangeDecorationsActor, $[70] = restoreSelectionFromProps, $[71] = t13, $[72] = t14) : (t13 = $[71], t14 = $[72]), useEffect(t13, t14);
6158
+ }, t14 = [rangeDecorationsActor, editorActor, restoreSelectionFromProps], $[67] = editorActor, $[68] = rangeDecorationsActor, $[69] = restoreSelectionFromProps, $[70] = t13, $[71] = t14) : (t13 = $[70], t14 = $[71]), useEffect(t13, t14);
6115
6159
  let t15, t16;
6116
- $[73] !== hasInvalidValue || $[74] !== propsSelection || $[75] !== restoreSelectionFromProps ? (t15 = () => {
6160
+ $[72] !== hasInvalidValue || $[73] !== propsSelection || $[74] !== restoreSelectionFromProps ? (t15 = () => {
6117
6161
  propsSelection && !hasInvalidValue && restoreSelectionFromProps();
6118
- }, t16 = [hasInvalidValue, propsSelection, restoreSelectionFromProps], $[73] = hasInvalidValue, $[74] = propsSelection, $[75] = restoreSelectionFromProps, $[76] = t15, $[77] = t16) : (t15 = $[76], t16 = $[77]), useEffect(t15, t16);
6162
+ }, t16 = [hasInvalidValue, propsSelection, restoreSelectionFromProps], $[72] = hasInvalidValue, $[73] = propsSelection, $[74] = restoreSelectionFromProps, $[75] = t15, $[76] = t16) : (t15 = $[75], t16 = $[76]), useEffect(t15, t16);
6119
6163
  let t17;
6120
- $[78] !== editorActor || $[79] !== editorEngine || $[80] !== onCopy ? (t17 = (event) => {
6164
+ $[77] !== editorActor || $[78] !== editorEngine || $[79] !== onCopy ? (t17 = (event) => {
6121
6165
  if (DOMEditor.hasSelectableTarget(editorEngine, event.target)) {
6122
6166
  if (onCopy)
6123
6167
  onCopy(event) !== void 0 && event.preventDefault();
@@ -6144,10 +6188,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6144
6188
  });
6145
6189
  }
6146
6190
  }
6147
- }, $[78] = editorActor, $[79] = editorEngine, $[80] = onCopy, $[81] = t17) : t17 = $[81];
6191
+ }, $[77] = editorActor, $[78] = editorEngine, $[79] = onCopy, $[80] = t17) : t17 = $[80];
6148
6192
  const handleCopy = t17;
6149
6193
  let t18;
6150
- $[82] !== editorActor || $[83] !== editorEngine || $[84] !== onCut ? (t18 = (event_0) => {
6194
+ $[81] !== editorActor || $[82] !== editorEngine || $[83] !== onCut ? (t18 = (event_0) => {
6151
6195
  if (DOMEditor.hasSelectableTarget(editorEngine, event_0.target)) {
6152
6196
  if (onCut)
6153
6197
  onCut(event_0) !== void 0 && event_0.preventDefault();
@@ -6174,10 +6218,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6174
6218
  });
6175
6219
  }
6176
6220
  }
6177
- }, $[82] = editorActor, $[83] = editorEngine, $[84] = onCut, $[85] = t18) : t18 = $[85];
6221
+ }, $[81] = editorActor, $[82] = editorEngine, $[83] = onCut, $[84] = t18) : t18 = $[84];
6178
6222
  const handleCut = t18;
6179
6223
  let t19;
6180
- $[86] !== editorActor || $[87] !== editorEngine || $[88] !== onPaste || $[89] !== portableTextEditor || $[90] !== relay ? (t19 = (event_1) => {
6224
+ $[85] !== editorActor || $[86] !== editorEngine || $[87] !== onPaste || $[88] !== portableTextEditor || $[89] !== relay ? (t19 = (event_1) => {
6181
6225
  const value = editorEngine.snapshot.context.value, path2 = editorEngine.snapshot.context.selection?.focus.path || [], onPasteResult = onPaste?.({
6182
6226
  event: event_1,
6183
6227
  value,
@@ -6256,18 +6300,18 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6256
6300
  });
6257
6301
  }
6258
6302
  debug.behaviors("No result from custom paste handler, pasting normally");
6259
- }, $[86] = editorActor, $[87] = editorEngine, $[88] = onPaste, $[89] = portableTextEditor, $[90] = relay, $[91] = t19) : t19 = $[91];
6303
+ }, $[85] = editorActor, $[86] = editorEngine, $[87] = onPaste, $[88] = portableTextEditor, $[89] = relay, $[90] = t19) : t19 = $[90];
6260
6304
  const handlePaste = t19;
6261
6305
  let t20;
6262
- $[92] !== editorEngine || $[93] !== onFocus || $[94] !== relay ? (t20 = (event_2) => {
6306
+ $[91] !== editorEngine || $[92] !== onFocus || $[93] !== relay ? (t20 = (event_2) => {
6263
6307
  onFocus && onFocus(event_2), event_2.isDefaultPrevented() || (relay.send({
6264
6308
  type: "focused",
6265
6309
  event: event_2
6266
6310
  }), !editorEngine.snapshot.context.selection && editorEngine.snapshot.context.value.length === 1 && isEmptyTextBlock(editorEngine.snapshot.context, editorEngine.snapshot.context.value.at(0)) && (editorEngine.select(start(editorEngine, [])), editorEngine.onChange()));
6267
- }, $[92] = editorEngine, $[93] = onFocus, $[94] = relay, $[95] = t20) : t20 = $[95];
6311
+ }, $[91] = editorEngine, $[92] = onFocus, $[93] = relay, $[94] = t20) : t20 = $[94];
6268
6312
  const handleOnFocus = t20;
6269
6313
  let t21;
6270
- $[96] !== editorActor || $[97] !== editorEngine || $[98] !== onClick ? (t21 = (event_3) => {
6314
+ $[95] !== editorActor || $[96] !== editorEngine || $[97] !== onClick ? (t21 = (event_3) => {
6271
6315
  if (onClick && onClick(event_3), event_3.isDefaultPrevented() || event_3.isPropagationStopped())
6272
6316
  return;
6273
6317
  const position_3 = getEventPosition({
@@ -6284,23 +6328,23 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6284
6328
  editor: editorEngine,
6285
6329
  nativeEvent: event_3
6286
6330
  });
6287
- }, $[96] = editorActor, $[97] = editorEngine, $[98] = onClick, $[99] = t21) : t21 = $[99];
6331
+ }, $[95] = editorActor, $[96] = editorEngine, $[97] = onClick, $[98] = t21) : t21 = $[98];
6288
6332
  const handleClick = t21;
6289
6333
  let t22;
6290
- $[100] !== onBlur || $[101] !== relay ? (t22 = (event_4) => {
6334
+ $[99] !== onBlur || $[100] !== relay ? (t22 = (event_4) => {
6291
6335
  onBlur && onBlur(event_4), event_4.isPropagationStopped() || relay.send({
6292
6336
  type: "blurred",
6293
6337
  event: event_4
6294
6338
  });
6295
- }, $[100] = onBlur, $[101] = relay, $[102] = t22) : t22 = $[102];
6339
+ }, $[99] = onBlur, $[100] = relay, $[101] = t22) : t22 = $[101];
6296
6340
  const handleOnBlur = t22;
6297
6341
  let t23;
6298
- $[103] !== onBeforeInput ? (t23 = (event_5) => {
6342
+ $[102] !== onBeforeInput ? (t23 = (event_5) => {
6299
6343
  onBeforeInput && onBeforeInput(event_5);
6300
- }, $[103] = onBeforeInput, $[104] = t23) : t23 = $[104];
6344
+ }, $[102] = onBeforeInput, $[103] = t23) : t23 = $[103];
6301
6345
  const handleOnBeforeInput = t23;
6302
6346
  let t24;
6303
- $[105] !== editorActor || $[106] !== editorEngine || $[107] !== hotkeys || $[108] !== portableTextEditor || $[109] !== props ? (t24 = (event_6) => {
6347
+ $[104] !== editorActor || $[105] !== editorEngine || $[106] !== hotkeys || $[107] !== portableTextEditor || $[108] !== props ? (t24 = (event_6) => {
6304
6348
  props.onKeyDown && props.onKeyDown(event_6), event_6.isDefaultPrevented() || performHotkey({
6305
6349
  editorActor,
6306
6350
  editor: editorEngine,
@@ -6323,10 +6367,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6323
6367
  editor: editorEngine,
6324
6368
  nativeEvent: event_6
6325
6369
  });
6326
- }, $[105] = editorActor, $[106] = editorEngine, $[107] = hotkeys, $[108] = portableTextEditor, $[109] = props, $[110] = t24) : t24 = $[110];
6370
+ }, $[104] = editorActor, $[105] = editorEngine, $[106] = hotkeys, $[107] = portableTextEditor, $[108] = props, $[109] = t24) : t24 = $[109];
6327
6371
  const handleKeyDown = t24;
6328
6372
  let t25;
6329
- $[111] !== editorActor || $[112] !== editorEngine || $[113] !== props ? (t25 = (event_7) => {
6373
+ $[110] !== editorActor || $[111] !== editorEngine || $[112] !== props ? (t25 = (event_7) => {
6330
6374
  props.onKeyUp && props.onKeyUp(event_7), event_7.isDefaultPrevented() || editorActor.send({
6331
6375
  type: "behavior event",
6332
6376
  behaviorEvent: {
@@ -6343,7 +6387,7 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6343
6387
  editor: editorEngine,
6344
6388
  nativeEvent: event_7
6345
6389
  });
6346
- }, $[111] = editorActor, $[112] = editorEngine, $[113] = props, $[114] = t25) : t25 = $[114];
6390
+ }, $[110] = editorActor, $[111] = editorEngine, $[112] = props, $[113] = t25) : t25 = $[113];
6347
6391
  const handleKeyUp = t25;
6348
6392
  let t26;
6349
6393
  bb0: {
@@ -6356,13 +6400,13 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6356
6400
  break bb0;
6357
6401
  }
6358
6402
  let t272;
6359
- $[115] !== portableTextEditor || $[116] !== scrollSelectionIntoView ? (t272 = (_editor, domRange) => {
6403
+ $[114] !== portableTextEditor || $[115] !== scrollSelectionIntoView ? (t272 = (_editor, domRange) => {
6360
6404
  scrollSelectionIntoView(portableTextEditor, domRange);
6361
- }, $[115] = portableTextEditor, $[116] = scrollSelectionIntoView, $[117] = t272) : t272 = $[117], t26 = t272;
6405
+ }, $[114] = portableTextEditor, $[115] = scrollSelectionIntoView, $[116] = t272) : t272 = $[116], t26 = t272;
6362
6406
  }
6363
6407
  const scrollSelectionIntoViewToEngine = t26;
6364
6408
  let t27, t28;
6365
- $[118] !== editorActor || $[119] !== editorEngine ? (t27 = () => {
6409
+ $[117] !== editorActor || $[118] !== editorEngine ? (t27 = () => {
6366
6410
  const window2 = DOMEditor.getWindow(editorEngine), onDragEnd_0 = () => {
6367
6411
  editorActor.send({
6368
6412
  type: "dragend"
@@ -6375,9 +6419,9 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6375
6419
  return window2.document.addEventListener("dragend", onDragEnd_0), window2.document.addEventListener("drop", onDrop_0), () => {
6376
6420
  window2.document.removeEventListener("dragend", onDragEnd_0), window2.document.removeEventListener("drop", onDrop_0);
6377
6421
  };
6378
- }, t28 = [editorEngine, editorActor], $[118] = editorActor, $[119] = editorEngine, $[120] = t27, $[121] = t28) : (t27 = $[120], t28 = $[121]), useEffect(t27, t28);
6422
+ }, t28 = [editorEngine, editorActor], $[117] = editorActor, $[118] = editorEngine, $[119] = t27, $[120] = t28) : (t27 = $[119], t28 = $[120]), useEffect(t27, t28);
6379
6423
  let t29;
6380
- $[122] !== editorActor || $[123] !== editorEngine || $[124] !== onDragStart || $[125] !== readOnly ? (t29 = (event_8) => {
6424
+ $[121] !== editorActor || $[122] !== editorEngine || $[123] !== onDragStart || $[124] !== readOnly ? (t29 = (event_8) => {
6381
6425
  if (readOnly || !DOMEditor.hasTarget(editorEngine, event_8.target) || (onDragStart?.(event_8), event_8.isDefaultPrevented() || event_8.isPropagationStopped()))
6382
6426
  return;
6383
6427
  const position_4 = getEventPosition({
@@ -6405,10 +6449,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6405
6449
  },
6406
6450
  editor: editorEngine
6407
6451
  }), !0;
6408
- }, $[122] = editorActor, $[123] = editorEngine, $[124] = onDragStart, $[125] = readOnly, $[126] = t29) : t29 = $[126];
6452
+ }, $[121] = editorActor, $[122] = editorEngine, $[123] = onDragStart, $[124] = readOnly, $[125] = t29) : t29 = $[125];
6409
6453
  const handleDragStart = t29;
6410
6454
  let t30;
6411
- $[127] !== editorActor || $[128] !== editorEngine || $[129] !== onDrag ? (t30 = (event_9) => {
6455
+ $[126] !== editorActor || $[127] !== editorEngine || $[128] !== onDrag ? (t30 = (event_9) => {
6412
6456
  if (onDrag?.(event_9), !(event_9.isDefaultPrevented() || event_9.isPropagationStopped() || !getEventPosition({
6413
6457
  editorActor,
6414
6458
  editorEngine,
@@ -6424,10 +6468,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6424
6468
  },
6425
6469
  editor: editorEngine
6426
6470
  }), !0;
6427
- }, $[127] = editorActor, $[128] = editorEngine, $[129] = onDrag, $[130] = t30) : t30 = $[130];
6471
+ }, $[126] = editorActor, $[127] = editorEngine, $[128] = onDrag, $[129] = t30) : t30 = $[129];
6428
6472
  const handleDrag = t30;
6429
6473
  let t31;
6430
- $[131] !== editorActor || $[132] !== editorEngine || $[133] !== onDragEnd ? (t31 = (event_10) => {
6474
+ $[130] !== editorActor || $[131] !== editorEngine || $[132] !== onDragEnd ? (t31 = (event_10) => {
6431
6475
  if (onDragEnd?.(event_10), !(event_10.isDefaultPrevented() || event_10.isPropagationStopped()))
6432
6476
  return editorActor.send({
6433
6477
  type: "behavior event",
@@ -6439,10 +6483,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6439
6483
  },
6440
6484
  editor: editorEngine
6441
6485
  }), !0;
6442
- }, $[131] = editorActor, $[132] = editorEngine, $[133] = onDragEnd, $[134] = t31) : t31 = $[134];
6486
+ }, $[130] = editorActor, $[131] = editorEngine, $[132] = onDragEnd, $[133] = t31) : t31 = $[133];
6443
6487
  const handleDragEnd = t31;
6444
6488
  let t32;
6445
- $[135] !== editorActor || $[136] !== editorEngine || $[137] !== onDragEnter ? (t32 = (event_11) => {
6489
+ $[134] !== editorActor || $[135] !== editorEngine || $[136] !== onDragEnter ? (t32 = (event_11) => {
6446
6490
  if (onDragEnter?.(event_11), event_11.isDefaultPrevented() || event_11.isPropagationStopped())
6447
6491
  return;
6448
6492
  const position_6 = getEventPosition({
@@ -6462,10 +6506,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6462
6506
  },
6463
6507
  editor: editorEngine
6464
6508
  }), !0;
6465
- }, $[135] = editorActor, $[136] = editorEngine, $[137] = onDragEnter, $[138] = t32) : t32 = $[138];
6509
+ }, $[134] = editorActor, $[135] = editorEngine, $[136] = onDragEnter, $[137] = t32) : t32 = $[137];
6466
6510
  const handleDragEnter = t32;
6467
6511
  let t33;
6468
- $[139] !== editorActor || $[140] !== editorEngine || $[141] !== onDragOver ? (t33 = (event_12) => {
6512
+ $[138] !== editorActor || $[139] !== editorEngine || $[140] !== onDragOver ? (t33 = (event_12) => {
6469
6513
  if (onDragOver?.(event_12), event_12.isDefaultPrevented() || event_12.isPropagationStopped())
6470
6514
  return;
6471
6515
  const position_7 = getEventPosition({
@@ -6487,10 +6531,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6487
6531
  editor: editorEngine,
6488
6532
  nativeEvent: event_12
6489
6533
  }), !0;
6490
- }, $[139] = editorActor, $[140] = editorEngine, $[141] = onDragOver, $[142] = t33) : t33 = $[142];
6534
+ }, $[138] = editorActor, $[139] = editorEngine, $[140] = onDragOver, $[141] = t33) : t33 = $[141];
6491
6535
  const handleDragOver = t33;
6492
6536
  let t34;
6493
- $[143] !== editorActor || $[144] !== editorEngine || $[145] !== onDrop ? (t34 = (event_13) => {
6537
+ $[142] !== editorActor || $[143] !== editorEngine || $[144] !== onDrop ? (t34 = (event_13) => {
6494
6538
  if (onDrop?.(event_13), event_13.isDefaultPrevented() || event_13.isPropagationStopped())
6495
6539
  return;
6496
6540
  const position_8 = getEventPosition({
@@ -6515,10 +6559,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6515
6559
  editor: editorEngine,
6516
6560
  nativeEvent: event_13
6517
6561
  }), !0;
6518
- }, $[143] = editorActor, $[144] = editorEngine, $[145] = onDrop, $[146] = t34) : t34 = $[146];
6562
+ }, $[142] = editorActor, $[143] = editorEngine, $[144] = onDrop, $[145] = t34) : t34 = $[145];
6519
6563
  const handleDrop = t34;
6520
6564
  let t35;
6521
- $[147] !== editorActor || $[148] !== editorEngine || $[149] !== onDragLeave ? (t35 = (event_14) => {
6565
+ $[146] !== editorActor || $[147] !== editorEngine || $[148] !== onDragLeave ? (t35 = (event_14) => {
6522
6566
  if (onDragLeave?.(event_14), !(event_14.isDefaultPrevented() || event_14.isPropagationStopped() || !getEventPosition({
6523
6567
  editorActor,
6524
6568
  editorEngine,
@@ -6534,10 +6578,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6534
6578
  },
6535
6579
  editor: editorEngine
6536
6580
  }), !0;
6537
- }, $[147] = editorActor, $[148] = editorEngine, $[149] = onDragLeave, $[150] = t35) : t35 = $[150];
6581
+ }, $[146] = editorActor, $[147] = editorEngine, $[148] = onDragLeave, $[149] = t35) : t35 = $[149];
6538
6582
  const handleDragLeave = t35;
6539
6583
  let t36;
6540
- $[151] !== forwardedRef || $[152] !== validateSelectionActor ? (t36 = (editorElement) => {
6584
+ $[150] !== forwardedRef || $[151] !== validateSelectionActor ? (t36 = (editorElement) => {
6541
6585
  if (typeof forwardedRef == "function" ? forwardedRef(editorElement) : forwardedRef && (forwardedRef.current = editorElement), editorElement) {
6542
6586
  const mutationObserver = new MutationObserver(() => {
6543
6587
  validateSelectionActor.send({
@@ -6555,12 +6599,12 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
6555
6599
  mutationObserver.disconnect();
6556
6600
  };
6557
6601
  }
6558
- }, $[151] = forwardedRef, $[152] = validateSelectionActor, $[153] = t36) : t36 = $[153];
6602
+ }, $[150] = forwardedRef, $[151] = validateSelectionActor, $[152] = t36) : t36 = $[152];
6559
6603
  const callbackRef = t36;
6560
6604
  if (!portableTextEditor)
6561
6605
  return null;
6562
6606
  let t37;
6563
- return $[154] !== callbackRef || $[155] !== decorate || $[156] !== editorActor || $[157] !== handleClick || $[158] !== handleCopy || $[159] !== handleCut || $[160] !== handleDrag || $[161] !== handleDragEnd || $[162] !== handleDragEnter || $[163] !== handleDragLeave || $[164] !== handleDragOver || $[165] !== handleDragStart || $[166] !== handleDrop || $[167] !== handleKeyDown || $[168] !== handleKeyUp || $[169] !== handleOnBeforeInput || $[170] !== handleOnBlur || $[171] !== handleOnFocus || $[172] !== handlePaste || $[173] !== hasInvalidValue || $[174] !== readOnly || $[175] !== renderElement || $[176] !== renderLeaf || $[177] !== restProps || $[178] !== scrollSelectionIntoViewToEngine ? (t37 = hasInvalidValue ? null : /* @__PURE__ */ jsx(SelectionStateProvider, { children: /* @__PURE__ */ jsx(Editable, { ...restProps, ref: callbackRef, editorActor, "data-read-only": readOnly, autoFocus: !1, className: restProps.className || "pt-editable", decorate, onBlur: handleOnBlur, onCopy: handleCopy, onCut: handleCut, onClick: handleClick, onDOMBeforeInput: handleOnBeforeInput, onDragStart: handleDragStart, onDrag: handleDrag, onDragEnd: handleDragEnd, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDrop: handleDrop, onDragLeave: handleDragLeave, onFocus: handleOnFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onPaste: handlePaste, readOnly, renderElement, renderLeaf, renderText, scrollSelectionIntoView: scrollSelectionIntoViewToEngine }) }), $[154] = callbackRef, $[155] = decorate, $[156] = editorActor, $[157] = handleClick, $[158] = handleCopy, $[159] = handleCut, $[160] = handleDrag, $[161] = handleDragEnd, $[162] = handleDragEnter, $[163] = handleDragLeave, $[164] = handleDragOver, $[165] = handleDragStart, $[166] = handleDrop, $[167] = handleKeyDown, $[168] = handleKeyUp, $[169] = handleOnBeforeInput, $[170] = handleOnBlur, $[171] = handleOnFocus, $[172] = handlePaste, $[173] = hasInvalidValue, $[174] = readOnly, $[175] = renderElement, $[176] = renderLeaf, $[177] = restProps, $[178] = scrollSelectionIntoViewToEngine, $[179] = t37) : t37 = $[179], t37;
6607
+ return $[153] !== callbackRef || $[154] !== decorate || $[155] !== editorActor || $[156] !== handleClick || $[157] !== handleCopy || $[158] !== handleCut || $[159] !== handleDrag || $[160] !== handleDragEnd || $[161] !== handleDragEnter || $[162] !== handleDragLeave || $[163] !== handleDragOver || $[164] !== handleDragStart || $[165] !== handleDrop || $[166] !== handleKeyDown || $[167] !== handleKeyUp || $[168] !== handleOnBeforeInput || $[169] !== handleOnBlur || $[170] !== handleOnFocus || $[171] !== handlePaste || $[172] !== hasInvalidValue || $[173] !== readOnly || $[174] !== renderElement || $[175] !== renderLeaf || $[176] !== restProps || $[177] !== scrollSelectionIntoViewToEngine ? (t37 = hasInvalidValue ? null : /* @__PURE__ */ jsx(SelectionStateProvider, { children: /* @__PURE__ */ jsx(DropPositionStateProvider, { children: /* @__PURE__ */ jsx(Editable, { ...restProps, ref: callbackRef, editorActor, "data-read-only": readOnly, autoFocus: !1, className: restProps.className || "pt-editable", decorate, onBlur: handleOnBlur, onCopy: handleCopy, onCut: handleCut, onClick: handleClick, onDOMBeforeInput: handleOnBeforeInput, onDragStart: handleDragStart, onDrag: handleDrag, onDragEnd: handleDragEnd, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDrop: handleDrop, onDragLeave: handleDragLeave, onFocus: handleOnFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onPaste: handlePaste, readOnly, renderElement, renderLeaf, renderText, scrollSelectionIntoView: scrollSelectionIntoViewToEngine }) }) }), $[153] = callbackRef, $[154] = decorate, $[155] = editorActor, $[156] = handleClick, $[157] = handleCopy, $[158] = handleCut, $[159] = handleDrag, $[160] = handleDragEnd, $[161] = handleDragEnter, $[162] = handleDragLeave, $[163] = handleDragOver, $[164] = handleDragStart, $[165] = handleDrop, $[166] = handleKeyDown, $[167] = handleKeyUp, $[168] = handleOnBeforeInput, $[169] = handleOnBlur, $[170] = handleOnFocus, $[171] = handlePaste, $[172] = hasInvalidValue, $[173] = readOnly, $[174] = renderElement, $[175] = renderLeaf, $[176] = restProps, $[177] = scrollSelectionIntoViewToEngine, $[178] = t37) : t37 = $[178], t37;
6564
6608
  });
6565
6609
  PortableTextEditable.displayName = "ForwardRef(PortableTextEditable)";
6566
6610
  function noop() {