@portabletext/editor 1.49.13 → 1.50.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/index.cjs +7 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +7 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/selectors/index.cjs +95 -1
- package/lib/selectors/index.cjs.map +1 -1
- package/lib/selectors/index.d.cts +25 -0
- package/lib/selectors/index.d.ts +25 -0
- package/lib/selectors/index.js +97 -3
- package/lib/selectors/index.js.map +1 -1
- package/package.json +1 -1
- package/src/editor/__tests__/PortableTextEditor.test.tsx +1 -0
- package/src/editor/components/render-text-block.tsx +15 -0
- package/src/selectors/index.ts +1 -0
- package/src/selectors/selector.get-list-state.test.ts +202 -0
- package/src/selectors/selector.get-list-state.ts +175 -0
- package/src/types/editor.ts +2 -1
- package/src/types/paths.ts +1 -0
package/lib/index.cjs
CHANGED
|
@@ -950,7 +950,13 @@ function RenderTextBlock(props) {
|
|
|
950
950
|
schemaType: legacyListItemSchemaType
|
|
951
951
|
}) : console.error(`Unable to find Schema type for text block list item ${props.textBlock.listItem}`);
|
|
952
952
|
}
|
|
953
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props.attributes, className: ["pt-block", "pt-text-block", ...props.textBlock.style ? [`pt-text-block-style-${props.textBlock.style}`] : [], ...props.textBlock.listItem ? ["pt-list-item", `pt-list-item-${props.textBlock.listItem}`, `pt-list-item-level-${props.textBlock.level ?? 1}`] : []].join(" "), spellCheck: props.spellCheck, "data-block-key": props.textBlock._key, "data-block-name": props.textBlock._type, "data-block-type": "text",
|
|
953
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props.attributes, className: ["pt-block", "pt-text-block", ...props.textBlock.style ? [`pt-text-block-style-${props.textBlock.style}`] : [], ...props.textBlock.listItem ? ["pt-list-item", `pt-list-item-${props.textBlock.listItem}`, `pt-list-item-level-${props.textBlock.level ?? 1}`] : []].join(" "), spellCheck: props.spellCheck, "data-block-key": props.textBlock._key, "data-block-name": props.textBlock._type, "data-block-type": "text", ...props.textBlock.listItem !== void 0 ? {
|
|
954
|
+
"data-list-item": props.textBlock.listItem
|
|
955
|
+
} : {}, ...props.textBlock.level !== void 0 ? {
|
|
956
|
+
"data-level": props.textBlock.level
|
|
957
|
+
} : {}, ...props.textBlock.style !== void 0 ? {
|
|
958
|
+
"data-style": props.textBlock.style
|
|
959
|
+
} : {}, children: [
|
|
954
960
|
dragPositionBlock === "start" ? /* @__PURE__ */ jsxRuntime.jsx(DropIndicator, {}) : null,
|
|
955
961
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: blockRef, children: props.renderBlock ? props.renderBlock({
|
|
956
962
|
children,
|