@superdoc-dev/cli 0.2.0-next.113 → 0.2.0-next.114

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 +47 -16
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -134600,9 +134600,9 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
134600
134600
  init_remark_gfm_z_sDF4ss_es();
134601
134601
  });
134602
134602
 
134603
- // ../../packages/superdoc/dist/chunks/src-CR6Zd30p.es.js
134604
- var exports_src_CR6Zd30p_es = {};
134605
- __export(exports_src_CR6Zd30p_es, {
134603
+ // ../../packages/superdoc/dist/chunks/src-D6a7JHkJ.es.js
134604
+ var exports_src_D6a7JHkJ_es = {};
134605
+ __export(exports_src_D6a7JHkJ_es, {
134606
134606
  zt: () => defineMark,
134607
134607
  z: () => cM,
134608
134608
  yt: () => Awareness,
@@ -226025,7 +226025,7 @@ var Node$13 = class Node$14 {
226025
226025
  trackedChanges: context.trackedChanges ?? []
226026
226026
  });
226027
226027
  }, _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;
226028
- var init_src_CR6Zd30p_es = __esm(() => {
226028
+ var init_src_D6a7JHkJ_es = __esm(() => {
226029
226029
  init_rolldown_runtime_B2q5OVn9_es();
226030
226030
  init_SuperConverter_BZ7c2IuL_es();
226031
226031
  init_jszip_ChlR43oI_es();
@@ -259545,8 +259545,8 @@ function print() { __p += __j.call(arguments, '') }
259545
259545
  return isObjectLike_default(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
259546
259546
  };
259547
259547
  stubFalse_default = stubFalse;
259548
- freeExports$2 = typeof exports_src_CR6Zd30p_es == "object" && exports_src_CR6Zd30p_es && !exports_src_CR6Zd30p_es.nodeType && exports_src_CR6Zd30p_es;
259549
- freeModule$2 = freeExports$2 && typeof module_src_CR6Zd30p_es == "object" && module_src_CR6Zd30p_es && !module_src_CR6Zd30p_es.nodeType && module_src_CR6Zd30p_es;
259548
+ freeExports$2 = typeof exports_src_D6a7JHkJ_es == "object" && exports_src_D6a7JHkJ_es && !exports_src_D6a7JHkJ_es.nodeType && exports_src_D6a7JHkJ_es;
259549
+ freeModule$2 = freeExports$2 && typeof module_src_D6a7JHkJ_es == "object" && module_src_D6a7JHkJ_es && !module_src_D6a7JHkJ_es.nodeType && module_src_D6a7JHkJ_es;
259550
259550
  Buffer$1 = freeModule$2 && freeModule$2.exports === freeExports$2 ? _root_default.Buffer : undefined;
259551
259551
  isBuffer_default = (Buffer$1 ? Buffer$1.isBuffer : undefined) || stubFalse_default;
259552
259552
  typedArrayTags = {};
@@ -259554,8 +259554,8 @@ function print() { __p += __j.call(arguments, '') }
259554
259554
  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;
259555
259555
  _baseIsTypedArray_default = baseIsTypedArray;
259556
259556
  _baseUnary_default = baseUnary;
259557
- freeExports$1 = typeof exports_src_CR6Zd30p_es == "object" && exports_src_CR6Zd30p_es && !exports_src_CR6Zd30p_es.nodeType && exports_src_CR6Zd30p_es;
259558
- freeModule$1 = freeExports$1 && typeof module_src_CR6Zd30p_es == "object" && module_src_CR6Zd30p_es && !module_src_CR6Zd30p_es.nodeType && module_src_CR6Zd30p_es;
259557
+ freeExports$1 = typeof exports_src_D6a7JHkJ_es == "object" && exports_src_D6a7JHkJ_es && !exports_src_D6a7JHkJ_es.nodeType && exports_src_D6a7JHkJ_es;
259558
+ freeModule$1 = freeExports$1 && typeof module_src_D6a7JHkJ_es == "object" && module_src_D6a7JHkJ_es && !module_src_D6a7JHkJ_es.nodeType && module_src_D6a7JHkJ_es;
259559
259559
  freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && _freeGlobal_default.process;
259560
259560
  _nodeUtil_default = function() {
259561
259561
  try {
@@ -259660,8 +259660,8 @@ function print() { __p += __j.call(arguments, '') }
259660
259660
  Stack.prototype.has = _stackHas_default;
259661
259661
  Stack.prototype.set = _stackSet_default;
259662
259662
  _Stack_default = Stack;
259663
- freeExports = typeof exports_src_CR6Zd30p_es == "object" && exports_src_CR6Zd30p_es && !exports_src_CR6Zd30p_es.nodeType && exports_src_CR6Zd30p_es;
259664
- freeModule = freeExports && typeof module_src_CR6Zd30p_es == "object" && module_src_CR6Zd30p_es && !module_src_CR6Zd30p_es.nodeType && module_src_CR6Zd30p_es;
259663
+ freeExports = typeof exports_src_D6a7JHkJ_es == "object" && exports_src_D6a7JHkJ_es && !exports_src_D6a7JHkJ_es.nodeType && exports_src_D6a7JHkJ_es;
259664
+ freeModule = freeExports && typeof module_src_D6a7JHkJ_es == "object" && module_src_D6a7JHkJ_es && !module_src_D6a7JHkJ_es.nodeType && module_src_D6a7JHkJ_es;
259665
259665
  Buffer4 = freeModule && freeModule.exports === freeExports ? _root_default.Buffer : undefined;
259666
259666
  allocUnsafe = Buffer4 ? Buffer4.allocUnsafe : undefined;
259667
259667
  _cloneBuffer_default = cloneBuffer;
@@ -267218,6 +267218,26 @@ function print() { __p += __j.call(arguments, '') }
267218
267218
  });
267219
267219
  }
267220
267220
  };
267221
+ const waitForCollaborativeFragmentSettling = async (ydoc, maxWaitMs = 200) => {
267222
+ const fragment2 = ydoc.getXmlFragment("supereditor");
267223
+ if (fragment2.length > 0)
267224
+ return fragment2;
267225
+ await new Promise((resolve4) => {
267226
+ const timeout$1 = setTimeout(() => {
267227
+ fragment2.unobserve?.(observer);
267228
+ resolve4();
267229
+ }, maxWaitMs);
267230
+ const observer = () => {
267231
+ if (fragment2.length <= 0)
267232
+ return;
267233
+ clearTimeout(timeout$1);
267234
+ fragment2.unobserve?.(observer);
267235
+ resolve4();
267236
+ };
267237
+ fragment2.observe?.(observer);
267238
+ });
267239
+ return fragment2;
267240
+ };
267221
267241
  const initializeData = async () => {
267222
267242
  if (props.fileSource) {
267223
267243
  let fileData = await loadNewFileData();
@@ -267248,14 +267268,25 @@ function print() { __p += __j.call(arguments, '') }
267248
267268
  };
267249
267269
  waitForSync().then(async () => {
267250
267270
  const partsMap = ydoc.getMap("parts");
267251
- const fragment2 = ydoc.getXmlFragment("supereditor");
267252
267271
  const metaMap = ydoc.getMap("meta");
267253
- const hasPartsContent = fragment2.length > 0 || partsMap.size > 0;
267254
267272
  const hasLegacyContent = metaMap.has("docx");
267255
- if (hasPartsContent || hasLegacyContent)
267273
+ const fragment2 = hasLegacyContent ? ydoc.getXmlFragment("supereditor") : await waitForCollaborativeFragmentSettling(ydoc);
267274
+ if (fragment2.length > 0 || partsMap.size > 0 || hasLegacyContent) {
267275
+ props.options.isNewFile = false;
267276
+ if (fragment2.length > 0) {
267277
+ props.options.fragment = fragment2;
267278
+ initEditor({});
267279
+ return;
267280
+ }
267281
+ delete props.options.fragment;
267282
+ if (hasLegacyContent) {
267283
+ initEditor({ content: metaMap.get("docx") });
267284
+ return;
267285
+ }
267256
267286
  initEditor({});
267257
- else {
267287
+ } else {
267258
267288
  props.options.isNewFile = true;
267289
+ delete props.options.fragment;
267259
267290
  const fileData = await loadNewFileData();
267260
267291
  if (fileData)
267261
267292
  initEditor(fileData);
@@ -267592,7 +267623,7 @@ function print() { __p += __j.call(arguments, '') }
267592
267623
  ], 6);
267593
267624
  };
267594
267625
  }
267595
- }), [["__scopeId", "data-v-cdf2871f"]]);
267626
+ }), [["__scopeId", "data-v-03ffec34"]]);
267596
267627
  _hoisted_1 = ["innerHTML"];
