@beyondwork/docx-react-component 1.0.19 → 1.0.21

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 (71) hide show
  1. package/package.json +44 -25
  2. package/src/api/public-types.ts +336 -0
  3. package/src/api/session-state.ts +2 -0
  4. package/src/core/commands/formatting-commands.ts +1 -1
  5. package/src/core/commands/index.ts +14 -2
  6. package/src/core/search/search-text.ts +28 -0
  7. package/src/core/state/editor-state.ts +3 -0
  8. package/src/index.ts +21 -0
  9. package/src/io/docx-session.ts +363 -17
  10. package/src/io/export/serialize-comments.ts +104 -34
  11. package/src/io/export/serialize-footnotes.ts +198 -1
  12. package/src/io/export/serialize-headers-footers.ts +203 -10
  13. package/src/io/export/serialize-main-document.ts +83 -3
  14. package/src/io/export/split-review-boundaries.ts +181 -19
  15. package/src/io/normalize/normalize-text.ts +82 -8
  16. package/src/io/ooxml/highlight-colors.ts +39 -0
  17. package/src/io/ooxml/parse-comments.ts +85 -19
  18. package/src/io/ooxml/parse-fields.ts +396 -0
  19. package/src/io/ooxml/parse-footnotes.ts +240 -2
  20. package/src/io/ooxml/parse-headers-footers.ts +431 -7
  21. package/src/io/ooxml/parse-inline-media.ts +15 -1
  22. package/src/io/ooxml/parse-main-document.ts +396 -14
  23. package/src/io/ooxml/parse-revisions.ts +317 -38
  24. package/src/legal/bookmarks.ts +44 -0
  25. package/src/legal/cross-references.ts +59 -1
  26. package/src/model/canonical-document.ts +117 -1
  27. package/src/model/snapshot.ts +85 -1
  28. package/src/review/store/revision-store.ts +6 -0
  29. package/src/review/store/revision-types.ts +1 -0
  30. package/src/runtime/document-navigation.ts +52 -13
  31. package/src/runtime/document-runtime.ts +1521 -75
  32. package/src/runtime/read-only-diagnostics-runtime.ts +8 -0
  33. package/src/runtime/session-capabilities.ts +33 -3
  34. package/src/runtime/surface-projection.ts +86 -25
  35. package/src/runtime/table-schema.ts +2 -2
  36. package/src/runtime/view-state.ts +24 -6
  37. package/src/runtime/workflow-markup.ts +349 -0
  38. package/src/ui/WordReviewEditor.tsx +915 -1314
  39. package/src/ui/editor-command-bag.ts +120 -0
  40. package/src/ui/editor-runtime-boundary.ts +1448 -0
  41. package/src/ui/editor-shell-view.tsx +134 -0
  42. package/src/ui/editor-surface-controller.tsx +55 -0
  43. package/src/ui/headless/revision-decoration-model.ts +4 -4
  44. package/src/ui/runtime-snapshot-selectors.ts +197 -0
  45. package/src/ui/workflow-surface-blocked-rails.ts +94 -0
  46. package/src/ui-tailwind/chrome/tw-alert-banner.tsx +18 -2
  47. package/src/ui-tailwind/chrome/tw-image-context-toolbar.tsx +129 -0
  48. package/src/ui-tailwind/chrome/tw-layout-panel.tsx +114 -0
  49. package/src/ui-tailwind/chrome/tw-object-context-toolbar.tsx +34 -0
  50. package/src/ui-tailwind/chrome/tw-selection-toolbar.tsx +27 -2
  51. package/src/ui-tailwind/chrome/tw-table-context-toolbar.tsx +128 -0
  52. package/src/ui-tailwind/editor-surface/perf-probe.ts +86 -14
  53. package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +2 -2
  54. package/src/ui-tailwind/editor-surface/pm-decorations.ts +237 -0
  55. package/src/ui-tailwind/editor-surface/pm-position-map.ts +1 -1
  56. package/src/ui-tailwind/editor-surface/pm-schema.ts +139 -8
  57. package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +98 -48
  58. package/src/ui-tailwind/editor-surface/surface-build-keys.ts +55 -0
  59. package/src/ui-tailwind/editor-surface/tw-opaque-block.tsx +7 -1
  60. package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +190 -48
  61. package/src/ui-tailwind/page-chrome-model.ts +27 -0
  62. package/src/ui-tailwind/review/tw-comment-sidebar.tsx +7 -7
  63. package/src/ui-tailwind/review/tw-health-panel.tsx +31 -2
  64. package/src/ui-tailwind/review/tw-review-rail.tsx +3 -3
  65. package/src/ui-tailwind/review/tw-revision-sidebar.tsx +15 -15
  66. package/src/ui-tailwind/theme/editor-theme.css +130 -0
  67. package/src/ui-tailwind/toolbar/tw-toolbar.tsx +543 -5
  68. package/src/ui-tailwind/tw-review-workspace.tsx +316 -19
  69. package/src/validation/compatibility-engine.ts +27 -4
  70. package/src/validation/compatibility-report.ts +1 -0
  71. package/src/validation/docx-comment-proof.ts +220 -0
@@ -258,6 +258,132 @@
258
258
  outline: none;
259
259
  }
260
260
 
