@superdoc-dev/cli 0.17.0-next.5 → 0.17.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +50 -10
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -233498,7 +233498,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
233498
233498
  init_remark_gfm_BhnWr3yf_es();
233499
233499
  });
233500
233500
 
233501
- // ../../packages/superdoc/dist/chunks/src-Btvk6jT1.es.js
233501
+ // ../../packages/superdoc/dist/chunks/src-BKOC1-8-.es.js
233502
233502
  function deleteProps(obj, propOrProps) {
233503
233503
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
233504
233504
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -285675,9 +285675,28 @@ function computeDomCaretPageLocal(options, pos) {
285675
285675
  const boundary = resolveTextBoundaryInElement(targetEl, pos, entry.pmStart, entry.pmEnd, "forward");
285676
285676
  if (!boundary) {
285677
285677
  const elRect = targetEl.getBoundingClientRect();
285678
+ if (targetEl.classList.contains("superdoc-line")) {
285679
+ const paddingLeft = parseFloat(targetEl.style.paddingLeft) || 0;
285680
+ const paddingRight = parseFloat(targetEl.style.paddingRight) || 0;
285681
+ const lineLeft = (elRect.left - pageRect.left) / zoom + paddingLeft;
285682
+ const lineRight = (elRect.right - pageRect.left) / zoom - paddingRight;
285683
+ const textAlign = targetEl.style.textAlign;
285684
+ let x;
285685
+ if (textAlign === "center")
285686
+ x = (lineLeft + lineRight) / 2;
285687
+ else if (textAlign === "right")
285688
+ x = lineRight;
285689
+ else
285690
+ x = lineLeft;
285691
+ return {
285692
+ pageIndex: Number(page.dataset.pageIndex ?? "0"),
285693
+ x,
285694
+ y: (elRect.top - pageRect.top) / zoom
285695
+ };
285696
+ }
285678
285697
  const isEmptySdtPlaceholder = targetEl.classList.contains("superdoc-empty-sdt-placeholder") || targetEl.classList.contains("superdoc-empty-inline-sdt-placeholder") || targetEl.classList.contains("superdoc-empty-block-sdt-placeholder");
285679
285698
  const atEnd = isEmptySdtPlaceholder ? pos > entry.pmEnd : pos >= entry.pmEnd;
285680
- const yRect = (isEmptySdtPlaceholder ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
285699
+ const yRect = (isEmptySdtPlaceholder || targetEl.classList.contains("superdoc-tab") ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
285681
285700
  return {
285682
285701
  pageIndex: Number(page.dataset.pageIndex ?? "0"),
285683
285702
  x: ((atEnd ? elRect.right : elRect.left) - pageRect.left) / zoom,
@@ -330940,7 +330959,7 @@ menclose::after {
330940
330959
  return;
330941
330960
  console.log(...args$1);
330942
330961
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
330943
- var init_src_Btvk6jT1_es = __esm(() => {
330962
+ var init_src_BKOC1_8_es = __esm(() => {
330944
330963
  init_rolldown_runtime_Bg48TavK_es();
330945
330964
  init_SuperConverter_BaKhr4cp_es();
330946
330965
  init_jszip_C49i9kUs_es();
@@ -352189,7 +352208,8 @@ function print() { __p += __j.call(arguments, '') }
352189
352208
  const menuRef = exports_vue.ref(null);
352190
352209
  const menuPosition = exports_vue.ref({
352191
352210
  top: "0px",
352192
- left: "0px"
352211
+ left: "0px",
352212
+ maxHeight: "none"
352193
352213
  });
352194
352214
  const optionRefs = exports_vue.ref([]);
352195
352215
  const keyboardIndex = exports_vue.ref(-1);
@@ -352226,6 +352246,7 @@ function print() { __p += __j.call(arguments, '') }
352226
352246
  position: "fixed",
352227
352247
  top: menuPosition.value.top,
352228
352248
  left: menuPosition.value.left,
352249
+ maxHeight: menuPosition.value.maxHeight,
352229
352250
  zIndex: 2000
352230
352251
  };
352231
352252
  });
@@ -352241,17 +352262,30 @@ function print() { __p += __j.call(arguments, '') }
352241
352262
  if (!triggerRef.value)
352242
352263
  return;
352243
352264
  const rect = triggerRef.value.getBoundingClientRect();
352244
- const menuWidth = menuRef.value?.offsetWidth ?? 0;
352265
+ const menuEl = menuRef.value;
352266
+ const menuWidth = menuEl?.offsetWidth ?? 0;
352267
+ const menuHeight = menuEl?.scrollHeight ?? menuEl?.offsetHeight ?? 0;
352245
352268
  const viewportWidth = window.innerWidth || document.documentElement.clientWidth || 0;
352269
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
352246
352270
  const gutter = 8;
352271
+ const gap = 4;
352272
+ const belowTop = rect.bottom + gap;
352273
+ const aboveBottom = rect.top - gap;
352274
+ const availableBelow = Math.max(0, viewportHeight - belowTop - gutter);
352275
+ const availableAbove = Math.max(0, aboveBottom - gutter);
352276
+ const openAbove = availableBelow < menuHeight && availableAbove > availableBelow;
352277
+ const maxHeight = openAbove ? availableAbove : availableBelow;
352278
+ const menuRenderHeight = menuHeight ? Math.min(menuHeight, maxHeight) : maxHeight;
352279
+ const top$1 = openAbove ? Math.max(gutter, aboveBottom - menuRenderHeight) : belowTop;
352247
352280
  let left$1 = rect.left;
352248
352281
  if (props.placement === "bottom-end")
352249
352282
  left$1 = rect.right - menuWidth;
352250
352283
  const maxLeft = Math.max(gutter, viewportWidth - menuWidth - gutter);
352251
352284
  left$1 = Math.min(Math.max(gutter, left$1), maxLeft);
352252
352285
  menuPosition.value = {
352253
- top: `${rect.bottom + 4}px`,
352254
- left: `${left$1}px`
352286
+ top: `${top$1}px`,
352287
+ left: `${left$1}px`,
352288
+ maxHeight: `${maxHeight}px`
352255
352289
  };
352256
352290
  };
352257
352291
  const onTriggerClick = () => {
@@ -352317,8 +352351,13 @@ function print() { __p += __j.call(arguments, '') }
352317
352351
  el.setAttribute("tabindex", index2 === keyboardIndex.value ? "0" : "-1");
352318
352352
  });
352319
352353
  const target = optionRefs.value[keyboardIndex.value];
352320
- if (target && typeof target.focus === "function")
352354
+ if (target && typeof target.focus === "function") {
352321
352355
  target.focus();
352356
+ target.scrollIntoView?.({
352357
+ block: "nearest",
352358
+ inline: "nearest"
352359
+ });
352360
+ }
352322
352361
  };
352323
352362
  const moveKeyboardIndex = (direction) => {
352324
352363
  const navigableIndexes = getNavigableIndexes();
@@ -352453,6 +352492,7 @@ function print() { __p += __j.call(arguments, '') }
352453
352492
  if (hasRenderOptions.value)
352454
352493
  return;
352455
352494
  keyboardIndex.value = getInitialKeyboardIndex();
352495
+ await exports_vue.nextTick();
352456
352496
  focusKeyboardIndex();
352457
352497
  }, { immediate: true });
352458
352498
  exports_vue.watch(isOpen, (open2) => {
@@ -352516,7 +352556,7 @@ function print() { __p += __j.call(arguments, '') }
352516
352556
  })]))]);
