@whity/ui 0.5.0 → 1.0.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/README.md +107 -107
- package/package.json +221 -192
- package/src/access-denied.stories.tsx +179 -179
- package/src/access-denied.tsx +305 -305
- package/src/action-proposal.tsx +338 -302
- package/src/actor-chip.tsx +71 -71
- package/src/agent-activity.tsx +163 -163
- package/src/agent-collaboration.stories.tsx +156 -156
- package/src/agent-run-status.tsx +196 -196
- package/src/alert-dialog.stories.tsx +45 -45
- package/src/alert-dialog.tsx +147 -147
- package/src/alert.stories.tsx +91 -91
- package/src/alert.tsx +89 -89
- package/src/app-sidebar.stories.tsx +195 -195
- package/src/app-sidebar.tsx +604 -500
- package/src/approval-queue.tsx +109 -108
- package/src/audience-group-picker.stories.tsx +198 -198
- package/src/audience-group-picker.tsx +362 -362
- package/src/audience-people-picker.stories.tsx +102 -102
- package/src/audience-people-picker.tsx +279 -279
- package/src/avatar-pattern.ts +138 -0
- package/src/avatar.tsx +125 -83
- package/src/badge.stories.tsx +105 -105
- package/src/badge.tsx +68 -68
- package/src/beta-warning.stories.tsx +79 -79
- package/src/beta-warning.tsx +189 -189
- package/src/bilingual-input.stories.tsx +82 -82
- package/src/bilingual-input.tsx +188 -183
- package/src/board.tsx +216 -0
- package/src/breadcrumb.stories.tsx +51 -51
- package/src/breadcrumb.tsx +90 -90
- package/src/built-on-whity.tsx +52 -0
- package/src/button.stories.tsx +87 -87
- package/src/button.tsx +123 -118
- package/src/card.stories.tsx +423 -423
- package/src/card.tsx +180 -180
- package/src/chart.stories.tsx +66 -66
- package/src/chart.tsx +228 -228
- package/src/checkbox.stories.tsx +62 -62
- package/src/checkbox.tsx +54 -54
- package/src/collapsible.stories.tsx +48 -48
- package/src/collapsible.tsx +34 -34
- package/src/color-card.stories.tsx +61 -61
- package/src/color-card.tsx +270 -270
- package/src/color-picker.stories.tsx +65 -65
- package/src/color-picker.tsx +425 -425
- package/src/column-matcher.tsx +84 -0
- package/src/command-palette.tsx +398 -306
- package/src/confirm-action.tsx +98 -0
- package/src/copy-block.stories.tsx +38 -38
- package/src/copy-block.tsx +85 -85
- package/src/data-table.stories.tsx +200 -200
- package/src/data-table.tsx +1686 -1106
- package/src/date-picker.stories.tsx +61 -61
- package/src/date-picker.tsx +456 -422
- package/src/design-cards.stories.tsx +551 -458
- package/src/dialog.stories.tsx +48 -48
- package/src/dialog.tsx +179 -166
- package/src/display-preferences.tsx +50 -0
- package/src/documents/barcode-svg.stories.tsx +72 -72
- package/src/documents/barcode-svg.tsx +79 -79
- package/src/dropdown-menu.stories.tsx +77 -77
- package/src/dropdown-menu.tsx +271 -271
- package/src/editor/agent-panel.tsx +222 -0
- package/src/editor/agents.stories.tsx +81 -0
- package/src/editor/agents.ts +55 -0
- package/src/editor/behaviour.ts +279 -279
- package/src/editor/block-ids.ts +44 -44
- package/src/editor/block-list.tsx +104 -101
- package/src/editor/block-toolbar.tsx +490 -477
- package/src/editor/bubble.tsx +119 -93
- package/src/editor/catalogue.ts +169 -103
- package/src/editor/collab-rail.tsx +746 -746
- package/src/editor/collab.stories.tsx +207 -207
- package/src/editor/collab.ts +87 -87
- package/src/editor/contract.ts +476 -408
- package/src/editor/convert.ts +414 -362
- package/src/editor/doc-editor.stories.tsx +98 -98
- package/src/editor/doc-editor.tsx +1492 -1287
- package/src/editor/editor.css +636 -536
- package/src/editor/extensions.ts +86 -86
- package/src/editor/field-bar.tsx +154 -0
- package/src/editor/field-picker.tsx +109 -107
- package/src/editor/fields.ts +100 -100
- package/src/editor/gutter.tsx +443 -367
- package/src/editor/index.ts +23 -22
- package/src/editor/label-sheet.tsx +289 -289
- package/src/editor/labels.ts +394 -310
- package/src/editor/link-tools.tsx +141 -141
- package/src/editor/node-views.tsx +461 -450
- package/src/editor/page-view.tsx +372 -353
- package/src/editor/phone.tsx +310 -0
- package/src/editor/plugin-block-view.tsx +230 -0
- package/src/editor/plugin-blocks.stories.tsx +96 -0
- package/src/editor/plugin-blocks.ts +52 -0
- package/src/editor/publish-check.tsx +201 -182
- package/src/editor/rich-blocks.stories.tsx +146 -146
- package/src/editor/sample.ts +40 -40
- package/src/editor/save-block-dialog.tsx +141 -0
- package/src/editor/saved-block-view.tsx +205 -0
- package/src/editor/saved-blocks.stories.tsx +105 -0
- package/src/editor/saved-parts.ts +192 -0
- package/src/editor/schema-rich.ts +156 -150
- package/src/editor/schema.ts +368 -315
- package/src/editor/services.tsx +205 -127
- package/src/editor/slash.ts +64 -64
- package/src/editor/suggesting.ts +372 -372
- package/src/editor/suggestions.ts +763 -763
- package/src/editor/table-keys.ts +66 -66
- package/src/editor/templates.stories.tsx +324 -324
- package/src/editor/toolbar.tsx +364 -358
- package/src/empty-state.stories.tsx +51 -51
- package/src/empty-state.tsx +126 -100
- package/src/empty-state.usage-notes.md +30 -30
- package/src/form.stories.tsx +112 -112
- package/src/form.tsx +176 -176
- package/src/globals.css +20 -20
- package/src/icon-button.tsx +85 -85
- package/src/icon-map.ts +335 -244
- package/src/icon.tsx +41 -41
- package/src/index.ts +90 -67
- package/src/input.stories.tsx +157 -157
- package/src/input.tsx +768 -759
- package/src/kpi-strip.tsx +47 -0
- package/src/localized-text.ts +76 -0
- package/src/locked-screen.stories.tsx +29 -29
- package/src/locked-screen.tsx +75 -61
- package/src/lockup.tsx +42 -0
- package/src/lottie.tsx +441 -0
- package/src/mark.tsx +62 -62
- package/src/math-text.stories.tsx +33 -33
- package/src/math-text.tsx +43 -43
- package/src/menu-bar.stories.tsx +198 -198
- package/src/menu-bar.tsx +373 -373
- package/src/message-thread.tsx +181 -0
- package/src/money/currency.ts +244 -230
- package/src/money/money-input.tsx +131 -0
- package/src/money/money.tsx +33 -0
- package/src/open-on-computer.tsx +150 -0
- package/src/otp-input.tsx +161 -0
- package/src/page-header.stories.tsx +95 -95
- package/src/page-header.tsx +122 -122
- package/src/page-shell.stories.tsx +42 -42
- package/src/page-shell.tsx +32 -32
- package/src/page-states.tsx +277 -0
- package/src/pagination.stories.tsx +45 -45
- package/src/pagination.tsx +98 -98
- package/src/paper-sheet.stories.tsx +88 -0
- package/src/paper-sheet.tsx +85 -0
- package/src/phone-tab-bar.tsx +152 -0
- package/src/plugin-card.stories.tsx +208 -180
- package/src/plugin-card.tsx +931 -848
- package/src/popover.stories.tsx +48 -48
- package/src/popover.tsx +55 -55
- package/src/radio-group.stories.tsx +26 -26
- package/src/radio-group.tsx +44 -44
- package/src/route-flow/editor.tsx +1087 -1014
- package/src/route-flow/model.ts +771 -716
- package/src/save-bar.tsx +94 -0
- package/src/scope-grant.tsx +139 -139
- package/src/screen-too-small.stories.tsx +61 -61
- package/src/screen-too-small.tsx +104 -104
- package/src/search-field.tsx +65 -0
- package/src/select.stories.tsx +44 -44
- package/src/select.tsx +197 -197
- package/src/separator.stories.tsx +34 -34
- package/src/separator.tsx +34 -34
- package/src/sheet.stories.tsx +49 -49
- package/src/sheet.tsx +168 -168
- package/src/skeleton.stories.tsx +28 -28
- package/src/skeleton.tsx +19 -19
- package/src/slider.stories.tsx +78 -78
- package/src/slider.tsx +300 -300
- package/src/spinner.stories.tsx +33 -33
- package/src/spinner.tsx +55 -55
- package/src/stepper.tsx +85 -0
- package/src/switch.stories.tsx +42 -42
- package/src/switch.tsx +41 -41
- package/src/switcher.stories.tsx +111 -111
- package/src/switcher.tsx +131 -131
- package/src/system-state.tsx +55 -0
- package/src/table.stories.tsx +48 -48
- package/src/table.tsx +121 -121
- package/src/tabs.stories.tsx +74 -74
- package/src/tabs.tsx +90 -90
- package/src/tag-input.stories.tsx +67 -67
- package/src/tag-input.tsx +117 -117
- package/src/tenant-logo.tsx +63 -63
- package/src/tenant-switcher.stories.tsx +38 -38
- package/src/tenant-switcher.tsx +164 -164
- package/src/textarea.stories.tsx +27 -27
- package/src/textarea.tsx +18 -18
- package/src/theme-mode.ts +52 -52
- package/src/time-grid.tsx +163 -0
- package/src/time-picker.stories.tsx +62 -62
- package/src/time-picker.tsx +615 -615
- package/src/toggle-group.tsx +138 -138
- package/src/tooltip.stories.tsx +43 -43
- package/src/tooltip.tsx +73 -73
- package/src/top-nav.stories.tsx +58 -58
- package/src/top-nav.tsx +324 -324
- package/src/undo-bar.tsx +107 -107
- package/src/utils.ts +45 -45
- package/src/view-toggle.stories.tsx +84 -84
- package/src/view-toggle.tsx +110 -110
|
@@ -1,450 +1,461 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { NodeViewContent, NodeViewWrapper, ReactNodeViewRenderer, type ReactNodeViewProps } from "@tiptap/react"
|
|
5
|
-
|
|
6
|
-
import { Badge } from "../badge"
|
|
7
|
-
import { Chart } from "../chart"
|
|
8
|
-
import { BarcodeSvg } from "../documents/barcode-svg"
|
|
9
|
-
import { Icon } from "../icon"
|
|
10
|
-
import { MathText } from "../math-text"
|
|
11
|
-
import { cn } from "../utils"
|
|
12
|
-
import type { Inline } from "./contract"
|
|
13
|
-
import { fill } from "./labels"
|
|
14
|
-
import {
|
|
15
|
-
BarcodeBlock,
|
|
16
|
-
Callout,
|
|
17
|
-
ChartBlock,
|
|
18
|
-
FileBlock,
|
|
19
|
-
Image,
|
|
20
|
-
MathBlock,
|
|
21
|
-
PageBreak,
|
|
22
|
-
QrBlock,
|
|
23
|
-
RecordBlock,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<div className="wy-placeholder">{
|
|
173
|
-
) : state === "
|
|
174
|
-
<div className="wy-
|
|
175
|
-
) :
|
|
176
|
-
<div className="wy-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
const
|
|
211
|
-
const
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
{
|
|
282
|
-
|
|
283
|
-
)
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
</div>
|
|
330
|
-
) : (
|
|
331
|
-
<div className="wy-
|
|
332
|
-
|
|
333
|
-
</div>
|
|
334
|
-
)
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
dom.
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
dom
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { NodeViewContent, NodeViewWrapper, ReactNodeViewRenderer, type ReactNodeViewProps } from "@tiptap/react"
|
|
5
|
+
|
|
6
|
+
import { Badge } from "../badge"
|
|
7
|
+
import { Chart } from "../chart"
|
|
8
|
+
import { BarcodeSvg } from "../documents/barcode-svg"
|
|
9
|
+
import { Icon } from "../icon"
|
|
10
|
+
import { MathText } from "../math-text"
|
|
11
|
+
import { cn } from "../utils"
|
|
12
|
+
import type { Inline } from "./contract"
|
|
13
|
+
import { fill } from "./labels"
|
|
14
|
+
import {
|
|
15
|
+
BarcodeBlock,
|
|
16
|
+
Callout,
|
|
17
|
+
ChartBlock,
|
|
18
|
+
FileBlock,
|
|
19
|
+
Image,
|
|
20
|
+
MathBlock,
|
|
21
|
+
PageBreak,
|
|
22
|
+
QrBlock,
|
|
23
|
+
RecordBlock,
|
|
24
|
+
PluginBlockNode,
|
|
25
|
+
SavedBlockNode,
|
|
26
|
+
SignatureBlock,
|
|
27
|
+
Table,
|
|
28
|
+
Toggle,
|
|
29
|
+
} from "./schema-rich"
|
|
30
|
+
import { PluginBlockView } from "./plugin-block-view"
|
|
31
|
+
import { SavedBlockView } from "./saved-block-view"
|
|
32
|
+
import { Field, MathInline } from "./schema"
|
|
33
|
+
import { formatSize, inlineText, useEditorServices, type ChartData, type RecordView } from "./services"
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* How the rich blocks look in the editor (EditorBlocks, bundle.css
|
|
37
|
+
* `.wy-blk--*`). Atoms are read-only here; their block toolbar edits them
|
|
38
|
+
* (block-toolbar.tsx). Containers (callout, toggle) keep their text editable.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const blockAttrs = (props: ReactNodeViewProps, type: string) => ({
|
|
42
|
+
"data-type": type,
|
|
43
|
+
"data-block-id": props.node.attrs.id ?? undefined,
|
|
44
|
+
className: cn("wy-rich", props.selected && "is-selected"),
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
function CalloutView(props: ReactNodeViewProps) {
|
|
48
|
+
const important = props.node.attrs.kind === "important"
|
|
49
|
+
return (
|
|
50
|
+
<NodeViewWrapper {...blockAttrs(props, "callout")} data-kind={important ? "important" : "note"}>
|
|
51
|
+
<span contentEditable={false} className="wy-callout-icon">
|
|
52
|
+
<Icon name={important ? "alert" : "info"} />
|
|
53
|
+
</span>
|
|
54
|
+
<NodeViewContent as="div" className="wy-callout-text" />
|
|
55
|
+
</NodeViewWrapper>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function ToggleView(props: ReactNodeViewProps) {
|
|
60
|
+
const { labels } = useEditorServices()
|
|
61
|
+
const open = Boolean(props.node.attrs.open)
|
|
62
|
+
return (
|
|
63
|
+
<NodeViewWrapper {...blockAttrs(props, "toggle")} data-open={open ? "true" : "false"}>
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
contentEditable={false}
|
|
67
|
+
className="wy-toggle-button"
|
|
68
|
+
aria-expanded={open}
|
|
69
|
+
aria-label={open ? labels.toggleClose : labels.toggleOpen}
|
|
70
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
71
|
+
onClick={() => props.updateAttributes({ open: !open })}
|
|
72
|
+
>
|
|
73
|
+
<Icon name="chevron-right" />
|
|
74
|
+
</button>
|
|
75
|
+
<NodeViewContent as="div" className="wy-toggle-content" />
|
|
76
|
+
</NodeViewWrapper>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function PageBreakView(props: ReactNodeViewProps) {
|
|
81
|
+
const { labels } = useEditorServices()
|
|
82
|
+
return (
|
|
83
|
+
<NodeViewWrapper {...blockAttrs(props, "pageBreak")}>
|
|
84
|
+
<div className="wy-pagebreak">{labels.blockPageBreak}</div>
|
|
85
|
+
</NodeViewWrapper>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function ImageView(props: ReactNodeViewProps) {
|
|
90
|
+
const { labels } = useEditorServices()
|
|
91
|
+
const { src, alt, width, caption } = props.node.attrs as { src: string; alt: string; width: string; caption: Inline[] | null }
|
|
92
|
+
return (
|
|
93
|
+
<NodeViewWrapper {...blockAttrs(props, "image")} data-width={width}>
|
|
94
|
+
<figure className="wy-figure">
|
|
95
|
+
{src ? <img src={src} alt={alt} draggable={false} /> : <div className="wy-placeholder">{labels.imageEmpty}</div>}
|
|
96
|
+
{caption && caption.length > 0 && <figcaption dir="auto">{inlineText(caption)}</figcaption>}
|
|
97
|
+
</figure>
|
|
98
|
+
</NodeViewWrapper>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function FileView(props: ReactNodeViewProps) {
|
|
103
|
+
const { services, labels } = useEditorServices()
|
|
104
|
+
const { fileId, name, size, mime } = props.node.attrs as { fileId: string; name: string; size: number; mime: string }
|
|
105
|
+
const kind = (mime.split("/")[1] ?? "").toUpperCase()
|
|
106
|
+
const href = fileId && services.fileUrl ? services.fileUrl(fileId) : undefined
|
|
107
|
+
return (
|
|
108
|
+
<NodeViewWrapper {...blockAttrs(props, "file")}>
|
|
109
|
+
<div className="wy-file">
|
|
110
|
+
<span className="wy-tile" aria-hidden="true">
|
|
111
|
+
<Icon name="document" />
|
|
112
|
+
</span>
|
|
113
|
+
<span className="wy-file-meta">
|
|
114
|
+
<span className="font-medium" dir="auto">
|
|
115
|
+
{name || labels.fileEmpty}
|
|
116
|
+
</span>
|
|
117
|
+
{fileId && <span className="text-xs text-muted-foreground">{[formatSize(size), kind].filter(Boolean).join(" · ")}</span>}
|
|
118
|
+
</span>
|
|
119
|
+
{href && (
|
|
120
|
+
<a href={href} download={name} className="wy-file-download" aria-label={fill(labels.fileDownload, { name })} contentEditable={false}>
|
|
121
|
+
<Icon name="download" />
|
|
122
|
+
</a>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
</NodeViewWrapper>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Loads live data for a block, again whenever the block's source changes. */
|
|
130
|
+
function useLive<T>(key: string, load: (() => Promise<T | null>) | null): { state: "loading" | "ready" | "hidden" | "error" | "none"; data: T | null } {
|
|
131
|
+
const [result, setResult] = React.useState<{ key: string; state: "loading" | "ready" | "hidden" | "error" | "none"; data: T | null }>({ key: "", state: "loading", data: null })
|
|
132
|
+
React.useEffect(() => {
|
|
133
|
+
if (!load) {
|
|
134
|
+
setResult({ key, state: "none", data: null })
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
let live = true
|
|
138
|
+
setResult({ key, state: "loading", data: null })
|
|
139
|
+
load()
|
|
140
|
+
.then((data) => live && setResult({ key, state: data === null ? "hidden" : "ready", data }))
|
|
141
|
+
.catch(() => live && setResult({ key, state: "error", data: null }))
|
|
142
|
+
return () => {
|
|
143
|
+
live = false
|
|
144
|
+
}
|
|
145
|
+
// `load` is rebuilt every render; the key says when the source really changed.
|
|
146
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
147
|
+
}, [key])
|
|
148
|
+
return result.key === key ? result : { state: "loading", data: null }
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function RecordView_(props: ReactNodeViewProps) {
|
|
152
|
+
const { services, labels } = useEditorServices()
|
|
153
|
+
const ref = props.node.attrs.ref as { type: string; id: string } | null
|
|
154
|
+
const key = ref ? `${ref.type}:${ref.id}` : ""
|
|
155
|
+
const { state, data } = useLive<RecordView>(key, ref && services.resolveRecord ? () => services.resolveRecord!(ref) : null)
|
|
156
|
+
const summary = props.node.attrs.view === "summary"
|
|
157
|
+
return (
|
|
158
|
+
<NodeViewWrapper {...blockAttrs(props, "record")}>
|
|
159
|
+
<div className="wy-embed">
|
|
160
|
+
<div className="wy-embed-head">
|
|
161
|
+
<Icon name="invoice" size={14} />
|
|
162
|
+
{data?.typeLabel ?? labels.blockRecord}
|
|
163
|
+
<span className="flex-1" />
|
|
164
|
+
{state === "ready" && (
|
|
165
|
+
<>
|
|
166
|
+
<Icon name="sync" size={12} />
|
|
167
|
+
{labels.live}
|
|
168
|
+
</>
|
|
169
|
+
)}
|
|
170
|
+
</div>
|
|
171
|
+
{!ref ? (
|
|
172
|
+
<div className="wy-placeholder">{labels.recordEmpty}</div>
|
|
173
|
+
) : state === "loading" ? (
|
|
174
|
+
<div className="wy-skeleton" aria-busy="true" />
|
|
175
|
+
) : state === "hidden" || state === "none" ? (
|
|
176
|
+
<div className="wy-placeholder">{state === "hidden" ? labels.recordHidden : labels.recordUnavailable}</div>
|
|
177
|
+
) : state === "error" ? (
|
|
178
|
+
<div className="wy-placeholder">{labels.recordFailed}</div>
|
|
179
|
+
) : data ? (
|
|
180
|
+
<div className="wy-embed-row">
|
|
181
|
+
{!summary && (
|
|
182
|
+
<span className="wy-tile is-tint" aria-hidden="true">
|
|
183
|
+
<Icon name="invoice" />
|
|
184
|
+
</span>
|
|
185
|
+
)}
|
|
186
|
+
<span className="wy-embed-main">
|
|
187
|
+
<span className="font-semibold" dir="auto">
|
|
188
|
+
{data.title}
|
|
189
|
+
</span>
|
|
190
|
+
{data.subtitle && <span className="text-[0.8125rem] text-muted-foreground">{data.subtitle}</span>}
|
|
191
|
+
</span>
|
|
192
|
+
{data.amount && <span className="text-base font-semibold tabular-nums" dir="ltr">{data.amount}</span>}
|
|
193
|
+
{data.status && <Badge variant={data.status.tone}>{data.status.label}</Badge>}
|
|
194
|
+
</div>
|
|
195
|
+
) : null}
|
|
196
|
+
</div>
|
|
197
|
+
</NodeViewWrapper>
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** 4860 → "4.9K": the one labelled bar (BarChart card). Western digits in every language. */
|
|
202
|
+
function compact(value: number): string {
|
|
203
|
+
if (Math.abs(value) >= 1_000_000) return `${(value / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`
|
|
204
|
+
if (Math.abs(value) >= 1_000) return `${(value / 1_000).toFixed(1).replace(/\.0$/, "")}K`
|
|
205
|
+
return String(value)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function ChartView(props: ReactNodeViewProps) {
|
|
209
|
+
const { services, labels } = useEditorServices()
|
|
210
|
+
const source = props.node.attrs.source as { query: string; params?: Record<string, string> } | null
|
|
211
|
+
const chart = (props.node.attrs.chart ?? "bar") as "bar" | "line" | "donut"
|
|
212
|
+
const title = props.node.attrs.title as string | null
|
|
213
|
+
const key = source ? JSON.stringify(source) : ""
|
|
214
|
+
const { state, data } = useLive<ChartData>(key, source && services.loadChart ? () => services.loadChart!(source) : null)
|
|
215
|
+
const [asTable, setAsTable] = React.useState(false)
|
|
216
|
+
const rows = (data?.points ?? []).map((p) => ({ label: p.label, value: p.value }))
|
|
217
|
+
const valueLabel = data?.valueLabel ?? title ?? labels.blockChart
|
|
218
|
+
const highest = rows.reduce((best, r, i) => (r.value > (rows[best]?.value ?? -Infinity) ? i : best), 0)
|
|
219
|
+
const ready = state === "ready" && rows.length > 0
|
|
220
|
+
return (
|
|
221
|
+
<NodeViewWrapper {...blockAttrs(props, "chart")}>
|
|
222
|
+
<div className="wy-embed">
|
|
223
|
+
{/* The BarChart card's header: the title, what it covers and that it is live, and a table view. */}
|
|
224
|
+
<div className="wy-chart-head">
|
|
225
|
+
<div className="grid min-w-0">
|
|
226
|
+
<span className="wy-chart-title" dir="auto">
|
|
227
|
+
{title || (source ? services.chartSources?.find((s) => s.key === source.query)?.label : null) || labels.blockChart}
|
|
228
|
+
</span>
|
|
229
|
+
{state === "ready" && (
|
|
230
|
+
<span className="wy-chart-sub" dir="auto">
|
|
231
|
+
{data?.subtitle ? fill(labels.chartLiveRange, { range: data.subtitle }) : labels.live}
|
|
232
|
+
</span>
|
|
233
|
+
)}
|
|
234
|
+
</div>
|
|
235
|
+
{ready && (
|
|
236
|
+
<button
|
|
237
|
+
type="button"
|
|
238
|
+
className="wy-chart-toggle"
|
|
239
|
+
contentEditable={false}
|
|
240
|
+
aria-pressed={asTable}
|
|
241
|
+
onMouseDown={(e) => e.preventDefault()}
|
|
242
|
+
onClick={() => setAsTable((v) => !v)}
|
|
243
|
+
>
|
|
244
|
+
<Icon name={asTable ? "chart" : "table"} size={14} />
|
|
245
|
+
{asTable ? labels.chartShowChart : labels.chartShowTable}
|
|
246
|
+
</button>
|
|
247
|
+
)}
|
|
248
|
+
</div>
|
|
249
|
+
{!source ? (
|
|
250
|
+
<div className="wy-placeholder">{labels.chartEmpty}</div>
|
|
251
|
+
) : state === "loading" ? (
|
|
252
|
+
<div className="wy-skeleton is-tall" aria-busy="true" />
|
|
253
|
+
) : ready && asTable ? (
|
|
254
|
+
<table className="wy-chart-table">
|
|
255
|
+
<thead>
|
|
256
|
+
<tr>
|
|
257
|
+
<th scope="col">{labels.chartCategory}</th>
|
|
258
|
+
<th scope="col">{valueLabel}</th>
|
|
259
|
+
</tr>
|
|
260
|
+
</thead>
|
|
261
|
+
<tbody>
|
|
262
|
+
{rows.map((r) => (
|
|
263
|
+
<tr key={r.label}>
|
|
264
|
+
<td dir="auto">{r.label}</td>
|
|
265
|
+
<td dir="ltr">{r.value.toLocaleString("en")}</td>
|
|
266
|
+
</tr>
|
|
267
|
+
))}
|
|
268
|
+
</tbody>
|
|
269
|
+
</table>
|
|
270
|
+
) : ready ? (
|
|
271
|
+
<Chart
|
|
272
|
+
type={chart === "donut" ? "pie" : chart}
|
|
273
|
+
data={rows}
|
|
274
|
+
xKey="label"
|
|
275
|
+
series={[{ key: "value", label: valueLabel, color: 1 }]}
|
|
276
|
+
height={170}
|
|
277
|
+
// One series needs no legend; a ring needs one to name its slices.
|
|
278
|
+
legend={chart === "donut"}
|
|
279
|
+
highlight={chart === "bar" ? highest : undefined}
|
|
280
|
+
formatValue={compact}
|
|
281
|
+
donut={chart === "donut"}
|
|
282
|
+
/>
|
|
283
|
+
) : (
|
|
284
|
+
<div className="wy-placeholder">
|
|
285
|
+
{state === "hidden" ? labels.chartHidden : state === "error" ? labels.chartFailed : state === "none" ? labels.chartUnavailable : labels.chartNoData}
|
|
286
|
+
</div>
|
|
287
|
+
)}
|
|
288
|
+
</div>
|
|
289
|
+
</NodeViewWrapper>
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function SignatureView(props: ReactNodeViewProps) {
|
|
294
|
+
const { labels } = useEditorServices()
|
|
295
|
+
const signers = (props.node.attrs.signers ?? []) as { name: Inline[]; role: Inline[] }[]
|
|
296
|
+
const date = (props.node.attrs.date ?? []) as Inline[]
|
|
297
|
+
return (
|
|
298
|
+
<NodeViewWrapper {...blockAttrs(props, "signature")}>
|
|
299
|
+
<div className="wy-sign">
|
|
300
|
+
{signers.map((s, i) => (
|
|
301
|
+
<div key={i} className="wy-sign-line">
|
|
302
|
+
<b dir="auto">{inlineText(s.name) || labels.signatureName}</b>
|
|
303
|
+
<span dir="auto">{inlineText(s.role)}</span>
|
|
304
|
+
</div>
|
|
305
|
+
))}
|
|
306
|
+
<div className="wy-sign-line">
|
|
307
|
+
{/* @date-display-ignore: the signature date is text the author typed or a merge field (Inline[]), not a record timestamp; this is its label. */}
|
|
308
|
+
<b>{labels.signatureDate}</b>
|
|
309
|
+
<span dir="auto">{inlineText(date)}</span>
|
|
310
|
+
</div>
|
|
311
|
+
{props.node.attrs.stamp && <div className="wy-sign-stamp">{labels.signatureStamp}</div>}
|
|
312
|
+
</div>
|
|
313
|
+
</NodeViewWrapper>
|
|
314
|
+
)
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** A barcode or QR code; a merge field can't be drawn until there's a value, so it shows what fills it. */
|
|
318
|
+
function CodeView(props: ReactNodeViewProps & { qr: boolean }) {
|
|
319
|
+
const { labels } = useEditorServices()
|
|
320
|
+
const value = (props.node.attrs.value ?? []) as Inline[]
|
|
321
|
+
const hasField = value.some((r) => r.type === "field")
|
|
322
|
+
const text = inlineText(value)
|
|
323
|
+
const symbology = props.qr ? "qrcode" : String(props.node.attrs.symbology ?? "code128")
|
|
324
|
+
const caption = props.qr ? inlineText(props.node.attrs.caption as Inline[] | null) : ""
|
|
325
|
+
return (
|
|
326
|
+
<NodeViewWrapper {...blockAttrs(props, props.qr ? "qr" : "barcode")}>
|
|
327
|
+
<figure className={cn("wy-code", props.qr ? "is-qr" : "is-bar")}>
|
|
328
|
+
{!text ? (
|
|
329
|
+
<div className="wy-placeholder">{props.qr ? labels.qrEmpty : labels.barcodeEmpty}</div>
|
|
330
|
+
) : hasField ? (
|
|
331
|
+
<div className="wy-placeholder is-field" dir="auto">
|
|
332
|
+
{fill(labels.codeFromField, { value: text })}
|
|
333
|
+
</div>
|
|
334
|
+
) : (
|
|
335
|
+
<div className="wy-code-art" dir="ltr">
|
|
336
|
+
<BarcodeSvg symbology={symbology} value={text} showText={!props.qr && Boolean(props.node.attrs.showText)} />
|
|
337
|
+
</div>
|
|
338
|
+
)}
|
|
339
|
+
{caption && <figcaption dir="auto">{caption}</figcaption>}
|
|
340
|
+
</figure>
|
|
341
|
+
</NodeViewWrapper>
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function MathView(props: ReactNodeViewProps) {
|
|
346
|
+
const { labels } = useEditorServices()
|
|
347
|
+
const tex = String(props.node.attrs.tex ?? "")
|
|
348
|
+
return (
|
|
349
|
+
<NodeViewWrapper {...blockAttrs(props, "math")}>
|
|
350
|
+
<div className="wy-math-block" dir="ltr">
|
|
351
|
+
{tex ? <MathText expression={tex} block /> : <div className="wy-placeholder">{labels.mathEmpty}</div>}
|
|
352
|
+
</div>
|
|
353
|
+
</NodeViewWrapper>
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** An inline formula (E.42), rendered with KaTeX; its source is the tooltip. */
|
|
358
|
+
function MathInlineView(props: ReactNodeViewProps) {
|
|
359
|
+
const tex = String(props.node.attrs.tex ?? "")
|
|
360
|
+
return (
|
|
361
|
+
<NodeViewWrapper as="span" data-math="" dir="ltr" title={tex} className={cn("wy-math", props.selected && "is-selected")}>
|
|
362
|
+
{tex ? <MathText expression={tex} /> : "…"}
|
|
363
|
+
</NodeViewWrapper>
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* E.26: a merge field is a chip with its plain name, its path on hover. While
|
|
369
|
+
* previewing with a record it shows the value with a dotted underline, or the
|
|
370
|
+
* name on the error tint when the record has none (E.27).
|
|
371
|
+
*/
|
|
372
|
+
function FieldView(props: ReactNodeViewProps) {
|
|
373
|
+
const { labels, preview } = useEditorServices()
|
|
374
|
+
const path = String(props.node.attrs.path ?? "")
|
|
375
|
+
const label = String(props.node.attrs.label || path)
|
|
376
|
+
if (preview) {
|
|
377
|
+
const value = preview.values[path]
|
|
378
|
+
if (value === null || value === undefined || value === "") {
|
|
379
|
+
return (
|
|
380
|
+
<NodeViewWrapper as="span" data-field={path} title={labels.fieldMissing} className="wy-mf is-missing">
|
|
381
|
+
<Icon name="alert" size={12} />
|
|
382
|
+
{label}
|
|
383
|
+
</NodeViewWrapper>
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
return (
|
|
387
|
+
<NodeViewWrapper as="span" data-field={path} title={label} className="wy-mf is-preview">
|
|
388
|
+
{value}
|
|
389
|
+
</NodeViewWrapper>
|
|
390
|
+
)
|
|
391
|
+
}
|
|
392
|
+
return (
|
|
393
|
+
<NodeViewWrapper as="span" data-field={path} title={path} className={cn("wy-mf", props.selected && "is-selected")}>
|
|
394
|
+
{label}
|
|
395
|
+
</NodeViewWrapper>
|
|
396
|
+
)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** Table cells take their column's alignment (E.15: end-aligned numbers). */
|
|
400
|
+
const TableWithAlign = Table.extend({
|
|
401
|
+
addNodeView() {
|
|
402
|
+
return ({ node: initial }) => {
|
|
403
|
+
let node = initial
|
|
404
|
+
const dom = document.createElement("table")
|
|
405
|
+
const contentDOM = document.createElement("tbody")
|
|
406
|
+
dom.append(contentDOM)
|
|
407
|
+
const paint = () => {
|
|
408
|
+
dom.dataset.type = "table"
|
|
409
|
+
dom.dataset.headerRow = node.attrs.headerRow ? "true" : "false"
|
|
410
|
+
if (node.attrs.id) dom.dataset.blockId = node.attrs.id
|
|
411
|
+
const columns = (node.attrs.columns ?? []) as { align?: string }[]
|
|
412
|
+
dom.style.setProperty("--wy-columns", String(columns.length))
|
|
413
|
+
// End-aligned columns are named on the table itself ("2 4") and the
|
|
414
|
+
// stylesheet aligns those cells. Writing data-align onto each cell
|
|
415
|
+
// after ProseMirror drew it read as an edit: ProseMirror redrew the
|
|
416
|
+
// cells, which were written again, thousands of times a second, and a
|
|
417
|
+
// click on a field chip in a table landed on a node already gone.
|
|
418
|
+
const ends = columns.flatMap((c, i) => (c?.align === "end" ? [String(i + 1)] : [])).join(" ")
|
|
419
|
+
if (ends) dom.dataset.endColumns = ends
|
|
420
|
+
else delete dom.dataset.endColumns
|
|
421
|
+
}
|
|
422
|
+
paint()
|
|
423
|
+
return {
|
|
424
|
+
dom,
|
|
425
|
+
contentDOM,
|
|
426
|
+
update(next) {
|
|
427
|
+
if (next.type !== node.type) return false
|
|
428
|
+
node = next
|
|
429
|
+
paint()
|
|
430
|
+
return true
|
|
431
|
+
},
|
|
432
|
+
// Its own attributes are painted here, not edits to read back.
|
|
433
|
+
ignoreMutation(mutation) {
|
|
434
|
+
return mutation.type === "attributes" && mutation.target === dom
|
|
435
|
+
},
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
const react = (component: React.ComponentType<ReactNodeViewProps>) => () => ReactNodeViewRenderer(component)
|
|
442
|
+
|
|
443
|
+
/** The M3 node types with their editor views. */
|
|
444
|
+
export const richNodeViews = [
|
|
445
|
+
Callout.extend({ addNodeView: react(CalloutView) }),
|
|
446
|
+
Toggle.extend({ addNodeView: react(ToggleView) }),
|
|
447
|
+
TableWithAlign,
|
|
448
|
+
PageBreak.extend({ addNodeView: react(PageBreakView) }),
|
|
449
|
+
Image.extend({ addNodeView: react(ImageView) }),
|
|
450
|
+
FileBlock.extend({ addNodeView: react(FileView) }),
|
|
451
|
+
RecordBlock.extend({ addNodeView: react(RecordView_) }),
|
|
452
|
+
ChartBlock.extend({ addNodeView: react(ChartView) }),
|
|
453
|
+
SignatureBlock.extend({ addNodeView: react(SignatureView) }),
|
|
454
|
+
BarcodeBlock.extend({ addNodeView: react((p) => <CodeView {...p} qr={false} />) }),
|
|
455
|
+
QrBlock.extend({ addNodeView: react((p) => <CodeView {...p} qr />) }),
|
|
456
|
+
MathBlock.extend({ addNodeView: react(MathView) }),
|
|
457
|
+
MathInline.extend({ addNodeView: react(MathInlineView) }),
|
|
458
|
+
SavedBlockNode.extend({ addNodeView: react(SavedBlockView) }),
|
|
459
|
+
PluginBlockNode.extend({ addNodeView: react(PluginBlockView) }),
|
|
460
|
+
Field.extend({ addNodeView: react(FieldView) }),
|
|
461
|
+
]
|