@uniformdev/tms-sdk 20.75.0 → 20.75.1-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -160,7 +160,11 @@ var SUPPORTED_PARAM_TYPES = {
160
160
  };
161
161
 
162
162
  // src/richText/renderAsTranslatableXml.ts
163
- import { getRichTextTagsFromTextFormat, isRichTextNodeType } from "@uniformdev/richtext";
163
+ import {
164
+ getRichTextListItemValue,
165
+ getRichTextTagsFromTextFormat,
166
+ isRichTextNodeType
167
+ } from "@uniformdev/richtext";
164
168
  var REF_ATTRIBUTE_NAME = "ref";
165
169
  function renderAsTranslatableXml(root) {
166
170
  if (!root) {
@@ -218,8 +222,23 @@ var getPropsAsBase64 = (node, ignoreProps) => {
218
222
  props[key] = node[key];
219
223
  }
220
224
  });
225
+ applyMissingSerializedDefaults(node.type, props);
221
226
  return btoa(JSON.stringify(props));
222
227
  };
228
+ function applyMissingSerializedDefaults(nodeType, props) {
229
+ if (props.version === void 0) {
230
+ props.version = 1;
231
+ }
232
+ if ((nodeType === "text" || nodeType === "tab") && props.format === void 0) {
233
+ props.format = 0;
234
+ } else if (nodeType === "list" && props.start === void 0) {
235
+ props.start = 1;
236
+ } else if (nodeType === "listitem" && props.value === void 0) {
237
+ props.value = 1;
238
+ } else if (nodeType === "tablecell" && props.headerState === void 0) {
239
+ props.headerState = 0;
240
+ }
241
+ }
223
242
  var getNodeMetaAttributesString = (node) => {
224
243
  const metadata = {};
225
244
  if (isRichTextNodeType(node, "text")) {
@@ -240,7 +259,10 @@ var getNodeMetaAttributesString = (node) => {
240
259
  metadata["tag"] = node.tag;
241
260
  }
242
261
  } else if (isRichTextNodeType(node, "listitem")) {
243
- metadata["value"] = String(node.value);
262
+ const value = getRichTextListItemValue(node.value);
263
+ if (typeof value === "number") {
264
+ metadata["value"] = String(value);
265
+ }
244
266
  }
245
267
  if (!Object.keys(metadata).length) {
246
268
  return "";
package/dist/index.js CHANGED
@@ -234,8 +234,23 @@ var getPropsAsBase64 = (node, ignoreProps) => {
234
234
  props[key] = node[key];
235
235
  }
236
236
  });
237
+ applyMissingSerializedDefaults(node.type, props);
237
238
  return btoa(JSON.stringify(props));
238
239
  };
240
+ function applyMissingSerializedDefaults(nodeType, props) {
241
+ if (props.version === void 0) {
242
+ props.version = 1;
243
+ }
244
+ if ((nodeType === "text" || nodeType === "tab") && props.format === void 0) {
245
+ props.format = 0;
246
+ } else if (nodeType === "list" && props.start === void 0) {
247
+ props.start = 1;
248
+ } else if (nodeType === "listitem" && props.value === void 0) {
249
+ props.value = 1;
250
+ } else if (nodeType === "tablecell" && props.headerState === void 0) {
251
+ props.headerState = 0;
252
+ }
253
+ }
239
254
  var getNodeMetaAttributesString = (node) => {
240
255
  const metadata = {};
241
256
  if ((0, import_richtext.isRichTextNodeType)(node, "text")) {
@@ -256,7 +271,10 @@ var getNodeMetaAttributesString = (node) => {
256
271
  metadata["tag"] = node.tag;
257
272
  }
258
273
  } else if ((0, import_richtext.isRichTextNodeType)(node, "listitem")) {
259
- metadata["value"] = String(node.value);
274
+ const value = (0, import_richtext.getRichTextListItemValue)(node.value);
275
+ if (typeof value === "number") {
276
+ metadata["value"] = String(value);
277
+ }
260
278
  }
261
279
  if (!Object.keys(metadata).length) {
262
280
  return "";
package/dist/index.mjs CHANGED
@@ -160,7 +160,11 @@ var SUPPORTED_PARAM_TYPES = {
160
160
  };
161
161
 
162
162
  // src/richText/renderAsTranslatableXml.ts
163
- import { getRichTextTagsFromTextFormat, isRichTextNodeType } from "@uniformdev/richtext";
163
+ import {
164
+ getRichTextListItemValue,
165
+ getRichTextTagsFromTextFormat,
166
+ isRichTextNodeType
167
+ } from "@uniformdev/richtext";
164
168
  var REF_ATTRIBUTE_NAME = "ref";
165
169
  function renderAsTranslatableXml(root) {
166
170
  if (!root) {
@@ -218,8 +222,23 @@ var getPropsAsBase64 = (node, ignoreProps) => {
218
222
  props[key] = node[key];
219
223
  }
220
224
  });
225
+ applyMissingSerializedDefaults(node.type, props);
221
226
  return btoa(JSON.stringify(props));
222
227
  };
228
+ function applyMissingSerializedDefaults(nodeType, props) {
229
+ if (props.version === void 0) {
230
+ props.version = 1;
231
+ }
232
+ if ((nodeType === "text" || nodeType === "tab") && props.format === void 0) {
233
+ props.format = 0;
234
+ } else if (nodeType === "list" && props.start === void 0) {
235
+ props.start = 1;
236
+ } else if (nodeType === "listitem" && props.value === void 0) {
237
+ props.value = 1;
238
+ } else if (nodeType === "tablecell" && props.headerState === void 0) {
239
+ props.headerState = 0;
240
+ }
241
+ }
223
242
  var getNodeMetaAttributesString = (node) => {
224
243
  const metadata = {};
225
244
  if (isRichTextNodeType(node, "text")) {
@@ -240,7 +259,10 @@ var getNodeMetaAttributesString = (node) => {
240
259
  metadata["tag"] = node.tag;
241
260
  }
242
261
  } else if (isRichTextNodeType(node, "listitem")) {
243
- metadata["value"] = String(node.value);
262
+ const value = getRichTextListItemValue(node.value);
263
+ if (typeof value === "number") {
264
+ metadata["value"] = String(value);
265
+ }
244
266
  }
245
267
  if (!Object.keys(metadata).length) {
246
268
  return "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/tms-sdk",
3
- "version": "20.75.0",
3
+ "version": "20.75.1-alpha.16+4e56d1cd21",
4
4
  "description": "Uniform Translation Management System SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -32,12 +32,12 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@uniformdev/canvas": "20.75.0",
36
- "@uniformdev/mesh-sdk": "20.75.0",
37
- "@uniformdev/richtext": "20.75.0",
35
+ "@uniformdev/canvas": "20.75.1-alpha.16+4e56d1cd21",
36
+ "@uniformdev/mesh-sdk": "20.75.1-alpha.16+4e56d1cd21",
37
+ "@uniformdev/richtext": "20.75.1-alpha.16+4e56d1cd21",
38
38
  "dequal": "2.0.3",
39
39
  "fast-xml-parser": "4.5.5",
40
40
  "immer": "10.2.0"
41
41
  },
42
- "gitHead": "945b06786c480e1595d06bfc51f539ddcf15f7c5"
42
+ "gitHead": "4e56d1cd21f2d4a02b13d733e51fb71441cac298"
43
43
  }