@speclynx/apidom-datamodel 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 CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.12.0](https://github.com/speclynx/apidom/compare/v2.11.0...v2.12.0) (2026-02-18)
7
+
8
+ ### Features
9
+
10
+ - add support for lossless JSON/YAML roundtrips ([#97](https://github.com/speclynx/apidom/issues/97)) ([dc17c9a](https://github.com/speclynx/apidom/commit/dc17c9a78fbc7df07a91e8f35b12be6409117d91))
11
+
6
12
  # [2.11.0](https://github.com/speclynx/apidom/compare/v2.10.3...v2.11.0) (2026-02-12)
7
13
 
8
14
  ### Features
package/README.md CHANGED
@@ -24,6 +24,7 @@ Primitive elements are the building blocks of ApiDOM. Each element has:
24
24
  - `content` - The element's value
25
25
  - `meta` - Metadata (id, classes, title, description, links)
26
26
  - `attributes` - Element-specific properties
27
+ - `style` - Optional format-specific style information for round-trip preservation (e.g., `{ yaml: { scalarStyle: 'DoubleQuoted' } }`)
27
28
 
28
29
  ### Element
29
30
 
@@ -554,20 +554,22 @@ class ShallowCloneError extends _CloneError_ts__WEBPACK_IMPORTED_MODULE_0__["def
554
554
 
555
555
  __webpack_require__.r(__webpack_exports__);
556
556
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
557
- /* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_ts__WEBPACK_IMPORTED_MODULE_7__["default"]),
558
- /* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_ts__WEBPACK_IMPORTED_MODULE_5__["default"]),
559
- /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_ts__WEBPACK_IMPORTED_MODULE_6__["default"]),
557
+ /* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_ts__WEBPACK_IMPORTED_MODULE_8__["default"]),
558
+ /* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_ts__WEBPACK_IMPORTED_MODULE_6__["default"]),
559
+ /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_ts__WEBPACK_IMPORTED_MODULE_7__["default"]),
560
560
  /* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
561
561
  /* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
562
562
  /* harmony export */ });
563
- /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(660);
564
- /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(807);
565
- /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(950);
566
- /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(762);
567
- /* harmony import */ var _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(588);
568
- /* harmony import */ var _errors_DeepCloneError_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(794);
569
- /* harmony import */ var _errors_ShallowCloneError_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(60);
570
- /* harmony import */ var _errors_CloneError_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(200);
563
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(138);
564
+ /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(660);
565
+ /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(807);
566
+ /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(950);
567
+ /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(762);
568
+ /* harmony import */ var _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(588);
569
+ /* harmony import */ var _errors_DeepCloneError_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(794);
570
+ /* harmony import */ var _errors_ShallowCloneError_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(60);
571
+ /* harmony import */ var _errors_CloneError_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(200);
572
+
571
573
 
572
574
 
573
575
 
@@ -603,9 +605,9 @@ const cloneDeepElement = (element, options) => {
603
605
  } = element;
604
606
  if (Array.isArray(content)) {
605
607
  copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
606
- } else if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__.isElement)(content)) {
608
+ } else if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
607
609
  copy.content = cloneDeepElement(content, passThroughOptions);
608
- } else if (content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
610
+ } else if (content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__["default"]) {
609
611
  copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
610
612
  } else {
611
613
  copy.content = content;
@@ -629,7 +631,7 @@ const cloneDeepKeyValuePair = (kvp, options) => {
629
631
  } = kvp;
630
632
  const keyCopy = key !== undefined ? cloneDeepElement(key, passThroughOptions) : undefined;
631
633
  const valueCopy = value !== undefined ? cloneDeepElement(value, passThroughOptions) : undefined;
632
- const copy = new _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"](keyCopy, valueCopy);
634
+ const copy = new _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__["default"](keyCopy, valueCopy);
633
635
  visited.set(kvp, copy);
634
636
  return copy;
635
637
  };
@@ -645,7 +647,7 @@ const cloneDeepObjectSlice = (slice, options) => {
645
647
  return visited.get(slice);
646
648
  }
647
649
  const items = [...slice].map(element => cloneDeepElement(element, passThroughOptions));
648
- const copy = new _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_0__["default"](items);
650
+ const copy = new _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_1__["default"](items);
649
651
  visited.set(slice, copy);
650
652
  return copy;
651
653
  };
