@cyberyozh/text-editor 0.1.10 → 0.1.11
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.map +1 -1
- package/dist/editor.mjs.map +1 -1
- package/dist/render.js +19 -12
- package/dist/render.js.map +1 -1
- package/dist/render.mjs +19 -12
- package/dist/render.mjs.map +1 -1
- package/package.json +1 -1
- package/src/extensions/views/components/table.tsx +7 -6
package/dist/render.js
CHANGED
|
@@ -2301,22 +2301,29 @@ function Table({ children }) {
|
|
|
2301
2301
|
(0, import_react2.useEffect)(() => {
|
|
2302
2302
|
if (wrapperRef.current && undefinedCount > 0) {
|
|
2303
2303
|
const containerWidth = wrapperRef.current.clientWidth;
|
|
2304
|
-
const remainingSpace = containerWidth - totalDefinedWidth;
|
|
2304
|
+
const remainingSpace = containerWidth - totalDefinedWidth - 2;
|
|
2305
2305
|
const calculatedWidth = Math.floor(remainingSpace / undefinedCount);
|
|
2306
2306
|
setUndefinedColWidth(calculatedWidth > 0 ? calculatedWidth : void 0);
|
|
2307
2307
|
}
|
|
2308
2308
|
}, [totalDefinedWidth, undefinedCount]);
|
|
2309
|
-
const tableWidth = undefinedCount > 0 && undefinedColWidth ? totalDefinedWidth + undefinedColWidth * undefinedCount : totalDefinedWidth > 0 ? totalDefinedWidth : void 0;
|
|
2310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
},
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2309
|
+
const tableWidth = undefinedCount > 0 && undefinedColWidth ? totalDefinedWidth + undefinedColWidth * undefinedCount + 2 : totalDefinedWidth > 0 ? totalDefinedWidth + 2 : void 0;
|
|
2310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2311
|
+
"div",
|
|
2312
|
+
{
|
|
2313
|
+
ref: wrapperRef,
|
|
2314
|
+
className: "tableWrapper",
|
|
2315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("table", { style: tableWidth ? { width: `${tableWidth}px` } : void 0, children: [
|
|
2316
|
+
colWidths.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("colgroup", { children: colWidths.map((width, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2317
|
+
"col",
|
|
2318
|
+
{
|
|
2319
|
+
style: width ? { width: `${width}px` } : undefinedColWidth ? { width: `${undefinedColWidth}px` } : void 0
|
|
2320
|
+
},
|
|
2321
|
+
index
|
|
2322
|
+
)) }),
|
|
2323
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("tbody", { children })
|
|
2324
|
+
] })
|
|
2325
|
+
}
|
|
2326
|
+
);
|
|
2320
2327
|
}
|
|
2321
2328
|
|
|
2322
2329
|
// src/utils/detect-video-hosting.ts
|