@speclynx/apidom-parser-adapter-openapi-json-2 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.
@@ -11151,6 +11151,53 @@ var both = /*#__PURE__*/(0,_internal_curry2_js__WEBPACK_IMPORTED_MODULE_0__["def
11151
11151
 
11152
11152
  /***/ },
11153
11153
 
11154
+ /***/ 8138
11155
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
11156
+
11157
+ "use strict";
11158
+ __webpack_require__.r(__webpack_exports__);
11159
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11160
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11161
+ /* harmony export */ });
11162
+ /* harmony import */ var _internal_clone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8575);
11163
+ /* harmony import */ var _internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8938);
11164
+
11165
+
11166
+
11167
+ /**
11168
+ * Creates a deep copy of the source that can be used in place of the source
11169
+ * object without retaining any references to it.
11170
+ * The source object may contain (nested) `Array`s and `Object`s,
11171
+ * `Number`s, `String`s, `Boolean`s and `Date`s.
11172
+ * `Function`s are assigned by reference rather than copied.
11173
+ *
11174
+ * Dispatches to a `clone` method if present.
11175
+ *
11176
+ * Note that if the source object has multiple nodes that share a reference,
11177
+ * the returned object will have the same structure, but the references will
11178
+ * be pointed to the location within the cloned value.
11179
+ *
11180
+ * @func
11181
+ * @memberOf R
11182
+ * @since v0.1.0
11183
+ * @category Object
11184
+ * @sig {*} -> {*}
11185
+ * @param {*} value The object or array to clone
11186
+ * @return {*} A deeply cloned copy of `val`
11187
+ * @example
11188
+ *
11189
+ * const objects = [{}, {}, {}];
11190
+ * const objectsClone = R.clone(objects);
11191
+ * objects === objectsClone; //=> false
11192
+ * objects[0] === objectsClone[0]; //=> false
11193
+ */
11194
+ var clone = /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function clone(value) {
11195
+ return value != null && typeof value.clone === 'function' ? value.clone() : (0,_internal_clone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, true);
11196
+ });
11197
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
11198
+
11199
+ /***/ },
11200
+
11154
11201
  /***/ 8199
11155
11202
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
11156
11203
 
@@ -12447,6 +12494,132 @@ function _checkForMethod(methodname, fn) {
12447
12494
 
12448
12495
  /***/ },
12449
12496
 