@@ -656,16 +658,16 @@ const cloneDeepObjectSlice = (slice, options) => {
656
658
  * @public
657
659
  */
658
660
  const cloneDeep = (value, options = {}) => {
659
- if (value instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
661
+ if (value instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__["default"]) {
660
662
  return cloneDeepKeyValuePair(value, options);
661
663
  }
662
- if (value instanceof _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) {
664
+ if (value instanceof _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
663
665
  return cloneDeepObjectSlice(value, options);
664
666
  }
665
- if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__.isElement)(value)) {
667
+ if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
666
668
  return cloneDeepElement(value, options);
667
669
  }
668
- throw new _errors_DeepCloneError_ts__WEBPACK_IMPORTED_MODULE_5__["default"]("Value provided to cloneDeep function couldn't be cloned", {
670
+ throw new _errors_DeepCloneError_ts__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneDeep function couldn't be cloned", {
669
671
  value
670
672
  });
671
673
  };
@@ -681,11 +683,11 @@ const cloneShallowKeyValuePair = keyValuePair => {
681
683
  key,
682
684
  value
683
685
  } = keyValuePair;
684
- return new _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"](key, value);
686
+ return new _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__["default"](key, value);
685
687
  };
686
688
  const cloneShallowObjectSlice = objectSlice => {
687
689
  const items = [...objectSlice];
688
- return new _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_0__["default"](items);
690
+ return new _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_1__["default"](items);
689
691
  };
690
692
  const cloneShallowElement = element => {
691
693
  const Ctor = element.constructor;
@@ -697,17 +699,20 @@ const cloneShallowElement = element => {
697
699
  if (!element.isAttributesEmpty) {
698
700
  copy.attributes = cloneDeep(element.attributes);
699
701
  }
700
- if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap)(element)) {
701
- _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_4__["default"].transfer(element, copy);
702
+ if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__.hasElementSourceMap)(element)) {
703
+ _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, copy);
704
+ }
705
+ if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__.hasElementStyle)(element)) {
706
+ copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
702
707
  }
703
708
  const {
704
709
  content
705
710
  } = element;
706
- if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__.isElement)(content)) {
711
+ if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
707
712
  copy.content = cloneShallowElement(content);
708
713
  } else if (Array.isArray(content)) {
709
714
  copy.content = [...content];
710
- } else if (content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
715
+ } else if (content instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__["default"]) {
711
716
  copy.content = cloneShallowKeyValuePair(content);
712
717
  } else {
713
718
  copy.content = content;
@@ -722,16 +727,16 @@ const cloneShallowElement = element => {
722
727
  * @public
723
728
  */
724
729
  const cloneShallow = value => {
725
- if (value instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
730
+ if (value instanceof _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_2__["default"]) {
726
731
  return cloneShallowKeyValuePair(value);
727
732
  }
728
- if (value instanceof _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) {
733
+ if (value instanceof _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_1__["default"]) {
729
734
  return cloneShallowObjectSlice(value);
730
735
  }
731
- if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_3__.isElement)(value)) {
736
+ if ((0,_predicates_index_ts__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
732
737
  return cloneShallowElement(value);
733
738
  }
734
- throw new _errors_ShallowCloneError_ts__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneShallow function couldn't be cloned", {
739
+ throw new _errors_ShallowCloneError_ts__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneShallow function couldn't be cloned", {
735
740
  value
736
741
  });
737
742
  };
@@ -1156,6 +1161,67 @@ function unpackSourceMap(packed) {
1156
1161
 
1157
1162
  /***/ },
1158
1163
 
1164
+ /***/ 128
1165
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1166
+
1167
+ __webpack_require__.r(__webpack_exports__);
1168
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1169
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1170
+ /* harmony export */ });
1171
+ /* harmony import */ var _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(975);
1172
+
1173
+
1174
+ /**
1175
+ * Shape with optional style property.
1176
+ * @public
1177
+ */
1178
+
1179
+ /**
1180
+ * StyleElement stores format-specific style information for round-trip preservation.
1181
+ *
1182
+ * The style data is stored as a plain object with format-specific namespaces
1183
+ * (e.g., `yaml`, `json`). This element exists only during serialization/deserialization
1184
+ * (refract format) - in memory, style lives directly on `element.style`.
1185
+ *
1186
+ * Follows the same pattern as SourceMapElement with __mappings__.
1187
+ *
1188
+ * @public
1189
+ */
1190
+ class StyleElement extends _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_0__["default"] {
1191
+ constructor(content, meta, attributes) {
1192
+ super(content, meta, attributes);
1193
+ this.element = '__styles__';
1194
+ }
1195
+
1196
+ /**
1197
+ * Transfers style property from one element to another.
1198
+ */
1199
+ static transfer(from, to) {
1200
+ to.style = from.style;
1201
+ }
1202
+
1203
+ /**
1204
+ * Creates a StyleElement from an element's style property.
1205
+ * Returns undefined if the element has no style.
1206
+ */
1207
+ static from(source) {
1208
+ if (!source.style) {
1209
+ return undefined;
1210
+ }
1211
+ return new StyleElement(source.style);
1212
+ }
1213
+
1214
+ /**
1215
+ * Restores the style property on the target element from this StyleElement.
1216
+ */
1217
+ applyTo(target) {
1218
+ target.style = this.toValue();
1219
+ }
1220
+ }
1221
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StyleElement);
1222
+
1223
+ /***/ },
1224
+
1159
1225
  /***/ 969
