ooxml-ui 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/building-block-styles.d.ts +0 -1
- package/dist/chart/format-pane-3d.d.ts +0 -1
- package/dist/chart/format-pane-analysis.d.ts +0 -1
- package/dist/chart/format-pane-fill-line.d.ts +0 -1
- package/dist/chart/format-pane-text.d.ts +0 -1
- package/dist/pptx/{chunk-KCZWGNWT.mjs → chunk-7DT3UJQB.mjs} +1 -1
- package/dist/pptx/{chunk-52Z74ESQ.mjs → chunk-CH4Z6H6C.mjs} +274 -76
- package/dist/pptx/{chunk-W4GPWC2Z.cjs → chunk-TDIJHLS5.cjs} +277 -74
- package/dist/pptx/{chunk-UG72HBSV.cjs → chunk-ZS5EVODY.cjs} +41 -41
- package/dist/pptx/dom/index.cjs +384 -383
- package/dist/pptx/dom/index.mjs +7 -6
- package/dist/pptx/index.cjs +3046 -3026
- package/dist/pptx/index.mjs +1 -1
- package/dist/pptx/render/bullet-toggle-selection.d.ts +8 -4
- package/dist/pptx/render/bullet-toggle-selection.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +1 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inline-list-style.d.ts +2 -1
- package/dist/pptx/render/inline-list-style.d.ts.map +1 -1
- package/dist/pptx/render/text-list-style-update.d.ts +23 -2
- package/dist/pptx/render/text-list-style-update.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-block.d.ts +10 -1
- package/dist/pptx/render/text-warp-envelope-block.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-curves.d.ts +8 -0
- package/dist/pptx/render/text-warp-envelope-curves.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-layout.d.ts +9 -3
- package/dist/pptx/render/text-warp-envelope-layout.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-map.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-envelope-wrap.d.ts +29 -0
- package/dist/pptx/render/text-warp-envelope-wrap.d.ts.map +1 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts +13 -0
- package/dist/pptx/render/text-warp-preset-definitions.d.ts.map +1 -1
- package/dist/pptx/render/text-warp-preset-sampler.d.ts +12 -0
- package/dist/pptx/render/text-warp-preset-sampler.d.ts.map +1 -1
- package/dist/pptx/render/text-warp.d.ts +3 -2
- package/dist/pptx/render/text-warp.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-GDFFXVAO.mjs → smartart-insert-preview-RQUFRLSV.mjs} +2 -2
- package/dist/pptx/{smartart-insert-preview-FA4WM2N4.cjs → smartart-insert-preview-YKNB37GE.cjs} +3 -3
- package/dist/theme-bridge.d.ts +0 -1
- package/dist/theme.d.ts +0 -1
- package/package.json +2 -2
|
@@ -3485,7 +3485,7 @@ function getImageBackgroundRemoval(element) {
|
|
|
3485
3485
|
prerendered: true
|
|
3486
3486
|
};
|
|
3487
3487
|
}
|
|
3488
|
-
var NONE_PRESETS = /* @__PURE__ */ new Set(["textNoShape"
|
|
3488
|
+
var NONE_PRESETS = /* @__PURE__ */ new Set(["textNoShape"]);
|
|
3489
3489
|
var PATH_PRESETS = /* @__PURE__ */ new Set([
|
|
3490
3490
|
"textArchUp",
|
|
3491
3491
|
"textArchDown",
|
|
@@ -3521,6 +3521,7 @@ var PATH_PRESETS = /* @__PURE__ */ new Set([
|
|
|
3521
3521
|
"textCascadeDown"
|
|
3522
3522
|
]);
|
|
3523
3523
|
var ENVELOPE_PRESETS = /* @__PURE__ */ new Set([
|
|
3524
|
+
"textPlain",
|
|
3524
3525
|
"textInflate",
|
|
3525
3526
|
"textDeflate",
|
|
3526
3527
|
"textInflateBottom",
|
|
@@ -3622,7 +3623,8 @@ var SVG_WARP_PRESETS = /* @__PURE__ */ new Set([
|
|
|
3622
3623
|
"textCirclePour",
|
|
3623
3624
|
"textButtonPour",
|
|
3624
3625
|
"textDeflateInflate",
|
|
3625
|
-
"textDeflateInflateDeflate"
|
|
3626
|
+
"textDeflateInflateDeflate",
|
|
3627
|
+
"textPlain"
|
|
3626
3628
|
]);
|
|
3627
3629
|
var clamp4 = (n) => Math.max(0, Math.min(n, 4));
|
|
3628
3630
|
function archUpPath(w, h, t2, adj) {
|
|
@@ -3933,6 +3935,10 @@ function deflateInflateDeflatePath(w, h, t2, adj) {
|
|
|
3933
3935
|
const q2 = 2 * w / 3;
|
|
3934
3936
|
return `M 0,${yBase} Q ${q1},${yBase - bulge} ${w / 2},${yBase} Q ${q2},${yBase + bulge} ${w},${yBase}`;
|
|
3935
3937
|
}
|
|
3938
|
+
function plainPath(w, h, t2) {
|
|
3939
|
+
const y = h * (0.2 + t2 * 0.6);
|
|
3940
|
+
return `M 0,${y} L ${w},${y}`;
|
|
3941
|
+
}
|
|
3936
3942
|
var WARP_PATH_GENERATORS = {
|
|
3937
3943
|
textArchUp: archUpPath,
|
|
3938
3944
|
textArchDown: archDownPath,
|
|
@@ -3972,10 +3978,11 @@ var WARP_PATH_GENERATORS = {
|
|
|
3972
3978
|
textCirclePour: circlePourPath,
|
|
3973
3979
|
textButtonPour: buttonPourPath,
|
|
3974
3980
|
textDeflateInflate: deflateInflatePath,
|
|
3975
|
-
textDeflateInflateDeflate: deflateInflateDeflatePath
|
|
3981
|
+
textDeflateInflateDeflate: deflateInflateDeflatePath,
|
|
3982
|
+
textPlain: plainPath
|
|
3976
3983
|
};
|
|
3977
3984
|
function shouldUseSvgWarp(preset2) {
|
|
3978
|
-
if (!preset2 || preset2 === "textNoShape"
|
|
3985
|
+
if (!preset2 || preset2 === "textNoShape") {
|
|
3979
3986
|
return false;
|
|
3980
3987
|
}
|
|
3981
3988
|
return SVG_WARP_PRESETS.has(preset2);
|
|
@@ -4290,6 +4297,33 @@ var WARP_PRESET_DEFINITIONS = {
|
|
|
4290
4297
|
],
|
|
4291
4298
|
top: quad("ty", "t", "ty"),
|
|
4292
4299
|
bottom: line("b", "b")
|
|
4300
|
+
},
|
|
4301
|
+
// "Plain": both paths are straight lines along the box's top and bottom
|
|
4302
|
+
// edges, so the text block is stretched to fill the shape. At the default
|
|
4303
|
+
// adj (50000) both span `l..r`; moving adj off centre shortens the top path
|
|
4304
|
+
// at one end and the bottom path at the other, slanting the block.
|
|
4305
|
+
textPlain: {
|
|
4306
|
+
defaultAdj: 5e4,
|
|
4307
|
+
gdLst: [
|
|
4308
|
+
{ name: "a", formula: "pin 30000 adj 70000" },
|
|
4309
|
+
{ name: "mid", formula: "*/ a w 100000" },
|
|
4310
|
+
{ name: "midDir", formula: "+- mid 0 hc" },
|
|
4311
|
+
{ name: "dl", formula: "+- mid 0 l" },
|
|
4312
|
+
{ name: "dr", formula: "+- r 0 mid" },
|
|
4313
|
+
{ name: "dl2", formula: "*/ dl 2 1" },
|
|
4314
|
+
{ name: "dr2", formula: "*/ dr 2 1" },
|
|
4315
|
+
{ name: "dx", formula: "?: midDir dr2 dl2" },
|
|
4316
|
+
{ name: "xr", formula: "+- l dx 0" },
|
|
4317
|
+
{ name: "xl", formula: "+- r 0 dx" },
|
|
4318
|
+
{ name: "tlx", formula: "?: midDir l xl" },
|
|
4319
|
+
{ name: "trx", formula: "?: midDir xr r" },
|
|
4320
|
+
{ name: "blx", formula: "?: midDir xl l" },
|
|
4321
|
+
{ name: "brx", formula: "?: midDir r xr" }
|
|
4322
|
+
],
|
|
4323
|
+
top: line("t", "t"),
|
|
4324
|
+
bottom: line("b", "b"),
|
|
4325
|
+
topX: { startX: "tlx", endX: "trx" },
|
|
4326
|
+
bottomX: { startX: "blx", endX: "brx" }
|
|
4293
4327
|
}
|
|
4294
4328
|
};
|
|
4295
4329
|
|
|
@@ -4383,12 +4417,41 @@ function sampleWarpPresetCurve(preset2, u, adj, adj2) {
|
|
|
4383
4417
|
bottom: sampleSegment(def.bottom, clampedU, vars) / BOX
|
|
4384
4418
|
};
|
|
4385
4419
|
}
|
|
4420
|
+
var FULL_WIDTH = [0, 1];
|
|
4421
|
+
function resolveXExtent(extent, vars) {
|
|
4422
|
+
if (!extent) {
|
|
4423
|
+
return FULL_WIDTH;
|
|
4424
|
+
}
|
|
4425
|
+
const start = vars.get(extent.startX);
|
|
4426
|
+
const end = vars.get(extent.endX);
|
|
4427
|
+
if (start === void 0 || end === void 0 || !(end > start)) {
|
|
4428
|
+
return FULL_WIDTH;
|
|
4429
|
+
}
|
|
4430
|
+
return [Math.max(0, start / BOX), Math.min(1, end / BOX)];
|
|
4431
|
+
}
|
|
4432
|
+
function sampleWarpPresetXExtent(preset2, adj, adj2) {
|
|
4433
|
+
const def = WARP_PRESET_DEFINITIONS[preset2];
|
|
4434
|
+
if (!def) {
|
|
4435
|
+
return void 0;
|
|
4436
|
+
}
|
|
4437
|
+
if (!def.topX && !def.bottomX) {
|
|
4438
|
+
return { top: FULL_WIDTH, bottom: FULL_WIDTH };
|
|
4439
|
+
}
|
|
4440
|
+
const adjustments = /* @__PURE__ */ new Map([
|
|
4441
|
+
["adj", adj ?? def.defaultAdj],
|
|
4442
|
+
["adj2", adj2 ?? 0]
|
|
4443
|
+
]);
|
|
4444
|
+
const vars = pptx.evaluateGuides([...def.gdLst], { w: BOX, h: BOX }, adjustments);
|
|
4445
|
+
return { top: resolveXExtent(def.topX, vars), bottom: resolveXExtent(def.bottomX, vars) };
|
|
4446
|
+
}
|
|
4386
4447
|
function hasWarpPresetDefinition(preset2) {
|
|
4387
4448
|
return preset2 in WARP_PRESET_DEFINITIONS;
|
|
4388
4449
|
}
|
|
4389
4450
|
|
|
4390
4451
|
// src/pptx/render/text-warp-envelope-curves.ts
|
|
4391
4452
|
var GLYPH_ENVELOPE_PRESETS = /* @__PURE__ */ new Set([
|
|
4453
|
+
// "Plain": straight top and bottom edges, so the block fills the shape.
|
|
4454
|
+
"textPlain",
|
|
4392
4455
|
"textInflate",
|
|
4393
4456
|
"textDeflate",
|
|
4394
4457
|
"textInflateBottom",
|
|
@@ -4492,6 +4555,12 @@ function clampBand(top, bottom) {
|
|
|
4492
4555
|
}
|
|
4493
4556
|
return { top: clampedTop, bottom: clampedBottom };
|
|
4494
4557
|
}
|
|
4558
|
+
function envelopeCurveXExtent(preset2, adj, adj2) {
|
|
4559
|
+
return (hasGlyphEnvelope(preset2) ? sampleWarpPresetXExtent(preset2, adj, adj2) : void 0) ?? {
|
|
4560
|
+
top: [0, 1],
|
|
4561
|
+
bottom: [0, 1]
|
|
4562
|
+
};
|
|
4563
|
+
}
|
|
4495
4564
|
var NOMINAL_ENVELOPE_BAND = {
|
|
4496
4565
|
top: TOP_MARGIN,
|
|
4497
4566
|
bottom: BOTTOM_MARGIN
|
|
@@ -6747,11 +6816,79 @@ function buildWarpedGlyphOutlinePathD(commands, warp, maxSegment) {
|
|
|
6747
6816
|
return parts.length > 0 ? parts.join("") : void 0;
|
|
6748
6817
|
}
|
|
6749
6818
|
|
|
6819
|
+
// src/pptx/render/text-warp-envelope-wrap.ts
|
|
6820
|
+
var WHITESPACE_RE = /^(?![\u00A0\u2007\u202F])\s$/u;
|
|
6821
|
+
var HARD_BREAK = "\n";
|
|
6822
|
+
var FIT_EPSILON = 1e-6;
|
|
6823
|
+
function envelopeWrapWidth(boxWidth, body) {
|
|
6824
|
+
if (!body || body.textWrap === "none") {
|
|
6825
|
+
return void 0;
|
|
6826
|
+
}
|
|
6827
|
+
const left = body.bodyInsetLeft ?? chunkD4LJJ7Z7_cjs.DEFAULT_BODY_INSET_LR_PX;
|
|
6828
|
+
const right = body.bodyInsetRight ?? chunkD4LJJ7Z7_cjs.DEFAULT_BODY_INSET_LR_PX;
|
|
6829
|
+
return Math.max(0, boxWidth - left - right);
|
|
6830
|
+
}
|
|
6831
|
+
function sumAdvances(items) {
|
|
6832
|
+
return items.reduce((sum, item4) => sum + item4.advance, 0);
|
|
6833
|
+
}
|
|
6834
|
+
function wrapPiece(items, maxWidth) {
|
|
6835
|
+
const rows = [];
|
|
6836
|
+
let row = [];
|
|
6837
|
+
let rowWidth = 0;
|
|
6838
|
+
let rowHasWord = false;
|
|
6839
|
+
let pending2 = [];
|
|
6840
|
+
let i = 0;
|
|
6841
|
+
while (i < items.length) {
|
|
6842
|
+
if (WHITESPACE_RE.test(items[i].char)) {
|
|
6843
|
+
pending2.push(items[i]);
|
|
6844
|
+
i++;
|
|
6845
|
+
continue;
|
|
6846
|
+
}
|
|
6847
|
+
const word = [];
|
|
6848
|
+
while (i < items.length && !WHITESPACE_RE.test(items[i].char)) {
|
|
6849
|
+
word.push(items[i]);
|
|
6850
|
+
i++;
|
|
6851
|
+
}
|
|
6852
|
+
const wordWidth = sumAdvances(word);
|
|
6853
|
+
const pendingWidth = sumAdvances(pending2);
|
|
6854
|
+
if (rowHasWord && rowWidth + pendingWidth + wordWidth > maxWidth + FIT_EPSILON) {
|
|
6855
|
+
rows.push(row);
|
|
6856
|
+
row = word;
|
|
6857
|
+
rowWidth = wordWidth;
|
|
6858
|
+
} else {
|
|
6859
|
+
row.push(...pending2, ...word);
|
|
6860
|
+
rowWidth += pendingWidth + wordWidth;
|
|
6861
|
+
}
|
|
6862
|
+
rowHasWord = true;
|
|
6863
|
+
pending2 = [];
|
|
6864
|
+
}
|
|
6865
|
+
row.push(...pending2);
|
|
6866
|
+
rows.push(row);
|
|
6867
|
+
return rows;
|
|
6868
|
+
}
|
|
6869
|
+
function wrapEnvelopeParagraph(items, maxWidth) {
|
|
6870
|
+
if (maxWidth === void 0) {
|
|
6871
|
+
return [items];
|
|
6872
|
+
}
|
|
6873
|
+
const rows = [];
|
|
6874
|
+
let piece = [];
|
|
6875
|
+
for (const item4 of items) {
|
|
6876
|
+
if (item4.char === HARD_BREAK) {
|
|
6877
|
+
rows.push(...wrapPiece(piece, maxWidth));
|
|
6878
|
+
piece = [];
|
|
6879
|
+
} else {
|
|
6880
|
+
piece.push(item4);
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6883
|
+
rows.push(...wrapPiece(piece, maxWidth));
|
|
6884
|
+
return rows;
|
|
6885
|
+
}
|
|
6886
|
+
|
|
6750
6887
|
// src/pptx/render/text-warp-envelope-block.ts
|
|
6751
6888
|
var LINE_PITCH_EM = 1.2;
|
|
6752
6889
|
var BASELINE_FRACTION = 0.805;
|
|
6753
6890
|
var FALLBACK_CAP_HEIGHT_EM = 0.72;
|
|
6754
|
-
var
|
|
6891
|
+
var WHITESPACE_RE2 = /^\s$/u;
|
|
6755
6892
|
function alignOffset(align2, blockWidth, lineWidth) {
|
|
6756
6893
|
if (align2 === "right") {
|
|
6757
6894
|
return blockWidth - lineWidth;
|
|
@@ -6762,7 +6899,7 @@ function alignOffset(align2, blockWidth, lineWidth) {
|
|
|
6762
6899
|
return 0;
|
|
6763
6900
|
}
|
|
6764
6901
|
function glyphInk(char, font, x, baseline, advance, outline) {
|
|
6765
|
-
if (
|
|
6902
|
+
if (WHITESPACE_RE2.test(char)) {
|
|
6766
6903
|
return void 0;
|
|
6767
6904
|
}
|
|
6768
6905
|
if (outline) {
|
|
@@ -6788,60 +6925,73 @@ function lineFontSize(segments, fallback) {
|
|
|
6788
6925
|
const sizes = segments.map((s) => envelopeFontSizePx(s.font));
|
|
6789
6926
|
return sizes.length > 0 ? Math.max(...sizes) : fallback;
|
|
6790
6927
|
}
|
|
6791
|
-
function
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
const
|
|
6928
|
+
function measureParagraph(segments) {
|
|
6929
|
+
return segments.flatMap((seg) => {
|
|
6930
|
+
const advances = measureGlyphAdvances(seg.text, seg.font);
|
|
6931
|
+
return [...seg.text].map((char, i) => ({ seg, char, advance: advances[i] ?? 0 }));
|
|
6932
|
+
});
|
|
6933
|
+
}
|
|
6934
|
+
function blockRows(paragraphs2, wrapWidth) {
|
|
6935
|
+
const rows = [];
|
|
6936
|
+
let previousSize = 0;
|
|
6937
|
+
paragraphs2.forEach((segments, paragraphIndex) => {
|
|
6938
|
+
const wrapped = wrapEnvelopeParagraph(measureParagraph(segments), wrapWidth);
|
|
6939
|
+
const paragraphSize = lineFontSize(segments, previousSize);
|
|
6940
|
+
for (const items of wrapped) {
|
|
6941
|
+
const fontSize = wrapped.length === 1 || items.length === 0 ? paragraphSize : Math.max(...items.map((item4) => envelopeFontSizePx(item4.seg.font)));
|
|
6942
|
+
const width = items.reduce((sum, item4) => sum + item4.advance, 0);
|
|
6943
|
+
rows.push({ paragraphIndex, items, width, fontSize });
|
|
6944
|
+
previousSize = fontSize;
|
|
6945
|
+
}
|
|
6946
|
+
});
|
|
6947
|
+
return rows;
|
|
6948
|
+
}
|
|
6949
|
+
function layoutEnvelopeBlock(paragraphs2, align2, getGlyphOutline, wrapWidth) {
|
|
6950
|
+
const rows = blockRows(paragraphs2, wrapWidth);
|
|
6951
|
+
const blockWidth = rows.length > 0 ? Math.max(...rows.map((row) => row.width)) : 0;
|
|
6799
6952
|
let baseline = 0;
|
|
6800
6953
|
let previousSize;
|
|
6801
6954
|
const box = { left: Infinity, top: Infinity, right: -Infinity, bottom: -Infinity };
|
|
6802
6955
|
let hasInk = false;
|
|
6803
|
-
const lines =
|
|
6804
|
-
|
|
6956
|
+
const lines = paragraphs2.map(() => []);
|
|
6957
|
+
const rowCounts = paragraphs2.map(() => 0);
|
|
6958
|
+
for (const row of rows) {
|
|
6959
|
+
const size2 = row.fontSize;
|
|
6805
6960
|
if (previousSize !== void 0) {
|
|
6806
6961
|
baseline += LINE_PITCH_EM * ((1 - BASELINE_FRACTION) * previousSize + BASELINE_FRACTION * size2);
|
|
6807
6962
|
}
|
|
6808
6963
|
previousSize = size2;
|
|
6809
|
-
let x = alignOffset(effectiveAlign(align2), blockWidth,
|
|
6810
|
-
const glyphs = [];
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
ink
|
|
6838
|
-
});
|
|
6839
|
-
x += advance;
|
|
6840
|
-
}
|
|
6964
|
+
let x = alignOffset(effectiveAlign(align2), blockWidth, row.width);
|
|
6965
|
+
const glyphs = lines[row.paragraphIndex];
|
|
6966
|
+
rowCounts[row.paragraphIndex]++;
|
|
6967
|
+
for (const { seg, char, advance } of row.items) {
|
|
6968
|
+
const outline = WHITESPACE_RE2.test(char) ? void 0 : getGlyphOutline?.(char, seg.font, x, baseline);
|
|
6969
|
+
const usable2 = outline && outline.length > 0 ? outline : void 0;
|
|
6970
|
+
const ink = glyphInk(char, seg.font, x, baseline, advance, usable2);
|
|
6971
|
+
if (ink) {
|
|
6972
|
+
hasInk = true;
|
|
6973
|
+
box.left = Math.min(box.left, ink.left);
|
|
6974
|
+
box.right = Math.max(box.right, ink.right);
|
|
6975
|
+
box.top = Math.min(box.top, ink.top);
|
|
6976
|
+
box.bottom = Math.max(box.bottom, ink.bottom);
|
|
6977
|
+
} else if (WHITESPACE_RE2.test(char)) {
|
|
6978
|
+
box.left = Math.min(box.left, x);
|
|
6979
|
+
box.right = Math.max(box.right, x + advance);
|
|
6980
|
+
}
|
|
6981
|
+
glyphs.push({
|
|
6982
|
+
char,
|
|
6983
|
+
segmentIndex: seg.segmentIndex,
|
|
6984
|
+
font: seg.font,
|
|
6985
|
+
x,
|
|
6986
|
+
baseline,
|
|
6987
|
+
advance,
|
|
6988
|
+
outline: usable2,
|
|
6989
|
+
ink
|
|
6990
|
+
});
|
|
6991
|
+
x += advance;
|
|
6841
6992
|
}
|
|
6842
|
-
|
|
6843
|
-
}
|
|
6844
|
-
return { lines, box: hasInk ? box : void 0 };
|
|
6993
|
+
}
|
|
6994
|
+
return { lines, rowCounts, box: hasInk ? box : void 0 };
|
|
6845
6995
|
}
|
|
6846
6996
|
function effectiveAlign(align2) {
|
|
6847
6997
|
return align2 === "justify" || align2 === "justLow" || align2 === "dist" || align2 === "thaiDist" ? "left" : align2;
|
|
@@ -6849,12 +6999,12 @@ function effectiveAlign(align2) {
|
|
|
6849
6999
|
|
|
6850
7000
|
// src/pptx/render/text-warp-envelope-map.ts
|
|
6851
7001
|
var CURVE_SAMPLES = 512;
|
|
6852
|
-
function buildArcTable(ys,
|
|
7002
|
+
function buildArcTable(ys, startX, endX) {
|
|
6853
7003
|
const xs = new Float64Array(ys.length);
|
|
6854
7004
|
const s = new Float64Array(ys.length);
|
|
6855
7005
|
let total = 0;
|
|
6856
7006
|
for (let i = 0; i < ys.length; i++) {
|
|
6857
|
-
xs[i] = i / (ys.length - 1) *
|
|
7007
|
+
xs[i] = startX + i / (ys.length - 1) * (endX - startX);
|
|
6858
7008
|
if (i > 0) {
|
|
6859
7009
|
total += Math.hypot(xs[i] - xs[i - 1], ys[i] - ys[i - 1]);
|
|
6860
7010
|
}
|
|
@@ -6904,8 +7054,9 @@ function createEnvelopeWarp(preset2, width, height, adj, adj2, block) {
|
|
|
6904
7054
|
topYs[i] = band.top * height;
|
|
6905
7055
|
bottomYs[i] = band.bottom * height;
|
|
6906
7056
|
}
|
|
6907
|
-
const
|
|
6908
|
-
const
|
|
7057
|
+
const extent = envelopeCurveXExtent(preset2, adj, adj2);
|
|
7058
|
+
const top = buildArcTable(topYs, extent.top[0] * width, extent.top[1] * width);
|
|
7059
|
+
const bottom = buildArcTable(bottomYs, extent.bottom[0] * width, extent.bottom[1] * width);
|
|
6909
7060
|
return {
|
|
6910
7061
|
map(x, y) {
|
|
6911
7062
|
const s = (x - block.left) / blockW;
|
|
@@ -7035,12 +7186,17 @@ function placeGlyph(glyph3, warp, maxSegment, shapeHeight) {
|
|
|
7035
7186
|
const fit = fitGlyphEnvelopeAffine(warp, box, shapeHeight);
|
|
7036
7187
|
return { ...base2, transform: fit.transform, slices: fit.slices };
|
|
7037
7188
|
}
|
|
7038
|
-
function buildGlyphEnvelopeBlock(preset2, paragraphs2, width, height, align2, adj, adj2, getGlyphOutline) {
|
|
7189
|
+
function buildGlyphEnvelopeBlock(preset2, paragraphs2, width, height, align2, adj, adj2, getGlyphOutline, textBody) {
|
|
7039
7190
|
const empty = paragraphs2.map(() => []);
|
|
7040
7191
|
if (!hasGlyphEnvelope(preset2) || !(width > 0) || !(height > 0)) {
|
|
7041
7192
|
return empty;
|
|
7042
7193
|
}
|
|
7043
|
-
const layout = layoutEnvelopeBlock(
|
|
7194
|
+
const layout = layoutEnvelopeBlock(
|
|
7195
|
+
paragraphs2,
|
|
7196
|
+
align2,
|
|
7197
|
+
getGlyphOutline,
|
|
7198
|
+
envelopeWrapWidth(width, textBody)
|
|
7199
|
+
);
|
|
7044
7200
|
if (!layout.box) {
|
|
7045
7201
|
return empty;
|
|
7046
7202
|
}
|
|
@@ -7053,7 +7209,7 @@ function buildGlyphEnvelopeBlock(preset2, paragraphs2, width, height, align2, ad
|
|
|
7053
7209
|
(line4) => line4.map((glyph3) => placeGlyph(glyph3, warp, maxSegment, height))
|
|
7054
7210
|
);
|
|
7055
7211
|
}
|
|
7056
|
-
function buildGlyphEnvelope(preset2, segments, width, height, align2, adj, adj2, getGlyphOutline) {
|
|
7212
|
+
function buildGlyphEnvelope(preset2, segments, width, height, align2, adj, adj2, getGlyphOutline, textBody) {
|
|
7057
7213
|
return buildGlyphEnvelopeBlock(
|
|
7058
7214
|
preset2,
|
|
7059
7215
|
[segments],
|
|
@@ -7062,7 +7218,8 @@ function buildGlyphEnvelope(preset2, segments, width, height, align2, adj, adj2,
|
|
|
7062
7218
|
align2,
|
|
7063
7219
|
adj,
|
|
7064
7220
|
adj2,
|
|
7065
|
-
getGlyphOutline
|
|
7221
|
+
getGlyphOutline,
|
|
7222
|
+
textBody
|
|
7066
7223
|
)[0] ?? [];
|
|
7067
7224
|
}
|
|
7068
7225
|
|
|
@@ -7613,12 +7770,12 @@ function parseOpenTypeFont(buffer, module = loadedModule) {
|
|
|
7613
7770
|
}
|
|
7614
7771
|
|
|
7615
7772
|
// src/pptx/render/text-warp-glyph-outline-lookup.ts
|
|
7616
|
-
var
|
|
7773
|
+
var WHITESPACE_RE3 = /^\s$/u;
|
|
7617
7774
|
function extractGlyphOutlineCommands(font, char, x, y, fontSizePx) {
|
|
7618
7775
|
if (!char) {
|
|
7619
7776
|
return void 0;
|
|
7620
7777
|
}
|
|
7621
|
-
if (
|
|
7778
|
+
if (WHITESPACE_RE3.test(char)) {
|
|
7622
7779
|
return [];
|
|
7623
7780
|
}
|
|
7624
7781
|
try {
|
|
@@ -7646,7 +7803,7 @@ function extractGlyphOutlineCommands(font, char, x, y, fontSizePx) {
|
|
|
7646
7803
|
}
|
|
7647
7804
|
function createGlyphOutlineLookup(cache) {
|
|
7648
7805
|
return (char, font, x, y) => {
|
|
7649
|
-
if (
|
|
7806
|
+
if (WHITESPACE_RE3.test(char)) {
|
|
7650
7807
|
return [];
|
|
7651
7808
|
}
|
|
7652
7809
|
const parsed = cache.get(font.fontFamily, font.bold, font.italic);
|
|
@@ -31511,6 +31668,36 @@ function restoreParagraphMetadata(original, updated) {
|
|
|
31511
31668
|
};
|
|
31512
31669
|
});
|
|
31513
31670
|
}
|
|
31671
|
+
var DEFAULT_LIST_CONVERSION_SCOPE = "paragraph";
|
|
31672
|
+
function caretListParagraphRange(segments, caretParagraph, listType) {
|
|
31673
|
+
if (listType === "none") {
|
|
31674
|
+
return void 0;
|
|
31675
|
+
}
|
|
31676
|
+
const paragraphs2 = bulletToggle.splitBulletParagraphs(segments).map((paragraph2) => ({
|
|
31677
|
+
kind: bulletToggle.paragraphBulletKind(paragraph2.segments),
|
|
31678
|
+
level: paragraph2.segments[0]?.paragraphLevel ?? 0
|
|
31679
|
+
}));
|
|
31680
|
+
const caret = paragraphs2[caretParagraph];
|
|
31681
|
+
if (!caret || caret.kind === "none" || caret.kind === listType) {
|
|
31682
|
+
return void 0;
|
|
31683
|
+
}
|
|
31684
|
+
const inList = (index) => {
|
|
31685
|
+
const paragraph2 = paragraphs2[index];
|
|
31686
|
+
if (!paragraph2 || paragraph2.kind === "none") {
|
|
31687
|
+
return false;
|
|
31688
|
+
}
|
|
31689
|
+
return paragraph2.level > caret.level || paragraph2.level === caret.level && paragraph2.kind === caret.kind;
|
|
31690
|
+
};
|
|
31691
|
+
let startParagraph = caretParagraph;
|
|
31692
|
+
while (inList(startParagraph - 1)) {
|
|
31693
|
+
startParagraph -= 1;
|
|
31694
|
+
}
|
|
31695
|
+
let endParagraph = caretParagraph;
|
|
31696
|
+
while (inList(endParagraph + 1)) {
|
|
31697
|
+
endParagraph += 1;
|
|
31698
|
+
}
|
|
31699
|
+
return { startParagraph, endParagraph };
|
|
31700
|
+
}
|
|
31514
31701
|
function selectedParagraphBulletKind(element, selection) {
|
|
31515
31702
|
if (!selection || !pptx.hasTextProperties(element) || !element.textSegments) {
|
|
31516
31703
|
const kind = bulletToggle.elementBulletKind(element);
|
|
@@ -31522,7 +31709,7 @@ function selectedParagraphBulletKind(element, selection) {
|
|
|
31522
31709
|
}
|
|
31523
31710
|
return bulletToggle.paragraphBulletKind(element.textSegments.slice(first));
|
|
31524
31711
|
}
|
|
31525
|
-
function applyListStyleUpdate(element, updates, selection) {
|
|
31712
|
+
function applyListStyleUpdate(element, updates, selection, options = {}) {
|
|
31526
31713
|
if (!pptx.hasTextProperties(element) || !updates.listType) {
|
|
31527
31714
|
return { patch: {}, selection };
|
|
31528
31715
|
}
|
|
@@ -31555,10 +31742,14 @@ function applyListStyleUpdate(element, updates, selection) {
|
|
|
31555
31742
|
const startOffset = startEntry.start + workingSelection.startOffset;
|
|
31556
31743
|
const endOffset = endEntry.start + workingSelection.endOffset;
|
|
31557
31744
|
const lastSelected = [...entries2].reverse().find((entry6) => entry6.start < endOffset);
|
|
31558
|
-
const patch = bulletToggle.setElementBullets(
|
|
31559
|
-
|
|
31560
|
-
|
|
31561
|
-
|
|
31745
|
+
const patch = bulletToggle.setElementBullets(
|
|
31746
|
+
working,
|
|
31747
|
+
listType,
|
|
31748
|
+
(startOffset === endOffset && (options.listConversionScope ?? DEFAULT_LIST_CONVERSION_SCOPE) === "list" ? caretListParagraphRange(segments, startEntry.paragraph, listType) : void 0) ?? {
|
|
31749
|
+
startParagraph: startEntry.paragraph,
|
|
31750
|
+
endParagraph: Math.max(startEntry.paragraph, lastSelected?.paragraph ?? endEntry.paragraph)
|
|
31751
|
+
}
|
|
31752
|
+
);
|
|
31562
31753
|
const next = { ...working, ...patch };
|
|
31563
31754
|
const nextSegments = pptx.hasTextProperties(next) ? next.textSegments : void 0;
|
|
31564
31755
|
if (!nextSegments) {
|
|
@@ -31590,7 +31781,7 @@ function selectionBulletKind(element, selection, segments) {
|
|
|
31590
31781
|
const paragraphs2 = bulletToggle.splitBulletParagraphs(bulletToggle.resolveBulletSegments(element, segments));
|
|
31591
31782
|
return bulletToggle.paragraphsBulletKind(paragraphs2.filter((paragraph2) => inScope(paragraph2, selection)));
|
|
31592
31783
|
}
|
|
31593
|
-
function setSelectionBullets(element, kind, selection, segments) {
|
|
31784
|
+
function setSelectionBullets(element, kind, selection, segments, options) {
|
|
31594
31785
|
if (!pptx.hasTextProperties(element)) {
|
|
31595
31786
|
return { patch: {}, newSelection: selection };
|
|
31596
31787
|
}
|
|
@@ -31598,13 +31789,20 @@ function setSelectionBullets(element, kind, selection, segments) {
|
|
|
31598
31789
|
const result = applyListStyleUpdate(
|
|
31599
31790
|
{ ...element, textSegments: source },
|
|
31600
31791
|
{ listType: kind },
|
|
31601
|
-
selection
|
|
31792
|
+
selection,
|
|
31793
|
+
options
|
|
31602
31794
|
);
|
|
31603
31795
|
return { patch: result.patch, newSelection: result.selection };
|
|
31604
31796
|
}
|
|
31605
|
-
function toggleSelectionBullets(element, kind, selection, segments) {
|
|
31797
|
+
function toggleSelectionBullets(element, kind, selection, segments, options) {
|
|
31606
31798
|
const current = selectionBulletKind(element, selection, segments);
|
|
31607
|
-
return setSelectionBullets(
|
|
31799
|
+
return setSelectionBullets(
|
|
31800
|
+
element,
|
|
31801
|
+
current === kind ? "none" : kind,
|
|
31802
|
+
selection,
|
|
31803
|
+
segments,
|
|
31804
|
+
options
|
|
31805
|
+
);
|
|
31608
31806
|
}
|
|
31609
31807
|
function applyTextStyleUpdate(element, updates, selection, segments) {
|
|
31610
31808
|
if (!pptx.hasTextProperties(element)) {
|
|
@@ -68455,12 +68653,12 @@ function overlayMasterViewInlineSnapshot(document2, target, snapshot, text4 = sn
|
|
|
68455
68653
|
const next = overlayInlineTextSnapshot(elements, snapshot, text4);
|
|
68456
68654
|
return next === elements ? null : replaceMasterViewElements(document2, target, next);
|
|
68457
68655
|
}
|
|
68458
|
-
function buildInlineListStylePatch(element, updates, selection) {
|
|
68656
|
+
function buildInlineListStylePatch(element, updates, selection, options) {
|
|
68459
68657
|
if (!pptx.hasTextProperties(element) || !element.textSegments) {
|
|
68460
68658
|
return void 0;
|
|
68461
68659
|
}
|
|
68462
68660
|
if (updates.listType !== void 0) {
|
|
68463
|
-
const patch = applyListStyleUpdate(element, updates, selection).patch;
|
|
68661
|
+
const patch = applyListStyleUpdate(element, updates, selection, options).patch;
|
|
68464
68662
|
return {
|
|
68465
68663
|
..."textStyle" in patch ? { textStyle: patch.textStyle } : {},
|
|
68466
68664
|
..."textSegments" in patch ? { textSegments: patch.textSegments } : {}
|
|
@@ -83773,7 +83971,7 @@ function definePptxInsertSmartArtDialog(registry2) {
|
|
|
83773
83971
|
if (this.#live || this.#draw) {
|
|
83774
83972
|
return;
|
|
83775
83973
|
}
|
|
83776
|
-
this.#live = import('./smartart-insert-preview-
|
|
83974
|
+
this.#live = import('./smartart-insert-preview-YKNB37GE.cjs').then((module) => {
|
|
83777
83975
|
if (this.#draw || !this.#picker) {
|
|
83778
83976
|
return;
|
|
83779
83977
|
}
|
|
@@ -92709,6 +92907,7 @@ exports.DEFAULT_FIND_REPLACE_OPTIONS = DEFAULT_FIND_REPLACE_OPTIONS;
|
|
|
92709
92907
|
exports.DEFAULT_INSERT_CHART_KIND = DEFAULT_INSERT_CHART_KIND;
|
|
92710
92908
|
exports.DEFAULT_INSERT_CHART_TYPE = DEFAULT_INSERT_CHART_TYPE;
|
|
92711
92909
|
exports.DEFAULT_LINE_HEIGHT = DEFAULT_LINE_HEIGHT;
|
|
92910
|
+
exports.DEFAULT_LIST_CONVERSION_SCOPE = DEFAULT_LIST_CONVERSION_SCOPE;
|
|
92712
92911
|
exports.DEFAULT_MORPH_DURATION_MS = DEFAULT_MORPH_DURATION_MS;
|
|
92713
92912
|
exports.DEFAULT_MOTION_PATH_DURATION_MS = DEFAULT_MOTION_PATH_DURATION_MS;
|
|
92714
92913
|
exports.DEFAULT_NOTES_FONT_SIZE_PT = DEFAULT_NOTES_FONT_SIZE_PT;
|
|
@@ -93892,6 +94091,8 @@ exports.encodePngFromRowBands = encodePngFromRowBands;
|
|
|
93892
94091
|
exports.endAudienceDisplay = endAudienceDisplay;
|
|
93893
94092
|
exports.ensureActionAffordanceStyles = ensureActionAffordanceStyles;
|
|
93894
94093
|
exports.envelopeCurveAt = envelopeCurveAt;
|
|
94094
|
+
exports.envelopeCurveXExtent = envelopeCurveXExtent;
|
|
94095
|
+
exports.envelopeWrapWidth = envelopeWrapWidth;
|
|
93895
94096
|
exports.equalizePaths = equalizePaths;
|
|
93896
94097
|
exports.erasePresentationInkAt = erasePresentationInkAt;
|
|
93897
94098
|
exports.escapeCssAttributeValue = escapeCssAttributeValue2;
|
|
@@ -94964,6 +95165,7 @@ exports.sameRenderer = sameRenderer2;
|
|
|
94964
95165
|
exports.sampleColorFromSlide = sampleColorFromSlide;
|
|
94965
95166
|
exports.sampleImageCropMorphSteps = sampleImageCropMorphSteps;
|
|
94966
95167
|
exports.sampleWarpPresetCurve = sampleWarpPresetCurve;
|
|
95168
|
+
exports.sampleWarpPresetXExtent = sampleWarpPresetXExtent;
|
|
94967
95169
|
exports.sanitizeAvatarUrl = sanitizeAvatarUrl;
|
|
94968
95170
|
exports.sanitizeColor = sanitizeColor;
|
|
94969
95171
|
exports.sanitizeCssDeclaration = sanitizeCssDeclaration;
|
|
@@ -95257,6 +95459,7 @@ exports.withNodeAtPath = withNodeAtPath;
|
|
|
95257
95459
|
exports.withRecordEntry = withRecordEntry;
|
|
95258
95460
|
exports.withSaveFailureToast = withSaveFailureToast;
|
|
95259
95461
|
exports.withSlideSizeOrientation = withSlideSizeOrientation;
|
|
95462
|
+
exports.wrapEnvelopeParagraph = wrapEnvelopeParagraph;
|
|
95260
95463
|
exports.wrapForeignObjectSvg = wrapForeignObjectSvg;
|
|
95261
95464
|
exports.wrapNotesText = wrapNotesText;
|
|
95262
95465
|
exports.writeBackReport = writeBackReport;
|