@fiduswriter/frontend 0.1.66 → 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/css/document-template-editor/document_template_designer.css +68 -68
- package/dist/css/image-manager/dialog_usermedia.css +41 -41
- 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/package.json +4 -4
- package/src/workers/adjust_doc_to_template.ts +18 -12
|
@@ -3,89 +3,89 @@
|
|
|
3
3
|
standalone embeds get the canonical scheme so the drag & drop palette
|
|
4
4
|
stays readable. */
|
|
5
5
|
:root {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
--part-neutral-background-color: #f0f8ff;
|
|
7
|
+
--part-neutral-border-color: #000000;
|
|
8
|
+
--part-heading-background-color: #84c4fe;
|
|
9
|
+
--part-contributors-background-color: #928efe;
|
|
10
|
+
--part-richtext-background-color: #ffc87b;
|
|
11
|
+
--part-tags-background-color: #ffdf7b;
|
|
12
|
+
--part-table-background-color: #bfedc1;
|
|
13
|
+
--part-toc-background-color: #985f99;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
table td {
|
|
17
|
-
|
|
17
|
+
vertical-align: top;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.label {
|
|
21
|
-
|
|
21
|
+
padding: 5px 0;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.from-container,
|
|
25
25
|
.to-column,
|
|
26
26
|
.trash {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
border: 1px solid var(--cs-white-border);
|
|
28
|
+
background-color: var(--cs-white-background);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.to-container {
|
|
32
|
-
|
|
32
|
+
min-height: 500px;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.to-column .smooth-dnd-draggable-wrapper {
|
|
36
|
-
|
|
36
|
+
overflow: visible !important;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.to-column {
|
|
40
|
-
|
|
40
|
+
width: 650px;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.to-column .doc-part table td {
|
|
44
|
-
|
|
44
|
+
border: 1px solid var(--cs-white-border);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.from-container {
|
|
48
|
-
|
|
48
|
+
width: 150px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.trash {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
background-color: var(--cs-dark-background);
|
|
53
|
+
width: 100px;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.doc-part-block {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
background-color: var(--part-neutral-background-color);
|
|
58
|
+
border-bottom: 3px dotted var(--part-neutral-border-color);
|
|
59
|
+
padding: 4px;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.doc-part-block[data-type="heading_part"] {
|
|
63
|
-
|
|
63
|
+
background-color: var(--part-heading-background-color);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.doc-part-block[data-type="contributors_part"] {
|
|
67
|
-
|
|
67
|
+
background-color: var(--part-contributors-background-color);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.doc-part-block[data-type="richtext_part"] {
|
|
71
|
-
|
|
71
|
+
background-color: var(--part-richtext-background-color);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.doc-part[data-type="tags_part"] {
|
|
75
|
-
|
|
75
|
+
background-color: var(--part-tags-background-color);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.doc-part-block[data-type="table_part"] {
|
|
79
|
-
|
|
79
|
+
background-color: var(--part-table-background-color);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.doc-part-block[data-type="table_of_contents"] {
|
|
83
|
-
|
|
83
|
+
background-color: var(--part-toc-background-color);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.from-container .doc-part-block,
|
|
87
87
|
.trash .doc-part-block {
|
|
88
|
-
|
|
88
|
+
height: 50px;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
.from-container .attrs,
|
|
@@ -94,120 +94,120 @@ table td {
|
|
|
94
94
|
.trash .object-tools,
|
|
95
95
|
.from-container .doc-part-header .label,
|
|
96
96
|
.attrs.hidden {
|
|
97
|
-
|
|
97
|
+
display: none;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.attrs label {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
display: inline-block;
|
|
102
|
+
width: initial;
|
|
103
|
+
float: initial;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.doc-part-header {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
cursor: move; /* fallback if grab cursor is unsupported */
|
|
108
|
+
cursor: grab;
|
|
109
|
+
height: 60px;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
.from-container .doc-part-header {
|
|
113
|
-
|
|
113
|
+
height: 100%;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
.object-tools.right {
|
|
117
|
-
|
|
117
|
+
float: right;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.ProseMirror {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
background-color: var(--cs-white-background);
|
|
122
|
+
color: var(--cs-white-text);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
.ProseMirror-menubar {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
background-color: inherit;
|
|
127
|
+
position: inherit;
|
|
128
|
+
min-height: 21px !important;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.doc-table th {
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
background-color: var(--cs-6-background);
|
|
133
|
+
color: var(--cs-6-text);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
.ProseMirror td.selectedCell {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
background-color: var(--cs-2-background);
|
|
138
|
+
caret-color: transparent;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
.error-element {
|
|
142
|
-
|
|
142
|
+
border: 3px solid var(--error-background-color);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
#template-editor .initial em,
|
|
146
146
|
#template-editor .instructions em {
|
|
147
|
-
|
|
147
|
+
font-style: italic;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
#template-editor .initial strong,
|
|
151
151
|
#template-editor .instructions strong {
|
|
152
|
-
|
|
152
|
+
font-weight: bold;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
#template-editor .initial code,
|
|
156
156
|
#template-editor .instructions code {
|
|
157
|
-
|
|
157
|
+
font-family: monospace;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
#template-editor .initial h1,
|
|
161
161
|
#template-editor .instructions h1 {
|
|
162
|
-
|
|
162
|
+
font-size: 28px;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
#template-editor .initial h2,
|
|
166
166
|
#template-editor .instructions h2 {
|
|
167
|
-
|
|
167
|
+
font-size: 24px;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
#template-editor .initial h3,
|
|
171
171
|
#template-editor .instructions h3 {
|
|
172
|
-
|
|
172
|
+
font-size: 20px;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
#template-editor .initial h4,
|
|
176
176
|
#template-editor .instructions h4 {
|
|
177
|
-
|
|
177
|
+
font-size: 16px;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
#template-editor .initial h5,
|
|
181
181
|
#template-editor .instructions h5 {
|
|
182
|
-
|
|
182
|
+
font-size: 14px;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
#template-editor .initial h6,
|
|
186
186
|
#template-editor .instructions h6 {
|
|
187
|
-
|
|
187
|
+
font-size: 12px;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
#template-editor .initial ul,
|
|
191
191
|
#template-editor .instructions ul {
|
|
192
|
-
|
|
192
|
+
list-style-type: disc;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
#template-editor .initial ol,
|
|
196
196
|
#template-editor .instructions ol {
|
|
197
|
-
|
|
197
|
+
list-style-type: decimal;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
.object-tools span.link {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
display: block;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
border-radius: 15px;
|
|
204
|
+
background-color: var(--cs-2-background);
|
|
205
|
+
color: var(--cs-2-text);
|
|
206
|
+
padding: 3px 12px;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
.id-types-value input[type="text"] {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
background-color: var(--cs-white-background);
|
|
211
|
+
border: 1px solid var(--cs-white-border);
|
|
212
|
+
padding: 2px 6px;
|
|
213
213
|
}
|
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
.img {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
width: calc(100vw - 100px);
|
|
3
|
+
height: calc(100vh - 200px);
|
|
4
|
+
max-width: 640px;
|
|
5
|
+
max-height: 480px;
|
|
6
|
+
background: transparent no-repeat center;
|
|
7
|
+
background-size: contain;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.fw-media-preview-missing {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
display: table-cell;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
min-height: 100px;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
text-align: center;
|
|
16
|
+
color: var(--error-background-color, #b00);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/* Image selection dialog table */
|
|
20
20
|
.image-selection-table {
|
|
21
|
-
|
|
21
|
+
width: 100%;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/* The generic fw-small table forces a fixed tbody width that does not fit
|
|
25
25
|
the selection dialog. */
|
|
26
26
|
.image-selection-table table.fw-data-table.fw-small tbody {
|
|
27
|
-
|
|
27
|
+
width: 100%;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/* Tighter cells so the larger previews still show several rows. */
|
|
31
31
|
.image-selection-table table.fw-data-table tbody td {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
padding-top: 4px;
|
|
33
|
+
padding-bottom: 4px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/* Reserve a fixed slot for the selection checkmark so that selecting a row
|
|
37
37
|
does not reflow the title column. */
|
|
38
38
|
.image-selection-table table.fw-data-table thead th:last-child,
|
|
39
39
|
.image-selection-table table.fw-data-table tbody td:last-child {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
width: 40px;
|
|
42
|
+
min-width: 40px;
|
|
43
|
+
max-width: 40px;
|
|
44
|
+
text-align: center;
|
|
45
|
+
vertical-align: middle;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.image-selection-table .fa-check {
|
|
49
|
-
|
|
49
|
+
font-size: 1.3em;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/* Image overview icons: stored thumbnails keep their real aspect ratio, so
|
|
53
53
|
do not stretch them to fill the square icon box. */
|
|
54
54
|
span.fw-usermedia-image > img {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
min-width: 0;
|
|
56
|
+
min-height: 0;
|
|
57
|
+
width: auto;
|
|
58
|
+
height: auto;
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
max-height: 100%;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.image-selection-table .fw-image-preview {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
display: block;
|
|
65
|
+
text-align: center;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.image-selection-table .fw-image-preview img {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
display: block;
|
|
70
|
+
/* Fixed-size preview box so all rows line up; images are scaled to fit
|
|
71
71
|
(contain) rather than shown at their natural size. */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
width: 150px;
|
|
73
|
+
height: 100px;
|
|
74
|
+
object-fit: contain;
|
|
75
|
+
margin: 0 auto 4px;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.image-selection-table .fw-image-info {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
display: block;
|
|
80
|
+
font-size: 0.85em;
|
|
81
|
+
opacity: 0.7;
|
|
82
|
+
white-space: nowrap;
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adjust_doc_to_template.d.ts","sourceRoot":"","sources":["../../src/workers/adjust_doc_to_template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AAExC,qBAAa,yBAAyB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAEvD,YACI,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAO1D;IAED,IAAI,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"adjust_doc_to_template.d.ts","sourceRoot":"","sources":["../../src/workers/adjust_doc_to_template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AAExC,qBAAa,yBAAyB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAEvD,YACI,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAO1D;IAED,IAAI,IAAI,IAAI,CAoBX;CACJ"}
|
|
@@ -15,12 +15,19 @@ export class AdjustDocToTemplateWorker {
|
|
|
15
15
|
this.sendMessage = sendMessage;
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
try {
|
|
19
|
+
const stateDoc = this.schema.nodeFromJSON(this.doc);
|
|
20
|
+
const newStateDoc = this.schema.nodeFromJSON(adjustDocToTemplate(this.doc, this.template, this.documentStyleSlugs, this.schema));
|
|
21
|
+
const transform = recreateTransform(stateDoc, newStateDoc);
|
|
22
|
+
const steps = [];
|
|
23
|
+
transform.steps.forEach((step) => steps.push(step.toJSON()));
|
|
24
|
+
this.sendMessage({ type: "result", steps });
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
// Report the failure so the editor can clear its wait cover
|
|
28
|
+
// instead of waiting forever for a result message.
|
|
29
|
+
this.sendMessage({ type: "error", error: String(error) });
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
33
|
//# sourceMappingURL=adjust_doc_to_template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adjust_doc_to_template.js","sourceRoot":"","sources":["../../src/workers/adjust_doc_to_template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qDAAqD,CAAA;AACrF,OAAO,EAAC,mBAAmB,EAAC,MAAM,+CAA+C,CAAA;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AAExC,MAAM,OAAO,yBAAyB;IAClC,MAAM,CAAQ;IACd,GAAG,CAAyB;IAC5B,QAAQ,CAAyB;IACjC,kBAAkB,CAAU;IAC5B,WAAW,CAA4C;IAEvD,YACI,UAAmC,EACnC,GAA4B,EAC5B,QAAiC,EACjC,kBAA4B,EAC5B,WAAuD;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,UAAiB,CAAC,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAClC,CAAC;IAED,IAAI;QACA,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"adjust_doc_to_template.js","sourceRoot":"","sources":["../../src/workers/adjust_doc_to_template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qDAAqD,CAAA;AACrF,OAAO,EAAC,mBAAmB,EAAC,MAAM,+CAA+C,CAAA;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAA;AAExC,MAAM,OAAO,yBAAyB;IAClC,MAAM,CAAQ;IACd,GAAG,CAAyB;IAC5B,QAAQ,CAAyB;IACjC,kBAAkB,CAAU;IAC5B,WAAW,CAA4C;IAEvD,YACI,UAAmC,EACnC,GAA4B,EAC5B,QAAiC,EACjC,kBAA4B,EAC5B,WAAuD;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,UAAiB,CAAC,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAClC,CAAC;IAED,IAAI;QACA,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACnD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CACxC,mBAAmB,CACf,IAAI,CAAC,GAAU,EACf,IAAI,CAAC,QAAe,EACpB,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,MAAM,CACd,CACJ,CAAA;YACD,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;YAC1D,MAAM,KAAK,GAAmC,EAAE,CAAA;YAChD,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;YACjE,IAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAA;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,4DAA4D;YAC5D,mDAAmD;YACnD,IAAI,CAAC,WAAW,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAC,CAAC,CAAA;QAC3D,CAAC;IACL,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiduswriter/frontend",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.67",
|
|
4
4
|
"description": "Fidus Writer-specific shared utilities and UI chrome",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fiduswriter",
|
|
@@ -237,9 +237,9 @@
|
|
|
237
237
|
"@types/qrcode": "^1.5.6",
|
|
238
238
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
239
239
|
"eslint": "^10.6.0",
|
|
240
|
-
"gettext-parser": "^
|
|
241
|
-
"globals": "^
|
|
242
|
-
"happy-dom": "^
|
|
240
|
+
"gettext-parser": "^10.0.0",
|
|
241
|
+
"globals": "^17.0.0",
|
|
242
|
+
"happy-dom": "^21.0.0",
|
|
243
243
|
"husky": "^9.1.7",
|
|
244
244
|
"jest": "^30.5.2",
|
|
245
245
|
"lint-staged": "^17.0.8",
|
|
@@ -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
|
}
|