@supernova-studio/client 0.44.0 → 0.45.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/dist/index.js
CHANGED
|
@@ -4832,7 +4832,9 @@ function documentationHierarchyToYjs(doc, transaction) {
|
|
|
4832
4832
|
transaction.pages.forEach((page) => {
|
|
4833
4833
|
const sanitizedPage = {
|
|
4834
4834
|
...page,
|
|
4835
|
-
data: {
|
|
4835
|
+
data: {
|
|
4836
|
+
configuration: page.data.configuration
|
|
4837
|
+
}
|
|
4836
4838
|
};
|
|
4837
4839
|
pagesMap.set(page.id, JSON.parse(JSON.stringify(sanitizedPage)));
|
|
4838
4840
|
});
|
|
@@ -4841,13 +4843,7 @@ function documentationHierarchyToYjs(doc, transaction) {
|
|
|
4841
4843
|
groupsMap.delete(id);
|
|
4842
4844
|
});
|
|
4843
4845
|
transaction.groups.forEach((group) => {
|
|
4844
|
-
|
|
4845
|
-
...group,
|
|
4846
|
-
data: {
|
|
4847
|
-
behavior: _optionalChain([group, 'access', _14 => _14.data, 'optionalAccess', _15 => _15.behavior])
|
|
4848
|
-
}
|
|
4849
|
-
};
|
|
4850
|
-
groupsMap.set(group.id, JSON.parse(JSON.stringify(sanitizedGroup)));
|
|
4846
|
+
groupsMap.set(group.id, JSON.parse(JSON.stringify(group)));
|
|
4851
4847
|
});
|
|
4852
4848
|
if (transaction.internalSettings) {
|
|
4853
4849
|
serializeDocumentationInternalSettings(trx.doc, transaction.internalSettings);
|
|
@@ -4908,7 +4904,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
|
|
|
4908
4904
|
function itemConfigurationToYjs(yDoc, item) {
|
|
4909
4905
|
yDoc.transact((trx) => {
|
|
4910
4906
|
const { title, configuration } = item;
|
|
4911
|
-
const header = _optionalChain([configuration, 'optionalAccess',
|
|
4907
|
+
const header = _optionalChain([configuration, 'optionalAccess', _14 => _14.header]);
|
|
4912
4908
|
if (title !== void 0) {
|
|
4913
4909
|
const headerYMap = trx.doc.getMap("itemTitle");
|
|
4914
4910
|
headerYMap.set("title", title);
|
|
@@ -4926,9 +4922,9 @@ function itemConfigurationToYjs(yDoc, item) {
|
|
|
4926
4922
|
header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
|
|
4927
4923
|
}
|
|
4928
4924
|
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
4929
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
4930
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
4931
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
4925
|
+
_optionalChain([configuration, 'optionalAccess', _15 => _15.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
|
|
4926
|
+
_optionalChain([configuration, 'optionalAccess', _16 => _16.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
|
|
4927
|
+
_optionalChain([configuration, 'optionalAccess', _17 => _17.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
|
|
4932
4928
|
});
|
|
4933
4929
|
}
|
|
4934
4930
|
function yjsToItemConfiguration(yDoc) {
|
|
@@ -5717,7 +5713,7 @@ var BlockDefinitionUtils = {
|
|
|
5717
5713
|
var ListTreeBuilder = class {
|
|
5718
5714
|
addWithProperty(block, multiRichTextProperty) {
|
|
5719
5715
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
5720
|
-
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess',
|
|
5716
|
+
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _18 => _18.multiRichTextStyle]) || "OL");
|
|
5721
5717
|
}
|
|
5722
5718
|
add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
|
|
5723
5719
|
const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
|
|
@@ -5737,7 +5733,7 @@ var ListTreeBuilder = class {
|
|
|
5737
5733
|
}
|
|
5738
5734
|
const listParent = this.getParentOfDepth(block.data.indentLevel);
|
|
5739
5735
|
const lastChild = listParent.children[listParent.children.length - 1];
|
|
5740
|
-
if (_optionalChain([lastChild, 'optionalAccess',
|
|
5736
|
+
if (_optionalChain([lastChild, 'optionalAccess', _19 => _19.type]) === "List") {
|
|
5741
5737
|
lastChild.children.push(...list.leadingChildren);
|
|
5742
5738
|
return;
|
|
5743
5739
|
} else {
|
|
@@ -5921,7 +5917,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
5921
5917
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
5922
5918
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
5923
5919
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
5924
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
5920
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _20 => _20.richTextStyle]), () => ( "Default"));
|
|
5925
5921
|
switch (style) {
|
|
5926
5922
|
case "Callout":
|
|
5927
5923
|
return serializeAsCallout(enrichedInput);
|
|
@@ -6142,7 +6138,7 @@ function serializeBlockNodeAttributes(block) {
|
|
|
6142
6138
|
};
|
|
6143
6139
|
}
|
|
6144
6140
|
function richTextHeadingLevel(property) {
|
|
6145
|
-
const style = _optionalChain([property, 'access',
|
|
6141
|
+
const style = _optionalChain([property, 'access', _21 => _21.options, 'optionalAccess', _22 => _22.richTextStyle]);
|
|
6146
6142
|
if (!style)
|
|
6147
6143
|
return void 0;
|
|
6148
6144
|
switch (style) {
|
|
@@ -6255,7 +6251,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
6255
6251
|
linksTo: i.linksTo
|
|
6256
6252
|
};
|
|
6257
6253
|
});
|
|
6258
|
-
const columns = _optionalChain([block, 'access',
|
|
6254
|
+
const columns = _optionalChain([block, 'access', _23 => _23.data, 'access', _24 => _24.appearance, 'optionalAccess', _25 => _25.numberOfColumns]);
|
|
6259
6255
|
return {
|
|
6260
6256
|
type: serializeCustomBlockNodeType(block, definition),
|
|
6261
6257
|
attrs: {
|
|
@@ -8102,10 +8098,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
|
|
|
8102
8098
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8103
8099
|
const result = [];
|
|
8104
8100
|
const listItems = [];
|
|
8105
|
-
_optionalChain([prosemirrorNode, 'access',
|
|
8101
|
+
_optionalChain([prosemirrorNode, 'access', _26 => _26.content, 'optionalAccess', _27 => _27.forEach, 'call', _28 => _28((c) => {
|
|
8106
8102
|
if (c.type !== "listItem")
|
|
8107
8103
|
return;
|
|
8108
|
-
_optionalChain([c, 'access',
|
|
8104
|
+
_optionalChain([c, 'access', _29 => _29.content, 'optionalAccess', _30 => _30.forEach, 'call', _31 => _31((cc) => {
|
|
8109
8105
|
listItems.push(cc);
|
|
8110
8106
|
})]);
|
|
8111
8107
|
})]);
|
|
@@ -8208,17 +8204,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
8208
8204
|
return null;
|
|
8209
8205
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8210
8206
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
8211
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
8207
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _32 => _32.content, 'optionalAccess', _33 => _33.find, 'call', _34 => _34((c) => c.type === "table")]);
|
|
8212
8208
|
if (!tableChild) {
|
|
8213
8209
|
return emptyTable(id, variantId, 0);
|
|
8214
8210
|
}
|
|
8215
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
8211
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _35 => _35.content, 'optionalAccess', _36 => _36.filter, 'call', _37 => _37((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _38 => _38.content, 'optionalAccess', _39 => _39.length]))]), () => ( []));
|
|
8216
8212
|
if (!rows.length) {
|
|
8217
8213
|
return emptyTable(id, variantId, 0);
|
|
8218
8214
|
}
|
|
8219
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
8220
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
8221
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
8215
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _40 => _40[0], 'access', _41 => _41.content, 'optionalAccess', _42 => _42.filter, 'call', _43 => _43((c) => c.type === "tableHeader"), 'access', _44 => _44.length]), () => ( 0));
|
|
8216
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _45 => _45.content, 'optionalAccess', _46 => _46[0], 'optionalAccess', _47 => _47.type]) === "tableHeader").length;
|
|
8217
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _48 => _48[0], 'access', _49 => _49.content, 'optionalAccess', _50 => _50.length]) === rowHeaderCells;
|
|
8222
8218
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
8223
8219
|
const tableValue = {
|
|
8224
8220
|
showBorder: hasBorder,
|
|
@@ -8300,7 +8296,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
8300
8296
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
8301
8297
|
if (!parsedItems.success)
|
|
8302
8298
|
return null;
|
|
8303
|
-
const rawImagePropertyValue = _optionalChain([parsedItems, 'access',
|
|
8299
|
+
const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _51 => _51.data, 'access', _52 => _52[0], 'optionalAccess', _53 => _53.props, 'access', _54 => _54.image]);
|
|
8304
8300
|
if (!rawImagePropertyValue)
|
|
8305
8301
|
return null;
|
|
8306
8302
|
const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
|
|
@@ -8522,7 +8518,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
8522
8518
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
8523
8519
|
}
|
|
8524
8520
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8525
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
8521
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _55 => _55.attrs, 'optionalAccess', _56 => _56[attributeName]]));
|
|
8526
8522
|
if (parsedAttr.success) {
|
|
8527
8523
|
return parsedAttr.data;
|
|
8528
8524
|
} else {
|