12497
+ /***/ 8575
12498
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12499
+
12500
+ "use strict";
12501
+ __webpack_require__.r(__webpack_exports__);
12502
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12503
+ /* harmony export */ "default": () => (/* binding */ _clone)
12504
+ /* harmony export */ });
12505
+ /* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1254);
12506
+ /* harmony import */ var _type_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(963);
12507
+
12508
+
12509
+
12510
+ /**
12511
+ * Copies an object.
12512
+ *
12513
+ * @private
12514
+ * @param {*} value The value to be copied
12515
+ * @param {Boolean} deep Whether or not to perform deep cloning.
12516
+ * @return {*} The copied value.
12517
+ */
12518
+ function _clone(value, deep, map) {
12519
+ map || (map = new _ObjectMap());
12520
+
12521
+ // this avoids the slower switch with a quick if decision removing some milliseconds in each run.
12522
+ if (_isPrimitive(value)) {
12523
+ return value;
12524
+ }
12525
+ var copy = function copy(copiedValue) {
12526
+ // Check for circular and same references on the object graph and return its corresponding clone.
12527
+ var cachedCopy = map.get(value);
12528
+ if (cachedCopy) {
12529
+ return cachedCopy;
12530
+ }
12531
+ map.set(value, copiedValue);
12532
+ for (var key in value) {
12533
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
12534
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
12535
+ }
12536
+ }
12537
+ return copiedValue;
12538
+ };
12539
+ switch ((0,_type_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
12540
+ case 'Object':
12541
+ return copy(Object.create(Object.getPrototypeOf(value)));
12542
+ case 'Array':
12543
+ return copy(Array(value.length));
12544
+ case 'Date':
12545
+ return new Date(value.valueOf());
12546
+ case 'RegExp':
12547
+ return (0,_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
12548
+ case 'Int8Array':
12549
+ case 'Uint8Array':
12550
+ case 'Uint8ClampedArray':
12551
+ case 'Int16Array':
12552
+ case 'Uint16Array':
12553
+ case 'Int32Array':
12554
+ case 'Uint32Array':
12555
+ case 'Float32Array':
12556
+ case 'Float64Array':
12557
+ case 'BigInt64Array':
12558
+ case 'BigUint64Array':
12559
+ return value.slice();
12560
+ default:
12561
+ return value;
12562
+ }
12563
+ }
12564
+ function _isPrimitive(param) {
12565
+ var type = typeof param;
12566
+ return param == null || type != 'object' && type != 'function';
12567
+ }
12568
+ var _ObjectMap = /*#__PURE__*/function () {
12569
+ function _ObjectMap() {
12570
+ this.map = {};
12571
+ this.length = 0;
12572
+ }
12573
+ _ObjectMap.prototype.set = function (key, value) {
12574
+ var hashedKey = this.hash(key);
12575
+ var bucket = this.map[hashedKey];
12576
+ if (!bucket) {
12577
+ this.map[hashedKey] = bucket = [];
12578
+ }
12579
+ bucket.push([key, value]);
12580
+ this.length += 1;
12581
+ };
12582
+ _ObjectMap.prototype.hash = function (key) {
12583
+ var hashedKey = [];
12584
+ for (var value in key) {
12585
+ hashedKey.push(Object.prototype.toString.call(key[value]));
12586
+ }
12587
+ return hashedKey.join();
12588
+ };
12589
+ _ObjectMap.prototype.get = function (key) {
12590
+ /**
12591
+ * 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,
12592
+ * on my tests this number is 180, anything above that using the hash function is faster.
12593
+ */
12594
+ if (this.length <= 180) {
12595
+ for (var p in this.map) {
12596
+ var bucket = this.map[p];
12597
+ for (var i = 0; i < bucket.length; i += 1) {
12598
+ var element = bucket[i];
12599
+ if (element[0] === key) {
12600
+ return element[1];
12601
+ }
12602
+ }
12603
+ }
12604
+ return;
12605
+ }
12606
+ var hashedKey = this.hash(key);
12607
+ var bucket = this.map[hashedKey];
12608
+ if (!bucket) {
12609
+ return;
12610
+ }
12611
+ for (var i = 0; i < bucket.length; i += 1) {
12612
+ var element = bucket[i];
12613
+ if (element[0] === key) {
12614
+ return element[1];
12615
+ }
12616
+ }
12617
+ };
12618
+ return _ObjectMap;
12619
+ }();
12620
+
12621
+ /***/ },
12622
+
12450
12623
  /***/ 1254
12451
12624
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12452
12625
 
