@veltra/desktop 1.3.0 → 1.3.2

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.
Files changed (67) hide show
  1. package/dist/components/action/action-group.vue.d.ts +2 -2
  2. package/dist/components/action/action.vue.d.ts +2 -2
  3. package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
  4. package/dist/components/breadcrumb/style2.css +1 -2
  5. package/dist/components/button/style2.css +3 -3
  6. package/dist/components/card/style2.css +1 -1
  7. package/dist/components/cascade/cascade.vue.d.ts +4 -4
  8. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  9. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  10. package/dist/components/code-editor/code-editor.vue.d.ts +2 -2
  11. package/dist/components/code-editor/lang-loaders.js +1 -0
  12. package/dist/components/code-editor/lang-loaders.js.map +1 -1
  13. package/dist/components/condition-editor/style2.css +2 -4
  14. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  15. package/dist/components/date-picker/date-picker.vue.d.ts +3 -3
  16. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +3 -3
  17. package/dist/components/empty/empty.vue.d.ts +1 -1
  18. package/dist/components/form-item/form-item.js.map +1 -1
  19. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +2 -1
  20. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/input/input.vue.d.ts +8 -8
  22. package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
  23. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
  24. package/dist/components/number-input/number-input.vue.d.ts +2 -2
  25. package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
  26. package/dist/components/password-input/password-input.vue.d.ts +1 -1
  27. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  28. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
  29. package/dist/components/rich-text-editor/style2.css +1 -1
  30. package/dist/components/select/select.vue.d.ts +3 -3
  31. package/dist/components/textarea/textarea.vue.d.ts +4 -4
  32. package/dist/components/tip/tip.js +32 -5
  33. package/dist/components/tip/tip.js.map +1 -1
  34. package/dist/components/tip/tip.vue.d.ts +1 -0
  35. package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
  36. package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +1 -1
  37. package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +914 -0
  38. package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -0
  39. package/dist/node_modules/.bun/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js +994 -0
  40. package/dist/node_modules/.bun/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js.map +1 -0
  41. package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +1 -1
  42. package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.1/node_modules/@codemirror/lang-markdown/dist/index.js +471 -0
  43. package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.1/node_modules/@codemirror/lang-markdown/dist/index.js.map +1 -0
  44. package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js +71 -1
  45. package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js.map +1 -1
  46. package/dist/node_modules/.bun/@lezer_common@1.5.2/node_modules/@lezer/common/dist/index.js +326 -2
  47. package/dist/node_modules/.bun/@lezer_common@1.5.2/node_modules/@lezer/common/dist/index.js.map +1 -1
  48. package/dist/node_modules/.bun/@lezer_css@1.3.4/node_modules/@lezer/css/dist/index.js +250 -0
  49. package/dist/node_modules/.bun/@lezer_css@1.3.4/node_modules/@lezer/css/dist/index.js.map +1 -0
  50. package/dist/node_modules/.bun/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +1 -1
  51. package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js +438 -0
  52. package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js.map +1 -0
  53. package/dist/node_modules/.bun/@lezer_markdown@1.7.2/node_modules/@lezer/markdown/dist/index.js +1952 -0
  54. package/dist/node_modules/.bun/@lezer_markdown@1.7.2/node_modules/@lezer/markdown/dist/index.js.map +1 -0
  55. package/dist/types/code-editor.d.ts +1 -1
  56. package/dist/types/tip.d.ts +5 -0
  57. package/package.json +7 -6
  58. package/src/components/breadcrumb/style.scss +1 -2
  59. package/src/components/button/style.scss +6 -4
  60. package/src/components/card/style.scss +1 -1
  61. package/src/components/code-editor/lang-loaders.ts +1 -0
  62. package/src/components/condition-editor/style.scss +2 -4
  63. package/src/components/form-item/form-item.vue +1 -1
  64. package/src/components/rich-text-editor/style.scss +1 -1
  65. package/src/components/tip/tip.vue +36 -5
  66. package/src/types/code-editor.ts +9 -1
  67. package/src/types/tip.ts +6 -0
@@ -1560,8 +1560,332 @@ var StringInput = class {
1560
1560
  return this.string.slice(from, to);
1561
1561
  }
1562
1562
  };
