@supernova-studio/client 0.20.1 → 0.21.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.d.mts +1503 -5407
- package/dist/index.d.ts +1503 -5407
- package/dist/index.js +23 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +1 -1
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +5 -2
package/dist/index.js
CHANGED
|
@@ -884,24 +884,20 @@ var PageBlockV1 = PageBlockBaseV1.extend({
|
|
|
884
884
|
)
|
|
885
885
|
});
|
|
886
886
|
var PageBlockLinkType = _zod.z.enum(["DocumentationItem", "PageHeading", "Url"]);
|
|
887
|
-
var PageBlockImageType = _zod.z.enum(["
|
|
887
|
+
var PageBlockImageType = _zod.z.enum(["Resource", "FigmaNode"]);
|
|
888
888
|
var PageBlockImageAlignment = _zod.z.enum(["Left", "Center", "Stretch"]);
|
|
889
889
|
var PageBlockTableCellAlignment = _zod.z.enum(["Left", "Center", "Right"]);
|
|
890
890
|
var PageBlockPreviewContainerSize = _zod.z.enum(["Centered", "NaturalHeight"]);
|
|
891
891
|
var PageBlockThemeDisplayMode = _zod.z.enum(["Split", "Override"]);
|
|
892
892
|
var PageBlockImageReference = _zod.z.object({
|
|
893
893
|
type: PageBlockImageType,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
resource: _zod.z.object({
|
|
895
|
+
url: _zod.z.string(),
|
|
896
|
+
resourceId: _zod.z.string()
|
|
897
|
+
}).optional(),
|
|
897
898
|
figmaFile: _zod.z.object({
|
|
898
899
|
sourceId: _zod.z.string(),
|
|
899
|
-
|
|
900
|
-
frameReferenceId: _zod.z.string(),
|
|
901
|
-
origin: _zod.z.object({
|
|
902
|
-
title: _zod.z.string().optional(),
|
|
903
|
-
sourceFileName: _zod.z.string().optional()
|
|
904
|
-
})
|
|
900
|
+
frameReferenceId: _zod.z.string()
|
|
905
901
|
}).optional()
|
|
906
902
|
});
|
|
907
903
|
var PageBlockColorV2 = _zod.z.object({
|
|
@@ -1162,7 +1158,7 @@ var DocumentationItemHeaderV2 = _zod.z.object({
|
|
|
1162
1158
|
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
1163
1159
|
foregroundColor: PageBlockColorV2.nullish(),
|
|
1164
1160
|
backgroundColor: PageBlockColorV2.nullish(),
|
|
1165
|
-
backgroundImageAsset:
|
|
1161
|
+
backgroundImageAsset: PageBlockImageReference.nullish(),
|
|
1166
1162
|
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
1167
1163
|
showBackgroundOverlay: _zod.z.boolean(),
|
|
1168
1164
|
showCoverText: _zod.z.boolean(),
|
|
@@ -5027,7 +5023,7 @@ function serializeTableNode(node) {
|
|
|
5027
5023
|
return {
|
|
5028
5024
|
type: "image",
|
|
5029
5025
|
attrs: {
|
|
5030
|
-
src: _optionalChain([node, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.url])
|
|
5026
|
+
src: _optionalChain([node, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.resource, 'optionalAccess', _14 => _14.url])
|
|
5031
5027
|
}
|
|
5032
5028
|
};
|
|
5033
5029
|
}
|
|
@@ -5047,7 +5043,7 @@ function serializeBlockNodeAttributes(input) {
|
|
|
5047
5043
|
};
|
|
5048
5044
|
}
|
|
5049
5045
|
function richTextHeadingLevel(property) {
|
|
5050
|
-
const style = _optionalChain([property, 'access',
|
|
5046
|
+
const style = _optionalChain([property, 'access', _15 => _15.options, 'optionalAccess', _16 => _16.richTextStyle]);
|
|
5051
5047
|
if (!style)
|
|
5052
5048
|
return void 0;
|
|
5053
5049
|
switch (style) {
|
|
@@ -5145,7 +5141,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
5145
5141
|
linksTo: i.linksTo
|
|
5146
5142
|
};
|
|
5147
5143
|
});
|
|
5148
|
-
const columns = _optionalChain([block, 'access',
|
|
5144
|
+
const columns = _optionalChain([block, 'access', _17 => _17.data, 'access', _18 => _18.appearance, 'optionalAccess', _19 => _19.numberOfColumns]);
|
|
5149
5145
|
return {
|
|
5150
5146
|
type: "blockNode",
|
|
5151
5147
|
attrs: {
|
|
@@ -7771,7 +7767,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
|
7771
7767
|
value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
|
|
7772
7768
|
if (listItem.type !== "listItem")
|
|
7773
7769
|
return null;
|
|
7774
|
-
if (!_optionalChain([listItem, 'access',
|
|
7770
|
+
if (!_optionalChain([listItem, 'access', _20 => _20.content, 'optionalAccess', _21 => _21.length]))
|
|
7775
7771
|
return parseRichText([]);
|
|
7776
7772
|
const paragraph = listItem.content[0];
|
|
7777
7773
|
if (paragraph.type !== "paragraph")
|
|
@@ -7814,7 +7810,7 @@ function parseRichTextAttribute(mark) {
|
|
|
7814
7810
|
const href = getProsemirrorAttribute(mark, "href", _zod.z.string().optional());
|
|
7815
7811
|
return {
|
|
7816
7812
|
type: "Link",
|
|
7817
|
-
openInNewWindow: _optionalChain([mark, 'access',
|
|
7813
|
+
openInNewWindow: _optionalChain([mark, 'access', _22 => _22.attrs, 'optionalAccess', _23 => _23.target]) !== "_self",
|
|
7818
7814
|
documentationItemId: itemId,
|
|
7819
7815
|
link: href
|
|
7820
7816
|
};
|
|
@@ -7827,17 +7823,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
7827
7823
|
return null;
|
|
7828
7824
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7829
7825
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
7830
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
7826
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _24 => _24.content, 'optionalAccess', _25 => _25.find, 'call', _26 => _26((c) => c.type === "table")]);
|
|
7831
7827
|
if (!tableChild) {
|
|
7832
7828
|
return emptyTable(id, variantId, 0);
|
|
7833
7829
|
}
|
|
7834
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
7830
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _27 => _27.content, 'optionalAccess', _28 => _28.filter, 'call', _29 => _29((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _30 => _30.content, 'optionalAccess', _31 => _31.length]))]), () => ( []));
|
|
7835
7831
|
if (!rows.length) {
|
|
7836
7832
|
return emptyTable(id, variantId, 0);
|
|
7837
7833
|
}
|
|
7838
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
7839
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
7840
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
7834
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _32 => _32[0], 'access', _33 => _33.content, 'optionalAccess', _34 => _34.filter, 'call', _35 => _35((c) => c.type === "tableHeader"), 'access', _36 => _36.length]), () => ( 0));
|
|
7835
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _37 => _37.content, 'optionalAccess', _38 => _38[0], 'optionalAccess', _39 => _39.type]) === "tableHeader").length;
|
|
7836
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _40 => _40[0], 'access', _41 => _41.content, 'optionalAccess', _42 => _42.length]) === rowHeaderCells;
|
|
7841
7837
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
7842
7838
|
const tableValue = {
|
|
7843
7839
|
showBorder: hasBorder,
|
|
@@ -7914,8 +7910,11 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
7914
7910
|
return {
|
|
7915
7911
|
type: "Image",
|
|
7916
7912
|
value: {
|
|
7917
|
-
type: "
|
|
7918
|
-
|
|
7913
|
+
type: "Resource",
|
|
7914
|
+
resource: {
|
|
7915
|
+
resourceId: "",
|
|
7916
|
+
url
|
|
7917
|
+
}
|
|
7919
7918
|
}
|
|
7920
7919
|
};
|
|
7921
7920
|
default:
|
|
@@ -8118,7 +8117,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
8118
8117
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
8119
8118
|
}
|
|
8120
8119
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8121
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
8120
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _43 => _43.attrs, 'optionalAccess', _44 => _44[attributeName]]));
|
|
8122
8121
|
if (parsedAttr.success) {
|
|
8123
8122
|
return parsedAttr.data;
|
|
8124
8123
|
} else {
|