@nldd/design-system 0.8.97 → 0.8.99
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/custom-elements.json +192 -46
- package/dist/components/actions/menu/menu.d.ts +39 -5
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +120 -7
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts +4 -3
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +10 -5
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +14 -3
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +45 -7
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +15 -1
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/components.js +1104 -186
- package/dist/components/content/code-viewer/code-viewer.d.ts +4 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +43 -5
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +22 -7
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.js +1 -0
- package/dist/components/content/code-viewer/code-viewer.template.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +7 -0
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +29 -2
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/visually-hidden/visually-hidden.d.ts +35 -0
- package/dist/components/content/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/components/content/visually-hidden/visually-hidden.js +45 -0
- package/dist/components/content/visually-hidden/visually-hidden.js.map +1 -0
- package/dist/components/content/visually-hidden/visually-hidden.styles.d.ts +2 -0
- package/dist/components/content/visually-hidden/visually-hidden.styles.d.ts.map +1 -0
- package/dist/components/content/visually-hidden/visually-hidden.styles.js +27 -0
- package/dist/components/content/visually-hidden/visually-hidden.styles.js.map +1 -0
- package/dist/components/content/visually-hidden/visually-hidden.template.d.ts +3 -0
- package/dist/components/content/visually-hidden/visually-hidden.template.d.ts.map +1 -0
- package/dist/components/content/visually-hidden/visually-hidden.template.js +7 -0
- package/dist/components/content/visually-hidden/visually-hidden.template.js.map +1 -0
- package/dist/components/{dist-CH9m014O.js → dist-B2QcygzG.js} +1 -1
- package/dist/components/{dist-DMHTTJRJ.js → dist-BB5mlo7D.js} +2 -2
- package/dist/components/{dist-C3uWRipu.js → dist-Bo5Jeyfn.js} +1 -1
- package/dist/components/{dist-CpW8MF-L.js → dist-Bud_7w5g.js} +232 -214
- package/dist/components/{dist-CvL6_ezZ.js → dist-CA0yDFIt.js} +2 -2
- package/dist/components/{dist-DV6Mp5N1.js → dist-CaxHkqR2.js} +3 -3
- package/dist/components/{dist-BWRYv3Mp.js → dist-Ch3gNAuT.js} +1 -1
- package/dist/components/{dist-PlhQXXtE.js → dist-DbNhCpS5.js} +1 -1
- package/dist/components/{dist-DTOshgo1.js → dist-DkqAbJH8.js} +1 -1
- package/dist/components/{dist-BWEAw34D.js → dist-DnZmcpbQ.js} +1 -1
- package/dist/components/{dist-Bi4EHsFY.js → dist-iC2RTM0V.js} +2 -2
- package/dist/components/forms/validation-list/validation-list.d.ts +19 -9
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +38 -12
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-button-NN0SrgS3.js → icon-button-CJIikwyu.js} +15 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +1 -4
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +1 -4
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +12 -1
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +29 -2
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.styles.js +2 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +3 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +6 -6
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
- package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.styles.js +4 -0
- package/dist/components/layout/popover/popover.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +6 -1
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +7 -2
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +16 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +35 -4
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +7 -6
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +44 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +132 -3
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +21 -2
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +19 -2
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +6 -3
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +11 -3
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts +1 -0
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +53 -32
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts +58 -5
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +148 -14
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.template.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.template.js +1 -0
- package/dist/components/navigation/skip-link/skip-link.template.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +70 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.i18n.d.ts +5 -0
- package/dist/components/navigation/tab-bar/tab-bar.i18n.d.ts.map +1 -0
- package/dist/components/navigation/tab-bar/tab-bar.i18n.js +4 -0
- package/dist/components/navigation/tab-bar/tab-bar.i18n.js.map +1 -0
- package/dist/components/navigation/tab-bar/tab-bar.js +213 -22
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.js +68 -3
- package/dist/components/navigation/tab-bar/tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +36 -5
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +7 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +16 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +7 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +8 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +8 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +62 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +86 -2
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notifications-area.d.ts +6 -0
- package/dist/components/status-and-feedback/notification/notifications-area.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notifications-area.js +16 -0
- package/dist/components/status-and-feedback/notification/notifications-area.js.map +1 -1
- package/dist/nldd.min.js +799 -612
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +1 -0
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +1 -0
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +1 -0
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +2 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +1 -0
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +1 -0
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +40 -26
- package/package.json +6 -2
|
@@ -3722,7 +3722,7 @@ function attrsEq(a, b, ignore) {
|
|
|
3722
3722
|
if (!a) a = noAttrs;
|
|
3723
3723
|
if (!b) b = noAttrs;
|
|
3724
3724
|
let keysA = Object.keys(a), keysB = Object.keys(b);
|
|
3725
|
-
if (keysA.length -
|
|
3725
|
+
if (keysA.length - 0 != keysB.length - 0) return false;
|
|
3726
3726
|
for (let key of keysA) if (key != ignore && (keysB.indexOf(key) == -1 || a[key] !== b[key])) return false;
|
|
3727
3727
|
return true;
|
|
3728
3728
|
}
|
|
@@ -4059,6 +4059,8 @@ var BlockWrapper = class BlockWrapper extends RangeValue {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
};
|
|
4061
4061
|
BlockWrapper.prototype.startSide = BlockWrapper.prototype.endSide = -1;
|
|
4062
|
+
var isElt = (node) => node.nodeType == 1;
|
|
4063
|
+
var isText = (node) => node.nodeType == 3;
|
|
4062
4064
|
function getSelection(root) {
|
|
4063
4065
|
let target;
|
|
4064
4066
|
if (root.nodeType == 11) target = root.getSelection ? root : root.ownerDocument;
|
|
@@ -4077,8 +4079,8 @@ function hasSelection(dom, selection) {
|
|
|
4077
4079
|
}
|
|
4078
4080
|
}
|
|
4079
4081
|
function clientRectsFor(dom) {
|
|
4080
|
-
if (dom
|
|
4081
|
-
else if (dom
|
|
4082
|
+
if (isText(dom)) return textRange(dom, 0, dom.nodeValue.length).getClientRects();
|
|
4083
|
+
else if (isElt(dom)) return dom.getClientRects();
|
|
4082
4084
|
else return [];
|
|
4083
4085
|
}
|
|
4084
4086
|
function isEquivalentPosition(node, off, targetNode, targetOff) {
|
|
@@ -4091,7 +4093,7 @@ function domIndex(node) {
|
|
|
4091
4093
|
}
|
|
4092
4094
|
}
|
|
4093
4095
|
function isBlockElement(node) {
|
|
4094
|
-
return node
|
|
4096
|
+
return isElt(node) && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node.nodeName);
|
|
4095
4097
|
}
|
|
4096
4098
|
function scanFor(node, off, targetNode, targetOff, dir) {
|
|
4097
4099
|
for (;;) {
|
|
@@ -4099,18 +4101,18 @@ function scanFor(node, off, targetNode, targetOff, dir) {
|
|
|
4099
4101
|
if (off == (dir < 0 ? 0 : maxOffset(node))) {
|
|
4100
4102
|
if (node.nodeName == "DIV") return false;
|
|
4101
4103
|
let parent = node.parentNode;
|
|
4102
|
-
if (!parent || parent
|
|
4104
|
+
if (!parent || !isElt(parent)) return false;
|
|
4103
4105
|
off = domIndex(node) + (dir < 0 ? 0 : 1);
|
|
4104
4106
|
node = parent;
|
|
4105
|
-
} else if (node
|
|
4107
|
+
} else if (isElt(node)) {
|
|
4106
4108
|
node = node.childNodes[off + (dir < 0 ? -1 : 0)];
|
|
4107
|
-
if (node.
|
|
4109
|
+
if (isElt(node) && (node.nodeName == "IMG" || node.nodeName == "BR" || node.contentEditable == "false")) return false;
|
|
4108
4110
|
off = dir < 0 ? maxOffset(node) : 0;
|
|
4109
4111
|
} else return false;
|
|
4110
4112
|
}
|
|
4111
4113
|
}
|
|
4112
4114
|
function maxOffset(node) {
|
|
4113
|
-
return node
|
|
4115
|
+
return isText(node) ? node.nodeValue.length : node.childNodes.length;
|
|
4114
4116
|
}
|
|
4115
4117
|
function flattenRect(rect, toLeft) {
|
|
4116
4118
|
let { left, right } = rect;
|
|
@@ -4150,7 +4152,7 @@ function getScale(elt, rect) {
|
|
|
4150
4152
|
}
|
|
4151
4153
|
function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
|
|
4152
4154
|
let doc = dom.ownerDocument, win = doc.defaultView || window;
|
|
4153
|
-
for (let cur = dom, stop = false; cur && !stop;) if (cur
|
|
4155
|
+
for (let cur = dom, stop = false; cur && !stop;) if (isElt(cur)) {
|
|
4154
4156
|
let bounding, top = cur == doc.body;
|
|
4155
4157
|
let scaleX = 1, scaleY = 1;
|
|
4156
4158
|
if (top) bounding = windowRect(win);
|
|
@@ -4229,7 +4231,7 @@ function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
|
|
|
4229
4231
|
function scrollableParents(dom, getX = true) {
|
|
4230
4232
|
let doc = dom.ownerDocument, x = null, y = null;
|
|
4231
4233
|
for (let cur = dom.parentNode; cur;) if (cur == doc.body || (!getX || x) && y) break;
|
|
4232
|
-
else if (cur
|
|
4234
|
+
else if (isElt(cur)) {
|
|
4233
4235
|
if (!y && cur.scrollHeight > cur.clientHeight) y = cur;
|
|
4234
4236
|
if (getX && !x && cur.scrollWidth > cur.clientWidth) x = cur;
|
|
4235
4237
|
cur = cur.assignedSlot || cur.parentNode;
|
|
@@ -4263,7 +4265,7 @@ var DOMSelectionState = class {
|
|
|
4263
4265
|
};
|
|
4264
4266
|
function getScrollStack(target) {
|
|
4265
4267
|
let stack = [];
|
|
4266
|
-
for (let cur = target; cur; cur = cur.nodeType == 11 ? cur.host : cur.parentNode) if (cur
|
|
4268
|
+
for (let cur = target; cur; cur = cur.nodeType == 11 ? cur.host : cur.parentNode) if (isElt(cur)) stack.push({
|
|
4267
4269
|
node: cur,
|
|
4268
4270
|
left: cur.scrollLeft,
|
|
4269
4271
|
top: cur.scrollTop
|
|
@@ -4327,7 +4329,7 @@ function atElementStart(doc, selection) {
|
|
|
4327
4329
|
if (!node || selection.anchorNode != node || selection.anchorOffset != offset) return false;
|
|
4328
4330
|
offset = Math.min(offset, maxOffset(node));
|
|
4329
4331
|
for (;;) if (offset) {
|
|
4330
|
-
if (node
|
|
4332
|
+
if (!isElt(node)) return false;
|
|
4331
4333
|
let prev = node.childNodes[offset - 1];
|
|
4332
4334
|
if (prev.contentEditable == "false") offset--;
|
|
4333
4335
|
else {
|
|
@@ -4345,11 +4347,11 @@ function isScrolledToBottom(elt) {
|
|
|
4345
4347
|
return elt.scrollTop > Math.max(1, elt.scrollHeight - elt.clientHeight - 4);
|
|
4346
4348
|
}
|
|
4347
4349
|
function textNodeBefore(startNode, startOffset) {
|
|
4348
|
-
for (let node = startNode, offset = startOffset;;) if (node
|
|
4350
|
+
for (let node = startNode, offset = startOffset;;) if (isText(node) && offset > 0) return {
|
|
4349
4351
|
node,
|
|
4350
4352
|
offset
|
|
4351
4353
|
};
|
|
4352
|
-
else if (node
|
|
4354
|
+
else if (isElt(node) && offset > 0) {
|
|
4353
4355
|
if (node.contentEditable == "false") return null;
|
|
4354
4356
|
node = node.childNodes[offset - 1];
|
|
4355
4357
|
offset = maxOffset(node);
|
|
@@ -4359,11 +4361,11 @@ function textNodeBefore(startNode, startOffset) {
|
|
|
4359
4361
|
} else return null;
|
|
4360
4362
|
}
|
|
4361
4363
|
function textNodeAfter(startNode, startOffset) {
|
|
4362
|
-
for (let node = startNode, offset = startOffset;;) if (node
|
|
4364
|
+
for (let node = startNode, offset = startOffset;;) if (isText(node) && offset < node.nodeValue.length) return {
|
|
4363
4365
|
node,
|
|
4364
4366
|
offset
|
|
4365
4367
|
};
|
|
4366
|
-
else if (node
|
|
4368
|
+
else if (isElt(node) && offset < node.childNodes.length) {
|
|
4367
4369
|
if (node.contentEditable == "false") return null;
|
|
4368
4370
|
node = node.childNodes[offset];
|
|
4369
4371
|
offset = 0;
|
|
@@ -5290,17 +5292,17 @@ var LineTile = class LineTile extends CompositeTile {
|
|
|
5290
5292
|
get domAttrs() {
|
|
5291
5293
|
return this.attrs;
|
|
5292
5294
|
}
|
|
5293
|
-
resolveInline(pos, side, forCoords) {
|
|
5295
|
+
resolveInline(pos, side, forCoords = false) {
|
|
5294
5296
|
let before = null, beforeOff = -1, after = null, afterOff = -1;
|
|
5295
5297
|
function scan(tile, pos) {
|
|
5296
5298
|
for (let i = 0, off = 0; i < tile.children.length && off <= pos; i++) {
|
|
5297
5299
|
let child = tile.children[i], end = off + child.length;
|
|
5298
5300
|
if (end >= pos) {
|
|
5299
5301
|
if (child.isComposite()) scan(child, pos - off);
|
|
5300
|
-
else if ((!after || after.isHidden && (side > 0 && !(after.flags & 32) || forCoords && onSameLine(after, child))) && (end > pos || child.flags & 32 && side <= 1)) {
|
|
5302
|
+
else if ((!after || forCoords && after.isHidden && (side > 0 && !(after.flags & 32) || forCoords && onSameLine(after, child))) && (end > pos || child.flags & 32 && side <= 1)) {
|
|
5301
5303
|
after = child;
|
|
5302
5304
|
afterOff = pos - off;
|
|
5303
|
-
} else if (off < pos || child.flags & 16 && !child.isHidden && side >= -1) {
|
|
5305
|
+
} else if (off < pos || child.flags & 16 && !(forCoords && child.isHidden) && side >= -1) {
|
|
5304
5306
|
before = child;
|
|
5305
5307
|
beforeOff = pos - off;
|
|
5306
5308
|
}
|
|
@@ -6535,7 +6537,7 @@ function destroyDropped(tile, reused) {
|
|
|
6535
6537
|
}
|
|
6536
6538
|
}
|
|
6537
6539
|
function betweenUneditable(pos) {
|
|
6538
|
-
return pos.node
|
|
6540
|
+
return isElt(pos.node) && pos.node.firstChild && (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == "false") && (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == "false");
|
|
6539
6541
|
}
|
|
6540
6542
|
function findCompositionNode(view, headPos) {
|
|
6541
6543
|
let sel = view.observer.selectionRange;
|
|
@@ -6573,7 +6575,7 @@ function findCompositionRange(view, changes, headPos) {
|
|
|
6573
6575
|
};
|
|
6574
6576
|
}
|
|
6575
6577
|
function nextToUneditable(node, offset) {
|
|
6576
|
-
if (node
|
|
6578
|
+
if (!isElt(node)) return 0;
|
|
6577
6579
|
return (offset && node.childNodes[offset - 1].contentEditable == "false" ? 1 : 0) | (offset < node.childNodes.length && node.childNodes[offset].contentEditable == "false" ? 2 : 0);
|
|
6578
6580
|
}
|
|
6579
6581
|
var DecorationComparator$1 = class DecorationComparator {
|
|
@@ -6613,7 +6615,7 @@ function findChangedWrappers(a, b, diff) {
|
|
|
6613
6615
|
return comp.changes;
|
|
6614
6616
|
}
|
|
6615
6617
|
function inUneditable(node, inside) {
|
|
6616
|
-
for (let cur = node; cur && cur != inside; cur = cur.assignedSlot || cur.parentNode) if (cur
|
|
6618
|
+
for (let cur = node; cur && cur != inside; cur = cur.assignedSlot || cur.parentNode) if (isElt(cur) && cur.contentEditable == "false") return true;
|
|
6617
6619
|
return false;
|
|
6618
6620
|
}
|
|
6619
6621
|
function touchesComposition(changes, composition) {
|
|
@@ -6959,7 +6961,7 @@ var InlineCoordsScan = class {
|
|
|
6959
6961
|
let scan = this.scan(positions, (i) => {
|
|
6960
6962
|
let child = tile.children[i];
|
|
6961
6963
|
if (child.flags & 48) return null;
|
|
6962
|
-
return (child.dom
|
|
6964
|
+
return (isElt(child.dom) ? child.dom : textRange(child.dom, 0, child.length)).getClientRects();
|
|
6963
6965
|
});
|
|
6964
6966
|
let child = tile.children[scan.i], pos = positions[scan.i];
|
|
6965
6967
|
if (child.isText()) return this.scanText(child, pos);
|
|
@@ -7028,16 +7030,16 @@ var DOMReader = class {
|
|
|
7028
7030
|
this.findPointInside(node, fromView.length);
|
|
7029
7031
|
for (let i = fromView.iter(); !i.next().done;) if (i.lineBreak) this.lineBreak();
|
|
7030
7032
|
else this.append(i.value);
|
|
7031
|
-
} else if (node
|
|
7033
|
+
} else if (isText(node)) this.readTextNode(node);
|
|
7032
7034
|
else if (node.nodeName == "BR") {
|
|
7033
7035
|
if (node.nextSibling) this.lineBreak();
|
|
7034
|
-
} else if (node
|
|
7036
|
+
} else if (isElt(node)) this.readRange(node.firstChild, null);
|
|
7035
7037
|
}
|
|
7036
7038
|
findPointBefore(node, next) {
|
|
7037
7039
|
for (let point of this.points) if (point.node == node && node.childNodes[point.offset] == next) point.pos = this.text.length;
|
|
7038
7040
|
}
|
|
7039
7041
|
findPointInside(node, length) {
|
|
7040
|
-
for (let point of this.points) if (node
|
|
7042
|
+
for (let point of this.points) if (isText(node) ? point.node == node : node.contains(point.node)) point.pos = this.text.length + (isAtEnd(node, point.node, point.offset) ? length : 0);
|
|
7041
7043
|
}
|
|
7042
7044
|
};
|
|
7043
7045
|
function isAtEnd(parent, node, offset) {
|
|
@@ -8003,12 +8005,12 @@ observers.blur = (view) => {
|
|
|
8003
8005
|
view.observer.clearSelectionRange();
|
|
8004
8006
|
updateForFocusChange(view);
|
|
8005
8007
|
};
|
|
8006
|
-
observers.compositionstart = observers.compositionupdate = (view) => {
|
|
8008
|
+
observers.compositionstart = observers.compositionupdate = (view, event) => {
|
|
8007
8009
|
if (view.observer.editContext) return;
|
|
8008
8010
|
if (view.inputState.compositionFirstChange == null) view.inputState.compositionFirstChange = true;
|
|
8009
8011
|
if (view.inputState.composing < 0) {
|
|
8010
8012
|
let { main } = view.state.selection;
|
|
8011
|
-
if (!main.empty && view.lineBlockAt(main.from).from != view.lineBlockAt(main.to).from) view.dispatch({
|
|
8013
|
+
if (!main.empty && view.lineBlockAt(main.from).from != view.lineBlockAt(main.to).from && !view.state.readOnly) view.dispatch({
|
|
8012
8014
|
changes: view.state.selection.ranges.filter((r) => !r.empty).map((r) => ({
|
|
8013
8015
|
from: r.from,
|
|
8014
8016
|
to: r.to
|
|
@@ -8712,17 +8714,16 @@ function visiblePixelRange(dom, paddingTop) {
|
|
|
8712
8714
|
let doc = dom.ownerDocument, win = doc.defaultView || window;
|
|
8713
8715
|
let left = Math.max(0, rect.left), right = Math.min(win.innerWidth, rect.right);
|
|
8714
8716
|
let top = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);
|
|
8715
|
-
for (let parent = dom.parentNode; parent && parent != doc.body;) if (parent
|
|
8716
|
-
let
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
let parentRect = elt.getBoundingClientRect();
|
|
8717
|
+
for (let parent = dom.parentNode; parent && parent != doc.body;) if (isElt(parent)) {
|
|
8718
|
+
let style = window.getComputedStyle(parent);
|
|
8719
|
+
if ((parent.scrollHeight > parent.clientHeight || parent.scrollWidth > parent.clientWidth) && style.overflow != "visible") {
|
|
8720
|
+
let parentRect = parent.getBoundingClientRect();
|
|
8720
8721
|
left = Math.max(left, parentRect.left);
|
|
8721
8722
|
right = Math.min(right, parentRect.right);
|
|
8722
8723
|
top = Math.max(top, parentRect.top);
|
|
8723
8724
|
bottom = Math.min(parent == dom.parentNode ? win.innerHeight : bottom, parentRect.bottom);
|
|
8724
8725
|
}
|
|
8725
|
-
parent = style.position == "absolute" || style.position == "fixed" ?
|
|
8726
|
+
parent = style.position == "absolute" || style.position == "fixed" ? parent.offsetParent : parent.parentNode;
|
|
8726
8727
|
} else if (parent.nodeType == 11) parent = parent.host;
|
|
8727
8728
|
else break;
|
|
8728
8729
|
return {
|
|
@@ -9474,7 +9475,7 @@ var baseTheme$1 = /*@__PURE__*/ buildTheme("." + baseThemeID, {
|
|
|
9474
9475
|
verticalAlign: "bottom"
|
|
9475
9476
|
},
|
|
9476
9477
|
".cm-widgetBuffer": {
|
|
9477
|
-
verticalAlign: "
|
|
9478
|
+
verticalAlign: "baseline",
|
|
9478
9479
|
height: "1em",
|
|
9479
9480
|
width: 0,
|
|
9480
9481
|
display: "inline"
|
|
@@ -9674,7 +9675,7 @@ var DOMObserver = class {
|
|
|
9674
9675
|
listenForScroll() {
|
|
9675
9676
|
this.parentCheck = -1;
|
|
9676
9677
|
let i = 0, changed = null;
|
|
9677
|
-
for (let dom = this.dom; dom;) if (dom
|
|
9678
|
+
for (let dom = this.dom; dom;) if (isElt(dom)) {
|
|
9678
9679
|
if (!changed && i < this.scrollTargets.length && this.scrollTargets[i] == dom) i++;
|
|
9679
9680
|
else if (!changed) changed = this.scrollTargets.slice(0, i);
|
|
9680
9681
|
if (changed) changed.push(dom);
|
|
@@ -9790,14 +9791,14 @@ var DOMObserver = class {
|
|
|
9790
9791
|
flush(readSelection = true) {
|
|
9791
9792
|
if (this.delayedFlush >= 0 || this.delayedAndroidKey) return false;
|
|
9792
9793
|
if (readSelection) this.readSelectionRange();
|
|
9793
|
-
let domChange = this.readChange();
|
|
9794
|
+
let selChange = this.selectionChanged, domChange = this.readChange();
|
|
9794
9795
|
if (!domChange) {
|
|
9795
9796
|
this.view.requestMeasure();
|
|
9796
9797
|
return false;
|
|
9797
9798
|
}
|
|
9798
9799
|
let startState = this.view.state;
|
|
9799
9800
|
let handled = applyDOMChange(this.view, domChange);
|
|
9800
|
-
if (this.view.state == startState && (domChange.domChanged ||
|
|
9801
|
+
if (this.view.state == startState && (domChange.domChanged || selChange)) this.view.update([]);
|
|
9801
9802
|
return handled;
|
|
9802
9803
|
}
|
|
9803
9804
|
readMutation(rec) {
|
|
@@ -10519,7 +10520,7 @@ var EditorView = class EditorView {
|
|
|
10519
10520
|
/**
|
|
10520
10521
|
Schedule a layout measurement, optionally providing callbacks to
|
|
10521
10522
|
do custom DOM measuring followed by a DOM write phase. Using
|
|
10522
|
-
this is preferable reading DOM layout directly from, for
|
|
10523
|
+
this is preferable to reading DOM layout directly from, for
|
|
10523
10524
|
example, an event handler, because it'll make sure measuring and
|
|
10524
10525
|
drawing done by other components is synchronized, avoiding
|
|
10525
10526
|
unnecessary DOM layout computations.
|
|
@@ -11587,6 +11588,7 @@ Define a layer.
|
|
|
11587
11588
|
function layer(config) {
|
|
11588
11589
|
return [ViewPlugin.define((v) => new LayerView(v, config)), layerOrder.of(config)];
|
|
11589
11590
|
}
|
|
11591
|
+
var drawMainRange = !browser.ios;
|
|
11590
11592
|
var selectionConfig = /*@__PURE__*/ Facet.define({ combine(configs) {
|
|
11591
11593
|
return combineConfig(configs, {
|
|
11592
11594
|
cursorBlinkRate: 1200,
|
|
@@ -11668,7 +11670,7 @@ var selectionLayer = /*@__PURE__*/ layer({
|
|
|
11668
11670
|
above: false,
|
|
11669
11671
|
markers(view) {
|
|
11670
11672
|
let markers = [], { main, ranges } = view.state.selection;
|
|
11671
|
-
for (let r of ranges) if (!r.empty) for (let marker of RectangleMarker.forRange(view, "cm-selectionBackground", r)) markers.push(marker);
|
|
11673
|
+
for (let r of ranges) if (!r.empty && (drawMainRange || r != main)) for (let marker of RectangleMarker.forRange(view, "cm-selectionBackground", r)) markers.push(marker);
|
|
11672
11674
|
if (browser.ios && !main.empty && view.state.facet(selectionConfig).iosSelectionHandles) {
|
|
11673
11675
|
for (let piece of RectangleMarker.forRange(view, "cm-selectionHandle cm-selectionHandle-start", EditorSelection.cursor(main.from, 1))) markers.push(piece);
|
|
11674
11676
|
for (let piece of RectangleMarker.forRange(view, "cm-selectionHandle cm-selectionHandle-end", EditorSelection.cursor(main.to, 1))) markers.push(piece);
|
|
@@ -11683,14 +11685,14 @@ var selectionLayer = /*@__PURE__*/ layer({
|
|
|
11683
11685
|
var selectionBg = browser.gecko && browser.gecko_version == 153 ? "#ffffff01" : "transparent";
|
|
11684
11686
|
var hideNativeSelection = /*@__PURE__*/ Prec.highest(/*@__PURE__*/ EditorView.theme({
|
|
11685
11687
|
".cm-line": {
|
|
11686
|
-
"& ::selection, &::selection": { backgroundColor: `${selectionBg} !important` },
|
|
11688
|
+
...drawMainRange ? { "& ::selection, &::selection": { backgroundColor: `${selectionBg} !important` } } : {},
|
|
11687
11689
|
caretColor: "transparent !important"
|
|
11688
11690
|
},
|
|
11689
11691
|
".cm-content": {
|
|
11690
11692
|
caretColor: "transparent !important",
|
|
11691
11693
|
"& :focus": {
|
|
11692
11694
|
caretColor: "initial !important",
|
|
11693
|
-
"&::selection, & ::selection": { backgroundColor: "Highlight !important" }
|
|
11695
|
+
...drawMainRange ? { "&::selection, & ::selection": { backgroundColor: "Highlight !important" } } : {}
|
|
11694
11696
|
}
|
|
11695
11697
|
}
|
|
11696
11698
|
}));
|
|
@@ -11890,13 +11892,26 @@ Creates an extension that configures tooltip behavior.
|
|
|
11890
11892
|
function tooltips(config = {}) {
|
|
11891
11893
|
return tooltipConfig.of(config);
|
|
11892
11894
|
}
|
|
11895
|
+
function fixedRange(view) {
|
|
11896
|
+
let docElt = view.dom.ownerDocument.documentElement, width = docElt.clientWidth;
|
|
11897
|
+
let style = getComputedStyle(docElt);
|
|
11898
|
+
if (!/stable/.test(style.scrollbarGutter || "")) return {
|
|
11899
|
+
left: 0,
|
|
11900
|
+
right: width
|
|
11901
|
+
};
|
|
11902
|
+
let rect = docElt.getBoundingClientRect(), scrollX = view.win.scrollX;
|
|
11903
|
+
return {
|
|
11904
|
+
left: Math.max(0, rect.left + scrollX - parseFloat(style.marginLeft)),
|
|
11905
|
+
right: Math.min(width, rect.right + scrollX + parseFloat(style.marginRight))
|
|
11906
|
+
};
|
|
11907
|
+
}
|
|
11893
11908
|
function windowSpace(view) {
|
|
11894
|
-
let
|
|
11909
|
+
let { left, right } = fixedRange(view);
|
|
11895
11910
|
return {
|
|
11896
11911
|
top: 0,
|
|
11897
|
-
left
|
|
11898
|
-
|
|
11899
|
-
|
|
11912
|
+
left,
|
|
11913
|
+
right,
|
|
11914
|
+
bottom: view.dom.ownerDocument.documentElement.clientHeight
|
|
11900
11915
|
};
|
|
11901
11916
|
}
|
|
11902
11917
|
var tooltipConfig = /*@__PURE__*/ Facet.define({ combine: (values) => {
|
|
@@ -12009,7 +12024,7 @@ var tooltipPlugin = /*@__PURE__*/ ViewPlugin.fromClass(class {
|
|
|
12009
12024
|
clearTimeout(this.measureTimeout);
|
|
12010
12025
|
}
|
|
12011
12026
|
readMeasure() {
|
|
12012
|
-
let scaleX = 1, scaleY = 1, makeAbsolute = false;
|
|
12027
|
+
let scaleX = 1, scaleY = 1, makeAbsolute = false, fixedLeft = 0;
|
|
12013
12028
|
if (this.position == "fixed" && this.manager.tooltipViews.length) {
|
|
12014
12029
|
let { dom } = this.manager.tooltipViews[0];
|
|
12015
12030
|
if (browser.safari) {
|
|
@@ -12025,7 +12040,7 @@ var tooltipPlugin = /*@__PURE__*/ ViewPlugin.fromClass(class {
|
|
|
12025
12040
|
scaleY = rect.height / this.parent.offsetHeight;
|
|
12026
12041
|
}
|
|
12027
12042
|
} else ({scaleX, scaleY} = this.view.viewState);
|
|
12028
|
-
}
|
|
12043
|
+
} else fixedLeft = fixedRange(this.view).left;
|
|
12029
12044
|
let visible = this.view.scrollDOM.getBoundingClientRect(), margins = getScrollMargins(this.view);
|
|
12030
12045
|
return {
|
|
12031
12046
|
visible: {
|
|
@@ -12043,7 +12058,8 @@ var tooltipPlugin = /*@__PURE__*/ ViewPlugin.fromClass(class {
|
|
|
12043
12058
|
space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),
|
|
12044
12059
|
scaleX,
|
|
12045
12060
|
scaleY,
|
|
12046
|
-
makeAbsolute
|
|
12061
|
+
makeAbsolute,
|
|
12062
|
+
fixedLeft
|
|
12047
12063
|
};
|
|
12048
12064
|
}
|
|
12049
12065
|
writeMeasure(measured) {
|
|
@@ -12088,7 +12104,7 @@ var tooltipPlugin = /*@__PURE__*/ ViewPlugin.fromClass(class {
|
|
|
12088
12104
|
setLeftStyle(dom, (left - measured.parent.left) / scaleX);
|
|
12089
12105
|
} else {
|
|
12090
12106
|
dom.style.top = top / scaleY + "px";
|
|
12091
|
-
setLeftStyle(dom, left / scaleX);
|
|
12107
|
+
setLeftStyle(dom, (left - measured.fixedLeft) / scaleX);
|
|
12092
12108
|
}
|
|
12093
12109
|
if (arrow) {
|
|
12094
12110
|
let arrowLeft = pos.left + (ltr ? offset.x : -offset.x) - (left + 14 - 7);
|
|
@@ -15368,6 +15384,172 @@ tagHighlighter([
|
|
|
15368
15384
|
}
|
|
15369
15385
|
]);
|
|
15370
15386
|
//#endregion
|
|
15387
|
+
//#region node_modules/@codemirror/streamparser/dist/index.js
|
|
15388
|
+
function countCol(string, end, tabSize, startIndex = 0, startValue = 0) {
|
|
15389
|
+
if (end == null) {
|
|
15390
|
+
end = string.search(/[^\s\u00a0]/);
|
|
15391
|
+
if (end == -1) end = string.length;
|
|
15392
|
+
}
|
|
15393
|
+
let n = startValue;
|
|
15394
|
+
for (let i = startIndex; i < end; i++) if (string.charCodeAt(i) == 9) n += tabSize - n % tabSize;
|
|
15395
|
+
else n++;
|
|
15396
|
+
return n;
|
|
15397
|
+
}
|
|
15398
|
+
/**
|
|
15399
|
+
Encapsulates a single line of input. Given to stream syntax code,
|
|
15400
|
+
which uses it to tokenize the content.
|
|
15401
|
+
*/
|
|
15402
|
+
var StringStream = class {
|
|
15403
|
+
/**
|
|
15404
|
+
Create a stream.
|
|
15405
|
+
*/
|
|
15406
|
+
constructor(string, tabSize, indentUnit, overrideIndent) {
|
|
15407
|
+
this.string = string;
|
|
15408
|
+
this.tabSize = tabSize;
|
|
15409
|
+
this.indentUnit = indentUnit;
|
|
15410
|
+
this.overrideIndent = overrideIndent;
|
|
15411
|
+
/**
|
|
15412
|
+
The current position on the line.
|
|
15413
|
+
*/
|
|
15414
|
+
this.pos = 0;
|
|
15415
|
+
/**
|
|
15416
|
+
The start position of the current token.
|
|
15417
|
+
*/
|
|
15418
|
+
this.start = 0;
|
|
15419
|
+
this.lastColumnPos = 0;
|
|
15420
|
+
this.lastColumnValue = 0;
|
|
15421
|
+
}
|
|
15422
|
+
/**
|
|
15423
|
+
True if we are at the end of the line.
|
|
15424
|
+
*/
|
|
15425
|
+
eol() {
|
|
15426
|
+
return this.pos >= this.string.length;
|
|
15427
|
+
}
|
|
15428
|
+
/**
|
|
15429
|
+
True if we are at the start of the line.
|
|
15430
|
+
*/
|
|
15431
|
+
sol() {
|
|
15432
|
+
return this.pos == 0;
|
|
15433
|
+
}
|
|
15434
|
+
/**
|
|
15435
|
+
Get the next code unit after the current position, or undefined
|
|
15436
|
+
if we're at the end of the line.
|
|
15437
|
+
*/
|
|
15438
|
+
peek() {
|
|
15439
|
+
return this.string.charAt(this.pos) || void 0;
|
|
15440
|
+
}
|
|
15441
|
+
/**
|
|
15442
|
+
Read the next code unit and advance `this.pos`.
|
|
15443
|
+
*/
|
|
15444
|
+
next() {
|
|
15445
|
+
if (this.pos < this.string.length) return this.string.charAt(this.pos++);
|
|
15446
|
+
}
|
|
15447
|
+
/**
|
|
15448
|
+
Match the next character against the given string, regular
|
|
15449
|
+
expression, or predicate. Consume and return it if it matches.
|
|
15450
|
+
*/
|
|
15451
|
+
eat(match) {
|
|
15452
|
+
let ch = this.string.charAt(this.pos);
|
|
15453
|
+
let ok;
|
|
15454
|
+
if (typeof match == "string") ok = ch == match;
|
|
15455
|
+
else ok = ch && (match instanceof RegExp ? match.test(ch) : match(ch));
|
|
15456
|
+
if (ok) {
|
|
15457
|
+
++this.pos;
|
|
15458
|
+
return ch;
|
|
15459
|
+
}
|
|
15460
|
+
}
|
|
15461
|
+
/**
|
|
15462
|
+
Continue matching characters that match the given string,
|
|
15463
|
+
regular expression, or predicate function. Return true if any
|
|
15464
|
+
characters were consumed.
|
|
15465
|
+
*/
|
|
15466
|
+
eatWhile(match) {
|
|
15467
|
+
let start = this.pos;
|
|
15468
|
+
while (this.eat(match));
|
|
15469
|
+
return this.pos > start;
|
|
15470
|
+
}
|
|
15471
|
+
/**
|
|
15472
|
+
Consume whitespace ahead of `this.pos`. Return true if any was
|
|
15473
|
+
found.
|
|
15474
|
+
*/
|
|
15475
|
+
eatSpace() {
|
|
15476
|
+
let start = this.pos;
|
|
15477
|
+
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
|
|
15478
|
+
return this.pos > start;
|
|
15479
|
+
}
|
|
15480
|
+
/**
|
|
15481
|
+
Move to the end of the line.
|
|
15482
|
+
*/
|
|
15483
|
+
skipToEnd() {
|
|
15484
|
+
this.pos = this.string.length;
|
|
15485
|
+
}
|
|
15486
|
+
/**
|
|
15487
|
+
Move to directly before the given character, if found on the
|
|
15488
|
+
current line.
|
|
15489
|
+
*/
|
|
15490
|
+
skipTo(ch) {
|
|
15491
|
+
let found = this.string.indexOf(ch, this.pos);
|
|
15492
|
+
if (found > -1) {
|
|
15493
|
+
this.pos = found;
|
|
15494
|
+
return true;
|
|
15495
|
+
}
|
|
15496
|
+
}
|
|
15497
|
+
/**
|
|
15498
|
+
Move back `n` characters.
|
|
15499
|
+
*/
|
|
15500
|
+
backUp(n) {
|
|
15501
|
+
this.pos -= n;
|
|
15502
|
+
}
|
|
15503
|
+
/**
|
|
15504
|
+
Get the column position at `this.pos`.
|
|
15505
|
+
*/
|
|
15506
|
+
column() {
|
|
15507
|
+
if (this.lastColumnPos < this.start) {
|
|
15508
|
+
this.lastColumnValue = countCol(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
|
|
15509
|
+
this.lastColumnPos = this.start;
|
|
15510
|
+
}
|
|
15511
|
+
return this.lastColumnValue;
|
|
15512
|
+
}
|
|
15513
|
+
/**
|
|
15514
|
+
Get the indentation column of the current line.
|
|
15515
|
+
*/
|
|
15516
|
+
indentation() {
|
|
15517
|
+
var _a;
|
|
15518
|
+
return (_a = this.overrideIndent) !== null && _a !== void 0 ? _a : countCol(this.string, null, this.tabSize);
|
|
15519
|
+
}
|
|
15520
|
+
/**
|
|
15521
|
+
Match the input against the given string or regular expression
|
|
15522
|
+
(which should start with a `^`). Return true or the regexp match
|
|
15523
|
+
if it matches.
|
|
15524
|
+
|
|
15525
|
+
Unless `consume` is set to `false`, this will move `this.pos`
|
|
15526
|
+
past the matched text.
|
|
15527
|
+
|
|
15528
|
+
When matching a string `caseInsensitive` can be set to true to
|
|
15529
|
+
make the match case-insensitive.
|
|
15530
|
+
*/
|
|
15531
|
+
match(pattern, consume, caseInsensitive) {
|
|
15532
|
+
if (typeof pattern == "string") {
|
|
15533
|
+
let cased = (str) => caseInsensitive ? str.toLowerCase() : str;
|
|
15534
|
+
if (cased(this.string.substr(this.pos, pattern.length)) == cased(pattern)) {
|
|
15535
|
+
if (consume !== false) this.pos += pattern.length;
|
|
15536
|
+
return true;
|
|
15537
|
+
} else return null;
|
|
15538
|
+
} else {
|
|
15539
|
+
let match = this.string.slice(this.pos).match(pattern);
|
|
15540
|
+
if (match && match.index > 0) return null;
|
|
15541
|
+
if (match && consume !== false) this.pos += match[0].length;
|
|
15542
|
+
return match;
|
|
15543
|
+
}
|
|
15544
|
+
}
|
|
15545
|
+
/**
|
|
15546
|
+
Get the current token.
|
|
15547
|
+
*/
|
|
15548
|
+
current() {
|
|
15549
|
+
return this.string.slice(this.start, this.pos);
|
|
15550
|
+
}
|
|
15551
|
+
};
|
|
15552
|
+
//#endregion
|
|
15371
15553
|
//#region node_modules/@codemirror/language/dist/index.js
|
|
15372
15554
|
var _a;
|
|
15373
15555
|
/**
|
|
@@ -16571,170 +16753,6 @@ function matchPlainBrackets(state, pos, dir, tree, tokenType, maxScanDistance, b
|
|
|
16571
16753
|
matched: false
|
|
16572
16754
|
} : null;
|
|
16573
16755
|
}
|
|
16574
|
-
function countCol(string, end, tabSize, startIndex = 0, startValue = 0) {
|
|
16575
|
-
if (end == null) {
|
|
16576
|
-
end = string.search(/[^\s\u00a0]/);
|
|
16577
|
-
if (end == -1) end = string.length;
|
|
16578
|
-
}
|
|
16579
|
-
let n = startValue;
|
|
16580
|
-
for (let i = startIndex; i < end; i++) if (string.charCodeAt(i) == 9) n += tabSize - n % tabSize;
|
|
16581
|
-
else n++;
|
|
16582
|
-
return n;
|
|
16583
|
-
}
|
|
16584
|
-
/**
|
|
16585
|
-
Encapsulates a single line of input. Given to stream syntax code,
|
|
16586
|
-
which uses it to tokenize the content.
|
|
16587
|
-
*/
|
|
16588
|
-
var StringStream = class {
|
|
16589
|
-
/**
|
|
16590
|
-
Create a stream.
|
|
16591
|
-
*/
|
|
16592
|
-
constructor(string, tabSize, indentUnit, overrideIndent) {
|
|
16593
|
-
this.string = string;
|
|
16594
|
-
this.tabSize = tabSize;
|
|
16595
|
-
this.indentUnit = indentUnit;
|
|
16596
|
-
this.overrideIndent = overrideIndent;
|
|
16597
|
-
/**
|
|
16598
|
-
The current position on the line.
|
|
16599
|
-
*/
|
|
16600
|
-
this.pos = 0;
|
|
16601
|
-
/**
|
|
16602
|
-
The start position of the current token.
|
|
16603
|
-
*/
|
|
16604
|
-
this.start = 0;
|
|
16605
|
-
this.lastColumnPos = 0;
|
|
16606
|
-
this.lastColumnValue = 0;
|
|
16607
|
-
}
|
|
16608
|
-
/**
|
|
16609
|
-
True if we are at the end of the line.
|
|
16610
|
-
*/
|
|
16611
|
-
eol() {
|
|
16612
|
-
return this.pos >= this.string.length;
|
|
16613
|
-
}
|
|
16614
|
-
/**
|
|
16615
|
-
True if we are at the start of the line.
|
|
16616
|
-
*/
|
|
16617
|
-
sol() {
|
|
16618
|
-
return this.pos == 0;
|
|
16619
|
-
}
|
|
16620
|
-
/**
|
|
16621
|
-
Get the next code unit after the current position, or undefined
|
|
16622
|
-
if we're at the end of the line.
|
|
16623
|
-
*/
|
|
16624
|
-
peek() {
|
|
16625
|
-
return this.string.charAt(this.pos) || void 0;
|
|
16626
|
-
}
|
|
16627
|
-
/**
|
|
16628
|
-
Read the next code unit and advance `this.pos`.
|
|
16629
|
-
*/
|
|
16630
|
-
next() {
|
|
16631
|
-
if (this.pos < this.string.length) return this.string.charAt(this.pos++);
|
|
16632
|
-
}
|
|
16633
|
-
/**
|
|
16634
|
-
Match the next character against the given string, regular
|
|
16635
|
-
expression, or predicate. Consume and return it if it matches.
|
|
16636
|
-
*/
|
|
16637
|
-
eat(match) {
|
|
16638
|
-
let ch = this.string.charAt(this.pos);
|
|
16639
|
-
let ok;
|
|
16640
|
-
if (typeof match == "string") ok = ch == match;
|
|
16641
|
-
else ok = ch && (match instanceof RegExp ? match.test(ch) : match(ch));
|
|
16642
|
-
if (ok) {
|
|
16643
|
-
++this.pos;
|
|
16644
|
-
return ch;
|
|
16645
|
-
}
|
|
16646
|
-
}
|
|
16647
|
-
/**
|
|
16648
|
-
Continue matching characters that match the given string,
|
|
16649
|
-
regular expression, or predicate function. Return true if any
|
|
16650
|
-
characters were consumed.
|
|
16651
|
-
*/
|
|
16652
|
-
eatWhile(match) {
|
|
16653
|
-
let start = this.pos;
|
|
16654
|
-
while (this.eat(match));
|
|
16655
|
-
return this.pos > start;
|
|
16656
|
-
}
|
|
16657
|
-
/**
|
|
16658
|
-
Consume whitespace ahead of `this.pos`. Return true if any was
|
|
16659
|
-
found.
|
|
16660
|
-
*/
|
|
16661
|
-
eatSpace() {
|
|
16662
|
-
let start = this.pos;
|
|
16663
|
-
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
|
|
16664
|
-
return this.pos > start;
|
|
16665
|
-
}
|
|
16666
|
-
/**
|
|
16667
|
-
Move to the end of the line.
|
|
16668
|
-
*/
|
|
16669
|
-
skipToEnd() {
|
|
16670
|
-
this.pos = this.string.length;
|
|
16671
|
-
}
|
|
16672
|
-
/**
|
|
16673
|
-
Move to directly before the given character, if found on the
|
|
16674
|
-
current line.
|
|
16675
|
-
*/
|
|
16676
|
-
skipTo(ch) {
|
|
16677
|
-
let found = this.string.indexOf(ch, this.pos);
|
|
16678
|
-
if (found > -1) {
|
|
16679
|
-
this.pos = found;
|
|
16680
|
-
return true;
|
|
16681
|
-
}
|
|
16682
|
-
}
|
|
16683
|
-
/**
|
|
16684
|
-
Move back `n` characters.
|
|
16685
|
-
*/
|
|
16686
|
-
backUp(n) {
|
|
16687
|
-
this.pos -= n;
|
|
16688
|
-
}
|
|
16689
|
-
/**
|
|
16690
|
-
Get the column position at `this.pos`.
|
|
16691
|
-
*/
|
|
16692
|
-
column() {
|
|
16693
|
-
if (this.lastColumnPos < this.start) {
|
|
16694
|
-
this.lastColumnValue = countCol(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
|
|
16695
|
-
this.lastColumnPos = this.start;
|
|
16696
|
-
}
|
|
16697
|
-
return this.lastColumnValue;
|
|
16698
|
-
}
|
|
16699
|
-
/**
|
|
16700
|
-
Get the indentation column of the current line.
|
|
16701
|
-
*/
|
|
16702
|
-
indentation() {
|
|
16703
|
-
var _a;
|
|
16704
|
-
return (_a = this.overrideIndent) !== null && _a !== void 0 ? _a : countCol(this.string, null, this.tabSize);
|
|
16705
|
-
}
|
|
16706
|
-
/**
|
|
16707
|
-
Match the input against the given string or regular expression
|
|
16708
|
-
(which should start with a `^`). Return true or the regexp match
|
|
16709
|
-
if it matches.
|
|
16710
|
-
|
|
16711
|
-
Unless `consume` is set to `false`, this will move `this.pos`
|
|
16712
|
-
past the matched text.
|
|
16713
|
-
|
|
16714
|
-
When matching a string `caseInsensitive` can be set to true to
|
|
16715
|
-
make the match case-insensitive.
|
|
16716
|
-
*/
|
|
16717
|
-
match(pattern, consume, caseInsensitive) {
|
|
16718
|
-
if (typeof pattern == "string") {
|
|
16719
|
-
let cased = (str) => caseInsensitive ? str.toLowerCase() : str;
|
|
16720
|
-
if (cased(this.string.substr(this.pos, pattern.length)) == cased(pattern)) {
|
|
16721
|
-
if (consume !== false) this.pos += pattern.length;
|
|
16722
|
-
return true;
|
|
16723
|
-
} else return null;
|
|
16724
|
-
} else {
|
|
16725
|
-
let match = this.string.slice(this.pos).match(pattern);
|
|
16726
|
-
if (match && match.index > 0) return null;
|
|
16727
|
-
if (match && consume !== false) this.pos += match[0].length;
|
|
16728
|
-
return match;
|
|
16729
|
-
}
|
|
16730
|
-
}
|
|
16731
|
-
/**
|
|
16732
|
-
Get the current token.
|
|
16733
|
-
*/
|
|
16734
|
-
current() {
|
|
16735
|
-
return this.string.slice(this.start, this.pos);
|
|
16736
|
-
}
|
|
16737
|
-
};
|
|
16738
16756
|
function fullParser(spec) {
|
|
16739
16757
|
return {
|
|
16740
16758
|
name: spec.name || "",
|