@@ -20131,6 +20304,7 @@ const predicates = {
20131
20304
  isCommentElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isCommentElement,
20132
20305
  isParseResultElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement,
20133
20306
  isSourceMapElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isSourceMapElement,
20307
+ hasElementStyle: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementStyle,
20134
20308
  hasElementSourceMap: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap,
20135
20309
  includesSymbols: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesSymbols,
20136
20310
  includesClasses: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses
@@ -20202,7 +20376,19 @@ const resolveSpecification = specification => {
20202
20376
  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)) {
20203
20377
  const $ref = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(['$ref'], val);
20204
20378
  const pointer = (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_6__["default"])('#/', $ref);
20205
- return (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(pointer.split('/'), root);
20379
+ const resolved = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(pointer.split('/'), root);
20380
+ // merge extra properties (e.g. alias) from the $ref object into the resolved value
20381
+ const {
20382
+ $ref: _,
20383
+ ...rest
20384
+ } = val;
20385
+ if (Object.keys(rest).length > 0 && (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(resolved)) {
20386
+ return {
20387
+ ...resolved,
20388
+ ...rest
20389
+ };
20390
+ }
20391
+ return resolved;
20206
20392
  }
20207
20393
  if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(val)) {
20208
20394
  return traverse(val, root, newPath);
@@ -20825,20 +21011,22 @@ class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["de
20825
21011
  "use strict";
20826
21012
  __webpack_require__.r(__webpack_exports__);
20827
21013
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20828
- /* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
20829
- /* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]),
20830
- /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
21014
+ /* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
21015
+ /* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
21016
+ /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
20831
21017
  /* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
20832
21018
  /* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
20833
21019
  /* harmony export */ });
20834
- /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8504);
20835
- /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6663);
20836
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8252);
20837
- /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5162);
20838
- /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5810);
20839
- /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5018);
20840
- /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3686);
20841
- /* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3772);
21020
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
21021
+ /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8504);
21022
+ /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6663);
21023
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8252);
21024
+ /* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5162);
21025
+ /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5810);
21026
+ /* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5018);
21027
+ /* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3686);
21028
+ /* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3772);
21029
+
20842
21030
 
20843
21031
 
20844
21032
 
@@ -20871,9 +21059,9 @@ const cloneDeepElement = (element, options) => {
20871
21059
  } = element;
20872
21060
  if (Array.isArray(content)) {
20873
21061
  copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
20874
- } else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(content)) {
21062
+ } else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
20875
21063
  copy.content = cloneDeepElement(content, passThroughOptions);
20876
- } else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
21064
+ } else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
20877
21065
  copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
20878
21066
  } else {
20879
21067
  copy.content = content;
@@ -20897,7 +21085,7 @@ const cloneDeepKeyValuePair = (kvp, options) => {
20897
21085
  } = kvp;
20898
21086
  const keyCopy = key !== undefined ? cloneDeepElement(key, passThroughOptions) : undefined;
20899
21087
  const valueCopy = value !== undefined ? cloneDeepElement(value, passThroughOptions) : undefined;
20900
- const copy = new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](keyCopy, valueCopy);
21088
+ const copy = new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](keyCopy, valueCopy);
20901
21089
  visited.set(kvp, copy);
20902
21090
  return copy;
20903
21091
  };
@@ -20913,7 +21101,7 @@ const cloneDeepObjectSlice = (slice, options) => {
20913
21101
  return visited.get(slice);
20914
21102
  }
20915
21103
  const items = [...slice].map(element => cloneDeepElement(element, passThroughOptions));
20916
- const copy = new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](items);
21104
+ const copy = new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](items);
20917
21105
  visited.set(slice, copy);
20918
21106
  return copy;
20919
21107
  };
@@ -20924,16 +21112,16 @@ const cloneDeepObjectSlice = (slice, options) => {
20924
21112
  * @public
20925
21113
  */
20926
21114
  const cloneDeep = (value, options = {}) => {
20927
- if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
21115
+ if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
20928
21116
  return cloneDeepKeyValuePair(value, options);
20929
21117
  }
20930
- if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]) {
21118
+ if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
20931
21119
  return cloneDeepObjectSlice(value, options);
20932
21120
  }
20933
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(value)) {
21121
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
20934
21122
  return cloneDeepElement(value, options);
20935
21123
  }
20936
- throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]("Value provided to cloneDeep function couldn't be cloned", {
21124
+ throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneDeep function couldn't be cloned", {
20937
21125
  value
20938
21126
  });
20939
21127
  };
@@ -20949,11 +21137,11 @@ const cloneShallowKeyValuePair = keyValuePair => {
20949
21137
  key,
20950
21138
  value
20951
21139
  } = keyValuePair;
20952
- return new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](key, value);
21140
+ return new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](key, value);
20953
21141
  };
20954
21142
  const cloneShallowObjectSlice = objectSlice => {
20955
21143
  const items = [...objectSlice];
20956
- return new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](items);
21144
+ return new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](items);
20957
21145
  };
20958
21146
  const cloneShallowElement = element => {
20959
21147
  const Ctor = element.constructor;
@@ -20965,17 +21153,20 @@ const cloneShallowElement = element => {
20965
21153
  if (!element.isAttributesEmpty) {
20966
21154
  copy.attributes = cloneDeep(element.attributes);
20967
21155
  }
20968
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap)(element)) {
20969
- _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_4__["default"].transfer(element, copy);
21156
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementSourceMap)(element)) {
21157
+ _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, copy);
21158
+ }
21159
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementStyle)(element)) {
21160
+ copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
20970
21161
  }
20971
21162
  const {
20972
21163
  content
20973
21164
  } = element;
20974
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(content)) {
21165
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
20975
21166
  copy.content = cloneShallowElement(content);
20976
21167
  } else if (Array.isArray(content)) {
20977
21168
  copy.content = [...content];
20978
- } else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
21169
+ } else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
20979
21170
  copy.content = cloneShallowKeyValuePair(content);
