superdoc 1.2.2-next.1 → 1.3.0-next.1
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.
- package/dist/chunks/{PdfViewer-Cq1mqKR1.cjs → PdfViewer-BAoRLNIo.cjs} +2 -2
- package/dist/chunks/{PdfViewer-fdEUMidQ.es.js → PdfViewer-CkOzQzPk.es.js} +2 -2
- package/dist/chunks/{SuperConverter-C4sb9GH7.es.js → SuperConverter-BXP6NikG.es.js} +79 -3
- package/dist/chunks/{SuperConverter-C_fR_pax.cjs → SuperConverter-Dy0-KTCc.cjs} +78 -2
- package/dist/chunks/{helpers-CAUq8coh.es.js → helpers-C8e9wR5l.es.js} +5 -5
- package/dist/chunks/{index-B2xKsF_F.cjs → index-BNpbdx2a.cjs} +146 -4
- package/dist/chunks/{index-BS-AafWf.cjs → index-BbvMtiJY.cjs} +4 -4
- package/dist/chunks/{index-Di1Kp3nz.es.js → index-C31VY_46.es.js} +5 -5
- package/dist/chunks/{index-CcYK8nzG.es.js → index-wwGlJ58Z.es.js} +147 -5
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +2 -2
- package/dist/super-editor/docx-zipper.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +4 -4
- package/dist/superdoc.umd.js +224 -6
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +3 -3
|
@@ -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-
|
|
5
|
-
const index = require("./index-
|
|
4
|
+
const superdoc = require("./index-BbvMtiJY.cjs");
|
|
5
|
+
const index = require("./index-BNpbdx2a.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-
|
|
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-
|
|
2
|
+
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-C31VY_46.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-wwGlJ58Z.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 {
|
|
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 = [
|
|
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.
|
|
30842
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.1") {
|
|
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 = [
|
|
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.
|
|
30843
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.3.0-next.1") {
|
|
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
|
-
|
|
334
|
+
halfPointToPoints as h,
|
|
335
335
|
inchesToTwips as i,
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
getDocxHighlightKeywordFromHex as j,
|
|
337
|
+
isValidHexColor as k,
|
|
338
338
|
linesToTwips as l,
|
|
339
|
-
|
|
339
|
+
getHexColorFromDocxSystem as m,
|
|
340
340
|
normalizeHexColor as n,
|
|
341
|
-
|
|
341
|
+
twipsToPt as o,
|
|
342
342
|
ptToTwips as p,
|
|
343
343
|
eighthPointsToPixels as q,
|
|
344
344
|
pixelsToEightPoints as r,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-C8_CqJxM.cjs");
|
|
3
3
|
const helpers$1 = require("./helpers-nOdwpmwb.cjs");
|
|
4
|
-
const superEditor_converter = require("./SuperConverter-
|
|
4
|
+
const superEditor_converter = require("./SuperConverter-Dy0-KTCc.cjs");
|
|
5
5
|
const vue = require("./vue-De9wkgLl.cjs");
|
|
6
6
|
require("./jszip.min-BPh2MMAa.cjs");
|
|
7
7
|
const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
|
|
@@ -14915,7 +14915,7 @@ const canUseDOM = () => {
|
|
|
14915
14915
|
return false;
|
|
14916
14916
|
}
|
|
14917
14917
|
};
|
|
14918
|
-
const summaryVersion = "1.
|
|
14918
|
+
const summaryVersion = "1.3.0-next.1";
|
|
14919
14919
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
14920
14920
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
14921
14921
|
function mapAttributes(attrs) {
|
|
@@ -17548,7 +17548,7 @@ class Editor extends EventEmitter {
|
|
|
17548
17548
|
* Process collaboration migrations
|
|
17549
17549
|
*/
|
|
17550
17550
|
processCollaborationMigrations() {
|
|
17551
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.
|
|
17551
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.1");
|
|
17552
17552
|
if (!this.options.ydoc) return;
|
|
17553
17553
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
17554
17554
|
let docVersion = metaMap.get("version");
|
|
@@ -49319,6 +49319,7 @@ const CommentMarkName = "commentMark";
|
|
|
49319
49319
|
const TrackInsertMarkName = "trackInsert";
|
|
49320
49320
|
const TrackDeleteMarkName = "trackDelete";
|
|
49321
49321
|
const TrackFormatMarkName = "trackFormat";
|
|
49322
|
+
const SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65;
|
|
49322
49323
|
const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
|
|
49323
49324
|
const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
|
|
49324
49325
|
const DEFAULT_VIRTUALIZED_PAGE_GAP = 72;
|
|
@@ -52563,6 +52564,7 @@ class PresentationEditor extends EventEmitter {
|
|
|
52563
52564
|
);
|
|
52564
52565
|
this.#domIndexObserverManager?.pause();
|
|
52565
52566
|
painter.paint(layout, this.#painterHost);
|
|
52567
|
+
this.#applyVertAlignToLayout();
|
|
52566
52568
|
this.#rebuildDomPositionIndex();
|
|
52567
52569
|
this.#domIndexObserverManager?.resume();
|
|
52568
52570
|
this.#layoutEpoch = layoutEpoch;
|
|
@@ -54325,6 +54327,90 @@ class PresentationEditor extends EventEmitter {
|
|
|
54325
54327
|
this.#errorBanner = null;
|
|
54326
54328
|
this.#errorBannerMessage = null;
|
|
54327
54329
|
}
|
|
54330
|
+
/**
|
|
54331
|
+
* Applies vertical alignment and font scaling to layout DOM elements for subscript/superscript rendering.
|
|
54332
|
+
*
|
|
54333
|
+
* This method post-processes the painted DOM layout to apply vertical alignment styles
|
|
54334
|
+
* (super, sub, baseline, or custom position) based on run properties and text style marks.
|
|
54335
|
+
* It handles both DOCX-style vertAlign ('superscript', 'subscript', 'baseline') and
|
|
54336
|
+
* custom position offsets (in half-points).
|
|
54337
|
+
*
|
|
54338
|
+
* Processing logic:
|
|
54339
|
+
* 1. Queries all text spans with ProseMirror position markers
|
|
54340
|
+
* 2. For each span, resolves the ProseMirror position to find the containing run node
|
|
54341
|
+
* 3. Extracts vertAlign and position from run properties and/or text style marks
|
|
54342
|
+
* 4. Applies CSS vertical-align and font-size styles based on the extracted properties
|
|
54343
|
+
* 5. Position takes precedence over vertAlign when both are present
|
|
54344
|
+
*
|
|
54345
|
+
* @throws Does not throw - DOM manipulation errors are silently caught to prevent layout corruption
|
|
54346
|
+
* @private
|
|
54347
|
+
*/
|
|
54348
|
+
#applyVertAlignToLayout() {
|
|
54349
|
+
const doc2 = this.#editor?.state?.doc;
|
|
54350
|
+
if (!doc2 || !this.#painterHost) return;
|
|
54351
|
+
try {
|
|
54352
|
+
const spans = this.#painterHost.querySelectorAll(".superdoc-line span[data-pm-start]");
|
|
54353
|
+
spans.forEach((span) => {
|
|
54354
|
+
try {
|
|
54355
|
+
if (span.closest(".superdoc-page-header, .superdoc-page-footer")) return;
|
|
54356
|
+
const pmStart = Number(span.dataset.pmStart ?? "NaN");
|
|
54357
|
+
if (!Number.isFinite(pmStart)) return;
|
|
54358
|
+
const pos = Math.max(0, Math.min(pmStart, doc2.content.size));
|
|
54359
|
+
const $pos = doc2.resolve(pos);
|
|
54360
|
+
let runNode = null;
|
|
54361
|
+
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
54362
|
+
const node = $pos.node(depth);
|
|
54363
|
+
if (node.type.name === "run") {
|
|
54364
|
+
runNode = node;
|
|
54365
|
+
break;
|
|
54366
|
+
}
|
|
54367
|
+
}
|
|
54368
|
+
let vertAlign = runNode?.attrs?.runProperties?.vertAlign ?? null;
|
|
54369
|
+
let position = runNode?.attrs?.runProperties?.position ?? null;
|
|
54370
|
+
let fontSizeHalfPts = runNode?.attrs?.runProperties?.fontSize ?? null;
|
|
54371
|
+
if (!vertAlign && position == null && runNode) {
|
|
54372
|
+
runNode.forEach((child) => {
|
|
54373
|
+
if (!child.isText || !child.marks?.length) return;
|
|
54374
|
+
const rpr = superEditor_converter.decodeRPrFromMarks(child.marks);
|
|
54375
|
+
if (rpr.vertAlign && !vertAlign) vertAlign = rpr.vertAlign;
|
|
54376
|
+
if (rpr.position != null && position == null) position = rpr.position;
|
|
54377
|
+
if (rpr.fontSize != null && fontSizeHalfPts == null) fontSizeHalfPts = rpr.fontSize;
|
|
54378
|
+
});
|
|
54379
|
+
}
|
|
54380
|
+
if (vertAlign == null && position == null) return;
|
|
54381
|
+
const styleEntries = [];
|
|
54382
|
+
if (position != null && Number.isFinite(position)) {
|
|
54383
|
+
const pts = helpers$1.halfPointToPoints(position);
|
|
54384
|
+
if (Number.isFinite(pts)) {
|
|
54385
|
+
styleEntries.push(`vertical-align: ${pts}pt`);
|
|
54386
|
+
}
|
|
54387
|
+
} else if (vertAlign === "superscript" || vertAlign === "subscript") {
|
|
54388
|
+
styleEntries.push(`vertical-align: ${vertAlign === "superscript" ? "super" : "sub"}`);
|
|
54389
|
+
if (fontSizeHalfPts != null && Number.isFinite(fontSizeHalfPts)) {
|
|
54390
|
+
const scaledPts = helpers$1.halfPointToPoints(fontSizeHalfPts * SUBSCRIPT_SUPERSCRIPT_SCALE);
|
|
54391
|
+
if (Number.isFinite(scaledPts)) {
|
|
54392
|
+
styleEntries.push(`font-size: ${scaledPts}pt`);
|
|
54393
|
+
} else {
|
|
54394
|
+
styleEntries.push(`font-size: ${SUBSCRIPT_SUPERSCRIPT_SCALE * 100}%`);
|
|
54395
|
+
}
|
|
54396
|
+
} else {
|
|
54397
|
+
styleEntries.push(`font-size: ${SUBSCRIPT_SUPERSCRIPT_SCALE * 100}%`);
|
|
54398
|
+
}
|
|
54399
|
+
} else if (vertAlign === "baseline") {
|
|
54400
|
+
styleEntries.push("vertical-align: baseline");
|
|
54401
|
+
}
|
|
54402
|
+
if (!styleEntries.length) return;
|
|
54403
|
+
const existing = span.getAttribute("style");
|
|
54404
|
+
const merged = existing ? `${existing}; ${styleEntries.join("; ")}` : styleEntries.join("; ");
|
|
54405
|
+
span.setAttribute("style", merged);
|
|
54406
|
+
} catch (error) {
|
|
54407
|
+
console.error("Failed to apply vertical alignment to span:", error);
|
|
54408
|
+
}
|
|
54409
|
+
});
|
|
54410
|
+
} catch (error) {
|
|
54411
|
+
console.error("Failed to apply vertical alignment to layout:", error);
|
|
54412
|
+
}
|
|
54413
|
+
}
|
|
54328
54414
|
}
|
|
54329
54415
|
const Color = Extension.create({
|
|
54330
54416
|
name: "color",
|
|
@@ -65866,7 +65952,63 @@ const TextStyle = Mark.create({
|
|
|
65866
65952
|
* @category Attribute
|
|
65867
65953
|
* @param {string} [styleId] - Style identifier for referencing predefined styles
|
|
65868
65954
|
*/
|
|
65869
|
-
styleId: {}
|
|
65955
|
+
styleId: {},
|
|
65956
|
+
/**
|
|
65957
|
+
* Vertical alignment for subscript/superscript text (DOCX w:vertAlign).
|
|
65958
|
+
* Standard values: 'superscript', 'subscript', 'baseline'.
|
|
65959
|
+
* When both vertAlign and position are present, position takes precedence.
|
|
65960
|
+
* Renders as CSS vertical-align with 65% font-size scaling for super/subscript.
|
|
65961
|
+
* @category Attribute
|
|
65962
|
+
* @param {string} [vertAlign] - Vertical alignment mode ('superscript' | 'subscript' | 'baseline')
|
|
65963
|
+
*/
|
|
65964
|
+
vertAlign: {
|
|
65965
|
+
default: null,
|
|
65966
|
+
renderDOM: (attrs) => {
|
|
65967
|
+
if (!attrs.vertAlign || attrs.position) return {};
|
|
65968
|
+
if (attrs.vertAlign === "superscript") {
|
|
65969
|
+
return { style: "vertical-align: super; font-size: 65%;" };
|
|
65970
|
+
}
|
|
65971
|
+
if (attrs.vertAlign === "subscript") {
|
|
65972
|
+
return { style: "vertical-align: sub; font-size: 65%;" };
|
|
65973
|
+
}
|
|
65974
|
+
if (attrs.vertAlign === "baseline") {
|
|
65975
|
+
return { style: "vertical-align: baseline;" };
|
|
65976
|
+
}
|
|
65977
|
+
return {};
|
|
65978
|
+
},
|
|
65979
|
+
parseDOM: (el) => {
|
|
65980
|
+
const va = el.style?.verticalAlign;
|
|
65981
|
+
if (va === "super") return "superscript";
|
|
65982
|
+
if (va === "sub") return "subscript";
|
|
65983
|
+
if (va === "baseline") return "baseline";
|
|
65984
|
+
return null;
|
|
65985
|
+
}
|
|
65986
|
+
},
|
|
65987
|
+
/**
|
|
65988
|
+
* Custom vertical position offset in points (DOCX w:position).
|
|
65989
|
+
* Numeric value specifying vertical offset (positive raises, negative lowers).
|
|
65990
|
+
* Format: '{number}pt' (e.g., '2pt', '-1.5pt').
|
|
65991
|
+
* Takes precedence over vertAlign when both are present.
|
|
65992
|
+
* Renders as CSS vertical-align with the exact offset value.
|
|
65993
|
+
* @category Attribute
|
|
65994
|
+
* @param {string} [position] - Vertical position offset (e.g., '2pt', '-1pt')
|
|
65995
|
+
*/
|
|
65996
|
+
position: {
|
|
65997
|
+
default: null,
|
|
65998
|
+
renderDOM: (attrs) => {
|
|
65999
|
+
if (!attrs.position) return {};
|
|
66000
|
+
return { style: `vertical-align: ${attrs.position};` };
|
|
66001
|
+
},
|
|
66002
|
+
parseDOM: (el) => {
|
|
66003
|
+
const va = el.style?.verticalAlign;
|
|
66004
|
+
if (!va) return null;
|
|
66005
|
+
const numeric = parseFloat(va);
|
|
66006
|
+
if (!Number.isNaN(numeric)) {
|
|
66007
|
+
return `${numeric}pt`;
|
|
66008
|
+
}
|
|
66009
|
+
return null;
|
|
66010
|
+
}
|
|
66011
|
+
}
|
|
65870
66012
|
};
|
|
65871
66013
|
},
|
|
65872
66014
|
addCommands() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const index = require("./index-
|
|
3
|
-
require("./SuperConverter-
|
|
2
|
+
const index = require("./index-BNpbdx2a.cjs");
|
|
3
|
+
require("./SuperConverter-Dy0-KTCc.cjs");
|
|
4
4
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
5
5
|
const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
|
|
6
6
|
const provider = require("@hocuspocus/provider");
|
|
@@ -7461,7 +7461,7 @@ const _sfc_main = {
|
|
|
7461
7461
|
__name: "SuperDoc",
|
|
7462
7462
|
emits: ["selection-update"],
|
|
7463
7463
|
setup(__props, { emit: __emit }) {
|
|
7464
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
7464
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BAoRLNIo.cjs")));
|
|
7465
7465
|
const superdocStore = useSuperdocStore();
|
|
7466
7466
|
const commentsStore = useCommentsStore();
|
|
7467
7467
|
const {
|
|
@@ -8367,7 +8367,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
8367
8367
|
this.config.colors = shuffleArray(this.config.colors);
|
|
8368
8368
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
8369
8369
|
this.colorIndex = 0;
|
|
8370
|
-
this.version = "1.
|
|
8370
|
+
this.version = "1.3.0-next.1";
|
|
8371
8371
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
8372
8372
|
this.superdocId = config.superdocId || uuid.v4();
|
|
8373
8373
|
this.colors = this.config.colors;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-
|
|
2
|
-
import "./SuperConverter-
|
|
1
|
+
import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-wwGlJ58Z.es.js";
|
|
2
|
+
import "./SuperConverter-BXP6NikG.es.js";
|
|
3
3
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
import { E as EventEmitter } from "./eventemitter3-CwrdEv8r.es.js";
|
|
5
5
|
import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
|
|
6
6
|
import "./jszip-B1fkPkPJ.es.js";
|
|
7
|
-
import "./helpers-
|
|
7
|
+
import "./helpers-C8e9wR5l.es.js";
|
|
8
8
|
import { i as inject, a as provide, c as computed, o as onBeforeUnmount, p as process$1, b as onBeforeMount, d as defineComponent, h, t as toRef, T as Transition, e as TransitionGroup, w as watchEffect, r as ref, f as onMounted, g as Teleport, F as Fragment, j as reactive, k as effectScope, m as markRaw, l as toRaw, n as isRef, q as isReactive, s as getCurrentInstance, u as watch, v as unref, x as hasInjectionContext, y as nextTick, z as getCurrentScope, A as onScopeDispose, B as toRefs, C as global, D as shallowRef, E as createElementBlock, G as openBlock, H as toDisplayString, I as createVNode, J as withCtx, K as createBaseVNode, L as normalizeStyle, M as createCommentVNode, N as createBlock, O as withModifiers, P as normalizeClass, Q as resolveDirective, R as withDirectives, S as renderList, U as createApp, V as resolveDynamicComponent, W as defineAsyncComponent } from "./vue-BnBKJwCW.es.js";
|
|
9
9
|
import "./jszip.min-DCl8qkFO.es.js";
|
|
10
10
|
import { createZip } from "../super-editor/file-zipper.es.js";
|
|
@@ -7444,7 +7444,7 @@ const _sfc_main = {
|
|
|
7444
7444
|
__name: "SuperDoc",
|
|
7445
7445
|
emits: ["selection-update"],
|
|
7446
7446
|
setup(__props, { emit: __emit }) {
|
|
7447
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
7447
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CkOzQzPk.es.js"));
|
|
7448
7448
|
const superdocStore = useSuperdocStore();
|
|
7449
7449
|
const commentsStore = useCommentsStore();
|
|
7450
7450
|
const {
|
|
@@ -8350,7 +8350,7 @@ class SuperDoc extends EventEmitter {
|
|
|
8350
8350
|
this.config.colors = shuffleArray(this.config.colors);
|
|
8351
8351
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
8352
8352
|
this.colorIndex = 0;
|
|
8353
|
-
this.version = "1.
|
|
8353
|
+
this.version = "1.3.0-next.1";
|
|
8354
8354
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
8355
8355
|
this.superdocId = config.superdocId || v4();
|
|
8356
8356
|
this.colors = this.config.colors;
|