@cyberyozh/text-editor 0.1.7 → 0.1.8
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/dist/editor.js +54 -90
- package/dist/editor.js.map +1 -1
- package/dist/editor.mjs +52 -88
- package/dist/editor.mjs.map +1 -1
- package/dist/render.js +17 -11
- package/dist/render.js.map +1 -1
- package/dist/render.mjs +17 -11
- package/dist/render.mjs.map +1 -1
- package/package.json +1 -3
- package/src/editor/dialogs/image-dialog/image-dialog.tsx +0 -1
- package/src/editor/editor.tsx +15 -4
- package/src/editor/handlers/dialog-handlers.ts +65 -135
- package/src/editor/handlers/index.ts +1 -2
- package/src/extensions/views/components/table.tsx +23 -4
- package/src/render/static-renderer-config.tsx +1 -17
- package/src/editor/handlers/create-image-upload-handler.ts +0 -24
package/dist/render.mjs
CHANGED
|
@@ -2188,10 +2188,24 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx6
|
|
|
2188
2188
|
|
|
2189
2189
|
// src/extensions/views/components/table.tsx
|
|
2190
2190
|
import { jsx as jsx67, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2191
|
-
function Table({ children
|
|
2191
|
+
function Table({ children }) {
|
|
2192
|
+
let colWidths = [];
|
|
2193
|
+
if (Array.isArray(children) && children.length > 0) {
|
|
2194
|
+
const firstRow = children[0];
|
|
2195
|
+
if (firstRow?.props?.children) {
|
|
2196
|
+
const cells = Array.isArray(firstRow.props.children) ? firstRow.props.children : [firstRow.props.children];
|
|
2197
|
+
colWidths = cells.map((cell) => cell?.props?.node?.attrs?.colwidth?.[0]).filter((width) => width !== void 0);
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2192
2200
|
const tableWidth = colWidths.length > 0 ? colWidths.reduce((total, width) => total + width, 0) : null;
|
|
2193
2201
|
return /* @__PURE__ */ jsx67("div", { className: "tableWrapper", children: /* @__PURE__ */ jsxs21("table", { style: tableWidth ? { width: `${tableWidth}px` } : void 0, children: [
|
|
2194
|
-
colWidths.length > 0 && /* @__PURE__ */ jsx67("colgroup", { children: colWidths.map((width, index) => /* @__PURE__ */ jsx67(
|
|
2202
|
+
colWidths.length > 0 && /* @__PURE__ */ jsx67("colgroup", { children: colWidths.map((width, index) => /* @__PURE__ */ jsx67(
|
|
2203
|
+
"col",
|
|
2204
|
+
{
|
|
2205
|
+
style: { width: `${width}px` }
|
|
2206
|
+
},
|
|
2207
|
+
index
|
|
2208
|
+
)) }),
|
|
2195
2209
|
/* @__PURE__ */ jsx67("tbody", { children })
|
|
2196
2210
|
] }) });
|
|
2197
2211
|
}
|
|
@@ -2358,15 +2372,7 @@ var getNodeMapping = (getImageById) => ({
|
|
|
2358
2372
|
return /* @__PURE__ */ jsx69(Video, { src: node.attrs.src });
|
|
2359
2373
|
},
|
|
2360
2374
|
table({ children }) {
|
|
2361
|
-
|
|
2362
|
-
if (Array.isArray(children) && children.length > 0) {
|
|
2363
|
-
const firstRow = children[0];
|
|
2364
|
-
if (firstRow?.props?.children) {
|
|
2365
|
-
const cells = Array.isArray(firstRow.props.children) ? firstRow.props.children : [firstRow.props.children];
|
|
2366
|
-
colWidths = cells.map((cell) => cell?.props?.node?.attrs?.colwidth?.[0]).filter((width) => width !== void 0);
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
return /* @__PURE__ */ jsx69(Table, { colWidths, children });
|
|
2375
|
+
return /* @__PURE__ */ jsx69(Table, { children });
|
|
2370
2376
|
},
|
|
2371
2377
|
figure({ node }) {
|
|
2372
2378
|
return /* @__PURE__ */ jsx69(
|