@superdoc-dev/cli 0.2.0-next.94 → 0.2.0-next.96

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 +31 -15
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -121914,9 +121914,9 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
121914
121914
  init_remark_gfm_z_sDF4ss_es();
121915
121915
  });
121916
121916
 
121917
- // ../../packages/superdoc/dist/chunks/src-CS_uXP_L.es.js
121918
- var exports_src_CS_uXP_L_es = {};
121919
- __export(exports_src_CS_uXP_L_es, {
121917
+ // ../../packages/superdoc/dist/chunks/src-t9dN6Uuh.es.js
121918
+ var exports_src_t9dN6Uuh_es = {};
121919
+ __export(exports_src_t9dN6Uuh_es, {
121920
121920
  zt: () => defineMark,
121921
121921
  z: () => cM,
121922
121922
  yt: () => removeAwarenessStates,
@@ -150141,8 +150141,10 @@ function hydrateImageBlocks(blocks2, mediaFiles) {
150141
150141
  const normalizedMedia = /* @__PURE__ */ new Map;
150142
150142
  Object.entries(mediaFiles).forEach(([key$1, value]) => {
150143
150143
  const normalized = normalizeMediaKey(key$1);
150144
- if (normalized)
150145
- normalizedMedia.set(normalized, value);
150144
+ if (normalized) {
150145
+ const stringValue = value instanceof Uint8Array ? new TextDecoder().decode(value) : value;
150146
+ normalizedMedia.set(normalized, stringValue);
150147
+ }
150146
150148
  });
150147
150149
  if (normalizedMedia.size === 0)
150148
150150
  return blocks2;
@@ -199182,7 +199184,7 @@ var Node$13 = class Node$14 {
199182
199184
  trackedChanges: context.trackedChanges ?? []
199183
199185
  });
199184
199186
  }, _hoisted_1$6, _hoisted_2$2, _hoisted_3, _hoisted_4, ContextMenu_default, _hoisted_1$5, BasicUpload_default, _hoisted_1$4, MIN_WIDTH = 200, PPI = 96, alignment = "flex-end", Ruler_default, GenericPopover_default, _hoisted_1$3, _hoisted_2$1, RESIZE_HANDLE_WIDTH_PX = 9, RESIZE_HANDLE_HEIGHT_PX = 9, RESIZE_HANDLE_OFFSET_PX = 4, DRAG_OVERLAY_EXTENSION_PX = 1000, MIN_DRAG_OVERLAY_WIDTH_PX = 2000, THROTTLE_INTERVAL_MS = 16, MIN_RESIZE_DELTA_PX = 1, TableResizeOverlay_default, _hoisted_1$2, OVERLAY_EXPANSION_PX = 2000, RESIZE_HANDLE_SIZE_PX = 12, MOUSE_MOVE_THROTTLE_MS = 16, DIMENSION_CHANGE_THRESHOLD_PX = 1, Z_INDEX_OVERLAY = 10, Z_INDEX_HANDLE = 15, Z_INDEX_GUIDELINE = 20, ImageResizeOverlay_default, LINK_CLICK_DEBOUNCE_MS = 300, CURSOR_UPDATE_TIMEOUT_MS = 10, POPOVER_VERTICAL_OFFSET_PX = 15, LinkClickHandler_default, _hoisted_1$1, _hoisted_2, DOCX2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", TABLE_RESIZE_HOVER_THRESHOLD = 8, TABLE_RESIZE_THROTTLE_MS = 16, SuperEditor_default, _hoisted_1, SuperInput_default, SlashMenu, Extensions;
199185
- var init_src_CS_uXP_L_es = __esm(() => {
199187
+ var init_src_t9dN6Uuh_es = __esm(() => {
199186
199188
  init_rolldown_runtime_B2q5OVn9_es();
199187
199189
  init_SuperConverter_6i_hCnOE_es();
199188
199190
  init_jszip_ChlR43oI_es();
@@ -213892,6 +213894,7 @@ function print() { __p += __j.call(arguments, '') }
213892
213894
  this.mount.insertBefore(this.virtualPagesEl, this.bottomSpacerEl);
213893
213895
  this.mount.appendChild(this.bottomSpacerEl);
213894
213896
  let prevIndex = null;
213897
+ let cursor = this.virtualPagesEl.firstChild;
213895
213898
  for (const idx of mounted) {
213896
213899
  if (prevIndex != null && idx > prevIndex + 1) {
213897
213900
  const gap = this.doc.createElement("div");
@@ -213901,10 +213904,13 @@ function print() { __p += __j.call(arguments, '') }
213901
213904
  const gapHeight = this.topOfIndex(idx) - this.topOfIndex(prevIndex) - this.virtualHeights[prevIndex] - this.virtualGap * 2;
213902
213905
  gap.style.height = `${Math.max(0, Math.floor(gapHeight))}px`;
213903
213906
  this.virtualGapSpacers.push(gap);
213904
- this.virtualPagesEl.appendChild(gap);
213907
+ this.virtualPagesEl.insertBefore(gap, cursor);
213905
213908
  }
213906
213909
  const state = this.pageIndexToState.get(idx);
213907
- this.virtualPagesEl.appendChild(state.element);
213910
+ if (state.element === cursor)
213911
+ cursor = state.element.nextSibling;
213912
+ else
213913
+ this.virtualPagesEl.insertBefore(state.element, cursor);
213908
213914
  prevIndex = idx;
213909
213915
  }
213910
213916
  this.changedBlocks.clear();
@@ -219318,12 +219324,22 @@ function print() { __p += __j.call(arguments, '') }
219318
219324
  return;
219319
219325
  this.#pendingDocChange = false;
219320
219326
  this.#isRerendering = true;
219327
+ const activeHfEditor = (this.#headerFooterSession?.session?.mode ?? "body") !== "body" ? this.#headerFooterSession?.activeEditor : null;
219328
+ const hadHfFocus = activeHfEditor?.view?.hasFocus?.() ?? false;
219321
219329
  try {
219322
219330
  await this.#rerender();
219323
219331
  } finally {
219324
219332
  this.#isRerendering = false;
219325
219333
  if (this.#pendingDocChange)
219326
219334
  this.#scheduleRerender();
219335
+ if (hadHfFocus && activeHfEditor?.view && this.#headerFooterSession?.activeEditor === activeHfEditor) {
219336
+ const doc$2 = this.#visibleHost.ownerDocument;
219337
+ const editorDom = activeHfEditor.view.dom;
219338
+ if (doc$2 && !editorDom.contains(doc$2.activeElement))
219339
+ try {
219340
+ activeHfEditor.view.focus();
219341
+ } catch {}
219342
+ }
219327
219343
  }
219328
219344
  }
219329
219345
  async#rerender() {
@@ -230919,8 +230935,8 @@ function print() { __p += __j.call(arguments, '') }
230919
230935
  return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
230920
230936
  };
230921
230937
  stubFalse_default = stubFalse;
230922
- freeExports$2 = typeof exports_src_CS_uXP_L_es == "object" && exports_src_CS_uXP_L_es && !exports_src_CS_uXP_L_es.nodeType && exports_src_CS_uXP_L_es;
230923
- freeModule$2 = freeExports$2 && typeof module_src_CS_uXP_L_es == "object" && module_src_CS_uXP_L_es && !module_src_CS_uXP_L_es.nodeType && module_src_CS_uXP_L_es;
230938
+ freeExports$2 = typeof exports_src_t9dN6Uuh_es == "object" && exports_src_t9dN6Uuh_es && !exports_src_t9dN6Uuh_es.nodeType && exports_src_t9dN6Uuh_es;
230939
+ freeModule$2 = freeExports$2 && typeof module_src_t9dN6Uuh_es == "object" && module_src_t9dN6Uuh_es && !module_src_t9dN6Uuh_es.nodeType && module_src_t9dN6Uuh_es;
230924
230940
  Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
230925
230941
  isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
230926
230942
  typedArrayTags = {};
@@ -230928,8 +230944,8 @@ function print() { __p += __j.call(arguments, '') }
230928
230944
  typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
230929
230945
  _baseIsTypedArray_default = baseIsTypedArray;
230930
230946
  _baseUnary_default = baseUnary;
230931
- freeExports$1 = typeof exports_src_CS_uXP_L_es == "object" && exports_src_CS_uXP_L_es && !exports_src_CS_uXP_L_es.nodeType && exports_src_CS_uXP_L_es;
230932
- freeModule$1 = freeExports$1 && typeof module_src_CS_uXP_L_es == "object" && module_src_CS_uXP_L_es && !module_src_CS_uXP_L_es.nodeType && module_src_CS_uXP_L_es;
230947
+ freeExports$1 = typeof exports_src_t9dN6Uuh_es == "object" && exports_src_t9dN6Uuh_es && !exports_src_t9dN6Uuh_es.nodeType && exports_src_t9dN6Uuh_es;
230948
+ freeModule$1 = freeExports$1 && typeof module_src_t9dN6Uuh_es == "object" && module_src_t9dN6Uuh_es && !module_src_t9dN6Uuh_es.nodeType && module_src_t9dN6Uuh_es;
230933
230949
  freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
230934
230950
  _nodeUtil_default = function() {
230935
230951
  try {
@@ -231034,8 +231050,8 @@ function print() { __p += __j.call(arguments, '') }
231034
231050
  Stack.prototype.has = _stackHas_default;
231035
231051
  Stack.prototype.set = _stackSet_default;
231036
231052
  _Stack_default = Stack;
231037
- freeExports = typeof exports_src_CS_uXP_L_es == "object" && exports_src_CS_uXP_L_es && !exports_src_CS_uXP_L_es.nodeType && exports_src_CS_uXP_L_es;
231038
- freeModule = freeExports && typeof module_src_CS_uXP_L_es == "object" && module_src_CS_uXP_L_es && !module_src_CS_uXP_L_es.nodeType && module_src_CS_uXP_L_es;
231053
+ freeExports = typeof exports_src_t9dN6Uuh_es == "object" && exports_src_t9dN6Uuh_es && !exports_src_t9dN6Uuh_es.nodeType && exports_src_t9dN6Uuh_es;
231054
+ freeModule = freeExports && typeof module_src_t9dN6Uuh_es == "object" && module_src_t9dN6Uuh_es && !module_src_t9dN6Uuh_es.nodeType && module_src_t9dN6Uuh_es;
231039
231055
  Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
231040
231056
  allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
231041
231057
  _cloneBuffer_default = cloneBuffer;
@@ -239115,7 +239131,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
239115
239131
 
239116
239132
  // ../../packages/superdoc/dist/super-editor.es.js
239117
239133
  var init_super_editor_es = __esm(() => {
239118
- init_src_CS_uXP_L_es();
239134
+ init_src_t9dN6Uuh_es();
239119
239135
  init_SuperConverter_6i_hCnOE_es();
239120
239136
  init_jszip_ChlR43oI_es();
239121
239137
  init_xml_js_DLE8mr0n_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.2.0-next.94",
3
+ "version": "0.2.0-next.96",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -21,20 +21,20 @@
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
23
  "@superdoc/document-api": "0.0.1",
24
- "@superdoc/super-editor": "0.0.1",
24
+ "@superdoc/pm-adapter": "0.0.0",
25
25
  "superdoc": "1.17.0",
26
- "@superdoc/pm-adapter": "0.0.0"
26
+ "@superdoc/super-editor": "0.0.1"
27
27
  },
28
28
  "module": "src/index.ts",
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.94",
34
- "@superdoc-dev/cli-darwin-x64": "0.2.0-next.94",
35
- "@superdoc-dev/cli-linux-x64": "0.2.0-next.94",
36
- "@superdoc-dev/cli-linux-arm64": "0.2.0-next.94",
37
- "@superdoc-dev/cli-windows-x64": "0.2.0-next.94"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.96",
34
+ "@superdoc-dev/cli-darwin-x64": "0.2.0-next.96",
35
+ "@superdoc-dev/cli-linux-arm64": "0.2.0-next.96",
36
+ "@superdoc-dev/cli-windows-x64": "0.2.0-next.96",
37
+ "@superdoc-dev/cli-linux-x64": "0.2.0-next.96"
38
38
  },
39
39
  "scripts": {
40
40
  "dev": "bun run src/index.ts",