@datalking/begonia-react 0.1.1 → 0.3.0
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/binding/BegoniaPdfViewer.d.ts +4 -1
- package/dist/binding/BrowserPaginatedEditorSurface.d.ts +44 -0
- package/dist/binding/HeaderFooterScratchMount.d.ts +25 -0
- package/dist/binding/PaginatedLayoutView.d.ts +21 -2
- package/dist/binding/PaginatedPageOverlayView.d.ts +44 -0
- package/dist/binding/VirtualPagedPreview.d.ts +38 -1
- package/dist/binding/begonia-theme-style.d.ts +12 -0
- package/dist/binding/browser-header-footer-bands.d.ts +98 -0
- package/dist/binding/browser-header-footer-format-bar.d.ts +21 -0
- package/dist/binding/browser-paginated-preview-drag-state.d.ts +2 -0
- package/dist/binding/headless.d.ts +1 -1
- package/dist/binding/index.d.ts +4 -0
- package/dist/binding/paginated-preview-doc-style.d.ts +40 -0
- package/dist/binding/paginated-preview-font-family.d.ts +19 -0
- package/dist/binding/paginated-scroll-axis-host.d.ts +32 -0
- package/dist/binding/preview-link-activation.d.ts +71 -0
- package/dist/binding/resolve-snapshot-comment-state.d.ts +32 -0
- package/dist/binding/use-browser-header-footer-editing.d.ts +114 -0
- package/dist/binding/use-header-footer-scratch-surface.d.ts +48 -0
- package/dist/binding/use-owned-destroyable.d.ts +9 -0
- package/dist/binding/use-undo-redo-hotkeys.d.ts +45 -0
- package/dist/binding/useVirtualPagedPreviewState.d.ts +13 -3
- package/dist/binding/v1.d.ts +16 -0
- package/dist/binding/virtual-paged-preview-comment-highlight.d.ts +33 -0
- package/dist/binding/virtual-paged-preview-drag-session.d.ts +1 -1
- package/dist/binding/virtual-paged-preview-interaction.d.ts +2 -2
- package/dist/binding/virtual-paged-preview-list-marker.d.ts +42 -0
- package/dist/binding/virtual-paged-preview-renderers/virtual-paged-preview-block-text.d.ts +21 -6
- package/dist/binding/virtual-paged-preview-renderers/virtual-paged-preview-block-views.d.ts +18 -2
- package/dist/binding/virtual-paged-preview-review-attributes.d.ts +78 -0
- package/dist/binding/virtual-paged-preview-text-lines.d.ts +4 -0
- package/dist/chunk-LIAB6VEG.js +1 -0
- package/dist/editor-surface.css +457 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/v1.d.ts +4 -2
- package/dist/v1.js +1 -1
- package/package.json +19 -16
- package/dist/binding/paginated-preview-defaults.d.ts +0 -2
- package/dist/binding/virtual-paged-preview-table-metrics.d.ts +0 -1
- package/dist/chunk-IEHE33P5.js +0 -1
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Begonia editor surface styles.
|
|
3
|
+
*
|
|
4
|
+
* Base styling for the editable ProseMirror surface (`.ald-editor`), its
|
|
5
|
+
* host frame, and inline revision/collaboration marks. Every color, font,
|
|
6
|
+
* radius, and shadow reads a `--ald-*` theme variable with the original
|
|
7
|
+
* begonia look as the fallback, so the surface is themeable end to end while
|
|
8
|
+
* remaining a visual no-op for hosts that set no variables.
|
|
9
|
+
*
|
|
10
|
+
* Import from the host app:
|
|
11
|
+
* import '@datalking/begonia-react/editor-surface.css';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
.editor-frame {
|
|
15
|
+
min-height: 430px;
|
|
16
|
+
border-radius: var(--ald-radius, 1.75rem);
|
|
17
|
+
border: 1px solid var(--ald-border, rgba(148, 163, 184, 0.24));
|
|
18
|
+
background: var(
|
|
19
|
+
--ald-surface-muted,
|
|
20
|
+
radial-gradient(circle at top, rgba(13, 148, 136, 0.08), transparent 24%),
|
|
21
|
+
linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%)
|
|
22
|
+
);
|
|
23
|
+
padding: 1rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.editor-host {
|
|
27
|
+
min-height: 398px;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
border-radius: var(--ald-page-radius, 1.25rem);
|
|
30
|
+
border: 1px solid var(--ald-border, rgba(148, 163, 184, 0.3));
|
|
31
|
+
background: var(--ald-surface, white);
|
|
32
|
+
box-shadow: var(
|
|
33
|
+
--ald-shadow,
|
|
34
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.85),
|
|
35
|
+
0 16px 36px rgba(15, 23, 42, 0.05)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ald-editor.ProseMirror {
|
|
40
|
+
min-height: 398px;
|
|
41
|
+
padding: 2rem 2.25rem 3rem;
|
|
42
|
+
outline: none;
|
|
43
|
+
/* Fallback mirrors DOC_TEXT_COLOR in paginated-preview-doc-style.ts. */
|
|
44
|
+
color: var(--ald-doc-text, #000000);
|
|
45
|
+
font-family: var(
|
|
46
|
+
--ald-font-doc,
|
|
47
|
+
'Iowan Old Style',
|
|
48
|
+
'Source Han Serif SC',
|
|
49
|
+
'Noto Serif CJK SC',
|
|
50
|
+
'Songti SC',
|
|
51
|
+
'STSong',
|
|
52
|
+
'SimSun',
|
|
53
|
+
'Baskerville',
|
|
54
|
+
'Times New Roman',
|
|
55
|
+
serif
|
|
56
|
+
);
|
|
57
|
+
/* Matches defaultTypography in layout-core (baseFontSize 16, lineHeight 24 =
|
|
58
|
+
1.5) so the flowing surface and the paginated surface set the same
|
|
59
|
+
document at the same size. They used to disagree (18px/1.72 vs 16px/1.5),
|
|
60
|
+
which is why the same paragraph looked different in the two editors. */
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
line-height: 1.5;
|
|
63
|
+
word-break: break-word;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* The off-screen editor used by the paginated surface is still a ProseMirror
|
|
68
|
+
* editing host. ProseMirror's own stylesheet gives it `white-space: pre-wrap`;
|
|
69
|
+
* this project does not import that stylesheet, so without this rule the
|
|
70
|
+
* browser collapses a paragraph's trailing space. The page paints the line from
|
|
71
|
+
* the layout projection, so the space is visible there, but the hidden caret
|
|
72
|
+
* stops before it: typing then replaces the invisible space instead of
|
|
73
|
+
* appending after it, and the caret looks stuck until the next keystroke.
|
|
74
|
+
*
|
|
75
|
+
* Scoped to the paginated host so the visible flowing editor keeps its current
|
|
76
|
+
* wrapping; only the hidden editing surface needs ProseMirror's contract.
|
|
77
|
+
*/
|
|
78
|
+
.begonia-paginated-editor-host .ald-editor.ProseMirror {
|
|
79
|
+
white-space: pre-wrap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ald-editor.ProseMirror ::selection {
|
|
83
|
+
background: var(--ald-accent-muted, rgba(13, 148, 136, 0.16));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ald-editor p {
|
|
87
|
+
margin: 0 0 1em;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ald-editor strong {
|
|
91
|
+
font-weight: 700;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ald-editor em {
|
|
95
|
+
font-style: italic;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ald-editor u {
|
|
99
|
+
text-decoration-thickness: 2px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ald-editor a {
|
|
103
|
+
/* Same fallback as DOC_LINK_COLOR in paginated-preview-doc-style.ts. The two
|
|
104
|
+
surfaces previously used different defaults, so a link changed colour
|
|
105
|
+
between the flowing and the paginated editor. */
|
|
106
|
+
color: var(--ald-link, #0563c1);
|
|
107
|
+
text-decoration-thickness: 2px;
|
|
108
|
+
text-underline-offset: 2px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ald-editor span[data-ald-text-style] {
|
|
112
|
+
border-radius: 0.12em;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ald-editor ul,
|
|
116
|
+
.ald-editor ol {
|
|
117
|
+
margin: 0 0 1em;
|
|
118
|
+
padding-left: 1.55em;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Preflight in the host app resets ol/ul list-style to none, and the rule
|
|
122
|
+
above only restores the indent. Without these rules the marker gutter is
|
|
123
|
+
reserved but empty, so the ordinal never appears. Word numbers a default
|
|
124
|
+
ordered list in decimal and bullets a default list with a disc, so these
|
|
125
|
+
values match the document model instead of inventing a look. */
|
|
126
|
+
.ald-editor ol {
|
|
127
|
+
list-style-type: decimal;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ald-editor ul {
|
|
131
|
+
list-style-type: disc;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ald-editor ol ol {
|
|
135
|
+
list-style-type: lower-alpha;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ald-editor ul ul {
|
|
139
|
+
list-style-type: circle;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Pin the marker to the document text token so a numbered item keeps a black
|
|
143
|
+
marker even when its first run carries a link or emphasis colour. */
|
|
144
|
+
.ald-editor li::marker {
|
|
145
|
+
color: var(--ald-doc-text, #000000);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ald-editor li {
|
|
149
|
+
margin: 0 0 0.35em;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ald-editor h1,
|
|
153
|
+
.ald-editor h2,
|
|
154
|
+
.ald-editor h3,
|
|
155
|
+
.ald-editor h4,
|
|
156
|
+
.ald-editor h5,
|
|
157
|
+
.ald-editor h6 {
|
|
158
|
+
margin: 0 0 0.66em;
|
|
159
|
+
/* Matches the layout's measured heading metrics: textScale() in
|
|
160
|
+
layout-core/src/shared.ts sizes every heading at 1.25x the body run and the
|
|
161
|
+
line box comes from the same 1.5 line-height ratio as body text. The old
|
|
162
|
+
2.1em/1.08em pair painted headings 33.6px tall inside a 30px measured line
|
|
163
|
+
box, so the paginated surface (which must honour the measurement) could
|
|
164
|
+
never match it. 1.25em of 16px is ~20px, which is also close to Word's
|
|
165
|
+
default Heading 1 (16pt). */
|
|
166
|
+
line-height: 1.5;
|
|
167
|
+
font-weight: 700;
|
|
168
|
+
letter-spacing: -0.01em;
|
|
169
|
+
/* Fallback mirrors DOC_HEADING_COLOR in paginated-preview-doc-style.ts. */
|
|
170
|
+
color: var(--ald-doc-heading, #000000);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Heading sizes step down by level.
|
|
174
|
+
These must equal HEADING_LEVEL_SCALES in layout-core/src/shared.ts. The
|
|
175
|
+
projection now carries headingLevel, so both this surface and the paginated
|
|
176
|
+
painter size the same heading the same way; these values are that ladder
|
|
177
|
+
expressed as em multiples of the 16px body size. */
|
|
178
|
+
.ald-editor h1 {
|
|
179
|
+
font-size: 1.25em;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ald-editor h2 {
|
|
183
|
+
font-size: 1.1111em;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ald-editor h3 {
|
|
187
|
+
font-size: 0.9876em;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ald-editor h4 {
|
|
191
|
+
font-size: 0.8779em;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.ald-editor h5 {
|
|
195
|
+
font-size: 0.7803em;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.ald-editor h6 {
|
|
199
|
+
font-size: 0.6936em;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.ald-editor .ald-table,
|
|
203
|
+
.ald-editor table {
|
|
204
|
+
width: 100%;
|
|
205
|
+
margin: 0 0 1.2em;
|
|
206
|
+
border-collapse: collapse;
|
|
207
|
+
table-layout: fixed;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ald-editor td {
|
|
211
|
+
/* Matches DOC_TABLE_BORDER so both surfaces draw the same rule. */
|
|
212
|
+
border: var(--ald-table-border, 1px solid rgba(0, 0, 0, 0.5));
|
|
213
|
+
/* Horizontal inset matches the layout's measured cell margin so the flowing
|
|
214
|
+
and paginated surfaces wrap text against the same content box.
|
|
215
|
+
No vertical inset: TABLE_CELL_VERTICAL_PADDING documents that OOXML treats an
|
|
216
|
+
omitted tblCellMar top/bottom as zero, and measurement confirms rows sit
|
|
217
|
+
flush to the border. The old 10px vertical padding made the flowing surface
|
|
218
|
+
disagree with both the standard and the paginated painter, which must honour
|
|
219
|
+
the measured geometry. */
|
|
220
|
+
padding: 0 10px;
|
|
221
|
+
vertical-align: top;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
* A header cell. The engine decorates the cells of a table's header rows with
|
|
226
|
+
* this class rather than emitting `th` elements, because whether a cell is a
|
|
227
|
+
* header comes from its row (or from the table's `w:tblLook`) and a cell's
|
|
228
|
+
* `toDOM` cannot see either. Emitting `th` would also change the exported
|
|
229
|
+
* HTML and make a re-import read plain body cells as headers.
|
|
230
|
+
*
|
|
231
|
+
* The weight and tint match the paginated painter, so the two surfaces agree:
|
|
232
|
+
* without this rule the flowing surface showed an unbolded, untinted header
|
|
233
|
+
* while the paginated one showed both.
|
|
234
|
+
*/
|
|
235
|
+
.ald-editor td.ald-cell-header {
|
|
236
|
+
font-weight: 700;
|
|
237
|
+
background: var(--ald-table-header-bg, rgba(226, 232, 240, 0.65));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/*
|
|
241
|
+
* Explicit page-break marker. The default theme keeps begonia's dashed
|
|
242
|
+
* marker box; a theme like `microsoft-word` swaps it for Word's look —
|
|
243
|
+
* a thin dotted gray rule flanking a small centered label — purely by
|
|
244
|
+
* setting `--ald-page-break-*` variables. Flex layout is a no-op for the
|
|
245
|
+
* default marker (the flanking pseudo-elements are not generated).
|
|
246
|
+
*/
|
|
247
|
+
.ald-editor .ald-page-break,
|
|
248
|
+
.ald-editor [data-ald-page-break] {
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
gap: 10px;
|
|
252
|
+
margin: 1.5em 0;
|
|
253
|
+
padding: var(--ald-page-break-padding, 10px 12px);
|
|
254
|
+
border-top: var(
|
|
255
|
+
--ald-page-break-rule-top,
|
|
256
|
+
2px dashed rgba(13, 148, 136, 0.4)
|
|
257
|
+
);
|
|
258
|
+
border-bottom: var(
|
|
259
|
+
--ald-page-break-rule-bottom,
|
|
260
|
+
2px dashed rgba(13, 148, 136, 0.18)
|
|
261
|
+
);
|
|
262
|
+
color: var(--ald-page-break-label-color, #0f766e);
|
|
263
|
+
font-size: 12px;
|
|
264
|
+
font-family: var(
|
|
265
|
+
--ald-font-ui,
|
|
266
|
+
'Inter',
|
|
267
|
+
'Segoe UI Variable',
|
|
268
|
+
'Helvetica Neue',
|
|
269
|
+
sans-serif
|
|
270
|
+
);
|
|
271
|
+
font-weight: var(--ald-page-break-label-weight, 700);
|
|
272
|
+
letter-spacing: 0.12em;
|
|
273
|
+
text-transform: var(--ald-page-break-label-transform, uppercase);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ald-editor .ald-page-break::before,
|
|
277
|
+
.ald-editor .ald-page-break::after,
|
|
278
|
+
.ald-editor [data-ald-page-break]::before,
|
|
279
|
+
.ald-editor [data-ald-page-break]::after {
|
|
280
|
+
content: var(--ald-page-break-flank-content, none);
|
|
281
|
+
flex: 1 1 0;
|
|
282
|
+
border-top: var(--ald-page-break-flank-rule, 1px dotted #a6a6a6);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/*
|
|
286
|
+
* A commented run in the editable surface.
|
|
287
|
+
*
|
|
288
|
+
* A comment is stored as two zero-width markers that print nothing, so the wash
|
|
289
|
+
* is what tells a reader the text carries a thread. It matches the tint the
|
|
290
|
+
* paginated preview paints for the same run, so a comment looks the same in both
|
|
291
|
+
* surfaces instead of being findable in only one of them.
|
|
292
|
+
*/
|
|
293
|
+
.ald-comment-highlight {
|
|
294
|
+
background: var(--ald-comment-tint, rgba(217, 119, 6, 0.22));
|
|
295
|
+
/* An underline as well as a fill: a background alone disappears for a reader
|
|
296
|
+
who prints the document or uses a theme where the tint is very faint. */
|
|
297
|
+
box-shadow: inset 0 -0.55em 0 0
|
|
298
|
+
var(--ald-comment-tint, rgba(217, 119, 6, 0.22));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.ald-revision-insert {
|
|
302
|
+
text-decoration: underline;
|
|
303
|
+
text-decoration-thickness: 2px;
|
|
304
|
+
text-decoration-color: var(--ald-revision-insert-text, #0f766e);
|
|
305
|
+
background: var(--ald-revision-insert-bg, rgba(13, 148, 136, 0.12));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.ald-revision-delete {
|
|
309
|
+
text-decoration: line-through;
|
|
310
|
+
text-decoration-thickness: 2px;
|
|
311
|
+
text-decoration-color: var(--ald-revision-delete-text, #be123c);
|
|
312
|
+
background: var(--ald-revision-delete-bg, rgba(244, 63, 94, 0.09));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ald-cursor {
|
|
316
|
+
position: relative;
|
|
317
|
+
margin-left: -1px;
|
|
318
|
+
margin-right: -1px;
|
|
319
|
+
border-left: 2px solid;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.ald-cursor-label {
|
|
323
|
+
position: absolute;
|
|
324
|
+
top: -1.45em;
|
|
325
|
+
left: -1px;
|
|
326
|
+
padding: 2px 7px;
|
|
327
|
+
border-radius: 999px;
|
|
328
|
+
color: white;
|
|
329
|
+
font-size: 11px;
|
|
330
|
+
font-family: var(
|
|
331
|
+
--ald-font-ui,
|
|
332
|
+
'Inter',
|
|
333
|
+
'Segoe UI Variable',
|
|
334
|
+
'Helvetica Neue',
|
|
335
|
+
sans-serif
|
|
336
|
+
);
|
|
337
|
+
font-weight: 700;
|
|
338
|
+
white-space: nowrap;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/*
|
|
342
|
+
* The paginated caret blinks.
|
|
343
|
+
*
|
|
344
|
+
* The plain editor gets its blink from the browser: it mounts a real
|
|
345
|
+
* contenteditable, and the browser blinks the native caret there. The paginated
|
|
346
|
+
* editor paints its own caret as a `div` over the page, so nothing blinks it
|
|
347
|
+
* unless a rule says to - a static vertical line reads as a frozen UI rather
|
|
348
|
+
* than as a cursor waiting for input.
|
|
349
|
+
*
|
|
350
|
+
* The animation lives in CSS, not in React, on purpose. A caret that blinked by
|
|
351
|
+
* re-rendering would repaint every page frame about twenty times a second and
|
|
352
|
+
* would contend with the overlay's own change detection: `publish()` dedupes by
|
|
353
|
+
* comparing geometry, so a blink expressed as a state change either has to
|
|
354
|
+
* defeat that dedupe or fight it. Declarative opacity costs nothing: the
|
|
355
|
+
* compositor runs it, and no component re-renders.
|
|
356
|
+
*
|
|
357
|
+
* The shape mirrors superdoc's `superdoc-caret-blink`: 1.2s, ease-in-out, and a
|
|
358
|
+
* dip to 0.55 rather than to 0. A caret that vanishes entirely flickers; one
|
|
359
|
+
* that dims still reads as present, which is what a cursor should do while the
|
|
360
|
+
* reader is thinking.
|
|
361
|
+
*
|
|
362
|
+
* Longhands, not the `animation` shorthand: the shorthand discards its
|
|
363
|
+
* longhand components in some DOM implementations, which makes the contract
|
|
364
|
+
* untestable in a unit test and leaves only a browser check. Written out, the
|
|
365
|
+
* four longhands are readable, greppable, and assertable.
|
|
366
|
+
*/
|
|
367
|
+
@keyframes begonia-paginated-caret-blink {
|
|
368
|
+
0%,
|
|
369
|
+
45% {
|
|
370
|
+
opacity: 1;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
55%,
|
|
374
|
+
100% {
|
|
375
|
+
opacity: 0;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
[data-begonia-paginated-caret='true'] {
|
|
380
|
+
animation-name: begonia-paginated-caret-blink;
|
|
381
|
+
animation-duration: 1.06s;
|
|
382
|
+
animation-timing-function: steps(1, end);
|
|
383
|
+
animation-iteration-count: infinite;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/*
|
|
387
|
+
* Respect the reader's motion preference. Blinking is the one place where a
|
|
388
|
+
* reduced-motion reader is actively harmed by an animation: a caret that never
|
|
389
|
+
* sits still is tiring, and the caret is on screen the whole time someone types.
|
|
390
|
+
* The caret stays visible and solid instead of disappearing - it still has to
|
|
391
|
+
* show where the next character goes.
|
|
392
|
+
*/
|
|
393
|
+
@media (prefers-reduced-motion: reduce) {
|
|
394
|
+
[data-begonia-paginated-caret='true'] {
|
|
395
|
+
animation-name: none;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
@media (max-width: 860px) {
|
|
400
|
+
.editor-frame {
|
|
401
|
+
padding: 0.75rem;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.ald-editor.ProseMirror {
|
|
405
|
+
padding: 1.5rem 1.25rem 2.25rem;
|
|
406
|
+
font-size: 17px;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/*
|
|
411
|
+
* A header or footer story is a strip, not a page.
|
|
412
|
+
*
|
|
413
|
+
* The scratch view is built with the same `.ald-editor` surface as the body, so it
|
|
414
|
+
* inherits the page rules above - `min-height: 398px` and a `2rem` top padding.
|
|
415
|
+
* Inside a band that box is far taller than the strip holding it: the view
|
|
416
|
+
* overflowed upwards out of its container, so the caret the writer saw sat well
|
|
417
|
+
* below the line they had clicked and the header text appeared to be painted in
|
|
418
|
+
* the wrong place. Word gives a story exactly the room its text needs, and so
|
|
419
|
+
* does this: no minimum height, no page padding, and the strip's own inset comes
|
|
420
|
+
* from the band geometry, which is derived from the header distance.
|
|
421
|
+
*
|
|
422
|
+
* Scoped by the band's editor host, so the body surface keeps its page styling
|
|
423
|
+
* and this cannot leak into a flowing editor that has no bands at all.
|
|
424
|
+
*/
|
|
425
|
+
[data-begonia-header-footer-editor='true'] .ald-editor.ProseMirror {
|
|
426
|
+
min-height: 0;
|
|
427
|
+
padding: 0;
|
|
428
|
+
overflow: visible;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/*
|
|
432
|
+
* The story scrolls inside its own strip rather than growing the band. A long
|
|
433
|
+
* header would otherwise overflow the margin and paint over the body text.
|
|
434
|
+
*/
|
|
435
|
+
[data-begonia-header-footer-editor='true'] {
|
|
436
|
+
overscroll-behavior: contain;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/*
|
|
440
|
+
* A footer's last line ends the story; its trailing margin is paper.
|
|
441
|
+
*
|
|
442
|
+
* The paginator places a footer by its measured text, so the blank space after
|
|
443
|
+
* the final line belongs to the page rather than to the story. Keeping the
|
|
444
|
+
* paragraph's one-em bottom margin pushed the whole footer story up by 16px, so
|
|
445
|
+
* an opened footer showed its text well above where the page paints it and
|
|
446
|
+
* closing the band made the text jump.
|
|
447
|
+
*
|
|
448
|
+
* Deliberately footer-only. A header is measured downwards from the header
|
|
449
|
+
* distance and *does* count that margin, so dropping it there made a two-line
|
|
450
|
+
* header 64px while editing and 80px once painted - the same jump, mirrored.
|
|
451
|
+
*/
|
|
452
|
+
[data-begonia-header-footer-band='footer']
|
|
453
|
+
[data-begonia-header-footer-editor='true']
|
|
454
|
+
.ProseMirror
|
|
455
|
+
> p:last-child {
|
|
456
|
+
margin-bottom: 0;
|
|
457
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,12 +8,18 @@ export { BrowserViewControls } from './browser-view-controls.tsx';
|
|
|
8
8
|
export type { BrowserViewControlsProps } from './browser-view-controls.tsx';
|
|
9
9
|
export { CommentsSidebar } from './CommentsSidebar.tsx';
|
|
10
10
|
export type { CommentsSidebarProps } from './CommentsSidebar.tsx';
|
|
11
|
+
export type { PreviewCommentHighlightState, PreviewCommentStateResolver, } from './binding/virtual-paged-preview-comment-highlight.ts';
|
|
12
|
+
export { resolveSnapshotCommentState } from './binding/resolve-snapshot-comment-state.ts';
|
|
11
13
|
export { BrowserContextMenu } from './BrowserContextMenu.tsx';
|
|
12
14
|
export type { BrowserContextMenuProps } from './BrowserContextMenu.tsx';
|
|
13
15
|
export { BrowserLinkPopover } from './BrowserLinkPopover.tsx';
|
|
14
16
|
export type { BrowserLinkPopoverProps } from './BrowserLinkPopover.tsx';
|
|
15
17
|
export { EditorToolbar } from './EditorToolbar.tsx';
|
|
16
18
|
export type { EditorToolbarProps } from './EditorToolbar.tsx';
|
|
19
|
+
export { EditorToolbarBlockControls } from './editor-toolbar-block-controls.tsx';
|
|
20
|
+
export type { EditorToolbarBlockControlsProps } from './editor-toolbar-block-controls.tsx';
|
|
21
|
+
export { EditorToolbarInsertControls } from './editor-toolbar-insert-controls.tsx';
|
|
22
|
+
export type { EditorToolbarInsertControlsProps } from './editor-toolbar-insert-controls.tsx';
|
|
17
23
|
export { ReviewPanel } from './ReviewPanel.tsx';
|
|
18
24
|
export type { ReviewPanelProps } from './ReviewPanel.tsx';
|
|
19
25
|
export { ReviewTimelinePanel } from './ReviewTimelinePanel.tsx';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,
|
|
1
|
+
import{$ as T,A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,M as K,R as L,S as M,T as N,U as O,X as P,Y as Q,Z as R,_ as S,a,aa as U,b,ba as V,c,ca as W,d,da as X,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,v as u,w as v,x as w,y as x,z as y}from"./chunk-LIAB6VEG.js";export{W as BegoniaBrowserEditor,d as BegoniaPdfViewer,L as BrowserCommentsDisplayControls,Q as BrowserContextMenu,R as BrowserLinkPopover,S as BrowserReviewDisplayControls,T as BrowserViewControls,M as CommentsSidebar,e as DEFAULT_VIRTUAL_PAGED_PREVIEW_SCALE,f as DEFAULT_WEB_FLOW_PAGE_HEIGHT_PX,P as EditorToolbar,N as EditorToolbarBlockControls,O as EditorToolbarInsertControls,I as PREVIEW_TABLE_CELL_HORIZONTAL_PADDING,J as PREVIEW_TABLE_CELL_VERTICAL_PADDING,r as PaginatedLayoutView,s as PaginatedPageOverlayView,U as ReviewPanel,V as ReviewTimelinePanel,m as VIRTUAL_PAGED_PREVIEW_FRAME_DATA_ATTRIBUTE,q as VirtualPagedPreview,g as WEB_VIRTUAL_PAGED_PREVIEW_HORIZONTAL_PADDING_PX,v as applyVirtualPagedPreviewAutoscroll,a as begoniaThemeRootProps,p as bindVirtualPagedPreviewWindowDragListeners,z as cloneVirtualPagedPreviewMetrics,X as createPdfViewerController,w as createVirtualPagedPreviewAutoscrollController,k as createVirtualPagedPreviewDragSession,F as createVirtualPagedPreviewSessionState,l as isVirtualPagedPreviewFrameTarget,A as normalizeVirtualPagedPreviewPinnedPageIndexes,B as normalizeVirtualPagedPreviewRequestKey,h as resolvePaginatedLayoutViewOptions,i as resolvePaginatedPreviewFlowMode,j as resolveRequestedPaginatedLayoutFlowMode,K as resolveSnapshotCommentState,x as resolveVirtualPagedPreviewAutoscrollDelta,C as resolveVirtualPagedPreviewHostMeasurement,n as resolveVirtualPagedPreviewPositionHit,o as resolveVirtualPagedPreviewPositionHitInMountedFrames,y as resolveVirtualPagedPreviewRenderState,D as resolveVirtualPagedPreviewResizeObserver,G as resolveVirtualPagedPreviewSessionCommit,H as resolveVirtualPagedPreviewSessionViewportEmission,E as sameVirtualPagedPreviewMetrics,t as useBrowserEditorUi,b as useControllerSnapshot,c as useControllerSnapshotSignal,u as useEditorUiController};
|
package/dist/v1.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { BrowserAdvancedOoxmlInspector } from './BrowserAdvancedOoxmlInspector.t
|
|
|
5
5
|
export type { BrowserAdvancedOoxmlInspectorProps } from './BrowserAdvancedOoxmlInspector.tsx';
|
|
6
6
|
export { BrowserRichFormatControls } from './browser-rich-format-controls.tsx';
|
|
7
7
|
export type { BrowserRichFormatControlsProps } from './browser-rich-format-controls.tsx';
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
8
|
+
export { BrowserHeaderFooterBands, BrowserHeaderFooterControls, BrowserHeaderFooterFormatBar, createHeaderFooterScratchSurface, useHeaderFooterScratchSurface, useBrowserHeaderFooterEditing, HeaderFooterScratchMount, } from './binding/v1.ts';
|
|
9
|
+
export type { BrowserHeaderFooterBandsProps, BrowserHeaderFooterControlsProps, BrowserHeaderFooterFormatBarProps, BrowserHeaderFooterEditing, HeaderFooterBandSlots, HeaderFooterBandTarget, HeaderFooterParticipant, HeaderFooterScratchSurfaceHandle, UseBrowserHeaderFooterEditingOptions, } from './binding/v1.ts';
|
|
10
|
+
export { BrowserPaginatedEditorSurface, BrowserPaginatedPreview, BrowserWhiteboardPdfPreview, BrowserWhiteboardPreview, DocumentReactMount, useBrowserEditorController, useBrowserEditorDocument, useUndoRedoHotkeys, } from './binding/v1.ts';
|
|
11
|
+
export type { BrowserHistoryShortcutTarget, BrowserPaginatedEditorSurfaceProps, BrowserPaginatedPreviewProps, BrowserWhiteboardPdfPreviewProps, BrowserWhiteboardPreviewProps, DocumentReactMountProps, UseBrowserEditorControllerOptions, UseBrowserEditorControllerResult, } from './binding/v1.ts';
|
|
10
12
|
export type { BrowserCommentsModuleOptions, BrowserEditorController, BrowserEditorState, BrowserTrackChangesModuleOptions, CreateBrowserEditorOptions, } from '@datalking/begonia-browser/v1';
|