oasis-editor 0.0.97 → 0.0.98
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-m8k4gBW1.js → OasisEditorApp-QVHCHhPa.js} +16 -3
- package/dist/assets/{importDocxWorker-BV6LezJZ.js → importDocxWorker-BulqJDJj.js} +1 -1
- package/dist/core/model/types/documentComments.d.ts +5 -0
- package/dist/core/model/types/styles.d.ts +11 -0
- package/dist/import/docx/commentsXml.d.ts +2 -0
- package/dist/{index-BiTnt_yD.js → index-DBzN897A.js} +28 -2
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/canvas/canvasFontResolution.d.ts +28 -0
- package/dist/ui/canvas/canvasParagraphPainter.d.ts +1 -1
- package/package.json +1 -1
|
@@ -34,6 +34,11 @@ export interface EditorComment {
|
|
|
34
34
|
initials?: string;
|
|
35
35
|
/** `w:comment/@w:date` as an epoch millisecond timestamp. */
|
|
36
36
|
date?: number;
|
|
37
|
+
/**
|
|
38
|
+
* `w16du:dateUtc` companion UTC timestamp (epoch ms). Round-trip metadata
|
|
39
|
+
* only — preserved verbatim so the UTC date survives export.
|
|
40
|
+
*/
|
|
41
|
+
dateUtc?: number;
|
|
37
42
|
/** Resolved/"done" state (`w15:commentEx/@w15:done`). */
|
|
38
43
|
resolved?: boolean;
|
|
39
44
|
/** Flattened comment body text (bodies in scope are single paragraphs). */
|
|
@@ -60,6 +60,17 @@ export interface EditorTextStyle {
|
|
|
60
60
|
glow?: EditorGlow | null;
|
|
61
61
|
/** `w14:reflection` — mirrored copy of glyphs fading below the baseline. */
|
|
62
62
|
reflection?: EditorReflection | null;
|
|
63
|
+
/**
|
|
64
|
+
* `w14:scene3d` — opaque serialized XML preserved verbatim for round-trip.
|
|
65
|
+
* 3D scene/camera is not rendered on any surface; the blob is re-emitted so
|
|
66
|
+
* the property is never silently dropped.
|
|
67
|
+
*/
|
|
68
|
+
scene3dXml?: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* `w14:props3d` — opaque serialized XML preserved verbatim for round-trip.
|
|
71
|
+
* 3D extrusion/bevel material is not rendered; re-emitted to avoid data loss.
|
|
72
|
+
*/
|
|
73
|
+
props3dXml?: string | null;
|
|
63
74
|
highlight?: string | null;
|
|
64
75
|
shading?: string | null;
|
|
65
76
|
language?: EditorTextLanguage | null;
|
|
@@ -2,6 +2,8 @@ export interface ParsedCommentBody {
|
|
|
2
2
|
author: string;
|
|
3
3
|
initials?: string;
|
|
4
4
|
date?: number;
|
|
5
|
+
/** `w16du:dateUtc` companion UTC timestamp (epoch ms). */
|
|
6
|
+
dateUtc?: number;
|
|
5
7
|
text: string;
|
|
6
8
|
resolved?: boolean;
|
|
7
9
|
/** `w14:paraId` of the comment's (first) paragraph — links to commentsEx. */
|
|
@@ -2519,7 +2519,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2519
2519
|
onCleanup(() => {
|
|
2520
2520
|
cancelled = true;
|
|
2521
2521
|
});
|
|
2522
|
-
import("./OasisEditorApp-
|
|
2522
|
+
import("./OasisEditorApp-QVHCHhPa.js").then((m) => {
|
|
2523
2523
|
cancelled = true;
|
|
2524
2524
|
setProgress(1);
|
|
2525
2525
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -15222,6 +15222,17 @@ function resolveCanvasTextRenderMetrics(styles, fontSize) {
|
|
|
15222
15222
|
baselineOffset: -explicitBaselineShift
|
|
15223
15223
|
};
|
|
15224
15224
|
}
|
|
15225
|
+
function applyCanvasTextFeatureHints(ctx, styles, fontSizePx) {
|
|
15226
|
+
const featureCtx = ctx;
|
|
15227
|
+
const threshold = styles == null ? void 0 : styles.kerningThreshold;
|
|
15228
|
+
const kerningActive = threshold !== void 0 && threshold !== null && Number.isFinite(threshold) && fontSizePx / PX_PER_POINT >= threshold;
|
|
15229
|
+
if ("fontKerning" in featureCtx) {
|
|
15230
|
+
featureCtx.fontKerning = kerningActive ? "normal" : "none";
|
|
15231
|
+
}
|
|
15232
|
+
if ("textRendering" in featureCtx) {
|
|
15233
|
+
featureCtx.textRendering = (styles == null ? void 0 : styles.ligatures) && styles.ligatures !== "none" ? "optimizeLegibility" : "optimizeSpeed";
|
|
15234
|
+
}
|
|
15235
|
+
}
|
|
15225
15236
|
function resolveVerticalMode(direction) {
|
|
15226
15237
|
switch (direction) {
|
|
15227
15238
|
case "tbRl":
|
|
@@ -21200,6 +21211,7 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
|
|
|
21200
21211
|
const renderMetrics = resolveCanvasTextRenderMetrics(styles, fontSize);
|
|
21201
21212
|
ctx.save();
|
|
21202
21213
|
ctx.font = `${fontStyle} ${fontWeight} ${renderMetrics.fontSize}px ${fontFamily}`;
|
|
21214
|
+
applyCanvasTextFeatureHints(ctx, styles, fontSize);
|
|
21203
21215
|
logCanvasFontUse({
|
|
21204
21216
|
requestedFamily: styles.fontFamily,
|
|
21205
21217
|
metricFamily,
|
|
@@ -33568,6 +33580,8 @@ function normalizeImportedRunStyle(style2, paragraphStyleId) {
|
|
|
33568
33580
|
textShadow: dd(effective.textShadow, defaultEffective.textShadow),
|
|
33569
33581
|
glow: dd(effective.glow, defaultEffective.glow),
|
|
33570
33582
|
reflection: dd(effective.reflection, defaultEffective.reflection),
|
|
33583
|
+
scene3dXml: dd(effective.scene3dXml, defaultEffective.scene3dXml),
|
|
33584
|
+
props3dXml: dd(effective.props3dXml, defaultEffective.props3dXml),
|
|
33571
33585
|
highlight: dd(effective.highlight, defaultEffective.highlight),
|
|
33572
33586
|
shading: dd(effective.shading, defaultEffective.shading),
|
|
33573
33587
|
language: dd(effective.language, defaultEffective.language),
|
|
@@ -33853,6 +33867,14 @@ function parseRunStyle(runProperties, theme) {
|
|
|
33853
33867
|
if (reflectionEl) {
|
|
33854
33868
|
styles.reflection = parseW14Reflection(reflectionEl);
|
|
33855
33869
|
}
|
|
33870
|
+
const scene3dEl = getFirstW14Child(runProperties, "scene3d");
|
|
33871
|
+
if (scene3dEl) {
|
|
33872
|
+
styles.scene3dXml = new XMLSerializer().serializeToString(scene3dEl);
|
|
33873
|
+
}
|
|
33874
|
+
const props3dEl = getFirstW14Child(runProperties, "props3d");
|
|
33875
|
+
if (props3dEl) {
|
|
33876
|
+
styles.props3dXml = new XMLSerializer().serializeToString(props3dEl);
|
|
33877
|
+
}
|
|
33856
33878
|
const highlight = getFirstChildByTagNameNS(
|
|
33857
33879
|
runProperties,
|
|
33858
33880
|
WORD_NS,
|
|
@@ -36837,6 +36859,7 @@ function extractCommentRangesFromSections(sections) {
|
|
|
36837
36859
|
return ranges;
|
|
36838
36860
|
}
|
|
36839
36861
|
const WORD15_NS = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
36862
|
+
const WORD16DU_NS = "http://schemas.microsoft.com/office/word/2023/wordml/word16du";
|
|
36840
36863
|
function flattenCommentText(element) {
|
|
36841
36864
|
let out = "";
|
|
36842
36865
|
for (let index = 0; index < element.childNodes.length; index += 1) {
|
|
@@ -36909,6 +36932,7 @@ function parseCommentsXml(commentsXml, commentsExtendedXml) {
|
|
|
36909
36932
|
const author = getAttributeValue(comment, "author") ?? "";
|
|
36910
36933
|
const initials = getAttributeValue(comment, "initials") ?? void 0;
|
|
36911
36934
|
const date = parseDate(getAttributeValue(comment, "date"));
|
|
36935
|
+
const dateUtc = parseDate(comment.getAttributeNS(WORD16DU_NS, "dateUtc"));
|
|
36912
36936
|
const paragraphs = getChildrenByTagNameNS(comment, WORD_NS, "p");
|
|
36913
36937
|
const text = paragraphs.map((p) => flattenCommentText(p)).join("\n").trim();
|
|
36914
36938
|
const paraId = paragraphs.length > 0 ? getAttributeValue(paragraphs[0], "paraId") ?? void 0 : void 0;
|
|
@@ -36917,6 +36941,7 @@ function parseCommentsXml(commentsXml, commentsExtendedXml) {
|
|
|
36917
36941
|
author,
|
|
36918
36942
|
...initials ? { initials } : {},
|
|
36919
36943
|
...date !== void 0 ? { date } : {},
|
|
36944
|
+
...dateUtc !== void 0 ? { dateUtc } : {},
|
|
36920
36945
|
text,
|
|
36921
36946
|
...resolved ? { resolved } : {},
|
|
36922
36947
|
...paraId ? { paraId } : {}
|
|
@@ -37312,6 +37337,7 @@ function buildEditorComments(ranges, bodies) {
|
|
|
37312
37337
|
author: (body == null ? void 0 : body.author) ?? "",
|
|
37313
37338
|
...(body == null ? void 0 : body.initials) ? { initials: body.initials } : {},
|
|
37314
37339
|
...(body == null ? void 0 : body.date) !== void 0 ? { date: body.date } : {},
|
|
37340
|
+
...(body == null ? void 0 : body.dateUtc) !== void 0 ? { dateUtc: body.dateUtc } : {},
|
|
37315
37341
|
...(body == null ? void 0 : body.resolved) ? { resolved: body.resolved } : {},
|
|
37316
37342
|
text: (body == null ? void 0 : body.text) ?? "",
|
|
37317
37343
|
...(range == null ? void 0 : range.start) ? { start: range.start } : {},
|
|
@@ -37426,7 +37452,7 @@ function importDocxInWorker(buffer, options = {}) {
|
|
|
37426
37452
|
const worker = new Worker(
|
|
37427
37453
|
new URL(
|
|
37428
37454
|
/* @vite-ignore */
|
|
37429
|
-
"" + new URL("assets/importDocxWorker-
|
|
37455
|
+
"" + new URL("assets/importDocxWorker-BulqJDJj.js", import.meta.url).href,
|
|
37430
37456
|
import.meta.url
|
|
37431
37457
|
),
|
|
37432
37458
|
{
|
package/dist/oasis-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O, c6, c7, c8, c9, ca, a8, cb, Q, bR, cc, cd, ce, N, cf, bP, cg, ch, ci, cj, ck, c1, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, ad, cx, c0, cy, c8 as c82, cd as cd2, cf as cf2, co as co2, cq as cq2, cv as cv2, cz, bT, bO, cA, cB, cC, bQ, cD, cE, bS } from "./index-
|
|
1
|
+
import { O, c6, c7, c8, c9, ca, a8, cb, Q, bR, cc, cd, ce, N, cf, bP, cg, ch, ci, cj, ck, c1, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, ad, cx, c0, cy, c8 as c82, cd as cd2, cf as cf2, co as co2, cq as cq2, cv as cv2, cz, bT, bO, cA, cB, cC, bQ, cD, cE, bS } from "./index-DBzN897A.js";
|
|
2
2
|
export {
|
|
3
3
|
O as BalloonShell,
|
|
4
4
|
c6 as Button,
|