@supernova-studio/client 0.47.61 → 0.47.63
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/utils/hash.ts +13 -3
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +2 -2
- package/src/yjs/version-room/frontend.ts +1 -3
- package/src/yjs/version-room/utils.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -5865,13 +5865,23 @@ function prepareObject(obj) {
|
|
|
5865
5865
|
}
|
|
5866
5866
|
return sortedObj;
|
|
5867
5867
|
}
|
|
5868
|
-
function generateHash(input) {
|
|
5868
|
+
function generateHash(input, debug = false) {
|
|
5869
5869
|
if (typeof input === "object") {
|
|
5870
|
-
|
|
5870
|
+
const sanitized = JSON.stringify(prepareObject(input));
|
|
5871
|
+
if (debug) {
|
|
5872
|
+
console.log("Hashing sanitized string:");
|
|
5873
|
+
console.log(sanitized);
|
|
5874
|
+
}
|
|
5875
|
+
return hash(sanitized);
|
|
5871
5876
|
} else {
|
|
5872
5877
|
try {
|
|
5873
5878
|
const obj = JSON.parse(input);
|
|
5874
|
-
|
|
5879
|
+
const sanitized = JSON.stringify(prepareObject(obj));
|
|
5880
|
+
if (debug) {
|
|
5881
|
+
console.log("Hashing sanitized string:");
|
|
5882
|
+
console.log(sanitized);
|
|
5883
|
+
}
|
|
5884
|
+
return hash(sanitized);
|
|
5875
5885
|
} catch {
|
|
5876
5886
|
return hash(input);
|
|
5877
5887
|
}
|
|
@@ -6018,8 +6028,8 @@ var VersionRoomBaseYDoc = class {
|
|
|
6018
6028
|
};
|
|
6019
6029
|
|
|
6020
6030
|
// src/yjs/version-room/utils.ts
|
|
6021
|
-
function generatePageContentHash(content) {
|
|
6022
|
-
return generateHash(content);
|
|
6031
|
+
function generatePageContentHash(content, debug = false) {
|
|
6032
|
+
return generateHash(content, debug);
|
|
6023
6033
|
}
|
|
6024
6034
|
|
|
6025
6035
|
// src/yjs/version-room/frontend.ts
|
|
@@ -6178,10 +6188,8 @@ var FrontendVersionRoomYDoc = class {
|
|
|
6178
6188
|
// Update page content hash
|
|
6179
6189
|
//
|
|
6180
6190
|
notifyDocumentationPageContentUpdated(pageId, content) {
|
|
6181
|
-
const pageContentHash = generatePageContentHash(content);
|
|
6191
|
+
const pageContentHash = generatePageContentHash(content, this.debug);
|
|
6182
6192
|
if (this.debug) {
|
|
6183
|
-
console.log("Hashed:");
|
|
6184
|
-
console.log(JSON.stringify(content));
|
|
6185
6193
|
console.log(`Will set page content hash: '${pageId}' : '${pageContentHash}'`);
|
|
6186
6194
|
}
|
|
6187
6195
|
new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({
|
|
@@ -10148,10 +10156,10 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
10148
10156
|
return {
|
|
10149
10157
|
id,
|
|
10150
10158
|
type: "Block",
|
|
10151
|
-
...variantId && { variantId },
|
|
10152
10159
|
data: {
|
|
10153
10160
|
packageId: definition.id,
|
|
10154
10161
|
indentLevel: 0,
|
|
10162
|
+
...variantId && { variantId },
|
|
10155
10163
|
items: [
|
|
10156
10164
|
{
|
|
10157
10165
|
id,
|
|
@@ -10348,6 +10356,7 @@ function parseAsTableCell(prosemirrorNode) {
|
|
|
10348
10356
|
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z217.array(z217.number()).optional());
|
|
10349
10357
|
if (columnWidthArray) {
|
|
10350
10358
|
columnWidth = columnWidthArray[0];
|
|
10359
|
+
columnWidth = Math.round(columnWidth * 100) / 100;
|
|
10351
10360
|
}
|
|
10352
10361
|
const tableNodes = (prosemirrorNode.content ?? []).map(parseAsTableNode).filter(nonNullFilter);
|
|
10353
10362
|
return {
|