1160
1226
  (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1161
1227
 
@@ -1219,6 +1285,7 @@ const isSourceMapElement = element => element instanceof _elements_SourceMap_ts_
1219
1285
  __webpack_require__.r(__webpack_exports__);
1220
1286
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1221
1287
  /* harmony export */ hasElementSourceMap: () => (/* binding */ hasElementSourceMap),
1288
+ /* harmony export */ hasElementStyle: () => (/* binding */ hasElementStyle),
1222
1289
  /* harmony export */ includesClasses: () => (/* binding */ includesClasses),
1223
1290
  /* harmony export */ includesSymbols: () => (/* binding */ includesSymbols),
1224
1291
  /* harmony export */ isAnnotationElement: () => (/* reexport safe */ _elements_ts__WEBPACK_IMPORTED_MODULE_1__.isAnnotationElement),
@@ -1244,6 +1311,14 @@ __webpack_require__.r(__webpack_exports__);
1244
1311
 
1245
1312
 
1246
1313
 
1314
+ /**
1315
+ * Checks if an element has format-specific style information.
1316
+ * @public
1317
+ */
1318
+ const hasElementStyle = element => {
1319
+ return element.style !== undefined;
1320
+ };
1321
+
1247
1322
  /**
1248
1323
  * Checks if an element has complete source position information.
1249
1324
  * Returns true only if all 6 position properties are numbers.
@@ -1790,6 +1865,12 @@ class Element {
1790
1865
  */
1791
1866
  parent;
1792
1867
 
1868
+ /**
1869
+ * Format-specific style information for round-trip preservation.
1870
+ * Each format owns its own namespace (e.g., `yaml`, `json`).
1871
+ */
1872
+ style;
1873
+
1793
1874
  // ============================================================================
1794
1875
  // Source Position (LSP-compatible, TextDocument-compatible, UTF-16 code units)
1795
1876
  // web-tree-sitter automatically provides position data in UTF-16 code units.
@@ -2679,17 +2760,18 @@ __webpack_require__.r(__webpack_exports__);
2679
2760
  /* harmony export */ CollectionElement: () => (/* reexport safe */ _primitives_CollectionElement_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
2680
2761
  /* harmony export */ CommentElement: () => (/* reexport safe */ _elements_Comment_ts__WEBPACK_IMPORTED_MODULE_12__["default"]),
2681
2762
  /* harmony export */ Element: () => (/* reexport safe */ _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__["default"]),
2682
- /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_16__["default"]),
2763
+ /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_17__["default"]),
2683
2764
  /* harmony export */ LinkElement: () => (/* reexport safe */ _elements_LinkElement_ts__WEBPACK_IMPORTED_MODULE_9__["default"]),
2684
2765
  /* harmony export */ MemberElement: () => (/* reexport safe */ _primitives_MemberElement_ts__WEBPACK_IMPORTED_MODULE_7__["default"]),
2685
2766
  /* harmony export */ NullElement: () => (/* reexport safe */ _primitives_NullElement_ts__WEBPACK_IMPORTED_MODULE_2__["default"]),
2686
2767
  /* harmony export */ NumberElement: () => (/* reexport safe */ _primitives_NumberElement_ts__WEBPACK_IMPORTED_MODULE_4__["default"]),
2687
2768
  /* harmony export */ ObjectElement: () => (/* reexport safe */ _primitives_ObjectElement_ts__WEBPACK_IMPORTED_MODULE_8__["default"]),