20980
21171
  } else {
20981
21172
  copy.content = content;
@@ -20990,16 +21181,16 @@ const cloneShallowElement = element => {
20990
21181
  * @public
20991
21182
  */
20992
21183
  const cloneShallow = value => {
20993
- if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
21184
+ if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
20994
21185
  return cloneShallowKeyValuePair(value);
20995
21186
  }
20996
- if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]) {
21187
+ if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
20997
21188
  return cloneShallowObjectSlice(value);
20998
21189
  }
20999
- if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isElement)(value)) {
21190
+ if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
21000
21191
  return cloneShallowElement(value);
21001
21192
  }
21002
- throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneShallow function couldn't be cloned", {
21193
+ throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneShallow function couldn't be cloned", {
21003
21194
  value
21004
21195
  });
21005
21196
  };
@@ -21426,6 +21617,66 @@ function unpackSourceMap(packed) {
21426
21617
 
21427
21618
  /***/ },
21428
21619
 
21620
+ /***/ 9686
21621
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
21622
+
21623
+ "use strict";
21624
+ __webpack_require__.r(__webpack_exports__);
21625
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21626
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
21627
+ /* harmony export */ });
21628
+ /* harmony import */ var _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7071);
21629
+
21630
+ /**
21631
+ * Shape with optional style property.
21632
+ * @public
21633
+ */
21634
+ /**
21635
+ * StyleElement stores format-specific style information for round-trip preservation.
21636
+ *
21637
+ * The style data is stored as a plain object with format-specific namespaces
21638
+ * (e.g., `yaml`, `json`). This element exists only during serialization/deserialization
21639
+ * (refract format) - in memory, style lives directly on `element.style`.
21640
+ *
21641
+ * Follows the same pattern as SourceMapElement with __mappings__.
21642
+ *
21643
+ * @public
21644
+ */
21645
+ class StyleElement extends _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
21646
+ constructor(content, meta, attributes) {
21647
+ super(content, meta, attributes);
21648
+ this.element = '__styles__';
21649
+ }
21650
+
21651
+ /**
21652
+ * Transfers style property from one element to another.
21653
+ */
21654
+ static transfer(from, to) {
21655
+ to.style = from.style;
21656
+ }
21657
+
21658
+ /**
21659
+ * Creates a StyleElement from an element's style property.
21660
+ * Returns undefined if the element has no style.
21661
+ */
21662
+ static from(source) {
21663
+ if (!source.style) {
21664
+ return undefined;
21665
+ }
21666
+ return new StyleElement(source.style);
21667
+ }
21668
+
21669
+ /**
21670
+ * Restores the style property on the target element from this StyleElement.
21671
+ */
21672
+ applyTo(target) {
21673
+ target.style = this.toValue();
21674
+ }
21675
+ }
21676
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StyleElement);
21677
+
21678
+ /***/ },
21679
+
21429
21680
  /***/ 6911
21430
21681
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
21431
21682
 
@@ -21490,6 +21741,7 @@ const isSourceMapElement = element => element instanceof _elements_SourceMap_mjs
21490
21741
  __webpack_require__.r(__webpack_exports__);
21491
21742
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21492
21743
  /* harmony export */ hasElementSourceMap: () => (/* binding */ hasElementSourceMap),
21744
+ /* harmony export */ hasElementStyle: () => (/* binding */ hasElementStyle),
21493
21745
  /* harmony export */ includesClasses: () => (/* binding */ includesClasses),
21494
21746
  /* harmony export */ includesSymbols: () => (/* binding */ includesSymbols),
21495
21747
  /* harmony export */ isAnnotationElement: () => (/* reexport safe */ _elements_mjs__WEBPACK_IMPORTED_MODULE_1__.isAnnotationElement),
@@ -21514,6 +21766,14 @@ __webpack_require__.r(__webpack_exports__);
21514
21766
 
21515
21767
 
21516
21768
 
21769
+ /**
21770
+ * Checks if an element has format-specific style information.
21771
+ * @public
21772
+ */
21773
+ const hasElementStyle = element => {
21774
+ return element.style !== undefined;
21775
+ };
21776
+
21517
21777
  /**
21518
21778
  * Checks if an element has complete source position information.
21519
21779
  * Returns true only if all 6 position properties are numbers.
@@ -22055,6 +22315,12 @@ class Element {
22055
22315
  */
22056
22316
  parent;
22057
22317
 
22318
+ /**
22319
+ * Format-specific style information for round-trip preservation.
22320
+ * Each format owns its own namespace (e.g., `yaml`, `json`).
22321
+ */
22322
+ style;
22323
+
22058
22324
  // ============================================================================
