diagram-contracts 0.2.1 → 0.2.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/diagram-contracts.browser.mjs +104 -57
- package/package.json +4 -1
|
@@ -528,6 +528,7 @@ function defineScalarTag(tagName, options) {
|
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
function defineSequenceTag(tagName, options) {
|
|
531
|
+
const carrierIsResult = options.finalize === void 0;
|
|
531
532
|
return {
|
|
532
533
|
tagName,
|
|
533
534
|
nodeKind: "sequence",
|
|
@@ -535,12 +536,15 @@ function defineSequenceTag(tagName, options) {
|
|
|
535
536
|
matchByTagPrefix: options.matchByTagPrefix ?? false,
|
|
536
537
|
create: options.create,
|
|
537
538
|
addItem: options.addItem,
|
|
539
|
+
finalize: options.finalize ?? ((carrier) => carrier),
|
|
540
|
+
carrierIsResult,
|
|
538
541
|
identify: options.identify ?? null,
|
|
539
542
|
represent: options.represent ?? ((data) => data),
|
|
540
543
|
representTagName: options.representTagName ?? null
|
|
541
544
|
};
|
|
542
545
|
}
|
|
543
546
|
function defineMappingTag(tagName, options) {
|
|
547
|
+
const carrierIsResult = options.finalize === void 0;
|
|
544
548
|
return {
|
|
545
549
|
tagName,
|
|
546
550
|
nodeKind: "mapping",
|
|
@@ -551,6 +555,8 @@ function defineMappingTag(tagName, options) {
|
|
|
551
555
|
has: options.has,
|
|
552
556
|
keys: options.keys,
|
|
553
557
|
get: options.get,
|
|
558
|
+
finalize: options.finalize ?? ((carrier) => carrier),
|
|
559
|
+
carrierIsResult,
|
|
554
560
|
identify: options.identify ?? null,
|
|
555
561
|
represent: options.represent ?? ((data) => data),
|
|
556
562
|
representTagName: options.representTagName ?? null
|
|
@@ -730,7 +736,7 @@ var intCoreTag = defineScalarTag("tag:yaml.org,2002:int", {
|
|
|
730
736
|
..."0123456789"
|
|
731
737
|
],
|
|
732
738
|
resolve: resolveYamlInteger$2,
|
|
733
|
-
identify: (object2) =>
|
|
739
|
+
identify: (object2) => Number.isInteger(object2) && !Object.is(object2, -0) && object2.toString(10).indexOf("e") < 0,
|
|
734
740
|
represent: (object2) => object2.toString(10)
|
|
735
741
|
});
|
|
736
742
|
var YAML_INTEGER_IMPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)$");
|
|
@@ -758,7 +764,7 @@ var intJsonTag = defineScalarTag("tag:yaml.org,2002:int", {
|
|
|
758
764
|
implicit: true,
|
|
759
765
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
760
766
|
resolve: resolveYamlInteger$1,
|
|
761
|
-
identify: (object2) =>
|
|
767
|
+
identify: (object2) => Number.isInteger(object2) && !Object.is(object2, -0) && object2.toString(10).indexOf("e") < 0,
|
|
762
768
|
represent: (object2) => object2.toString(10)
|
|
763
769
|
});
|
|
764
770
|
var YAML_INTEGER_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
@@ -792,7 +798,7 @@ var intYaml11Tag = defineScalarTag("tag:yaml.org,2002:int", {
|
|
|
792
798
|
..."0123456789"
|
|
793
799
|
],
|
|
794
800
|
resolve: resolveYamlInteger,
|
|
795
|
-
identify: (object2) =>
|
|
801
|
+
identify: (object2) => Number.isInteger(object2) && !Object.is(object2, -0) && object2.toString(10).indexOf("e") < 0,
|
|
796
802
|
represent: (object2) => object2.toString(10)
|
|
797
803
|
});
|
|
798
804
|
var YAML_FLOAT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
@@ -825,7 +831,7 @@ var floatCoreTag = defineScalarTag("tag:yaml.org,2002:float", {
|
|
|
825
831
|
..."0123456789"
|
|
826
832
|
],
|
|
827
833
|
resolve: resolveYamlFloat$2,
|
|
828
|
-
identify: (object2) =>
|
|
834
|
+
identify: (object2) => typeof object2 === "number" && (!Number.isInteger(object2) || Object.is(object2, -0) || object2.toString(10).indexOf("e") >= 0),
|
|
829
835
|
represent: representYamlFloat$2
|
|
830
836
|
});
|
|
831
837
|
var YAML_FLOAT_IMPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$");
|
|
@@ -858,7 +864,7 @@ var floatJsonTag = defineScalarTag("tag:yaml.org,2002:float", {
|
|
|
858
864
|
implicit: true,
|
|
859
865
|
implicitFirstChars: ["-", ..."0123456789"],
|
|
860
866
|
resolve: resolveYamlFloat$1,
|
|
861
|
-
identify: (object2) =>
|
|
867
|
+
identify: (object2) => typeof object2 === "number" && (!Number.isInteger(object2) || Object.is(object2, -0) || object2.toString(10).indexOf("e") >= 0),
|
|
862
868
|
represent: representYamlFloat$1
|
|
863
869
|
});
|
|
864
870
|
var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
@@ -895,7 +901,7 @@ var floatYaml11Tag = defineScalarTag("tag:yaml.org,2002:float", {
|
|
|
895
901
|
..."0123456789"
|
|
896
902
|
],
|
|
897
903
|
resolve: resolveYamlFloat,
|
|
898
|
-
identify: (object2) =>
|
|
904
|
+
identify: (object2) => typeof object2 === "number" && (!Number.isInteger(object2) || Object.is(object2, -0) || object2.toString(10).indexOf("e") >= 0),
|
|
899
905
|
represent: representYamlFloat
|
|
900
906
|
});
|
|
901
907
|
var mergeTag = defineScalarTag("tag:yaml.org,2002:merge", {
|
|
@@ -974,17 +980,37 @@ var seqTag = defineSequenceTag("tag:yaml.org,2002:seq", {
|
|
|
974
980
|
},
|
|
975
981
|
identify: Array.isArray
|
|
976
982
|
});
|
|
983
|
+
function isPlainObject(data) {
|
|
984
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) return false;
|
|
985
|
+
const prototype = Object.getPrototypeOf(data);
|
|
986
|
+
return prototype === null || prototype === Object.prototype;
|
|
987
|
+
}
|
|
988
|
+
function pick(object2, keys) {
|
|
989
|
+
const result = {};
|
|
990
|
+
for (const key of keys) if (object2[key] !== void 0) result[key] = object2[key];
|
|
991
|
+
return result;
|
|
992
|
+
}
|
|
977
993
|
var omapTag = defineSequenceTag("tag:yaml.org,2002:omap", {
|
|
978
|
-
create: () =>
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
994
|
+
create: () => ({
|
|
995
|
+
list: [],
|
|
996
|
+
seen: /* @__PURE__ */ new Set()
|
|
997
|
+
}),
|
|
998
|
+
addItem: (carrier, item) => {
|
|
999
|
+
let key;
|
|
1000
|
+
if (item instanceof Map) {
|
|
1001
|
+
if (item.size !== 1) return "cannot resolve an ordered map item";
|
|
1002
|
+
key = item.keys().next().value;
|
|
1003
|
+
} else if (isPlainObject(item)) {
|
|
1004
|
+
const itemKeys = Object.keys(item);
|
|
1005
|
+
if (itemKeys.length !== 1) return "cannot resolve an ordered map item";
|
|
1006
|
+
key = itemKeys[0];
|
|
1007
|
+
} else return "cannot resolve an ordered map item";
|
|
1008
|
+
if (carrier.seen.has(key)) return "duplicate key in ordered map";
|
|
1009
|
+
carrier.seen.add(key);
|
|
1010
|
+
carrier.list.push(item);
|
|
986
1011
|
return "";
|
|
987
|
-
}
|
|
1012
|
+
},
|
|
1013
|
+
finalize: (carrier) => carrier.list
|
|
988
1014
|
});
|
|
989
1015
|
var pairsTag = defineSequenceTag("tag:yaml.org,2002:pairs", {
|
|
990
1016
|
create: () => [],
|
|
@@ -1002,16 +1028,6 @@ var pairsTag = defineSequenceTag("tag:yaml.org,2002:pairs", {
|
|
|
1002
1028
|
return "";
|
|
1003
1029
|
}
|
|
1004
1030
|
});
|
|
1005
|
-
function isPlainObject(data) {
|
|
1006
|
-
if (data === null || typeof data !== "object" || Array.isArray(data)) return false;
|
|
1007
|
-
const prototype = Object.getPrototypeOf(data);
|
|
1008
|
-
return prototype === null || prototype === Object.prototype;
|
|
1009
|
-
}
|
|
1010
|
-
function pick(object2, keys) {
|
|
1011
|
-
const result = {};
|
|
1012
|
-
for (const key of keys) if (object2[key] !== void 0) result[key] = object2[key];
|
|
1013
|
-
return result;
|
|
1014
|
-
}
|
|
1015
1031
|
var mapTag = defineMappingTag("tag:yaml.org,2002:map", {
|
|
1016
1032
|
create: () => ({}),
|
|
1017
1033
|
identify: isPlainObject,
|
|
@@ -1582,7 +1598,8 @@ var DEFAULT_CONSTRUCTOR_OPTIONS = {
|
|
|
1582
1598
|
filename: "",
|
|
1583
1599
|
schema: CORE_SCHEMA,
|
|
1584
1600
|
json: false,
|
|
1585
|
-
|
|
1601
|
+
maxTotalMergeKeys: 1e4,
|
|
1602
|
+
maxAliases: -1
|
|
1586
1603
|
};
|
|
1587
1604
|
function eventPosition$1(event) {
|
|
1588
1605
|
if ("tagStart" in event && event.tagStart !== NO_RANGE$2) return event.tagStart;
|
|
@@ -1594,6 +1611,14 @@ function eventPosition$1(event) {
|
|
|
1594
1611
|
function throwError$1(state, message) {
|
|
1595
1612
|
throwErrorAt(state.source, state.position, message, state.filename);
|
|
1596
1613
|
}
|
|
1614
|
+
function finalizeCollection(state, position, tag, carrier) {
|
|
1615
|
+
try {
|
|
1616
|
+
return tag.finalize(carrier);
|
|
1617
|
+
} catch (error51) {
|
|
1618
|
+
if (error51 instanceof YAMLException) throw error51;
|
|
1619
|
+
throwErrorAt(state.source, position, error51 instanceof Error ? error51.message : String(error51), state.filename);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1597
1622
|
function lookupTag(exact, prefix, tagName) {
|
|
1598
1623
|
const exactTag = exact[tagName];
|
|
1599
1624
|
if (exactTag) return exactTag;
|
|
@@ -1626,8 +1651,9 @@ function constructScalar(state, event) {
|
|
|
1626
1651
|
const collectionTagDef = lookupTag(state.schema.exact.mapping, state.schema.prefix.mapping, tagName) ?? lookupTag(state.schema.exact.sequence, state.schema.prefix.sequence, tagName);
|
|
1627
1652
|
if (collectionTagDef) {
|
|
1628
1653
|
if (source !== "") throwError$1(state, `cannot resolve a node with !<${tagName}> explicit tag`);
|
|
1654
|
+
const carrier = collectionTagDef.create(tagName);
|
|
1629
1655
|
return {
|
|
1630
|
-
value: collectionTagDef.
|
|
1656
|
+
value: collectionTagDef.carrierIsResult ? carrier : finalizeCollection(state, state.position, collectionTagDef, carrier),
|
|
1631
1657
|
tag: collectionTagDef
|
|
1632
1658
|
};
|
|
1633
1659
|
}
|
|
@@ -1661,6 +1687,7 @@ function isMappingTag(tag) {
|
|
|
1661
1687
|
}
|
|
1662
1688
|
function mergeKeys(state, frame, source, sourceTag) {
|
|
1663
1689
|
for (const sourceKey of sourceTag.keys(source)) {
|
|
1690
|
+
if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) throwError$1(state, `merge keys exceeded maxTotalMergeKeys (${state.maxTotalMergeKeys})`);
|
|
1664
1691
|
if (frame.tag.has(frame.value, sourceKey)) continue;
|
|
1665
1692
|
const err = frame.tag.addPair(frame.value, sourceKey, sourceTag.get(source, sourceKey));
|
|
1666
1693
|
if (err) throwError$1(state, err);
|
|
@@ -1670,14 +1697,8 @@ function mergeKeys(state, frame, source, sourceTag) {
|
|
|
1670
1697
|
function mergeSource(state, frame, source, sourceTag) {
|
|
1671
1698
|
state.position = frame.keyPosition;
|
|
1672
1699
|
if (isMappingTag(sourceTag)) mergeKeys(state, frame, source, sourceTag);
|
|
1673
|
-
else if (sourceTag.nodeKind === "sequence" && Array.isArray(source))
|
|
1674
|
-
|
|
1675
|
-
for (const element of source) {
|
|
1676
|
-
if (seen.has(element)) continue;
|
|
1677
|
-
seen.add(element);
|
|
1678
|
-
mergeKeys(state, frame, element, frame.tag);
|
|
1679
|
-
}
|
|
1680
|
-
} else throwError$1(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1700
|
+
else if (sourceTag.nodeKind === "sequence" && Array.isArray(source)) for (const element of source) mergeKeys(state, frame, element, frame.tag);
|
|
1701
|
+
else throwError$1(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1681
1702
|
}
|
|
1682
1703
|
function addMappingValue(state, frame, key, value, tag) {
|
|
1683
1704
|
state.position = frame.keyPosition;
|
|
@@ -1698,7 +1719,6 @@ function addValue(state, value, tag) {
|
|
|
1698
1719
|
} else if (frame.kind === "sequence") {
|
|
1699
1720
|
if (frame.merge) {
|
|
1700
1721
|
if (!isMappingTag(tag)) throwError$1(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1701
|
-
if (frame.index >= state.maxMergeSeqLength) throwError$1(state, `merge sequence length exceeded maxMergeSeqLength (${state.maxMergeSeqLength})`);
|
|
1702
1722
|
}
|
|
1703
1723
|
const err = frame.tag.addItem(frame.value, value, frame.index++);
|
|
1704
1724
|
if (err) throwError$1(state, err);
|
|
@@ -1713,11 +1733,17 @@ function addValue(state, value, tag) {
|
|
|
1713
1733
|
frame.hasKey = true;
|
|
1714
1734
|
}
|
|
1715
1735
|
}
|
|
1716
|
-
function storeAnchor(state, event, value, tag) {
|
|
1717
|
-
if (event.anchorStart !== NO_RANGE$2)
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1736
|
+
function storeAnchor(state, event, value, tag, isValueFinal) {
|
|
1737
|
+
if (event.anchorStart !== NO_RANGE$2) {
|
|
1738
|
+
const anchor = {
|
|
1739
|
+
value,
|
|
1740
|
+
tag,
|
|
1741
|
+
isValueFinal
|
|
1742
|
+
};
|
|
1743
|
+
state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor);
|
|
1744
|
+
return anchor;
|
|
1745
|
+
}
|
|
1746
|
+
return null;
|
|
1721
1747
|
}
|
|
1722
1748
|
function constructFromEvents(events, options) {
|
|
1723
1749
|
const state = {
|
|
@@ -1729,7 +1755,9 @@ function constructFromEvents(events, options) {
|
|
|
1729
1755
|
position: 0,
|
|
1730
1756
|
frames: [],
|
|
1731
1757
|
anchors: /* @__PURE__ */ new Map(),
|
|
1732
|
-
tagHandlers: /* @__PURE__ */ Object.create(null)
|
|
1758
|
+
tagHandlers: /* @__PURE__ */ Object.create(null),
|
|
1759
|
+
totalMergeKeys: 0,
|
|
1760
|
+
aliasCount: 0
|
|
1733
1761
|
};
|
|
1734
1762
|
while (state.eventIndex < state.events.length) {
|
|
1735
1763
|
const event = state.events[state.eventIndex++];
|
|
@@ -1737,6 +1765,7 @@ function constructFromEvents(events, options) {
|
|
|
1737
1765
|
switch (event.type) {
|
|
1738
1766
|
case 1:
|
|
1739
1767
|
state.anchors = /* @__PURE__ */ new Map();
|
|
1768
|
+
state.aliasCount = 0;
|
|
1740
1769
|
state.tagHandlers = /* @__PURE__ */ Object.create(null);
|
|
1741
1770
|
for (const directive of event.directives) if (directive.kind === "tag") state.tagHandlers[directive.handle] = directive.prefix;
|
|
1742
1771
|
state.frames.push({
|
|
@@ -1748,14 +1777,14 @@ function constructFromEvents(events, options) {
|
|
|
1748
1777
|
break;
|
|
1749
1778
|
case 4: {
|
|
1750
1779
|
const { value, tag } = constructScalar(state, event);
|
|
1751
|
-
storeAnchor(state, event, value, tag);
|
|
1780
|
+
storeAnchor(state, event, value, tag, true);
|
|
1752
1781
|
addValue(state, value, tag);
|
|
1753
1782
|
break;
|
|
1754
1783
|
}
|
|
1755
1784
|
case 2: {
|
|
1756
1785
|
const definition = collectionTag(state, event, state.schema.exact.sequence, state.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence");
|
|
1757
1786
|
const value = definition.tag.create(definition.tagName);
|
|
1758
|
-
storeAnchor(state, event, value, definition.tag);
|
|
1787
|
+
const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult);
|
|
1759
1788
|
const parent = state.frames[state.frames.length - 1];
|
|
1760
1789
|
const merge2 = parent !== void 0 && parent.kind === "mapping" && parent.hasKey && parent.key === MERGE_KEY;
|
|
1761
1790
|
state.frames.push({
|
|
@@ -1763,6 +1792,7 @@ function constructFromEvents(events, options) {
|
|
|
1763
1792
|
position: state.position,
|
|
1764
1793
|
value,
|
|
1765
1794
|
tag: definition.tag,
|
|
1795
|
+
anchor,
|
|
1766
1796
|
index: 0,
|
|
1767
1797
|
merge: merge2
|
|
1768
1798
|
});
|
|
@@ -1771,12 +1801,13 @@ function constructFromEvents(events, options) {
|
|
|
1771
1801
|
case 3: {
|
|
1772
1802
|
const definition = collectionTag(state, event, state.schema.exact.mapping, state.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping");
|
|
1773
1803
|
const value = definition.tag.create(definition.tagName);
|
|
1774
|
-
storeAnchor(state, event, value, definition.tag);
|
|
1804
|
+
const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult);
|
|
1775
1805
|
state.frames.push({
|
|
1776
1806
|
kind: "mapping",
|
|
1777
1807
|
position: state.position,
|
|
1778
1808
|
value,
|
|
1779
1809
|
tag: definition.tag,
|
|
1810
|
+
anchor,
|
|
1780
1811
|
key: void 0,
|
|
1781
1812
|
keyPosition: state.position,
|
|
1782
1813
|
hasKey: false,
|
|
@@ -1785,16 +1816,25 @@ function constructFromEvents(events, options) {
|
|
|
1785
1816
|
break;
|
|
1786
1817
|
}
|
|
1787
1818
|
case 5: {
|
|
1819
|
+
if (state.maxAliases !== -1 && ++state.aliasCount > state.maxAliases) throwError$1(state, `aliases exceeded maxAliases (${state.maxAliases})`);
|
|
1788
1820
|
const name = state.source.slice(event.anchorStart, event.anchorEnd);
|
|
1789
1821
|
const anchor = state.anchors.get(name);
|
|
1790
1822
|
if (!anchor) throwError$1(state, `unidentified alias "${name}"`);
|
|
1823
|
+
if (!anchor.isValueFinal) throwError$1(state, `recursive alias "${name}" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`);
|
|
1791
1824
|
addValue(state, anchor.value, anchor.tag);
|
|
1792
1825
|
break;
|
|
1793
1826
|
}
|
|
1794
1827
|
case 6: {
|
|
1795
1828
|
const frame = state.frames.pop();
|
|
1796
1829
|
if (frame.kind === "document") state.documents.push(frame.value);
|
|
1797
|
-
else
|
|
1830
|
+
else {
|
|
1831
|
+
const value = frame.tag.carrierIsResult ? frame.value : finalizeCollection(state, frame.position, frame.tag, frame.value);
|
|
1832
|
+
if (frame.anchor) {
|
|
1833
|
+
frame.anchor.value = value;
|
|
1834
|
+
frame.anchor.isValueFinal = true;
|
|
1835
|
+
}
|
|
1836
|
+
addValue(state, value, frame.tag);
|
|
1837
|
+
}
|
|
1798
1838
|
break;
|
|
1799
1839
|
}
|
|
1800
1840
|
}
|
|
@@ -1849,6 +1889,17 @@ function addMappingEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd,
|
|
|
1849
1889
|
style
|
|
1850
1890
|
});
|
|
1851
1891
|
}
|
|
1892
|
+
function insertFlowPairMappingEvent(state, snapshot) {
|
|
1893
|
+
state.events.splice(snapshot.eventsLength, 0, {
|
|
1894
|
+
type: 3,
|
|
1895
|
+
start: snapshot.position,
|
|
1896
|
+
anchorStart: NO_RANGE$1,
|
|
1897
|
+
anchorEnd: NO_RANGE$1,
|
|
1898
|
+
tagStart: NO_RANGE$1,
|
|
1899
|
+
tagEnd: NO_RANGE$1,
|
|
1900
|
+
style: 2
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1852
1903
|
function addScalarEvent(state, valueStart, valueEnd, anchorStart, anchorEnd, tagStart, tagEnd, style, chomping = 1, indent = -1, fast = false) {
|
|
1853
1904
|
state.events.push({
|
|
1854
1905
|
type: 4,
|
|
@@ -2292,12 +2343,8 @@ function readFlowCollection(state, nodeIndent, props) {
|
|
|
2292
2343
|
state.position++;
|
|
2293
2344
|
skipFlowSeparationSpace(state, nodeIndent);
|
|
2294
2345
|
if (!isMapping) {
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
|
|
2298
|
-
skipFlowSeparationSpace(state, nodeIndent);
|
|
2299
|
-
state.position++;
|
|
2300
|
-
skipFlowSeparationSpace(state, nodeIndent);
|
|
2346
|
+
insertFlowPairMappingEvent(state, entryStart);
|
|
2347
|
+
if (!keyWasRead) addEmptyScalarEvent(state);
|
|
2301
2348
|
} else if (!keyWasRead) addEmptyScalarEvent(state);
|
|
2302
2349
|
if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
|
|
2303
2350
|
skipFlowSeparationSpace(state, nodeIndent);
|
|
@@ -2307,9 +2354,8 @@ function readFlowCollection(state, nodeIndent, props) {
|
|
|
2307
2354
|
addEmptyScalarEvent(state);
|
|
2308
2355
|
} else if (isMapping) addEmptyScalarEvent(state);
|
|
2309
2356
|
else if (isPair) {
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
2357
|
+
insertFlowPairMappingEvent(state, entryStart);
|
|
2358
|
+
if (!keyWasRead) addEmptyScalarEvent(state);
|
|
2313
2359
|
addEmptyScalarEvent(state);
|
|
2314
2360
|
addPopEvent(state);
|
|
2315
2361
|
}
|
|
@@ -2666,7 +2712,8 @@ var DEFAULT_PRESENTER_OPTIONS = {
|
|
|
2666
2712
|
flowSkipCommaSpace: false,
|
|
2667
2713
|
flowSkipColonSpace: false,
|
|
2668
2714
|
quoteFlowKeys: false,
|
|
2669
|
-
quoteStyle: "
|
|
2715
|
+
quoteStyle: "single",
|
|
2716
|
+
forceQuotes: false,
|
|
2670
2717
|
tagBeforeAnchor: false
|
|
2671
2718
|
};
|
|
2672
2719
|
var DEFAULT_DUMP_SCHEMA = YAML11_SCHEMA.withTags({
|
|
@@ -23177,5 +23224,5 @@ export {
|
|
|
23177
23224
|
/*! Bundled license information:
|
|
23178
23225
|
|
|
23179
23226
|
js-yaml/dist/js-yaml.mjs:
|
|
23180
|
-
(*! js-yaml 5.
|
|
23227
|
+
(*! js-yaml 5.2.2 https://github.com/nodeca/js-yaml @license MIT *)
|
|
23181
23228
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diagram-contracts",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rule Catalog driven layout runtime — compile diagrams to deterministic SVG from Draw TSX, Draw Text, or Layout IR",
|
|
6
6
|
"keywords": [
|
|
@@ -105,5 +105,8 @@
|
|
|
105
105
|
"size-limit": "^11.0.0",
|
|
106
106
|
"tsup": "^8.5.1",
|
|
107
107
|
"vitest": "^4.1.9"
|
|
108
|
+
},
|
|
109
|
+
"overrides": {
|
|
110
|
+
"esbuild": "$esbuild"
|
|
108
111
|
}
|
|
109
112
|
}
|