2688
- /* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_15__["default"]),
2769
+ /* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_16__["default"]),
2689
2770
  /* harmony export */ ParseResultElement: () => (/* reexport safe */ _elements_ParseResult_ts__WEBPACK_IMPORTED_MODULE_13__["default"]),
2690
2771
  /* harmony export */ RefElement: () => (/* reexport safe */ _elements_RefElement_ts__WEBPACK_IMPORTED_MODULE_10__["default"]),
2691
2772
  /* harmony export */ SourceMapElement: () => (/* reexport safe */ _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_14__["default"]),
2692
2773
  /* harmony export */ StringElement: () => (/* reexport safe */ _primitives_StringElement_ts__WEBPACK_IMPORTED_MODULE_3__["default"]),
2774
+ /* harmony export */ StyleElement: () => (/* reexport safe */ _elements_Style_ts__WEBPACK_IMPORTED_MODULE_15__["default"]),
2693
2775
  /* harmony export */ refract: () => (/* binding */ refract)
2694
2776
  /* harmony export */ });
2695
2777
  /* harmony import */ var _primitives_Element_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(370);
@@ -2707,8 +2789,10 @@ __webpack_require__.r(__webpack_exports__);
2707
2789
  /* harmony import */ var _elements_Comment_ts__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(176);
2708
2790
  /* harmony import */ var _elements_ParseResult_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(755);
2709
2791
  /* harmony import */ var _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(588);
2710
- /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(660);
2711
- /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(807);
2792
+ /* harmony import */ var _elements_Style_ts__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(128);
2793
+ /* harmony import */ var _ObjectSlice_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(660);
2794
+ /* harmony import */ var _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(807);
2795
+
2712
2796
 
2713
2797
 
2714
2798
 
@@ -2795,6 +2879,8 @@ __webpack_require__.r(__webpack_exports__);
2795
2879
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2796
2880
  /* harmony export */ });
2797
2881
  /* harmony import */ var _elements_SourceMap_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(588);
2882
+ /* harmony import */ var _elements_Style_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(128);
2883
+
2798
2884
 
2799
2885
 
2800
2886
  /**
@@ -2858,6 +2944,17 @@ class JSONSerialiser {
2858
2944
  payload.meta.__mappings__ = this.serialise(sourceMap);
2859
2945
  }
2860
2946
  }
2947
+
2948
+ // Serialize style as __styles__ in meta (skip for StyleElement itself)
2949
+ if (!(element instanceof _elements_Style_ts__WEBPACK_IMPORTED_MODULE_1__["default"])) {
2950
+ const styleElement = _elements_Style_ts__WEBPACK_IMPORTED_MODULE_1__["default"].from(element);
2951
+ if (styleElement) {
2952
+ if (!payload.meta) {
2953
+ payload.meta = {};
2954
+ }
2955
+ payload.meta.__styles__ = this.serialise(styleElement);
2956
+ }
2957
+ }
2861
2958
  const content = this.serialiseContent(element.content);
2862
2959
  if (content !== undefined) {
2863
2960
  payload.content = content;
@@ -2878,15 +2975,18 @@ class JSONSerialiser {
2878
2975
  element.element = value.element;
2879
2976
  }
2880
2977
 
2881
- // Extract __mappings__ without mutating input, filter remaining meta
2978
+ // Extract __mappings__ and __styles__ without mutating input, filter remaining meta
2882
2979
  let mappingsDoc;
2980
+ let stylesDoc;
2883
2981
  let metaToDeserialize = value.meta;
2884
- if (value.meta?.__mappings__) {
2982
+ if (value.meta?.__mappings__ || value.meta?.__styles__) {
2885
2983
  const {
2886
2984
  __mappings__,
2985
+ __styles__,
2887
2986
  ...rest
2888
2987
  } = value.meta;
2889
2988
  mappingsDoc = __mappings__;
2989
+ stylesDoc = __styles__;
2890
2990
  metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
2891
2991
  }
2892
2992
  if (metaToDeserialize) {
@@ -2898,6 +2998,12 @@ class JSONSerialiser {
2898
2998
  const sourceMap = this.deserialise(mappingsDoc);
2899
2999
  sourceMap.applyTo(element);
2900
3000
  }
3001
+
3002
+ // Restore style from __styles__
3003
+ if (stylesDoc) {
3004
+ const styleElement = this.deserialise(stylesDoc);
3005
+ styleElement.applyTo(element);
3006
+ }
2901
3007
  if (value.attributes) {
2902
3008
  this.deserialiseObject(value.attributes, element.attributes);
2903
3009
  }
@@ -2969,6 +3075,52 @@ class JSONSerialiser {
2969
3075
 
2970
3076
  /***/ },
