@bendyline/squisq-editor-react 2.13.13 → 2.13.15

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.
@@ -932,7 +932,7 @@ function useDictationController({
932
932
  }
933
933
  return;
934
934
  }
935
- const { startDictationSession } = await import("./dictationSession-4JBKD5EU.js");
935
+ const { startDictationSession } = await import("./dictationSession-AVCXB3JR.js");
936
936
  if (!isCurrent()) return;
937
937
  const handle = await startDictationSession({
938
938
  provider: active,
@@ -200,9 +200,10 @@ var ProgressiveSpeechToText = class {
200
200
  const type = recorder.mimeType || this.mimeType || "audio/webm";
201
201
  const blob = new Blob(this.chunks, { type });
202
202
  const capturedMs = Math.max(0, Date.now() - this.segmentStartedAt);
203
+ const heardSpeech = this.segmentHasSpeech;
203
204
  this.chunks = [];
204
205
  if (!this.finalSegmentRequested) this.startSegment();
205
- if (blob.size > 0) this.enqueueTranscription(blob, type, capturedMs);
206
+ if (blob.size > 0) this.enqueueTranscription(blob, type, capturedMs, heardSpeech);
206
207
  if (this.finalSegmentRequested) void this.finish();
207
208
  };
208
209
  recorder.start();
@@ -255,18 +256,14 @@ var ProgressiveSpeechToText = class {
255
256
  this.pending = next;
256
257
  if (!this.disposed) this.onPendingChange?.(next);
257
258
  }
258
- enqueueTranscription(blob, mimeType, capturedMs) {
259
+ enqueueTranscription(blob, mimeType, capturedMs, heardSpeech) {
259
260
  this.setPending(this.pending + 1);
260
261
  this.transcriptionQueue = this.transcriptionQueue.then(async () => {
261
262
  if (this.disposed) return;
262
263
  try {
264
+ const prompt = heardSpeech || !this.activityMonitorStarted ? this.recognitionPrompt : "";
263
265
  const text = normalizeSpeechTranscript(
264
- await this.transcribe(
265
- blob,
266
- mimeType,
267
- this.abortController.signal,
268
- this.recognitionPrompt
269
- )
266
+ await this.transcribe(blob, mimeType, this.abortController.signal, prompt)
270
267
  );
271
268
  if (this.disposed) return;
272
269
  if (text) {
package/dist/index.d.ts CHANGED
@@ -1933,6 +1933,12 @@ interface ApplyAsciiDiagramCommandOptions {
1933
1933
  col: number;
1934
1934
  row: number;
1935
1935
  };
1936
+ /**
1937
+ * Called when the edit is refused because its redrawn art would not read
1938
+ * back as the same diagram (a box or connection would be lost), as opposed
1939
+ * to a no-op. Lets the canvas say why the edit didn't stick.
1940
+ */
1941
+ onRejected?: () => void;
1936
1942
  }
1937
1943
  /**
1938
1944
  * Replace the TEXT inside the codeBlock at `pos` and, when `ensureLanguage`
@@ -2035,6 +2041,11 @@ declare function removeEdgeOp(diagram: AsciiDiagram, source: string, target: str
2035
2041
  * Rename a node. The label drives the node's parse-derived id, so edges
2036
2042
  * and containment references are rewritten to the id the next parse will
2037
2043
  * produce. (Selection in the canvas drops after a rename — documented.)
2044
+ *
2045
+ * A longer label widens the box; when that would crowd a sibling on the
2046
+ * same rows, everything to the right shifts over so the renderer never has
2047
+ * to resolve the collision itself (it bumps the sibling down a row, and the
2048
+ * rerouted edges can fail the command's re-parse check — a silent revert).
2038
2049
  */
2039
2050
  declare function renameNodeOp(diagram: AsciiDiagram, nodeId: string, label: string): AsciiDiagram;
2040
2051
  /** Add a node at (col, row). Inherits a container when placed inside one. */
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  PROOF_FRONTMATTER_KEYS,
4
4
  createHarperProofingProvider
5
5
  } from "./chunk-VRRT4WP4.js";
6
- import "./chunk-7MAL27C2.js";
6
+ import "./chunk-7ADGH53Y.js";
7
7
  import {
8
8
  configureMonacoWorkers
9
9
  } from "./chunk-BWPFPHWY.js";
@@ -243,7 +243,7 @@ import {
243
243
  videoEmbedParagraphJson,
244
244
  viewStateFromBinding,
245
245
  writeHeadingViewState
246
- } from "./chunk-FLCBGVPN.js";
246
+ } from "./chunk-CLULTEKS.js";
247
247
  import {
248
248
  EditorProvider,
249
249
  applySourceEditsToText,
@@ -264,7 +264,7 @@ import {
264
264
  useBlockNavigator,
265
265
  useEditorContext,
266
266
  useEditorInsertMenuItems
267
- } from "./chunk-D2QFSFG2.js";
267
+ } from "./chunk-UQUYPT5P.js";
268
268
  import {
269
269
  SPEECH_INPUT_SAMPLE_RATE,
270
270
  isSpeechInputProviderFactory,
@@ -19,7 +19,7 @@ import {
19
19
  updateReviewDecorations,
20
20
  useReview,
21
21
  useReviewState
22
- } from "../chunk-D2QFSFG2.js";
22
+ } from "../chunk-UQUYPT5P.js";
23
23
  import "../chunk-DNEVUOBZ.js";
24
24
  import "../chunk-ZLKINE4Y.js";
25
25
 
@@ -5,12 +5,12 @@ import {
5
5
  RawEditor,
6
6
  WysiwygEditor,
7
7
  useEditorContextMenuItems
8
- } from "../chunk-FLCBGVPN.js";
8
+ } from "../chunk-CLULTEKS.js";
9
9
  import {
10
10
  EditorProvider,
11
11
  useEditorContext,
12
12
  useEditorInsertMenuItems
13
- } from "../chunk-D2QFSFG2.js";
13
+ } from "../chunk-UQUYPT5P.js";
14
14
  import "../chunk-DNEVUOBZ.js";
15
15
  import "../chunk-A2H3JOA5.js";
16
16
  import "../chunk-4MBH7MMU.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  encodeMonoPcm16Wav,
3
3
  startDictationSession
4
- } from "../chunk-7MAL27C2.js";
4
+ } from "../chunk-7ADGH53Y.js";
5
5
  import {
6
6
  SPEECH_INPUT_SAMPLE_RATE,
7
7
  isSpeechInputProviderFactory,
@@ -11679,6 +11679,119 @@
11679
11679
  background: var(--squisq-danger-soft);
11680
11680
  color: var(--squisq-danger-strong);
11681
11681
  }
11682
+ .squisq-media-bin-item--previewable {
11683
+ cursor: pointer;
11684
+ }
11685
+ .squisq-media-preview {
11686
+ position: fixed;
11687
+ inset: 0;
11688
+ z-index: 1000;
11689
+ display: flex;
11690
+ align-items: center;
11691
+ justify-content: center;
11692
+ padding: 24px;
11693
+ background: var(--squisq-scrim);
11694
+ }
11695
+ .squisq-media-preview-surface {
11696
+ display: flex;
11697
+ flex-direction: column;
11698
+ max-width: 100%;
11699
+ max-height: 100%;
11700
+ overflow: hidden;
11701
+ border: 1px solid var(--squisq-border);
11702
+ border-radius: 8px;
11703
+ background: var(--squisq-surface-overlay);
11704
+ color: var(--squisq-text);
11705
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
11706
+ font: 400 13px/1.4 var(--squisq-ux-font, system-ui, -apple-system, sans-serif);
11707
+ }
11708
+ .squisq-media-preview-surface--image {
11709
+ width: min(1200px, 100%);
11710
+ height: min(860px, 100%);
11711
+ }
11712
+ .squisq-media-preview-surface--image .squisq-media-preview-body {
11713
+ align-items: stretch;
11714
+ }
11715
+ .squisq-media-preview-surface--video {
11716
+ min-width: min(480px, 100%);
11717
+ }
11718
+ .squisq-media-preview-surface--audio {
11719
+ width: min(480px, 100%);
11720
+ }
11721
+ .squisq-media-preview-header {
11722
+ display: flex;
11723
+ align-items: center;
11724
+ gap: 12px;
11725
+ padding: 8px 8px 8px 16px;
11726
+ border-bottom: 1px solid var(--squisq-border-subtle);
11727
+ background: var(--squisq-bg);
11728
+ }
11729
+ .squisq-media-preview-title {
11730
+ min-width: 0;
11731
+ overflow: hidden;
11732
+ text-overflow: ellipsis;
11733
+ white-space: nowrap;
11734
+ font-weight: 600;
11735
+ }
11736
+ .squisq-media-preview-detail {
11737
+ flex: 1;
11738
+ white-space: nowrap;
11739
+ font-size: 12px;
11740
+ color: var(--squisq-text-muted);
11741
+ }
11742
+ .squisq-media-preview-close {
11743
+ width: 28px;
11744
+ height: 28px;
11745
+ flex: 0 0 auto;
11746
+ padding: 0;
11747
+ border: 1px solid transparent;
11748
+ border-radius: 4px;
11749
+ background: transparent;
11750
+ color: var(--squisq-text-muted);
11751
+ font-size: 22px;
11752
+ line-height: 1;
11753
+ cursor: pointer;
11754
+ }
11755
+ .squisq-media-preview-close:hover {
11756
+ background: var(--squisq-surface-hover);
11757
+ color: var(--squisq-text);
11758
+ }
11759
+ .squisq-media-preview-close:focus-visible {
11760
+ outline: 2px solid var(--squisq-accent-border);
11761
+ outline-offset: 1px;
11762
+ }
11763
+ .squisq-media-preview-body {
11764
+ flex: 1;
11765
+ min-height: 0;
11766
+ display: flex;
11767
+ align-items: center;
11768
+ justify-content: center;
11769
+ }
11770
+ .squisq-media-preview-video {
11771
+ display: block;
11772
+ max-width: 100%;
11773
+ max-height: calc(100vh - 48px - 46px);
11774
+ background: var(--squisq-media-well);
11775
+ }
11776
+ .squisq-media-preview-audio {
11777
+ display: flex;
11778
+ flex-direction: column;
11779
+ align-items: center;
11780
+ gap: 16px;
11781
+ width: 100%;
11782
+ padding: 24px;
11783
+ }
11784
+ .squisq-media-preview-audio-icon {
11785
+ font-size: 40px;
11786
+ line-height: 1;
11787
+ }
11788
+ .squisq-media-preview-audio audio {
11789
+ width: 100%;
11790
+ }
11791
+ .squisq-media-preview-message {
11792
+ padding: 48px 24px;
11793
+ color: var(--squisq-text-muted);
11794
+ }
11682
11795
  .squisq-drop-overlay {
11683
11796
  position: absolute;
11684
11797
  inset: 0;
@@ -13739,7 +13852,7 @@ button.squisq-view-menu-radio-row:focus-visible {
13739
13852
  padding: 1px 6px;
13740
13853
  font-size: 10px;
13741
13854
  font-weight: 600;
13742
- color: var(--squisq-outline-accent);
13855
+ color: color-mix(in oklch, var(--squisq-outline-accent) 35%, var(--squisq-text-strong));
13743
13856
  background: color-mix(in oklch, var(--squisq-outline-accent) 12%, transparent);
13744
13857
  border: 1px solid color-mix(in oklch, var(--squisq-outline-accent) 35%, transparent);
13745
13858
  border-radius: 8px;
@@ -13747,7 +13860,7 @@ button.squisq-view-menu-radio-row:focus-visible {
13747
13860
  }
13748
13861
  .squisq-outline-row--current {
13749
13862
  background: color-mix(in oklch, var(--squisq-outline-accent) 14%, transparent);
13750
- color: var(--squisq-outline-accent);
13863
+ color: color-mix(in oklch, var(--squisq-outline-accent) 35%, var(--squisq-text-strong));
13751
13864
  }
13752
13865
  .squisq-outline-row-wrap {
13753
13866
  position: relative;
@@ -13836,13 +13949,15 @@ button.squisq-view-menu-radio-row:focus-visible {
13836
13949
  color: var(--squisq-text-faint);
13837
13950
  }
13838
13951
  .squisq-editor-shell[data-theme=dark] .squisq-outline-template-chip {
13839
- color: color-mix(in oklch, var(--squisq-outline-accent) 55%, var(--squisq-text-strong));
13840
13952
  background: color-mix(in oklch, var(--squisq-outline-accent) 30%, transparent);
13841
13953
  border-color: color-mix(in oklch, var(--squisq-outline-accent) 55%, transparent);
13842
13954
  }
13843
13955
  .squisq-editor-shell[data-theme=dark] .squisq-outline-row--current {
13844
13956
  background: color-mix(in oklch, var(--squisq-outline-accent) 32%, transparent);
13845
- color: color-mix(in oklch, var(--squisq-outline-accent) 55%, var(--squisq-text-on-accent));
13957
+ color: color-mix(in oklch, var(--squisq-outline-accent) 35%, var(--squisq-text-strong));
13958
+ }
13959
+ .squisq-editor-shell[data-theme=dark] .squisq-outline-row--current .squisq-outline-template-chip {
13960
+ background: transparent;
13846
13961
  }
13847
13962
  .squisq-link-dialog-overlay {
13848
13963
  position: fixed;
@@ -17360,6 +17475,23 @@ button.squisq-view-menu-radio-row:focus-visible {
17360
17475
  margin: 4px 0 0;
17361
17476
  padding-left: 18px;
17362
17477
  }
17478
+ .squisq-ascii-diagram-notice:not(:empty) {
17479
+ margin-top: 6px;
17480
+ padding: 6px 10px;
17481
+ border: 1px solid var(--squisq-border);
17482
+ border-left: 3px solid var(--squisq-accent);
17483
+ border-radius: 6px;
17484
+ background: var(--squisq-input-bg);
17485
+ color: var(--squisq-text);
17486
+ font-size: 13px;
17487
+ }
17488
+ .squisq-scene-block-max > .squisq-ascii-diagram-notice {
17489
+ position: absolute;
17490
+ left: 24px;
17491
+ bottom: 24px;
17492
+ max-width: min(560px, calc(100% - 48px));
17493
+ z-index: 30;
17494
+ }
17363
17495
  .squisq-repair-banner {
17364
17496
  display: flex;
17365
17497
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "2.13.13",
3
+ "version": "2.13.15",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -102,12 +102,12 @@
102
102
  }
103
103
  },
104
104
  "dependencies": {
105
- "@bendyline/squisq": "2.13.8",
105
+ "@bendyline/squisq": "2.13.9",
106
106
  "@bendyline/squisq-calc": "2.11.2",
107
- "@bendyline/squisq-formats": "2.8.9",
108
- "@bendyline/squisq-grid-react": "2.11.37",
109
- "@bendyline/squisq-react": "2.12.20",
110
- "@bendyline/squisq-video-react": "2.5.21",
107
+ "@bendyline/squisq-formats": "2.8.11",
108
+ "@bendyline/squisq-grid-react": "2.11.38",
109
+ "@bendyline/squisq-react": "2.12.21",
110
+ "@bendyline/squisq-video-react": "2.5.22",
111
111
  "@fortawesome/fontawesome-free": "7.3.1",
112
112
  "@tiptap/core": "2.27.3",
113
113
  "@tiptap/extension-heading": "2.27.3",