@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/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)("div", { ref: wrapperRef, className: "tableWrapper", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("table", { style: tableWidth ? { width: `${tableWidth}px` } : void 0, children: [
2311
- colWidths.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("colgroup", { children: colWidths.map((width, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2312
- "col",
2313
- {
2314
- style: width ? { width: `${width}px` } : undefinedColWidth ? { width: `${undefinedColWidth}px` } : void 0
2315
- },
2316
- index
2317
- )) }),
2318
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("tbody", { children })
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