2971
3077
 
3078
+ /***/ 138
3079
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3080
+
3081
+ __webpack_require__.r(__webpack_exports__);
3082
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3083
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3084
+ /* harmony export */ });
3085
+ /* harmony import */ var _internal_clone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(575);
3086
+ /* harmony import */ var _internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(938);
3087
+
3088
+
3089
+
3090
+ /**
3091
+ * Creates a deep copy of the source that can be used in place of the source
3092
+ * object without retaining any references to it.
3093
+ * The source object may contain (nested) `Array`s and `Object`s,
3094
+ * `Number`s, `String`s, `Boolean`s and `Date`s.
3095
+ * `Function`s are assigned by reference rather than copied.
3096
+ *
3097
+ * Dispatches to a `clone` method if present.
3098
+ *
3099
+ * Note that if the source object has multiple nodes that share a reference,
3100
+ * the returned object will have the same structure, but the references will
3101
+ * be pointed to the location within the cloned value.
3102
+ *
3103
+ * @func
3104
+ * @memberOf R
3105
+ * @since v0.1.0
3106
+ * @category Object
3107
+ * @sig {*} -> {*}
3108
+ * @param {*} value The object or array to clone
3109
+ * @return {*} A deeply cloned copy of `val`
3110
+ * @example
3111
+ *
3112
+ * const objects = [{}, {}, {}];
3113
+ * const objectsClone = R.clone(objects);
3114
+ * objects === objectsClone; //=> false
3115
+ * objects[0] === objectsClone[0]; //=> false
3116
+ */
3117
+ var clone = /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function clone(value) {
3118
+ return value != null && typeof value.clone === 'function' ? value.clone() : (0,_internal_clone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, true);
3119
+ });
3120
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
3121
+
3122
+ /***/ },
3123
+
2972
3124
  /***/ 654
2973
3125
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2974
3126
 
@@ -3031,6 +3183,144 @@ function _arrayFromIterator(iter) {
3031
3183
 
3032
3184
  /***/ },
3033
3185
 
