pptx-react-viewer 3.21.0 → 4.1.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/CHANGELOG.md +23 -0
- package/dist/{AiChatPanel-UD756KAU.mjs → AiChatPanel-C3ACRWOY.mjs} +4 -4
- package/dist/AiChatPanel-C3ACRWOY.mjs.br +0 -0
- package/dist/AiChatPanel-C3ACRWOY.mjs.gz +0 -0
- package/dist/{AiChatPanel-B3QM7MIC.js → AiChatPanel-GQNSKMP6.js} +25 -25
- package/dist/AiChatPanel-GQNSKMP6.js.br +0 -0
- package/dist/AiChatPanel-GQNSKMP6.js.gz +0 -0
- package/dist/{Area3DChartScene-435BFPLY.js → Area3DChartScene-3I6KB2DN.js} +2 -2
- package/dist/{Area3DChartScene-435BFPLY.js.br → Area3DChartScene-3I6KB2DN.js.br} +0 -0
- package/dist/Area3DChartScene-3I6KB2DN.js.gz +0 -0
- package/dist/{Area3DChartScene-MQKUWVMS.mjs → Area3DChartScene-4TPNRYXS.mjs} +1 -1
- package/dist/Area3DChartScene-4TPNRYXS.mjs.br +0 -0
- package/dist/Area3DChartScene-4TPNRYXS.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-D4GMQGPN.mjs → Bar3DChartScene-V45IUIT7.mjs} +1 -1
- package/dist/Bar3DChartScene-V45IUIT7.mjs.br +0 -0
- package/dist/Bar3DChartScene-V45IUIT7.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-KEYLVYJA.js → Bar3DChartScene-ZSCATOYF.js} +2 -2
- package/dist/Bar3DChartScene-ZSCATOYF.js.br +0 -0
- package/dist/Bar3DChartScene-ZSCATOYF.js.gz +0 -0
- package/dist/{Line3DChartScene-B3AWFXE4.mjs → Line3DChartScene-DCQJEZK6.mjs} +1 -1
- package/dist/Line3DChartScene-DCQJEZK6.mjs.br +0 -0
- package/dist/Line3DChartScene-DCQJEZK6.mjs.gz +0 -0
- package/dist/{Line3DChartScene-JYGXLE56.js → Line3DChartScene-DK55LQ2D.js} +2 -2
- package/dist/{Line3DChartScene-JYGXLE56.js.br → Line3DChartScene-DK55LQ2D.js.br} +0 -0
- package/dist/Line3DChartScene-DK55LQ2D.js.gz +0 -0
- package/dist/{Model3DScene-JF5J6N6W.js → Model3DScene-2WNP4XBP.js} +2 -2
- package/dist/Model3DScene-2WNP4XBP.js.br +0 -0
- package/dist/Model3DScene-2WNP4XBP.js.gz +0 -0
- package/dist/{Model3DScene-4TG4YRVM.mjs → Model3DScene-SA5XMR2D.mjs} +1 -1
- package/dist/Model3DScene-SA5XMR2D.mjs.br +0 -0
- package/dist/Model3DScene-SA5XMR2D.mjs.gz +0 -0
- package/dist/{PieChart3DScene-4BQ6PR7P.mjs → PieChart3DScene-HC2ZWL42.mjs} +1 -1
- package/dist/PieChart3DScene-HC2ZWL42.mjs.br +0 -0
- package/dist/PieChart3DScene-HC2ZWL42.mjs.gz +0 -0
- package/dist/{PieChart3DScene-CCQWSH3W.js → PieChart3DScene-Q75D66HS.js} +2 -2
- package/dist/{PieChart3DScene-CCQWSH3W.js.br → PieChart3DScene-Q75D66HS.js.br} +0 -0
- package/dist/PieChart3DScene-Q75D66HS.js.gz +0 -0
- package/dist/{SmartArt3DScene-QZGIABOK.mjs → SmartArt3DScene-D4VNNPHS.mjs} +124 -19
- package/dist/SmartArt3DScene-D4VNNPHS.mjs.br +0 -0
- package/dist/SmartArt3DScene-D4VNNPHS.mjs.gz +0 -0
- package/dist/{SmartArt3DScene-T236GYUT.js → SmartArt3DScene-NHD7CZJ5.js} +123 -18
- package/dist/SmartArt3DScene-NHD7CZJ5.js.br +0 -0
- package/dist/SmartArt3DScene-NHD7CZJ5.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-FRQC5HBG.mjs → SurfaceChart3DScene-JRMX4PN5.mjs} +1 -1
- package/dist/SurfaceChart3DScene-JRMX4PN5.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JRMX4PN5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-UVZPT6OD.js → SurfaceChart3DScene-ODS5E6ZG.js} +2 -2
- package/dist/{SurfaceChart3DScene-UVZPT6OD.js.br → SurfaceChart3DScene-ODS5E6ZG.js.br} +0 -0
- package/dist/SurfaceChart3DScene-ODS5E6ZG.js.gz +0 -0
- package/dist/{chunk-EJMDD4VV.mjs → chunk-25CABWCR.mjs} +131 -329
- package/dist/chunk-25CABWCR.mjs.br +0 -0
- package/dist/chunk-25CABWCR.mjs.gz +0 -0
- package/dist/{chunk-BXMPXKV5.mjs → chunk-3B6YIH4K.mjs} +626 -133
- package/dist/chunk-3B6YIH4K.mjs.br +0 -0
- package/dist/chunk-3B6YIH4K.mjs.gz +0 -0
- package/dist/{chunk-BFPIMU6Q.js → chunk-A6JKOHSV.js} +2143 -1644
- package/dist/chunk-A6JKOHSV.js.br +0 -0
- package/dist/chunk-A6JKOHSV.js.gz +0 -0
- package/dist/{chunk-TOOKJUPG.mjs → chunk-GRAARMUW.mjs} +1 -1
- package/dist/chunk-GRAARMUW.mjs.br +0 -0
- package/dist/chunk-GRAARMUW.mjs.gz +0 -0
- package/dist/{chunk-H7QPQ4OR.js → chunk-MQHMMB6V.js} +5 -5
- package/dist/chunk-MQHMMB6V.js.br +0 -0
- package/dist/chunk-MQHMMB6V.js.gz +0 -0
- package/dist/{chunk-M6QJKPU2.js → chunk-NR4MQJM5.js} +1961 -2161
- package/dist/chunk-NR4MQJM5.js.br +0 -0
- package/dist/chunk-NR4MQJM5.js.gz +0 -0
- package/dist/{chunk-M24DEOP6.js → chunk-NXGUR2DO.js} +2 -0
- package/dist/chunk-NXGUR2DO.js.br +0 -0
- package/dist/chunk-NXGUR2DO.js.gz +0 -0
- package/dist/{chunk-R664EPDC.mjs → chunk-PC7H3C5W.mjs} +2 -0
- package/dist/chunk-PC7H3C5W.mjs.br +0 -0
- package/dist/chunk-PC7H3C5W.mjs.gz +0 -0
- package/dist/{chunk-SUZIFHXI.js → chunk-PUALTXTU.js} +182 -182
- package/dist/chunk-PUALTXTU.js.br +0 -0
- package/dist/chunk-PUALTXTU.js.gz +0 -0
- package/dist/{chunk-TMTQJAGK.mjs → chunk-Q6QJOD56.mjs} +2307 -552
- package/dist/chunk-Q6QJOD56.mjs.br +0 -0
- package/dist/chunk-Q6QJOD56.mjs.gz +0 -0
- package/dist/{chunk-T6V342NP.js → chunk-SK2CZQ6P.js} +2313 -551
- package/dist/chunk-SK2CZQ6P.js.br +0 -0
- package/dist/chunk-SK2CZQ6P.js.gz +0 -0
- package/dist/{chunk-HZEOZUUH.mjs → chunk-WLWAYLL6.mjs} +2 -2
- package/dist/chunk-WLWAYLL6.mjs.br +0 -0
- package/dist/chunk-WLWAYLL6.mjs.gz +0 -0
- package/dist/i18n/de.cjs +2 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +2 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +2 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +2 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +2 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +2 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +2 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +2 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +586 -7
- package/dist/index.js +52 -48
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +447 -13
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +32 -32
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-B3QM7MIC.js.br +0 -0
- package/dist/AiChatPanel-B3QM7MIC.js.gz +0 -0
- package/dist/AiChatPanel-UD756KAU.mjs.br +0 -0
- package/dist/AiChatPanel-UD756KAU.mjs.gz +0 -0
- package/dist/Area3DChartScene-435BFPLY.js.gz +0 -0
- package/dist/Area3DChartScene-MQKUWVMS.mjs.br +0 -0
- package/dist/Area3DChartScene-MQKUWVMS.mjs.gz +0 -0
- package/dist/Bar3DChartScene-D4GMQGPN.mjs.br +0 -0
- package/dist/Bar3DChartScene-D4GMQGPN.mjs.gz +0 -0
- package/dist/Bar3DChartScene-KEYLVYJA.js.br +0 -0
- package/dist/Bar3DChartScene-KEYLVYJA.js.gz +0 -0
- package/dist/Line3DChartScene-B3AWFXE4.mjs.br +0 -0
- package/dist/Line3DChartScene-B3AWFXE4.mjs.gz +0 -0
- package/dist/Line3DChartScene-JYGXLE56.js.gz +0 -0
- package/dist/Model3DScene-4TG4YRVM.mjs.br +0 -0
- package/dist/Model3DScene-4TG4YRVM.mjs.gz +0 -0
- package/dist/Model3DScene-JF5J6N6W.js.br +0 -0
- package/dist/Model3DScene-JF5J6N6W.js.gz +0 -0
- package/dist/PieChart3DScene-4BQ6PR7P.mjs.br +0 -0
- package/dist/PieChart3DScene-4BQ6PR7P.mjs.gz +0 -0
- package/dist/PieChart3DScene-CCQWSH3W.js.gz +0 -0
- package/dist/SmartArt3DScene-QZGIABOK.mjs.br +0 -0
- package/dist/SmartArt3DScene-QZGIABOK.mjs.gz +0 -0
- package/dist/SmartArt3DScene-T236GYUT.js.br +0 -0
- package/dist/SmartArt3DScene-T236GYUT.js.gz +0 -0
- package/dist/SurfaceChart3DScene-FRQC5HBG.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-FRQC5HBG.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-UVZPT6OD.js.gz +0 -0
- package/dist/chunk-BFPIMU6Q.js.br +0 -0
- package/dist/chunk-BFPIMU6Q.js.gz +0 -0
- package/dist/chunk-BXMPXKV5.mjs.br +0 -0
- package/dist/chunk-BXMPXKV5.mjs.gz +0 -0
- package/dist/chunk-EJMDD4VV.mjs.br +0 -0
- package/dist/chunk-EJMDD4VV.mjs.gz +0 -0
- package/dist/chunk-H7QPQ4OR.js.br +0 -0
- package/dist/chunk-H7QPQ4OR.js.gz +0 -0
- package/dist/chunk-HZEOZUUH.mjs.br +0 -0
- package/dist/chunk-HZEOZUUH.mjs.gz +0 -0
- package/dist/chunk-M24DEOP6.js.br +0 -0
- package/dist/chunk-M24DEOP6.js.gz +0 -0
- package/dist/chunk-M6QJKPU2.js.br +0 -0
- package/dist/chunk-M6QJKPU2.js.gz +0 -0
- package/dist/chunk-R664EPDC.mjs.br +0 -0
- package/dist/chunk-R664EPDC.mjs.gz +0 -0
- package/dist/chunk-SUZIFHXI.js.br +0 -0
- package/dist/chunk-SUZIFHXI.js.gz +0 -0
- package/dist/chunk-T6V342NP.js.br +0 -0
- package/dist/chunk-T6V342NP.js.gz +0 -0
- package/dist/chunk-TMTQJAGK.mjs.br +0 -0
- package/dist/chunk-TMTQJAGK.mjs.gz +0 -0
- package/dist/chunk-TOOKJUPG.mjs.br +0 -0
- package/dist/chunk-TOOKJUPG.mjs.gz +0 -0
|
@@ -5,7 +5,7 @@ import DOMPurify from 'dompurify';
|
|
|
5
5
|
|
|
6
6
|
// ../core/dist/index.mjs
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.bun/emf-converter@
|
|
8
|
+
// ../../node_modules/.bun/emf-converter@3.0.1/node_modules/emf-converter/dist/index.mjs
|
|
9
9
|
function colorRefToHex(r, g2, b) {
|
|
10
10
|
const toHex4 = (v) => v.toString(16).padStart(2, "0");
|
|
11
11
|
return `#${toHex4(r & 255)}${toHex4(g2 & 255)}${toHex4(b & 255)}`;
|
|
@@ -231,6 +231,26 @@ var emfLog = (...args) => {
|
|
|
231
231
|
};
|
|
232
232
|
var emfWarn = (...args) => {
|
|
233
233
|
};
|
|
234
|
+
var nodeCanvasModule;
|
|
235
|
+
async function ensureNodeCanvasModule() {
|
|
236
|
+
if (nodeCanvasModule !== void 0) {
|
|
237
|
+
return nodeCanvasModule;
|
|
238
|
+
}
|
|
239
|
+
if (typeof OffscreenCanvas !== "undefined" || typeof document !== "undefined") {
|
|
240
|
+
nodeCanvasModule = null;
|
|
241
|
+
return nodeCanvasModule;
|
|
242
|
+
}
|
|
243
|
+
if (typeof process === "undefined" || !process.versions?.node) {
|
|
244
|
+
nodeCanvasModule = null;
|
|
245
|
+
return nodeCanvasModule;
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
nodeCanvasModule = await import('@napi-rs/canvas');
|
|
249
|
+
} catch {
|
|
250
|
+
nodeCanvasModule = null;
|
|
251
|
+
}
|
|
252
|
+
return nodeCanvasModule;
|
|
253
|
+
}
|
|
234
254
|
var DEFAULT_DPI_SCALE = 1;
|
|
235
255
|
function createCanvas(width, height, maxWidth, maxHeight, dpiScale = DEFAULT_DPI_SCALE, maxCanvasDimension = MAX_CANVAS_DIMENSION) {
|
|
236
256
|
const effectiveScale = Math.max(1, Math.min(dpiScale, 4));
|
|
@@ -267,30 +287,44 @@ function createCanvas(width, height, maxWidth, maxHeight, dpiScale = DEFAULT_DPI
|
|
|
267
287
|
emfLog(
|
|
268
288
|
`createCanvas: using OffscreenCanvas ${w}\xD7${h2}, scale=(${scaleX.toFixed(3)},${scaleY.toFixed(3)})`
|
|
269
289
|
);
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
if (!
|
|
290
|
+
const canvas = new OffscreenCanvas(w, h2);
|
|
291
|
+
const ctx = canvas.getContext("2d");
|
|
292
|
+
if (!ctx) {
|
|
273
293
|
emfWarn('createCanvas: OffscreenCanvas.getContext("2d") returned null');
|
|
274
294
|
return null;
|
|
275
295
|
}
|
|
276
|
-
return { canvas
|
|
296
|
+
return { canvas, ctx, scaleX, scaleY };
|
|
277
297
|
}
|
|
278
|
-
if (typeof document
|
|
279
|
-
|
|
280
|
-
|
|
298
|
+
if (typeof document !== "undefined") {
|
|
299
|
+
emfLog(
|
|
300
|
+
`createCanvas: using HTMLCanvasElement ${w}\xD7${h2}, scale=(${scaleX.toFixed(3)},${scaleY.toFixed(3)})`
|
|
301
|
+
);
|
|
302
|
+
const canvas = document.createElement("canvas");
|
|
303
|
+
canvas.width = w;
|
|
304
|
+
canvas.height = h2;
|
|
305
|
+
const ctx = canvas.getContext("2d");
|
|
306
|
+
if (!ctx) {
|
|
307
|
+
emfWarn('createCanvas: HTMLCanvasElement.getContext("2d") returned null');
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
return { canvas, ctx, scaleX, scaleY };
|
|
281
311
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
312
|
+
if (nodeCanvasModule) {
|
|
313
|
+
emfLog(
|
|
314
|
+
`createCanvas: using @napi-rs/canvas ${w}\xD7${h2}, scale=(${scaleX.toFixed(3)},${scaleY.toFixed(3)})`
|
|
315
|
+
);
|
|
316
|
+
const canvas = nodeCanvasModule.createCanvas(w, h2);
|
|
317
|
+
const ctx = canvas.getContext("2d");
|
|
318
|
+
if (!ctx) {
|
|
319
|
+
emfWarn('createCanvas: @napi-rs/canvas getContext("2d") returned null');
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
return { canvas, ctx, scaleX, scaleY };
|
|
292
323
|
}
|
|
293
|
-
|
|
324
|
+
emfWarn(
|
|
325
|
+
"createCanvas: no OffscreenCanvas, no document, and no @napi-rs/canvas, cannot create canvas"
|
|
326
|
+
);
|
|
327
|
+
return null;
|
|
294
328
|
} catch (err) {
|
|
295
329
|
return null;
|
|
296
330
|
}
|
|
@@ -319,6 +353,14 @@ function createTempCanvas(width, height) {
|
|
|
319
353
|
}
|
|
320
354
|
return { canvas, ctx };
|
|
321
355
|
}
|
|
356
|
+
if (nodeCanvasModule) {
|
|
357
|
+
const canvas = nodeCanvasModule.createCanvas(width, height);
|
|
358
|
+
const ctx = canvas.getContext("2d");
|
|
359
|
+
if (!ctx) {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
return { canvas, ctx };
|
|
363
|
+
}
|
|
322
364
|
return null;
|
|
323
365
|
}
|
|
324
366
|
function rop2Paint(rop2) {
|
|
@@ -552,8 +594,31 @@ async function exportCanvasToPngDataUrl(canvas) {
|
|
|
552
594
|
);
|
|
553
595
|
return canvas.toDataURL("image/png");
|
|
554
596
|
}
|
|
597
|
+
if (nodeCanvasModule && canvas instanceof nodeCanvasModule.Canvas) {
|
|
598
|
+
emfLog(
|
|
599
|
+
`exportCanvasToPngDataUrl: using @napi-rs/canvas toDataURLAsync (${canvas.width}\xD7${canvas.height})`
|
|
600
|
+
);
|
|
601
|
+
return canvas.toDataURLAsync();
|
|
602
|
+
}
|
|
555
603
|
return null;
|
|
556
604
|
}
|
|
605
|
+
async function decodeDeferredImageBytes(bytes, mime) {
|
|
606
|
+
if (nodeCanvasModule) {
|
|
607
|
+
const image = await nodeCanvasModule.loadImage(new Uint8Array(bytes));
|
|
608
|
+
return { drawable: image, width: image.width, height: image.height, close: () => {
|
|
609
|
+
} };
|
|
610
|
+
}
|
|
611
|
+
if (typeof createImageBitmap !== "function") {
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
const blob = mime !== void 0 ? new Blob([bytes], { type: mime }) : new Blob([bytes]);
|
|
615
|
+
const bitmap = await createImageBitmap(blob);
|
|
616
|
+
return { drawable: bitmap, width: bitmap.width, height: bitmap.height, close: () => bitmap.close() };
|
|
617
|
+
}
|
|
618
|
+
function canvasDrawImage(ctx, image, dx, dy, dw, dh) {
|
|
619
|
+
const draw = ctx.drawImage;
|
|
620
|
+
draw.call(ctx, image, dx, dy, dw, dh);
|
|
621
|
+
}
|
|
557
622
|
function parseEmfHeader(view) {
|
|
558
623
|
emfLog("parseEmfHeader: byteLength =", view.byteLength);
|
|
559
624
|
if (view.byteLength < 88) {
|
|
@@ -1455,7 +1520,8 @@ function handleBitBlt(rCtx, offset, dataOff, recSize) {
|
|
|
1455
1520
|
const temp = createTempCanvas(imageData.width, imageData.height);
|
|
1456
1521
|
if (temp) {
|
|
1457
1522
|
temp.ctx.putImageData(imageData, 0, 0);
|
|
1458
|
-
|
|
1523
|
+
canvasDrawImage(
|
|
1524
|
+
ctx,
|
|
1459
1525
|
temp.canvas,
|
|
1460
1526
|
gmx(rCtx, dstX),
|
|
1461
1527
|
gmy(rCtx, dstY),
|
|
@@ -1490,7 +1556,8 @@ function handleStretchDibits(rCtx, offset, dataOff, recSize) {
|
|
|
1490
1556
|
const temp = createTempCanvas(imageData.width, imageData.height);
|
|
1491
1557
|
if (temp) {
|
|
1492
1558
|
temp.ctx.putImageData(imageData, 0, 0);
|
|
1493
|
-
|
|
1559
|
+
canvasDrawImage(
|
|
1560
|
+
ctx,
|
|
1494
1561
|
temp.canvas,
|
|
1495
1562
|
gmx(rCtx, dstX),
|
|
1496
1563
|
gmy(rCtx, dstY),
|
|
@@ -4807,12 +4874,16 @@ async function processDeferredImages(ctx, deferredImages, recursionDepth = 0) {
|
|
|
4807
4874
|
if (img.isMetafile) {
|
|
4808
4875
|
if (recursionDepth >= MAX_METAFILE_RECURSION) {
|
|
4809
4876
|
emfWarn(
|
|
4810
|
-
` Deferred image [${idx}]: skipping embedded metafile
|
|
4877
|
+
` Deferred image [${idx}]: skipping embedded metafile, recursion depth ${recursionDepth} >= ${MAX_METAFILE_RECURSION}`
|
|
4811
4878
|
);
|
|
4812
4879
|
continue;
|
|
4813
4880
|
}
|
|
4814
4881
|
emfLog(` Deferred image [${idx}]: recursively converting embedded metafile...`);
|
|
4815
|
-
const metafileDataUrl = await
|
|
4882
|
+
const metafileDataUrl = await convertMetafileToDataUrl(
|
|
4883
|
+
plainBuffer,
|
|
4884
|
+
void 0,
|
|
4885
|
+
recursionDepth + 1
|
|
4886
|
+
);
|
|
4816
4887
|
if (metafileDataUrl) {
|
|
4817
4888
|
emfLog(
|
|
4818
4889
|
` Deferred image [${idx}]: metafile converted, dataUrl length=${metafileDataUrl.length}`
|
|
@@ -4825,26 +4896,28 @@ async function processDeferredImages(ctx, deferredImages, recursionDepth = 0) {
|
|
|
4825
4896
|
for (let i2 = 0; i2 < byteString.length; i2++) {
|
|
4826
4897
|
ia[i2] = byteString.charCodeAt(i2);
|
|
4827
4898
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4899
|
+
emfLog(` Deferred image [${idx}]: decoding ${ab.byteLength} byte image (${mime})...`);
|
|
4900
|
+
const decoded = await decodeDeferredImageBytes(ab, mime);
|
|
4901
|
+
if (decoded) {
|
|
4902
|
+
emfLog(` Deferred image [${idx}]: decoded ${decoded.width}\xD7${decoded.height}`);
|
|
4903
|
+
canvasDrawImage(ctx, decoded.drawable, img.dx, img.dy, img.dw, img.dh);
|
|
4904
|
+
decoded.close();
|
|
4905
|
+
} else {
|
|
4906
|
+
emfWarn(` Deferred image [${idx}]: no image decoder available`);
|
|
4907
|
+
}
|
|
4836
4908
|
} else {
|
|
4837
4909
|
emfWarn(` Deferred image [${idx}]: metafile conversion returned null`);
|
|
4838
4910
|
}
|
|
4839
4911
|
} else {
|
|
4840
|
-
emfLog(
|
|
4841
|
-
|
|
4842
|
-
)
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4912
|
+
emfLog(` Deferred image [${idx}]: decoding ${plainBuffer.byteLength} byte image...`);
|
|
4913
|
+
const decoded = await decodeDeferredImageBytes(plainBuffer);
|
|
4914
|
+
if (decoded) {
|
|
4915
|
+
emfLog(` Deferred image [${idx}]: decoded ${decoded.width}\xD7${decoded.height}`);
|
|
4916
|
+
canvasDrawImage(ctx, decoded.drawable, img.dx, img.dy, img.dw, img.dh);
|
|
4917
|
+
decoded.close();
|
|
4918
|
+
} else {
|
|
4919
|
+
emfWarn(` Deferred image [${idx}]: no image decoder available`);
|
|
4920
|
+
}
|
|
4848
4921
|
}
|
|
4849
4922
|
} catch (imgErr) {
|
|
4850
4923
|
imgErr instanceof Error ? imgErr.message : String(imgErr);
|
|
@@ -4857,10 +4930,35 @@ async function processDeferredImages(ctx, deferredImages, recursionDepth = 0) {
|
|
|
4857
4930
|
}
|
|
4858
4931
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
4859
4932
|
}
|
|
4860
|
-
async function
|
|
4933
|
+
async function convertMetafileToDataUrl(buffer, options, recursionDepth = 0) {
|
|
4934
|
+
await ensureNodeCanvasModule();
|
|
4861
4935
|
if (recursionDepth > MAX_METAFILE_RECURSION) {
|
|
4862
4936
|
return null;
|
|
4863
4937
|
}
|
|
4938
|
+
emfLog(`convertMetafileToDataUrl: input buffer ${buffer.byteLength} bytes`);
|
|
4939
|
+
if (buffer.byteLength >= 16) {
|
|
4940
|
+
const hdrBytes = new Uint8Array(buffer, 0, 16);
|
|
4941
|
+
emfLog(
|
|
4942
|
+
`convertMetafileToDataUrl: first 16 bytes: [${Array.from(hdrBytes).map((b) => b.toString(16).padStart(2, "0")).join(" ")}]`
|
|
4943
|
+
);
|
|
4944
|
+
}
|
|
4945
|
+
const view = new DataView(buffer);
|
|
4946
|
+
let emfHeader = null;
|
|
4947
|
+
try {
|
|
4948
|
+
emfHeader = parseEmfHeader(view);
|
|
4949
|
+
} catch (err) {
|
|
4950
|
+
emfWarn(
|
|
4951
|
+
"convertMetafileToDataUrl: parseEmfHeader threw during detection:",
|
|
4952
|
+
err instanceof Error ? err.message : err
|
|
4953
|
+
);
|
|
4954
|
+
emfHeader = null;
|
|
4955
|
+
}
|
|
4956
|
+
if (emfHeader) {
|
|
4957
|
+
return convertEmfInternal(buffer, view, emfHeader, options, recursionDepth);
|
|
4958
|
+
}
|
|
4959
|
+
return convertWmfInternal(buffer, view);
|
|
4960
|
+
}
|
|
4961
|
+
async function convertEmfInternal(buffer, view, header, options, recursionDepth) {
|
|
4864
4962
|
const opts = {};
|
|
4865
4963
|
const dpiScale = opts.dpiScale ?? DEFAULT_DPI_SCALE;
|
|
4866
4964
|
const effectiveMaxWidth = opts.maxWidth;
|
|
@@ -4871,30 +4969,18 @@ async function convertEmfToDataUrl(buffer, options, recursionDepth = 0) {
|
|
|
4871
4969
|
fontFamilyMap: opts.fontFamilyMap
|
|
4872
4970
|
};
|
|
4873
4971
|
try {
|
|
4874
|
-
emfLog("===
|
|
4972
|
+
emfLog("=== convertEmfInternal START ===");
|
|
4875
4973
|
emfLog(
|
|
4876
4974
|
`Input buffer: ${buffer.byteLength} bytes, maxWidth=${effectiveMaxWidth}, maxHeight=${effectiveMaxHeight}, dpiScale=${dpiScale}`
|
|
4877
4975
|
);
|
|
4878
|
-
if (buffer.byteLength >= 16) {
|
|
4879
|
-
const hdrBytes = new Uint8Array(buffer, 0, 16);
|
|
4880
|
-
emfLog(
|
|
4881
|
-
`First 16 bytes: [${Array.from(hdrBytes).map((b) => b.toString(16).padStart(2, "0")).join(" ")}]`
|
|
4882
|
-
);
|
|
4883
|
-
}
|
|
4884
|
-
const view = new DataView(buffer);
|
|
4885
|
-
const header = parseEmfHeader(view);
|
|
4886
|
-
if (!header) {
|
|
4887
|
-
emfLog("convertEmfToDataUrl: parseEmfHeader returned null \u2014 returning null");
|
|
4888
|
-
return null;
|
|
4889
|
-
}
|
|
4890
4976
|
const renderBounds = getRenderableEmfBounds(header);
|
|
4891
4977
|
if (!renderBounds) {
|
|
4892
|
-
emfLog("
|
|
4978
|
+
emfLog("convertEmfInternal: getRenderableEmfBounds returned null, returning null");
|
|
4893
4979
|
return null;
|
|
4894
4980
|
}
|
|
4895
4981
|
const logicalW = renderBounds.right - renderBounds.left;
|
|
4896
4982
|
const logicalH = renderBounds.bottom - renderBounds.top;
|
|
4897
|
-
emfLog(`
|
|
4983
|
+
emfLog(`convertEmfInternal: logicalSize=${logicalW}\xD7${logicalH}`);
|
|
4898
4984
|
const setup = createCanvas(
|
|
4899
4985
|
logicalW,
|
|
4900
4986
|
logicalH,
|
|
@@ -4904,15 +4990,15 @@ async function convertEmfToDataUrl(buffer, options, recursionDepth = 0) {
|
|
|
4904
4990
|
opts.maxCanvasDimension
|
|
4905
4991
|
);
|
|
4906
4992
|
if (!setup) {
|
|
4907
|
-
emfLog("
|
|
4993
|
+
emfLog("convertEmfInternal: createCanvas returned null, returning null");
|
|
4908
4994
|
return null;
|
|
4909
4995
|
}
|
|
4910
4996
|
const { canvas, ctx } = setup;
|
|
4911
4997
|
emfLog(
|
|
4912
|
-
`
|
|
4998
|
+
`convertEmfInternal: canvas created ${canvas.width}\xD7${canvas.height} (dpiScale=${dpiScale})`
|
|
4913
4999
|
);
|
|
4914
5000
|
ctx.save();
|
|
4915
|
-
emfLog("
|
|
5001
|
+
emfLog("convertEmfInternal: starting replayEmfRecords...");
|
|
4916
5002
|
const deferredImages = replayEmfRecords(
|
|
4917
5003
|
view,
|
|
4918
5004
|
ctx,
|
|
@@ -4922,30 +5008,25 @@ async function convertEmfToDataUrl(buffer, options, recursionDepth = 0) {
|
|
|
4922
5008
|
dpiScale,
|
|
4923
5009
|
replayOptions
|
|
4924
5010
|
);
|
|
4925
|
-
emfLog(
|
|
4926
|
-
`convertEmfToDataUrl: replayEmfRecords returned ${deferredImages.length} deferred images`
|
|
4927
|
-
);
|
|
5011
|
+
emfLog(`convertEmfInternal: replayEmfRecords returned ${deferredImages.length} deferred images`);
|
|
4928
5012
|
ctx.restore();
|
|
4929
|
-
await processDeferredImages(ctx, deferredImages);
|
|
4930
|
-
emfLog("
|
|
5013
|
+
await processDeferredImages(ctx, deferredImages, recursionDepth);
|
|
5014
|
+
emfLog("convertEmfInternal: exporting canvas to PNG data URL...");
|
|
4931
5015
|
const result = await exportCanvasToPngDataUrl(canvas);
|
|
4932
5016
|
if (result) {
|
|
4933
|
-
emfLog(`
|
|
5017
|
+
emfLog(`convertEmfInternal: SUCCESS, data URL length=${result.length}`);
|
|
4934
5018
|
} else {
|
|
4935
|
-
emfWarn("
|
|
5019
|
+
emfWarn("convertEmfInternal: exportCanvasToPngDataUrl returned null");
|
|
4936
5020
|
}
|
|
4937
|
-
emfLog("===
|
|
5021
|
+
emfLog("=== convertEmfInternal END ===");
|
|
4938
5022
|
return result;
|
|
4939
5023
|
} catch (err) {
|
|
4940
|
-
emfWarn("
|
|
4941
|
-
console.warn("[
|
|
5024
|
+
emfWarn("convertEmfInternal: EXCEPTION:", err instanceof Error ? err.message : err);
|
|
5025
|
+
console.warn("[emf-converter] EMF conversion failed:", err instanceof Error ? err.message : err);
|
|
4942
5026
|
return null;
|
|
4943
5027
|
}
|
|
4944
5028
|
}
|
|
4945
|
-
async function
|
|
4946
|
-
if (recursionDepth > MAX_METAFILE_RECURSION) {
|
|
4947
|
-
return null;
|
|
4948
|
-
}
|
|
5029
|
+
async function convertWmfInternal(buffer, view, options, recursionDepth) {
|
|
4949
5030
|
const opts = {};
|
|
4950
5031
|
const dpiScale = opts.dpiScale ?? DEFAULT_DPI_SCALE;
|
|
4951
5032
|
const effectiveMaxWidth = opts.maxWidth;
|
|
@@ -4956,20 +5037,19 @@ async function convertWmfToDataUrl(buffer, options, recursionDepth = 0) {
|
|
|
4956
5037
|
};
|
|
4957
5038
|
try {
|
|
4958
5039
|
emfLog(
|
|
4959
|
-
"===
|
|
5040
|
+
"=== convertWmfInternal START ===",
|
|
4960
5041
|
`buffer=${buffer.byteLength} bytes, dpiScale=${dpiScale}`
|
|
4961
5042
|
);
|
|
4962
|
-
const view = new DataView(buffer);
|
|
4963
5043
|
const header = parseWmfHeader(view);
|
|
4964
5044
|
if (!header) {
|
|
4965
|
-
emfLog("
|
|
5045
|
+
emfLog("convertWmfInternal: parseWmfHeader returned null");
|
|
4966
5046
|
return null;
|
|
4967
5047
|
}
|
|
4968
5048
|
const logicalW = header.boundsRight - header.boundsLeft;
|
|
4969
5049
|
const logicalH = header.boundsBottom - header.boundsTop;
|
|
4970
|
-
emfLog(`
|
|
5050
|
+
emfLog(`convertWmfInternal: logicalSize=${logicalW}\xD7${logicalH}`);
|
|
4971
5051
|
if (logicalW <= 0 || logicalH <= 0) {
|
|
4972
|
-
emfLog("
|
|
5052
|
+
emfLog("convertWmfInternal: invalid dimensions, returning null");
|
|
4973
5053
|
return null;
|
|
4974
5054
|
}
|
|
4975
5055
|
const setup = createCanvas(
|
|
@@ -4988,12 +5068,12 @@ async function convertWmfToDataUrl(buffer, options, recursionDepth = 0) {
|
|
|
4988
5068
|
replayWmfRecords(view, ctx, header, canvas.width, canvas.height, replayOptions);
|
|
4989
5069
|
ctx.restore();
|
|
4990
5070
|
const result = await exportCanvasToPngDataUrl(canvas);
|
|
4991
|
-
emfLog(`
|
|
4992
|
-
emfLog("===
|
|
5071
|
+
emfLog(`convertWmfInternal: result=${result ? `dataUrl len=${result.length}` : "null"}`);
|
|
5072
|
+
emfLog("=== convertWmfInternal END ===");
|
|
4993
5073
|
return result;
|
|
4994
5074
|
} catch (err) {
|
|
4995
|
-
emfWarn("
|
|
4996
|
-
console.warn("[
|
|
5075
|
+
emfWarn("convertWmfInternal: EXCEPTION:", err instanceof Error ? err.message : err);
|
|
5076
|
+
console.warn("[emf-converter] WMF conversion failed:", err instanceof Error ? err.message : err);
|
|
4997
5077
|
return null;
|
|
4998
5078
|
}
|
|
4999
5079
|
}
|
|
@@ -30985,7 +31065,7 @@ function directChildOrder(xml) {
|
|
|
30985
31065
|
function extractElementOrders(xml, elementName) {
|
|
30986
31066
|
const orders = [];
|
|
30987
31067
|
const pattern = new RegExp(
|
|
30988
|
-
`<([A-Za-z_][\\w.-]*:)?${elementName}\\
|
|
31068
|
+
`<([A-Za-z_][\\w.-]*:)?${elementName}(?=[\\s/>])[^>]*>([\\s\\S]*?)<\\/\\1${elementName}\\s*>`,
|
|
30989
31069
|
"gu"
|
|
30990
31070
|
);
|
|
30991
31071
|
for (const match of xml.matchAll(pattern)) {
|
|
@@ -31949,11 +32029,11 @@ function parseRunSolidFillColor(rPr) {
|
|
|
31949
32029
|
if (!rPr) {
|
|
31950
32030
|
return void 0;
|
|
31951
32031
|
}
|
|
31952
|
-
const
|
|
31953
|
-
if (!
|
|
32032
|
+
const solidFill32 = rPr["a:solidFill"];
|
|
32033
|
+
if (!solidFill32) {
|
|
31954
32034
|
return void 0;
|
|
31955
32035
|
}
|
|
31956
|
-
const srgb =
|
|
32036
|
+
const srgb = solidFill32["a:srgbClr"];
|
|
31957
32037
|
if (srgb?.["@_val"]) {
|
|
31958
32038
|
return String(srgb["@_val"]);
|
|
31959
32039
|
}
|
|
@@ -31963,11 +32043,11 @@ function parseRunSolidFillColorXml(rPr) {
|
|
|
31963
32043
|
if (!rPr) {
|
|
31964
32044
|
return void 0;
|
|
31965
32045
|
}
|
|
31966
|
-
const
|
|
31967
|
-
if (!
|
|
32046
|
+
const solidFill32 = rPr["a:solidFill"];
|
|
32047
|
+
if (!solidFill32) {
|
|
31968
32048
|
return void 0;
|
|
31969
32049
|
}
|
|
31970
|
-
return extractColorChoiceXml(
|
|
32050
|
+
return extractColorChoiceXml(solidFill32);
|
|
31971
32051
|
}
|
|
31972
32052
|
var init_text_run_properties_parser = __esm({
|
|
31973
32053
|
"src/core/utils/text-run-properties-parser.ts"() {
|
|
@@ -37366,6 +37446,20 @@ function itemAspect(plan, index, nodeCount, presLayoutVars) {
|
|
|
37366
37446
|
}
|
|
37367
37447
|
return void 0;
|
|
37368
37448
|
}
|
|
37449
|
+
function itemCrossAxisFraction(plan, index) {
|
|
37450
|
+
const item = itemNode(plan.node);
|
|
37451
|
+
if (!item) {
|
|
37452
|
+
return void 0;
|
|
37453
|
+
}
|
|
37454
|
+
const role = roleOf(item);
|
|
37455
|
+
const arrangerRole = roleOf(plan.node);
|
|
37456
|
+
const rawHeight = firstConstraintDeclaredBy(index, role, "h", arrangerRole);
|
|
37457
|
+
if (!rawHeight || rawHeight.referenceType !== "w") {
|
|
37458
|
+
return void 0;
|
|
37459
|
+
}
|
|
37460
|
+
const width = resolveConstraintDeclaredBy(index, role, "w", arrangerRole);
|
|
37461
|
+
return typeof width === "number" && width > 0 ? width : void 0;
|
|
37462
|
+
}
|
|
37369
37463
|
function ordered(nodes, flow) {
|
|
37370
37464
|
return flow.reverse ? [...nodes].reverse() : nodes;
|
|
37371
37465
|
}
|
|
@@ -37753,6 +37847,7 @@ function arrangeLinear(plan, flow, nodes, box, palette, style, elementId, index
|
|
|
37753
37847
|
const horizontal = flow.orientation === "horizontal";
|
|
37754
37848
|
const usableMain = (horizontal ? w : h2) - INSET * 2;
|
|
37755
37849
|
const usableCross = (horizontal ? h2 : w) - INSET * 2;
|
|
37850
|
+
const crossAxisFraction = horizontal ? void 0 : itemCrossAxisFraction(plan, index);
|
|
37756
37851
|
const { mainExtent, gap } = resolveMainAxisLayout(
|
|
37757
37852
|
constraints,
|
|
37758
37853
|
index,
|
|
@@ -37768,7 +37863,7 @@ function arrangeLinear(plan, flow, nodes, box, palette, style, elementId, index
|
|
|
37768
37863
|
const itemTemplate = itemNode(plan.node);
|
|
37769
37864
|
const itemShape = findCompositeItemShape(itemTemplate);
|
|
37770
37865
|
const naturalAspect = resolveItemSelfAspect(itemTemplate);
|
|
37771
|
-
const crossExtent = aspect ? Math.min(usableCross, Math.max(12, mainExtent * aspect)) : typeof naturalAspect === "number" ? Math.min(
|
|
37866
|
+
const crossExtent = crossAxisFraction ? Math.min(usableCross, Math.max(12, usableCross * crossAxisFraction)) : aspect ? Math.min(usableCross, Math.max(12, mainExtent * aspect)) : typeof naturalAspect === "number" ? Math.min(
|
|
37772
37867
|
usableCross,
|
|
37773
37868
|
Math.max(12, mainExtent * (horizontal ? naturalAspect : 1 / naturalAspect))
|
|
37774
37869
|
) : usableCross;
|
|
@@ -46320,8 +46415,8 @@ function parseLineStyle(container, elementName, xmlLookup, colorParser) {
|
|
|
46320
46415
|
if (spPr) {
|
|
46321
46416
|
const lnNode = xmlLookup.getChildByLocalName(spPr, "ln");
|
|
46322
46417
|
if (lnNode) {
|
|
46323
|
-
const
|
|
46324
|
-
const lineColor = colorParser.parseColor(
|
|
46418
|
+
const solidFill32 = xmlLookup.getChildByLocalName(lnNode, "solidFill");
|
|
46419
|
+
const lineColor = colorParser.parseColor(solidFill32);
|
|
46325
46420
|
if (lineColor) {
|
|
46326
46421
|
result.color = lineColor;
|
|
46327
46422
|
}
|
|
@@ -47024,8 +47119,8 @@ function parseShapeProps(spPrNode, xmlLookup, colorParser) {
|
|
|
47024
47119
|
}
|
|
47025
47120
|
const result = {};
|
|
47026
47121
|
let hasProps = false;
|
|
47027
|
-
const
|
|
47028
|
-
const fillColor = colorParser.parseColor(
|
|
47122
|
+
const solidFill32 = xmlLookup.getChildByLocalName(spPrNode, "solidFill");
|
|
47123
|
+
const fillColor = colorParser.parseColor(solidFill32);
|
|
47029
47124
|
if (fillColor) {
|
|
47030
47125
|
result.fillColor = fillColor;
|
|
47031
47126
|
hasProps = true;
|
|
@@ -48507,8 +48602,8 @@ function parseTxPr(txPrNode, xmlLookup, colorParser, target, resolveTypeface) {
|
|
|
48507
48602
|
const raw = String(latin["@_typeface"]);
|
|
48508
48603
|
target.fontFamily = resolveTypeface ? resolveTypeface(raw) : raw;
|
|
48509
48604
|
}
|
|
48510
|
-
const
|
|
48511
|
-
const fontColor = colorParser.parseColor(
|
|
48605
|
+
const solidFill32 = xmlLookup.getChildByLocalName(defRPr, "solidFill");
|
|
48606
|
+
const fontColor = colorParser.parseColor(solidFill32);
|
|
48512
48607
|
if (fontColor) {
|
|
48513
48608
|
target.fontColor = fontColor;
|
|
48514
48609
|
}
|
|
@@ -49009,13 +49104,13 @@ function extractCxSeriesColor(ser, xmlLookup, colorParser) {
|
|
|
49009
49104
|
if (!spPr) {
|
|
49010
49105
|
return void 0;
|
|
49011
49106
|
}
|
|
49012
|
-
const
|
|
49013
|
-
if (
|
|
49014
|
-
const resolved = colorParser?.parseColor(
|
|
49107
|
+
const solidFill32 = xmlLookup.getChildByLocalName(spPr, "solidFill");
|
|
49108
|
+
if (solidFill32) {
|
|
49109
|
+
const resolved = colorParser?.parseColor(solidFill32);
|
|
49015
49110
|
if (resolved) {
|
|
49016
49111
|
return resolved;
|
|
49017
49112
|
}
|
|
49018
|
-
const srgb = xmlLookup.getChildByLocalName(
|
|
49113
|
+
const srgb = xmlLookup.getChildByLocalName(solidFill32, "srgbClr");
|
|
49019
49114
|
const val2 = String(srgb?.["@_val"] || "").trim();
|
|
49020
49115
|
return val2.length === 6 ? `#${val2}` : void 0;
|
|
49021
49116
|
}
|
|
@@ -65865,9 +65960,9 @@ var init_effect_dag_specific_helpers = __esm({
|
|
|
65865
65960
|
}
|
|
65866
65961
|
});
|
|
65867
65962
|
function fillOverlayColorHost(fillOverlay, context) {
|
|
65868
|
-
const
|
|
65869
|
-
if (
|
|
65870
|
-
return
|
|
65963
|
+
const solidFill32 = fillOverlay["a:solidFill"];
|
|
65964
|
+
if (solidFill32) {
|
|
65965
|
+
return solidFill32;
|
|
65871
65966
|
}
|
|
65872
65967
|
const gradFill = fillOverlay["a:gradFill"];
|
|
65873
65968
|
if (!gradFill) {
|
|
@@ -67397,20 +67492,20 @@ var init_PptxShapeStyleExtractor = __esm({
|
|
|
67397
67492
|
extractShapeStyle(spPr, styleNode) {
|
|
67398
67493
|
const style = {};
|
|
67399
67494
|
const shapeProps = spPr || {};
|
|
67400
|
-
const
|
|
67495
|
+
const solidFill32 = drawingChild(shapeProps, "solidFill");
|
|
67401
67496
|
const gradFill = drawingChild(shapeProps, "gradFill");
|
|
67402
67497
|
const pattFill = drawingChild(shapeProps, "pattFill");
|
|
67403
67498
|
const noFill = hasDrawingChild(shapeProps, "noFill");
|
|
67404
67499
|
const blipFill = drawingChild(shapeProps, "blipFill");
|
|
67405
|
-
if (
|
|
67500
|
+
if (solidFill32) {
|
|
67406
67501
|
style.fillMode = "solid";
|
|
67407
|
-
style.fillColor = this.context.parseColor(
|
|
67408
|
-
style.fillOpacity = this.context.extractColorOpacity(
|
|
67409
|
-
const solidFillColorXml = extractColorChoiceXml(
|
|
67502
|
+
style.fillColor = this.context.parseColor(solidFill32);
|
|
67503
|
+
style.fillOpacity = this.context.extractColorOpacity(solidFill32);
|
|
67504
|
+
const solidFillColorXml = extractColorChoiceXml(solidFill32);
|
|
67410
67505
|
if (solidFillColorXml) {
|
|
67411
67506
|
style.fillColorXml = solidFillColorXml;
|
|
67412
67507
|
}
|
|
67413
|
-
const solidFillColorRef = themeColorRefFromColorChoice(
|
|
67508
|
+
const solidFillColorRef = themeColorRefFromColorChoice(solidFill32);
|
|
67414
67509
|
if (solidFillColorRef) {
|
|
67415
67510
|
style.fillColorRef = solidFillColorRef;
|
|
67416
67511
|
}
|
|
@@ -67636,11 +67731,11 @@ function parseTintShadeVal(value) {
|
|
|
67636
67731
|
const fraction = parseOoxmlPercent(value);
|
|
67637
67732
|
return fraction === void 0 || fraction === 0 ? void 0 : Math.round(fraction * 1e5);
|
|
67638
67733
|
}
|
|
67639
|
-
function parseSolidFillStyle(
|
|
67640
|
-
if (!
|
|
67734
|
+
function parseSolidFillStyle(solidFill32) {
|
|
67735
|
+
if (!solidFill32) {
|
|
67641
67736
|
return void 0;
|
|
67642
67737
|
}
|
|
67643
|
-
const schemeClr =
|
|
67738
|
+
const schemeClr = solidFill32["a:schemeClr"];
|
|
67644
67739
|
if (!schemeClr) {
|
|
67645
67740
|
return void 0;
|
|
67646
67741
|
}
|
|
@@ -67683,13 +67778,13 @@ function parseBorderSide(side) {
|
|
|
67683
67778
|
border.dash = dashVal;
|
|
67684
67779
|
has = true;
|
|
67685
67780
|
}
|
|
67686
|
-
const
|
|
67687
|
-
const fill = parseSolidFillStyle(
|
|
67781
|
+
const solidFill32 = ln["a:solidFill"];
|
|
67782
|
+
const fill = parseSolidFillStyle(solidFill32);
|
|
67688
67783
|
if (fill) {
|
|
67689
67784
|
border.fill = fill;
|
|
67690
67785
|
has = true;
|
|
67691
67786
|
} else {
|
|
67692
|
-
const srgb =
|
|
67787
|
+
const srgb = solidFill32?.["a:srgbClr"];
|
|
67693
67788
|
const hex4 = srgb ? String(srgb["@_val"] || "").trim() : "";
|
|
67694
67789
|
if (hex4) {
|
|
67695
67790
|
border.color = hex4.startsWith("#") ? hex4 : `#${hex4}`;
|
|
@@ -71249,10 +71344,6 @@ var init_compatibility_child_sets = __esm({
|
|
|
71249
71344
|
]);
|
|
71250
71345
|
GRAPHIC_FRAME_LIMITATIONS = {
|
|
71251
71346
|
unknown: ["UNSUPPORTED_GRAPHIC_FRAME", "The graphic-frame payload is preserved but unsupported."],
|
|
71252
|
-
smartArt: [
|
|
71253
|
-
"PARTIAL_SMARTART_SUPPORT",
|
|
71254
|
-
"SmartArt is parsed and preserved, but some DiagramML behavior is not editable."
|
|
71255
|
-
],
|
|
71256
71347
|
ole: [
|
|
71257
71348
|
"PARTIAL_OLE_SUPPORT",
|
|
71258
71349
|
"The OLE payload renders as a preview image and can be downloaded or opened in a new tab, but cannot be edited in place."
|
|
@@ -80142,8 +80233,8 @@ function parseTypedTextStyle(txPrNode, localName28, colorParser) {
|
|
|
80142
80233
|
if (typeface) {
|
|
80143
80234
|
style.fontFamily = String(typeface);
|
|
80144
80235
|
}
|
|
80145
|
-
const
|
|
80146
|
-
const color2 = literalColor(
|
|
80236
|
+
const solidFill32 = nodesOf(defRPr, "solidFill", localName28)[0];
|
|
80237
|
+
const color2 = literalColor(solidFill32, localName28, colorParser);
|
|
80147
80238
|
if (color2) {
|
|
80148
80239
|
style.color = color2;
|
|
80149
80240
|
}
|
|
@@ -94968,8 +95059,8 @@ function parseTableBackground(tblBg) {
|
|
|
94968
95059
|
return void 0;
|
|
94969
95060
|
}
|
|
94970
95061
|
const fillNode = tblBg["a:fill"];
|
|
94971
|
-
const
|
|
94972
|
-
const schemeClr =
|
|
95062
|
+
const solidFill32 = fillNode?.["a:solidFill"] ?? tblBg["a:solidFill"];
|
|
95063
|
+
const schemeClr = solidFill32?.["a:schemeClr"];
|
|
94973
95064
|
const schemeColor = schemeClr ? String(schemeClr["@_val"] || "").trim() || void 0 : void 0;
|
|
94974
95065
|
const fill = schemeColor ? { schemeColor } : void 0;
|
|
94975
95066
|
const hasEffectLst = Boolean(tblBg["a:effectLst"]);
|
|
@@ -95765,9 +95856,9 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
|
|
|
95765
95856
|
}
|
|
95766
95857
|
rawCopy[key2] = fillOverlay[key2];
|
|
95767
95858
|
}
|
|
95768
|
-
const
|
|
95769
|
-
const resolvedColor =
|
|
95770
|
-
const resolvedOpacity =
|
|
95859
|
+
const solidFill32 = fillOverlay["a:solidFill"];
|
|
95860
|
+
const resolvedColor = solidFill32 ? this.parseColor(solidFill32) : void 0;
|
|
95861
|
+
const resolvedOpacity = solidFill32 ? this.extractColorOpacity(solidFill32) ?? 1 : void 0;
|
|
95771
95862
|
const gradFill = fillOverlay["a:gradFill"];
|
|
95772
95863
|
const resolvedGradient = gradFill ? this.resolveFillOverlayGradient(gradFill) : void 0;
|
|
95773
95864
|
const pattFill = fillOverlay["a:pattFill"];
|
|
@@ -96136,7 +96227,7 @@ var init_PptxHandlerRuntimeMediaData = __esm({
|
|
|
96136
96227
|
try {
|
|
96137
96228
|
if (ext === "emf" || ext === "wmf") {
|
|
96138
96229
|
const binaryBuffer = await imageFile2.async("arraybuffer");
|
|
96139
|
-
const converted =
|
|
96230
|
+
const converted = await convertMetafileToDataUrl(binaryBuffer);
|
|
96140
96231
|
if (converted) {
|
|
96141
96232
|
this.imageDataCache.set(imagePath, converted);
|
|
96142
96233
|
return converted;
|
|
@@ -97136,8 +97227,8 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
97136
97227
|
if (hasNoFill) {
|
|
97137
97228
|
return "none";
|
|
97138
97229
|
}
|
|
97139
|
-
const
|
|
97140
|
-
return
|
|
97230
|
+
const solidFill32 = this.xmlLookupService.getChildByLocalName(shapeProperties, "solidFill");
|
|
97231
|
+
return solidFill32 ? this.parseColor(solidFill32) : void 0;
|
|
97141
97232
|
}
|
|
97142
97233
|
/**
|
|
97143
97234
|
* Extract chart style metadata from chart XML.
|
|
@@ -100076,14 +100167,14 @@ var init_PptxHandlerRuntimeTextRunStyleExtraction = __esm({
|
|
|
100076
100167
|
if (csTypeface) {
|
|
100077
100168
|
style.complexScriptFont = csTypeface;
|
|
100078
100169
|
}
|
|
100079
|
-
const
|
|
100080
|
-
if (
|
|
100081
|
-
style.color = this.parseColor(
|
|
100082
|
-
const colorXml2 = extractColorChoiceXml(
|
|
100170
|
+
const solidFill32 = xmlChild(runProperties2, "a:solidFill");
|
|
100171
|
+
if (solidFill32) {
|
|
100172
|
+
style.color = this.parseColor(solidFill32);
|
|
100173
|
+
const colorXml2 = extractColorChoiceXml(solidFill32);
|
|
100083
100174
|
if (colorXml2) {
|
|
100084
100175
|
style.colorXml = colorXml2;
|
|
100085
100176
|
}
|
|
100086
|
-
const colorRef = themeColorRefFromColorChoice(
|
|
100177
|
+
const colorRef = themeColorRefFromColorChoice(solidFill32);
|
|
100087
100178
|
if (colorRef) {
|
|
100088
100179
|
style.colorRef = colorRef;
|
|
100089
100180
|
}
|
|
@@ -116410,11 +116501,11 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
116410
116501
|
}
|
|
116411
116502
|
const bgPr = xmlChild(bg, "p:bgPr");
|
|
116412
116503
|
if (bgPr) {
|
|
116413
|
-
const
|
|
116414
|
-
if (
|
|
116504
|
+
const solidFill32 = xmlChild(bgPr, "a:solidFill");
|
|
116505
|
+
if (solidFill32) {
|
|
116415
116506
|
return this.blendBackgroundColorOntoWhite(
|
|
116416
|
-
this.parseColor(
|
|
116417
|
-
this.extractColorOpacity(
|
|
116507
|
+
this.parseColor(solidFill32),
|
|
116508
|
+
this.extractColorOpacity(solidFill32)
|
|
116418
116509
|
);
|
|
116419
116510
|
}
|
|
116420
116511
|
const pattFill = xmlChild(bgPr, "a:pattFill");
|
|
@@ -116507,11 +116598,11 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
116507
116598
|
if (idx === 0) {
|
|
116508
116599
|
return void 0;
|
|
116509
116600
|
}
|
|
116510
|
-
const
|
|
116511
|
-
if (
|
|
116601
|
+
const solidFill32 = xmlChild(bgRef, "a:solidFill");
|
|
116602
|
+
if (solidFill32) {
|
|
116512
116603
|
return this.blendBackgroundColorOntoWhite(
|
|
116513
|
-
this.parseColor(
|
|
116514
|
-
this.extractColorOpacity(
|
|
116604
|
+
this.parseColor(solidFill32),
|
|
116605
|
+
this.extractColorOpacity(solidFill32)
|
|
116515
116606
|
);
|
|
116516
116607
|
}
|
|
116517
116608
|
const overrideColor = this.blendBackgroundColorOntoWhite(
|
|
@@ -117329,13 +117420,13 @@ var init_PptxHandlerRuntimePlaceholderStyles = __esm({
|
|
|
117329
117420
|
if (defRPr["@_i"] !== void 0) {
|
|
117330
117421
|
style.italic = defRPr["@_i"] === "1";
|
|
117331
117422
|
}
|
|
117332
|
-
const
|
|
117333
|
-
const color2 = this.parseColor(
|
|
117423
|
+
const solidFill32 = defRPr["a:solidFill"];
|
|
117424
|
+
const color2 = this.parseColor(solidFill32);
|
|
117334
117425
|
if (color2) {
|
|
117335
117426
|
style.color = color2;
|
|
117336
117427
|
}
|
|
117337
|
-
if (
|
|
117338
|
-
style.colorChoiceXml =
|
|
117428
|
+
if (solidFill32) {
|
|
117429
|
+
style.colorChoiceXml = solidFill32;
|
|
117339
117430
|
}
|
|
117340
117431
|
const latin = defRPr["a:latin"];
|
|
117341
117432
|
if (latin?.["@_typeface"]) {
|
|
@@ -120069,8 +120160,8 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
120069
120160
|
}
|
|
120070
120161
|
const chrome = {};
|
|
120071
120162
|
if (bg) {
|
|
120072
|
-
const
|
|
120073
|
-
const bgColor = this.parseColor(
|
|
120163
|
+
const solidFill32 = this.xmlLookupService.getChildByLocalName(bg, "solidFill");
|
|
120164
|
+
const bgColor = this.parseColor(solidFill32);
|
|
120074
120165
|
if (bgColor) {
|
|
120075
120166
|
chrome.backgroundColor = bgColor;
|
|
120076
120167
|
} else {
|
|
@@ -120084,8 +120175,8 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
120084
120175
|
if (whole) {
|
|
120085
120176
|
const lnNode = this.xmlLookupService.getChildByLocalName(whole, "ln");
|
|
120086
120177
|
if (lnNode) {
|
|
120087
|
-
const
|
|
120088
|
-
const outlineColor = this.parseColor(
|
|
120178
|
+
const solidFill32 = this.xmlLookupService.getChildByLocalName(lnNode, "solidFill");
|
|
120179
|
+
const outlineColor = this.parseColor(solidFill32);
|
|
120089
120180
|
if (outlineColor) {
|
|
120090
120181
|
chrome.outlineColor = outlineColor;
|
|
120091
120182
|
}
|
|
@@ -120197,11 +120288,11 @@ function extractDrawingShapeFill(spPr, deps) {
|
|
|
120197
120288
|
}
|
|
120198
120289
|
return result;
|
|
120199
120290
|
}
|
|
120200
|
-
const
|
|
120201
|
-
if (
|
|
120202
|
-
result.fillColor = deps.parseColor(
|
|
120291
|
+
const solidFill32 = deps.getChild(spPr, "solidFill");
|
|
120292
|
+
if (solidFill32) {
|
|
120293
|
+
result.fillColor = deps.parseColor(solidFill32) ?? void 0;
|
|
120203
120294
|
}
|
|
120204
|
-
const gradFill = !
|
|
120295
|
+
const gradFill = !solidFill32 ? deps.getChild(spPr, "gradFill") : void 0;
|
|
120205
120296
|
if (gradFill) {
|
|
120206
120297
|
const stops = deps.extractGradientStops(gradFill).map((stop) => ({
|
|
120207
120298
|
color: stop.color,
|
|
@@ -120215,7 +120306,7 @@ function extractDrawingShapeFill(spPr, deps) {
|
|
|
120215
120306
|
result.fillColor ??= stops[Math.floor(stops.length / 2)]?.color;
|
|
120216
120307
|
}
|
|
120217
120308
|
}
|
|
120218
|
-
const pattFill = !
|
|
120309
|
+
const pattFill = !solidFill32 && !gradFill ? deps.getChild(spPr, "pattFill") : void 0;
|
|
120219
120310
|
if (pattFill) {
|
|
120220
120311
|
const preset = String(pattFill["@_prst"] || "").trim();
|
|
120221
120312
|
if (preset) {
|
|
@@ -120231,7 +120322,7 @@ function extractDrawingShapeFill(spPr, deps) {
|
|
|
120231
120322
|
}
|
|
120232
120323
|
result.fillColor ??= fg ?? bg;
|
|
120233
120324
|
}
|
|
120234
|
-
const blipFill = !
|
|
120325
|
+
const blipFill = !solidFill32 && !gradFill && !pattFill ? deps.getChild(spPr, "blipFill") : void 0;
|
|
120235
120326
|
if (blipFill) {
|
|
120236
120327
|
const blip = deps.getChild(blipFill, "blip");
|
|
120237
120328
|
const embed = String(
|
|
@@ -148633,8 +148724,8 @@ function getOmmlMathColor(node) {
|
|
|
148633
148724
|
}
|
|
148634
148725
|
const drawingRunProperties = node["a:rPr"];
|
|
148635
148726
|
if (drawingRunProperties && typeof drawingRunProperties === "object") {
|
|
148636
|
-
const
|
|
148637
|
-
const srgbColor =
|
|
148727
|
+
const solidFill22 = drawingRunProperties["a:solidFill"];
|
|
148728
|
+
const srgbColor = solidFill22 && typeof solidFill22 === "object" ? solidFill22["a:srgbClr"] : void 0;
|
|
148638
148729
|
const value = srgbColor?.["@_val"];
|
|
148639
148730
|
if (typeof value === "string" && /^[0-9a-f]{6}$/iu.test(value)) {
|
|
148640
148731
|
return `#${value.toUpperCase()}`;
|
|
@@ -154392,6 +154483,102 @@ function buildCartesianHorizontalAxis(chartData, categoryLabels, layout, kind, p
|
|
|
154392
154483
|
displayChartData: datePlan || categoryPlan ? chartDataInCategoryOrder(chartData, sourceIndices2) : chartData
|
|
154393
154484
|
};
|
|
154394
154485
|
}
|
|
154486
|
+
function estimatedGlyphAdvanceRatio(glyph) {
|
|
154487
|
+
if (/\p{Mark}/u.test(glyph)) {
|
|
154488
|
+
return 0;
|
|
154489
|
+
}
|
|
154490
|
+
if (/\s/u.test(glyph)) {
|
|
154491
|
+
return 0.33;
|
|
154492
|
+
}
|
|
154493
|
+
if (/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]/u.test(
|
|
154494
|
+
glyph
|
|
154495
|
+
)) {
|
|
154496
|
+
return 1;
|
|
154497
|
+
}
|
|
154498
|
+
if (/[A-Z]/u.test(glyph)) {
|
|
154499
|
+
return 0.65;
|
|
154500
|
+
}
|
|
154501
|
+
if (/[a-z0-9]/u.test(glyph)) {
|
|
154502
|
+
return 0.55;
|
|
154503
|
+
}
|
|
154504
|
+
if (/[,.;:!?()\u005b\u005d{}'"`\-_/\\]/u.test(glyph)) {
|
|
154505
|
+
return 0.35;
|
|
154506
|
+
}
|
|
154507
|
+
return 0.6;
|
|
154508
|
+
}
|
|
154509
|
+
function estimatedTextWidth(glyphs, fontSize) {
|
|
154510
|
+
return glyphs.reduce((sum, glyph) => sum + estimatedGlyphAdvanceRatio(glyph) * fontSize, 0);
|
|
154511
|
+
}
|
|
154512
|
+
function estimateTextWidth(text22, fontSize) {
|
|
154513
|
+
return estimatedTextWidth(Array.from(text22), fontSize);
|
|
154514
|
+
}
|
|
154515
|
+
var HANGING_PUNCTUATION_RE = /^[\u3001\u3002\uff0c\uff0e\uff01\uff1f\uff1b\uff1a\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u3019\u301b\uff09\uff3d\uff5d\u2019\u201d\u00bb\u203a]$/u;
|
|
154516
|
+
var BREAKABLE_GLYPH_RE = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]$/u;
|
|
154517
|
+
function estimatedWrapUnits(text22) {
|
|
154518
|
+
const units = [];
|
|
154519
|
+
let unbreakableRun = "";
|
|
154520
|
+
const flushRun = () => {
|
|
154521
|
+
if (unbreakableRun.length > 0) {
|
|
154522
|
+
units.push(unbreakableRun);
|
|
154523
|
+
unbreakableRun = "";
|
|
154524
|
+
}
|
|
154525
|
+
};
|
|
154526
|
+
for (const glyph of Array.from(text22)) {
|
|
154527
|
+
if (/\s/u.test(glyph) || BREAKABLE_GLYPH_RE.test(glyph)) {
|
|
154528
|
+
flushRun();
|
|
154529
|
+
units.push(glyph);
|
|
154530
|
+
} else {
|
|
154531
|
+
unbreakableRun += glyph;
|
|
154532
|
+
}
|
|
154533
|
+
}
|
|
154534
|
+
flushRun();
|
|
154535
|
+
return units;
|
|
154536
|
+
}
|
|
154537
|
+
function wrapTextByEstimatedWidth(text22, maxWidth, fontSize, options = {}) {
|
|
154538
|
+
if (!text22 || text22.trim().length === 0) {
|
|
154539
|
+
return [];
|
|
154540
|
+
}
|
|
154541
|
+
if (!(maxWidth > 0) || !(fontSize > 0)) {
|
|
154542
|
+
return [];
|
|
154543
|
+
}
|
|
154544
|
+
const lines = [];
|
|
154545
|
+
for (const paragraph of text22.split(/\r?\n/u)) {
|
|
154546
|
+
if (paragraph.trim().length === 0) {
|
|
154547
|
+
if (options.keepBlankLines) {
|
|
154548
|
+
lines.push("");
|
|
154549
|
+
}
|
|
154550
|
+
continue;
|
|
154551
|
+
}
|
|
154552
|
+
let current = "";
|
|
154553
|
+
let pendingWhitespace = false;
|
|
154554
|
+
for (const unit of estimatedWrapUnits(paragraph)) {
|
|
154555
|
+
if (/^\s+$/u.test(unit)) {
|
|
154556
|
+
pendingWhitespace = current.length > 0;
|
|
154557
|
+
continue;
|
|
154558
|
+
}
|
|
154559
|
+
const separator = pendingWhitespace && current.length > 0 ? " " : "";
|
|
154560
|
+
const candidate = `${current}${separator}${unit}`;
|
|
154561
|
+
if (current.length === 0 || estimatedTextWidth(Array.from(candidate), fontSize) <= maxWidth) {
|
|
154562
|
+
current = candidate;
|
|
154563
|
+
pendingWhitespace = false;
|
|
154564
|
+
continue;
|
|
154565
|
+
}
|
|
154566
|
+
if (HANGING_PUNCTUATION_RE.test(unit)) {
|
|
154567
|
+
current += unit;
|
|
154568
|
+
pendingWhitespace = false;
|
|
154569
|
+
continue;
|
|
154570
|
+
}
|
|
154571
|
+
lines.push(current);
|
|
154572
|
+
current = unit;
|
|
154573
|
+
pendingWhitespace = false;
|
|
154574
|
+
}
|
|
154575
|
+
const completed = current.trimEnd();
|
|
154576
|
+
if (completed.length > 0) {
|
|
154577
|
+
lines.push(completed);
|
|
154578
|
+
}
|
|
154579
|
+
}
|
|
154580
|
+
return lines;
|
|
154581
|
+
}
|
|
154395
154582
|
function valueToX(val2, range, leftX, rightX) {
|
|
154396
154583
|
const usable = rightX - leftX;
|
|
154397
154584
|
let ratio;
|
|
@@ -154441,6 +154628,12 @@ function buildSideCategoryLabels(categoryLabels, layout) {
|
|
|
154441
154628
|
dominantBaseline: "central"
|
|
154442
154629
|
}));
|
|
154443
154630
|
}
|
|
154631
|
+
function widestCategoryLabelWidth(categoryLabels, fontSize) {
|
|
154632
|
+
return categoryLabels.reduce(
|
|
154633
|
+
(max, label) => Math.max(max, estimateTextWidth(label, fontSize)),
|
|
154634
|
+
0
|
|
154635
|
+
);
|
|
154636
|
+
}
|
|
154444
154637
|
function categoryTotals2(series, catCount) {
|
|
154445
154638
|
return Array.from(
|
|
154446
154639
|
{ length: catCount },
|
|
@@ -154455,7 +154648,9 @@ function barFill(chartData, series, seriesIndex, pointIndex) {
|
|
|
154455
154648
|
return resolveDataPointFill(series, pointIndex, paletteColor2(seriesIndex, palette)) ?? seriesColor2(series, seriesIndex, palette);
|
|
154456
154649
|
}
|
|
154457
154650
|
function buildHorizontalBarViewModel(element, chartData, categoryLabels) {
|
|
154458
|
-
const layout = computePlotLayout(element.width, element.height, chartData, true
|
|
154651
|
+
const layout = computePlotLayout(element.width, element.height, chartData, true, {
|
|
154652
|
+
leftCategoryLabelWidth: widestCategoryLabelWidth(categoryLabels, DEFAULT_CHART_TEXT_PX)
|
|
154653
|
+
}), catCount = Math.max(categoryLabels.length, 1), series = chartData.series, grouping = chartData.grouping ?? "clustered", isStacked = grouping === "stacked" || grouping === "percentStacked", isPercent = grouping === "percentStacked", range = isPercent ? { min: 0, max: 100, span: 100 } : isStacked ? computeStackedValueRange(series, catCount, layout.plotWidth) : computeValueRangeForChart(series, chartData.axes, layout.plotWidth), { gridlines, axisLabels } = buildTransposedValueAxis(range, layout), zeroX = valueToX(0, range, layout.plotLeft, layout.plotRight), zeroLine = range.min < 0 && range.max > 0 ? {
|
|
154459
154654
|
kind: "line",
|
|
154460
154655
|
x1: zeroX,
|
|
154461
154656
|
y1: layout.plotTop,
|
|
@@ -157652,9 +157847,12 @@ function categoryAxisBand(chartData) {
|
|
|
157652
157847
|
), fontPx = axis?.fontSize !== void 0 ? chartFontPx(axis.fontSize) : DEFAULT_CHART_TEXT_PX, offset = 4 + 8 * ((axis?.labelOffset ?? 100) / 100);
|
|
157653
157848
|
return Math.max(24, offset + fontPx * 1.2);
|
|
157654
157849
|
}
|
|
157850
|
+
function leftAxisBand(leftCategoryLabelWidth) {
|
|
157851
|
+
return Math.max(40, (leftCategoryLabelWidth ?? 0) + 4);
|
|
157852
|
+
}
|
|
157655
157853
|
function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, options) {
|
|
157656
157854
|
const svgWidth = Math.max(1, elementWidth), svgHeight = Math.max(1, elementHeight);
|
|
157657
|
-
let plotLeft = hasAxes ?
|
|
157855
|
+
let plotLeft = hasAxes ? 8 + leftAxisBand(options?.leftCategoryLabelWidth) : 8, plotTop = 8, plotRight = svgWidth - 8, plotBottom = svgHeight - (hasAxes ? categoryAxisBand(chartData) : 8);
|
|
157658
157856
|
if (hasAxes && options?.categoryAxisAtTop) {
|
|
157659
157857
|
plotBottom = svgHeight - 8;
|
|
157660
157858
|
plotTop += categoryAxisBand(chartData);
|
|
@@ -157693,7 +157891,7 @@ function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, opti
|
|
|
157693
157891
|
plotRight = manual.x + manual.width;
|
|
157694
157892
|
plotBottom = manual.y + manual.height;
|
|
157695
157893
|
if (hasAxes && plotLayout.layoutTarget !== "inner") {
|
|
157696
|
-
plotLeft +=
|
|
157894
|
+
plotLeft += leftAxisBand(options?.leftCategoryLabelWidth);
|
|
157697
157895
|
plotBottom -= categoryAxisBand(chartData) - 8;
|
|
157698
157896
|
}
|
|
157699
157897
|
}
|
|
@@ -158276,7 +158474,7 @@ function regionViewBounds(viewedRegionType, regionValues) {
|
|
|
158276
158474
|
};
|
|
158277
158475
|
}
|
|
158278
158476
|
function scalePathD(d, scale2, dx, dy) {
|
|
158279
|
-
const tokens = d.
|
|
158477
|
+
const tokens = d.match(/[A-Za-z]|-?\d+(?:\.\d+)?/gu) ?? [];
|
|
158280
158478
|
const out = [];
|
|
158281
158479
|
let i2 = 0;
|
|
158282
158480
|
while (i2 < tokens.length) {
|
|
@@ -158291,7 +158489,7 @@ function scalePathD(d, scale2, dx, dy) {
|
|
|
158291
158489
|
continue;
|
|
158292
158490
|
}
|
|
158293
158491
|
const xRaw = parseFloat(tok);
|
|
158294
|
-
const yRaw = parseFloat(tokens[i2 + 1] ?? "
|
|
158492
|
+
const yRaw = parseFloat(tokens[i2 + 1] ?? "");
|
|
158295
158493
|
if (!Number.isNaN(xRaw) && !Number.isNaN(yRaw)) {
|
|
158296
158494
|
out.push(`${(xRaw * scale2 + dx).toFixed(2)},${(yRaw * scale2 + dy).toFixed(2)}`);
|
|
158297
158495
|
i2 += 2;
|
|
@@ -173044,6 +173242,8 @@ var translationsEn = {
|
|
|
173044
173242
|
"pptx.collaboration.userCount": "{{count}} user(s)",
|
|
173045
173243
|
"pptx.collaboration.youLabel": "{{name}} (you)",
|
|
173046
173244
|
"pptx.collaboration.usersConnected": "{{count}} user(s) connected",
|
|
173245
|
+
"pptx.collaboration.editable": "Editable",
|
|
173246
|
+
"pptx.collaboration.shellStatusLabel": "Collaboration status",
|
|
173047
173247
|
"pptx.collaboration.moreUsers": "{{count}} more user(s)",
|
|
173048
173248
|
"pptx.collaboration.onePersonHere": "1 person here",
|
|
173049
173249
|
"pptx.collaboration.peopleHere": "{{count}} people here",
|
|
@@ -178924,11 +179124,16 @@ function buildParagraphs(element, fieldContext, segmentOverrides, options) {
|
|
|
178924
179124
|
}
|
|
178925
179125
|
var sessions = /* @__PURE__ */ new WeakMap();
|
|
178926
179126
|
var nextSession = 0;
|
|
178927
|
-
function createInlineListSeed(element) {
|
|
178928
|
-
if (!hasTextProperties(element) || !element.textSegments?.some((segment) => resolveParagraphBullet(segment))) {
|
|
179127
|
+
function createInlineListSeed(element, options) {
|
|
179128
|
+
if (!hasTextProperties(element) || !options?.includePlain && !element.textSegments?.some((segment) => resolveParagraphBullet(segment))) {
|
|
178929
179129
|
return void 0;
|
|
178930
179130
|
}
|
|
178931
|
-
const
|
|
179131
|
+
const textStyle = element.textStyle;
|
|
179132
|
+
const segments = element.textSegments?.length ? structuredClone(element.textSegments) : (element.text ?? "").split("\n").flatMap((text22, index) => [
|
|
179133
|
+
...index > 0 ? [{ text: "\n", style: {}, isParagraphBreak: true }] : [],
|
|
179134
|
+
{ text: text22, style: structuredClone(textStyle ?? {}) }
|
|
179135
|
+
]);
|
|
179136
|
+
element = { ...element, textSegments: structuredClone(segments) };
|
|
178932
179137
|
const paragraphs2 = [{ segments: [] }];
|
|
178933
179138
|
const indices = [[]];
|
|
178934
179139
|
for (const [index, segment] of segments.entries()) {
|
|
@@ -179156,6 +179361,54 @@ function clearSingleTextDecoration(node, blockRoot) {
|
|
|
179156
179361
|
ancestor = ancestor.parentElement;
|
|
179157
179362
|
}
|
|
179158
179363
|
}
|
|
179364
|
+
var snapshots = /* @__PURE__ */ new WeakMap();
|
|
179365
|
+
function recordInlineListProvenance(seed, root, snapshot, blocks, origins, unchanged22) {
|
|
179366
|
+
const session = inlineListSession(seed);
|
|
179367
|
+
const paragraphs2 = /* @__PURE__ */ new Map();
|
|
179368
|
+
const hidden = [];
|
|
179369
|
+
const segments = snapshot.textSegments ?? [];
|
|
179370
|
+
let paragraphIndex = 0;
|
|
179371
|
+
let start = 0;
|
|
179372
|
+
const record2 = (end, terminator) => {
|
|
179373
|
+
const block = blocks[paragraphIndex++];
|
|
179374
|
+
if (!block) return;
|
|
179375
|
+
paragraphs2.set(block, start < end ? start : terminator ?? null);
|
|
179376
|
+
const body = segments.slice(start, end);
|
|
179377
|
+
const content = body.filter((segment, index) => index !== 0 || !isBulletMarkerSegment(segment));
|
|
179378
|
+
const onlyEmptyCarrier = content.length === 1 && content[0].text === "" && !content[0].isLineBreak;
|
|
179379
|
+
for (let index = start; index < end; index++) {
|
|
179380
|
+
const segment = segments[index];
|
|
179381
|
+
const marker = index === start && isBulletMarkerSegment(segment);
|
|
179382
|
+
if (!marker && (segment.text !== "" || segment.isLineBreak)) continue;
|
|
179383
|
+
const node = marker || onlyEmptyCarrier ? block : unchanged22 ? inlineListDescendants(block).find((child27) => session.runNodes.get(child27) === index) : origins[index];
|
|
179384
|
+
hidden.push({ node, kind: marker ? "marker" : "empty", index });
|
|
179385
|
+
}
|
|
179386
|
+
};
|
|
179387
|
+
for (const [index, segment] of segments.entries()) {
|
|
179388
|
+
if (!isParagraphSeparatorSegment(segment)) continue;
|
|
179389
|
+
record2(index, index);
|
|
179390
|
+
start = index + 1;
|
|
179391
|
+
}
|
|
179392
|
+
record2(segments.length);
|
|
179393
|
+
snapshots.set(snapshot, { seed, root, paragraphs: paragraphs2, hidden });
|
|
179394
|
+
}
|
|
179395
|
+
function readInlineListProvenance(snapshot, previous) {
|
|
179396
|
+
const current = snapshots.get(snapshot);
|
|
179397
|
+
const before = previous && snapshots.get(previous);
|
|
179398
|
+
if (!current || previous && (!before || before.seed !== current.seed || before.root !== current.root)) {
|
|
179399
|
+
return void 0;
|
|
179400
|
+
}
|
|
179401
|
+
const matches2 = (a, b) => a.node !== void 0 && a.node === b.node && a.kind === b.kind;
|
|
179402
|
+
return {
|
|
179403
|
+
paragraphSources: [...current.paragraphs.keys()].map(
|
|
179404
|
+
(node) => before?.paragraphs.get(node) ?? null
|
|
179405
|
+
),
|
|
179406
|
+
hiddenSources: current.hidden.map((origin) => {
|
|
179407
|
+
const old = before?.hidden.filter((candidate) => matches2(origin, candidate));
|
|
179408
|
+
return old?.length === 1 && current.hidden.filter((candidate) => matches2(origin, candidate)).length === 1 ? old[0].index : null;
|
|
179409
|
+
})
|
|
179410
|
+
};
|
|
179411
|
+
}
|
|
179159
179412
|
function inlineListStyleDelta(node, baseline = "", inheritedColor) {
|
|
179160
179413
|
const style = {};
|
|
179161
179414
|
const original = node.ownerDocument.createElement("span").style;
|
|
@@ -179214,6 +179467,11 @@ function bodyOnly(segment) {
|
|
|
179214
179467
|
}
|
|
179215
179468
|
function readInlineListRuns(session, block, bodyStyle) {
|
|
179216
179469
|
const runs = [];
|
|
179470
|
+
const origins = [];
|
|
179471
|
+
const push2 = (segment, node) => {
|
|
179472
|
+
runs.push(segment);
|
|
179473
|
+
origins.push(node);
|
|
179474
|
+
};
|
|
179217
179475
|
let unsupported = false;
|
|
179218
179476
|
let unchanged22 = true;
|
|
179219
179477
|
let placeholder = false;
|
|
@@ -179227,10 +179485,10 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179227
179485
|
const style2 = { ...inherited, ...parentDelta };
|
|
179228
179486
|
for (const [index2, text22] of node.nodeValue.split("\n").entries()) {
|
|
179229
179487
|
if (index2 > 0) {
|
|
179230
|
-
|
|
179488
|
+
push2({ text: "\n", style: { ...style2 }, isLineBreak: true }, node);
|
|
179231
179489
|
}
|
|
179232
179490
|
if (text22) {
|
|
179233
|
-
|
|
179491
|
+
push2({ text: text22, style: { ...style2 } }, node);
|
|
179234
179492
|
}
|
|
179235
179493
|
}
|
|
179236
179494
|
}
|
|
@@ -179262,7 +179520,7 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179262
179520
|
const oldChildren = originalIndex === void 0 ? void 0 : session.runChildren.get(originalIndex);
|
|
179263
179521
|
const intact = originalIndex !== void 0 && node.innerHTML === session.runHtml.get(originalIndex) && children13.length === oldChildren?.length && children13.every((child27, childIndex) => child27 === oldChildren[childIndex]);
|
|
179264
179522
|
if (intact && original) {
|
|
179265
|
-
|
|
179523
|
+
push2({ ...bodyOnly(original), style }, node);
|
|
179266
179524
|
unchanged22 &&= index === originalIndex && Object.keys(delta).length === 0;
|
|
179267
179525
|
return;
|
|
179268
179526
|
}
|
|
@@ -179276,7 +179534,7 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179276
179534
|
return;
|
|
179277
179535
|
}
|
|
179278
179536
|
if (node.tagName === "BR") {
|
|
179279
|
-
|
|
179537
|
+
push2({ text: "\n", style, isLineBreak: true }, node);
|
|
179280
179538
|
placeholder = original?.isLineBreak !== true;
|
|
179281
179539
|
return;
|
|
179282
179540
|
}
|
|
@@ -179286,9 +179544,9 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179286
179544
|
};
|
|
179287
179545
|
walk2(block, bodyStyle);
|
|
179288
179546
|
if (runs.length === 1 && runs[0].isLineBreak && placeholder) {
|
|
179289
|
-
return { runs: [{ text: "", style: runs[0].style }], unchanged: false };
|
|
179547
|
+
return { runs: [{ text: "", style: runs[0].style }], origins: [block], unchanged: false };
|
|
179290
179548
|
}
|
|
179291
|
-
return unsupported ? void 0 : { runs, unchanged: unchanged22 };
|
|
179549
|
+
return unsupported ? void 0 : { runs, origins, unchanged: unchanged22 };
|
|
179292
179550
|
}
|
|
179293
179551
|
function hasOnlyCaretPlaceholder(element) {
|
|
179294
179552
|
const content = Array.from(element.childNodes).filter((child27) => {
|
|
@@ -179360,6 +179618,7 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179360
179618
|
return fallback("unsupported-paragraph-structure");
|
|
179361
179619
|
}
|
|
179362
179620
|
const segments = [];
|
|
179621
|
+
const origins = [];
|
|
179363
179622
|
const text22 = [];
|
|
179364
179623
|
const sequence = createAutoNumberSequence();
|
|
179365
179624
|
let unchanged22 = blocks.length === seed.paragraphs.length;
|
|
@@ -179380,7 +179639,7 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179380
179639
|
return fallback("unsupported-run-structure");
|
|
179381
179640
|
}
|
|
179382
179641
|
const { runs } = body;
|
|
179383
|
-
const bodyText = runs.map((run) => run.text).join("");
|
|
179642
|
+
const bodyText = runs.map((run) => run.isLineBreak ? "\n" : run.text).join("");
|
|
179384
179643
|
text22.push(bodyText);
|
|
179385
179644
|
unchanged22 &&= original === position2 && token2 === seed.paragraphs[position2].token && body.unchanged && bodyText === seed.paragraphs[position2].runs.map((run) => run.text).join("") && runs.every(
|
|
179386
179645
|
(run, index) => JSON.stringify(run.style) === JSON.stringify(seed.paragraphs[position2].runs[index]?.style)
|
|
@@ -179390,6 +179649,7 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179390
179649
|
text: "",
|
|
179391
179650
|
style: structuredClone(carrier?.paragraphInsertionStyle ?? carrier?.style ?? {})
|
|
179392
179651
|
});
|
|
179652
|
+
body.origins.push(block);
|
|
179393
179653
|
}
|
|
179394
179654
|
if (carrier) {
|
|
179395
179655
|
if (original !== void 0) {
|
|
@@ -179437,14 +179697,18 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179437
179697
|
delete first[key2];
|
|
179438
179698
|
}
|
|
179439
179699
|
runs.unshift(marker);
|
|
179700
|
+
body.origins.unshift(block);
|
|
179440
179701
|
}
|
|
179441
179702
|
if (position2 > 0) {
|
|
179442
179703
|
segments.push({ text: "\n", style: {}, isParagraphBreak: true });
|
|
179704
|
+
origins.push(void 0);
|
|
179443
179705
|
}
|
|
179444
179706
|
segments.push(...runs);
|
|
179707
|
+
origins.push(...body.origins);
|
|
179445
179708
|
}
|
|
179446
179709
|
const textSegments = unchanged22 ? structuredClone(session.originalSegments) : segments;
|
|
179447
179710
|
const snapshot = { elementId: seed.elementId, text: text22.join("\n"), textSegments };
|
|
179711
|
+
recordInlineListProvenance(seed, root, snapshot, blocks, origins, unchanged22);
|
|
179448
179712
|
return {
|
|
179449
179713
|
kind: "supported",
|
|
179450
179714
|
snapshot,
|
|
@@ -179453,6 +179717,12 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179453
179717
|
})
|
|
179454
179718
|
};
|
|
179455
179719
|
}
|
|
179720
|
+
function readInlineListNativeSnapshot(seed, root, previous) {
|
|
179721
|
+
const read = readInlineListSnapshot(seed, root);
|
|
179722
|
+
if (read.kind !== "supported") return read;
|
|
179723
|
+
const provenance = readInlineListProvenance(read.snapshot, previous);
|
|
179724
|
+
return provenance ? { ...read, ...provenance } : { kind: "unsupported", reason: "unknown-native-baseline", text: read.snapshot.text };
|
|
179725
|
+
}
|
|
179456
179726
|
function paragraphBodies(segments) {
|
|
179457
179727
|
const paragraphs2 = [""];
|
|
179458
179728
|
let first = true;
|
|
@@ -179462,7 +179732,7 @@ function paragraphBodies(segments) {
|
|
|
179462
179732
|
first = true;
|
|
179463
179733
|
} else {
|
|
179464
179734
|
if (!first || !isBulletMarkerSegment(segment)) {
|
|
179465
|
-
paragraphs2[paragraphs2.length - 1] += segment.text;
|
|
179735
|
+
paragraphs2[paragraphs2.length - 1] += segment.isLineBreak ? "\n" : segment.text;
|
|
179466
179736
|
}
|
|
179467
179737
|
first = false;
|
|
179468
179738
|
}
|
|
@@ -179482,7 +179752,7 @@ function modelPoint(segments, offset, end) {
|
|
|
179482
179752
|
}
|
|
179483
179753
|
continue;
|
|
179484
179754
|
}
|
|
179485
|
-
const next = position2 + segment.text.length;
|
|
179755
|
+
const next = position2 + (first || segment.isLineBreak ? 1 : segment.text.length);
|
|
179486
179756
|
if (!first && !segment.isLineBreak) {
|
|
179487
179757
|
last = { index, offset: segment.text.length };
|
|
179488
179758
|
if (end ? offset <= next : offset < next || offset === position2 && next === position2) {
|
|
@@ -179494,18 +179764,30 @@ function modelPoint(segments, offset, end) {
|
|
|
179494
179764
|
return last;
|
|
179495
179765
|
}
|
|
179496
179766
|
function readInlineListSelection(seed, root, selection = root.ownerDocument.defaultView?.getSelection() ?? null) {
|
|
179767
|
+
return readInlineListRange(seed, root, selection?.rangeCount ? selection.getRangeAt(0) : null);
|
|
179768
|
+
}
|
|
179769
|
+
function readInlineListRange(seed, root, range) {
|
|
179497
179770
|
const read = readInlineListSnapshot(seed, root);
|
|
179498
179771
|
if (read.kind !== "supported") {
|
|
179499
179772
|
return { kind: "unsupported", reason: read.reason };
|
|
179500
179773
|
}
|
|
179501
179774
|
const { snapshot } = read;
|
|
179502
|
-
if (!
|
|
179775
|
+
if (!range) {
|
|
179503
179776
|
return { kind: "supported", snapshot, selection: null };
|
|
179504
179777
|
}
|
|
179505
|
-
const range = selection.getRangeAt(0);
|
|
179506
179778
|
if (!root.contains(range.startContainer) || !root.contains(range.endContainer)) {
|
|
179507
179779
|
return { kind: "unsupported", reason: "selection-outside-session" };
|
|
179508
179780
|
}
|
|
179781
|
+
try {
|
|
179782
|
+
const checked = root.ownerDocument.createRange();
|
|
179783
|
+
checked.setStart(range.startContainer, range.startOffset);
|
|
179784
|
+
checked.setEnd(range.endContainer, range.endOffset);
|
|
179785
|
+
if (checked.startContainer !== range.startContainer || checked.startOffset !== range.startOffset || checked.endContainer !== range.endContainer || checked.endOffset !== range.endOffset) {
|
|
179786
|
+
return { kind: "unsupported", reason: "invalid-selection-boundary" };
|
|
179787
|
+
}
|
|
179788
|
+
} catch {
|
|
179789
|
+
return { kind: "unsupported", reason: "invalid-selection-boundary" };
|
|
179790
|
+
}
|
|
179509
179791
|
const blocks = Array.from(root.children);
|
|
179510
179792
|
const bodies = paragraphBodies(snapshot.textSegments);
|
|
179511
179793
|
if (blocks.some(
|
|
@@ -185728,6 +186010,26 @@ function presenceToCursors(presence, activeSlideIndex) {
|
|
|
185728
186010
|
}
|
|
185729
186011
|
return cursors;
|
|
185730
186012
|
}
|
|
186013
|
+
function resolveCollaborationShellEditability(input) {
|
|
186014
|
+
return input.authorizedCanEdit && (!input.configured || !input.readOnly && !input.sourcePending && !input.sourceError);
|
|
186015
|
+
}
|
|
186016
|
+
function resolveCollaborationShellState(input) {
|
|
186017
|
+
const status = input.configured ? input.status : "disconnected";
|
|
186018
|
+
const remoteUsers = input.configured ? input.remoteUsers : [];
|
|
186019
|
+
return {
|
|
186020
|
+
canEdit: resolveCollaborationShellEditability(input),
|
|
186021
|
+
status,
|
|
186022
|
+
remoteUsers,
|
|
186023
|
+
connectedCount: remoteUsers.length + (status === "connected" ? 1 : 0)
|
|
186024
|
+
};
|
|
186025
|
+
}
|
|
186026
|
+
function describeCollaborationShellState(state, translate) {
|
|
186027
|
+
return [
|
|
186028
|
+
translate(`pptx.collaboration.status.${state.status}`),
|
|
186029
|
+
translate("pptx.collaboration.usersConnected", { count: state.connectedCount }),
|
|
186030
|
+
translate(state.canEdit ? "pptx.collaboration.editable" : "pptx.toolbar.readOnly")
|
|
186031
|
+
].join(" \xB7 ");
|
|
186032
|
+
}
|
|
185731
186033
|
function observeExternalCollaborationSession(session, onSnapshot) {
|
|
185732
186034
|
let active2 = true;
|
|
185733
186035
|
let subscribing = true;
|
|
@@ -185923,6 +186225,9 @@ function buildSegmentAttrs(seg) {
|
|
|
185923
186225
|
if (seg.paragraphInsertionStyle) {
|
|
185924
186226
|
a.pi = JSON.stringify(seg.paragraphInsertionStyle);
|
|
185925
186227
|
}
|
|
186228
|
+
if (seg.paragraphProperties) {
|
|
186229
|
+
a.pp = JSON.stringify(seg.paragraphProperties);
|
|
186230
|
+
}
|
|
185926
186231
|
if (typeof seg.fieldType === "string") {
|
|
185927
186232
|
a.ft = seg.fieldType;
|
|
185928
186233
|
}
|
|
@@ -186035,6 +186340,12 @@ function decodeDelta(delta) {
|
|
|
186035
186340
|
} catch {
|
|
186036
186341
|
}
|
|
186037
186342
|
}
|
|
186343
|
+
if (a.pp) {
|
|
186344
|
+
try {
|
|
186345
|
+
seg.paragraphProperties = JSON.parse(a.pp);
|
|
186346
|
+
} catch {
|
|
186347
|
+
}
|
|
186348
|
+
}
|
|
186038
186349
|
if (a.ft) {
|
|
186039
186350
|
seg.fieldType = a.ft;
|
|
186040
186351
|
}
|
|
@@ -186097,6 +186408,22 @@ function decodeDelta(delta) {
|
|
|
186097
186408
|
function decodeTextBody(ytext) {
|
|
186098
186409
|
return decodeDelta(ytext.toDelta());
|
|
186099
186410
|
}
|
|
186411
|
+
function inlineListBodyText(segments) {
|
|
186412
|
+
let first = true;
|
|
186413
|
+
let text22 = "";
|
|
186414
|
+
for (const segment of segments ?? []) {
|
|
186415
|
+
if (isParagraphSeparatorSegment(segment)) {
|
|
186416
|
+
text22 += "\n";
|
|
186417
|
+
first = true;
|
|
186418
|
+
} else {
|
|
186419
|
+
if (!first || !isBulletMarkerSegment(segment)) {
|
|
186420
|
+
text22 += segment.isLineBreak ? "\n" : segment.text;
|
|
186421
|
+
}
|
|
186422
|
+
first = false;
|
|
186423
|
+
}
|
|
186424
|
+
}
|
|
186425
|
+
return text22;
|
|
186426
|
+
}
|
|
186100
186427
|
var YDOC_SLIDES_KEY = "pptx:slides";
|
|
186101
186428
|
var SCALAR_ELEMENT_KEYS = /* @__PURE__ */ new Set([
|
|
186102
186429
|
"id",
|
|
@@ -186350,6 +186677,9 @@ function readElementFromYMap(ymap, assets) {
|
|
|
186350
186677
|
}
|
|
186351
186678
|
});
|
|
186352
186679
|
readAssetFields(ymap, assets, element);
|
|
186680
|
+
if (Array.isArray(element.textSegments) && element.textSegments.length > 0) {
|
|
186681
|
+
element.text = inlineListBodyText(element.textSegments);
|
|
186682
|
+
}
|
|
186353
186683
|
return element;
|
|
186354
186684
|
}
|
|
186355
186685
|
function writeSlideToYMap(slide, ymap, factories, assets) {
|
|
@@ -186413,6 +186743,32 @@ function observeYDocSlides(ydoc, onChange) {
|
|
|
186413
186743
|
arr.observeDeep(onChange);
|
|
186414
186744
|
return () => arr.unobserveDeep(onChange);
|
|
186415
186745
|
}
|
|
186746
|
+
var leases = /* @__PURE__ */ new WeakMap();
|
|
186747
|
+
function registerCollaborationTextLease(target, ownsModel) {
|
|
186748
|
+
const lease = { ownsModel };
|
|
186749
|
+
leases.set(target, lease);
|
|
186750
|
+
return () => {
|
|
186751
|
+
if (leases.get(target) === lease) {
|
|
186752
|
+
leases.delete(target);
|
|
186753
|
+
}
|
|
186754
|
+
};
|
|
186755
|
+
}
|
|
186756
|
+
function hasCollaborationTextLease(target, candidate) {
|
|
186757
|
+
const lease = leases.get(target);
|
|
186758
|
+
if (!lease) {
|
|
186759
|
+
return false;
|
|
186760
|
+
}
|
|
186761
|
+
try {
|
|
186762
|
+
if (lease.ownsModel(candidate) && leases.get(target) === lease) {
|
|
186763
|
+
return true;
|
|
186764
|
+
}
|
|
186765
|
+
} catch {
|
|
186766
|
+
}
|
|
186767
|
+
if (leases.get(target) === lease) {
|
|
186768
|
+
leases.delete(target);
|
|
186769
|
+
}
|
|
186770
|
+
return false;
|
|
186771
|
+
}
|
|
186416
186772
|
function isYTextEditable(value) {
|
|
186417
186773
|
return isYTextLike(value) && typeof value.delete === "function" && typeof value.format === "function";
|
|
186418
186774
|
}
|
|
@@ -186535,8 +186891,11 @@ var LOCAL_SYNC_ORIGIN = "pptx-viewer:local-sync";
|
|
|
186535
186891
|
function jsonEqual(a, b) {
|
|
186536
186892
|
return a === b || JSON.stringify(a) === JSON.stringify(b);
|
|
186537
186893
|
}
|
|
186538
|
-
function reconcileScalars(ymap, rec, keys) {
|
|
186894
|
+
function reconcileScalars(ymap, rec, keys, skipKey) {
|
|
186539
186895
|
for (const key2 of keys) {
|
|
186896
|
+
if (key2 === skipKey) {
|
|
186897
|
+
continue;
|
|
186898
|
+
}
|
|
186540
186899
|
const next = rec[key2];
|
|
186541
186900
|
const current = ymap.get(key2);
|
|
186542
186901
|
if (next === void 0) {
|
|
@@ -186585,9 +186944,12 @@ function reconcileElementTextBody(ymap, rec, factories) {
|
|
|
186585
186944
|
}
|
|
186586
186945
|
function reconcileElementYMap(ymap, element, factories, assets) {
|
|
186587
186946
|
const rec = element;
|
|
186588
|
-
|
|
186947
|
+
const ownsText = hasCollaborationTextLease(ymap, element);
|
|
186948
|
+
reconcileScalars(ymap, rec, SCALAR_ELEMENT_KEYS, ownsText ? "text" : void 0);
|
|
186589
186949
|
reconcileComplexFields(ymap, rec, COMPLEX_ELEMENT_FIELDS);
|
|
186590
|
-
|
|
186950
|
+
if (!ownsText) {
|
|
186951
|
+
reconcileElementTextBody(ymap, rec, factories);
|
|
186952
|
+
}
|
|
186591
186953
|
reconcileAssetFields(rec.id, rec, ymap, assets);
|
|
186592
186954
|
}
|
|
186593
186955
|
function mapIdAt(arr, index) {
|
|
@@ -186701,8 +187063,13 @@ function observeExternalCollaborationReadiness(session, options) {
|
|
|
186701
187063
|
}
|
|
186702
187064
|
};
|
|
186703
187065
|
const suspend = () => {
|
|
187066
|
+
const preserveAcceptedEdits = active2 && established && options.gate.isOpen();
|
|
186704
187067
|
options.gate.reset();
|
|
186705
187068
|
options.livePatcher?.configure(null, null);
|
|
187069
|
+
if (preserveAcceptedEdits) {
|
|
187070
|
+
lastAdopted = void 0;
|
|
187071
|
+
adopt(readSlidesFromYDoc(session.doc));
|
|
187072
|
+
}
|
|
186706
187073
|
options.onSuspend?.();
|
|
186707
187074
|
notifyReadOnly();
|
|
186708
187075
|
};
|
|
@@ -186959,6 +187326,576 @@ function applyLivePatch(doc, factories, patch, textPatchLimit) {
|
|
|
186959
187326
|
reconcileElementTextBody(ymap, { textSegments: segments }, factories);
|
|
186960
187327
|
}
|
|
186961
187328
|
}
|
|
187329
|
+
function initializeCollaborationText(doc, element, factories, isCurrent) {
|
|
187330
|
+
const needsSeed = () => {
|
|
187331
|
+
const body = element.get("textBody");
|
|
187332
|
+
return (body === void 0 || isYTextEditable(body) && body.toDelta().length === 0) && typeof element.get("text") === "string";
|
|
187333
|
+
};
|
|
187334
|
+
if (!isCurrent() || !needsSeed()) {
|
|
187335
|
+
return;
|
|
187336
|
+
}
|
|
187337
|
+
doc.transact(() => {
|
|
187338
|
+
if (!isCurrent() || !needsSeed()) {
|
|
187339
|
+
return;
|
|
187340
|
+
}
|
|
187341
|
+
let textStyle;
|
|
187342
|
+
try {
|
|
187343
|
+
const raw = element.get(COMPLEX_ELEMENT_FIELDS.textStyle);
|
|
187344
|
+
if (typeof raw === "string") {
|
|
187345
|
+
textStyle = JSON.parse(raw);
|
|
187346
|
+
}
|
|
187347
|
+
} catch {
|
|
187348
|
+
}
|
|
187349
|
+
const seed = createInlineListSeed(
|
|
187350
|
+
{
|
|
187351
|
+
id: element.get("id"),
|
|
187352
|
+
type: element.get("type"),
|
|
187353
|
+
text: element.get("text"),
|
|
187354
|
+
textStyle
|
|
187355
|
+
},
|
|
187356
|
+
{ includePlain: true }
|
|
187357
|
+
);
|
|
187358
|
+
const segments = seed && inlineListSession(seed)?.originalSegments;
|
|
187359
|
+
if (!segments) {
|
|
187360
|
+
return;
|
|
187361
|
+
}
|
|
187362
|
+
const previous = element.get("textBody");
|
|
187363
|
+
const text22 = isYTextEditable(previous) ? previous : factories.createText();
|
|
187364
|
+
encodeTextBody(segments, text22);
|
|
187365
|
+
if (text22 !== previous) {
|
|
187366
|
+
element.set("textBody", text22);
|
|
187367
|
+
}
|
|
187368
|
+
}, LOCAL_SYNC_ORIGIN);
|
|
187369
|
+
}
|
|
187370
|
+
var textBoundary = (text22, index) => !(text22.charCodeAt(index - 1) >= 55296 && text22.charCodeAt(index - 1) <= 56319 && text22.charCodeAt(index) >= 56320 && text22.charCodeAt(index) <= 57343);
|
|
187371
|
+
function textSessionReplacementSpan(before, after, { from, to }) {
|
|
187372
|
+
const suffix = before.length - to;
|
|
187373
|
+
const afterEnd = after.length - suffix;
|
|
187374
|
+
return Number.isInteger(from) && Number.isInteger(to) && from >= 0 && to >= from && to <= before.length && afterEnd >= from && before.slice(0, from) === after.slice(0, from) && before.slice(to) === after.slice(afterEnd) && textBoundary(before, from) && textBoundary(before, to) && textBoundary(after, from) && textBoundary(after, afterEnd) ? { prefix: from, suffix } : void 0;
|
|
187375
|
+
}
|
|
187376
|
+
function textSessionRetainedIndices(before, after, edit) {
|
|
187377
|
+
let indices;
|
|
187378
|
+
if (edit && "retainedIndices" in edit) {
|
|
187379
|
+
indices = Array.from(edit.retainedIndices);
|
|
187380
|
+
} else {
|
|
187381
|
+
const explicit = edit && textSessionReplacementSpan(before, after, edit);
|
|
187382
|
+
if (edit && !explicit) {
|
|
187383
|
+
return void 0;
|
|
187384
|
+
}
|
|
187385
|
+
const prefix = explicit?.prefix ?? commonPrefixLength3(before, after);
|
|
187386
|
+
const suffix = explicit?.suffix ?? commonSuffixLength3(before, after, prefix);
|
|
187387
|
+
indices = Array.from(
|
|
187388
|
+
{ length: after.length },
|
|
187389
|
+
(_, index) => index < prefix ? index : index >= after.length - suffix ? before.length - (after.length - index) : null
|
|
187390
|
+
);
|
|
187391
|
+
}
|
|
187392
|
+
if (indices.length !== after.length) {
|
|
187393
|
+
return void 0;
|
|
187394
|
+
}
|
|
187395
|
+
let last = -1;
|
|
187396
|
+
for (const [index, retained] of indices.entries()) {
|
|
187397
|
+
if (retained === null) {
|
|
187398
|
+
continue;
|
|
187399
|
+
}
|
|
187400
|
+
if (!Number.isInteger(retained) || retained <= last || retained >= before.length || before[retained] !== after[index] || (!textBoundary(before, retained) || !textBoundary(after, index)) && indices[index - 1] !== retained - 1 || (!textBoundary(before, retained + 1) || !textBoundary(after, index + 1)) && indices[index + 1] !== retained + 1) {
|
|
187401
|
+
return void 0;
|
|
187402
|
+
}
|
|
187403
|
+
last = retained;
|
|
187404
|
+
}
|
|
187405
|
+
return indices;
|
|
187406
|
+
}
|
|
187407
|
+
function textSessionPlan(before, after, edit) {
|
|
187408
|
+
const retainedIndices = textSessionRetainedIndices(before, after, edit);
|
|
187409
|
+
if (!retainedIndices) {
|
|
187410
|
+
return void 0;
|
|
187411
|
+
}
|
|
187412
|
+
const sources = edit && "retainedIndices" in edit ? edit.paragraphSources : void 0;
|
|
187413
|
+
if (sources === void 0) {
|
|
187414
|
+
return { retainedIndices };
|
|
187415
|
+
}
|
|
187416
|
+
const paragraphSources = Array.from(sources);
|
|
187417
|
+
if (paragraphSources.length !== after.length || paragraphSources.some(
|
|
187418
|
+
(source) => source !== null && (!Number.isInteger(source) || source < 0 || source >= before.length)
|
|
187419
|
+
)) {
|
|
187420
|
+
return void 0;
|
|
187421
|
+
}
|
|
187422
|
+
return { retainedIndices, paragraphSources };
|
|
187423
|
+
}
|
|
187424
|
+
function textSessionAttributesEqual(a, b) {
|
|
187425
|
+
return Object.keys(a).length === Object.keys(b).length && Object.keys(a).every((key2) => a[key2] === b[key2]);
|
|
187426
|
+
}
|
|
187427
|
+
function textSessionDeltaSupported(delta) {
|
|
187428
|
+
return delta.every(
|
|
187429
|
+
(op2) => typeof op2.insert === "string" && Object.values(op2.attributes ?? {}).every((value) => typeof value === "string")
|
|
187430
|
+
);
|
|
187431
|
+
}
|
|
187432
|
+
function textSessionUnits(delta) {
|
|
187433
|
+
const units = [];
|
|
187434
|
+
for (const op2 of delta) {
|
|
187435
|
+
if (typeof op2.insert !== "string") {
|
|
187436
|
+
return void 0;
|
|
187437
|
+
}
|
|
187438
|
+
const attributes = {};
|
|
187439
|
+
for (const [key2, value] of Object.entries(op2.attributes ?? {})) {
|
|
187440
|
+
if (typeof value !== "string") {
|
|
187441
|
+
return void 0;
|
|
187442
|
+
}
|
|
187443
|
+
attributes[key2] = value;
|
|
187444
|
+
}
|
|
187445
|
+
for (let index = 0; index < op2.insert.length; index++) {
|
|
187446
|
+
units.push({ text: op2.insert[index], attributes });
|
|
187447
|
+
}
|
|
187448
|
+
}
|
|
187449
|
+
return units;
|
|
187450
|
+
}
|
|
187451
|
+
function textSessionAttributePatch(before, after, current) {
|
|
187452
|
+
const patch = {};
|
|
187453
|
+
for (const key2 of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
187454
|
+
if (before[key2] !== after[key2]) {
|
|
187455
|
+
patch[key2] = key2 === "s" ? mergeTextSessionObjectAttribute(before[key2], after[key2], current[key2]) : after[key2] ?? null;
|
|
187456
|
+
}
|
|
187457
|
+
}
|
|
187458
|
+
return patch;
|
|
187459
|
+
}
|
|
187460
|
+
function isObject(value) {
|
|
187461
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
187462
|
+
}
|
|
187463
|
+
function mergeObjectChanges(before, after, current) {
|
|
187464
|
+
const merged = new Map(Object.entries(current));
|
|
187465
|
+
for (const key2 of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
187466
|
+
const oldValue = Object.hasOwn(before, key2) ? before[key2] : void 0;
|
|
187467
|
+
const nextValue = Object.hasOwn(after, key2) ? after[key2] : void 0;
|
|
187468
|
+
if (JSON.stringify(oldValue) === JSON.stringify(nextValue)) {
|
|
187469
|
+
continue;
|
|
187470
|
+
}
|
|
187471
|
+
const liveValue = merged.get(key2);
|
|
187472
|
+
if ((oldValue === void 0 || isObject(oldValue)) && (nextValue === void 0 || isObject(nextValue)) && isObject(liveValue)) {
|
|
187473
|
+
const nested = mergeObjectChanges(oldValue ?? {}, nextValue ?? {}, liveValue);
|
|
187474
|
+
if (Object.keys(nested).length > 0) {
|
|
187475
|
+
merged.set(key2, nested);
|
|
187476
|
+
} else {
|
|
187477
|
+
merged.delete(key2);
|
|
187478
|
+
}
|
|
187479
|
+
} else if (nextValue === void 0) {
|
|
187480
|
+
merged.delete(key2);
|
|
187481
|
+
} else {
|
|
187482
|
+
merged.set(key2, nextValue);
|
|
187483
|
+
}
|
|
187484
|
+
}
|
|
187485
|
+
return Object.fromEntries(merged);
|
|
187486
|
+
}
|
|
187487
|
+
function mergeTextSessionObjectAttribute(before, after, current) {
|
|
187488
|
+
try {
|
|
187489
|
+
const oldValue = before ? JSON.parse(before) : {};
|
|
187490
|
+
const nextValue = after ? JSON.parse(after) : {};
|
|
187491
|
+
const liveValue = current ? JSON.parse(current) : {};
|
|
187492
|
+
if (isObject(oldValue) && isObject(nextValue) && isObject(liveValue)) {
|
|
187493
|
+
const merged = mergeObjectChanges(oldValue, nextValue, liveValue);
|
|
187494
|
+
return Object.keys(merged).length ? JSON.stringify(merged) : null;
|
|
187495
|
+
}
|
|
187496
|
+
} catch {
|
|
187497
|
+
}
|
|
187498
|
+
return after ?? null;
|
|
187499
|
+
}
|
|
187500
|
+
var paragraphKeys = ["bi", "pl", "pr", "pi", "pp"];
|
|
187501
|
+
function readParagraphAttributes(previous, source, readCurrent) {
|
|
187502
|
+
const carrier = readCurrent(source);
|
|
187503
|
+
if (carrier) return carrier;
|
|
187504
|
+
if (previous[source].attributes.pb === "1") return {};
|
|
187505
|
+
let start = source;
|
|
187506
|
+
while (start > 0 && previous[start - 1].attributes.pb !== "1") start--;
|
|
187507
|
+
for (let index = start; index < previous.length && previous[index].attributes.pb !== "1"; index++) {
|
|
187508
|
+
const current = readCurrent(index);
|
|
187509
|
+
if (current) return current;
|
|
187510
|
+
}
|
|
187511
|
+
return {};
|
|
187512
|
+
}
|
|
187513
|
+
function textSessionParagraphPatches(previous, desired, sources, readCurrent) {
|
|
187514
|
+
const patches = /* @__PURE__ */ new Map();
|
|
187515
|
+
const cache = /* @__PURE__ */ new Map();
|
|
187516
|
+
for (const [index, source] of (sources ?? []).entries()) {
|
|
187517
|
+
if (source === null) {
|
|
187518
|
+
continue;
|
|
187519
|
+
}
|
|
187520
|
+
const after = desired[index].attributes;
|
|
187521
|
+
let byAttributes = cache.get(source);
|
|
187522
|
+
if (!byAttributes) {
|
|
187523
|
+
byAttributes = /* @__PURE__ */ new Map();
|
|
187524
|
+
cache.set(source, byAttributes);
|
|
187525
|
+
}
|
|
187526
|
+
let patch = byAttributes.get(after);
|
|
187527
|
+
if (!patch) {
|
|
187528
|
+
const before = previous[source].attributes;
|
|
187529
|
+
const current = readParagraphAttributes(previous, source, readCurrent);
|
|
187530
|
+
patch = {};
|
|
187531
|
+
for (const key2 of paragraphKeys) {
|
|
187532
|
+
patch[key2] = before[key2] === after[key2] ? current[key2] ?? null : key2 === "pl" ? after[key2] ?? null : mergeTextSessionObjectAttribute(before[key2], after[key2], current[key2]);
|
|
187533
|
+
}
|
|
187534
|
+
byAttributes.set(after, patch);
|
|
187535
|
+
}
|
|
187536
|
+
patches.set(index, patch);
|
|
187537
|
+
}
|
|
187538
|
+
return patches;
|
|
187539
|
+
}
|
|
187540
|
+
function textSessionInsertionAttributes(attributes, paragraph) {
|
|
187541
|
+
const result = { ...attributes };
|
|
187542
|
+
for (const [key2, value] of Object.entries(paragraph ?? {})) {
|
|
187543
|
+
if (value === null) {
|
|
187544
|
+
delete result[key2];
|
|
187545
|
+
} else {
|
|
187546
|
+
result[key2] = value;
|
|
187547
|
+
}
|
|
187548
|
+
}
|
|
187549
|
+
return result;
|
|
187550
|
+
}
|
|
187551
|
+
function applyTextSessionPlan(text22, positions2, previous, desired, indices, emptyBoundary, paragraphSources) {
|
|
187552
|
+
const range = (unit) => {
|
|
187553
|
+
const start = positions2.resolve(unit.start);
|
|
187554
|
+
const end = positions2.resolve(unit.end);
|
|
187555
|
+
return start !== null && end !== null && end > start ? { start, end } : void 0;
|
|
187556
|
+
};
|
|
187557
|
+
const sourceUnits = paragraphSources && textSessionUnits(text22.toDelta());
|
|
187558
|
+
if (paragraphSources && !sourceUnits) {
|
|
187559
|
+
return void 0;
|
|
187560
|
+
}
|
|
187561
|
+
const paragraphPatches = textSessionParagraphPatches(
|
|
187562
|
+
previous,
|
|
187563
|
+
desired,
|
|
187564
|
+
paragraphSources,
|
|
187565
|
+
(source) => {
|
|
187566
|
+
const current = range(previous[source]);
|
|
187567
|
+
return current ? sourceUnits?.[current.start]?.attributes : void 0;
|
|
187568
|
+
}
|
|
187569
|
+
);
|
|
187570
|
+
const batches = [];
|
|
187571
|
+
for (let index = 0; index < indices.length; ) {
|
|
187572
|
+
if (indices[index] !== null) {
|
|
187573
|
+
index++;
|
|
187574
|
+
continue;
|
|
187575
|
+
}
|
|
187576
|
+
const from = index;
|
|
187577
|
+
while (index < indices.length && indices[index] === null) {
|
|
187578
|
+
index++;
|
|
187579
|
+
}
|
|
187580
|
+
const oldStart = from === 0 ? 0 : indices[from - 1] + 1;
|
|
187581
|
+
const boundary = previous[oldStart]?.start ?? previous.at(-1)?.end ?? emptyBoundary;
|
|
187582
|
+
if (positions2.resolve(boundary) === null) {
|
|
187583
|
+
return void 0;
|
|
187584
|
+
}
|
|
187585
|
+
batches.push({ from, to: index, boundary });
|
|
187586
|
+
}
|
|
187587
|
+
const retained = new Set(indices);
|
|
187588
|
+
const deletedRanges = previous.filter((_, index) => !retained.has(index)).map(range).filter((value) => value !== void 0).sort((a, b) => a.start - b.start);
|
|
187589
|
+
const deletions = [];
|
|
187590
|
+
for (const next of deletedRanges) {
|
|
187591
|
+
const last = deletions.at(-1);
|
|
187592
|
+
if (last && last.end === next.start) {
|
|
187593
|
+
last.end = next.end;
|
|
187594
|
+
} else {
|
|
187595
|
+
deletions.push(next);
|
|
187596
|
+
}
|
|
187597
|
+
}
|
|
187598
|
+
for (const deletion of deletions.reverse()) {
|
|
187599
|
+
text22.delete(deletion.start, deletion.end - deletion.start);
|
|
187600
|
+
}
|
|
187601
|
+
if (positions2.refresh?.() === false) {
|
|
187602
|
+
return void 0;
|
|
187603
|
+
}
|
|
187604
|
+
const inserted = /* @__PURE__ */ new Map();
|
|
187605
|
+
let precedingInsert;
|
|
187606
|
+
for (const batch of batches) {
|
|
187607
|
+
const boundary = positions2.resolve(batch.boundary);
|
|
187608
|
+
const minimum = precedingInsert ? positions2.resolve(precedingInsert.end) : 0;
|
|
187609
|
+
if (boundary === null || minimum === null) {
|
|
187610
|
+
return void 0;
|
|
187611
|
+
}
|
|
187612
|
+
const start = Math.max(boundary, minimum);
|
|
187613
|
+
let offset = start;
|
|
187614
|
+
for (let index = batch.from; index < batch.to; ) {
|
|
187615
|
+
let end = index + 1;
|
|
187616
|
+
while (end < batch.to && desired[end].attributes === desired[index].attributes && paragraphPatches.get(end) === paragraphPatches.get(index)) {
|
|
187617
|
+
end++;
|
|
187618
|
+
}
|
|
187619
|
+
text22.insert(
|
|
187620
|
+
offset,
|
|
187621
|
+
desired.slice(index, end).map((unit) => unit.text).join(""),
|
|
187622
|
+
textSessionInsertionAttributes(desired[index].attributes, paragraphPatches.get(index))
|
|
187623
|
+
);
|
|
187624
|
+
offset += end - index;
|
|
187625
|
+
index = end;
|
|
187626
|
+
}
|
|
187627
|
+
if (positions2.refresh?.() === false) {
|
|
187628
|
+
return void 0;
|
|
187629
|
+
}
|
|
187630
|
+
for (let index = batch.from; index < batch.to; index++) {
|
|
187631
|
+
const position2 = start + index - batch.from;
|
|
187632
|
+
inserted.set(index, {
|
|
187633
|
+
...desired[index],
|
|
187634
|
+
start: positions2.capture(position2, 0),
|
|
187635
|
+
end: positions2.capture(position2 + 1, -1)
|
|
187636
|
+
});
|
|
187637
|
+
}
|
|
187638
|
+
precedingInsert = inserted.get(batch.to - 1);
|
|
187639
|
+
}
|
|
187640
|
+
const liveUnits = textSessionUnits(text22.toDelta());
|
|
187641
|
+
const formats = [];
|
|
187642
|
+
for (const [index, oldIndex] of indices.entries()) {
|
|
187643
|
+
if (oldIndex === null) {
|
|
187644
|
+
continue;
|
|
187645
|
+
}
|
|
187646
|
+
const unit = previous[oldIndex];
|
|
187647
|
+
const paragraph = paragraphPatches.get(index);
|
|
187648
|
+
if (!paragraph && textSessionAttributesEqual(unit.attributes, desired[index].attributes)) {
|
|
187649
|
+
continue;
|
|
187650
|
+
}
|
|
187651
|
+
const current = range(unit);
|
|
187652
|
+
if (!current) {
|
|
187653
|
+
continue;
|
|
187654
|
+
}
|
|
187655
|
+
const patch = {
|
|
187656
|
+
...textSessionAttributePatch(
|
|
187657
|
+
unit.attributes,
|
|
187658
|
+
desired[index].attributes,
|
|
187659
|
+
liveUnits?.[current.start]?.attributes ?? {}
|
|
187660
|
+
),
|
|
187661
|
+
...paragraph
|
|
187662
|
+
};
|
|
187663
|
+
for (const key2 of Object.keys(patch)) {
|
|
187664
|
+
if (patch[key2] === (liveUnits?.[current.start]?.attributes[key2] ?? null)) {
|
|
187665
|
+
delete patch[key2];
|
|
187666
|
+
}
|
|
187667
|
+
}
|
|
187668
|
+
if (Object.keys(patch).length > 0) {
|
|
187669
|
+
const last = formats.at(-1);
|
|
187670
|
+
if (last && last.end === current.start && JSON.stringify(last.patch) === JSON.stringify(patch)) {
|
|
187671
|
+
last.end = current.end;
|
|
187672
|
+
} else {
|
|
187673
|
+
formats.push({ ...current, patch });
|
|
187674
|
+
}
|
|
187675
|
+
}
|
|
187676
|
+
}
|
|
187677
|
+
for (const format of formats) {
|
|
187678
|
+
text22.format(format.start, format.end - format.start, format.patch);
|
|
187679
|
+
}
|
|
187680
|
+
return indices.map((oldIndex, index) => ({
|
|
187681
|
+
...oldIndex === null ? inserted.get(index) : previous[oldIndex],
|
|
187682
|
+
attributes: desired[index].attributes
|
|
187683
|
+
}));
|
|
187684
|
+
}
|
|
187685
|
+
function createCollaborationTextSession({
|
|
187686
|
+
text: text22,
|
|
187687
|
+
positions: positions2,
|
|
187688
|
+
transact,
|
|
187689
|
+
isCurrent
|
|
187690
|
+
}) {
|
|
187691
|
+
if (!isCurrent() || positions2.refresh?.() === false) {
|
|
187692
|
+
positions2.dispose?.();
|
|
187693
|
+
return void 0;
|
|
187694
|
+
}
|
|
187695
|
+
const observe = (delta) => textSessionUnits(delta)?.map((unit, index) => ({
|
|
187696
|
+
...unit,
|
|
187697
|
+
start: positions2.capture(index, 0),
|
|
187698
|
+
end: positions2.capture(index + 1, -1)
|
|
187699
|
+
}));
|
|
187700
|
+
let baseline = observe(text22.toDelta());
|
|
187701
|
+
if (!baseline) {
|
|
187702
|
+
positions2.dispose?.();
|
|
187703
|
+
return void 0;
|
|
187704
|
+
}
|
|
187705
|
+
let emptyBoundary = positions2.capture(0, 0);
|
|
187706
|
+
let version = 0;
|
|
187707
|
+
let disposed = false;
|
|
187708
|
+
let snapshots2 = /* @__PURE__ */ new WeakMap();
|
|
187709
|
+
const dispose = () => {
|
|
187710
|
+
if (disposed) {
|
|
187711
|
+
return;
|
|
187712
|
+
}
|
|
187713
|
+
disposed = true;
|
|
187714
|
+
baseline = [];
|
|
187715
|
+
snapshots2 = /* @__PURE__ */ new WeakMap();
|
|
187716
|
+
positions2.dispose?.();
|
|
187717
|
+
};
|
|
187718
|
+
const active2 = () => {
|
|
187719
|
+
if (!disposed && (!isCurrent() || positions2.refresh?.() === false || !textSessionDeltaSupported(text22.toDelta()))) {
|
|
187720
|
+
dispose();
|
|
187721
|
+
}
|
|
187722
|
+
return !disposed;
|
|
187723
|
+
};
|
|
187724
|
+
return {
|
|
187725
|
+
bookmark(index, association) {
|
|
187726
|
+
if (!active2() || !Number.isInteger(index) || index < 0 || index > baseline.length) {
|
|
187727
|
+
return () => null;
|
|
187728
|
+
}
|
|
187729
|
+
const units = baseline;
|
|
187730
|
+
const position2 = association < 0 && index > 0 ? units[index - 1].end : units[index]?.start ?? units[index - 1]?.end ?? emptyBoundary;
|
|
187731
|
+
return () => active2() ? positions2.resolve(position2) : null;
|
|
187732
|
+
},
|
|
187733
|
+
applyLocalDelta(delta, edit) {
|
|
187734
|
+
if (!active2()) {
|
|
187735
|
+
return false;
|
|
187736
|
+
}
|
|
187737
|
+
const desired = textSessionUnits(delta);
|
|
187738
|
+
if (!desired) {
|
|
187739
|
+
return false;
|
|
187740
|
+
}
|
|
187741
|
+
const previous = baseline;
|
|
187742
|
+
const before = previous.map((unit) => unit.text).join("");
|
|
187743
|
+
const after = desired.map((unit) => unit.text).join("");
|
|
187744
|
+
const plan = textSessionPlan(before, after, edit);
|
|
187745
|
+
if (!plan) {
|
|
187746
|
+
return false;
|
|
187747
|
+
}
|
|
187748
|
+
const { retainedIndices: indices, paragraphSources } = plan;
|
|
187749
|
+
if (previous.length === desired.length && indices.every((retained, index) => retained === index) && (!paragraphSources || paragraphSources.every((source, index) => source === null || source === index)) && desired.every(
|
|
187750
|
+
(unit, index) => textSessionAttributesEqual(previous[index].attributes, unit.attributes)
|
|
187751
|
+
)) {
|
|
187752
|
+
return true;
|
|
187753
|
+
}
|
|
187754
|
+
let next;
|
|
187755
|
+
transact(() => {
|
|
187756
|
+
if (!active2()) {
|
|
187757
|
+
return;
|
|
187758
|
+
}
|
|
187759
|
+
next = applyTextSessionPlan(
|
|
187760
|
+
text22,
|
|
187761
|
+
positions2,
|
|
187762
|
+
previous,
|
|
187763
|
+
desired,
|
|
187764
|
+
indices,
|
|
187765
|
+
emptyBoundary,
|
|
187766
|
+
paragraphSources
|
|
187767
|
+
);
|
|
187768
|
+
});
|
|
187769
|
+
if (!next || !active2()) {
|
|
187770
|
+
return false;
|
|
187771
|
+
}
|
|
187772
|
+
baseline = next;
|
|
187773
|
+
version++;
|
|
187774
|
+
return true;
|
|
187775
|
+
},
|
|
187776
|
+
readMerged() {
|
|
187777
|
+
if (!active2()) {
|
|
187778
|
+
return void 0;
|
|
187779
|
+
}
|
|
187780
|
+
const delta = text22.toDelta();
|
|
187781
|
+
const units = observe(delta);
|
|
187782
|
+
if (!units) {
|
|
187783
|
+
dispose();
|
|
187784
|
+
return void 0;
|
|
187785
|
+
}
|
|
187786
|
+
const snapshot = { delta };
|
|
187787
|
+
snapshots2.set(snapshot, { units, boundary: positions2.capture(0, 0), version });
|
|
187788
|
+
return snapshot;
|
|
187789
|
+
},
|
|
187790
|
+
adoptMerged(snapshot) {
|
|
187791
|
+
const observed = snapshots2.get(snapshot);
|
|
187792
|
+
if (!active2() || !observed || observed.version !== version) {
|
|
187793
|
+
return false;
|
|
187794
|
+
}
|
|
187795
|
+
baseline = observed.units;
|
|
187796
|
+
emptyBoundary = observed.boundary;
|
|
187797
|
+
version++;
|
|
187798
|
+
return true;
|
|
187799
|
+
},
|
|
187800
|
+
dispose
|
|
187801
|
+
};
|
|
187802
|
+
}
|
|
187803
|
+
function createCollaborationTextTarget({
|
|
187804
|
+
doc,
|
|
187805
|
+
factories,
|
|
187806
|
+
slideId,
|
|
187807
|
+
elementId,
|
|
187808
|
+
isWritable,
|
|
187809
|
+
onChange,
|
|
187810
|
+
ownsModel
|
|
187811
|
+
}) {
|
|
187812
|
+
const element = findElementYMap(doc, slideId, elementId);
|
|
187813
|
+
if (element && factories.createTextPositions) {
|
|
187814
|
+
initializeCollaborationText(
|
|
187815
|
+
doc,
|
|
187816
|
+
element,
|
|
187817
|
+
factories,
|
|
187818
|
+
() => isWritable() && findElementYMap(doc, slideId, elementId) === element
|
|
187819
|
+
);
|
|
187820
|
+
}
|
|
187821
|
+
const text22 = element?.get("textBody");
|
|
187822
|
+
if (!element || !isYTextEditable(text22) || !factories.createTextPositions || !isWritable()) {
|
|
187823
|
+
return void 0;
|
|
187824
|
+
}
|
|
187825
|
+
const positions2 = factories.createTextPositions(text22);
|
|
187826
|
+
let disposed = false;
|
|
187827
|
+
let applying = false;
|
|
187828
|
+
const isCurrent = () => !disposed && isWritable() && findElementYMap(doc, slideId, elementId) === element && element.get("textBody") === text22;
|
|
187829
|
+
const session = createCollaborationTextSession({
|
|
187830
|
+
text: text22,
|
|
187831
|
+
positions: positions2,
|
|
187832
|
+
isCurrent,
|
|
187833
|
+
transact: (callback) => doc.transact(() => {
|
|
187834
|
+
callback();
|
|
187835
|
+
if (isCurrent()) {
|
|
187836
|
+
const segments = decodeDelta(text22.toDelta());
|
|
187837
|
+
const value = inlineListBodyText(segments);
|
|
187838
|
+
if (element.get("text") !== value) {
|
|
187839
|
+
element.set("text", value);
|
|
187840
|
+
}
|
|
187841
|
+
}
|
|
187842
|
+
}, LOCAL_SYNC_ORIGIN)
|
|
187843
|
+
});
|
|
187844
|
+
if (!session) {
|
|
187845
|
+
return void 0;
|
|
187846
|
+
}
|
|
187847
|
+
const slides = doc.getArray(YDOC_SLIDES_KEY);
|
|
187848
|
+
let previous = JSON.stringify(text22.toDelta());
|
|
187849
|
+
const changed = () => {
|
|
187850
|
+
if (disposed || applying) {
|
|
187851
|
+
return;
|
|
187852
|
+
}
|
|
187853
|
+
const next = isCurrent() ? JSON.stringify(text22.toDelta()) : void 0;
|
|
187854
|
+
if (next !== previous) {
|
|
187855
|
+
previous = next ?? "";
|
|
187856
|
+
onChange?.();
|
|
187857
|
+
}
|
|
187858
|
+
};
|
|
187859
|
+
slides.observeDeep(changed);
|
|
187860
|
+
const releaseLease = ownsModel ? registerCollaborationTextLease(element, ownsModel) : () => {
|
|
187861
|
+
};
|
|
187862
|
+
const readMerged = () => {
|
|
187863
|
+
const snapshot = session.readMerged();
|
|
187864
|
+
if (!snapshot) {
|
|
187865
|
+
return void 0;
|
|
187866
|
+
}
|
|
187867
|
+
const segments = decodeDelta([...snapshot.delta]);
|
|
187868
|
+
return Object.assign(snapshot, {
|
|
187869
|
+
inline: { elementId, text: inlineListBodyText(segments), textSegments: segments }
|
|
187870
|
+
});
|
|
187871
|
+
};
|
|
187872
|
+
return {
|
|
187873
|
+
readMerged,
|
|
187874
|
+
adoptMerged: session.adoptMerged,
|
|
187875
|
+
applyLocalDelta(delta, edit) {
|
|
187876
|
+
if (!isCurrent()) {
|
|
187877
|
+
return false;
|
|
187878
|
+
}
|
|
187879
|
+
applying = true;
|
|
187880
|
+
try {
|
|
187881
|
+
return session.applyLocalDelta(delta, edit);
|
|
187882
|
+
} finally {
|
|
187883
|
+
applying = false;
|
|
187884
|
+
changed();
|
|
187885
|
+
}
|
|
187886
|
+
},
|
|
187887
|
+
bookmark: session.bookmark,
|
|
187888
|
+
dispose() {
|
|
187889
|
+
if (!disposed) {
|
|
187890
|
+
disposed = true;
|
|
187891
|
+
releaseLease();
|
|
187892
|
+
slides.unobserveDeep(changed);
|
|
187893
|
+
session.dispose();
|
|
187894
|
+
onChange?.();
|
|
187895
|
+
}
|
|
187896
|
+
}
|
|
187897
|
+
};
|
|
187898
|
+
}
|
|
186962
187899
|
var LIVE_PATCH_THROTTLE_MS = 50;
|
|
186963
187900
|
function createCollaborationLivePatcher(options = {}) {
|
|
186964
187901
|
const throttleMs = options.throttleMs ?? LIVE_PATCH_THROTTLE_MS;
|
|
@@ -186968,6 +187905,17 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
186968
187905
|
let timer = null;
|
|
186969
187906
|
let lastWriteAt = Number.NEGATIVE_INFINITY;
|
|
186970
187907
|
let immediate = false;
|
|
187908
|
+
const textSessions = /* @__PURE__ */ new Map();
|
|
187909
|
+
const textOwners = /* @__PURE__ */ new Map();
|
|
187910
|
+
const keyFor3 = (slideId, elementId) => `${slideId ?? ""}\0${elementId}`;
|
|
187911
|
+
const retireTextSessions = () => {
|
|
187912
|
+
const retiring = [...textSessions.values()];
|
|
187913
|
+
textSessions.clear();
|
|
187914
|
+
textOwners.clear();
|
|
187915
|
+
for (const session of retiring) {
|
|
187916
|
+
session.dispose();
|
|
187917
|
+
}
|
|
187918
|
+
};
|
|
186971
187919
|
const cancelTimer = () => {
|
|
186972
187920
|
if (timer !== null) {
|
|
186973
187921
|
clearTimeout(timer);
|
|
@@ -187015,7 +187963,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187015
187963
|
if (!doc || !factories || !elementId) {
|
|
187016
187964
|
return null;
|
|
187017
187965
|
}
|
|
187018
|
-
const key2 =
|
|
187966
|
+
const key2 = keyFor3(slideId, elementId);
|
|
187019
187967
|
let entry2 = pending.get(key2);
|
|
187020
187968
|
if (!entry2) {
|
|
187021
187969
|
entry2 = { slideId, elementId };
|
|
@@ -187024,6 +187972,53 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187024
187972
|
return entry2;
|
|
187025
187973
|
};
|
|
187026
187974
|
return {
|
|
187975
|
+
beginTextEdit(slideId, elementId, onChange, ownsModel) {
|
|
187976
|
+
if (!doc || !factories) {
|
|
187977
|
+
return void 0;
|
|
187978
|
+
}
|
|
187979
|
+
const activeDoc = doc;
|
|
187980
|
+
const activeFactories = factories;
|
|
187981
|
+
const key2 = keyFor3(slideId, elementId);
|
|
187982
|
+
const owner = {};
|
|
187983
|
+
textOwners.set(key2, owner);
|
|
187984
|
+
const isWritable = () => doc === activeDoc && factories === activeFactories && textOwners.get(key2) === owner;
|
|
187985
|
+
textSessions.get(key2)?.dispose();
|
|
187986
|
+
if (!isWritable()) {
|
|
187987
|
+
return void 0;
|
|
187988
|
+
}
|
|
187989
|
+
const queued = pending.get(key2);
|
|
187990
|
+
if (queued) {
|
|
187991
|
+
delete queued.text;
|
|
187992
|
+
}
|
|
187993
|
+
const target = createCollaborationTextTarget({
|
|
187994
|
+
doc,
|
|
187995
|
+
factories,
|
|
187996
|
+
slideId,
|
|
187997
|
+
elementId,
|
|
187998
|
+
onChange,
|
|
187999
|
+
ownsModel,
|
|
188000
|
+
isWritable
|
|
188001
|
+
});
|
|
188002
|
+
if (!target || textOwners.get(key2) !== owner) {
|
|
188003
|
+
target?.dispose();
|
|
188004
|
+
if (textOwners.get(key2) === owner) {
|
|
188005
|
+
textOwners.delete(key2);
|
|
188006
|
+
}
|
|
188007
|
+
return void 0;
|
|
188008
|
+
}
|
|
188009
|
+
const dispose = target.dispose;
|
|
188010
|
+
target.dispose = () => {
|
|
188011
|
+
dispose();
|
|
188012
|
+
if (textSessions.get(key2) === target) {
|
|
188013
|
+
textSessions.delete(key2);
|
|
188014
|
+
}
|
|
188015
|
+
if (textOwners.get(key2) === owner) {
|
|
188016
|
+
textOwners.delete(key2);
|
|
188017
|
+
}
|
|
188018
|
+
};
|
|
188019
|
+
textSessions.set(key2, target);
|
|
188020
|
+
return target;
|
|
188021
|
+
},
|
|
187027
188022
|
configure(nextDoc, nextFactories, nextImmediate = false) {
|
|
187028
188023
|
if (nextDoc === doc && nextFactories === factories && nextImmediate === immediate) {
|
|
187029
188024
|
return;
|
|
@@ -187034,6 +188029,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187034
188029
|
factories = nextFactories;
|
|
187035
188030
|
immediate = nextImmediate;
|
|
187036
188031
|
lastWriteAt = Number.NEGATIVE_INFINITY;
|
|
188032
|
+
retireTextSessions();
|
|
187037
188033
|
},
|
|
187038
188034
|
isActive() {
|
|
187039
188035
|
return doc !== null && factories !== null;
|
|
@@ -187047,6 +188043,9 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187047
188043
|
schedule();
|
|
187048
188044
|
},
|
|
187049
188045
|
patchText(slideId, elementId, text22, source) {
|
|
188046
|
+
if (textOwners.has(keyFor3(slideId, elementId))) {
|
|
188047
|
+
return;
|
|
188048
|
+
}
|
|
187050
188049
|
const entry2 = enqueue(slideId, elementId);
|
|
187051
188050
|
if (!entry2) {
|
|
187052
188051
|
return;
|
|
@@ -187063,6 +188062,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187063
188062
|
pending.clear();
|
|
187064
188063
|
doc = null;
|
|
187065
188064
|
factories = null;
|
|
188065
|
+
retireTextSessions();
|
|
187066
188066
|
}
|
|
187067
188067
|
};
|
|
187068
188068
|
}
|
|
@@ -187085,6 +188085,731 @@ function publishLiveGeometry(patcher, slideId, elementId, geometry) {
|
|
|
187085
188085
|
}
|
|
187086
188086
|
patcher.patchGeometry(slideId, elementId, geometry);
|
|
187087
188087
|
}
|
|
188088
|
+
function normalizedRuns(delta) {
|
|
188089
|
+
const runs = [];
|
|
188090
|
+
for (const op2 of delta) {
|
|
188091
|
+
if (typeof op2.insert !== "string") {
|
|
188092
|
+
return void 0;
|
|
188093
|
+
}
|
|
188094
|
+
const entries = Object.entries(op2.attributes ?? {});
|
|
188095
|
+
if (entries.some(([, value]) => typeof value !== "string")) {
|
|
188096
|
+
return void 0;
|
|
188097
|
+
}
|
|
188098
|
+
if (!op2.insert) {
|
|
188099
|
+
continue;
|
|
188100
|
+
}
|
|
188101
|
+
const attributes = JSON.stringify(entries.sort(([a], [b]) => a.localeCompare(b)));
|
|
188102
|
+
const previous = runs[runs.length - 1];
|
|
188103
|
+
if (previous?.attributes === attributes) {
|
|
188104
|
+
previous.text += op2.insert;
|
|
188105
|
+
} else {
|
|
188106
|
+
runs.push({ text: op2.insert, attributes });
|
|
188107
|
+
}
|
|
188108
|
+
}
|
|
188109
|
+
return runs;
|
|
188110
|
+
}
|
|
188111
|
+
function validBoundary(text22, offset) {
|
|
188112
|
+
return Number.isInteger(offset) && offset >= 0 && offset <= text22.length && !(text22.charCodeAt(offset - 1) >= 55296 && text22.charCodeAt(offset - 1) <= 56319 && text22.charCodeAt(offset) >= 56320 && text22.charCodeAt(offset) <= 57343);
|
|
188113
|
+
}
|
|
188114
|
+
function createCollaborationTextProjection(segments, delta, body) {
|
|
188115
|
+
if (inlineListBodyText(segments) !== body) {
|
|
188116
|
+
return void 0;
|
|
188117
|
+
}
|
|
188118
|
+
const expected = normalizedRuns(encodeSegmentsToDelta([...segments]));
|
|
188119
|
+
const actual = normalizedRuns(delta);
|
|
188120
|
+
if (!expected || !actual || expected.length !== actual.length || expected.some(
|
|
188121
|
+
(run, index) => run.text !== actual[index].text || run.attributes !== actual[index].attributes
|
|
188122
|
+
)) {
|
|
188123
|
+
return void 0;
|
|
188124
|
+
}
|
|
188125
|
+
const encoded = actual.map((run) => run.text).join("");
|
|
188126
|
+
const spans = [];
|
|
188127
|
+
let bodyStart = 0;
|
|
188128
|
+
let encodedStart = 0;
|
|
188129
|
+
let first = true;
|
|
188130
|
+
for (const [segmentIndex, segment] of segments.entries()) {
|
|
188131
|
+
const paragraphBreak = isParagraphSeparatorSegment(segment);
|
|
188132
|
+
const marker = !paragraphBreak && first && isBulletMarkerSegment(segment);
|
|
188133
|
+
const kind = paragraphBreak ? "paragraph-break" : segment.isLineBreak ? "line-break" : marker ? "bullet-marker" : segment.text.length === 0 ? "empty-carrier" : "text";
|
|
188134
|
+
const bodyLength = paragraphBreak || segment.isLineBreak ? 1 : marker ? 0 : segment.text.length;
|
|
188135
|
+
const encodedLength = segment.isParagraphBreak || segment.isLineBreak ? 1 : Math.max(1, segment.text.length);
|
|
188136
|
+
spans.push({
|
|
188137
|
+
segmentIndex,
|
|
188138
|
+
bodyStart,
|
|
188139
|
+
bodyEnd: bodyStart + bodyLength,
|
|
188140
|
+
encodedStart,
|
|
188141
|
+
encodedEnd: encodedStart + encodedLength,
|
|
188142
|
+
kind
|
|
188143
|
+
});
|
|
188144
|
+
bodyStart += bodyLength;
|
|
188145
|
+
encodedStart += encodedLength;
|
|
188146
|
+
first = paragraphBreak;
|
|
188147
|
+
}
|
|
188148
|
+
return {
|
|
188149
|
+
spans,
|
|
188150
|
+
bodyOffsetToEncoded(offset) {
|
|
188151
|
+
if (!validBoundary(body, offset)) {
|
|
188152
|
+
return void 0;
|
|
188153
|
+
}
|
|
188154
|
+
let start = encoded.length;
|
|
188155
|
+
let end = 0;
|
|
188156
|
+
for (const span of spans) {
|
|
188157
|
+
if (offset < span.bodyStart || offset > span.bodyEnd) {
|
|
188158
|
+
continue;
|
|
188159
|
+
}
|
|
188160
|
+
const point = span.encodedStart + offset - span.bodyStart;
|
|
188161
|
+
start = Math.min(start, point);
|
|
188162
|
+
end = Math.max(end, span.bodyStart === span.bodyEnd ? span.encodedEnd : point);
|
|
188163
|
+
}
|
|
188164
|
+
return { start, end };
|
|
188165
|
+
},
|
|
188166
|
+
encodedOffsetToBody(offset) {
|
|
188167
|
+
if (!validBoundary(encoded, offset)) {
|
|
188168
|
+
return void 0;
|
|
188169
|
+
}
|
|
188170
|
+
for (const span of spans) {
|
|
188171
|
+
if (offset >= span.encodedStart && offset <= span.encodedEnd) {
|
|
188172
|
+
const point = span.bodyStart === span.bodyEnd ? span.bodyStart : span.bodyStart + offset - span.encodedStart;
|
|
188173
|
+
return validBoundary(body, point) ? point : void 0;
|
|
188174
|
+
}
|
|
188175
|
+
}
|
|
188176
|
+
return 0;
|
|
188177
|
+
}
|
|
188178
|
+
};
|
|
188179
|
+
}
|
|
188180
|
+
var initialized = /* @__PURE__ */ new WeakSet();
|
|
188181
|
+
function initializeInlineListDom(root, seed) {
|
|
188182
|
+
const session = inlineListSession(seed);
|
|
188183
|
+
if (!session || initialized.has(root) || root.childNodes.length > 0 || session.boundParagraphs.size > 0) {
|
|
188184
|
+
return false;
|
|
188185
|
+
}
|
|
188186
|
+
const textStyle = "textStyle" in session.element ? session.element.textStyle : void 0;
|
|
188187
|
+
const fontScale = resolveAutoFitFontScale(textStyle);
|
|
188188
|
+
for (const paragraph of seed.paragraphs) {
|
|
188189
|
+
const block = root.ownerDocument.createElement("div");
|
|
188190
|
+
block.dataset.pptxListParagraph = paragraph.token;
|
|
188191
|
+
for (const run of paragraph.runs) {
|
|
188192
|
+
const span = root.ownerDocument.createElement("span");
|
|
188193
|
+
span.dataset.pptxListRun = run.token;
|
|
188194
|
+
const source = session.segments[run.segmentIndex];
|
|
188195
|
+
const projected = {
|
|
188196
|
+
...source,
|
|
188197
|
+
style: withInlineListDecorationDefaults(source.style, textStyle)
|
|
188198
|
+
};
|
|
188199
|
+
const style = segmentStyleToCss(projected, fontScale);
|
|
188200
|
+
applyUnderlineVariant(style, projected);
|
|
188201
|
+
for (const [key2, value] of Object.entries(style)) {
|
|
188202
|
+
span.style.setProperty(
|
|
188203
|
+
key2.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`),
|
|
188204
|
+
String(value)
|
|
188205
|
+
);
|
|
188206
|
+
}
|
|
188207
|
+
if (run.text === "" || run.isLineBreak) {
|
|
188208
|
+
span.append(root.ownerDocument.createElement("br"));
|
|
188209
|
+
} else {
|
|
188210
|
+
for (const [index, line4] of run.text.split("\n").entries()) {
|
|
188211
|
+
if (index > 0) {
|
|
188212
|
+
span.append(root.ownerDocument.createElement("br"));
|
|
188213
|
+
}
|
|
188214
|
+
span.append(root.ownerDocument.createTextNode(line4));
|
|
188215
|
+
}
|
|
188216
|
+
}
|
|
188217
|
+
block.append(span);
|
|
188218
|
+
bindInlineListRun(seed, span, run.segmentIndex);
|
|
188219
|
+
}
|
|
188220
|
+
root.append(block);
|
|
188221
|
+
bindInlineListParagraph(seed, block, paragraph.sourceIndex);
|
|
188222
|
+
}
|
|
188223
|
+
initialized.add(root);
|
|
188224
|
+
return true;
|
|
188225
|
+
}
|
|
188226
|
+
function collaborationInlineModelKey(element) {
|
|
188227
|
+
return JSON.stringify(
|
|
188228
|
+
element && {
|
|
188229
|
+
id: element.id,
|
|
188230
|
+
type: element.type,
|
|
188231
|
+
..."text" in element ? { text: element.text } : {},
|
|
188232
|
+
..."textSegments" in element ? { textSegments: element.textSegments } : {},
|
|
188233
|
+
..."textStyle" in element ? { textStyle: element.textStyle } : {}
|
|
188234
|
+
}
|
|
188235
|
+
);
|
|
188236
|
+
}
|
|
188237
|
+
function prepareCollaborationInlineDom(root, element, snapshot) {
|
|
188238
|
+
const seed = createInlineListSeed({ ...element, ...snapshot }, {
|
|
188239
|
+
includePlain: true
|
|
188240
|
+
});
|
|
188241
|
+
if (!seed) {
|
|
188242
|
+
return void 0;
|
|
188243
|
+
}
|
|
188244
|
+
const detached = root.ownerDocument.createElement("div");
|
|
188245
|
+
return initializeInlineListDom(detached, seed) ? { seed, children: Array.from(detached.childNodes) } : void 0;
|
|
188246
|
+
}
|
|
188247
|
+
function bookmarkCollaborationInlineSelection(root, seed, snapshot, target) {
|
|
188248
|
+
const selected = readInlineListSelection(seed, root);
|
|
188249
|
+
const selection = root.ownerDocument.getSelection();
|
|
188250
|
+
const range = selection?.rangeCount ? selection.getRangeAt(0) : void 0;
|
|
188251
|
+
const backward = Boolean(
|
|
188252
|
+
range && !range.collapsed && selection?.anchorNode === range.endContainer && selection.anchorOffset === range.endOffset
|
|
188253
|
+
);
|
|
188254
|
+
const segments = snapshot.textSegments ?? [];
|
|
188255
|
+
const projection = createCollaborationTextProjection(
|
|
188256
|
+
segments,
|
|
188257
|
+
encodeSegmentsToDelta(segments),
|
|
188258
|
+
snapshot.text
|
|
188259
|
+
);
|
|
188260
|
+
if (selected.kind !== "supported" || !selected.bodyRange || !projection) {
|
|
188261
|
+
return void 0;
|
|
188262
|
+
}
|
|
188263
|
+
const { start, end } = selected.bodyRange;
|
|
188264
|
+
const first = projection.bodyOffsetToEncoded(start);
|
|
188265
|
+
const last = projection.bodyOffsetToEncoded(end);
|
|
188266
|
+
if (!first || !last) {
|
|
188267
|
+
return void 0;
|
|
188268
|
+
}
|
|
188269
|
+
const from = target.bookmark(first.end, 0);
|
|
188270
|
+
const to = start === end ? from : target.bookmark(last.start, -1);
|
|
188271
|
+
return (nextSeed, next) => {
|
|
188272
|
+
const nextSegments = next.textSegments ?? [];
|
|
188273
|
+
const nextProjection = createCollaborationTextProjection(
|
|
188274
|
+
nextSegments,
|
|
188275
|
+
encodeSegmentsToDelta(nextSegments),
|
|
188276
|
+
next.text
|
|
188277
|
+
);
|
|
188278
|
+
const encodedStart = from();
|
|
188279
|
+
const encodedEnd = to();
|
|
188280
|
+
const bodyStart = encodedStart === null ? void 0 : nextProjection?.encodedOffsetToBody(encodedStart);
|
|
188281
|
+
const bodyEnd = encodedEnd === null ? void 0 : nextProjection?.encodedOffsetToBody(encodedEnd);
|
|
188282
|
+
if (bodyStart !== void 0 && bodyEnd !== void 0) {
|
|
188283
|
+
restoreInlineListBodySelection(nextSeed, root, {
|
|
188284
|
+
start: Math.min(bodyStart, bodyEnd),
|
|
188285
|
+
end: Math.max(bodyStart, bodyEnd)
|
|
188286
|
+
});
|
|
188287
|
+
if (backward && selection?.rangeCount) {
|
|
188288
|
+
const restored = selection.getRangeAt(0);
|
|
188289
|
+
selection.setBaseAndExtent(
|
|
188290
|
+
restored.endContainer,
|
|
188291
|
+
restored.endOffset,
|
|
188292
|
+
restored.startContainer,
|
|
188293
|
+
restored.startOffset
|
|
188294
|
+
);
|
|
188295
|
+
}
|
|
188296
|
+
}
|
|
188297
|
+
};
|
|
188298
|
+
}
|
|
188299
|
+
function resolveCollaborationNativeRange(range, previous, current) {
|
|
188300
|
+
if (!range?.deleteDirection) {
|
|
188301
|
+
return range;
|
|
188302
|
+
}
|
|
188303
|
+
const removed = previous.length - current.length;
|
|
188304
|
+
if (removed <= 0) {
|
|
188305
|
+
return void 0;
|
|
188306
|
+
}
|
|
188307
|
+
const from = range.deleteDirection === "backward" ? range.from - removed : range.from;
|
|
188308
|
+
const to = range.deleteDirection === "forward" ? range.to + removed : range.to;
|
|
188309
|
+
return from >= 0 && to <= previous.length ? { from, to } : void 0;
|
|
188310
|
+
}
|
|
188311
|
+
function observeCollaborationInlineInput(root, getSeed, apply, settled) {
|
|
188312
|
+
let disposed = false;
|
|
188313
|
+
let composing = false;
|
|
188314
|
+
let pending = false;
|
|
188315
|
+
let range;
|
|
188316
|
+
const capture = (event) => {
|
|
188317
|
+
const target = event?.getTargetRanges?.()[0];
|
|
188318
|
+
const read = target ? readInlineListRange(getSeed(), root, target) : readInlineListSelection(getSeed(), root);
|
|
188319
|
+
range = read.kind === "supported" && read.bodyRange ? { from: read.bodyRange.start, to: read.bodyRange.end } : void 0;
|
|
188320
|
+
if (!target && range && range.from === range.to && event?.inputType?.startsWith("delete")) {
|
|
188321
|
+
if (event.inputType.endsWith("Backward")) {
|
|
188322
|
+
range.deleteDirection = "backward";
|
|
188323
|
+
} else if (event.inputType.endsWith("Forward")) {
|
|
188324
|
+
range.deleteDirection = "forward";
|
|
188325
|
+
}
|
|
188326
|
+
}
|
|
188327
|
+
};
|
|
188328
|
+
const before = (event) => {
|
|
188329
|
+
if (!composing) {
|
|
188330
|
+
capture(event);
|
|
188331
|
+
}
|
|
188332
|
+
pending = true;
|
|
188333
|
+
queueMicrotask(() => {
|
|
188334
|
+
if (!disposed && !composing && pending) {
|
|
188335
|
+
pending = false;
|
|
188336
|
+
settled();
|
|
188337
|
+
}
|
|
188338
|
+
});
|
|
188339
|
+
};
|
|
188340
|
+
const input = () => {
|
|
188341
|
+
if (composing || disposed) {
|
|
188342
|
+
return;
|
|
188343
|
+
}
|
|
188344
|
+
pending = false;
|
|
188345
|
+
const replacement = range;
|
|
188346
|
+
range = void 0;
|
|
188347
|
+
apply(replacement);
|
|
188348
|
+
};
|
|
188349
|
+
const start = () => {
|
|
188350
|
+
if (!composing) {
|
|
188351
|
+
capture();
|
|
188352
|
+
}
|
|
188353
|
+
composing = true;
|
|
188354
|
+
};
|
|
188355
|
+
const end = () => {
|
|
188356
|
+
queueMicrotask(() => {
|
|
188357
|
+
if (disposed) {
|
|
188358
|
+
return;
|
|
188359
|
+
}
|
|
188360
|
+
composing = false;
|
|
188361
|
+
input();
|
|
188362
|
+
});
|
|
188363
|
+
};
|
|
188364
|
+
root.addEventListener("beforeinput", before, true);
|
|
188365
|
+
root.addEventListener("paste", before, true);
|
|
188366
|
+
root.addEventListener("input", input, true);
|
|
188367
|
+
root.addEventListener("compositionstart", start, true);
|
|
188368
|
+
root.addEventListener("compositionend", end, true);
|
|
188369
|
+
return {
|
|
188370
|
+
blocked: () => composing || pending,
|
|
188371
|
+
reason: () => composing ? "composition-active" : pending ? "input-active" : void 0,
|
|
188372
|
+
dispose() {
|
|
188373
|
+
disposed = true;
|
|
188374
|
+
root.removeEventListener("beforeinput", before, true);
|
|
188375
|
+
root.removeEventListener("paste", before, true);
|
|
188376
|
+
root.removeEventListener("input", input, true);
|
|
188377
|
+
root.removeEventListener("compositionstart", start, true);
|
|
188378
|
+
root.removeEventListener("compositionend", end, true);
|
|
188379
|
+
}
|
|
188380
|
+
};
|
|
188381
|
+
}
|
|
188382
|
+
function paragraphCarriers(projection) {
|
|
188383
|
+
const carriers = [void 0];
|
|
188384
|
+
for (const span of projection.spans) {
|
|
188385
|
+
carriers[carriers.length - 1] ??= span;
|
|
188386
|
+
if (span.kind === "paragraph-break") {
|
|
188387
|
+
carriers.push(void 0);
|
|
188388
|
+
}
|
|
188389
|
+
}
|
|
188390
|
+
return carriers;
|
|
188391
|
+
}
|
|
188392
|
+
function bodyUnits(projection) {
|
|
188393
|
+
const indices = [];
|
|
188394
|
+
for (const span of projection.spans) {
|
|
188395
|
+
for (let body = span.bodyStart; body < span.bodyEnd; body++) {
|
|
188396
|
+
indices[body] = span.encodedStart + body - span.bodyStart;
|
|
188397
|
+
}
|
|
188398
|
+
}
|
|
188399
|
+
return indices;
|
|
188400
|
+
}
|
|
188401
|
+
function createNativeCollaborationTextEdit(before, after, replacement) {
|
|
188402
|
+
const range = textSessionReplacementSpan(before.body, after.body, replacement);
|
|
188403
|
+
const delta = encodeSegmentsToDelta([...after.segments]);
|
|
188404
|
+
const oldProjection = createCollaborationTextProjection(
|
|
188405
|
+
before.segments,
|
|
188406
|
+
before.delta,
|
|
188407
|
+
before.body
|
|
188408
|
+
);
|
|
188409
|
+
const nextProjection = createCollaborationTextProjection(after.segments, delta, after.body);
|
|
188410
|
+
if (!range || !oldProjection || !nextProjection) {
|
|
188411
|
+
return void 0;
|
|
188412
|
+
}
|
|
188413
|
+
const oldCarriers = new Map(
|
|
188414
|
+
paragraphCarriers(oldProjection).flatMap(
|
|
188415
|
+
(span) => span ? [[span.segmentIndex, span]] : []
|
|
188416
|
+
)
|
|
188417
|
+
);
|
|
188418
|
+
const nextCarriers = paragraphCarriers(nextProjection);
|
|
188419
|
+
if (after.paragraphSources.length !== nextCarriers.length || Array.from(after.paragraphSources).some(
|
|
188420
|
+
(source) => source !== null && (!Number.isInteger(source) || !oldCarriers.has(source))
|
|
188421
|
+
)) {
|
|
188422
|
+
return void 0;
|
|
188423
|
+
}
|
|
188424
|
+
const oldText = before.delta.map((op2) => op2.insert).join("");
|
|
188425
|
+
const nextText = delta.map((op2) => op2.insert).join("");
|
|
188426
|
+
const oldBody = bodyUnits(oldProjection);
|
|
188427
|
+
const nextBody = bodyUnits(nextProjection);
|
|
188428
|
+
const retainedIndices = Array(nextText.length).fill(null);
|
|
188429
|
+
const paragraphSources = Array(nextText.length).fill(null);
|
|
188430
|
+
const afterEnd = after.body.length - range.suffix;
|
|
188431
|
+
for (const [bodyIndex, encodedIndex] of nextBody.entries()) {
|
|
188432
|
+
const previous = bodyIndex < range.prefix ? bodyIndex : bodyIndex >= afterEnd ? before.body.length - (after.body.length - bodyIndex) : void 0;
|
|
188433
|
+
if (previous !== void 0) {
|
|
188434
|
+
retainedIndices[encodedIndex] = oldBody[previous];
|
|
188435
|
+
}
|
|
188436
|
+
}
|
|
188437
|
+
for (const [paragraph, carrier] of nextCarriers.entries()) {
|
|
188438
|
+
const source = after.paragraphSources[paragraph];
|
|
188439
|
+
const oldCarrier = source === null ? void 0 : oldCarriers.get(source);
|
|
188440
|
+
if (!carrier || !oldCarrier) {
|
|
188441
|
+
continue;
|
|
188442
|
+
}
|
|
188443
|
+
paragraphSources.fill(oldCarrier.encodedStart, carrier.encodedStart, carrier.encodedEnd);
|
|
188444
|
+
}
|
|
188445
|
+
const hidden = nextProjection.spans.filter((span) => span.bodyStart === span.bodyEnd);
|
|
188446
|
+
if (after.hiddenSources.length !== hidden.length) {
|
|
188447
|
+
return void 0;
|
|
188448
|
+
}
|
|
188449
|
+
for (const [index, carrier] of hidden.entries()) {
|
|
188450
|
+
const source = after.hiddenSources[index];
|
|
188451
|
+
if (source === null) {
|
|
188452
|
+
continue;
|
|
188453
|
+
}
|
|
188454
|
+
const oldCarrier = oldProjection.spans[source];
|
|
188455
|
+
if (!Number.isInteger(source) || !oldCarrier || oldCarrier.bodyStart !== oldCarrier.bodyEnd || oldCarrier.kind !== carrier.kind || oldText.slice(oldCarrier.encodedStart, oldCarrier.encodedEnd) !== nextText.slice(carrier.encodedStart, carrier.encodedEnd)) {
|
|
188456
|
+
return void 0;
|
|
188457
|
+
}
|
|
188458
|
+
for (let unit = carrier.encodedStart; unit < carrier.encodedEnd; unit++) {
|
|
188459
|
+
retainedIndices[unit] = oldCarrier.encodedStart + unit - carrier.encodedStart;
|
|
188460
|
+
}
|
|
188461
|
+
}
|
|
188462
|
+
const correspondence = { retainedIndices, paragraphSources };
|
|
188463
|
+
return textSessionRetainedIndices(oldText, nextText, correspondence) ? { delta, correspondence } : void 0;
|
|
188464
|
+
}
|
|
188465
|
+
function attachCollaborationInlineEditor(root, element, options) {
|
|
188466
|
+
let disposed = false;
|
|
188467
|
+
let busy = false;
|
|
188468
|
+
let model = element;
|
|
188469
|
+
let modelKey = collaborationInlineModelKey(element);
|
|
188470
|
+
let previous;
|
|
188471
|
+
let painted;
|
|
188472
|
+
let controller;
|
|
188473
|
+
let events = void 0;
|
|
188474
|
+
let target = void 0;
|
|
188475
|
+
target = options.patcher.beginTextEdit?.(options.slideId, element.id, synchronize, checkModel);
|
|
188476
|
+
if (!target) {
|
|
188477
|
+
return void 0;
|
|
188478
|
+
}
|
|
188479
|
+
const initial = target.readMerged();
|
|
188480
|
+
if (!initial || !paint(initial)) {
|
|
188481
|
+
controller?.dispose();
|
|
188482
|
+
target.dispose();
|
|
188483
|
+
return void 0;
|
|
188484
|
+
}
|
|
188485
|
+
events = observeCollaborationInlineInput(root, () => painted.seed, applyInput, synchronize);
|
|
188486
|
+
return {
|
|
188487
|
+
read,
|
|
188488
|
+
readAccepted: () => !disposed ? target?.readMerged()?.inline : void 0,
|
|
188489
|
+
checkModel,
|
|
188490
|
+
mutate(range, apply) {
|
|
188491
|
+
if (disposed || busy || events?.blocked() || !painted) {
|
|
188492
|
+
return false;
|
|
188493
|
+
}
|
|
188494
|
+
const selected = readInlineListRange(painted.seed, root, range);
|
|
188495
|
+
if (selected.kind !== "supported" || !selected.bodyRange) {
|
|
188496
|
+
return false;
|
|
188497
|
+
}
|
|
188498
|
+
try {
|
|
188499
|
+
apply();
|
|
188500
|
+
} catch {
|
|
188501
|
+
cancel();
|
|
188502
|
+
return false;
|
|
188503
|
+
}
|
|
188504
|
+
applyInput({ from: selected.bodyRange.start, to: selected.bodyRange.end });
|
|
188505
|
+
return !disposed;
|
|
188506
|
+
},
|
|
188507
|
+
format(snapshot) {
|
|
188508
|
+
if (disposed || events?.blocked()) {
|
|
188509
|
+
return read();
|
|
188510
|
+
}
|
|
188511
|
+
const result = controller?.format(snapshot);
|
|
188512
|
+
return result?.kind === "unsupported" ? result : read();
|
|
188513
|
+
},
|
|
188514
|
+
readSelection: (selection) => controller?.readSelection(selection) ?? { kind: "unsupported", reason: "inactive-session" },
|
|
188515
|
+
refresh() {
|
|
188516
|
+
synchronize();
|
|
188517
|
+
return read();
|
|
188518
|
+
},
|
|
188519
|
+
dispose
|
|
188520
|
+
};
|
|
188521
|
+
function dispose() {
|
|
188522
|
+
if (disposed) {
|
|
188523
|
+
return;
|
|
188524
|
+
}
|
|
188525
|
+
disposed = true;
|
|
188526
|
+
events?.dispose();
|
|
188527
|
+
controller?.dispose();
|
|
188528
|
+
target.dispose();
|
|
188529
|
+
}
|
|
188530
|
+
function cancel() {
|
|
188531
|
+
if (!disposed) {
|
|
188532
|
+
dispose();
|
|
188533
|
+
options.onCancel?.();
|
|
188534
|
+
}
|
|
188535
|
+
}
|
|
188536
|
+
function read() {
|
|
188537
|
+
const reason = events?.reason();
|
|
188538
|
+
if (reason && !disposed) {
|
|
188539
|
+
return { kind: "unsupported", reason, text: previous?.text ?? "" };
|
|
188540
|
+
}
|
|
188541
|
+
const merged = !disposed && target.readMerged();
|
|
188542
|
+
return merged ? {
|
|
188543
|
+
kind: "supported",
|
|
188544
|
+
snapshot: merged.inline,
|
|
188545
|
+
paragraphs: buildParagraphs(model, void 0, merged.inline.textSegments, {
|
|
188546
|
+
preserveTrailingEmpty: true
|
|
188547
|
+
})
|
|
188548
|
+
} : { kind: "unsupported", reason: "inactive-session", text: "" };
|
|
188549
|
+
}
|
|
188550
|
+
function checkModel(candidate) {
|
|
188551
|
+
if (disposed || !candidate || candidate.id !== element.id) {
|
|
188552
|
+
cancel();
|
|
188553
|
+
return false;
|
|
188554
|
+
}
|
|
188555
|
+
const key2 = collaborationInlineModelKey(candidate);
|
|
188556
|
+
if (key2 === modelKey) {
|
|
188557
|
+
return true;
|
|
188558
|
+
}
|
|
188559
|
+
const merged = target.readMerged();
|
|
188560
|
+
if (merged && collaborationInlineModelKey({ ...model, ...merged.inline }) === key2) {
|
|
188561
|
+
model = candidate;
|
|
188562
|
+
modelKey = key2;
|
|
188563
|
+
return true;
|
|
188564
|
+
}
|
|
188565
|
+
cancel();
|
|
188566
|
+
return false;
|
|
188567
|
+
}
|
|
188568
|
+
function paint(merged) {
|
|
188569
|
+
if (!createCollaborationTextProjection(
|
|
188570
|
+
merged.inline.textSegments ?? [],
|
|
188571
|
+
merged.delta,
|
|
188572
|
+
merged.inline.text
|
|
188573
|
+
)) {
|
|
188574
|
+
return false;
|
|
188575
|
+
}
|
|
188576
|
+
const prepared = prepareCollaborationInlineDom(root, model, merged.inline);
|
|
188577
|
+
if (!prepared) {
|
|
188578
|
+
return false;
|
|
188579
|
+
}
|
|
188580
|
+
const restore = painted && previous ? bookmarkCollaborationInlineSelection(root, painted.seed, previous, target) : void 0;
|
|
188581
|
+
controller?.dispose();
|
|
188582
|
+
root.replaceChildren(...prepared.children);
|
|
188583
|
+
painted = prepared;
|
|
188584
|
+
controller = attachInlineListController(root, prepared.seed, {
|
|
188585
|
+
isCurrent: () => !disposed,
|
|
188586
|
+
onFormat: () => applyInput({ from: 0, to: 0 })
|
|
188587
|
+
});
|
|
188588
|
+
const captured = readInlineListNativeSnapshot(prepared.seed, root);
|
|
188589
|
+
if (captured.kind !== "supported" || !createCollaborationTextProjection(
|
|
188590
|
+
captured.snapshot.textSegments ?? [],
|
|
188591
|
+
merged.delta,
|
|
188592
|
+
captured.snapshot.text
|
|
188593
|
+
) || !target.adoptMerged(merged)) {
|
|
188594
|
+
return false;
|
|
188595
|
+
}
|
|
188596
|
+
previous = captured.snapshot;
|
|
188597
|
+
restore?.(prepared.seed, previous);
|
|
188598
|
+
return true;
|
|
188599
|
+
}
|
|
188600
|
+
function synchronize() {
|
|
188601
|
+
if (!target || disposed || busy) {
|
|
188602
|
+
return;
|
|
188603
|
+
}
|
|
188604
|
+
const merged = target.readMerged();
|
|
188605
|
+
if (!merged || !previous || !painted) {
|
|
188606
|
+
cancel();
|
|
188607
|
+
return;
|
|
188608
|
+
}
|
|
188609
|
+
if (events?.blocked()) {
|
|
188610
|
+
return;
|
|
188611
|
+
}
|
|
188612
|
+
const matching = createCollaborationTextProjection(
|
|
188613
|
+
previous.textSegments ?? [],
|
|
188614
|
+
merged.delta,
|
|
188615
|
+
previous.text
|
|
188616
|
+
);
|
|
188617
|
+
if (matching ? !target.adoptMerged(merged) : !paint(merged)) {
|
|
188618
|
+
cancel();
|
|
188619
|
+
return;
|
|
188620
|
+
}
|
|
188621
|
+
options.onSnapshot?.(merged.inline);
|
|
188622
|
+
}
|
|
188623
|
+
function applyInput(range) {
|
|
188624
|
+
if (disposed || busy || !previous || !painted) {
|
|
188625
|
+
return;
|
|
188626
|
+
}
|
|
188627
|
+
const next = readInlineListNativeSnapshot(painted.seed, root, previous);
|
|
188628
|
+
if (next.kind !== "supported") {
|
|
188629
|
+
cancel();
|
|
188630
|
+
return;
|
|
188631
|
+
}
|
|
188632
|
+
const beforeDelta = encodeSegmentsToDelta(previous.textSegments ?? []);
|
|
188633
|
+
if (JSON.stringify(beforeDelta) === JSON.stringify(encodeSegmentsToDelta(next.snapshot.textSegments ?? []))) {
|
|
188634
|
+
synchronize();
|
|
188635
|
+
return;
|
|
188636
|
+
}
|
|
188637
|
+
const replacement = resolveCollaborationNativeRange(range, previous.text, next.snapshot.text);
|
|
188638
|
+
const edit = replacement && createNativeCollaborationTextEdit(
|
|
188639
|
+
{ segments: previous.textSegments ?? [], body: previous.text, delta: beforeDelta },
|
|
188640
|
+
{
|
|
188641
|
+
segments: next.snapshot.textSegments ?? [],
|
|
188642
|
+
body: next.snapshot.text,
|
|
188643
|
+
paragraphSources: next.paragraphSources,
|
|
188644
|
+
hiddenSources: next.hiddenSources
|
|
188645
|
+
},
|
|
188646
|
+
replacement
|
|
188647
|
+
);
|
|
188648
|
+
if (!edit) {
|
|
188649
|
+
cancel();
|
|
188650
|
+
return;
|
|
188651
|
+
}
|
|
188652
|
+
busy = true;
|
|
188653
|
+
let applied = false;
|
|
188654
|
+
try {
|
|
188655
|
+
applied = target.applyLocalDelta(edit.delta, edit.correspondence);
|
|
188656
|
+
} finally {
|
|
188657
|
+
busy = false;
|
|
188658
|
+
}
|
|
188659
|
+
if (!applied) {
|
|
188660
|
+
cancel();
|
|
188661
|
+
return;
|
|
188662
|
+
}
|
|
188663
|
+
previous = next.snapshot;
|
|
188664
|
+
synchronize();
|
|
188665
|
+
}
|
|
188666
|
+
}
|
|
188667
|
+
function createTextPositionTracker(length) {
|
|
188668
|
+
const start = { index: 0 };
|
|
188669
|
+
const end = { index: length };
|
|
188670
|
+
let cells2 = Array.from({ length }, (_, index) => ({ index }));
|
|
188671
|
+
let disposed = false;
|
|
188672
|
+
const dispose = () => {
|
|
188673
|
+
disposed = true;
|
|
188674
|
+
cells2 = [];
|
|
188675
|
+
};
|
|
188676
|
+
const neighbour = (cell, direction) => {
|
|
188677
|
+
const path = [];
|
|
188678
|
+
while (cell.index < 0) {
|
|
188679
|
+
path.push(cell);
|
|
188680
|
+
cell = cell[direction];
|
|
188681
|
+
}
|
|
188682
|
+
for (const removed of path) {
|
|
188683
|
+
removed[direction] = cell;
|
|
188684
|
+
}
|
|
188685
|
+
return cell;
|
|
188686
|
+
};
|
|
188687
|
+
return {
|
|
188688
|
+
capture(index, association) {
|
|
188689
|
+
if (disposed || !Number.isInteger(index) || index < 0 || index > cells2.length) {
|
|
188690
|
+
throw new RangeError("Cannot capture a position outside the current text");
|
|
188691
|
+
}
|
|
188692
|
+
return {
|
|
188693
|
+
cell: association < 0 ? cells2[index - 1] ?? start : cells2[index] ?? end,
|
|
188694
|
+
association
|
|
188695
|
+
};
|
|
188696
|
+
},
|
|
188697
|
+
resolve(position2) {
|
|
188698
|
+
if (disposed) {
|
|
188699
|
+
return null;
|
|
188700
|
+
}
|
|
188701
|
+
const cell = neighbour(position2.cell, position2.association < 0 ? "left" : "right");
|
|
188702
|
+
return cell === start || cell === end ? cell.index : cell.index + (position2.association < 0 ? 1 : 0);
|
|
188703
|
+
},
|
|
188704
|
+
apply(changes) {
|
|
188705
|
+
if (disposed) {
|
|
188706
|
+
return false;
|
|
188707
|
+
}
|
|
188708
|
+
let oldIndex = 0;
|
|
188709
|
+
const next = [];
|
|
188710
|
+
const removed = [];
|
|
188711
|
+
for (const change of changes) {
|
|
188712
|
+
if ([change.retain, change.delete, change.insert].filter((value) => value !== void 0).length !== 1) {
|
|
188713
|
+
dispose();
|
|
188714
|
+
return false;
|
|
188715
|
+
}
|
|
188716
|
+
if (change.insert !== void 0) {
|
|
188717
|
+
for (let index = 0; index < change.insert.length; index++) {
|
|
188718
|
+
next.push({ index: next.length });
|
|
188719
|
+
}
|
|
188720
|
+
continue;
|
|
188721
|
+
}
|
|
188722
|
+
const count = change.retain ?? change.delete;
|
|
188723
|
+
if (!Number.isInteger(count) || count < 0 || oldIndex + count > cells2.length) {
|
|
188724
|
+
dispose();
|
|
188725
|
+
return false;
|
|
188726
|
+
}
|
|
188727
|
+
for (let index = 0; index < count; index++) {
|
|
188728
|
+
const cell = cells2[oldIndex++];
|
|
188729
|
+
if (change.retain !== void 0) {
|
|
188730
|
+
next.push(cell);
|
|
188731
|
+
} else {
|
|
188732
|
+
removed.push({ cell, left: next.at(-1) ?? start, rightIndex: next.length });
|
|
188733
|
+
}
|
|
188734
|
+
}
|
|
188735
|
+
}
|
|
188736
|
+
while (oldIndex < cells2.length) {
|
|
188737
|
+
next.push(cells2[oldIndex++]);
|
|
188738
|
+
}
|
|
188739
|
+
for (const { cell, left, rightIndex } of removed) {
|
|
188740
|
+
cell.index = -1;
|
|
188741
|
+
cell.left = left;
|
|
188742
|
+
cell.right = next[rightIndex] ?? end;
|
|
188743
|
+
}
|
|
188744
|
+
next.forEach((cell, index) => {
|
|
188745
|
+
cell.index = index;
|
|
188746
|
+
});
|
|
188747
|
+
cells2 = next;
|
|
188748
|
+
end.index = cells2.length;
|
|
188749
|
+
return true;
|
|
188750
|
+
},
|
|
188751
|
+
dispose
|
|
188752
|
+
};
|
|
188753
|
+
}
|
|
188754
|
+
function createSnapshotTextPositions(text22, snapshots2) {
|
|
188755
|
+
const tracker = createTextPositionTracker(text22.toString().length);
|
|
188756
|
+
let previous = snapshots2.read();
|
|
188757
|
+
let busy = false;
|
|
188758
|
+
let disposed = false;
|
|
188759
|
+
let unsubscribe = () => {
|
|
188760
|
+
};
|
|
188761
|
+
const marker = /* @__PURE__ */ Symbol("text-identity-change");
|
|
188762
|
+
const dispose = () => {
|
|
188763
|
+
if (!disposed) {
|
|
188764
|
+
disposed = true;
|
|
188765
|
+
unsubscribe();
|
|
188766
|
+
tracker.dispose();
|
|
188767
|
+
}
|
|
188768
|
+
};
|
|
188769
|
+
const refresh = () => {
|
|
188770
|
+
if (disposed || busy) {
|
|
188771
|
+
return false;
|
|
188772
|
+
}
|
|
188773
|
+
busy = true;
|
|
188774
|
+
try {
|
|
188775
|
+
const current = snapshots2.read();
|
|
188776
|
+
if (snapshots2.equal(current, previous)) {
|
|
188777
|
+
return true;
|
|
188778
|
+
}
|
|
188779
|
+
const delta = text22.toDelta(current, previous, (type) => ({ type, marker }));
|
|
188780
|
+
const changes = [];
|
|
188781
|
+
for (const op2 of delta) {
|
|
188782
|
+
if (typeof op2.insert !== "string") {
|
|
188783
|
+
dispose();
|
|
188784
|
+
return false;
|
|
188785
|
+
}
|
|
188786
|
+
const change = op2.attributes?.ychange;
|
|
188787
|
+
const marked = typeof change === "object" && change !== null && "marker" in change && change.marker === marker && "type" in change;
|
|
188788
|
+
changes.push(
|
|
188789
|
+
!marked ? { retain: op2.insert.length } : change.type === "added" ? { insert: op2.insert } : { delete: op2.insert.length }
|
|
188790
|
+
);
|
|
188791
|
+
}
|
|
188792
|
+
previous = current;
|
|
188793
|
+
if (changes.some((change) => change.insert !== void 0 || change.delete !== void 0) && !tracker.apply(changes)) {
|
|
188794
|
+
dispose();
|
|
188795
|
+
return false;
|
|
188796
|
+
}
|
|
188797
|
+
return true;
|
|
188798
|
+
} catch {
|
|
188799
|
+
dispose();
|
|
188800
|
+
return false;
|
|
188801
|
+
} finally {
|
|
188802
|
+
busy = false;
|
|
188803
|
+
}
|
|
188804
|
+
};
|
|
188805
|
+
const stop = snapshots2.subscribeBeforeObservers(refresh);
|
|
188806
|
+
if (disposed) {
|
|
188807
|
+
stop();
|
|
188808
|
+
} else {
|
|
188809
|
+
unsubscribe = stop;
|
|
188810
|
+
}
|
|
188811
|
+
return { capture: tracker.capture, resolve: tracker.resolve, refresh, dispose };
|
|
188812
|
+
}
|
|
187088
188813
|
function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
|
|
187089
188814
|
let opened = false;
|
|
187090
188815
|
let timer = null;
|
|
@@ -191148,6 +192873,362 @@ function collectCoherent3DOffNodeIds(nodes) {
|
|
|
191148
192873
|
}
|
|
191149
192874
|
return ids;
|
|
191150
192875
|
}
|
|
192876
|
+
var LINE_HEIGHT_RATIO = 1.2;
|
|
192877
|
+
function centeredSvgTextLines(text22, fontSize, options = {}) {
|
|
192878
|
+
const lines = options.maxWidth !== void 0 ? wrapTextByEstimatedWidth(text22, options.maxWidth, fontSize) : text22.split("\n").filter((line4) => line4.length > 0);
|
|
192879
|
+
const centerY = options.centerY ?? 0;
|
|
192880
|
+
if (lines.length === 0) {
|
|
192881
|
+
return [{ text: "", y: centerY }];
|
|
192882
|
+
}
|
|
192883
|
+
const lineHeight = options.lineHeight ?? fontSize * (options.lineHeightRatio ?? LINE_HEIGHT_RATIO);
|
|
192884
|
+
const blockTop = centerY - lines.length * lineHeight / 2;
|
|
192885
|
+
return lines.map((line4, index) => ({
|
|
192886
|
+
text: line4,
|
|
192887
|
+
y: blockTop + lineHeight / 2 + index * lineHeight
|
|
192888
|
+
}));
|
|
192889
|
+
}
|
|
192890
|
+
var PALETTES = {
|
|
192891
|
+
colorful1: ["#3b82f6", "#22c55e", "#f97316", "#eab308", "#a855f7", "#ec4899"],
|
|
192892
|
+
colorful2: ["#6366f1", "#14b8a6", "#f59e0b", "#ef4444", "#8b5cf6", "#06b6d4"],
|
|
192893
|
+
colorful3: ["#0ea5e9", "#84cc16", "#f43e5e", "#a855f7", "#f97316", "#10b981"],
|
|
192894
|
+
monochromatic1: ["#3b82f6", "#60a5fa", "#93c5fd", "#bfdbfe", "#2563eb", "#1d4ed8"],
|
|
192895
|
+
monochromatic2: ["#6366f1", "#818cf8", "#a5b4fc", "#c7d2fe", "#4f46e5", "#4338ca"]
|
|
192896
|
+
};
|
|
192897
|
+
var DEFAULT_PALETTE2 = PALETTES.colorful1;
|
|
192898
|
+
function paletteColour(index, palette) {
|
|
192899
|
+
return palette[index % palette.length];
|
|
192900
|
+
}
|
|
192901
|
+
function resolvePalette(data) {
|
|
192902
|
+
if (!data) {
|
|
192903
|
+
return DEFAULT_PALETTE2;
|
|
192904
|
+
}
|
|
192905
|
+
const ctFills = data.colorTransform?.fillColors;
|
|
192906
|
+
if (ctFills && ctFills.length > 0) {
|
|
192907
|
+
return ctFills;
|
|
192908
|
+
}
|
|
192909
|
+
return PALETTES[data.colorScheme ?? "colorful1"] ?? DEFAULT_PALETTE2;
|
|
192910
|
+
}
|
|
192911
|
+
function buildChromeStyle(chrome) {
|
|
192912
|
+
const s = {
|
|
192913
|
+
width: "100%",
|
|
192914
|
+
height: "100%",
|
|
192915
|
+
"box-sizing": "border-box",
|
|
192916
|
+
overflow: "hidden"
|
|
192917
|
+
};
|
|
192918
|
+
if (!chrome) {
|
|
192919
|
+
return s;
|
|
192920
|
+
}
|
|
192921
|
+
if (chrome.backgroundColor) {
|
|
192922
|
+
s["background-color"] = chrome.backgroundColor;
|
|
192923
|
+
}
|
|
192924
|
+
if (chrome.outlineColor) {
|
|
192925
|
+
s["border"] = `${chrome.outlineWidth ?? 1}px solid ${chrome.outlineColor}`;
|
|
192926
|
+
}
|
|
192927
|
+
return s;
|
|
192928
|
+
}
|
|
192929
|
+
var TEXT_WIDTH_FRACTION = 0.82;
|
|
192930
|
+
var CJK_SMARTART_TEXT_RE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
|
|
192931
|
+
var CJK_SMARTART_LINE_HEIGHT_RATIO = 1.33;
|
|
192932
|
+
var DEFAULT_SMARTART_LINE_HEIGHT_RATIO = 1.2;
|
|
192933
|
+
function drawingTextBaseLineHeightRatio(text22) {
|
|
192934
|
+
return CJK_SMARTART_TEXT_RE.test(text22 ?? "") ? CJK_SMARTART_LINE_HEIGHT_RATIO : DEFAULT_SMARTART_LINE_HEIGHT_RATIO;
|
|
192935
|
+
}
|
|
192936
|
+
function underlyingFill(shape, shapes, index) {
|
|
192937
|
+
const centerX = shape.x + shape.width / 2;
|
|
192938
|
+
const centerY = shape.y + shape.height / 2;
|
|
192939
|
+
for (let below = index - 1; below >= 0; below--) {
|
|
192940
|
+
const candidate = shapes[below];
|
|
192941
|
+
if (!candidate || candidate.fillNone || !candidate.fillColor) {
|
|
192942
|
+
continue;
|
|
192943
|
+
}
|
|
192944
|
+
if (centerX >= candidate.x && centerX <= candidate.x + candidate.width && centerY >= candidate.y && centerY <= candidate.y + candidate.height) {
|
|
192945
|
+
return candidate.fillColor;
|
|
192946
|
+
}
|
|
192947
|
+
}
|
|
192948
|
+
return void 0;
|
|
192949
|
+
}
|
|
192950
|
+
function drawingShapeLabelColor(shape, shapes, index, resolvedFill) {
|
|
192951
|
+
const basis = resolvedFill === "none" || resolvedFill.startsWith("url(") ? underlyingFill(shape, shapes, index) : resolvedFill;
|
|
192952
|
+
return basis ? contrastTextColor(basis) : "#1a1a1a";
|
|
192953
|
+
}
|
|
192954
|
+
function computeDrawingViewBox(shapes) {
|
|
192955
|
+
let minX = Infinity;
|
|
192956
|
+
let minY = Infinity;
|
|
192957
|
+
let maxX = -Infinity;
|
|
192958
|
+
let maxY = -Infinity;
|
|
192959
|
+
for (const s of shapes) {
|
|
192960
|
+
const shapeMinX = Math.min(s.x, s.textFrameX ?? s.x);
|
|
192961
|
+
const shapeMinY = Math.min(s.y, s.textFrameY ?? s.y);
|
|
192962
|
+
const shapeMaxX = Math.max(
|
|
192963
|
+
s.x + s.width,
|
|
192964
|
+
(s.textFrameX ?? s.x) + (s.textFrameWidth ?? s.width)
|
|
192965
|
+
);
|
|
192966
|
+
const shapeMaxY = Math.max(
|
|
192967
|
+
s.y + s.height,
|
|
192968
|
+
(s.textFrameY ?? s.y) + (s.textFrameHeight ?? s.height)
|
|
192969
|
+
);
|
|
192970
|
+
if (shapeMinX < minX) {
|
|
192971
|
+
minX = shapeMinX;
|
|
192972
|
+
}
|
|
192973
|
+
if (shapeMinY < minY) {
|
|
192974
|
+
minY = shapeMinY;
|
|
192975
|
+
}
|
|
192976
|
+
if (shapeMaxX > maxX) {
|
|
192977
|
+
maxX = shapeMaxX;
|
|
192978
|
+
}
|
|
192979
|
+
if (shapeMaxY > maxY) {
|
|
192980
|
+
maxY = shapeMaxY;
|
|
192981
|
+
}
|
|
192982
|
+
}
|
|
192983
|
+
if (!Number.isFinite(minX)) {
|
|
192984
|
+
return { minX: 0, minY: 0, width: 1, height: 1 };
|
|
192985
|
+
}
|
|
192986
|
+
return {
|
|
192987
|
+
minX,
|
|
192988
|
+
minY,
|
|
192989
|
+
width: maxX - minX || 1,
|
|
192990
|
+
height: maxY - minY || 1
|
|
192991
|
+
};
|
|
192992
|
+
}
|
|
192993
|
+
function resolveGradient(shape, id) {
|
|
192994
|
+
const stops = shape.fillGradientStops;
|
|
192995
|
+
if (!stops || stops.length === 0) {
|
|
192996
|
+
return void 0;
|
|
192997
|
+
}
|
|
192998
|
+
const mapped = stops.map((stop) => ({
|
|
192999
|
+
offset: `${Math.max(0, Math.min(100, stop.position))}%`,
|
|
193000
|
+
color: stop.color,
|
|
193001
|
+
...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
|
|
193002
|
+
}));
|
|
193003
|
+
if (shape.fillGradientType === "radial") {
|
|
193004
|
+
return { id, kind: "radial", cx: "50%", cy: "50%", r: "50%", stops: mapped };
|
|
193005
|
+
}
|
|
193006
|
+
const radians = (shape.fillGradientAngle ?? 0) * Math.PI / 180;
|
|
193007
|
+
const dx = Math.cos(radians) / 2;
|
|
193008
|
+
const dy = Math.sin(radians) / 2;
|
|
193009
|
+
return {
|
|
193010
|
+
id,
|
|
193011
|
+
kind: "linear",
|
|
193012
|
+
x1: `${(0.5 - dx) * 100}%`,
|
|
193013
|
+
y1: `${(0.5 - dy) * 100}%`,
|
|
193014
|
+
x2: `${(0.5 + dx) * 100}%`,
|
|
193015
|
+
y2: `${(0.5 + dy) * 100}%`,
|
|
193016
|
+
stops: mapped
|
|
193017
|
+
};
|
|
193018
|
+
}
|
|
193019
|
+
function resolveShapeKind(shape, hasImage) {
|
|
193020
|
+
if (hasImage) {
|
|
193021
|
+
return "image";
|
|
193022
|
+
}
|
|
193023
|
+
const normalized = (shape.shapeType ?? "").trim().toLowerCase();
|
|
193024
|
+
if (normalized === "ellipse" || normalized === "oval") {
|
|
193025
|
+
return "ellipse";
|
|
193026
|
+
}
|
|
193027
|
+
const identityPresets = /* @__PURE__ */ new Set(["rect", "flowchartprocess", "roundrect"]);
|
|
193028
|
+
return identityPresets.has(normalized) || normalized.length === 0 ? "rect" : "path";
|
|
193029
|
+
}
|
|
193030
|
+
function drawingShapeTransform(shape, cx, cy) {
|
|
193031
|
+
const transforms = [];
|
|
193032
|
+
if (shape.rotation) {
|
|
193033
|
+
transforms.push(`rotate(${shape.rotation} ${cx} ${cy})`);
|
|
193034
|
+
}
|
|
193035
|
+
if (shape.flipHorizontal || shape.flipVertical) {
|
|
193036
|
+
transforms.push(
|
|
193037
|
+
`translate(${cx} ${cy}) scale(${shape.flipHorizontal ? -1 : 1} ${shape.flipVertical ? -1 : 1}) translate(${-cx} ${-cy})`
|
|
193038
|
+
);
|
|
193039
|
+
}
|
|
193040
|
+
return transforms.length > 0 ? transforms.join(" ") : void 0;
|
|
193041
|
+
}
|
|
193042
|
+
function projectDrawingShapes(elementId, shapes, viewBox, palette, style) {
|
|
193043
|
+
const { minX, minY } = viewBox;
|
|
193044
|
+
const sw = styleStroke(style);
|
|
193045
|
+
return shapes.map((shape, i2) => {
|
|
193046
|
+
const gradient = shape.fillNone ? void 0 : resolveGradient(shape, `${elementId}-dspgrad-${shape.id}-${i2}`);
|
|
193047
|
+
const fill = shape.fillNone ? "none" : gradient ? `url(#${gradient.id})` : shape.fillPatternForegroundColor ?? shape.fillColor ?? paletteColour(i2, palette);
|
|
193048
|
+
const relX = shape.x - minX;
|
|
193049
|
+
const relY = shape.y - minY;
|
|
193050
|
+
const kind = resolveShapeKind(shape, Boolean(shape.fillImageUrl));
|
|
193051
|
+
const rx = getShapeType(shape.shapeType) === "roundRect" ? Math.min(shape.width, shape.height) * 0.1 : 0;
|
|
193052
|
+
const cx = relX + shape.width / 2;
|
|
193053
|
+
const cy = relY + shape.height / 2;
|
|
193054
|
+
const stroke = shape.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none");
|
|
193055
|
+
const transform6 = drawingShapeTransform(shape, cx, cy);
|
|
193056
|
+
const presetGeometry = kind === "path" ? getPresetShapeVectorGeometry(
|
|
193057
|
+
shape.shapeType,
|
|
193058
|
+
shape.width,
|
|
193059
|
+
shape.height,
|
|
193060
|
+
shape.shapeAdjustments
|
|
193061
|
+
) : void 0;
|
|
193062
|
+
const fontSize = shape.fontSize ?? Math.max(8, Math.min(14, shape.height * 0.2));
|
|
193063
|
+
const hasTextFrame = Number.isFinite(shape.textFrameX) && Number.isFinite(shape.textFrameY) && Number.isFinite(shape.textFrameWidth) && Number.isFinite(shape.textFrameHeight) && (shape.textFrameWidth ?? 0) > 0 && (shape.textFrameHeight ?? 0) > 0;
|
|
193064
|
+
const textFrameX = (hasTextFrame ? shape.textFrameX : shape.x) - minX;
|
|
193065
|
+
const textFrameY = (hasTextFrame ? shape.textFrameY : shape.y) - minY;
|
|
193066
|
+
const textFrameWidth = hasTextFrame ? shape.textFrameWidth : shape.width;
|
|
193067
|
+
const textFrameHeight = hasTextFrame ? shape.textFrameHeight : shape.height;
|
|
193068
|
+
const textInsetLeft = shape.textInsetLeft ?? 0;
|
|
193069
|
+
const textInsetRight = shape.textInsetRight ?? 0;
|
|
193070
|
+
const textInsetTop = shape.textInsetTop ?? 0;
|
|
193071
|
+
const textInsetBottom = shape.textInsetBottom ?? 0;
|
|
193072
|
+
const textContentWidth = Math.max(1, textFrameWidth - textInsetLeft - textInsetRight);
|
|
193073
|
+
const textContentHeight = Math.max(1, textFrameHeight - textInsetTop - textInsetBottom);
|
|
193074
|
+
const textCenterX = textFrameX + textInsetLeft + textContentWidth / 2;
|
|
193075
|
+
const textCenterY = textFrameY + textInsetTop + textContentHeight / 2;
|
|
193076
|
+
const textWrapWidth = hasTextFrame ? textContentWidth : shape.width * TEXT_WIDTH_FRACTION;
|
|
193077
|
+
const authoredLineHeightRatio = shape.lineHeightRatio ?? 1;
|
|
193078
|
+
const lineHeightRatio = drawingTextBaseLineHeightRatio(shape.text) * authoredLineHeightRatio + (shape.lineSpacingAfterRatio ?? 0);
|
|
193079
|
+
const lineHeight = shape.lineHeight !== void 0 || shape.lineSpacingAfter !== void 0 ? (shape.lineHeight ?? fontSize * drawingTextBaseLineHeightRatio(shape.text) * authoredLineHeightRatio) + (shape.lineSpacingAfter ?? 0) : void 0;
|
|
193080
|
+
return {
|
|
193081
|
+
key: `${elementId}-dsp-${shape.id}-${i2}`,
|
|
193082
|
+
kind,
|
|
193083
|
+
...presetGeometry ? {
|
|
193084
|
+
pathData: presetGeometry.d,
|
|
193085
|
+
pathTransform: [transform6, `translate(${relX} ${relY})`].filter(Boolean).join(" ")
|
|
193086
|
+
} : {},
|
|
193087
|
+
...gradient ? { gradient } : {},
|
|
193088
|
+
x: relX,
|
|
193089
|
+
y: relY,
|
|
193090
|
+
width: shape.width,
|
|
193091
|
+
height: shape.height,
|
|
193092
|
+
rx,
|
|
193093
|
+
cx,
|
|
193094
|
+
cy,
|
|
193095
|
+
fill,
|
|
193096
|
+
stroke,
|
|
193097
|
+
strokeWidth: shape.strokeWidth ?? sw,
|
|
193098
|
+
transform: transform6,
|
|
193099
|
+
imageUrl: shape.fillImageUrl,
|
|
193100
|
+
textLines: shape.text ? centeredSvgTextLines(shape.text, fontSize, {
|
|
193101
|
+
maxWidth: textWrapWidth,
|
|
193102
|
+
centerY: textCenterY,
|
|
193103
|
+
lineHeight,
|
|
193104
|
+
lineHeightRatio
|
|
193105
|
+
}) : [],
|
|
193106
|
+
textX: textCenterX,
|
|
193107
|
+
textY: textCenterY,
|
|
193108
|
+
textWidth: textContentWidth,
|
|
193109
|
+
textHeight: textContentHeight,
|
|
193110
|
+
fontColor: shape.fontColor ?? drawingShapeLabelColor(shape, shapes, i2, fill),
|
|
193111
|
+
fontSize,
|
|
193112
|
+
fontFamily: shape.fontFamily ? getSubstituteFontFamily(shape.fontFamily) : void 0,
|
|
193113
|
+
fontWeight: shape.fontWeight,
|
|
193114
|
+
fontStyle: shape.fontStyle
|
|
193115
|
+
};
|
|
193116
|
+
});
|
|
193117
|
+
}
|
|
193118
|
+
function styleShadowFilter(style) {
|
|
193119
|
+
return styleShadow(style);
|
|
193120
|
+
}
|
|
193121
|
+
function fitDrawingToBox(drawing, box) {
|
|
193122
|
+
const scale2 = Math.min(box.width / drawing.width, box.height / drawing.height) || 1;
|
|
193123
|
+
return {
|
|
193124
|
+
scale: scale2,
|
|
193125
|
+
offsetX: (box.width - drawing.width * scale2) / 2,
|
|
193126
|
+
offsetY: (box.height - drawing.height * scale2) / 2
|
|
193127
|
+
};
|
|
193128
|
+
}
|
|
193129
|
+
function solidFill3(shape, rendered) {
|
|
193130
|
+
if (shape.fillNone || rendered.fill === "none") {
|
|
193131
|
+
return null;
|
|
193132
|
+
}
|
|
193133
|
+
if (rendered.gradient) {
|
|
193134
|
+
return rendered.gradient.stops[0]?.color ?? shape.fillColor ?? null;
|
|
193135
|
+
}
|
|
193136
|
+
return rendered.fill;
|
|
193137
|
+
}
|
|
193138
|
+
function drawingShapeNode(shape, rendered, fit) {
|
|
193139
|
+
const fill = solidFill3(shape, rendered);
|
|
193140
|
+
if (!fill) {
|
|
193141
|
+
return null;
|
|
193142
|
+
}
|
|
193143
|
+
const { scale: scale2, offsetX, offsetY } = fit;
|
|
193144
|
+
const sx = (x) => offsetX + x * scale2;
|
|
193145
|
+
const sy = (y) => offsetY + y * scale2;
|
|
193146
|
+
const base = {
|
|
193147
|
+
key: rendered.key,
|
|
193148
|
+
fill,
|
|
193149
|
+
stroke: rendered.stroke,
|
|
193150
|
+
strokeWidth: rendered.strokeWidth * scale2,
|
|
193151
|
+
opacity: 1,
|
|
193152
|
+
text: shape.text ?? "",
|
|
193153
|
+
fontSize: rendered.fontSize * scale2,
|
|
193154
|
+
textX: sx(rendered.textX),
|
|
193155
|
+
textY: sy(rendered.textY)
|
|
193156
|
+
};
|
|
193157
|
+
if (rendered.kind === "ellipse") {
|
|
193158
|
+
return {
|
|
193159
|
+
...base,
|
|
193160
|
+
kind: "circle",
|
|
193161
|
+
cx: sx(rendered.cx),
|
|
193162
|
+
cy: sy(rendered.cy),
|
|
193163
|
+
r: Math.min(rendered.width, rendered.height) / 2 * scale2,
|
|
193164
|
+
rx: rendered.width / 2 * scale2,
|
|
193165
|
+
ry: rendered.height / 2 * scale2
|
|
193166
|
+
};
|
|
193167
|
+
}
|
|
193168
|
+
if (rendered.kind === "path" && rendered.pathData) {
|
|
193169
|
+
const pts = parsePathPoints(rendered.pathData);
|
|
193170
|
+
if (pts.length >= 3) {
|
|
193171
|
+
return {
|
|
193172
|
+
...base,
|
|
193173
|
+
kind: "polygon",
|
|
193174
|
+
points: pts.map((p) => `${sx(rendered.x + p.x)},${sy(rendered.y + p.y)}`).join(" ")
|
|
193175
|
+
};
|
|
193176
|
+
}
|
|
193177
|
+
}
|
|
193178
|
+
return {
|
|
193179
|
+
...base,
|
|
193180
|
+
kind: "rect",
|
|
193181
|
+
x: sx(rendered.x),
|
|
193182
|
+
y: sy(rendered.y),
|
|
193183
|
+
width: rendered.width * scale2,
|
|
193184
|
+
height: rendered.height * scale2,
|
|
193185
|
+
rx: rendered.rx * scale2
|
|
193186
|
+
};
|
|
193187
|
+
}
|
|
193188
|
+
function drawingShapesLayoutResult(elementId, shapes, box, palette, style, family) {
|
|
193189
|
+
if (!shapes || shapes.length === 0) {
|
|
193190
|
+
return null;
|
|
193191
|
+
}
|
|
193192
|
+
const viewBox = computeDrawingViewBox(shapes);
|
|
193193
|
+
const fit = fitDrawingToBox(viewBox, box);
|
|
193194
|
+
const rendered = projectDrawingShapes(elementId, shapes, viewBox, palette, style);
|
|
193195
|
+
const nodes = [];
|
|
193196
|
+
rendered.forEach((r, i2) => {
|
|
193197
|
+
const node = drawingShapeNode(shapes[i2], r, fit);
|
|
193198
|
+
if (node) {
|
|
193199
|
+
nodes.push(node);
|
|
193200
|
+
}
|
|
193201
|
+
});
|
|
193202
|
+
if (nodes.length === 0) {
|
|
193203
|
+
return null;
|
|
193204
|
+
}
|
|
193205
|
+
return {
|
|
193206
|
+
nodes,
|
|
193207
|
+
connectors: [],
|
|
193208
|
+
shadowFilter: void 0,
|
|
193209
|
+
viewBox: `0 0 ${box.width} ${box.height}`,
|
|
193210
|
+
family
|
|
193211
|
+
};
|
|
193212
|
+
}
|
|
193213
|
+
function resolveSmartArt3DLayout(smartArtData, nodes, box, palette, style, elementId) {
|
|
193214
|
+
const family = resolveLayoutFamily(nodes, smartArtData.resolvedLayoutType, smartArtData.layout);
|
|
193215
|
+
return drawingShapesLayoutResult(elementId, smartArtData.drawingShapes, box, palette, style, family) ?? computeSmartArtElementLayout(smartArtData, nodes, box, palette, style, elementId);
|
|
193216
|
+
}
|
|
193217
|
+
function observeElementHeight(el, onHeight) {
|
|
193218
|
+
onHeight(el.getBoundingClientRect().height);
|
|
193219
|
+
if (typeof ResizeObserver === "undefined") {
|
|
193220
|
+
return () => void 0;
|
|
193221
|
+
}
|
|
193222
|
+
const observer = new ResizeObserver((entries) => {
|
|
193223
|
+
const entry2 = entries[entries.length - 1];
|
|
193224
|
+
if (entry2) {
|
|
193225
|
+
const box = entry2.borderBoxSize?.[0]?.blockSize;
|
|
193226
|
+
onHeight(box ?? el.getBoundingClientRect().height);
|
|
193227
|
+
}
|
|
193228
|
+
});
|
|
193229
|
+
observer.observe(el);
|
|
193230
|
+
return () => observer.disconnect();
|
|
193231
|
+
}
|
|
191151
193232
|
var MAX_LISTED_NODES = 8;
|
|
191152
193233
|
var LAYOUT_LABELS = {
|
|
191153
193234
|
list: "List",
|
|
@@ -192337,10 +194418,18 @@ function computeSphericalCameraPlacement(maxExtent, targetY, view3D) {
|
|
|
192337
194418
|
fov
|
|
192338
194419
|
};
|
|
192339
194420
|
}
|
|
192340
|
-
function computeCartesianCameraPlacement(cols, rows, view3D) {
|
|
194421
|
+
function computeCartesianCameraPlacement(cols, rows, view3D, horizontal = false) {
|
|
192341
194422
|
const { gridWidth, gridDepth } = computeCartesianGridExtent(cols, rows, view3D?.depthPercent);
|
|
192342
194423
|
const maxExtent = Math.max(gridWidth, gridDepth, MAX_VALUE_HEIGHT);
|
|
192343
|
-
|
|
194424
|
+
const placement = computeSphericalCameraPlacement(maxExtent, MAX_VALUE_HEIGHT * 0.2, view3D);
|
|
194425
|
+
if (!horizontal) {
|
|
194426
|
+
return placement;
|
|
194427
|
+
}
|
|
194428
|
+
return {
|
|
194429
|
+
...placement,
|
|
194430
|
+
position: transposeForHorizontalBar3D(placement.position),
|
|
194431
|
+
target: transposeForHorizontalBar3D(placement.target)
|
|
194432
|
+
};
|
|
192344
194433
|
}
|
|
192345
194434
|
function buildCartesianChart3DLabels(cols, rows, categoryLabels, seriesNames, depthPercent, maxCat = 8, maxSer = 6, horizontal = false) {
|
|
192346
194435
|
const { gridWidth, gridDepth } = computeCartesianGridExtent(cols, rows, depthPercent);
|
|
@@ -192789,7 +194878,12 @@ async function mountBarChart3D(container, options, interaction) {
|
|
|
192789
194878
|
const fill = new three.DirectionalLight(16777215, 0.3);
|
|
192790
194879
|
fill.position.set(-3, 4, -2);
|
|
192791
194880
|
scene.add(fill);
|
|
192792
|
-
const placement = computeCartesianCameraPlacement(
|
|
194881
|
+
const placement = computeCartesianCameraPlacement(
|
|
194882
|
+
options.cols,
|
|
194883
|
+
options.rows,
|
|
194884
|
+
options.view3D,
|
|
194885
|
+
options.horizontal
|
|
194886
|
+
);
|
|
192793
194887
|
const camera = new three.PerspectiveCamera(placement.fov, width / height, 0.1, 1e3);
|
|
192794
194888
|
camera.position.set(...placement.position);
|
|
192795
194889
|
const target = new three.Vector3(...placement.target);
|
|
@@ -194204,344 +196298,6 @@ function buildPieChart3DDataForElement(element, options) {
|
|
|
194204
196298
|
const categoryLabels = chartData.categories.length > 0 ? chartData.categories : Array.from({ length: pieSeries.values.length }, (_, i2) => String(i2 + 1));
|
|
194205
196299
|
return buildPieChart3DData(chartData, categoryLabels, options);
|
|
194206
196300
|
}
|
|
194207
|
-
function estimatedGlyphAdvanceRatio(glyph) {
|
|
194208
|
-
if (/\p{Mark}/u.test(glyph)) {
|
|
194209
|
-
return 0;
|
|
194210
|
-
}
|
|
194211
|
-
if (/\s/u.test(glyph)) {
|
|
194212
|
-
return 0.33;
|
|
194213
|
-
}
|
|
194214
|
-
if (/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]/u.test(
|
|
194215
|
-
glyph
|
|
194216
|
-
)) {
|
|
194217
|
-
return 1;
|
|
194218
|
-
}
|
|
194219
|
-
if (/[A-Z]/u.test(glyph)) {
|
|
194220
|
-
return 0.65;
|
|
194221
|
-
}
|
|
194222
|
-
if (/[a-z0-9]/u.test(glyph)) {
|
|
194223
|
-
return 0.55;
|
|
194224
|
-
}
|
|
194225
|
-
if (/[,.;:!?()\u005b\u005d{}'"`\-_/\\]/u.test(glyph)) {
|
|
194226
|
-
return 0.35;
|
|
194227
|
-
}
|
|
194228
|
-
return 0.6;
|
|
194229
|
-
}
|
|
194230
|
-
function estimatedTextWidth(glyphs, fontSize) {
|
|
194231
|
-
return glyphs.reduce((sum, glyph) => sum + estimatedGlyphAdvanceRatio(glyph) * fontSize, 0);
|
|
194232
|
-
}
|
|
194233
|
-
var HANGING_PUNCTUATION_RE = /^[\u3001\u3002\uff0c\uff0e\uff01\uff1f\uff1b\uff1a\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u3019\u301b\uff09\uff3d\uff5d\u2019\u201d\u00bb\u203a]$/u;
|
|
194234
|
-
var BREAKABLE_GLYPH_RE = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]$/u;
|
|
194235
|
-
function estimatedWrapUnits(text22) {
|
|
194236
|
-
const units = [];
|
|
194237
|
-
let unbreakableRun = "";
|
|
194238
|
-
const flushRun = () => {
|
|
194239
|
-
if (unbreakableRun.length > 0) {
|
|
194240
|
-
units.push(unbreakableRun);
|
|
194241
|
-
unbreakableRun = "";
|
|
194242
|
-
}
|
|
194243
|
-
};
|
|
194244
|
-
for (const glyph of Array.from(text22)) {
|
|
194245
|
-
if (/\s/u.test(glyph) || BREAKABLE_GLYPH_RE.test(glyph)) {
|
|
194246
|
-
flushRun();
|
|
194247
|
-
units.push(glyph);
|
|
194248
|
-
} else {
|
|
194249
|
-
unbreakableRun += glyph;
|
|
194250
|
-
}
|
|
194251
|
-
}
|
|
194252
|
-
flushRun();
|
|
194253
|
-
return units;
|
|
194254
|
-
}
|
|
194255
|
-
function wrapTextByEstimatedWidth(text22, maxWidth, fontSize, options = {}) {
|
|
194256
|
-
if (!text22 || text22.trim().length === 0) {
|
|
194257
|
-
return [];
|
|
194258
|
-
}
|
|
194259
|
-
if (!(maxWidth > 0) || !(fontSize > 0)) {
|
|
194260
|
-
return [];
|
|
194261
|
-
}
|
|
194262
|
-
const lines = [];
|
|
194263
|
-
for (const paragraph of text22.split(/\r?\n/u)) {
|
|
194264
|
-
if (paragraph.trim().length === 0) {
|
|
194265
|
-
if (options.keepBlankLines) {
|
|
194266
|
-
lines.push("");
|
|
194267
|
-
}
|
|
194268
|
-
continue;
|
|
194269
|
-
}
|
|
194270
|
-
let current = "";
|
|
194271
|
-
let pendingWhitespace = false;
|
|
194272
|
-
for (const unit of estimatedWrapUnits(paragraph)) {
|
|
194273
|
-
if (/^\s+$/u.test(unit)) {
|
|
194274
|
-
pendingWhitespace = current.length > 0;
|
|
194275
|
-
continue;
|
|
194276
|
-
}
|
|
194277
|
-
const separator = pendingWhitespace && current.length > 0 ? " " : "";
|
|
194278
|
-
const candidate = `${current}${separator}${unit}`;
|
|
194279
|
-
if (current.length === 0 || estimatedTextWidth(Array.from(candidate), fontSize) <= maxWidth) {
|
|
194280
|
-
current = candidate;
|
|
194281
|
-
pendingWhitespace = false;
|
|
194282
|
-
continue;
|
|
194283
|
-
}
|
|
194284
|
-
if (HANGING_PUNCTUATION_RE.test(unit)) {
|
|
194285
|
-
current += unit;
|
|
194286
|
-
pendingWhitespace = false;
|
|
194287
|
-
continue;
|
|
194288
|
-
}
|
|
194289
|
-
lines.push(current);
|
|
194290
|
-
current = unit;
|
|
194291
|
-
pendingWhitespace = false;
|
|
194292
|
-
}
|
|
194293
|
-
const completed = current.trimEnd();
|
|
194294
|
-
if (completed.length > 0) {
|
|
194295
|
-
lines.push(completed);
|
|
194296
|
-
}
|
|
194297
|
-
}
|
|
194298
|
-
return lines;
|
|
194299
|
-
}
|
|
194300
|
-
var LINE_HEIGHT_RATIO = 1.2;
|
|
194301
|
-
function centeredSvgTextLines(text22, fontSize, options = {}) {
|
|
194302
|
-
const lines = options.maxWidth !== void 0 ? wrapTextByEstimatedWidth(text22, options.maxWidth, fontSize) : text22.split("\n").filter((line4) => line4.length > 0);
|
|
194303
|
-
const centerY = options.centerY ?? 0;
|
|
194304
|
-
if (lines.length === 0) {
|
|
194305
|
-
return [{ text: "", y: centerY }];
|
|
194306
|
-
}
|
|
194307
|
-
const lineHeight = options.lineHeight ?? fontSize * (options.lineHeightRatio ?? LINE_HEIGHT_RATIO);
|
|
194308
|
-
const blockTop = centerY - lines.length * lineHeight / 2;
|
|
194309
|
-
return lines.map((line4, index) => ({
|
|
194310
|
-
text: line4,
|
|
194311
|
-
y: blockTop + lineHeight / 2 + index * lineHeight
|
|
194312
|
-
}));
|
|
194313
|
-
}
|
|
194314
|
-
var PALETTES = {
|
|
194315
|
-
colorful1: ["#3b82f6", "#22c55e", "#f97316", "#eab308", "#a855f7", "#ec4899"],
|
|
194316
|
-
colorful2: ["#6366f1", "#14b8a6", "#f59e0b", "#ef4444", "#8b5cf6", "#06b6d4"],
|
|
194317
|
-
colorful3: ["#0ea5e9", "#84cc16", "#f43e5e", "#a855f7", "#f97316", "#10b981"],
|
|
194318
|
-
monochromatic1: ["#3b82f6", "#60a5fa", "#93c5fd", "#bfdbfe", "#2563eb", "#1d4ed8"],
|
|
194319
|
-
monochromatic2: ["#6366f1", "#818cf8", "#a5b4fc", "#c7d2fe", "#4f46e5", "#4338ca"]
|
|
194320
|
-
};
|
|
194321
|
-
var DEFAULT_PALETTE2 = PALETTES.colorful1;
|
|
194322
|
-
function paletteColour(index, palette) {
|
|
194323
|
-
return palette[index % palette.length];
|
|
194324
|
-
}
|
|
194325
|
-
function resolvePalette(data) {
|
|
194326
|
-
if (!data) {
|
|
194327
|
-
return DEFAULT_PALETTE2;
|
|
194328
|
-
}
|
|
194329
|
-
const ctFills = data.colorTransform?.fillColors;
|
|
194330
|
-
if (ctFills && ctFills.length > 0) {
|
|
194331
|
-
return ctFills;
|
|
194332
|
-
}
|
|
194333
|
-
return PALETTES[data.colorScheme ?? "colorful1"] ?? DEFAULT_PALETTE2;
|
|
194334
|
-
}
|
|
194335
|
-
function buildChromeStyle(chrome) {
|
|
194336
|
-
const s = {
|
|
194337
|
-
width: "100%",
|
|
194338
|
-
height: "100%",
|
|
194339
|
-
"box-sizing": "border-box",
|
|
194340
|
-
overflow: "hidden"
|
|
194341
|
-
};
|
|
194342
|
-
if (!chrome) {
|
|
194343
|
-
return s;
|
|
194344
|
-
}
|
|
194345
|
-
if (chrome.backgroundColor) {
|
|
194346
|
-
s["background-color"] = chrome.backgroundColor;
|
|
194347
|
-
}
|
|
194348
|
-
if (chrome.outlineColor) {
|
|
194349
|
-
s["border"] = `${chrome.outlineWidth ?? 1}px solid ${chrome.outlineColor}`;
|
|
194350
|
-
}
|
|
194351
|
-
return s;
|
|
194352
|
-
}
|
|
194353
|
-
var TEXT_WIDTH_FRACTION = 0.82;
|
|
194354
|
-
var CJK_SMARTART_TEXT_RE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
|
|
194355
|
-
var CJK_SMARTART_LINE_HEIGHT_RATIO = 1.33;
|
|
194356
|
-
var DEFAULT_SMARTART_LINE_HEIGHT_RATIO = 1.2;
|
|
194357
|
-
function drawingTextBaseLineHeightRatio(text22) {
|
|
194358
|
-
return CJK_SMARTART_TEXT_RE.test(text22 ?? "") ? CJK_SMARTART_LINE_HEIGHT_RATIO : DEFAULT_SMARTART_LINE_HEIGHT_RATIO;
|
|
194359
|
-
}
|
|
194360
|
-
function underlyingFill(shape, shapes, index) {
|
|
194361
|
-
const centerX = shape.x + shape.width / 2;
|
|
194362
|
-
const centerY = shape.y + shape.height / 2;
|
|
194363
|
-
for (let below = index - 1; below >= 0; below--) {
|
|
194364
|
-
const candidate = shapes[below];
|
|
194365
|
-
if (!candidate || candidate.fillNone || !candidate.fillColor) {
|
|
194366
|
-
continue;
|
|
194367
|
-
}
|
|
194368
|
-
if (centerX >= candidate.x && centerX <= candidate.x + candidate.width && centerY >= candidate.y && centerY <= candidate.y + candidate.height) {
|
|
194369
|
-
return candidate.fillColor;
|
|
194370
|
-
}
|
|
194371
|
-
}
|
|
194372
|
-
return void 0;
|
|
194373
|
-
}
|
|
194374
|
-
function drawingShapeLabelColor(shape, shapes, index, resolvedFill) {
|
|
194375
|
-
const basis = resolvedFill === "none" || resolvedFill.startsWith("url(") ? underlyingFill(shape, shapes, index) : resolvedFill;
|
|
194376
|
-
return basis ? contrastTextColor(basis) : "#1a1a1a";
|
|
194377
|
-
}
|
|
194378
|
-
function computeDrawingViewBox(shapes) {
|
|
194379
|
-
let minX = Infinity;
|
|
194380
|
-
let minY = Infinity;
|
|
194381
|
-
let maxX = -Infinity;
|
|
194382
|
-
let maxY = -Infinity;
|
|
194383
|
-
for (const s of shapes) {
|
|
194384
|
-
const shapeMinX = Math.min(s.x, s.textFrameX ?? s.x);
|
|
194385
|
-
const shapeMinY = Math.min(s.y, s.textFrameY ?? s.y);
|
|
194386
|
-
const shapeMaxX = Math.max(
|
|
194387
|
-
s.x + s.width,
|
|
194388
|
-
(s.textFrameX ?? s.x) + (s.textFrameWidth ?? s.width)
|
|
194389
|
-
);
|
|
194390
|
-
const shapeMaxY = Math.max(
|
|
194391
|
-
s.y + s.height,
|
|
194392
|
-
(s.textFrameY ?? s.y) + (s.textFrameHeight ?? s.height)
|
|
194393
|
-
);
|
|
194394
|
-
if (shapeMinX < minX) {
|
|
194395
|
-
minX = shapeMinX;
|
|
194396
|
-
}
|
|
194397
|
-
if (shapeMinY < minY) {
|
|
194398
|
-
minY = shapeMinY;
|
|
194399
|
-
}
|
|
194400
|
-
if (shapeMaxX > maxX) {
|
|
194401
|
-
maxX = shapeMaxX;
|
|
194402
|
-
}
|
|
194403
|
-
if (shapeMaxY > maxY) {
|
|
194404
|
-
maxY = shapeMaxY;
|
|
194405
|
-
}
|
|
194406
|
-
}
|
|
194407
|
-
if (!Number.isFinite(minX)) {
|
|
194408
|
-
return { minX: 0, minY: 0, width: 1, height: 1 };
|
|
194409
|
-
}
|
|
194410
|
-
return {
|
|
194411
|
-
minX,
|
|
194412
|
-
minY,
|
|
194413
|
-
width: maxX - minX || 1,
|
|
194414
|
-
height: maxY - minY || 1
|
|
194415
|
-
};
|
|
194416
|
-
}
|
|
194417
|
-
function resolveGradient(shape, id) {
|
|
194418
|
-
const stops = shape.fillGradientStops;
|
|
194419
|
-
if (!stops || stops.length === 0) {
|
|
194420
|
-
return void 0;
|
|
194421
|
-
}
|
|
194422
|
-
const mapped = stops.map((stop) => ({
|
|
194423
|
-
offset: `${Math.max(0, Math.min(100, stop.position))}%`,
|
|
194424
|
-
color: stop.color,
|
|
194425
|
-
...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
|
|
194426
|
-
}));
|
|
194427
|
-
if (shape.fillGradientType === "radial") {
|
|
194428
|
-
return { id, kind: "radial", cx: "50%", cy: "50%", r: "50%", stops: mapped };
|
|
194429
|
-
}
|
|
194430
|
-
const radians = (shape.fillGradientAngle ?? 0) * Math.PI / 180;
|
|
194431
|
-
const dx = Math.cos(radians) / 2;
|
|
194432
|
-
const dy = Math.sin(radians) / 2;
|
|
194433
|
-
return {
|
|
194434
|
-
id,
|
|
194435
|
-
kind: "linear",
|
|
194436
|
-
x1: `${(0.5 - dx) * 100}%`,
|
|
194437
|
-
y1: `${(0.5 - dy) * 100}%`,
|
|
194438
|
-
x2: `${(0.5 + dx) * 100}%`,
|
|
194439
|
-
y2: `${(0.5 + dy) * 100}%`,
|
|
194440
|
-
stops: mapped
|
|
194441
|
-
};
|
|
194442
|
-
}
|
|
194443
|
-
function resolveShapeKind(shape, hasImage) {
|
|
194444
|
-
if (hasImage) {
|
|
194445
|
-
return "image";
|
|
194446
|
-
}
|
|
194447
|
-
const normalized = (shape.shapeType ?? "").trim().toLowerCase();
|
|
194448
|
-
if (normalized === "ellipse" || normalized === "oval") {
|
|
194449
|
-
return "ellipse";
|
|
194450
|
-
}
|
|
194451
|
-
const identityPresets = /* @__PURE__ */ new Set(["rect", "flowchartprocess", "roundrect"]);
|
|
194452
|
-
return identityPresets.has(normalized) || normalized.length === 0 ? "rect" : "path";
|
|
194453
|
-
}
|
|
194454
|
-
function drawingShapeTransform(shape, cx, cy) {
|
|
194455
|
-
const transforms = [];
|
|
194456
|
-
if (shape.rotation) {
|
|
194457
|
-
transforms.push(`rotate(${shape.rotation} ${cx} ${cy})`);
|
|
194458
|
-
}
|
|
194459
|
-
if (shape.flipHorizontal || shape.flipVertical) {
|
|
194460
|
-
transforms.push(
|
|
194461
|
-
`translate(${cx} ${cy}) scale(${shape.flipHorizontal ? -1 : 1} ${shape.flipVertical ? -1 : 1}) translate(${-cx} ${-cy})`
|
|
194462
|
-
);
|
|
194463
|
-
}
|
|
194464
|
-
return transforms.length > 0 ? transforms.join(" ") : void 0;
|
|
194465
|
-
}
|
|
194466
|
-
function projectDrawingShapes(elementId, shapes, viewBox, palette, style) {
|
|
194467
|
-
const { minX, minY } = viewBox;
|
|
194468
|
-
const sw = styleStroke(style);
|
|
194469
|
-
return shapes.map((shape, i2) => {
|
|
194470
|
-
const gradient = shape.fillNone ? void 0 : resolveGradient(shape, `${elementId}-dspgrad-${shape.id}-${i2}`);
|
|
194471
|
-
const fill = shape.fillNone ? "none" : gradient ? `url(#${gradient.id})` : shape.fillPatternForegroundColor ?? shape.fillColor ?? paletteColour(i2, palette);
|
|
194472
|
-
const relX = shape.x - minX;
|
|
194473
|
-
const relY = shape.y - minY;
|
|
194474
|
-
const kind = resolveShapeKind(shape, Boolean(shape.fillImageUrl));
|
|
194475
|
-
const rx = getShapeType(shape.shapeType) === "roundRect" ? Math.min(shape.width, shape.height) * 0.1 : 0;
|
|
194476
|
-
const cx = relX + shape.width / 2;
|
|
194477
|
-
const cy = relY + shape.height / 2;
|
|
194478
|
-
const stroke = shape.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none");
|
|
194479
|
-
const transform6 = drawingShapeTransform(shape, cx, cy);
|
|
194480
|
-
const presetGeometry = kind === "path" ? getPresetShapeVectorGeometry(
|
|
194481
|
-
shape.shapeType,
|
|
194482
|
-
shape.width,
|
|
194483
|
-
shape.height,
|
|
194484
|
-
shape.shapeAdjustments
|
|
194485
|
-
) : void 0;
|
|
194486
|
-
const fontSize = shape.fontSize ?? Math.max(8, Math.min(14, shape.height * 0.2));
|
|
194487
|
-
const hasTextFrame = Number.isFinite(shape.textFrameX) && Number.isFinite(shape.textFrameY) && Number.isFinite(shape.textFrameWidth) && Number.isFinite(shape.textFrameHeight) && (shape.textFrameWidth ?? 0) > 0 && (shape.textFrameHeight ?? 0) > 0;
|
|
194488
|
-
const textFrameX = (hasTextFrame ? shape.textFrameX : shape.x) - minX;
|
|
194489
|
-
const textFrameY = (hasTextFrame ? shape.textFrameY : shape.y) - minY;
|
|
194490
|
-
const textFrameWidth = hasTextFrame ? shape.textFrameWidth : shape.width;
|
|
194491
|
-
const textFrameHeight = hasTextFrame ? shape.textFrameHeight : shape.height;
|
|
194492
|
-
const textInsetLeft = shape.textInsetLeft ?? 0;
|
|
194493
|
-
const textInsetRight = shape.textInsetRight ?? 0;
|
|
194494
|
-
const textInsetTop = shape.textInsetTop ?? 0;
|
|
194495
|
-
const textInsetBottom = shape.textInsetBottom ?? 0;
|
|
194496
|
-
const textContentWidth = Math.max(1, textFrameWidth - textInsetLeft - textInsetRight);
|
|
194497
|
-
const textContentHeight = Math.max(1, textFrameHeight - textInsetTop - textInsetBottom);
|
|
194498
|
-
const textCenterX = textFrameX + textInsetLeft + textContentWidth / 2;
|
|
194499
|
-
const textCenterY = textFrameY + textInsetTop + textContentHeight / 2;
|
|
194500
|
-
const textWrapWidth = hasTextFrame ? textContentWidth : shape.width * TEXT_WIDTH_FRACTION;
|
|
194501
|
-
const authoredLineHeightRatio = shape.lineHeightRatio ?? 1;
|
|
194502
|
-
const lineHeightRatio = drawingTextBaseLineHeightRatio(shape.text) * authoredLineHeightRatio + (shape.lineSpacingAfterRatio ?? 0);
|
|
194503
|
-
const lineHeight = shape.lineHeight !== void 0 || shape.lineSpacingAfter !== void 0 ? (shape.lineHeight ?? fontSize * drawingTextBaseLineHeightRatio(shape.text) * authoredLineHeightRatio) + (shape.lineSpacingAfter ?? 0) : void 0;
|
|
194504
|
-
return {
|
|
194505
|
-
key: `${elementId}-dsp-${shape.id}-${i2}`,
|
|
194506
|
-
kind,
|
|
194507
|
-
...presetGeometry ? {
|
|
194508
|
-
pathData: presetGeometry.d,
|
|
194509
|
-
pathTransform: [transform6, `translate(${relX} ${relY})`].filter(Boolean).join(" ")
|
|
194510
|
-
} : {},
|
|
194511
|
-
...gradient ? { gradient } : {},
|
|
194512
|
-
x: relX,
|
|
194513
|
-
y: relY,
|
|
194514
|
-
width: shape.width,
|
|
194515
|
-
height: shape.height,
|
|
194516
|
-
rx,
|
|
194517
|
-
cx,
|
|
194518
|
-
cy,
|
|
194519
|
-
fill,
|
|
194520
|
-
stroke,
|
|
194521
|
-
strokeWidth: shape.strokeWidth ?? sw,
|
|
194522
|
-
transform: transform6,
|
|
194523
|
-
imageUrl: shape.fillImageUrl,
|
|
194524
|
-
textLines: shape.text ? centeredSvgTextLines(shape.text, fontSize, {
|
|
194525
|
-
maxWidth: textWrapWidth,
|
|
194526
|
-
centerY: textCenterY,
|
|
194527
|
-
lineHeight,
|
|
194528
|
-
lineHeightRatio
|
|
194529
|
-
}) : [],
|
|
194530
|
-
textX: textCenterX,
|
|
194531
|
-
textY: textCenterY,
|
|
194532
|
-
textWidth: textContentWidth,
|
|
194533
|
-
textHeight: textContentHeight,
|
|
194534
|
-
fontColor: shape.fontColor ?? drawingShapeLabelColor(shape, shapes, i2, fill),
|
|
194535
|
-
fontSize,
|
|
194536
|
-
fontFamily: shape.fontFamily ? getSubstituteFontFamily(shape.fontFamily) : void 0,
|
|
194537
|
-
fontWeight: shape.fontWeight,
|
|
194538
|
-
fontStyle: shape.fontStyle
|
|
194539
|
-
};
|
|
194540
|
-
});
|
|
194541
|
-
}
|
|
194542
|
-
function styleShadowFilter(style) {
|
|
194543
|
-
return styleShadow(style);
|
|
194544
|
-
}
|
|
194545
196301
|
function collectFontsFromElement(element, fonts) {
|
|
194546
196302
|
if (hasTextProperties(element)) {
|
|
194547
196303
|
if (element.textStyle?.fontFamily) {
|
|
@@ -201487,13 +203243,14 @@ var COMPAT_TOAST_METRICS = {
|
|
|
201487
203243
|
/** Stacking order: above the canvas and inspector, below dialogs. */
|
|
201488
203244
|
zIndex: 40
|
|
201489
203245
|
};
|
|
201490
|
-
function compatToastStackStyle() {
|
|
203246
|
+
function compatToastStackStyle(extraRightInset = 0, extraBottomInset = 0) {
|
|
201491
203247
|
const m = COMPAT_TOAST_METRICS;
|
|
201492
203248
|
return {
|
|
201493
203249
|
position: "absolute",
|
|
201494
|
-
right: `${String(m.insetRight)}px`,
|
|
201495
|
-
bottom: `${String(STATUS_BAR_METRICS.height + m.marginAboveStatusBar)}px`,
|
|
203250
|
+
right: `${String(m.insetRight + extraRightInset)}px`,
|
|
203251
|
+
bottom: `${String(STATUS_BAR_METRICS.height + m.marginAboveStatusBar + extraBottomInset)}px`,
|
|
201496
203252
|
width: `${String(m.width)}px`,
|
|
203253
|
+
maxWidth: `calc(100% - ${String(m.insetRight + extraRightInset)}px)`,
|
|
201497
203254
|
zIndex: String(m.zIndex),
|
|
201498
203255
|
display: "flex",
|
|
201499
203256
|
flexDirection: "column",
|
|
@@ -201704,8 +203461,20 @@ function filterCommands(query, resolveLabel) {
|
|
|
201704
203461
|
(entry2) => resolveLabel(entry2.labelKey).toLowerCase().includes(lowerQuery)
|
|
201705
203462
|
);
|
|
201706
203463
|
}
|
|
203464
|
+
var sourceIdentities = /* @__PURE__ */ new WeakMap();
|
|
203465
|
+
function sourceIdentity(source) {
|
|
203466
|
+
if ((typeof source !== "object" || source === null) && typeof source !== "function") {
|
|
203467
|
+
return source;
|
|
203468
|
+
}
|
|
203469
|
+
let identity = sourceIdentities.get(source);
|
|
203470
|
+
if (!identity) {
|
|
203471
|
+
identity = {};
|
|
203472
|
+
sourceIdentities.set(source, identity);
|
|
203473
|
+
}
|
|
203474
|
+
return identity;
|
|
203475
|
+
}
|
|
201707
203476
|
function autosaveSnapshotMark(filePath, sources) {
|
|
201708
|
-
return { filePath, sources:
|
|
203477
|
+
return { filePath, sources: sources.map(sourceIdentity) };
|
|
201709
203478
|
}
|
|
201710
203479
|
function shouldWriteAutosaveSnapshot(input) {
|
|
201711
203480
|
if (!input.filePath || !input.isDirty || input.saving) {
|
|
@@ -201718,7 +203487,9 @@ function shouldWriteAutosaveSnapshot(input) {
|
|
|
201718
203487
|
if (input.sources.length === 0 || previous.sources.length !== input.sources.length) {
|
|
201719
203488
|
return true;
|
|
201720
203489
|
}
|
|
201721
|
-
return input.sources.some(
|
|
203490
|
+
return input.sources.some(
|
|
203491
|
+
(source, index) => !Object.is(sourceIdentity(source), previous.sources[index])
|
|
203492
|
+
);
|
|
201722
203493
|
}
|
|
201723
203494
|
function resolveAutosaveActivation(input) {
|
|
201724
203495
|
if (input.hostAutosave === false) {
|
|
@@ -201853,8 +203624,8 @@ async function listBackstageRecentFiles(translate, limit) {
|
|
|
201853
203624
|
return [];
|
|
201854
203625
|
}
|
|
201855
203626
|
try {
|
|
201856
|
-
const
|
|
201857
|
-
const sorted =
|
|
203627
|
+
const snapshots2 = await listAutosaveSnapshots();
|
|
203628
|
+
const sorted = snapshots2.map((snapshot) => ({ ...snapshot, ...splitFilePath(snapshot.key, translate) })).sort((a, b) => b.timestamp - a.timestamp);
|
|
201858
203629
|
return limit === void 0 ? sorted : sorted.slice(0, Math.max(0, limit));
|
|
201859
203630
|
} catch {
|
|
201860
203631
|
return [];
|
|
@@ -202727,15 +204498,15 @@ function resolveProfileInitial(profile) {
|
|
|
202727
204498
|
return trimmed ? trimmed.slice(0, 1).toUpperCase() : "?";
|
|
202728
204499
|
}
|
|
202729
204500
|
async function getLocalStorageUsageSummary() {
|
|
202730
|
-
const
|
|
204501
|
+
const snapshots2 = await listAutosaveSnapshots();
|
|
202731
204502
|
return {
|
|
202732
|
-
presentationCount:
|
|
202733
|
-
totalBytes:
|
|
204503
|
+
presentationCount: snapshots2.length,
|
|
204504
|
+
totalBytes: snapshots2.reduce((sum, snapshot) => sum + snapshot.size, 0)
|
|
202734
204505
|
};
|
|
202735
204506
|
}
|
|
202736
204507
|
async function clearAllLocalViewerData() {
|
|
202737
|
-
const
|
|
202738
|
-
await Promise.all(
|
|
204508
|
+
const snapshots2 = await listAutosaveSnapshots();
|
|
204509
|
+
await Promise.all(snapshots2.map((snapshot) => deleteAutosaveSnapshot(snapshot.key)));
|
|
202739
204510
|
clearStoredViewerPrefs();
|
|
202740
204511
|
}
|
|
202741
204512
|
function saveViewerProfile(profile) {
|
|
@@ -203254,13 +205025,13 @@ function shouldDiscardAutosaveOnSuccessfulSave(options) {
|
|
|
203254
205025
|
function shouldClearAutosaveCacheOnClose(options) {
|
|
203255
205026
|
return options.save.clearCacheOnClose;
|
|
203256
205027
|
}
|
|
203257
|
-
function resolveExpiredAutosaveSnapshots(
|
|
205028
|
+
function resolveExpiredAutosaveSnapshots(snapshots2, options, now = Date.now()) {
|
|
203258
205029
|
const days = options.save.cacheRetentionDays;
|
|
203259
205030
|
if (!Number.isFinite(days) || days <= 0) {
|
|
203260
205031
|
return [];
|
|
203261
205032
|
}
|
|
203262
205033
|
const maxAgeMs = days * 24 * 60 * 60 * 1e3;
|
|
203263
|
-
return
|
|
205034
|
+
return snapshots2.filter((snapshot) => now - snapshot.timestamp > maxAgeMs).map((s) => s.key);
|
|
203264
205035
|
}
|
|
203265
205036
|
function playFeedbackSound(options) {
|
|
203266
205037
|
if (!options.accessibility.feedbackWithSound || typeof window === "undefined") {
|
|
@@ -205374,22 +207145,6 @@ function calculateViewportFit(input, defaults = DEFAULTS2) {
|
|
|
205374
207145
|
availableHeight
|
|
205375
207146
|
};
|
|
205376
207147
|
}
|
|
205377
|
-
function inlineListBodyText(segments) {
|
|
205378
|
-
let first = true;
|
|
205379
|
-
let text22 = "";
|
|
205380
|
-
for (const segment of segments ?? []) {
|
|
205381
|
-
if (isParagraphSeparatorSegment(segment)) {
|
|
205382
|
-
text22 += "\n";
|
|
205383
|
-
first = true;
|
|
205384
|
-
} else {
|
|
205385
|
-
if (!first || !isBulletMarkerSegment(segment)) {
|
|
205386
|
-
text22 += segment.isLineBreak ? "\n" : segment.text;
|
|
205387
|
-
}
|
|
205388
|
-
first = false;
|
|
205389
|
-
}
|
|
205390
|
-
}
|
|
205391
|
-
return text22;
|
|
205392
|
-
}
|
|
205393
207148
|
function readListActivationSelection(root, body) {
|
|
205394
207149
|
if (readEditableText(root) !== body) {
|
|
205395
207150
|
return void 0;
|
|
@@ -208043,4 +209798,4 @@ async function rasterResultToPngBlob(result) {
|
|
|
208043
209798
|
* `<p:extLst>` (optional)
|
|
208044
209799
|
*/
|
|
208045
209800
|
|
|
208046
|
-
export { ACTION_BUTTON_PRESETS, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, ARTISTIC_EFFECTS, AVATAR_COLOR_SWATCHES, BACKSTAGE_NAV, BACKSTAGE_TEMPLATES, BAR3D_SHAPE_OPTIONS, BEVEL_PRESETS, BROADCAST_THROTTLE_MS, CATEGORIES, CHARACTER_SPACING_OPTIONS, CHART_QUICK_ACTION_BUTTON_SIZE, CHART_TYPE_OPTIONS, CINEMATIC_TRANSITION_KEYFRAMES, COLOR_MAP_ALIAS_KEYS, COMMENT_MARKER_SIZE, COMMENT_MENTION_ATTRIBUTE, COMMENT_MENTION_CLASS, COMMON_FONTS, COMMON_FONT_SIZES, COMPOUND_LINE_OPTIONS, CONNECTION_TIMEOUT_MS, CONNECTOR_SITE_SNAP_PX, CUSTOM_FONT_ACCEPT, DEBOUNCE_MS, DEFAULT_BROADCAST_SERVER_URL, DEFAULT_COLOR_CHANGE_TOLERANCE, DEFAULT_COLOR_MAP, DEFAULT_FONT_FAMILY2 as DEFAULT_FONT_FAMILY, DEFAULT_INSERT_CHART_KIND, DEFAULT_MORPH_DURATION_MS, DEFAULT_MOTION_PATH_PRESET_ID, DEFAULT_PALETTE2, DEFAULT_QUICK_ACCESS_COMMAND_IDS, DEFAULT_ROW_HEIGHT, DEFAULT_TRANSITION_DURATION_MS, DEFAULT_VIEWER_OPTIONS, DEFAULT_VIEWER_PREFERENCES, DEFAULT_VIEWER_PROFILE, DEFAULT_VIRTUAL_OVERSCAN, DIRECTIONAL_PRESETS, DUOTONE_PRESETS, EASE, EFFECT_SOUND_CATALOGUE, ELEMENT_ACTION_TYPE_OPTIONS, EMPHASIS_PRESET_VALUES, ENTRANCE_PRESET_VALUES, EQUATION_TEMPLATES, EXIT_PRESET_VALUES, EXPANDED_MAX_HEIGHT, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, EncryptedFileError, FILL_MODE_OPTIONS, FILL_PATTERN_LABEL_KEYS, GIF_POST_CAPTURE_MAX_SIDE, GRADIENT_TYPE_OPTIONS, GlyphOutlineFontCache, HANDOUT_OPTIONS, HIDDEN_SLIDE_LABEL_KEY, HIDDEN_SLIDE_SLASH_GRADIENT, HIGHLIGHTER_COLORS, INDENT_PX, INK_REPLAY_KEYFRAMES, INSERT_CHART_TYPES, INSTANT, LBL, LINE_CAP_OPTIONS, LINE_JOIN_OPTIONS, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_HINT_CLASS, LINK_TOOLTIP_HOST_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_PANEL_CLASS, LOCAL_SYNC_ORIGIN, MATERIAL_PRESETS, MAX_INDENT_LEVEL, MAX_ZOOM_SCALE, MEDIA_CHROME_ATTRIBUTE, MIN_TOUCH_TARGET_PX, MIN_ZOOM_SCALE, MOBILE_BREAKPOINT, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, MOTION_PATH_FAMILIES, NOTES_FONT_SIZE_DEFAULT, NOTES_FONT_SIZE_MAX, NOTES_FONT_SIZE_MIN, NOTES_FONT_SIZE_STEP, NUM, OFFICE_COLOR_SWATCHES, OUTLINE_LEVEL_ATTR, OUTLINE_ROW_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_VIEW_ATTR, P14_TRANSITION_KEYFRAMES, P14_TRANSITION_KEYFRAMES_2, P14_TRANSITION_KEYFRAMES_ALL, PATTERN_OPTIONS, PATTERN_PRESET_OPTIONS, PDF_SLIDES_PAGE_HEIGHT_PT, PDF_SLIDES_PAGE_WIDTH_PT, PEN_COLORS, PPTX_OPEN_ACCEPT, PRESENTATION_CHANNEL_NAME, PRESENTATION_HASH, PRESENTATION_HIT_TEST_CSS, PRESENTATION_MESSAGE_ORIGIN, PRESENTATION_NONCE_KEY, PRESENTATION_OPEN_EXTENSIONS, PRESENTATION_STAGE_ATTRIBUTE, PRESENTER_CONSOLE_CLASSES, PRESENTER_CONSOLE_CONTROLS, PRESENTER_NAVIGATOR_LABEL_KEYS, PRESENT_TOOLBAR_CLASSES, PRESETS, PRESET_THEMES, PptxHandler, PptxMarkdownConverter, PresentationAnimationController, QUICK_ACCESS_COMMAND_CATALOG, RADAR_STYLE_OPTIONS, RANDOM_ELIGIBLE_TYPES, READING_VIEW_ATTR, READING_VIEW_COUNTER_ATTR, READING_VIEW_STAGE_ATTR, RIBBON_SHAPE_SWATCHES, RIBBON_TRANSITION_PRESETS, RULER_FONT_SIZE, RULER_THICKNESS, SECTION_HEADING, SEL, SHAPE_PRESET_DEFS, SHAPE_QUICK_STYLES, SHORTCUT_REFERENCE_ITEMS, SLIDE_SHOW_OPTIONS, SLIDE_SIZE_PRESETS, SLIDE_TEMPLATES, SLIDE_TRANSITION_KEYFRAMES, SLIDE_TRANSITION_KEYFRAMES_CSS, SLIDE_TRANSITION_OPTIONS, SLIDE_VIRTUALIZATION_THRESHOLD, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_PREVIEW_ELEMENT_HEIGHT, SMARTART_PREVIEW_ELEMENT_WIDTH, SMARTART_STYLE_LABEL_KEYS, SORTER_MAX_ZOOM, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, STATUS_BAR_CLASSES, STROKE_DASH_OPTIONS2 as STROKE_DASH_OPTIONS, SURFACE_WIREFRAME_OPTIONS, SWITCHABLE_LAYOUT_TYPES, SvgExporter, TABLET_BREAKPOINT, TABLE_STYLE_BORDER_SIDES, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, TABLE_STYLE_EDITOR_PARTS, TABLE_STYLE_PRESETS, TAB_ROW_ACTION_CLASSES, TEXT_BUILD_ID_SEP, TEXT_DECORATION_FLAGS, TEXT_WARP_PRESETS, THEME_CATALOG, THEME_COLOR_SCHEME_KEYS, THEME_COLOR_SLOT_LABEL_KEYS, THEME_PRESETS, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, TOOLBAR_TABS, TRANSITION_DIR_ARROWS, TRANSITION_MORPH_OPTIONS, TRANSITION_ORIENTATION_TYPES, TRANSITION_SOUND_NONE_VALUE, TRANSITION_SOUND_OTHER_VALUE, TRANSITION_SPEED_DURATION_MS, TRANSITION_SPEED_OPTIONS, TRANSITION_VALID_DIRECTIONS, ThemePresets, VIEWER_OPTIONS_TABS, VIEWER_PREFS_STORAGE_KEY, VIEWER_SHORTCUT_REFERENCE, WEBM_MIME_CANDIDATES, WHEEL_SPOKE_COUNTS, acceptAutosaveRecovery, acceptsPresentationInput, actionAffordanceLabels, activateModalFocus, addChartCategory, addChartSeries, addCommentToList, addQuickAccessCommand, addSection, addSiblingAfter, addSmartArtNodeAsChild, addTableStyleToMap, addTagToCollections, advanceChartMarkDrag, advanceChartValueDrag, advanceMainSequence, alignElements, animationEffectLabel, annotationOverlayZIndex, appendPresentationInkPoint, appendTableElementColumn, appendTableElementRow, apply3dEffects, applyAcceptAllSlides, applyAcceptSlide, applyActiveInlineListFormatting, applyAnimationTimelineOrder, applyAutoCorrect, applyCaseTransformToSegments, applyChartElementToggle, applyChartPartHighlight, applyChartStylePreset, applyColorChange, applyDuotone, applyFindReplacements, applyFormatToElement, applyHighlightClickStyle, applyImagePathPatches, applyListStyleUpdate, applyMasterViewCrudAction, applyMotionPathPreset, applyOleDocumentParagraphEdit, applyOleNestedDeckElementTextEdit, applyOleSheetCellEdit, applyOutlineEdit, applyPreferenceToOptions, applyReadingViewCommand, applyRehearsalTimings, applyReroutedConnectors, applyResize, applyTableStyleDelete, applyTableStyleFieldEdit, applyTableStyleMapChange, applyTableStylePreset, applyTextStyleUpdate, applyThemeOverrideToSlide, applyThemeToData, applyTransitionSoundFile, applyTransitionStockSound, applyUnderlineVariant, assertElementUpdateTarget, attachEditorImagePaste, attachInlineListController, attachPresentationVisibilityPause, attachRotateHandlePlacement, authorConnectorBetweenSites, autosaveSnapshotMark, availableQuickAccessCommands, backstageCardsFor, bar3DShapePatch, beginChartMarkDrag, beginChartValueDrag, beginShapeAdjustment, bindInlineListParagraph, bindInlineListRun, borrowExternalCollaborationAwareness, bringForward, bringToFront, build3DExtrusionData, buildActiveSessionUsers, buildAnimationTimelineBars, buildAnimationTimelineRows, buildAreaChart3DDataForElement, buildBarActions, buildBarChart3DDataForElement, buildBroadcastViewerUrl, buildCacheKey, buildCalloutLeaderLineSvgPath, buildChartMarkDragGeometry, buildChartQuickActionsDescriptor, buildChartViewModel, buildChromeStyle, buildCollaborationShareUrl, buildCommentMarkers, buildContentPartStrokes, buildContextMenuEntries, buildCreateCollaborationConfig, buildCssGradientFromShapeStyle, buildDeckSaveOptions, buildDirectionGrid, buildDuotoneCacheKey, buildElementClipboardPayload, buildFieldSubstitutionContext, buildFontCatalog, buildFreeformShapeElement, buildGlyphEnvelope, buildHandoutsHtml, buildHollowHitOutline, buildInitialGuides, buildInkGroupStrokes, buildInlineListStylePatch, buildInlineTextCommitPatch, buildJoinCollaborationConfig, buildLayoutPreviewGeometry, buildLineChart3DDataForElement, buildLiveInkStrokeView, buildMorphAnimationRules, buildMorphTransitionPlan, buildMotionPathPreview, buildNotesHtml, buildNotesPdfBytes, buildNotesPrintHtml, buildOleContentUpdatePatch, buildOleEditDialogDescriptor, buildOleObjectNamePatch, buildOutline, buildOutlineHtml, buildParagraphs, buildPieChart3DDataForElement, buildPresentationAudienceUrl, buildPreviewAnimation, buildPreviewElements, buildPrintDocument, buildPrintHtmlDocument, buildRectPathGradient, buildRunProgramNotice, buildRunTabLines, buildSaveSlides, buildSlideTemplateContent, buildSlideTemplateSlide, buildSlidesHtml, buildSmartArt3DModel, buildSmartArtA11y, buildSmartArtPresetData, buildSmartArtPreviewElement, buildStrokeOutline, buildStrokePathD, buildSubpathFillOverlay, buildSubpathPaints, buildSummaryZoomView, buildSurfaceChart3DDataForElement, buildSvgGradientDef, buildTabContext, buildTableDataGrid, buildTextBlockStyle, buildTextBody3DSceneStyle, buildTextBodyLayoutStyle, buildTextBuildSpec, buildTextStyleOverrideCss, buildThemeColorGrid, buildThemeColorMap, buildThemeColorSwatchGrid, buildTiledSlidesPdfBytes, buildUserFontFaceStyles, calculateViewportFit, canAddTopLevelNode, canCommitActionType, canDrillDown, canGoNext, canGoPrevious, canGroupSelection, canInteractWithElement, canRemoveTopLevelNode, canSetStrokeWidth, canUngroupSelection, canUseClipboard, cancelBuildReveal, canvasToJpegData, cellRunStyle, cellStyleToCss, centeredSvgTextLines, chartGridlinesPatch, chartGridlinesState, chartPartToAttrs, chartPreserveAspectRatio, checkModifyPassword, clampCropValue, clampGifDimensions, clampNotesFontSize, clampOptionNumber, clampPercent2, clampSorterZoom, clampTransitionNumber, clampZoomScale, classifyExtraConnections, classifyMediaType, clearAllLocalViewerData, clearAudienceContent, clearLocalAwareness, clearMotionPath, clearPlaybackTimers, clearStoredViewerPrefs, clearTransitionSound, cloneElementForPaste, cloneElementUpdates, cloneHistorySnapshot, cloneSlide, cloneTemplateElementsBySlideId, collapseChartTitleRunsForEdit, collectCoherent3DOffNodeIds, collectConnectorSiteCandidates, collectImagePaths, collectMediaElements, collectReferencedFontFamilies, collectUsedFonts, colorWithOpacity, commentMentionQuery, commentTextSegments, comparePresentation, compatToastStackStyle, compatibilityWarningToasts, compileEquationTemplateMathMl, compileLatexEquation, computeAllNotesPages, computeAnchoredPopupPosition, computeChartLegendLayout, computeColorFilter, computeColumnBoundaries, computeDrawingViewBox, computeEntranceAnimationDelay, computeGridSpacingPx, computeHandoutLayout, computeInlineEditorRect, computeKeyboardInset, computeMarqueeHitIds, computeMergeCellDown, computeMergeCellRight, computeResizedColumnWidths, computeResizedRowHeight, computeScrollDelta, computeSelectionRect, computeSlideIndices, computeSmartArtElementLayout, computeSnapToShape, computeSplitCell, computeVirtualRange, connectorWrapperTransform, convertLatexToOmml, convertOmmlToLatex, convertOmmlToMathMl, copyFormatFromElement, createActiveAnimationGroup, createBackstagePresentation, createBlankSlide, createCollaborationLivePatcher, createDefaultChartElement, createDefaultChartUserShape, createDefaultChartUserShapeGroupChild, createDepartureChannel, createGlyphOutlineLookup, createImageElementFromFile, createInitialPresentationSnapshot, createInlineListModelObserver, createInlineListSeed, createPlainNotesSegments, createPresenceProjector, createPresentationKeyBuffer, createPresentationLoadResources, createPresentationSessionId, createPresenterShowGuard, createPresenterTimer, createRotationDrag, createSyncGate, createTableStyleEntry, createTouchGestureRecognizer, createViewerOptionsStore, createViewerZoomStore, createWheelStepBuffer, createWriteBackScheduler, cursorForTool, customGeometryPathsToSvgSubpaths, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, deleteSection, deleteTableStyleFromMap, deleteTagFromCollections, demote, deriveSlideFieldContext, deriveViewportBreakpoints, describeFontEmbedding, describeSmartArtBounds, describeTableStyleEditor, detectOrientation, detectTouchDevice, discardAutosaveRecovery, distributeElements, downloadBlob, downloadDataUrl, editCommentInList, elementActionToPptxAction, elementBulletKind, elementHitTargetStyle, elementIdSelector, elementLockTogglePatch, encodeGif, endAudienceDisplay, ensureActionAffordanceStyles, ensureChartInteractionStyles, erasePresentationInkAt, evenColumnWidths, evenRowHeights, exportDeckJson, extraQuickAccessCommands, fetchGoogleWebfontOutlineBytes, filterCommands, filterHiddenSlideIndices, filterInteractableIds, filterRenderedElements, findChartPartTarget, findConnectorSiteNear, findEraserHitElementId, findInSlides, findSelectedThemeSwatch, findSmartArtNodeText, finishPrintWindow, firstShowSlideIndex, flattenNodes, flattenTagCollections, forgetSessionDeck, formatAxisValue, formatBackstageDate, formatBackstageSize, formatBytes, formatCommentTimestamp, formatElapsed, formatMobileElapsed, formatRelativeTime, formatSlideCounter, formatTime, formatVersionTimestamp, fpsToFrameIntervalMs, generateBroadcastRoomId, generateElementId, generateNoteLineCount, generateTicks, getActiveXControlOverlayView, getAnimationColorBaseStyle, getAnimationInitialStyle, getAriaLabel, getAriaRole, getAriaRoleDescription, getBarFacePicturePixelSampleVersion, getBevelLightingSvgFilter, getCachedResult, getCalloutLeaderLineGeometry, getCalloutViewBoxBounds, getCellDiagonalBorders, getChartStylePalette, getChartUserShapeGroupTransform, getChartUserShapeRowChartBox, getCinematicTransitionAnimations, getCompoundLineOffsets, getCompoundLineWidths, getComputedEffectStyle, getComputedFillStyle, getComputedStrokeStyle, getConnectorEndpointHandles, getConnectorPathGeometry, getContentPartReplayStyles, getCropShapeClipPath, getCurrentParagraphIndex, getDenseGridLayoutPlan, getDensePanelTouchTargetPx, getDraggedShapeAdjustments, getDuotoneCachedResult, getEffectSoundAsset, getEffectSoundState, getEffectStyleSource, getElementLabel, getElementTransform, getElementTransformWithoutRotation, getFragmentedTransitionDescriptor, getGroupChildParentFill, getImageColorWashStyle, getImageEffectsFilter, getImageEffectsOpacity, getImageFillCounterTransform, getImageFitStyle, getImageSvgFilters, getImageTilingStyle, getInkReplayStyles, getInlineEditorSelectionResult, getLocalStorageUsageSummary, getNonVisualDescriptionFields, getNotesPrintableArea, getOleAriaLabel, getOleBadgeLabel, getOleDisplayName, getOleDocumentParagraphs, getOleNestedDeckDetail, getOleObjectTypeLabel, getOleSheetGrid, getOleTypeColor, getOleTypeLabel, getOverflowSegments, getP14TransitionAnimations, getPatternSvg, getPendingSelectionRestore, getPresetShapeClipPath, getPresetShapeVectorGeometry, getPrintableArea, getResizeHandleHitAreaStyle, getSelectionControlArtworkStyle, getSelectionOutlineColor, getSelectionTextStyleFlags, getSessionTabId, getShapeAdjustmentHandleDescriptors, getShapeConnectionSites, getSlideBackgroundStyle, getSlideTransitionAnimations, getSoftEdgeSvgFilter, getSubstituteFontFamily, getSvgStrokeDasharray, getTableCellBandStyle, getTextBodyRotationTransform, getTextCompensationTransform, getWarpPath, groupElements, groupIntoParagraphs, groupSlidesBySection, guidePxToEmu, handleReadingViewKey, hasCopyableFormat, hasDistinctScriptFonts, hasGlyphEnvelope, hasMultipleSelectedTableCells, hasShapeProperties, hasShowSlideAfter, hasTextProperties, hasTiltData, hexToRgbUnit, hiddenSlideCue, hideChartSeries, hollowTextFillStyle, inlineElementPointerEvents, inlineListBodyText, insertCommentMention, insertTableElementColumn, insertTableElementRow, isActionHidden, isBlackboardActive, isBrowserOpenableMime, isBulletMarkerSegment, isCalloutShape, isCellInRect, isCurrentLayout, isEditableMotionPath, isEditableTextElement, isEditorTextInputTarget, isElementActionable, isElementLocked, isElementRendered, isExportAbortError, isHeaderFooterDateTextVisible, isHeaderFooterFooterTextVisible, isHeaderFooterHeaderTextVisible, isHollowShapeElement, isImageLikeElement, isImageTiled, isInkElement, isKeyboardOpen, isLegacyBinaryPresentation, isLinkedTextBox, isMixedContentBlocked, isMobileViewport, isPpactionUrl, isPresentationAdvanceClick, isPresentationSessionMessage, isSeriesUsingSecondaryAxis, isStrokeOnlyPresetElement, isSupportedPresentationFile, isTemplateElementId3 as isTemplateElementId, isUrlSafe, isWedgeCalloutPresetShape, lastShowSlideIndex, listAutosaveSnapshots, listBackstageRecentFiles, listChartUserShapeRows, loadAudienceContent, loadSessionDeck, lockResizeAspect, makeCloneId, makeSlideId, mapEditingWheel, mapEditorKey, mapOutlineKey, mapPresentationKey, mapPresentationWheel, mapSlideShowStartKey, mapSlideSorterKey, masterViewBackgroundColor, masterViewCrudActions, masterViewCrudFailureKey, masterViewElements, masterViewPseudoSlide, matchCommentMentionAuthors, mayLeaveSlideShow, measureSvgViewportRect, mediaFallbackIcon, mediaFallbackLabelKey, mediaFallbackVisual, mediaPlaybackAttributes, mediaTransportVisible, mediaTrimEndAbsoluteMs, mediaTrimEndMsFromAbsoluteMs, mediaTrimEndMsFromSeconds, mediaTrimEndSeconds, mergeAdditiveSelection, mergeCells, mergePresentationSnapshot, mergeShapes, mergeSlideTransition, mobileElapsedSince, mobileSlideCounter, modelDataToBlobUrl, morphOptionToMode, motionPathEndPixel, motionPathFamilyLabelKey, motionPathFor, motionPathPresetIdForPath, motionPathPresetLabelKey, motionPathPresetsByFamily, motionPathToSvgD, mountAreaChart3D, mountBarChart3D, mountLineChart3D, mountModel3D, mountPieChart3D, mountSurfaceChart3D, movePresenterPointer, moveQuickAccessCommand, moveSectionDown, moveSectionUp, moveSlidesToSection, mruColorsPatch, nestedTextDecorationStyle, newTableElement, nextPresentedSlide, nextShowSlideIndex, nextToggleValue, normalizeColorsForCapture, normalizeHexColor2 as normalizeHexColor, normalizeStrokeDashType, normalizeTableStyleGuid, notesSegmentsToSpans, observeExternalCollaborationReadiness, observeExternalCollaborationSession, observeYDocSlides, ooxmlGradientAngleToCssDegrees, openNativeEyeDropper, openPendingPrintWindow, openPptxFile, openReadingView, openUrlInNewTab, overlayInlineTextSnapshot, overlayMasterViewInlineSnapshot, paintedElementSize, paintedStrokeWidth, paragraphsToSegments, parseDrawingColor, parseDrawingColorOpacity, parsePanoseString, parsePpactionUrl, parseSegmentsFromRichEditor, partitionTemplateElements, patchChartData, pickSupportedMimeType, pieceLetterSpacing, placeAudienceWindow, placeCaretAtEnd, placeTileOnPage, placeholderPromptDescriptor, playFeedbackSound, playGroup, playSlideTransitionPreview, polygonsToSvgPath, pptxActionToElementAction, prepareElementForInsertion, prepareElementUpdateBatch, prepareExportClone, preprocessCssForCapture, presentationBaseName, presentationEntrySlideIndex, presentationInkPath, presenterElapsed, presenterNextDisabled, presenterPaneAdvancesOnClick, presenterPrevDisabled, presenterTimerProgress, previousShowSlideIndex, printPropertiesFrameSlides, printPropertiesSlidesPerPage, probeAutosaveRecovery, projectDrawingShapes, promote, publishLiveGeometry, publishLiveInlineText, pushRecentColor, quickStyleSwatchCss, radarStylePatch, rasterResultToPngBlob, rasterizeElement, rasterizeElementTiledToCanvas, rasterizeElementTiles, reResolveElementColors, reResolveSlideColors, readBackstageRecentFile, readEditableText, readListActivationSelection, readOnlyRecommendation, readRibbonTransitionDraft, readSlideShowOption, readSlidesFromYDoc, readSoundFileAsDataUrl, readStoredViewerPrefs, readViewportMetrics, readingViewFitScale, rebuildDrawingShapesIfCleared, reconcileSlidesInYDoc, recordProgressPercent, rectToCells, redistributeColumnWidth, registerCollaborationTeardown, registerCrossSlideAudio, registerCustomFont, remapTextToSegments, rememberSessionDeck, removeChartCategory, removeChartSeries, removeCommentFromList, removeEmptyNode, removeLastTableElementColumn, removeLastTableElementRow, removeQuickAccessCommand, removeSmartArtNode, removeTableElementColumn, removeTableElementRow, renameSection, reorder2 as reorder, reorderAnimationTimelineRows, replaceMasterViewElements, replaceOleFile, replyToCommentInList, rerouteConnectorsForMovedElements, resetPresenterTimer, resetSlideLayoutPath, resolve3DRenderingFlags, resolveActionType, resolveAudienceScreenPlacement, resolveAuthoredCustomShowId, resolveAuthoredSlideRange, resolveAutoAdvanceDelayMs, resolveAutoFitFontScale, resolveAutosaveActivation, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, resolveChartKind, resolveConnectorEndpointUpdate, resolveDefaultFontFamily, resolveDefaultPrintSettings, resolveDirection, resolveDirection8, resolveDisplayedChartType, resolveElementActionAffordance, resolveElementAriaAttributes, resolveElementHighlightClick, resolveElementInteractivity, resolveExpiredAutosaveSnapshots, resolveExportCaptureDecision, resolveFontKerning, resolveGoogleWebfontHref, resolveGroupChildFill, resolveHistoryDepth, resolveImageResolutionScale, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, resolveMediaElementSource, resolveMediaTimeNodeElementIds, resolveMetricTrackingPx, resolveNotesSchematicBodyFontSizePx, resolveNotesSegments, resolveOleType, resolveOleVerbTarget, resolveOptionRootClasses, resolveOrientation, resolvePalette, resolvePresentationAction, resolveProfileInitial, resolveRevealedChartData, resolveRevealedDrawingShapeNodeIds, resolveRevealedDrawingShapes, resolveRevealedSmartArtNodes, resolveScreenTip, resolveScriptFontSet, resolveSelectionPaneRename, resolveShapeGeometry, resolveShowSlideIndexes, resolveSlideSizeSelection, resolveSlideTransition, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTemplateBackgroundRows, resolveThemeCatalogEntry, resolveTitleBarStatusKey, resolveTransitionDurationMs, resolveTransitionSoundAction, resolveTransportForServerUrl, resolveViewerAddinRows, resolveViewportFitOptions, resolveWheelSpokeCount, restoreFilteredSeries, restoreInlineListBodySelection, restoreSegmentSelection, restoreSessionDeck, ribbonTransitionUpdates, rulerDragToGuidePosition, runPresentationAction, runProgramNoticeStackStyle, safeOpenUrl, sanitizeColor, sanitizeGradientStops, sanitizeMathMl, saveAutosaveSnapshot, saveDeckWithPassword, saveViewerProfile, savedPresentationFileName, scaleSlidesForSizeChange, scanAvailableFontFamilies, scheduleAutoAdvanceChain, scheduleMediaTrimAndFade, schemaLabel, scopeLayoutOptionsToSlide, seedRecentColors, segmentFrameCount, segmentStyleToCss, segmentsToEditorHtml, segmentsToParagraphs, segmentsToPlainText, selectGoogleWebfontFamilies, selectedParagraphBulletKind, selectionBulletKind, sendBackward, sendToBack, seriesSecondaryAxisPatch, setAfterAnimation, setAfterAnimationColor, setCachedResult, setCellText, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategoryLabel, setChartCellValue, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartSeriesChartType, setChartSeriesMarker, setDataLabelsRangeCache, setDuotoneCachedResult, setEffectSound, setEffectStockSound, setMasterViewBackgroundColor, setMotionPath, setMotionPathEnd, setPendingSelectionRestore, setSmartArtNodeStyle, setTableElementCellText, shapeFillChange, shapeOutlineChange, shouldAutoFollowBroadcaster, shouldClearAutosaveCacheOnClose, shouldCommitSmartArtNodeText, shouldConfirmExternalHyperlink, shouldDiscardAutosaveOnSuccessfulSave, shouldLoopContinuously, shouldProbeAutosaveRecovery, shouldRenderHitTarget, shouldRoomSlidesReplaceLoad, shouldShowAccessibilitySection, shouldShowAutosaveRecoveryPrompt, shouldShowElementHandles, shouldStickyActionRow, shouldUseSvgWarp, shouldWriteAutosaveSnapshot, siblingCount, siblingIndex, slideProgressPercent, slideShowOptionChange, slideSizeFromPreset, slideSizeToCanvasPx, slideStatusLabel, snapBoxToGrid, splitCell, splitRunByScriptFont, splitRunForMetrics, splitWordsForUnderline, stepPresenterZoom, stopAllPersistentAudio, stopCaptureStream, storeAudienceContent, stripUnderlineDecoration, strokeOutlineViewBox, strokeWidthOf, styleShadowFilter, subscribeBarFacePicturePixelSamples, substituteFieldText, surfaceWireframePatch, svgGradientFillRef, svgLineCap, svgPathToPolygons, swapPresentationWindows, switchSmartArtLayout, syncGoogleWebfontStylesheet, tableCellCss, tableContainerCss, tableStyleAssignmentUpdate, templateSchemeFromTheme, text3dEmuToPt, text3dPtToEmu, textBuildSpanStyle, textFontSizePtToPx, textFontSizePxToPt, themeColorLabel, themeColorSchemesEqual, themeColorSwatchRows, themeSwatchCommit, themeToCssVars, toCssTextOrientation, toCssVerticalDirection, toCssWritingMode, toSlideIndex, toggleBlackboard, toggleCommentResolvedInList, togglePresenterTimer, toggleSelectionBullets, toggleSheet, toggleStageElementMedia, toggleText3dExtrusion, transformInlineListCase, transformTextCase, transitionSoundOptions, transitionSoundSelectedValue, transitionStockSoundId, trimmedMediaDurationMs, ungroupElements, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateElement, updateMasterViewElement, updateMergeAttrsInRawXml, updateSmartArtNodeText, updateTagInCollections, validateMediaTrimRange, validateRoomId, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, viewPropertiesPatchFromPreferences, viewerOptionsToPreferences, viewerPreferencesFromViewProperties, visibleTemplateElements, warpPreviewPath, withChartPointValue, withChartTitle, withChartUserShapeAdded, withChartUserShapeGroupChildAdded, withChartUserShapeRowChartBoxUpdated, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRemoved, withChartUserShapeRowRotationUpdated, withChartUserShapeRowTextUpdated, withChartUserShapeRowUpdated, withConnectorEndpointUpdate, withFrameSlides, withInlineListDecorationDefaults, withSlideSizeOrientation, withSlidesPerPage, writeStoredViewerPrefs, xmlText };
|
|
209801
|
+
export { ACTION_BUTTON_PRESETS, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, ARTISTIC_EFFECTS, AVATAR_COLOR_SWATCHES, BACKSTAGE_NAV, BACKSTAGE_TEMPLATES, BAR3D_SHAPE_OPTIONS, BEVEL_PRESETS, BROADCAST_THROTTLE_MS, CATEGORIES, CHARACTER_SPACING_OPTIONS, CHART_QUICK_ACTION_BUTTON_SIZE, CHART_TYPE_OPTIONS, CINEMATIC_TRANSITION_KEYFRAMES, COLOR_MAP_ALIAS_KEYS, COMMENT_MARKER_SIZE, COMMENT_MENTION_ATTRIBUTE, COMMENT_MENTION_CLASS, COMMON_FONTS, COMMON_FONT_SIZES, COMPOUND_LINE_OPTIONS, CONNECTION_TIMEOUT_MS, CONNECTOR_SITE_SNAP_PX, CUSTOM_FONT_ACCEPT, DEBOUNCE_MS, DEFAULT_BROADCAST_SERVER_URL, DEFAULT_COLOR_CHANGE_TOLERANCE, DEFAULT_COLOR_MAP, DEFAULT_FONT_FAMILY2 as DEFAULT_FONT_FAMILY, DEFAULT_INSERT_CHART_KIND, DEFAULT_MORPH_DURATION_MS, DEFAULT_MOTION_PATH_PRESET_ID, DEFAULT_PALETTE2, DEFAULT_QUICK_ACCESS_COMMAND_IDS, DEFAULT_ROW_HEIGHT, DEFAULT_TRANSITION_DURATION_MS, DEFAULT_VIEWER_OPTIONS, DEFAULT_VIEWER_PREFERENCES, DEFAULT_VIEWER_PROFILE, DEFAULT_VIRTUAL_OVERSCAN, DIRECTIONAL_PRESETS, DUOTONE_PRESETS, EASE, EFFECT_SOUND_CATALOGUE, ELEMENT_ACTION_TYPE_OPTIONS, EMPHASIS_PRESET_VALUES, ENTRANCE_PRESET_VALUES, EQUATION_TEMPLATES, EXIT_PRESET_VALUES, EXPANDED_MAX_HEIGHT, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, EncryptedFileError, FILL_MODE_OPTIONS, FILL_PATTERN_LABEL_KEYS, GIF_POST_CAPTURE_MAX_SIDE, GRADIENT_TYPE_OPTIONS, GlyphOutlineFontCache, HANDOUT_OPTIONS, HIDDEN_SLIDE_LABEL_KEY, HIDDEN_SLIDE_SLASH_GRADIENT, HIGHLIGHTER_COLORS, INDENT_PX, INK_REPLAY_KEYFRAMES, INSERT_CHART_TYPES, INSTANT, LBL, LINE_CAP_OPTIONS, LINE_JOIN_OPTIONS, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_HINT_CLASS, LINK_TOOLTIP_HOST_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_PANEL_CLASS, LOCAL_SYNC_ORIGIN, MATERIAL_PRESETS, MAX_INDENT_LEVEL, MAX_ZOOM_SCALE, MEDIA_CHROME_ATTRIBUTE, MIN_TOUCH_TARGET_PX, MIN_ZOOM_SCALE, MOBILE_BREAKPOINT, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, MOTION_PATH_FAMILIES, NOTES_FONT_SIZE_DEFAULT, NOTES_FONT_SIZE_MAX, NOTES_FONT_SIZE_MIN, NOTES_FONT_SIZE_STEP, NUM, OFFICE_COLOR_SWATCHES, OUTLINE_LEVEL_ATTR, OUTLINE_ROW_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_VIEW_ATTR, P14_TRANSITION_KEYFRAMES, P14_TRANSITION_KEYFRAMES_2, P14_TRANSITION_KEYFRAMES_ALL, PATTERN_OPTIONS, PATTERN_PRESET_OPTIONS, PDF_SLIDES_PAGE_HEIGHT_PT, PDF_SLIDES_PAGE_WIDTH_PT, PEN_COLORS, PPTX_OPEN_ACCEPT, PRESENTATION_CHANNEL_NAME, PRESENTATION_HASH, PRESENTATION_HIT_TEST_CSS, PRESENTATION_MESSAGE_ORIGIN, PRESENTATION_NONCE_KEY, PRESENTATION_OPEN_EXTENSIONS, PRESENTATION_STAGE_ATTRIBUTE, PRESENTER_CONSOLE_CLASSES, PRESENTER_CONSOLE_CONTROLS, PRESENTER_NAVIGATOR_LABEL_KEYS, PRESENT_TOOLBAR_CLASSES, PRESETS, PRESET_THEMES, PptxHandler, PptxMarkdownConverter, PresentationAnimationController, QUICK_ACCESS_COMMAND_CATALOG, RADAR_STYLE_OPTIONS, RANDOM_ELIGIBLE_TYPES, READING_VIEW_ATTR, READING_VIEW_COUNTER_ATTR, READING_VIEW_STAGE_ATTR, RIBBON_SHAPE_SWATCHES, RIBBON_TRANSITION_PRESETS, RULER_FONT_SIZE, RULER_THICKNESS, SECTION_HEADING, SEL, SHAPE_PRESET_DEFS, SHAPE_QUICK_STYLES, SHORTCUT_REFERENCE_ITEMS, SLIDE_SHOW_OPTIONS, SLIDE_SIZE_PRESETS, SLIDE_TEMPLATES, SLIDE_TRANSITION_KEYFRAMES, SLIDE_TRANSITION_KEYFRAMES_CSS, SLIDE_TRANSITION_OPTIONS, SLIDE_VIRTUALIZATION_THRESHOLD, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_PREVIEW_ELEMENT_HEIGHT, SMARTART_PREVIEW_ELEMENT_WIDTH, SMARTART_STYLE_LABEL_KEYS, SORTER_MAX_ZOOM, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, STATUS_BAR_CLASSES, STROKE_DASH_OPTIONS2 as STROKE_DASH_OPTIONS, SURFACE_WIREFRAME_OPTIONS, SWITCHABLE_LAYOUT_TYPES, SvgExporter, TABLET_BREAKPOINT, TABLE_STYLE_BORDER_SIDES, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, TABLE_STYLE_EDITOR_PARTS, TABLE_STYLE_PRESETS, TAB_ROW_ACTION_CLASSES, TEXT_BUILD_ID_SEP, TEXT_DECORATION_FLAGS, TEXT_WARP_PRESETS, THEME_CATALOG, THEME_COLOR_SCHEME_KEYS, THEME_COLOR_SLOT_LABEL_KEYS, THEME_PRESETS, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, TOOLBAR_TABS, TRANSITION_DIR_ARROWS, TRANSITION_MORPH_OPTIONS, TRANSITION_ORIENTATION_TYPES, TRANSITION_SOUND_NONE_VALUE, TRANSITION_SOUND_OTHER_VALUE, TRANSITION_SPEED_DURATION_MS, TRANSITION_SPEED_OPTIONS, TRANSITION_VALID_DIRECTIONS, ThemePresets, VIEWER_OPTIONS_TABS, VIEWER_PREFS_STORAGE_KEY, VIEWER_SHORTCUT_REFERENCE, WEBM_MIME_CANDIDATES, WHEEL_SPOKE_COUNTS, acceptAutosaveRecovery, acceptsPresentationInput, actionAffordanceLabels, activateModalFocus, addChartCategory, addChartSeries, addCommentToList, addQuickAccessCommand, addSection, addSiblingAfter, addSmartArtNodeAsChild, addTableStyleToMap, addTagToCollections, advanceChartMarkDrag, advanceChartValueDrag, advanceMainSequence, alignElements, animationEffectLabel, annotationOverlayZIndex, appendPresentationInkPoint, appendTableElementColumn, appendTableElementRow, apply3dEffects, applyAcceptAllSlides, applyAcceptSlide, applyActiveInlineListFormatting, applyAnimationTimelineOrder, applyAutoCorrect, applyCaseTransformToSegments, applyChartElementToggle, applyChartPartHighlight, applyChartStylePreset, applyColorChange, applyDuotone, applyFindReplacements, applyFormatToElement, applyHighlightClickStyle, applyImagePathPatches, applyListStyleUpdate, applyMasterViewCrudAction, applyMotionPathPreset, applyOleDocumentParagraphEdit, applyOleNestedDeckElementTextEdit, applyOleSheetCellEdit, applyOutlineEdit, applyPreferenceToOptions, applyReadingViewCommand, applyRehearsalTimings, applyReroutedConnectors, applyResize, applyTableStyleDelete, applyTableStyleFieldEdit, applyTableStyleMapChange, applyTableStylePreset, applyTextStyleUpdate, applyThemeOverrideToSlide, applyThemeToData, applyTransitionSoundFile, applyTransitionStockSound, applyUnderlineVariant, assertElementUpdateTarget, attachCollaborationInlineEditor, attachEditorImagePaste, attachInlineListController, attachPresentationVisibilityPause, attachRotateHandlePlacement, authorConnectorBetweenSites, autosaveSnapshotMark, availableQuickAccessCommands, backstageCardsFor, bar3DShapePatch, beginChartMarkDrag, beginChartValueDrag, beginShapeAdjustment, bindInlineListParagraph, bindInlineListRun, borrowExternalCollaborationAwareness, bringForward, bringToFront, build3DExtrusionData, buildActiveSessionUsers, buildAnimationTimelineBars, buildAnimationTimelineRows, buildAreaChart3DDataForElement, buildBarActions, buildBarChart3DDataForElement, buildBroadcastViewerUrl, buildCacheKey, buildCalloutLeaderLineSvgPath, buildChartMarkDragGeometry, buildChartQuickActionsDescriptor, buildChartViewModel, buildChromeStyle, buildCollaborationShareUrl, buildCommentMarkers, buildContentPartStrokes, buildContextMenuEntries, buildCreateCollaborationConfig, buildCssGradientFromShapeStyle, buildDeckSaveOptions, buildDirectionGrid, buildDuotoneCacheKey, buildElementClipboardPayload, buildFieldSubstitutionContext, buildFontCatalog, buildFreeformShapeElement, buildGlyphEnvelope, buildHandoutsHtml, buildHollowHitOutline, buildInitialGuides, buildInkGroupStrokes, buildInlineListStylePatch, buildInlineTextCommitPatch, buildJoinCollaborationConfig, buildLayoutPreviewGeometry, buildLineChart3DDataForElement, buildLiveInkStrokeView, buildMorphAnimationRules, buildMorphTransitionPlan, buildMotionPathPreview, buildNotesHtml, buildNotesPdfBytes, buildNotesPrintHtml, buildOleContentUpdatePatch, buildOleEditDialogDescriptor, buildOleObjectNamePatch, buildOutline, buildOutlineHtml, buildParagraphs, buildPieChart3DDataForElement, buildPresentationAudienceUrl, buildPreviewAnimation, buildPreviewElements, buildPrintDocument, buildPrintHtmlDocument, buildRectPathGradient, buildRunProgramNotice, buildRunTabLines, buildSaveSlides, buildSlideTemplateContent, buildSlideTemplateSlide, buildSlidesHtml, buildSmartArt3DModel, buildSmartArtA11y, buildSmartArtPresetData, buildSmartArtPreviewElement, buildStrokeOutline, buildStrokePathD, buildSubpathFillOverlay, buildSubpathPaints, buildSummaryZoomView, buildSurfaceChart3DDataForElement, buildSvgGradientDef, buildTabContext, buildTableDataGrid, buildTextBlockStyle, buildTextBody3DSceneStyle, buildTextBodyLayoutStyle, buildTextBuildSpec, buildTextStyleOverrideCss, buildThemeColorGrid, buildThemeColorMap, buildThemeColorSwatchGrid, buildTiledSlidesPdfBytes, buildUserFontFaceStyles, calculateViewportFit, canAddTopLevelNode, canCommitActionType, canDrillDown, canGoNext, canGoPrevious, canGroupSelection, canInteractWithElement, canRemoveTopLevelNode, canSetStrokeWidth, canUngroupSelection, canUseClipboard, cancelBuildReveal, canvasToJpegData, cellRunStyle, cellStyleToCss, centeredSvgTextLines, chartGridlinesPatch, chartGridlinesState, chartPartToAttrs, chartPreserveAspectRatio, checkModifyPassword, clampCropValue, clampGifDimensions, clampNotesFontSize, clampOptionNumber, clampPercent2, clampSorterZoom, clampTransitionNumber, clampZoomScale, classifyExtraConnections, classifyMediaType, clearAllLocalViewerData, clearAudienceContent, clearLocalAwareness, clearMotionPath, clearPlaybackTimers, clearStoredViewerPrefs, clearTransitionSound, cloneElementForPaste, cloneElementUpdates, cloneHistorySnapshot, cloneSlide, cloneTemplateElementsBySlideId, collapseChartTitleRunsForEdit, collectCoherent3DOffNodeIds, collectConnectorSiteCandidates, collectImagePaths, collectMediaElements, collectReferencedFontFamilies, collectUsedFonts, colorWithOpacity, commentMentionQuery, commentTextSegments, comparePresentation, compatToastStackStyle, compatibilityWarningToasts, compileEquationTemplateMathMl, compileLatexEquation, computeAllNotesPages, computeAnchoredPopupPosition, computeChartLegendLayout, computeColorFilter, computeColumnBoundaries, computeDrawingViewBox, computeEntranceAnimationDelay, computeGridSpacingPx, computeHandoutLayout, computeInlineEditorRect, computeKeyboardInset, computeMarqueeHitIds, computeMergeCellDown, computeMergeCellRight, computeResizedColumnWidths, computeResizedRowHeight, computeScrollDelta, computeSelectionRect, computeSlideIndices, computeSmartArtElementLayout, computeSnapToShape, computeSplitCell, computeVirtualRange, connectorWrapperTransform, convertLatexToOmml, convertOmmlToLatex, convertOmmlToMathMl, copyFormatFromElement, createActiveAnimationGroup, createBackstagePresentation, createBlankSlide, createCollaborationLivePatcher, createDefaultChartElement, createDefaultChartUserShape, createDefaultChartUserShapeGroupChild, createDepartureChannel, createGlyphOutlineLookup, createImageElementFromFile, createInitialPresentationSnapshot, createInlineListModelObserver, createInlineListSeed, createPlainNotesSegments, createPresenceProjector, createPresentationKeyBuffer, createPresentationLoadResources, createPresentationSessionId, createPresenterShowGuard, createPresenterTimer, createRotationDrag, createSnapshotTextPositions, createSyncGate, createTableStyleEntry, createTouchGestureRecognizer, createViewerOptionsStore, createViewerZoomStore, createWheelStepBuffer, createWriteBackScheduler, cursorForTool, customGeometryPathsToSvgSubpaths, defaultCssVars, defaultRadius, defaultThemeColors, deleteAutosaveSnapshot, deleteSection, deleteTableStyleFromMap, deleteTagFromCollections, demote, deriveSlideFieldContext, deriveViewportBreakpoints, describeCollaborationShellState, describeFontEmbedding, describeSmartArtBounds, describeTableStyleEditor, detectOrientation, detectTouchDevice, discardAutosaveRecovery, distributeElements, downloadBlob, downloadDataUrl, editCommentInList, elementActionToPptxAction, elementBulletKind, elementHitTargetStyle, elementIdSelector, elementLockTogglePatch, encodeGif, endAudienceDisplay, ensureActionAffordanceStyles, ensureChartInteractionStyles, erasePresentationInkAt, evenColumnWidths, evenRowHeights, exportDeckJson, extraQuickAccessCommands, fetchGoogleWebfontOutlineBytes, filterCommands, filterHiddenSlideIndices, filterInteractableIds, filterRenderedElements, findChartPartTarget, findConnectorSiteNear, findEraserHitElementId, findInSlides, findSelectedThemeSwatch, findSmartArtNodeText, finishPrintWindow, firstShowSlideIndex, flattenNodes, flattenTagCollections, forgetSessionDeck, formatAxisValue, formatBackstageDate, formatBackstageSize, formatBytes, formatCommentTimestamp, formatElapsed, formatMobileElapsed, formatRelativeTime, formatSlideCounter, formatTime, formatVersionTimestamp, fpsToFrameIntervalMs, generateBroadcastRoomId, generateElementId, generateNoteLineCount, generateTicks, getActiveXControlOverlayView, getAnimationColorBaseStyle, getAnimationInitialStyle, getAriaLabel, getAriaRole, getAriaRoleDescription, getBarFacePicturePixelSampleVersion, getBevelLightingSvgFilter, getCachedResult, getCalloutLeaderLineGeometry, getCalloutViewBoxBounds, getCellDiagonalBorders, getChartStylePalette, getChartUserShapeGroupTransform, getChartUserShapeRowChartBox, getCinematicTransitionAnimations, getCompoundLineOffsets, getCompoundLineWidths, getComputedEffectStyle, getComputedFillStyle, getComputedStrokeStyle, getConnectorEndpointHandles, getConnectorPathGeometry, getContentPartReplayStyles, getCropShapeClipPath, getCurrentParagraphIndex, getDenseGridLayoutPlan, getDensePanelTouchTargetPx, getDraggedShapeAdjustments, getDuotoneCachedResult, getEffectSoundAsset, getEffectSoundState, getEffectStyleSource, getElementLabel, getElementTransform, getElementTransformWithoutRotation, getFragmentedTransitionDescriptor, getGroupChildParentFill, getImageColorWashStyle, getImageEffectsFilter, getImageEffectsOpacity, getImageFillCounterTransform, getImageFitStyle, getImageSvgFilters, getImageTilingStyle, getInkReplayStyles, getInlineEditorSelectionResult, getLocalStorageUsageSummary, getNonVisualDescriptionFields, getNotesPrintableArea, getOleAriaLabel, getOleBadgeLabel, getOleDisplayName, getOleDocumentParagraphs, getOleNestedDeckDetail, getOleObjectTypeLabel, getOleSheetGrid, getOleTypeColor, getOleTypeLabel, getOverflowSegments, getP14TransitionAnimations, getPatternSvg, getPendingSelectionRestore, getPresetShapeClipPath, getPresetShapeVectorGeometry, getPrintableArea, getResizeHandleHitAreaStyle, getSelectionControlArtworkStyle, getSelectionOutlineColor, getSelectionTextStyleFlags, getSessionTabId, getShapeAdjustmentHandleDescriptors, getShapeConnectionSites, getSlideBackgroundStyle, getSlideTransitionAnimations, getSoftEdgeSvgFilter, getSubstituteFontFamily, getSvgStrokeDasharray, getTableCellBandStyle, getTextBodyRotationTransform, getTextCompensationTransform, getWarpPath, groupElements, groupIntoParagraphs, groupSlidesBySection, guidePxToEmu, handleReadingViewKey, hasCopyableFormat, hasDistinctScriptFonts, hasGlyphEnvelope, hasMultipleSelectedTableCells, hasShapeProperties, hasShowSlideAfter, hasTextProperties, hasTiltData, hexToRgbUnit, hiddenSlideCue, hideChartSeries, hollowTextFillStyle, inlineElementPointerEvents, inlineListBodyText, insertCommentMention, insertTableElementColumn, insertTableElementRow, isActionHidden, isBlackboardActive, isBrowserOpenableMime, isBulletMarkerSegment, isCalloutShape, isCellInRect, isCurrentLayout, isEditableMotionPath, isEditableTextElement, isEditorTextInputTarget, isElementActionable, isElementLocked, isElementRendered, isExportAbortError, isHeaderFooterDateTextVisible, isHeaderFooterFooterTextVisible, isHeaderFooterHeaderTextVisible, isHollowShapeElement, isImageLikeElement, isImageTiled, isInkElement, isKeyboardOpen, isLegacyBinaryPresentation, isLinkedTextBox, isMixedContentBlocked, isMobileViewport, isPpactionUrl, isPresentationAdvanceClick, isPresentationSessionMessage, isSeriesUsingSecondaryAxis, isStrokeOnlyPresetElement, isSupportedPresentationFile, isTemplateElementId3 as isTemplateElementId, isUrlSafe, isWedgeCalloutPresetShape, lastShowSlideIndex, listAutosaveSnapshots, listBackstageRecentFiles, listChartUserShapeRows, loadAudienceContent, loadSessionDeck, lockResizeAspect, makeCloneId, makeSlideId, mapEditingWheel, mapEditorKey, mapOutlineKey, mapPresentationKey, mapPresentationWheel, mapSlideShowStartKey, mapSlideSorterKey, masterViewBackgroundColor, masterViewCrudActions, masterViewCrudFailureKey, masterViewElements, masterViewPseudoSlide, matchCommentMentionAuthors, mayLeaveSlideShow, measureSvgViewportRect, mediaFallbackIcon, mediaFallbackLabelKey, mediaFallbackVisual, mediaPlaybackAttributes, mediaTransportVisible, mediaTrimEndAbsoluteMs, mediaTrimEndMsFromAbsoluteMs, mediaTrimEndMsFromSeconds, mediaTrimEndSeconds, mergeAdditiveSelection, mergeCells, mergePresentationSnapshot, mergeShapes, mergeSlideTransition, mobileElapsedSince, mobileSlideCounter, modelDataToBlobUrl, morphOptionToMode, motionPathEndPixel, motionPathFamilyLabelKey, motionPathFor, motionPathPresetIdForPath, motionPathPresetLabelKey, motionPathPresetsByFamily, motionPathToSvgD, mountAreaChart3D, mountBarChart3D, mountLineChart3D, mountModel3D, mountPieChart3D, mountSurfaceChart3D, movePresenterPointer, moveQuickAccessCommand, moveSectionDown, moveSectionUp, moveSlidesToSection, mruColorsPatch, nestedTextDecorationStyle, newTableElement, nextPresentedSlide, nextShowSlideIndex, nextToggleValue, normalizeColorsForCapture, normalizeHexColor2 as normalizeHexColor, normalizeStrokeDashType, normalizeTableStyleGuid, notesSegmentsToSpans, observeElementHeight, observeExternalCollaborationReadiness, observeExternalCollaborationSession, observeYDocSlides, ooxmlGradientAngleToCssDegrees, openNativeEyeDropper, openPendingPrintWindow, openPptxFile, openReadingView, openUrlInNewTab, overlayInlineTextSnapshot, overlayMasterViewInlineSnapshot, paintedElementSize, paintedStrokeWidth, paragraphsToSegments, parseDrawingColor, parseDrawingColorOpacity, parsePanoseString, parsePpactionUrl, parseSegmentsFromRichEditor, partitionTemplateElements, patchChartData, pickSupportedMimeType, pieceLetterSpacing, placeAudienceWindow, placeCaretAtEnd, placeTileOnPage, placeholderPromptDescriptor, playFeedbackSound, playGroup, playSlideTransitionPreview, polygonsToSvgPath, pptxActionToElementAction, prepareElementForInsertion, prepareElementUpdateBatch, prepareExportClone, preprocessCssForCapture, presentationBaseName, presentationEntrySlideIndex, presentationInkPath, presenterElapsed, presenterNextDisabled, presenterPaneAdvancesOnClick, presenterPrevDisabled, presenterTimerProgress, previousShowSlideIndex, printPropertiesFrameSlides, printPropertiesSlidesPerPage, probeAutosaveRecovery, projectDrawingShapes, promote, publishLiveGeometry, publishLiveInlineText, pushRecentColor, quickStyleSwatchCss, radarStylePatch, rasterResultToPngBlob, rasterizeElement, rasterizeElementTiledToCanvas, rasterizeElementTiles, reResolveElementColors, reResolveSlideColors, readBackstageRecentFile, readEditableText, readListActivationSelection, readOnlyRecommendation, readRibbonTransitionDraft, readSlideShowOption, readSlidesFromYDoc, readSoundFileAsDataUrl, readStoredViewerPrefs, readViewportMetrics, readingViewFitScale, rebuildDrawingShapesIfCleared, reconcileSlidesInYDoc, recordProgressPercent, rectToCells, redistributeColumnWidth, registerCollaborationTeardown, registerCrossSlideAudio, registerCustomFont, remapTextToSegments, rememberSessionDeck, removeChartCategory, removeChartSeries, removeCommentFromList, removeEmptyNode, removeLastTableElementColumn, removeLastTableElementRow, removeQuickAccessCommand, removeSmartArtNode, removeTableElementColumn, removeTableElementRow, renameSection, reorder2 as reorder, reorderAnimationTimelineRows, replaceMasterViewElements, replaceOleFile, replyToCommentInList, rerouteConnectorsForMovedElements, resetPresenterTimer, resetSlideLayoutPath, resolve3DRenderingFlags, resolveActionType, resolveAudienceScreenPlacement, resolveAuthoredCustomShowId, resolveAuthoredSlideRange, resolveAutoAdvanceDelayMs, resolveAutoFitFontScale, resolveAutosaveActivation, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, resolveChartKind, resolveCollaborationShellEditability, resolveCollaborationShellState, resolveConnectorEndpointUpdate, resolveDefaultFontFamily, resolveDefaultPrintSettings, resolveDirection, resolveDirection8, resolveDisplayedChartType, resolveElementActionAffordance, resolveElementAriaAttributes, resolveElementHighlightClick, resolveElementInteractivity, resolveExpiredAutosaveSnapshots, resolveExportCaptureDecision, resolveFontKerning, resolveGoogleWebfontHref, resolveGroupChildFill, resolveHistoryDepth, resolveImageResolutionScale, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, resolveMediaElementSource, resolveMediaTimeNodeElementIds, resolveMetricTrackingPx, resolveNotesSchematicBodyFontSizePx, resolveNotesSegments, resolveOleType, resolveOleVerbTarget, resolveOptionRootClasses, resolveOrientation, resolvePalette, resolvePresentationAction, resolveProfileInitial, resolveRevealedChartData, resolveRevealedDrawingShapeNodeIds, resolveRevealedDrawingShapes, resolveRevealedSmartArtNodes, resolveScreenTip, resolveScriptFontSet, resolveSelectionPaneRename, resolveShapeGeometry, resolveShowSlideIndexes, resolveSlideSizeSelection, resolveSlideTransition, resolveSmartArt3DLayout, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTemplateBackgroundRows, resolveThemeCatalogEntry, resolveTitleBarStatusKey, resolveTransitionDurationMs, resolveTransitionSoundAction, resolveTransportForServerUrl, resolveViewerAddinRows, resolveViewportFitOptions, resolveWheelSpokeCount, restoreFilteredSeries, restoreInlineListBodySelection, restoreSegmentSelection, restoreSessionDeck, ribbonTransitionUpdates, rulerDragToGuidePosition, runPresentationAction, runProgramNoticeStackStyle, safeOpenUrl, sanitizeColor, sanitizeGradientStops, sanitizeMathMl, saveAutosaveSnapshot, saveDeckWithPassword, saveViewerProfile, savedPresentationFileName, scaleSlidesForSizeChange, scanAvailableFontFamilies, scheduleAutoAdvanceChain, scheduleMediaTrimAndFade, schemaLabel, scopeLayoutOptionsToSlide, seedRecentColors, segmentFrameCount, segmentStyleToCss, segmentsToEditorHtml, segmentsToParagraphs, segmentsToPlainText, selectGoogleWebfontFamilies, selectedParagraphBulletKind, selectionBulletKind, sendBackward, sendToBack, seriesSecondaryAxisPatch, setAfterAnimation, setAfterAnimationColor, setCachedResult, setCellText, setChartAxisGridlineStyle, setChartAxisLogScale, setChartAxisTitleStyle, setChartCategoryLabel, setChartCellValue, setChartDataPointExplosion, setChartDataPointFill, setChartDataPointLabel, setChartDataPointMarker, setChartSeriesChartType, setChartSeriesMarker, setDataLabelsRangeCache, setDuotoneCachedResult, setEffectSound, setEffectStockSound, setMasterViewBackgroundColor, setMotionPath, setMotionPathEnd, setPendingSelectionRestore, setSmartArtNodeStyle, setTableElementCellText, shapeFillChange, shapeOutlineChange, shouldAutoFollowBroadcaster, shouldClearAutosaveCacheOnClose, shouldCommitSmartArtNodeText, shouldConfirmExternalHyperlink, shouldDiscardAutosaveOnSuccessfulSave, shouldLoopContinuously, shouldProbeAutosaveRecovery, shouldRenderHitTarget, shouldRoomSlidesReplaceLoad, shouldShowAccessibilitySection, shouldShowAutosaveRecoveryPrompt, shouldShowElementHandles, shouldStickyActionRow, shouldUseSvgWarp, shouldWriteAutosaveSnapshot, siblingCount, siblingIndex, slideProgressPercent, slideShowOptionChange, slideSizeFromPreset, slideSizeToCanvasPx, slideStatusLabel, snapBoxToGrid, splitCell, splitRunByScriptFont, splitRunForMetrics, splitWordsForUnderline, stepPresenterZoom, stopAllPersistentAudio, stopCaptureStream, storeAudienceContent, stripUnderlineDecoration, strokeOutlineViewBox, strokeWidthOf, styleShadowFilter, subscribeBarFacePicturePixelSamples, substituteFieldText, surfaceWireframePatch, svgGradientFillRef, svgLineCap, svgPathToPolygons, swapPresentationWindows, switchSmartArtLayout, syncGoogleWebfontStylesheet, tableCellCss, tableContainerCss, tableStyleAssignmentUpdate, templateSchemeFromTheme, text3dEmuToPt, text3dPtToEmu, textBuildSpanStyle, textFontSizePtToPx, textFontSizePxToPt, themeColorLabel, themeColorSchemesEqual, themeColorSwatchRows, themeSwatchCommit, themeToCssVars, toCssTextOrientation, toCssVerticalDirection, toCssWritingMode, toSlideIndex, toggleBlackboard, toggleCommentResolvedInList, togglePresenterTimer, toggleSelectionBullets, toggleSheet, toggleStageElementMedia, toggleText3dExtrusion, transformInlineListCase, transformTextCase, transitionSoundOptions, transitionSoundSelectedValue, transitionStockSoundId, trimmedMediaDurationMs, ungroupElements, updateCellTextInRawXml, updateCellTextStyleInRawXml, updateElement, updateMasterViewElement, updateMergeAttrsInRawXml, updateSmartArtNodeText, updateTagInCollections, validateMediaTrimRange, validateRoomId, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, viewPropertiesPatchFromPreferences, viewerOptionsToPreferences, viewerPreferencesFromViewProperties, visibleTemplateElements, warpPreviewPath, withChartPointValue, withChartTitle, withChartUserShapeAdded, withChartUserShapeGroupChildAdded, withChartUserShapeRowChartBoxUpdated, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRemoved, withChartUserShapeRowRotationUpdated, withChartUserShapeRowTextUpdated, withChartUserShapeRowUpdated, withConnectorEndpointUpdate, withFrameSlides, withInlineListDecorationDefaults, withSlideSizeOrientation, withSlidesPerPage, writeStoredViewerPrefs, xmlText };
|