@fiduswriter/frontend 0.1.65 → 0.1.67
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/documents/overview/index.js +1 -1
- package/dist/documents/revisions/index.js +6 -6
- package/dist/maintenance/index.js +4 -4
- package/dist/workers/adjust_doc_to_template.d.ts.map +1 -1
- package/dist/workers/adjust_doc_to_template.js +13 -6
- package/dist/workers/adjust_doc_to_template.js.map +1 -1
- package/locale/ar/messages.json +10 -10
- package/locale/bg/messages.json +10 -10
- package/locale/cs/messages.json +10 -10
- package/locale/da/messages.json +10 -10
- package/locale/de/messages.json +10 -10
- package/locale/en/messages.json +10 -10
- package/locale/en_US/messages.json +10 -10
- package/locale/es/messages.json +10 -10
- package/locale/fr/messages.json +10 -10
- package/locale/it/messages.json +10 -10
- package/locale/ja/messages.json +10 -10
- package/locale/ko/messages.json +10 -10
- package/locale/nb/messages.json +10 -10
- package/locale/nl/messages.json +10 -10
- package/locale/pl/messages.json +10 -10
- package/locale/pt_BR/messages.json +10 -10
- package/locale/pt_PT/messages.json +10 -10
- package/locale/ru/messages.json +10 -10
- package/locale/sv/messages.json +10 -10
- package/locale/tr/messages.json +10 -10
- package/locale/zh_Hans/messages.json +10 -10
- package/package.json +4 -4
- package/src/documents/overview/index.ts +1 -1
- package/src/documents/revisions/index.ts +6 -6
- package/src/maintenance/index.ts +4 -4
- package/src/workers/adjust_doc_to_template.ts +18 -12
|
@@ -24,18 +24,24 @@ export class AdjustDocToTemplateWorker {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
init(): void {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
try {
|
|
28
|
+
const stateDoc = this.schema.nodeFromJSON(this.doc)
|
|
29
|
+
const newStateDoc = this.schema.nodeFromJSON(
|
|
30
|
+
adjustDocToTemplate(
|
|
31
|
+
this.doc as any,
|
|
32
|
+
this.template as any,
|
|
33
|
+
this.documentStyleSlugs,
|
|
34
|
+
this.schema
|
|
35
|
+
)
|
|
34
36
|
)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const transform = recreateTransform(stateDoc, newStateDoc)
|
|
38
|
+
const steps: Array<Record<string, unknown>> = []
|
|
39
|
+
transform.steps.forEach((step: any) => steps.push(step.toJSON()))
|
|
40
|
+
this.sendMessage({type: "result", steps})
|
|
41
|
+
} catch (error) {
|
|
42
|
+
// Report the failure so the editor can clear its wait cover
|
|
43
|
+
// instead of waiting forever for a result message.
|
|
44
|
+
this.sendMessage({type: "error", error: String(error)})
|
|
45
|
+
}
|
|
40
46
|
}
|
|
41
47
|
}
|