superdoc 2.21.0 → 2.22.0-next.2

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.
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
19
19
  var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
20
20
  var ENGINE_INFO = Object.freeze({
21
21
  ...PRIVATE_ENGINE_INFO,
22
- superdocVersion: "2.21.0",
22
+ superdocVersion: "2.22.0-next.2",
23
23
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
24
24
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
25
25
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
18
18
  var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
19
19
  var ENGINE_INFO = Object.freeze({
20
20
  ...PRIVATE_ENGINE_INFO,
21
- superdocVersion: "2.21.0",
21
+ superdocVersion: "2.22.0-next.2",
22
22
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
23
23
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
24
24
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -84,6 +84,24 @@ export type StructuredContentLockMode = 'unlocked' | 'sdtLocked' | 'contentLocke
84
84
  * DOM textContent (a11y / copy-paste behavior).
85
85
  */
86
86
  export type StructuredContentAppearance = 'boundingBox' | 'tags' | 'hidden';
87
+ /** The visible state Word stores on a `w14:checkbox` content control. */
88
+ export type StructuredContentCheckbox = {
89
+ checked: boolean;
90
+ checkedSymbol: {
91
+ font: string;
92
+ char: string;
93
+ };
94
+ uncheckedSymbol: {
95
+ font: string;
96
+ char: string;
97
+ };
98
+ /**
99
+ * CSS-pixel size resolved from the checkbox SDT's own `<w:rPr>`.
100
+ * Word applies this control-level run formatting to its glyph even when the
101
+ * carrier `<w:sym>` does not retain that formatting through projection.
102
+ */
103
+ fontSize?: number;
104
+ };
87
105
  export type StructuredContentMetadata = {
88
106
  type: 'structuredContent';
89
107
  scope: 'inline' | 'block';
@@ -93,6 +111,8 @@ export type StructuredContentMetadata = {
93
111
  lockMode?: StructuredContentLockMode;
94
112
  /** Appearance from the SDT's `<w15:appearance>` element, when present. */
95
113
  appearance?: StructuredContentAppearance;
114
+ /** Word-native checkbox state parsed from the SDT properties, when present. */
115
+ checkbox?: StructuredContentCheckbox;
96
116
  sdtPr?: unknown;
97
117
  };
98
118
  export type DocumentSectionMetadata = {
@@ -2,6 +2,14 @@ import { Run, TextRun } from '../../../../contracts/src/index.js';
2
2
  import { FragmentRenderContext } from '../renderer.js';
3
3
  import { BROWSER_DEFAULT_FONT_SIZE } from '../styles.js';
4
4
  import { RunRenderContext, TrackedChangesRenderConfig } from './types.js';
5
+ export type CheckboxGlyphs = {
6
+ checked: string;
7
+ unchecked: string;
8
+ current: string;
9
+ };
10
+ export declare const checkboxGlyphs: (run: TextRun) => CheckboxGlyphs | null;
11
+ /** Stamps the authored states needed to reflect an accepted checkbox toggle. */
12
+ export declare const applyCheckboxGlyphMetadata: (element: HTMLElement, run: TextRun) => CheckboxGlyphs | null;
5
13
  /**
6
14
  * Underline thickness in px, scaled to font size. Shared by text runs
7
15
  * (`text-decoration-thickness`) and tab underlines (border width) so a run's
@@ -1,11 +1,3 @@
1
- /**
2
- * Document-scoped font options for the toolbar: one option per logical family a loaded document
3
- * actually uses. Distinct from the static {@link ./font-offerings} (the bundled choices): this is
4
- * runtime and document-scoped because it needs the document's registry and resolver.
5
- *
6
- * Fallback diagnostics are intentionally not part of this surface. The toolbar lists document fonts as
7
- * plain picker rows; internal fallback/reporting details stay in SuperDoc's runtime font report.
8
- */
9
1
  import { type BundledActivation } from './activation.js';
10
2
  import { type UsedFace } from './report.js';
11
3
  import type { FontRegistry } from './registry.js';
@@ -22,6 +14,8 @@ export interface DocumentFontOption {
22
14
  * provided font previews as itself). The regular face is used as the representative when present.
23
15
  */
24
16
  previewFamily: string;
17
+ /** First CSS generic in the rendered logical stack, or null when that stack has none. */
18
+ genericFamily: string | null;
25
19
  }
26
20
  /**
27
21
  * The document-specific font options for the toolbar: one per LOGICAL family the document renders,
@@ -50,4 +44,4 @@ export interface FontFamilyOption {
50
44
  * always listed - they come from the loaded document itself. Sorted alphabetically, deduped by
51
45
  * logical family.
52
46
  */
53
- export declare function buildFontFamilyOptions(documentOptions: ReadonlyArray<DocumentFontOption>, activation?: BundledActivation): FontFamilyOption[];
47
+ export declare function buildFontFamilyOptions(documentOptions: ReadonlyArray<Pick<DocumentFontOption, 'logicalFamily' | 'previewFamily'>>, activation?: BundledActivation): FontFamilyOption[];
package/dist/style.css CHANGED
@@ -2340,34 +2340,34 @@ img[data-v-c95b2073] {
2340
2340
  pointer-events: auto;
2341
2341
  }
2342
2342
 
2343
- .superdoc[data-v-0d8ce95e] {
2343
+ .superdoc[data-v-b22dc061] {
2344
2344
  display: flex;
2345
2345
  position: relative;
2346
2346
  }
2347
- .right-sidebar[data-v-0d8ce95e] {
2347
+ .right-sidebar[data-v-b22dc061] {
2348
2348
  min-width: 320px;
2349
2349
  height: 100%;
2350
2350
  }
2351
- .floating-comments[data-v-0d8ce95e] {
2351
+ .floating-comments[data-v-b22dc061] {
2352
2352
  min-width: 300px;
2353
2353
  width: 300px;
2354
2354
  height: 100%;
2355
2355
  overflow: visible;
2356
2356
  }
2357
- .superdoc__layers[data-v-0d8ce95e] {
2357
+ .superdoc__layers[data-v-b22dc061] {
2358
2358
  height: 100%;
2359
2359
  position: relative;
2360
2360
  box-sizing: border-box;
2361
2361
  }
2362
- .superdoc__document[data-v-0d8ce95e] {
2362
+ .superdoc__document[data-v-b22dc061] {
2363
2363
  width: 100%;
2364
2364
  position: relative;
2365
2365
  }
2366
- .superdoc__sub-document[data-v-0d8ce95e] {
2366
+ .superdoc__sub-document[data-v-b22dc061] {
2367
2367
  width: 100%;
2368
2368
  position: relative;
2369
2369
  }
2370
- .superdoc__selection-layer[data-v-0d8ce95e] {
2370
+ .superdoc__selection-layer[data-v-b22dc061] {
2371
2371
  position: absolute;
2372
2372
  min-width: 100%;
2373
2373
  min-height: 100%;
@@ -2378,13 +2378,13 @@ img[data-v-c95b2073] {
2378
2378
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
2379
2379
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
2380
2380
  clickable, and below the selection layer (z-index 10). */
2381
- .superdoc__whiteboard-layer[data-v-0d8ce95e] {
2381
+ .superdoc__whiteboard-layer[data-v-b22dc061] {
2382
2382
  z-index: 4;
2383
2383
  }
2384
- .superdoc__temp-selection[data-v-0d8ce95e] {
2384
+ .superdoc__temp-selection[data-v-b22dc061] {
2385
2385
  position: absolute;
2386
2386
  }
2387
- .superdoc__right-sidebar[data-v-0d8ce95e] {
2387
+ .superdoc__right-sidebar[data-v-b22dc061] {
2388
2388
  width: 320px;
2389
2389
  min-width: 320px;
2390
2390
  padding: 0 10px;
@@ -2392,7 +2392,7 @@ img[data-v-c95b2073] {
2392
2392
  position: relative;
2393
2393
  z-index: 2;
2394
2394
  }
2395
- .superdoc__compact-comment-popover[data-v-0d8ce95e] {
2395
+ .superdoc__compact-comment-popover[data-v-b22dc061] {
2396
2396
  position: absolute;
2397
2397
  top: 12px;
2398
2398
  right: 12px;
@@ -2401,14 +2401,14 @@ img[data-v-c95b2073] {
2401
2401
  }
2402
2402
 
2403
2403
  /* Tools styles */
2404
- .tools[data-v-0d8ce95e] {
2404
+ .tools[data-v-b22dc061] {
2405
2405
  position: absolute;
2406
2406
  z-index: 3;
2407
2407
  display: flex;
2408
2408
  flex-direction: column;
2409
2409
  gap: var(--sd-ui-tools-gap, 6px);
2410
2410
  }
2411
- .tools-item[data-v-0d8ce95e] {
2411
+ .tools-item[data-v-b22dc061] {
2412
2412
  display: flex;
2413
2413
  align-items: center;
2414
2414
  justify-content: center;
@@ -2419,10 +2419,10 @@ img[data-v-c95b2073] {
2419
2419
  cursor: pointer;
2420
2420
  position: relative;
2421
2421
  }
2422
- .tools-item i[data-v-0d8ce95e] {
2422
+ .tools-item i[data-v-b22dc061] {
2423
2423
  cursor: pointer;
2424
2424
  }
2425
- .superdoc__tools-icon[data-v-0d8ce95e] {
2425
+ .superdoc__tools-icon[data-v-b22dc061] {
2426
2426
  width: var(--sd-ui-tools-icon-size, 20px);
2427
2427
  height: var(--sd-ui-tools-icon-size, 20px);
2428
2428
  flex-shrink: 0;
@@ -2437,22 +2437,22 @@ img[data-v-c95b2073] {
2437
2437
 
2438
2438
  /* 834px is iPad screen size in portrait orientation */
2439
2439
  @media (max-width: 834px) {
2440
- .superdoc .superdoc__layers[data-v-0d8ce95e] {
2440
+ .superdoc .superdoc__layers[data-v-b22dc061] {
2441
2441
  margin: 0;
2442
2442
  border: 0 !important;
2443
2443
  box-shadow: none;
2444
2444
  }
2445
- .superdoc__sub-document[data-v-0d8ce95e] {
2445
+ .superdoc__sub-document[data-v-b22dc061] {
2446
2446
  max-width: 100%;
2447
2447
  }
2448
- .superdoc__right-sidebar[data-v-0d8ce95e] {
2448
+ .superdoc__right-sidebar[data-v-b22dc061] {
2449
2449
  padding: 10px;
2450
2450
  position: relative;
2451
2451
  }
2452
2452
  }
2453
2453
 
2454
2454
  /* AI Writer styles */
2455
- .ai-writer-container[data-v-0d8ce95e] {
2455
+ .ai-writer-container[data-v-b22dc061] {
2456
2456
  position: fixed;
2457
2457
  z-index: 1000;
2458
2458
  background: white;
@@ -2468,10 +2468,10 @@ img[data-v-c95b2073] {
2468
2468
  transform: translateY(-50%);
2469
2469
  z-index: 50;
2470
2470
  } */
2471
- .ai-tool > svg[data-v-0d8ce95e] {
2471
+ .ai-tool > svg[data-v-b22dc061] {
2472
2472
  fill: transparent;
2473
2473
  }
2474
- .ai-tool[data-v-0d8ce95e]::before {
2474
+ .ai-tool[data-v-b22dc061]::before {
2475
2475
  content: '';
2476
2476
  position: absolute;
2477
2477
  width: 20px;
@@ -2492,7 +2492,7 @@ img[data-v-c95b2073] {
2492
2492
  filter: brightness(1.2);
2493
2493
  transition: filter 0.2s ease;
2494
2494
  }
2495
- .ai-tool[data-v-0d8ce95e]:hover::before {
2495
+ .ai-tool[data-v-b22dc061]:hover::before {
2496
2496
  filter: brightness(1.3);
2497
2497
  }
2498
2498
 
@@ -2340,34 +2340,34 @@ img[data-v-c95b2073] {
2340
2340
  pointer-events: auto;
2341
2341
  }
2342
2342
 
2343
- .superdoc[data-v-0d8ce95e] {
2343
+ .superdoc[data-v-b22dc061] {
2344
2344
  display: flex;
2345
2345
  position: relative;
2346
2346
  }
2347
- .right-sidebar[data-v-0d8ce95e] {
2347
+ .right-sidebar[data-v-b22dc061] {
2348
2348
  min-width: 320px;
2349
2349
  height: 100%;
2350
2350
  }
2351
- .floating-comments[data-v-0d8ce95e] {
2351
+ .floating-comments[data-v-b22dc061] {
2352
2352
  min-width: 300px;
2353
2353
  width: 300px;
2354
2354
  height: 100%;
2355
2355
  overflow: visible;
2356
2356
  }
2357
- .superdoc__layers[data-v-0d8ce95e] {
2357
+ .superdoc__layers[data-v-b22dc061] {
2358
2358
  height: 100%;
2359
2359
  position: relative;
2360
2360
  box-sizing: border-box;
2361
2361
  }
2362
- .superdoc__document[data-v-0d8ce95e] {
2362
+ .superdoc__document[data-v-b22dc061] {
2363
2363
  width: 100%;
2364
2364
  position: relative;
2365
2365
  }
2366
- .superdoc__sub-document[data-v-0d8ce95e] {
2366
+ .superdoc__sub-document[data-v-b22dc061] {
2367
2367
  width: 100%;
2368
2368
  position: relative;
2369
2369
  }
2370
- .superdoc__selection-layer[data-v-0d8ce95e] {
2370
+ .superdoc__selection-layer[data-v-b22dc061] {
2371
2371
  position: absolute;
2372
2372
  min-width: 100%;
2373
2373
  min-height: 100%;
@@ -2378,13 +2378,13 @@ img[data-v-c95b2073] {
2378
2378
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
2379
2379
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
2380
2380
  clickable, and below the selection layer (z-index 10). */
2381
- .superdoc__whiteboard-layer[data-v-0d8ce95e] {
2381
+ .superdoc__whiteboard-layer[data-v-b22dc061] {
2382
2382
  z-index: 4;
2383
2383
  }
2384
- .superdoc__temp-selection[data-v-0d8ce95e] {
2384
+ .superdoc__temp-selection[data-v-b22dc061] {
2385
2385
  position: absolute;
2386
2386
  }
2387
- .superdoc__right-sidebar[data-v-0d8ce95e] {
2387
+ .superdoc__right-sidebar[data-v-b22dc061] {
2388
2388
  width: 320px;
2389
2389
  min-width: 320px;
2390
2390
  padding: 0 10px;
@@ -2392,7 +2392,7 @@ img[data-v-c95b2073] {
2392
2392
  position: relative;
2393
2393
  z-index: 2;
2394
2394
  }
2395
- .superdoc__compact-comment-popover[data-v-0d8ce95e] {
2395
+ .superdoc__compact-comment-popover[data-v-b22dc061] {
2396
2396
  position: absolute;
2397
2397
  top: 12px;
2398
2398
  right: 12px;
@@ -2401,14 +2401,14 @@ img[data-v-c95b2073] {
2401
2401
  }
2402
2402
 
2403
2403
  /* Tools styles */
2404
- .tools[data-v-0d8ce95e] {
2404
+ .tools[data-v-b22dc061] {
2405
2405
  position: absolute;
2406
2406
  z-index: 3;
2407
2407
  display: flex;
2408
2408
  flex-direction: column;
2409
2409
  gap: var(--sd-ui-tools-gap, 6px);
2410
2410
  }
2411
- .tools-item[data-v-0d8ce95e] {
2411
+ .tools-item[data-v-b22dc061] {
2412
2412
  display: flex;
2413
2413
  align-items: center;
2414
2414
  justify-content: center;
@@ -2419,10 +2419,10 @@ img[data-v-c95b2073] {
2419
2419
  cursor: pointer;
2420
2420
  position: relative;
2421
2421
  }
2422
- .tools-item i[data-v-0d8ce95e] {
2422
+ .tools-item i[data-v-b22dc061] {
2423
2423
  cursor: pointer;
2424
2424
  }
2425
- .superdoc__tools-icon[data-v-0d8ce95e] {
2425
+ .superdoc__tools-icon[data-v-b22dc061] {
2426
2426
  width: var(--sd-ui-tools-icon-size, 20px);
2427
2427
  height: var(--sd-ui-tools-icon-size, 20px);
2428
2428
  flex-shrink: 0;
@@ -2437,22 +2437,22 @@ img[data-v-c95b2073] {
2437
2437
 
2438
2438
  /* 834px is iPad screen size in portrait orientation */
2439
2439
  @media (max-width: 834px) {
2440
- .superdoc .superdoc__layers[data-v-0d8ce95e] {
2440
+ .superdoc .superdoc__layers[data-v-b22dc061] {
2441
2441
  margin: 0;
2442
2442
  border: 0 !important;
2443
2443
  box-shadow: none;
2444
2444
  }
2445
- .superdoc__sub-document[data-v-0d8ce95e] {
2445
+ .superdoc__sub-document[data-v-b22dc061] {
2446
2446
  max-width: 100%;
2447
2447
  }
2448
- .superdoc__right-sidebar[data-v-0d8ce95e] {
2448
+ .superdoc__right-sidebar[data-v-b22dc061] {
2449
2449
  padding: 10px;
2450
2450
  position: relative;
2451
2451
  }
2452
2452
  }
2453
2453
 
2454
2454
  /* AI Writer styles */
2455
- .ai-writer-container[data-v-0d8ce95e] {
2455
+ .ai-writer-container[data-v-b22dc061] {
2456
2456
  position: fixed;
2457
2457
  z-index: 1000;
2458
2458
  background: white;
@@ -2468,10 +2468,10 @@ img[data-v-c95b2073] {
2468
2468
  transform: translateY(-50%);
2469
2469
  z-index: 50;
2470
2470
  } */
2471
- .ai-tool > svg[data-v-0d8ce95e] {
2471
+ .ai-tool > svg[data-v-b22dc061] {
2472
2472
  fill: transparent;
2473
2473
  }
2474
- .ai-tool[data-v-0d8ce95e]::before {
2474
+ .ai-tool[data-v-b22dc061]::before {
2475
2475
  content: '';
2476
2476
  position: absolute;
2477
2477
  width: 20px;
@@ -2492,7 +2492,7 @@ img[data-v-c95b2073] {
2492
2492
  filter: brightness(1.2);
2493
2493
  transition: filter 0.2s ease;
2494
2494
  }
2495
- .ai-tool[data-v-0d8ce95e]:hover::before {
2495
+ .ai-tool[data-v-b22dc061]:hover::before {
2496
2496
  filter: brightness(1.3);
2497
2497
  }
2498
2498
 
@@ -10,3 +10,6 @@ export function isV2RangeSnapshot(snapshot: {
10
10
  } | null | undefined): boolean;
11
11
  export function hasOutsideV2DomRangeSelection(selection: Selection | null | undefined, root: Node | null | undefined): boolean;
12
12
  export function shouldPreserveHostV2Selection(documentMode: string | null | undefined, hostSnapshot: unknown): boolean;
13
+ export function shouldRetainV2FloatingSelection(hasHostRange: boolean, selectionPosition: {
14
+ source?: unknown;
15
+ } | null | undefined): boolean;
package/dist/superdoc.cjs CHANGED
@@ -316,7 +316,7 @@ var shuffleArray = (array) => {
316
316
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
317
317
  function getSuperdocVersion() {
318
318
  try {
319
- return "2.21.0";
319
+ return "2.22.0-next.2";
320
320
  } catch {
321
321
  return "unknown";
322
322
  }
@@ -17363,6 +17363,17 @@ var shouldPreserveHostV2Selection = (documentMode, hostSnapshot) => {
17363
17363
  if (documentMode !== "editing" && documentMode !== "suggesting") return false;
17364
17364
  return isV2RangeSnapshot(hostSnapshot);
17365
17365
  };
17366
+ /**
17367
+ * A V2 paint can briefly have no DOM anchor while a selected control is being
17368
+ * rebuilt. Keep an already-positioned comment affordance during that gap when
17369
+ * the host still owns a range; otherwise the button unmounts and remounts on
17370
+ * consecutive paint frames, making it blink and intercepting its own click.
17371
+ *
17372
+ * @param {boolean} hasHostRange
17373
+ * @param {{ source?: unknown } | null | undefined} selectionPosition
17374
+ * @returns {boolean}
17375
+ */
17376
+ var shouldRetainV2FloatingSelection = (hasHostRange, selectionPosition) => hasHostRange === true && selectionPosition?.source === "document-editor";
17366
17377
  //#endregion
17367
17378
  //#region src/composables/use-password-prompt.js
17368
17379
  /** @typedef {import('../core/types').PasswordPromptConfig} PasswordPromptConfig */
@@ -23007,6 +23018,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23007
23018
  }
23008
23019
  const selection = buildV2FloatingSelection();
23009
23020
  if (!selection) {
23021
+ if (shouldRetainV2FloatingSelection(v2HasRangeSelection.value, selectionPosition.value)) return;
23010
23022
  activeSelection.value = null;
23011
23023
  resetSelection();
23012
23024
  return;
@@ -24541,7 +24553,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24541
24553
  ], 38);
24542
24554
  };
24543
24555
  }
24544
- }, [["__scopeId", "data-v-0d8ce95e"]]);
24556
+ }, [["__scopeId", "data-v-b22dc061"]]);
24545
24557
  //#endregion
24546
24558
  //#region src/core/create-app.js
24547
24559
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -46358,7 +46370,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
46358
46370
  this.config.colors = shuffleArray(this.config.colors);
46359
46371
  this.userColorMap = /* @__PURE__ */ new Map();
46360
46372
  this.colorIndex = 0;
46361
- this.version = "2.21.0";
46373
+ this.version = "2.22.0-next.2";
46362
46374
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46363
46375
  this.superdocId = config.superdocId || require_uuid.v4();
46364
46376
  this.colors = this.config.colors ?? [];
@@ -314,7 +314,7 @@ var shuffleArray = (array) => {
314
314
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
315
315
  function getSuperdocVersion() {
316
316
  try {
317
- return "2.21.0";
317
+ return "2.22.0-next.2";
318
318
  } catch {
319
319
  return "unknown";
320
320
  }
@@ -17347,6 +17347,17 @@ var shouldPreserveHostV2Selection = (documentMode, hostSnapshot) => {
17347
17347
  if (documentMode !== "editing" && documentMode !== "suggesting") return false;
17348
17348
  return isV2RangeSnapshot(hostSnapshot);
17349
17349
  };
17350
+ /**
17351
+ * A V2 paint can briefly have no DOM anchor while a selected control is being
17352
+ * rebuilt. Keep an already-positioned comment affordance during that gap when
17353
+ * the host still owns a range; otherwise the button unmounts and remounts on
17354
+ * consecutive paint frames, making it blink and intercepting its own click.
17355
+ *
17356
+ * @param {boolean} hasHostRange
17357
+ * @param {{ source?: unknown } | null | undefined} selectionPosition
17358
+ * @returns {boolean}
17359
+ */
17360
+ var shouldRetainV2FloatingSelection = (hasHostRange, selectionPosition) => hasHostRange === true && selectionPosition?.source === "document-editor";
17350
17361
  //#endregion
17351
17362
  //#region src/composables/use-password-prompt.js
17352
17363
  /** @typedef {import('../core/types').PasswordPromptConfig} PasswordPromptConfig */
@@ -22966,6 +22977,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22966
22977
  }
22967
22978
  const selection = buildV2FloatingSelection();
22968
22979
  if (!selection) {
22980
+ if (shouldRetainV2FloatingSelection(v2HasRangeSelection.value, selectionPosition.value)) return;
22969
22981
  activeSelection.value = null;
22970
22982
  resetSelection();
22971
22983
  return;
@@ -24500,7 +24512,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
24500
24512
  ], 38);
24501
24513
  };
24502
24514
  }
24503
- }, [["__scopeId", "data-v-0d8ce95e"]]);
24515
+ }, [["__scopeId", "data-v-b22dc061"]]);
24504
24516
  //#endregion
24505
24517
  //#region src/core/create-app.js
24506
24518
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -46287,7 +46299,7 @@ var SuperDoc = class extends import_eventemitter3.default {
46287
46299
  this.config.colors = shuffleArray(this.config.colors);
46288
46300
  this.userColorMap = /* @__PURE__ */ new Map();
46289
46301
  this.colorIndex = 0;
46290
- this.version = "2.21.0";
46302
+ this.version = "2.22.0-next.2";
46291
46303
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46292
46304
  this.superdocId = config.superdocId || v4();
46293
46305
  this.colors = this.config.colors ?? [];