@limetech/lime-elements 39.44.2 → 39.44.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/CHANGELOG.md +14 -0
- package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +2573 -934
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +27 -16
- package/dist/cjs/limel-table.cjs.entry.js +346 -112
- package/dist/collection/components/checkbox/checkbox.js +2 -2
- package/dist/collection/components/form/form.test-schemas.js +15 -0
- package/dist/collection/components/table/table.css +6 -0
- package/dist/esm/limel-checkbox.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +2575 -936
- package/dist/esm/limel-prosemirror-adapter.entry.js +27 -16
- package/dist/esm/limel-table.entry.js +346 -112
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-1fb4bfa9.entry.js +13 -0
- package/dist/lime-elements/p-31713caf.entry.js +1 -0
- package/dist/lime-elements/p-4512a7b1.entry.js +1 -0
- package/dist/lime-elements/p-cf955cc2.entry.js +1 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/form/form.test-schemas.d.ts +1 -0
- package/package.json +20 -21
- package/dist/lime-elements/p-49f810e0.entry.js +0 -1
- package/dist/lime-elements/p-68eda654.entry.js +0 -13
- package/dist/lime-elements/p-c1ceade7.entry.js +0 -1
- package/dist/lime-elements/p-ffd668d2.entry.js +0 -1
|
@@ -179,8 +179,11 @@ function findDiffStart(a, b, pos) {
|
|
|
179
179
|
if (!childA.sameMarkup(childB))
|
|
180
180
|
return pos;
|
|
181
181
|
if (childA.isText && childA.text != childB.text) {
|
|
182
|
-
|
|
182
|
+
let tA = childA.text, tB = childB.text, j = 0;
|
|
183
|
+
for (; tA[j] == tB[j]; j++)
|
|
183
184
|
pos++;
|
|
185
|
+
if (j && j < tA.length && j < tB.length && surrogateHigh(tA.charCodeAt(j - 1)) && surrogateLow(tA.charCodeAt(j)))
|
|
186
|
+
pos--;
|
|
184
187
|
return pos;
|
|
185
188
|
}
|
|
186
189
|
if (childA.content.size || childB.content.size) {
|
|
@@ -204,12 +207,17 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
204
207
|
if (!childA.sameMarkup(childB))
|
|
205
208
|
return { a: posA, b: posB };
|
|
206
209
|
if (childA.isText && childA.text != childB.text) {
|
|
207
|
-
let
|
|
208
|
-
while (
|
|
209
|
-
|
|
210
|
+
let tA = childA.text, tB = childB.text, iA = tA.length, iB = tB.length;
|
|
211
|
+
while (iA > 0 && iB > 0 && tA[iA - 1] == tB[iB - 1]) {
|
|
212
|
+
iA--;
|
|
213
|
+
iB--;
|
|
210
214
|
posA--;
|
|
211
215
|
posB--;
|
|
212
216
|
}
|
|
217
|
+
if (iA && iB && iA < tA.length && surrogateHigh(tA.charCodeAt(iA - 1)) && surrogateLow(tA.charCodeAt(iA))) {
|
|
218
|
+
posA++;
|
|
219
|
+
posB++;
|
|
220
|
+
}
|
|
213
221
|
return { a: posA, b: posB };
|
|
214
222
|
}
|
|
215
223
|
if (childA.content.size || childB.content.size) {
|
|
@@ -221,6 +229,8 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
221
229
|
posB -= size;
|
|
222
230
|
}
|
|
223
231
|
}
|
|
232
|
+
function surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000; }
|
|
233
|
+
function surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00; }
|
|
224
234
|
|
|
225
235
|
/**
|
|
226
236
|
A fragment represents a node's collection of child nodes.
|
|
@@ -901,7 +911,8 @@ function addRange($start, $end, depth, target) {
|
|
|
901
911
|
addNode($end.nodeBefore, target);
|
|
902
912
|
}
|
|
903
913
|
function close(node, content) {
|
|
904
|
-
node.type.
|
|
914
|
+
if (!node.type.validContent(content))
|
|
915
|
+
throw new ReplaceError("Invalid content for node " + node.type.name);
|
|
905
916
|
return node.copy(content);
|
|
906
917
|
}
|
|
907
918
|
function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
@@ -2212,13 +2223,12 @@ function computeAttrs(attrs, value) {
|
|
|
2212
2223
|
return built;
|
|
2213
2224
|
}
|
|
2214
2225
|
function checkAttrs(attrs, values, type, name) {
|
|
2215
|
-
for (let
|
|
2216
|
-
if (!(
|
|
2217
|
-
throw new RangeError(`Unsupported attribute ${
|
|
2218
|
-
for (let
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
attr.validate(values[name]);
|
|
2226
|
+
for (let attr in values)
|
|
2227
|
+
if (!(attr in attrs))
|
|
2228
|
+
throw new RangeError(`Unsupported attribute ${attr} for ${type} of type ${name}`);
|
|
2229
|
+
for (let attr in attrs) {
|
|
2230
|
+
if (attrs[attr].validate)
|
|
2231
|
+
attrs[attr].validate(values[attr]);
|
|
2222
2232
|
}
|
|
2223
2233
|
}
|
|
2224
2234
|
function initAttrs(typeName, attrs) {
|
|
@@ -2395,7 +2405,7 @@ let NodeType$1 = class NodeType {
|
|
|
2395
2405
|
@internal
|
|
2396
2406
|
*/
|
|
2397
2407
|
checkAttrs(attrs) {
|
|
2398
|
-
checkAttrs(this.attrs, attrs, "node");
|
|
2408
|
+
checkAttrs(this.attrs, attrs, "node", this.name);
|
|
2399
2409
|
}
|
|
2400
2410
|
/**
|
|
2401
2411
|
Check whether the given mark type is allowed in this node.
|
|
@@ -2546,7 +2556,7 @@ class MarkType {
|
|
|
2546
2556
|
@internal
|
|
2547
2557
|
*/
|
|
2548
2558
|
checkAttrs(attrs) {
|
|
2549
|
-
checkAttrs(this.attrs, attrs, "mark");
|
|
2559
|
+
checkAttrs(this.attrs, attrs, "mark", this.name);
|
|
2550
2560
|
}
|
|
2551
2561
|
/**
|
|
2552
2562
|
Queries whether a given mark type is
|
|
@@ -2838,7 +2848,7 @@ class DOMParser {
|
|
|
2838
2848
|
}
|
|
2839
2849
|
}
|
|
2840
2850
|
const blockTags = {
|
|
2841
|
-
address: true, article: true, aside: true, blockquote: true, canvas: true,
|
|
2851
|
+
address: true, article: true, aside: true, blockquote: true, body: true, canvas: true,
|
|
2842
2852
|
dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,
|
|
2843
2853
|
footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true,
|
|
2844
2854
|
h6: true, header: true, hgroup: true, hr: true, li: true, noscript: true, ol: true,
|
|
@@ -22458,7 +22468,8 @@ const defaultMarkdownSerializer = new MarkdownSerializer({
|
|
|
22458
22468
|
state.renderList(node, " ", () => (node.attrs.bullet || "*") + " ");
|
|
22459
22469
|
},
|
|
22460
22470
|
ordered_list(state, node) {
|
|
22461
|
-
|
|
22471
|
+
var _a;
|
|
22472
|
+
let start = (_a = node.attrs.order) !== null && _a !== void 0 ? _a : 1;
|
|
22462
22473
|
let maxW = String(start + node.childCount - 1).length;
|
|
22463
22474
|
let space = state.repeat(" ", maxW + 2);
|
|
22464
22475
|
state.renderList(node, space, i => {
|