superdoc 1.2.2-next.1 → 1.3.0-next.2

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.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-De9wkgLl.cjs");
4
- const superdoc = require("./index-BS-AafWf.cjs");
5
- const index = require("./index-B2xKsF_F.cjs");
4
+ const superdoc = require("./index-sykfrKvQ.cjs");
5
+ const index = require("./index-C2XLSjq0.cjs");
6
6
  function self(vars) {
7
7
  const {
8
8
  opacityDisabled,
@@ -1,6 +1,6 @@
1
1
  import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, c as computed, r as ref, f as onMounted, X as onUnmounted, E as createElementBlock, G as openBlock, K as createBaseVNode, M as createCommentVNode, I as createVNode, v as unref } from "./vue-BnBKJwCW.es.js";
2
- import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-Di1Kp3nz.es.js";
3
- import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-CcYK8nzG.es.js";
2
+ import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-CMxyLpsU.es.js";
3
+ import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-D5tN0eME.es.js";
4
4
  function self(vars) {
5
5
  const {
6
6
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  import { B as Buffer, c as commonjsGlobal, g as getDefaultExportFromCjs$1 } from "./jszip-B1fkPkPJ.es.js";
2
- import { h as getDocxHighlightKeywordFromHex, n as normalizeHexColor, p as ptToTwips, j as isValidHexColor, k as getHexColorFromDocxSystem, m as twipsToPt, o as halfPointToPoints, c as twipsToPixels, q as eighthPointsToPixels, l as linesToTwips, a as twipsToLines, t as twipsToInches, b as pixelsToTwips, i as inchesToTwips, r as pixelsToEightPoints, s as emuToPixels, u as polygonToObj, v as rotToDegrees, w as pointsToTwips, x as pixelsToEmu, y as degreesToRot, z as objToPolygon, f as libExports, A as rgbToHex, B as deobfuscateFont, C as getArrayBufferFromUrl } from "./helpers-CAUq8coh.es.js";
2
+ import { j as getDocxHighlightKeywordFromHex, n as normalizeHexColor, p as ptToTwips, k as isValidHexColor, m as getHexColorFromDocxSystem, h as halfPointToPoints, o as twipsToPt, c as twipsToPixels, q as eighthPointsToPixels, l as linesToTwips, a as twipsToLines, t as twipsToInches, b as pixelsToTwips, i as inchesToTwips, r as pixelsToEightPoints, s as emuToPixels, u as polygonToObj, v as rotToDegrees, w as pointsToTwips, x as pixelsToEmu, y as degreesToRot, z as objToPolygon, f as libExports, A as rgbToHex, B as deobfuscateFont, C as getArrayBufferFromUrl } from "./helpers-C8e9wR5l.es.js";
3
3
  import { v as v4 } from "./uuid-CjlX8hrF.es.js";
4
4
  function getDefaultExportFromCjs(x2) {
5
5
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -7483,8 +7483,18 @@ function getUnderlineCssString({ type = "single", color = null, thickness = null
7483
7483
  if (color) add("text-decoration-color", color);
7484
7484
  return parts.join("; ");
7485
7485
  }
7486
- const INLINE_OVERRIDE_PROPERTIES = ["fontSize", "bold", "italic", "strike", "underline", "letterSpacing"];
7486
+ const INLINE_OVERRIDE_PROPERTIES = [
7487
+ "fontSize",
7488
+ "bold",
7489
+ "italic",
7490
+ "strike",
7491
+ "underline",
7492
+ "letterSpacing",
7493
+ "vertAlign",
7494
+ "position"
7495
+ ];
7487
7496
  const DEFAULT_FONT_SIZE_HALF_POINTS = 20;
7497
+ const SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65;
7488
7498
  const resolveRunProperties = (params, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => {
7489
7499
  const paragraphStyleId = resolvedPpr?.styleId;
7490
7500
  const paragraphStyleProps = resolveStyleChain(params, paragraphStyleId, translator$1O);
@@ -7832,6 +7842,21 @@ function encodeMarksFromRPr(runProperties, docx) {
7832
7842
  }
7833
7843
  break;
7834
7844
  }
7845
+ case "vertAlign": {
7846
+ if (value) {
7847
+ textStyleAttrs.vertAlign = value;
7848
+ }
7849
+ break;
7850
+ }
7851
+ case "position": {
7852
+ if (value != null && Number.isFinite(value)) {
7853
+ const points2 = halfPointToPoints(value);
7854
+ if (Number.isFinite(points2)) {
7855
+ textStyleAttrs.position = `${points2}pt`;
7856
+ }
7857
+ }
7858
+ break;
7859
+ }
7835
7860
  }
7836
7861
  });
7837
7862
  if (Object.keys(textStyleAttrs).length) {
@@ -7946,6 +7971,8 @@ function encodeCSSFromRPr(runProperties, docx) {
7946
7971
  let hasTextDecorationNone = false;
7947
7972
  let highlightColor = null;
7948
7973
  let hasHighlightTag = false;
7974
+ let verticalAlignValue;
7975
+ let fontSizeOverride;
7949
7976
  Object.keys(runProperties).forEach((key) => {
7950
7977
  const value = runProperties[key];
7951
7978
  switch (key) {
@@ -8076,6 +8103,35 @@ function encodeCSSFromRPr(runProperties, docx) {
8076
8103
  }
8077
8104
  break;
8078
8105
  }
8106
+ case "vertAlign": {
8107
+ if (runProperties.position != null && Number.isFinite(runProperties.position)) {
8108
+ break;
8109
+ }
8110
+ if (value === "superscript" || value === "subscript") {
8111
+ verticalAlignValue = value === "superscript" ? "super" : "sub";
8112
+ if (runProperties.fontSize != null && Number.isFinite(runProperties.fontSize)) {
8113
+ const scaledPoints = halfPointToPoints(runProperties.fontSize * SUBSCRIPT_SUPERSCRIPT_SCALE);
8114
+ if (Number.isFinite(scaledPoints)) {
8115
+ fontSizeOverride = `${scaledPoints}pt`;
8116
+ }
8117
+ } else {
8118
+ fontSizeOverride = `${SUBSCRIPT_SUPERSCRIPT_SCALE * 100}%`;
8119
+ }
8120
+ } else if (value === "baseline") {
8121
+ verticalAlignValue = "baseline";
8122
+ }
8123
+ break;
8124
+ }
8125
+ case "position": {
8126
+ if (value != null && Number.isFinite(value)) {
8127
+ const points = halfPointToPoints(value);
8128
+ if (Number.isFinite(points)) {
8129
+ verticalAlignValue = `${points}pt`;
8130
+ fontSizeOverride = void 0;
8131
+ }
8132
+ }
8133
+ break;
8134
+ }
8079
8135
  }
8080
8136
  });
8081
8137
  if (!hasTextDecorationNone && textDecorationLines.size) {
@@ -8090,6 +8146,12 @@ function encodeCSSFromRPr(runProperties, docx) {
8090
8146
  css["color"] = "inherit";
8091
8147
  }
8092
8148
  }
8149
+ if (fontSizeOverride) {
8150
+ css["font-size"] = fontSizeOverride;
8151
+ }
8152
+ if (verticalAlignValue) {
8153
+ css["vertical-align"] = verticalAlignValue;
8154
+ }
8093
8155
  return css;
8094
8156
  }
8095
8157
  function decodeRPrFromMarks(marks) {
@@ -8166,6 +8228,20 @@ function decodeRPrFromMarks(marks) {
8166
8228
  runProperties.fontFamily = result;
8167
8229
  }
8168
8230
  break;
8231
+ case "vertAlign":
8232
+ if (value != null) {
8233
+ runProperties.vertAlign = value;
8234
+ }
8235
+ break;
8236
+ case "position": {
8237
+ if (value != null) {
8238
+ const numeric = parseFloat(value);
8239
+ if (!isNaN(numeric)) {
8240
+ runProperties.position = numeric * 2;
8241
+ }
8242
+ }
8243
+ break;
8244
+ }
8169
8245
  }
8170
8246
  });
8171
8247
  break;
@@ -30763,7 +30839,7 @@ class SuperConverter {
30763
30839
  static getStoredSuperdocVersion(docx) {
30764
30840
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30765
30841
  }
30766
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.2-next.1") {
30842
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.2") {
30767
30843
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30768
30844
  }
30769
30845
  /**
@@ -7484,8 +7484,18 @@ function getUnderlineCssString({ type = "single", color = null, thickness = null
7484
7484
  if (color) add("text-decoration-color", color);
7485
7485
  return parts.join("; ");
7486
7486
  }
7487
- const INLINE_OVERRIDE_PROPERTIES = ["fontSize", "bold", "italic", "strike", "underline", "letterSpacing"];
7487
+ const INLINE_OVERRIDE_PROPERTIES = [
7488
+ "fontSize",
7489
+ "bold",
7490
+ "italic",
7491
+ "strike",
7492
+ "underline",
7493
+ "letterSpacing",
7494
+ "vertAlign",
7495
+ "position"
7496
+ ];
7488
7497
  const DEFAULT_FONT_SIZE_HALF_POINTS = 20;
7498
+ const SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65;
7489
7499
  const resolveRunProperties = (params, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => {
7490
7500
  const paragraphStyleId = resolvedPpr?.styleId;
7491
7501
  const paragraphStyleProps = resolveStyleChain(params, paragraphStyleId, translator$1O);
@@ -7833,6 +7843,21 @@ function encodeMarksFromRPr(runProperties, docx) {
7833
7843
  }
7834
7844
  break;
7835
7845
  }
7846
+ case "vertAlign": {
7847
+ if (value) {
7848
+ textStyleAttrs.vertAlign = value;
7849
+ }
7850
+ break;
7851
+ }
7852
+ case "position": {
7853
+ if (value != null && Number.isFinite(value)) {
7854
+ const points2 = helpers.halfPointToPoints(value);
7855
+ if (Number.isFinite(points2)) {
7856
+ textStyleAttrs.position = `${points2}pt`;
7857
+ }
7858
+ }
7859
+ break;
7860
+ }
7836
7861
  }
7837
7862
  });
7838
7863
  if (Object.keys(textStyleAttrs).length) {
@@ -7947,6 +7972,8 @@ function encodeCSSFromRPr(runProperties, docx) {
7947
7972
  let hasTextDecorationNone = false;
7948
7973
  let highlightColor = null;
7949
7974
  let hasHighlightTag = false;
7975
+ let verticalAlignValue;
7976
+ let fontSizeOverride;
7950
7977
  Object.keys(runProperties).forEach((key) => {
7951
7978
  const value = runProperties[key];
7952
7979
  switch (key) {
@@ -8077,6 +8104,35 @@ function encodeCSSFromRPr(runProperties, docx) {
8077
8104
  }
8078
8105
  break;
8079
8106
  }
8107
+ case "vertAlign": {
8108
+ if (runProperties.position != null && Number.isFinite(runProperties.position)) {
8109
+ break;
8110
+ }
8111
+ if (value === "superscript" || value === "subscript") {
8112
+ verticalAlignValue = value === "superscript" ? "super" : "sub";
8113
+ if (runProperties.fontSize != null && Number.isFinite(runProperties.fontSize)) {
8114
+ const scaledPoints = helpers.halfPointToPoints(runProperties.fontSize * SUBSCRIPT_SUPERSCRIPT_SCALE);
8115
+ if (Number.isFinite(scaledPoints)) {
8116
+ fontSizeOverride = `${scaledPoints}pt`;
8117
+ }
8118
+ } else {
8119
+ fontSizeOverride = `${SUBSCRIPT_SUPERSCRIPT_SCALE * 100}%`;
8120
+ }
8121
+ } else if (value === "baseline") {
8122
+ verticalAlignValue = "baseline";
8123
+ }
8124
+ break;
8125
+ }
8126
+ case "position": {
8127
+ if (value != null && Number.isFinite(value)) {
8128
+ const points = helpers.halfPointToPoints(value);
8129
+ if (Number.isFinite(points)) {
8130
+ verticalAlignValue = `${points}pt`;
8131
+ fontSizeOverride = void 0;
8132
+ }
8133
+ }
8134
+ break;
8135
+ }
8080
8136
  }
8081
8137
  });
8082
8138
  if (!hasTextDecorationNone && textDecorationLines.size) {
@@ -8091,6 +8147,12 @@ function encodeCSSFromRPr(runProperties, docx) {
8091
8147
  css["color"] = "inherit";
8092
8148
  }
8093
8149
  }
8150
+ if (fontSizeOverride) {
8151
+ css["font-size"] = fontSizeOverride;
8152
+ }
8153
+ if (verticalAlignValue) {
8154
+ css["vertical-align"] = verticalAlignValue;
8155
+ }
8094
8156
  return css;
8095
8157
  }
8096
8158
  function decodeRPrFromMarks(marks) {
@@ -8167,6 +8229,20 @@ function decodeRPrFromMarks(marks) {
8167
8229
  runProperties.fontFamily = result;
8168
8230
  }
8169
8231
  break;
8232
+ case "vertAlign":
8233
+ if (value != null) {
8234
+ runProperties.vertAlign = value;
8235
+ }
8236
+ break;
8237
+ case "position": {
8238
+ if (value != null) {
8239
+ const numeric = parseFloat(value);
8240
+ if (!isNaN(numeric)) {
8241
+ runProperties.position = numeric * 2;
8242
+ }
8243
+ }
8244
+ break;
8245
+ }
8170
8246
  }
8171
8247
  });
8172
8248
  break;
@@ -30764,7 +30840,7 @@ class SuperConverter {
30764
30840
  static getStoredSuperdocVersion(docx) {
30765
30841
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
30766
30842
  }
30767
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.2.2-next.1") {
30843
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.2") {
30768
30844
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
30769
30845
  }
30770
30846
  /**
@@ -331,14 +331,14 @@ export {
331
331
  inchesToPixels as e,
332
332
  libExports as f,
333
333
  getContentTypesFromXml as g,
334
- getDocxHighlightKeywordFromHex as h,
334
+ halfPointToPoints as h,
335
335
  inchesToTwips as i,
336
- isValidHexColor as j,
337
- getHexColorFromDocxSystem as k,
336
+ getDocxHighlightKeywordFromHex as j,
337
+ isValidHexColor as k,
338
338
  linesToTwips as l,
339
- twipsToPt as m,
339
+ getHexColorFromDocxSystem as m,
340
340
  normalizeHexColor as n,
341
- halfPointToPoints as o,
341
+ twipsToPt as o,
342
342
  ptToTwips as p,
343
343
  eighthPointsToPixels as q,
344
344
  pixelsToEightPoints as r,