@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.esm.js
CHANGED
|
@@ -268,6 +268,12 @@ function ensureAllCheckboxes(editor) {
|
|
|
268
268
|
if (!ul.classList.contains("rte-checkbox-list")) {
|
|
269
269
|
ul.classList.add("rte-checkbox-list");
|
|
270
270
|
}
|
|
271
|
+
// Propagate checkbox class to nested ULs inside LI children
|
|
272
|
+
ul.querySelectorAll(":scope > li > ul").forEach((nestedUl) => {
|
|
273
|
+
if (!nestedUl.classList.contains("rte-checkbox-list")) {
|
|
274
|
+
nestedUl.classList.add("rte-checkbox-list");
|
|
275
|
+
}
|
|
276
|
+
});
|
|
271
277
|
// Handle GitHub format: convert <input type="checkbox"> to aria-checked
|
|
272
278
|
ul.querySelectorAll(":scope > li").forEach((li) => {
|
|
273
279
|
const input = li.querySelector('input[type="checkbox"]');
|
|
@@ -1422,8 +1428,10 @@ function indentListItem(selection) {
|
|
|
1422
1428
|
// Create nested list in the previous item
|
|
1423
1429
|
let nestedList = previousItem.querySelector('ul, ol');
|
|
1424
1430
|
if (!nestedList) {
|
|
1425
|
-
// Create new nested list
|
|
1426
1431
|
nestedList = document.createElement(list.tagName.toLowerCase());
|
|
1432
|
+
if (list.classList.contains('rte-checkbox-list')) {
|
|
1433
|
+
nestedList.classList.add('rte-checkbox-list');
|
|
1434
|
+
}
|
|
1427
1435
|
previousItem.appendChild(nestedList);
|
|
1428
1436
|
}
|
|
1429
1437
|
// Move current item into nested list
|
|
@@ -1451,6 +1459,9 @@ function indentListItem(selection) {
|
|
|
1451
1459
|
else {
|
|
1452
1460
|
// No previous item — create new nested list in current item
|
|
1453
1461
|
const nestedList = document.createElement(list.tagName.toLowerCase());
|
|
1462
|
+
if (list.classList.contains('rte-checkbox-list')) {
|
|
1463
|
+
nestedList.classList.add('rte-checkbox-list');
|
|
1464
|
+
}
|
|
1454
1465
|
// Move all following items into the nested list
|
|
1455
1466
|
let nextSibling = listItem.nextElementSibling;
|
|
1456
1467
|
while (nextSibling && nextSibling.tagName === 'LI') {
|
|
@@ -3223,7 +3234,7 @@ function createImagePlugin(onImageUpload) {
|
|
|
3223
3234
|
}
|
|
3224
3235
|
}
|
|
3225
3236
|
};
|
|
3226
|
-
return (jsxs(Fragment, { children: [jsx("button", { type: "button", onClick: () => setShowModal(true), disabled: props.disabled, className: "rte-toolbar-button", title: "Insert Image", "aria-label": "Insert Image", children: jsx(IconWrapper, { icon: "mdi:image", width: 18, height: 18 }) }), showModal && (jsx("div", { className: "rte-image-modal-overlay", onClick: (e) => {
|
|
3237
|
+
return (jsxs(Fragment, { children: [jsx("button", { type: "button", onClick: () => setShowModal(true), disabled: props.disabled, className: "rte-toolbar-button", title: "Insert Image", "aria-label": "Insert Image", children: jsx(IconWrapper, { icon: "mdi:image", width: 18, height: 18 }) }), showModal && (jsx("div", { className: "rte-image-modal-overlay", onMouseDown: (e) => e.stopPropagation(), onClick: (e) => {
|
|
3227
3238
|
if (e.target === e.currentTarget) {
|
|
3228
3239
|
setShowModal(false);
|
|
3229
3240
|
}
|