@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
|
@@ -177,8 +177,11 @@ function findDiffStart(a, b, pos) {
|
|
|
177
177
|
if (!childA.sameMarkup(childB))
|
|
178
178
|
return pos;
|
|
179
179
|
if (childA.isText && childA.text != childB.text) {
|
|
180
|
-
|
|
180
|
+
let tA = childA.text, tB = childB.text, j = 0;
|
|
181
|
+
for (; tA[j] == tB[j]; j++)
|
|
181
182
|
pos++;
|
|
183
|
+
if (j && j < tA.length && j < tB.length && surrogateHigh(tA.charCodeAt(j - 1)) && surrogateLow(tA.charCodeAt(j)))
|
|
184
|
+
pos--;
|
|
182
185
|
return pos;
|
|
183
186
|
}
|
|
184
187
|
if (childA.content.size || childB.content.size) {
|
|
@@ -202,12 +205,17 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
202
205
|
if (!childA.sameMarkup(childB))
|
|
203
206
|
return { a: posA, b: posB };
|
|
204
207
|
if (childA.isText && childA.text != childB.text) {
|
|
205
|
-
let
|
|
206
|
-
while (
|
|
207
|
-
|
|
208
|
+
let tA = childA.text, tB = childB.text, iA = tA.length, iB = tB.length;
|
|
209
|
+
while (iA > 0 && iB > 0 && tA[iA - 1] == tB[iB - 1]) {
|
|
210
|
+
iA--;
|
|
211
|
+
iB--;
|
|
208
212
|
posA--;
|
|
209
213
|
posB--;
|
|
210
214
|
}
|
|
215
|
+
if (iA && iB && iA < tA.length && surrogateHigh(tA.charCodeAt(iA - 1)) && surrogateLow(tA.charCodeAt(iA))) {
|
|
216
|
+
posA++;
|
|
217
|
+
posB++;
|
|
218
|
+
}
|
|
211
219
|
return { a: posA, b: posB };
|
|
212
220
|
}
|
|
213
221
|
if (childA.content.size || childB.content.size) {
|
|
@@ -219,6 +227,8 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
219
227
|
posB -= size;
|
|
220
228
|
}
|
|
221
229
|
}
|
|
230
|
+
function surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000; }
|
|
231
|
+
function surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00; }
|
|
222
232
|
|
|
223
233
|
/**
|
|
224
234
|
A fragment represents a node's collection of child nodes.
|
|
@@ -899,7 +909,8 @@ function addRange($start, $end, depth, target) {
|
|
|
899
909
|
addNode($end.nodeBefore, target);
|
|
900
910
|
}
|
|
901
911
|
function close(node, content) {
|
|
902
|
-
node.type.
|
|
912
|
+
if (!node.type.validContent(content))
|
|
913
|
+
throw new ReplaceError("Invalid content for node " + node.type.name);
|
|
903
914
|
return node.copy(content);
|
|
904
915
|
}
|
|
905
916
|
function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
@@ -2210,13 +2221,12 @@ function computeAttrs(attrs, value) {
|
|
|
2210
2221
|
return built;
|
|
2211
2222
|
}
|
|
2212
2223
|
function checkAttrs(attrs, values, type, name) {
|
|
2213
|
-
for (let
|
|
2214
|
-
if (!(
|
|
2215
|
-
throw new RangeError(`Unsupported attribute ${
|
|
2216
|
-
for (let
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
attr.validate(values[name]);
|
|
2224
|
+
for (let attr in values)
|
|
2225
|
+
if (!(attr in attrs))
|
|
2226
|
+
throw new RangeError(`Unsupported attribute ${attr} for ${type} of type ${name}`);
|
|
2227
|
+
for (let attr in attrs) {
|
|
2228
|
+
if (attrs[attr].validate)
|
|
2229
|
+
attrs[attr].validate(values[attr]);
|
|
2220
2230
|
}
|
|
2221
2231
|
}
|
|
2222
2232
|
function initAttrs(typeName, attrs) {
|
|
@@ -2393,7 +2403,7 @@ let NodeType$1 = class NodeType {
|
|
|
2393
2403
|
@internal
|
|
2394
2404
|
*/
|
|
2395
2405
|
checkAttrs(attrs) {
|
|
2396
|
-
checkAttrs(this.attrs, attrs, "node");
|
|
2406
|
+
checkAttrs(this.attrs, attrs, "node", this.name);
|
|
2397
2407
|
}
|
|
2398
2408
|
/**
|
|
2399
2409
|
Check whether the given mark type is allowed in this node.
|
|
@@ -2544,7 +2554,7 @@ class MarkType {
|
|
|
2544
2554
|
@internal
|
|
2545
2555
|
*/
|
|
2546
2556
|
checkAttrs(attrs) {
|
|
2547
|
-
checkAttrs(this.attrs, attrs, "mark");
|
|
2557
|
+
checkAttrs(this.attrs, attrs, "mark", this.name);
|
|
2548
2558
|
}
|
|
2549
2559
|
/**
|
|
2550
2560
|
Queries whether a given mark type is
|
|
@@ -2836,7 +2846,7 @@ class DOMParser {
|
|
|
2836
2846
|
}
|
|
2837
2847
|
}
|
|
2838
2848
|
const blockTags = {
|
|
2839
|
-
address: true, article: true, aside: true, blockquote: true, canvas: true,
|
|
2849
|
+
address: true, article: true, aside: true, blockquote: true, body: true, canvas: true,
|
|
2840
2850
|
dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,
|
|
2841
2851
|
footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true,
|
|
2842
2852
|
h6: true, header: true, hgroup: true, hr: true, li: true, noscript: true, ol: true,
|
|
@@ -22456,7 +22466,8 @@ const defaultMarkdownSerializer = new MarkdownSerializer({
|
|
|
22456
22466
|
state.renderList(node, " ", () => (node.attrs.bullet || "*") + " ");
|
|
22457
22467
|
},
|
|
22458
22468
|
ordered_list(state, node) {
|
|
22459
|
-
|
|
22469
|
+
var _a;
|
|
22470
|
+
let start = (_a = node.attrs.order) !== null && _a !== void 0 ? _a : 1;
|
|
22460
22471
|
let maxW = String(start + node.childCount - 1).length;
|
|
22461
22472
|
let space = state.repeat(" ", maxW + 2);
|
|
22462
22473
|
state.renderList(node, space, i => {
|