@superdoc-dev/cli 0.15.0-next.3 → 0.15.0-next.4

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 -29
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -221759,7 +221759,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
221759
221759
  init_remark_gfm_BhnWr3yf_es();
221760
221760
  });
221761
221761
 
221762
- // ../../packages/superdoc/dist/chunks/src-DzR9fgTM.es.js
221762
+ // ../../packages/superdoc/dist/chunks/src-D6vKCaok.es.js
221763
221763
  function deleteProps(obj, propOrProps) {
221764
221764
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
221765
221765
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -223148,6 +223148,29 @@ function checkLockViolation(sdtNodes, from$1, to) {
223148
223148
  }
223149
223149
  return { blocked: false };
223150
223150
  }
223151
+ function isAtBlockSdtWrapperDeletePosition(state, sdt, pos) {
223152
+ if (sdt.type !== "structuredContentBlock")
223153
+ return false;
223154
+ const $pos = state.doc.resolve(pos);
223155
+ let sdtDepth = null;
223156
+ for (let depth = $pos.depth;depth > 0; depth -= 1)
223157
+ if ($pos.node(depth).type.name === "structuredContentBlock" && $pos.before(depth) === sdt.pos) {
223158
+ sdtDepth = depth;
223159
+ break;
223160
+ }
223161
+ if (sdtDepth == null)
223162
+ return false;
223163
+ const textblockDepth = sdtDepth + 1;
223164
+ if ($pos.depth < textblockDepth)
223165
+ return false;
223166
+ if (!$pos.node(textblockDepth).isTextblock)
223167
+ return false;
223168
+ if ($pos.node(textblockDepth).type.name !== "paragraph")
223169
+ return false;
223170
+ if ($pos.pos !== $pos.start(textblockDepth))
223171
+ return false;
223172
+ return $pos.before(textblockDepth) === $pos.start(sdtDepth);
223173
+ }
223151
223174
  function createStructuredContentLockPlugin() {
223152
223175
  return new Plugin({
223153
223176
  key: STRUCTURED_CONTENT_LOCK_KEY,
@@ -223209,6 +223232,9 @@ function createStructuredContentLockPlugin() {
223209
223232
  view.dispatch(state.tr.delete(emptyInlineSDT.pos, emptyInlineSDT.end));
223210
223233
  return true;
223211
223234
  }
223235
+ const blockSdtAtWrapperDeletePosition = sdtNodes.find((s2) => isAtBlockSdtWrapperDeletePosition(state, s2, from$1));
223236
+ if ((isBackspace || isDelete) && blockSdtAtWrapperDeletePosition)
223237
+ return false;
223212
223238
  const inlineSdtAncestor = sdtNodes.find((s2) => s2.type === "structuredContent" && from$1 > s2.pos && from$1 < s2.end);
223213
223239
  const inlineSdtContentEditable = inlineSdtAncestor && inlineSdtAncestor.lockMode !== "contentLocked" && inlineSdtAncestor.lockMode !== "sdtContentLocked";
223214
223240
  if ((isBackspace || isDelete) && inlineSdtContentEditable && selection.$from.parent.type.name === "run") {
@@ -300013,8 +300039,9 @@ var Node$13 = class Node$14 {
300013
300039
  .superdoc-structured-content-block {
300014
300040
  box-sizing: border-box;
300015
300041
  border-radius: 4px;
300016
- background-color: var(--sd-content-controls-block-bg, transparent);
300042
+ background-color: transparent;
300017
300043
  position: relative;
300044
+ z-index: 0;
300018
300045
  --sd-sdt-chrome-left: 0px;
300019
300046
  --sd-sdt-chrome-width: 100%;
300020
300047
  --sd-sdt-chrome-bottom-extension: 0px;
@@ -300028,7 +300055,9 @@ var Node$13 = class Node$14 {
300028
300055
  bottom: calc(0px - var(--sd-sdt-chrome-bottom-extension, 0px));
300029
300056
  width: var(--sd-sdt-chrome-width, 100%);
300030
300057
  border-radius: inherit;
300058
+ background-color: var(--sd-content-controls-block-bg, transparent);
300031
300059
  box-sizing: border-box;
300060
+ z-index: -1;
300032
300061
  pointer-events: none;
300033
300062
  }
300034
300063
 
@@ -300042,6 +300071,7 @@ var Node$13 = class Node$14 {
300042
300071
  border: 1px solid transparent;
300043
300072
  border-radius: inherit;
300044
300073
  box-sizing: border-box;
300074
+ z-index: 1;
300045
300075
  pointer-events: none;
300046
300076
  }
300047
300077
 
@@ -300177,6 +300207,11 @@ var Node$13 = class Node$14 {
300177
300207
  z-index: 10;
300178
300208
  }
300179
300209
 
300210
+ .superdoc-structured-content-inline[data-contains-inline-image='true']:not([data-appearance='hidden']) {
300211
+ display: inline-block;
300212
+ vertical-align: top;
300213
+ }
300214
+
300180
300215
  /* Hover effect for inline structured content */
300181
300216
  .superdoc-structured-content-inline:not(.ProseMirror-selectednode):hover {
300182
300217
  background-color: var(--sd-content-controls-inline-hover-bg, #f2f2f2);
@@ -300308,6 +300343,7 @@ var Node$13 = class Node$14 {
300308
300343
  border: none;
300309
300344
  }
300310
300345
 
300346
+ .presentation-editor--viewing .superdoc-structured-content-block::before,
300311
300347
  .presentation-editor--viewing .superdoc-structured-content-block:hover::before,
300312
300348
  .presentation-editor--viewing .superdoc-structured-content-block.sdt-group-hover::before,
300313
300349
  .presentation-editor--viewing .superdoc-structured-content-block[data-lock-mode].sdt-group-hover::before {
@@ -300349,6 +300385,10 @@ var Node$13 = class Node$14 {
300349
300385
  border: none;
300350
300386
  }
300351
300387
 
300388
+ .superdoc-structured-content-block::before {
300389
+ background: none;
300390
+ }
300391
+
300352
300392
  .superdoc-document-section__tooltip,
300353
300393
  .superdoc-structured-content__label,
300354
300394
  .superdoc-structured-content-inline__label {
@@ -304649,6 +304689,8 @@ menclose::after {
304649
304689
  geoSdtWrapper.style.top = "0px";
304650
304690
  geoSdtWrapper.style.height = `${line.lineHeight}px`;
304651
304691
  }
304692
+ if (isImageRun$1(runForSdt))
304693
+ geoSdtWrapper.dataset.containsInlineImage = "true";
304652
304694
  runContext.syncInlineSdtWrapperTypography(geoSdtWrapper, runForSdt);
304653
304695
  elem.style.left = `${elemLeftPx - geoSdtWrapperLeft}px`;
304654
304696
  geoSdtMaxRight = Math.max(geoSdtMaxRight, elemLeftPx + elemWidthPx);
@@ -304802,6 +304844,8 @@ menclose::after {
304802
304844
  runContext.syncInlineSdtWrapperTypography(currentInlineSdtWrapper, run2);
304803
304845
  currentInlineSdtId = runSdtId;
304804
304846
  }
304847
+ if (isImageRun$1(run2))
304848
+ currentInlineSdtWrapper.dataset.containsInlineImage = "true";
304805
304849
  runContext.expandSdtWrapperPmRange(currentInlineSdtWrapper, run2.pmStart, run2.pmEnd);
304806
304850
  currentInlineSdtWrapper.appendChild(elem);
304807
304851
  } else
@@ -314269,26 +314313,6 @@ menclose::after {
314269
314313
  const layoutState = this.#deps?.getLayoutState();
314270
314314
  return calculateExtendedSelection(layoutState?.blocks ?? [], anchor, head, mode);
314271
314315
  }
314272
- #clampHeadAtIsolatingBoundary(doc$12, anchor, head) {
314273
- const forward = head >= anchor;
314274
- try {
314275
- const $head = doc$12.resolve(head);
314276
- let isolatingDepth = -1;
314277
- for (let d = $head.depth;d > 0; d--) {
314278
- const node3 = $head.node(d);
314279
- if (node3.type.spec.isolating || node3.type.spec.tableRole === "table")
314280
- isolatingDepth = d;
314281
- }
314282
- if (isolatingDepth > 0) {
314283
- const boundary = forward ? $head.before(isolatingDepth) : $head.after(isolatingDepth);
314284
- const near = Selection.near(doc$12.resolve(boundary), forward ? -1 : 1);
314285
- if (near instanceof TextSelection)
314286
- return near.head;
314287
- return anchor;
314288
- }
314289
- } catch {}
314290
- return head;
314291
- }
314292
314316
  #shouldUseCellSelection(currentTableHit) {
314293
314317
  return shouldUseCellSelection(currentTableHit, this.#cellAnchor, this.#cellDragMode);
314294
314318
  }
@@ -315426,8 +315450,7 @@ menclose::after {
315426
315450
  return;
315427
315451
  if (!useActiveSurfaceHitTest && isRenderedNoteBlockId(rawHit.blockId))
315428
315452
  return;
315429
- const doc$12 = editor.state?.doc;
315430
- if (!doc$12)
315453
+ if (!editor.state?.doc)
315431
315454
  return;
315432
315455
  this.#dragLastRawHit = rawHit;
315433
315456
  const pageMounted = this.#deps.getPageElement(rawHit.pageIndex) != null;
@@ -315450,9 +315473,7 @@ menclose::after {
315450
315473
  return;
315451
315474
  }
315452
315475
  const anchor = this.#dragAnchor;
315453
- let head = hit.pos;
315454
- if (!this.#cellAnchor)
315455
- head = this.#clampHeadAtIsolatingBoundary(doc$12, anchor, head);
315476
+ const head = hit.pos;
315456
315477
  const { selAnchor, selHead } = this.#calculateExtendedSelection(anchor, head, this.#dragExtensionMode);
315457
315478
  try {
315458
315479
  const tr = editor.state.tr.setSelection(TextSelection.create(editor.state.doc, selAnchor, selHead));
@@ -318777,7 +318798,7 @@ menclose::after {
318777
318798
  return;
318778
318799
  console.log(...args$1);
318779
318800
  }, 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;
318780
- var init_src_DzR9fgTM_es = __esm(() => {
318801
+ var init_src_D6vKCaok_es = __esm(() => {
318781
318802
  init_rolldown_runtime_Bg48TavK_es();
318782
318803
  init_SuperConverter_C6hKp29w_es();
318783
318804
  init_jszip_C49i9kUs_es();
@@ -353028,7 +353049,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
353028
353049
 
353029
353050
  // ../../packages/superdoc/dist/super-editor.es.js
353030
353051
  var init_super_editor_es = __esm(() => {
353031
- init_src_DzR9fgTM_es();
353052
+ init_src_D6vKCaok_es();
353032
353053
  init_SuperConverter_C6hKp29w_es();
353033
353054
  init_jszip_C49i9kUs_es();
353034
353055
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.15.0-next.3",
3
+ "version": "0.15.0-next.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -26,19 +26,19 @@
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
28
  "@superdoc/pm-adapter": "0.0.0",
29
- "superdoc": "1.37.0",
30
- "@superdoc/super-editor": "0.0.1"
29
+ "@superdoc/super-editor": "0.0.1",
30
+ "superdoc": "1.37.0"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.15.0-next.3",
38
- "@superdoc-dev/cli-darwin-x64": "0.15.0-next.3",
39
- "@superdoc-dev/cli-linux-arm64": "0.15.0-next.3",
40
- "@superdoc-dev/cli-linux-x64": "0.15.0-next.3",
41
- "@superdoc-dev/cli-windows-x64": "0.15.0-next.3"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.15.0-next.4",
38
+ "@superdoc-dev/cli-darwin-x64": "0.15.0-next.4",
39
+ "@superdoc-dev/cli-linux-x64": "0.15.0-next.4",
40
+ "@superdoc-dev/cli-windows-x64": "0.15.0-next.4",
41
+ "@superdoc-dev/cli-linux-arm64": "0.15.0-next.4"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",