3186
+ /***/ 575
3187
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3188
+
3189
+ __webpack_require__.r(__webpack_exports__);
3190
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3191
+ /* harmony export */ "default": () => (/* binding */ _clone)
3192
+ /* harmony export */ });
3193
+ /* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(254);
3194
+ /* harmony import */ var _type_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(963);
3195
+
3196
+
3197
+
3198
+ /**
3199
+ * Copies an object.
3200
+ *
3201
+ * @private
3202
+ * @param {*} value The value to be copied
3203
+ * @param {Boolean} deep Whether or not to perform deep cloning.
3204
+ * @return {*} The copied value.
3205
+ */
3206
+ function _clone(value, deep, map) {
3207
+ map || (map = new _ObjectMap());
3208
+
3209
+ // this avoids the slower switch with a quick if decision removing some milliseconds in each run.
3210
+ if (_isPrimitive(value)) {
3211
+ return value;
3212
+ }
3213
+ var copy = function copy(copiedValue) {
3214
+ // Check for circular and same references on the object graph and return its corresponding clone.
3215
+ var cachedCopy = map.get(value);
3216
+ if (cachedCopy) {
3217
+ return cachedCopy;
3218
+ }
3219
+ map.set(value, copiedValue);
3220
+ for (var key in value) {
3221
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
3222
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
3223
+ }
3224
+ }
3225
+ return copiedValue;
3226
+ };
3227
+ switch ((0,_type_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
3228
+ case 'Object':
3229
+ return copy(Object.create(Object.getPrototypeOf(value)));
3230
+ case 'Array':
3231
+ return copy(Array(value.length));
3232
+ case 'Date':
3233
+ return new Date(value.valueOf());
3234
+ case 'RegExp':
3235
+ return (0,_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
3236
+ case 'Int8Array':
3237
+ case 'Uint8Array':
3238
+ case 'Uint8ClampedArray':
3239
+ case 'Int16Array':
3240
+ case 'Uint16Array':
3241
+ case 'Int32Array':
3242
+ case 'Uint32Array':
3243
+ case 'Float32Array':
3244
+ case 'Float64Array':
3245
+ case 'BigInt64Array':
3246
+ case 'BigUint64Array':
3247
+ return value.slice();
3248
+ default:
3249
+ return value;
3250
+ }
3251
+ }
3252
+ function _isPrimitive(param) {
3253
+ var type = typeof param;
3254
+ return param == null || type != 'object' && type != 'function';
3255
+ }
3256
+ var _ObjectMap = /*#__PURE__*/function () {
3257
+ function _ObjectMap() {
3258
+ this.map = {};
3259
+ this.length = 0;
3260
+ }
3261
+ _ObjectMap.prototype.set = function (key, value) {
3262
+ var hashedKey = this.hash(key);
3263
+ var bucket = this.map[hashedKey];
3264
+ if (!bucket) {
3265
+ this.map[hashedKey] = bucket = [];
3266
+ }
3267
+ bucket.push([key, value]);
3268
+ this.length += 1;
3269
+ };
3270
+ _ObjectMap.prototype.hash = function (key) {
3271
+ var hashedKey = [];
3272
+ for (var value in key) {
3273
+ hashedKey.push(Object.prototype.toString.call(key[value]));
3274
+ }
3275
+ return hashedKey.join();
3276
+ };
3277
+ _ObjectMap.prototype.get = function (key) {
3278
+ /**
3279
+ * 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,
3280
+ * on my tests this number is 180, anything above that using the hash function is faster.
3281
+ */
3282
+ if (this.length <= 180) {
3283
+ for (var p in this.map) {
3284
+ var bucket = this.map[p];
3285
+ for (var i = 0; i < bucket.length; i += 1) {
3286
+ var element = bucket[i];
3287
+ if (element[0] === key) {
3288
+ return element[1];
3289
+ }
3290
+ }
3291
+ }
3292
+ return;
3293
+ }
3294
+ var hashedKey = this.hash(key);
3295
+ var bucket = this.map[hashedKey];
3296
+ if (!bucket) {
3297
+ return;
3298
+ }
3299
+ for (var i = 0; i < bucket.length; i += 1) {
3300
+ var element = bucket[i];
3301
+ if (element[0] === key) {
3302
+ return element[1];
3303
+ }
3304
+ }
3305
+ };
3306
+ return _ObjectMap;
3307
+ }();
3308
+
3309
+ /***/ },
3310
+
3311
+ /***/ 254
3312
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3313
+
3314
+ __webpack_require__.r(__webpack_exports__);
3315
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3316
+ /* harmony export */ "default": () => (/* binding */ _cloneRegExp)
3317
+ /* harmony export */ });
3318
+ function _cloneRegExp(pattern) {
3319
+ return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : '') + (pattern.dotAll ? 's' : ''));
3320
+ }
3321
+
3322
+ /***/ },
3323
+
3034
3324
  /***/ 938
3035
3325
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3036
3326
 
@@ -3634,7 +3924,7 @@ __webpack_require__.r(__webpack_exports__);
3634
3924
  /* harmony export */ CommentElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_19__["default"]),
3635
3925
  /* harmony export */ DeepCloneError: () => (/* reexport safe */ _clone_index_ts__WEBPACK_IMPORTED_MODULE_4__["default"]),
3636
3926
  /* harmony export */ Element: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_7__["default"]),
3637
- /* harmony export */ JSONSerialiser: () => (/* reexport safe */ _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_23__["default"]),
3927
+ /* harmony export */ JSONSerialiser: () => (/* reexport safe */ _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_24__["default"]),
3638
3928
  /* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_ts__WEBPACK_IMPORTED_MODULE_1__["default"]),
3639
3929
  /* harmony export */ LinkElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_16__["default"]),
3640
3930
  /* harmony export */ MemberElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_14__["default"]),
@@ -3642,32 +3932,34 @@ __webpack_require__.r(__webpack_exports__);
3642
3932
  /* harmony export */ NullElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_9__["default"]),
3643
3933
  /* harmony export */ NumberElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_11__["default"]),
3644
3934
  /* harmony export */ ObjectElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_15__["default"]),
3645
- /* harmony export */ ObjectSlice: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_22__["default"]),
3935
+ /* harmony export */ ObjectSlice: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_23__["default"]),
3646
3936
  /* harmony export */ ParseResultElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_20__["default"]),
3647
3937
  /* harmony export */ RefElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_17__["default"]),