1563
- new NodeProp({ perNode: true });
1563
+ /**
1564
+ Create a parse wrapper that, after the inner parse completes,
1565
+ scans its tree for mixed language regions with the `nest`
1566
+ function, runs the resulting [inner parses](#common.NestedParse),
1567
+ and then [mounts](#common.NodeProp^mounted) their results onto the
1568
+ tree.
1569
+ */
1570
+ function parseMixed(nest) {
1571
+ return (parse, input, fragments, ranges) => new MixedParse(parse, nest, input, fragments, ranges);
1572
+ }
1573
+ var InnerParse = class {
1574
+ constructor(parser, parse, overlay, bracketed, target, from) {
1575
+ this.parser = parser;
1576
+ this.parse = parse;
1577
+ this.overlay = overlay;
1578
+ this.bracketed = bracketed;
1579
+ this.target = target;
1580
+ this.from = from;
1581
+ }
1582
+ };
1583
+ function checkRanges(ranges) {
1584
+ if (!ranges.length || ranges.some((r) => r.from >= r.to)) throw new RangeError("Invalid inner parse ranges given: " + JSON.stringify(ranges));
1585
+ }
1586
+ var ActiveOverlay = class {
1587
+ constructor(parser, predicate, mounts, index, start, bracketed, target, prev) {
1588
+ this.parser = parser;
1589
+ this.predicate = predicate;
1590
+ this.mounts = mounts;
1591
+ this.index = index;
1592
+ this.start = start;
1593
+ this.bracketed = bracketed;
1594
+ this.target = target;
1595
+ this.prev = prev;
1596
+ this.depth = 0;
1597
+ this.ranges = [];
1598
+ }
1599
+ };
1600
+ const stoppedInner = new NodeProp({ perNode: true });
1601
+ var MixedParse = class {
1602
+ constructor(base, nest, input, fragments, ranges) {
1603
+ this.nest = nest;
1604
+ this.input = input;
1605
+ this.fragments = fragments;
1606
+ this.ranges = ranges;
1607
+ this.inner = [];
1608
+ this.innerDone = 0;
1609
+ this.baseTree = null;
1610
+ this.stoppedAt = null;
1611
+ this.baseParse = base;
1612
+ }
1613
+ advance() {
1614
+ if (this.baseParse) {
1615
+ let done = this.baseParse.advance();
1616
+ if (!done) return null;
1617
+ this.baseParse = null;
1618
+ this.baseTree = done;
1619
+ this.startInner();
1620
+ if (this.stoppedAt != null) for (let inner of this.inner) inner.parse.stopAt(this.stoppedAt);
1621
+ }
1622
+ if (this.innerDone == this.inner.length) {
1623
+ let result = this.baseTree;
1624
+ if (this.stoppedAt != null) result = new Tree(result.type, result.children, result.positions, result.length, result.propValues.concat([[stoppedInner, this.stoppedAt]]));
1625
+ return result;
1626
+ }
1627
+ let inner = this.inner[this.innerDone], done = inner.parse.advance();
1628
+ if (done) {
1629
+ this.innerDone++;
1630
+ let props = Object.assign(Object.create(null), inner.target.props);
1631
+ props[NodeProp.mounted.id] = new MountedTree(done, inner.overlay, inner.parser, inner.bracketed);
1632
+ inner.target.props = props;
1633
+ }
1634
+ return null;
1635
+ }
1636
+ get parsedPos() {
1637
+ if (this.baseParse) return 0;
1638
+ let pos = this.input.length;
1639
+ for (let i = this.innerDone; i < this.inner.length; i++) if (this.inner[i].from < pos) pos = Math.min(pos, this.inner[i].parse.parsedPos);
1640
+ return pos;
1641
+ }
1642
+ stopAt(pos) {
1643
+ this.stoppedAt = pos;
1644
+ if (this.baseParse) this.baseParse.stopAt(pos);
1645
+ else for (let i = this.innerDone; i < this.inner.length; i++) this.inner[i].parse.stopAt(pos);
1646
+ }
1647
+ startInner() {
1648
+ let fragmentCursor = new FragmentCursor(this.fragments);
1649
+ let overlay = null;
1650
+ let covered = null;
1651
+ let cursor = new TreeCursor(new TreeNode(this.baseTree, this.ranges[0].from, 0, null), IterMode.IncludeAnonymous | IterMode.IgnoreMounts);
1652
+ scan: for (let nest, isCovered;;) {
1653
+ let enter = true, range;
1654
+ if (this.stoppedAt != null && cursor.from >= this.stoppedAt) enter = false;
1655
+ else if (fragmentCursor.hasNode(cursor)) {
1656
+ if (overlay) {
1657
+ let match = overlay.mounts.find((m) => m.frag.from <= cursor.from && m.frag.to >= cursor.to && m.mount.overlay);
1658
+ if (match) for (let r of match.mount.overlay) {
1659
+ let from = r.from + match.pos, to = r.to + match.pos;
1660
+ if (from >= cursor.from && to <= cursor.to && !overlay.ranges.some((r) => r.from < to && r.to > from)) overlay.ranges.push({
1661
+ from,
1662
+ to
1663
+ });
1664
+ }
1665
+ }
1666
+ enter = false;
1667
+ } else if (covered && (isCovered = checkCover(covered.ranges, cursor.from, cursor.to))) enter = isCovered != 2;
1668
+ else if (!cursor.type.isAnonymous && (nest = this.nest(cursor, this.input)) && (cursor.from < cursor.to || !nest.overlay)) {
1669
+ if (!cursor.tree) {
1670
+ materialize(cursor);
1671
+ if (overlay) overlay.depth++;
1672
+ if (covered) covered.depth++;
1673
+ }
1674
+ let oldMounts = fragmentCursor.findMounts(cursor.from, nest.parser);
1675
+ if (typeof nest.overlay == "function") overlay = new ActiveOverlay(nest.parser, nest.overlay, oldMounts, this.inner.length, cursor.from, !!nest.bracketed, cursor.tree, overlay);
1676
+ else {
1677
+ let ranges = punchRanges(this.ranges, nest.overlay || (cursor.from < cursor.to ? [new Range(cursor.from, cursor.to)] : []));
1678
+ if (ranges.length) checkRanges(ranges);
1679
+ if (ranges.length || !nest.overlay) this.inner.push(new InnerParse(nest.parser, ranges.length ? nest.parser.startParse(this.input, enterFragments(oldMounts, ranges), ranges) : nest.parser.startParse(""), nest.overlay ? nest.overlay.map((r) => new Range(r.from - cursor.from, r.to - cursor.from)) : null, !!nest.bracketed, cursor.tree, ranges.length ? ranges[0].from : cursor.from));
1680
+ if (!nest.overlay) enter = false;
1681
+ else if (ranges.length) covered = {
1682
+ ranges,
1683
+ depth: 0,
1684
+ prev: covered
1685
+ };
1686
+ }
1687
+ } else if (overlay && (range = overlay.predicate(cursor))) {
1688
+ if (range === true) range = new Range(cursor.from, cursor.to);
1689
+ if (range.from < range.to) {
1690
+ let last = overlay.ranges.length - 1;
1691
+ if (last >= 0 && overlay.ranges[last].to == range.from) overlay.ranges[last] = {
1692
+ from: overlay.ranges[last].from,
1693
+ to: range.to
1694
+ };
1695
+ else overlay.ranges.push(range);
1696
+ }
1697
+ }
1698
+ if (enter && cursor.firstChild()) {
1699
+ if (overlay) overlay.depth++;
1700
+ if (covered) covered.depth++;
1701
+ } else for (;;) {
1702
+ if (cursor.nextSibling()) break;
1703
+ if (!cursor.parent()) break scan;
1704
+ if (overlay && !--overlay.depth) {
1705
+ let ranges = punchRanges(this.ranges, overlay.ranges);
1706
+ if (ranges.length) {
1707
+ checkRanges(ranges);
1708
+ 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.bracketed, overlay.target, ranges[0].from));
1709
+ }
1710
+ overlay = overlay.prev;
1711
+ }
1712
+ if (covered && !--covered.depth) covered = covered.prev;
1713
+ }
1714
+ }
1715
+ }
1716
+ };
1717
+ function checkCover(covered, from, to) {
1718
+ for (let range of covered) {
1719
+ if (range.from >= to) break;
1720
+ if (range.to > from) return range.from <= from && range.to >= to ? 2 : 1;
1721
+ }
1722
+ return 0;
1723
+ }
1724
+ function sliceBuf(buf, startI, endI, nodes, positions, off) {
1725
+ if (startI < endI) {
1726
+ let from = buf.buffer[startI + 1];
1727
+ nodes.push(buf.slice(startI, endI, from));
1728
+ positions.push(from - off);
1729
+ }
1730
+ }
1731
+ function materialize(cursor) {
1732
+ let { node } = cursor, stack = [];
1733
+ let buffer = node.context.buffer;
1734
+ do {
1735
+ stack.push(cursor.index);
1736
+ cursor.parent();
1737
+ } while (!cursor.tree);
1738
+ let base = cursor.tree, i = base.children.indexOf(buffer);
1739
+ let buf = base.children[i], b = buf.buffer, newStack = [i];
1740
+ function split(startI, endI, type, innerOffset, length, stackPos) {
1741
+ let targetI = stack[stackPos];
1742
+ let children = [], positions = [];
1743
+ sliceBuf(buf, startI, targetI, children, positions, innerOffset);
1744
+ let from = b[targetI + 1], to = b[targetI + 2];
1745
+ newStack.push(children.length);
1746
+ let child = stackPos ? split(targetI + 4, b[targetI + 3], buf.set.types[b[targetI]], from, to - from, stackPos - 1) : node.toTree();
1747
+ children.push(child);
1748
+ positions.push(from - innerOffset);
1749
+ sliceBuf(buf, b[targetI + 3], endI, children, positions, innerOffset);
1750
+ return new Tree(type, children, positions, length);
1751
+ }
1752
+ base.children[i] = split(0, b.length, NodeType.none, 0, buf.length, stack.length - 1);
1753
+ for (let index of newStack) {
1754
+ let tree = cursor.tree.children[index], pos = cursor.tree.positions[index];
1755
+ cursor.yield(new TreeNode(tree, pos + cursor.from, index, cursor._tree));
1756
+ }
1757
+ }
1758
+ var StructureCursor = class {
1759
+ constructor(root, offset) {
1760
+ this.offset = offset;
1761
+ this.done = false;
1762
+ this.cursor = root.cursor(IterMode.IncludeAnonymous | IterMode.IgnoreMounts);
1763
+ }
1764
+ moveTo(pos) {
1765
+ let { cursor } = this, p = pos - this.offset;
1766
+ while (!this.done && cursor.from < p) if (cursor.to >= pos && cursor.enter(p, 1, IterMode.IgnoreOverlays | IterMode.ExcludeBuffers));
1767
+ else if (cursor.to <= pos) {
1768
+ if (!cursor.next(false)) this.done = true;
1769
+ } else break;
1770
+ }
1771
+ hasNode(cursor) {
1772
+ this.moveTo(cursor.from);
1773
+ if (!this.done && this.cursor.from + this.offset == cursor.from && this.cursor.tree) for (let tree = this.cursor.tree;;) {
1774
+ if (tree == cursor.tree) return true;
1775
+ if (tree.children.length && tree.positions[0] == 0 && tree.children[0] instanceof Tree) tree = tree.children[0];
1776
+ else break;
1777
+ }
1778
+ return false;
1779
+ }
1780
+ };
1781
+ var FragmentCursor = class {
1782
+ constructor(fragments) {
1783
+ var _a;
1784
+ this.fragments = fragments;
1785
+ this.curTo = 0;
1786
+ this.fragI = 0;
1787
+ if (fragments.length) {
1788
+ let first = this.curFrag = fragments[0];
1789
+ this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : first.to;
1790
+ this.inner = new StructureCursor(first.tree, -first.offset);
1791
+ } else this.curFrag = this.inner = null;
1792
+ }
1793
+ hasNode(node) {
1794
+ while (this.curFrag && node.from >= this.curTo) this.nextFrag();
1795
+ return this.curFrag && this.curFrag.from <= node.from && this.curTo >= node.to && this.inner.hasNode(node);
1796
+ }
1797
+ nextFrag() {
1798
+ var _a;
1799
+ this.fragI++;
1800
+ if (this.fragI == this.fragments.length) this.curFrag = this.inner = null;
1801
+ else {
1802
+ let frag = this.curFrag = this.fragments[this.fragI];
1803
+ this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : frag.to;
1804
+ this.inner = new StructureCursor(frag.tree, -frag.offset);
1805
+ }
1806
+ }
1807
+ findMounts(pos, parser) {
1808
+ var _a;
1809
+ let result = [];
1810
+ if (this.inner) {
1811
+ this.inner.cursor.moveTo(pos, 1);
1812
+ for (let pos = this.inner.cursor.node; pos; pos = pos.parent) {
1813
+ let mount = (_a = pos.tree) === null || _a === void 0 ? void 0 : _a.prop(NodeProp.mounted);
1814
+ if (mount && mount.parser == parser) for (let i = this.fragI; i < this.fragments.length; i++) {
1815
+ let frag = this.fragments[i];
1816
+ if (frag.from >= pos.to) break;
1817
+ if (frag.tree == this.curFrag.tree) result.push({
1818
+ frag,
1819
+ pos: pos.from - frag.offset,
1820
+ mount
1821
+ });
1822
+ }
1823
+ }
1824
+ }
1825
+ return result;
1826
+ }
1827
+ };
1828
+ function punchRanges(outer, ranges) {
1829
+ let copy = null, current = ranges;
1830
+ for (let i = 1, j = 0; i < outer.length; i++) {
1831
+ let gapFrom = outer[i - 1].to, gapTo = outer[i].from;
1832
+ for (; j < current.length; j++) {
1833
+ let r = current[j];
1834
+ if (r.from >= gapTo) break;
1835
+ if (r.to <= gapFrom) continue;
1836
+ if (!copy) current = copy = ranges.slice();
1837
+ if (r.from < gapFrom) {
1838
+ copy[j] = new Range(r.from, gapFrom);
1839
+ if (r.to > gapTo) copy.splice(j + 1, 0, new Range(gapTo, r.to));
1840
+ } else if (r.to > gapTo) copy[j--] = new Range(gapTo, r.to);
1841
+ else copy.splice(j--, 1);
1842
+ }
1843
+ }
1844
+ return current;
1845
+ }
1846
+ function findCoverChanges(a, b, from, to) {
1847
+ let iA = 0, iB = 0, inA = false, inB = false, pos = -1e9;
1848
+ let result = [];
1849
+ for (;;) {
1850
+ let nextA = iA == a.length ? 1e9 : inA ? a[iA].to : a[iA].from;
1851
+ let nextB = iB == b.length ? 1e9 : inB ? b[iB].to : b[iB].from;
1852
+ if (inA != inB) {
1853
+ let start = Math.max(pos, from), end = Math.min(nextA, nextB, to);
1854
+ if (start < end) result.push(new Range(start, end));
1855
+ }
1856
+ pos = Math.min(nextA, nextB);
1857
+ if (pos == 1e9) break;
1858
+ if (nextA == pos) if (!inA) inA = true;
1859
+ else {
1860
+ inA = false;
1861
+ iA++;
1862
+ }
1863
+ if (nextB == pos) if (!inB) inB = true;
1864
+ else {
1865
+ inB = false;
1866
+ iB++;
1867
+ }
1868
+ }
1869
+ return result;
1870
+ }
1871
+ function enterFragments(mounts, ranges) {
1872
+ let result = [];
1873
+ for (let { pos, mount, frag } of mounts) {
1874
+ let startPos = pos + (mount.overlay ? mount.overlay[0].from : 0), endPos = startPos + mount.tree.length;
1875
+ let from = Math.max(frag.from, startPos), to = Math.min(frag.to, endPos);
1876
+ if (mount.overlay) {
1877
+ let changes = findCoverChanges(ranges, mount.overlay.map((r) => new Range(r.from + pos, r.to + pos)), from, to);
1878
+ for (let i = 0, pos = from;; i++) {
1879
+ let last = i == changes.length, end = last ? to : changes[i].from;
1880
+ if (end > pos) result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));
1881
+ if (last) break;
1882
+ pos = changes[i].to;
1883
+ }
1884
+ } else result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));
1885
+ }
1886
+ return result;
1887
+ }
1564
1888
  //#endregion
1565
- export { DefaultBufferLength, IterMode, NodeProp, NodeSet, NodeType, NodeWeakMap, Parser, Tree, TreeFragment };
1889
+ export { DefaultBufferLength, IterMode, NodeProp, NodeSet, NodeType, NodeWeakMap, Parser, Tree, TreeFragment, parseMixed };
1566
1890
 
1567
1891
  //# sourceMappingURL=index.js.map