@overlap/rte 1.0.3 → 1.0.4

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/index.js CHANGED
@@ -272,6 +272,12 @@ function ensureAllCheckboxes(editor) {
272
272
  if (!ul.classList.contains("rte-checkbox-list")) {
273
273
  ul.classList.add("rte-checkbox-list");
274
274
  }
275
+ // Propagate checkbox class to nested ULs inside LI children
276
+ ul.querySelectorAll(":scope > li > ul").forEach((nestedUl) => {
277
+ if (!nestedUl.classList.contains("rte-checkbox-list")) {
278
+ nestedUl.classList.add("rte-checkbox-list");
279
+ }
280
+ });
275
281
  // Handle GitHub format: convert <input type="checkbox"> to aria-checked
276
282
  ul.querySelectorAll(":scope > li").forEach((li) => {
277
283
  const input = li.querySelector('input[type="checkbox"]');
@@ -1426,8 +1432,10 @@ function indentListItem(selection) {
1426
1432
  // Create nested list in the previous item
1427
1433
  let nestedList = previousItem.querySelector('ul, ol');
1428
1434
  if (!nestedList) {
1429
- // Create new nested list
1430
1435
  nestedList = document.createElement(list.tagName.toLowerCase());
1436
+ if (list.classList.contains('rte-checkbox-list')) {
1437
+ nestedList.classList.add('rte-checkbox-list');
1438
+ }
1431
1439
  previousItem.appendChild(nestedList);
1432
1440
  }
1433
1441
  // Move current item into nested list
@@ -1455,6 +1463,9 @@ function indentListItem(selection) {
1455
1463
  else {
1456
1464
  // No previous item — create new nested list in current item
1457
1465
  const nestedList = document.createElement(list.tagName.toLowerCase());
1466
+ if (list.classList.contains('rte-checkbox-list')) {
1467
+ nestedList.classList.add('rte-checkbox-list');
1468
+ }
1458
1469
  // Move all following items into the nested list
1459
1470
  let nextSibling = listItem.nextElementSibling;
1460
1471
  while (nextSibling && nextSibling.tagName === 'LI') {
@@ -3227,7 +3238,7 @@ function createImagePlugin(onImageUpload) {
3227
3238
  }
3228
3239
  }
3229
3240
  };
3230
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { type: "button", onClick: () => setShowModal(true), disabled: props.disabled, className: "rte-toolbar-button", title: "Insert Image", "aria-label": "Insert Image", children: jsxRuntime.jsx(IconWrapper, { icon: "mdi:image", width: 18, height: 18 }) }), showModal && (jsxRuntime.jsx("div", { className: "rte-image-modal-overlay", onClick: (e) => {
3241
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { type: "button", onClick: () => setShowModal(true), disabled: props.disabled, className: "rte-toolbar-button", title: "Insert Image", "aria-label": "Insert Image", children: jsxRuntime.jsx(IconWrapper, { icon: "mdi:image", width: 18, height: 18 }) }), showModal && (jsxRuntime.jsx("div", { className: "rte-image-modal-overlay", onMouseDown: (e) => e.stopPropagation(), onClick: (e) => {
3231
3242
  if (e.target === e.currentTarget) {
3232
3243
  setShowModal(false);
3233
3244
  }