@ai-matrx/office 0.8.18 → 0.8.19
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/CHANGELOG.md +5 -0
- package/dist/univer-collab.cjs +23 -0
- package/dist/univer-collab.cjs.map +1 -1
- package/dist/univer-collab.js +23 -0
- package/dist/univer-collab.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.19
|
|
4
|
+
### C7a: the browser editor's plugin resources
|
|
5
|
+
|
|
6
|
+
- **Docs state hash: plugin resources by content, zoom never.** The browser editor (full docs preset) writes one `resources` entry per plugin on every save (`"[]"`, `""`, `{"links":[]}`, `{"data":{},"order":[]}`) and `settings.zoomRatio`; a stored row and a headless load have neither, so live seats still refused a restore after 0.8.18. The canonical form now parses each resource, drops empty ones, sorts by name, and drops the zoom. Forcing case: the live row and what the browser held after loading it (red on 0.8.18, green). Consumer action: none.
|
|
7
|
+
|
|
3
8
|
## 0.8.18
|
|
4
9
|
### C7a restore hash, stale checkpoints, collaborator colours
|
|
5
10
|
|
package/dist/univer-collab.cjs
CHANGED
|
@@ -1134,9 +1134,32 @@ function asLoadedDocsSnapshot(snapshot) {
|
|
|
1134
1134
|
model.dispose();
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
|
+
var isEmptyDeep = (v) => v == null || v === "" || (Array.isArray(v) ? v.every(isEmptyDeep) : typeof v === "object" ? Object.values(v).every(isEmptyDeep) : false);
|
|
1138
|
+
function canonicalResources(resources) {
|
|
1139
|
+
if (!Array.isArray(resources)) return [];
|
|
1140
|
+
const out = [];
|
|
1141
|
+
for (const r of resources) {
|
|
1142
|
+
if (!r || typeof r.name !== "string") continue;
|
|
1143
|
+
let data = r.data;
|
|
1144
|
+
if (typeof data === "string" && data !== "") {
|
|
1145
|
+
try {
|
|
1146
|
+
data = JSON.parse(data);
|
|
1147
|
+
} catch {
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
if (isEmptyDeep(data)) continue;
|
|
1151
|
+
out.push({ name: r.name, data: sortDeep(data) });
|
|
1152
|
+
}
|
|
1153
|
+
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
1154
|
+
}
|
|
1137
1155
|
function canonicalDocsSnapshot(snapshot) {
|
|
1138
1156
|
const s = asLoadedDocsSnapshot(snapshot);
|
|
1139
1157
|
delete s.id;
|
|
1158
|
+
s.resources = canonicalResources(s.resources);
|
|
1159
|
+
if (s.settings && typeof s.settings === "object") {
|
|
1160
|
+
s.settings = { ...s.settings };
|
|
1161
|
+
delete s.settings.zoomRatio;
|
|
1162
|
+
}
|
|
1140
1163
|
for (const k of DOC_LOCAL_KEYS) delete s[k];
|
|
1141
1164
|
s.body = canonicalBody(s.body);
|
|
1142
1165
|
for (const seg of ["headers", "footers", "notes"]) {
|