@supernova-studio/client 0.47.64 → 0.47.66
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 +22 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/version-room/frontend.ts +5 -5
package/dist/index.js
CHANGED
|
@@ -6104,14 +6104,14 @@ var FrontendVersionRoomYDoc = class {
|
|
|
6104
6104
|
);
|
|
6105
6105
|
const result = /* @__PURE__ */ new Map();
|
|
6106
6106
|
pages.forEach((page) => {
|
|
6107
|
-
const currentPageContentHash = _nullishCoalesce(pageHashes[page.persistentId], () => ( ""));
|
|
6108
|
-
const currentState = this.itemStateFromPage(page, currentPageContentHash);
|
|
6109
6107
|
const snapshot = publishedSnapshotsByPageId.get(page.id);
|
|
6110
6108
|
let publishedState;
|
|
6111
6109
|
if (snapshot) {
|
|
6112
6110
|
const publishedPage = publishedPagesById.get(snapshot.page.id);
|
|
6113
6111
|
publishedState = this.itemStateFromPage(publishedPage, snapshot.pageContentHash);
|
|
6114
6112
|
}
|
|
6113
|
+
const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _35 => _35.pageContentHash]))), () => ( ""));
|
|
6114
|
+
const currentState = this.itemStateFromPage(page, currentPageContentHash);
|
|
6115
6115
|
const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
|
|
6116
6116
|
if (draftState)
|
|
6117
6117
|
result.set(page.id, draftState);
|
|
@@ -6154,7 +6154,7 @@ var FrontendVersionRoomYDoc = class {
|
|
|
6154
6154
|
itemStateFromGroup(group) {
|
|
6155
6155
|
return {
|
|
6156
6156
|
title: group.meta.name,
|
|
6157
|
-
configuration: _optionalChain([group, 'access',
|
|
6157
|
+
configuration: _optionalChain([group, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.configuration]),
|
|
6158
6158
|
contentHash: "-"
|
|
6159
6159
|
};
|
|
6160
6160
|
}
|
|
@@ -6188,7 +6188,7 @@ var FrontendVersionRoomYDoc = class {
|
|
|
6188
6188
|
}
|
|
6189
6189
|
updatedDraftState.changes.previousContentHash = publishedState.contentHash;
|
|
6190
6190
|
}
|
|
6191
|
-
if (Object.keys(updatedDraftState).length) {
|
|
6191
|
+
if (Object.keys(updatedDraftState.changes).length) {
|
|
6192
6192
|
return updatedDraftState;
|
|
6193
6193
|
}
|
|
6194
6194
|
return void 0;
|
|
@@ -6237,7 +6237,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
|
|
|
6237
6237
|
function itemConfigurationToYjs(yDoc, item) {
|
|
6238
6238
|
yDoc.transact((trx) => {
|
|
6239
6239
|
const { title, configuration } = item;
|
|
6240
|
-
const header = _optionalChain([configuration, 'optionalAccess',
|
|
6240
|
+
const header = _optionalChain([configuration, 'optionalAccess', _38 => _38.header]);
|
|
6241
6241
|
if (title !== void 0) {
|
|
6242
6242
|
const headerYMap = trx.doc.getMap("itemTitle");
|
|
6243
6243
|
headerYMap.set("title", title);
|
|
@@ -6255,9 +6255,9 @@ function itemConfigurationToYjs(yDoc, item) {
|
|
|
6255
6255
|
header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
|
|
6256
6256
|
}
|
|
6257
6257
|
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
6258
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
6259
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
6260
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
6258
|
+
_optionalChain([configuration, 'optionalAccess', _39 => _39.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
|
|
6259
|
+
_optionalChain([configuration, 'optionalAccess', _40 => _40.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
|
|
6260
|
+
_optionalChain([configuration, 'optionalAccess', _41 => _41.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
|
|
6261
6261
|
});
|
|
6262
6262
|
}
|
|
6263
6263
|
function yjsToItemConfiguration(yDoc) {
|
|
@@ -7049,7 +7049,7 @@ var ListTreeBuilder = class {
|
|
|
7049
7049
|
}
|
|
7050
7050
|
addWithProperty(block, multiRichTextProperty) {
|
|
7051
7051
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
7052
|
-
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess',
|
|
7052
|
+
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _42 => _42.multiRichTextStyle]) || "OL");
|
|
7053
7053
|
}
|
|
7054
7054
|
add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
|
|
7055
7055
|
const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
|
|
@@ -7069,7 +7069,7 @@ var ListTreeBuilder = class {
|
|
|
7069
7069
|
}
|
|
7070
7070
|
const listParent = this.getParentOfDepth(block.data.indentLevel);
|
|
7071
7071
|
const lastChild = listParent.children[listParent.children.length - 1];
|
|
7072
|
-
if (_optionalChain([lastChild, 'optionalAccess',
|
|
7072
|
+
if (_optionalChain([lastChild, 'optionalAccess', _43 => _43.type]) === "List") {
|
|
7073
7073
|
lastChild.children.push(...list.leadingChildren);
|
|
7074
7074
|
return;
|
|
7075
7075
|
} else {
|
|
@@ -7253,7 +7253,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
7253
7253
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
7254
7254
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
7255
7255
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
7256
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
7256
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _44 => _44.richTextStyle]), () => ( "Default"));
|
|
7257
7257
|
switch (style) {
|
|
7258
7258
|
case "Callout":
|
|
7259
7259
|
return serializeAsCallout(enrichedInput);
|
|
@@ -7475,7 +7475,7 @@ function serializeBlockNodeAttributes(block) {
|
|
|
7475
7475
|
};
|
|
7476
7476
|
}
|
|
7477
7477
|
function richTextHeadingLevel(property) {
|
|
7478
|
-
const style = _optionalChain([property, 'access',
|
|
7478
|
+
const style = _optionalChain([property, 'access', _45 => _45.options, 'optionalAccess', _46 => _46.richTextStyle]);
|
|
7479
7479
|
if (!style)
|
|
7480
7480
|
return void 0;
|
|
7481
7481
|
switch (style) {
|
|
@@ -7588,7 +7588,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
7588
7588
|
linksTo: i.linksTo
|
|
7589
7589
|
};
|
|
7590
7590
|
});
|
|
7591
|
-
const columns = _optionalChain([block, 'access',
|
|
7591
|
+
const columns = _optionalChain([block, 'access', _47 => _47.data, 'access', _48 => _48.appearance, 'optionalAccess', _49 => _49.numberOfColumns]);
|
|
7592
7592
|
return {
|
|
7593
7593
|
type: serializeCustomBlockNodeType(block, definition),
|
|
7594
7594
|
attrs: {
|
|
@@ -10208,10 +10208,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
|
|
|
10208
10208
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
10209
10209
|
const result = [];
|
|
10210
10210
|
const listItems = [];
|
|
10211
|
-
_optionalChain([prosemirrorNode, 'access',
|
|
10211
|
+
_optionalChain([prosemirrorNode, 'access', _50 => _50.content, 'optionalAccess', _51 => _51.forEach, 'call', _52 => _52((c) => {
|
|
10212
10212
|
if (c.type !== "listItem")
|
|
10213
10213
|
return;
|
|
10214
|
-
_optionalChain([c, 'access',
|
|
10214
|
+
_optionalChain([c, 'access', _53 => _53.content, 'optionalAccess', _54 => _54.forEach, 'call', _55 => _55((cc) => {
|
|
10215
10215
|
listItems.push(cc);
|
|
10216
10216
|
})]);
|
|
10217
10217
|
})]);
|
|
@@ -10314,17 +10314,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
10314
10314
|
return null;
|
|
10315
10315
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
10316
10316
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
10317
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
10317
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _56 => _56.content, 'optionalAccess', _57 => _57.find, 'call', _58 => _58((c) => c.type === "table")]);
|
|
10318
10318
|
if (!tableChild) {
|
|
10319
10319
|
return emptyTable(id, variantId, 0);
|
|
10320
10320
|
}
|
|
10321
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
10321
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _59 => _59.content, 'optionalAccess', _60 => _60.filter, 'call', _61 => _61((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _62 => _62.content, 'optionalAccess', _63 => _63.length]))]), () => ( []));
|
|
10322
10322
|
if (!rows.length) {
|
|
10323
10323
|
return emptyTable(id, variantId, 0);
|
|
10324
10324
|
}
|
|
10325
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
10326
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
10327
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
10325
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _64 => _64[0], 'access', _65 => _65.content, 'optionalAccess', _66 => _66.filter, 'call', _67 => _67((c) => c.type === "tableHeader"), 'access', _68 => _68.length]), () => ( 0));
|
|
10326
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _69 => _69.content, 'optionalAccess', _70 => _70[0], 'optionalAccess', _71 => _71.type]) === "tableHeader").length;
|
|
10327
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _72 => _72[0], 'access', _73 => _73.content, 'optionalAccess', _74 => _74.length]) === rowHeaderCells;
|
|
10328
10328
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
10329
10329
|
const tableValue = {
|
|
10330
10330
|
showBorder: hasBorder,
|
|
@@ -10407,7 +10407,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
10407
10407
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
10408
10408
|
if (!parsedItems.success)
|
|
10409
10409
|
return null;
|
|
10410
|
-
const rawImagePropertyValue = _optionalChain([parsedItems, 'access',
|
|
10410
|
+
const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _75 => _75.data, 'access', _76 => _76[0], 'optionalAccess', _77 => _77.props, 'access', _78 => _78.image]);
|
|
10411
10411
|
if (!rawImagePropertyValue)
|
|
10412
10412
|
return null;
|
|
10413
10413
|
const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
|
|
@@ -10643,7 +10643,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
10643
10643
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
10644
10644
|
}
|
|
10645
10645
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
10646
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
10646
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _79 => _79.attrs, 'optionalAccess', _80 => _80[attributeName]]));
|
|
10647
10647
|
if (parsedAttr.success) {
|
|
10648
10648
|
return parsedAttr.data;
|
|
10649
10649
|
} else {
|