oasis-editor 0.0.115 → 0.0.116
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/{OasisEditorApp-C1dyjJoH.js → OasisEditorApp-DY_N4M54.js} +337 -111
- package/dist/adapters/react.d.ts +11 -0
- package/dist/adapters/ui.d.ts +2 -0
- package/dist/adapters/vue.d.ts +23 -0
- package/dist/assets/{importDocxWorker-D0F0jbcF.js → importDocxWorker-nIS-zjkj.js} +1 -1
- package/dist/core/html/inlineImageParser.d.ts +7 -0
- package/dist/core/layoutConstants.d.ts +18 -0
- package/dist/{index-Cq3YFYX2.js → index-DLKF27_V.js} +427 -304
- package/dist/layoutProjection/blocksPaginationTypes.d.ts +2 -0
- package/dist/layoutProjection/headerFooterLayoutContext.d.ts +2 -0
- package/dist/layoutProjection/paginationTrack.d.ts +2 -0
- package/dist/layoutProjection/paragraphPagination.d.ts +8 -3
- package/dist/layoutProjection/sectionPagination.d.ts +3 -0
- package/dist/layoutProjection/tableRowSlicing.d.ts +2 -1
- package/dist/oasis-editor.js +55 -55
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/react.d.ts +7 -8
- package/dist/react.js +18 -22
- package/dist/ui/canvas/table/prepareCells.d.ts +1 -1
- package/dist/ui/canvas/table/resolveRowHeights.d.ts +1 -1
- package/dist/ui/components/FindReplace/FindReplaceDialog.d.ts +1 -2
- package/dist/ui/components/Menubar/Menubar.d.ts +1 -2
- package/dist/ui/components/PageBreak.d.ts +1 -1
- package/dist/ui.d.ts +2 -42
- package/dist/ui.js +19 -18
- package/dist/utils/performanceMetrics.d.ts +0 -6
- package/dist/utils/round.d.ts +7 -0
- package/dist/vue.d.ts +22 -8
- package/dist/vue.js +18 -24
- package/package.json +9 -6
|
@@ -2539,7 +2539,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2539
2539
|
onCleanup(() => {
|
|
2540
2540
|
cancelled = true;
|
|
2541
2541
|
});
|
|
2542
|
-
import("./OasisEditorApp-
|
|
2542
|
+
import("./OasisEditorApp-DY_N4M54.js").then((m) => {
|
|
2543
2543
|
cancelled = true;
|
|
2544
2544
|
setProgress(1);
|
|
2545
2545
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -13135,6 +13135,10 @@ function getPreciseFontProgram(family, bold, italic) {
|
|
|
13135
13135
|
const resolved = family ?? "";
|
|
13136
13136
|
return registry.get(faceKey(resolved, bold, italic)) ?? registry.get(faceKey(resolved, false, false)) ?? null;
|
|
13137
13137
|
}
|
|
13138
|
+
function roundTo(value, decimals) {
|
|
13139
|
+
const factor = 10 ** decimals;
|
|
13140
|
+
return Math.round(value * factor) / factor;
|
|
13141
|
+
}
|
|
13138
13142
|
const familyFileCache = /* @__PURE__ */ new Map();
|
|
13139
13143
|
const fontLogger$1 = createEditorLogger("fonts");
|
|
13140
13144
|
function resolveFaceFiles(family) {
|
|
@@ -13312,7 +13316,7 @@ async function preloadLayoutFonts(families) {
|
|
|
13312
13316
|
);
|
|
13313
13317
|
const finishedAt = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
13314
13318
|
fontLogger$1.info("preload:done", {
|
|
13315
|
-
durationMs:
|
|
13319
|
+
durationMs: roundTo(finishedAt - startedAt, 2),
|
|
13316
13320
|
results,
|
|
13317
13321
|
documentFontsStatus: typeof document !== "undefined" && document.fonts ? document.fonts.status : "unavailable"
|
|
13318
13322
|
});
|
|
@@ -14086,7 +14090,6 @@ function findHyphenationPoints(word, lang) {
|
|
|
14086
14090
|
}
|
|
14087
14091
|
const DEFAULT_CONTENT_WIDTH = 624;
|
|
14088
14092
|
const MIN_CONTENT_WIDTH = 120;
|
|
14089
|
-
const PT_TO_PX = 96 / 72;
|
|
14090
14093
|
function intersectsVertically(aTop, aBottom, bTop, bBottom) {
|
|
14091
14094
|
return aTop < bBottom && aBottom > bTop;
|
|
14092
14095
|
}
|
|
@@ -14538,7 +14541,7 @@ function composeMeasuredParagraphLines(options) {
|
|
|
14538
14541
|
}
|
|
14539
14542
|
if (!isEmptyLine) {
|
|
14540
14543
|
const remaining = lineAvailableWidth - lineWidth;
|
|
14541
|
-
const zonePx = ((hyphenation == null ? void 0 : hyphenation.zone) ?? 0) *
|
|
14544
|
+
const zonePx = ((hyphenation == null ? void 0 : hyphenation.zone) ?? 0) * PX_PER_POINT;
|
|
14542
14545
|
if (remaining > zonePx) {
|
|
14543
14546
|
const hy = tryHyphenate(token.chars, remaining);
|
|
14544
14547
|
if (hy) {
|
|
@@ -14938,6 +14941,9 @@ function getParagraphBorderInsets(style2) {
|
|
|
14938
14941
|
bottom: edgeInset(style2.borderBottom)
|
|
14939
14942
|
};
|
|
14940
14943
|
}
|
|
14944
|
+
const VERTICAL_HIT_WEIGHT = 1e3;
|
|
14945
|
+
const TEXT_BASELINE_RATIO = 0.8;
|
|
14946
|
+
const NO_WRAP_MEASURE_WIDTH_PX = 1e5;
|
|
14941
14947
|
function formatTimestamp() {
|
|
14942
14948
|
const now = /* @__PURE__ */ new Date();
|
|
14943
14949
|
const h = String(now.getHours()).padStart(2, "0");
|
|
@@ -14972,7 +14978,7 @@ function markEnd(label) {
|
|
|
14972
14978
|
performance.mark(endName);
|
|
14973
14979
|
try {
|
|
14974
14980
|
const measure = performance.measure(label, startName, endName);
|
|
14975
|
-
const duration =
|
|
14981
|
+
const duration = roundTo(measure.duration, 2);
|
|
14976
14982
|
marks.push({
|
|
14977
14983
|
name: label,
|
|
14978
14984
|
duration,
|
|
@@ -14993,14 +14999,14 @@ function markEnd(label) {
|
|
|
14993
14999
|
function recordDuration(label, durationMs) {
|
|
14994
15000
|
marks.push({
|
|
14995
15001
|
name: label,
|
|
14996
|
-
duration:
|
|
15002
|
+
duration: roundTo(durationMs, 2),
|
|
14997
15003
|
timestamp: Date.now()
|
|
14998
15004
|
});
|
|
14999
15005
|
if (shouldLogPerformanceMetrics()) {
|
|
15000
15006
|
console.info(
|
|
15001
15007
|
`%c[perf] ${label}`,
|
|
15002
15008
|
"color: #f59e0b;",
|
|
15003
|
-
`${formatTimestamp()} ${
|
|
15009
|
+
`${formatTimestamp()} ${roundTo(durationMs, 2)}ms`
|
|
15004
15010
|
);
|
|
15005
15011
|
}
|
|
15006
15012
|
}
|
|
@@ -15052,7 +15058,7 @@ function startLongTaskObserver() {
|
|
|
15052
15058
|
observer = new PerformanceObserver((list) => {
|
|
15053
15059
|
for (const entry of list.getEntries()) {
|
|
15054
15060
|
longTasks.push({
|
|
15055
|
-
duration:
|
|
15061
|
+
duration: roundTo(entry.duration, 2),
|
|
15056
15062
|
startTime: Math.round(entry.startTime)
|
|
15057
15063
|
});
|
|
15058
15064
|
}
|
|
@@ -15347,11 +15353,14 @@ function resolveDropCapExclusion(options) {
|
|
|
15347
15353
|
sourceRunId: DROP_CAP_EXCLUSION_RUN_ID
|
|
15348
15354
|
};
|
|
15349
15355
|
}
|
|
15350
|
-
|
|
15351
|
-
|
|
15352
|
-
|
|
15353
|
-
|
|
15354
|
-
|
|
15356
|
+
const EMPTY_PROJECTION_CONTEXT = {
|
|
15357
|
+
hyphenation: void 0,
|
|
15358
|
+
hyphenationSignature: ""
|
|
15359
|
+
};
|
|
15360
|
+
function createProjectionContext(options) {
|
|
15361
|
+
const hyphenation = (options == null ? void 0 : options.enabled) ? options : void 0;
|
|
15362
|
+
const hyphenationSignature = hyphenation ? `h:${hyphenation.zone ?? ""}:${hyphenation.consecutiveLimit ?? ""}:${hyphenation.doNotHyphenateCaps ? 1 : 0}` : "";
|
|
15363
|
+
return { hyphenation, hyphenationSignature };
|
|
15355
15364
|
}
|
|
15356
15365
|
function paragraphStyleComparableKey(style2) {
|
|
15357
15366
|
const {
|
|
@@ -15418,9 +15427,9 @@ function getParagraphFieldDependence(paragraph) {
|
|
|
15418
15427
|
paragraphFieldDependenceCache.set(paragraph, result);
|
|
15419
15428
|
return result;
|
|
15420
15429
|
}
|
|
15421
|
-
function projectParagraphLayout(paragraph, pageIndex, totalPages, styles, contentWidth, measurer = domTextMeasurer, defaultTabStop) {
|
|
15430
|
+
function projectParagraphLayout(paragraph, pageIndex, totalPages, styles, contentWidth, measurer = domTextMeasurer, defaultTabStop, context2 = EMPTY_PROJECTION_CONTEXT) {
|
|
15422
15431
|
const { dependsOnPageIndex, dependsOnTotalPages } = getParagraphFieldDependence(paragraph);
|
|
15423
|
-
const cacheKey = `${dependsOnPageIndex ? pageIndex ?? "" : ""}:${dependsOnTotalPages ? totalPages ?? "" : ""}:${contentWidth ?? ""}:${defaultTabStop ?? ""}:${
|
|
15432
|
+
const cacheKey = `${dependsOnPageIndex ? pageIndex ?? "" : ""}:${dependsOnTotalPages ? totalPages ?? "" : ""}:${contentWidth ?? ""}:${defaultTabStop ?? ""}:${context2.hyphenationSignature}`;
|
|
15424
15433
|
let cacheForParagraph = paragraphLayoutCache.get(paragraph);
|
|
15425
15434
|
if (cacheForParagraph) {
|
|
15426
15435
|
const cached = cacheForParagraph.get(cacheKey);
|
|
@@ -15478,7 +15487,7 @@ function projectParagraphLayout(paragraph, pageIndex, totalPages, styles, conten
|
|
|
15478
15487
|
styles,
|
|
15479
15488
|
contentWidth,
|
|
15480
15489
|
defaultTabStop,
|
|
15481
|
-
hyphenation:
|
|
15490
|
+
hyphenation: context2.hyphenation
|
|
15482
15491
|
}).map((line) => ({
|
|
15483
15492
|
...line,
|
|
15484
15493
|
height: line.height || lineHeight,
|
|
@@ -15507,7 +15516,7 @@ function projectParagraphLayout(paragraph, pageIndex, totalPages, styles, conten
|
|
|
15507
15516
|
cacheForParagraph.set(cacheKey, result);
|
|
15508
15517
|
return result;
|
|
15509
15518
|
}
|
|
15510
|
-
function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWidth, measurer = domTextMeasurer, pageIndex, totalPages, styles, defaultTabStop, resolveTextBoxHeight, externalExclusions = []) {
|
|
15519
|
+
function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWidth, measurer = domTextMeasurer, pageIndex, totalPages, styles, defaultTabStop, resolveTextBoxHeight, externalExclusions = [], context2 = EMPTY_PROJECTION_CONTEXT) {
|
|
15511
15520
|
const preliminary = projectParagraphLayout(
|
|
15512
15521
|
paragraph,
|
|
15513
15522
|
pageIndex,
|
|
@@ -15515,7 +15524,8 @@ function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWi
|
|
|
15515
15524
|
styles,
|
|
15516
15525
|
contentWidth,
|
|
15517
15526
|
measurer,
|
|
15518
|
-
defaultTabStop
|
|
15527
|
+
defaultTabStop,
|
|
15528
|
+
context2
|
|
15519
15529
|
);
|
|
15520
15530
|
if (!pageSettings || !contentWidth) {
|
|
15521
15531
|
return preliminary;
|
|
@@ -15776,7 +15786,6 @@ function estimateParagraphBlockHeight(paragraph, styles, contentWidth, measurer
|
|
|
15776
15786
|
}
|
|
15777
15787
|
const MIN_TABLE_CELL_CONTENT_WIDTH_PX$2 = 24;
|
|
15778
15788
|
const DEFAULT_CELL_PADDING_LEFT_RIGHT_PX$1 = 7.2;
|
|
15779
|
-
const NO_WRAP_MEASURE_WIDTH_PX$1 = 1e5;
|
|
15780
15789
|
function toPx$1(valuePt) {
|
|
15781
15790
|
return valuePt * PX_PER_POINT;
|
|
15782
15791
|
}
|
|
@@ -15850,7 +15859,7 @@ function getTableCellContentWidthForParagraph(document2, paragraphId, activeSect
|
|
|
15850
15859
|
if (!row) return null;
|
|
15851
15860
|
const cell = row.cells[tableLocation.cellIndex];
|
|
15852
15861
|
if (!cell) return null;
|
|
15853
|
-
if ((_a = cell.style) == null ? void 0 : _a.noWrap) return NO_WRAP_MEASURE_WIDTH_PX
|
|
15862
|
+
if ((_a = cell.style) == null ? void 0 : _a.noWrap) return NO_WRAP_MEASURE_WIDTH_PX;
|
|
15854
15863
|
const pageContentWidthPx = getPageContentWidth(
|
|
15855
15864
|
getDocumentPageSettings(document2)
|
|
15856
15865
|
);
|
|
@@ -15917,7 +15926,6 @@ function resolveCachedTableCellParagraph(source, formatting, styles) {
|
|
|
15917
15926
|
return resolved;
|
|
15918
15927
|
}
|
|
15919
15928
|
const DEFAULT_LINE_HEIGHT = 1.15;
|
|
15920
|
-
const NO_WRAP_MEASURE_WIDTH_PX = 1e5;
|
|
15921
15929
|
const DEFAULT_TABLE_CELL_HORIZONTAL_PADDING_PX = 14.4;
|
|
15922
15930
|
const MIN_TABLE_CELL_CONTENT_WIDTH_PX$1 = 24;
|
|
15923
15931
|
const DEFAULT_TABLE_SEGMENT_VERTICAL_SPACING = 0;
|
|
@@ -16471,7 +16479,8 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
|
|
|
16471
16479
|
track.floatingExclusions.map((exclusion) => ({
|
|
16472
16480
|
...exclusion,
|
|
16473
16481
|
y: exclusion.y - track.height
|
|
16474
|
-
}))
|
|
16482
|
+
})),
|
|
16483
|
+
params.projectionContext ?? EMPTY_PROJECTION_CONTEXT
|
|
16475
16484
|
);
|
|
16476
16485
|
const measuredParagraphLayout = measuredParagraphLayouts == null ? void 0 : measuredParagraphLayouts[sourceBlock.id];
|
|
16477
16486
|
const paragraphLayout = measuredParagraphLayout && isMeasuredLayoutCurrent(projectedParagraphLayout, measuredParagraphLayout) ? applyMeasuredLineGeometry(
|
|
@@ -16783,7 +16792,7 @@ function estimateSingleCellRowSliceHeight(row, cellIndex, start, end, styles, me
|
|
|
16783
16792
|
rowIndex
|
|
16784
16793
|
);
|
|
16785
16794
|
}
|
|
16786
|
-
function findCellSplitEndPosition(row, cellIndex, start, availableHeight, styles, measurer, defaultTabStop, contentWidth, table, rowIndex) {
|
|
16795
|
+
function findCellSplitEndPosition(row, cellIndex, start, availableHeight, styles, measurer, defaultTabStop, contentWidth, table, rowIndex, projectionContext = EMPTY_PROJECTION_CONTEXT) {
|
|
16787
16796
|
const cell = row.cells[cellIndex];
|
|
16788
16797
|
if (!cell) return start;
|
|
16789
16798
|
const limit = cell.blocks.length;
|
|
@@ -16822,7 +16831,8 @@ function findCellSplitEndPosition(row, cellIndex, start, availableHeight, styles
|
|
|
16822
16831
|
styles,
|
|
16823
16832
|
contentWidth,
|
|
16824
16833
|
measurer,
|
|
16825
|
-
defaultTabStop
|
|
16834
|
+
defaultTabStop,
|
|
16835
|
+
projectionContext
|
|
16826
16836
|
);
|
|
16827
16837
|
for (const line of layout.lines) {
|
|
16828
16838
|
if (line.endOffset <= startOffset || line.endOffset >= paragraphLength) {
|
|
@@ -16894,7 +16904,14 @@ function resolveFloatingTableWidth(table, contentWidth) {
|
|
|
16894
16904
|
}
|
|
16895
16905
|
function paginateTableBlock(track, params, sourceBlock, index) {
|
|
16896
16906
|
var _a;
|
|
16897
|
-
const {
|
|
16907
|
+
const {
|
|
16908
|
+
contentWidth,
|
|
16909
|
+
measurer,
|
|
16910
|
+
styles,
|
|
16911
|
+
defaultTabStop,
|
|
16912
|
+
measuredHeights,
|
|
16913
|
+
projectionContext
|
|
16914
|
+
} = params;
|
|
16898
16915
|
const tableHeight = (measuredHeights == null ? void 0 : measuredHeights[sourceBlock.id]) ?? estimateTableBlockHeight(
|
|
16899
16916
|
sourceBlock,
|
|
16900
16917
|
styles,
|
|
@@ -17108,7 +17125,8 @@ function paginateTableBlock(track, params, sourceBlock, index) {
|
|
|
17108
17125
|
defaultTabStop,
|
|
17109
17126
|
contentWidth,
|
|
17110
17127
|
sourceBlock,
|
|
17111
|
-
rowGroups[groupEndIndex].startRowIndex
|
|
17128
|
+
rowGroups[groupEndIndex].startRowIndex,
|
|
17129
|
+
projectionContext
|
|
17112
17130
|
)
|
|
17113
17131
|
);
|
|
17114
17132
|
if (positionsProgressed(starts, ends)) {
|
|
@@ -17155,7 +17173,12 @@ function paginateTableBlock(track, params, sourceBlock, index) {
|
|
|
17155
17173
|
splitEndPositions,
|
|
17156
17174
|
startCellPositions
|
|
17157
17175
|
);
|
|
17158
|
-
advanceCursor(
|
|
17176
|
+
advanceCursor(
|
|
17177
|
+
groupEndIndex,
|
|
17178
|
+
isLastRowSplit,
|
|
17179
|
+
splitEnds,
|
|
17180
|
+
splitEndPositions
|
|
17181
|
+
);
|
|
17159
17182
|
return block;
|
|
17160
17183
|
},
|
|
17161
17184
|
force(segmentId) {
|
|
@@ -17187,7 +17210,8 @@ function paginateTableBlock(track, params, sourceBlock, index) {
|
|
|
17187
17210
|
defaultTabStop,
|
|
17188
17211
|
contentWidth,
|
|
17189
17212
|
sourceBlock,
|
|
17190
|
-
startRowIndex
|
|
17213
|
+
startRowIndex,
|
|
17214
|
+
projectionContext
|
|
17191
17215
|
)
|
|
17192
17216
|
);
|
|
17193
17217
|
if (!positionsProgressed(starts, ends)) {
|
|
@@ -17201,7 +17225,11 @@ function paginateTableBlock(track, params, sourceBlock, index) {
|
|
|
17201
17225
|
splitEnds = positionsToBlockIndexes(ends);
|
|
17202
17226
|
splitEndPositions = ends;
|
|
17203
17227
|
isLastRowSplit = true;
|
|
17204
|
-
const slicedLastRow = buildRowSliceFromPositions(
|
|
17228
|
+
const slicedLastRow = buildRowSliceFromPositions(
|
|
17229
|
+
targetRow,
|
|
17230
|
+
starts,
|
|
17231
|
+
ends
|
|
17232
|
+
);
|
|
17205
17233
|
segmentHeight = getTableSegmentHeight(
|
|
17206
17234
|
{ ...sourceBlock, rows: [slicedLastRow] },
|
|
17207
17235
|
0,
|
|
@@ -17236,7 +17264,12 @@ function paginateTableBlock(track, params, sourceBlock, index) {
|
|
|
17236
17264
|
splitEndPositions,
|
|
17237
17265
|
startCellPositions
|
|
17238
17266
|
);
|
|
17239
|
-
advanceCursor(
|
|
17267
|
+
advanceCursor(
|
|
17268
|
+
groupEndIndex,
|
|
17269
|
+
isLastRowSplit,
|
|
17270
|
+
splitEnds,
|
|
17271
|
+
splitEndPositions
|
|
17272
|
+
);
|
|
17240
17273
|
return block;
|
|
17241
17274
|
}
|
|
17242
17275
|
});
|
|
@@ -17267,7 +17300,8 @@ function projectColumnTrackLayout(context2) {
|
|
|
17267
17300
|
measurer = domTextMeasurer,
|
|
17268
17301
|
reservedHeightByPageIndex,
|
|
17269
17302
|
defaultTabStop,
|
|
17270
|
-
contentWidthOverride
|
|
17303
|
+
contentWidthOverride,
|
|
17304
|
+
projectionContext
|
|
17271
17305
|
} = context2;
|
|
17272
17306
|
const contentWidth = contentWidthOverride ?? getPageContentWidth(pageSettings);
|
|
17273
17307
|
const track = new PaginationTrack(
|
|
@@ -17285,7 +17319,8 @@ function projectColumnTrackLayout(context2) {
|
|
|
17285
17319
|
totalPages,
|
|
17286
17320
|
defaultTabStop,
|
|
17287
17321
|
measuredHeights,
|
|
17288
|
-
measuredParagraphLayouts
|
|
17322
|
+
measuredParagraphLayouts,
|
|
17323
|
+
projectionContext
|
|
17289
17324
|
};
|
|
17290
17325
|
for (let index = 0; index < blocks.length; index += 1) {
|
|
17291
17326
|
const sourceBlock = blocks[index];
|
|
@@ -17966,7 +18001,6 @@ function resolveTableLeftOffset(table, tableWidth, contentWidth) {
|
|
|
17966
18001
|
}
|
|
17967
18002
|
return resolveTableIndentLeft(table);
|
|
17968
18003
|
}
|
|
17969
|
-
const NO_WRAP_WIDTH_PX = 1e5;
|
|
17970
18004
|
const MIN_TABLE_CELL_CONTENT_WIDTH_PX = 24;
|
|
17971
18005
|
function resolveCellVerticalMode(cell) {
|
|
17972
18006
|
var _a, _b, _c;
|
|
@@ -18044,8 +18078,16 @@ function prepareCells(options) {
|
|
|
18044
18078
|
right: resolveBorder(((_m = cell.style) == null ? void 0 : _m.borderRight) ?? logicalRight),
|
|
18045
18079
|
bottom: resolveBorder((_n = cell.style) == null ? void 0 : _n.borderBottom),
|
|
18046
18080
|
left: resolveBorder(((_o = cell.style) == null ? void 0 : _o.borderLeft) ?? logicalLeft),
|
|
18047
|
-
...((_p = cell.style) == null ? void 0 : _p.borderTopLeftToBottomRight) ? {
|
|
18048
|
-
|
|
18081
|
+
...((_p = cell.style) == null ? void 0 : _p.borderTopLeftToBottomRight) ? {
|
|
18082
|
+
topLeftToBottomRight: resolveBorder(
|
|
18083
|
+
cell.style.borderTopLeftToBottomRight
|
|
18084
|
+
)
|
|
18085
|
+
} : {},
|
|
18086
|
+
...((_q = cell.style) == null ? void 0 : _q.borderTopRightToBottomLeft) ? {
|
|
18087
|
+
topRightToBottomLeft: resolveBorder(
|
|
18088
|
+
cell.style.borderTopRightToBottomLeft
|
|
18089
|
+
)
|
|
18090
|
+
} : {}
|
|
18049
18091
|
};
|
|
18050
18092
|
const contentWidthPx = Math.max(
|
|
18051
18093
|
MIN_TABLE_CELL_CONTENT_WIDTH_PX,
|
|
@@ -18060,7 +18102,7 @@ function prepareCells(options) {
|
|
|
18060
18102
|
const wrapWidth = isRotated || ((_s = cell.style) == null ? void 0 : _s.noWrap) ? isRotated && hasExplicitRowHeight ? Math.max(
|
|
18061
18103
|
MIN_TABLE_CELL_CONTENT_WIDTH_PX,
|
|
18062
18104
|
explicitRowHeightPx - borders.top.width - borders.bottom.width - padding.top - padding.bottom
|
|
18063
|
-
) :
|
|
18105
|
+
) : NO_WRAP_MEASURE_WIDTH_PX : contentWidthPx;
|
|
18064
18106
|
const projectedParagraphs = [];
|
|
18065
18107
|
let contentNaturalHeightPx = 0;
|
|
18066
18108
|
for (const original of cell.blocks) {
|
|
@@ -18071,7 +18113,7 @@ function prepareCells(options) {
|
|
|
18071
18113
|
pageIndex,
|
|
18072
18114
|
void 0,
|
|
18073
18115
|
state.document.styles,
|
|
18074
|
-
|
|
18116
|
+
NO_WRAP_MEASURE_WIDTH_PX,
|
|
18075
18117
|
void 0,
|
|
18076
18118
|
(_t = state.document.settings) == null ? void 0 : _t.defaultTabStop
|
|
18077
18119
|
);
|
|
@@ -18127,7 +18169,10 @@ function prepareCells(options) {
|
|
|
18127
18169
|
const removedAfter = previous.spacingAfter;
|
|
18128
18170
|
previous.height = Math.max(1, previous.height - removedAfter);
|
|
18129
18171
|
previous.spacingAfter = 0;
|
|
18130
|
-
contentNaturalHeightPx = Math.max(
|
|
18172
|
+
contentNaturalHeightPx = Math.max(
|
|
18173
|
+
0,
|
|
18174
|
+
contentNaturalHeightPx - removedAfter
|
|
18175
|
+
);
|
|
18131
18176
|
effectiveSpacingBefore = 0;
|
|
18132
18177
|
} else {
|
|
18133
18178
|
const collapsed = Math.min(previous.spacingAfter, spacingBefore);
|
|
@@ -18279,7 +18324,11 @@ function assembleCellEntries(options) {
|
|
|
18279
18324
|
0
|
|
18280
18325
|
);
|
|
18281
18326
|
let paragraphCursorY = 0;
|
|
18282
|
-
const verticalContentOffset = cellEntry.verticalMode === "horizontal" ? resolveVerticalContentOffset(
|
|
18327
|
+
const verticalContentOffset = cellEntry.verticalMode === "horizontal" ? resolveVerticalContentOffset(
|
|
18328
|
+
cell,
|
|
18329
|
+
contentHeightPx,
|
|
18330
|
+
cellEntry.contentNaturalHeightPx
|
|
18331
|
+
) : 0;
|
|
18283
18332
|
const paragraphs = [];
|
|
18284
18333
|
for (const projected of cellEntry.projectedParagraphs) {
|
|
18285
18334
|
paragraphs.push({
|
|
@@ -18371,7 +18420,10 @@ function buildCanvasTableLayout(options) {
|
|
|
18371
18420
|
let glyphWidth = 0;
|
|
18372
18421
|
for (const block of cell.blocks) {
|
|
18373
18422
|
if (block.type !== "paragraph") continue;
|
|
18374
|
-
glyphWidth = Math.max(
|
|
18423
|
+
glyphWidth = Math.max(
|
|
18424
|
+
glyphWidth,
|
|
18425
|
+
estimateStackedColumnWidth(block, state)
|
|
18426
|
+
);
|
|
18375
18427
|
}
|
|
18376
18428
|
if (glyphWidth <= 0) continue;
|
|
18377
18429
|
const padding = resolveCellPadding(cell);
|
|
@@ -18387,7 +18439,9 @@ function buildCanvasTableLayout(options) {
|
|
|
18387
18439
|
columnOffsets[i + 1] = columnOffsets[i] + resolvedColumnWidths[i] + cellSpacingPx;
|
|
18388
18440
|
}
|
|
18389
18441
|
const effectiveRowStyles = table.rows.map((row, rowIndex) => {
|
|
18390
|
-
const entry = tableEntries.find(
|
|
18442
|
+
const entry = tableEntries.find(
|
|
18443
|
+
(candidate) => candidate.rowIndex === rowIndex
|
|
18444
|
+
);
|
|
18391
18445
|
return entry ? resolveEffectiveTableCellFormatting({
|
|
18392
18446
|
table: sourceTable,
|
|
18393
18447
|
rowIndex,
|
|
@@ -18437,7 +18491,7 @@ function buildCanvasTableLayout(options) {
|
|
|
18437
18491
|
};
|
|
18438
18492
|
}
|
|
18439
18493
|
var _tmpl$$y = /* @__PURE__ */ template(`<div class=oasis-editor-page-break style="display:flex;align-items:center;justify-content:center;margin:16px 0;position:relative;user-select:none"><div style="position:absolute;left:0;right:0;top:50%;border-top:1px dashed var(--oasis-toolbar-border, #e0e3e7)"></div><div style="background:var(--oasis-bg, #f6f8fb);padding:0 12px;color:var(--oasis-text-muted, #5f6368);font-size:12px;font-family:var(--oasis-font-ui, sans-serif);z-index:1">`);
|
|
18440
|
-
function PageBreak(
|
|
18494
|
+
function PageBreak(_props) {
|
|
18441
18495
|
const t = useI18n();
|
|
18442
18496
|
return (() => {
|
|
18443
18497
|
var _el$ = _tmpl$$y(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
@@ -20489,7 +20543,10 @@ function resolveCanvasTextFill(ctx, styles, line, fragment, originX, originY) {
|
|
|
20489
20543
|
const axis = resolveGradientAxis(x0, y0, x1, y1, fill.angle ?? 0);
|
|
20490
20544
|
const gradient = ctx.createLinearGradient(axis.x0, axis.y0, axis.x1, axis.y1);
|
|
20491
20545
|
for (const stop of fill.stops) {
|
|
20492
|
-
gradient.addColorStop(
|
|
20546
|
+
gradient.addColorStop(
|
|
20547
|
+
stop.position,
|
|
20548
|
+
hexToRgba(stop.color, stop.alpha ?? 1)
|
|
20549
|
+
);
|
|
20493
20550
|
}
|
|
20494
20551
|
return gradient;
|
|
20495
20552
|
}
|
|
@@ -20980,7 +21037,14 @@ function drawTextFragment(ctx, paragraph, line, fragment, slotByOffset, state, s
|
|
|
20980
21037
|
segmentLeft = null;
|
|
20981
21038
|
return;
|
|
20982
21039
|
}
|
|
20983
|
-
drawStyledText(
|
|
21040
|
+
drawStyledText(
|
|
21041
|
+
ctx,
|
|
21042
|
+
segmentText,
|
|
21043
|
+
originX + segmentLeft,
|
|
21044
|
+
baselineY,
|
|
21045
|
+
scale,
|
|
21046
|
+
styles
|
|
21047
|
+
);
|
|
20984
21048
|
segmentText = "";
|
|
20985
21049
|
segmentLeft = null;
|
|
20986
21050
|
};
|
|
@@ -20999,14 +21063,27 @@ function drawTextFragment(ctx, paragraph, line, fragment, slotByOffset, state, s
|
|
|
20999
21063
|
const nextSlot = slotByOffset.get(char.paragraphOffset + 1);
|
|
21000
21064
|
const leader = resolveTabLeader(paragraph, line, slot.left, state);
|
|
21001
21065
|
if (nextSlot && leader) {
|
|
21002
|
-
drawTabLeader(
|
|
21066
|
+
drawTabLeader(
|
|
21067
|
+
ctx,
|
|
21068
|
+
leader,
|
|
21069
|
+
originX + slot.left,
|
|
21070
|
+
originX + nextSlot.left,
|
|
21071
|
+
baselineY
|
|
21072
|
+
);
|
|
21003
21073
|
}
|
|
21004
21074
|
continue;
|
|
21005
21075
|
}
|
|
21006
21076
|
const renderedChar = getRenderedChar(char.char, styles);
|
|
21007
21077
|
if (hasManualCharacterSpacing) {
|
|
21008
21078
|
flushSegment();
|
|
21009
|
-
drawStyledText(
|
|
21079
|
+
drawStyledText(
|
|
21080
|
+
ctx,
|
|
21081
|
+
renderedChar,
|
|
21082
|
+
originX + slot.left,
|
|
21083
|
+
baselineY,
|
|
21084
|
+
scale,
|
|
21085
|
+
styles
|
|
21086
|
+
);
|
|
21010
21087
|
continue;
|
|
21011
21088
|
}
|
|
21012
21089
|
if (char.char === " ") {
|
|
@@ -21028,7 +21105,7 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21028
21105
|
for (const slot of line.slots) {
|
|
21029
21106
|
slotByOffset.set(slot.offset, slot);
|
|
21030
21107
|
}
|
|
21031
|
-
const baselineY = originY + line.top + line.height *
|
|
21108
|
+
const baselineY = originY + line.top + line.height * TEXT_BASELINE_RATIO;
|
|
21032
21109
|
const listPrefix = line.index === 0 ? resolveListPrefix(paragraph, state.document) : "";
|
|
21033
21110
|
if (listPrefix) {
|
|
21034
21111
|
const prefixStyles = resolveEffectiveTextStyleForParagraph(
|
|
@@ -21078,15 +21155,43 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21078
21155
|
italic: Boolean(styles.italic),
|
|
21079
21156
|
sample: fragment.text.slice(0, 80)
|
|
21080
21157
|
});
|
|
21081
|
-
ctx.fillStyle = resolveCanvasTextFill(
|
|
21158
|
+
ctx.fillStyle = resolveCanvasTextFill(
|
|
21159
|
+
ctx,
|
|
21160
|
+
styles,
|
|
21161
|
+
line,
|
|
21162
|
+
fragment,
|
|
21163
|
+
originX,
|
|
21164
|
+
originY
|
|
21165
|
+
);
|
|
21082
21166
|
if (styles.shading) {
|
|
21083
|
-
drawFragmentShading(
|
|
21167
|
+
drawFragmentShading(
|
|
21168
|
+
ctx,
|
|
21169
|
+
line,
|
|
21170
|
+
fragment,
|
|
21171
|
+
originX,
|
|
21172
|
+
originY,
|
|
21173
|
+
styles.shading
|
|
21174
|
+
);
|
|
21084
21175
|
}
|
|
21085
21176
|
if (styles.highlight) {
|
|
21086
|
-
drawFragmentHighlight(
|
|
21177
|
+
drawFragmentHighlight(
|
|
21178
|
+
ctx,
|
|
21179
|
+
line,
|
|
21180
|
+
fragment,
|
|
21181
|
+
originX,
|
|
21182
|
+
originY,
|
|
21183
|
+
styles.highlight
|
|
21184
|
+
);
|
|
21087
21185
|
}
|
|
21088
21186
|
if (styles.textBorder) {
|
|
21089
|
-
drawFragmentBorder(
|
|
21187
|
+
drawFragmentBorder(
|
|
21188
|
+
ctx,
|
|
21189
|
+
line,
|
|
21190
|
+
fragment,
|
|
21191
|
+
originX,
|
|
21192
|
+
originY,
|
|
21193
|
+
styles.textBorder
|
|
21194
|
+
);
|
|
21090
21195
|
}
|
|
21091
21196
|
if (fragment.image && !fragment.image.floating) {
|
|
21092
21197
|
const slot = slotByOffset.get(fragment.startOffset);
|
|
@@ -21173,7 +21278,14 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21173
21278
|
drawTextDecoration(ctx, line, fragment, originX, originY, "strike");
|
|
21174
21279
|
}
|
|
21175
21280
|
if (styles.doubleStrike) {
|
|
21176
|
-
drawTextDecoration(
|
|
21281
|
+
drawTextDecoration(
|
|
21282
|
+
ctx,
|
|
21283
|
+
line,
|
|
21284
|
+
fragment,
|
|
21285
|
+
originX,
|
|
21286
|
+
originY,
|
|
21287
|
+
"doubleStrike"
|
|
21288
|
+
);
|
|
21177
21289
|
}
|
|
21178
21290
|
if (styles.emphasisMark) {
|
|
21179
21291
|
drawFragmentEmphasis(
|
|
@@ -21223,7 +21335,7 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21223
21335
|
ctx.save();
|
|
21224
21336
|
ctx.font = "400 13px Calibri";
|
|
21225
21337
|
ctx.fillStyle = "#9ca3af";
|
|
21226
|
-
const y = originY + line.top + line.height *
|
|
21338
|
+
const y = originY + line.top + line.height * TEXT_BASELINE_RATIO;
|
|
21227
21339
|
ctx.fillText("¶", originX + markSlot.left + 2, y);
|
|
21228
21340
|
ctx.restore();
|
|
21229
21341
|
}
|
|
@@ -21352,7 +21464,7 @@ function drawDropCapForParagraph(options) {
|
|
|
21352
21464
|
}
|
|
21353
21465
|
const style2 = dropCap.style;
|
|
21354
21466
|
const { font, fillStyle, renderMetrics } = resolveCanvasRunPaintStyle(style2);
|
|
21355
|
-
const bodyLineHeight = ((_a = lines[0]) == null ? void 0 : _a.height) ?? (
|
|
21467
|
+
const bodyLineHeight = ((_a = lines[0]) == null ? void 0 : _a.height) ?? (style2 == null ? void 0 : style2.fontSize) ?? DEFAULT_FONT_SIZE_PX;
|
|
21356
21468
|
const glyphWidth = measureDropCapWidth(dropCap);
|
|
21357
21469
|
const x = dropCap.type === "margin" ? originX - glyphWidth : originX;
|
|
21358
21470
|
const baselineY = paragraphTop + (dropCap.lines - 0.2) * bodyLineHeight + renderMetrics.baselineOffset;
|
|
@@ -23214,7 +23326,6 @@ const WRAP_OPTIONS = [{
|
|
|
23214
23326
|
labelKey: "layoutOptions.front"
|
|
23215
23327
|
}];
|
|
23216
23328
|
function WrapIcon(props) {
|
|
23217
|
-
useI18n();
|
|
23218
23329
|
const line = (x, y, w) => (() => {
|
|
23219
23330
|
var _el$ = _tmpl$$q();
|
|
23220
23331
|
setAttribute(_el$, "x", x);
|
|
@@ -32263,14 +32374,14 @@ function twipsToPoints(value) {
|
|
|
32263
32374
|
if (!Number.isFinite(parsed)) {
|
|
32264
32375
|
return void 0;
|
|
32265
32376
|
}
|
|
32266
|
-
return
|
|
32377
|
+
return roundTo(parsed / 20, 4);
|
|
32267
32378
|
}
|
|
32268
32379
|
function halfPointsToPx(value) {
|
|
32269
32380
|
const parsed = value ? Number(value) : Number.NaN;
|
|
32270
32381
|
if (!Number.isFinite(parsed)) {
|
|
32271
32382
|
return null;
|
|
32272
32383
|
}
|
|
32273
|
-
return
|
|
32384
|
+
return roundTo(parsed / 2 / 72 * PX_PER_INCH, 4);
|
|
32274
32385
|
}
|
|
32275
32386
|
function normalizeImportedFontFamily(value) {
|
|
32276
32387
|
const family = value == null ? void 0 : value.trim();
|
|
@@ -32735,7 +32846,7 @@ function parseDocxBorder(borderNode) {
|
|
|
32735
32846
|
return { width: 0, type: "none", color: "transparent" };
|
|
32736
32847
|
}
|
|
32737
32848
|
const size = Number(getAttributeValue(borderNode, "sz"));
|
|
32738
|
-
const width = Number.isFinite(size) && size > 0 ?
|
|
32849
|
+
const width = Number.isFinite(size) && size > 0 ? roundTo(size / 8, 4) : 0.75;
|
|
32739
32850
|
const color = normalizeImportedHexColor(getAttributeValue(borderNode, "color")) ?? "#000000";
|
|
32740
32851
|
const normalizedValue = (value == null ? void 0 : value.toLowerCase()) ?? "single";
|
|
32741
32852
|
const type = normalizedValue.includes("dotted") || normalizedValue.includes("dot") ? "dotted" : normalizedValue.includes("dash") ? "dashed" : "solid";
|
|
@@ -33467,7 +33578,7 @@ function parseParagraphStyle$1(paragraphProperties, colors) {
|
|
|
33467
33578
|
}
|
|
33468
33579
|
if (line) {
|
|
33469
33580
|
if (lineRule === "exact" || lineRule === "atLeast") {
|
|
33470
|
-
style2.lineHeight =
|
|
33581
|
+
style2.lineHeight = roundTo(Number(line) / 1440 * 96, 4);
|
|
33471
33582
|
style2.lineRule = lineRule;
|
|
33472
33583
|
} else {
|
|
33473
33584
|
style2.lineHeight = Number(line) / 240;
|
|
@@ -33600,7 +33711,7 @@ function parseDocxWidthValue(element) {
|
|
|
33600
33711
|
return void 0;
|
|
33601
33712
|
}
|
|
33602
33713
|
const pct = raw.trim().endsWith("%") ? Number.parseFloat(raw) : Number(raw) / 50;
|
|
33603
|
-
return Number.isFinite(pct) ? `${
|
|
33714
|
+
return Number.isFinite(pct) ? `${roundTo(pct, 4)}%` : void 0;
|
|
33604
33715
|
}
|
|
33605
33716
|
return twipsToPoints(raw);
|
|
33606
33717
|
}
|
|
@@ -33984,7 +34095,7 @@ function parseTableCellStyle(cellProperties, tableDefaultMargins, colors) {
|
|
|
33984
34095
|
} else if (cellWidthType === "pct" && cellWidthValue) {
|
|
33985
34096
|
const pct = Number(cellWidthValue);
|
|
33986
34097
|
if (Number.isFinite(pct)) {
|
|
33987
|
-
style2.width = `${
|
|
34098
|
+
style2.width = `${roundTo(pct / 50, 4)}%`;
|
|
33988
34099
|
}
|
|
33989
34100
|
}
|
|
33990
34101
|
const tcMar = parseCellMargins(
|
|
@@ -35042,7 +35153,7 @@ function parseTextBoxShape(wsp) {
|
|
|
35042
35153
|
} else if (el.localName === "ln") {
|
|
35043
35154
|
const width = parseOptionalInt$1(el.getAttribute("w"));
|
|
35044
35155
|
if (width !== void 0) {
|
|
35045
|
-
shape.borderWidthPt =
|
|
35156
|
+
shape.borderWidthPt = roundTo(width / EMU_PER_PT, 2);
|
|
35046
35157
|
}
|
|
35047
35158
|
const color = normalizeHexColor(
|
|
35048
35159
|
(_b = findElementDeep(el, "srgbClr")) == null ? void 0 : _b.getAttribute("val")
|
|
@@ -36812,12 +36923,16 @@ async function importDocxToEditorDocument(buffer, options = {}) {
|
|
|
36812
36923
|
const hasAssets = Object.keys(assets.assets).length > 0;
|
|
36813
36924
|
const finalize = (doc2) => {
|
|
36814
36925
|
const settingsPatch = {};
|
|
36815
|
-
if (docSettings.defaultTabStop !== void 0)
|
|
36816
|
-
|
|
36926
|
+
if (docSettings.defaultTabStop !== void 0)
|
|
36927
|
+
settingsPatch.defaultTabStop = docSettings.defaultTabStop;
|
|
36928
|
+
if (docSettings.allowSpaceOfSameStyleInTable)
|
|
36929
|
+
settingsPatch.allowSpaceOfSameStyleInTable = true;
|
|
36817
36930
|
if (docSettings.autoHyphenation) settingsPatch.autoHyphenation = true;
|
|
36818
36931
|
if (docSettings.doNotHyphenateCaps) settingsPatch.doNotHyphenateCaps = true;
|
|
36819
|
-
if (docSettings.consecutiveHyphenLimit !== void 0)
|
|
36820
|
-
|
|
36932
|
+
if (docSettings.consecutiveHyphenLimit !== void 0)
|
|
36933
|
+
settingsPatch.consecutiveHyphenLimit = docSettings.consecutiveHyphenLimit;
|
|
36934
|
+
if (docSettings.hyphenationZone !== void 0)
|
|
36935
|
+
settingsPatch.hyphenationZone = docSettings.hyphenationZone;
|
|
36821
36936
|
if (Object.keys(settingsPatch).length > 0) {
|
|
36822
36937
|
doc2.settings = { ...doc2.settings ?? {}, ...settingsPatch };
|
|
36823
36938
|
}
|
|
@@ -37005,7 +37120,7 @@ function importDocxInWorker(buffer, options = {}) {
|
|
|
37005
37120
|
const worker = new Worker(
|
|
37006
37121
|
new URL(
|
|
37007
37122
|
/* @vite-ignore */
|
|
37008
|
-
"" + new URL("assets/importDocxWorker-
|
|
37123
|
+
"" + new URL("assets/importDocxWorker-nIS-zjkj.js", import.meta.url).href,
|
|
37009
37124
|
import.meta.url
|
|
37010
37125
|
),
|
|
37011
37126
|
{
|
|
@@ -37064,6 +37179,10 @@ const docxImporter = {
|
|
|
37064
37179
|
});
|
|
37065
37180
|
}
|
|
37066
37181
|
};
|
|
37182
|
+
function isAllowedImageSrc(src) {
|
|
37183
|
+
const normalized = src.trim().toLowerCase();
|
|
37184
|
+
return normalized.startsWith("data:image/") || normalized.startsWith("blob:");
|
|
37185
|
+
}
|
|
37067
37186
|
function parseInlineImage(element) {
|
|
37068
37187
|
var _a, _b, _c;
|
|
37069
37188
|
if (element.tagName !== "IMG") {
|
|
@@ -37071,7 +37190,7 @@ function parseInlineImage(element) {
|
|
|
37071
37190
|
}
|
|
37072
37191
|
const img = element;
|
|
37073
37192
|
const src = ((_a = img.getAttribute("src")) == null ? void 0 : _a.trim()) ?? "";
|
|
37074
|
-
if (!src) {
|
|
37193
|
+
if (!src || !isAllowedImageSrc(src)) {
|
|
37075
37194
|
return void 0;
|
|
37076
37195
|
}
|
|
37077
37196
|
const widthAttr = ((_b = img.getAttribute("width")) == null ? void 0 : _b.trim()) ?? "";
|
|
@@ -38865,7 +38984,7 @@ function buildCanvasLayoutSnapshot(options) {
|
|
|
38865
38984
|
};
|
|
38866
38985
|
}
|
|
38867
38986
|
function rounded(value) {
|
|
38868
|
-
return
|
|
38987
|
+
return roundTo(value, 2);
|
|
38869
38988
|
}
|
|
38870
38989
|
function getCanvasPageRectSignature(surface) {
|
|
38871
38990
|
const surfaceRect = surface.getBoundingClientRect();
|
|
@@ -40219,10 +40338,10 @@ function previousFontSizePt(currentPt) {
|
|
|
40219
40338
|
return Math.max(1, Math.round(currentPt) - 1);
|
|
40220
40339
|
}
|
|
40221
40340
|
function fontSizePxToPt(px) {
|
|
40222
|
-
return
|
|
40341
|
+
return roundTo(pxToPt(px), 2);
|
|
40223
40342
|
}
|
|
40224
40343
|
function fontSizePtToPx(pt2) {
|
|
40225
|
-
return
|
|
40344
|
+
return roundTo(ptToPx(pt2), 4);
|
|
40226
40345
|
}
|
|
40227
40346
|
function formatFontSizePt(px) {
|
|
40228
40347
|
const value = Number(px);
|
|
@@ -41112,7 +41231,7 @@ function cmToPx(cm) {
|
|
|
41112
41231
|
return Math.round(cm * PX_PER_CM);
|
|
41113
41232
|
}
|
|
41114
41233
|
function pxToCm(px) {
|
|
41115
|
-
return
|
|
41234
|
+
return roundTo(px / PX_PER_CM, 2);
|
|
41116
41235
|
}
|
|
41117
41236
|
const MARGIN_PRESETS = [
|
|
41118
41237
|
{
|
|
@@ -42634,254 +42753,258 @@ const OASIS_MENU_ITEMS = {
|
|
|
42634
42753
|
formatListsNumbered: "format_lists_numbered"
|
|
42635
42754
|
};
|
|
42636
42755
|
export {
|
|
42637
|
-
|
|
42756
|
+
resolveImageSrc as $,
|
|
42638
42757
|
getParagraphLength as A,
|
|
42639
42758
|
getParagraphText as B,
|
|
42640
42759
|
getActiveZone as C,
|
|
42641
42760
|
getActiveSectionIndex as D,
|
|
42642
|
-
|
|
42643
|
-
|
|
42644
|
-
|
|
42645
|
-
|
|
42646
|
-
|
|
42647
|
-
|
|
42648
|
-
|
|
42649
|
-
|
|
42761
|
+
EMPTY_PROJECTION_CONTEXT as E,
|
|
42762
|
+
getParagraphs as F,
|
|
42763
|
+
normalizeSelection as G,
|
|
42764
|
+
positionToParagraphOffset as H,
|
|
42765
|
+
paragraphOffsetToPosition as I,
|
|
42766
|
+
clampPosition as J,
|
|
42767
|
+
findParagraphIndex as K,
|
|
42768
|
+
createCollapsedSelection as L,
|
|
42650
42769
|
MAX_FOOTNOTE_LAYOUT_ITERATIONS as M,
|
|
42651
|
-
|
|
42652
|
-
|
|
42653
|
-
|
|
42654
|
-
|
|
42655
|
-
|
|
42770
|
+
isSelectionCollapsed as N,
|
|
42771
|
+
parseFontSizePtToPx as O,
|
|
42772
|
+
formatFontSizePt as P,
|
|
42773
|
+
createEditorParagraph as Q,
|
|
42774
|
+
getBlockParagraphs as R,
|
|
42656
42775
|
STANDARD_FONT_SIZES_PT as S,
|
|
42657
|
-
|
|
42658
|
-
|
|
42659
|
-
|
|
42660
|
-
|
|
42661
|
-
|
|
42662
|
-
|
|
42663
|
-
|
|
42664
|
-
|
|
42776
|
+
findParagraphTableLocation as T,
|
|
42777
|
+
buildTableCellLayout as U,
|
|
42778
|
+
PT_PER_PX as V,
|
|
42779
|
+
createEditorTableCell as W,
|
|
42780
|
+
createEditorTableRow as X,
|
|
42781
|
+
createEditorTable as Y,
|
|
42782
|
+
PX_PER_POINT as Z,
|
|
42783
|
+
underlineStyleToCssDecorationStyle as _,
|
|
42665
42784
|
getPageContentWidth as a,
|
|
42666
|
-
|
|
42667
|
-
|
|
42668
|
-
|
|
42669
|
-
|
|
42670
|
-
|
|
42671
|
-
|
|
42672
|
-
|
|
42673
|
-
|
|
42674
|
-
|
|
42675
|
-
|
|
42676
|
-
|
|
42677
|
-
|
|
42678
|
-
|
|
42679
|
-
|
|
42680
|
-
|
|
42681
|
-
|
|
42682
|
-
|
|
42683
|
-
|
|
42684
|
-
|
|
42685
|
-
|
|
42686
|
-
|
|
42687
|
-
|
|
42688
|
-
|
|
42689
|
-
|
|
42690
|
-
|
|
42691
|
-
|
|
42692
|
-
|
|
42693
|
-
|
|
42694
|
-
|
|
42695
|
-
|
|
42696
|
-
|
|
42697
|
-
|
|
42698
|
-
|
|
42699
|
-
|
|
42700
|
-
|
|
42701
|
-
|
|
42702
|
-
|
|
42703
|
-
|
|
42704
|
-
|
|
42705
|
-
|
|
42706
|
-
|
|
42707
|
-
|
|
42708
|
-
|
|
42709
|
-
|
|
42710
|
-
|
|
42711
|
-
|
|
42712
|
-
|
|
42713
|
-
|
|
42714
|
-
|
|
42715
|
-
|
|
42716
|
-
|
|
42717
|
-
|
|
42718
|
-
|
|
42719
|
-
|
|
42720
|
-
|
|
42721
|
-
|
|
42722
|
-
|
|
42723
|
-
|
|
42724
|
-
|
|
42725
|
-
|
|
42726
|
-
|
|
42727
|
-
|
|
42728
|
-
|
|
42729
|
-
|
|
42785
|
+
imageExtensionFromMime as a$,
|
|
42786
|
+
listKindForTag as a0,
|
|
42787
|
+
isParagraphTag as a1,
|
|
42788
|
+
collectInlineRuns as a2,
|
|
42789
|
+
parseParagraphStyle as a3,
|
|
42790
|
+
getRunImage as a4,
|
|
42791
|
+
InlineShell as a5,
|
|
42792
|
+
BalloonShell as a6,
|
|
42793
|
+
DocumentShell as a7,
|
|
42794
|
+
createMemo as a8,
|
|
42795
|
+
getCaretRectFromSnapshot as a9,
|
|
42796
|
+
OasisEditorEditor as aA,
|
|
42797
|
+
OasisBrandMark as aB,
|
|
42798
|
+
setPreciseFontPreference as aC,
|
|
42799
|
+
setWelcomeSeen as aD,
|
|
42800
|
+
enablePreciseFontMode as aE,
|
|
42801
|
+
TWIPS_PER_POINT as aF,
|
|
42802
|
+
PX_PER_INCH as aG,
|
|
42803
|
+
TWIPS_PER_INCH as aH,
|
|
42804
|
+
normalizeHex6 as aI,
|
|
42805
|
+
TABLE_CONDITIONAL_FLAG_ATTRIBUTES as aJ,
|
|
42806
|
+
TABLE_BORDER_EDGE_KEYS as aK,
|
|
42807
|
+
resolveEffectiveParagraphStyle as aL,
|
|
42808
|
+
resolveEffectiveTextStyleForParagraph as aM,
|
|
42809
|
+
EMU_PER_PT as aN,
|
|
42810
|
+
OOXML_ROTATION_UNITS as aO,
|
|
42811
|
+
OOXML_PERCENT_DENOMINATOR as aP,
|
|
42812
|
+
parseHexColorToRgb255 as aQ,
|
|
42813
|
+
EMU_PER_PX as aR,
|
|
42814
|
+
getRunFootnoteReference as aS,
|
|
42815
|
+
getRunEndnoteReference as aT,
|
|
42816
|
+
iterateFootnoteReferenceRuns as aU,
|
|
42817
|
+
iterateEndnoteReferenceRuns as aV,
|
|
42818
|
+
imageContentTypeDefaults as aW,
|
|
42819
|
+
getRunFieldChar as aX,
|
|
42820
|
+
getRunFieldInstruction as aY,
|
|
42821
|
+
createEditorRun as aZ,
|
|
42822
|
+
JSZip as a_,
|
|
42823
|
+
getParagraphRectFromSnapshot as aa,
|
|
42824
|
+
createComponent as ab,
|
|
42825
|
+
CaretOverlay as ac,
|
|
42826
|
+
Show as ad,
|
|
42827
|
+
createRenderEffect as ae,
|
|
42828
|
+
style as af,
|
|
42829
|
+
setAttribute as ag,
|
|
42830
|
+
setStyleProperty as ah,
|
|
42831
|
+
memo as ai,
|
|
42832
|
+
template as aj,
|
|
42833
|
+
addEventListener as ak,
|
|
42834
|
+
insert as al,
|
|
42835
|
+
delegateEvents as am,
|
|
42836
|
+
useI18n as an,
|
|
42837
|
+
createEffect as ao,
|
|
42838
|
+
use as ap,
|
|
42839
|
+
Dialog as aq,
|
|
42840
|
+
className as ar,
|
|
42841
|
+
For as as,
|
|
42842
|
+
UNDERLINE_STYLE_OPTIONS as at,
|
|
42843
|
+
Tabs as au,
|
|
42844
|
+
createStore as av,
|
|
42845
|
+
reconcile as aw,
|
|
42846
|
+
onMount as ax,
|
|
42847
|
+
onCleanup as ay,
|
|
42848
|
+
PluginUiHost as az,
|
|
42730
42849
|
getPageBodyTop as b,
|
|
42731
|
-
|
|
42732
|
-
|
|
42733
|
-
|
|
42734
|
-
|
|
42735
|
-
|
|
42736
|
-
|
|
42737
|
-
|
|
42738
|
-
|
|
42739
|
-
|
|
42740
|
-
|
|
42741
|
-
|
|
42742
|
-
|
|
42743
|
-
|
|
42744
|
-
|
|
42745
|
-
|
|
42746
|
-
|
|
42747
|
-
|
|
42748
|
-
|
|
42749
|
-
|
|
42750
|
-
|
|
42751
|
-
|
|
42752
|
-
|
|
42753
|
-
|
|
42754
|
-
|
|
42755
|
-
|
|
42756
|
-
|
|
42757
|
-
|
|
42758
|
-
|
|
42759
|
-
|
|
42760
|
-
|
|
42761
|
-
|
|
42762
|
-
|
|
42763
|
-
|
|
42764
|
-
|
|
42765
|
-
|
|
42766
|
-
|
|
42767
|
-
|
|
42768
|
-
|
|
42769
|
-
|
|
42770
|
-
|
|
42771
|
-
|
|
42772
|
-
|
|
42773
|
-
|
|
42774
|
-
|
|
42775
|
-
|
|
42776
|
-
|
|
42777
|
-
|
|
42778
|
-
|
|
42779
|
-
|
|
42780
|
-
|
|
42781
|
-
|
|
42782
|
-
|
|
42783
|
-
|
|
42784
|
-
|
|
42785
|
-
|
|
42786
|
-
|
|
42787
|
-
|
|
42788
|
-
|
|
42789
|
-
|
|
42790
|
-
|
|
42791
|
-
|
|
42792
|
-
|
|
42793
|
-
|
|
42794
|
-
|
|
42850
|
+
VERTICAL_HIT_WEIGHT as b$,
|
|
42851
|
+
pxToPt as b0,
|
|
42852
|
+
resolveFloatingObjectRect as b1,
|
|
42853
|
+
getTextBoxFloatingGeometry as b2,
|
|
42854
|
+
getPresetPathSegments as b3,
|
|
42855
|
+
buildListLabels as b4,
|
|
42856
|
+
DEFAULT_FONT_SIZE_PX as b5,
|
|
42857
|
+
resolveGradientAxis as b6,
|
|
42858
|
+
isDoubleUnderlineStyle as b7,
|
|
42859
|
+
isWavyUnderlineStyle as b8,
|
|
42860
|
+
underlineStyleLineWidthPx as b9,
|
|
42861
|
+
defaultFontDecoderRegistry as bA,
|
|
42862
|
+
SfntFontProgram as bB,
|
|
42863
|
+
collectPdfFontFamilies as bC,
|
|
42864
|
+
outlineFrom as bD,
|
|
42865
|
+
getPageHeaderZoneTop as bE,
|
|
42866
|
+
getPageColumnRects as bF,
|
|
42867
|
+
findFootnoteReference as bG,
|
|
42868
|
+
FOOTNOTE_MARKER_GUTTER_PX as bH,
|
|
42869
|
+
resolveImporterForFile as bI,
|
|
42870
|
+
roundTo as bJ,
|
|
42871
|
+
getDocumentSectionsCanonical as bK,
|
|
42872
|
+
getDocumentParagraphsCanonical as bL,
|
|
42873
|
+
getDocumentParagraphs as bM,
|
|
42874
|
+
getDocumentPageSettings as bN,
|
|
42875
|
+
getTableCellContentWidthForParagraph as bO,
|
|
42876
|
+
layoutMetricsEpoch as bP,
|
|
42877
|
+
bumpLayoutMetricsEpoch as bQ,
|
|
42878
|
+
createCanvasLayoutSnapshotProvider as bR,
|
|
42879
|
+
on as bS,
|
|
42880
|
+
debounce as bT,
|
|
42881
|
+
unwrap as bU,
|
|
42882
|
+
perfTimer as bV,
|
|
42883
|
+
getRunTextBox as bW,
|
|
42884
|
+
createEditorDocument as bX,
|
|
42885
|
+
resolveResizedDimensions as bY,
|
|
42886
|
+
resolveTextBoxRenderHeight as bZ,
|
|
42887
|
+
getToolbarStyleState as b_,
|
|
42888
|
+
WAVY_UNDERLINE_WAVELENGTH_PX as ba,
|
|
42889
|
+
WAVY_UNDERLINE_AMPLITUDE_PX as bb,
|
|
42890
|
+
DOUBLE_UNDERLINE_OFFSET_PX as bc,
|
|
42891
|
+
underlineStyleDashArray as bd,
|
|
42892
|
+
EMPHASIS_GLYPH as be,
|
|
42893
|
+
rgb255ToHex as bf,
|
|
42894
|
+
getImageFloatingGeometry as bg,
|
|
42895
|
+
textStyleToFontSizePt as bh,
|
|
42896
|
+
TEXT_BASELINE_RATIO as bi,
|
|
42897
|
+
resolveOpenTypeFeatureTags as bj,
|
|
42898
|
+
resolveDecorationLineY as bk,
|
|
42899
|
+
DOUBLE_STRIKE_OFFSET_PX as bl,
|
|
42900
|
+
resolveListLabel as bm,
|
|
42901
|
+
getListLabelInset as bn,
|
|
42902
|
+
getAlignedListLabelInset as bo,
|
|
42903
|
+
getParagraphBorderInsets as bp,
|
|
42904
|
+
buildSegmentTable as bq,
|
|
42905
|
+
buildCanvasTableLayout as br,
|
|
42906
|
+
resolveCanvasTableWidth as bs,
|
|
42907
|
+
resolveFloatingTableRect as bt,
|
|
42908
|
+
normalizeFamily as bu,
|
|
42909
|
+
ROBOTO_FONT_FILES as bv,
|
|
42910
|
+
loadFontAsset as bw,
|
|
42911
|
+
OFFICE_COMPAT_FONT_FAMILIES as bx,
|
|
42912
|
+
BinaryReader as by,
|
|
42913
|
+
buildSfnt as bz,
|
|
42795
42914
|
getPageBodyBottom as c,
|
|
42796
|
-
|
|
42797
|
-
|
|
42798
|
-
|
|
42799
|
-
|
|
42800
|
-
|
|
42801
|
-
|
|
42802
|
-
|
|
42803
|
-
|
|
42804
|
-
|
|
42805
|
-
|
|
42806
|
-
|
|
42807
|
-
|
|
42808
|
-
|
|
42809
|
-
|
|
42810
|
-
|
|
42811
|
-
|
|
42812
|
-
|
|
42813
|
-
|
|
42814
|
-
|
|
42815
|
-
|
|
42816
|
-
|
|
42817
|
-
|
|
42818
|
-
|
|
42819
|
-
|
|
42820
|
-
|
|
42821
|
-
|
|
42822
|
-
|
|
42823
|
-
|
|
42824
|
-
|
|
42825
|
-
|
|
42826
|
-
|
|
42827
|
-
|
|
42828
|
-
|
|
42829
|
-
|
|
42830
|
-
|
|
42831
|
-
|
|
42832
|
-
|
|
42833
|
-
|
|
42834
|
-
|
|
42835
|
-
|
|
42836
|
-
|
|
42837
|
-
|
|
42838
|
-
|
|
42839
|
-
|
|
42840
|
-
|
|
42841
|
-
|
|
42842
|
-
|
|
42843
|
-
|
|
42844
|
-
|
|
42845
|
-
|
|
42846
|
-
|
|
42847
|
-
|
|
42848
|
-
|
|
42849
|
-
|
|
42850
|
-
|
|
42851
|
-
|
|
42852
|
-
|
|
42853
|
-
|
|
42854
|
-
|
|
42855
|
-
|
|
42856
|
-
|
|
42857
|
-
|
|
42858
|
-
|
|
42859
|
-
|
|
42915
|
+
SidePanel as c$,
|
|
42916
|
+
getCachedCanvasImage as c0,
|
|
42917
|
+
measureParagraphMinContentWidthPx as c1,
|
|
42918
|
+
getEditableBlocksForZone as c2,
|
|
42919
|
+
findParagraphLocation as c3,
|
|
42920
|
+
createSectionBoundaryParagraph as c4,
|
|
42921
|
+
normalizePageSettings as c5,
|
|
42922
|
+
DEFAULT_EDITOR_PAGE_SETTINGS as c6,
|
|
42923
|
+
markStart as c7,
|
|
42924
|
+
markEnd as c8,
|
|
42925
|
+
getParagraphEntries as c9,
|
|
42926
|
+
Toolbar as cA,
|
|
42927
|
+
OasisEditorLoading as cB,
|
|
42928
|
+
I18nProvider as cC,
|
|
42929
|
+
createTranslator as cD,
|
|
42930
|
+
createEditorLogger as cE,
|
|
42931
|
+
registerDomStatsSurface as cF,
|
|
42932
|
+
Button as cG,
|
|
42933
|
+
Checkbox as cH,
|
|
42934
|
+
ColorPicker as cI,
|
|
42935
|
+
CommandRegistry as cJ,
|
|
42936
|
+
DEFAULT_PALETTE as cK,
|
|
42937
|
+
DialogFooter as cL,
|
|
42938
|
+
FloatingActionButton as cM,
|
|
42939
|
+
GridPicker as cN,
|
|
42940
|
+
IconButton as cO,
|
|
42941
|
+
Menu as cP,
|
|
42942
|
+
OASIS_BUILTIN_COMMANDS as cQ,
|
|
42943
|
+
OASIS_MENU_ITEMS as cR,
|
|
42944
|
+
OASIS_TOOLBAR_ITEMS as cS,
|
|
42945
|
+
OasisEditorAppLazy as cT,
|
|
42946
|
+
OasisEditorContainer as cU,
|
|
42947
|
+
PluginCollection as cV,
|
|
42948
|
+
Popover as cW,
|
|
42949
|
+
RIBBON_TABS as cX,
|
|
42950
|
+
Select as cY,
|
|
42951
|
+
SelectField as cZ,
|
|
42952
|
+
Separator as c_,
|
|
42953
|
+
getParagraphById as ca,
|
|
42954
|
+
createEditorFootnote as cb,
|
|
42955
|
+
createFootnoteReferenceRun as cc,
|
|
42956
|
+
renumberFootnotes as cd,
|
|
42957
|
+
getHeadingLevel as ce,
|
|
42958
|
+
preciseFontModeVersion as cf,
|
|
42959
|
+
isPreciseFontModeEnabled as cg,
|
|
42960
|
+
resolveNamedTextStyle as ch,
|
|
42961
|
+
togglePreciseFontMode as ci,
|
|
42962
|
+
nextFontSizePt as cj,
|
|
42963
|
+
previousFontSizePt as ck,
|
|
42964
|
+
fontSizePtToPx as cl,
|
|
42965
|
+
createDefaultToolbarPreset as cm,
|
|
42966
|
+
MenuRegistry as cn,
|
|
42967
|
+
createToolbarRegistry as co,
|
|
42968
|
+
Editor as cp,
|
|
42969
|
+
resolveCommandRef as cq,
|
|
42970
|
+
commandRefName as cr,
|
|
42971
|
+
createOasisEditorClient as cs,
|
|
42972
|
+
createEditorZoom as ct,
|
|
42973
|
+
startLongTaskObserver as cu,
|
|
42974
|
+
installGlobalReport as cv,
|
|
42975
|
+
applyStoredPreciseFontPreference as cw,
|
|
42976
|
+
getWelcomeSeen as cx,
|
|
42977
|
+
isLocalFontAccessSupported as cy,
|
|
42978
|
+
EDITOR_SCROLL_PADDING_PX as cz,
|
|
42860
42979
|
domTextMeasurer as d,
|
|
42861
|
-
|
|
42862
|
-
|
|
42863
|
-
|
|
42864
|
-
|
|
42865
|
-
|
|
42866
|
-
|
|
42867
|
-
|
|
42868
|
-
|
|
42869
|
-
|
|
42980
|
+
SidePanelBody as d0,
|
|
42981
|
+
SidePanelFooter as d1,
|
|
42982
|
+
SidePanelHeader as d2,
|
|
42983
|
+
SplitButton as d3,
|
|
42984
|
+
StyleGallery as d4,
|
|
42985
|
+
TextField as d5,
|
|
42986
|
+
Button$1 as d6,
|
|
42987
|
+
buildRibbonTabDefinitions as d7,
|
|
42988
|
+
createEditorCommandBus as d8,
|
|
42989
|
+
createOasisEditor as d9,
|
|
42990
|
+
createOasisEditorContainer as da,
|
|
42991
|
+
mount as db,
|
|
42992
|
+
registerToolbarRenderer as dc,
|
|
42870
42993
|
estimateTableBlockHeight as e,
|
|
42871
42994
|
getFootnoteDisplayMarker as f,
|
|
42872
42995
|
getProjectedParagraphBlockHeight as g,
|
|
42873
|
-
|
|
42874
|
-
|
|
42875
|
-
|
|
42876
|
-
|
|
42996
|
+
createProjectionContext as h,
|
|
42997
|
+
getDocumentSections as i,
|
|
42998
|
+
buildFootnoteReservations as j,
|
|
42999
|
+
applyFootnotesToPages as k,
|
|
42877
43000
|
listReferencedEndnotes as l,
|
|
42878
|
-
|
|
42879
|
-
|
|
42880
|
-
|
|
43001
|
+
getRunField as m,
|
|
43002
|
+
projectBlocksLayout as n,
|
|
43003
|
+
assertNever as o,
|
|
42881
43004
|
projectParagraphLayout as p,
|
|
42882
|
-
|
|
43005
|
+
createSignal as q,
|
|
42883
43006
|
reservationSignature as r,
|
|
42884
|
-
|
|
43007
|
+
createEditorStateFromDocument as s,
|
|
42885
43008
|
createInitialEditorState as t,
|
|
42886
43009
|
fontSizePxToPt as u,
|
|
42887
43010
|
visitRun as v,
|