@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/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, colWidths = [] }) {
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("col", { style: { width: `${width}px` } }, index)) }),
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
- let colWidths = [];
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(