@wireweave/core 3.1.0-beta.4 → 3.1.0-beta.5
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/index.cjs +7160 -4880
- package/dist/index.d.cts +144 -139
- package/dist/index.d.ts +144 -139
- package/dist/index.js +7140 -4879
- package/dist/parser.cjs +24 -19
- package/dist/parser.d.cts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/parser.js +24 -19
- package/dist/renderer.cjs +4994 -4542
- package/dist/renderer.d.cts +280 -19
- package/dist/renderer.d.ts +280 -19
- package/dist/renderer.js +4986 -4542
- package/dist/spec.cjs +2856 -0
- package/dist/spec.d.cts +371 -0
- package/dist/spec.d.ts +371 -0
- package/dist/spec.js +2808 -0
- package/dist/{types-Bb3NSNUs.d.cts → types-BiDAgo6f.d.cts} +112 -30
- package/dist/{types-Bb3NSNUs.d.ts → types-BiDAgo6f.d.ts} +112 -30
- package/package.json +53 -13
package/dist/parser.cjs
CHANGED
|
@@ -625,16 +625,16 @@ function peg$parse(input, options) {
|
|
|
625
625
|
const columns = [];
|
|
626
626
|
const rows = [];
|
|
627
627
|
for (const item of items.map((i) => i[0]).filter((i) => i !== null)) {
|
|
628
|
-
if (item.
|
|
629
|
-
else if (item.
|
|
628
|
+
if (item.kind === "columns") columns.push(...item.values);
|
|
629
|
+
else if (item.kind === "row") rows.push(item.values);
|
|
630
630
|
}
|
|
631
631
|
return { columns, rows };
|
|
632
632
|
}
|
|
633
633
|
function peg$f52(values) {
|
|
634
|
-
return {
|
|
634
|
+
return { kind: "columns", values };
|
|
635
635
|
}
|
|
636
636
|
function peg$f53(values) {
|
|
637
|
-
return {
|
|
637
|
+
return { kind: "row", values };
|
|
638
638
|
}
|
|
639
639
|
function peg$f54() {
|
|
640
640
|
return null;
|
|
@@ -649,11 +649,11 @@ function peg$parse(input, options) {
|
|
|
649
649
|
return items.map((i) => i[0]).filter((i) => i !== null);
|
|
650
650
|
}
|
|
651
651
|
function peg$f57(label, attrs, nested) {
|
|
652
|
-
return {
|
|
652
|
+
return createBlockNode("ListItem", {
|
|
653
653
|
content: label,
|
|
654
654
|
...attrsToObject(attrs),
|
|
655
655
|
children: nested || []
|
|
656
|
-
};
|
|
656
|
+
});
|
|
657
657
|
}
|
|
658
658
|
function peg$f58() {
|
|
659
659
|
return null;
|
|
@@ -699,11 +699,11 @@ function peg$parse(input, options) {
|
|
|
699
699
|
const processedItems = items.map((item) => {
|
|
700
700
|
if (typeof item === "string") {
|
|
701
701
|
if (item === "---" || item === "-" || item === "divider") {
|
|
702
|
-
return
|
|
702
|
+
return createBlockNode("Divider", {});
|
|
703
703
|
}
|
|
704
|
-
return { label: item };
|
|
704
|
+
return createBlockNode("DropdownItem", { label: item });
|
|
705
705
|
}
|
|
706
|
-
return item;
|
|
706
|
+
return createBlockNode("DropdownItem", item);
|
|
707
707
|
});
|
|
708
708
|
return createNode("Dropdown", {
|
|
709
709
|
...attrsToObject(attrs),
|
|
@@ -720,10 +720,10 @@ function peg$parse(input, options) {
|
|
|
720
720
|
return items.map((i) => i[0]).filter((i) => i !== null);
|
|
721
721
|
}
|
|
722
722
|
function peg$f68(label, attrs) {
|
|
723
|
-
return { label, ...attrsToObject(attrs) };
|
|
723
|
+
return createBlockNode("DropdownItem", { label, ...attrsToObject(attrs) });
|
|
724
724
|
}
|
|
725
725
|
function peg$f69() {
|
|
726
|
-
return
|
|
726
|
+
return createBlockNode("Divider", {});
|
|
727
727
|
}
|
|
728
728
|
function peg$f70() {
|
|
729
729
|
return null;
|
|
@@ -739,31 +739,29 @@ function peg$parse(input, options) {
|
|
|
739
739
|
return content.map((c) => c[0]).filter((c) => c !== null);
|
|
740
740
|
}
|
|
741
741
|
function peg$f73() {
|
|
742
|
-
return
|
|
742
|
+
return createBlockNode("Divider", {});
|
|
743
743
|
}
|
|
744
744
|
function peg$f74() {
|
|
745
745
|
return null;
|
|
746
746
|
}
|
|
747
747
|
function peg$f75(label, attrs, items) {
|
|
748
|
-
return {
|
|
749
|
-
type: "group",
|
|
748
|
+
return createBlockNode("NavGroup", {
|
|
750
749
|
label,
|
|
751
750
|
...attrsToObject(attrs),
|
|
752
751
|
items: items.map((i) => i[0]).filter((i) => i !== null)
|
|
753
|
-
};
|
|
752
|
+
});
|
|
754
753
|
}
|
|
755
754
|
function peg$f76() {
|
|
756
|
-
return
|
|
755
|
+
return createBlockNode("Divider", {});
|
|
757
756
|
}
|
|
758
757
|
function peg$f77() {
|
|
759
758
|
return null;
|
|
760
759
|
}
|
|
761
760
|
function peg$f78(label, attrs) {
|
|
762
|
-
return {
|
|
763
|
-
type: "item",
|
|
761
|
+
return createBlockNode("NavItem", {
|
|
764
762
|
label,
|
|
765
763
|
...attrsToObject(attrs)
|
|
766
|
-
};
|
|
764
|
+
});
|
|
767
765
|
}
|
|
768
766
|
function peg$f79(items, attrs, block) {
|
|
769
767
|
return createNode("Tabs", {
|
|
@@ -7597,6 +7595,13 @@ function peg$parse(input, options) {
|
|
|
7597
7595
|
loc: location()
|
|
7598
7596
|
};
|
|
7599
7597
|
}
|
|
7598
|
+
function createBlockNode(type, props = {}) {
|
|
7599
|
+
return {
|
|
7600
|
+
type,
|
|
7601
|
+
...props,
|
|
7602
|
+
loc: location()
|
|
7603
|
+
};
|
|
7604
|
+
}
|
|
7600
7605
|
function attrsToObject(attrs) {
|
|
7601
7606
|
if (!attrs || attrs.length === 0) return {};
|
|
7602
7607
|
const result = {};
|
package/dist/parser.d.cts
CHANGED
package/dist/parser.d.ts
CHANGED
package/dist/parser.js
CHANGED
|
@@ -596,16 +596,16 @@ function peg$parse(input, options) {
|
|
|
596
596
|
const columns = [];
|
|
597
597
|
const rows = [];
|
|
598
598
|
for (const item of items.map((i) => i[0]).filter((i) => i !== null)) {
|
|
599
|
-
if (item.
|
|
600
|
-
else if (item.
|
|
599
|
+
if (item.kind === "columns") columns.push(...item.values);
|
|
600
|
+
else if (item.kind === "row") rows.push(item.values);
|
|
601
601
|
}
|
|
602
602
|
return { columns, rows };
|
|
603
603
|
}
|
|
604
604
|
function peg$f52(values) {
|
|
605
|
-
return {
|
|
605
|
+
return { kind: "columns", values };
|
|
606
606
|
}
|
|
607
607
|
function peg$f53(values) {
|
|
608
|
-
return {
|
|
608
|
+
return { kind: "row", values };
|
|
609
609
|
}
|
|
610
610
|
function peg$f54() {
|
|
611
611
|
return null;
|
|
@@ -620,11 +620,11 @@ function peg$parse(input, options) {
|
|
|
620
620
|
return items.map((i) => i[0]).filter((i) => i !== null);
|
|
621
621
|
}
|
|
622
622
|
function peg$f57(label, attrs, nested) {
|
|
623
|
-
return {
|
|
623
|
+
return createBlockNode("ListItem", {
|
|
624
624
|
content: label,
|
|
625
625
|
...attrsToObject(attrs),
|
|
626
626
|
children: nested || []
|
|
627
|
-
};
|
|
627
|
+
});
|
|
628
628
|
}
|
|
629
629
|
function peg$f58() {
|
|
630
630
|
return null;
|
|
@@ -670,11 +670,11 @@ function peg$parse(input, options) {
|
|
|
670
670
|
const processedItems = items.map((item) => {
|
|
671
671
|
if (typeof item === "string") {
|
|
672
672
|
if (item === "---" || item === "-" || item === "divider") {
|
|
673
|
-
return
|
|
673
|
+
return createBlockNode("Divider", {});
|
|
674
674
|
}
|
|
675
|
-
return { label: item };
|
|
675
|
+
return createBlockNode("DropdownItem", { label: item });
|
|
676
676
|
}
|
|
677
|
-
return item;
|
|
677
|
+
return createBlockNode("DropdownItem", item);
|
|
678
678
|
});
|
|
679
679
|
return createNode("Dropdown", {
|
|
680
680
|
...attrsToObject(attrs),
|
|
@@ -691,10 +691,10 @@ function peg$parse(input, options) {
|
|
|
691
691
|
return items.map((i) => i[0]).filter((i) => i !== null);
|
|
692
692
|
}
|
|
693
693
|
function peg$f68(label, attrs) {
|
|
694
|
-
return { label, ...attrsToObject(attrs) };
|
|
694
|
+
return createBlockNode("DropdownItem", { label, ...attrsToObject(attrs) });
|
|
695
695
|
}
|
|
696
696
|
function peg$f69() {
|
|
697
|
-
return
|
|
697
|
+
return createBlockNode("Divider", {});
|
|
698
698
|
}
|
|
699
699
|
function peg$f70() {
|
|
700
700
|
return null;
|
|
@@ -710,31 +710,29 @@ function peg$parse(input, options) {
|
|
|
710
710
|
return content.map((c) => c[0]).filter((c) => c !== null);
|
|
711
711
|
}
|
|
712
712
|
function peg$f73() {
|
|
713
|
-
return
|
|
713
|
+
return createBlockNode("Divider", {});
|
|
714
714
|
}
|
|
715
715
|
function peg$f74() {
|
|
716
716
|
return null;
|
|
717
717
|
}
|
|
718
718
|
function peg$f75(label, attrs, items) {
|
|
719
|
-
return {
|
|
720
|
-
type: "group",
|
|
719
|
+
return createBlockNode("NavGroup", {
|
|
721
720
|
label,
|
|
722
721
|
...attrsToObject(attrs),
|
|
723
722
|
items: items.map((i) => i[0]).filter((i) => i !== null)
|
|
724
|
-
};
|
|
723
|
+
});
|
|
725
724
|
}
|
|
726
725
|
function peg$f76() {
|
|
727
|
-
return
|
|
726
|
+
return createBlockNode("Divider", {});
|
|
728
727
|
}
|
|
729
728
|
function peg$f77() {
|
|
730
729
|
return null;
|
|
731
730
|
}
|
|
732
731
|
function peg$f78(label, attrs) {
|
|
733
|
-
return {
|
|
734
|
-
type: "item",
|
|
732
|
+
return createBlockNode("NavItem", {
|
|
735
733
|
label,
|
|
736
734
|
...attrsToObject(attrs)
|
|
737
|
-
};
|
|
735
|
+
});
|
|
738
736
|
}
|
|
739
737
|
function peg$f79(items, attrs, block) {
|
|
740
738
|
return createNode("Tabs", {
|
|
@@ -7568,6 +7566,13 @@ function peg$parse(input, options) {
|
|
|
7568
7566
|
loc: location()
|
|
7569
7567
|
};
|
|
7570
7568
|
}
|
|
7569
|
+
function createBlockNode(type, props = {}) {
|
|
7570
|
+
return {
|
|
7571
|
+
type,
|
|
7572
|
+
...props,
|
|
7573
|
+
loc: location()
|
|
7574
|
+
};
|
|
7575
|
+
}
|
|
7571
7576
|
function attrsToObject(attrs) {
|
|
7572
7577
|
if (!attrs || attrs.length === 0) return {};
|
|
7573
7578
|
const result = {};
|