@fiduswriter/frontend 0.1.51 → 0.1.53
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/README.md +1 -1
- package/dist/css/editor/e2ee.css +1 -1
- package/dist/css/editor/tracking.css +45 -0
- package/dist/css/fwtoolkit/dialog.css +6 -1
- package/dist/css/fwtoolkit/dialog_table.css +65 -14
- package/dist/css/fwtoolkit/fwtoolkit.css +71 -15
- package/dist/css/image-manager/dialog_usermedia.css +75 -0
- package/dist/documents/overview/actions.d.ts +3 -3
- package/dist/documents/overview/actions.d.ts.map +1 -1
- package/dist/documents/overview/actions.js +59 -11
- package/dist/documents/overview/actions.js.map +1 -1
- package/dist/documents/overview/template_export_dialog.d.ts +14 -0
- package/dist/documents/overview/template_export_dialog.d.ts.map +1 -0
- package/dist/documents/overview/template_export_dialog.js +69 -0
- package/dist/documents/overview/template_export_dialog.js.map +1 -0
- package/package.json +7 -9
- package/scripts/deploy-pages.sh +2 -2
- package/scripts/extract-fwtoolkit-i18n.js +1 -1
- package/scripts/split-translations.js +2 -2
- package/src/documents/overview/actions.ts +79 -12
- package/css/inline_tools.css +0 -84
- package/dist/css/figure.css +0 -88
- package/dist/css/inline_tools.css +0 -84
- /package/{css → dist/css/editor}/figure.css +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://
|
|
2
|
+
<img src="https://git.fiduswriter.org/fiduswriter/fiduswriter-frontend-ts/raw/branch/main/logo.svg" alt="@fiduswriter/frontend" width="100" height="100">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">@fiduswriter/frontend</h1>
|
package/dist/css/editor/e2ee.css
CHANGED
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
.e2ee-recovery-key-box code {
|
|
322
|
-
font-family: "
|
|
322
|
+
font-family: "JetBrains Mono", "DejaVu Sans Mono", monospace;
|
|
323
323
|
font-size: 1.1em;
|
|
324
324
|
color: var(--main-text-color, #2c2723);
|
|
325
325
|
letter-spacing: 0.5px;
|
|
@@ -64,6 +64,51 @@ li [data-track]::before {
|
|
|
64
64
|
left: -5px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* Inline nodes whose content is not plain text do not necessarily show the
|
|
68
|
+
line-through inherited from the deletion mark (their own styling may
|
|
69
|
+
prevent inheritance). Re-apply it to the direct children of deletion
|
|
70
|
+
marks. */
|
|
71
|
+
span.deletion > * {
|
|
72
|
+
text-decoration: line-through;
|
|
73
|
+
text-decoration-color: var(--editor-track-fallback-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Equations are rendered by MathLive, which does not react to
|
|
77
|
+
text-decoration at all. Draw a line over the rendered equation instead and
|
|
78
|
+
dim it slightly. */
|
|
79
|
+
span.deletion .equation {
|
|
80
|
+
position: relative;
|
|
81
|
+
opacity: 0.75;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
span.deletion .equation::after {
|
|
85
|
+
content: "";
|
|
86
|
+
position: absolute;
|
|
87
|
+
left: -2px;
|
|
88
|
+
right: -2px;
|
|
89
|
+
top: calc(50% - 1px);
|
|
90
|
+
border-top: 2px solid var(--editor-track-fallback-color);
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Footnote markers only contain a non-breaking space, so a line-through
|
|
95
|
+
would be invisible. Give them a background tint instead. */
|
|
96
|
+
span.deletion .footnote-marker {
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
background-color: rgb(0 119 190 / 0.3);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Block level nodes with a deletion track entry (figures, tables, list
|
|
102
|
+
items) previously only showed the small [data-track] marker line, which is
|
|
103
|
+
easy to miss - particularly for figures. Make them clearly recognizable. */
|
|
104
|
+
figure[data-track*='"deletion"'],
|
|
105
|
+
table[data-track*='"deletion"'],
|
|
106
|
+
li[data-track*='"deletion"'] {
|
|
107
|
+
outline: 2px dashed var(--editor-track-fallback-color);
|
|
108
|
+
outline-offset: 2px;
|
|
109
|
+
opacity: 0.55;
|
|
110
|
+
}
|
|
111
|
+
|
|
67
112
|
.track-ctas {
|
|
68
113
|
display: none;
|
|
69
114
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
position: absolute;
|
|
3
3
|
background-color: var(--cs-light-background);
|
|
4
4
|
font-size: 14px;
|
|
5
|
-
overflow:
|
|
5
|
+
overflow: visible;
|
|
6
6
|
outline: 0;
|
|
7
7
|
padding: 0 19px 19px;
|
|
8
8
|
box-shadow: none;
|
|
@@ -72,6 +72,11 @@
|
|
|
72
72
|
.fw-dialog-content {
|
|
73
73
|
position: relative;
|
|
74
74
|
margin-top: 24px;
|
|
75
|
+
/* Tooltips escape the scroll container because they are portal-rendered
|
|
76
|
+
in document.body (see src/tooltip.ts). `visible auto` would be coerced
|
|
77
|
+
by browsers to `auto auto` (visible + auto is not representable), so
|
|
78
|
+
hidden on the x-axis avoids a horizontal scrollbar while the y-axis
|
|
79
|
+
scrolls when the content grows too tall. */
|
|
75
80
|
overflow: hidden auto;
|
|
76
81
|
padding: 6px;
|
|
77
82
|
max-height: calc(100vh - 133px);
|
|
@@ -39,11 +39,10 @@
|
|
|
39
39
|
padding-top: 2px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
/* Shared tooltip box styling. Standalone selectors so the styles also apply
|
|
43
|
+
when the tooltip is portal-rendered in document.body (see src/tooltip.ts). */
|
|
44
|
+
.fw-tooltip {
|
|
44
45
|
min-width: 260px;
|
|
45
|
-
top: calc(100% + 2px);
|
|
46
|
-
left: calc(100% - 13px);
|
|
47
46
|
background-color: var(--cs-dark-background);
|
|
48
47
|
color: var(--cs-dark-text);
|
|
49
48
|
border-radius: 6px;
|
|
@@ -56,7 +55,27 @@
|
|
|
56
55
|
z-index: 1;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
/* In-place positioning only (no-JS fallback). Portal-rendered tooltips are
|
|
59
|
+
positioned by src/tooltip.ts instead, so this rule stays scoped to the
|
|
60
|
+
trigger. */
|
|
61
|
+
.fw-tablerow-title .fw-tooltip {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: calc(100% + 2px);
|
|
64
|
+
left: calc(100% - 13px);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* These rules are the no-JS fallback. When src/tooltip.ts is active it adds
|
|
68
|
+
`fw-tooltip-active` to the trigger and renders the tooltip in
|
|
69
|
+
document.body, so it no longer matches these descendant selectors. */
|
|
70
|
+
.fw-tablerow-title.fw-wtooltip:not(.fw-tooltip-active):hover .fw-tooltip {
|
|
71
|
+
visibility: visible;
|
|
72
|
+
opacity: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Show the table-row tooltip on keyboard focus as well as hover. */
|
|
76
|
+
.fw-tablerow-title.fw-wtooltip:not(.fw-tooltip-active):focus .fw-tooltip,
|
|
77
|
+
.fw-tablerow-title.fw-wtooltip:not(.fw-tooltip-active):focus-within
|
|
78
|
+
.fw-tooltip {
|
|
60
79
|
visibility: visible;
|
|
61
80
|
opacity: 1;
|
|
62
81
|
}
|
|
@@ -74,11 +93,26 @@
|
|
|
74
93
|
cursor: help;
|
|
75
94
|
}
|
|
76
95
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
96
|
+
/* The trigger is a real button so it is keyboard focusable. */
|
|
97
|
+
.fw-info-tooltip-trigger {
|
|
98
|
+
border: none;
|
|
99
|
+
background: none;
|
|
100
|
+
padding: 0;
|
|
101
|
+
margin: 0;
|
|
102
|
+
font: inherit;
|
|
103
|
+
line-height: inherit;
|
|
104
|
+
color: inherit;
|
|
105
|
+
cursor: help;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.fw-info-tooltip-trigger:hover,
|
|
110
|
+
.fw-info-tooltip-trigger:focus-visible {
|
|
111
|
+
color: var(--cs-link-color, var(--cs-2-background));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Shared tooltip box styling (applies in-place and portal-rendered). */
|
|
115
|
+
.fw-info-tooltip-text {
|
|
82
116
|
min-width: 280px;
|
|
83
117
|
max-width: 360px;
|
|
84
118
|
background-color: var(--cs-dark-background);
|
|
@@ -98,12 +132,21 @@
|
|
|
98
132
|
white-space: normal;
|
|
99
133
|
}
|
|
100
134
|
|
|
101
|
-
|
|
135
|
+
/* In-place positioning only (no-JS fallback). */
|
|
136
|
+
.fw-info-tooltip .fw-info-tooltip-text {
|
|
137
|
+
position: absolute;
|
|
138
|
+
bottom: calc(100% + 6px);
|
|
139
|
+
left: 50%;
|
|
140
|
+
transform: translateX(-50%);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.fw-info-tooltip:not(.fw-tooltip-active):hover .fw-info-tooltip-text,
|
|
144
|
+
.fw-info-tooltip:not(.fw-tooltip-active):focus-within .fw-info-tooltip-text {
|
|
102
145
|
visibility: visible;
|
|
103
146
|
opacity: 1;
|
|
104
147
|
}
|
|
105
148
|
|
|
106
|
-
.fw-info-tooltip
|
|
149
|
+
.fw-info-tooltip-text::after {
|
|
107
150
|
content: "";
|
|
108
151
|
position: absolute;
|
|
109
152
|
top: 100%;
|
|
@@ -114,12 +157,20 @@
|
|
|
114
157
|
border-color: var(--cs-dark-background) transparent transparent transparent;
|
|
115
158
|
}
|
|
116
159
|
|
|
117
|
-
|
|
160
|
+
/* When the portal tooltip is flipped below its trigger because there was no
|
|
161
|
+
room above, point the arrow up instead of down. */
|
|
162
|
+
.fw-info-tooltip-text.fw-tooltip-flipped::after {
|
|
163
|
+
top: auto;
|
|
164
|
+
bottom: 100%;
|
|
165
|
+
border-color: transparent transparent var(--cs-dark-background) transparent;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.fw-info-tooltip-text ul {
|
|
118
169
|
margin: 6px 0 0 16px;
|
|
119
170
|
padding: 0;
|
|
120
171
|
list-style-type: disc;
|
|
121
172
|
}
|
|
122
173
|
|
|
123
|
-
.fw-info-tooltip
|
|
174
|
+
.fw-info-tooltip-text li {
|
|
124
175
|
margin-bottom: 4px;
|
|
125
176
|
}
|
|
@@ -1257,11 +1257,10 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1257
1257
|
padding-top: 2px;
|
|
1258
1258
|
}
|
|
1259
1259
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1260
|
+
/* Shared tooltip box styling. Standalone selectors so the styles also apply
|
|
1261
|
+
when the tooltip is portal-rendered in document.body (see src/tooltip.ts). */
|
|
1262
|
+
.fw-tooltip {
|
|
1262
1263
|
min-width: 260px;
|
|
1263
|
-
top: calc(100% + 2px);
|
|
1264
|
-
left: calc(100% - 13px);
|
|
1265
1264
|
background-color: var(--cs-dark-background);
|
|
1266
1265
|
color: var(--cs-dark-text);
|
|
1267
1266
|
border-radius: 6px;
|
|
@@ -1274,7 +1273,27 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1274
1273
|
z-index: 1;
|
|
1275
1274
|
}
|
|
1276
1275
|
|
|
1277
|
-
|
|
1276
|
+
/* In-place positioning only (no-JS fallback). Portal-rendered tooltips are
|
|
1277
|
+
positioned by src/tooltip.ts instead, so this rule stays scoped to the
|
|
1278
|
+
trigger. */
|
|
1279
|
+
.fw-tablerow-title .fw-tooltip {
|
|
1280
|
+
position: absolute;
|
|
1281
|
+
top: calc(100% + 2px);
|
|
1282
|
+
left: calc(100% - 13px);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/* These rules are the no-JS fallback. When src/tooltip.ts is active it adds
|
|
1286
|
+
`fw-tooltip-active` to the trigger and renders the tooltip in
|
|
1287
|
+
document.body, so it no longer matches these descendant selectors. */
|
|
1288
|
+
.fw-tablerow-title.fw-wtooltip:not(.fw-tooltip-active):hover .fw-tooltip {
|
|
1289
|
+
visibility: visible;
|
|
1290
|
+
opacity: 1;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/* Show the table-row tooltip on keyboard focus as well as hover. */
|
|
1294
|
+
.fw-tablerow-title.fw-wtooltip:not(.fw-tooltip-active):focus .fw-tooltip,
|
|
1295
|
+
.fw-tablerow-title.fw-wtooltip:not(.fw-tooltip-active):focus-within
|
|
1296
|
+
.fw-tooltip {
|
|
1278
1297
|
visibility: visible;
|
|
1279
1298
|
opacity: 1;
|
|
1280
1299
|
}
|
|
@@ -1292,11 +1311,26 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1292
1311
|
cursor: help;
|
|
1293
1312
|
}
|
|
1294
1313
|
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1314
|
+
/* The trigger is a real button so it is keyboard focusable. */
|
|
1315
|
+
.fw-info-tooltip-trigger {
|
|
1316
|
+
border: none;
|
|
1317
|
+
background: none;
|
|
1318
|
+
padding: 0;
|
|
1319
|
+
margin: 0;
|
|
1320
|
+
font: inherit;
|
|
1321
|
+
line-height: inherit;
|
|
1322
|
+
color: inherit;
|
|
1323
|
+
cursor: help;
|
|
1324
|
+
border-radius: 4px;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
.fw-info-tooltip-trigger:hover,
|
|
1328
|
+
.fw-info-tooltip-trigger:focus-visible {
|
|
1329
|
+
color: var(--cs-link-color, var(--cs-2-background));
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/* Shared tooltip box styling (applies in-place and portal-rendered). */
|
|
1333
|
+
.fw-info-tooltip-text {
|
|
1300
1334
|
min-width: 280px;
|
|
1301
1335
|
max-width: 360px;
|
|
1302
1336
|
background-color: var(--cs-dark-background);
|
|
@@ -1316,12 +1350,21 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1316
1350
|
white-space: normal;
|
|
1317
1351
|
}
|
|
1318
1352
|
|
|
1319
|
-
|
|
1353
|
+
/* In-place positioning only (no-JS fallback). */
|
|
1354
|
+
.fw-info-tooltip .fw-info-tooltip-text {
|
|
1355
|
+
position: absolute;
|
|
1356
|
+
bottom: calc(100% + 6px);
|
|
1357
|
+
left: 50%;
|
|
1358
|
+
transform: translateX(-50%);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
.fw-info-tooltip:not(.fw-tooltip-active):hover .fw-info-tooltip-text,
|
|
1362
|
+
.fw-info-tooltip:not(.fw-tooltip-active):focus-within .fw-info-tooltip-text {
|
|
1320
1363
|
visibility: visible;
|
|
1321
1364
|
opacity: 1;
|
|
1322
1365
|
}
|
|
1323
1366
|
|
|
1324
|
-
.fw-info-tooltip
|
|
1367
|
+
.fw-info-tooltip-text::after {
|
|
1325
1368
|
content: "";
|
|
1326
1369
|
position: absolute;
|
|
1327
1370
|
top: 100%;
|
|
@@ -1332,13 +1375,21 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1332
1375
|
border-color: var(--cs-dark-background) transparent transparent transparent;
|
|
1333
1376
|
}
|
|
1334
1377
|
|
|
1335
|
-
|
|
1378
|
+
/* When the portal tooltip is flipped below its trigger because there was no
|
|
1379
|
+
room above, point the arrow up instead of down. */
|
|
1380
|
+
.fw-info-tooltip-text.fw-tooltip-flipped::after {
|
|
1381
|
+
top: auto;
|
|
1382
|
+
bottom: 100%;
|
|
1383
|
+
border-color: transparent transparent var(--cs-dark-background) transparent;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
.fw-info-tooltip-text ul {
|
|
1336
1387
|
margin: 6px 0 0 16px;
|
|
1337
1388
|
padding: 0;
|
|
1338
1389
|
list-style-type: disc;
|
|
1339
1390
|
}
|
|
1340
1391
|
|
|
1341
|
-
.fw-info-tooltip
|
|
1392
|
+
.fw-info-tooltip-text li {
|
|
1342
1393
|
margin-bottom: 4px;
|
|
1343
1394
|
}
|
|
1344
1395
|
|
|
@@ -1347,7 +1398,7 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1347
1398
|
position: absolute;
|
|
1348
1399
|
background-color: var(--cs-light-background);
|
|
1349
1400
|
font-size: 14px;
|
|
1350
|
-
overflow:
|
|
1401
|
+
overflow: visible;
|
|
1351
1402
|
outline: 0;
|
|
1352
1403
|
padding: 0 19px 19px;
|
|
1353
1404
|
box-shadow: none;
|
|
@@ -1417,6 +1468,11 @@ table.fw-data-table.fw-selection-table tbody tr {
|
|
|
1417
1468
|
.fw-dialog-content {
|
|
1418
1469
|
position: relative;
|
|
1419
1470
|
margin-top: 24px;
|
|
1471
|
+
/* Tooltips escape the scroll container because they are portal-rendered
|
|
1472
|
+
in document.body (see src/tooltip.ts). `visible auto` would be coerced
|
|
1473
|
+
by browsers to `auto auto` (visible + auto is not representable), so
|
|
1474
|
+
hidden on the x-axis avoids a horizontal scrollbar while the y-axis
|
|
1475
|
+
scrolls when the content grows too tall. */
|
|
1420
1476
|
overflow: hidden auto;
|
|
1421
1477
|
padding: 6px;
|
|
1422
1478
|
max-height: calc(100vh - 133px);
|
|
@@ -6,3 +6,78 @@
|
|
|
6
6
|
background: transparent no-repeat center;
|
|
7
7
|
background-size: contain;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
.fw-media-preview-missing {
|
|
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
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Image selection dialog table */
|
|
20
|
+
.image-selection-table {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* The generic fw-small table forces a fixed tbody width that does not fit
|
|
25
|
+
the selection dialog. */
|
|
26
|
+
.image-selection-table table.fw-data-table.fw-small tbody {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Tighter cells so the larger previews still show several rows. */
|
|
31
|
+
.image-selection-table table.fw-data-table tbody td {
|
|
32
|
+
padding-top: 4px;
|
|
33
|
+
padding-bottom: 4px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Reserve a fixed slot for the selection checkmark so that selecting a row
|
|
37
|
+
does not reflow the title column. */
|
|
38
|
+
.image-selection-table table.fw-data-table thead th:last-child,
|
|
39
|
+
.image-selection-table table.fw-data-table tbody td:last-child {
|
|
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
|
+
}
|
|
47
|
+
|
|
48
|
+
.image-selection-table .fa-check {
|
|
49
|
+
font-size: 1.3em;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Image overview icons: stored thumbnails keep their real aspect ratio, so
|
|
53
|
+
do not stretch them to fill the square icon box. */
|
|
54
|
+
span.fw-usermedia-image > img {
|
|
55
|
+
min-width: 0;
|
|
56
|
+
min-height: 0;
|
|
57
|
+
width: auto;
|
|
58
|
+
height: auto;
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
max-height: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.image-selection-table .fw-image-preview {
|
|
64
|
+
display: block;
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.image-selection-table .fw-image-preview img {
|
|
69
|
+
display: block;
|
|
70
|
+
/* Fixed-size preview box so all rows line up; images are scaled to fit
|
|
71
|
+
(contain) rather than shown at their natural size. */
|
|
72
|
+
width: 150px;
|
|
73
|
+
height: 100px;
|
|
74
|
+
object-fit: contain;
|
|
75
|
+
margin: 0 auto 4px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.image-selection-table .fw-image-info {
|
|
79
|
+
display: block;
|
|
80
|
+
font-size: 0.85em;
|
|
81
|
+
opacity: 0.7;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
}
|
|
@@ -21,12 +21,12 @@ export declare class DocumentOverviewActions {
|
|
|
21
21
|
copyFilesAs(ids: number[]): void;
|
|
22
22
|
downloadNativeFiles(ids: number[]): void;
|
|
23
23
|
downloadSlimNativeFiles(ids: number[]): void;
|
|
24
|
-
downloadHTMLFiles(ids: number[]): void
|
|
25
|
-
downloadTemplateExportFiles(ids: number[], templateUrl: string, templateType: string): void
|
|
24
|
+
downloadHTMLFiles(ids: number[]): Promise<void>;
|
|
25
|
+
downloadTemplateExportFiles(ids: number[], templateUrl: string, templateType: string): Promise<void>;
|
|
26
26
|
downloadLatexFiles(ids: number[]): void;
|
|
27
27
|
downloadJATSFiles(ids: number[]): void;
|
|
28
28
|
downloadBITSFiles(ids: number[]): void;
|
|
29
|
-
downloadEpubFiles(ids: number[]): void
|
|
29
|
+
downloadEpubFiles(ids: number[]): Promise<void>;
|
|
30
30
|
settingsDocumentDialog(docId: number): void;
|
|
31
31
|
revisionsDialog(documentId: number, app: FrontendApp): void;
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/documents/overview/actions.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/documents/overview/actions.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAA;AAyC/C,qBAAa,uBAAuB;IAChC,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,WAAW,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;QACnB,QAAQ,EAAE,CAAC,MAAM,EAAE;YAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAC,KAAK,MAAM,CAAA;KAC/D,CAAC,CAAA;IACF,MAAM,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAC9D,eAAe,EAAE,GAAG,CAAA;IACpB,mBAAmB,EAAE,OAAO,CAAA;IAE5B,YAAY,gBAAgB,EAAE,gBAAgB,EAmC7C;IAED,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA+BtD;IAED,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBxC;IAED,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CA8C1D;IAEK,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA8WpC;IAED,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAkC7B;IAED,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CA2J/B;IAED,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAoBvC;IAED,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAqB3C;IAEK,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDpD;IAEK,2BAA2B,CAC7B,GAAG,EAAE,MAAM,EAAE,EACb,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAwDf;IAED,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CA2BtC;IAED,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CA6BrC;IAED,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CA6BrC;IAEK,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDpD;IAED,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAmC1C;IAED,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAgC1D;CACJ"}
|
|
@@ -6,6 +6,15 @@ import { enterPassphraseDialog } from "fwtoolkit/e2ee/passphrase-dialog";
|
|
|
6
6
|
import { PassphraseManager } from "fwtoolkit/e2ee/passphrase-manager";
|
|
7
7
|
import { createPasswordDialog, enterPasswordDialog } from "fwtoolkit/e2ee/password-dialog";
|
|
8
8
|
import { documentDialogTemplate, importDocumentTemplate } from "./templates.js";
|
|
9
|
+
import { HtmlExportDialog, EpubExportDialog, TemplateExportDialog } from "@fiduswriter/editor/dialogs/index";
|
|
10
|
+
import { Node as PMNode } from "prosemirror-model";
|
|
11
|
+
import { acceptAllNoInsertions } from "@fiduswriter/document/transform";
|
|
12
|
+
/** Return a copy of the document with all tracked changes accepted. */
|
|
13
|
+
const resolveDocTrackedChanges = (doc, schema) => {
|
|
14
|
+
const pmDoc = PMNode.fromJSON(schema, doc.content);
|
|
15
|
+
const resolved = acceptAllNoInsertions(pmDoc);
|
|
16
|
+
return { ...doc, content: resolved.toJSON() };
|
|
17
|
+
};
|
|
9
18
|
const exportProgressCallback = (doc) => {
|
|
10
19
|
const title = shortFileTitle(doc.title, doc.path || "");
|
|
11
20
|
const task = addProgress("info", `${title}: ${gettext("Exporting...")}`, {
|
|
@@ -588,28 +597,52 @@ export class DocumentOverviewActions {
|
|
|
588
597
|
}));
|
|
589
598
|
});
|
|
590
599
|
}
|
|
591
|
-
downloadHTMLFiles(ids) {
|
|
600
|
+
async downloadHTMLFiles(ids) {
|
|
601
|
+
const dialog = new HtmlExportDialog();
|
|
602
|
+
const options = await dialog.init();
|
|
603
|
+
if (!options) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
const converterOptions = {};
|
|
607
|
+
if (options.svgMath) {
|
|
608
|
+
converterOptions.mathOutput = "svg";
|
|
609
|
+
}
|
|
610
|
+
if (!options.resolveTrackChanges) {
|
|
611
|
+
converterOptions.trackChanges = true;
|
|
612
|
+
}
|
|
592
613
|
import("../tools.js").then(({ getMissingDocumentListData }) => {
|
|
593
614
|
getMissingDocumentListData(ids, this.documentOverview.documentList, this.documentOverview.schema, this.documentOverview.app.apiConnectors.document).then(() => ids.forEach(id => {
|
|
594
|
-
const
|
|
595
|
-
if (!
|
|
615
|
+
const found = this.documentOverview.documentList.find(entry => entry.id === id);
|
|
616
|
+
if (!found)
|
|
596
617
|
return;
|
|
618
|
+
const doc = options.resolveTrackChanges
|
|
619
|
+
? resolveDocTrackedChanges(found, this.documentOverview.schema)
|
|
620
|
+
: found;
|
|
597
621
|
const progressCallback = exportProgressCallback(doc);
|
|
598
622
|
import("@fiduswriter/document/exporter/html/index").then(({ HTMLExporter }) => {
|
|
599
|
-
const exporter = new HTMLExporter(doc, { db: doc.bibliography }, { db: doc.images }, this.documentOverview.app.csl, new Date(doc.updated * 1000), this.documentOverview.documentStyles);
|
|
623
|
+
const exporter = new HTMLExporter(doc, { db: doc.bibliography }, { db: doc.images }, this.documentOverview.app.csl, new Date(doc.updated * 1000), this.documentOverview.documentStyles, converterOptions);
|
|
600
624
|
exporter.progressCallback = progressCallback;
|
|
601
625
|
exporter.init();
|
|
602
626
|
});
|
|
603
627
|
}));
|
|
604
628
|
});
|
|
605
629
|
}
|
|
606
|
-
downloadTemplateExportFiles(ids, templateUrl, templateType) {
|
|
630
|
+
async downloadTemplateExportFiles(ids, templateUrl, templateType) {
|
|
631
|
+
const dialog = new TemplateExportDialog();
|
|
632
|
+
const options = await dialog.init(templateType === "docx" ? "docx" : "odt");
|
|
633
|
+
if (!options) {
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
const resolveTrackChanges = options.resolveTrackChanges;
|
|
607
637
|
import("../tools.js").then(({ getMissingDocumentListData }) => {
|
|
608
638
|
getMissingDocumentListData(ids, this.documentOverview.documentList, this.documentOverview.schema, this.documentOverview.app.apiConnectors.document).then(() => {
|
|
609
639
|
ids.forEach(id => {
|
|
610
|
-
const
|
|
611
|
-
if (!
|
|
640
|
+
const found = this.documentOverview.documentList.find(entry => entry.id === id);
|
|
641
|
+
if (!found)
|
|
612
642
|
return;
|
|
643
|
+
const doc = resolveTrackChanges
|
|
644
|
+
? resolveDocTrackedChanges(found, this.documentOverview.schema)
|
|
645
|
+
: found;
|
|
613
646
|
const progressCallback = exportProgressCallback(doc);
|
|
614
647
|
if (templateType === "docx") {
|
|
615
648
|
import("@fiduswriter/document/exporter/docx/index").then(({ DOCXExporter }) => {
|
|
@@ -674,15 +707,30 @@ export class DocumentOverviewActions {
|
|
|
674
707
|
}));
|
|
675
708
|
});
|
|
676
709
|
}
|
|
677
|
-
downloadEpubFiles(ids) {
|
|
710
|
+
async downloadEpubFiles(ids) {
|
|
711
|
+
const dialog = new EpubExportDialog();
|
|
712
|
+
const options = await dialog.init();
|
|
713
|
+
if (!options) {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const converterOptions = {};
|
|
717
|
+
if (options.svgMath) {
|
|
718
|
+
converterOptions.mathOutput = "svg";
|
|
719
|
+
}
|
|
720
|
+
if (!options.resolveTrackChanges) {
|
|
721
|
+
converterOptions.trackChanges = true;
|
|
722
|
+
}
|
|
678
723
|
import("../tools.js").then(({ getMissingDocumentListData }) => {
|
|
679
724
|
getMissingDocumentListData(ids, this.documentOverview.documentList, this.documentOverview.schema, this.documentOverview.app.apiConnectors.document).then(() => ids.forEach(id => {
|
|
680
|
-
const
|
|
681
|
-
if (!
|
|
725
|
+
const found = this.documentOverview.documentList.find(entry => entry.id === id);
|
|
726
|
+
if (!found)
|
|
682
727
|
return;
|
|
728
|
+
const doc = options.resolveTrackChanges
|
|
729
|
+
? resolveDocTrackedChanges(found, this.documentOverview.schema)
|
|
730
|
+
: found;
|
|
683
731
|
const progressCallback = exportProgressCallback(doc);
|
|
684
732
|
import("@fiduswriter/document/exporter/epub/index").then(({ EpubExporter }) => {
|
|
685
|
-
const exporter = new EpubExporter(doc, { db: doc.bibliography }, { db: doc.images }, this.documentOverview.app.csl, new Date(doc.updated * 1000), this.documentOverview.documentStyles);
|
|
733
|
+
const exporter = new EpubExporter(doc, { db: doc.bibliography }, { db: doc.images }, this.documentOverview.app.csl, new Date(doc.updated * 1000), this.documentOverview.documentStyles, converterOptions);
|
|
686
734
|
exporter.progressCallback = progressCallback;
|
|
687
735
|
exporter.init();
|
|
688
736
|
});
|