22059
22325
  // Source Position (LSP-compatible, TextDocument-compatible, UTF-16 code units)
22060
22326
  // web-tree-sitter automatically provides position data in UTF-16 code units.
@@ -22944,17 +23210,18 @@ __webpack_require__.r(__webpack_exports__);
22944
23210
  /* harmony export */ CollectionElement: () => (/* reexport safe */ _primitives_CollectionElement_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
22945
23211
  /* harmony export */ CommentElement: () => (/* reexport safe */ _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]),
22946
23212
  /* harmony export */ Element: () => (/* reexport safe */ _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]),
22947
- /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
23213
+ /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__["default"]),
22948
23214
  /* harmony export */ LinkElement: () => (/* reexport safe */ _elements_LinkElement_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
22949
23215
  /* harmony export */ MemberElement: () => (/* reexport safe */ _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
22950
23216
  /* harmony export */ NullElement: () => (/* reexport safe */ _primitives_NullElement_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
22951
23217
  /* harmony export */ NumberElement: () => (/* reexport safe */ _primitives_NumberElement_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]),
22952
23218
  /* harmony export */ ObjectElement: () => (/* reexport safe */ _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
22953
- /* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
23219
+ /* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
22954
23220
  /* harmony export */ ParseResultElement: () => (/* reexport safe */ _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]),
22955
23221
  /* harmony export */ RefElement: () => (/* reexport safe */ _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]),
22956
23222
  /* harmony export */ SourceMapElement: () => (/* reexport safe */ _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]),
22957
23223
  /* harmony export */ StringElement: () => (/* reexport safe */ _primitives_StringElement_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
23224
+ /* harmony export */ StyleElement: () => (/* reexport safe */ _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
22958
23225
  /* harmony export */ refract: () => (/* binding */ refract)
22959
23226
  /* harmony export */ });
22960
23227
  /* harmony import */ var _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(728);
@@ -22972,8 +23239,10 @@ __webpack_require__.r(__webpack_exports__);
22972
23239
  /* harmony import */ var _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(94);
22973
23240
  /* harmony import */ var _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4823);
22974
23241
  /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5810);
22975
- /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(8504);
22976
- /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6663);
23242
+ /* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9686);
23243
+ /* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(8504);
23244
+ /* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(6663);
23245
+
22977
23246
 
22978
23247
 
22979
23248
 
@@ -23060,6 +23329,8 @@ __webpack_require__.r(__webpack_exports__);
23060
23329
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
23061
23330
  /* harmony export */ });
