@maketribe/ms-app 3.1.1 → 3.1.3
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/cjs/assets/iconfonts/iconfont.js +38 -0
- package/dist/cjs/assets/iconfonts/iconfont.js.map +1 -0
- package/dist/cjs/components/basic/icon-select/icon-select.js +1 -1
- package/dist/cjs/components/basic/icon-select/icon-select.js.map +1 -1
- package/dist/cjs/components/basic/svg-icon/svg-icon.js.map +1 -1
- package/dist/cjs/components/business/verify-dialog/verify-dialog.js.map +1 -1
- package/dist/cjs/components/data-model/data-table/components/column-action/column-action-options.d.ts +3 -2
- package/dist/cjs/components/data-model/data-table/components/column-action/column-action-options.js +2 -1
- package/dist/cjs/components/data-model/data-table/components/column-action/column-action-options.js.map +1 -1
- package/dist/cjs/components/data-model/data-table/components/column-action/column-action.d.ts +7 -3
- package/dist/cjs/components/data-model/data-table/components/column-action/column-action.js +5 -1
- package/dist/cjs/components/data-model/data-table/components/column-action/column-action.js.map +1 -1
- package/dist/cjs/components/data-model/data-table/components/column-action/index.d.ts +7 -3
- package/dist/cjs/core/MSAppClient.js +2 -2
- package/dist/cjs/core/MSAppClient.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/cms/dataviews/cms-articles/CmsArticlesForm.js +3 -3
- package/dist/cjs/modules/cms/dataviews/cms-articles/CmsArticlesForm.js.map +1 -1
- package/dist/cjs/modules/cms/dataviews/cms-parts/CmsPartForm.js +32 -6
- package/dist/cjs/modules/cms/dataviews/cms-parts/CmsPartForm.js.map +1 -1
- package/dist/cjs/modules/cms/dataviews/cms-parts/CmsPartTree.js.map +1 -1
- package/dist/cjs/modules/cms/index.js +5 -0
- package/dist/cjs/modules/cms/index.js.map +1 -1
- package/dist/cjs/modules/cms/pages/cms-resource/components/resource-item/index.vue.d.ts +12 -0
- package/dist/cjs/modules/cms/pages/cms-resource/components/resource-item/index.vue.js +9 -0
- package/dist/cjs/modules/cms/pages/cms-resource/components/resource-item/index.vue.js.map +1 -0
- package/dist/cjs/modules/cms/pages/cms-resource/components/resource-item/index.vue2.js +91 -0
- package/dist/cjs/modules/cms/pages/cms-resource/components/resource-item/index.vue2.js.map +1 -0
- package/dist/cjs/modules/cms/pages/cms-resource/core/ResourceManager.d.ts +23 -0
- package/dist/cjs/modules/cms/pages/cms-resource/core/ResourceManager.js +133 -0
- package/dist/cjs/modules/cms/pages/cms-resource/core/ResourceManager.js.map +1 -0
- package/dist/cjs/modules/cms/pages/cms-resource/index.vue.d.ts +2 -0
- package/dist/cjs/modules/cms/pages/cms-resource/index.vue.js +9 -0
- package/dist/cjs/modules/cms/pages/cms-resource/index.vue.js.map +1 -0
- package/dist/cjs/modules/cms/pages/cms-resource/index.vue2.js +217 -0
- package/dist/cjs/modules/cms/pages/cms-resource/index.vue2.js.map +1 -0
- package/dist/cjs/modules/ms/pages/local-log/index.vue2.js.map +1 -1
- package/dist/cjs/node_modules/.pnpm/@codemirror_autocomplete@6.15.0_@codemirror_language@6.10.1_@codemirror_state@6.4.1_@codemirr_djjyqdn7bhwopzrz2h2s2bwhzm/node_modules/@codemirror/autocomplete/dist/index.js +276 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_autocomplete@6.15.0_@codemirror_language@6.10.1_@codemirror_state@6.4.1_@codemirr_djjyqdn7bhwopzrz2h2s2bwhzm/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/.pnpm/@codemirror_lang-css@6.2.1_@codemirror_view@6.26.1/node_modules/@codemirror/lang-css/dist/index.js +263 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_lang-css@6.2.1_@codemirror_view@6.26.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_lang-html@6.4.9/node_modules/@codemirror/lang-html/dist/index.js +667 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_lang-html@6.4.9/node_modules/@codemirror/lang-html/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_lang-javascript@6.2.2/node_modules/@codemirror/lang-javascript/dist/index.js +342 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_lang-javascript@6.2.2/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_language@6.10.1/node_modules/@codemirror/language/dist/index.js +21 -0
- package/dist/cjs/node_modules/.pnpm/@codemirror_language@6.10.1/node_modules/@codemirror/language/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/.pnpm/@lezer_common@1.2.1/node_modules/@lezer/common/dist/index.js +510 -1
- package/dist/cjs/node_modules/.pnpm/@lezer_common@1.2.1/node_modules/@lezer/common/dist/index.js.map +1 -1
- package/dist/cjs/node_modules/.pnpm/@lezer_css@1.1.8/node_modules/@lezer/css/dist/index.js +127 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_css@1.1.8/node_modules/@lezer/css/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_html@1.3.10/node_modules/@lezer/html/dist/index.js +360 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_html@1.3.10/node_modules/@lezer/html/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_javascript@1.4.17/node_modules/@lezer/javascript/dist/index.js +189 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_javascript@1.4.17/node_modules/@lezer/javascript/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_lr@1.4.0/node_modules/@lezer/lr/dist/index.js +1879 -0
- package/dist/cjs/node_modules/.pnpm/@lezer_lr@1.4.0/node_modules/@lezer/lr/dist/index.js.map +1 -0
- package/dist/cjs/page/signup/index.vue2.js +1 -1
- package/dist/cjs/page/signup/index.vue2.js.map +1 -1
- package/dist/cjs/router-middleware/auth.js +1 -1
- package/dist/cjs/router-middleware/auth.js.map +1 -1
- package/dist/esm/assets/iconfonts/iconfont.js +36 -0
- package/dist/esm/assets/iconfonts/iconfont.js.map +1 -0
- package/dist/esm/components/basic/icon-select/icon-select.js +1 -1
- package/dist/esm/components/basic/icon-select/icon-select.js.map +1 -1
- package/dist/esm/components/basic/svg-icon/svg-icon.js.map +1 -1
- package/dist/esm/components/business/verify-dialog/verify-dialog.js.map +1 -1
- package/dist/esm/components/data-model/data-table/components/column-action/column-action-options.d.ts +3 -2
- package/dist/esm/components/data-model/data-table/components/column-action/column-action-options.js +3 -2
- package/dist/esm/components/data-model/data-table/components/column-action/column-action-options.js.map +1 -1
- package/dist/esm/components/data-model/data-table/components/column-action/column-action.d.ts +7 -3
- package/dist/esm/components/data-model/data-table/components/column-action/column-action.js +5 -1
- package/dist/esm/components/data-model/data-table/components/column-action/column-action.js.map +1 -1
- package/dist/esm/components/data-model/data-table/components/column-action/index.d.ts +7 -3
- package/dist/esm/core/MSAppClient.js +2 -2
- package/dist/esm/core/MSAppClient.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/cms/dataviews/cms-articles/CmsArticlesForm.js +3 -3
- package/dist/esm/modules/cms/dataviews/cms-articles/CmsArticlesForm.js.map +1 -1
- package/dist/esm/modules/cms/dataviews/cms-parts/CmsPartForm.js +32 -6
- package/dist/esm/modules/cms/dataviews/cms-parts/CmsPartForm.js.map +1 -1
- package/dist/esm/modules/cms/dataviews/cms-parts/CmsPartTree.js.map +1 -1
- package/dist/esm/modules/cms/index.js +5 -0
- package/dist/esm/modules/cms/index.js.map +1 -1
- package/dist/esm/modules/cms/pages/cms-resource/components/resource-item/index.vue.d.ts +12 -0
- package/dist/esm/modules/cms/pages/cms-resource/components/resource-item/index.vue.js +7 -0
- package/dist/esm/modules/cms/pages/cms-resource/components/resource-item/index.vue.js.map +1 -0
- package/dist/esm/modules/cms/pages/cms-resource/components/resource-item/index.vue2.js +89 -0
- package/dist/esm/modules/cms/pages/cms-resource/components/resource-item/index.vue2.js.map +1 -0
- package/dist/esm/modules/cms/pages/cms-resource/core/ResourceManager.d.ts +23 -0
- package/dist/esm/modules/cms/pages/cms-resource/core/ResourceManager.js +131 -0
- package/dist/esm/modules/cms/pages/cms-resource/core/ResourceManager.js.map +1 -0
- package/dist/esm/modules/cms/pages/cms-resource/index.vue.d.ts +2 -0
- package/dist/esm/modules/cms/pages/cms-resource/index.vue.js +7 -0
- package/dist/esm/modules/cms/pages/cms-resource/index.vue.js.map +1 -0
- package/dist/esm/modules/cms/pages/cms-resource/index.vue2.js +215 -0
- package/dist/esm/modules/cms/pages/cms-resource/index.vue2.js.map +1 -0
- package/dist/esm/modules/ms/pages/local-log/index.vue2.js.map +1 -1
- package/dist/esm/node_modules/.pnpm/@codemirror_autocomplete@6.15.0_@codemirror_language@6.10.1_@codemirror_state@6.4.1_@codemirr_djjyqdn7bhwopzrz2h2s2bwhzm/node_modules/@codemirror/autocomplete/dist/index.js +273 -4
- package/dist/esm/node_modules/.pnpm/@codemirror_autocomplete@6.15.0_@codemirror_language@6.10.1_@codemirror_state@6.4.1_@codemirr_djjyqdn7bhwopzrz2h2s2bwhzm/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
- package/dist/esm/node_modules/.pnpm/@codemirror_lang-css@6.2.1_@codemirror_view@6.26.1/node_modules/@codemirror/lang-css/dist/index.js +258 -0
- package/dist/esm/node_modules/.pnpm/@codemirror_lang-css@6.2.1_@codemirror_view@6.26.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@codemirror_lang-html@6.4.9/node_modules/@codemirror/lang-html/dist/index.js +661 -0
- package/dist/esm/node_modules/.pnpm/@codemirror_lang-html@6.4.9/node_modules/@codemirror/lang-html/dist/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@codemirror_lang-javascript@6.2.2/node_modules/@codemirror/lang-javascript/dist/index.js +332 -0
- package/dist/esm/node_modules/.pnpm/@codemirror_lang-javascript@6.2.2/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@codemirror_language@6.10.1/node_modules/@codemirror/language/dist/index.js +20 -1
- package/dist/esm/node_modules/.pnpm/@codemirror_language@6.10.1/node_modules/@codemirror/language/dist/index.js.map +1 -1
- package/dist/esm/node_modules/.pnpm/@lezer_common@1.2.1/node_modules/@lezer/common/dist/index.js +508 -2
- package/dist/esm/node_modules/.pnpm/@lezer_common@1.2.1/node_modules/@lezer/common/dist/index.js.map +1 -1
- package/dist/esm/node_modules/.pnpm/@lezer_css@1.1.8/node_modules/@lezer/css/dist/index.js +125 -0
- package/dist/esm/node_modules/.pnpm/@lezer_css@1.1.8/node_modules/@lezer/css/dist/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@lezer_html@1.3.10/node_modules/@lezer/html/dist/index.js +357 -0
- package/dist/esm/node_modules/.pnpm/@lezer_html@1.3.10/node_modules/@lezer/html/dist/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@lezer_javascript@1.4.17/node_modules/@lezer/javascript/dist/index.js +187 -0
- package/dist/esm/node_modules/.pnpm/@lezer_javascript@1.4.17/node_modules/@lezer/javascript/dist/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@lezer_lr@1.4.0/node_modules/@lezer/lr/dist/index.js +1872 -0
- package/dist/esm/node_modules/.pnpm/@lezer_lr@1.4.0/node_modules/@lezer/lr/dist/index.js.map +1 -0
- package/dist/esm/page/signup/index.vue2.js +1 -1
- package/dist/esm/page/signup/index.vue2.js.map +1 -1
- package/dist/esm/router-middleware/auth.js +1 -1
- package/dist/esm/router-middleware/auth.js.map +1 -1
- package/dist/style/index.css +1 -1
- package/dist/style/modules/cms/index.css +1 -0
- package/dist/style/modules/cms/resource-manager.css +1 -0
- package/dist/style/src/index.scss +16 -15
- package/dist/style/src/modules/cms/index.scss +1 -0
- package/dist/style/src/modules/cms/resource-manager.scss +71 -0
- package/package.json +4 -6
package/dist/esm/node_modules/.pnpm/@lezer_common@1.2.1/node_modules/@lezer/common/dist/index.js
CHANGED
|
@@ -250,6 +250,52 @@ class NodeType {
|
|
|
250
250
|
An empty dummy node type to use when no actual type is available.
|
|
251
251
|
*/
|
|
252
252
|
NodeType.none = new NodeType("", Object.create(null), 0, 8 /* NodeFlag.Anonymous */);
|
|
253
|
+
/**
|
|
254
|
+
A node set holds a collection of node types. It is used to
|
|
255
|
+
compactly represent trees by storing their type ids, rather than a
|
|
256
|
+
full pointer to the type object, in a numeric array. Each parser
|
|
257
|
+
[has](#lr.LRParser.nodeSet) a node set, and [tree
|
|
258
|
+
buffers](#common.TreeBuffer) can only store collections of nodes
|
|
259
|
+
from the same set. A set can have a maximum of 2**16 (65536) node
|
|
260
|
+
types in it, so that the ids fit into 16-bit typed array slots.
|
|
261
|
+
*/
|
|
262
|
+
class NodeSet {
|
|
263
|
+
/**
|
|
264
|
+
Create a set with the given types. The `id` property of each
|
|
265
|
+
type should correspond to its position within the array.
|
|
266
|
+
*/
|
|
267
|
+
constructor(
|
|
268
|
+
/**
|
|
269
|
+
The node types in this set, by id.
|
|
270
|
+
*/
|
|
271
|
+
types) {
|
|
272
|
+
this.types = types;
|
|
273
|
+
for (let i = 0; i < types.length; i++)
|
|
274
|
+
if (types[i].id != i)
|
|
275
|
+
throw new RangeError("Node type ids should correspond to array positions when creating a node set");
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
Create a copy of this set with some node properties added. The
|
|
279
|
+
arguments to this method can be created with
|
|
280
|
+
[`NodeProp.add`](#common.NodeProp.add).
|
|
281
|
+
*/
|
|
282
|
+
extend(...props) {
|
|
283
|
+
let newTypes = [];
|
|
284
|
+
for (let type of this.types) {
|
|
285
|
+
let newProps = null;
|
|
286
|
+
for (let source of props) {
|
|
287
|
+
let add = source(type);
|
|
288
|
+
if (add) {
|
|
289
|
+
if (!newProps)
|
|
290
|
+
newProps = Object.assign({}, type.props);
|
|
291
|
+
newProps[add[0].id] = add[1];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);
|
|
295
|
+
}
|
|
296
|
+
return new NodeSet(newTypes);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
253
299
|
const CachedNode = new WeakMap(), CachedInnerNode = new WeakMap();
|
|
254
300
|
/**
|
|
255
301
|
Options that control iteration. Can be combined with the `|`
|
|
@@ -1505,6 +1551,58 @@ mkTree) {
|
|
|
1505
1551
|
divide(children, positions, from, to, 0);
|
|
1506
1552
|
return (mkTop || mkTree)(localChildren, localPositions, length);
|
|
1507
1553
|
}
|
|
1554
|
+
/**
|
|
1555
|
+
Provides a way to associate values with pieces of trees. As long
|
|
1556
|
+
as that part of the tree is reused, the associated values can be
|
|
1557
|
+
retrieved from an updated tree.
|
|
1558
|
+
*/
|
|
1559
|
+
class NodeWeakMap {
|
|
1560
|
+
constructor() {
|
|
1561
|
+
this.map = new WeakMap();
|
|
1562
|
+
}
|
|
1563
|
+
setBuffer(buffer, index, value) {
|
|
1564
|
+
let inner = this.map.get(buffer);
|
|
1565
|
+
if (!inner)
|
|
1566
|
+
this.map.set(buffer, inner = new Map);
|
|
1567
|
+
inner.set(index, value);
|
|
1568
|
+
}
|
|
1569
|
+
getBuffer(buffer, index) {
|
|
1570
|
+
let inner = this.map.get(buffer);
|
|
1571
|
+
return inner && inner.get(index);
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
Set the value for this syntax node.
|
|
1575
|
+
*/
|
|
1576
|
+
set(node, value) {
|
|
1577
|
+
if (node instanceof BufferNode)
|
|
1578
|
+
this.setBuffer(node.context.buffer, node.index, value);
|
|
1579
|
+
else if (node instanceof TreeNode)
|
|
1580
|
+
this.map.set(node.tree, value);
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
Retrieve value for this syntax node, if it exists in the map.
|
|
1584
|
+
*/
|
|
1585
|
+
get(node) {
|
|
1586
|
+
return node instanceof BufferNode ? this.getBuffer(node.context.buffer, node.index)
|
|
1587
|
+
: node instanceof TreeNode ? this.map.get(node.tree) : undefined;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
Set the value for the node that a cursor currently points to.
|
|
1591
|
+
*/
|
|
1592
|
+
cursorSet(cursor, value) {
|
|
1593
|
+
if (cursor.buffer)
|
|
1594
|
+
this.setBuffer(cursor.buffer.buffer, cursor.index, value);
|
|
1595
|
+
else
|
|
1596
|
+
this.map.set(cursor.tree, value);
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
Retrieve the value for the node that a cursor currently points
|
|
1600
|
+
to.
|
|
1601
|
+
*/
|
|
1602
|
+
cursorGet(cursor) {
|
|
1603
|
+
return cursor.buffer ? this.getBuffer(cursor.buffer.buffer, cursor.index) : this.map.get(cursor.tree);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1508
1606
|
|
|
1509
1607
|
/**
|
|
1510
1608
|
Tree fragments are used during [incremental
|
|
@@ -1652,7 +1750,415 @@ class StringInput {
|
|
|
1652
1750
|
get lineChunks() { return false; }
|
|
1653
1751
|
read(from, to) { return this.string.slice(from, to); }
|
|
1654
1752
|
}
|
|
1655
|
-
new NodeProp({ perNode: true });
|
|
1656
1753
|
|
|
1657
|
-
|
|
1754
|
+
/**
|
|
1755
|
+
Create a parse wrapper that, after the inner parse completes,
|
|
1756
|
+
scans its tree for mixed language regions with the `nest`
|
|
1757
|
+
function, runs the resulting [inner parses](#common.NestedParse),
|
|
1758
|
+
and then [mounts](#common.NodeProp^mounted) their results onto the
|
|
1759
|
+
tree.
|
|
1760
|
+
*/
|
|
1761
|
+
function parseMixed(nest) {
|
|
1762
|
+
return (parse, input, fragments, ranges) => new MixedParse(parse, nest, input, fragments, ranges);
|
|
1763
|
+
}
|
|
1764
|
+
class InnerParse {
|
|
1765
|
+
constructor(parser, parse, overlay, target, from) {
|
|
1766
|
+
this.parser = parser;
|
|
1767
|
+
this.parse = parse;
|
|
1768
|
+
this.overlay = overlay;
|
|
1769
|
+
this.target = target;
|
|
1770
|
+
this.from = from;
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
function checkRanges(ranges) {
|
|
1774
|
+
if (!ranges.length || ranges.some(r => r.from >= r.to))
|
|
1775
|
+
throw new RangeError("Invalid inner parse ranges given: " + JSON.stringify(ranges));
|
|
1776
|
+
}
|
|
1777
|
+
class ActiveOverlay {
|
|
1778
|
+
constructor(parser, predicate, mounts, index, start, target, prev) {
|
|
1779
|
+
this.parser = parser;
|
|
1780
|
+
this.predicate = predicate;
|
|
1781
|
+
this.mounts = mounts;
|
|
1782
|
+
this.index = index;
|
|
1783
|
+
this.start = start;
|
|
1784
|
+
this.target = target;
|
|
1785
|
+
this.prev = prev;
|
|
1786
|
+
this.depth = 0;
|
|
1787
|
+
this.ranges = [];
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
const stoppedInner = new NodeProp({ perNode: true });
|
|
1791
|
+
class MixedParse {
|
|
1792
|
+
constructor(base, nest, input, fragments, ranges) {
|
|
1793
|
+
this.nest = nest;
|
|
1794
|
+
this.input = input;
|
|
1795
|
+
this.fragments = fragments;
|
|
1796
|
+
this.ranges = ranges;
|
|
1797
|
+
this.inner = [];
|
|
1798
|
+
this.innerDone = 0;
|
|
1799
|
+
this.baseTree = null;
|
|
1800
|
+
this.stoppedAt = null;
|
|
1801
|
+
this.baseParse = base;
|
|
1802
|
+
}
|
|
1803
|
+
advance() {
|
|
1804
|
+
if (this.baseParse) {
|
|
1805
|
+
let done = this.baseParse.advance();
|
|
1806
|
+
if (!done)
|
|
1807
|
+
return null;
|
|
1808
|
+
this.baseParse = null;
|
|
1809
|
+
this.baseTree = done;
|
|
1810
|
+
this.startInner();
|
|
1811
|
+
if (this.stoppedAt != null)
|
|
1812
|
+
for (let inner of this.inner)
|
|
1813
|
+
inner.parse.stopAt(this.stoppedAt);
|
|
1814
|
+
}
|
|
1815
|
+
if (this.innerDone == this.inner.length) {
|
|
1816
|
+
let result = this.baseTree;
|
|
1817
|
+
if (this.stoppedAt != null)
|
|
1818
|
+
result = new Tree(result.type, result.children, result.positions, result.length, result.propValues.concat([[stoppedInner, this.stoppedAt]]));
|
|
1819
|
+
return result;
|
|
1820
|
+
}
|
|
1821
|
+
let inner = this.inner[this.innerDone], done = inner.parse.advance();
|
|
1822
|
+
if (done) {
|
|
1823
|
+
this.innerDone++;
|
|
1824
|
+
// This is a somewhat dodgy but super helpful hack where we
|
|
1825
|
+
// patch up nodes created by the inner parse (and thus
|
|
1826
|
+
// presumably not aliased anywhere else) to hold the information
|
|
1827
|
+
// about the inner parse.
|
|
1828
|
+
let props = Object.assign(Object.create(null), inner.target.props);
|
|
1829
|
+
props[NodeProp.mounted.id] = new MountedTree(done, inner.overlay, inner.parser);
|
|
1830
|
+
inner.target.props = props;
|
|
1831
|
+
}
|
|
1832
|
+
return null;
|
|
1833
|
+
}
|
|
1834
|
+
get parsedPos() {
|
|
1835
|
+
if (this.baseParse)
|
|
1836
|
+
return 0;
|
|
1837
|
+
let pos = this.input.length;
|
|
1838
|
+
for (let i = this.innerDone; i < this.inner.length; i++) {
|
|
1839
|
+
if (this.inner[i].from < pos)
|
|
1840
|
+
pos = Math.min(pos, this.inner[i].parse.parsedPos);
|
|
1841
|
+
}
|
|
1842
|
+
return pos;
|
|
1843
|
+
}
|
|
1844
|
+
stopAt(pos) {
|
|
1845
|
+
this.stoppedAt = pos;
|
|
1846
|
+
if (this.baseParse)
|
|
1847
|
+
this.baseParse.stopAt(pos);
|
|
1848
|
+
else
|
|
1849
|
+
for (let i = this.innerDone; i < this.inner.length; i++)
|
|
1850
|
+
this.inner[i].parse.stopAt(pos);
|
|
1851
|
+
}
|
|
1852
|
+
startInner() {
|
|
1853
|
+
let fragmentCursor = new FragmentCursor(this.fragments);
|
|
1854
|
+
let overlay = null;
|
|
1855
|
+
let covered = null;
|
|
1856
|
+
let cursor = new TreeCursor(new TreeNode(this.baseTree, this.ranges[0].from, 0, null), IterMode.IncludeAnonymous | IterMode.IgnoreMounts);
|
|
1857
|
+
scan: for (let nest, isCovered;;) {
|
|
1858
|
+
let enter = true, range;
|
|
1859
|
+
if (this.stoppedAt != null && cursor.from >= this.stoppedAt) {
|
|
1860
|
+
enter = false;
|
|
1861
|
+
}
|
|
1862
|
+
else if (fragmentCursor.hasNode(cursor)) {
|
|
1863
|
+
if (overlay) {
|
|
1864
|
+
let match = overlay.mounts.find(m => m.frag.from <= cursor.from && m.frag.to >= cursor.to && m.mount.overlay);
|
|
1865
|
+
if (match)
|
|
1866
|
+
for (let r of match.mount.overlay) {
|
|
1867
|
+
let from = r.from + match.pos, to = r.to + match.pos;
|
|
1868
|
+
if (from >= cursor.from && to <= cursor.to && !overlay.ranges.some(r => r.from < to && r.to > from))
|
|
1869
|
+
overlay.ranges.push({ from, to });
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
enter = false;
|
|
1873
|
+
}
|
|
1874
|
+
else if (covered && (isCovered = checkCover(covered.ranges, cursor.from, cursor.to))) {
|
|
1875
|
+
enter = isCovered != 2 /* Cover.Full */;
|
|
1876
|
+
}
|
|
1877
|
+
else if (!cursor.type.isAnonymous && (nest = this.nest(cursor, this.input)) &&
|
|
1878
|
+
(cursor.from < cursor.to || !nest.overlay)) {
|
|
1879
|
+
if (!cursor.tree)
|
|
1880
|
+
materialize(cursor);
|
|
1881
|
+
let oldMounts = fragmentCursor.findMounts(cursor.from, nest.parser);
|
|
1882
|
+
if (typeof nest.overlay == "function") {
|
|
1883
|
+
overlay = new ActiveOverlay(nest.parser, nest.overlay, oldMounts, this.inner.length, cursor.from, cursor.tree, overlay);
|
|
1884
|
+
}
|
|
1885
|
+
else {
|
|
1886
|
+
let ranges = punchRanges(this.ranges, nest.overlay ||
|
|
1887
|
+
(cursor.from < cursor.to ? [new Range(cursor.from, cursor.to)] : []));
|
|
1888
|
+
if (ranges.length)
|
|
1889
|
+
checkRanges(ranges);
|
|
1890
|
+
if (ranges.length || !nest.overlay)
|
|
1891
|
+
this.inner.push(new InnerParse(nest.parser, ranges.length ? nest.parser.startParse(this.input, enterFragments(oldMounts, ranges), ranges)
|
|
1892
|
+
: nest.parser.startParse(""), nest.overlay ? nest.overlay.map(r => new Range(r.from - cursor.from, r.to - cursor.from)) : null, cursor.tree, ranges.length ? ranges[0].from : cursor.from));
|
|
1893
|
+
if (!nest.overlay)
|
|
1894
|
+
enter = false;
|
|
1895
|
+
else if (ranges.length)
|
|
1896
|
+
covered = { ranges, depth: 0, prev: covered };
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
else if (overlay && (range = overlay.predicate(cursor))) {
|
|
1900
|
+
if (range === true)
|
|
1901
|
+
range = new Range(cursor.from, cursor.to);
|
|
1902
|
+
if (range.from < range.to)
|
|
1903
|
+
overlay.ranges.push(range);
|
|
1904
|
+
}
|
|
1905
|
+
if (enter && cursor.firstChild()) {
|
|
1906
|
+
if (overlay)
|
|
1907
|
+
overlay.depth++;
|
|
1908
|
+
if (covered)
|
|
1909
|
+
covered.depth++;
|
|
1910
|
+
}
|
|
1911
|
+
else {
|
|
1912
|
+
for (;;) {
|
|
1913
|
+
if (cursor.nextSibling())
|
|
1914
|
+
break;
|
|
1915
|
+
if (!cursor.parent())
|
|
1916
|
+
break scan;
|
|
1917
|
+
if (overlay && !--overlay.depth) {
|
|
1918
|
+
let ranges = punchRanges(this.ranges, overlay.ranges);
|
|
1919
|
+
if (ranges.length) {
|
|
1920
|
+
checkRanges(ranges);
|
|
1921
|
+
this.inner.splice(overlay.index, 0, new InnerParse(overlay.parser, overlay.parser.startParse(this.input, enterFragments(overlay.mounts, ranges), ranges), overlay.ranges.map(r => new Range(r.from - overlay.start, r.to - overlay.start)), overlay.target, ranges[0].from));
|
|
1922
|
+
}
|
|
1923
|
+
overlay = overlay.prev;
|
|
1924
|
+
}
|
|
1925
|
+
if (covered && !--covered.depth)
|
|
1926
|
+
covered = covered.prev;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
function checkCover(covered, from, to) {
|
|
1933
|
+
for (let range of covered) {
|
|
1934
|
+
if (range.from >= to)
|
|
1935
|
+
break;
|
|
1936
|
+
if (range.to > from)
|
|
1937
|
+
return range.from <= from && range.to >= to ? 2 /* Cover.Full */ : 1 /* Cover.Partial */;
|
|
1938
|
+
}
|
|
1939
|
+
return 0 /* Cover.None */;
|
|
1940
|
+
}
|
|
1941
|
+
// Take a piece of buffer and convert it into a stand-alone
|
|
1942
|
+
// TreeBuffer.
|
|
1943
|
+
function sliceBuf(buf, startI, endI, nodes, positions, off) {
|
|
1944
|
+
if (startI < endI) {
|
|
1945
|
+
let from = buf.buffer[startI + 1];
|
|
1946
|
+
nodes.push(buf.slice(startI, endI, from));
|
|
1947
|
+
positions.push(from - off);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
// This function takes a node that's in a buffer, and converts it, and
|
|
1951
|
+
// its parent buffer nodes, into a Tree. This is again acting on the
|
|
1952
|
+
// assumption that the trees and buffers have been constructed by the
|
|
1953
|
+
// parse that was ran via the mix parser, and thus aren't shared with
|
|
1954
|
+
// any other code, making violations of the immutability safe.
|
|
1955
|
+
function materialize(cursor) {
|
|
1956
|
+
let { node } = cursor, stack = [];
|
|
1957
|
+
let buffer = node.context.buffer;
|
|
1958
|
+
// Scan up to the nearest tree
|
|
1959
|
+
do {
|
|
1960
|
+
stack.push(cursor.index);
|
|
1961
|
+
cursor.parent();
|
|
1962
|
+
} while (!cursor.tree);
|
|
1963
|
+
// Find the index of the buffer in that tree
|
|
1964
|
+
let base = cursor.tree, i = base.children.indexOf(buffer);
|
|
1965
|
+
let buf = base.children[i], b = buf.buffer, newStack = [i];
|
|
1966
|
+
// Split a level in the buffer, putting the nodes before and after
|
|
1967
|
+
// the child that contains `node` into new buffers.
|
|
1968
|
+
function split(startI, endI, type, innerOffset, length, stackPos) {
|
|
1969
|
+
let targetI = stack[stackPos];
|
|
1970
|
+
let children = [], positions = [];
|
|
1971
|
+
sliceBuf(buf, startI, targetI, children, positions, innerOffset);
|
|
1972
|
+
let from = b[targetI + 1], to = b[targetI + 2];
|
|
1973
|
+
newStack.push(children.length);
|
|
1974
|
+
let child = stackPos
|
|
1975
|
+
? split(targetI + 4, b[targetI + 3], buf.set.types[b[targetI]], from, to - from, stackPos - 1)
|
|
1976
|
+
: node.toTree();
|
|
1977
|
+
children.push(child);
|
|
1978
|
+
positions.push(from - innerOffset);
|
|
1979
|
+
sliceBuf(buf, b[targetI + 3], endI, children, positions, innerOffset);
|
|
1980
|
+
return new Tree(type, children, positions, length);
|
|
1981
|
+
}
|
|
1982
|
+
base.children[i] = split(0, b.length, NodeType.none, 0, buf.length, stack.length - 1);
|
|
1983
|
+
// Move the cursor back to the target node
|
|
1984
|
+
for (let index of newStack) {
|
|
1985
|
+
let tree = cursor.tree.children[index], pos = cursor.tree.positions[index];
|
|
1986
|
+
cursor.yield(new TreeNode(tree, pos + cursor.from, index, cursor._tree));
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
class StructureCursor {
|
|
1990
|
+
constructor(root, offset) {
|
|
1991
|
+
this.offset = offset;
|
|
1992
|
+
this.done = false;
|
|
1993
|
+
this.cursor = root.cursor(IterMode.IncludeAnonymous | IterMode.IgnoreMounts);
|
|
1994
|
+
}
|
|
1995
|
+
// Move to the first node (in pre-order) that starts at or after `pos`.
|
|
1996
|
+
moveTo(pos) {
|
|
1997
|
+
let { cursor } = this, p = pos - this.offset;
|
|
1998
|
+
while (!this.done && cursor.from < p) {
|
|
1999
|
+
if (cursor.to >= pos && cursor.enter(p, 1, IterMode.IgnoreOverlays | IterMode.ExcludeBuffers)) ;
|
|
2000
|
+
else if (!cursor.next(false))
|
|
2001
|
+
this.done = true;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
hasNode(cursor) {
|
|
2005
|
+
this.moveTo(cursor.from);
|
|
2006
|
+
if (!this.done && this.cursor.from + this.offset == cursor.from && this.cursor.tree) {
|
|
2007
|
+
for (let tree = this.cursor.tree;;) {
|
|
2008
|
+
if (tree == cursor.tree)
|
|
2009
|
+
return true;
|
|
2010
|
+
if (tree.children.length && tree.positions[0] == 0 && tree.children[0] instanceof Tree)
|
|
2011
|
+
tree = tree.children[0];
|
|
2012
|
+
else
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
return false;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
class FragmentCursor {
|
|
2020
|
+
constructor(fragments) {
|
|
2021
|
+
var _a;
|
|
2022
|
+
this.fragments = fragments;
|
|
2023
|
+
this.curTo = 0;
|
|
2024
|
+
this.fragI = 0;
|
|
2025
|
+
if (fragments.length) {
|
|
2026
|
+
let first = this.curFrag = fragments[0];
|
|
2027
|
+
this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : first.to;
|
|
2028
|
+
this.inner = new StructureCursor(first.tree, -first.offset);
|
|
2029
|
+
}
|
|
2030
|
+
else {
|
|
2031
|
+
this.curFrag = this.inner = null;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
hasNode(node) {
|
|
2035
|
+
while (this.curFrag && node.from >= this.curTo)
|
|
2036
|
+
this.nextFrag();
|
|
2037
|
+
return this.curFrag && this.curFrag.from <= node.from && this.curTo >= node.to && this.inner.hasNode(node);
|
|
2038
|
+
}
|
|
2039
|
+
nextFrag() {
|
|
2040
|
+
var _a;
|
|
2041
|
+
this.fragI++;
|
|
2042
|
+
if (this.fragI == this.fragments.length) {
|
|
2043
|
+
this.curFrag = this.inner = null;
|
|
2044
|
+
}
|
|
2045
|
+
else {
|
|
2046
|
+
let frag = this.curFrag = this.fragments[this.fragI];
|
|
2047
|
+
this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : frag.to;
|
|
2048
|
+
this.inner = new StructureCursor(frag.tree, -frag.offset);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
findMounts(pos, parser) {
|
|
2052
|
+
var _a;
|
|
2053
|
+
let result = [];
|
|
2054
|
+
if (this.inner) {
|
|
2055
|
+
this.inner.cursor.moveTo(pos, 1);
|
|
2056
|
+
for (let pos = this.inner.cursor.node; pos; pos = pos.parent) {
|
|
2057
|
+
let mount = (_a = pos.tree) === null || _a === void 0 ? void 0 : _a.prop(NodeProp.mounted);
|
|
2058
|
+
if (mount && mount.parser == parser) {
|
|
2059
|
+
for (let i = this.fragI; i < this.fragments.length; i++) {
|
|
2060
|
+
let frag = this.fragments[i];
|
|
2061
|
+
if (frag.from >= pos.to)
|
|
2062
|
+
break;
|
|
2063
|
+
if (frag.tree == this.curFrag.tree)
|
|
2064
|
+
result.push({
|
|
2065
|
+
frag,
|
|
2066
|
+
pos: pos.from - frag.offset,
|
|
2067
|
+
mount
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
return result;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
function punchRanges(outer, ranges) {
|
|
2077
|
+
let copy = null, current = ranges;
|
|
2078
|
+
for (let i = 1, j = 0; i < outer.length; i++) {
|
|
2079
|
+
let gapFrom = outer[i - 1].to, gapTo = outer[i].from;
|
|
2080
|
+
for (; j < current.length; j++) {
|
|
2081
|
+
let r = current[j];
|
|
2082
|
+
if (r.from >= gapTo)
|
|
2083
|
+
break;
|
|
2084
|
+
if (r.to <= gapFrom)
|
|
2085
|
+
continue;
|
|
2086
|
+
if (!copy)
|
|
2087
|
+
current = copy = ranges.slice();
|
|
2088
|
+
if (r.from < gapFrom) {
|
|
2089
|
+
copy[j] = new Range(r.from, gapFrom);
|
|
2090
|
+
if (r.to > gapTo)
|
|
2091
|
+
copy.splice(j + 1, 0, new Range(gapTo, r.to));
|
|
2092
|
+
}
|
|
2093
|
+
else if (r.to > gapTo) {
|
|
2094
|
+
copy[j--] = new Range(gapTo, r.to);
|
|
2095
|
+
}
|
|
2096
|
+
else {
|
|
2097
|
+
copy.splice(j--, 1);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
return current;
|
|
2102
|
+
}
|
|
2103
|
+
function findCoverChanges(a, b, from, to) {
|
|
2104
|
+
let iA = 0, iB = 0, inA = false, inB = false, pos = -1e9;
|
|
2105
|
+
let result = [];
|
|
2106
|
+
for (;;) {
|
|
2107
|
+
let nextA = iA == a.length ? 1e9 : inA ? a[iA].to : a[iA].from;
|
|
2108
|
+
let nextB = iB == b.length ? 1e9 : inB ? b[iB].to : b[iB].from;
|
|
2109
|
+
if (inA != inB) {
|
|
2110
|
+
let start = Math.max(pos, from), end = Math.min(nextA, nextB, to);
|
|
2111
|
+
if (start < end)
|
|
2112
|
+
result.push(new Range(start, end));
|
|
2113
|
+
}
|
|
2114
|
+
pos = Math.min(nextA, nextB);
|
|
2115
|
+
if (pos == 1e9)
|
|
2116
|
+
break;
|
|
2117
|
+
if (nextA == pos) {
|
|
2118
|
+
if (!inA)
|
|
2119
|
+
inA = true;
|
|
2120
|
+
else {
|
|
2121
|
+
inA = false;
|
|
2122
|
+
iA++;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
if (nextB == pos) {
|
|
2126
|
+
if (!inB)
|
|
2127
|
+
inB = true;
|
|
2128
|
+
else {
|
|
2129
|
+
inB = false;
|
|
2130
|
+
iB++;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
return result;
|
|
2135
|
+
}
|
|
2136
|
+
// Given a number of fragments for the outer tree, and a set of ranges
|
|
2137
|
+
// to parse, find fragments for inner trees mounted around those
|
|
2138
|
+
// ranges, if any.
|
|
2139
|
+
function enterFragments(mounts, ranges) {
|
|
2140
|
+
let result = [];
|
|
2141
|
+
for (let { pos, mount, frag } of mounts) {
|
|
2142
|
+
let startPos = pos + (mount.overlay ? mount.overlay[0].from : 0), endPos = startPos + mount.tree.length;
|
|
2143
|
+
let from = Math.max(frag.from, startPos), to = Math.min(frag.to, endPos);
|
|
2144
|
+
if (mount.overlay) {
|
|
2145
|
+
let overlay = mount.overlay.map(r => new Range(r.from + pos, r.to + pos));
|
|
2146
|
+
let changes = findCoverChanges(ranges, overlay, from, to);
|
|
2147
|
+
for (let i = 0, pos = from;; i++) {
|
|
2148
|
+
let last = i == changes.length, end = last ? to : changes[i].from;
|
|
2149
|
+
if (end > pos)
|
|
2150
|
+
result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));
|
|
2151
|
+
if (last)
|
|
2152
|
+
break;
|
|
2153
|
+
pos = changes[i].to;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
else {
|
|
2157
|
+
result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
return result;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
export { DefaultBufferLength, IterMode, MountedTree, NodeProp, NodeSet, NodeType, NodeWeakMap, Parser, Tree, TreeBuffer, TreeCursor, TreeFragment, parseMixed };
|
|
1658
2164
|
//# sourceMappingURL=index.js.map
|