267597
267628
  SuperInput_default = /* @__PURE__ */ __plugin_vue_export_helper_default({
267598
267629
  __name: "SuperInput",
@@ -267726,7 +267757,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
267726
267757
 
267727
267758
  // ../../packages/superdoc/dist/super-editor.es.js
267728
267759
  var init_super_editor_es = __esm(() => {
267729
- init_src_CR6Zd30p_es();
267760
+ init_src_D6a7JHkJ_es();
267730
267761
  init_SuperConverter_BZ7c2IuL_es();
267731
267762
  init_jszip_ChlR43oI_es();
267732
267763
  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.113",
3
+ "version": "0.2.0-next.114",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -20,21 +20,21 @@
20
20
  "@types/bun": "^1.3.8",
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
- "@superdoc/document-api": "0.0.1",
24
23
  "@superdoc/pm-adapter": "0.0.0",
25
- "superdoc": "1.18.0",
26
- "@superdoc/super-editor": "0.0.1"
24
+ "@superdoc/super-editor": "0.0.1",
25
+ "@superdoc/document-api": "0.0.1",
26
+ "superdoc": "1.18.0"
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.113",
34
- "@superdoc-dev/cli-darwin-x64": "0.2.0-next.113",
35
- "@superdoc-dev/cli-linux-arm64": "0.2.0-next.113",
36
- "@superdoc-dev/cli-windows-x64": "0.2.0-next.113",
37
- "@superdoc-dev/cli-linux-x64": "0.2.0-next.113"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.2.0-next.114",
34
+ "@superdoc-dev/cli-darwin-x64": "0.2.0-next.114",
35
+ "@superdoc-dev/cli-linux-x64": "0.2.0-next.114",
36
+ "@superdoc-dev/cli-linux-arm64": "0.2.0-next.114",
37
+ "@superdoc-dev/cli-windows-x64": "0.2.0-next.114"
38
38
  },
39
39
  "scripts": {
40
40
  "dev": "bun run src/index.ts",