@superdoc-dev/mcp 0.3.0-next.71 → 0.3.0-next.73

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 +112 -39
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -199725,7 +199725,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
199725
199725
  init_remark_gfm_BhnWr3yf_es();
199726
199726
  });
199727
199727
 
199728
- // ../../packages/superdoc/dist/chunks/src-AOxYjda5.es.js
199728
+ // ../../packages/superdoc/dist/chunks/src-BLxaw1d3.es.js
199729
199729
  function deleteProps(obj, propOrProps) {
199730
199730
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
199731
199731
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -284856,7 +284856,10 @@ menclose::after {
284856
284856
  const attrs = block.attrs;
284857
284857
  if (!attrs)
284858
284858
  return false;
284859
- const directionAttr = attrs.direction ?? attrs.dir ?? attrs.textDirection;
284859
+ const directionContext = attrs.directionContext;
284860
+ if (directionContext?.inlineDirection != null)
284861
+ return directionContext.inlineDirection === "rtl";
284862
+ const directionAttr = attrs.direction ?? attrs.dir;
284860
284863
  if (typeof directionAttr === "string" && directionAttr.toLowerCase() === "rtl")
284861
284864
  return true;
284862
284865
  return false;
@@ -286110,6 +286113,99 @@ menclose::after {
286110
286113
  mutated = true;
286111
286114
  }
286112
286115
  return mutated ? mirrored : indent2;
286116
+ }, DEFAULT_PAGE_DIRECTION = "ltr", DEFAULT_WRITING_MODE = "horizontal-tb", isToggleOn = (val) => {
286117
+ if (val === undefined || val === null)
286118
+ return true;
286119
+ if (val === "0" || val === 0 || val === false)
286120
+ return false;
286121
+ if (val === "false" || val === "off")
286122
+ return false;
286123
+ return true;
286124
+ }, writingModeFromTextDirection$1 = (val) => {
286125
+ if (typeof val !== "string")
286126
+ return;
286127
+ switch (val) {
286128
+ case "lrTb":
286129
+ case "lrTbV":
286130
+ case "tb":
286131
+ case "tbV":
286132
+ return "horizontal-tb";
286133
+ case "tbRl":
286134
+ case "tbRlV":
286135
+ case "rl":
286136
+ case "rlV":
286137
+ return "vertical-rl";
286138
+ case "btLr":
286139
+ case "lr":
286140
+ case "lrV":
286141
+ case "tbLrV":
286142
+ return "vertical-lr";
286143
+ default:
286144
+ return;
286145
+ }
286146
+ }, resolveSectionDirection = (sectPr) => {
286147
+ let pageDirection = DEFAULT_PAGE_DIRECTION;
286148
+ let writingMode = DEFAULT_WRITING_MODE;
286149
+ let rtlGutter = false;
286150
+ if (sectPr && typeof sectPr === "object") {
286151
+ const elements = sectPr.elements;
286152
+ if (Array.isArray(elements))
286153
+ for (const el of elements) {
286154
+ if (!el?.name)
286155
+ continue;
286156
+ const val = el.attributes?.["w:val"] ?? el.attributes?.val;
286157
+ if (el.name === "w:bidi" && isToggleOn(val)) {
286158
+ pageDirection = "rtl";
286159
+ continue;
286160
+ }
286161
+ if (el.name === "w:textDirection") {
286162
+ const mode = writingModeFromTextDirection$1(val);
286163
+ if (mode)
286164
+ writingMode = mode;
286165
+ continue;
286166
+ }
286167
+ if (el.name === "w:rtlGutter" && isToggleOn(val)) {
286168
+ rtlGutter = true;
286169
+ continue;
286170
+ }
286171
+ }
286172
+ }
286173
+ return {
286174
+ pageDirection,
286175
+ writingMode,
286176
+ rtlGutter
286177
+ };
286178
+ }, writingModeFromTextDirection = (val) => {
286179
+ switch (val) {
286180
+ case "lrTb":
286181
+ case "lrTbV":
286182
+ case "tb":
286183
+ case "tbV":
286184
+ return "horizontal-tb";
286185
+ case "tbRl":
286186
+ case "tbRlV":
286187
+ case "rl":
286188
+ case "rlV":
286189
+ return "vertical-rl";
286190
+ case "btLr":
286191
+ case "lr":
286192
+ case "lrV":
286193
+ case "tbLrV":
286194
+ return "vertical-lr";
286195
+ default:
286196
+ return;
286197
+ }
286198
+ }, resolveParagraphDirection = (paragraphProperties, parentSection, parentCell) => {
286199
+ let inlineDirection;
286200
+ if (paragraphProperties?.rightToLeft === true)
286201
+ inlineDirection = "rtl";
286202
+ else if (paragraphProperties?.rightToLeft === false)
286203
+ inlineDirection = "ltr";
286204
+ const writingMode = writingModeFromTextDirection(paragraphProperties?.textDirection) ?? parentCell?.writingMode ?? parentSection.writingMode;
286205
+ return {
286206
+ inlineDirection,
286207
+ writingMode
286208
+ };
286113
286209
  }, DEFAULT_DECIMAL_SEPARATOR$1 = ".", DEFAULT_TAB_INTERVAL_TWIPS$1 = 720, normalizeColor$1 = (value) => {
286114
286210
  if (typeof value !== "string")
286115
286211
  return;
@@ -286127,37 +286223,6 @@ menclose::after {
286127
286223
  if (Object.prototype.hasOwnProperty.call(obj, key2))
286128
286224
  clone2[key2] = deepClone2(obj[key2]);
286129
286225
  return clone2;
286130
- }, inferDirectionFromRuns = (para) => {
286131
- const content3 = Array.isArray(para.content) ? para.content : [];
286132
- let hasExplicitRtl = false;
286133
- let hasExplicitLtr = false;
286134
- for (const node2 of content3) {
286135
- if (node2?.type !== "run")
286136
- continue;
286137
- const runProps = node2.attrs?.runProperties ?? {};
286138
- const runDirection = runProps.rightToLeft ?? runProps.rtl;
286139
- if (runDirection === true) {
286140
- hasExplicitRtl = true;
286141
- continue;
286142
- }
286143
- if (runDirection === false)
286144
- hasExplicitLtr = true;
286145
- }
286146
- if (!hasExplicitRtl && !hasExplicitLtr)
286147
- return;
286148
- if (hasExplicitLtr)
286149
- return;
286150
- return "rtl";
286151
- }, resolveEffectiveParagraphDirection = (para, resolvedParagraphProperties, _sectionDirection, docDefaultsDirection) => {
286152
- if (resolvedParagraphProperties.rightToLeft === true)
286153
- return "rtl";
286154
- if (resolvedParagraphProperties.rightToLeft === false)
286155
- return "ltr";
286156
- const inferredFromRuns = inferDirectionFromRuns(para);
286157
- if (inferredFromRuns)
286158
- return inferredFromRuns;
286159
- if (docDefaultsDirection)
286160
- return docDefaultsDirection;
286161
286226
  }, normalizeIndentTwipsToPx = (indent2) => {
286162
286227
  if (!indent2)
286163
286228
  return;
@@ -286280,7 +286345,9 @@ menclose::after {
286280
286345
  resolvedParagraphProperties = paragraphProperties;
286281
286346
  else
286282
286347
  resolvedParagraphProperties = resolveParagraphProperties(converterContext, paragraphProperties, converterContext.tableInfo);
286283
- const normalizedDirection = resolveEffectiveParagraphDirection(para, resolvedParagraphProperties, converterContext?.sectionDirection, converterContext?.translatedLinkedStyles?.docDefaults?.paragraphProperties?.rightToLeft === true ? "rtl" : converterContext?.translatedLinkedStyles?.docDefaults?.paragraphProperties?.rightToLeft === false ? "ltr" : undefined);
286348
+ const sectionContext = resolveSectionDirection(undefined);
286349
+ const directionContext = resolveParagraphDirection(resolvedParagraphProperties, sectionContext);
286350
+ const normalizedDirection = directionContext.inlineDirection;
286284
286351
  const isRtl = normalizedDirection === "rtl";
286285
286352
  const normalizedSpacing = normalizeParagraphSpacing(resolvedParagraphProperties.spacing, Boolean(resolvedParagraphProperties.numberingProperties));
286286
286353
  const normalizedIndentBase = normalizeIndentTwipsToPx(resolveLogicalIndentToPhysical(resolvedParagraphProperties.indent, normalizedDirection));
@@ -286314,7 +286381,8 @@ menclose::after {
286314
286381
  keepLines: resolvedParagraphProperties.keepLines,
286315
286382
  floatAlignment,
286316
286383
  pageBreakBefore: resolvedParagraphProperties.pageBreakBefore,
286317
- ...normalizedDirection ? { direction: normalizedDirection } : {}
286384
+ ...normalizedDirection ? { direction: normalizedDirection } : {},
286385
+ directionContext
286318
286386
  };
286319
286387
  if (normalizedNumberingProperties && normalizedListRendering) {
286320
286388
  const markerRunAttrs = computeRunAttrs(resolveRunProperties(converterContext, resolvedParagraphProperties.runProperties, resolvedParagraphProperties, converterContext.tableInfo, true, Boolean(paragraphProperties.numberingProperties)), converterContext);
@@ -292968,7 +293036,7 @@ menclose::after {
292968
293036
  return;
292969
293037
  console.log(...args$1);
292970
293038
  }, 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;
292971
- var init_src_AOxYjda5_es = __esm(() => {
293039
+ var init_src_BLxaw1d3_es = __esm(() => {
292972
293040
  init_rolldown_runtime_Bg48TavK_es();
292973
293041
  init_SuperConverter_BecdrRIX_es();
292974
293042
  init_jszip_C49i9kUs_es();
@@ -330862,7 +330930,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
330862
330930
 
330863
330931
  // ../../packages/superdoc/dist/super-editor.es.js
330864
330932
  var init_super_editor_es = __esm(() => {
330865
- init_src_AOxYjda5_es();
330933
+ init_src_BLxaw1d3_es();
330866
330934
  init_SuperConverter_BecdrRIX_es();
330867
330935
  init_jszip_C49i9kUs_es();
330868
330936
  init_xml_js_CqGKpaft_es();
@@ -469079,7 +469147,12 @@ function jsonSchemaPropertyToZod(prop) {
469079
469147
  return exports_external.enum(values2).describe(desc ?? "");
469080
469148
  }
469081
469149
  }
469082
- if (prop.oneOf || prop.anyOf || prop.allOf) {
469150
+ const variants = prop.oneOf ?? prop.anyOf ?? prop.allOf;
469151
+ if (variants) {
469152
+ const allObjectVariants = variants.every((v) => v?.type === "object");
469153
+ if (allObjectVariants) {
469154
+ return desc ? exports_external.looseObject({}).describe(desc) : exports_external.looseObject({});
469155
+ }
469083
469156
  return desc ? exports_external.unknown().describe(desc) : exports_external.unknown();
469084
469157
  }
469085
469158
  switch (type) {
@@ -469093,7 +469166,7 @@ function jsonSchemaPropertyToZod(prop) {
469093
469166
  case "array":
469094
469167
  return desc ? exports_external.array(exports_external.unknown()).describe(desc) : exports_external.array(exports_external.unknown());
469095
469168
  case "object":
469096
- return desc ? exports_external.unknown().describe(desc) : exports_external.unknown();
469169
+ return desc ? exports_external.looseObject({}).describe(desc) : exports_external.looseObject({});
469097
469170
  default:
469098
469171
  return desc ? exports_external.unknown().describe(desc) : exports_external.unknown();
469099
469172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.3.0-next.71",
3
+ "version": "0.3.0-next.73",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -20,8 +20,8 @@
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
22
  "@superdoc/document-api": "0.0.1",
23
- "@superdoc/super-editor": "0.0.1",
24
- "superdoc": "1.31.0"
23
+ "superdoc": "1.31.0",
24
+ "@superdoc/super-editor": "0.0.1"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"