@speclynx/apidom-reference 2.11.0 → 2.12.0
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/CHANGELOG.md +6 -0
- package/README.md +4 -2
- package/dist/apidom-reference.browser.js +834 -157
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +25 -25
- package/src/parse/parsers/Parser.cjs +7 -0
- package/src/parse/parsers/Parser.mjs +7 -0
- package/src/parse/parsers/arazzo-json-1/index.cjs +1 -1
- package/src/parse/parsers/arazzo-json-1/index.mjs +1 -1
- package/src/parse/parsers/arazzo-yaml-1/index.cjs +1 -1
- package/src/parse/parsers/arazzo-yaml-1/index.mjs +1 -1
- package/src/parse/parsers/asyncapi-json-2/index.cjs +1 -1
- package/src/parse/parsers/asyncapi-json-2/index.mjs +1 -1
- package/src/parse/parsers/asyncapi-yaml-2/index.cjs +1 -1
- package/src/parse/parsers/asyncapi-yaml-2/index.mjs +1 -1
- package/src/parse/parsers/json/index.cjs +1 -1
- package/src/parse/parsers/json/index.mjs +1 -1
- package/src/parse/parsers/openapi-json-2/index.cjs +1 -1
- package/src/parse/parsers/openapi-json-2/index.mjs +1 -1
- package/src/parse/parsers/openapi-json-3-0/index.cjs +1 -1
- package/src/parse/parsers/openapi-json-3-0/index.mjs +1 -1
- package/src/parse/parsers/openapi-json-3-1/index.cjs +1 -1
- package/src/parse/parsers/openapi-json-3-1/index.mjs +1 -1
- package/src/parse/parsers/openapi-yaml-2/index.cjs +1 -1
- package/src/parse/parsers/openapi-yaml-2/index.mjs +1 -1
- package/src/parse/parsers/openapi-yaml-3-0/index.cjs +1 -1
- package/src/parse/parsers/openapi-yaml-3-0/index.mjs +1 -1
- package/src/parse/parsers/openapi-yaml-3-1/index.cjs +1 -1
- package/src/parse/parsers/openapi-yaml-3-1/index.mjs +1 -1
- package/src/parse/parsers/yaml-1-2/index.cjs +1 -0
- package/src/parse/parsers/yaml-1-2/index.mjs +1 -0
- package/types/apidom-reference.d.ts +6 -1
- package/types/parse/parsers/Parser.d.ts +6 -1
|
@@ -5654,6 +5654,11 @@ class Parser {
|
|
|
5654
5654
|
*/
|
|
5655
5655
|
sourceMap;
|
|
5656
5656
|
|
|
5657
|
+
/**
|
|
5658
|
+
* Whether to capture format-specific style information for round-trip preservation.
|
|
5659
|
+
*/
|
|
5660
|
+
style;
|
|
5661
|
+
|
|
5657
5662
|
/**
|
|
5658
5663
|
* Whether to use strict parsing (native JSON.parse/YAML instead of tree-sitter).
|
|
5659
5664
|
*/
|
|
@@ -5672,6 +5677,7 @@ class Parser {
|
|
|
5672
5677
|
name,
|
|
5673
5678
|
allowEmpty = true,
|
|
5674
5679
|
sourceMap = false,
|
|
5680
|
+
style = false,
|
|
5675
5681
|
strict = true,
|
|
5676
5682
|
fileExtensions = [],
|
|
5677
5683
|
mediaTypes = []
|
|
@@ -5679,6 +5685,7 @@ class Parser {
|
|
|
5679
5685
|
this.name = name;
|
|
5680
5686
|
this.allowEmpty = allowEmpty;
|
|
5681
5687
|
this.sourceMap = sourceMap;
|
|
5688
|
+
this.style = style;
|
|
5682
5689
|
this.strict = strict;
|
|
5683
5690
|
this.fileExtensions = fileExtensions;
|
|
5684
5691
|
this.mediaTypes = mediaTypes;
|
|
@@ -5826,7 +5833,7 @@ class ArazzoJSON1Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["default
|
|
|
5826
5833
|
async parse(file, options) {
|
|
5827
5834
|
const source = file.toString();
|
|
5828
5835
|
try {
|
|
5829
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
5836
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
5830
5837
|
const parseResult = await (0,_speclynx_apidom_parser_adapter_arazzo_json_1__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
5831
5838
|
const shouldParseSourceDescriptions = options?.parse?.parserOpts?.[this.name]?.sourceDescriptions ?? options?.parse?.parserOpts?.sourceDescriptions;
|
|
5832
5839
|
if (shouldParseSourceDescriptions) {
|
|
@@ -6142,7 +6149,7 @@ class ArazzoYAML1Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["default
|
|
|
6142
6149
|
async parse(file, options) {
|
|
6143
6150
|
const source = file.toString();
|
|
6144
6151
|
try {
|
|
6145
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6152
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6146
6153
|
const parseResult = await (0,_speclynx_apidom_parser_adapter_arazzo_yaml_1__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6147
6154
|
const shouldParseSourceDescriptions = options?.parse?.parserOpts?.[this.name]?.sourceDescriptions ?? options?.parse?.parserOpts?.sourceDescriptions;
|
|
6148
6155
|
if (shouldParseSourceDescriptions) {
|
|
@@ -6234,7 +6241,7 @@ class AsyncAPIJSON2Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defau
|
|
|
6234
6241
|
async parse(file) {
|
|
6235
6242
|
const source = file.toString();
|
|
6236
6243
|
try {
|
|
6237
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6244
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6238
6245
|
return await (0,_speclynx_apidom_parser_adapter_asyncapi_json_2__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6239
6246
|
} catch (error) {
|
|
6240
6247
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6300,7 +6307,7 @@ class AsyncAPIYAML2Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defau
|
|
|
6300
6307
|
async parse(file) {
|
|
6301
6308
|
const source = file.toString();
|
|
6302
6309
|
try {
|
|
6303
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6310
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6304
6311
|
return await (0,_speclynx_apidom_parser_adapter_asyncapi_yaml_2__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6305
6312
|
} catch (error) {
|
|
6306
6313
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6432,7 +6439,7 @@ class JSONParser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["default"] {
|
|
|
6432
6439
|
async parse(file) {
|
|
6433
6440
|
const source = file.toString();
|
|
6434
6441
|
try {
|
|
6435
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict'], this);
|
|
6442
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict'], this);
|
|
6436
6443
|
return await (0,_speclynx_apidom_parser_adapter_json__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6437
6444
|
} catch (error) {
|
|
6438
6445
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6498,7 +6505,7 @@ class OpenAPIJSON2Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defaul
|
|
|
6498
6505
|
async parse(file) {
|
|
6499
6506
|
const source = file.toString();
|
|
6500
6507
|
try {
|
|
6501
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6508
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6502
6509
|
return await (0,_speclynx_apidom_parser_adapter_openapi_json_2__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6503
6510
|
} catch (error) {
|
|
6504
6511
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6564,7 +6571,7 @@ class OpenAPIJSON3_0Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defa
|
|
|
6564
6571
|
async parse(file) {
|
|
6565
6572
|
const source = file.toString();
|
|
6566
6573
|
try {
|
|
6567
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6574
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6568
6575
|
return await (0,_speclynx_apidom_parser_adapter_openapi_json_3_0__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6569
6576
|
} catch (error) {
|
|
6570
6577
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6630,7 +6637,7 @@ class OpenAPIJSON3_1Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defa
|
|
|
6630
6637
|
async parse(file) {
|
|
6631
6638
|
const source = file.toString();
|
|
6632
6639
|
try {
|
|
6633
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6640
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6634
6641
|
return await (0,_speclynx_apidom_parser_adapter_openapi_json_3_1__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6635
6642
|
} catch (error) {
|
|
6636
6643
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6696,7 +6703,7 @@ class OpenAPIYAML2Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defaul
|
|
|
6696
6703
|
async parse(file) {
|
|
6697
6704
|
const source = file.toString();
|
|
6698
6705
|
try {
|
|
6699
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6706
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6700
6707
|
return await (0,_speclynx_apidom_parser_adapter_openapi_yaml_2__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6701
6708
|
} catch (error) {
|
|
6702
6709
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6762,7 +6769,7 @@ class OpenAPIYAML3_0Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defa
|
|
|
6762
6769
|
async parse(file) {
|
|
6763
6770
|
const source = file.toString();
|
|
6764
6771
|
try {
|
|
6765
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6772
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6766
6773
|
return await (0,_speclynx_apidom_parser_adapter_openapi_yaml_3_0__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6767
6774
|
} catch (error) {
|
|
6768
6775
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6828,7 +6835,7 @@ class OpenAPIYAML3_1Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_4__["defa
|
|
|
6828
6835
|
async parse(file) {
|
|
6829
6836
|
const source = file.toString();
|
|
6830
6837
|
try {
|
|
6831
|
-
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'strict', 'refractorOpts'], this);
|
|
6838
|
+
const parserOpts = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['sourceMap', 'style', 'strict', 'refractorOpts'], this);
|
|
6832
6839
|
return await (0,_speclynx_apidom_parser_adapter_openapi_yaml_3_1__WEBPACK_IMPORTED_MODULE_1__.parse)(source, parserOpts);
|
|
6833
6840
|
} catch (error) {
|
|
6834
6841
|
throw new _errors_ParserError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`Error parsing "${file.uri}"`, {
|
|
@@ -6894,6 +6901,7 @@ class YAML1Parser extends _Parser_ts__WEBPACK_IMPORTED_MODULE_3__["default"] {
|
|
|
6894
6901
|
try {
|
|
6895
6902
|
return await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_0__.parse)(source, {
|
|
6896
6903
|
sourceMap: this.sourceMap,
|
|
6904
|
+
style: this.style,
|
|
6897
6905
|
strict: this.strict
|
|
6898
6906
|
});
|
|
6899
6907
|
} catch (error) {
|
|
@@ -27815,6 +27823,53 @@ var both = /*#__PURE__*/(0,_internal_curry2_js__WEBPACK_IMPORTED_MODULE_0__["def
|
|
|
27815
27823
|
|
|
27816
27824
|
/***/ },
|
|
27817
27825
|
|
|
27826
|
+
/***/ 8138
|
|
27827
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
27828
|
+
|
|
27829
|
+
"use strict";
|
|
27830
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27831
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
27832
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
27833
|
+
/* harmony export */ });
|
|
27834
|
+
/* harmony import */ var _internal_clone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8575);
|
|
27835
|
+
/* harmony import */ var _internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18938);
|
|
27836
|
+
|
|
27837
|
+
|
|
27838
|
+
|
|
27839
|
+
/**
|
|
27840
|
+
* Creates a deep copy of the source that can be used in place of the source
|
|
27841
|
+
* object without retaining any references to it.
|
|
27842
|
+
* The source object may contain (nested) `Array`s and `Object`s,
|
|
27843
|
+
* `Number`s, `String`s, `Boolean`s and `Date`s.
|
|
27844
|
+
* `Function`s are assigned by reference rather than copied.
|
|
27845
|
+
*
|
|
27846
|
+
* Dispatches to a `clone` method if present.
|
|
27847
|
+
*
|
|
27848
|
+
* Note that if the source object has multiple nodes that share a reference,
|
|
27849
|
+
* the returned object will have the same structure, but the references will
|
|
27850
|
+
* be pointed to the location within the cloned value.
|
|
27851
|
+
*
|
|
27852
|
+
* @func
|
|
27853
|
+
* @memberOf R
|
|
27854
|
+
* @since v0.1.0
|
|
27855
|
+
* @category Object
|
|
27856
|
+
* @sig {*} -> {*}
|
|
27857
|
+
* @param {*} value The object or array to clone
|
|
27858
|
+
* @return {*} A deeply cloned copy of `val`
|
|
27859
|
+
* @example
|
|
27860
|
+
*
|
|
27861
|
+
* const objects = [{}, {}, {}];
|
|
27862
|
+
* const objectsClone = R.clone(objects);
|
|
27863
|
+
* objects === objectsClone; //=> false
|
|
27864
|
+
* objects[0] === objectsClone[0]; //=> false
|
|
27865
|
+
*/
|
|
27866
|
+
var clone = /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function clone(value) {
|
|
27867
|
+
return value != null && typeof value.clone === 'function' ? value.clone() : (0,_internal_clone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, true);
|
|
27868
|
+
});
|
|
27869
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
|
|
27870
|
+
|
|
27871
|
+
/***/ },
|
|
27872
|
+
|
|
27818
27873
|
/***/ 68199
|
|
27819
27874
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
27820
27875
|
|
|
@@ -29541,6 +29596,132 @@ function _checkForMethod(methodname, fn) {
|
|
|
29541
29596
|
|
|
29542
29597
|
/***/ },
|
|
29543
29598
|
|
|
29599
|
+
/***/ 8575
|
|
29600
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
29601
|
+
|
|
29602
|
+
"use strict";
|
|
29603
|
+
__webpack_require__.r(__webpack_exports__);
|
|
29604
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29605
|
+
/* harmony export */ "default": () => (/* binding */ _clone)
|
|
29606
|
+
/* harmony export */ });
|
|
29607
|
+
/* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31254);
|
|
29608
|
+
/* harmony import */ var _type_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60963);
|
|
29609
|
+
|
|
29610
|
+
|
|
29611
|
+
|
|
29612
|
+
/**
|
|
29613
|
+
* Copies an object.
|
|
29614
|
+
*
|
|
29615
|
+
* @private
|
|
29616
|
+
* @param {*} value The value to be copied
|
|
29617
|
+
* @param {Boolean} deep Whether or not to perform deep cloning.
|
|
29618
|
+
* @return {*} The copied value.
|
|
29619
|
+
*/
|
|
29620
|
+
function _clone(value, deep, map) {
|
|
29621
|
+
map || (map = new _ObjectMap());
|
|
29622
|
+
|
|
29623
|
+
// this avoids the slower switch with a quick if decision removing some milliseconds in each run.
|
|
29624
|
+
if (_isPrimitive(value)) {
|
|
29625
|
+
return value;
|
|
29626
|
+
}
|
|
29627
|
+
var copy = function copy(copiedValue) {
|
|
29628
|
+
// Check for circular and same references on the object graph and return its corresponding clone.
|
|
29629
|
+
var cachedCopy = map.get(value);
|
|
29630
|
+
if (cachedCopy) {
|
|
29631
|
+
return cachedCopy;
|
|
29632
|
+
}
|
|
29633
|
+
map.set(value, copiedValue);
|
|
29634
|
+
for (var key in value) {
|
|
29635
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
29636
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
|
29637
|
+
}
|
|
29638
|
+
}
|
|
29639
|
+
return copiedValue;
|
|
29640
|
+
};
|
|
29641
|
+
switch ((0,_type_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
|
|
29642
|
+
case 'Object':
|
|
29643
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
|
29644
|
+
case 'Array':
|
|
29645
|
+
return copy(Array(value.length));
|
|
29646
|
+
case 'Date':
|
|
29647
|
+
return new Date(value.valueOf());
|
|
29648
|
+
case 'RegExp':
|
|
29649
|
+
return (0,_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
|
|
29650
|
+
case 'Int8Array':
|
|
29651
|
+
case 'Uint8Array':
|
|
29652
|
+
case 'Uint8ClampedArray':
|
|
29653
|
+
case 'Int16Array':
|
|
29654
|
+
case 'Uint16Array':
|
|
29655
|
+
case 'Int32Array':
|
|
29656
|
+
case 'Uint32Array':
|
|
29657
|
+
case 'Float32Array':
|
|
29658
|
+
case 'Float64Array':
|
|
29659
|
+
case 'BigInt64Array':
|
|
29660
|
+
case 'BigUint64Array':
|
|
29661
|
+
return value.slice();
|
|
29662
|
+
default:
|
|
29663
|
+
return value;
|
|
29664
|
+
}
|
|
29665
|
+
}
|
|
29666
|
+
function _isPrimitive(param) {
|
|
29667
|
+
var type = typeof param;
|
|
29668
|
+
return param == null || type != 'object' && type != 'function';
|
|
29669
|
+
}
|
|
29670
|
+
var _ObjectMap = /*#__PURE__*/function () {
|
|
29671
|
+
function _ObjectMap() {
|
|
29672
|
+
this.map = {};
|
|
29673
|
+
this.length = 0;
|
|
29674
|
+
}
|
|
29675
|
+
_ObjectMap.prototype.set = function (key, value) {
|
|
29676
|
+
var hashedKey = this.hash(key);
|
|
29677
|
+
var bucket = this.map[hashedKey];
|
|
29678
|
+
if (!bucket) {
|
|
29679
|
+
this.map[hashedKey] = bucket = [];
|
|
29680
|
+
}
|
|
29681
|
+
bucket.push([key, value]);
|
|
29682
|
+
this.length += 1;
|
|
29683
|
+
};
|
|
29684
|
+
_ObjectMap.prototype.hash = function (key) {
|
|
29685
|
+
var hashedKey = [];
|
|
29686
|
+
for (var value in key) {
|
|
29687
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
|
29688
|
+
}
|
|
29689
|
+
return hashedKey.join();
|
|
29690
|
+
};
|
|
29691
|
+
_ObjectMap.prototype.get = function (key) {
|
|
29692
|
+
/**
|
|
29693
|
+
* depending on the number of objects to be cloned is faster to just iterate over the items in the map just because the hash function is so costly,
|
|
29694
|
+
* on my tests this number is 180, anything above that using the hash function is faster.
|
|
29695
|
+
*/
|
|
29696
|
+
if (this.length <= 180) {
|
|
29697
|
+
for (var p in this.map) {
|
|
29698
|
+
var bucket = this.map[p];
|
|
29699
|
+
for (var i = 0; i < bucket.length; i += 1) {
|
|
29700
|
+
var element = bucket[i];
|
|
29701
|
+
if (element[0] === key) {
|
|
29702
|
+
return element[1];
|
|
29703
|
+
}
|
|
29704
|
+
}
|
|
29705
|
+
}
|
|
29706
|
+
return;
|
|
29707
|
+
}
|
|
29708
|
+
var hashedKey = this.hash(key);
|
|
29709
|
+
var bucket = this.map[hashedKey];
|
|
29710
|
+
if (!bucket) {
|
|
29711
|
+
return;
|
|
29712
|
+
}
|
|
29713
|
+
for (var i = 0; i < bucket.length; i += 1) {
|
|
29714
|
+
var element = bucket[i];
|
|
29715
|
+
if (element[0] === key) {
|
|
29716
|
+
return element[1];
|
|
29717
|
+
}
|
|
29718
|
+
}
|
|
29719
|
+
};
|
|
29720
|
+
return _ObjectMap;
|
|
29721
|
+
}();
|
|
29722
|
+
|
|
29723
|
+
/***/ },
|
|
29724
|
+
|
|
29544
29725
|
/***/ 31254
|
|
29545
29726
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
29546
29727
|
|
|
@@ -46730,6 +46911,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46730
46911
|
* @public
|
|
46731
46912
|
*/
|
|
46732
46913
|
|
|
46914
|
+
/**
|
|
46915
|
+
* @public
|
|
46916
|
+
*/
|
|
46917
|
+
|
|
46733
46918
|
/**
|
|
46734
46919
|
* Returns the fixed fields for an Element class or instance.
|
|
46735
46920
|
*
|
|
@@ -47177,6 +47362,7 @@ const predicates = {
|
|
|
47177
47362
|
isCommentElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isCommentElement,
|
|
47178
47363
|
isParseResultElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement,
|
|
47179
47364
|
isSourceMapElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isSourceMapElement,
|
|
47365
|
+
hasElementStyle: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementStyle,
|
|
47180
47366
|
hasElementSourceMap: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap,
|
|
47181
47367
|
includesSymbols: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesSymbols,
|
|
47182
47368
|
includesClasses: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses
|
|
@@ -47248,7 +47434,19 @@ const resolveSpecification = specification => {
|
|
|
47248
47434
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(val) && (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])('$ref', val) && (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])(ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__["default"], '$ref', val)) {
|
|
47249
47435
|
const $ref = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(['$ref'], val);
|
|
47250
47436
|
const pointer = (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_6__["default"])('#/', $ref);
|
|
47251
|
-
|
|
47437
|
+
const resolved = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(pointer.split('/'), root);
|
|
47438
|
+
// merge extra properties (e.g. alias) from the $ref object into the resolved value
|
|
47439
|
+
const {
|
|
47440
|
+
$ref: _,
|
|
47441
|
+
...rest
|
|
47442
|
+
} = val;
|
|
47443
|
+
if (Object.keys(rest).length > 0 && (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(resolved)) {
|
|
47444
|
+
return {
|
|
47445
|
+
...resolved,
|
|
47446
|
+
...rest
|
|
47447
|
+
};
|
|
47448
|
+
}
|
|
47449
|
+
return resolved;
|
|
47252
47450
|
}
|
|
47253
47451
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(val)) {
|
|
47254
47452
|
return traverse(val, root, newPath);
|
|
@@ -47871,20 +48069,22 @@ class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["de
|
|
|
47871
48069
|
"use strict";
|
|
47872
48070
|
__webpack_require__.r(__webpack_exports__);
|
|
47873
48071
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
47874
|
-
/* harmony export */ CloneError: () => (/* reexport safe */
|
|
47875
|
-
/* harmony export */ DeepCloneError: () => (/* reexport safe */
|
|
47876
|
-
/* harmony export */ ShallowCloneError: () => (/* reexport safe */
|
|
48072
|
+
/* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
|
|
48073
|
+
/* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
|
|
48074
|
+
/* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
47877
48075
|
/* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
|
|
47878
48076
|
/* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
|
|
47879
48077
|
/* harmony export */ });
|
|
47880
|
-
/* harmony import */ var
|
|
47881
|
-
/* harmony import */ var
|
|
47882
|
-
/* harmony import */ var
|
|
47883
|
-
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
47884
|
-
/* harmony import */ var
|
|
47885
|
-
/* harmony import */ var
|
|
47886
|
-
/* harmony import */ var
|
|
47887
|
-
/* harmony import */ var
|
|
48078
|
+
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
48079
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38504);
|
|
48080
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
48081
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18252);
|
|
48082
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25162);
|
|
48083
|
+
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25810);
|
|
48084
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95018);
|
|
48085
|
+
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3686);
|
|
48086
|
+
/* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3772);
|
|
48087
|
+
|
|
47888
48088
|
|
|
47889
48089
|
|
|
47890
48090
|
|
|
@@ -47917,9 +48117,9 @@ const cloneDeepElement = (element, options) => {
|
|
|
47917
48117
|
} = element;
|
|
47918
48118
|
if (Array.isArray(content)) {
|
|
47919
48119
|
copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
|
|
47920
|
-
} else if ((0,
|
|
48120
|
+
} else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
|
|
47921
48121
|
copy.content = cloneDeepElement(content, passThroughOptions);
|
|
47922
|
-
} else if (content instanceof
|
|
48122
|
+
} else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
47923
48123
|
copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
|
|
47924
48124
|
} else {
|
|
47925
48125
|
copy.content = content;
|
|
@@ -47943,7 +48143,7 @@ const cloneDeepKeyValuePair = (kvp, options) => {
|
|
|
47943
48143
|
} = kvp;
|
|
47944
48144
|
const keyCopy = key !== undefined ? cloneDeepElement(key, passThroughOptions) : undefined;
|
|
47945
48145
|
const valueCopy = value !== undefined ? cloneDeepElement(value, passThroughOptions) : undefined;
|
|
47946
|
-
const copy = new
|
|
48146
|
+
const copy = new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](keyCopy, valueCopy);
|
|
47947
48147
|
visited.set(kvp, copy);
|
|
47948
48148
|
return copy;
|
|
47949
48149
|
};
|
|
@@ -47959,7 +48159,7 @@ const cloneDeepObjectSlice = (slice, options) => {
|
|
|
47959
48159
|
return visited.get(slice);
|
|
47960
48160
|
}
|
|
47961
48161
|
const items = [...slice].map(element => cloneDeepElement(element, passThroughOptions));
|
|
47962
|
-
const copy = new
|
|
48162
|
+
const copy = new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](items);
|
|
47963
48163
|
visited.set(slice, copy);
|
|
47964
48164
|
return copy;
|
|
47965
48165
|
};
|
|
@@ -47970,16 +48170,16 @@ const cloneDeepObjectSlice = (slice, options) => {
|
|
|
47970
48170
|
* @public
|
|
47971
48171
|
*/
|
|
47972
48172
|
const cloneDeep = (value, options = {}) => {
|
|
47973
|
-
if (value instanceof
|
|
48173
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
47974
48174
|
return cloneDeepKeyValuePair(value, options);
|
|
47975
48175
|
}
|
|
47976
|
-
if (value instanceof
|
|
48176
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
47977
48177
|
return cloneDeepObjectSlice(value, options);
|
|
47978
48178
|
}
|
|
47979
|
-
if ((0,
|
|
48179
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
|
|
47980
48180
|
return cloneDeepElement(value, options);
|
|
47981
48181
|
}
|
|
47982
|
-
throw new
|
|
48182
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
47983
48183
|
value
|
|
47984
48184
|
});
|
|
47985
48185
|
};
|
|
@@ -47995,11 +48195,11 @@ const cloneShallowKeyValuePair = keyValuePair => {
|
|
|
47995
48195
|
key,
|
|
47996
48196
|
value
|
|
47997
48197
|
} = keyValuePair;
|
|
47998
|
-
return new
|
|
48198
|
+
return new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](key, value);
|
|
47999
48199
|
};
|
|
48000
48200
|
const cloneShallowObjectSlice = objectSlice => {
|
|
48001
48201
|
const items = [...objectSlice];
|
|
48002
|
-
return new
|
|
48202
|
+
return new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](items);
|
|
48003
48203
|
};
|
|
48004
48204
|
const cloneShallowElement = element => {
|
|
48005
48205
|
const Ctor = element.constructor;
|
|
@@ -48011,17 +48211,20 @@ const cloneShallowElement = element => {
|
|
|
48011
48211
|
if (!element.isAttributesEmpty) {
|
|
48012
48212
|
copy.attributes = cloneDeep(element.attributes);
|
|
48013
48213
|
}
|
|
48014
|
-
if ((0,
|
|
48015
|
-
|
|
48214
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementSourceMap)(element)) {
|
|
48215
|
+
_elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, copy);
|
|
48216
|
+
}
|
|
48217
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementStyle)(element)) {
|
|
48218
|
+
copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
|
|
48016
48219
|
}
|
|
48017
48220
|
const {
|
|
48018
48221
|
content
|
|
48019
48222
|
} = element;
|
|
48020
|
-
if ((0,
|
|
48223
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
|
|
48021
48224
|
copy.content = cloneShallowElement(content);
|
|
48022
48225
|
} else if (Array.isArray(content)) {
|
|
48023
48226
|
copy.content = [...content];
|
|
48024
|
-
} else if (content instanceof
|
|
48227
|
+
} else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
48025
48228
|
copy.content = cloneShallowKeyValuePair(content);
|
|
48026
48229
|
} else {
|
|
48027
48230
|
copy.content = content;
|
|
@@ -48036,16 +48239,16 @@ const cloneShallowElement = element => {
|
|
|
48036
48239
|
* @public
|
|
48037
48240
|
*/
|
|
48038
48241
|
const cloneShallow = value => {
|
|
48039
|
-
if (value instanceof
|
|
48242
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
48040
48243
|
return cloneShallowKeyValuePair(value);
|
|
48041
48244
|
}
|
|
48042
|
-
if (value instanceof
|
|
48245
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
48043
48246
|
return cloneShallowObjectSlice(value);
|
|
48044
48247
|
}
|
|
48045
|
-
if ((0,
|
|
48248
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
|
|
48046
48249
|
return cloneShallowElement(value);
|
|
48047
48250
|
}
|
|
48048
|
-
throw new
|
|
48251
|
+
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
48049
48252
|
value
|
|
48050
48253
|
});
|
|
48051
48254
|
};
|
|
@@ -48472,6 +48675,66 @@ function unpackSourceMap(packed) {
|
|
|
48472
48675
|
|
|
48473
48676
|
/***/ },
|
|
48474
48677
|
|
|
48678
|
+
/***/ 49686
|
|
48679
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
48680
|
+
|
|
48681
|
+
"use strict";
|
|
48682
|
+
__webpack_require__.r(__webpack_exports__);
|
|
48683
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
48684
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
48685
|
+
/* harmony export */ });
|
|
48686
|
+
/* harmony import */ var _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97071);
|
|
48687
|
+
|
|
48688
|
+
/**
|
|
48689
|
+
* Shape with optional style property.
|
|
48690
|
+
* @public
|
|
48691
|
+
*/
|
|
48692
|
+
/**
|
|
48693
|
+
* StyleElement stores format-specific style information for round-trip preservation.
|
|
48694
|
+
*
|
|
48695
|
+
* The style data is stored as a plain object with format-specific namespaces
|
|
48696
|
+
* (e.g., `yaml`, `json`). This element exists only during serialization/deserialization
|
|
48697
|
+
* (refract format) - in memory, style lives directly on `element.style`.
|
|
48698
|
+
*
|
|
48699
|
+
* Follows the same pattern as SourceMapElement with __mappings__.
|
|
48700
|
+
*
|
|
48701
|
+
* @public
|
|
48702
|
+
*/
|
|
48703
|
+
class StyleElement extends _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
48704
|
+
constructor(content, meta, attributes) {
|
|
48705
|
+
super(content, meta, attributes);
|
|
48706
|
+
this.element = '__styles__';
|
|
48707
|
+
}
|
|
48708
|
+
|
|
48709
|
+
/**
|
|
48710
|
+
* Transfers style property from one element to another.
|
|
48711
|
+
*/
|
|
48712
|
+
static transfer(from, to) {
|
|
48713
|
+
to.style = from.style;
|
|
48714
|
+
}
|
|
48715
|
+
|
|
48716
|
+
/**
|
|
48717
|
+
* Creates a StyleElement from an element's style property.
|
|
48718
|
+
* Returns undefined if the element has no style.
|
|
48719
|
+
*/
|
|
48720
|
+
static from(source) {
|
|
48721
|
+
if (!source.style) {
|
|
48722
|
+
return undefined;
|
|
48723
|
+
}
|
|
48724
|
+
return new StyleElement(source.style);
|
|
48725
|
+
}
|
|
48726
|
+
|
|
48727
|
+
/**
|
|
48728
|
+
* Restores the style property on the target element from this StyleElement.
|
|
48729
|
+
*/
|
|
48730
|
+
applyTo(target) {
|
|
48731
|
+
target.style = this.toValue();
|
|
48732
|
+
}
|
|
48733
|
+
}
|
|
48734
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StyleElement);
|
|
48735
|
+
|
|
48736
|
+
/***/ },
|
|
48737
|
+
|
|
48475
48738
|
/***/ 96911
|
|
48476
48739
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
48477
48740
|
|
|
@@ -48536,6 +48799,7 @@ const isSourceMapElement = element => element instanceof _elements_SourceMap_mjs
|
|
|
48536
48799
|
__webpack_require__.r(__webpack_exports__);
|
|
48537
48800
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
48538
48801
|
/* harmony export */ hasElementSourceMap: () => (/* binding */ hasElementSourceMap),
|
|
48802
|
+
/* harmony export */ hasElementStyle: () => (/* binding */ hasElementStyle),
|
|
48539
48803
|
/* harmony export */ includesClasses: () => (/* binding */ includesClasses),
|
|
48540
48804
|
/* harmony export */ includesSymbols: () => (/* binding */ includesSymbols),
|
|
48541
48805
|
/* harmony export */ isAnnotationElement: () => (/* reexport safe */ _elements_mjs__WEBPACK_IMPORTED_MODULE_1__.isAnnotationElement),
|
|
@@ -48560,6 +48824,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
48560
48824
|
|
|
48561
48825
|
|
|
48562
48826
|
|
|
48827
|
+
/**
|
|
48828
|
+
* Checks if an element has format-specific style information.
|
|
48829
|
+
* @public
|
|
48830
|
+
*/
|
|
48831
|
+
const hasElementStyle = element => {
|
|
48832
|
+
return element.style !== undefined;
|
|
48833
|
+
};
|
|
48834
|
+
|
|
48563
48835
|
/**
|
|
48564
48836
|
* Checks if an element has complete source position information.
|
|
48565
48837
|
* Returns true only if all 6 position properties are numbers.
|
|
@@ -49101,6 +49373,12 @@ class Element {
|
|
|
49101
49373
|
*/
|
|
49102
49374
|
parent;
|
|
49103
49375
|
|
|
49376
|
+
/**
|
|
49377
|
+
* Format-specific style information for round-trip preservation.
|
|
49378
|
+
* Each format owns its own namespace (e.g., `yaml`, `json`).
|
|
49379
|
+
*/
|
|
49380
|
+
style;
|
|
49381
|
+
|
|
49104
49382
|
// ============================================================================
|
|
49105
49383
|
// Source Position (LSP-compatible, TextDocument-compatible, UTF-16 code units)
|
|
49106
49384
|
// web-tree-sitter automatically provides position data in UTF-16 code units.
|
|
@@ -49990,17 +50268,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49990
50268
|
/* harmony export */ CollectionElement: () => (/* reexport safe */ _primitives_CollectionElement_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
49991
50269
|
/* harmony export */ CommentElement: () => (/* reexport safe */ _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]),
|
|
49992
50270
|
/* harmony export */ Element: () => (/* reexport safe */ _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]),
|
|
49993
|
-
/* harmony export */ KeyValuePair: () => (/* reexport safe */
|
|
50271
|
+
/* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__["default"]),
|
|
49994
50272
|
/* harmony export */ LinkElement: () => (/* reexport safe */ _elements_LinkElement_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
|
|
49995
50273
|
/* harmony export */ MemberElement: () => (/* reexport safe */ _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
49996
50274
|
/* harmony export */ NullElement: () => (/* reexport safe */ _primitives_NullElement_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
|
|
49997
50275
|
/* harmony export */ NumberElement: () => (/* reexport safe */ _primitives_NumberElement_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
49998
50276
|
/* harmony export */ ObjectElement: () => (/* reexport safe */ _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
|
|
49999
|
-
/* harmony export */ ObjectSlice: () => (/* reexport safe */
|
|
50277
|
+
/* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
|
|
50000
50278
|
/* harmony export */ ParseResultElement: () => (/* reexport safe */ _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]),
|
|
50001
50279
|
/* harmony export */ RefElement: () => (/* reexport safe */ _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]),
|
|
50002
50280
|
/* harmony export */ SourceMapElement: () => (/* reexport safe */ _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]),
|
|
50003
50281
|
/* harmony export */ StringElement: () => (/* reexport safe */ _primitives_StringElement_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
50282
|
+
/* harmony export */ StyleElement: () => (/* reexport safe */ _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
|
|
50004
50283
|
/* harmony export */ refract: () => (/* binding */ refract)
|
|
50005
50284
|
/* harmony export */ });
|
|
50006
50285
|
/* harmony import */ var _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60728);
|
|
@@ -50018,8 +50297,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50018
50297
|
/* harmony import */ var _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(40094);
|
|
50019
50298
|
/* harmony import */ var _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4823);
|
|
50020
50299
|
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(25810);
|
|
50021
|
-
/* harmony import */ var
|
|
50022
|
-
/* harmony import */ var
|
|
50300
|
+
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(49686);
|
|
50301
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(38504);
|
|
50302
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36663);
|
|
50303
|
+
|
|
50023
50304
|
|
|
50024
50305
|
|
|
50025
50306
|
|
|
@@ -50106,6 +50387,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50106
50387
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
50107
50388
|
/* harmony export */ });
|
|
50108
50389
|
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25810);
|
|
50390
|
+
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49686);
|
|
50391
|
+
|
|
50109
50392
|
|
|
50110
50393
|
/**
|
|
50111
50394
|
* Serialized representation of an Element in JSON Refract format.
|
|
@@ -50164,6 +50447,17 @@ class JSONSerialiser {
|
|
|
50164
50447
|
payload.meta.__mappings__ = this.serialise(sourceMap);
|
|
50165
50448
|
}
|
|
50166
50449
|
}
|
|
50450
|
+
|
|
50451
|
+
// Serialize style as __styles__ in meta (skip for StyleElement itself)
|
|
50452
|
+
if (!(element instanceof _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])) {
|
|
50453
|
+
const styleElement = _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__["default"].from(element);
|
|
50454
|
+
if (styleElement) {
|
|
50455
|
+
if (!payload.meta) {
|
|
50456
|
+
payload.meta = {};
|
|
50457
|
+
}
|
|
50458
|
+
payload.meta.__styles__ = this.serialise(styleElement);
|
|
50459
|
+
}
|
|
50460
|
+
}
|
|
50167
50461
|
const content = this.serialiseContent(element.content);
|
|
50168
50462
|
if (content !== undefined) {
|
|
50169
50463
|
payload.content = content;
|
|
@@ -50184,15 +50478,18 @@ class JSONSerialiser {
|
|
|
50184
50478
|
element.element = value.element;
|
|
50185
50479
|
}
|
|
50186
50480
|
|
|
50187
|
-
// Extract __mappings__ without mutating input, filter remaining meta
|
|
50481
|
+
// Extract __mappings__ and __styles__ without mutating input, filter remaining meta
|
|
50188
50482
|
let mappingsDoc;
|
|
50483
|
+
let stylesDoc;
|
|
50189
50484
|
let metaToDeserialize = value.meta;
|
|
50190
|
-
if (value.meta?.__mappings__) {
|
|
50485
|
+
if (value.meta?.__mappings__ || value.meta?.__styles__) {
|
|
50191
50486
|
const {
|
|
50192
50487
|
__mappings__,
|
|
50488
|
+
__styles__,
|
|
50193
50489
|
...rest
|
|
50194
50490
|
} = value.meta;
|
|
50195
50491
|
mappingsDoc = __mappings__;
|
|
50492
|
+
stylesDoc = __styles__;
|
|
50196
50493
|
metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
|
|
50197
50494
|
}
|
|
50198
50495
|
if (metaToDeserialize) {
|
|
@@ -50204,6 +50501,12 @@ class JSONSerialiser {
|
|
|
50204
50501
|
const sourceMap = this.deserialise(mappingsDoc);
|
|
50205
50502
|
sourceMap.applyTo(element);
|
|
50206
50503
|
}
|
|
50504
|
+
|
|
50505
|
+
// Restore style from __styles__
|
|
50506
|
+
if (stylesDoc) {
|
|
50507
|
+
const styleElement = this.deserialise(stylesDoc);
|
|
50508
|
+
styleElement.applyTo(element);
|
|
50509
|
+
}
|
|
50207
50510
|
if (value.attributes) {
|
|
50208
50511
|
this.deserialiseObject(value.attributes, element.attributes);
|
|
50209
50512
|
}
|
|
@@ -53025,6 +53328,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53025
53328
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
53026
53329
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
53027
53330
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
53331
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
53028
53332
|
|
|
53029
53333
|
|
|
53030
53334
|
|
|
@@ -53052,6 +53356,7 @@ class Visitor {
|
|
|
53052
53356
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
53053
53357
|
}
|
|
53054
53358
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
53359
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
53055
53360
|
}
|
|
53056
53361
|
}
|
|
53057
53362
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -63401,7 +63706,7 @@ const specification = {
|
|
|
63401
63706
|
$ref: '#/visitors/value'
|
|
63402
63707
|
},
|
|
63403
63708
|
attributes: {
|
|
63404
|
-
$
|
|
63709
|
+
$ref: '#/visitors/value',
|
|
63405
63710
|
alias: 'attributesField'
|
|
63406
63711
|
},
|
|
63407
63712
|
orderingKey: {
|
|
@@ -63691,6 +63996,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63691
63996
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
63692
63997
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
63693
63998
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
63999
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
63694
64000
|
|
|
63695
64001
|
|
|
63696
64002
|
|
|
@@ -63718,6 +64024,7 @@ class Visitor {
|
|
|
63718
64024
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
63719
64025
|
}
|
|
63720
64026
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
64027
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
63721
64028
|
}
|
|
63722
64029
|
}
|
|
63723
64030
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -71445,7 +71752,7 @@ const specification = {
|
|
|
71445
71752
|
fixedFields: {
|
|
71446
71753
|
// core vocabulary
|
|
71447
71754
|
id: {
|
|
71448
|
-
$
|
|
71755
|
+
$ref: '#/visitors/value',
|
|
71449
71756
|
alias: 'idField'
|
|
71450
71757
|
},
|
|
71451
71758
|
$schema: {
|
|
@@ -71727,6 +72034,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
71727
72034
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
71728
72035
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
71729
72036
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
72037
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
71730
72038
|
|
|
71731
72039
|
|
|
71732
72040
|
|
|
@@ -71754,6 +72062,7 @@ class Visitor {
|
|
|
71754
72062
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
71755
72063
|
}
|
|
71756
72064
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
72065
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
71757
72066
|
}
|
|
71758
72067
|
}
|
|
71759
72068
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -77156,6 +77465,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
77156
77465
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
77157
77466
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
77158
77467
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
77468
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
77159
77469
|
|
|
77160
77470
|
|
|
77161
77471
|
|
|
@@ -77183,6 +77493,7 @@ class Visitor {
|
|
|
77183
77493
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
77184
77494
|
}
|
|
77185
77495
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
77496
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
77186
77497
|
}
|
|
77187
77498
|
}
|
|
77188
77499
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -79401,10 +79712,10 @@ class Encoding extends _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__["
|
|
|
79401
79712
|
set headers(headers) {
|
|
79402
79713
|
this.set('headers', headers);
|
|
79403
79714
|
}
|
|
79404
|
-
get
|
|
79715
|
+
get styleField() {
|
|
79405
79716
|
return this.get('style');
|
|
79406
79717
|
}
|
|
79407
|
-
set
|
|
79718
|
+
set styleField(style) {
|
|
79408
79719
|
this.set('style', style);
|
|
79409
79720
|
}
|
|
79410
79721
|
get explode() {
|
|
@@ -79551,10 +79862,10 @@ class Header extends _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["de
|
|
|
79551
79862
|
set allowEmptyValue(allowEmptyValue) {
|
|
79552
79863
|
this.set('allowEmptyValue', allowEmptyValue);
|
|
79553
79864
|
}
|
|
79554
|
-
get
|
|
79865
|
+
get styleField() {
|
|
79555
79866
|
return this.get('style');
|
|
79556
79867
|
}
|
|
79557
|
-
set
|
|
79868
|
+
set styleField(style) {
|
|
79558
79869
|
this.set('style', style);
|
|
79559
79870
|
}
|
|
79560
79871
|
get explode() {
|
|
@@ -80170,10 +80481,10 @@ class Parameter extends _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__[
|
|
|
80170
80481
|
set allowEmptyValue(allowEmptyValue) {
|
|
80171
80482
|
this.set('allowEmptyValue', allowEmptyValue);
|
|
80172
80483
|
}
|
|
80173
|
-
get
|
|
80484
|
+
get styleField() {
|
|
80174
80485
|
return this.get('style');
|
|
80175
80486
|
}
|
|
80176
|
-
set
|
|
80487
|
+
set styleField(style) {
|
|
80177
80488
|
this.set('style', style);
|
|
80178
80489
|
}
|
|
80179
80490
|
get explode() {
|
|
@@ -83041,7 +83352,8 @@ const specification = {
|
|
|
83041
83352
|
$ref: '#/visitors/value'
|
|
83042
83353
|
},
|
|
83043
83354
|
style: {
|
|
83044
|
-
$ref: '#/visitors/value'
|
|
83355
|
+
$ref: '#/visitors/value',
|
|
83356
|
+
alias: 'styleField'
|
|
83045
83357
|
},
|
|
83046
83358
|
explode: {
|
|
83047
83359
|
$ref: '#/visitors/value'
|
|
@@ -83097,7 +83409,8 @@ const specification = {
|
|
|
83097
83409
|
},
|
|
83098
83410
|
headers: _visitors_open_api_3_0_encoding_HeadersVisitor_mjs__WEBPACK_IMPORTED_MODULE_60__["default"],
|
|
83099
83411
|
style: {
|
|
83100
|
-
$ref: '#/visitors/value'
|
|
83412
|
+
$ref: '#/visitors/value',
|
|
83413
|
+
alias: 'styleField'
|
|
83101
83414
|
},
|
|
83102
83415
|
explode: {
|
|
83103
83416
|
$ref: '#/visitors/value'
|
|
@@ -83187,7 +83500,8 @@ const specification = {
|
|
|
83187
83500
|
$ref: '#/visitors/value'
|
|
83188
83501
|
},
|
|
83189
83502
|
style: {
|
|
83190
|
-
$ref: '#/visitors/value'
|
|
83503
|
+
$ref: '#/visitors/value',
|
|
83504
|
+
alias: 'styleField'
|
|
83191
83505
|
},
|
|
83192
83506
|
explode: {
|
|
83193
83507
|
$ref: '#/visitors/value'
|
|
@@ -83609,6 +83923,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83609
83923
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
83610
83924
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
83611
83925
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
83926
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
83612
83927
|
|
|
83613
83928
|
|
|
83614
83929
|
|
|
@@ -83636,6 +83951,7 @@ class Visitor {
|
|
|
83636
83951
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
83637
83952
|
}
|
|
83638
83953
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
83954
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
83639
83955
|
}
|
|
83640
83956
|
}
|
|
83641
83957
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -91378,16 +91694,21 @@ const detect = async (source, {
|
|
|
91378
91694
|
*/
|
|
91379
91695
|
const parse = async (source, {
|
|
91380
91696
|
sourceMap = false,
|
|
91697
|
+
style = false,
|
|
91381
91698
|
strict = false
|
|
91382
91699
|
} = {}) => {
|
|
91383
91700
|
if (strict && sourceMap) {
|
|
91384
91701
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use sourceMap with strict parsing. Strict parsing does not support source maps.');
|
|
91385
91702
|
}
|
|
91703
|
+
if (strict && style) {
|
|
91704
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use style with strict parsing. Strict parsing does not support style preservation.');
|
|
91705
|
+
}
|
|
91386
91706
|
if (strict) {
|
|
91387
91707
|
return _native_index_mjs__WEBPACK_IMPORTED_MODULE_2__.parse(source);
|
|
91388
91708
|
}
|
|
91389
91709
|
return _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__.parse(source, {
|
|
91390
|
-
sourceMap
|
|
91710
|
+
sourceMap,
|
|
91711
|
+
style
|
|
91391
91712
|
});
|
|
91392
91713
|
};
|
|
91393
91714
|
|
|
@@ -91518,12 +91839,14 @@ const detect = async source => {
|
|
|
91518
91839
|
* @public
|
|
91519
91840
|
*/
|
|
91520
91841
|
const parse = async (source, {
|
|
91521
|
-
sourceMap = false
|
|
91842
|
+
sourceMap = false,
|
|
91843
|
+
style = false
|
|
91522
91844
|
} = {}) => {
|
|
91523
91845
|
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
91524
91846
|
try {
|
|
91525
91847
|
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
91526
|
-
sourceMap
|
|
91848
|
+
sourceMap,
|
|
91849
|
+
style
|
|
91527
91850
|
});
|
|
91528
91851
|
} finally {
|
|
91529
91852
|
cst.delete();
|
|
@@ -91626,6 +91949,24 @@ const maybeAddSourceMap = (info, element, ctx) => {
|
|
|
91626
91949
|
element.endCharacter = info.endPosition.column;
|
|
91627
91950
|
element.endOffset = info.endIndex;
|
|
91628
91951
|
};
|
|
91952
|
+
|
|
91953
|
+
// build json style object for an element
|
|
91954
|
+
const buildJsonStyle = (ctx, extras) => {
|
|
91955
|
+
const jsonStyle = {
|
|
91956
|
+
indent: ctx.indent
|
|
91957
|
+
};
|
|
91958
|
+
if (extras) Object.assign(jsonStyle, extras);
|
|
91959
|
+
return {
|
|
91960
|
+
json: jsonStyle
|
|
91961
|
+
};
|
|
91962
|
+
};
|
|
91963
|
+
|
|
91964
|
+
// detect indent from an object's first pair child position
|
|
91965
|
+
// called during transformChildren when we encounter the first pair
|
|
91966
|
+
const detectIndent = (objectColumn, firstPairColumn) => {
|
|
91967
|
+
const diff = firstPairColumn - objectColumn;
|
|
91968
|
+
return diff > 0 ? diff : 2;
|
|
91969
|
+
};
|
|
91629
91970
|
const transform = (cursor, transformerMap, ctx) => {
|
|
91630
91971
|
const info = getCursorInfo(cursor);
|
|
91631
91972
|
|
|
@@ -91689,11 +92030,27 @@ const createTransformers = transformerMap => ({
|
|
|
91689
92030
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
91690
92031
|
maybeAddSourceMap(info, element, ctx);
|
|
91691
92032
|
|
|
92033
|
+
// Detect indent from first pair if style is enabled and not yet detected
|
|
92034
|
+
if (ctx.style && ctx.indent === 0) {
|
|
92035
|
+
if (cursor.gotoFirstChild()) {
|
|
92036
|
+
do {
|
|
92037
|
+
if (cursor.nodeType === 'pair') {
|
|
92038
|
+
ctx.indent = detectIndent(info.startPosition.column, cursor.startPosition.column);
|
|
92039
|
+
break;
|
|
92040
|
+
}
|
|
92041
|
+
} while (cursor.gotoNextSibling());
|
|
92042
|
+
cursor.gotoParent();
|
|
92043
|
+
}
|
|
92044
|
+
}
|
|
92045
|
+
|
|
91692
92046
|
// Transform children (pairs)
|
|
91693
92047
|
const children = transformChildren(cursor, transformerMap, ctx);
|
|
91694
92048
|
for (const child of children) {
|
|
91695
92049
|
element.push(child);
|
|
91696
92050
|
}
|
|
92051
|
+
if (ctx.style) {
|
|
92052
|
+
element.style = buildJsonStyle(ctx);
|
|
92053
|
+
}
|
|
91697
92054
|
return element;
|
|
91698
92055
|
},
|
|
91699
92056
|
array(cursor, ctx) {
|
|
@@ -91706,6 +92063,9 @@ const createTransformers = transformerMap => ({
|
|
|
91706
92063
|
for (const child of children) {
|
|
91707
92064
|
element.push(child);
|
|
91708
92065
|
}
|
|
92066
|
+
if (ctx.style) {
|
|
92067
|
+
element.style = buildJsonStyle(ctx);
|
|
92068
|
+
}
|
|
91709
92069
|
return element;
|
|
91710
92070
|
},
|
|
91711
92071
|
pair(cursor, ctx) {
|
|
@@ -91747,30 +92107,47 @@ const createTransformers = transformerMap => ({
|
|
|
91747
92107
|
});
|
|
91748
92108
|
}
|
|
91749
92109
|
}
|
|
92110
|
+
if (ctx.style) {
|
|
92111
|
+
element.style = buildJsonStyle(ctx);
|
|
92112
|
+
}
|
|
91750
92113
|
maybeAddSourceMap(info, element, ctx);
|
|
91751
92114
|
return element;
|
|
91752
92115
|
},
|
|
91753
92116
|
number(cursor, ctx) {
|
|
91754
92117
|
const info = getCursorInfo(cursor);
|
|
91755
92118
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](Number(info.text));
|
|
92119
|
+
if (ctx.style) {
|
|
92120
|
+
element.style = buildJsonStyle(ctx, {
|
|
92121
|
+
rawContent: info.text
|
|
92122
|
+
});
|
|
92123
|
+
}
|
|
91756
92124
|
maybeAddSourceMap(info, element, ctx);
|
|
91757
92125
|
return element;
|
|
91758
92126
|
},
|
|
91759
92127
|
null(cursor, ctx) {
|
|
91760
92128
|
const info = getCursorInfo(cursor);
|
|
91761
92129
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
|
92130
|
+
if (ctx.style) {
|
|
92131
|
+
element.style = buildJsonStyle(ctx);
|
|
92132
|
+
}
|
|
91762
92133
|
maybeAddSourceMap(info, element, ctx);
|
|
91763
92134
|
return element;
|
|
91764
92135
|
},
|
|
91765
92136
|
true(cursor, ctx) {
|
|
91766
92137
|
const info = getCursorInfo(cursor);
|
|
91767
92138
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](true);
|
|
92139
|
+
if (ctx.style) {
|
|
92140
|
+
element.style = buildJsonStyle(ctx);
|
|
92141
|
+
}
|
|
91768
92142
|
maybeAddSourceMap(info, element, ctx);
|
|
91769
92143
|
return element;
|
|
91770
92144
|
},
|
|
91771
92145
|
false(cursor, ctx) {
|
|
91772
92146
|
const info = getCursorInfo(cursor);
|
|
91773
92147
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](false);
|
|
92148
|
+
if (ctx.style) {
|
|
92149
|
+
element.style = buildJsonStyle(ctx);
|
|
92150
|
+
}
|
|
91774
92151
|
maybeAddSourceMap(info, element, ctx);
|
|
91775
92152
|
return element;
|
|
91776
92153
|
},
|
|
@@ -91801,11 +92178,14 @@ Object.assign(transformers, createTransformers(transformers));
|
|
|
91801
92178
|
* @public
|
|
91802
92179
|
*/
|
|
91803
92180
|
const analyze = (cst, {
|
|
91804
|
-
sourceMap = false
|
|
92181
|
+
sourceMap = false,
|
|
92182
|
+
style = false
|
|
91805
92183
|
} = {}) => {
|
|
91806
92184
|
const cursor = cst.walk();
|
|
91807
92185
|
const ctx = {
|
|
91808
92186
|
sourceMap,
|
|
92187
|
+
style,
|
|
92188
|
+
indent: 0,
|
|
91809
92189
|
annotations: []
|
|
91810
92190
|
};
|
|
91811
92191
|
const result = transform(cursor, transformers, ctx);
|
|
@@ -92387,16 +92767,21 @@ const detect = async (source, {
|
|
|
92387
92767
|
*/
|
|
92388
92768
|
const parse = async (source, {
|
|
92389
92769
|
sourceMap = false,
|
|
92770
|
+
style = false,
|
|
92390
92771
|
strict = false
|
|
92391
92772
|
} = {}) => {
|
|
92392
92773
|
if (strict && sourceMap) {
|
|
92393
92774
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use sourceMap with strict parsing. Strict parsing does not support source maps.');
|
|
92394
92775
|
}
|
|
92776
|
+
if (strict && style) {
|
|
92777
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use style with strict parsing. Strict parsing does not support style preservation.');
|
|
92778
|
+
}
|
|
92395
92779
|
if (strict) {
|
|
92396
92780
|
return _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__.parse(source);
|
|
92397
92781
|
}
|
|
92398
92782
|
return _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__.parse(source, {
|
|
92399
|
-
sourceMap
|
|
92783
|
+
sourceMap,
|
|
92784
|
+
style
|
|
92400
92785
|
});
|
|
92401
92786
|
};
|
|
92402
92787
|
|
|
@@ -92471,12 +92856,14 @@ const detect = async source => {
|
|
|
92471
92856
|
* @public
|
|
92472
92857
|
*/
|
|
92473
92858
|
const parse = async (source, {
|
|
92474
|
-
sourceMap = false
|
|
92859
|
+
sourceMap = false,
|
|
92860
|
+
style = false
|
|
92475
92861
|
} = {}) => {
|
|
92476
92862
|
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
92477
92863
|
try {
|
|
92478
92864
|
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
92479
|
-
sourceMap
|
|
92865
|
+
sourceMap,
|
|
92866
|
+
style
|
|
92480
92867
|
});
|
|
92481
92868
|
} finally {
|
|
92482
92869
|
cst.delete();
|
|
@@ -92550,18 +92937,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
92550
92937
|
/* harmony import */ var _ast_Error_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33240);
|
|
92551
92938
|
/* harmony import */ var _ast_Literal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86951);
|
|
92552
92939
|
/* harmony import */ var _ast_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88912);
|
|
92553
|
-
/* harmony import */ var
|
|
92554
|
-
/* harmony import */ var
|
|
92555
|
-
/* harmony import */ var
|
|
92556
|
-
/* harmony import */ var
|
|
92557
|
-
/* harmony import */ var
|
|
92558
|
-
/* harmony import */ var
|
|
92559
|
-
/* harmony import */ var
|
|
92560
|
-
/* harmony import */ var
|
|
92561
|
-
/* harmony import */ var
|
|
92562
|
-
/* harmony import */ var
|
|
92563
|
-
/* harmony import */ var
|
|
92564
|
-
/* harmony import */ var
|
|
92940
|
+
/* harmony import */ var _ast_nodes_YamlNode_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6821);
|
|
92941
|
+
/* harmony import */ var _ast_nodes_YamlAlias_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15103);
|
|
92942
|
+
/* harmony import */ var _ast_nodes_YamlAnchor_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2838);
|
|
92943
|
+
/* harmony import */ var _ast_nodes_YamlComment_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14120);
|
|
92944
|
+
/* harmony import */ var _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22532);
|
|
92945
|
+
/* harmony import */ var _ast_nodes_YamlDocument_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17374);
|
|
92946
|
+
/* harmony import */ var _ast_nodes_YamlKeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39113);
|
|
92947
|
+
/* harmony import */ var _ast_nodes_YamlMapping_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17373);
|
|
92948
|
+
/* harmony import */ var _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(20301);
|
|
92949
|
+
/* harmony import */ var _ast_nodes_YamlSequence_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(46794);
|
|
92950
|
+
/* harmony import */ var _ast_nodes_YamlStream_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(74213);
|
|
92951
|
+
/* harmony import */ var _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(48139);
|
|
92952
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21544);
|
|
92953
|
+
|
|
92565
92954
|
|
|
92566
92955
|
|
|
92567
92956
|
|
|
@@ -92601,16 +92990,16 @@ const toPositionProps = info => ({
|
|
|
92601
92990
|
endOffset: info.endIndex
|
|
92602
92991
|
});
|
|
92603
92992
|
const toYamlAnchor = info => {
|
|
92604
|
-
return new
|
|
92993
|
+
return new _ast_nodes_YamlAnchor_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]({
|
|
92605
92994
|
name: info.text,
|
|
92606
92995
|
...toPositionProps(info)
|
|
92607
92996
|
});
|
|
92608
92997
|
};
|
|
92609
92998
|
const toYamlTag = (info, tagInfo) => {
|
|
92610
92999
|
const explicitName = tagInfo?.text || (info.type === 'plain_scalar' ? '?' : '!');
|
|
92611
|
-
const kind = info.type.endsWith('mapping') ?
|
|
93000
|
+
const kind = info.type.endsWith('mapping') ? _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Mapping : info.type.endsWith('sequence') ? _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Sequence : _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar;
|
|
92612
93001
|
const positionProps = tagInfo ? toPositionProps(tagInfo) : undefined;
|
|
92613
|
-
return new
|
|
93002
|
+
return new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
92614
93003
|
explicitName,
|
|
92615
93004
|
kind,
|
|
92616
93005
|
...positionProps
|
|
@@ -92658,12 +93047,29 @@ const processChildren = (cursor, ctx, transformerMap) => {
|
|
|
92658
93047
|
return results;
|
|
92659
93048
|
};
|
|
92660
93049
|
|
|
93050
|
+
// strip leading '# ' (or bare '#') from comment text, keeping only the content
|
|
93051
|
+
const stripCommentHash = text => text.split('\n').map(line => line.replace(/^#\s?/, '')).join('\n');
|
|
93052
|
+
|
|
93053
|
+
// find the first YamlNode in a TransformResult (which may be an array from block_node)
|
|
93054
|
+
const findYamlNode = result => {
|
|
93055
|
+
if (result instanceof _ast_nodes_YamlNode_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) return result;
|
|
93056
|
+
if (Array.isArray(result)) {
|
|
93057
|
+
for (const item of result.flat()) {
|
|
93058
|
+
if (item instanceof _ast_nodes_YamlNode_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) return item;
|
|
93059
|
+
}
|
|
93060
|
+
}
|
|
93061
|
+
return null;
|
|
93062
|
+
};
|
|
92661
93063
|
// Helper to process key-value pair children
|
|
92662
93064
|
const processKeyValuePairChildren = (cursor, ctx, transformerMap) => {
|
|
92663
93065
|
let key = null;
|
|
92664
93066
|
let value = null;
|
|
92665
93067
|
const errors = [];
|
|
93068
|
+
const commentsBetweenKeyValue = [];
|
|
93069
|
+
const commentsAfterValue = [];
|
|
92666
93070
|
let siblings = {};
|
|
93071
|
+
let seenKey = false;
|
|
93072
|
+
let seenValue = false;
|
|
92667
93073
|
if (cursor.gotoFirstChild()) {
|
|
92668
93074
|
do {
|
|
92669
93075
|
const info = getCursorInfo(cursor);
|
|
@@ -92678,12 +93084,25 @@ const processKeyValuePairChildren = (cursor, ctx, transformerMap) => {
|
|
|
92678
93084
|
siblings.anchor = info;
|
|
92679
93085
|
continue;
|
|
92680
93086
|
}
|
|
93087
|
+
|
|
93088
|
+
// collect comment nodes (extras placed by tree-sitter between key/value)
|
|
93089
|
+
if (info.type === 'comment') {
|
|
93090
|
+
const commentText = stripCommentHash(info.text);
|
|
93091
|
+
if (seenValue) {
|
|
93092
|
+
commentsAfterValue.push(commentText);
|
|
93093
|
+
} else if (seenKey) {
|
|
93094
|
+
commentsBetweenKeyValue.push(commentText);
|
|
93095
|
+
}
|
|
93096
|
+
continue;
|
|
93097
|
+
}
|
|
92681
93098
|
if (fieldName === 'key') {
|
|
92682
93099
|
key = transform(cursor, ctx, transformerMap, siblings);
|
|
92683
93100
|
siblings = {};
|
|
93101
|
+
seenKey = true;
|
|
92684
93102
|
} else if (fieldName === 'value') {
|
|
92685
93103
|
value = transform(cursor, ctx, transformerMap, siblings);
|
|
92686
93104
|
siblings = {};
|
|
93105
|
+
seenValue = true;
|
|
92687
93106
|
} else if (info.type === 'ERROR') {
|
|
92688
93107
|
const errorResult = transform(cursor, ctx, transformerMap, siblings);
|
|
92689
93108
|
if (errorResult !== null) {
|
|
@@ -92696,7 +93115,9 @@ const processKeyValuePairChildren = (cursor, ctx, transformerMap) => {
|
|
|
92696
93115
|
return {
|
|
92697
93116
|
key,
|
|
92698
93117
|
value,
|
|
92699
|
-
errors
|
|
93118
|
+
errors,
|
|
93119
|
+
commentsBetweenKeyValue,
|
|
93120
|
+
commentsAfterValue
|
|
92700
93121
|
};
|
|
92701
93122
|
};
|
|
92702
93123
|
const transform = (cursor, ctx, transformerMap, siblings = {}) => {
|
|
@@ -92725,7 +93146,7 @@ const createTransformers = transformerMap => ({
|
|
|
92725
93146
|
stream(cursor, ctx) {
|
|
92726
93147
|
const info = getCursorInfo(cursor);
|
|
92727
93148
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
92728
|
-
const stream = new
|
|
93149
|
+
const stream = new _ast_nodes_YamlStream_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]({
|
|
92729
93150
|
children: children.filter(c => c !== null),
|
|
92730
93151
|
...toPositionProps(info),
|
|
92731
93152
|
isMissing: info.isMissing
|
|
@@ -92748,7 +93169,7 @@ const createTransformers = transformerMap => ({
|
|
|
92748
93169
|
} while (cursor.gotoNextSibling());
|
|
92749
93170
|
cursor.gotoParent();
|
|
92750
93171
|
}
|
|
92751
|
-
return new
|
|
93172
|
+
return new _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
|
|
92752
93173
|
...toPositionProps(info),
|
|
92753
93174
|
name: '%YAML',
|
|
92754
93175
|
parameters: {
|
|
@@ -92767,7 +93188,7 @@ const createTransformers = transformerMap => ({
|
|
|
92767
93188
|
} while (cursor.gotoNextSibling());
|
|
92768
93189
|
cursor.gotoParent();
|
|
92769
93190
|
}
|
|
92770
|
-
const tagDirective = new
|
|
93191
|
+
const tagDirective = new _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
|
|
92771
93192
|
...toPositionProps(info),
|
|
92772
93193
|
name: '%TAG',
|
|
92773
93194
|
parameters: {
|
|
@@ -92789,7 +93210,7 @@ const createTransformers = transformerMap => ({
|
|
|
92789
93210
|
} while (cursor.gotoNextSibling());
|
|
92790
93211
|
cursor.gotoParent();
|
|
92791
93212
|
}
|
|
92792
|
-
return new
|
|
93213
|
+
return new _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
|
|
92793
93214
|
...toPositionProps(info),
|
|
92794
93215
|
name: children[0],
|
|
92795
93216
|
parameters: {
|
|
@@ -92801,7 +93222,7 @@ const createTransformers = transformerMap => ({
|
|
|
92801
93222
|
document(cursor, ctx) {
|
|
92802
93223
|
const info = getCursorInfo(cursor);
|
|
92803
93224
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
92804
|
-
return new
|
|
93225
|
+
return new _ast_nodes_YamlDocument_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
92805
93226
|
children: children.flat().filter(c => c !== null),
|
|
92806
93227
|
...toPositionProps(info),
|
|
92807
93228
|
isMissing: info.isMissing
|
|
@@ -92833,7 +93254,7 @@ const createTransformers = transformerMap => ({
|
|
|
92833
93254
|
|
|
92834
93255
|
// No kind node - create empty scalar
|
|
92835
93256
|
if (lastChildInfo) {
|
|
92836
|
-
const emptyScalarNode = new
|
|
93257
|
+
const emptyScalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
92837
93258
|
content: '',
|
|
92838
93259
|
anchor: siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined,
|
|
92839
93260
|
tag: toYamlTag(lastChildInfo, siblings.tag),
|
|
@@ -92843,8 +93264,8 @@ const createTransformers = transformerMap => ({
|
|
|
92843
93264
|
endLine: lastChildInfo.endPosition.row,
|
|
92844
93265
|
endCharacter: lastChildInfo.endPosition.column,
|
|
92845
93266
|
endOffset: lastChildInfo.endIndex,
|
|
92846
|
-
styleGroup:
|
|
92847
|
-
style:
|
|
93267
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93268
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
92848
93269
|
});
|
|
92849
93270
|
registerAnchor(emptyScalarNode, ctx);
|
|
92850
93271
|
return emptyScalarNode;
|
|
@@ -92856,13 +93277,13 @@ const createTransformers = transformerMap => ({
|
|
|
92856
93277
|
const tag = toYamlTag(info, siblings.tag);
|
|
92857
93278
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
92858
93279
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
92859
|
-
const mappingNode = new
|
|
93280
|
+
const mappingNode = new _ast_nodes_YamlMapping_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]({
|
|
92860
93281
|
children: children.filter(c => c !== null),
|
|
92861
93282
|
...toPositionProps(info),
|
|
92862
93283
|
anchor,
|
|
92863
93284
|
tag,
|
|
92864
|
-
styleGroup:
|
|
92865
|
-
style:
|
|
93285
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
93286
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.NextLine,
|
|
92866
93287
|
isMissing: info.isMissing
|
|
92867
93288
|
});
|
|
92868
93289
|
registerAnchor(mappingNode, ctx);
|
|
@@ -92873,13 +93294,15 @@ const createTransformers = transformerMap => ({
|
|
|
92873
93294
|
const {
|
|
92874
93295
|
key,
|
|
92875
93296
|
value,
|
|
92876
|
-
errors
|
|
93297
|
+
errors,
|
|
93298
|
+
commentsBetweenKeyValue,
|
|
93299
|
+
commentsAfterValue
|
|
92877
93300
|
} = processKeyValuePairChildren(cursor, ctx, transformerMap);
|
|
92878
93301
|
const children = [];
|
|
92879
93302
|
|
|
92880
93303
|
// Handle empty key
|
|
92881
93304
|
if (key === null) {
|
|
92882
|
-
const emptyKey = new
|
|
93305
|
+
const emptyKey = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
92883
93306
|
content: '',
|
|
92884
93307
|
startLine: info.startPosition.row,
|
|
92885
93308
|
startCharacter: info.startPosition.column,
|
|
@@ -92887,12 +93310,12 @@ const createTransformers = transformerMap => ({
|
|
|
92887
93310
|
endLine: info.startPosition.row,
|
|
92888
93311
|
endCharacter: info.startPosition.column,
|
|
92889
93312
|
endOffset: info.startIndex,
|
|
92890
|
-
tag: new
|
|
93313
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
92891
93314
|
explicitName: '?',
|
|
92892
|
-
kind:
|
|
93315
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
92893
93316
|
}),
|
|
92894
|
-
styleGroup:
|
|
92895
|
-
style:
|
|
93317
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93318
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
92896
93319
|
});
|
|
92897
93320
|
children.push(emptyKey);
|
|
92898
93321
|
} else {
|
|
@@ -92901,7 +93324,7 @@ const createTransformers = transformerMap => ({
|
|
|
92901
93324
|
|
|
92902
93325
|
// Handle empty value
|
|
92903
93326
|
if (value === null) {
|
|
92904
|
-
const emptyValue = new
|
|
93327
|
+
const emptyValue = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
92905
93328
|
content: '',
|
|
92906
93329
|
startLine: info.endPosition.row,
|
|
92907
93330
|
startCharacter: info.endPosition.column,
|
|
@@ -92909,22 +93332,37 @@ const createTransformers = transformerMap => ({
|
|
|
92909
93332
|
endLine: info.endPosition.row,
|
|
92910
93333
|
endCharacter: info.endPosition.column,
|
|
92911
93334
|
endOffset: info.endIndex,
|
|
92912
|
-
tag: new
|
|
93335
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
92913
93336
|
explicitName: '?',
|
|
92914
|
-
kind:
|
|
93337
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
92915
93338
|
}),
|
|
92916
|
-
styleGroup:
|
|
92917
|
-
style:
|
|
93339
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93340
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
92918
93341
|
});
|
|
92919
93342
|
children.push(emptyValue);
|
|
92920
93343
|
} else {
|
|
92921
93344
|
children.push(value);
|
|
92922
93345
|
}
|
|
93346
|
+
|
|
93347
|
+
// attach comments found between key and value to the value node
|
|
93348
|
+
if (commentsBetweenKeyValue.length > 0) {
|
|
93349
|
+
const valueNode = findYamlNode(value);
|
|
93350
|
+
if (valueNode) {
|
|
93351
|
+
valueNode.commentBefore = commentsBetweenKeyValue.join('\n');
|
|
93352
|
+
}
|
|
93353
|
+
}
|
|
93354
|
+
// attach comments found after value to the value node
|
|
93355
|
+
if (commentsAfterValue.length > 0) {
|
|
93356
|
+
const valueNode = findYamlNode(value);
|
|
93357
|
+
if (valueNode) {
|
|
93358
|
+
valueNode.comment = commentsAfterValue.join('\n');
|
|
93359
|
+
}
|
|
93360
|
+
}
|
|
92923
93361
|
children.push(...errors);
|
|
92924
|
-
return new
|
|
93362
|
+
return new _ast_nodes_YamlKeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
92925
93363
|
children: children.flat().filter(c => c !== null),
|
|
92926
93364
|
...toPositionProps(info),
|
|
92927
|
-
styleGroup:
|
|
93365
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
92928
93366
|
isMissing: info.isMissing
|
|
92929
93367
|
});
|
|
92930
93368
|
},
|
|
@@ -92933,13 +93371,13 @@ const createTransformers = transformerMap => ({
|
|
|
92933
93371
|
const tag = toYamlTag(info, siblings.tag);
|
|
92934
93372
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
92935
93373
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
92936
|
-
const mappingNode = new
|
|
93374
|
+
const mappingNode = new _ast_nodes_YamlMapping_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]({
|
|
92937
93375
|
children: children.flat().filter(c => c !== null),
|
|
92938
93376
|
...toPositionProps(info),
|
|
92939
93377
|
anchor,
|
|
92940
93378
|
tag,
|
|
92941
|
-
styleGroup:
|
|
92942
|
-
style:
|
|
93379
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93380
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Explicit,
|
|
92943
93381
|
isMissing: info.isMissing
|
|
92944
93382
|
});
|
|
92945
93383
|
registerAnchor(mappingNode, ctx);
|
|
@@ -92950,13 +93388,15 @@ const createTransformers = transformerMap => ({
|
|
|
92950
93388
|
const {
|
|
92951
93389
|
key,
|
|
92952
93390
|
value,
|
|
92953
|
-
errors
|
|
93391
|
+
errors,
|
|
93392
|
+
commentsBetweenKeyValue,
|
|
93393
|
+
commentsAfterValue
|
|
92954
93394
|
} = processKeyValuePairChildren(cursor, ctx, transformerMap);
|
|
92955
93395
|
const children = [];
|
|
92956
93396
|
|
|
92957
93397
|
// Handle empty key
|
|
92958
93398
|
if (key === null) {
|
|
92959
|
-
const emptyKey = new
|
|
93399
|
+
const emptyKey = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
92960
93400
|
content: '',
|
|
92961
93401
|
startLine: info.startPosition.row,
|
|
92962
93402
|
startCharacter: info.startPosition.column,
|
|
@@ -92964,12 +93404,12 @@ const createTransformers = transformerMap => ({
|
|
|
92964
93404
|
endLine: info.startPosition.row,
|
|
92965
93405
|
endCharacter: info.startPosition.column,
|
|
92966
93406
|
endOffset: info.startIndex,
|
|
92967
|
-
tag: new
|
|
93407
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
92968
93408
|
explicitName: '?',
|
|
92969
|
-
kind:
|
|
93409
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
92970
93410
|
}),
|
|
92971
|
-
styleGroup:
|
|
92972
|
-
style:
|
|
93411
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93412
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
92973
93413
|
});
|
|
92974
93414
|
children.push(emptyKey);
|
|
92975
93415
|
} else {
|
|
@@ -92978,7 +93418,7 @@ const createTransformers = transformerMap => ({
|
|
|
92978
93418
|
|
|
92979
93419
|
// Handle empty value
|
|
92980
93420
|
if (value === null) {
|
|
92981
|
-
const emptyValue = new
|
|
93421
|
+
const emptyValue = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
92982
93422
|
content: '',
|
|
92983
93423
|
startLine: info.endPosition.row,
|
|
92984
93424
|
startCharacter: info.endPosition.column,
|
|
@@ -92986,22 +93426,37 @@ const createTransformers = transformerMap => ({
|
|
|
92986
93426
|
endLine: info.endPosition.row,
|
|
92987
93427
|
endCharacter: info.endPosition.column,
|
|
92988
93428
|
endOffset: info.endIndex,
|
|
92989
|
-
tag: new
|
|
93429
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
92990
93430
|
explicitName: '?',
|
|
92991
|
-
kind:
|
|
93431
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
92992
93432
|
}),
|
|
92993
|
-
styleGroup:
|
|
92994
|
-
style:
|
|
93433
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93434
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
92995
93435
|
});
|
|
92996
93436
|
children.push(emptyValue);
|
|
92997
93437
|
} else {
|
|
92998
93438
|
children.push(value);
|
|
92999
93439
|
}
|
|
93440
|
+
|
|
93441
|
+
// attach comments found between key and value to the value node
|
|
93442
|
+
if (commentsBetweenKeyValue.length > 0) {
|
|
93443
|
+
const valueNode = findYamlNode(value);
|
|
93444
|
+
if (valueNode) {
|
|
93445
|
+
valueNode.commentBefore = commentsBetweenKeyValue.join('\n');
|
|
93446
|
+
}
|
|
93447
|
+
}
|
|
93448
|
+
// attach comments found after value to the value node
|
|
93449
|
+
if (commentsAfterValue.length > 0) {
|
|
93450
|
+
const valueNode = findYamlNode(value);
|
|
93451
|
+
if (valueNode) {
|
|
93452
|
+
valueNode.comment = commentsAfterValue.join('\n');
|
|
93453
|
+
}
|
|
93454
|
+
}
|
|
93000
93455
|
children.push(...errors);
|
|
93001
|
-
return new
|
|
93456
|
+
return new _ast_nodes_YamlKeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
93002
93457
|
children: children.flat().filter(c => c !== null),
|
|
93003
93458
|
...toPositionProps(info),
|
|
93004
|
-
styleGroup:
|
|
93459
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93005
93460
|
isMissing: info.isMissing
|
|
93006
93461
|
});
|
|
93007
93462
|
},
|
|
@@ -93010,13 +93465,13 @@ const createTransformers = transformerMap => ({
|
|
|
93010
93465
|
const tag = toYamlTag(info, siblings.tag);
|
|
93011
93466
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
93012
93467
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
93013
|
-
const sequenceNode = new
|
|
93468
|
+
const sequenceNode = new _ast_nodes_YamlSequence_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]({
|
|
93014
93469
|
children: children.flat(Infinity).filter(c => c !== null),
|
|
93015
93470
|
...toPositionProps(info),
|
|
93016
93471
|
anchor,
|
|
93017
93472
|
tag,
|
|
93018
|
-
styleGroup:
|
|
93019
|
-
style:
|
|
93473
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
93474
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.NextLine
|
|
93020
93475
|
});
|
|
93021
93476
|
registerAnchor(sequenceNode, ctx);
|
|
93022
93477
|
return ctx.schema.resolve(sequenceNode);
|
|
@@ -93027,11 +93482,11 @@ const createTransformers = transformerMap => ({
|
|
|
93027
93482
|
|
|
93028
93483
|
// If only one child (the "-" literal), create empty node
|
|
93029
93484
|
if (children.length === 0) {
|
|
93030
|
-
const emptyScalarNode = new
|
|
93485
|
+
const emptyScalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
93031
93486
|
content: '',
|
|
93032
|
-
tag: new
|
|
93487
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
93033
93488
|
explicitName: '?',
|
|
93034
|
-
kind:
|
|
93489
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
93035
93490
|
}),
|
|
93036
93491
|
startLine: info.endPosition.row,
|
|
93037
93492
|
startCharacter: info.endPosition.column,
|
|
@@ -93039,8 +93494,8 @@ const createTransformers = transformerMap => ({
|
|
|
93039
93494
|
endLine: info.endPosition.row,
|
|
93040
93495
|
endCharacter: info.endPosition.column,
|
|
93041
93496
|
endOffset: info.endIndex,
|
|
93042
|
-
styleGroup:
|
|
93043
|
-
style:
|
|
93497
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93498
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
93044
93499
|
});
|
|
93045
93500
|
return [emptyScalarNode];
|
|
93046
93501
|
}
|
|
@@ -93051,13 +93506,13 @@ const createTransformers = transformerMap => ({
|
|
|
93051
93506
|
const tag = toYamlTag(info, siblings.tag);
|
|
93052
93507
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
93053
93508
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
93054
|
-
const sequenceNode = new
|
|
93509
|
+
const sequenceNode = new _ast_nodes_YamlSequence_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]({
|
|
93055
93510
|
children: children.flat().filter(c => c !== null),
|
|
93056
93511
|
...toPositionProps(info),
|
|
93057
93512
|
anchor,
|
|
93058
93513
|
tag,
|
|
93059
|
-
styleGroup:
|
|
93060
|
-
style:
|
|
93514
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93515
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Explicit
|
|
93061
93516
|
});
|
|
93062
93517
|
registerAnchor(sequenceNode, ctx);
|
|
93063
93518
|
return ctx.schema.resolve(sequenceNode);
|
|
@@ -93066,14 +93521,15 @@ const createTransformers = transformerMap => ({
|
|
|
93066
93521
|
const info = getCursorInfo(cursor);
|
|
93067
93522
|
const tag = toYamlTag(info, siblings.tag);
|
|
93068
93523
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
93069
|
-
const scalarNode = new
|
|
93524
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
93070
93525
|
content: info.text,
|
|
93071
93526
|
anchor,
|
|
93072
93527
|
tag,
|
|
93073
93528
|
...toPositionProps(info),
|
|
93074
|
-
styleGroup:
|
|
93075
|
-
style:
|
|
93529
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93530
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
93076
93531
|
});
|
|
93532
|
+
scalarNode.rawContent = info.text;
|
|
93077
93533
|
registerAnchor(scalarNode, ctx);
|
|
93078
93534
|
return ctx.schema.resolve(scalarNode);
|
|
93079
93535
|
},
|
|
@@ -93081,14 +93537,15 @@ const createTransformers = transformerMap => ({
|
|
|
93081
93537
|
const info = getCursorInfo(cursor);
|
|
93082
93538
|
const tag = toYamlTag(info, siblings.tag);
|
|
93083
93539
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
93084
|
-
const scalarNode = new
|
|
93540
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
93085
93541
|
content: info.text,
|
|
93086
93542
|
anchor,
|
|
93087
93543
|
tag,
|
|
93088
93544
|
...toPositionProps(info),
|
|
93089
|
-
styleGroup:
|
|
93090
|
-
style:
|
|
93545
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93546
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.SingleQuoted
|
|
93091
93547
|
});
|
|
93548
|
+
scalarNode.rawContent = info.text;
|
|
93092
93549
|
registerAnchor(scalarNode, ctx);
|
|
93093
93550
|
return ctx.schema.resolve(scalarNode);
|
|
93094
93551
|
},
|
|
@@ -93096,14 +93553,15 @@ const createTransformers = transformerMap => ({
|
|
|
93096
93553
|
const info = getCursorInfo(cursor);
|
|
93097
93554
|
const tag = toYamlTag(info, siblings.tag);
|
|
93098
93555
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
93099
|
-
const scalarNode = new
|
|
93556
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
93100
93557
|
content: info.text,
|
|
93101
93558
|
anchor,
|
|
93102
93559
|
tag,
|
|
93103
93560
|
...toPositionProps(info),
|
|
93104
|
-
styleGroup:
|
|
93105
|
-
style:
|
|
93561
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
93562
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.DoubleQuoted
|
|
93106
93563
|
});
|
|
93564
|
+
scalarNode.rawContent = info.text;
|
|
93107
93565
|
registerAnchor(scalarNode, ctx);
|
|
93108
93566
|
return ctx.schema.resolve(scalarNode);
|
|
93109
93567
|
},
|
|
@@ -93111,27 +93569,29 @@ const createTransformers = transformerMap => ({
|
|
|
93111
93569
|
const info = getCursorInfo(cursor);
|
|
93112
93570
|
const tag = toYamlTag(info, siblings.tag);
|
|
93113
93571
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
93114
|
-
const style = info.text.startsWith('|') ?
|
|
93115
|
-
const scalarNode = new
|
|
93572
|
+
const style = info.text.startsWith('|') ? _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Literal : info.text.startsWith('>') ? _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Folded : _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain;
|
|
93573
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
93116
93574
|
content: info.text,
|
|
93117
93575
|
anchor,
|
|
93118
93576
|
tag,
|
|
93119
93577
|
...toPositionProps(info),
|
|
93120
|
-
styleGroup:
|
|
93578
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
93121
93579
|
style
|
|
93122
93580
|
});
|
|
93581
|
+
scalarNode.rawContent = info.text;
|
|
93123
93582
|
registerAnchor(scalarNode, ctx);
|
|
93124
93583
|
return ctx.schema.resolve(scalarNode);
|
|
93125
93584
|
},
|
|
93126
93585
|
comment(cursor) {
|
|
93127
93586
|
const info = getCursorInfo(cursor);
|
|
93128
|
-
return new
|
|
93129
|
-
content: info.text
|
|
93587
|
+
return new _ast_nodes_YamlComment_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
93588
|
+
content: info.text,
|
|
93589
|
+
...toPositionProps(info)
|
|
93130
93590
|
});
|
|
93131
93591
|
},
|
|
93132
93592
|
alias(cursor, ctx) {
|
|
93133
93593
|
const info = getCursorInfo(cursor);
|
|
93134
|
-
const alias = new
|
|
93594
|
+
const alias = new _ast_nodes_YamlAlias_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]({
|
|
93135
93595
|
content: info.text
|
|
93136
93596
|
});
|
|
93137
93597
|
return ctx.referenceManager.resolveAlias(alias);
|
|
@@ -93213,6 +93673,147 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
93213
93673
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"].transfer(node, element);
|
|
93214
93674
|
};
|
|
93215
93675
|
|
|
93676
|
+
// find the first descendant matching a type path through the AST
|
|
93677
|
+
const findFirst = (node, path) => {
|
|
93678
|
+
if (path.length === 0) return node;
|
|
93679
|
+
const [type, ...rest] = path;
|
|
93680
|
+
for (const child of node.children || []) {
|
|
93681
|
+
if (child.type !== type) continue;
|
|
93682
|
+
const found = findFirst(child, rest);
|
|
93683
|
+
if (found) return found;
|
|
93684
|
+
}
|
|
93685
|
+
return undefined;
|
|
93686
|
+
};
|
|
93687
|
+
|
|
93688
|
+
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
93689
|
+
const detectIndent = node => {
|
|
93690
|
+
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
93691
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_9__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
93692
|
+
return nested.startCharacter;
|
|
93693
|
+
}
|
|
93694
|
+
return 2;
|
|
93695
|
+
};
|
|
93696
|
+
|
|
93697
|
+
// strip leading '#' from each line of comment text; yaml library adds '#' during stringification
|
|
93698
|
+
const stripCommentHash = text => text.split('\n').map(line => line.replace(/^#/, '')).join('\n');
|
|
93699
|
+
|
|
93700
|
+
// collect comment texts from raw AST children, indexed by position relative to non-comment siblings
|
|
93701
|
+
|
|
93702
|
+
// is the comment on the same line as the previous non-comment sibling?
|
|
93703
|
+
const isInlineComment = (child, lastEndLine, pending) => {
|
|
93704
|
+
return pending.length === 0 && lastEndLine !== undefined && child.startLine === lastEndLine;
|
|
93705
|
+
};
|
|
93706
|
+
|
|
93707
|
+
/**
|
|
93708
|
+
* @param children - raw AST children of a mapping/sequence
|
|
93709
|
+
* @param containerStartCol - the start column of the container node;
|
|
93710
|
+
* trailing comments whose startCharacter is less than this are out-of-scope
|
|
93711
|
+
* (tree-sitter may place them inside a nested block they don't belong to)
|
|
93712
|
+
*/
|
|
93713
|
+
const collectComments = (children, containerStartCol) => {
|
|
93714
|
+
const before = new Map();
|
|
93715
|
+
const after = new Map();
|
|
93716
|
+
const pending = [];
|
|
93717
|
+
let lastNonCommentEndLine;
|
|
93718
|
+
let elementIdx = 0;
|
|
93719
|
+
for (const child of children) {
|
|
93720
|
+
if (child?.type === 'comment') {
|
|
93721
|
+
const text = stripCommentHash(child.content || '');
|
|
93722
|
+
if (elementIdx > 0 && isInlineComment(child, lastNonCommentEndLine, pending)) {
|
|
93723
|
+
after.set(elementIdx - 1, text);
|
|
93724
|
+
} else {
|
|
93725
|
+
pending.push({
|
|
93726
|
+
text,
|
|
93727
|
+
startLine: child.startLine,
|
|
93728
|
+
startCharacter: child.startCharacter
|
|
93729
|
+
});
|
|
93730
|
+
}
|
|
93731
|
+
continue;
|
|
93732
|
+
}
|
|
93733
|
+
|
|
93734
|
+
// non-comment node: attach any pending comments as commentBefore
|
|
93735
|
+
if (pending.length > 0) {
|
|
93736
|
+
before.set(elementIdx, pending.map(c => c.text).join('\n'));
|
|
93737
|
+
pending.length = 0;
|
|
93738
|
+
}
|
|
93739
|
+
lastNonCommentEndLine = child.endLine;
|
|
93740
|
+
elementIdx++;
|
|
93741
|
+
}
|
|
93742
|
+
|
|
93743
|
+
// remaining pending comments are trailing — split into in-scope and out-of-scope
|
|
93744
|
+
let trailing = null;
|
|
93745
|
+
const outOfScope = [];
|
|
93746
|
+
for (const c of pending) {
|
|
93747
|
+
if (containerStartCol !== undefined && c.startCharacter !== undefined && c.startCharacter < containerStartCol) {
|
|
93748
|
+
outOfScope.push(c.text);
|
|
93749
|
+
} else {
|
|
93750
|
+
trailing = trailing ? `${trailing}\n${c.text}` : c.text;
|
|
93751
|
+
}
|
|
93752
|
+
}
|
|
93753
|
+
return {
|
|
93754
|
+
before,
|
|
93755
|
+
after,
|
|
93756
|
+
trailing,
|
|
93757
|
+
outOfScope
|
|
93758
|
+
};
|
|
93759
|
+
};
|
|
93760
|
+
|
|
93761
|
+
// set a yaml style property on an element, initializing style.yaml if needed
|
|
93762
|
+
const setYamlStyleProp = (element, key, value) => {
|
|
93763
|
+
if (!element.style) element.style = {};
|
|
93764
|
+
const yaml = element.style.yaml ?? {};
|
|
93765
|
+
yaml[key] = value;
|
|
93766
|
+
element.style.yaml = yaml;
|
|
93767
|
+
};
|
|
93768
|
+
|
|
93769
|
+
// apply collected comments to transformed ApiDOM elements
|
|
93770
|
+
const applyComments = (elements, comments) => {
|
|
93771
|
+
comments.before.forEach((text, idx) => {
|
|
93772
|
+
if (elements[idx]) setYamlStyleProp(elements[idx], 'commentBefore', text);
|
|
93773
|
+
});
|
|
93774
|
+
comments.after.forEach((text, idx) => {
|
|
93775
|
+
if (elements[idx]) setYamlStyleProp(elements[idx], 'comment', text);
|
|
93776
|
+
});
|
|
93777
|
+
};
|
|
93778
|
+
|
|
93779
|
+
// detect flow collection padding from node positions
|
|
93780
|
+
// gap of 1 between container start and first child start → no padding: [x
|
|
93781
|
+
// gap of 2+ → padding: [ x
|
|
93782
|
+
// gap of 1 between container start and first child start → no padding: {x
|
|
93783
|
+
// gap of 2+ → padding: { x
|
|
93784
|
+
const detectFlowPadding = node => {
|
|
93785
|
+
const firstChild = (node.children || [])[0];
|
|
93786
|
+
if (firstChild && typeof node.startCharacter === 'number' && typeof firstChild.startCharacter === 'number') {
|
|
93787
|
+
return firstChild.startCharacter - node.startCharacter > 1;
|
|
93788
|
+
}
|
|
93789
|
+
return true;
|
|
93790
|
+
};
|
|
93791
|
+
|
|
93792
|
+
// build yaml style object for an element
|
|
93793
|
+
const buildYamlStyle = (node, ctx, extras) => {
|
|
93794
|
+
const yamlStyle = {
|
|
93795
|
+
styleGroup: node.styleGroup,
|
|
93796
|
+
indent: ctx.indent
|
|
93797
|
+
};
|
|
93798
|
+
if (ctx.flowCollectionPadding !== null) {
|
|
93799
|
+
yamlStyle.flowCollectionPadding = ctx.flowCollectionPadding;
|
|
93800
|
+
}
|
|
93801
|
+
if (node.comment) {
|
|
93802
|
+
yamlStyle.comment = node.comment;
|
|
93803
|
+
}
|
|
93804
|
+
if (node.commentBefore) {
|
|
93805
|
+
yamlStyle.commentBefore = node.commentBefore;
|
|
93806
|
+
}
|
|
93807
|
+
if (extras) {
|
|
93808
|
+
for (const [key, value] of Object.entries(extras)) {
|
|
93809
|
+
if (value !== undefined) yamlStyle[key] = value;
|
|
93810
|
+
}
|
|
93811
|
+
}
|
|
93812
|
+
return {
|
|
93813
|
+
yaml: yamlStyle
|
|
93814
|
+
};
|
|
93815
|
+
};
|
|
93816
|
+
|
|
93216
93817
|
// Transform a single node based on its type
|
|
93217
93818
|
const transform = (node, ctx) => {
|
|
93218
93819
|
if (node === null || node === undefined) {
|
|
@@ -93248,22 +93849,58 @@ const transform = (node, ctx) => {
|
|
|
93248
93849
|
// Transform children array and flatten results
|
|
93249
93850
|
const transformChildren = (children, ctx) => {
|
|
93250
93851
|
const results = [];
|
|
93852
|
+
let pendingPromoted = [];
|
|
93251
93853
|
for (const child of children) {
|
|
93252
93854
|
const result = transform(child, ctx);
|
|
93253
93855
|
if (result === null) {
|
|
93856
|
+
// collect any promoted comments generated during this null transform
|
|
93857
|
+
if (ctx.style && ctx.promotedComments.length > 0) {
|
|
93858
|
+
pendingPromoted.push(...ctx.promotedComments);
|
|
93859
|
+
ctx.promotedComments = [];
|
|
93860
|
+
}
|
|
93254
93861
|
continue;
|
|
93255
93862
|
}
|
|
93863
|
+
|
|
93864
|
+
// apply promoted comments from PREVIOUS children as commentBefore on this element
|
|
93865
|
+
if (ctx.style && pendingPromoted.length > 0) {
|
|
93866
|
+
const target = Array.isArray(result) ? result[0] : result;
|
|
93867
|
+
if (target) {
|
|
93868
|
+
if (!target.style) target.style = {};
|
|
93869
|
+
const yaml = target.style.yaml ?? {};
|
|
93870
|
+
const existing = yaml.commentBefore;
|
|
93871
|
+
const promoted = pendingPromoted.join('\n');
|
|
93872
|
+
yaml.commentBefore = existing ? `${promoted}\n${existing}` : promoted;
|
|
93873
|
+
target.style.yaml = yaml;
|
|
93874
|
+
}
|
|
93875
|
+
pendingPromoted = [];
|
|
93876
|
+
}
|
|
93877
|
+
|
|
93878
|
+
// collect any promoted comments generated by this child's transform
|
|
93879
|
+
// (these will be applied to the NEXT sibling)
|
|
93880
|
+
if (ctx.style && ctx.promotedComments.length > 0) {
|
|
93881
|
+
pendingPromoted.push(...ctx.promotedComments);
|
|
93882
|
+
ctx.promotedComments = [];
|
|
93883
|
+
}
|
|
93256
93884
|
if (Array.isArray(result)) {
|
|
93257
93885
|
results.push(...result);
|
|
93258
93886
|
} else {
|
|
93259
93887
|
results.push(result);
|
|
93260
93888
|
}
|
|
93261
93889
|
}
|
|
93890
|
+
|
|
93891
|
+
// if promoted comments remain after all children, propagate up to parent scope
|
|
93892
|
+
if (pendingPromoted.length > 0) {
|
|
93893
|
+
ctx.promotedComments.push(...pendingPromoted);
|
|
93894
|
+
}
|
|
93262
93895
|
return results;
|
|
93263
93896
|
};
|
|
93264
93897
|
|
|
93265
93898
|
// Stream: Wraps transformed children in ParseResultElement
|
|
93266
93899
|
const transformStream = (node, ctx) => {
|
|
93900
|
+
// detect indent from the stream structure (only needed for style preservation)
|
|
93901
|
+
if (ctx.style) {
|
|
93902
|
+
ctx.indent = detectIndent(node);
|
|
93903
|
+
}
|
|
93267
93904
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
93268
93905
|
|
|
93269
93906
|
// Transform all children
|
|
@@ -93309,12 +93946,35 @@ const transformDocument = (node, ctx) => {
|
|
|
93309
93946
|
return transformChildren(node.children || [], ctx);
|
|
93310
93947
|
};
|
|
93311
93948
|
|
|
93949
|
+
// shared logic for transformMapping and transformSequence
|
|
93950
|
+
const transformCollection = (element, node, ctx) => {
|
|
93951
|
+
const typedNode = node;
|
|
93952
|
+
const children = node.children || [];
|
|
93953
|
+
if (ctx.style) {
|
|
93954
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_9__.YamlStyleGroup.Flow) {
|
|
93955
|
+
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
93956
|
+
}
|
|
93957
|
+
const comments = collectComments(children, typedNode.startCharacter);
|
|
93958
|
+
const childElements = transformChildren(children, ctx);
|
|
93959
|
+
// bypass content setter to avoid re-refracting already-transformed elements
|
|
93960
|
+
element._content = childElements; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
93961
|
+
applyComments(childElements, comments);
|
|
93962
|
+
element.style = buildYamlStyle(node, ctx, {
|
|
93963
|
+
comment: comments.trailing
|
|
93964
|
+
});
|
|
93965
|
+
if (comments.outOfScope.length > 0) {
|
|
93966
|
+
ctx.promotedComments.push(...comments.outOfScope);
|
|
93967
|
+
}
|
|
93968
|
+
} else {
|
|
93969
|
+
element._content = transformChildren(children, ctx); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
93970
|
+
}
|
|
93971
|
+
maybeAddSourceMap(typedNode, element, ctx);
|
|
93972
|
+
};
|
|
93973
|
+
|
|
93312
93974
|
// Mapping: Transforms to ObjectElement
|
|
93313
93975
|
const transformMapping = (node, ctx) => {
|
|
93314
93976
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
93315
|
-
|
|
93316
|
-
element._content = transformChildren(node.children || [], ctx);
|
|
93317
|
-
maybeAddSourceMap(node, element, ctx);
|
|
93977
|
+
transformCollection(element, node, ctx);
|
|
93318
93978
|
return element;
|
|
93319
93979
|
};
|
|
93320
93980
|
|
|
@@ -93348,9 +94008,7 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
93348
94008
|
// Sequence: Transforms to ArrayElement
|
|
93349
94009
|
const transformSequence = (node, ctx) => {
|
|
93350
94010
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
93351
|
-
|
|
93352
|
-
element._content = transformChildren(node.children || [], ctx);
|
|
93353
|
-
maybeAddSourceMap(node, element, ctx);
|
|
94011
|
+
transformCollection(element, node, ctx);
|
|
93354
94012
|
return element;
|
|
93355
94013
|
};
|
|
93356
94014
|
|
|
@@ -93363,6 +94021,15 @@ const transformScalar = (node, ctx) => {
|
|
|
93363
94021
|
element.classes.push('yaml-e-node');
|
|
93364
94022
|
element.classes.push('yaml-e-scalar');
|
|
93365
94023
|
}
|
|
94024
|
+
if (ctx.style) {
|
|
94025
|
+
const extras = {
|
|
94026
|
+
scalarStyle: node.style
|
|
94027
|
+
};
|
|
94028
|
+
if (node.rawContent !== undefined) {
|
|
94029
|
+
extras.rawContent = node.rawContent;
|
|
94030
|
+
}
|
|
94031
|
+
element.style = buildYamlStyle(node, ctx, extras);
|
|
94032
|
+
}
|
|
93366
94033
|
maybeAddSourceMap(node, element, ctx);
|
|
93367
94034
|
return element;
|
|
93368
94035
|
};
|
|
@@ -93427,13 +94094,18 @@ const transformRootError = (node, ctx) => {
|
|
|
93427
94094
|
* @public
|
|
93428
94095
|
*/
|
|
93429
94096
|
const transformYamlAstToApiDOM = (yamlAst, {
|
|
93430
|
-
sourceMap = false
|
|
94097
|
+
sourceMap = false,
|
|
94098
|
+
style = false
|
|
93431
94099
|
} = {}) => {
|
|
93432
94100
|
const ctx = {
|
|
93433
94101
|
sourceMap,
|
|
94102
|
+
style,
|
|
93434
94103
|
namespace: new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__["default"](),
|
|
93435
94104
|
annotations: [],
|
|
93436
|
-
processedDocumentCount: 0
|
|
94105
|
+
processedDocumentCount: 0,
|
|
94106
|
+
indent: 2,
|
|
94107
|
+
flowCollectionPadding: null,
|
|
94108
|
+
promotedComments: []
|
|
93437
94109
|
};
|
|
93438
94110
|
const rootNode = yamlAst.rootNode;
|
|
93439
94111
|
|
|
@@ -94032,6 +94704,8 @@ class YamlNode extends _Node_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
94032
94704
|
tag;
|
|
94033
94705
|
style;
|
|
94034
94706
|
styleGroup;
|
|
94707
|
+
comment;
|
|
94708
|
+
commentBefore;
|
|
94035
94709
|
constructor({
|
|
94036
94710
|
anchor,
|
|
94037
94711
|
tag,
|
|
@@ -94071,6 +94745,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
94071
94745
|
class YamlScalar extends _YamlNode_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
94072
94746
|
static type = 'scalar';
|
|
94073
94747
|
content;
|
|
94748
|
+
rawContent;
|
|
94074
94749
|
constructor({
|
|
94075
94750
|
content,
|
|
94076
94751
|
...rest
|
|
@@ -94868,7 +95543,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
94868
95543
|
* @public
|
|
94869
95544
|
*/
|
|
94870
95545
|
const analyze = (cst, {
|
|
94871
|
-
sourceMap = false
|
|
95546
|
+
sourceMap = false,
|
|
95547
|
+
style = false
|
|
94872
95548
|
} = {}) => {
|
|
94873
95549
|
const cursor = cst.walk();
|
|
94874
95550
|
const schema = new _ast_schemas_json_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]();
|
|
@@ -94883,7 +95559,8 @@ const analyze = (cst, {
|
|
|
94883
95559
|
|
|
94884
95560
|
// Pass 2: YAML AST -> ApiDOM (direct transformation)
|
|
94885
95561
|
return (0,_YamlAstTransformer_mjs__WEBPACK_IMPORTED_MODULE_3__.transformYamlAstToApiDOM)(yamlAst, {
|
|
94886
|
-
sourceMap
|
|
95562
|
+
sourceMap,
|
|
95563
|
+
style
|
|
94887
95564
|
});
|
|
94888
95565
|
};
|
|
94889
95566
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
|