@rhc-office/sdk 6.6.391 → 6.6.393
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/api/annotation-tool.d.ts +16 -0
- package/dist/api/annotation-tool.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +1 -1
- package/dist/browser/document-viewer.js.map +1 -1
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/tools/AnnotationToolImpl.d.ts +1 -0
- package/dist/tools/AnnotationToolImpl.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/annotation-tool.ts +23 -0
- package/src/tools/AnnotationToolImpl.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var X = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(X || {});
|
|
2
|
-
const
|
|
2
|
+
const B = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", P = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
6
6
|
},
|
|
7
7
|
deviceType: "client",
|
|
8
|
-
edgePosition:
|
|
8
|
+
edgePosition: B,
|
|
9
9
|
plugin: {
|
|
10
10
|
pin: "",
|
|
11
11
|
usbKeyType: 14
|
|
@@ -138,7 +138,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
138
138
|
const n = p();
|
|
139
139
|
return t && (n.defaults = g(t)), n.overrides = {}, n.current = g(n.defaults), n.current;
|
|
140
140
|
}, kt = {
|
|
141
|
-
EDGE_POSITION:
|
|
141
|
+
EDGE_POSITION: B,
|
|
142
142
|
RSA_MODE: K,
|
|
143
143
|
SIGNATURE_TYPE: V
|
|
144
144
|
}, R = (t) => {
|
|
@@ -236,6 +236,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
236
236
|
canRedoAnnotation: { kind: "query" },
|
|
237
237
|
selectAnnotationTool: { kind: "command" },
|
|
238
238
|
selectAnnotationStamp: { kind: "command" },
|
|
239
|
+
openTextNoteCalloutDialog: { kind: "command", returnsResult: !0 },
|
|
239
240
|
getCustomStamps: { kind: "query" },
|
|
240
241
|
addCustomTextStamp: { kind: "query" },
|
|
241
242
|
addCustomImageStamp: { kind: "query" },
|
|
@@ -245,7 +246,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
245
246
|
};
|
|
246
247
|
class ae {
|
|
247
248
|
constructor(n) {
|
|
248
|
-
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.getCustomStamps = () => this.adapter.getCustomStamps(), this.addCustomTextStamp = (e) => this.adapter.addCustomTextStamp(e), this.addCustomImageStamp = (e) => this.adapter.addCustomImageStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter = u(
|
|
249
|
+
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.openTextNoteCalloutDialog = (e) => this.adapter.openTextNoteCalloutDialog(e), this.getCustomStamps = () => this.adapter.getCustomStamps(), this.addCustomTextStamp = (e) => this.adapter.addCustomTextStamp(e), this.addCustomImageStamp = (e) => this.adapter.addCustomImageStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter = u(
|
|
249
250
|
"annotation",
|
|
250
251
|
re,
|
|
251
252
|
n
|
|
@@ -612,19 +613,19 @@ class Fe {
|
|
|
612
613
|
);
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
|
-
const
|
|
616
|
+
const Ne = {
|
|
616
617
|
createPDF417Barcode: { kind: "command" }
|
|
617
618
|
};
|
|
618
|
-
class
|
|
619
|
+
class Ue {
|
|
619
620
|
constructor(n) {
|
|
620
621
|
this.createPDF417Barcode = (e, i, r, a, s, o, d) => this.adapter.createPDF417Barcode(e, i, r, a, s, o, d), this.adapter = u(
|
|
621
622
|
"symbology",
|
|
622
|
-
|
|
623
|
+
Ne,
|
|
623
624
|
n
|
|
624
625
|
);
|
|
625
626
|
}
|
|
626
627
|
}
|
|
627
|
-
const
|
|
628
|
+
const xe = {
|
|
628
629
|
setup: { kind: "command" },
|
|
629
630
|
create: { kind: "command" },
|
|
630
631
|
getMarkups: { kind: "callbackQuery" },
|
|
@@ -632,11 +633,11 @@ const Be = {
|
|
|
632
633
|
removeAllMarkups: { kind: "command" },
|
|
633
634
|
sign: { kind: "callbackQuery" }
|
|
634
635
|
};
|
|
635
|
-
class
|
|
636
|
+
class Be {
|
|
636
637
|
constructor(n) {
|
|
637
638
|
this.setup = (e) => this.adapter.setup(e), this.create = (e) => this.adapter.create(e), this.getMarkups = (e) => this.adapter.getMarkups(e), this.removeMarkup = (e, i) => this.adapter.removeMarkup(e, i), this.removeAllMarkups = (e) => this.adapter.removeAllMarkups(e), this.sign = (e) => this.adapter.sign(e), this.adapter = u(
|
|
638
639
|
"templateSign",
|
|
639
|
-
|
|
640
|
+
xe,
|
|
640
641
|
n
|
|
641
642
|
);
|
|
642
643
|
}
|
|
@@ -1076,14 +1077,14 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
|
|
|
1076
1077
|
}, ct = () => {
|
|
1077
1078
|
const t = typeof globalThis.matchMedia == "function";
|
|
1078
1079
|
return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
|
|
1079
|
-
},
|
|
1080
|
+
}, N = (t, n) => {
|
|
1080
1081
|
const e = t;
|
|
1081
1082
|
if (typeof e.addEventListener == "function") {
|
|
1082
1083
|
e.addEventListener("change", n);
|
|
1083
1084
|
return;
|
|
1084
1085
|
}
|
|
1085
1086
|
typeof e.addListener == "function" && e.addListener(n);
|
|
1086
|
-
},
|
|
1087
|
+
}, U = (t, n) => {
|
|
1087
1088
|
const e = t;
|
|
1088
1089
|
if (typeof e.removeEventListener == "function") {
|
|
1089
1090
|
e.removeEventListener("change", n);
|
|
@@ -1092,7 +1093,7 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
|
|
|
1092
1093
|
typeof e.removeListener == "function" && e.removeListener(n);
|
|
1093
1094
|
}, ht = (t) => {
|
|
1094
1095
|
t.style.display || (t.style.display = "block"), t.style.width || (t.style.width = "100%"), t.style.height || (t.style.height = "100%");
|
|
1095
|
-
},
|
|
1096
|
+
}, x = (t, n) => {
|
|
1096
1097
|
const e = n;
|
|
1097
1098
|
if (!e)
|
|
1098
1099
|
return t.removeAttribute("theme"), null;
|
|
@@ -1106,8 +1107,8 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
|
|
|
1106
1107
|
const r = globalThis.matchMedia("(prefers-color-scheme: dark)"), a = globalThis.matchMedia("(prefers-contrast: more)"), s = () => {
|
|
1107
1108
|
i();
|
|
1108
1109
|
};
|
|
1109
|
-
return
|
|
1110
|
-
|
|
1110
|
+
return N(r, s), N(a, s), () => {
|
|
1111
|
+
U(r, s), U(a, s);
|
|
1111
1112
|
};
|
|
1112
1113
|
};
|
|
1113
1114
|
class gt {
|
|
@@ -1118,7 +1119,7 @@ class gt {
|
|
|
1118
1119
|
debug: () => this.debugEnabled,
|
|
1119
1120
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
1120
1121
|
state: this.readerState
|
|
1121
|
-
}, this.documentTool = new me(this.bridgeToolContext), this.uiTool = new Ge(this.bridgeToolContext), this.pageTool = new ve(this.bridgeToolContext), this.pageArrangeTool = new Te(this.bridgeToolContext), this.findTool = new be(this.bridgeToolContext), this.signServerTool = new Fe(this.bridgeToolContext), this.digitalSignTool = new ue(this.bridgeToolContext), this.symbologyTool = new
|
|
1122
|
+
}, this.documentTool = new me(this.bridgeToolContext), this.uiTool = new Ge(this.bridgeToolContext), this.pageTool = new ve(this.bridgeToolContext), this.pageArrangeTool = new Te(this.bridgeToolContext), this.findTool = new be(this.bridgeToolContext), this.signServerTool = new Fe(this.bridgeToolContext), this.digitalSignTool = new ue(this.bridgeToolContext), this.symbologyTool = new Ue(this.bridgeToolContext), this.annotationTool = new ae(this.bridgeToolContext), this.templateSignTool = new Be(this.bridgeToolContext), this.pdfFormFiller = new Pe(this.bridgeToolContext), this.networkingTool = new fe(this.bridgeToolContext), this.cryptoTool = new oe(this.bridgeToolContext), this.securityTool = new _e(this.bridgeToolContext), this.readyCallbacks = [], this.unloadCallbacks = [], this.debugEnabled = !1, this.isReady = !1, this.removed = !1, this.mountToken = 0, this.hostContainer = null, this.readerElement = null, this.readerId = null, this.normalizedConfiguration = null, this.runtimeRestoreState = null, this.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
1122
1123
|
this.debugEnabled = e;
|
|
1123
1124
|
}, this.changeLanguage = (e) => {
|
|
1124
1125
|
this.readerElement && this.readerElement.setAttribute("language", e);
|
|
@@ -1126,7 +1127,7 @@ class gt {
|
|
|
1126
1127
|
this.themeCleanup?.(), this.themeCleanup = null, this.normalizedConfiguration = this.normalizedConfiguration ? {
|
|
1127
1128
|
...this.normalizedConfiguration,
|
|
1128
1129
|
theme: e
|
|
1129
|
-
} : null, this.readerElement && (this.themeCleanup =
|
|
1130
|
+
} : null, this.readerElement && (this.themeCleanup = x(this.readerElement, e));
|
|
1130
1131
|
}, this.setSessionUser = (e) => {
|
|
1131
1132
|
this.sessionUser = e, this.syncReaderRuntimeConfig();
|
|
1132
1133
|
}, this.setSessionUserId = (e) => {
|
|
@@ -1160,7 +1161,7 @@ class gt {
|
|
|
1160
1161
|
if (a.toggleAttribute("data-sdk-compact-mode", o), a.toggleAttribute("data-sdk-ribbon-hidden", i.ribbonMenu === !1), a.toggleAttribute(
|
|
1161
1162
|
"data-sdk-ribbon-title-hidden",
|
|
1162
1163
|
i.ribbonTitle === !1
|
|
1163
|
-
), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup =
|
|
1164
|
+
), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup = x(a, i.theme), this.bindNativeReaderEvents(a), e.replaceChildren(a), this.readerElement = a, await Promise.resolve(), this.mountToken !== r)
|
|
1164
1165
|
return;
|
|
1165
1166
|
const d = await this.bridge.waitForReady();
|
|
1166
1167
|
if (this.mountToken !== r)
|
|
@@ -1279,8 +1280,8 @@ export {
|
|
|
1279
1280
|
Pe as PdfFormFillerImpl,
|
|
1280
1281
|
_e as SecurityToolImpl,
|
|
1281
1282
|
Fe as SignServerToolImpl,
|
|
1282
|
-
|
|
1283
|
-
|
|
1283
|
+
Ue as SymbologyToolImpl,
|
|
1284
|
+
Be as TemplateSignToolImpl,
|
|
1284
1285
|
Ge as UIToolImpl,
|
|
1285
1286
|
X as WatermarkDisplay,
|
|
1286
1287
|
Tt as createNewDocumentSdk,
|