@portabletext/editor 7.5.1 → 7.6.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.
- package/lib/_chunks-dts/behavior.types.action.d.ts +4 -4
- package/lib/_chunks-es/get-parent.js +37 -19
- package/lib/_chunks-es/get-parent.js.map +1 -1
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js +2 -3
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js.map +1 -1
- package/lib/index.js +311 -283
- package/lib/index.js.map +1 -1
- package/lib/traversal/index.d.ts +23 -2
- package/lib/traversal/index.d.ts.map +1 -1
- package/lib/traversal/index.js +2 -1
- package/package.json +2 -2
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,
|
|
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$
|
|
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$
|
|
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}]`);
|
|
@@ -4244,7 +4244,230 @@ function getSelectionFromEvent(editor, event) {
|
|
|
4244
4244
|
function isEventContainer(editorEngine, eventNode, eventPath) {
|
|
4245
4245
|
return isEditor(eventNode) ? !0 : isEditableContainer(editorEngine.snapshot, eventNode, eventPath);
|
|
4246
4246
|
}
|
|
4247
|
-
|
|
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 = {
|
|
4248
4471
|
alt: "altKey",
|
|
4249
4472
|
control: "ctrlKey",
|
|
4250
4473
|
meta: "metaKey",
|
|
@@ -4961,7 +5184,7 @@ function RenderBlockObject(props) {
|
|
|
4961
5184
|
const $ = c(50), blockObjectRef = useRef(null);
|
|
4962
5185
|
let t0;
|
|
4963
5186
|
$[0] !== props.path ? (t0 = serializePath(props.path), $[0] = props.path, $[1] = t0) : t0 = $[1];
|
|
4964
|
-
const serializedPath = t0, selected = useIsSelectedLeaf(serializedPath), focused = useIsFocusedLeaf(serializedPath);
|
|
5187
|
+
const serializedPath = t0, selected = useIsSelectedLeaf(serializedPath), focused = useIsFocusedLeaf(serializedPath), dropPosition = useElementDropPosition(props.path);
|
|
4965
5188
|
let t1;
|
|
4966
5189
|
if ($[2] !== props.element || $[3] !== props.schema.blockObjects) {
|
|
4967
5190
|
let t22;
|
|
@@ -5026,12 +5249,12 @@ function RenderBlockObject(props) {
|
|
|
5026
5249
|
}, $[33] = props.attributes, $[34] = props.element._key, $[35] = props.element._type, $[36] = t3) : t3 = $[36];
|
|
5027
5250
|
const attributes = t3;
|
|
5028
5251
|
let t4;
|
|
5029
|
-
$[37] !==
|
|
5252
|
+
$[37] !== dropPosition ? (t4 = dropPosition === "start" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[37] = dropPosition, $[38] = t4) : t4 = $[38];
|
|
5030
5253
|
const t5 = !props.readOnly;
|
|
5031
5254
|
let t6;
|
|
5032
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];
|
|
5033
5256
|
let t7;
|
|
5034
|
-
$[42] !==
|
|
5257
|
+
$[42] !== dropPosition ? (t7 = dropPosition === "end" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[42] = dropPosition, $[43] = t7) : t7 = $[43];
|
|
5035
5258
|
let t8;
|
|
5036
5259
|
return $[44] !== attributes || $[45] !== props.children || $[46] !== t4 || $[47] !== t6 || $[48] !== t7 ? (t8 = /* @__PURE__ */ jsxs("div", { ...attributes, children: [
|
|
5037
5260
|
t4,
|
|
@@ -5191,7 +5414,7 @@ function RenderTextBlock(props) {
|
|
|
5191
5414
|
const schemaType = t1;
|
|
5192
5415
|
let t2;
|
|
5193
5416
|
$[5] !== props.path ? (t2 = serializePath(props.path), $[5] = props.path, $[6] = t2) : t2 = $[6];
|
|
5194
|
-
const serializedPath = t2, selected = useIsSelectedContainer(serializedPath), focused = useIsFocusedContainer(serializedPath);
|
|
5417
|
+
const serializedPath = t2, selected = useIsSelectedContainer(serializedPath), focused = useIsFocusedContainer(serializedPath), dropPosition = useElementDropPosition(props.path);
|
|
5195
5418
|
let t3;
|
|
5196
5419
|
$[7] !== serializedPath ? (t3 = (editor) => editor.listIndexMap.get(serializedPath), $[7] = serializedPath, $[8] = t3) : t3 = $[8];
|
|
5197
5420
|
const listIndex = useEngineSelector(t3), subSchema = useBlockSubSchema(props.path);
|
|
@@ -5254,7 +5477,7 @@ function RenderTextBlock(props) {
|
|
|
5254
5477
|
"data-list-index": listIndex
|
|
5255
5478
|
} : {}, $[52] = listIndex, $[53] = t12) : t12 = $[53];
|
|
5256
5479
|
let t13;
|
|
5257
|
-
$[54] !==
|
|
5480
|
+
$[54] !== dropPosition ? (t13 = dropPosition === "start" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[54] = dropPosition, $[55] = t13) : t13 = $[55];
|
|
5258
5481
|
let t14;
|
|
5259
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: [{
|
|
5260
5483
|
_key: props.textBlock._key
|
|
@@ -5262,7 +5485,7 @@ function RenderTextBlock(props) {
|
|
|
5262
5485
|
let t15;
|
|
5263
5486
|
$[63] !== t14 ? (t15 = /* @__PURE__ */ jsx("div", { ref: blockRef, children: t14 }), $[63] = t14, $[64] = t15) : t15 = $[64];
|
|
5264
5487
|
let t16;
|
|
5265
|
-
$[65] !==
|
|
5488
|
+
$[65] !== dropPosition ? (t16 = dropPosition === "end" ? /* @__PURE__ */ jsx(DropIndicator, {}) : null, $[65] = dropPosition, $[66] = t16) : t16 = $[66];
|
|
5266
5489
|
let t17;
|
|
5267
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: [
|
|
5268
5491
|
t13,
|
|
@@ -5342,10 +5565,6 @@ function RenderStyle({
|
|
|
5342
5565
|
value
|
|
5343
5566
|
});
|
|
5344
5567
|
}
|
|
5345
|
-
function resolveElementDropPosition(dropPosition, elementPath) {
|
|
5346
|
-
if (dropPosition && pathEquals(dropPosition.path, elementPath))
|
|
5347
|
-
return dropPosition.position;
|
|
5348
|
-
}
|
|
5349
5568
|
function tupleRefEqual(previous, next) {
|
|
5350
5569
|
if (previous === null || previous.length !== next.length)
|
|
5351
5570
|
return !1;
|
|
@@ -5355,7 +5574,7 @@ function tupleRefEqual(previous, next) {
|
|
|
5355
5574
|
return !0;
|
|
5356
5575
|
}
|
|
5357
5576
|
function RenderElement(props) {
|
|
5358
|
-
const $ = c(
|
|
5577
|
+
const $ = c(75), parentContainer = useContext(ParentContainerContext), parentTextBlock = useContext(ParentTextBlockContext), isInNewPipeline = useContext(NewPipelineContext), engineStatic = useEngineStatic(), schema = props.schema, type = props.element._type;
|
|
5359
5578
|
let t0;
|
|
5360
5579
|
$[0] !== parentContainer || $[1] !== type ? (t0 = findBlockPositionalOverride(parentContainer, type), $[0] = parentContainer, $[1] = type, $[2] = t0) : t0 = $[2];
|
|
5361
5580
|
const blockPositionalOverride = t0;
|
|
@@ -5437,14 +5656,14 @@ function RenderElement(props) {
|
|
|
5437
5656
|
if (containerConfig) {
|
|
5438
5657
|
let t82;
|
|
5439
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];
|
|
5440
|
-
let
|
|
5441
|
-
return $[15] !== containerConfig || $[16] !== t82 ? (
|
|
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;
|
|
5442
5661
|
}
|
|
5443
5662
|
if (isTextBlock({
|
|
5444
5663
|
schema
|
|
5445
5664
|
}, props.element)) {
|
|
5446
5665
|
let rendered;
|
|
5447
|
-
if ($[18] !== isInNewPipeline || $[19] !== props.attributes || $[20] !== props.children || $[21] !== props.
|
|
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) {
|
|
5448
5667
|
const {
|
|
5449
5668
|
"data-slate-node": _sn,
|
|
5450
5669
|
...rest
|
|
@@ -5463,80 +5682,74 @@ function RenderElement(props) {
|
|
|
5463
5682
|
children: props.children
|
|
5464
5683
|
});
|
|
5465
5684
|
else {
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
$[29] !== props.dropPosition || $[30] !== props.path ? (t92 = resolveElementDropPosition(props.dropPosition, props.path), $[29] = props.dropPosition, $[30] = props.path, $[31] = t92) : t92 = $[31];
|
|
5469
|
-
let t102;
|
|
5470
|
-
$[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;
|
|
5471
5687
|
}
|
|
5472
|
-
$[18] = isInNewPipeline, $[19] = props.attributes, $[20] = props.children, $[21] = props.
|
|
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;
|
|
5473
5689
|
} else
|
|
5474
|
-
rendered = $[
|
|
5690
|
+
rendered = $[27];
|
|
5475
5691
|
if (textBlockScope) {
|
|
5476
5692
|
let t82;
|
|
5477
|
-
return $[
|
|
5693
|
+
return $[36] !== rendered || $[37] !== textBlockScope ? (t82 = /* @__PURE__ */ jsx(ParentTextBlockContext.Provider, { value: textBlockScope, children: rendered }), $[36] = rendered, $[37] = textBlockScope, $[38] = t82) : t82 = $[38], t82;
|
|
5478
5694
|
}
|
|
5479
5695
|
return rendered;
|
|
5480
5696
|
}
|
|
5481
5697
|
if (isInline(engineStatic.snapshot, props.path)) {
|
|
5482
5698
|
if (isInNewPipeline && !inlineObjectConfig) {
|
|
5483
5699
|
let rest_0;
|
|
5484
|
-
if ($[
|
|
5700
|
+
if ($[39] !== props.attributes) {
|
|
5485
5701
|
const {
|
|
5486
5702
|
"data-slate-node": _sn_0,
|
|
5487
5703
|
"data-slate-void": _sv,
|
|
5488
5704
|
...t84
|
|
5489
5705
|
} = props.attributes;
|
|
5490
|
-
rest_0 = t84, $[
|
|
5706
|
+
rest_0 = t84, $[39] = props.attributes, $[40] = rest_0;
|
|
5491
5707
|
} else
|
|
5492
|
-
rest_0 = $[
|
|
5708
|
+
rest_0 = $[40];
|
|
5493
5709
|
let t83;
|
|
5494
|
-
$[
|
|
5710
|
+
$[41] !== props.element._key || $[42] !== props.element._type ? (t83 = /* @__PURE__ */ jsxs("span", { contentEditable: !1, children: [
|
|
5495
5711
|
"[",
|
|
5496
5712
|
props.element._type,
|
|
5497
5713
|
": ",
|
|
5498
5714
|
props.element._key,
|
|
5499
5715
|
"]"
|
|
5500
|
-
] }), $[
|
|
5501
|
-
let
|
|
5502
|
-
return $[
|
|
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: [
|
|
5503
5719
|
props.children,
|
|
5504
5720
|
t83
|
|
5505
|
-
] }), $[
|
|
5721
|
+
] }), $[44] = props.children, $[45] = rest_0, $[46] = t83, $[47] = t9) : t9 = $[47], t9;
|
|
5506
5722
|
}
|
|
5507
5723
|
let t82;
|
|
5508
|
-
return $[
|
|
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;
|
|
5509
5725
|
}
|
|
5510
5726
|
if (isInNewPipeline && !blockObjectConfig) {
|
|
5511
5727
|
let rest_1;
|
|
5512
|
-
if ($[
|
|
5728
|
+
if ($[57] !== props.attributes) {
|
|
5513
5729
|
const {
|
|
5514
5730
|
"data-slate-node": _sn_1,
|
|
5515
5731
|
"data-slate-void": _sv_0,
|
|
5516
5732
|
...t83
|
|
5517
5733
|
} = props.attributes;
|
|
5518
|
-
rest_1 = t83, $[
|
|
5734
|
+
rest_1 = t83, $[57] = props.attributes, $[58] = rest_1;
|
|
5519
5735
|
} else
|
|
5520
|
-
rest_1 = $[
|
|
5736
|
+
rest_1 = $[58];
|
|
5521
5737
|
let t82;
|
|
5522
|
-
$[
|
|
5738
|
+
$[59] !== props.element._key || $[60] !== props.element._type ? (t82 = /* @__PURE__ */ jsxs("div", { contentEditable: !1, children: [
|
|
5523
5739
|
"[",
|
|
5524
5740
|
props.element._type,
|
|
5525
5741
|
": ",
|
|
5526
5742
|
props.element._key,
|
|
5527
5743
|
"]"
|
|
5528
|
-
] }), $[
|
|
5529
|
-
let
|
|
5530
|
-
return $[
|
|
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: [
|
|
5531
5747
|
props.children,
|
|
5532
5748
|
t82
|
|
5533
|
-
] }), $[
|
|
5749
|
+
] }), $[62] = props.children, $[63] = rest_1, $[64] = t82, $[65] = t9) : t9 = $[65], t9;
|
|
5534
5750
|
}
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
$[71] !== props.dropPosition || $[72] !== props.path ? (t10 = resolveElementDropPosition(props.dropPosition, props.path), $[71] = props.dropPosition, $[72] = props.path, $[73] = t10) : t10 = $[73];
|
|
5538
|
-
let t11;
|
|
5539
|
-
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;
|
|
5540
5753
|
}
|
|
5541
5754
|
function RenderTextBlockConfig(props) {
|
|
5542
5755
|
const $ = c(11);
|
|
@@ -5749,191 +5962,6 @@ function RenderText(props) {
|
|
|
5749
5962
|
let t0;
|
|
5750
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;
|
|
5751
5964
|
}
|
|
5752
|
-
function createEditorPriority(config) {
|
|
5753
|
-
return {
|
|
5754
|
-
id: defaultKeyGenerator(),
|
|
5755
|
-
name: config?.name,
|
|
5756
|
-
reference: config?.reference
|
|
5757
|
-
};
|
|
5758
|
-
}
|
|
5759
|
-
const corePriority = createEditorPriority({
|
|
5760
|
-
name: "core"
|
|
5761
|
-
});
|
|
5762
|
-
function getDragSelection({
|
|
5763
|
-
eventSelection,
|
|
5764
|
-
snapshot
|
|
5765
|
-
}) {
|
|
5766
|
-
let dragSelection = eventSelection;
|
|
5767
|
-
if (getFocusInlineObject({
|
|
5768
|
-
...snapshot,
|
|
5769
|
-
context: {
|
|
5770
|
-
...snapshot.context,
|
|
5771
|
-
selection: eventSelection
|
|
5772
|
-
}
|
|
5773
|
-
}))
|
|
5774
|
-
return dragSelection;
|
|
5775
|
-
const draggingCollapsedSelection = isSelectionCollapsed$1({
|
|
5776
|
-
context: {
|
|
5777
|
-
...snapshot.context,
|
|
5778
|
-
selection: eventSelection
|
|
5779
|
-
}
|
|
5780
|
-
}), draggedTextBlock = getFocusTextBlock({
|
|
5781
|
-
...snapshot,
|
|
5782
|
-
context: {
|
|
5783
|
-
...snapshot.context,
|
|
5784
|
-
selection: eventSelection
|
|
5785
|
-
}
|
|
5786
|
-
}), draggedSpan = getFocusSpan({
|
|
5787
|
-
...snapshot,
|
|
5788
|
-
context: {
|
|
5789
|
-
...snapshot.context,
|
|
5790
|
-
selection: eventSelection
|
|
5791
|
-
}
|
|
5792
|
-
});
|
|
5793
|
-
draggingCollapsedSelection && draggedTextBlock && draggedSpan && (dragSelection = {
|
|
5794
|
-
anchor: getBlockStartPoint({
|
|
5795
|
-
context: snapshot.context,
|
|
5796
|
-
block: draggedTextBlock
|
|
5797
|
-
}),
|
|
5798
|
-
focus: getBlockEndPoint({
|
|
5799
|
-
context: snapshot.context,
|
|
5800
|
-
block: draggedTextBlock
|
|
5801
|
-
})
|
|
5802
|
-
});
|
|
5803
|
-
const selectedBlocks = getFragment(snapshot);
|
|
5804
|
-
if (snapshot.context.selection && isSelectionExpanded(snapshot) && selectedBlocks.length > 1) {
|
|
5805
|
-
const selectionStartBlock = getSelectionStartBlock(snapshot), selectionEndBlock = getSelectionEndBlock(snapshot);
|
|
5806
|
-
if (!selectionStartBlock || !selectionEndBlock)
|
|
5807
|
-
return dragSelection;
|
|
5808
|
-
const selectionStartPoint = getBlockStartPoint({
|
|
5809
|
-
context: snapshot.context,
|
|
5810
|
-
block: selectionStartBlock
|
|
5811
|
-
}), selectionEndPoint = getBlockEndPoint({
|
|
5812
|
-
context: snapshot.context,
|
|
5813
|
-
block: selectionEndBlock
|
|
5814
|
-
});
|
|
5815
|
-
isOverlappingSelection(eventSelection)({
|
|
5816
|
-
...snapshot,
|
|
5817
|
-
context: {
|
|
5818
|
-
...snapshot.context,
|
|
5819
|
-
selection: {
|
|
5820
|
-
anchor: selectionStartPoint,
|
|
5821
|
-
focus: selectionEndPoint
|
|
5822
|
-
}
|
|
5823
|
-
}
|
|
5824
|
-
}) && (dragSelection = {
|
|
5825
|
-
anchor: selectionStartPoint,
|
|
5826
|
-
focus: selectionEndPoint
|
|
5827
|
-
});
|
|
5828
|
-
}
|
|
5829
|
-
return dragSelection;
|
|
5830
|
-
}
|
|
5831
|
-
function createDropPositionBehaviorsConfig({
|
|
5832
|
-
setDropPosition
|
|
5833
|
-
}) {
|
|
5834
|
-
return [{
|
|
5835
|
-
behavior: defineBehavior({
|
|
5836
|
-
on: "drag.dragover",
|
|
5837
|
-
guard: ({
|
|
5838
|
-
snapshot,
|
|
5839
|
-
event
|
|
5840
|
-
}) => {
|
|
5841
|
-
const dropFocusBlock = getFocusBlock({
|
|
5842
|
-
...snapshot,
|
|
5843
|
-
context: {
|
|
5844
|
-
...snapshot.context,
|
|
5845
|
-
selection: event.position.selection
|
|
5846
|
-
}
|
|
5847
|
-
});
|
|
5848
|
-
if (!dropFocusBlock)
|
|
5849
|
-
return !1;
|
|
5850
|
-
const dragOrigin = event.dragOrigin;
|
|
5851
|
-
if (!dragOrigin)
|
|
5852
|
-
return !1;
|
|
5853
|
-
const dragSelection = getDragSelection({
|
|
5854
|
-
eventSelection: dragOrigin.selection,
|
|
5855
|
-
snapshot
|
|
5856
|
-
});
|
|
5857
|
-
return getSelectedBlocks({
|
|
5858
|
-
...snapshot,
|
|
5859
|
-
context: {
|
|
5860
|
-
...snapshot.context,
|
|
5861
|
-
selection: dragSelection
|
|
5862
|
-
}
|
|
5863
|
-
}).some((draggedBlock) => draggedBlock.node._key === dropFocusBlock.node._key) || !isSelectingEntireBlocks({
|
|
5864
|
-
...snapshot,
|
|
5865
|
-
context: {
|
|
5866
|
-
...snapshot.context,
|
|
5867
|
-
selection: dragSelection
|
|
5868
|
-
}
|
|
5869
|
-
}) ? !1 : {
|
|
5870
|
-
dropFocusBlock
|
|
5871
|
-
};
|
|
5872
|
-
},
|
|
5873
|
-
actions: [({
|
|
5874
|
-
event
|
|
5875
|
-
}, {
|
|
5876
|
-
dropFocusBlock
|
|
5877
|
-
}) => [{
|
|
5878
|
-
type: "effect",
|
|
5879
|
-
effect: () => {
|
|
5880
|
-
setDropPosition({
|
|
5881
|
-
path: dropFocusBlock.path,
|
|
5882
|
-
position: event.position.block
|
|
5883
|
-
});
|
|
5884
|
-
}
|
|
5885
|
-
}]]
|
|
5886
|
-
}),
|
|
5887
|
-
priority: createEditorPriority({
|
|
5888
|
-
reference: {
|
|
5889
|
-
priority: corePriority,
|
|
5890
|
-
importance: "lower"
|
|
5891
|
-
}
|
|
5892
|
-
})
|
|
5893
|
-
}, {
|
|
5894
|
-
behavior: defineBehavior({
|
|
5895
|
-
on: "drag.*",
|
|
5896
|
-
guard: ({
|
|
5897
|
-
event
|
|
5898
|
-
}) => event.type !== "drag.dragover",
|
|
5899
|
-
actions: [({
|
|
5900
|
-
event
|
|
5901
|
-
}) => [{
|
|
5902
|
-
type: "effect",
|
|
5903
|
-
effect: () => {
|
|
5904
|
-
setDropPosition(void 0);
|
|
5905
|
-
}
|
|
5906
|
-
}, forward(event)]]
|
|
5907
|
-
}),
|
|
5908
|
-
priority: createEditorPriority({
|
|
5909
|
-
reference: {
|
|
5910
|
-
priority: corePriority,
|
|
5911
|
-
importance: "lower"
|
|
5912
|
-
}
|
|
5913
|
-
})
|
|
5914
|
-
}];
|
|
5915
|
-
}
|
|
5916
|
-
function useDropPosition() {
|
|
5917
|
-
const $ = c(3), editorActor = useContext(EditorActorContext), [dropPosition, setDropPosition] = useState();
|
|
5918
|
-
let t0, t1;
|
|
5919
|
-
return $[0] !== editorActor ? (t0 = () => {
|
|
5920
|
-
const behaviorConfigs = createDropPositionBehaviorsConfig({
|
|
5921
|
-
setDropPosition
|
|
5922
|
-
});
|
|
5923
|
-
for (const behaviorConfig of behaviorConfigs)
|
|
5924
|
-
editorActor.send({
|
|
5925
|
-
type: "add behavior",
|
|
5926
|
-
behaviorConfig
|
|
5927
|
-
});
|
|
5928
|
-
return () => {
|
|
5929
|
-
for (const behaviorConfig_0 of behaviorConfigs)
|
|
5930
|
-
editorActor.send({
|
|
5931
|
-
type: "remove behavior",
|
|
5932
|
-
behaviorConfig: behaviorConfig_0
|
|
5933
|
-
});
|
|
5934
|
-
};
|
|
5935
|
-
}, t1 = [editorActor, setDropPosition], $[0] = editorActor, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1), dropPosition;
|
|
5936
|
-
}
|
|
5937
5965
|
const PortableTextEditorContext = createContext(null), usePortableTextEditor = () => {
|
|
5938
5966
|
const editor = useContext(PortableTextEditorContext);
|
|
5939
5967
|
if (!editor)
|
|
@@ -6017,7 +6045,7 @@ function validateSelection(editorEngine, editorElement) {
|
|
|
6017
6045
|
}
|
|
6018
6046
|
}
|
|
6019
6047
|
const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
6020
|
-
const $ = c(
|
|
6048
|
+
const $ = c(179);
|
|
6021
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;
|
|
6022
6050
|
$[0] !== props ? ({
|
|
6023
6051
|
hotkeys,
|
|
@@ -6072,7 +6100,7 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6072
6100
|
skipSetup: t3
|
|
6073
6101
|
}
|
|
6074
6102
|
}, $[33] = editorEngine, $[34] = readOnly, $[35] = schema, $[36] = t1, $[37] = t3, $[38] = t4) : t4 = $[38];
|
|
6075
|
-
const rangeDecorationsActor = useActorRef(rangeDecorationsMachine, t4), decorate = useSelector(rangeDecorationsActor, _temp2)
|
|
6103
|
+
const rangeDecorationsActor = useActorRef(rangeDecorationsMachine, t4), decorate = useSelector(rangeDecorationsActor, _temp2);
|
|
6076
6104
|
let t5, t6;
|
|
6077
6105
|
$[39] !== rangeDecorationsActor || $[40] !== readOnly ? (t5 = () => {
|
|
6078
6106
|
rangeDecorationsActor.send({
|
|
@@ -6096,13 +6124,13 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6096
6124
|
}, $[47] = renderBlock, $[48] = renderChild, $[49] = renderListItem, $[50] = renderStyle, $[51] = t9) : t9 = $[51];
|
|
6097
6125
|
const legacy = t9;
|
|
6098
6126
|
let t10;
|
|
6099
|
-
$[52] !==
|
|
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];
|
|
6100
6128
|
const renderElement = t10;
|
|
6101
6129
|
let t11;
|
|
6102
|
-
$[
|
|
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];
|
|
6103
6131
|
const renderLeaf = t11, renderText = _temp3;
|
|
6104
6132
|
let t12;
|
|
6105
|
-
$[
|
|
6133
|
+
$[63] !== editorActor || $[64] !== editorEngine || $[65] !== propsSelection ? (t12 = () => {
|
|
6106
6134
|
if (propsSelection) {
|
|
6107
6135
|
debug.selection.enabled && debug.selection(`Selection from props ${safeStringify(propsSelection)}`);
|
|
6108
6136
|
const resolvedSelection = resolveSelection(editorEngine, propsSelection);
|
|
@@ -6111,10 +6139,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6111
6139
|
selection: resolvedSelection
|
|
6112
6140
|
}), editorEngine.onChange());
|
|
6113
6141
|
}
|
|
6114
|
-
}, $[
|
|
6142
|
+
}, $[63] = editorActor, $[64] = editorEngine, $[65] = propsSelection, $[66] = t12) : t12 = $[66];
|
|
6115
6143
|
const restoreSelectionFromProps = t12;
|
|
6116
6144
|
let t13, t14;
|
|
6117
|
-
$[
|
|
6145
|
+
$[67] !== editorActor || $[68] !== rangeDecorationsActor || $[69] !== restoreSelectionFromProps ? (t13 = () => {
|
|
6118
6146
|
const onReady = editorActor.on("ready", () => {
|
|
6119
6147
|
rangeDecorationsActor.send({
|
|
6120
6148
|
type: "ready"
|
|
@@ -6127,13 +6155,13 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6127
6155
|
return () => {
|
|
6128
6156
|
onReady.unsubscribe(), onInvalidValue.unsubscribe(), onValueChanged.unsubscribe();
|
|
6129
6157
|
};
|
|
6130
|
-
}, t14 = [rangeDecorationsActor, editorActor, restoreSelectionFromProps], $[
|
|
6158
|
+
}, t14 = [rangeDecorationsActor, editorActor, restoreSelectionFromProps], $[67] = editorActor, $[68] = rangeDecorationsActor, $[69] = restoreSelectionFromProps, $[70] = t13, $[71] = t14) : (t13 = $[70], t14 = $[71]), useEffect(t13, t14);
|
|
6131
6159
|
let t15, t16;
|
|
6132
|
-
$[
|
|
6160
|
+
$[72] !== hasInvalidValue || $[73] !== propsSelection || $[74] !== restoreSelectionFromProps ? (t15 = () => {
|
|
6133
6161
|
propsSelection && !hasInvalidValue && restoreSelectionFromProps();
|
|
6134
|
-
}, t16 = [hasInvalidValue, propsSelection, restoreSelectionFromProps], $[
|
|
6162
|
+
}, t16 = [hasInvalidValue, propsSelection, restoreSelectionFromProps], $[72] = hasInvalidValue, $[73] = propsSelection, $[74] = restoreSelectionFromProps, $[75] = t15, $[76] = t16) : (t15 = $[75], t16 = $[76]), useEffect(t15, t16);
|
|
6135
6163
|
let t17;
|
|
6136
|
-
$[
|
|
6164
|
+
$[77] !== editorActor || $[78] !== editorEngine || $[79] !== onCopy ? (t17 = (event) => {
|
|
6137
6165
|
if (DOMEditor.hasSelectableTarget(editorEngine, event.target)) {
|
|
6138
6166
|
if (onCopy)
|
|
6139
6167
|
onCopy(event) !== void 0 && event.preventDefault();
|
|
@@ -6160,10 +6188,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6160
6188
|
});
|
|
6161
6189
|
}
|
|
6162
6190
|
}
|
|
6163
|
-
}, $[
|
|
6191
|
+
}, $[77] = editorActor, $[78] = editorEngine, $[79] = onCopy, $[80] = t17) : t17 = $[80];
|
|
6164
6192
|
const handleCopy = t17;
|
|
6165
6193
|
let t18;
|
|
6166
|
-
$[
|
|
6194
|
+
$[81] !== editorActor || $[82] !== editorEngine || $[83] !== onCut ? (t18 = (event_0) => {
|
|
6167
6195
|
if (DOMEditor.hasSelectableTarget(editorEngine, event_0.target)) {
|
|
6168
6196
|
if (onCut)
|
|
6169
6197
|
onCut(event_0) !== void 0 && event_0.preventDefault();
|
|
@@ -6190,10 +6218,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6190
6218
|
});
|
|
6191
6219
|
}
|
|
6192
6220
|
}
|
|
6193
|
-
}, $[
|
|
6221
|
+
}, $[81] = editorActor, $[82] = editorEngine, $[83] = onCut, $[84] = t18) : t18 = $[84];
|
|
6194
6222
|
const handleCut = t18;
|
|
6195
6223
|
let t19;
|
|
6196
|
-
$[
|
|
6224
|
+
$[85] !== editorActor || $[86] !== editorEngine || $[87] !== onPaste || $[88] !== portableTextEditor || $[89] !== relay ? (t19 = (event_1) => {
|
|
6197
6225
|
const value = editorEngine.snapshot.context.value, path2 = editorEngine.snapshot.context.selection?.focus.path || [], onPasteResult = onPaste?.({
|
|
6198
6226
|
event: event_1,
|
|
6199
6227
|
value,
|
|
@@ -6272,18 +6300,18 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6272
6300
|
});
|
|
6273
6301
|
}
|
|
6274
6302
|
debug.behaviors("No result from custom paste handler, pasting normally");
|
|
6275
|
-
}, $[
|
|
6303
|
+
}, $[85] = editorActor, $[86] = editorEngine, $[87] = onPaste, $[88] = portableTextEditor, $[89] = relay, $[90] = t19) : t19 = $[90];
|
|
6276
6304
|
const handlePaste = t19;
|
|
6277
6305
|
let t20;
|
|
6278
|
-
$[
|
|
6306
|
+
$[91] !== editorEngine || $[92] !== onFocus || $[93] !== relay ? (t20 = (event_2) => {
|
|
6279
6307
|
onFocus && onFocus(event_2), event_2.isDefaultPrevented() || (relay.send({
|
|
6280
6308
|
type: "focused",
|
|
6281
6309
|
event: event_2
|
|
6282
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()));
|
|
6283
|
-
}, $[
|
|
6311
|
+
}, $[91] = editorEngine, $[92] = onFocus, $[93] = relay, $[94] = t20) : t20 = $[94];
|
|
6284
6312
|
const handleOnFocus = t20;
|
|
6285
6313
|
let t21;
|
|
6286
|
-
$[
|
|
6314
|
+
$[95] !== editorActor || $[96] !== editorEngine || $[97] !== onClick ? (t21 = (event_3) => {
|
|
6287
6315
|
if (onClick && onClick(event_3), event_3.isDefaultPrevented() || event_3.isPropagationStopped())
|
|
6288
6316
|
return;
|
|
6289
6317
|
const position_3 = getEventPosition({
|
|
@@ -6300,23 +6328,23 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6300
6328
|
editor: editorEngine,
|
|
6301
6329
|
nativeEvent: event_3
|
|
6302
6330
|
});
|
|
6303
|
-
}, $[
|
|
6331
|
+
}, $[95] = editorActor, $[96] = editorEngine, $[97] = onClick, $[98] = t21) : t21 = $[98];
|
|
6304
6332
|
const handleClick = t21;
|
|
6305
6333
|
let t22;
|
|
6306
|
-
$[
|
|
6334
|
+
$[99] !== onBlur || $[100] !== relay ? (t22 = (event_4) => {
|
|
6307
6335
|
onBlur && onBlur(event_4), event_4.isPropagationStopped() || relay.send({
|
|
6308
6336
|
type: "blurred",
|
|
6309
6337
|
event: event_4
|
|
6310
6338
|
});
|
|
6311
|
-
}, $[
|
|
6339
|
+
}, $[99] = onBlur, $[100] = relay, $[101] = t22) : t22 = $[101];
|
|
6312
6340
|
const handleOnBlur = t22;
|
|
6313
6341
|
let t23;
|
|
6314
|
-
$[
|
|
6342
|
+
$[102] !== onBeforeInput ? (t23 = (event_5) => {
|
|
6315
6343
|
onBeforeInput && onBeforeInput(event_5);
|
|
6316
|
-
}, $[
|
|
6344
|
+
}, $[102] = onBeforeInput, $[103] = t23) : t23 = $[103];
|
|
6317
6345
|
const handleOnBeforeInput = t23;
|
|
6318
6346
|
let t24;
|
|
6319
|
-
$[
|
|
6347
|
+
$[104] !== editorActor || $[105] !== editorEngine || $[106] !== hotkeys || $[107] !== portableTextEditor || $[108] !== props ? (t24 = (event_6) => {
|
|
6320
6348
|
props.onKeyDown && props.onKeyDown(event_6), event_6.isDefaultPrevented() || performHotkey({
|
|
6321
6349
|
editorActor,
|
|
6322
6350
|
editor: editorEngine,
|
|
@@ -6339,10 +6367,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6339
6367
|
editor: editorEngine,
|
|
6340
6368
|
nativeEvent: event_6
|
|
6341
6369
|
});
|
|
6342
|
-
}, $[
|
|
6370
|
+
}, $[104] = editorActor, $[105] = editorEngine, $[106] = hotkeys, $[107] = portableTextEditor, $[108] = props, $[109] = t24) : t24 = $[109];
|
|
6343
6371
|
const handleKeyDown = t24;
|
|
6344
6372
|
let t25;
|
|
6345
|
-
$[
|
|
6373
|
+
$[110] !== editorActor || $[111] !== editorEngine || $[112] !== props ? (t25 = (event_7) => {
|
|
6346
6374
|
props.onKeyUp && props.onKeyUp(event_7), event_7.isDefaultPrevented() || editorActor.send({
|
|
6347
6375
|
type: "behavior event",
|
|
6348
6376
|
behaviorEvent: {
|
|
@@ -6359,7 +6387,7 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6359
6387
|
editor: editorEngine,
|
|
6360
6388
|
nativeEvent: event_7
|
|
6361
6389
|
});
|
|
6362
|
-
}, $[
|
|
6390
|
+
}, $[110] = editorActor, $[111] = editorEngine, $[112] = props, $[113] = t25) : t25 = $[113];
|
|
6363
6391
|
const handleKeyUp = t25;
|
|
6364
6392
|
let t26;
|
|
6365
6393
|
bb0: {
|
|
@@ -6372,13 +6400,13 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6372
6400
|
break bb0;
|
|
6373
6401
|
}
|
|
6374
6402
|
let t272;
|
|
6375
|
-
$[
|
|
6403
|
+
$[114] !== portableTextEditor || $[115] !== scrollSelectionIntoView ? (t272 = (_editor, domRange) => {
|
|
6376
6404
|
scrollSelectionIntoView(portableTextEditor, domRange);
|
|
6377
|
-
}, $[
|
|
6405
|
+
}, $[114] = portableTextEditor, $[115] = scrollSelectionIntoView, $[116] = t272) : t272 = $[116], t26 = t272;
|
|
6378
6406
|
}
|
|
6379
6407
|
const scrollSelectionIntoViewToEngine = t26;
|
|
6380
6408
|
let t27, t28;
|
|
6381
|
-
$[
|
|
6409
|
+
$[117] !== editorActor || $[118] !== editorEngine ? (t27 = () => {
|
|
6382
6410
|
const window2 = DOMEditor.getWindow(editorEngine), onDragEnd_0 = () => {
|
|
6383
6411
|
editorActor.send({
|
|
6384
6412
|
type: "dragend"
|
|
@@ -6391,9 +6419,9 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6391
6419
|
return window2.document.addEventListener("dragend", onDragEnd_0), window2.document.addEventListener("drop", onDrop_0), () => {
|
|
6392
6420
|
window2.document.removeEventListener("dragend", onDragEnd_0), window2.document.removeEventListener("drop", onDrop_0);
|
|
6393
6421
|
};
|
|
6394
|
-
}, t28 = [editorEngine, editorActor], $[
|
|
6422
|
+
}, t28 = [editorEngine, editorActor], $[117] = editorActor, $[118] = editorEngine, $[119] = t27, $[120] = t28) : (t27 = $[119], t28 = $[120]), useEffect(t27, t28);
|
|
6395
6423
|
let t29;
|
|
6396
|
-
$[
|
|
6424
|
+
$[121] !== editorActor || $[122] !== editorEngine || $[123] !== onDragStart || $[124] !== readOnly ? (t29 = (event_8) => {
|
|
6397
6425
|
if (readOnly || !DOMEditor.hasTarget(editorEngine, event_8.target) || (onDragStart?.(event_8), event_8.isDefaultPrevented() || event_8.isPropagationStopped()))
|
|
6398
6426
|
return;
|
|
6399
6427
|
const position_4 = getEventPosition({
|
|
@@ -6421,10 +6449,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6421
6449
|
},
|
|
6422
6450
|
editor: editorEngine
|
|
6423
6451
|
}), !0;
|
|
6424
|
-
}, $[
|
|
6452
|
+
}, $[121] = editorActor, $[122] = editorEngine, $[123] = onDragStart, $[124] = readOnly, $[125] = t29) : t29 = $[125];
|
|
6425
6453
|
const handleDragStart = t29;
|
|
6426
6454
|
let t30;
|
|
6427
|
-
$[
|
|
6455
|
+
$[126] !== editorActor || $[127] !== editorEngine || $[128] !== onDrag ? (t30 = (event_9) => {
|
|
6428
6456
|
if (onDrag?.(event_9), !(event_9.isDefaultPrevented() || event_9.isPropagationStopped() || !getEventPosition({
|
|
6429
6457
|
editorActor,
|
|
6430
6458
|
editorEngine,
|
|
@@ -6440,10 +6468,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6440
6468
|
},
|
|
6441
6469
|
editor: editorEngine
|
|
6442
6470
|
}), !0;
|
|
6443
|
-
}, $[
|
|
6471
|
+
}, $[126] = editorActor, $[127] = editorEngine, $[128] = onDrag, $[129] = t30) : t30 = $[129];
|
|
6444
6472
|
const handleDrag = t30;
|
|
6445
6473
|
let t31;
|
|
6446
|
-
$[
|
|
6474
|
+
$[130] !== editorActor || $[131] !== editorEngine || $[132] !== onDragEnd ? (t31 = (event_10) => {
|
|
6447
6475
|
if (onDragEnd?.(event_10), !(event_10.isDefaultPrevented() || event_10.isPropagationStopped()))
|
|
6448
6476
|
return editorActor.send({
|
|
6449
6477
|
type: "behavior event",
|
|
@@ -6455,10 +6483,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6455
6483
|
},
|
|
6456
6484
|
editor: editorEngine
|
|
6457
6485
|
}), !0;
|
|
6458
|
-
}, $[
|
|
6486
|
+
}, $[130] = editorActor, $[131] = editorEngine, $[132] = onDragEnd, $[133] = t31) : t31 = $[133];
|
|
6459
6487
|
const handleDragEnd = t31;
|
|
6460
6488
|
let t32;
|
|
6461
|
-
$[
|
|
6489
|
+
$[134] !== editorActor || $[135] !== editorEngine || $[136] !== onDragEnter ? (t32 = (event_11) => {
|
|
6462
6490
|
if (onDragEnter?.(event_11), event_11.isDefaultPrevented() || event_11.isPropagationStopped())
|
|
6463
6491
|
return;
|
|
6464
6492
|
const position_6 = getEventPosition({
|
|
@@ -6478,10 +6506,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6478
6506
|
},
|
|
6479
6507
|
editor: editorEngine
|
|
6480
6508
|
}), !0;
|
|
6481
|
-
}, $[
|
|
6509
|
+
}, $[134] = editorActor, $[135] = editorEngine, $[136] = onDragEnter, $[137] = t32) : t32 = $[137];
|
|
6482
6510
|
const handleDragEnter = t32;
|
|
6483
6511
|
let t33;
|
|
6484
|
-
$[
|
|
6512
|
+
$[138] !== editorActor || $[139] !== editorEngine || $[140] !== onDragOver ? (t33 = (event_12) => {
|
|
6485
6513
|
if (onDragOver?.(event_12), event_12.isDefaultPrevented() || event_12.isPropagationStopped())
|
|
6486
6514
|
return;
|
|
6487
6515
|
const position_7 = getEventPosition({
|
|
@@ -6503,10 +6531,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6503
6531
|
editor: editorEngine,
|
|
6504
6532
|
nativeEvent: event_12
|
|
6505
6533
|
}), !0;
|
|
6506
|
-
}, $[
|
|
6534
|
+
}, $[138] = editorActor, $[139] = editorEngine, $[140] = onDragOver, $[141] = t33) : t33 = $[141];
|
|
6507
6535
|
const handleDragOver = t33;
|
|
6508
6536
|
let t34;
|
|
6509
|
-
$[
|
|
6537
|
+
$[142] !== editorActor || $[143] !== editorEngine || $[144] !== onDrop ? (t34 = (event_13) => {
|
|
6510
6538
|
if (onDrop?.(event_13), event_13.isDefaultPrevented() || event_13.isPropagationStopped())
|
|
6511
6539
|
return;
|
|
6512
6540
|
const position_8 = getEventPosition({
|
|
@@ -6531,10 +6559,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6531
6559
|
editor: editorEngine,
|
|
6532
6560
|
nativeEvent: event_13
|
|
6533
6561
|
}), !0;
|
|
6534
|
-
}, $[
|
|
6562
|
+
}, $[142] = editorActor, $[143] = editorEngine, $[144] = onDrop, $[145] = t34) : t34 = $[145];
|
|
6535
6563
|
const handleDrop = t34;
|
|
6536
6564
|
let t35;
|
|
6537
|
-
$[
|
|
6565
|
+
$[146] !== editorActor || $[147] !== editorEngine || $[148] !== onDragLeave ? (t35 = (event_14) => {
|
|
6538
6566
|
if (onDragLeave?.(event_14), !(event_14.isDefaultPrevented() || event_14.isPropagationStopped() || !getEventPosition({
|
|
6539
6567
|
editorActor,
|
|
6540
6568
|
editorEngine,
|
|
@@ -6550,10 +6578,10 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6550
6578
|
},
|
|
6551
6579
|
editor: editorEngine
|
|
6552
6580
|
}), !0;
|
|
6553
|
-
}, $[
|
|
6581
|
+
}, $[146] = editorActor, $[147] = editorEngine, $[148] = onDragLeave, $[149] = t35) : t35 = $[149];
|
|
6554
6582
|
const handleDragLeave = t35;
|
|
6555
6583
|
let t36;
|
|
6556
|
-
$[
|
|
6584
|
+
$[150] !== forwardedRef || $[151] !== validateSelectionActor ? (t36 = (editorElement) => {
|
|
6557
6585
|
if (typeof forwardedRef == "function" ? forwardedRef(editorElement) : forwardedRef && (forwardedRef.current = editorElement), editorElement) {
|
|
6558
6586
|
const mutationObserver = new MutationObserver(() => {
|
|
6559
6587
|
validateSelectionActor.send({
|
|
@@ -6571,12 +6599,12 @@ const PortableTextEditable = forwardRef(function(props, forwardedRef) {
|
|
|
6571
6599
|
mutationObserver.disconnect();
|
|
6572
6600
|
};
|
|
6573
6601
|
}
|
|
6574
|
-
}, $[
|
|
6602
|
+
}, $[150] = forwardedRef, $[151] = validateSelectionActor, $[152] = t36) : t36 = $[152];
|
|
6575
6603
|
const callbackRef = t36;
|
|
6576
6604
|
if (!portableTextEditor)
|
|
6577
6605
|
return null;
|
|
6578
6606
|
let t37;
|
|
6579
|
-
return $[
|
|
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;
|
|
6580
6608
|
});
|
|
6581
6609
|
PortableTextEditable.displayName = "ForwardRef(PortableTextEditable)";
|
|
6582
6610
|
function noop() {
|