352517
352557
  };
352518
352558
  }
352519
- }, [["__scopeId", "data-v-302f7d86"]]);
352559
+ }, [["__scopeId", "data-v-69732782"]]);
352520
352560
  SdTooltip_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
352521
352561
  __name: "SdTooltip",
352522
352562
  props: {
@@ -366193,7 +366233,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
366193
366233
 
366194
366234
  // ../../packages/superdoc/dist/super-editor.es.js
366195
366235
  var init_super_editor_es = __esm(() => {
366196
- init_src_Btvk6jT1_es();
366236
+ init_src_BKOC1_8_es();
366197
366237
  init_SuperConverter_BaKhr4cp_es();
366198
366238
  init_jszip_C49i9kUs_es();
366199
366239
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.17.0-next.5",
3
+ "version": "0.17.0-next.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -33,11 +33,11 @@
33
33
  "access": "public"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@superdoc-dev/cli-darwin-arm64": "0.17.0-next.5",
37
- "@superdoc-dev/cli-darwin-x64": "0.17.0-next.5",
38
- "@superdoc-dev/cli-linux-x64": "0.17.0-next.5",
39
- "@superdoc-dev/cli-linux-arm64": "0.17.0-next.5",
40
- "@superdoc-dev/cli-windows-x64": "0.17.0-next.5"
36
+ "@superdoc-dev/cli-darwin-arm64": "0.17.0-next.7",
37
+ "@superdoc-dev/cli-darwin-x64": "0.17.0-next.7",
38
+ "@superdoc-dev/cli-linux-arm64": "0.17.0-next.7",
39
+ "@superdoc-dev/cli-linux-x64": "0.17.0-next.7",
40
+ "@superdoc-dev/cli-windows-x64": "0.17.0-next.7"
41
41
  },
42
42
  "scripts": {
43
43
  "predev": "node scripts/ensure-superdoc-build.js",