@bendyline/squisq-editor-react 2.9.0 → 2.10.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.
@@ -7590,6 +7590,9 @@
7590
7590
  .squisq-toolbar-contextual--clipped {
7591
7591
  visibility: hidden;
7592
7592
  }
7593
+ .squisq-toolbar-button--overflowed {
7594
+ visibility: hidden;
7595
+ }
7593
7596
  .squisq-toolbar-view-tab {
7594
7597
  padding: 8px 14px 4px;
7595
7598
  border: none;
@@ -9090,7 +9093,7 @@
9090
9093
  color: #dc2626;
9091
9094
  }
9092
9095
  .squisq-wysiwyg-container {
9093
- background: #dcd8d0;
9096
+ background: var(--squisq-desk-bg);
9094
9097
  }
9095
9098
  .squisq-wysiwyg-editor {
9096
9099
  padding: 16px 24px;
@@ -10060,6 +10063,7 @@
10060
10063
  --squisq-input-bg: #fff;
10061
10064
  --squisq-text: #1f2937;
10062
10065
  --squisq-text-muted: #6b7280;
10066
+ --squisq-desk-bg: #dcd8d0;
10063
10067
  --squisq-editor-background: #ffffff;
10064
10068
  --squisq-editor-foreground: #1f2937;
10065
10069
  }
@@ -10069,6 +10073,7 @@
10069
10073
  --squisq-input-bg: #374151;
10070
10074
  --squisq-text: #e5e7eb;
10071
10075
  --squisq-text-muted: #9ca3af;
10076
+ --squisq-desk-bg: #0f1219;
10072
10077
  --squisq-editor-background: #1e1e1e;
10073
10078
  --squisq-editor-foreground: #d4d4d4;
10074
10079
  }
@@ -10344,9 +10349,6 @@
10344
10349
  .squisq-editor-shell[data-theme=dark] .squisq-status-error {
10345
10350
  color: #f87171;
10346
10351
  }
10347
- .squisq-editor-shell[data-theme=dark] .squisq-wysiwyg-container {
10348
- background: #0f1219;
10349
- }
10350
10352
  .squisq-editor-shell[data-theme=dark] .squisq-wysiwyg-editor {
10351
10353
  color: #e5e7eb;
10352
10354
  background: #111827;
@@ -11939,7 +11941,7 @@
11939
11941
  align-items: center;
11940
11942
  justify-content: center;
11941
11943
  padding: 12px 16px;
11942
- background: #dcd8d0;
11944
+ background: var(--squisq-desk-bg);
11943
11945
  border-left: 1px solid #b0a99a;
11944
11946
  overflow: auto;
11945
11947
  }
@@ -11959,7 +11961,6 @@
11959
11961
  height: 100%;
11960
11962
  }
11961
11963
  .squisq-editor-shell[data-theme=dark] .squisq-block-preview-panel {
11962
- background: #0f1219;
11963
11964
  border-left-color: #2a3144;
11964
11965
  }
11965
11966
  .squisq-editor-shell[data-theme=dark] .squisq-block-preview-frame {
@@ -11970,7 +11971,7 @@
11970
11971
  flex-direction: column;
11971
11972
  height: 100%;
11972
11973
  min-height: 0;
11973
- background: #dcd8d0;
11974
+ background: var(--squisq-desk-bg);
11974
11975
  }