23062
23331
  /* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5810);
23332
+ /* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9686);
23333
+
23063
23334
 
23064
23335
  /**
23065
23336
  * Serialized representation of an Element in JSON Refract format.
@@ -23118,6 +23389,17 @@ class JSONSerialiser {
23118
23389
  payload.meta.__mappings__ = this.serialise(sourceMap);
23119
23390
  }
23120
23391
  }
23392
+
23393
+ // Serialize style as __styles__ in meta (skip for StyleElement itself)
23394
+ if (!(element instanceof _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])) {
23395
+ const styleElement = _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__["default"].from(element);
23396
+ if (styleElement) {
23397
+ if (!payload.meta) {
23398
+ payload.meta = {};
23399
+ }
23400
+ payload.meta.__styles__ = this.serialise(styleElement);
23401
+ }
23402
+ }
23121
23403
  const content = this.serialiseContent(element.content);
23122
23404
  if (content !== undefined) {
23123
23405
  payload.content = content;
@@ -23138,15 +23420,18 @@ class JSONSerialiser {
23138
23420
  element.element = value.element;
23139
23421
  }
23140
23422
 
23141
- // Extract __mappings__ without mutating input, filter remaining meta
23423
+ // Extract __mappings__ and __styles__ without mutating input, filter remaining meta
23142
23424
  let mappingsDoc;
23425
+ let stylesDoc;
23143
23426
  let metaToDeserialize = value.meta;
23144
- if (value.meta?.__mappings__) {
23427
+ if (value.meta?.__mappings__ || value.meta?.__styles__) {
23145
23428
  const {
23146
23429
  __mappings__,
23430
+ __styles__,
23147
23431
  ...rest
23148
23432
  } = value.meta;
23149
23433
  mappingsDoc = __mappings__;
23434
+ stylesDoc = __styles__;
23150
23435
  metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
23151
23436
  }
23152
23437
  if (metaToDeserialize) {
@@ -23158,6 +23443,12 @@ class JSONSerialiser {
23158
23443
  const sourceMap = this.deserialise(mappingsDoc);
23159
23444
  sourceMap.applyTo(element);
23160
23445
  }
23446
+
23447
+ // Restore style from __styles__
23448
+ if (stylesDoc) {
23449
+ const styleElement = this.deserialise(stylesDoc);
23450
+ styleElement.applyTo(element);
23451
+ }
23161
23452
  if (value.attributes) {
23162
23453
  this.deserialiseObject(value.attributes, element.attributes);
23163
23454
  }
@@ -24000,7 +24291,7 @@ const specification = {
24000
24291
  fixedFields: {
24001
24292
  // core vocabulary
24002
24293
  id: {
24003
- $visitor: _visitors_FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE_0__["default"],
24294
+ $ref: '#/visitors/value',
24004
24295
  alias: 'idField'
24005
24296
  },
24006
24297
  $schema: {
@@ -24282,6 +24573,7 @@ __webpack_require__.r(__webpack_exports__);
24282
24573
  /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8400);
24283
24574
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7071);
24284
24575
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5810);
24576
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9686);
24285
24577
 
24286
24578
 
24287
24579
 
@@ -24309,6 +24601,7 @@ class Visitor {
24309
24601
  to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
24310
24602
  }
24311
24603
  _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
24604
+ _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
24312
24605
  }
24313
24606
  }
24314
24607
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
@@ -28838,6 +29131,7 @@ __webpack_require__.r(__webpack_exports__);
28838
29131
  /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8400);
28839
29132
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7071);
28840
29133
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5810);
29134
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9686);
28841
29135
 
28842
29136
 
28843
29137
 
@@ -28865,6 +29159,7 @@ class Visitor {
28865
29159
  to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
28866
29160
  }
28867
29161
  _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
29162
+ _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
28868
29163
  }
28869
29164
  }
28870
29165
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
@@ -30937,16 +31232,21 @@ const detect = async (source, {
30937
31232
  */
30938
31233
  const parse = async (source, {
30939
31234
  sourceMap = false,
31235
+ style = false,
30940
31236
  strict = false
30941
31237
  } = {}) => {
30942
31238
  if (strict && sourceMap) {
30943
31239
  throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use sourceMap with strict parsing. Strict parsing does not support source maps.');
30944
31240
  }
31241
+ if (strict && style) {
31242
+ throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use style with strict parsing. Strict parsing does not support style preservation.');
31243
+ }
30945
31244
  if (strict) {
30946
31245
  return _native_index_mjs__WEBPACK_IMPORTED_MODULE_2__.parse(source);
30947
31246
  }
30948
31247
  return _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__.parse(source, {
30949
- sourceMap
31248
+ sourceMap,
31249
+ style
30950
31250
  });
30951
31251
  };
30952
31252
 
