@open-press/core 1.1.4 → 1.2.1

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.
Files changed (51) hide show
  1. package/engine/cli.mjs +3 -3
  2. package/engine/commands/_shared.mjs +89 -13
  3. package/engine/commands/deploy.mjs +19 -4
  4. package/engine/commands/image.mjs +9 -3
  5. package/engine/commands/pdf.mjs +4 -1
  6. package/engine/output/chrome-pdf.mjs +102 -0
  7. package/engine/output/static-server.mjs +64 -17
  8. package/engine/react/document-export.mjs +22 -0
  9. package/package.json +1 -1
  10. package/src/openpress/app/OpenPressApp.tsx +5 -1
  11. package/src/openpress/app/OpenPressRuntime.tsx +85 -6
  12. package/src/openpress/reader/PageThumbnailsPanel.tsx +28 -5
  13. package/src/openpress/reader/PublicReaderPage.tsx +163 -74
  14. package/src/openpress/reader/SlidePresentationPage.tsx +37 -15
  15. package/src/openpress/reader/SlidePublicPage.tsx +332 -0
  16. package/src/openpress/reader/index.ts +1 -0
  17. package/src/openpress/reader/pageViewportScaleModel.ts +5 -3
  18. package/src/openpress/reader/usePageViewportScale.ts +9 -5
  19. package/src/openpress/reader/usePanelState.ts +14 -5
  20. package/src/openpress/shared/index.ts +1 -0
  21. package/src/openpress/shared/staticSearch.ts +174 -0
  22. package/src/openpress/workbench/Workbench.tsx +61 -176
  23. package/src/openpress/workbench/actions/DeploymentControl.tsx +1 -1
  24. package/src/openpress/workbench/actions/ExportControl.tsx +267 -0
  25. package/src/openpress/workbench/actions/SearchControl.tsx +32 -43
  26. package/src/openpress/workbench/actions/index.ts +1 -1
  27. package/src/openpress/workbench/actions/useDeploymentWorkbench.ts +21 -5
  28. package/src/openpress/workbench/hooks/useWorkbenchNavigation.ts +42 -0
  29. package/src/openpress/workbench/inspector/useInspectorComments.ts +6 -6
  30. package/src/openpress/workbench/project/ProjectEntryPanel.tsx +2 -278
  31. package/src/openpress/workbench/shell/WorkbenchShell.tsx +44 -18
  32. package/src/openpress/workbench/shell/WorkbenchToolbarActions.tsx +206 -0
  33. package/src/styles/openpress/app-shell.css +0 -83
  34. package/src/styles/openpress/print-route.css +1 -3
  35. package/src/styles/openpress/project-preview-panel.css +5 -783
  36. package/src/styles/openpress/public-viewer.css +7 -249
  37. package/src/styles/openpress/reader-runtime.css +0 -274
  38. package/src/styles/openpress/slide-presenter.css +150 -0
  39. package/src/styles/openpress/slide-public-viewer.css +222 -0
  40. package/src/styles/openpress/workbench-dialog.css +267 -0
  41. package/src/styles/openpress/workbench-export.css +154 -0
  42. package/src/styles/openpress/workbench-inline-editor.css +128 -0
  43. package/src/styles/openpress/workbench-panels.css +0 -88
  44. package/src/styles/openpress/workbench-search.css +257 -0
  45. package/src/styles/openpress/workbench-toolbar.css +422 -0
  46. package/src/styles/openpress/workbench.css +34 -1263
  47. package/src/styles/openpress/workspace-gallery.css +0 -5
  48. package/src/styles/openpress.css +7 -1
  49. package/vite.config.ts +66 -17
  50. package/src/openpress/workbench/actions/ExportImageControl.tsx +0 -96
  51. package/src/styles/openpress/media-workspace.css +0 -230
