@rhc-office/sdk 6.6.381 → 6.6.384
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/common.d.ts +9 -1
- package/dist/api/common.d.ts.map +1 -1
- package/dist/api/crypto-tool.d.ts +1 -2
- package/dist/api/crypto-tool.d.ts.map +1 -1
- package/dist/api/digital-sign-environment.d.ts +1 -27
- package/dist/api/digital-sign-environment.d.ts.map +1 -1
- package/dist/api/document-tool.d.ts +9 -1
- package/dist/api/document-tool.d.ts.map +1 -1
- package/dist/api/sign-server.d.ts +1 -1
- package/dist/api/sign-server.d.ts.map +1 -1
- package/dist/api/sign-tool.d.ts +1 -7
- package/dist/api/sign-tool.d.ts.map +1 -1
- package/dist/api/ui-tool.d.ts +1 -0
- package/dist/api/ui-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 +54 -102
- 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/UIToolImpl.d.ts +1 -0
- package/dist/tools/UIToolImpl.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/common.ts +11 -1
- package/src/api/crypto-tool.ts +1 -2
- package/src/api/digital-sign-environment.ts +1 -84
- package/src/api/document-tool.ts +9 -1
- package/src/api/sign-server.ts +7 -2
- package/src/api/sign-tool.ts +3 -12
- package/src/api/ui-tool.ts +2 -0
- package/src/tools/DocumentToolImpl.ts +2 -2
- package/src/tools/UIToolImpl.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
var Y = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(Y || {});
|
|
2
|
-
const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto",
|
|
2
|
+
const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", E = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
6
6
|
},
|
|
7
7
|
deviceType: "client",
|
|
8
8
|
edgePosition: U,
|
|
9
|
-
kol: {
|
|
10
|
-
appId: "",
|
|
11
|
-
appName: "",
|
|
12
|
-
pin: "",
|
|
13
|
-
serviceUrl: "",
|
|
14
|
-
token: ""
|
|
15
|
-
},
|
|
16
9
|
plugin: {
|
|
17
10
|
pin: "",
|
|
18
11
|
usbKeyType: 14
|
|
@@ -25,12 +18,6 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
25
18
|
defaultLogin: "",
|
|
26
19
|
defaultPassword: "",
|
|
27
20
|
defaultServer: "",
|
|
28
|
-
kol: {
|
|
29
|
-
appId: "",
|
|
30
|
-
appName: "",
|
|
31
|
-
serviceUrl: "",
|
|
32
|
-
token: ""
|
|
33
|
-
},
|
|
34
21
|
macAddress: "",
|
|
35
22
|
token: "",
|
|
36
23
|
usbKey: {
|
|
@@ -44,30 +31,17 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
44
31
|
},
|
|
45
32
|
deviceType: t.deviceType,
|
|
46
33
|
edgePosition: t.edgePosition,
|
|
47
|
-
kol: {
|
|
48
|
-
appId: t.kol.appId,
|
|
49
|
-
appName: t.kol.appName,
|
|
50
|
-
pin: t.kol.pin,
|
|
51
|
-
serviceUrl: t.kol.serviceUrl,
|
|
52
|
-
token: t.kol.token
|
|
53
|
-
},
|
|
54
34
|
plugin: {
|
|
55
35
|
pin: t.plugin.pin,
|
|
56
36
|
usbKeyType: t.plugin.usbKeyType
|
|
57
37
|
},
|
|
58
38
|
rsaMode: t.rsaMode,
|
|
59
39
|
signatureType: t.signatureType
|
|
60
|
-
}),
|
|
40
|
+
}), V = (t) => ({
|
|
61
41
|
authSource: t.authSource,
|
|
62
42
|
defaultLogin: t.defaultLogin,
|
|
63
43
|
defaultPassword: t.defaultPassword,
|
|
64
44
|
defaultServer: t.defaultServer,
|
|
65
|
-
kol: {
|
|
66
|
-
appId: t.kol.appId,
|
|
67
|
-
appName: t.kol.appName,
|
|
68
|
-
serviceUrl: t.kol.serviceUrl,
|
|
69
|
-
token: t.kol.token
|
|
70
|
-
},
|
|
71
45
|
macAddress: t.macAddress,
|
|
72
46
|
token: t.token,
|
|
73
47
|
usbKey: {
|
|
@@ -76,17 +50,15 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
76
50
|
}
|
|
77
51
|
}), g = (t) => ({
|
|
78
52
|
defaults: x(t.defaults),
|
|
79
|
-
signServer:
|
|
80
|
-
}),
|
|
53
|
+
signServer: V(t.signServer)
|
|
54
|
+
}), v = (t) => ({
|
|
81
55
|
defaults: t.defaults ? {
|
|
82
56
|
...t.defaults,
|
|
83
57
|
bjca: t.defaults.bjca ? { ...t.defaults.bjca } : void 0,
|
|
84
|
-
kol: t.defaults.kol ? { ...t.defaults.kol } : void 0,
|
|
85
58
|
plugin: t.defaults.plugin ? { ...t.defaults.plugin } : void 0
|
|
86
59
|
} : void 0,
|
|
87
60
|
signServer: t.signServer ? {
|
|
88
61
|
...t.signServer,
|
|
89
|
-
kol: t.signServer.kol ? { ...t.signServer.kol } : void 0,
|
|
90
62
|
usbKey: t.signServer.usbKey ? { ...t.signServer.usbKey } : void 0
|
|
91
63
|
} : void 0
|
|
92
64
|
}), W = (t, n) => n ? {
|
|
@@ -95,13 +67,6 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
95
67
|
},
|
|
96
68
|
deviceType: n.deviceType ?? t.deviceType,
|
|
97
69
|
edgePosition: n.edgePosition ?? t.edgePosition,
|
|
98
|
-
kol: {
|
|
99
|
-
appId: n.kol?.appId ?? t.kol.appId,
|
|
100
|
-
appName: n.kol?.appName ?? t.kol.appName,
|
|
101
|
-
pin: n.kol?.pin ?? t.kol.pin,
|
|
102
|
-
serviceUrl: n.kol?.serviceUrl ?? t.kol.serviceUrl,
|
|
103
|
-
token: n.kol?.token ?? t.kol.token
|
|
104
|
-
},
|
|
105
70
|
plugin: {
|
|
106
71
|
pin: n.plugin?.pin ?? t.plugin.pin,
|
|
107
72
|
usbKeyType: n.plugin?.usbKeyType ?? t.plugin.usbKeyType
|
|
@@ -113,35 +78,23 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
113
78
|
defaultLogin: n.defaultLogin ?? t.defaultLogin,
|
|
114
79
|
defaultPassword: n.defaultPassword ?? t.defaultPassword,
|
|
115
80
|
defaultServer: n.defaultServer ?? t.defaultServer,
|
|
116
|
-
kol: {
|
|
117
|
-
appId: n.kol?.appId ?? t.kol.appId,
|
|
118
|
-
appName: n.kol?.appName ?? t.kol.appName,
|
|
119
|
-
serviceUrl: n.kol?.serviceUrl ?? t.kol.serviceUrl,
|
|
120
|
-
token: n.kol?.token ?? t.kol.token
|
|
121
|
-
},
|
|
122
81
|
macAddress: n.macAddress ?? t.macAddress,
|
|
123
82
|
token: n.token ?? t.token,
|
|
124
83
|
usbKey: {
|
|
125
84
|
checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
|
|
126
85
|
usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
|
|
127
86
|
}
|
|
128
|
-
} :
|
|
87
|
+
} : V(t), K = (t, n) => ({
|
|
129
88
|
defaults: W(t.defaults, n.defaults),
|
|
130
89
|
signServer: $(t.signServer, n.signServer)
|
|
131
90
|
}), X = (t, n) => {
|
|
132
91
|
const e = t.defaults?.bjca || n.defaults?.bjca ? {
|
|
133
92
|
...t.defaults?.bjca,
|
|
134
93
|
...n.defaults?.bjca
|
|
135
|
-
} : void 0, i = t.defaults?.
|
|
136
|
-
...t.defaults?.kol,
|
|
137
|
-
...n.defaults?.kol
|
|
138
|
-
} : void 0, r = t.defaults?.plugin || n.defaults?.plugin ? {
|
|
94
|
+
} : void 0, i = t.defaults?.plugin || n.defaults?.plugin ? {
|
|
139
95
|
...t.defaults?.plugin,
|
|
140
96
|
...n.defaults?.plugin
|
|
141
|
-
} : void 0,
|
|
142
|
-
...t.signServer?.kol,
|
|
143
|
-
...n.signServer?.kol
|
|
144
|
-
} : void 0, s = t.signServer?.usbKey || n.signServer?.usbKey ? {
|
|
97
|
+
} : void 0, r = t.signServer?.usbKey || n.signServer?.usbKey ? {
|
|
145
98
|
...t.signServer?.usbKey,
|
|
146
99
|
...n.signServer?.usbKey
|
|
147
100
|
} : void 0;
|
|
@@ -150,39 +103,37 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
150
103
|
...t.defaults,
|
|
151
104
|
...n.defaults,
|
|
152
105
|
...e ? { bjca: e } : {},
|
|
153
|
-
...i ? {
|
|
154
|
-
...r ? { plugin: r } : {}
|
|
106
|
+
...i ? { plugin: i } : {}
|
|
155
107
|
} : void 0,
|
|
156
108
|
signServer: t.signServer || n.signServer ? {
|
|
157
109
|
...t.signServer,
|
|
158
110
|
...n.signServer,
|
|
159
|
-
...
|
|
160
|
-
...s ? { usbKey: s } : {}
|
|
111
|
+
...r ? { usbKey: r } : {}
|
|
161
112
|
} : void 0
|
|
162
113
|
};
|
|
163
114
|
}, J = () => globalThis, p = () => {
|
|
164
115
|
const t = J();
|
|
165
|
-
return t[
|
|
116
|
+
return t[f] || (t[f] = {
|
|
166
117
|
current: g(E),
|
|
167
118
|
defaults: g(E),
|
|
168
119
|
overrides: {}
|
|
169
|
-
}), t[
|
|
120
|
+
}), t[f];
|
|
170
121
|
}, ct = () => p().current, ht = () => {
|
|
171
122
|
const t = p();
|
|
172
123
|
return {
|
|
173
124
|
current: g(t.current),
|
|
174
125
|
defaults: g(t.defaults),
|
|
175
|
-
overrides:
|
|
126
|
+
overrides: v(t.overrides)
|
|
176
127
|
};
|
|
177
128
|
}, gt = (t) => {
|
|
178
129
|
const n = p();
|
|
179
|
-
return n.defaults = g(t), n.current =
|
|
130
|
+
return n.defaults = g(t), n.current = K(n.defaults, n.overrides), n.current;
|
|
180
131
|
}, mt = (t) => {
|
|
181
132
|
const n = p();
|
|
182
|
-
return n.current = g(t), n.overrides =
|
|
133
|
+
return n.current = g(t), n.overrides = v(t), n.current;
|
|
183
134
|
}, pt = (t) => {
|
|
184
135
|
const n = p();
|
|
185
|
-
return n.overrides = X(n.overrides,
|
|
136
|
+
return n.overrides = X(n.overrides, v(t)), n.current = K(n.current, t), n.current;
|
|
186
137
|
}, bt = (t) => {
|
|
187
138
|
const n = p();
|
|
188
139
|
return t && (n.defaults = g(t)), n.overrides = {}, n.current = g(n.defaults), n.current;
|
|
@@ -190,7 +141,7 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
190
141
|
EDGE_POSITION: U,
|
|
191
142
|
RSA_MODE: B,
|
|
192
143
|
SIGNATURE_TYPE: N
|
|
193
|
-
},
|
|
144
|
+
}, R = (t) => {
|
|
194
145
|
if (t.length !== 0)
|
|
195
146
|
return t.length === 1 ? t[0] : t;
|
|
196
147
|
}, d = (t, n, e) => new Proxy(
|
|
@@ -211,16 +162,16 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGIT
|
|
|
211
162
|
return a.state?.(e.state.snapshot(), s);
|
|
212
163
|
const o = a.adapterMethod ?? r;
|
|
213
164
|
if (a.kind === "query")
|
|
214
|
-
return e.bridge.request(t, o,
|
|
165
|
+
return e.bridge.request(t, o, R(s));
|
|
215
166
|
if (a.kind === "callbackQuery") {
|
|
216
167
|
const c = s.find((h) => typeof h == "function"), l = s.filter((h) => typeof h != "function");
|
|
217
|
-
e.bridge.request(t, o,
|
|
168
|
+
e.bridge.request(t, o, R(l)).then((h) => {
|
|
218
169
|
const j = a.mapCallbackResult?.(h) ?? [h];
|
|
219
170
|
c?.(...j);
|
|
220
171
|
}).catch(e.onAsyncError);
|
|
221
172
|
return;
|
|
222
173
|
}
|
|
223
|
-
const u = e.bridge.request(t, o,
|
|
174
|
+
const u = e.bridge.request(t, o, R(s)).catch((c) => {
|
|
224
175
|
e.onAsyncError(c);
|
|
225
176
|
});
|
|
226
177
|
if (a.returnsResult)
|
|
@@ -416,7 +367,7 @@ const oe = "rhc-office.editor-adapter", de = 1, ue = "__RHC_OFFICE_EDITOR_ADAPTE
|
|
|
416
367
|
};
|
|
417
368
|
class ce {
|
|
418
369
|
constructor(n) {
|
|
419
|
-
this.context = n, this.addDocumentOpenedCallback = (e) => this.adapter.addDocumentOpenedCallback(e), this.addDocumentSavedCallback = (e) => this.adapter.addDocumentSavedCallback(e), this.addDocumentClosedCallback = (e) => this.adapter.addDocumentClosedCallback(e), this.openPDFDocument = (e, i) => this.adapter.openPDFDocument(e, i), this.openPdfDocument = (e, i) => this.adapter.openPdfDocument(e, i), this.openOFDDocument = (e, i) => this.adapter.openOFDDocument(e, i), this.openOfdDocument = (e, i) => this.adapter.openOfdDocument(e, i), this.openOfficeDocument = (e, i) => this.adapter.openOfficeDocument(e, i), this.openImageDocument = (e, i) => this.adapter.openImageDocument(e, i), this.openTextDocument = (e, i) => this.adapter.openTextDocument(e, i), this.openFromLocalStorage = () => this.adapter.openFromLocalStorage(), this.setUploadUrl = (e) => this.adapter.setUploadUrl(e), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) => {
|
|
370
|
+
this.context = n, this.addDocumentOpenedCallback = (e) => this.adapter.addDocumentOpenedCallback(e), this.addDocumentSavedCallback = (e) => this.adapter.addDocumentSavedCallback(e), this.addDocumentClosedCallback = (e) => this.adapter.addDocumentClosedCallback(e), this.openPDFDocument = (e, i) => this.adapter.openPDFDocument(e, i), this.openPdfDocument = (e, i) => this.adapter.openPdfDocument(e, i), this.openOFDDocument = (e, i) => this.adapter.openOFDDocument(e, i), this.openOfdDocument = (e, i) => this.adapter.openOfdDocument(e, i), this.openOfficeDocument = (e, i) => this.adapter.openOfficeDocument(e, i), this.openImageDocument = (e, i) => this.adapter.openImageDocument(e, i), this.openTextDocument = (e, i) => this.adapter.openTextDocument(e, i), this.openFromLocalStorage = () => this.adapter.openFromLocalStorage(), this.setUploadUrl = (e, i) => this.adapter.setUploadUrl(e, i), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) => {
|
|
420
371
|
const i = this.context.bridge.getReaderId();
|
|
421
372
|
if (!i)
|
|
422
373
|
return Promise.resolve({
|
|
@@ -476,7 +427,7 @@ const be = () => ({
|
|
|
476
427
|
rotateRight: { kind: "command", returnsResult: !0 },
|
|
477
428
|
undo: { kind: "command", returnsResult: !0 }
|
|
478
429
|
}), Se = (t) => t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
479
|
-
class
|
|
430
|
+
class fe {
|
|
480
431
|
constructor(n) {
|
|
481
432
|
this.getSnapshot = () => this.adapter.getSnapshot(), this.execute = (e) => this.adapter.execute(e), this.newPage = (e, i) => this.adapter.newPage(e, i), this.deletePages = (e) => this.adapter.deletePages(e), this.duplicatePages = (e, i) => this.adapter.duplicatePages(e, i), this.rotateLeft = (e) => this.adapter.rotateLeft(e), this.rotateRight = (e) => this.adapter.rotateRight(e), this.clearContent = (e) => this.adapter.clearContent(e), this.moveBefore = (e, i) => this.adapter.moveBefore(e, i), this.moveAfter = (e, i) => this.adapter.moveAfter(e, i), this.importDocument = (e, i) => this.adapter.importDocument(Se(e), i), this.extractPages = (e, i) => this.adapter.extractPages(e, i), this.undo = () => this.adapter.undo(), this.commit = () => this.adapter.commit(), this.adapter = d(
|
|
482
433
|
"pageArrange",
|
|
@@ -485,7 +436,7 @@ class ke {
|
|
|
485
436
|
);
|
|
486
437
|
}
|
|
487
438
|
}
|
|
488
|
-
const
|
|
439
|
+
const Re = (t) => ({
|
|
489
440
|
addPageChangeCallback: {
|
|
490
441
|
kind: "callbackRegister",
|
|
491
442
|
callback: (n, e) => {
|
|
@@ -535,11 +486,11 @@ const fe = (t) => ({
|
|
|
535
486
|
gotoPreviousPage: { kind: "command" },
|
|
536
487
|
rotatePage: { kind: "command" }
|
|
537
488
|
});
|
|
538
|
-
class
|
|
489
|
+
class ke {
|
|
539
490
|
constructor(n) {
|
|
540
491
|
this.addPageChangeCallback = (e) => this.adapter.addPageChangeCallback(e), this.addPageModeChangeCallback = (e) => this.adapter.addPageModeChangeCallback(e), this.getPageCount = (e) => this.adapter.getPageCount(e), this.getPageIndex = (e) => this.adapter.getPageIndex(e), this.setSinglePageViewMode = () => this.adapter.setSinglePageViewMode(), this.setTwoPagesViewMode = () => this.adapter.setTwoPagesViewMode(), this.setPageScrollVertical = () => this.adapter.setPageScrollVertical(), this.setPageScrollHorizontal = () => this.adapter.setPageScrollHorizontal(), this.setPageCursorPanDrag = () => this.adapter.setPageCursorPanDrag(), this.setPageCursorTextSelect = () => this.adapter.setPageCursorTextSelect(), this.rotateCW = () => this.adapter.rotateCW(), this.rotateCCW = () => this.adapter.rotateCCW(), this.autoFitPage = () => this.adapter.autoFitPage(), this.fitPageSize = () => this.adapter.fitPageSize(), this.fitPageWidth = () => this.adapter.fitPageWidth(), this.fitPageHeight = () => this.adapter.fitPageHeight(), this.increasePageScale = () => this.adapter.increasePageScale(), this.decreasePageScale = () => this.adapter.decreasePageScale(), this.setPageScale = (e) => this.adapter.setPageScale(e), this.setPageBlendColor = (e, i, r, a) => this.adapter.setPageBlendColor(e, i, r, a), this.gotoPage = (e, i, r) => this.adapter.gotoPage(e, i, r), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter = d(
|
|
541
492
|
"page",
|
|
542
|
-
|
|
493
|
+
Re(n),
|
|
543
494
|
n
|
|
544
495
|
);
|
|
545
496
|
}
|
|
@@ -561,7 +512,7 @@ const Te = {
|
|
|
561
512
|
mapCallbackResult: (t) => [Array.isArray(t) ? t : []]
|
|
562
513
|
}
|
|
563
514
|
};
|
|
564
|
-
class
|
|
515
|
+
class ye {
|
|
565
516
|
constructor(n) {
|
|
566
517
|
this.open = () => this.adapter.open(), this.setFormFieldValue = (e, i) => this.adapter.setFormFieldValue(e, i), this.setFormFieldReadonly = (e, i) => this.adapter.setFormFieldReadonly(e, i), this.commit = (e) => this.adapter.commit(e), this.clear = (e) => this.adapter.clear(e), this.toKeyValue = (e) => this.adapter.toKeyValue(e), this.adapter = d(
|
|
567
518
|
"pdfFormFiller",
|
|
@@ -570,18 +521,18 @@ class ve {
|
|
|
570
521
|
);
|
|
571
522
|
}
|
|
572
523
|
}
|
|
573
|
-
const
|
|
524
|
+
const ve = /\s*,\s*/, Ee = /\s*-\s*/, k = (t) => {
|
|
574
525
|
const n = Number.parseInt(t.trim(), 10);
|
|
575
526
|
return !Number.isFinite(n) || n <= 0 ? null : n;
|
|
576
527
|
}, Pe = (t) => {
|
|
577
528
|
const n = t.split(Ee);
|
|
578
529
|
if (n.length === 1) {
|
|
579
|
-
const r =
|
|
530
|
+
const r = k(n[0] ?? "");
|
|
580
531
|
return r ? [r] : [];
|
|
581
532
|
}
|
|
582
|
-
const e =
|
|
533
|
+
const e = k(n[0] ?? ""), i = k(n[1] ?? "");
|
|
583
534
|
return !e || !i || i < e ? [] : Array.from({ length: i - e + 1 }, (r, a) => e + a);
|
|
584
|
-
}, Ce = (t) => t ? t.split(
|
|
535
|
+
}, Ce = (t) => t ? t.split(ve).flatMap((e) => Pe(e)).filter((e, i, r) => r.indexOf(e) === i) : [];
|
|
585
536
|
class De {
|
|
586
537
|
constructor(n, e, i) {
|
|
587
538
|
this.setFieldName = (r) => {
|
|
@@ -623,7 +574,7 @@ const Me = {
|
|
|
623
574
|
setSecuritySettings: { kind: "query" },
|
|
624
575
|
openSecuritySettingsDialog: { kind: "command" }
|
|
625
576
|
};
|
|
626
|
-
class
|
|
577
|
+
class we {
|
|
627
578
|
constructor(n) {
|
|
628
579
|
this.getSecuritySettings = () => this.adapter.getSecuritySettings(), this.setSecuritySettings = (e) => this.adapter.setSecuritySettings(e), this.isSecuritySettingsLocalEditable = () => this.adapter.isSecuritySettingsLocalEditable(), this.setSecuritySettingsLocalEditable = (e) => this.adapter.setSecuritySettingsLocalEditable(e), this.openSecuritySettingsDialog = () => this.adapter.openSecuritySettingsDialog(), this.adapter = d(
|
|
629
580
|
"security",
|
|
@@ -632,7 +583,7 @@ class Ie {
|
|
|
632
583
|
);
|
|
633
584
|
}
|
|
634
585
|
}
|
|
635
|
-
const
|
|
586
|
+
const Ie = {
|
|
636
587
|
setSignServer: { kind: "command" },
|
|
637
588
|
addSignServerAuthCallback: {
|
|
638
589
|
kind: "callbackRegister",
|
|
@@ -656,7 +607,7 @@ class _e {
|
|
|
656
607
|
constructor(n) {
|
|
657
608
|
this.setSignServer = (e) => this.adapter.setSignServer(e), this.addSignServerAuthCallback = (e) => this.adapter.addSignServerAuthCallback(e), this.setSignServerDefaultLogin = (e) => this.adapter.setSignServerDefaultLogin(e), this.setDefaultSignServerLogin = (e) => this.adapter.setDefaultSignServerLogin(e), this.setSignServerDefaultPassword = (e) => this.adapter.setSignServerDefaultPassword(e), this.setDefaultSignServerPassword = (e) => this.adapter.setDefaultSignServerPassword(e), this.loginNTKOSignServer = (e, i, r) => this.adapter.loginNTKOSignServer(e, i, r), this.loginSignServer = (e, i, r, a) => this.adapter.loginSignServer(e, i, r, a), this.signOutSignServer = () => this.adapter.signOutSignServer(), this.isAuthenticatedOnSignServer = () => this.adapter.isAuthenticatedOnSignServer(), this.setSignServerLoginFromUSBKey = (e, i) => this.adapter.setSignServerLoginFromUSBKey(e, i), this.setUserAuthSource = (e) => this.adapter.setUserAuthSource(e), this.adapter = d(
|
|
658
609
|
"signServer",
|
|
659
|
-
|
|
610
|
+
Ie,
|
|
660
611
|
n
|
|
661
612
|
);
|
|
662
613
|
}
|
|
@@ -720,6 +671,7 @@ const Ne = /* @__PURE__ */ new Set([2, 5]), Be = (t) => ({
|
|
|
720
671
|
setWatermark: { kind: "command" },
|
|
721
672
|
setCompactMode: { kind: "command" },
|
|
722
673
|
setRulerVisible: { kind: "command" },
|
|
674
|
+
setStatusBarVisible: { kind: "command" },
|
|
723
675
|
toggleSidebar: { kind: "command" },
|
|
724
676
|
enterBookViewMode: {
|
|
725
677
|
kind: "callbackQuery",
|
|
@@ -742,13 +694,13 @@ class xe {
|
|
|
742
694
|
), this.setupRibbonMenu(e)), this.showToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("showToolbarMenuItem", "showRibbonMenuItem"), this.showRibbonMenuItem(e)), this.hideToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("hideToolbarMenuItem", "hideRibbonMenuItem"), this.hideRibbonMenuItem(e)), this.setupRibbonMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
743
695
|
"setupRibbonMenu",
|
|
744
696
|
"showRibbonMenu/hideRibbonMenu/setupRibbonMenuTab"
|
|
745
|
-
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter = d("ui", Be(n), n);
|
|
697
|
+
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.setStatusBarVisible = (e) => this.adapter.setStatusBarVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter = d("ui", Be(n), n);
|
|
746
698
|
}
|
|
747
699
|
warnLegacyRibbonMethod(n, e) {
|
|
748
700
|
console.warn(`[RHC Office SDK] ui.${n} is deprecated. Use ui.${e} instead.`);
|
|
749
701
|
}
|
|
750
702
|
}
|
|
751
|
-
const
|
|
703
|
+
const Ve = (t) => {
|
|
752
704
|
if (!t)
|
|
753
705
|
return;
|
|
754
706
|
const n = t.trim().toLowerCase();
|
|
@@ -759,12 +711,12 @@ const Ke = (t) => {
|
|
|
759
711
|
}, q = (t) => {
|
|
760
712
|
const n = new URL(t, globalThis.location?.href ?? "http://localhost/");
|
|
761
713
|
return n.hash = "", n.pathname.endsWith("/") || (n.pathname = `${n.pathname}/`), n.toString();
|
|
762
|
-
},
|
|
714
|
+
}, Ke = (t) => new URL("editors.bootstrap.js", t).toString(), Ge = (t, n) => {
|
|
763
715
|
const e = q(t);
|
|
764
716
|
return {
|
|
765
717
|
...n,
|
|
766
718
|
appUrl: e,
|
|
767
|
-
theme:
|
|
719
|
+
theme: Ve(n.theme)
|
|
768
720
|
};
|
|
769
721
|
}, m = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__", H = () => {
|
|
770
722
|
const t = globalThis;
|
|
@@ -800,7 +752,7 @@ const z = (t) => {
|
|
|
800
752
|
const s = Promise.resolve();
|
|
801
753
|
return n.loadPromises.set(t, s), s;
|
|
802
754
|
}
|
|
803
|
-
const i =
|
|
755
|
+
const i = Ke(t), r = qe(i);
|
|
804
756
|
n.activeAppUrl = t;
|
|
805
757
|
const a = new Promise((s, o) => {
|
|
806
758
|
const u = (h) => {
|
|
@@ -947,7 +899,7 @@ class $e {
|
|
|
947
899
|
});
|
|
948
900
|
}
|
|
949
901
|
}
|
|
950
|
-
const
|
|
902
|
+
const w = {
|
|
951
903
|
annotationEnabled: !1,
|
|
952
904
|
documentModified: !1,
|
|
953
905
|
documentOpened: !1,
|
|
@@ -958,10 +910,10 @@ const I = {
|
|
|
958
910
|
};
|
|
959
911
|
class Xe {
|
|
960
912
|
constructor() {
|
|
961
|
-
this.state = { ...
|
|
913
|
+
this.state = { ...w };
|
|
962
914
|
}
|
|
963
915
|
reset() {
|
|
964
|
-
this.state = { ...
|
|
916
|
+
this.state = { ...w };
|
|
965
917
|
}
|
|
966
918
|
update(n) {
|
|
967
919
|
n && (this.state = {
|
|
@@ -985,7 +937,7 @@ class Xe {
|
|
|
985
937
|
};
|
|
986
938
|
}
|
|
987
939
|
}
|
|
988
|
-
const Je = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t : void 0, Q = (t) => typeof t == "object" && t !== null && !Array.isArray(t),
|
|
940
|
+
const Je = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t : void 0, Q = (t) => typeof t == "object" && t !== null && !Array.isArray(t), I = (t) => {
|
|
989
941
|
if (!Q(t))
|
|
990
942
|
return;
|
|
991
943
|
const n = {};
|
|
@@ -996,7 +948,7 @@ const Je = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t :
|
|
|
996
948
|
success: !0,
|
|
997
949
|
status: "ok"
|
|
998
950
|
};
|
|
999
|
-
const n =
|
|
951
|
+
const n = I(t.state), e = I(t), i = typeof t.error == "string" ? t.error : void 0, r = typeof t.success == "boolean" ? t.success : !i, a = typeof t.status == "string" ? t.status : r ? "ok" : "error";
|
|
1000
952
|
return {
|
|
1001
953
|
success: r,
|
|
1002
954
|
status: a,
|
|
@@ -1082,7 +1034,7 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", tt = "__rhcOfficeReaderRuntimeConfig"
|
|
|
1082
1034
|
"documentLoaded",
|
|
1083
1035
|
"documentStateChange",
|
|
1084
1036
|
"documentError"
|
|
1085
|
-
], it = "readerReady", rt = "readerUnload",
|
|
1037
|
+
], it = "readerReady", rt = "readerUnload", y = "readerError", at = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, _ = (t, n) => ({
|
|
1086
1038
|
appUrl: n?.appUrl ?? null,
|
|
1087
1039
|
configuration: n,
|
|
1088
1040
|
element: t
|
|
@@ -1154,7 +1106,7 @@ class lt {
|
|
|
1154
1106
|
debug: () => this.debugEnabled,
|
|
1155
1107
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
1156
1108
|
state: this.readerState
|
|
1157
|
-
}, this.documentTool = new ce(this.bridgeToolContext), this.uiTool = new xe(this.bridgeToolContext), this.pageTool = new
|
|
1109
|
+
}, this.documentTool = new ce(this.bridgeToolContext), this.uiTool = new xe(this.bridgeToolContext), this.pageTool = new ke(this.bridgeToolContext), this.pageArrangeTool = new fe(this.bridgeToolContext), this.findTool = new ge(this.bridgeToolContext), this.signServerTool = new _e(this.bridgeToolContext), this.digitalSignTool = new se(this.bridgeToolContext), this.symbologyTool = new Le(this.bridgeToolContext), this.annotationTool = new ne(this.bridgeToolContext), this.templateSignTool = new Ue(this.bridgeToolContext), this.pdfFormFiller = new ye(this.bridgeToolContext), this.networkingTool = new pe(this.bridgeToolContext), this.cryptoTool = new re(this.bridgeToolContext), this.securityTool = new we(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) => {
|
|
1158
1110
|
this.debugEnabled = e;
|
|
1159
1111
|
}, this.changeLanguage = (e) => {
|
|
1160
1112
|
this.readerElement && this.readerElement.setAttribute("language", e);
|
|
@@ -1225,7 +1177,7 @@ class lt {
|
|
|
1225
1177
|
}), nt.forEach((r) => {
|
|
1226
1178
|
const a = (s) => {
|
|
1227
1179
|
const o = s instanceof CustomEvent ? s.detail : s;
|
|
1228
|
-
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(
|
|
1180
|
+
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(y, o);
|
|
1229
1181
|
};
|
|
1230
1182
|
e.addEventListener(r, a), this.nativeEventCleanupCallbacks.push(() => {
|
|
1231
1183
|
e.removeEventListener(r, a);
|
|
@@ -1238,9 +1190,9 @@ class lt {
|
|
|
1238
1190
|
}, this.emitReaderEvent = (e, i) => {
|
|
1239
1191
|
this.readerEventListener?.(e, i);
|
|
1240
1192
|
}, this.reportReaderError = (e) => {
|
|
1241
|
-
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(
|
|
1193
|
+
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(y, e);
|
|
1242
1194
|
}, this.reportAdapterError = (e) => {
|
|
1243
|
-
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(
|
|
1195
|
+
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(y, e);
|
|
1244
1196
|
}, this.bridge.configureTimeouts({
|
|
1245
1197
|
readyTimeoutMs: n?.readyTimeoutMs,
|
|
1246
1198
|
requestTimeoutMs: n?.requestTimeoutMs
|
|
@@ -1269,7 +1221,7 @@ class lt {
|
|
|
1269
1221
|
this.runtimeRestoreState.hadPreviousRuntime ? n[S] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, S), this.runtimeRestoreState = null;
|
|
1270
1222
|
}
|
|
1271
1223
|
}
|
|
1272
|
-
const
|
|
1224
|
+
const ft = (t) => new lt(t);
|
|
1273
1225
|
export {
|
|
1274
1226
|
ne as AnnotationToolImpl,
|
|
1275
1227
|
re as CryptoToolImpl,
|
|
@@ -1281,16 +1233,16 @@ export {
|
|
|
1281
1233
|
ge as FindToolImpl,
|
|
1282
1234
|
De as KVField,
|
|
1283
1235
|
pe as NetworkingToolImpl,
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1236
|
+
fe as PageArrangeToolImpl,
|
|
1237
|
+
ke as PageToolImpl,
|
|
1238
|
+
ye as PdfFormFillerImpl,
|
|
1239
|
+
we as SecurityToolImpl,
|
|
1288
1240
|
_e as SignServerToolImpl,
|
|
1289
1241
|
Le as SymbologyToolImpl,
|
|
1290
1242
|
Ue as TemplateSignToolImpl,
|
|
1291
1243
|
xe as UIToolImpl,
|
|
1292
1244
|
Y as WatermarkDisplay,
|
|
1293
|
-
|
|
1245
|
+
ft as createNewDocumentSdk,
|
|
1294
1246
|
ct as getDigitalSignEnvironment,
|
|
1295
1247
|
ht as getDigitalSignEnvironmentSource,
|
|
1296
1248
|
gt as initializeDigitalSignEnvironment,
|