ooxml-core 1.16.0 → 1.17.0
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/{PptxHandler-M35YFCUC.mjs → PptxHandler-K7GMS2ST.mjs} +2 -2
- package/dist/PptxHandler-L3JPWOBN.mjs +4 -0
- package/dist/{PptxHandler-3A7VEXVK.cjs → PptxHandler-U6EFO73T.cjs} +3 -3
- package/dist/{PresentationBuilder-XVRTITYR.cjs → PresentationBuilder-LUR6LGHU.cjs} +5 -5
- package/dist/{PresentationBuilder-Y6DJK6H2.mjs → PresentationBuilder-OK526SZ4.mjs} +2 -2
- package/dist/{PresentationBuilder-C7NPM7OQ.mjs → PresentationBuilder-XC3F3OPY.mjs} +2 -2
- package/dist/automation/index.cjs +45 -12
- package/dist/automation/index.mjs +45 -12
- package/dist/chart/index.cjs +23 -4
- package/dist/chart/index.mjs +23 -4
- package/dist/{chunk-B37EVUMG.mjs → chunk-A7S2NYAU.mjs} +1 -1
- package/dist/{chunk-LM6VBPQJ.mjs → chunk-HLZIALC5.mjs} +24 -5
- package/dist/{chunk-WBCV52YV.mjs → chunk-IM5LFEA2.mjs} +1 -1
- package/dist/{chunk-OKGQ2X7D.mjs → chunk-KU3SMBFU.mjs} +1 -1
- package/dist/{chunk-UGWY72WC.cjs → chunk-NYTR4UZ5.cjs} +23 -4
- package/dist/{chunk-KOX5Y5E5.mjs → chunk-UFGJNXRG.mjs} +1 -1
- package/dist/{chunk-AHRFBMLK.cjs → chunk-UWWS6VVJ.cjs} +1007 -1007
- package/dist/{chunk-WEFFRYXN.mjs → chunk-XTSHZGSM.mjs} +23 -4
- package/dist/{chunk-C2Y6SZDN.mjs → chunk-YS43OMM3.mjs} +4 -4
- package/dist/collab/broadcast-transport.d.ts.map +1 -1
- package/dist/collab/identity.d.ts +2 -0
- package/dist/collab/identity.d.ts.map +1 -1
- package/dist/collab/index.cjs +11 -2
- package/dist/collab/index.mjs +11 -3
- package/dist/crypto/index.cjs +23 -4
- package/dist/crypto/index.mjs +23 -4
- package/dist/diagram/index.cjs +23 -4
- package/dist/diagram/index.mjs +23 -4
- package/dist/docx/embedded.cjs +23 -4
- package/dist/docx/embedded.mjs +23 -4
- package/dist/docx/index.cjs +24 -5
- package/dist/docx/index.mjs +24 -5
- package/dist/docx/layout/index.cjs +24 -5
- package/dist/docx/layout/index.mjs +24 -5
- package/dist/docx/load/index.cjs +23 -4
- package/dist/docx/load/index.mjs +23 -4
- package/dist/docx/ui/index.cjs +32 -5
- package/dist/docx/ui/index.mjs +32 -5
- package/dist/drawingml/index.cjs +23 -4
- package/dist/drawingml/index.mjs +23 -4
- package/dist/index.cjs +23 -4
- package/dist/index.mjs +23 -4
- package/dist/math/index.cjs +23 -4
- package/dist/math/index.mjs +23 -4
- package/dist/opc/index.cjs +23 -4
- package/dist/opc/index.mjs +23 -4
- package/dist/pptx/automation/index.cjs +28 -9
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/cli/index.cjs +28 -9
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/index.cjs +28 -9
- package/dist/pptx/index.mjs +5 -5
- package/dist/teams/index.cjs +44 -9
- package/dist/teams/index.mjs +44 -9
- package/dist/visio/index.cjs +23 -4
- package/dist/visio/index.mjs +23 -4
- package/dist/visio/ui/document-history.d.ts +6 -1
- package/dist/visio/ui/document-history.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +49 -6
- package/dist/visio/ui/index.mjs +49 -7
- package/dist/xlsx/edit/context.d.ts.map +1 -1
- package/dist/xlsx/edit/slicers.d.ts.map +1 -1
- package/dist/xlsx/edit/timelines.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +45 -12
- package/dist/xlsx/index.mjs +45 -12
- package/dist/xlsx/load/index.cjs +32 -5
- package/dist/xlsx/load/index.mjs +32 -5
- package/dist/xlsx/ui/dialogs/grid-chart.d.ts +25 -0
- package/dist/xlsx/ui/dialogs/grid-chart.d.ts.map +1 -0
- package/dist/xlsx/ui/index.cjs +4721 -1063
- package/dist/xlsx/ui/index.d.ts +1 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -1
- package/dist/xlsx/ui/index.mjs +4714 -1063
- package/dist/xml/index.cjs +23 -4
- package/dist/xml/index.mjs +23 -4
- package/dist/xml/xml.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/PptxHandler-7POULDRL.mjs +0 -4
|
@@ -29118,15 +29118,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
29118
29118
|
maxDepth: 512,
|
|
29119
29119
|
maxNodes: 5e6
|
|
29120
29120
|
};
|
|
29121
|
-
var
|
|
29121
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
29122
|
+
var MARKUP_SKIPS = [
|
|
29123
|
+
["<!--", "-->"],
|
|
29124
|
+
["<![CDATA[", "]]>"],
|
|
29125
|
+
["<?", "?>"]
|
|
29126
|
+
];
|
|
29122
29127
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
29123
29128
|
const maxDepth2 = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
29124
29129
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
29125
29130
|
let depth = 0;
|
|
29126
29131
|
let nodes = 0;
|
|
29127
|
-
|
|
29128
|
-
|
|
29129
|
-
|
|
29132
|
+
let at2 = xml.indexOf("<");
|
|
29133
|
+
while (at2 !== -1) {
|
|
29134
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at2));
|
|
29135
|
+
if (skip) {
|
|
29136
|
+
const end = xml.indexOf(skip[1], at2 + skip[0].length);
|
|
29137
|
+
if (end === -1) return;
|
|
29138
|
+
at2 = xml.indexOf("<", end + skip[1].length);
|
|
29139
|
+
continue;
|
|
29140
|
+
}
|
|
29141
|
+
TAG_RE.lastIndex = at2;
|
|
29142
|
+
const match = TAG_RE.exec(xml);
|
|
29143
|
+
if (!match) {
|
|
29144
|
+
at2 = xml.indexOf("<", at2 + 1);
|
|
29145
|
+
continue;
|
|
29146
|
+
}
|
|
29147
|
+
const [, closing, , selfClosing] = match;
|
|
29148
|
+
at2 = xml.indexOf("<", at2 + match[0].length);
|
|
29130
29149
|
if (closing) {
|
|
29131
29150
|
depth--;
|
|
29132
29151
|
continue;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-
|
|
2
|
-
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, isLineDrawnChartType, chartFormatTargetKey, applyChartGroupOptionsInput, STANDARD_LAYOUTS, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, relationshipsPartFor, parseRelationships, resolvePartPath, clonePartGraph, buildRelationshipsXml, buildBlankPresentationArchive, nextRelationshipId, relativePartTarget, PptxXmlBuilder } from './chunk-
|
|
3
|
-
import { escAttr, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, elements, buildXml, bytesToBase64, base64ToBytes, hasTextProperties } from './chunk-
|
|
1
|
+
import { findText, replaceText, replaceTextInSlide, mergePresentation } from './chunk-UFGJNXRG.mjs';
|
|
2
|
+
import { PresentationBuilder, PptxHandler, SlideBuilder, validateSeriesIndex, removeEmptyDataPoint, ensureDataPoint, ensureChartData, assertChartGradientSupported, toChartGradientFill, isLineDrawnChartType, chartFormatTargetKey, applyChartGroupOptionsInput, STANDARD_LAYOUTS, createTextElement, createShapeElement, createImageElement, createTableElement, createChartElement, createConnectorElement, createMediaElement, createGroupElement, relationshipsPartFor, parseRelationships, resolvePartPath, clonePartGraph, buildRelationshipsXml, buildBlankPresentationArchive, nextRelationshipId, relativePartTarget, PptxXmlBuilder } from './chunk-IM5LFEA2.mjs';
|
|
3
|
+
import { escAttr, EMU_PER_PIXEL, EMU_PER_INCH, parseXml, first, elements, buildXml, bytesToBase64, base64ToBytes, hasTextProperties } from './chunk-HLZIALC5.mjs';
|
|
4
4
|
import { openPptxZip } from './chunk-M4XLF4R7.mjs';
|
|
5
5
|
import { cloneSlide, cloneElement } from './chunk-54S5A5PZ.mjs';
|
|
6
6
|
|
|
@@ -14957,7 +14957,7 @@ async function setPresentationRunText(bytes, slideIndex, elementId, runIndex, te
|
|
|
14957
14957
|
async function createPresentationFromOutline(slides, options = {}) {
|
|
14958
14958
|
if (!(slides instanceof Array) || !slides.length || slides.length > 200)
|
|
14959
14959
|
throw new Error("A presentation outline has 1 to 200 slides");
|
|
14960
|
-
const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-
|
|
14960
|
+
const { PresentationBuilder: PresentationBuilder2 } = await import('./PresentationBuilder-OK526SZ4.mjs');
|
|
14961
14961
|
const { handler, data, createSlide } = await PresentationBuilder2.create({
|
|
14962
14962
|
...options.title ? { title: options.title } : {}
|
|
14963
14963
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast-transport.d.ts","sourceRoot":"","sources":["../../collab/broadcast-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"broadcast-transport.d.ts","sourceRoot":"","sources":["../../collab/broadcast-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,YAAY,CAAC;AAI/D,mEAAmE;AACnE,MAAM,WAAW,oBAAoB;IACpC,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACvD;AACD,MAAM,MAAM,2BAA2B,GAAG,KAAK,IAAI,EAAE,MAAM,KAAK,oBAAoB,CAAC;AAErF,MAAM,WAAW,yBAAyB;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;CAC/C;AAiBD,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,KAAK,GAAE,MAAmB,GAAG,OAAO,CAEhE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,SAAS,CAmDtF"}
|
|
@@ -14,6 +14,8 @@ export declare function assignUserColor(seed: number | string, palette?: readonl
|
|
|
14
14
|
export declare function formatCursorLabel(userName: string, maxChars?: number): string;
|
|
15
15
|
/** Up to two uppercase initials: first+last for multi-word names, otherwise the first two letters. */
|
|
16
16
|
export declare function getUserInitials(name: string): string;
|
|
17
|
+
/** Eight random base-36 characters from the platform CSPRNG, or a counter when it is missing. */
|
|
18
|
+
export declare function randomToken(): string;
|
|
17
19
|
/** A random-enough client id for a session; `crypto.randomUUID` when present. */
|
|
18
20
|
export declare function createClientId(): string;
|
|
19
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../collab/identity.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEpE,eAAO,MAAM,mBAAmB,EAAE,SAAS,iBAAiB,EAI3D,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAI1E;AAED,uDAAuD;AACvD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAErE;AAED,wEAAwE;AACxE,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAS3C,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,4FAA4F;AAC5F,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,OAAO,GAAE,SAAS,MAAM,EAAmB,GACzC,MAAM,CAMR;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAwB,GAAG,MAAM,CAG9F;AAED,sGAAsG;AACtG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED,iFAAiF;AACjF,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAOD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAO5F;AAED,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IAC1B,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,MAAM,EAAE;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,SAAS,eAAe,EAAE,CAAC;CACxC,GAAG,UAAU,EAAE,CAuBf"}
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../collab/identity.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEpE,eAAO,MAAM,mBAAmB,EAAE,SAAS,iBAAiB,EAI3D,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAI1E;AAED,uDAAuD;AACvD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAErE;AAED,wEAAwE;AACxE,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAS3C,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,4FAA4F;AAC5F,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,OAAO,GAAE,SAAS,MAAM,EAAmB,GACzC,MAAM,CAMR;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAwB,GAAG,MAAM,CAG9F;AAED,sGAAsG;AACtG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED,iGAAiG;AACjG,wBAAgB,WAAW,IAAI,MAAM,CAWpC;AAGD,iFAAiF;AACjF,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAOD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAO5F;AAED,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IAC1B,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,MAAM,EAAE;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,SAAS,eAAe,EAAE,CAAC;CACxC,GAAG,UAAU,EAAE,CAuBf"}
|
package/dist/collab/index.cjs
CHANGED
|
@@ -205,10 +205,18 @@ function getUserInitials(name) {
|
|
|
205
205
|
if (parts.length >= 2 && first && last) return (first[0] + last[0]).toUpperCase();
|
|
206
206
|
return trimmed.slice(0, 2).toUpperCase();
|
|
207
207
|
}
|
|
208
|
+
function randomToken() {
|
|
209
|
+
const cryptoApi = globalThis.crypto;
|
|
210
|
+
if (cryptoApi?.getRandomValues) {
|
|
211
|
+
return cryptoApi.getRandomValues(new Uint32Array(2)).reduce((s, n) => s + n.toString(36), "").slice(0, 8);
|
|
212
|
+
}
|
|
213
|
+
return (fallbackCounter++).toString(36).padStart(8, "0");
|
|
214
|
+
}
|
|
215
|
+
var fallbackCounter = 0;
|
|
208
216
|
function createClientId() {
|
|
209
217
|
const cryptoApi = globalThis.crypto;
|
|
210
218
|
if (cryptoApi?.randomUUID) return cryptoApi.randomUUID();
|
|
211
|
-
return `c${Date.now().toString(36)}${
|
|
219
|
+
return `c${Date.now().toString(36)}${randomToken()}`;
|
|
212
220
|
}
|
|
213
221
|
function clientKey(clientId) {
|
|
214
222
|
if (!isValidId(clientId)) throw new Error("Invalid collaboration client ID");
|
|
@@ -505,7 +513,7 @@ function canBroadcast(scope = globalThis) {
|
|
|
505
513
|
function createBroadcastTransport(options) {
|
|
506
514
|
const roomId = validateRoomId(options.roomId);
|
|
507
515
|
const Channel = options.BroadcastChannel ?? globalThis.BroadcastChannel;
|
|
508
|
-
const self =
|
|
516
|
+
const self = randomToken() + Date.now().toString(36);
|
|
509
517
|
let channel = null;
|
|
510
518
|
let handlers = null;
|
|
511
519
|
const close = () => {
|
|
@@ -1459,6 +1467,7 @@ exports.mergeUpdates = mergeUpdates2;
|
|
|
1459
1467
|
exports.observeExternalSession = observeExternalSession;
|
|
1460
1468
|
exports.packageAdapter = packageAdapter;
|
|
1461
1469
|
exports.presenceToCursors = presenceToCursors;
|
|
1470
|
+
exports.randomToken = randomToken;
|
|
1462
1471
|
exports.registerTeardown = registerTeardown;
|
|
1463
1472
|
exports.removeAwarenessStatesLocally = removeAwarenessStatesLocally;
|
|
1464
1473
|
exports.restoreSnapshot = restoreSnapshot;
|
package/dist/collab/index.mjs
CHANGED
|
@@ -181,10 +181,18 @@ function getUserInitials(name) {
|
|
|
181
181
|
if (parts.length >= 2 && first && last) return (first[0] + last[0]).toUpperCase();
|
|
182
182
|
return trimmed.slice(0, 2).toUpperCase();
|
|
183
183
|
}
|
|
184
|
+
function randomToken() {
|
|
185
|
+
const cryptoApi = globalThis.crypto;
|
|
186
|
+
if (cryptoApi?.getRandomValues) {
|
|
187
|
+
return cryptoApi.getRandomValues(new Uint32Array(2)).reduce((s, n) => s + n.toString(36), "").slice(0, 8);
|
|
188
|
+
}
|
|
189
|
+
return (fallbackCounter++).toString(36).padStart(8, "0");
|
|
190
|
+
}
|
|
191
|
+
var fallbackCounter = 0;
|
|
184
192
|
function createClientId() {
|
|
185
193
|
const cryptoApi = globalThis.crypto;
|
|
186
194
|
if (cryptoApi?.randomUUID) return cryptoApi.randomUUID();
|
|
187
|
-
return `c${Date.now().toString(36)}${
|
|
195
|
+
return `c${Date.now().toString(36)}${randomToken()}`;
|
|
188
196
|
}
|
|
189
197
|
function clientKey(clientId) {
|
|
190
198
|
if (!isValidId(clientId)) throw new Error("Invalid collaboration client ID");
|
|
@@ -481,7 +489,7 @@ function canBroadcast(scope = globalThis) {
|
|
|
481
489
|
function createBroadcastTransport(options) {
|
|
482
490
|
const roomId = validateRoomId(options.roomId);
|
|
483
491
|
const Channel = options.BroadcastChannel ?? globalThis.BroadcastChannel;
|
|
484
|
-
const self =
|
|
492
|
+
const self = randomToken() + Date.now().toString(36);
|
|
485
493
|
let channel = null;
|
|
486
494
|
let handlers = null;
|
|
487
495
|
const close = () => {
|
|
@@ -1370,4 +1378,4 @@ function trimTrailingSlashes(value) {
|
|
|
1370
1378
|
return value.slice(0, end);
|
|
1371
1379
|
}
|
|
1372
1380
|
|
|
1373
|
-
export { BROADCAST_THROTTLE_MS, BoundedMap, COLLABORATION_ROLES, COLLAB_LEAVE_MESSAGE, CONNECTION_TIMEOUT_MS, CURSOR_PALETTE, DEFAULT_COLOR, DEFAULT_MAX_PACKAGE_BYTES, DEPARTURE_CHANNEL, Emitter, INITIAL_SYNC_GRACE_MS, IdempotencyCache, LEGACY_PPTX_DEPARTURE_CHANNEL, LEGACY_PPTX_LEAVE_MESSAGE, LOCAL_ORIGIN, MAX_LABEL_CHARS, MAX_UPDATE_BYTES, MESSAGE_AWARENESS, MESSAGE_QUERY_AWARENESS, MESSAGE_SYNC, PRESENCE_FIELD, PRESENCE_HEARTBEAT_MS, STALE_PRESENCE_MS, SequenceTracker, adaptYjsProvider, applyUpdateSafe, asSelectionIds, assignUserColor, bindDocument, borrowAwareness, buildRoster, canBroadcast, canWrite, clampCoordinate, classifyVersion, clearLocalAwareness, createAssetSync, createBroadcastTransport, createClientId, createCollabSession, createDepartureChannel, createIdGenerator, createMemoryHub, createPresencePublisher, createSyncGate, createTransportProvider, createWebSocketTransport, deriveCanvasPresence, derivePresence, encodeDiff, encodeSnapshot, encodeStateVector2 as encodeStateVector, formatCursorLabel, freezeDeep, fromBase64, getUserInitials, isMixedContentBlocked, isNonNegativeSafeInteger, isPresenceFresh, isValidId, isValidRoomId, mergeUpdates2 as mergeUpdates, observeExternalSession, packageAdapter, presenceToCursors, registerTeardown, removeAwarenessStatesLocally, restoreSnapshot, roomUrl, sanitizeAvatarUrl, sanitizeCanvasPayload, sanitizeColor, sanitizeIdentity, sanitizeIndex, sanitizeRole, sanitizeUserName, shouldAutoFollowBroadcaster, shouldRoomReplaceLoad, stripHtmlTags, toBase64, transportProvider, validateDisplayName, validateRoomId, validateUpdate };
|
|
1381
|
+
export { BROADCAST_THROTTLE_MS, BoundedMap, COLLABORATION_ROLES, COLLAB_LEAVE_MESSAGE, CONNECTION_TIMEOUT_MS, CURSOR_PALETTE, DEFAULT_COLOR, DEFAULT_MAX_PACKAGE_BYTES, DEPARTURE_CHANNEL, Emitter, INITIAL_SYNC_GRACE_MS, IdempotencyCache, LEGACY_PPTX_DEPARTURE_CHANNEL, LEGACY_PPTX_LEAVE_MESSAGE, LOCAL_ORIGIN, MAX_LABEL_CHARS, MAX_UPDATE_BYTES, MESSAGE_AWARENESS, MESSAGE_QUERY_AWARENESS, MESSAGE_SYNC, PRESENCE_FIELD, PRESENCE_HEARTBEAT_MS, STALE_PRESENCE_MS, SequenceTracker, adaptYjsProvider, applyUpdateSafe, asSelectionIds, assignUserColor, bindDocument, borrowAwareness, buildRoster, canBroadcast, canWrite, clampCoordinate, classifyVersion, clearLocalAwareness, createAssetSync, createBroadcastTransport, createClientId, createCollabSession, createDepartureChannel, createIdGenerator, createMemoryHub, createPresencePublisher, createSyncGate, createTransportProvider, createWebSocketTransport, deriveCanvasPresence, derivePresence, encodeDiff, encodeSnapshot, encodeStateVector2 as encodeStateVector, formatCursorLabel, freezeDeep, fromBase64, getUserInitials, isMixedContentBlocked, isNonNegativeSafeInteger, isPresenceFresh, isValidId, isValidRoomId, mergeUpdates2 as mergeUpdates, observeExternalSession, packageAdapter, presenceToCursors, randomToken, registerTeardown, removeAwarenessStatesLocally, restoreSnapshot, roomUrl, sanitizeAvatarUrl, sanitizeCanvasPayload, sanitizeColor, sanitizeIdentity, sanitizeIndex, sanitizeRole, sanitizeUserName, shouldAutoFollowBroadcaster, shouldRoomReplaceLoad, stripHtmlTags, toBase64, transportProvider, validateDisplayName, validateRoomId, validateUpdate };
|
package/dist/crypto/index.cjs
CHANGED
|
@@ -3210,15 +3210,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
3210
3210
|
maxDepth: 512,
|
|
3211
3211
|
maxNodes: 5e6
|
|
3212
3212
|
};
|
|
3213
|
-
var
|
|
3213
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
3214
|
+
var MARKUP_SKIPS = [
|
|
3215
|
+
["<!--", "-->"],
|
|
3216
|
+
["<![CDATA[", "]]>"],
|
|
3217
|
+
["<?", "?>"]
|
|
3218
|
+
];
|
|
3214
3219
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
3215
3220
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
3216
3221
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
3217
3222
|
let depth = 0;
|
|
3218
3223
|
let nodes = 0;
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3224
|
+
let at = xml.indexOf("<");
|
|
3225
|
+
while (at !== -1) {
|
|
3226
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
3227
|
+
if (skip) {
|
|
3228
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
3229
|
+
if (end === -1) return;
|
|
3230
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
3231
|
+
continue;
|
|
3232
|
+
}
|
|
3233
|
+
TAG_RE.lastIndex = at;
|
|
3234
|
+
const match = TAG_RE.exec(xml);
|
|
3235
|
+
if (!match) {
|
|
3236
|
+
at = xml.indexOf("<", at + 1);
|
|
3237
|
+
continue;
|
|
3238
|
+
}
|
|
3239
|
+
const [, closing, , selfClosing] = match;
|
|
3240
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
3222
3241
|
if (closing) {
|
|
3223
3242
|
depth--;
|
|
3224
3243
|
continue;
|
package/dist/crypto/index.mjs
CHANGED
|
@@ -3208,15 +3208,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
3208
3208
|
maxDepth: 512,
|
|
3209
3209
|
maxNodes: 5e6
|
|
3210
3210
|
};
|
|
3211
|
-
var
|
|
3211
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
3212
|
+
var MARKUP_SKIPS = [
|
|
3213
|
+
["<!--", "-->"],
|
|
3214
|
+
["<![CDATA[", "]]>"],
|
|
3215
|
+
["<?", "?>"]
|
|
3216
|
+
];
|
|
3212
3217
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
3213
3218
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
3214
3219
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
3215
3220
|
let depth = 0;
|
|
3216
3221
|
let nodes = 0;
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3222
|
+
let at = xml.indexOf("<");
|
|
3223
|
+
while (at !== -1) {
|
|
3224
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
3225
|
+
if (skip) {
|
|
3226
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
3227
|
+
if (end === -1) return;
|
|
3228
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
3229
|
+
continue;
|
|
3230
|
+
}
|
|
3231
|
+
TAG_RE.lastIndex = at;
|
|
3232
|
+
const match = TAG_RE.exec(xml);
|
|
3233
|
+
if (!match) {
|
|
3234
|
+
at = xml.indexOf("<", at + 1);
|
|
3235
|
+
continue;
|
|
3236
|
+
}
|
|
3237
|
+
const [, closing, , selfClosing] = match;
|
|
3238
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
3220
3239
|
if (closing) {
|
|
3221
3240
|
depth--;
|
|
3222
3241
|
continue;
|
package/dist/diagram/index.cjs
CHANGED
|
@@ -22539,15 +22539,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
22539
22539
|
maxDepth: 512,
|
|
22540
22540
|
maxNodes: 5e6
|
|
22541
22541
|
};
|
|
22542
|
-
var
|
|
22542
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
22543
|
+
var MARKUP_SKIPS = [
|
|
22544
|
+
["<!--", "-->"],
|
|
22545
|
+
["<![CDATA[", "]]>"],
|
|
22546
|
+
["<?", "?>"]
|
|
22547
|
+
];
|
|
22543
22548
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
22544
22549
|
const maxDepth2 = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
22545
22550
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
22546
22551
|
let depth = 0;
|
|
22547
22552
|
let nodes = 0;
|
|
22548
|
-
|
|
22549
|
-
|
|
22550
|
-
|
|
22553
|
+
let at = xml.indexOf("<");
|
|
22554
|
+
while (at !== -1) {
|
|
22555
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
22556
|
+
if (skip) {
|
|
22557
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
22558
|
+
if (end === -1) return;
|
|
22559
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
22560
|
+
continue;
|
|
22561
|
+
}
|
|
22562
|
+
TAG_RE.lastIndex = at;
|
|
22563
|
+
const match = TAG_RE.exec(xml);
|
|
22564
|
+
if (!match) {
|
|
22565
|
+
at = xml.indexOf("<", at + 1);
|
|
22566
|
+
continue;
|
|
22567
|
+
}
|
|
22568
|
+
const [, closing, , selfClosing] = match;
|
|
22569
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
22551
22570
|
if (closing) {
|
|
22552
22571
|
depth--;
|
|
22553
22572
|
continue;
|
package/dist/diagram/index.mjs
CHANGED
|
@@ -22537,15 +22537,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
22537
22537
|
maxDepth: 512,
|
|
22538
22538
|
maxNodes: 5e6
|
|
22539
22539
|
};
|
|
22540
|
-
var
|
|
22540
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
22541
|
+
var MARKUP_SKIPS = [
|
|
22542
|
+
["<!--", "-->"],
|
|
22543
|
+
["<![CDATA[", "]]>"],
|
|
22544
|
+
["<?", "?>"]
|
|
22545
|
+
];
|
|
22541
22546
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
22542
22547
|
const maxDepth2 = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
22543
22548
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
22544
22549
|
let depth = 0;
|
|
22545
22550
|
let nodes = 0;
|
|
22546
|
-
|
|
22547
|
-
|
|
22548
|
-
|
|
22551
|
+
let at = xml.indexOf("<");
|
|
22552
|
+
while (at !== -1) {
|
|
22553
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
22554
|
+
if (skip) {
|
|
22555
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
22556
|
+
if (end === -1) return;
|
|
22557
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
22558
|
+
continue;
|
|
22559
|
+
}
|
|
22560
|
+
TAG_RE.lastIndex = at;
|
|
22561
|
+
const match = TAG_RE.exec(xml);
|
|
22562
|
+
if (!match) {
|
|
22563
|
+
at = xml.indexOf("<", at + 1);
|
|
22564
|
+
continue;
|
|
22565
|
+
}
|
|
22566
|
+
const [, closing, , selfClosing] = match;
|
|
22567
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
22549
22568
|
if (closing) {
|
|
22550
22569
|
depth--;
|
|
22551
22570
|
continue;
|
package/dist/docx/embedded.cjs
CHANGED
|
@@ -35,15 +35,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
35
35
|
maxDepth: 512,
|
|
36
36
|
maxNodes: 5e6
|
|
37
37
|
};
|
|
38
|
-
var
|
|
38
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
39
|
+
var MARKUP_SKIPS = [
|
|
40
|
+
["<!--", "-->"],
|
|
41
|
+
["<![CDATA[", "]]>"],
|
|
42
|
+
["<?", "?>"]
|
|
43
|
+
];
|
|
39
44
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
40
45
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
41
46
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
42
47
|
let depth = 0;
|
|
43
48
|
let nodes = 0;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
let at = xml.indexOf("<");
|
|
50
|
+
while (at !== -1) {
|
|
51
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
52
|
+
if (skip) {
|
|
53
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
54
|
+
if (end === -1) return;
|
|
55
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
TAG_RE.lastIndex = at;
|
|
59
|
+
const match = TAG_RE.exec(xml);
|
|
60
|
+
if (!match) {
|
|
61
|
+
at = xml.indexOf("<", at + 1);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const [, closing, , selfClosing] = match;
|
|
65
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
47
66
|
if (closing) {
|
|
48
67
|
depth--;
|
|
49
68
|
continue;
|
package/dist/docx/embedded.mjs
CHANGED
|
@@ -29,15 +29,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
29
29
|
maxDepth: 512,
|
|
30
30
|
maxNodes: 5e6
|
|
31
31
|
};
|
|
32
|
-
var
|
|
32
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
33
|
+
var MARKUP_SKIPS = [
|
|
34
|
+
["<!--", "-->"],
|
|
35
|
+
["<![CDATA[", "]]>"],
|
|
36
|
+
["<?", "?>"]
|
|
37
|
+
];
|
|
33
38
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
34
39
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
35
40
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
36
41
|
let depth = 0;
|
|
37
42
|
let nodes = 0;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
let at = xml.indexOf("<");
|
|
44
|
+
while (at !== -1) {
|
|
45
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
46
|
+
if (skip) {
|
|
47
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
48
|
+
if (end === -1) return;
|
|
49
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
TAG_RE.lastIndex = at;
|
|
53
|
+
const match = TAG_RE.exec(xml);
|
|
54
|
+
if (!match) {
|
|
55
|
+
at = xml.indexOf("<", at + 1);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const [, closing, , selfClosing] = match;
|
|
59
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
41
60
|
if (closing) {
|
|
42
61
|
depth--;
|
|
43
62
|
continue;
|
package/dist/docx/index.cjs
CHANGED
|
@@ -35,15 +35,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
35
35
|
maxDepth: 512,
|
|
36
36
|
maxNodes: 5e6
|
|
37
37
|
};
|
|
38
|
-
var
|
|
38
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
39
|
+
var MARKUP_SKIPS = [
|
|
40
|
+
["<!--", "-->"],
|
|
41
|
+
["<![CDATA[", "]]>"],
|
|
42
|
+
["<?", "?>"]
|
|
43
|
+
];
|
|
39
44
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
40
45
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
41
46
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
42
47
|
let depth = 0;
|
|
43
48
|
let nodes = 0;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
let at = xml.indexOf("<");
|
|
50
|
+
while (at !== -1) {
|
|
51
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
52
|
+
if (skip) {
|
|
53
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
54
|
+
if (end === -1) return;
|
|
55
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
TAG_RE.lastIndex = at;
|
|
59
|
+
const match = TAG_RE.exec(xml);
|
|
60
|
+
if (!match) {
|
|
61
|
+
at = xml.indexOf("<", at + 1);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const [, closing, , selfClosing] = match;
|
|
65
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
47
66
|
if (closing) {
|
|
48
67
|
depth--;
|
|
49
68
|
continue;
|
|
@@ -26938,7 +26957,7 @@ function shapeSvg(spec, widthPx, heightPx, theme) {
|
|
|
26938
26957
|
spec.flipH || spec.flipV ? `translate(${spec.flipH ? w : 0} ${spec.flipV ? h : 0}) scale(${spec.flipH ? -1 : 1} ${spec.flipV ? -1 : 1})` : ""
|
|
26939
26958
|
].filter(Boolean).join(" ");
|
|
26940
26959
|
const label = escapeXml(lookupPresetShape(spec.preset) ? spec.preset : "Shape");
|
|
26941
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform2 ? ` transform="${transform2}"` : ""}>${paths}${text3}</g></svg>`;
|
|
26960
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform2 ? ` transform="${escapeXml(transform2)}"` : ""}>${paths}${text3}</g></svg>`;
|
|
26942
26961
|
}
|
|
26943
26962
|
|
|
26944
26963
|
exports.CHART_GRAPHIC_URI = CHART_GRAPHIC_URI;
|
package/dist/docx/index.mjs
CHANGED
|
@@ -29,15 +29,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
29
29
|
maxDepth: 512,
|
|
30
30
|
maxNodes: 5e6
|
|
31
31
|
};
|
|
32
|
-
var
|
|
32
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
33
|
+
var MARKUP_SKIPS = [
|
|
34
|
+
["<!--", "-->"],
|
|
35
|
+
["<![CDATA[", "]]>"],
|
|
36
|
+
["<?", "?>"]
|
|
37
|
+
];
|
|
33
38
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
34
39
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
35
40
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
36
41
|
let depth = 0;
|
|
37
42
|
let nodes = 0;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
let at = xml.indexOf("<");
|
|
44
|
+
while (at !== -1) {
|
|
45
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
46
|
+
if (skip) {
|
|
47
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
48
|
+
if (end === -1) return;
|
|
49
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
TAG_RE.lastIndex = at;
|
|
53
|
+
const match = TAG_RE.exec(xml);
|
|
54
|
+
if (!match) {
|
|
55
|
+
at = xml.indexOf("<", at + 1);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const [, closing, , selfClosing] = match;
|
|
59
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
41
60
|
if (closing) {
|
|
42
61
|
depth--;
|
|
43
62
|
continue;
|
|
@@ -26932,7 +26951,7 @@ function shapeSvg(spec, widthPx, heightPx, theme) {
|
|
|
26932
26951
|
spec.flipH || spec.flipV ? `translate(${spec.flipH ? w : 0} ${spec.flipV ? h : 0}) scale(${spec.flipH ? -1 : 1} ${spec.flipV ? -1 : 1})` : ""
|
|
26933
26952
|
].filter(Boolean).join(" ");
|
|
26934
26953
|
const label = escapeXml(lookupPresetShape(spec.preset) ? spec.preset : "Shape");
|
|
26935
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform2 ? ` transform="${transform2}"` : ""}>${paths}${text3}</g></svg>`;
|
|
26954
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform2 ? ` transform="${escapeXml(transform2)}"` : ""}>${paths}${text3}</g></svg>`;
|
|
26936
26955
|
}
|
|
26937
26956
|
|
|
26938
26957
|
export { CHART_GRAPHIC_URI, CHART_NOTICE, DEFAULT_DRAWN_SHAPE, DEFAULT_SHAPE_FILL, DEFAULT_SHAPE_LINE, DEFAULT_SHAPE_LINE_EMU, DEFAULT_STYLES_XML, DEFAULT_TABLE_BORDERS, DEFAULT_TOC_INSTRUCTION, DIAGRAM_GRAPHIC_URI, DocxModelValidationError, EMPTY_FIGURES_TEXT, EMPTY_TOC_TEXT, EMU_PER_INCH, EMU_PER_PIXEL, EMU_PER_POINT, LIGATURE_VALUES, PAGE_SIZES, PAGE_SIZE_OPTIONS, PIXELS_PER_INCH, PROPERTY_FIELDS, SHAPE_PALETTE, SHAPE_PALETTE_NAMES, ST_AlgClass, ST_AlgType, ST_AnnotationVMerge, ST_Border, ST_BrClear, ST_BrType, ST_CalendarType, ST_CaptionPos, ST_ChapterSep, ST_CharacterSpacing, ST_CombineBrackets, ST_ConformanceClass, ST_CryptProv, ST_Direction, ST_DisplacedByCustomXml, ST_DocGrid, ST_DocPartBehavior, ST_DocPartGallery, ST_DocPartType, ST_DocProtect, ST_DropCap, ST_EdGrp, ST_EdnPos, ST_Em, ST_FFTextType, ST_FldCharType, ST_FontFamily, ST_FrameLayout, ST_FrameScrollbar, ST_FtnEdn, ST_FtnPos, ST_HAnchor, ST_HdrFtr, ST_HeightRule, ST_HexColorAuto, ST_HighlightColor, ST_Hint, ST_InfoTextType, ST_Jc, ST_JcTable, ST_LevelSuffix, ST_LineNumberRestart, ST_LineSpacingRule, ST_Lock, ST_MailMergeDest, ST_MailMergeDocType, ST_MailMergeOdsoFMDFieldType, ST_MailMergeSourceType, ST_Merge, ST_MultiLevelType, ST_NumberFormat, ST_ObjectDrawAspect, ST_ObjectUpdateMode, ST_OnOff1, ST_PTabAlignment, ST_PTabLeader, ST_PTabRelativeTo, ST_PageBorderDisplay, ST_PageBorderOffset, ST_PageBorderZOrder, ST_PageOrientation, ST_Pitch, ST_Proof, ST_ProofErr, ST_RelFromH, ST_RelFromV, ST_RestartNumber, ST_RubyAlign, ST_SchemeColorVal, ST_SdtDateMappingType, ST_SectionMark, ST_Shd, ST_StyleSort, ST_StyleType, ST_TabJc, ST_TabTlc, ST_TargetScreenSz, ST_TblLayoutType, ST_TblOverlap, ST_TblStyleOverrideType, ST_TblWidth, ST_TextAlignment, ST_TextDirection, ST_TextEffect, ST_TextboxTightWrap, ST_Theme, ST_ThemeColor, ST_TrueFalse, ST_TrueFalseBlank, ST_Underline, ST_VAnchor, ST_VerticalAlignRun, ST_VerticalJc, ST_View, ST_WmlColorSchemeIndex, ST_Wrap, ST_XAlign, ST_YAlign, ST_Zoom, TWIPS_PER_INCH, TWIPS_PER_POINT, WORD, WORD_HIGHLIGHT_TOKENS, WORD_UNDERLINE_TOKENS, acceptAllRevisions, acceptRevision, alignFromJustification, applyPageSetup, applyThemeShade, applyThemeTint, assertValidDocumentModel, buildTableOfContents, canDeleteControl, canEditControlContent, captionParagraphs, cellSourceBlocks, changeColumnGap, changeColumnWidth, chartsIn, checkboxState, columnPreset, columnTextWidth, computeListLabels, controlDate, createDocument, createListDefinition, dateFieldResult, datePicture, defaultPlaceholder, defaultStyleCatalogs, diagramColorTheme, diagramsIn, displayListLabel, documentStats, docxChartPaint, eighthPoints, eighthPointsFromPoints, eighthPointsToPoints, emu, emuFromPixels, emuToPixels, ensureListDefinition, enumValue, equalColumnDraft, fieldName, findRevision, findTableOfContents, formatListNumber, formatNoteNumber, formatWordDate, fullDateOf, halfPoints, halfPointsFromPoints, halfPointsToPoints, headingLevel, headingListLevels, isCaptionOf, isDirectionalPreset, isFieldLocked, isHeadingListKind, isLigatures, isLinePreset, isRunHiddenForReview, isStAlgClass, isStAlgType, isStAnnotationVMerge, isStBorder, isStBrClear, isStBrType, isStCalendarType, isStCaptionPos, isStChapterSep, isStCharacterSpacing, isStCombineBrackets, isStConformanceClass, isStCryptProv, isStDirection, isStDisplacedByCustomXml, isStDocGrid, isStDocPartBehavior, isStDocPartGallery, isStDocPartType, isStDocProtect, isStDropCap, isStEdGrp, isStEdnPos, isStEm, isStFFTextType, isStFldCharType, isStFontFamily, isStFrameLayout, isStFrameScrollbar, isStFtnEdn, isStFtnPos, isStHAnchor, isStHdrFtr, isStHeightRule, isStHexColorAuto, isStHighlightColor, isStHint, isStInfoTextType, isStJc, isStJcTable, isStLevelSuffix, isStLineNumberRestart, isStLineSpacingRule, isStLock, isStMailMergeDest, isStMailMergeDocType, isStMailMergeOdsoFMDFieldType, isStMailMergeSourceType, isStMerge, isStMultiLevelType, isStNumberFormat, isStObjectDrawAspect, isStObjectUpdateMode, isStOnOff1, isStPTabAlignment, isStPTabLeader, isStPTabRelativeTo, isStPageBorderDisplay, isStPageBorderOffset, isStPageBorderZOrder, isStPageOrientation, isStPitch, isStProof, isStProofErr, isStRelFromH, isStRelFromV, isStRestartNumber, isStRubyAlign, isStSchemeColorVal, isStSdtDateMappingType, isStSectionMark, isStShd, isStStyleSort, isStStyleType, isStTabJc, isStTabTlc, isStTargetScreenSz, isStTblLayoutType, isStTblOverlap, isStTblStyleOverrideType, isStTblWidth, isStTextAlignment, isStTextDirection, isStTextEffect, isStTextboxTightWrap, isStTheme, isStThemeColor, isStTrueFalse, isStTrueFalseBlank, isStUnderline, isStVAnchor, isStVerticalAlignRun, isStVerticalJc, isStView, isStWmlColorSchemeIndex, isStWrap, isStXAlign, isStYAlign, isStZoom, isThemeColorToken, isValidLanguageTag, isWordHighlightToken, isWordUnderlineStyle, lineSpacingLabel, lineSpacingOptions, lineSpacingValue, linkStylesToList, listRevisions, loadDocx, newShape, numberNotesInOrder, onOffAttribute, onOffElement, pageSizeOf, paragraphTwipsFromAttrs, parseColorSchemeMapping, parseContentControl, parseEighthPoints, parseHalfPoints, parseHexColor, parseInteger, parseJustification, parseLineSpacingValue, parseNumberingCatalog, parseOnOff, parseParagraphStyleCatalog, parseRgbColor, parseRunStyleCatalog, parseSignedHalfPoints, parseSignedTwips, parseTableStyleCatalog, parseTextScale, parseTheme2 as parseTheme, parseTintShade, parseTwips, parseUnsignedInteger, plainText2 as plainText, presetOf, readColumnDraft, readPageSetup, rejectAllRevisions, rejectRevision, reportParseWarning, resolveCellVisuals, resolveDiagramColor, resolveNumberingLevel, resolveParagraphFormatting, resolveParagraphNumbering, resolveRunFormatting, resolveStyleNumbering, resolveTableStyleFormatting, resolveThemeColorReference, resolveThemeColorToken, reviewDocumentFormatting, reviewFormattingWarnings, reviewParagraphFormatting, reviewRunFormatting, roundEighthPoints, roundEmu, roundHalfPoints, roundSignedTwips, roundTwips, saveDocx, sectionLayoutJson, sectionsFromLayout, sectionsOf, selectListItem, setColumns, setControlDate, setLineNumbering, setListStartOverride, setMargins, setOrientation, setPageNumbering, setPageSize, setTitlePage, setVerticalAlign, shapeAppearance, shapeColorCss, shapeSvg, shapeTextColor, signedTwips, signedTwipsAttr, signedTwipsFromPixels, signedTwipsFromPoints, tableOfFiguresInstruction, themeCatalogColorScheme, tocBookmarks, tocCaptionLabel, tocEntries, tocHyperlinks, tocLevels, toggleCheckbox, transformCase, twips, twipsAttr, twipsFromInches, twipsFromPixels, twipsFromPoints, twipsToInches, twipsToPixels, twipsToPoints, unequalColumnPreset, universalMeasureToTwips, updateTableOfContents, validColumnDraft, validateDocumentModel, validatePageSetup, withParseWarnings, withSection, withTocBookmarks, withValue };
|
|
@@ -12,15 +12,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
12
12
|
maxDepth: 512,
|
|
13
13
|
maxNodes: 5e6
|
|
14
14
|
};
|
|
15
|
-
var
|
|
15
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
16
|
+
var MARKUP_SKIPS = [
|
|
17
|
+
["<!--", "-->"],
|
|
18
|
+
["<![CDATA[", "]]>"],
|
|
19
|
+
["<?", "?>"]
|
|
20
|
+
];
|
|
16
21
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
17
22
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
18
23
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
19
24
|
let depth = 0;
|
|
20
25
|
let nodes = 0;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
let at = xml.indexOf("<");
|
|
27
|
+
while (at !== -1) {
|
|
28
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
29
|
+
if (skip) {
|
|
30
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
31
|
+
if (end === -1) return;
|
|
32
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
TAG_RE.lastIndex = at;
|
|
36
|
+
const match = TAG_RE.exec(xml);
|
|
37
|
+
if (!match) {
|
|
38
|
+
at = xml.indexOf("<", at + 1);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const [, closing, , selfClosing] = match;
|
|
42
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
24
43
|
if (closing) {
|
|
25
44
|
depth--;
|
|
26
45
|
continue;
|
|
@@ -15310,7 +15329,7 @@ function shapeSvg(spec, widthPx, heightPx, theme) {
|
|
|
15310
15329
|
spec.flipH || spec.flipV ? `translate(${spec.flipH ? w : 0} ${spec.flipV ? h : 0}) scale(${spec.flipH ? -1 : 1} ${spec.flipV ? -1 : 1})` : ""
|
|
15311
15330
|
].filter(Boolean).join(" ");
|
|
15312
15331
|
const label = escapeXml(lookupPresetShape(spec.preset) ? spec.preset : "Shape");
|
|
15313
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform ? ` transform="${transform}"` : ""}>${paths}${text2}</g></svg>`;
|
|
15332
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform ? ` transform="${escapeXml(transform)}"` : ""}>${paths}${text2}</g></svg>`;
|
|
15314
15333
|
}
|
|
15315
15334
|
|
|
15316
15335
|
// docx/layout/units.ts
|
|
@@ -10,15 +10,34 @@ var DEFAULT_XML_LIMITS = {
|
|
|
10
10
|
maxDepth: 512,
|
|
11
11
|
maxNodes: 5e6
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var TAG_RE = /<(\/?)([^\s\/><]+)(?:\s+[^\s=\/><]+\s*=\s*(?:"[^"<]*"|'[^'<]*'))*\s*(\/?)>/y;
|
|
14
|
+
var MARKUP_SKIPS = [
|
|
15
|
+
["<!--", "-->"],
|
|
16
|
+
["<![CDATA[", "]]>"],
|
|
17
|
+
["<?", "?>"]
|
|
18
|
+
];
|
|
14
19
|
function checkXmlLimits(xml, label, limits = {}) {
|
|
15
20
|
const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
|
|
16
21
|
const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
|
|
17
22
|
let depth = 0;
|
|
18
23
|
let nodes = 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
let at = xml.indexOf("<");
|
|
25
|
+
while (at !== -1) {
|
|
26
|
+
const skip = MARKUP_SKIPS.find(([open]) => xml.startsWith(open, at));
|
|
27
|
+
if (skip) {
|
|
28
|
+
const end = xml.indexOf(skip[1], at + skip[0].length);
|
|
29
|
+
if (end === -1) return;
|
|
30
|
+
at = xml.indexOf("<", end + skip[1].length);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
TAG_RE.lastIndex = at;
|
|
34
|
+
const match = TAG_RE.exec(xml);
|
|
35
|
+
if (!match) {
|
|
36
|
+
at = xml.indexOf("<", at + 1);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const [, closing, , selfClosing] = match;
|
|
40
|
+
at = xml.indexOf("<", at + match[0].length);
|
|
22
41
|
if (closing) {
|
|
23
42
|
depth--;
|
|
24
43
|
continue;
|
|
@@ -15308,7 +15327,7 @@ function shapeSvg(spec, widthPx, heightPx, theme) {
|
|
|
15308
15327
|
spec.flipH || spec.flipV ? `translate(${spec.flipH ? w : 0} ${spec.flipV ? h : 0}) scale(${spec.flipH ? -1 : 1} ${spec.flipV ? -1 : 1})` : ""
|
|
15309
15328
|
].filter(Boolean).join(" ");
|
|
15310
15329
|
const label = escapeXml(lookupPresetShape(spec.preset) ? spec.preset : "Shape");
|
|
15311
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform ? ` transform="${transform}"` : ""}>${paths}${text2}</g></svg>`;
|
|
15330
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${round(w)}" height="${round(h)}" viewBox="0 0 ${round(w)} ${round(h)}" style="overflow:visible" role="img" aria-label="${label}"><g${transform ? ` transform="${escapeXml(transform)}"` : ""}>${paths}${text2}</g></svg>`;
|
|
15312
15331
|
}
|
|
15313
15332
|
|
|
15314
15333
|
// docx/layout/units.ts
|