@@ -31077,12 +31377,14 @@ const detect = async source => {
31077
31377
  * @public
31078
31378
  */
31079
31379
  const parse = async (source, {
31080
- sourceMap = false
31380
+ sourceMap = false,
31381
+ style = false
31081
31382
  } = {}) => {
31082
31383
  const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
31083
31384
  try {
31084
31385
  return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
31085
- sourceMap
31386
+ sourceMap,
31387
+ style
31086
31388
  });
31087
31389
  } finally {
31088
31390
  cst.delete();
@@ -31185,6 +31487,24 @@ const maybeAddSourceMap = (info, element, ctx) => {
31185
31487
  element.endCharacter = info.endPosition.column;
31186
31488
  element.endOffset = info.endIndex;
31187
31489
  };
31490
+
31491
+ // build json style object for an element
31492
+ const buildJsonStyle = (ctx, extras) => {
31493
+ const jsonStyle = {
31494
+ indent: ctx.indent
31495
+ };
31496
+ if (extras) Object.assign(jsonStyle, extras);
31497
+ return {
31498
+ json: jsonStyle
31499
+ };
31500
+ };
31501
+
31502
+ // detect indent from an object's first pair child position
31503
+ // called during transformChildren when we encounter the first pair
31504
+ const detectIndent = (objectColumn, firstPairColumn) => {
31505
+ const diff = firstPairColumn - objectColumn;
31506
+ return diff > 0 ? diff : 2;
31507
+ };
31188
31508
  const transform = (cursor, transformerMap, ctx) => {
31189
31509
  const info = getCursorInfo(cursor);
31190
31510
 
@@ -31248,11 +31568,27 @@ const createTransformers = transformerMap => ({
31248
31568
  const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
31249
31569
  maybeAddSourceMap(info, element, ctx);
31250
31570
 
31571
+ // Detect indent from first pair if style is enabled and not yet detected
31572
+ if (ctx.style && ctx.indent === 0) {
31573
+ if (cursor.gotoFirstChild()) {
31574
+ do {
31575
+ if (cursor.nodeType === 'pair') {
31576
+ ctx.indent = detectIndent(info.startPosition.column, cursor.startPosition.column);
31577
+ break;
31578
+ }
31579
+ } while (cursor.gotoNextSibling());
31580
+ cursor.gotoParent();
31581
+ }
31582
+ }
31583
+
31251
31584
  // Transform children (pairs)
31252
31585
  const children = transformChildren(cursor, transformerMap, ctx);
31253
31586
  for (const child of children) {
31254
31587
  element.push(child);
31255
31588
  }
31589
+ if (ctx.style) {
31590
+ element.style = buildJsonStyle(ctx);
31591
+ }
31256
31592
  return element;
31257
31593
  },
31258
31594
  array(cursor, ctx) {
@@ -31265,6 +31601,9 @@ const createTransformers = transformerMap => ({
31265
31601
  for (const child of children) {
31266
31602
  element.push(child);
31267
31603
  }
31604
+ if (ctx.style) {
31605
+ element.style = buildJsonStyle(ctx);
31606
+ }
31268
31607
  return element;
31269
31608
  },
31270
31609
  pair(cursor, ctx) {
@@ -31306,30 +31645,47 @@ const createTransformers = transformerMap => ({
31306
31645
  });
31307
31646
  }
31308
31647
  }
31648
+ if (ctx.style) {
31649
+ element.style = buildJsonStyle(ctx);
31650
+ }
31309
31651
  maybeAddSourceMap(info, element, ctx);
31310
31652
  return element;
31311
31653
  },
31312
31654
  number(cursor, ctx) {
31313
31655
  const info = getCursorInfo(cursor);
31314
31656
  const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](Number(info.text));
31657
+ if (ctx.style) {
31658
+ element.style = buildJsonStyle(ctx, {
31659
+ rawContent: info.text
31660
+ });
31661
+ }
31315
31662
  maybeAddSourceMap(info, element, ctx);
31316
31663
  return element;
31317
31664
  },
31318
31665
  null(cursor, ctx) {
31319
31666
  const info = getCursorInfo(cursor);
31320
31667
  const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__["default"]();
31668
+ if (ctx.style) {
31669
+ element.style = buildJsonStyle(ctx);
31670
+ }
31321
31671
  maybeAddSourceMap(info, element, ctx);
31322
31672
  return element;
31323
31673
  },
31324
31674
  true(cursor, ctx) {
31325
31675
  const info = getCursorInfo(cursor);
31326
31676
  const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](true);
31677
+ if (ctx.style) {
31678
+ element.style = buildJsonStyle(ctx);
31679
+ }
31327
31680
  maybeAddSourceMap(info, element, ctx);
31328
31681
  return element;
31329
31682
  },
31330
31683
  false(cursor, ctx) {
31331
31684
  const info = getCursorInfo(cursor);
31332
31685
  const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](false);
31686
+ if (ctx.style) {
31687
+ element.style = buildJsonStyle(ctx);
31688
+ }
31333
31689
  maybeAddSourceMap(info, element, ctx);
31334
31690
  return element;
31335
31691
  },
@@ -31360,11 +31716,14 @@ Object.assign(transformers, createTransformers(transformers));
31360
31716
  * @public
31361
31717
  */
31362
31718
  const analyze = (cst, {
31363
- sourceMap = false
31719
+ sourceMap = false,
31720
+ style = false
31364
31721
  } = {}) => {
31365
31722
  const cursor = cst.walk();
31366
31723
  const ctx = {
31367
31724
  sourceMap,
31725
+ style,
31726
+ indent: 0,
31368
31727
  annotations: []
31369
31728
  };
31370
31729
  const result = transform(cursor, transformers, ctx);