@rhc-office/sdk 6.6.256 → 6.6.264
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/README.md +63 -3
- package/dist/api/document-sdk.d.ts +0 -4
- package/dist/api/document-sdk.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +2 -0
- package/dist/browser/document-viewer.js.map +1 -0
- package/dist/browser.d.ts +33 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/viewer/ReaderConfiguration.d.ts +1 -1
- package/dist/viewer/ReaderConfiguration.d.ts.map +1 -1
- package/package.json +12 -2
- package/src/api/document-sdk.ts +0 -4
- package/src/browser.ts +85 -0
- package/src/viewer/DocumentSDK.ts +2 -2
- package/src/viewer/ReaderConfiguration.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var K = /* @__PURE__ */ ((n) => (n.DEFAULT = "default", n.COMPACT = "compact", n.HIDE = "none", n))(K || {});
|
|
2
|
-
const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto",
|
|
2
|
+
const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", f = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", y = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
@@ -77,7 +77,7 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
77
77
|
}), m = (n) => ({
|
|
78
78
|
defaults: O(n.defaults),
|
|
79
79
|
signServer: L(n.signServer)
|
|
80
|
-
}),
|
|
80
|
+
}), U = (n) => ({
|
|
81
81
|
defaults: n.defaults ? {
|
|
82
82
|
...n.defaults,
|
|
83
83
|
bjca: n.defaults.bjca ? { ...n.defaults.bjca } : void 0,
|
|
@@ -125,7 +125,7 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
125
125
|
checkCertificateBinding: t.usbKey?.checkCertificateBinding ?? n.usbKey.checkCertificateBinding,
|
|
126
126
|
usbKeyType: t.usbKey?.usbKeyType ?? n.usbKey.usbKeyType
|
|
127
127
|
}
|
|
128
|
-
} : L(n),
|
|
128
|
+
} : L(n), N = (n, t) => ({
|
|
129
129
|
defaults: G(n.defaults, t.defaults),
|
|
130
130
|
signServer: H(n.signServer, t.signServer)
|
|
131
131
|
}), q = (n, t) => ({
|
|
@@ -159,20 +159,20 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
159
159
|
} : void 0
|
|
160
160
|
}), Q = () => globalThis, k = () => {
|
|
161
161
|
const n = Q();
|
|
162
|
-
return n[
|
|
162
|
+
return n[f] || (n[f] = {
|
|
163
163
|
current: m(y),
|
|
164
164
|
defaults: m(y),
|
|
165
165
|
overrides: {}
|
|
166
|
-
}), n[
|
|
167
|
-
},
|
|
166
|
+
}), n[f];
|
|
167
|
+
}, Ne = () => k().current, xe = (n) => {
|
|
168
168
|
const t = k();
|
|
169
|
-
return t.defaults = m(n), t.current =
|
|
169
|
+
return t.defaults = m(n), t.current = N(t.defaults, t.overrides), t.current;
|
|
170
170
|
}, Ve = (n) => {
|
|
171
171
|
const t = k();
|
|
172
|
-
return t.current = m(n), t.overrides =
|
|
172
|
+
return t.current = m(n), t.overrides = U(n), t.current;
|
|
173
173
|
}, Be = (n) => {
|
|
174
174
|
const t = k();
|
|
175
|
-
return t.overrides = q(t.overrides,
|
|
175
|
+
return t.overrides = q(t.overrides, U(n)), t.current = N(t.current, n), t.current;
|
|
176
176
|
}, Ke = (n) => {
|
|
177
177
|
const t = k();
|
|
178
178
|
return n && (t.defaults = m(n)), t.overrides = {}, t.current = m(t.defaults), t.current;
|
|
@@ -205,8 +205,8 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", b = "__RHC_OFFICE_DIGIT
|
|
|
205
205
|
if (o.kind === "callbackQuery") {
|
|
206
206
|
const l = a.find((d) => typeof d == "function"), p = a.filter((d) => typeof d != "function");
|
|
207
207
|
e.bridge.request(n, s, T(p)).then((d) => {
|
|
208
|
-
const
|
|
209
|
-
l?.(...
|
|
208
|
+
const b = o.mapCallbackResult?.(d) ?? [d];
|
|
209
|
+
l?.(...b);
|
|
210
210
|
}).catch(e.onAsyncError);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
@@ -496,7 +496,7 @@ const ue = (n) => {
|
|
|
496
496
|
const e = x(n);
|
|
497
497
|
return {
|
|
498
498
|
...t,
|
|
499
|
-
|
|
499
|
+
appUrl: e,
|
|
500
500
|
scrollIntoView: t.scrollIntoView ?? !0,
|
|
501
501
|
theme: ue(t.theme)
|
|
502
502
|
};
|
|
@@ -537,8 +537,8 @@ const B = (n) => {
|
|
|
537
537
|
const i = he(n), r = pe(i);
|
|
538
538
|
t.activeAppUrl = n;
|
|
539
539
|
const o = new Promise((a, s) => {
|
|
540
|
-
const l = (
|
|
541
|
-
|
|
540
|
+
const l = (b) => {
|
|
541
|
+
b?.remove(), s(new S(i));
|
|
542
542
|
}, p = () => {
|
|
543
543
|
globalThis.customElements.whenDefined(h).then(() => {
|
|
544
544
|
a();
|
|
@@ -564,7 +564,7 @@ const B = (n) => {
|
|
|
564
564
|
throw t.loadPromises.delete(n), !globalThis.customElements?.get(h) && t.activeAppUrl === n && (t.activeAppUrl = null), a;
|
|
565
565
|
});
|
|
566
566
|
return t.loadPromises.set(n, o), o;
|
|
567
|
-
},
|
|
567
|
+
}, be = "rhc-office.editor-adapter", fe = 1, Te = "__RHC_OFFICE_EDITOR_ADAPTER__", C = "rhcOfficeAdapterReady", P = "rhcOfficeAdapterEvent", Ee = "data-rhc-office-reader-id", Re = 5e3, ve = 5e3, ye = () => {
|
|
568
568
|
const n = globalThis.crypto;
|
|
569
569
|
return typeof n?.randomUUID == "function" ? n.randomUUID() : `adapter-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
570
570
|
}, g = () => globalThis[Te];
|
|
@@ -617,8 +617,8 @@ class Ce {
|
|
|
617
617
|
}
|
|
618
618
|
};
|
|
619
619
|
const a = {
|
|
620
|
-
protocol:
|
|
621
|
-
version:
|
|
620
|
+
protocol: be,
|
|
621
|
+
version: fe,
|
|
622
622
|
requestId: ye(),
|
|
623
623
|
readerId: this.readerId,
|
|
624
624
|
tool: t,
|
|
@@ -784,7 +784,7 @@ const De = [
|
|
|
784
784
|
"documentStateChange",
|
|
785
785
|
"documentError"
|
|
786
786
|
], Me = "readerReady", Ie = "readerUnload", v = "readerError", we = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, D = (n, t) => ({
|
|
787
|
-
appUrl: t?.
|
|
787
|
+
appUrl: t?.appUrl ?? null,
|
|
788
788
|
configuration: t,
|
|
789
789
|
element: n
|
|
790
790
|
}), _e = (n) => {
|
|
@@ -836,7 +836,7 @@ const De = [
|
|
|
836
836
|
I(r, a), I(o, a);
|
|
837
837
|
};
|
|
838
838
|
};
|
|
839
|
-
class
|
|
839
|
+
class Ue {
|
|
840
840
|
constructor(t) {
|
|
841
841
|
this.bridge = new Ce(), this.callbacks = new Ae(), this.readerState = new Pe(), this.bridgeToolContext = {
|
|
842
842
|
bridge: this.bridge,
|
|
@@ -905,7 +905,7 @@ class Ne {
|
|
|
905
905
|
this.emitReaderEvent(Ie, i), this.unloadCallbacks.forEach((r) => r());
|
|
906
906
|
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getReviewTool = () => this.reviewTool, this.getEkeyTool = () => this.ekeyTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getExtensionTool = () => this.extensionTool, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.createDigitalSignOptions = () => new se(), this.createKVField = (e, i, r) => new ae(e, i, r), this.mountReader = async (e, i, r) => {
|
|
907
907
|
try {
|
|
908
|
-
if (await ke(i.
|
|
908
|
+
if (await ke(i.appUrl), this.mountToken !== r)
|
|
909
909
|
return;
|
|
910
910
|
const o = document.createElement(h), a = we();
|
|
911
911
|
if (o.setAttribute(Ee, a), this.readerId = a, this.bridge.setReaderId(a), Oe(o, i), this.themeCleanup = Le(o, i), this.bindNativeReaderEvents(o), e.replaceChildren(o), this.readerElement = o, await Promise.resolve(), this.mountToken !== r)
|
|
@@ -1046,13 +1046,13 @@ class Ne {
|
|
|
1046
1046
|
);
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
|
-
const He = (n) => new
|
|
1049
|
+
const He = (n) => new Ue(n);
|
|
1050
1050
|
export {
|
|
1051
1051
|
Ge as DIGITAL_SIGN_DEFAULTS,
|
|
1052
|
-
|
|
1052
|
+
Ue as DocumentSDK,
|
|
1053
1053
|
K as WatermarkDisplay,
|
|
1054
1054
|
He as createNewDocumentSdk,
|
|
1055
|
-
|
|
1055
|
+
Ne as getDigitalSignEnvironment,
|
|
1056
1056
|
xe as initializeDigitalSignEnvironment,
|
|
1057
1057
|
Be as patchDigitalSignEnvironment,
|
|
1058
1058
|
Ke as resetDigitalSignEnvironment,
|