261
+ .prosemirror-surface .ProseMirror .wre-workflow-inline {
262
+ border-radius: 0.25rem;
263
+ box-shadow: inset 0 0 0 1px transparent;
264
+ }
265
+
266
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-edit {
267
+ background: color-mix(in srgb, var(--color-accent) 10%, transparent);
268
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 18%, transparent);
269
+ }
270
+
271
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-suggest {
272
+ background: color-mix(in srgb, var(--color-warning) 12%, transparent);
273
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-warning) 20%, transparent);
274
+ }
275
+
276
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-comment {
277
+ background: color-mix(in srgb, var(--color-insert) 10%, transparent);
278
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-insert) 18%, transparent);
279
+ }
280
+
281
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-view {
282
+ background: color-mix(in srgb, var(--color-secondary) 7%, transparent);
283
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-secondary) 14%, transparent);
284
+ }
285
+
286
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-candidate {
287
+ background: color-mix(in srgb, var(--color-warning) 6%, transparent);
288
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-warning) 18%, transparent);
289
+ text-decoration: underline;
290
+ text-decoration-style: dashed;
291
+ text-decoration-color: color-mix(in srgb, var(--color-warning) 55%, transparent);
292
+ text-underline-offset: 0.18em;
293
+ }
294
+
295
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-preserve-only {
296
+ background: color-mix(in srgb, var(--color-danger) 7%, transparent);
297
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-danger) 18%, transparent);
298
+ }
299
+
300
+ .prosemirror-surface .ProseMirror .wre-workflow-inline-blocked-import {
301
+ background: color-mix(in srgb, var(--color-danger) 8%, transparent);
302
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-danger) 24%, transparent);
303
+ text-decoration: underline;
304
+ text-decoration-style: wavy;
305
+ text-decoration-color: color-mix(in srgb, var(--color-danger) 70%, transparent);
306
+ text-underline-offset: 0.18em;
307
+ }
308
+
309
+ .prosemirror-surface .ProseMirror .wre-workflow-rail {
310
+ position: relative;
311
+ padding-left: 0.875rem;
312
+ border-radius: 0.25rem;
313
+ }
314
+
315
+ .prosemirror-surface .ProseMirror .wre-workflow-rail::before {
316
+ content: "";
317
+ position: absolute;
318
+ left: 0;
319
+ top: 0.2rem;
320
+ bottom: 0.2rem;
321
+ width: 0.3rem;
322
+ border-radius: 999px;
323
+ background: var(--wre-workflow-rail-color, var(--color-border-strong));
324
+ }
325
+
326
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-edit {
327
+ --wre-workflow-rail-color: var(--color-accent);
328
+ background: color-mix(in srgb, var(--color-accent) 7%, transparent);
329
+ }
330
+
331
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-suggest {
332
+ --wre-workflow-rail-color: var(--color-warning);
333
+ background: color-mix(in srgb, var(--color-warning) 8%, transparent);
334
+ }
335
+
336
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-comment {
337
+ --wre-workflow-rail-color: var(--color-insert);
338
+ background: color-mix(in srgb, var(--color-insert) 7%, transparent);
339
+ }
340
+
341
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-view {
342
+ --wre-workflow-rail-color: var(--color-secondary);
343
+ background: color-mix(in srgb, var(--color-secondary) 6%, transparent);
344
+ }
345
+
346
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-candidate {
347
+ --wre-workflow-rail-color: var(--color-warning);
348
+ background: color-mix(in srgb, var(--color-warning) 4%, transparent);
349
+ }
350
+
351
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-candidate::before {
352
+ background:
353
+ repeating-linear-gradient(
354
+ to bottom,
355
+ var(--wre-workflow-rail-color, var(--color-warning)) 0,
356
+ var(--wre-workflow-rail-color, var(--color-warning)) 6px,
357
+ transparent 6px,
358
+ transparent 10px
359
+ );
360
+ }
361
+
362
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-preserve-only {
363
+ --wre-workflow-rail-color: var(--color-danger);
364
+ background: color-mix(in srgb, var(--color-danger) 5%, transparent);
365
+ }
366
+
367
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-preserve-only::before {
368
+ opacity: 0.85;
369
+ }
370
+
371
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-blocked-import {
372
+ --wre-workflow-rail-color: var(--color-danger);
373
+ background: color-mix(in srgb, var(--color-danger) 8%, transparent);
374
+ }
375
+
376
+ .prosemirror-surface .ProseMirror .wre-workflow-rail-blocked-import::before {
377
+ background:
378
+ repeating-linear-gradient(
379
+ to bottom,
380
+ var(--wre-workflow-rail-color, var(--color-danger)) 0,
381
+ var(--wre-workflow-rail-color, var(--color-danger)) 4px,
382
+ transparent 4px,
383
+ transparent 8px
384
+ );
385
+ }
386
+
261
387
  .prosemirror-surface:focus-visible {
262
388
  outline: none;
263
389
  }
@@ -266,6 +392,10 @@
266
392
  margin: 0 0 0.5em 0;
267
393
  }
268
394
 
395
+ .prosemirror-surface .ProseMirror p[data-numbered="true"][data-list-continuation="true"] {
396
+ margin-bottom: 0.25em;
397
+ }
398
+
269
399
  .prosemirror-surface .ProseMirror [data-node-type="opaque_block"] {
270
400
  user-select: none;
271
401
  cursor: default;