superdoc 2.23.0-next.12 → 2.23.0-next.14

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.
@@ -1971,12 +1971,12 @@ img[data-v-c95b2073] {
1971
1971
  padding: 38px 75px 75px;
1972
1972
  }
1973
1973
 
1974
- .link-input-wrapper[data-v-3e4bd44e] {
1974
+ .link-input-wrapper[data-v-498a6e6e] {
1975
1975
  display: flex;
1976
1976
  flex-direction: column;
1977
1977
  gap: 8px;
1978
1978
  }
1979
- .link-input-ctn[data-v-3e4bd44e] {
1979
+ .link-input-ctn[data-v-498a6e6e] {
1980
1980
  width: 320px;
1981
1981
  display: flex;
1982
1982
  flex-direction: column;
@@ -1985,20 +1985,20 @@ img[data-v-c95b2073] {
1985
1985
  background-color: var(--sd-ui-dropdown-bg, #ffffff);
1986
1986
  box-sizing: border-box;
1987
1987
  }
1988
- .link-input-ctn[data-v-3e4bd44e] svg {
1988
+ .link-input-ctn[data-v-498a6e6e] svg {
1989
1989
  width: 100%;
1990
1990
  height: 100%;
1991
1991
  display: block;
1992
1992
  fill: currentColor;
1993
1993
  }
1994
- .link-input-ctn .input-row[data-v-3e4bd44e] {
1994
+ .link-input-ctn .input-row[data-v-498a6e6e] {
1995
1995
  align-content: baseline;
1996
1996
  display: flex;
1997
1997
  align-items: center;
1998
1998
  position: relative;
1999
1999
  font-size: var(--sd-ui-font-size-600, 16px);
2000
2000
  }
2001
- .link-input-ctn .input-row input[data-v-3e4bd44e] {
2001
+ .link-input-ctn .input-row input[data-v-498a6e6e] {
2002
2002
  font-size: var(--sd-ui-font-size-300, 13px);
2003
2003
  flex-grow: 1;
2004
2004
  min-width: 0;
@@ -2010,22 +2010,22 @@ img[data-v-c95b2073] {
2010
2010
  border: 1px solid var(--sd-ui-border, #dbdbdb);
2011
2011
  box-sizing: border-box;
2012
2012
  }
2013
- .link-input-ctn .input-row input[data-v-3e4bd44e]:active,
2014
- .link-input-ctn .input-row input[data-v-3e4bd44e]:focus {
2013
+ .link-input-ctn .input-row input[data-v-498a6e6e]:active,
2014
+ .link-input-ctn .input-row input[data-v-498a6e6e]:focus {
2015
2015
  outline: none;
2016
2016
  border: 1px solid var(--sd-ui-action, #1355ff);
2017
2017
  }
2018
- .link-input-ctn .input-row input[readonly][data-v-3e4bd44e] {
2018
+ .link-input-ctn .input-row input[readonly][data-v-498a6e6e] {
2019
2019
  background-color: var(--sd-ui-disabled-bg, #f5f5f5);
2020
2020
  cursor: default;
2021
2021
  color: var(--sd-ui-text-disabled, #888);
2022
2022
  border-color: var(--sd-ui-border, #e0e0e0);
2023
2023
  }
2024
- .link-input-ctn .input-row input[readonly][data-v-3e4bd44e]:active,
2025
- .link-input-ctn .input-row input[readonly][data-v-3e4bd44e]:focus {
2024
+ .link-input-ctn .input-row input[readonly][data-v-498a6e6e]:active,
2025
+ .link-input-ctn .input-row input[readonly][data-v-498a6e6e]:focus {
2026
2026
  border-color: var(--sd-ui-border, #e0e0e0);
2027
2027
  }
2028
- .link-input-ctn .input-icon[data-v-3e4bd44e] {
2028
+ .link-input-ctn .input-icon[data-v-498a6e6e] {
2029
2029
  position: absolute;
2030
2030
  left: 12px;
2031
2031
  width: 14px;
@@ -2034,18 +2034,18 @@ img[data-v-c95b2073] {
2034
2034
  text-align: center;
2035
2035
  z-index: 1;
2036
2036
  }
2037
- .link-input-ctn .input-icon[data-v-3e4bd44e]:not(.text-input-icon) {
2037
+ .link-input-ctn .input-icon[data-v-498a6e6e]:not(.text-input-icon) {
2038
2038
  transform: rotate(45deg);
2039
2039
  height: 14px;
2040
2040
  }
2041
- .link-input-ctn.high-contrast .input-icon[data-v-3e4bd44e] {
2041
+ .link-input-ctn.high-contrast .input-icon[data-v-498a6e6e] {
2042
2042
  color: var(--sd-ui-text, #47484a);
2043
2043
  }
2044
- .link-input-ctn.high-contrast .input-row input[data-v-3e4bd44e] {
2044
+ .link-input-ctn.high-contrast .input-row input[data-v-498a6e6e] {
2045
2045
  color: var(--sd-ui-text, #47484a);
2046
2046
  border-color: var(--sd-ui-text, #47484a);
2047
2047
  }
2048
- .open-link-icon[data-v-3e4bd44e] {
2048
+ .open-link-icon[data-v-498a6e6e] {
2049
2049
  margin-left: 10px;
2050
2050
  width: 30px;
2051
2051
  height: 30px;
@@ -2058,57 +2058,57 @@ img[data-v-c95b2073] {
2058
2058
  transition: all 0.2s ease;
2059
2059
  cursor: pointer;
2060
2060
  }
2061
- .open-link-icon[data-v-3e4bd44e]:hover {
2061
+ .open-link-icon[data-v-498a6e6e]:hover {
2062
2062
  color: var(--sd-ui-action, #1355ff);
2063
2063
  background-color: var(--sd-ui-bg, #ffffff);
2064
2064
  border: 1px solid var(--sd-ui-border, #dbdbdb);
2065
2065
  }
2066
- .open-link-icon[data-v-3e4bd44e] svg {
2066
+ .open-link-icon[data-v-498a6e6e] svg {
2067
2067
  width: 15px;
2068
2068
  height: 15px;
2069
2069
  }
2070
- .sd-disabled[data-v-3e4bd44e] {
2070
+ .sd-disabled[data-v-498a6e6e] {
2071
2071
  opacity: 0.6;
2072
2072
  cursor: not-allowed;
2073
2073
  pointer-events: none;
2074
2074
  }
2075
- .link-buttons[data-v-3e4bd44e] {
2075
+ .link-buttons[data-v-498a6e6e] {
2076
2076
  display: flex;
2077
2077
  justify-content: flex-end;
2078
2078
  margin-top: 10px;
2079
2079
  }
2080
- .remove-btn__icon[data-v-3e4bd44e] {
2080
+ .remove-btn__icon[data-v-498a6e6e] {
2081
2081
  display: inline-flex;
2082
2082
  width: 13px;
2083
2083
  height: 13px;
2084
2084
  flex-shrink: 0;
2085
2085
  margin-right: 4px;
2086
2086
  }
2087
- .link-buttons button[data-v-3e4bd44e] {
2087
+ .link-buttons button[data-v-498a6e6e] {
2088
2088
  margin-left: 5px;
2089
2089
  }
2090
- .disable-btn[data-v-3e4bd44e] {
2090
+ .disable-btn[data-v-498a6e6e] {
2091
2091
  opacity: 0.6;
2092
2092
  cursor: not-allowed;
2093
2093
  pointer-events: none;
2094
2094
  }
2095
- .go-to-anchor a[data-v-3e4bd44e] {
2095
+ .go-to-anchor a[data-v-498a6e6e] {
2096
2096
  font-size: var(--sd-ui-font-size-400, 14px);
2097
2097
  text-decoration: underline;
2098
2098
  }
2099
- .clickable[data-v-3e4bd44e] {
2099
+ .clickable[data-v-498a6e6e] {
2100
2100
  cursor: pointer;
2101
2101
  }
2102
- .link-title[data-v-3e4bd44e] {
2102
+ .link-title[data-v-498a6e6e] {
2103
2103
  font-size: var(--sd-ui-font-size-400, 14px);
2104
2104
  font-weight: 600;
2105
2105
  color: var(--sd-ui-text, #47484a);
2106
2106
  margin-bottom: 10px;
2107
2107
  }
2108
- .hasBottomMargin[data-v-3e4bd44e] {
2108
+ .hasBottomMargin[data-v-498a6e6e] {
2109
2109
  margin-bottom: 1em;
2110
2110
  }
2111
- .remove-btn[data-v-3e4bd44e] {
2111
+ .remove-btn[data-v-498a6e6e] {
2112
2112
  display: inline-flex;
2113
2113
  justify-content: center;
2114
2114
  align-items: center;
@@ -2124,10 +2124,10 @@ img[data-v-c95b2073] {
2124
2124
  border: 1px solid var(--sd-ui-border, #dbdbdb);
2125
2125
  box-sizing: border-box;
2126
2126
  }
2127
- .remove-btn[data-v-3e4bd44e]:hover {
2127
+ .remove-btn[data-v-498a6e6e]:hover {
2128
2128
  background-color: var(--sd-ui-hover-bg, #dbdbdb);
2129
2129
  }
2130
- .sd-submit-btn[data-v-3e4bd44e] {
2130
+ .sd-submit-btn[data-v-498a6e6e] {
2131
2131
  display: inline-flex;
2132
2132
  justify-content: center;
2133
2133
  align-items: center;
@@ -2143,10 +2143,10 @@ img[data-v-c95b2073] {
2143
2143
  transition: all 0.2s ease;
2144
2144
  box-sizing: border-box;
2145
2145
  }
2146
- .sd-submit-btn[data-v-3e4bd44e]:hover {
2146
+ .sd-submit-btn[data-v-498a6e6e]:hover {
2147
2147
  background-color: var(--sd-ui-action-hover, #0f44cc);
2148
2148
  }
2149
- .sd-error[data-v-3e4bd44e] {
2149
+ .sd-error[data-v-498a6e6e] {
2150
2150
  border-color: red !important;
2151
2151
  background-color: #ff00001a;
2152
2152
  }
@@ -2341,34 +2341,34 @@ img[data-v-c95b2073] {
2341
2341
  pointer-events: auto;
2342
2342
  }
2343
2343
 
2344
- .superdoc[data-v-3a8bc935] {
2344
+ .superdoc[data-v-f53aafe0] {
2345
2345
  display: flex;
2346
2346
  position: relative;
2347
2347
  }
2348
- .right-sidebar[data-v-3a8bc935] {
2348
+ .right-sidebar[data-v-f53aafe0] {
2349
2349
  min-width: 320px;
2350
2350
  height: 100%;
2351
2351
  }
2352
- .floating-comments[data-v-3a8bc935] {
2352
+ .floating-comments[data-v-f53aafe0] {
2353
2353
  min-width: 300px;
2354
2354
  width: 300px;
2355
2355
  height: 100%;
2356
2356
  overflow: visible;
2357
2357
  }
2358
- .superdoc__layers[data-v-3a8bc935] {
2358
+ .superdoc__layers[data-v-f53aafe0] {
2359
2359
  height: 100%;
2360
2360
  position: relative;
2361
2361
  box-sizing: border-box;
2362
2362
  }
2363
- .superdoc__document[data-v-3a8bc935] {
2363
+ .superdoc__document[data-v-f53aafe0] {
2364
2364
  width: 100%;
2365
2365
  position: relative;
2366
2366
  }
2367
- .superdoc__sub-document[data-v-3a8bc935] {
2367
+ .superdoc__sub-document[data-v-f53aafe0] {
2368
2368
  width: 100%;
2369
2369
  position: relative;
2370
2370
  }
2371
- .superdoc__selection-layer[data-v-3a8bc935] {
2371
+ .superdoc__selection-layer[data-v-f53aafe0] {
2372
2372
  position: absolute;
2373
2373
  min-width: 100%;
2374
2374
  min-height: 100%;
@@ -2379,13 +2379,13 @@ img[data-v-c95b2073] {
2379
2379
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
2380
2380
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
2381
2381
  clickable, and below the selection layer (z-index 10). */
2382
- .superdoc__whiteboard-layer[data-v-3a8bc935] {
2382
+ .superdoc__whiteboard-layer[data-v-f53aafe0] {
2383
2383
  z-index: 4;
2384
2384
  }
2385
- .superdoc__temp-selection[data-v-3a8bc935] {
2385
+ .superdoc__temp-selection[data-v-f53aafe0] {
2386
2386
  position: absolute;
2387
2387
  }
2388
- .superdoc__right-sidebar[data-v-3a8bc935] {
2388
+ .superdoc__right-sidebar[data-v-f53aafe0] {
2389
2389
  width: 320px;
2390
2390
  min-width: 320px;
2391
2391
  padding: 0 10px;
@@ -2393,7 +2393,7 @@ img[data-v-c95b2073] {
2393
2393
  position: relative;
2394
2394
  z-index: 2;
2395
2395
  }
2396
- .superdoc__compact-comment-popover[data-v-3a8bc935] {
2396
+ .superdoc__compact-comment-popover[data-v-f53aafe0] {
2397
2397
  position: absolute;
2398
2398
  top: 12px;
2399
2399
  right: 12px;
@@ -2402,14 +2402,14 @@ img[data-v-c95b2073] {
2402
2402
  }
2403
2403
 
2404
2404
  /* Tools styles */
2405
- .tools[data-v-3a8bc935] {
2405
+ .tools[data-v-f53aafe0] {
2406
2406
  position: absolute;
2407
2407
  z-index: 3;
2408
2408
  display: flex;
2409
2409
  flex-direction: column;
2410
2410
  gap: var(--sd-ui-tools-gap, 6px);
2411
2411
  }
2412
- .tools-item[data-v-3a8bc935] {
2412
+ .tools-item[data-v-f53aafe0] {
2413
2413
  display: flex;
2414
2414
  align-items: center;
2415
2415
  justify-content: center;
@@ -2420,10 +2420,10 @@ img[data-v-c95b2073] {
2420
2420
  cursor: pointer;
2421
2421
  position: relative;
2422
2422
  }
2423
- .tools-item i[data-v-3a8bc935] {
2423
+ .tools-item i[data-v-f53aafe0] {
2424
2424
  cursor: pointer;
2425
2425
  }
2426
- .superdoc__tools-icon[data-v-3a8bc935] {
2426
+ .superdoc__tools-icon[data-v-f53aafe0] {
2427
2427
  width: var(--sd-ui-tools-icon-size, 20px);
2428
2428
  height: var(--sd-ui-tools-icon-size, 20px);
2429
2429
  flex-shrink: 0;
@@ -2438,22 +2438,22 @@ img[data-v-c95b2073] {
2438
2438
 
2439
2439
  /* 834px is iPad screen size in portrait orientation */
2440
2440
  @media (max-width: 834px) {
2441
- .superdoc .superdoc__layers[data-v-3a8bc935] {
2441
+ .superdoc .superdoc__layers[data-v-f53aafe0] {
2442
2442
  margin: 0;
2443
2443
  border: 0 !important;
2444
2444
  box-shadow: none;
2445
2445
  }
2446
- .superdoc__sub-document[data-v-3a8bc935] {
2446
+ .superdoc__sub-document[data-v-f53aafe0] {
2447
2447
  max-width: 100%;
2448
2448
  }
2449
- .superdoc__right-sidebar[data-v-3a8bc935] {
2449
+ .superdoc__right-sidebar[data-v-f53aafe0] {
2450
2450
  padding: 10px;
2451
2451
  position: relative;
2452
2452
  }
2453
2453
  }
2454
2454
 
2455
2455
  /* AI Writer styles */
2456
- .ai-writer-container[data-v-3a8bc935] {
2456
+ .ai-writer-container[data-v-f53aafe0] {
2457
2457
  position: fixed;
2458
2458
  z-index: 1000;
2459
2459
  background: white;
@@ -2469,10 +2469,10 @@ img[data-v-c95b2073] {
2469
2469
  transform: translateY(-50%);
2470
2470
  z-index: 50;
2471
2471
  } */
2472
- .ai-tool > svg[data-v-3a8bc935] {
2472
+ .ai-tool > svg[data-v-f53aafe0] {
2473
2473
  fill: transparent;
2474
2474
  }
2475
- .ai-tool[data-v-3a8bc935]::before {
2475
+ .ai-tool[data-v-f53aafe0]::before {
2476
2476
  content: '';
2477
2477
  position: absolute;
2478
2478
  width: 20px;
@@ -2493,7 +2493,7 @@ img[data-v-c95b2073] {
2493
2493
  filter: brightness(1.2);
2494
2494
  transition: filter 0.2s ease;
2495
2495
  }
2496
- .ai-tool[data-v-3a8bc935]:hover::before {
2496
+ .ai-tool[data-v-f53aafe0]:hover::before {
2497
2497
  filter: brightness(1.3);
2498
2498
  }
2499
2499
 
@@ -1,17 +1,17 @@
1
1
  declare const _default: import('vue').DefineComponent<{}, {
2
2
  target: Record<string, any>;
3
3
  doc: Record<string, any>;
4
+ selectedText: string;
4
5
  restoreSelection: Function;
5
6
  endpoint: string;
6
- selectedText: string;
7
7
  apiKey: string;
8
8
  handleClose: Function;
9
9
  $props: {
10
10
  readonly target?: Record<string, any> | undefined;
11
11
  readonly doc?: Record<string, any> | undefined;
12
+ readonly selectedText?: string | undefined;
12
13
  readonly restoreSelection?: Function | undefined;
13
14
  readonly endpoint?: string | undefined;
14
- readonly selectedText?: string | undefined;
15
15
  readonly apiKey?: string | undefined;
16
16
  readonly handleClose?: Function | undefined;
17
17
  };
@@ -14,6 +14,7 @@ declare const _default: import('vue').DefineComponent<{}, {
14
14
  closePopover: Function;
15
15
  clickedElement: Record<string, any>;
16
16
  hyperlinkText: string;
17
+ selectedText: string;
17
18
  restoreSelection: Function;
18
19
  $props: {
19
20
  readonly target?: string | undefined;
@@ -31,6 +32,7 @@ declare const _default: import('vue').DefineComponent<{}, {
31
32
  readonly closePopover?: Function | undefined;
32
33
  readonly clickedElement?: Record<string, any> | undefined;
33
34
  readonly hyperlinkText?: string | undefined;
35
+ readonly selectedText?: string | undefined;
34
36
  readonly restoreSelection?: Function | undefined;
35
37
  };
36
38
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-74VwNCz7.cjs");
3
3
  const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
4
- const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-CbiiPcgr.cjs");
4
+ const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-1uZB3O_w.cjs");
5
5
  const require_eventemitter3 = require("./chunks/eventemitter3-C_TAnXOl.cjs");
6
6
  const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
7
7
  const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-CYxINHh_.cjs");
@@ -304,7 +304,7 @@ var awarenessStatesToArray = (context, states) => {
304
304
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
305
305
  function getSuperdocVersion() {
306
306
  try {
307
- return "2.23.0-next.12";
307
+ return "2.23.0-next.14";
308
308
  } catch {
309
309
  return "unknown";
310
310
  }
@@ -13205,12 +13205,12 @@ var _hoisted_14$2 = {
13205
13205
  key: 0,
13206
13206
  class: "tracked-change-text"
13207
13207
  };
13208
- var _hoisted_15$1 = {
13208
+ var _hoisted_15$2 = {
13209
13209
  key: 1,
13210
13210
  class: "change-type"
13211
13211
  };
13212
- var _hoisted_16$1 = { class: "change-type" };
13213
- var _hoisted_17$1 = { key: 1 };
13212
+ var _hoisted_16$2 = { class: "change-type" };
13213
+ var _hoisted_17$2 = { key: 1 };
13214
13214
  var _hoisted_18$1 = { class: "tracked-change-text is-inserted" };
13215
13215
  var _hoisted_19$1 = { key: 2 };
13216
13216
  var _hoisted_20$1 = { class: "tracked-change-text is-inserted" };
@@ -14275,10 +14275,10 @@ var _sfc_main$34 = {
14275
14275
  class: "tracked-change-detail-line"
14276
14276
  }, [
14277
14277
  line.excerpt ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_14$2, "\"" + require__plugin_vue_export_helper.toDisplayString(line.excerpt) + "\"", 1)) : require__plugin_vue_export_helper.createCommentVNode("", true),
14278
- line.excerpt ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_15$1, " — ")) : require__plugin_vue_export_helper.createCommentVNode("", true),
14279
- require__plugin_vue_export_helper.createElementVNode("span", _hoisted_16$1, require__plugin_vue_export_helper.toDisplayString(line.label), 1)
14278
+ line.excerpt ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_15$2, " — ")) : require__plugin_vue_export_helper.createCommentVNode("", true),
14279
+ require__plugin_vue_export_helper.createElementVNode("span", _hoisted_16$2, require__plugin_vue_export_helper.toDisplayString(line.label), 1)
14280
14280
  ]);
14281
- }), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true)])) : comment.trackedChangeDisplayType === "hyperlinkAdded" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_17$1, [_cache[2] || (_cache[2] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added hyperlink ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_18$1, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "hyperlinkModified" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_19$1, [_cache[3] || (_cache[3] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Changed hyperlink to ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_20$1, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "paragraphSplit" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_21$1, [..._cache[4] || (_cache[4] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added new line", -1)])])) : comment.trackedChangeDisplayType === "tableInsert" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_22$1, [..._cache[5] || (_cache[5] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added table", -1)])])) : comment.trackedChangeDisplayType === "tableDelete" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_23$1, [..._cache[6] || (_cache[6] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Deleted table", -1)])])) : comment.trackedChangeType === "trackFormat" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_24, [_cache[7] || (_cache[7] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Format: ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_25, require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText), 1)])) : comment.trackedChangeType === "both" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_26, [
14281
+ }), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true)])) : comment.trackedChangeDisplayType === "hyperlinkAdded" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_17$2, [_cache[2] || (_cache[2] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added hyperlink ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_18$1, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "hyperlinkModified" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_19$1, [_cache[3] || (_cache[3] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Changed hyperlink to ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_20$1, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "paragraphSplit" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_21$1, [..._cache[4] || (_cache[4] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added new line", -1)])])) : comment.trackedChangeDisplayType === "tableInsert" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_22$1, [..._cache[5] || (_cache[5] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added table", -1)])])) : comment.trackedChangeDisplayType === "tableDelete" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_23$1, [..._cache[6] || (_cache[6] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Deleted table", -1)])])) : comment.trackedChangeType === "trackFormat" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_24, [_cache[7] || (_cache[7] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Format: ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_25, require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText), 1)])) : comment.trackedChangeType === "both" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_26, [
14282
14282
  _cache[8] || (_cache[8] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Replaced ", -1)),
14283
14283
  require__plugin_vue_export_helper.createElementVNode("span", _hoisted_27, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.deletedText) + "\"", 1),
14284
14284
  _cache[9] || (_cache[9] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, " with ", -1)),
@@ -18904,8 +18904,15 @@ var _hoisted_12$1 = {
18904
18904
  key: 0,
18905
18905
  class: "input-row link-buttons"
18906
18906
  };
18907
- var _hoisted_13$1 = ["innerHTML"];
18908
- var _hoisted_14$1 = {
18907
+ var _hoisted_13$1 = ["disabled"];
18908
+ var _hoisted_14$1 = ["innerHTML"];
18909
+ var _hoisted_15$1 = ["disabled"];
18910
+ var _hoisted_16$1 = {
18911
+ key: 1,
18912
+ role: "alert",
18913
+ class: "sd-error"
18914
+ };
18915
+ var _hoisted_17$1 = {
18909
18916
  key: 5,
18910
18917
  class: "input-row go-to-anchor clickable"
18911
18918
  };
@@ -18986,6 +18993,10 @@ var _sfc_main$26 = {
18986
18993
  type: Object,
18987
18994
  default: null
18988
18995
  },
18996
+ selectedText: {
18997
+ type: String,
18998
+ default: null
18999
+ },
18989
19000
  /**
18990
19001
  * Re-applies the toolbar's pre-interaction selection capture before the link
18991
19002
  * command runs. LinkInput executes the command directly (bypassing Toolbar.vue's
@@ -19006,8 +19017,11 @@ var _sfc_main$26 = {
19006
19017
  const props = __props;
19007
19018
  const { isHighContrastMode } = useHighContrastMode();
19008
19019
  const urlError = require__plugin_vue_export_helper.ref(false);
19020
+ const commandError = require__plugin_vue_export_helper.ref("");
19021
+ const isSubmitting = require__plugin_vue_export_helper.ref(false);
19009
19022
  const readSelectedText = () => {
19010
19023
  if (typeof props.hyperlinkText === "string" && props.hyperlinkText) return props.hyperlinkText;
19024
+ if (typeof props.selectedText === "string" && props.selectedText) return props.selectedText;
19011
19025
  const snapshot = props.ui?.selection?.getSnapshot?.();
19012
19026
  if (typeof snapshot?.quotedText === "string" && snapshot.quotedText) return snapshot.quotedText;
19013
19027
  const clickedText = props.clickedElement?.innerText ?? props.clickedElement?.textContent;
@@ -19038,7 +19052,7 @@ var _sfc_main$26 = {
19038
19052
  const validUrl = require__plugin_vue_export_helper.computed(() => sanitizedUrl.value !== null);
19039
19053
  const hadExistingLink = require__plugin_vue_export_helper.ref(false);
19040
19054
  const isEditing = require__plugin_vue_export_helper.computed(() => !isAnchor.value && hadExistingLink.value);
19041
- const isDisabled = require__plugin_vue_export_helper.computed(() => !validUrl.value);
19055
+ const isDisabled = require__plugin_vue_export_helper.computed(() => !validUrl.value || isSubmitting.value);
19042
19056
  const isViewingMode = require__plugin_vue_export_helper.computed(() => readDocumentMode() === "viewing");
19043
19057
  const openLink = () => {
19044
19058
  const href = sanitizedUrl.value?.href;
@@ -19057,20 +19071,36 @@ var _sfc_main$26 = {
19057
19071
  isAnchor.value = rawUrl.value.startsWith("#");
19058
19072
  if (props.showInput && !isViewingMode.value) focusInput();
19059
19073
  });
19060
- const runLinkCommand = (payload) => {
19074
+ const runLinkCommand = async (payload) => {
19061
19075
  const ui = props.ui;
19062
- if (!ui?.commands?.execute) return false;
19076
+ if (!ui?.commands?.executeAsync) return false;
19063
19077
  props.restoreSelection?.();
19064
- return ui.commands.execute("link", payload);
19078
+ return require_create_super_doc_ui.executeFirstPartyCommandAsync(ui, "link", payload);
19065
19079
  };
19066
- const handleSubmit = () => {
19067
- if (isViewingMode.value) return;
19080
+ const applyLinkCommand = async (payload) => {
19081
+ if (isSubmitting.value) return;
19082
+ isSubmitting.value = true;
19083
+ commandError.value = "";
19084
+ try {
19085
+ const result = await runLinkCommand(payload);
19086
+ if (result === false || result == null || typeof result === "object" && (result.success === false || result.status === "rejected")) {
19087
+ commandError.value = "Could not apply link. Check the selection and try again.";
19088
+ return;
19089
+ }
19090
+ props.closePopover();
19091
+ } catch {
19092
+ commandError.value = "Could not apply link. Check the selection and try again.";
19093
+ } finally {
19094
+ isSubmitting.value = false;
19095
+ }
19096
+ };
19097
+ const handleSubmit = async () => {
19098
+ if (isViewingMode.value || isSubmitting.value) return;
19068
19099
  if (!rawUrl.value) {
19069
- runLinkCommand({
19100
+ await applyLinkCommand({
19070
19101
  href: null,
19071
19102
  hyperlinkTarget: props.hyperlinkTarget
19072
19103
  });
19073
- props.closePopover();
19074
19104
  return;
19075
19105
  }
19076
19106
  if (!validUrl.value) {
@@ -19089,23 +19119,22 @@ var _sfc_main$26 = {
19089
19119
  textTarget: props.textTarget
19090
19120
  };
19091
19121
  if (text.value) payload.text = text.value;
19092
- else if (!isEditing.value) payload.text = href;
19093
- runLinkCommand(payload);
19094
- props.closePopover();
19122
+ else if (!isEditing.value && !props.textTarget) payload.text = href;
19123
+ await applyLinkCommand(payload);
19095
19124
  };
19096
- const handleRemove = () => {
19097
- runLinkCommand({
19125
+ const handleRemove = async () => {
19126
+ if (isViewingMode.value || isSubmitting.value) return;
19127
+ await applyLinkCommand({
19098
19128
  href: null,
19099
19129
  hyperlinkTarget: props.hyperlinkTarget
19100
19130
  });
19101
- props.closePopover();
19102
19131
  };
19103
19132
  const navigateToAnchor = (anchorUrl) => {
19104
19133
  if (props.goToAnchor) props.goToAnchor(anchorUrl);
19105
19134
  };
19106
19135
  return (_ctx, _cache) => {
19107
19136
  return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", { class: require__plugin_vue_export_helper.normalizeClass(["link-input-ctn", { "high-contrast": require__plugin_vue_export_helper.unref(isHighContrastMode) }]) }, [isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$20, "Page anchor")) : isViewingMode.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_2$16, "Link details")) : isEditing.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_3$13, "Edit link")) : (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_4$8, "Add link")), __props.showInput && !isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_5$6, [
19108
- require__plugin_vue_export_helper.createElementVNode("div", _hoisted_6$5, [_cache[4] || (_cache[4] = require__plugin_vue_export_helper.createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)), require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("input", {
19137
+ require__plugin_vue_export_helper.createElementVNode("div", _hoisted_6$5, [_cache[5] || (_cache[5] = require__plugin_vue_export_helper.createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)), require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("input", {
19109
19138
  type: "text",
19110
19139
  name: "text",
19111
19140
  placeholder: "Text",
@@ -19125,7 +19154,8 @@ var _sfc_main$26 = {
19125
19154
  class: require__plugin_vue_export_helper.normalizeClass({ "sd-error": urlError.value }),
19126
19155
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => rawUrl.value = $event),
19127
19156
  readonly: isViewingMode.value,
19128
- onKeydown: [require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"]), _cache[2] || (_cache[2] = ($event) => urlError.value = false)]
19157
+ onInput: _cache[2] || (_cache[2] = ($event) => commandError.value = ""),
19158
+ onKeydown: [require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"]), _cache[3] || (_cache[3] = ($event) => urlError.value = false)]
19129
19159
  }, null, 42, _hoisted_10$2), [[require__plugin_vue_export_helper.vModelText, rawUrl.value]]),
19130
19160
  require__plugin_vue_export_helper.createElementVNode("div", {
19131
19161
  class: require__plugin_vue_export_helper.normalizeClass(["open-link-icon", { "sd-disabled": !validUrl.value }]),
@@ -19138,20 +19168,23 @@ var _sfc_main$26 = {
19138
19168
  key: 0,
19139
19169
  class: "remove-btn",
19140
19170
  onClick: handleRemove,
19171
+ disabled: isSubmitting.value,
19141
19172
  "data-item": "btn-link-remove"
19142
19173
  }, [require__plugin_vue_export_helper.createElementVNode("div", {
19143
19174
  class: "remove-btn__icon",
19144
19175
  innerHTML: require__plugin_vue_export_helper.unref(toolbarIcons).removeLink
19145
- }, null, 8, _hoisted_13$1), _cache[5] || (_cache[5] = require__plugin_vue_export_helper.createTextVNode(" Remove ", -1))])) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("button", {
19176
+ }, null, 8, _hoisted_14$1), _cache[6] || (_cache[6] = require__plugin_vue_export_helper.createTextVNode(" Remove ", -1))], 8, _hoisted_13$1)) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("button", {
19146
19177
  class: require__plugin_vue_export_helper.normalizeClass(["sd-submit-btn", { "disable-btn": isDisabled.value }]),
19147
19178
  onClick: handleSubmit,
19179
+ disabled: isSubmitting.value,
19148
19180
  "data-item": "btn-link-apply"
19149
- }, " Apply ", 2)])) : require__plugin_vue_export_helper.createCommentVNode("", true)
19150
- ])) : isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_14$1, [require__plugin_vue_export_helper.createElementVNode("a", { onClick: _cache[3] || (_cache[3] = require__plugin_vue_export_helper.withModifiers(($event) => navigateToAnchor(rawUrl.value), ["stop", "prevent"])) }, "Go to " + require__plugin_vue_export_helper.toDisplayString(rawUrl.value.startsWith("#_") ? rawUrl.value.substring(2) : rawUrl.value), 1)])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 2);
19181
+ }, " Apply ", 10, _hoisted_15$1)])) : require__plugin_vue_export_helper.createCommentVNode("", true),
19182
+ commandError.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_16$1, require__plugin_vue_export_helper.toDisplayString(commandError.value), 1)) : require__plugin_vue_export_helper.createCommentVNode("", true)
19183
+ ])) : isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_17$1, [require__plugin_vue_export_helper.createElementVNode("a", { onClick: _cache[4] || (_cache[4] = require__plugin_vue_export_helper.withModifiers(($event) => navigateToAnchor(rawUrl.value), ["stop", "prevent"])) }, "Go to " + require__plugin_vue_export_helper.toDisplayString(rawUrl.value.startsWith("#_") ? rawUrl.value.substring(2) : rawUrl.value), 1)])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 2);
19151
19184
  };
19152
19185
  }
19153
19186
  };
19154
- var LinkInput_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$26, [["__scopeId", "data-v-3e4bd44e"]]);
19187
+ var LinkInput_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$26, [["__scopeId", "data-v-498a6e6e"]]);
19155
19188
  //#endregion
19156
19189
  //#region src/internal/toolbar/built-in/scroll-helpers.js
19157
19190
  function getScrollableParent(element) {
@@ -22247,6 +22280,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
22247
22280
  return () => {
22248
22281
  const linkItem = toolbar.getToolbarItemByName("link");
22249
22282
  if (!linkItem || linkItem.disabled?.value === true) return;
22283
+ toolbar.pendingSelectionCapture = toolbar.ui?.selection?.capture?.() ?? null;
22250
22284
  if (linkItem.expand && typeof linkItem.expand === "object" && "value" in linkItem.expand) linkItem.expand.value = true;
22251
22285
  toolbar.updateToolbarState?.();
22252
22286
  };
@@ -24609,7 +24643,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24609
24643
  ], 38);
24610
24644
  };
24611
24645
  }
24612
- }, [["__scopeId", "data-v-3a8bc935"]]);
24646
+ }, [["__scopeId", "data-v-f53aafe0"]]);
24613
24647
  //#endregion
24614
24648
  //#region src/core/create-app.js
24615
24649
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -43981,16 +44015,18 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
43981
44015
  }
43982
44016
  });
43983
44017
  function renderLinkDropdown(link) {
43984
- const selection = currentSelectionSnapshot(superToolbar);
43985
- const selectionTarget = selection?.selectionTarget ?? selectionTargetFromTextTarget(selection?.target);
44018
+ const capture = superToolbar.pendingSelectionCapture;
44019
+ const liveSelection = currentSelectionSnapshot(superToolbar);
44020
+ const selection = liveSelection?.quotedText && JSON.stringify(liveSelection.selectionTarget ?? liveSelection.target) !== JSON.stringify(capture?.selectionTarget ?? capture?.target) ? liveSelection : capture ?? liveSelection;
44021
+ const selectionTarget = selection?.selectionTarget ?? selectionTargetFromTextTarget(selection?.target) ?? selection?.target;
43986
44022
  const restoreSelection = () => {
43987
- const capture = superToolbar.pendingSelectionCapture;
43988
- if (capture && typeof superToolbar.ui?.selection?.restore === "function") superToolbar.ui.selection.restore(capture);
44023
+ if (selection === capture && typeof superToolbar.ui?.selection?.restore === "function") superToolbar.ui.selection.restore(capture);
43989
44024
  };
43990
44025
  return require__plugin_vue_export_helper.h("div", {}, [require__plugin_vue_export_helper.h(LinkInput_default, {
43991
44026
  ui: superToolbar.ui,
43992
44027
  linkItem: link,
43993
44028
  textTarget: selectionTarget,
44029
+ selectedText: selection?.quotedText ?? null,
43994
44030
  restoreSelection,
43995
44031
  closePopover: () => {
43996
44032
  closeDropdown(link);
@@ -46433,7 +46469,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
46433
46469
  }
46434
46470
  this.userColorMap = /* @__PURE__ */ new Map();
46435
46471
  this.colorIndex = 0;
46436
- this.version = "2.23.0-next.12";
46472
+ this.version = "2.23.0-next.14";
46437
46473
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46438
46474
  this.superdocId = config.superdocId || require_uuid.v4();
46439
46475
  this.colors = this.config.colors ?? [];