pptx-react-viewer 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/dist/{AiChatPanel-WMVQFNDC.js → AiChatPanel-N2FVAQRP.js} +25 -25
- package/dist/AiChatPanel-N2FVAQRP.js.br +0 -0
- package/dist/AiChatPanel-N2FVAQRP.js.gz +0 -0
- package/dist/{AiChatPanel-MHURGN6G.mjs → AiChatPanel-VINTTAOW.mjs} +4 -4
- package/dist/AiChatPanel-VINTTAOW.mjs.br +0 -0
- package/dist/AiChatPanel-VINTTAOW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-IMGZEZNU.js → Area3DChartScene-TI3GRA4Y.js} +2 -2
- package/dist/Area3DChartScene-TI3GRA4Y.js.br +0 -0
- package/dist/Area3DChartScene-TI3GRA4Y.js.gz +0 -0
- package/dist/{Area3DChartScene-LKOWSMAU.mjs → Area3DChartScene-WNEHMOG2.mjs} +1 -1
- package/dist/Area3DChartScene-WNEHMOG2.mjs.br +0 -0
- package/dist/Area3DChartScene-WNEHMOG2.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-VLSYVFRT.js → Bar3DChartScene-CRN5WPCZ.js} +2 -2
- package/dist/Bar3DChartScene-CRN5WPCZ.js.br +0 -0
- package/dist/Bar3DChartScene-CRN5WPCZ.js.gz +0 -0
- package/dist/{Bar3DChartScene-NQNSIMUL.mjs → Bar3DChartScene-E53RZRI4.mjs} +1 -1
- package/dist/Bar3DChartScene-E53RZRI4.mjs.br +0 -0
- package/dist/Bar3DChartScene-E53RZRI4.mjs.gz +0 -0
- package/dist/{Line3DChartScene-IWZHA563.js → Line3DChartScene-DGPE4GDN.js} +2 -2
- package/dist/Line3DChartScene-DGPE4GDN.js.br +0 -0
- package/dist/Line3DChartScene-DGPE4GDN.js.gz +0 -0
- package/dist/{Line3DChartScene-ANZBJYQI.mjs → Line3DChartScene-YJ2POVES.mjs} +1 -1
- package/dist/Line3DChartScene-YJ2POVES.mjs.br +0 -0
- package/dist/Line3DChartScene-YJ2POVES.mjs.gz +0 -0
- package/dist/{Model3DScene-Y34HTZXK.mjs → Model3DScene-MYODSOVU.mjs} +1 -1
- package/dist/Model3DScene-MYODSOVU.mjs.br +0 -0
- package/dist/Model3DScene-MYODSOVU.mjs.gz +0 -0
- package/dist/{Model3DScene-2L3YRAMR.js → Model3DScene-O4IOWE5S.js} +2 -2
- package/dist/Model3DScene-O4IOWE5S.js.br +0 -0
- package/dist/Model3DScene-O4IOWE5S.js.gz +0 -0
- package/dist/{PieChart3DScene-NE3GN5VG.js → PieChart3DScene-4S4MZENR.js} +2 -2
- package/dist/PieChart3DScene-4S4MZENR.js.br +0 -0
- package/dist/PieChart3DScene-4S4MZENR.js.gz +0 -0
- package/dist/{PieChart3DScene-FBRPLHLG.mjs → PieChart3DScene-YYBYC5AM.mjs} +1 -1
- package/dist/PieChart3DScene-YYBYC5AM.mjs.br +0 -0
- package/dist/PieChart3DScene-YYBYC5AM.mjs.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-7HE5DA3X.mjs → SurfaceChart3DScene-FFYG6CNE.mjs} +1 -1
- package/dist/SurfaceChart3DScene-FFYG6CNE.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-FFYG6CNE.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-OSMAVZJC.js → SurfaceChart3DScene-RNBXINNV.js} +2 -2
- package/dist/SurfaceChart3DScene-RNBXINNV.js.br +0 -0
- package/dist/SurfaceChart3DScene-RNBXINNV.js.gz +0 -0
- package/dist/{chunk-I5F3XLVR.js → chunk-3LIWTQSG.js} +1961 -2161
- package/dist/chunk-3LIWTQSG.js.br +0 -0
- package/dist/chunk-3LIWTQSG.js.gz +0 -0
- package/dist/{chunk-L6I73WMO.js → chunk-45JD3XEM.js} +2164 -1646
- package/dist/chunk-45JD3XEM.js.br +0 -0
- package/dist/chunk-45JD3XEM.js.gz +0 -0
- package/dist/{chunk-33YE6E2O.mjs → chunk-7X6UCEYM.mjs} +2225 -582
- package/dist/chunk-7X6UCEYM.mjs.br +0 -0
- package/dist/chunk-7X6UCEYM.mjs.gz +0 -0
- package/dist/{chunk-IWHZ2DUD.mjs → chunk-FOXGVZ4A.mjs} +647 -135
- package/dist/chunk-FOXGVZ4A.mjs.br +0 -0
- package/dist/chunk-FOXGVZ4A.mjs.gz +0 -0
- package/dist/{chunk-GITM3RKP.mjs → chunk-ILVWZ7TN.mjs} +2 -2
- package/dist/chunk-ILVWZ7TN.mjs.br +0 -0
- package/dist/chunk-ILVWZ7TN.mjs.gz +0 -0
- package/dist/{chunk-LAAXFMRE.js → chunk-JLQWPRIM.js} +2231 -581
- package/dist/chunk-JLQWPRIM.js.br +0 -0
- package/dist/chunk-JLQWPRIM.js.gz +0 -0
- package/dist/{chunk-ZOB6ITIM.js → chunk-MVLYI7C2.js} +5 -5
- package/dist/chunk-MVLYI7C2.js.br +0 -0
- package/dist/chunk-MVLYI7C2.js.gz +0 -0
- package/dist/{chunk-NKACTGK5.js → chunk-NKXILGP5.js} +182 -182
- package/dist/chunk-NKXILGP5.js.br +0 -0
- package/dist/chunk-NKXILGP5.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-5F426BCZ.mjs → chunk-Q7MONAI4.mjs} +1 -1
- package/dist/chunk-Q7MONAI4.mjs.br +0 -0
- package/dist/chunk-Q7MONAI4.mjs.gz +0 -0
- package/dist/{chunk-H7J4EYXS.mjs → chunk-VC4GPWZS.mjs} +131 -329
- package/dist/chunk-VC4GPWZS.mjs.br +0 -0
- package/dist/chunk-VC4GPWZS.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-MHURGN6G.mjs.br +0 -0
- package/dist/AiChatPanel-MHURGN6G.mjs.gz +0 -0
- package/dist/AiChatPanel-WMVQFNDC.js.br +0 -0
- package/dist/AiChatPanel-WMVQFNDC.js.gz +0 -0
- package/dist/Area3DChartScene-IMGZEZNU.js.br +0 -0
- package/dist/Area3DChartScene-IMGZEZNU.js.gz +0 -0
- package/dist/Area3DChartScene-LKOWSMAU.mjs.br +0 -0
- package/dist/Area3DChartScene-LKOWSMAU.mjs.gz +0 -0
- package/dist/Bar3DChartScene-NQNSIMUL.mjs.br +0 -0
- package/dist/Bar3DChartScene-NQNSIMUL.mjs.gz +0 -0
- package/dist/Bar3DChartScene-VLSYVFRT.js.br +0 -0
- package/dist/Bar3DChartScene-VLSYVFRT.js.gz +0 -0
- package/dist/Line3DChartScene-ANZBJYQI.mjs.br +0 -0
- package/dist/Line3DChartScene-ANZBJYQI.mjs.gz +0 -0
- package/dist/Line3DChartScene-IWZHA563.js.br +0 -0
- package/dist/Line3DChartScene-IWZHA563.js.gz +0 -0
- package/dist/Model3DScene-2L3YRAMR.js.br +0 -0
- package/dist/Model3DScene-2L3YRAMR.js.gz +0 -0
- package/dist/Model3DScene-Y34HTZXK.mjs.br +0 -0
- package/dist/Model3DScene-Y34HTZXK.mjs.gz +0 -0
- package/dist/PieChart3DScene-FBRPLHLG.mjs.br +0 -0
- package/dist/PieChart3DScene-FBRPLHLG.mjs.gz +0 -0
- package/dist/PieChart3DScene-NE3GN5VG.js.br +0 -0
- package/dist/PieChart3DScene-NE3GN5VG.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-7HE5DA3X.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-7HE5DA3X.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-OSMAVZJC.js.br +0 -0
- package/dist/SurfaceChart3DScene-OSMAVZJC.js.gz +0 -0
- package/dist/chunk-33YE6E2O.mjs.br +0 -0
- package/dist/chunk-33YE6E2O.mjs.gz +0 -0
- package/dist/chunk-5F426BCZ.mjs.br +0 -0
- package/dist/chunk-5F426BCZ.mjs.gz +0 -0
- package/dist/chunk-GITM3RKP.mjs.br +0 -0
- package/dist/chunk-GITM3RKP.mjs.gz +0 -0
- package/dist/chunk-H7J4EYXS.mjs.br +0 -0
- package/dist/chunk-H7J4EYXS.mjs.gz +0 -0
- package/dist/chunk-I5F3XLVR.js.br +0 -0
- package/dist/chunk-I5F3XLVR.js.gz +0 -0
- package/dist/chunk-IWHZ2DUD.mjs.br +0 -0
- package/dist/chunk-IWHZ2DUD.mjs.gz +0 -0
- package/dist/chunk-L6I73WMO.js.br +0 -0
- package/dist/chunk-L6I73WMO.js.gz +0 -0
- package/dist/chunk-LAAXFMRE.js.br +0 -0
- package/dist/chunk-LAAXFMRE.js.gz +0 -0
- package/dist/chunk-M24DEOP6.js.br +0 -0
- package/dist/chunk-M24DEOP6.js.gz +0 -0
- package/dist/chunk-NKACTGK5.js.br +0 -0
- package/dist/chunk-NKACTGK5.js.gz +0 -0
- package/dist/chunk-R664EPDC.mjs.br +0 -0
- package/dist/chunk-R664EPDC.mjs.gz +0 -0
- package/dist/chunk-ZOB6ITIM.js.br +0 -0
- package/dist/chunk-ZOB6ITIM.js.gz +0 -0
|
@@ -31065,7 +31065,7 @@ function directChildOrder(xml) {
|
|
|
31065
31065
|
function extractElementOrders(xml, elementName) {
|
|
31066
31066
|
const orders = [];
|
|
31067
31067
|
const pattern = new RegExp(
|
|
31068
|
-
`<([A-Za-z_][\\w.-]*:)?${elementName}\\
|
|
31068
|
+
`<([A-Za-z_][\\w.-]*:)?${elementName}(?=[\\s/>])[^>]*>([\\s\\S]*?)<\\/\\1${elementName}\\s*>`,
|
|
31069
31069
|
"gu"
|
|
31070
31070
|
);
|
|
31071
31071
|
for (const match of xml.matchAll(pattern)) {
|
|
@@ -32029,11 +32029,11 @@ function parseRunSolidFillColor(rPr) {
|
|
|
32029
32029
|
if (!rPr) {
|
|
32030
32030
|
return void 0;
|
|
32031
32031
|
}
|
|
32032
|
-
const
|
|
32033
|
-
if (!
|
|
32032
|
+
const solidFill32 = rPr["a:solidFill"];
|
|
32033
|
+
if (!solidFill32) {
|
|
32034
32034
|
return void 0;
|
|
32035
32035
|
}
|
|
32036
|
-
const srgb =
|
|
32036
|
+
const srgb = solidFill32["a:srgbClr"];
|
|
32037
32037
|
if (srgb?.["@_val"]) {
|
|
32038
32038
|
return String(srgb["@_val"]);
|
|
32039
32039
|
}
|
|
@@ -32043,11 +32043,11 @@ function parseRunSolidFillColorXml(rPr) {
|
|
|
32043
32043
|
if (!rPr) {
|
|
32044
32044
|
return void 0;
|
|
32045
32045
|
}
|
|
32046
|
-
const
|
|
32047
|
-
if (!
|
|
32046
|
+
const solidFill32 = rPr["a:solidFill"];
|
|
32047
|
+
if (!solidFill32) {
|
|
32048
32048
|
return void 0;
|
|
32049
32049
|
}
|
|
32050
|
-
return extractColorChoiceXml(
|
|
32050
|
+
return extractColorChoiceXml(solidFill32);
|
|
32051
32051
|
}
|
|
32052
32052
|
var init_text_run_properties_parser = __esm({
|
|
32053
32053
|
"src/core/utils/text-run-properties-parser.ts"() {
|
|
@@ -37446,6 +37446,20 @@ function itemAspect(plan, index, nodeCount, presLayoutVars) {
|
|
|
37446
37446
|
}
|
|
37447
37447
|
return void 0;
|
|
37448
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
|
+
}
|
|
37449
37463
|
function ordered(nodes, flow) {
|
|
37450
37464
|
return flow.reverse ? [...nodes].reverse() : nodes;
|
|
37451
37465
|
}
|
|
@@ -37833,6 +37847,7 @@ function arrangeLinear(plan, flow, nodes, box, palette, style, elementId, index
|
|
|
37833
37847
|
const horizontal = flow.orientation === "horizontal";
|
|
37834
37848
|
const usableMain = (horizontal ? w : h2) - INSET * 2;
|
|
37835
37849
|
const usableCross = (horizontal ? h2 : w) - INSET * 2;
|
|
37850
|
+
const crossAxisFraction = horizontal ? void 0 : itemCrossAxisFraction(plan, index);
|
|
37836
37851
|
const { mainExtent, gap } = resolveMainAxisLayout(
|
|
37837
37852
|
constraints,
|
|
37838
37853
|
index,
|
|
@@ -37848,7 +37863,7 @@ function arrangeLinear(plan, flow, nodes, box, palette, style, elementId, index
|
|
|
37848
37863
|
const itemTemplate = itemNode(plan.node);
|
|
37849
37864
|
const itemShape = findCompositeItemShape(itemTemplate);
|
|
37850
37865
|
const naturalAspect = resolveItemSelfAspect(itemTemplate);
|
|
37851
|
-
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(
|
|
37852
37867
|
usableCross,
|
|
37853
37868
|
Math.max(12, mainExtent * (horizontal ? naturalAspect : 1 / naturalAspect))
|
|
37854
37869
|
) : usableCross;
|
|
@@ -46400,8 +46415,8 @@ function parseLineStyle(container, elementName, xmlLookup, colorParser) {
|
|
|
46400
46415
|
if (spPr) {
|
|
46401
46416
|
const lnNode = xmlLookup.getChildByLocalName(spPr, "ln");
|
|
46402
46417
|
if (lnNode) {
|
|
46403
|
-
const
|
|
46404
|
-
const lineColor = colorParser.parseColor(
|
|
46418
|
+
const solidFill32 = xmlLookup.getChildByLocalName(lnNode, "solidFill");
|
|
46419
|
+
const lineColor = colorParser.parseColor(solidFill32);
|
|
46405
46420
|
if (lineColor) {
|
|
46406
46421
|
result.color = lineColor;
|
|
46407
46422
|
}
|
|
@@ -47104,8 +47119,8 @@ function parseShapeProps(spPrNode, xmlLookup, colorParser) {
|
|
|
47104
47119
|
}
|
|
47105
47120
|
const result = {};
|
|
47106
47121
|
let hasProps = false;
|
|
47107
|
-
const
|
|
47108
|
-
const fillColor = colorParser.parseColor(
|
|
47122
|
+
const solidFill32 = xmlLookup.getChildByLocalName(spPrNode, "solidFill");
|
|
47123
|
+
const fillColor = colorParser.parseColor(solidFill32);
|
|
47109
47124
|
if (fillColor) {
|
|
47110
47125
|
result.fillColor = fillColor;
|
|
47111
47126
|
hasProps = true;
|
|
@@ -48587,8 +48602,8 @@ function parseTxPr(txPrNode, xmlLookup, colorParser, target, resolveTypeface) {
|
|
|
48587
48602
|
const raw = String(latin["@_typeface"]);
|
|
48588
48603
|
target.fontFamily = resolveTypeface ? resolveTypeface(raw) : raw;
|
|
48589
48604
|
}
|
|
48590
|
-
const
|
|
48591
|
-
const fontColor = colorParser.parseColor(
|
|
48605
|
+
const solidFill32 = xmlLookup.getChildByLocalName(defRPr, "solidFill");
|
|
48606
|
+
const fontColor = colorParser.parseColor(solidFill32);
|
|
48592
48607
|
if (fontColor) {
|
|
48593
48608
|
target.fontColor = fontColor;
|
|
48594
48609
|
}
|
|
@@ -49089,13 +49104,13 @@ function extractCxSeriesColor(ser, xmlLookup, colorParser) {
|
|
|
49089
49104
|
if (!spPr) {
|
|
49090
49105
|
return void 0;
|
|
49091
49106
|
}
|
|
49092
|
-
const
|
|
49093
|
-
if (
|
|
49094
|
-
const resolved = colorParser?.parseColor(
|
|
49107
|
+
const solidFill32 = xmlLookup.getChildByLocalName(spPr, "solidFill");
|
|
49108
|
+
if (solidFill32) {
|
|
49109
|
+
const resolved = colorParser?.parseColor(solidFill32);
|
|
49095
49110
|
if (resolved) {
|
|
49096
49111
|
return resolved;
|
|
49097
49112
|
}
|
|
49098
|
-
const srgb = xmlLookup.getChildByLocalName(
|
|
49113
|
+
const srgb = xmlLookup.getChildByLocalName(solidFill32, "srgbClr");
|
|
49099
49114
|
const val2 = String(srgb?.["@_val"] || "").trim();
|
|
49100
49115
|
return val2.length === 6 ? `#${val2}` : void 0;
|
|
49101
49116
|
}
|
|
@@ -65945,9 +65960,9 @@ var init_effect_dag_specific_helpers = __esm({
|
|
|
65945
65960
|
}
|
|
65946
65961
|
});
|
|
65947
65962
|
function fillOverlayColorHost(fillOverlay, context) {
|
|
65948
|
-
const
|
|
65949
|
-
if (
|
|
65950
|
-
return
|
|
65963
|
+
const solidFill32 = fillOverlay["a:solidFill"];
|
|
65964
|
+
if (solidFill32) {
|
|
65965
|
+
return solidFill32;
|
|
65951
65966
|
}
|
|
65952
65967
|
const gradFill = fillOverlay["a:gradFill"];
|
|
65953
65968
|
if (!gradFill) {
|
|
@@ -67477,20 +67492,20 @@ var init_PptxShapeStyleExtractor = __esm({
|
|
|
67477
67492
|
extractShapeStyle(spPr, styleNode) {
|
|
67478
67493
|
const style = {};
|
|
67479
67494
|
const shapeProps = spPr || {};
|
|
67480
|
-
const
|
|
67495
|
+
const solidFill32 = drawingChild(shapeProps, "solidFill");
|
|
67481
67496
|
const gradFill = drawingChild(shapeProps, "gradFill");
|
|
67482
67497
|
const pattFill = drawingChild(shapeProps, "pattFill");
|
|
67483
67498
|
const noFill = hasDrawingChild(shapeProps, "noFill");
|
|
67484
67499
|
const blipFill = drawingChild(shapeProps, "blipFill");
|
|
67485
|
-
if (
|
|
67500
|
+
if (solidFill32) {
|
|
67486
67501
|
style.fillMode = "solid";
|
|
67487
|
-
style.fillColor = this.context.parseColor(
|
|
67488
|
-
style.fillOpacity = this.context.extractColorOpacity(
|
|
67489
|
-
const solidFillColorXml = extractColorChoiceXml(
|
|
67502
|
+
style.fillColor = this.context.parseColor(solidFill32);
|
|
67503
|
+
style.fillOpacity = this.context.extractColorOpacity(solidFill32);
|
|
67504
|
+
const solidFillColorXml = extractColorChoiceXml(solidFill32);
|
|
67490
67505
|
if (solidFillColorXml) {
|
|
67491
67506
|
style.fillColorXml = solidFillColorXml;
|
|
67492
67507
|
}
|
|
67493
|
-
const solidFillColorRef = themeColorRefFromColorChoice(
|
|
67508
|
+
const solidFillColorRef = themeColorRefFromColorChoice(solidFill32);
|
|
67494
67509
|
if (solidFillColorRef) {
|
|
67495
67510
|
style.fillColorRef = solidFillColorRef;
|
|
67496
67511
|
}
|
|
@@ -67716,11 +67731,11 @@ function parseTintShadeVal(value) {
|
|
|
67716
67731
|
const fraction = parseOoxmlPercent(value);
|
|
67717
67732
|
return fraction === void 0 || fraction === 0 ? void 0 : Math.round(fraction * 1e5);
|
|
67718
67733
|
}
|
|
67719
|
-
function parseSolidFillStyle(
|
|
67720
|
-
if (!
|
|
67734
|
+
function parseSolidFillStyle(solidFill32) {
|
|
67735
|
+
if (!solidFill32) {
|
|
67721
67736
|
return void 0;
|
|
67722
67737
|
}
|
|
67723
|
-
const schemeClr =
|
|
67738
|
+
const schemeClr = solidFill32["a:schemeClr"];
|
|
67724
67739
|
if (!schemeClr) {
|
|
67725
67740
|
return void 0;
|
|
67726
67741
|
}
|
|
@@ -67763,13 +67778,13 @@ function parseBorderSide(side) {
|
|
|
67763
67778
|
border.dash = dashVal;
|
|
67764
67779
|
has = true;
|
|
67765
67780
|
}
|
|
67766
|
-
const
|
|
67767
|
-
const fill = parseSolidFillStyle(
|
|
67781
|
+
const solidFill32 = ln["a:solidFill"];
|
|
67782
|
+
const fill = parseSolidFillStyle(solidFill32);
|
|
67768
67783
|
if (fill) {
|
|
67769
67784
|
border.fill = fill;
|
|
67770
67785
|
has = true;
|
|
67771
67786
|
} else {
|
|
67772
|
-
const srgb =
|
|
67787
|
+
const srgb = solidFill32?.["a:srgbClr"];
|
|
67773
67788
|
const hex4 = srgb ? String(srgb["@_val"] || "").trim() : "";
|
|
67774
67789
|
if (hex4) {
|
|
67775
67790
|
border.color = hex4.startsWith("#") ? hex4 : `#${hex4}`;
|
|
@@ -71329,10 +71344,6 @@ var init_compatibility_child_sets = __esm({
|
|
|
71329
71344
|
]);
|
|
71330
71345
|
GRAPHIC_FRAME_LIMITATIONS = {
|
|
71331
71346
|
unknown: ["UNSUPPORTED_GRAPHIC_FRAME", "The graphic-frame payload is preserved but unsupported."],
|
|
71332
|
-
smartArt: [
|
|
71333
|
-
"PARTIAL_SMARTART_SUPPORT",
|
|
71334
|
-
"SmartArt is parsed and preserved, but some DiagramML behavior is not editable."
|
|
71335
|
-
],
|
|
71336
71347
|
ole: [
|
|
71337
71348
|
"PARTIAL_OLE_SUPPORT",
|
|
71338
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."
|
|
@@ -80222,8 +80233,8 @@ function parseTypedTextStyle(txPrNode, localName28, colorParser) {
|
|
|
80222
80233
|
if (typeface) {
|
|
80223
80234
|
style.fontFamily = String(typeface);
|
|
80224
80235
|
}
|
|
80225
|
-
const
|
|
80226
|
-
const color2 = literalColor(
|
|
80236
|
+
const solidFill32 = nodesOf(defRPr, "solidFill", localName28)[0];
|
|
80237
|
+
const color2 = literalColor(solidFill32, localName28, colorParser);
|
|
80227
80238
|
if (color2) {
|
|
80228
80239
|
style.color = color2;
|
|
80229
80240
|
}
|
|
@@ -95048,8 +95059,8 @@ function parseTableBackground(tblBg) {
|
|
|
95048
95059
|
return void 0;
|
|
95049
95060
|
}
|
|
95050
95061
|
const fillNode = tblBg["a:fill"];
|
|
95051
|
-
const
|
|
95052
|
-
const schemeClr =
|
|
95062
|
+
const solidFill32 = fillNode?.["a:solidFill"] ?? tblBg["a:solidFill"];
|
|
95063
|
+
const schemeClr = solidFill32?.["a:schemeClr"];
|
|
95053
95064
|
const schemeColor = schemeClr ? String(schemeClr["@_val"] || "").trim() || void 0 : void 0;
|
|
95054
95065
|
const fill = schemeColor ? { schemeColor } : void 0;
|
|
95055
95066
|
const hasEffectLst = Boolean(tblBg["a:effectLst"]);
|
|
@@ -95845,9 +95856,9 @@ var init_PptxHandlerRuntimeImageEffects = __esm({
|
|
|
95845
95856
|
}
|
|
95846
95857
|
rawCopy[key2] = fillOverlay[key2];
|
|
95847
95858
|
}
|
|
95848
|
-
const
|
|
95849
|
-
const resolvedColor =
|
|
95850
|
-
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;
|
|
95851
95862
|
const gradFill = fillOverlay["a:gradFill"];
|
|
95852
95863
|
const resolvedGradient = gradFill ? this.resolveFillOverlayGradient(gradFill) : void 0;
|
|
95853
95864
|
const pattFill = fillOverlay["a:pattFill"];
|
|
@@ -97216,8 +97227,8 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
97216
97227
|
if (hasNoFill) {
|
|
97217
97228
|
return "none";
|
|
97218
97229
|
}
|
|
97219
|
-
const
|
|
97220
|
-
return
|
|
97230
|
+
const solidFill32 = this.xmlLookupService.getChildByLocalName(shapeProperties, "solidFill");
|
|
97231
|
+
return solidFill32 ? this.parseColor(solidFill32) : void 0;
|
|
97221
97232
|
}
|
|
97222
97233
|
/**
|
|
97223
97234
|
* Extract chart style metadata from chart XML.
|
|
@@ -100156,14 +100167,14 @@ var init_PptxHandlerRuntimeTextRunStyleExtraction = __esm({
|
|
|
100156
100167
|
if (csTypeface) {
|
|
100157
100168
|
style.complexScriptFont = csTypeface;
|
|
100158
100169
|
}
|
|
100159
|
-
const
|
|
100160
|
-
if (
|
|
100161
|
-
style.color = this.parseColor(
|
|
100162
|
-
const colorXml2 = extractColorChoiceXml(
|
|
100170
|
+
const solidFill32 = xmlChild(runProperties2, "a:solidFill");
|
|
100171
|
+
if (solidFill32) {
|
|
100172
|
+
style.color = this.parseColor(solidFill32);
|
|
100173
|
+
const colorXml2 = extractColorChoiceXml(solidFill32);
|
|
100163
100174
|
if (colorXml2) {
|
|
100164
100175
|
style.colorXml = colorXml2;
|
|
100165
100176
|
}
|
|
100166
|
-
const colorRef = themeColorRefFromColorChoice(
|
|
100177
|
+
const colorRef = themeColorRefFromColorChoice(solidFill32);
|
|
100167
100178
|
if (colorRef) {
|
|
100168
100179
|
style.colorRef = colorRef;
|
|
100169
100180
|
}
|
|
@@ -116490,11 +116501,11 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
116490
116501
|
}
|
|
116491
116502
|
const bgPr = xmlChild(bg, "p:bgPr");
|
|
116492
116503
|
if (bgPr) {
|
|
116493
|
-
const
|
|
116494
|
-
if (
|
|
116504
|
+
const solidFill32 = xmlChild(bgPr, "a:solidFill");
|
|
116505
|
+
if (solidFill32) {
|
|
116495
116506
|
return this.blendBackgroundColorOntoWhite(
|
|
116496
|
-
this.parseColor(
|
|
116497
|
-
this.extractColorOpacity(
|
|
116507
|
+
this.parseColor(solidFill32),
|
|
116508
|
+
this.extractColorOpacity(solidFill32)
|
|
116498
116509
|
);
|
|
116499
116510
|
}
|
|
116500
116511
|
const pattFill = xmlChild(bgPr, "a:pattFill");
|
|
@@ -116587,11 +116598,11 @@ var init_PptxHandlerRuntimeBackgroundParsing = __esm({
|
|
|
116587
116598
|
if (idx === 0) {
|
|
116588
116599
|
return void 0;
|
|
116589
116600
|
}
|
|
116590
|
-
const
|
|
116591
|
-
if (
|
|
116601
|
+
const solidFill32 = xmlChild(bgRef, "a:solidFill");
|
|
116602
|
+
if (solidFill32) {
|
|
116592
116603
|
return this.blendBackgroundColorOntoWhite(
|
|
116593
|
-
this.parseColor(
|
|
116594
|
-
this.extractColorOpacity(
|
|
116604
|
+
this.parseColor(solidFill32),
|
|
116605
|
+
this.extractColorOpacity(solidFill32)
|
|
116595
116606
|
);
|
|
116596
116607
|
}
|
|
116597
116608
|
const overrideColor = this.blendBackgroundColorOntoWhite(
|
|
@@ -117409,13 +117420,13 @@ var init_PptxHandlerRuntimePlaceholderStyles = __esm({
|
|
|
117409
117420
|
if (defRPr["@_i"] !== void 0) {
|
|
117410
117421
|
style.italic = defRPr["@_i"] === "1";
|
|
117411
117422
|
}
|
|
117412
|
-
const
|
|
117413
|
-
const color2 = this.parseColor(
|
|
117423
|
+
const solidFill32 = defRPr["a:solidFill"];
|
|
117424
|
+
const color2 = this.parseColor(solidFill32);
|
|
117414
117425
|
if (color2) {
|
|
117415
117426
|
style.color = color2;
|
|
117416
117427
|
}
|
|
117417
|
-
if (
|
|
117418
|
-
style.colorChoiceXml =
|
|
117428
|
+
if (solidFill32) {
|
|
117429
|
+
style.colorChoiceXml = solidFill32;
|
|
117419
117430
|
}
|
|
117420
117431
|
const latin = defRPr["a:latin"];
|
|
117421
117432
|
if (latin?.["@_typeface"]) {
|
|
@@ -120149,8 +120160,8 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
120149
120160
|
}
|
|
120150
120161
|
const chrome = {};
|
|
120151
120162
|
if (bg) {
|
|
120152
|
-
const
|
|
120153
|
-
const bgColor = this.parseColor(
|
|
120163
|
+
const solidFill32 = this.xmlLookupService.getChildByLocalName(bg, "solidFill");
|
|
120164
|
+
const bgColor = this.parseColor(solidFill32);
|
|
120154
120165
|
if (bgColor) {
|
|
120155
120166
|
chrome.backgroundColor = bgColor;
|
|
120156
120167
|
} else {
|
|
@@ -120164,8 +120175,8 @@ var init_PptxHandlerRuntimeSmartArtXmlUtils = __esm({
|
|
|
120164
120175
|
if (whole) {
|
|
120165
120176
|
const lnNode = this.xmlLookupService.getChildByLocalName(whole, "ln");
|
|
120166
120177
|
if (lnNode) {
|
|
120167
|
-
const
|
|
120168
|
-
const outlineColor = this.parseColor(
|
|
120178
|
+
const solidFill32 = this.xmlLookupService.getChildByLocalName(lnNode, "solidFill");
|
|
120179
|
+
const outlineColor = this.parseColor(solidFill32);
|
|
120169
120180
|
if (outlineColor) {
|
|
120170
120181
|
chrome.outlineColor = outlineColor;
|
|
120171
120182
|
}
|
|
@@ -120277,11 +120288,11 @@ function extractDrawingShapeFill(spPr, deps) {
|
|
|
120277
120288
|
}
|
|
120278
120289
|
return result;
|
|
120279
120290
|
}
|
|
120280
|
-
const
|
|
120281
|
-
if (
|
|
120282
|
-
result.fillColor = deps.parseColor(
|
|
120291
|
+
const solidFill32 = deps.getChild(spPr, "solidFill");
|
|
120292
|
+
if (solidFill32) {
|
|
120293
|
+
result.fillColor = deps.parseColor(solidFill32) ?? void 0;
|
|
120283
120294
|
}
|
|
120284
|
-
const gradFill = !
|
|
120295
|
+
const gradFill = !solidFill32 ? deps.getChild(spPr, "gradFill") : void 0;
|
|
120285
120296
|
if (gradFill) {
|
|
120286
120297
|
const stops = deps.extractGradientStops(gradFill).map((stop) => ({
|
|
120287
120298
|
color: stop.color,
|
|
@@ -120295,7 +120306,7 @@ function extractDrawingShapeFill(spPr, deps) {
|
|
|
120295
120306
|
result.fillColor ??= stops[Math.floor(stops.length / 2)]?.color;
|
|
120296
120307
|
}
|
|
120297
120308
|
}
|
|
120298
|
-
const pattFill = !
|
|
120309
|
+
const pattFill = !solidFill32 && !gradFill ? deps.getChild(spPr, "pattFill") : void 0;
|
|
120299
120310
|
if (pattFill) {
|
|
120300
120311
|
const preset = String(pattFill["@_prst"] || "").trim();
|
|
120301
120312
|
if (preset) {
|
|
@@ -120311,7 +120322,7 @@ function extractDrawingShapeFill(spPr, deps) {
|
|
|
120311
120322
|
}
|
|
120312
120323
|
result.fillColor ??= fg ?? bg;
|
|
120313
120324
|
}
|
|
120314
|
-
const blipFill = !
|
|
120325
|
+
const blipFill = !solidFill32 && !gradFill && !pattFill ? deps.getChild(spPr, "blipFill") : void 0;
|
|
120315
120326
|
if (blipFill) {
|
|
120316
120327
|
const blip = deps.getChild(blipFill, "blip");
|
|
120317
120328
|
const embed = String(
|
|
@@ -148713,8 +148724,8 @@ function getOmmlMathColor(node) {
|
|
|
148713
148724
|
}
|
|
148714
148725
|
const drawingRunProperties = node["a:rPr"];
|
|
148715
148726
|
if (drawingRunProperties && typeof drawingRunProperties === "object") {
|
|
148716
|
-
const
|
|
148717
|
-
const srgbColor =
|
|
148727
|
+
const solidFill22 = drawingRunProperties["a:solidFill"];
|
|
148728
|
+
const srgbColor = solidFill22 && typeof solidFill22 === "object" ? solidFill22["a:srgbClr"] : void 0;
|
|
148718
148729
|
const value = srgbColor?.["@_val"];
|
|
148719
148730
|
if (typeof value === "string" && /^[0-9a-f]{6}$/iu.test(value)) {
|
|
148720
148731
|
return `#${value.toUpperCase()}`;
|
|
@@ -154472,6 +154483,102 @@ function buildCartesianHorizontalAxis(chartData, categoryLabels, layout, kind, p
|
|
|
154472
154483
|
displayChartData: datePlan || categoryPlan ? chartDataInCategoryOrder(chartData, sourceIndices2) : chartData
|
|
154473
154484
|
};
|
|
154474
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
|
+
}
|
|
154475
154582
|
function valueToX(val2, range, leftX, rightX) {
|
|
154476
154583
|
const usable = rightX - leftX;
|
|
154477
154584
|
let ratio;
|
|
@@ -154521,6 +154628,12 @@ function buildSideCategoryLabels(categoryLabels, layout) {
|
|
|
154521
154628
|
dominantBaseline: "central"
|
|
154522
154629
|
}));
|
|
154523
154630
|
}
|
|
154631
|
+
function widestCategoryLabelWidth(categoryLabels, fontSize) {
|
|
154632
|
+
return categoryLabels.reduce(
|
|
154633
|
+
(max, label) => Math.max(max, estimateTextWidth(label, fontSize)),
|
|
154634
|
+
0
|
|
154635
|
+
);
|
|
154636
|
+
}
|
|
154524
154637
|
function categoryTotals2(series, catCount) {
|
|
154525
154638
|
return Array.from(
|
|
154526
154639
|
{ length: catCount },
|
|
@@ -154535,7 +154648,9 @@ function barFill(chartData, series, seriesIndex, pointIndex) {
|
|
|
154535
154648
|
return resolveDataPointFill(series, pointIndex, paletteColor2(seriesIndex, palette)) ?? seriesColor2(series, seriesIndex, palette);
|
|
154536
154649
|
}
|
|
154537
154650
|
function buildHorizontalBarViewModel(element, chartData, categoryLabels) {
|
|
154538
|
-
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 ? {
|
|
154539
154654
|
kind: "line",
|
|
154540
154655
|
x1: zeroX,
|
|
154541
154656
|
y1: layout.plotTop,
|
|
@@ -157732,9 +157847,12 @@ function categoryAxisBand(chartData) {
|
|
|
157732
157847
|
), fontPx = axis?.fontSize !== void 0 ? chartFontPx(axis.fontSize) : DEFAULT_CHART_TEXT_PX, offset = 4 + 8 * ((axis?.labelOffset ?? 100) / 100);
|
|
157733
157848
|
return Math.max(24, offset + fontPx * 1.2);
|
|
157734
157849
|
}
|
|
157850
|
+
function leftAxisBand(leftCategoryLabelWidth) {
|
|
157851
|
+
return Math.max(40, (leftCategoryLabelWidth ?? 0) + 4);
|
|
157852
|
+
}
|
|
157735
157853
|
function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, options) {
|
|
157736
157854
|
const svgWidth = Math.max(1, elementWidth), svgHeight = Math.max(1, elementHeight);
|
|
157737
|
-
let plotLeft = hasAxes ?
|
|
157855
|
+
let plotLeft = hasAxes ? 8 + leftAxisBand(options?.leftCategoryLabelWidth) : 8, plotTop = 8, plotRight = svgWidth - 8, plotBottom = svgHeight - (hasAxes ? categoryAxisBand(chartData) : 8);
|
|
157738
157856
|
if (hasAxes && options?.categoryAxisAtTop) {
|
|
157739
157857
|
plotBottom = svgHeight - 8;
|
|
157740
157858
|
plotTop += categoryAxisBand(chartData);
|
|
@@ -157773,7 +157891,7 @@ function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, opti
|
|
|
157773
157891
|
plotRight = manual.x + manual.width;
|
|
157774
157892
|
plotBottom = manual.y + manual.height;
|
|
157775
157893
|
if (hasAxes && plotLayout.layoutTarget !== "inner") {
|
|
157776
|
-
plotLeft +=
|
|
157894
|
+
plotLeft += leftAxisBand(options?.leftCategoryLabelWidth);
|
|
157777
157895
|
plotBottom -= categoryAxisBand(chartData) - 8;
|
|
157778
157896
|
}
|
|
157779
157897
|
}
|
|
@@ -158356,7 +158474,7 @@ function regionViewBounds(viewedRegionType, regionValues) {
|
|
|
158356
158474
|
};
|
|
158357
158475
|
}
|
|
158358
158476
|
function scalePathD(d, scale2, dx, dy) {
|
|
158359
|
-
const tokens = d.
|
|
158477
|
+
const tokens = d.match(/[A-Za-z]|-?\d+(?:\.\d+)?/gu) ?? [];
|
|
158360
158478
|
const out = [];
|
|
158361
158479
|
let i2 = 0;
|
|
158362
158480
|
while (i2 < tokens.length) {
|
|
@@ -158371,7 +158489,7 @@ function scalePathD(d, scale2, dx, dy) {
|
|
|
158371
158489
|
continue;
|
|
158372
158490
|
}
|
|
158373
158491
|
const xRaw = parseFloat(tok);
|
|
158374
|
-
const yRaw = parseFloat(tokens[i2 + 1] ?? "
|
|
158492
|
+
const yRaw = parseFloat(tokens[i2 + 1] ?? "");
|
|
158375
158493
|
if (!Number.isNaN(xRaw) && !Number.isNaN(yRaw)) {
|
|
158376
158494
|
out.push(`${(xRaw * scale2 + dx).toFixed(2)},${(yRaw * scale2 + dy).toFixed(2)}`);
|
|
158377
158495
|
i2 += 2;
|
|
@@ -173124,6 +173242,8 @@ var translationsEn = {
|
|
|
173124
173242
|
"pptx.collaboration.userCount": "{{count}} user(s)",
|
|
173125
173243
|
"pptx.collaboration.youLabel": "{{name}} (you)",
|
|
173126
173244
|
"pptx.collaboration.usersConnected": "{{count}} user(s) connected",
|
|
173245
|
+
"pptx.collaboration.editable": "Editable",
|
|
173246
|
+
"pptx.collaboration.shellStatusLabel": "Collaboration status",
|
|
173127
173247
|
"pptx.collaboration.moreUsers": "{{count}} more user(s)",
|
|
173128
173248
|
"pptx.collaboration.onePersonHere": "1 person here",
|
|
173129
173249
|
"pptx.collaboration.peopleHere": "{{count}} people here",
|
|
@@ -179004,11 +179124,16 @@ function buildParagraphs(element, fieldContext, segmentOverrides, options) {
|
|
|
179004
179124
|
}
|
|
179005
179125
|
var sessions = /* @__PURE__ */ new WeakMap();
|
|
179006
179126
|
var nextSession = 0;
|
|
179007
|
-
function createInlineListSeed(element) {
|
|
179008
|
-
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))) {
|
|
179009
179129
|
return void 0;
|
|
179010
179130
|
}
|
|
179011
|
-
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) };
|
|
179012
179137
|
const paragraphs2 = [{ segments: [] }];
|
|
179013
179138
|
const indices = [[]];
|
|
179014
179139
|
for (const [index, segment] of segments.entries()) {
|
|
@@ -179236,6 +179361,54 @@ function clearSingleTextDecoration(node, blockRoot) {
|
|
|
179236
179361
|
ancestor = ancestor.parentElement;
|
|
179237
179362
|
}
|
|
179238
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
|
+
}
|
|
179239
179412
|
function inlineListStyleDelta(node, baseline = "", inheritedColor) {
|
|
179240
179413
|
const style = {};
|
|
179241
179414
|
const original = node.ownerDocument.createElement("span").style;
|
|
@@ -179294,6 +179467,11 @@ function bodyOnly(segment) {
|
|
|
179294
179467
|
}
|
|
179295
179468
|
function readInlineListRuns(session, block, bodyStyle) {
|
|
179296
179469
|
const runs = [];
|
|
179470
|
+
const origins = [];
|
|
179471
|
+
const push2 = (segment, node) => {
|
|
179472
|
+
runs.push(segment);
|
|
179473
|
+
origins.push(node);
|
|
179474
|
+
};
|
|
179297
179475
|
let unsupported = false;
|
|
179298
179476
|
let unchanged22 = true;
|
|
179299
179477
|
let placeholder = false;
|
|
@@ -179307,10 +179485,10 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179307
179485
|
const style2 = { ...inherited, ...parentDelta };
|
|
179308
179486
|
for (const [index2, text22] of node.nodeValue.split("\n").entries()) {
|
|
179309
179487
|
if (index2 > 0) {
|
|
179310
|
-
|
|
179488
|
+
push2({ text: "\n", style: { ...style2 }, isLineBreak: true }, node);
|
|
179311
179489
|
}
|
|
179312
179490
|
if (text22) {
|
|
179313
|
-
|
|
179491
|
+
push2({ text: text22, style: { ...style2 } }, node);
|
|
179314
179492
|
}
|
|
179315
179493
|
}
|
|
179316
179494
|
}
|
|
@@ -179342,7 +179520,7 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179342
179520
|
const oldChildren = originalIndex === void 0 ? void 0 : session.runChildren.get(originalIndex);
|
|
179343
179521
|
const intact = originalIndex !== void 0 && node.innerHTML === session.runHtml.get(originalIndex) && children13.length === oldChildren?.length && children13.every((child27, childIndex) => child27 === oldChildren[childIndex]);
|
|
179344
179522
|
if (intact && original) {
|
|
179345
|
-
|
|
179523
|
+
push2({ ...bodyOnly(original), style }, node);
|
|
179346
179524
|
unchanged22 &&= index === originalIndex && Object.keys(delta).length === 0;
|
|
179347
179525
|
return;
|
|
179348
179526
|
}
|
|
@@ -179356,7 +179534,7 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179356
179534
|
return;
|
|
179357
179535
|
}
|
|
179358
179536
|
if (node.tagName === "BR") {
|
|
179359
|
-
|
|
179537
|
+
push2({ text: "\n", style, isLineBreak: true }, node);
|
|
179360
179538
|
placeholder = original?.isLineBreak !== true;
|
|
179361
179539
|
return;
|
|
179362
179540
|
}
|
|
@@ -179366,9 +179544,9 @@ function readInlineListRuns(session, block, bodyStyle) {
|
|
|
179366
179544
|
};
|
|
179367
179545
|
walk2(block, bodyStyle);
|
|
179368
179546
|
if (runs.length === 1 && runs[0].isLineBreak && placeholder) {
|
|
179369
|
-
return { runs: [{ text: "", style: runs[0].style }], unchanged: false };
|
|
179547
|
+
return { runs: [{ text: "", style: runs[0].style }], origins: [block], unchanged: false };
|
|
179370
179548
|
}
|
|
179371
|
-
return unsupported ? void 0 : { runs, unchanged: unchanged22 };
|
|
179549
|
+
return unsupported ? void 0 : { runs, origins, unchanged: unchanged22 };
|
|
179372
179550
|
}
|
|
179373
179551
|
function hasOnlyCaretPlaceholder(element) {
|
|
179374
179552
|
const content = Array.from(element.childNodes).filter((child27) => {
|
|
@@ -179440,6 +179618,7 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179440
179618
|
return fallback("unsupported-paragraph-structure");
|
|
179441
179619
|
}
|
|
179442
179620
|
const segments = [];
|
|
179621
|
+
const origins = [];
|
|
179443
179622
|
const text22 = [];
|
|
179444
179623
|
const sequence = createAutoNumberSequence();
|
|
179445
179624
|
let unchanged22 = blocks.length === seed.paragraphs.length;
|
|
@@ -179460,7 +179639,7 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179460
179639
|
return fallback("unsupported-run-structure");
|
|
179461
179640
|
}
|
|
179462
179641
|
const { runs } = body;
|
|
179463
|
-
const bodyText = runs.map((run) => run.text).join("");
|
|
179642
|
+
const bodyText = runs.map((run) => run.isLineBreak ? "\n" : run.text).join("");
|
|
179464
179643
|
text22.push(bodyText);
|
|
179465
179644
|
unchanged22 &&= original === position2 && token2 === seed.paragraphs[position2].token && body.unchanged && bodyText === seed.paragraphs[position2].runs.map((run) => run.text).join("") && runs.every(
|
|
179466
179645
|
(run, index) => JSON.stringify(run.style) === JSON.stringify(seed.paragraphs[position2].runs[index]?.style)
|
|
@@ -179470,6 +179649,7 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179470
179649
|
text: "",
|
|
179471
179650
|
style: structuredClone(carrier?.paragraphInsertionStyle ?? carrier?.style ?? {})
|
|
179472
179651
|
});
|
|
179652
|
+
body.origins.push(block);
|
|
179473
179653
|
}
|
|
179474
179654
|
if (carrier) {
|
|
179475
179655
|
if (original !== void 0) {
|
|
@@ -179517,14 +179697,18 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179517
179697
|
delete first[key2];
|
|
179518
179698
|
}
|
|
179519
179699
|
runs.unshift(marker);
|
|
179700
|
+
body.origins.unshift(block);
|
|
179520
179701
|
}
|
|
179521
179702
|
if (position2 > 0) {
|
|
179522
179703
|
segments.push({ text: "\n", style: {}, isParagraphBreak: true });
|
|
179704
|
+
origins.push(void 0);
|
|
179523
179705
|
}
|
|
179524
179706
|
segments.push(...runs);
|
|
179707
|
+
origins.push(...body.origins);
|
|
179525
179708
|
}
|
|
179526
179709
|
const textSegments = unchanged22 ? structuredClone(session.originalSegments) : segments;
|
|
179527
179710
|
const snapshot = { elementId: seed.elementId, text: text22.join("\n"), textSegments };
|
|
179711
|
+
recordInlineListProvenance(seed, root, snapshot, blocks, origins, unchanged22);
|
|
179528
179712
|
return {
|
|
179529
179713
|
kind: "supported",
|
|
179530
179714
|
snapshot,
|
|
@@ -179533,6 +179717,12 @@ function readInlineListSnapshot(seed, root) {
|
|
|
179533
179717
|
})
|
|
179534
179718
|
};
|
|
179535
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
|
+
}
|
|
179536
179726
|
function paragraphBodies(segments) {
|
|
179537
179727
|
const paragraphs2 = [""];
|
|
179538
179728
|
let first = true;
|
|
@@ -179542,7 +179732,7 @@ function paragraphBodies(segments) {
|
|
|
179542
179732
|
first = true;
|
|
179543
179733
|
} else {
|
|
179544
179734
|
if (!first || !isBulletMarkerSegment(segment)) {
|
|
179545
|
-
paragraphs2[paragraphs2.length - 1] += segment.text;
|
|
179735
|
+
paragraphs2[paragraphs2.length - 1] += segment.isLineBreak ? "\n" : segment.text;
|
|
179546
179736
|
}
|
|
179547
179737
|
first = false;
|
|
179548
179738
|
}
|
|
@@ -179562,7 +179752,7 @@ function modelPoint(segments, offset, end) {
|
|
|
179562
179752
|
}
|
|
179563
179753
|
continue;
|
|
179564
179754
|
}
|
|
179565
|
-
const next = position2 + segment.text.length;
|
|
179755
|
+
const next = position2 + (first || segment.isLineBreak ? 1 : segment.text.length);
|
|
179566
179756
|
if (!first && !segment.isLineBreak) {
|
|
179567
179757
|
last = { index, offset: segment.text.length };
|
|
179568
179758
|
if (end ? offset <= next : offset < next || offset === position2 && next === position2) {
|
|
@@ -179574,18 +179764,30 @@ function modelPoint(segments, offset, end) {
|
|
|
179574
179764
|
return last;
|
|
179575
179765
|
}
|
|
179576
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) {
|
|
179577
179770
|
const read = readInlineListSnapshot(seed, root);
|
|
179578
179771
|
if (read.kind !== "supported") {
|
|
179579
179772
|
return { kind: "unsupported", reason: read.reason };
|
|
179580
179773
|
}
|
|
179581
179774
|
const { snapshot } = read;
|
|
179582
|
-
if (!
|
|
179775
|
+
if (!range) {
|
|
179583
179776
|
return { kind: "supported", snapshot, selection: null };
|
|
179584
179777
|
}
|
|
179585
|
-
const range = selection.getRangeAt(0);
|
|
179586
179778
|
if (!root.contains(range.startContainer) || !root.contains(range.endContainer)) {
|
|
179587
179779
|
return { kind: "unsupported", reason: "selection-outside-session" };
|
|
179588
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
|
+
}
|
|
179589
179791
|
const blocks = Array.from(root.children);
|
|
179590
179792
|
const bodies = paragraphBodies(snapshot.textSegments);
|
|
179591
179793
|
if (blocks.some(
|
|
@@ -185808,6 +186010,26 @@ function presenceToCursors(presence, activeSlideIndex) {
|
|
|
185808
186010
|
}
|
|
185809
186011
|
return cursors;
|
|
185810
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
|
+
}
|
|
185811
186033
|
function observeExternalCollaborationSession(session, onSnapshot) {
|
|
185812
186034
|
let active2 = true;
|
|
185813
186035
|
let subscribing = true;
|
|
@@ -186003,6 +186225,9 @@ function buildSegmentAttrs(seg) {
|
|
|
186003
186225
|
if (seg.paragraphInsertionStyle) {
|
|
186004
186226
|
a.pi = JSON.stringify(seg.paragraphInsertionStyle);
|
|
186005
186227
|
}
|
|
186228
|
+
if (seg.paragraphProperties) {
|
|
186229
|
+
a.pp = JSON.stringify(seg.paragraphProperties);
|
|
186230
|
+
}
|
|
186006
186231
|
if (typeof seg.fieldType === "string") {
|
|
186007
186232
|
a.ft = seg.fieldType;
|
|
186008
186233
|
}
|
|
@@ -186115,6 +186340,12 @@ function decodeDelta(delta) {
|
|
|
186115
186340
|
} catch {
|
|
186116
186341
|
}
|
|
186117
186342
|
}
|
|
186343
|
+
if (a.pp) {
|
|
186344
|
+
try {
|
|
186345
|
+
seg.paragraphProperties = JSON.parse(a.pp);
|
|
186346
|
+
} catch {
|
|
186347
|
+
}
|
|
186348
|
+
}
|
|
186118
186349
|
if (a.ft) {
|
|
186119
186350
|
seg.fieldType = a.ft;
|
|
186120
186351
|
}
|
|
@@ -186177,6 +186408,22 @@ function decodeDelta(delta) {
|
|
|
186177
186408
|
function decodeTextBody(ytext) {
|
|
186178
186409
|
return decodeDelta(ytext.toDelta());
|
|
186179
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
|
+
}
|
|
186180
186427
|
var YDOC_SLIDES_KEY = "pptx:slides";
|
|
186181
186428
|
var SCALAR_ELEMENT_KEYS = /* @__PURE__ */ new Set([
|
|
186182
186429
|
"id",
|
|
@@ -186430,6 +186677,9 @@ function readElementFromYMap(ymap, assets) {
|
|
|
186430
186677
|
}
|
|
186431
186678
|
});
|
|
186432
186679
|
readAssetFields(ymap, assets, element);
|
|
186680
|
+
if (Array.isArray(element.textSegments) && element.textSegments.length > 0) {
|
|
186681
|
+
element.text = inlineListBodyText(element.textSegments);
|
|
186682
|
+
}
|
|
186433
186683
|
return element;
|
|
186434
186684
|
}
|
|
186435
186685
|
function writeSlideToYMap(slide, ymap, factories, assets) {
|
|
@@ -186493,6 +186743,32 @@ function observeYDocSlides(ydoc, onChange) {
|
|
|
186493
186743
|
arr.observeDeep(onChange);
|
|
186494
186744
|
return () => arr.unobserveDeep(onChange);
|
|
186495
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
|
+
}
|
|
186496
186772
|
function isYTextEditable(value) {
|
|
186497
186773
|
return isYTextLike(value) && typeof value.delete === "function" && typeof value.format === "function";
|
|
186498
186774
|
}
|
|
@@ -186615,8 +186891,11 @@ var LOCAL_SYNC_ORIGIN = "pptx-viewer:local-sync";
|
|
|
186615
186891
|
function jsonEqual(a, b) {
|
|
186616
186892
|
return a === b || JSON.stringify(a) === JSON.stringify(b);
|
|
186617
186893
|
}
|
|
186618
|
-
function reconcileScalars(ymap, rec, keys) {
|
|
186894
|
+
function reconcileScalars(ymap, rec, keys, skipKey) {
|
|
186619
186895
|
for (const key2 of keys) {
|
|
186896
|
+
if (key2 === skipKey) {
|
|
186897
|
+
continue;
|
|
186898
|
+
}
|
|
186620
186899
|
const next = rec[key2];
|
|
186621
186900
|
const current = ymap.get(key2);
|
|
186622
186901
|
if (next === void 0) {
|
|
@@ -186665,9 +186944,12 @@ function reconcileElementTextBody(ymap, rec, factories) {
|
|
|
186665
186944
|
}
|
|
186666
186945
|
function reconcileElementYMap(ymap, element, factories, assets) {
|
|
186667
186946
|
const rec = element;
|
|
186668
|
-
|
|
186947
|
+
const ownsText = hasCollaborationTextLease(ymap, element);
|
|
186948
|
+
reconcileScalars(ymap, rec, SCALAR_ELEMENT_KEYS, ownsText ? "text" : void 0);
|
|
186669
186949
|
reconcileComplexFields(ymap, rec, COMPLEX_ELEMENT_FIELDS);
|
|
186670
|
-
|
|
186950
|
+
if (!ownsText) {
|
|
186951
|
+
reconcileElementTextBody(ymap, rec, factories);
|
|
186952
|
+
}
|
|
186671
186953
|
reconcileAssetFields(rec.id, rec, ymap, assets);
|
|
186672
186954
|
}
|
|
186673
186955
|
function mapIdAt(arr, index) {
|
|
@@ -186781,8 +187063,13 @@ function observeExternalCollaborationReadiness(session, options) {
|
|
|
186781
187063
|
}
|
|
186782
187064
|
};
|
|
186783
187065
|
const suspend = () => {
|
|
187066
|
+
const preserveAcceptedEdits = active2 && established && options.gate.isOpen();
|
|
186784
187067
|
options.gate.reset();
|
|
186785
187068
|
options.livePatcher?.configure(null, null);
|
|
187069
|
+
if (preserveAcceptedEdits) {
|
|
187070
|
+
lastAdopted = void 0;
|
|
187071
|
+
adopt(readSlidesFromYDoc(session.doc));
|
|
187072
|
+
}
|
|
186786
187073
|
options.onSuspend?.();
|
|
186787
187074
|
notifyReadOnly();
|
|
186788
187075
|
};
|
|
@@ -187039,6 +187326,576 @@ function applyLivePatch(doc, factories, patch, textPatchLimit) {
|
|
|
187039
187326
|
reconcileElementTextBody(ymap, { textSegments: segments }, factories);
|
|
187040
187327
|
}
|
|
187041
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
|
+
}
|
|
187042
187899
|
var LIVE_PATCH_THROTTLE_MS = 50;
|
|
187043
187900
|
function createCollaborationLivePatcher(options = {}) {
|
|
187044
187901
|
const throttleMs = options.throttleMs ?? LIVE_PATCH_THROTTLE_MS;
|
|
@@ -187048,6 +187905,17 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187048
187905
|
let timer = null;
|
|
187049
187906
|
let lastWriteAt = Number.NEGATIVE_INFINITY;
|
|
187050
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
|
+
};
|
|
187051
187919
|
const cancelTimer = () => {
|
|
187052
187920
|
if (timer !== null) {
|
|
187053
187921
|
clearTimeout(timer);
|
|
@@ -187095,7 +187963,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187095
187963
|
if (!doc || !factories || !elementId) {
|
|
187096
187964
|
return null;
|
|
187097
187965
|
}
|
|
187098
|
-
const key2 =
|
|
187966
|
+
const key2 = keyFor3(slideId, elementId);
|
|
187099
187967
|
let entry2 = pending.get(key2);
|
|
187100
187968
|
if (!entry2) {
|
|
187101
187969
|
entry2 = { slideId, elementId };
|
|
@@ -187104,6 +187972,53 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187104
187972
|
return entry2;
|
|
187105
187973
|
};
|
|
187106
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
|
+
},
|
|
187107
188022
|
configure(nextDoc, nextFactories, nextImmediate = false) {
|
|
187108
188023
|
if (nextDoc === doc && nextFactories === factories && nextImmediate === immediate) {
|
|
187109
188024
|
return;
|
|
@@ -187114,6 +188029,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187114
188029
|
factories = nextFactories;
|
|
187115
188030
|
immediate = nextImmediate;
|
|
187116
188031
|
lastWriteAt = Number.NEGATIVE_INFINITY;
|
|
188032
|
+
retireTextSessions();
|
|
187117
188033
|
},
|
|
187118
188034
|
isActive() {
|
|
187119
188035
|
return doc !== null && factories !== null;
|
|
@@ -187127,6 +188043,9 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187127
188043
|
schedule();
|
|
187128
188044
|
},
|
|
187129
188045
|
patchText(slideId, elementId, text22, source) {
|
|
188046
|
+
if (textOwners.has(keyFor3(slideId, elementId))) {
|
|
188047
|
+
return;
|
|
188048
|
+
}
|
|
187130
188049
|
const entry2 = enqueue(slideId, elementId);
|
|
187131
188050
|
if (!entry2) {
|
|
187132
188051
|
return;
|
|
@@ -187143,6 +188062,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
187143
188062
|
pending.clear();
|
|
187144
188063
|
doc = null;
|
|
187145
188064
|
factories = null;
|
|
188065
|
+
retireTextSessions();
|
|
187146
188066
|
}
|
|
187147
188067
|
};
|
|
187148
188068
|
}
|
|
@@ -187165,6 +188085,731 @@ function publishLiveGeometry(patcher, slideId, elementId, geometry) {
|
|
|
187165
188085
|
}
|
|
187166
188086
|
patcher.patchGeometry(slideId, elementId, geometry);
|
|
187167
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
|
+
}
|
|
187168
188813
|
function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
|
|
187169
188814
|
let opened = false;
|
|
187170
188815
|
let timer = null;
|
|
@@ -191228,6 +192873,362 @@ function collectCoherent3DOffNodeIds(nodes) {
|
|
|
191228
192873
|
}
|
|
191229
192874
|
return ids;
|
|
191230
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
|
+
}
|
|
191231
193232
|
var MAX_LISTED_NODES = 8;
|
|
191232
193233
|
var LAYOUT_LABELS = {
|
|
191233
193234
|
list: "List",
|
|
@@ -192417,10 +194418,18 @@ function computeSphericalCameraPlacement(maxExtent, targetY, view3D) {
|
|
|
192417
194418
|
fov
|
|
192418
194419
|
};
|
|
192419
194420
|
}
|
|
192420
|
-
function computeCartesianCameraPlacement(cols, rows, view3D) {
|
|
194421
|
+
function computeCartesianCameraPlacement(cols, rows, view3D, horizontal = false) {
|
|
192421
194422
|
const { gridWidth, gridDepth } = computeCartesianGridExtent(cols, rows, view3D?.depthPercent);
|
|
192422
194423
|
const maxExtent = Math.max(gridWidth, gridDepth, MAX_VALUE_HEIGHT);
|
|
192423
|
-
|
|
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
|
+
};
|
|
192424
194433
|
}
|
|
192425
194434
|
function buildCartesianChart3DLabels(cols, rows, categoryLabels, seriesNames, depthPercent, maxCat = 8, maxSer = 6, horizontal = false) {
|
|
192426
194435
|
const { gridWidth, gridDepth } = computeCartesianGridExtent(cols, rows, depthPercent);
|
|
@@ -192869,7 +194878,12 @@ async function mountBarChart3D(container, options, interaction) {
|
|
|
192869
194878
|
const fill = new three.DirectionalLight(16777215, 0.3);
|
|
192870
194879
|
fill.position.set(-3, 4, -2);
|
|
192871
194880
|
scene.add(fill);
|
|
192872
|
-
const placement = computeCartesianCameraPlacement(
|
|
194881
|
+
const placement = computeCartesianCameraPlacement(
|
|
194882
|
+
options.cols,
|
|
194883
|
+
options.rows,
|
|
194884
|
+
options.view3D,
|
|
194885
|
+
options.horizontal
|
|
194886
|
+
);
|
|
192873
194887
|
const camera = new three.PerspectiveCamera(placement.fov, width / height, 0.1, 1e3);
|
|
192874
194888
|
camera.position.set(...placement.position);
|
|
192875
194889
|
const target = new three.Vector3(...placement.target);
|
|
@@ -194284,344 +196298,6 @@ function buildPieChart3DDataForElement(element, options) {
|
|
|
194284
196298
|
const categoryLabels = chartData.categories.length > 0 ? chartData.categories : Array.from({ length: pieSeries.values.length }, (_, i2) => String(i2 + 1));
|
|
194285
196299
|
return buildPieChart3DData(chartData, categoryLabels, options);
|
|
194286
196300
|
}
|
|
194287
|
-
function estimatedGlyphAdvanceRatio(glyph) {
|
|
194288
|
-
if (/\p{Mark}/u.test(glyph)) {
|
|
194289
|
-
return 0;
|
|
194290
|
-
}
|
|
194291
|
-
if (/\s/u.test(glyph)) {
|
|
194292
|
-
return 0.33;
|
|
194293
|
-
}
|
|
194294
|
-
if (/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]/u.test(
|
|
194295
|
-
glyph
|
|
194296
|
-
)) {
|
|
194297
|
-
return 1;
|
|
194298
|
-
}
|
|
194299
|
-
if (/[A-Z]/u.test(glyph)) {
|
|
194300
|
-
return 0.65;
|
|
194301
|
-
}
|
|
194302
|
-
if (/[a-z0-9]/u.test(glyph)) {
|
|
194303
|
-
return 0.55;
|
|
194304
|
-
}
|
|
194305
|
-
if (/[,.;:!?()\u005b\u005d{}'"`\-_/\\]/u.test(glyph)) {
|
|
194306
|
-
return 0.35;
|
|
194307
|
-
}
|
|
194308
|
-
return 0.6;
|
|
194309
|
-
}
|
|
194310
|
-
function estimatedTextWidth(glyphs, fontSize) {
|
|
194311
|
-
return glyphs.reduce((sum, glyph) => sum + estimatedGlyphAdvanceRatio(glyph) * fontSize, 0);
|
|
194312
|
-
}
|
|
194313
|
-
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;
|
|
194314
|
-
var BREAKABLE_GLYPH_RE = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]$/u;
|
|
194315
|
-
function estimatedWrapUnits(text22) {
|
|
194316
|
-
const units = [];
|
|
194317
|
-
let unbreakableRun = "";
|
|
194318
|
-
const flushRun = () => {
|
|
194319
|
-
if (unbreakableRun.length > 0) {
|
|
194320
|
-
units.push(unbreakableRun);
|
|
194321
|
-
unbreakableRun = "";
|
|
194322
|
-
}
|
|
194323
|
-
};
|
|
194324
|
-
for (const glyph of Array.from(text22)) {
|
|
194325
|
-
if (/\s/u.test(glyph) || BREAKABLE_GLYPH_RE.test(glyph)) {
|
|
194326
|
-
flushRun();
|
|
194327
|
-
units.push(glyph);
|
|
194328
|
-
} else {
|
|
194329
|
-
unbreakableRun += glyph;
|
|
194330
|
-
}
|
|
194331
|
-
}
|
|
194332
|
-
flushRun();
|
|
194333
|
-
return units;
|
|
194334
|
-
}
|
|
194335
|
-
function wrapTextByEstimatedWidth(text22, maxWidth, fontSize, options = {}) {
|
|
194336
|
-
if (!text22 || text22.trim().length === 0) {
|
|
194337
|
-
return [];
|
|
194338
|
-
}
|
|
194339
|
-
if (!(maxWidth > 0) || !(fontSize > 0)) {
|
|
194340
|
-
return [];
|
|
194341
|
-
}
|
|
194342
|
-
const lines = [];
|
|
194343
|
-
for (const paragraph of text22.split(/\r?\n/u)) {
|
|
194344
|
-
if (paragraph.trim().length === 0) {
|
|
194345
|
-
if (options.keepBlankLines) {
|
|
194346
|
-
lines.push("");
|
|
194347
|
-
}
|
|
194348
|
-
continue;
|
|
194349
|
-
}
|
|
194350
|
-
let current = "";
|
|
194351
|
-
let pendingWhitespace = false;
|
|
194352
|
-
for (const unit of estimatedWrapUnits(paragraph)) {
|
|
194353
|
-
if (/^\s+$/u.test(unit)) {
|
|
194354
|
-
pendingWhitespace = current.length > 0;
|
|
194355
|
-
continue;
|
|
194356
|
-
}
|
|
194357
|
-
const separator = pendingWhitespace && current.length > 0 ? " " : "";
|
|
194358
|
-
const candidate = `${current}${separator}${unit}`;
|
|
194359
|
-
if (current.length === 0 || estimatedTextWidth(Array.from(candidate), fontSize) <= maxWidth) {
|
|
194360
|
-
current = candidate;
|
|
194361
|
-
pendingWhitespace = false;
|
|
194362
|
-
continue;
|
|
194363
|
-
}
|
|
194364
|
-
if (HANGING_PUNCTUATION_RE.test(unit)) {
|
|
194365
|
-
current += unit;
|
|
194366
|
-
pendingWhitespace = false;
|
|
194367
|
-
continue;
|
|
194368
|
-
}
|
|
194369
|
-
lines.push(current);
|
|
194370
|
-
current = unit;
|
|
194371
|
-
pendingWhitespace = false;
|
|
194372
|
-
}
|
|
194373
|
-
const completed = current.trimEnd();
|
|
194374
|
-
if (completed.length > 0) {
|
|
194375
|
-
lines.push(completed);
|
|
194376
|
-
}
|
|
194377
|
-
}
|
|
194378
|
-
return lines;
|
|
194379
|
-
}
|
|
194380
|
-
var LINE_HEIGHT_RATIO = 1.2;
|
|
194381
|
-
function centeredSvgTextLines(text22, fontSize, options = {}) {
|
|
194382
|
-
const lines = options.maxWidth !== void 0 ? wrapTextByEstimatedWidth(text22, options.maxWidth, fontSize) : text22.split("\n").filter((line4) => line4.length > 0);
|
|
194383
|
-
const centerY = options.centerY ?? 0;
|
|
194384
|
-
if (lines.length === 0) {
|
|
194385
|
-
return [{ text: "", y: centerY }];
|
|
194386
|
-
}
|
|
194387
|
-
const lineHeight = options.lineHeight ?? fontSize * (options.lineHeightRatio ?? LINE_HEIGHT_RATIO);
|
|
194388
|
-
const blockTop = centerY - lines.length * lineHeight / 2;
|
|
194389
|
-
return lines.map((line4, index) => ({
|
|
194390
|
-
text: line4,
|
|
194391
|
-
y: blockTop + lineHeight / 2 + index * lineHeight
|
|
194392
|
-
}));
|
|
194393
|
-
}
|
|
194394
|
-
var PALETTES = {
|
|
194395
|
-
colorful1: ["#3b82f6", "#22c55e", "#f97316", "#eab308", "#a855f7", "#ec4899"],
|
|
194396
|
-
colorful2: ["#6366f1", "#14b8a6", "#f59e0b", "#ef4444", "#8b5cf6", "#06b6d4"],
|
|
194397
|
-
colorful3: ["#0ea5e9", "#84cc16", "#f43e5e", "#a855f7", "#f97316", "#10b981"],
|
|
194398
|
-
monochromatic1: ["#3b82f6", "#60a5fa", "#93c5fd", "#bfdbfe", "#2563eb", "#1d4ed8"],
|
|
194399
|
-
monochromatic2: ["#6366f1", "#818cf8", "#a5b4fc", "#c7d2fe", "#4f46e5", "#4338ca"]
|
|
194400
|
-
};
|
|
194401
|
-
var DEFAULT_PALETTE2 = PALETTES.colorful1;
|
|
194402
|
-
function paletteColour(index, palette) {
|
|
194403
|
-
return palette[index % palette.length];
|
|
194404
|
-
}
|
|
194405
|
-
function resolvePalette(data) {
|
|
194406
|
-
if (!data) {
|
|
194407
|
-
return DEFAULT_PALETTE2;
|
|
194408
|
-
}
|
|
194409
|
-
const ctFills = data.colorTransform?.fillColors;
|
|
194410
|
-
if (ctFills && ctFills.length > 0) {
|
|
194411
|
-
return ctFills;
|
|
194412
|
-
}
|
|
194413
|
-
return PALETTES[data.colorScheme ?? "colorful1"] ?? DEFAULT_PALETTE2;
|
|
194414
|
-
}
|
|
194415
|
-
function buildChromeStyle(chrome) {
|
|
194416
|
-
const s = {
|
|
194417
|
-
width: "100%",
|
|
194418
|
-
height: "100%",
|
|
194419
|
-
"box-sizing": "border-box",
|
|
194420
|
-
overflow: "hidden"
|
|
194421
|
-
};
|
|
194422
|
-
if (!chrome) {
|
|
194423
|
-
return s;
|
|
194424
|
-
}
|
|
194425
|
-
if (chrome.backgroundColor) {
|
|
194426
|
-
s["background-color"] = chrome.backgroundColor;
|
|
194427
|
-
}
|
|
194428
|
-
if (chrome.outlineColor) {
|
|
194429
|
-
s["border"] = `${chrome.outlineWidth ?? 1}px solid ${chrome.outlineColor}`;
|
|
194430
|
-
}
|
|
194431
|
-
return s;
|
|
194432
|
-
}
|
|
194433
|
-
var TEXT_WIDTH_FRACTION = 0.82;
|
|
194434
|
-
var CJK_SMARTART_TEXT_RE = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
|
|
194435
|
-
var CJK_SMARTART_LINE_HEIGHT_RATIO = 1.33;
|
|
194436
|
-
var DEFAULT_SMARTART_LINE_HEIGHT_RATIO = 1.2;
|
|
194437
|
-
function drawingTextBaseLineHeightRatio(text22) {
|
|
194438
|
-
return CJK_SMARTART_TEXT_RE.test(text22 ?? "") ? CJK_SMARTART_LINE_HEIGHT_RATIO : DEFAULT_SMARTART_LINE_HEIGHT_RATIO;
|
|
194439
|
-
}
|
|
194440
|
-
function underlyingFill(shape, shapes, index) {
|
|
194441
|
-
const centerX = shape.x + shape.width / 2;
|
|
194442
|
-
const centerY = shape.y + shape.height / 2;
|
|
194443
|
-
for (let below = index - 1; below >= 0; below--) {
|
|
194444
|
-
const candidate = shapes[below];
|
|
194445
|
-
if (!candidate || candidate.fillNone || !candidate.fillColor) {
|
|
194446
|
-
continue;
|
|
194447
|
-
}
|
|
194448
|
-
if (centerX >= candidate.x && centerX <= candidate.x + candidate.width && centerY >= candidate.y && centerY <= candidate.y + candidate.height) {
|
|
194449
|
-
return candidate.fillColor;
|
|
194450
|
-
}
|
|
194451
|
-
}
|
|
194452
|
-
return void 0;
|
|
194453
|
-
}
|
|
194454
|
-
function drawingShapeLabelColor(shape, shapes, index, resolvedFill) {
|
|
194455
|
-
const basis = resolvedFill === "none" || resolvedFill.startsWith("url(") ? underlyingFill(shape, shapes, index) : resolvedFill;
|
|
194456
|
-
return basis ? contrastTextColor(basis) : "#1a1a1a";
|
|
194457
|
-
}
|
|
194458
|
-
function computeDrawingViewBox(shapes) {
|
|
194459
|
-
let minX = Infinity;
|
|
194460
|
-
let minY = Infinity;
|
|
194461
|
-
let maxX = -Infinity;
|
|
194462
|
-
let maxY = -Infinity;
|
|
194463
|
-
for (const s of shapes) {
|
|
194464
|
-
const shapeMinX = Math.min(s.x, s.textFrameX ?? s.x);
|
|
194465
|
-
const shapeMinY = Math.min(s.y, s.textFrameY ?? s.y);
|
|
194466
|
-
const shapeMaxX = Math.max(
|
|
194467
|
-
s.x + s.width,
|
|
194468
|
-
(s.textFrameX ?? s.x) + (s.textFrameWidth ?? s.width)
|
|
194469
|
-
);
|
|
194470
|
-
const shapeMaxY = Math.max(
|
|
194471
|
-
s.y + s.height,
|
|
194472
|
-
(s.textFrameY ?? s.y) + (s.textFrameHeight ?? s.height)
|
|
194473
|
-
);
|
|
194474
|
-
if (shapeMinX < minX) {
|
|
194475
|
-
minX = shapeMinX;
|
|
194476
|
-
}
|
|
194477
|
-
if (shapeMinY < minY) {
|
|
194478
|
-
minY = shapeMinY;
|
|
194479
|
-
}
|
|
194480
|
-
if (shapeMaxX > maxX) {
|
|
194481
|
-
maxX = shapeMaxX;
|
|
194482
|
-
}
|
|
194483
|
-
if (shapeMaxY > maxY) {
|
|
194484
|
-
maxY = shapeMaxY;
|
|
194485
|
-
}
|
|
194486
|
-
}
|
|
194487
|
-
if (!Number.isFinite(minX)) {
|
|
194488
|
-
return { minX: 0, minY: 0, width: 1, height: 1 };
|
|
194489
|
-
}
|
|
194490
|
-
return {
|
|
194491
|
-
minX,
|
|
194492
|
-
minY,
|
|
194493
|
-
width: maxX - minX || 1,
|
|
194494
|
-
height: maxY - minY || 1
|
|
194495
|
-
};
|
|
194496
|
-
}
|
|
194497
|
-
function resolveGradient(shape, id) {
|
|
194498
|
-
const stops = shape.fillGradientStops;
|
|
194499
|
-
if (!stops || stops.length === 0) {
|
|
194500
|
-
return void 0;
|
|
194501
|
-
}
|
|
194502
|
-
const mapped = stops.map((stop) => ({
|
|
194503
|
-
offset: `${Math.max(0, Math.min(100, stop.position))}%`,
|
|
194504
|
-
color: stop.color,
|
|
194505
|
-
...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
|
|
194506
|
-
}));
|
|
194507
|
-
if (shape.fillGradientType === "radial") {
|
|
194508
|
-
return { id, kind: "radial", cx: "50%", cy: "50%", r: "50%", stops: mapped };
|
|
194509
|
-
}
|
|
194510
|
-
const radians = (shape.fillGradientAngle ?? 0) * Math.PI / 180;
|
|
194511
|
-
const dx = Math.cos(radians) / 2;
|
|
194512
|
-
const dy = Math.sin(radians) / 2;
|
|
194513
|
-
return {
|
|
194514
|
-
id,
|
|
194515
|
-
kind: "linear",
|
|
194516
|
-
x1: `${(0.5 - dx) * 100}%`,
|
|
194517
|
-
y1: `${(0.5 - dy) * 100}%`,
|
|
194518
|
-
x2: `${(0.5 + dx) * 100}%`,
|
|
194519
|
-
y2: `${(0.5 + dy) * 100}%`,
|
|
194520
|
-
stops: mapped
|
|
194521
|
-
};
|
|
194522
|
-
}
|
|
194523
|
-
function resolveShapeKind(shape, hasImage) {
|
|
194524
|
-
if (hasImage) {
|
|
194525
|
-
return "image";
|
|
194526
|
-
}
|
|
194527
|
-
const normalized = (shape.shapeType ?? "").trim().toLowerCase();
|
|
194528
|
-
if (normalized === "ellipse" || normalized === "oval") {
|
|
194529
|
-
return "ellipse";
|
|
194530
|
-
}
|
|
194531
|
-
const identityPresets = /* @__PURE__ */ new Set(["rect", "flowchartprocess", "roundrect"]);
|
|
194532
|
-
return identityPresets.has(normalized) || normalized.length === 0 ? "rect" : "path";
|
|
194533
|
-
}
|
|
194534
|
-
function drawingShapeTransform(shape, cx, cy) {
|
|
194535
|
-
const transforms = [];
|
|
194536
|
-
if (shape.rotation) {
|
|
194537
|
-
transforms.push(`rotate(${shape.rotation} ${cx} ${cy})`);
|
|
194538
|
-
}
|
|
194539
|
-
if (shape.flipHorizontal || shape.flipVertical) {
|
|
194540
|
-
transforms.push(
|
|
194541
|
-
`translate(${cx} ${cy}) scale(${shape.flipHorizontal ? -1 : 1} ${shape.flipVertical ? -1 : 1}) translate(${-cx} ${-cy})`
|
|
194542
|
-
);
|
|
194543
|
-
}
|
|
194544
|
-
return transforms.length > 0 ? transforms.join(" ") : void 0;
|
|
194545
|
-
}
|
|
194546
|
-
function projectDrawingShapes(elementId, shapes, viewBox, palette, style) {
|
|
194547
|
-
const { minX, minY } = viewBox;
|
|
194548
|
-
const sw = styleStroke(style);
|
|
194549
|
-
return shapes.map((shape, i2) => {
|
|
194550
|
-
const gradient = shape.fillNone ? void 0 : resolveGradient(shape, `${elementId}-dspgrad-${shape.id}-${i2}`);
|
|
194551
|
-
const fill = shape.fillNone ? "none" : gradient ? `url(#${gradient.id})` : shape.fillPatternForegroundColor ?? shape.fillColor ?? paletteColour(i2, palette);
|
|
194552
|
-
const relX = shape.x - minX;
|
|
194553
|
-
const relY = shape.y - minY;
|
|
194554
|
-
const kind = resolveShapeKind(shape, Boolean(shape.fillImageUrl));
|
|
194555
|
-
const rx = getShapeType(shape.shapeType) === "roundRect" ? Math.min(shape.width, shape.height) * 0.1 : 0;
|
|
194556
|
-
const cx = relX + shape.width / 2;
|
|
194557
|
-
const cy = relY + shape.height / 2;
|
|
194558
|
-
const stroke = shape.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none");
|
|
194559
|
-
const transform6 = drawingShapeTransform(shape, cx, cy);
|
|
194560
|
-
const presetGeometry = kind === "path" ? getPresetShapeVectorGeometry(
|
|
194561
|
-
shape.shapeType,
|
|
194562
|
-
shape.width,
|
|
194563
|
-
shape.height,
|
|
194564
|
-
shape.shapeAdjustments
|
|
194565
|
-
) : void 0;
|
|
194566
|
-
const fontSize = shape.fontSize ?? Math.max(8, Math.min(14, shape.height * 0.2));
|
|
194567
|
-
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;
|
|
194568
|
-
const textFrameX = (hasTextFrame ? shape.textFrameX : shape.x) - minX;
|
|
194569
|
-
const textFrameY = (hasTextFrame ? shape.textFrameY : shape.y) - minY;
|
|
194570
|
-
const textFrameWidth = hasTextFrame ? shape.textFrameWidth : shape.width;
|
|
194571
|
-
const textFrameHeight = hasTextFrame ? shape.textFrameHeight : shape.height;
|
|
194572
|
-
const textInsetLeft = shape.textInsetLeft ?? 0;
|
|
194573
|
-
const textInsetRight = shape.textInsetRight ?? 0;
|
|
194574
|
-
const textInsetTop = shape.textInsetTop ?? 0;
|
|
194575
|
-
const textInsetBottom = shape.textInsetBottom ?? 0;
|
|
194576
|
-
const textContentWidth = Math.max(1, textFrameWidth - textInsetLeft - textInsetRight);
|
|
194577
|
-
const textContentHeight = Math.max(1, textFrameHeight - textInsetTop - textInsetBottom);
|
|
194578
|
-
const textCenterX = textFrameX + textInsetLeft + textContentWidth / 2;
|
|
194579
|
-
const textCenterY = textFrameY + textInsetTop + textContentHeight / 2;
|
|
194580
|
-
const textWrapWidth = hasTextFrame ? textContentWidth : shape.width * TEXT_WIDTH_FRACTION;
|
|
194581
|
-
const authoredLineHeightRatio = shape.lineHeightRatio ?? 1;
|
|
194582
|
-
const lineHeightRatio = drawingTextBaseLineHeightRatio(shape.text) * authoredLineHeightRatio + (shape.lineSpacingAfterRatio ?? 0);
|
|
194583
|
-
const lineHeight = shape.lineHeight !== void 0 || shape.lineSpacingAfter !== void 0 ? (shape.lineHeight ?? fontSize * drawingTextBaseLineHeightRatio(shape.text) * authoredLineHeightRatio) + (shape.lineSpacingAfter ?? 0) : void 0;
|
|
194584
|
-
return {
|
|
194585
|
-
key: `${elementId}-dsp-${shape.id}-${i2}`,
|
|
194586
|
-
kind,
|
|
194587
|
-
...presetGeometry ? {
|
|
194588
|
-
pathData: presetGeometry.d,
|
|
194589
|
-
pathTransform: [transform6, `translate(${relX} ${relY})`].filter(Boolean).join(" ")
|
|
194590
|
-
} : {},
|
|
194591
|
-
...gradient ? { gradient } : {},
|
|
194592
|
-
x: relX,
|
|
194593
|
-
y: relY,
|
|
194594
|
-
width: shape.width,
|
|
194595
|
-
height: shape.height,
|
|
194596
|
-
rx,
|
|
194597
|
-
cx,
|
|
194598
|
-
cy,
|
|
194599
|
-
fill,
|
|
194600
|
-
stroke,
|
|
194601
|
-
strokeWidth: shape.strokeWidth ?? sw,
|
|
194602
|
-
transform: transform6,
|
|
194603
|
-
imageUrl: shape.fillImageUrl,
|
|
194604
|
-
textLines: shape.text ? centeredSvgTextLines(shape.text, fontSize, {
|
|
194605
|
-
maxWidth: textWrapWidth,
|
|
194606
|
-
centerY: textCenterY,
|
|
194607
|
-
lineHeight,
|
|
194608
|
-
lineHeightRatio
|
|
194609
|
-
}) : [],
|
|
194610
|
-
textX: textCenterX,
|
|
194611
|
-
textY: textCenterY,
|
|
194612
|
-
textWidth: textContentWidth,
|
|
194613
|
-
textHeight: textContentHeight,
|
|
194614
|
-
fontColor: shape.fontColor ?? drawingShapeLabelColor(shape, shapes, i2, fill),
|
|
194615
|
-
fontSize,
|
|
194616
|
-
fontFamily: shape.fontFamily ? getSubstituteFontFamily(shape.fontFamily) : void 0,
|
|
194617
|
-
fontWeight: shape.fontWeight,
|
|
194618
|
-
fontStyle: shape.fontStyle
|
|
194619
|
-
};
|
|
194620
|
-
});
|
|
194621
|
-
}
|
|
194622
|
-
function styleShadowFilter(style) {
|
|
194623
|
-
return styleShadow(style);
|
|
194624
|
-
}
|
|
194625
196301
|
function collectFontsFromElement(element, fonts) {
|
|
194626
196302
|
if (hasTextProperties(element)) {
|
|
194627
196303
|
if (element.textStyle?.fontFamily) {
|
|
@@ -195074,117 +196750,6 @@ async function saveAutosaveSnapshot(filePath, data) {
|
|
|
195074
196750
|
return putAutosaveRecord(filePath, data);
|
|
195075
196751
|
}
|
|
195076
196752
|
}
|
|
195077
|
-
var AUTOSAVE_RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
195078
|
-
var CONSUMED_KEY = "pptx-viewer-recovery-consumed";
|
|
195079
|
-
function markAutosaveSnapshotConsumed(timestamp) {
|
|
195080
|
-
try {
|
|
195081
|
-
if (typeof sessionStorage === "undefined" || !Number.isFinite(timestamp)) {
|
|
195082
|
-
return;
|
|
195083
|
-
}
|
|
195084
|
-
const previous = consumedAutosaveSnapshotTimestamp();
|
|
195085
|
-
if (timestamp > previous) {
|
|
195086
|
-
sessionStorage.setItem(CONSUMED_KEY, String(timestamp));
|
|
195087
|
-
}
|
|
195088
|
-
} catch {
|
|
195089
|
-
}
|
|
195090
|
-
}
|
|
195091
|
-
function consumedAutosaveSnapshotTimestamp() {
|
|
195092
|
-
try {
|
|
195093
|
-
if (typeof sessionStorage === "undefined") {
|
|
195094
|
-
return 0;
|
|
195095
|
-
}
|
|
195096
|
-
const raw = sessionStorage.getItem(CONSUMED_KEY);
|
|
195097
|
-
const value = raw === null ? Number.NaN : Number(raw);
|
|
195098
|
-
return Number.isFinite(value) ? value : 0;
|
|
195099
|
-
} catch {
|
|
195100
|
-
return 0;
|
|
195101
|
-
}
|
|
195102
|
-
}
|
|
195103
|
-
function shouldProbeAutosaveRecovery(input) {
|
|
195104
|
-
return !input.alreadyChecked && input.autosaveAllowed && Boolean(input.filePath) && !input.loading && !input.error && input.slideCount > 0;
|
|
195105
|
-
}
|
|
195106
|
-
function formatSnapshotSize(bytes) {
|
|
195107
|
-
if (!Number.isFinite(bytes) || bytes <= 0) {
|
|
195108
|
-
return "0 KB";
|
|
195109
|
-
}
|
|
195110
|
-
if (bytes < 1024 * 1024) {
|
|
195111
|
-
return `${Math.max(1, Math.round(bytes / 1024))} KB`;
|
|
195112
|
-
}
|
|
195113
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
195114
|
-
}
|
|
195115
|
-
function ageKeyFor(ageMinutes) {
|
|
195116
|
-
if (ageMinutes < 1) {
|
|
195117
|
-
return { key: "pptx.autosave.justNow", count: 0 };
|
|
195118
|
-
}
|
|
195119
|
-
if (ageMinutes === 1) {
|
|
195120
|
-
return { key: "pptx.autosave.oneMinAgo", count: 1 };
|
|
195121
|
-
}
|
|
195122
|
-
if (ageMinutes < 60) {
|
|
195123
|
-
return { key: "pptx.autosave.minutesAgo", count: ageMinutes };
|
|
195124
|
-
}
|
|
195125
|
-
return { key: "pptx.autosave.recovery.hoursAgo", count: Math.floor(ageMinutes / 60) };
|
|
195126
|
-
}
|
|
195127
|
-
function autosaveRecoveryPrompt(input) {
|
|
195128
|
-
const record2 = input.record;
|
|
195129
|
-
if (!record2 || record2.size <= 0 || !record2.key) {
|
|
195130
|
-
return null;
|
|
195131
|
-
}
|
|
195132
|
-
const age = input.now - record2.timestamp;
|
|
195133
|
-
if (!Number.isFinite(age) || age < 0 || age >= AUTOSAVE_RECOVERY_WINDOW_MS) {
|
|
195134
|
-
return null;
|
|
195135
|
-
}
|
|
195136
|
-
if (record2.timestamp <= (input.consumedTimestamp ?? 0)) {
|
|
195137
|
-
return null;
|
|
195138
|
-
}
|
|
195139
|
-
const ageMinutes = Math.floor(age / 6e4);
|
|
195140
|
-
const relative = ageKeyFor(ageMinutes);
|
|
195141
|
-
return {
|
|
195142
|
-
filePath: record2.key,
|
|
195143
|
-
timestamp: record2.timestamp,
|
|
195144
|
-
size: record2.size,
|
|
195145
|
-
ageMinutes,
|
|
195146
|
-
titleKey: "pptx.autosave.recovery.title",
|
|
195147
|
-
messageKey: "pptx.autosave.recovery.message",
|
|
195148
|
-
messageParams: { file: record2.key, size: formatSnapshotSize(record2.size) },
|
|
195149
|
-
ageKey: relative.key,
|
|
195150
|
-
ageParams: { count: relative.count },
|
|
195151
|
-
restoreKey: "pptx.autosave.recovery.restore",
|
|
195152
|
-
discardKey: "pptx.autosave.recovery.discard"
|
|
195153
|
-
};
|
|
195154
|
-
}
|
|
195155
|
-
function shouldShowAutosaveRecoveryPrompt(input) {
|
|
195156
|
-
return Boolean(input.prompt) && !input.presenting;
|
|
195157
|
-
}
|
|
195158
|
-
async function probeAutosaveRecovery(filePath, now = Date.now()) {
|
|
195159
|
-
if (typeof indexedDB === "undefined") {
|
|
195160
|
-
return null;
|
|
195161
|
-
}
|
|
195162
|
-
try {
|
|
195163
|
-
const record2 = await getAutosaveSnapshot(filePath);
|
|
195164
|
-
const prompt = autosaveRecoveryPrompt({
|
|
195165
|
-
record: record2 ? { key: record2.key, timestamp: record2.timestamp, size: record2.size } : void 0,
|
|
195166
|
-
now,
|
|
195167
|
-
consumedTimestamp: consumedAutosaveSnapshotTimestamp()
|
|
195168
|
-
});
|
|
195169
|
-
if (!prompt || !record2) {
|
|
195170
|
-
return null;
|
|
195171
|
-
}
|
|
195172
|
-
return { prompt, record: record2 };
|
|
195173
|
-
} catch {
|
|
195174
|
-
return null;
|
|
195175
|
-
}
|
|
195176
|
-
}
|
|
195177
|
-
function acceptAutosaveRecovery(record2) {
|
|
195178
|
-
markAutosaveSnapshotConsumed(record2.timestamp);
|
|
195179
|
-
return record2.data instanceof Uint8Array ? record2.data : new Uint8Array(record2.data);
|
|
195180
|
-
}
|
|
195181
|
-
async function discardAutosaveRecovery(record2) {
|
|
195182
|
-
markAutosaveSnapshotConsumed(record2.timestamp);
|
|
195183
|
-
try {
|
|
195184
|
-
await deleteAutosaveSnapshot(record2.key);
|
|
195185
|
-
} catch {
|
|
195186
|
-
}
|
|
195187
|
-
}
|
|
195188
196753
|
function secureRandomBytes(length) {
|
|
195189
196754
|
const bytes = new Uint8Array(length);
|
|
195190
196755
|
if (typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function") {
|
|
@@ -195383,7 +196948,6 @@ async function restoreSessionDeck() {
|
|
|
195383
196948
|
const snapshot = await getAutosaveSnapshot(deck.fileName);
|
|
195384
196949
|
const bytes = snapshot ? toBytes(snapshot.data) : null;
|
|
195385
196950
|
if (snapshot && bytes && bytes.byteLength > 0 && snapshot.timestamp > deck.timestamp) {
|
|
195386
|
-
markAutosaveSnapshotConsumed(snapshot.timestamp);
|
|
195387
196951
|
return { fileName: deck.fileName, data: bytes, timestamp: snapshot.timestamp };
|
|
195388
196952
|
}
|
|
195389
196953
|
} catch {
|
|
@@ -201567,13 +203131,14 @@ var COMPAT_TOAST_METRICS = {
|
|
|
201567
203131
|
/** Stacking order: above the canvas and inspector, below dialogs. */
|
|
201568
203132
|
zIndex: 40
|
|
201569
203133
|
};
|
|
201570
|
-
function compatToastStackStyle() {
|
|
203134
|
+
function compatToastStackStyle(extraRightInset = 0, extraBottomInset = 0) {
|
|
201571
203135
|
const m = COMPAT_TOAST_METRICS;
|
|
201572
203136
|
return {
|
|
201573
203137
|
position: "absolute",
|
|
201574
|
-
right: `${String(m.insetRight)}px`,
|
|
201575
|
-
bottom: `${String(STATUS_BAR_METRICS.height + m.marginAboveStatusBar)}px`,
|
|
203138
|
+
right: `${String(m.insetRight + extraRightInset)}px`,
|
|
203139
|
+
bottom: `${String(STATUS_BAR_METRICS.height + m.marginAboveStatusBar + extraBottomInset)}px`,
|
|
201576
203140
|
width: `${String(m.width)}px`,
|
|
203141
|
+
maxWidth: `calc(100% - ${String(m.insetRight + extraRightInset)}px)`,
|
|
201577
203142
|
zIndex: String(m.zIndex),
|
|
201578
203143
|
display: "flex",
|
|
201579
203144
|
flexDirection: "column",
|
|
@@ -201784,8 +203349,20 @@ function filterCommands(query, resolveLabel) {
|
|
|
201784
203349
|
(entry2) => resolveLabel(entry2.labelKey).toLowerCase().includes(lowerQuery)
|
|
201785
203350
|
);
|
|
201786
203351
|
}
|
|
203352
|
+
var sourceIdentities = /* @__PURE__ */ new WeakMap();
|
|
203353
|
+
function sourceIdentity(source) {
|
|
203354
|
+
if ((typeof source !== "object" || source === null) && typeof source !== "function") {
|
|
203355
|
+
return source;
|
|
203356
|
+
}
|
|
203357
|
+
let identity = sourceIdentities.get(source);
|
|
203358
|
+
if (!identity) {
|
|
203359
|
+
identity = {};
|
|
203360
|
+
sourceIdentities.set(source, identity);
|
|
203361
|
+
}
|
|
203362
|
+
return identity;
|
|
203363
|
+
}
|
|
201787
203364
|
function autosaveSnapshotMark(filePath, sources) {
|
|
201788
|
-
return { filePath, sources:
|
|
203365
|
+
return { filePath, sources: sources.map(sourceIdentity) };
|
|
201789
203366
|
}
|
|
201790
203367
|
function shouldWriteAutosaveSnapshot(input) {
|
|
201791
203368
|
if (!input.filePath || !input.isDirty || input.saving) {
|
|
@@ -201798,7 +203375,9 @@ function shouldWriteAutosaveSnapshot(input) {
|
|
|
201798
203375
|
if (input.sources.length === 0 || previous.sources.length !== input.sources.length) {
|
|
201799
203376
|
return true;
|
|
201800
203377
|
}
|
|
201801
|
-
return input.sources.some(
|
|
203378
|
+
return input.sources.some(
|
|
203379
|
+
(source, index) => !Object.is(sourceIdentity(source), previous.sources[index])
|
|
203380
|
+
);
|
|
201802
203381
|
}
|
|
201803
203382
|
function resolveAutosaveActivation(input) {
|
|
201804
203383
|
if (input.hostAutosave === false) {
|
|
@@ -201828,6 +203407,86 @@ function resolveAutosaveIntervalMs(input) {
|
|
|
201828
203407
|
}
|
|
201829
203408
|
return AUTOSAVE_DEFAULT_INTERVAL_MS;
|
|
201830
203409
|
}
|
|
203410
|
+
var AUTOSAVE_RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
203411
|
+
function shouldProbeAutosaveRecovery(input) {
|
|
203412
|
+
return !input.alreadyChecked && input.autosaveAllowed && Boolean(input.filePath) && !input.loading && !input.error && input.slideCount > 0;
|
|
203413
|
+
}
|
|
203414
|
+
function formatSnapshotSize(bytes) {
|
|
203415
|
+
if (!Number.isFinite(bytes) || bytes <= 0) {
|
|
203416
|
+
return "0 KB";
|
|
203417
|
+
}
|
|
203418
|
+
if (bytes < 1024 * 1024) {
|
|
203419
|
+
return `${Math.max(1, Math.round(bytes / 1024))} KB`;
|
|
203420
|
+
}
|
|
203421
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
203422
|
+
}
|
|
203423
|
+
function ageKeyFor(ageMinutes) {
|
|
203424
|
+
if (ageMinutes < 1) {
|
|
203425
|
+
return { key: "pptx.autosave.justNow", count: 0 };
|
|
203426
|
+
}
|
|
203427
|
+
if (ageMinutes === 1) {
|
|
203428
|
+
return { key: "pptx.autosave.oneMinAgo", count: 1 };
|
|
203429
|
+
}
|
|
203430
|
+
if (ageMinutes < 60) {
|
|
203431
|
+
return { key: "pptx.autosave.minutesAgo", count: ageMinutes };
|
|
203432
|
+
}
|
|
203433
|
+
return { key: "pptx.autosave.recovery.hoursAgo", count: Math.floor(ageMinutes / 60) };
|
|
203434
|
+
}
|
|
203435
|
+
function autosaveRecoveryPrompt(input) {
|
|
203436
|
+
const record2 = input.record;
|
|
203437
|
+
if (!record2 || record2.size <= 0 || !record2.key) {
|
|
203438
|
+
return null;
|
|
203439
|
+
}
|
|
203440
|
+
const age = input.now - record2.timestamp;
|
|
203441
|
+
if (!Number.isFinite(age) || age < 0 || age >= AUTOSAVE_RECOVERY_WINDOW_MS) {
|
|
203442
|
+
return null;
|
|
203443
|
+
}
|
|
203444
|
+
const ageMinutes = Math.floor(age / 6e4);
|
|
203445
|
+
const relative = ageKeyFor(ageMinutes);
|
|
203446
|
+
return {
|
|
203447
|
+
filePath: record2.key,
|
|
203448
|
+
timestamp: record2.timestamp,
|
|
203449
|
+
size: record2.size,
|
|
203450
|
+
ageMinutes,
|
|
203451
|
+
titleKey: "pptx.autosave.recovery.title",
|
|
203452
|
+
messageKey: "pptx.autosave.recovery.message",
|
|
203453
|
+
messageParams: { file: record2.key, size: formatSnapshotSize(record2.size) },
|
|
203454
|
+
ageKey: relative.key,
|
|
203455
|
+
ageParams: { count: relative.count },
|
|
203456
|
+
restoreKey: "pptx.autosave.recovery.restore",
|
|
203457
|
+
discardKey: "pptx.autosave.recovery.discard"
|
|
203458
|
+
};
|
|
203459
|
+
}
|
|
203460
|
+
function shouldShowAutosaveRecoveryPrompt(input) {
|
|
203461
|
+
return Boolean(input.prompt) && !input.presenting;
|
|
203462
|
+
}
|
|
203463
|
+
async function probeAutosaveRecovery(filePath, now = Date.now()) {
|
|
203464
|
+
if (typeof indexedDB === "undefined") {
|
|
203465
|
+
return null;
|
|
203466
|
+
}
|
|
203467
|
+
try {
|
|
203468
|
+
const record2 = await getAutosaveSnapshot(filePath);
|
|
203469
|
+
const prompt = autosaveRecoveryPrompt({
|
|
203470
|
+
record: record2 ? { key: record2.key, timestamp: record2.timestamp, size: record2.size } : void 0,
|
|
203471
|
+
now
|
|
203472
|
+
});
|
|
203473
|
+
if (!prompt || !record2) {
|
|
203474
|
+
return null;
|
|
203475
|
+
}
|
|
203476
|
+
return { prompt, record: record2 };
|
|
203477
|
+
} catch {
|
|
203478
|
+
return null;
|
|
203479
|
+
}
|
|
203480
|
+
}
|
|
203481
|
+
function acceptAutosaveRecovery(record2) {
|
|
203482
|
+
return record2.data instanceof Uint8Array ? record2.data : new Uint8Array(record2.data);
|
|
203483
|
+
}
|
|
203484
|
+
async function discardAutosaveRecovery(record2) {
|
|
203485
|
+
try {
|
|
203486
|
+
await deleteAutosaveSnapshot(record2.key);
|
|
203487
|
+
} catch {
|
|
203488
|
+
}
|
|
203489
|
+
}
|
|
201831
203490
|
var BACKSTAGE_NAV = [
|
|
201832
203491
|
{ id: "home", label: "Home", labelKey: "pptx.backstage.nav.home" },
|
|
201833
203492
|
{ id: "new", label: "New", labelKey: "pptx.backstage.nav.new" },
|
|
@@ -201933,8 +203592,8 @@ async function listBackstageRecentFiles(translate, limit) {
|
|
|
201933
203592
|
return [];
|
|
201934
203593
|
}
|
|
201935
203594
|
try {
|
|
201936
|
-
const
|
|
201937
|
-
const sorted =
|
|
203595
|
+
const snapshots2 = await listAutosaveSnapshots();
|
|
203596
|
+
const sorted = snapshots2.map((snapshot) => ({ ...snapshot, ...splitFilePath(snapshot.key, translate) })).sort((a, b) => b.timestamp - a.timestamp);
|
|
201938
203597
|
return limit === void 0 ? sorted : sorted.slice(0, Math.max(0, limit));
|
|
201939
203598
|
} catch {
|
|
201940
203599
|
return [];
|
|
@@ -202807,15 +204466,15 @@ function resolveProfileInitial(profile) {
|
|
|
202807
204466
|
return trimmed ? trimmed.slice(0, 1).toUpperCase() : "?";
|
|
202808
204467
|
}
|
|
202809
204468
|
async function getLocalStorageUsageSummary() {
|
|
202810
|
-
const
|
|
204469
|
+
const snapshots2 = await listAutosaveSnapshots();
|
|
202811
204470
|
return {
|
|
202812
|
-
presentationCount:
|
|
202813
|
-
totalBytes:
|
|
204471
|
+
presentationCount: snapshots2.length,
|
|
204472
|
+
totalBytes: snapshots2.reduce((sum, snapshot) => sum + snapshot.size, 0)
|
|
202814
204473
|
};
|
|
202815
204474
|
}
|
|
202816
204475
|
async function clearAllLocalViewerData() {
|
|
202817
|
-
const
|
|
202818
|
-
await Promise.all(
|
|
204476
|
+
const snapshots2 = await listAutosaveSnapshots();
|
|
204477
|
+
await Promise.all(snapshots2.map((snapshot) => deleteAutosaveSnapshot(snapshot.key)));
|
|
202819
204478
|
clearStoredViewerPrefs();
|
|
202820
204479
|
}
|
|
202821
204480
|
function saveViewerProfile(profile) {
|
|
@@ -203334,13 +204993,13 @@ function shouldDiscardAutosaveOnSuccessfulSave(options) {
|
|
|
203334
204993
|
function shouldClearAutosaveCacheOnClose(options) {
|
|
203335
204994
|
return options.save.clearCacheOnClose;
|
|
203336
204995
|
}
|
|
203337
|
-
function resolveExpiredAutosaveSnapshots(
|
|
204996
|
+
function resolveExpiredAutosaveSnapshots(snapshots2, options, now = Date.now()) {
|
|
203338
204997
|
const days = options.save.cacheRetentionDays;
|
|
203339
204998
|
if (!Number.isFinite(days) || days <= 0) {
|
|
203340
204999
|
return [];
|
|
203341
205000
|
}
|
|
203342
205001
|
const maxAgeMs = days * 24 * 60 * 60 * 1e3;
|
|
203343
|
-
return
|
|
205002
|
+
return snapshots2.filter((snapshot) => now - snapshot.timestamp > maxAgeMs).map((s) => s.key);
|
|
203344
205003
|
}
|
|
203345
205004
|
function playFeedbackSound(options) {
|
|
203346
205005
|
if (!options.accessibility.feedbackWithSound || typeof window === "undefined") {
|
|
@@ -205454,22 +207113,6 @@ function calculateViewportFit(input, defaults = DEFAULTS2) {
|
|
|
205454
207113
|
availableHeight
|
|
205455
207114
|
};
|
|
205456
207115
|
}
|
|
205457
|
-
function inlineListBodyText(segments) {
|
|
205458
|
-
let first = true;
|
|
205459
|
-
let text22 = "";
|
|
205460
|
-
for (const segment of segments ?? []) {
|
|
205461
|
-
if (isParagraphSeparatorSegment(segment)) {
|
|
205462
|
-
text22 += "\n";
|
|
205463
|
-
first = true;
|
|
205464
|
-
} else {
|
|
205465
|
-
if (!first || !isBulletMarkerSegment(segment)) {
|
|
205466
|
-
text22 += segment.isLineBreak ? "\n" : segment.text;
|
|
205467
|
-
}
|
|
205468
|
-
first = false;
|
|
205469
|
-
}
|
|
205470
|
-
}
|
|
205471
|
-
return text22;
|
|
205472
|
-
}
|
|
205473
207116
|
function readListActivationSelection(root, body) {
|
|
205474
207117
|
if (readEditableText(root) !== body) {
|
|
205475
207118
|
return void 0;
|
|
@@ -208123,4 +209766,4 @@ async function rasterResultToPngBlob(result) {
|
|
|
208123
209766
|
* `<p:extLst>` (optional)
|
|
208124
209767
|
*/
|
|
208125
209768
|
|
|
208126
|
-
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 };
|
|
209769
|
+
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 };
|