@@ -0,0 +1,422 @@
1
+ .openpress-workbench-toolbar {
2
+ z-index: 30;
3
+ display: flex;
4
+ min-width: 0;
5
+ height: var(--openpress-workbench-toolbar-height, 44px);
6
+ min-height: 0;
7
+ grid-area: toolbar;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ gap: 12px;
11
+ border-bottom: 1px solid rgb(255 255 255 / 9%);
12
+ padding: 0 12px;
13
+ background: rgb(18 18 18 / 96%);
14
+ backdrop-filter: var(--openpress-workbench-glass-blur);
15
+ }
16
+
17
+ .openpress-workbench-toolbar__content {
18
+ display: flex;
19
+ flex: 1 1 auto;
20
+ min-width: 0;
21
+ align-items: center;
22
+ justify-content: space-between;
23
+ gap: 12px;
24
+ }
25
+
26
+ .openpress-workbench-toolbar__group {
27
+ display: flex;
28
+ min-width: 0;
29
+ align-items: center;
30
+ gap: 8px;
31
+ }
32
+
33
+ .openpress-workbench-toolbar__group--right {
34
+ justify-content: flex-end;
35
+ }
36
+
37
+ .openpress-workbench-toolbar__group--page {
38
+ flex: 1 1 auto;
39
+ justify-content: center;
40
+ }
41
+
42
+ .openpress-workbench-toolbar-panel-toggle {
43
+ display: inline-flex;
44
+ width: 30px;
45
+ height: 30px;
46
+ flex: 0 0 auto;
47
+ align-items: center;
48
+ justify-content: center;
49
+ border: 1px solid transparent;
50
+ border-radius: var(--openpress-workbench-radius-sm);
51
+ padding: 0;
52
+ background: transparent;
53
+ color: #8e949b;
54
+ cursor: pointer;
55
+ transition:
56
+ color 160ms ease,
57
+ transform 160ms ease;
58
+ }
59
+
60
+ .openpress-workbench-toolbar-panel-toggle:hover {
61
+ color: #f2f2f0;
62
+ }
63
+
64
+ .openpress-workbench-toolbar-panel-toggle:active {
65
+ transform: translateY(1px);
66
+ }
67
+
68
+ .openpress-workbench-toolbar-panel-toggle svg {
69
+ width: 14px;
70
+ height: 14px;
71
+ }
72
+
73
+ .openpress-workbench-page-geometry,
74
+ .openpress-workbench-zoom-control {
75
+ display: inline-flex;
76
+ overflow: hidden;
77
+ height: 30px;
78
+ max-width: min(34vw, 280px);
79
+ align-items: center;
80
+ justify-content: center;
81
+ gap: 7px;
82
+ border: 1px solid transparent;
83
+ border-radius: var(--openpress-workbench-radius-sm);
84
+ padding: 0 8px;
85
+ background: transparent;
86
+ color: #aeb3b8;
87
+ font: inherit;
88
+ line-height: 1;
89
+ white-space: nowrap;
90
+ cursor: pointer;
91
+ transition:
92
+ border-color 160ms ease,
93
+ background 160ms ease,
94
+ color 160ms ease,
95
+ transform 160ms ease;
96
+ }
97
+
98
+ .openpress-workbench-page-geometry:hover,
99
+ .openpress-workbench-zoom-control:hover {
100
+ color: #f2f2f0;
101
+ }
102
+
103
+ .openpress-workbench-page-geometry:active,
104
+ .openpress-workbench-zoom-control:active {
105
+ transform: translateY(1px);
106
+ }
107
+
108
+ .openpress-workbench-page-geometry svg,
109
+ .openpress-workbench-zoom-control svg {
110
+ width: 13px;
111
+ height: 13px;
112
+ flex: 0 0 auto;
113
+ color: currentColor;
114
+ }
115
+
116
+ .openpress-workbench-page-geometry__label,
117
+ .openpress-workbench-page-geometry__dimensions {
118
+ overflow: hidden;
119
+ min-width: 0;
120
+ text-overflow: ellipsis;
121
+ white-space: nowrap;
122
+ }
123
+
124
+ .openpress-workbench-page-geometry__label {
125
+ color: #d8dadd;
126
+ font-size: 11px;
127
+ font-weight: 560;
128
+ }
129
+
130
+ .openpress-workbench-page-geometry__dimensions {
131
+ color: #7f858c;
132
+ font-family: var(--openpress-font-mono);
133
+ font-size: 10px;
134
+ font-weight: 500;
135
+ }
136
+
137
+ .openpress-workbench-zoom-control {
138
+ max-width: min(20vw, 92px);
139
+ color: #9fa5ab;
140
+ font-family: var(--openpress-font-mono);
141
+ font-size: 10px;
142
+ font-weight: 650;
143
+ }
144
+
145
+ .openpress-workbench-zoom-control-wrap {
146
+ position: relative;
147
+ display: inline-flex;
148
+ }
149
+
150
+ .openpress-workbench-zoom-control__chevron {
151
+ width: 12px !important;
152
+ height: 12px !important;
153
+ opacity: 0.7;
154
+ }
155
+
156
+ .openpress-workbench-zoom-control[aria-expanded="true"],
157
+ .openpress-workbench-zoom-control[data-openpress-toolbar-active="true"] {
158
+ border-color: rgb(242 242 240 / 16%);
159
+ background: rgb(242 242 240 / 7%);
160
+ color: #f2f2f0;
161
+ }
162
+
163
+ .openpress-workbench-zoom-menu {
164
+ position: absolute;
165
+ top: calc(100% + 8px);
166
+ left: 50%;
167
+ z-index: 80;
168
+ display: grid;
169
+ width: 188px;
170
+ gap: 6px;
171
+ border: 1px solid rgb(255 255 255 / 16%);
172
+ border-radius: 10px;
173
+ padding: 8px;
174
+ background: rgb(46 47 46 / 96%);
175
+ box-shadow: 0 18px 42px rgb(0 0 0 / 34%);
176
+ color: rgb(245 245 242 / 88%);
177
+ transform: translateX(-50%);
178
+ backdrop-filter: var(--openpress-workbench-glass-blur);
179
+ }
180
+
181
+ .openpress-workbench-zoom-menu__section {
182
+ display: grid;
183
+ gap: 2px;
184
+ }
185
+
186
+ .openpress-workbench-zoom-menu__divider {
187
+ height: 1px;
188
+ margin: 4px 6px;
189
+ background: rgb(255 255 255 / 14%);
190
+ }
191
+
192
+ .openpress-workbench-zoom-menu__item {
193
+ display: grid;
194
+ grid-template-columns: 18px 18px minmax(0, 1fr);
195
+ min-height: 30px;
196
+ align-items: center;
197
+ gap: 9px;
198
+ border: 0;
199
+ border-radius: var(--openpress-workbench-radius-md);
200
+ padding: 0 8px;
201
+ background: transparent;
202
+ color: inherit;
203
+ font: inherit;
204
+ font-size: 12px;
205
+ font-weight: 650;
206
+ line-height: 1;
207
+ text-align: left;
208
+ cursor: pointer;
209
+ }
210
+
211
+ .openpress-workbench-zoom-menu__item:hover,
212
+ .openpress-workbench-zoom-menu__item:focus-visible {
213
+ background: rgb(255 255 255 / 9%);
214
+ outline: 0;
215
+ }
216
+
217
+ .openpress-workbench-zoom-menu__item[aria-checked="true"] {
218
+ color: #ffffff;
219
+ }
220
+
221
+ .openpress-workbench-zoom-menu__item svg {
222
+ width: 15px;
223
+ height: 15px;
224
+ }
225
+
226
+ .openpress-workbench-zoom-menu__check {
227
+ display: grid;
228
+ width: 18px;
229
+ height: 18px;
230
+ place-items: center;
231
+ }
232
+
233
+ .openpress-workbench-zoom-menu__spacer {
234
+ width: 18px;
235
+ height: 1px;
236
+ }
237
+
238
+ .openpress-workbench-toolbar-action {
239
+ position: relative;
240
+ display: inline-flex;
241
+ overflow: hidden;
242
+ height: 30px;
243
+ width: 30px;
244
+ min-width: 30px;
245
+ max-width: 30px;
246
+ align-items: center;
247
+ justify-content: center;
248
+ gap: 0;
249
+ border: 1px solid transparent;
250
+ border-radius: var(--openpress-workbench-radius-sm);
251
+ padding: 0;
252
+ background: transparent;
253
+ color: #aeb3b8;
254
+ font: inherit;
255
+ font-size: 11px;
256
+ font-weight: 500;
257
+ line-height: 1;
258
+ text-decoration: none;
259
+ white-space: nowrap;
260
+ cursor: pointer;
261
+ transition:
262
+ border-color 160ms ease,
263
+ background 160ms ease,
264
+ color 160ms ease,
265
+ transform 160ms ease;
266
+ }
267
+
268
+ .openpress-workbench-toolbar-action:hover:not(:disabled) {
269
+ color: #f2f2f0;
270
+ }
271
+
272
+ .openpress-workbench-toolbar-action:active:not(:disabled) {
273
+ transform: translateY(1px);
274
+ }
275
+
276
+ .openpress-workbench-toolbar-action:disabled {
277
+ cursor: progress;
278
+ color: #a7adb2;
279
+ opacity: 0.62;
280
+ }
281
+
282
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-expanded="true"] {
283
+ width: auto;
284
+ min-width: 30px;
285
+ max-width: min(34vw, 300px);
286
+ gap: 7px;
287
+ padding: 0 10px;
288
+ }
289
+
290
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-active="true"] {
291
+ border-color: rgb(240 182 76 / 34%);
292
+ background: rgb(240 182 76 / 8%);
293
+ color: var(--openpress-workbench-accent);
294
+ }
295
+
296
+ .openpress-workbench-toolbar-action[data-openpress-deploy-status="online"] {
297
+ color: rgb(110 231 160 / 88%);
298
+ }
299
+
300
+ .openpress-workbench-toolbar-action[data-openpress-deploy-status="dirty"],
301
+ .openpress-workbench-toolbar-action[data-openpress-deploy-status="deploying"] {
302
+ color: var(--openpress-workbench-accent);
303
+ }
304
+
305
+ .openpress-workbench-toolbar-action[data-openpress-deploy-status="failed"] {
306
+ color: var(--openpress-workbench-danger);
307
+ }
308
+
309
+ .openpress-workbench-toolbar-action[data-openpress-deploy-state="deploying"]::after {
310
+ position: absolute;
311
+ inset: 3px;
312
+ border: 1px solid rgb(240 182 76 / 36%);
313
+ border-top-color: rgb(240 182 76 / 96%);
314
+ border-radius: var(--openpress-workbench-radius-pill);
315
+ animation: openpress-toolbar-deploy-spin 0.9s linear infinite;
316
+ content: "";
317
+ }
318
+
319
+ .openpress-workbench-toolbar-action[data-openpress-deploy-state="deploying"] svg {
320
+ animation: openpress-toolbar-deploy-pulse 0.9s ease-in-out infinite alternate;
321
+ }
322
+
323
+ .openpress-workbench-toolbar-action svg {
324
+ width: 13px;
325
+ height: 13px;
326
+ flex: 0 0 auto;
327
+ color: currentColor;
328
+ }
329
+
330
+ .openpress-workbench-toolbar-action__label,
331
+ .openpress-workbench-toolbar-action .openpress-dev-pdf-status,
332
+ .openpress-workbench-toolbar-action .openpress-dev-deploy-status,
333
+ .openpress-workbench-toolbar-action .openpress-dev-edit-status,
334
+ .openpress-workbench-toolbar-action .openpress-dev-inspector-status {
335
+ display: none;
336
+ overflow: hidden;
337
+ min-width: 0;
338
+ text-overflow: ellipsis;
339
+ white-space: nowrap;
340
+ }
341
+
342
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-expanded="true"] .openpress-workbench-toolbar-action__label,
343
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-expanded="true"] .openpress-dev-pdf-status,
344
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-expanded="true"] .openpress-dev-deploy-status,
345
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-expanded="true"] .openpress-dev-edit-status,
346
+ .openpress-workbench-toolbar-action[data-openpress-toolbar-expanded="true"] .openpress-dev-inspector-status {
347
+ display: inline-flex;
348
+ }
349
+
350
+ .openpress-workbench-toolbar-action .openpress-dev-pdf-status,
351
+ .openpress-workbench-toolbar-action .openpress-dev-deploy-status,
352
+ .openpress-workbench-toolbar-action .openpress-dev-edit-status,
353
+ .openpress-workbench-toolbar-action .openpress-dev-inspector-status {
354
+ max-width: 150px;
355
+ font-size: 10px;
356
+ }
357
+
358
+ .openpress-dev-edit-status {
359
+ align-items: center;
360
+ gap: 5px;
361
+ }
362
+
363
+ .openpress-dev-edit-status--toolbar {
364
+ display: inline-flex;
365
+ max-width: 132px;
366
+ min-height: 24px;
367
+ align-items: center;
368
+ gap: 6px;
369
+ overflow: hidden;
370
+ border: 1px solid rgb(240 182 76 / 18%);
371
+ border-radius: var(--openpress-workbench-radius-sm);
372
+ padding: 0 8px;
373
+ background: rgb(240 182 76 / 7%);
374
+ color: rgb(240 182 76 / 88%);
375
+ font-size: 10px;
376
+ line-height: 1;
377
+ text-overflow: ellipsis;
378
+ white-space: nowrap;
379
+ }
380
+
381
+ .openpress-dev-edit-status[data-openpress-edit-status="failed"] {
382
+ color: rgb(248 113 113 / 92%);
383
+ }
384
+
385
+ .openpress-dev-edit-status__spinner {
386
+ width: 9px;
387
+ height: 9px;
388
+ flex: 0 0 auto;
389
+ border: 1px solid rgb(240 182 76 / 32%);
390
+ border-top-color: rgb(240 182 76 / 96%);
391
+ border-radius: var(--openpress-workbench-radius-pill);
392
+ animation: openpress-toolbar-deploy-spin 0.8s linear infinite;
393
+ }
394
+
395
+ .openpress-workbench-toolbar > .openpress-dev-inspector-status {
396
+ max-width: 180px;
397
+ flex: 0 1 auto;
398
+ color: rgb(198 204 210 / 70%);
399
+ font-size: 10px;
400
+ }
401
+
402
+ .openpress-dev-deploy-status--toolbar {
403
+ max-width: 86px;
404
+ overflow: hidden;
405
+ color: rgb(240 182 76 / 86%);
406
+ text-overflow: ellipsis;
407
+ }
408
+
409
+ @keyframes openpress-toolbar-deploy-spin {
410
+ to {
411
+ transform: rotate(360deg);
412
+ }
413
+ }
414
+
415
+ @keyframes openpress-toolbar-deploy-pulse {
416
+ from {
417
+ opacity: 0.58;
418
+ }
419
+ to {
420
+ opacity: 1;
421
+ }
422
+ }