@portabletext/editor 1.44.13 → 1.44.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-cjs/behavior.core.cjs +41 -41
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/editor-provider.cjs +4486 -4457
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js +41 -41
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/editor-provider.js +4489 -4460
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/index.cjs +13 -13
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +16 -16
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/behavior-actions/behavior.action.annotation.add.ts +133 -0
- package/src/behavior-actions/behavior.action.annotation.remove.ts +150 -0
- package/src/behavior-actions/behavior.actions.ts +2 -4
- package/src/behaviors/behavior.default.ts +30 -28
- package/src/converters/converter.text-html.ts +14 -2
- package/src/converters/converter.text-plain.ts +14 -2
- package/src/editor/PortableTextEditor.tsx +1 -1
- package/src/editor/plugins/createWithEditableAPI.ts +1 -282
- package/src/index.ts +34 -34
package/lib/index.cjs
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var editorProvider = require("./_chunks-cjs/editor-provider.cjs"), jsxRuntime = require("react/jsx-runtime"), react = require("@xstate/react"), noop = require("lodash/noop.js"),
|
|
3
|
+
var reactCompilerRuntime = require("react-compiler-runtime"), React = require("react"), useEffectEvent = require("use-effect-event"), editorProvider = require("./_chunks-cjs/editor-provider.cjs"), jsxRuntime = require("react/jsx-runtime"), react = require("@xstate/react"), noop = require("lodash/noop.js"), slate = require("slate"), slateReact = require("slate-react"), selector_isOverlappingSelection = require("./_chunks-cjs/selector.is-overlapping-selection.cjs"), util_sliceBlocks = require("./_chunks-cjs/util.slice-blocks.cjs"), selector_getFocusInlineObject = require("./_chunks-cjs/selector.get-focus-inline-object.cjs"), slateDom = require("slate-dom"), util_isSelectionCollapsed = require("./_chunks-cjs/util.is-selection-collapsed.cjs"), parseBlocks = require("./_chunks-cjs/parse-blocks.cjs"), isEqual = require("lodash/isEqual.js"), selector_isSelectingEntireBlocks = require("./_chunks-cjs/selector.is-selecting-entire-blocks.cjs"), behavior_core = require("./_chunks-cjs/behavior.core.cjs"), uniq = require("lodash/uniq.js"), xstate = require("xstate");
|
|
4
4
|
function _interopDefaultCompat(e) {
|
|
5
5
|
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
6
6
|
}
|
|
7
7
|
var noop__default = /* @__PURE__ */ _interopDefaultCompat(noop), isEqual__default = /* @__PURE__ */ _interopDefaultCompat(isEqual), uniq__default = /* @__PURE__ */ _interopDefaultCompat(uniq);
|
|
8
|
+
function EditorEventListener(props) {
|
|
9
|
+
const $ = reactCompilerRuntime.c(5), editor = editorProvider.useEditor(), on = useEffectEvent.useEffectEvent(props.on);
|
|
10
|
+
let t0;
|
|
11
|
+
$[0] !== editor || $[1] !== on ? (t0 = () => {
|
|
12
|
+
const subscription = editor.on("*", on);
|
|
13
|
+
return () => {
|
|
14
|
+
subscription.unsubscribe();
|
|
15
|
+
};
|
|
16
|
+
}, $[0] = editor, $[1] = on, $[2] = t0) : t0 = $[2];
|
|
17
|
+
let t1;
|
|
18
|
+
return $[3] !== editor ? (t1 = [editor], $[3] = editor, $[4] = t1) : t1 = $[4], React.useEffect(t0, t1), null;
|
|
19
|
+
}
|
|
8
20
|
function getCompoundClientRect(nodes) {
|
|
9
21
|
if (nodes.length === 0)
|
|
10
22
|
return new DOMRect(0, 0, 0, 0);
|
|
@@ -1585,18 +1597,6 @@ const debug = editorProvider.debugWithName("component:Editable"), PLACEHOLDER_ST
|
|
|
1585
1597
|
) : null;
|
|
1586
1598
|
});
|
|
1587
1599
|
PortableTextEditable.displayName = "ForwardRef(PortableTextEditable)";
|
|
1588
|
-
function EditorEventListener(props) {
|
|
1589
|
-
const $ = reactCompilerRuntime.c(5), editor = editorProvider.useEditor(), on = useEffectEvent.useEffectEvent(props.on);
|
|
1590
|
-
let t0;
|
|
1591
|
-
$[0] !== editor || $[1] !== on ? (t0 = () => {
|
|
1592
|
-
const subscription = editor.on("*", on);
|
|
1593
|
-
return () => {
|
|
1594
|
-
subscription.unsubscribe();
|
|
1595
|
-
};
|
|
1596
|
-
}, $[0] = editor, $[1] = on, $[2] = t0) : t0 = $[2];
|
|
1597
|
-
let t1;
|
|
1598
|
-
return $[3] !== editor ? (t1 = [editor], $[3] = editor, $[4] = t1) : t1 = $[4], React.useEffect(t0, t1), null;
|
|
1599
|
-
}
|
|
1600
1600
|
exports.EditorProvider = editorProvider.EditorProvider;
|
|
1601
1601
|
exports.PortableTextEditor = editorProvider.PortableTextEditor;
|
|
1602
1602
|
exports.defineSchema = editorProvider.defineSchema;
|