3648
3938
  /* harmony export */ ShallowCloneError: () => (/* reexport safe */ _clone_index_ts__WEBPACK_IMPORTED_MODULE_5__["default"]),
3649
3939
  /* harmony export */ SourceMapElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_21__["default"]),
3650
3940
  /* harmony export */ StringElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_10__["default"]),
3941
+ /* harmony export */ StyleElement: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_22__["default"]),
3651
3942
  /* harmony export */ cloneDeep: () => (/* reexport safe */ _clone_index_ts__WEBPACK_IMPORTED_MODULE_2__.cloneDeep),
3652
3943
  /* harmony export */ cloneShallow: () => (/* reexport safe */ _clone_index_ts__WEBPACK_IMPORTED_MODULE_2__.cloneShallow),
3653
- /* harmony export */ hasElementSourceMap: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_24__.hasElementSourceMap),
3654
- /* harmony export */ includesClasses: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_24__.includesClasses),
3655
- /* harmony export */ includesSymbols: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_24__.includesSymbols),
3656
- /* harmony export */ isAnnotationElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isAnnotationElement),
3657
- /* harmony export */ isArrayElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isArrayElement),
3658
- /* harmony export */ isBooleanElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isBooleanElement),
3659
- /* harmony export */ isCommentElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isCommentElement),
3660
- /* harmony export */ isElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isElement),
3661
- /* harmony export */ isLinkElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isLinkElement),
3662
- /* harmony export */ isMemberElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isMemberElement),
3663
- /* harmony export */ isNullElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isNullElement),
3664
- /* harmony export */ isNumberElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isNumberElement),
3665
- /* harmony export */ isObjectElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isObjectElement),
3666
- /* harmony export */ isParseResultElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isParseResultElement),
3667
- /* harmony export */ isPrimitiveElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isPrimitiveElement),
3668
- /* harmony export */ isRefElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isRefElement),
3669
- /* harmony export */ isSourceMapElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isSourceMapElement),
3670
- /* harmony export */ isStringElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.isStringElement),
3944
+ /* harmony export */ hasElementSourceMap: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.hasElementSourceMap),
3945
+ /* harmony export */ hasElementStyle: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.hasElementStyle),
3946
+ /* harmony export */ includesClasses: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.includesClasses),
3947
+ /* harmony export */ includesSymbols: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__.includesSymbols),
3948
+ /* harmony export */ isAnnotationElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__.isAnnotationElement),
3949
+ /* harmony export */ isArrayElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isArrayElement),
3950
+ /* harmony export */ isBooleanElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isBooleanElement),
3951
+ /* harmony export */ isCommentElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__.isCommentElement),
3952
+ /* harmony export */ isElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isElement),
3953
+ /* harmony export */ isLinkElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__.isLinkElement),
3954
+ /* harmony export */ isMemberElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isMemberElement),
3955
+ /* harmony export */ isNullElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isNullElement),
3956
+ /* harmony export */ isNumberElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isNumberElement),
3957
+ /* harmony export */ isObjectElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isObjectElement),
3958
+ /* harmony export */ isParseResultElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__.isParseResultElement),
3959
+ /* harmony export */ isPrimitiveElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isPrimitiveElement),
3960
+ /* harmony export */ isRefElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__.isRefElement),
3961
+ /* harmony export */ isSourceMapElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__.isSourceMapElement),
3962
+ /* harmony export */ isStringElement: () => (/* reexport safe */ _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__.isStringElement),
3671
3963
  /* harmony export */ refract: () => (/* reexport safe */ _registration_ts__WEBPACK_IMPORTED_MODULE_6__.refract)
3672
3964
  /* harmony export */ });
3673
3965
  /* harmony import */ var _Namespace_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(576);
@@ -3692,11 +3984,12 @@ __webpack_require__.r(__webpack_exports__);
3692
3984
  /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(176);
3693
3985
  /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(755);
3694
3986
  /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(588);
3695
- /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(660);
3696
- /* harmony import */ var _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(27);
3697
- /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(950);
3698
- /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(762);
3699
- /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(969);
3987
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(128);
3988
+ /* harmony import */ var _registration_ts__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(660);
3989
+ /* harmony import */ var _serialisers_JSONSerialiser_ts__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(27);
3990
+ /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(950);
3991
+ /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(762);
3992
+ /* harmony import */ var _predicates_index_ts__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(969);
3700
3993
 
3701
3994
 
3702
3995