11975
11976
  .squisq-block-card-body {
11976
11977
  flex: 1 1 auto;
@@ -12029,9 +12030,6 @@
12029
12030
  .squisq-block-card-add {
12030
12031
  margin-left: 8px;
12031
12032
  }
12032
- .squisq-editor-shell[data-theme=dark] .squisq-block-card {
12033
- background: #0f1219;
12034
- }
12035
12033
  .squisq-editor-shell[data-theme=dark] .squisq-block-card-body .squisq-wysiwyg-editor,
12036
12034
  .squisq-editor-shell[data-theme=dark] .squisq-block-card-body > .squisq-raw-editor-container {
12037
12035
  border-top-color: #2a3144;
@@ -12764,7 +12762,7 @@
12764
12762
  .squisq-editor-shell {
12765
12763
  --squisq-preview-accent: #6366f1;
12766
12764
  --squisq-preview-accent-muted: #94a3b8;
12767
- --squisq-preview-gutter-bg: #dcd8d0;
12765
+ --squisq-preview-gutter-bg: var(--squisq-desk-bg);
12768
12766
  --squisq-preview-card-bg: #ffffff;
12769
12767
  --squisq-preview-card-border: #e5e7eb;
12770
12768
  --squisq-preview-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
@@ -12878,7 +12876,7 @@
12878
12876
  }
12879
12877
  .squisq-outline {
12880
12878
  padding: 12px 8px;
12881
- background: #dcd8d0;
12879
+ background: var(--squisq-desk-bg);
12882
12880
  font-size: 13px;
12883
12881
  color: #1f2937;
12884
12882
  box-sizing: border-box;
@@ -13081,13 +13079,12 @@
13081
13079
  color: #f9fafb;
13082
13080
  }
13083
13081
  .squisq-editor-shell[data-theme=dark] .squisq-outline {
13084
- background: #0f1219;
13085
13082
  color: #d1d5db;
13086
13083
  }
13087
13084
  .squisq-editor-shell[data-theme=dark] {
13088
13085
  --squisq-preview-accent: #818cf8;
13089
13086
  --squisq-preview-accent-muted: #475569;
13090
- --squisq-preview-gutter-bg: #0f1219;
13087
+ --squisq-preview-gutter-bg: var(--squisq-desk-bg);
13091
13088
  --squisq-preview-card-bg: #111827;
13092
13089
  --squisq-preview-card-border: #1f2937;
13093
13090
  --squisq-preview-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
@@ -17087,6 +17084,407 @@ button.squisq-ascii-timeline-track-name:focus-visible {
17087
17084
  }
17088
17085
  }
17089
17086
 
17087
+ /* src/styles/proofing.css */
17088
+ .squisq-proof-underline {
17089
+ text-decoration-skip-ink: none;
17090
+ }
17091
+ .squisq-proof-underline--spelling {
17092
+ text-decoration: underline wavy #d93025 1px;
17093
+ text-decoration-skip-ink: none;
17094
+ }
17095
+ .squisq-proof-underline--grammar {
17096
+ text-decoration: underline wavy #188038 1px;
17097
+ text-decoration-skip-ink: none;
17098
+ }
17099
+ .squisq-proof-underline--style {
17100
+ text-decoration: underline dotted #1a73e8 1.5px;
17101
+ text-decoration-skip-ink: none;
17102
+ }
17103
+ .squisq-proof-dot {
17104
+ display: inline-block;
17105
+ width: 8px;
17106
+ height: 8px;
17107
+ border-radius: 50%;
17108
+ flex: 0 0 auto;
17109
+ }
17110
+ .squisq-proof-dot--spelling {
17111
+ background: #d93025;
17112
+ }
17113
+ .squisq-proof-dot--grammar {
17114
+ background: #188038;
17115
+ }
17116
+ .squisq-proof-dot--style {
17117
+ background: #1a73e8;
17118
+ }
17119
+ .squisq-proof-panel {
17120
+ width: 240px;
17121
+ flex: 0 0 240px;
17122
+ display: flex;
17123
+ flex-direction: column;
17124
+ border-left: 1px solid #e0e0e0;
17125
+ background: #fafafa;
17126
+ min-height: 0;
17127
+ font-size: 12px;
17128
+ }
17129
+ .squisq-proof-panel-header {
17130
+ display: flex;
17131
+ align-items: center;
17132
+ justify-content: space-between;
17133
+ padding: 8px 10px;
17134
+ border-bottom: 1px solid #e0e0e0;
17135
+ }
17136
+ .squisq-proof-panel-title {
17137
+ font-weight: 600;
17138
+ color: #444;
17139
+ display: inline-flex;
17140
+ align-items: center;
17141
+ gap: 6px;
17142
+ }
17143
+ .squisq-proof-panel-count {
17144
+ background: #e8e8e8;
17145
+ color: #555;
17146
+ border-radius: 8px;
17147
+ padding: 0 6px;
17148
+ font-weight: 500;
17149
+ }
17150
+ .squisq-proof-panel-actions {
17151
+ display: inline-flex;
17152
+ gap: 2px;
17153
+ }
17154
+ .squisq-proof-panel-button {
17155
+ border: none;
17156
+ background: transparent;
17157
+ color: #666;
17158
+ cursor: pointer;
17159
+ border-radius: 4px;
17160
+ padding: 2px 6px;
17161
+ font-size: 12px;
17162
+ line-height: 1.4;
17163
+ }
17164
+ .squisq-proof-panel-button:hover:not(:disabled) {
17165
+ background: #ececec;
17166
+ color: #222;
17167
+ }
17168
+ .squisq-proof-panel-button:disabled {
17169
+ opacity: 0.4;
17170
+ cursor: default;
17171
+ }
17172
+ .squisq-proof-panel-empty {
17173
+ padding: 14px 12px;
17174
+ color: #888;
17175
+ display: flex;
17176
+ flex-direction: column;
17177
+ gap: 8px;
17178
+ align-items: flex-start;
17179
+ }
17180
+ .squisq-proof-panel-retry {
17181
+ border: 1px solid #ccc;
17182
+ background: #fff;
17183
+ border-radius: 4px;
17184
+ padding: 2px 10px;
17185
+ cursor: pointer;
17186
+ font-size: 12px;
17187
+ }
17188
+ .squisq-proof-panel-list {
17189
+ list-style: none;
17190
+ margin: 0;
17191
+ padding: 4px 0;
17192
+ overflow-y: auto;
17193
+ flex: 1 1 auto;
17194
+ min-height: 0;
17195
+ }
17196
+ .squisq-proof-panel-row {
17197
+ display: flex;
17198
+ align-items: flex-start;
17199
+ gap: 8px;
17200
+ width: 100%;
17201
+ border: none;
17202
+ background: transparent;
17203
+ text-align: left;
17204
+ padding: 6px 10px;
17205
+ cursor: pointer;
17206
+ font: inherit;
17207
+ }
17208
+ .squisq-proof-panel-row:hover {
17209
+ background: #f0f0f0;
17210
+ }
17211
+ .squisq-proof-panel-row--active {
17212
+ background: #e7f0fe;
17213
+ }
17214
+ .squisq-proof-panel-row .squisq-proof-dot {
17215
+ margin-top: 4px;
17216
+ }
17217
+ .squisq-proof-panel-row-body {
17218
+ display: flex;
17219
+ flex-direction: column;
17220
+ gap: 1px;
17221
+ min-width: 0;
17222
+ }
17223
+ .squisq-proof-panel-excerpt {
17224
+ font-weight: 600;
17225
+ color: #333;
17226
+ overflow: hidden;
17227
+ text-overflow: ellipsis;
17228
+ white-space: nowrap;
17229
+ }
17230
+ .squisq-proof-panel-message {
17231
+ color: #777;
17232
+ }
17233
+ .squisq-proof-menu {
17234
+ min-width: 200px;
17235
+ max-width: 320px;
17236
+ background: #fff;
17237
+ border: 1px solid #d5d5d5;
17238
+ border-radius: 8px;
17239
+ box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
17240
+ padding: 4px;
17241
+ font-size: 13px;
17242
+ }
17243
+ .squisq-proof-menu-header {
17244
+ display: flex;
17245
+ align-items: flex-start;
17246
+ gap: 7px;
17247
+ padding: 6px 8px;
17248
+ color: #666;
17249
+ font-size: 12px;
17250
+ border-bottom: 1px solid #eee;
17251
+ margin-bottom: 4px;
17252
+ }
17253
+ .squisq-proof-menu-header .squisq-proof-dot {
17254
+ margin-top: 3px;
17255
+ }
17256
+ .squisq-proof-menu-item {
17257
+ display: block;
17258
+ width: 100%;
17259
+ border: none;
17260
+ background: transparent;
17261
+ text-align: left;
17262
+ padding: 6px 10px;
17263
+ border-radius: 5px;
17264
+ cursor: pointer;
17265
+ color: #333;
17266
+ font: inherit;
17267
+ }
17268
+ .squisq-proof-menu-item:hover,
17269
+ .squisq-proof-menu-item:focus-visible {
17270
+ background: #f0f4ff;
17271
+ outline: none;
17272
+ }
17273
+ .squisq-proof-menu-suggestion {
17274
+ font-weight: 600;
17275
+ }
17276
+ .squisq-proof-menu-empty {
17277
+ padding: 6px 10px;
17278
+ color: #999;
17279
+ font-style: italic;
17280
+ }
17281
+ .squisq-proof-tooltip {
17282
+ max-width: 320px;
17283
+ background: #fff;
17284
+ border: 1px solid #d5d5d5;
17285
+ border-radius: 8px;
17286
+ box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
17287
+ padding: 8px 10px;
17288
+ font-size: 12px;
17289
+ line-height: 1.4;
17290
+ color: #333;
17291
+ }
17292
+ .squisq-proof-tooltip-head {
17293
+ display: flex;
17294
+ align-items: center;
17295
+ gap: 6px;
17296
+ margin-bottom: 3px;
17297
+ }
17298
+ .squisq-proof-tooltip-category {
17299
+ font-weight: 600;
17300
+ font-size: 11px;
17301
+ letter-spacing: 0.03em;
17302
+ text-transform: uppercase;
17303
+ color: #666;
17304
+ }
17305
+ .squisq-proof-tooltip-message {
17306
+ color: #222;
17307
+ }
17308
+ .squisq-proof-tooltip-suggestions {
17309
+ display: flex;
17310
+ flex-wrap: wrap;
17311
+ align-items: center;
17312
+ gap: 4px;
17313
+ margin-top: 6px;
17314
+ }
17315
+ .squisq-proof-tooltip-chip {
17316
+ border: 1px solid transparent;
17317
+ padding: 2px 8px;
17318
+ border-radius: 4px;
17319
+ background: #f0f4ff;
17320
+ color: #1a3d8f;
17321
+ font: inherit;
17322
+ font-weight: 600;
17323
+ cursor: pointer;
17324
+ }
17325
+ .squisq-proof-tooltip-chip:hover,
17326
+ .squisq-proof-tooltip-chip:focus-visible {
17327
+ background: #dfe8ff;
17328
+ border-color: #b7c8f5;
17329
+ outline: none;
17330
+ }
17331
+ .squisq-proof-tooltip-more {
17332
+ border: none;
17333
+ background: transparent;
17334
+ padding: 2px 4px;
17335
+ border-radius: 4px;
17336
+ color: #777;
17337
+ font: inherit;
17338
+ font-size: 11px;
17339
+ cursor: pointer;
17340
+ }
17341
+ .squisq-proof-tooltip-more:hover,
17342
+ .squisq-proof-tooltip-more:focus-visible {
17343
+ color: #333;
17344
+ background: #f0f0f0;
17345
+ outline: none;
17346
+ }
17347
+ .squisq-proof-tooltip-actions {
17348
+ display: flex;
17349
+ flex-wrap: wrap;
17350
+ gap: 2px;
17351
+ margin-top: 6px;
17352
+ padding-top: 5px;
17353
+ border-top: 1px solid #eee;
17354
+ }
17355
+ .squisq-proof-tooltip-action {
17356
+ border: none;
17357
+ background: transparent;
17358
+ padding: 3px 6px;
17359
+ border-radius: 4px;
17360
+ color: #666;
17361
+ font: inherit;
17362
+ font-size: 11px;
17363
+ cursor: pointer;
17364
+ }
17365
+ .squisq-proof-tooltip-action:hover,
17366
+ .squisq-proof-tooltip-action:focus-visible {
17367
+ background: #f0f0f0;
17368
+ color: #222;
17369
+ outline: none;
17370
+ }
17371
+ .squisq-proof-status {
17372
+ cursor: pointer;
17373
+ user-select: none;
17374
+ border: none;
17375
+ background: transparent;
17376
+ color: inherit;
17377
+ font: inherit;
17378
+ padding: 0;
17379
+ }
17380
+ .squisq-proof-status--error {
17381
+ color: #d93025;
17382
+ }
17383
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-underline--spelling {
17384
+ text-decoration-color: #f28b82;
17385
+ }
17386
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-underline--grammar {
17387
+ text-decoration-color: #81c995;
17388
+ }
17389
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-underline--style {
17390
+ text-decoration-color: #8ab4f8;
17391
+ }
17392
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel {
17393
+ background: #1f1f1f;
17394
+ border-left-color: #383838;
17395
+ }
17396
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-header {
17397
+ border-bottom-color: #383838;
17398
+ }
17399
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-title {
17400
+ color: #ccc;
17401
+ }
17402
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-count {
17403
+ background: #333;
17404
+ color: #bbb;
17405
+ }
17406
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-button {
17407
+ color: #999;
17408
+ }
17409
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-button:hover:not(:disabled) {
17410
+ background: #2e2e2e;
17411
+ color: #ddd;
17412
+ }
17413
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-empty {
17414
+ color: #888;
17415
+ }
17416
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-retry {
17417
+ background: #2a2a2a;
17418
+ border-color: #444;
17419
+ color: #ccc;
17420
+ }
17421
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-row:hover {
17422
+ background: #2a2a2a;
17423
+ }
17424
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-row--active {
17425
+ background: #1c3a5e;
17426
+ }
17427
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-excerpt {
17428
+ color: #ddd;
17429
+ }
17430
+ .squisq-editor-shell[data-theme=dark] .squisq-proof-panel-message {
17431
+ color: #999;
17432
+ }
17433
+ .squisq-proof-menu[data-theme=dark] {
17434
+ background: #262626;
17435
+ border-color: #454545;
17436
+ box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
17437
+ }
17438
+ .squisq-proof-menu[data-theme=dark] .squisq-proof-menu-header {
17439
+ color: #aaa;
17440
+ border-bottom-color: #3a3a3a;
17441
+ }
17442
+ .squisq-proof-menu[data-theme=dark] .squisq-proof-menu-item {
17443
+ color: #ddd;
17444
+ }
17445
+ .squisq-proof-menu[data-theme=dark] .squisq-proof-menu-item:hover,
17446
+ .squisq-proof-menu[data-theme=dark] .squisq-proof-menu-item:focus-visible {
17447
+ background: #333f52;
17448
+ }
17449
+ .squisq-proof-menu[data-theme=dark] .squisq-proof-menu-empty {
17450
+ color: #777;
17451
+ }
17452
+ .squisq-proof-tooltip[data-theme=dark] {
17453
+ background: #262626;
17454
+ border-color: #454545;
17455
+ box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
17456
+ color: #ddd;
17457
+ }
17458
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-category {
17459
+ color: #aaa;
17460
+ }
17461
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-message {
17462
+ color: #eee;
17463
+ }
17464
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-chip {
17465
+ background: #333f52;
17466
+ color: #cddcff;
17467
+ }
17468
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-chip:hover,
17469
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-chip:focus-visible {
17470
+ background: #3f4e68;
17471
+ border-color: #56688a;
17472
+ }
17473
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-more,
17474
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-action {
17475
+ color: #999;
17476
+ }
17477
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-more:hover,
17478
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-more:focus-visible,
17479
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-action:hover,
17480
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-action:focus-visible {
17481
+ background: #333;
17482
+ color: #eee;
17483
+ }
17484
+ .squisq-proof-tooltip[data-theme=dark] .squisq-proof-tooltip-actions {
17485
+ border-top-color: #3a3a3a;
17486
+ }
17487
+
17090
17488
  /* src/scene/scene.css */
17091
17489
  .squisq-scene-root {
17092
17490
  position: relative;
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Doc, Theme, MediaProvider } from '@bendyline/squisq/schemas';
3
3
  import { ContentContainer } from '@bendyline/squisq/storage';
4
- import { o as TeleprompterRecordingDeps, g as NarrationStageHandle, T as TeleprompterController, c as FloatingWindowHandle } from '../useNarrationStage-Bk3mdW75.js';
5
- export { C as CanvasSink, D as DEFAULT_TELEPROMPTER_PREFS, F as FloatOpenOptions, b as FloatTier, d as FloatingWindowManager, M as MicAnalysisHandle, e as MicAnalysisStatus, N as NarrationRecorderController, f as NarrationRecorderState, h as NarrationTake, P as PrompterTransport, J as TELEPROMPTER_PREF_LIMITS, n as TeleprompterPrefs, q as UseNarrationStageOptions, s as createFloatingWindowManager, t as detectFloatTiers, K as normalizeTeleprompterPrefs, z as useFloatingWindow, B as useMicAnalysis, E as useNarrationRecorder, G as useNarrationStage, H as useTeleprompter, I as vadConfigForSensitivity } from '../useNarrationStage-Bk3mdW75.js';
4
+ import { o as TeleprompterRecordingDeps, g as NarrationStageHandle, T as TeleprompterController, c as FloatingWindowHandle } from '../useNarrationStage-B6r9Zlq-.js';
5
+ export { C as CanvasSink, D as DEFAULT_TELEPROMPTER_PREFS, F as FloatOpenOptions, b as FloatTier, d as FloatingWindowManager, M as MicAnalysisHandle, e as MicAnalysisStatus, N as NarrationRecorderController, f as NarrationRecorderState, h as NarrationTake, P as PrompterTransport, J as TELEPROMPTER_PREF_LIMITS, n as TeleprompterPrefs, q as UseNarrationStageOptions, s as createFloatingWindowManager, t as detectFloatTiers, K as normalizeTeleprompterPrefs, z as useFloatingWindow, B as useMicAnalysis, E as useNarrationRecorder, G as useNarrationStage, H as useTeleprompter, I as vadConfigForSensitivity } from '../useNarrationStage-B6r9Zlq-.js';
6
6
  import { NarrationTimingJsonV3, NarrationScript, NarrationAlignment } from '@bendyline/squisq/narration';
7
7
  import { ReactNode } from 'react';
8
8
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TeleprompterView
3
- } from "../chunk-IQFPX2CE.js";
3
+ } from "../chunk-ZZTB6BEQ.js";
4
4
  import {
5
5
  DEFAULT_TELEPROMPTER_PREFS,
6
6
  EYE_LINE_FRACTION,
@@ -31,7 +31,7 @@ import {
31
31
  useNarrationStage,
32
32
  useTeleprompter,
33
33
  vadConfigForSensitivity
34
- } from "../chunk-OWOKKZAU.js";
34
+ } from "../chunk-IRPOMTYK.js";
35
35
  export {
36
36
  DEFAULT_TELEPROMPTER_PREFS,
37
37
  EYE_LINE_FRACTION,
@@ -0,0 +1,156 @@
1
+ import { ProofFinding, ProofDialect } from '@bendyline/squisq/proof';
2
+
3
+ /**
4
+ * The proofing capability contract between an editor host and the shell.
5
+ *
6
+ * A host that wants grammar/spellcheck passes a {@link ProofingProvider}
7
+ * (or a factory) to `EditorShell`'s `proofing` prop — the same
8
+ * capability-injection semantics as `ffmpegWasm`: absent means the
9
+ * feature is off, and there is no CDN fallback. The provider surface is
10
+ * plain data end to end, deliberately free of harper.js types so the
11
+ * engine stays an optional peer dependency that never appears in this
12
+ * package's published declarations.
13
+ */
14
+
15
+ /** Markup mode for one lint call. */
16
+ type ProofingLanguage = 'plaintext' | 'markdown';
17
+ interface ProofingLintOptions {
18
+ /** Defaults to `plaintext`. */
19
+ language?: ProofingLanguage;
20
+ }
21
+ /**
22
+ * An engine adapter the editor drives. Implementations must serialize
23
+ * their own engine access (calls may arrive while a previous one is in
24
+ * flight) and keep `lint` results resolvable by finding id until the
25
+ * next `lint` call.
26
+ */
27
+ interface ProofingProvider {
28
+ /**
29
+ * Load the engine (module + WASM). Idempotent and safe to call
30
+ * repeatedly; a rejection is retryable — a later call attempts a
31
+ * fresh load. All expensive work belongs here, never in construction.
32
+ */
33
+ setup(): Promise<void>;
34
+ /** Lint `text`; finding offsets index into `text` (UTF-16 units). */
35
+ lint(text: string, options?: ProofingLintOptions): Promise<ProofFinding[]>;
36
+ /**
37
+ * Persistently ignore the finding's underlying lint — including any
38
+ * stacked same-span lints other rules reveal once the first is
39
+ * suppressed. `findingId` must come from the most recent `lint` call.
40
+ */
41
+ ignoreFinding(findingId: string): Promise<void>;
42
+ /**
43
+ * Accept one word into the APP-level dictionary — fires the host's
44
+ * `onDictionaryWord` so it can persist wherever it keeps user
45
+ * settings. Backs the menu's "Add to dictionary".
46
+ */
47
+ addWord(word: string): Promise<void>;
48
+ /**
49
+ * Accept words for this session without notifying the host. Used both
50
+ * to load a document's own word list at setup and to back the menu's
51
+ * "Add to document word list" (where the DOC's frontmatter, not the
52
+ * app, is the store of record).
53
+ */
54
+ addWords(words: readonly string[]): Promise<void>;
55
+ /**
56
+ * Whether app-level additions actually persist — i.e. the host wired
57
+ * `onDictionaryWord`. When `false`, the editor hides "Add to
58
+ * dictionary" so a word can never appear to be saved app-wide and
59
+ * then silently come back. `undefined` (a provider that doesn't
60
+ * report) is treated as capable.
61
+ */
62
+ readonly hasAppDictionary?: boolean;
63
+ /**
64
+ * The engine's ignored-findings state as an OPAQUE string — it holds
65
+ * context hashes as integers above 2^53, so it must never be
66
+ * JSON-parsed or rebuilt, only stored and handed back verbatim.
67
+ */
68
+ exportIgnored(): Promise<string>;
69
+ /** Merge previously exported ignored-findings state into the engine. */
70
+ importIgnored(json: string): Promise<void>;
71
+ /**
72
+ * Drop all ignored findings. The editor calls this when the engine's
73
+ * ignore set belongs to a different document than the one about to be
74
+ * linted — ignores are per-document, but an engine instance may be
75
+ * shared across documents and shells.
76
+ */
77
+ clearIgnored(): Promise<void>;
78
+ /** Switch English dialect. The caller re-lints afterwards. */
79
+ setDialect(dialect: ProofDialect): Promise<void>;
80
+ /** Release engine resources. Further calls reject. */
81
+ dispose(): void;
82
+ }
83
+ /**
84
+ * Deferred construction. When the shell receives a factory it creates
85
+ * the provider on first activation and disposes it on unmount; a host
86
+ * that passes an instance owns its lifetime (letting one warm engine
87
+ * survive shell remounts).
88
+ */
89
+ type ProofingProviderFactory = () => ProofingProvider;
90
+ /** What the `proofing` shell prop accepts. */
91
+ type ProofingCapability = ProofingProvider | ProofingProviderFactory;
92
+ /**
93
+ * Identifies the document a set of ignored findings belongs to. Hosts
94
+ * key their storage off whichever field suits them — usually the file
95
+ * path, falling back to the article id for unsaved buffers.
96
+ */
97
+ interface ProofingDocumentRef {
98
+ /** The document's `articleId` (always present; `'untitled'` default). */
99
+ articleId: string;
100
+ /** The document's file name / path, when the host supplied one. */
101
+ fileName?: string;
102
+ }
103
+ /**
104
+ * Host-owned persistence for dismissed ("Ignore") findings.
105
+ *
106
+ * Ignores are deliberately never written into the document — they are
107
+ * one person's editing preference, and a doc travelling through git
108
+ * shouldn't carry them. Instead the editor hands the state to the host,
109
+ * scoped per document, and the host stores it wherever its user data
110
+ * lives (a settings file, IndexedDB, a per-workspace record keyed by
111
+ * path…). The payload is the engine's OPAQUE export: store it as a
112
+ * string, never parse it.
113
+ *
114
+ * Omit the store and Ignore still works — it just lasts for the
115
+ * session, which is often the right behavior for a scratch buffer.
116
+ */
117
+ interface ProofingIgnoreStore {
118
+ /** Previously saved state for this document, if any. */
119
+ load(doc: ProofingDocumentRef): string | undefined | Promise<string | undefined>;
120
+ /** Persist this document's state. Called after every Ignore. */
121
+ save(doc: ProofingDocumentRef, ignoredJson: string): void | Promise<void>;
122
+ }
123
+ /** Configuration for {@link createHarperProofingProvider}. */
124
+ interface HarperProofingConfig {
125
+ /**
126
+ * Same-origin URL of harper's WASM binary (the host serves
127
+ * `harper.js/dist/harper_wasm_bg.wasm` itself — see docs/proofing.md).
128
+ * When omitted, the `harper.js/binary` module default is used, which
129
+ * relies on the host bundler resolving the WASM as an asset.
130
+ */
131
+ wasmUrl?: string;
132
+ /** Initial dialect (default American). */
133
+ dialect?: ProofDialect;
134
+ /** App-level dictionary loaded during setup. */
135
+ initialWords?: readonly string[];
136
+ /**
137
+ * Fired when the user adds a word app-wide — persist it host-side.
138
+ * Its absence reports `hasAppDictionary: false`, which hides the
139
+ * "Add to dictionary" menu item.
140
+ *
141
+ * Note the asymmetry with ignores: a dictionary word is app-global
142
+ * (a proper noun is spelled the same everywhere), so it belongs on
143
+ * the engine's config. Ignores are per-document and go through
144
+ * `EditorShell`'s `proofingIgnoreStore` instead.
145
+ */
146
+ onDictionaryWord?: (word: string) => void;
147
+ /**
148
+ * Escape hatch: a preconstructed harper `BinaryModule`. Typed
149
+ * `unknown` so harper types stay out of published declarations
150
+ * (Node tests pass `binaryInlined` here — harper's `file://` loader
151
+ * is broken on Windows).
152
+ */
153
+ binary?: unknown;
154
+ }
155
+
156
+ export type { HarperProofingConfig as H, ProofingCapability as P, ProofingDocumentRef as a, ProofingIgnoreStore as b, ProofingLanguage as c, ProofingLintOptions as d, ProofingProvider as e, ProofingProviderFactory as f };