@supernova-studio/client 0.7.0 → 0.7.1

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.js CHANGED
@@ -4429,6 +4429,7 @@ function serializeAsCustomBlock(block, definition) {
4429
4429
  linksTo: i.linksTo
4430
4430
  };
4431
4431
  });
4432
+ const columns = _optionalChain([block, 'access', _10 => _10.data, 'access', _11 => _11.appearance, 'optionalAccess', _12 => _12.numberOfColumns]);
4432
4433
  return {
4433
4434
  type: "blockNode",
4434
4435
  attrs: {
@@ -4436,7 +4437,7 @@ function serializeAsCustomBlock(block, definition) {
4436
4437
  definitionId: block.data.packageId,
4437
4438
  variantId: block.data.variantId,
4438
4439
  items: JSON.stringify(items),
4439
- appearance: JSON.stringify(block.data.appearance)
4440
+ ...columns && { columns }
4440
4441
  }
4441
4442
  };
4442
4443
  }
@@ -5921,7 +5922,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
5921
5922
  value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
5922
5923
  if (listItem.type !== "listitem")
5923
5924
  return null;
5924
- if (!_optionalChain([listItem, 'access', _10 => _10.content, 'optionalAccess', _11 => _11.length]))
5925
+ if (!_optionalChain([listItem, 'access', _13 => _13.content, 'optionalAccess', _14 => _14.length]))
5925
5926
  return parseRichText([]);
5926
5927
  const paragraph = listItem.content[0];
5927
5928
  if (paragraph.type !== "paragraph")
@@ -5966,7 +5967,7 @@ function parseRichTextAttribute(mark) {
5966
5967
  const href = typeof hrefRaw === "string" ? hrefRaw : void 0;
5967
5968
  return {
5968
5969
  type: "Link",
5969
- openInNewWindow: _optionalChain([mark, 'access', _12 => _12.attrs, 'optionalAccess', _13 => _13.target]) !== "_self",
5970
+ openInNewWindow: _optionalChain([mark, 'access', _15 => _15.attrs, 'optionalAccess', _16 => _16.target]) !== "_self",
5970
5971
  documentationItemId: itemId,
5971
5972
  link: href
5972
5973
  };
@@ -5980,17 +5981,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
5980
5981
  const variantIdRaw = parseProsemirrorOptionalBlockAttribute(prosemirrorNode, "variantId");
5981
5982
  const variantId = typeof variantIdRaw === "string" ? variantIdRaw : void 0;
5982
5983
  const hasBorder = parseProsemirrorOptionalBlockAttribute(prosemirrorNode, "hasBorder") !== false;
5983
- const tableChild = _optionalChain([prosemirrorNode, 'access', _14 => _14.content, 'optionalAccess', _15 => _15.find, 'call', _16 => _16((c) => c.type === "table")]);
5984
+ const tableChild = _optionalChain([prosemirrorNode, 'access', _17 => _17.content, 'optionalAccess', _18 => _18.find, 'call', _19 => _19((c) => c.type === "table")]);
5984
5985
  if (!tableChild) {
5985
5986
  return emptyTable(id, variantId, 0);
5986
5987
  }
5987
- const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _17 => _17.content, 'optionalAccess', _18 => _18.filter, 'call', _19 => _19((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _20 => _20.content, 'optionalAccess', _21 => _21.length]))]), () => ( []));
5988
+ const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _20 => _20.content, 'optionalAccess', _21 => _21.filter, 'call', _22 => _22((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _23 => _23.content, 'optionalAccess', _24 => _24.length]))]), () => ( []));
5988
5989
  if (!rows.length) {
5989
5990
  return emptyTable(id, variantId, 0);
5990
5991
  }
5991
- const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _22 => _22[0], 'access', _23 => _23.content, 'optionalAccess', _24 => _24.filter, 'call', _25 => _25((c) => c.type === "tableHeader"), 'access', _26 => _26.length]), () => ( 0));
5992
- const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _27 => _27.content, 'optionalAccess', _28 => _28[0], 'optionalAccess', _29 => _29.type]) === "tableHeader").length;
5993
- const hasHeaderRow = _optionalChain([rows, 'access', _30 => _30[0], 'access', _31 => _31.content, 'optionalAccess', _32 => _32.length]) === rowHeaderCells;
5992
+ const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _25 => _25[0], 'access', _26 => _26.content, 'optionalAccess', _27 => _27.filter, 'call', _28 => _28((c) => c.type === "tableHeader"), 'access', _29 => _29.length]), () => ( 0));
5993
+ const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _30 => _30.content, 'optionalAccess', _31 => _31[0], 'optionalAccess', _32 => _32.type]) === "tableHeader").length;
5994
+ const hasHeaderRow = _optionalChain([rows, 'access', _33 => _33[0], 'access', _34 => _34.content, 'optionalAccess', _35 => _35.length]) === rowHeaderCells;
5994
5995
  const hasHeaderColumn = rows.length === columnHeaderCells;
5995
5996
  const tableValue = {
5996
5997
  showBorder: hasBorder,
@@ -6180,7 +6181,7 @@ function parseAsCustomBlock(prosemirrorNode, definition) {
6180
6181
  packageId: definition.id,
6181
6182
  indentLevel: 0,
6182
6183
  ...variantId && { variantId },
6183
- appearance,
6184
+ ...appearance && { appearance },
6184
6185
  items: parsedItems
6185
6186
  }
6186
6187
  };
@@ -6209,6 +6210,8 @@ function parseAppearance(prosemirrorNode) {
6209
6210
  appearance.itemBackgroundColor = parsedColor.data;
6210
6211
  }
6211
6212
  }
6213
+ if (!Object.keys(appearance).length)
6214
+ return void 0;
6212
6215
  return appearance;
6213
6216
  }
6214
6217
  function parseItem(rawItem, definition) {
@@ -6296,7 +6299,7 @@ function parseProsemirrorBlockAttribute(prosemirrorNode, attributeName) {
6296
6299
  return attributeValue;
6297
6300
  }
6298
6301
  function parseProsemirrorOptionalBlockAttribute(prosemirrorNode, attributeName) {
6299
- return _nullishCoalesce(_optionalChain([prosemirrorNode, 'access', _33 => _33.attrs, 'optionalAccess', _34 => _34[attributeName]]), () => ( void 0));
6302
+ return _nullishCoalesce(_optionalChain([prosemirrorNode, 'access', _36 => _36.attrs, 'optionalAccess', _37 => _37[attributeName]]), () => ( void 0));
6300
6303
  }
6301
6304
  function nonNullFilter2(item) {
6302
6305
  return item !== null;