@rhc-office/sdk 6.6.395 → 6.6.396

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var X = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(X || {});
2
- const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", A = {
2
+ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", A = {
3
3
  defaults: {
4
4
  bjca: {
5
5
  pin: ""
@@ -25,7 +25,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
25
25
  usbKeyType: 14
26
26
  }
27
27
  }
28
- }, z = (t) => ({
28
+ }, q = (t) => ({
29
29
  bjca: {
30
30
  pin: t.bjca.pin
31
31
  },
@@ -37,7 +37,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
37
37
  },
38
38
  rsaMode: t.rsaMode,
39
39
  signatureType: t.signatureType
40
- }), G = (t) => ({
40
+ }), z = (t) => ({
41
41
  authSource: t.authSource,
42
42
  defaultLogin: t.defaultLogin,
43
43
  defaultPassword: t.defaultPassword,
@@ -49,8 +49,8 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
49
49
  usbKeyType: t.usbKey.usbKeyType
50
50
  }
51
51
  }), m = (t) => ({
52
- defaults: z(t.defaults),
53
- signServer: G(t.signServer)
52
+ defaults: q(t.defaults),
53
+ signServer: z(t.signServer)
54
54
  }), E = (t) => ({
55
55
  defaults: t.defaults ? {
56
56
  ...t.defaults,
@@ -73,7 +73,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
73
73
  },
74
74
  rsaMode: n.rsaMode ?? t.rsaMode,
75
75
  signatureType: n.signatureType ?? t.signatureType
76
- } : z(t), Z = (t, n) => n ? {
76
+ } : q(t), Z = (t, n) => n ? {
77
77
  authSource: n.authSource ?? t.authSource,
78
78
  defaultLogin: n.defaultLogin ?? t.defaultLogin,
79
79
  defaultPassword: n.defaultPassword ?? t.defaultPassword,
@@ -84,7 +84,7 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
84
84
  checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
85
85
  usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
86
86
  }
87
- } : G(t), q = (t, n) => ({
87
+ } : z(t), G = (t, n) => ({
88
88
  defaults: J(t.defaults, n.defaults),
89
89
  signServer: Z(t.signServer, n.signServer)
90
90
  }), ee = (t, n) => {
@@ -113,12 +113,12 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
113
113
  };
114
114
  }, te = () => globalThis, p = () => {
115
115
  const t = te();
116
- return t[S] || (t[S] = {
116
+ return t[f] || (t[f] = {
117
117
  current: m(A),
118
118
  defaults: m(A),
119
119
  overrides: {}
120
- }), t[S];
121
- }, St = () => p().current, Rt = () => {
120
+ }), t[f];
121
+ }, ft = () => p().current, Rt = () => {
122
122
  const t = p();
123
123
  return {
124
124
  current: m(t.current),
@@ -127,13 +127,13 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", S = "__RHC_OFFICE_DIGIT
127
127
  };
128
128
  }, kt = (t) => {
129
129
  const n = p();
130
- return n.defaults = m(t), n.current = q(n.defaults, n.overrides), n.current;
130
+ return n.defaults = m(t), n.current = G(n.defaults, n.overrides), n.current;
131
131
  }, Tt = (t) => {
132
132
  const n = p();
133
133
  return n.current = m(t), n.overrides = E(t), n.current;
134
134
  }, yt = (t) => {
135
135
  const n = p();
136
- return n.overrides = ee(n.overrides, E(t)), n.current = q(n.current, t), n.current;
136
+ return n.overrides = ee(n.overrides, E(t)), n.current = G(n.current, t), n.current;
137
137
  }, vt = (t) => {
138
138
  const n = p();
139
139
  return t && (n.defaults = m(t)), n.overrides = {}, n.current = m(n.defaults), n.current;
@@ -365,7 +365,7 @@ class me {
365
365
  );
366
366
  }
367
367
  }
368
- const ge = "rhc-office.editor-adapter", pe = 1, be = "__RHC_OFFICE_EDITOR_ADAPTER__", D = "rhcOfficeAdapterReady", M = "rhcOfficeAdapterEvent", H = "data-rhc-office-reader-id", fe = {
368
+ const ge = "rhc-office.editor-adapter", pe = 1, be = "__RHC_OFFICE_EDITOR_ADAPTER__", D = "rhcOfficeAdapterReady", M = "rhcOfficeAdapterEvent", H = "data-rhc-office-reader-id", Se = {
369
369
  addDocumentOpenedCallback: {
370
370
  kind: "callbackRegister",
371
371
  callback: (t, n) => {
@@ -402,6 +402,10 @@ const ge = "rhc-office.editor-adapter", pe = 1, be = "__RHC_OFFICE_EDITOR_ADAPTE
402
402
  kind: "callbackQuery",
403
403
  mapCallbackResult: (t) => [t]
404
404
  },
405
+ getCurrentDocument: { kind: "query" },
406
+ getOpenDocuments: { kind: "query" },
407
+ activateDocument: { kind: "query" },
408
+ closeDocumentBySessionId: { kind: "query" },
405
409
  closeDocument: { kind: "callbackQuery" },
406
410
  isDocumentOpened: {
407
411
  kind: "stateGetter",
@@ -414,7 +418,7 @@ const ge = "rhc-office.editor-adapter", pe = 1, be = "__RHC_OFFICE_EDITOR_ADAPTE
414
418
  print: { kind: "command" },
415
419
  createPreview: { kind: "command" }
416
420
  };
417
- class Se {
421
+ class fe {
418
422
  constructor(n) {
419
423
  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
424
  const i = this.context.bridge.getReaderId();
@@ -429,9 +433,9 @@ class Se {
429
433
  `[${H}="${i}"]`
430
434
  );
431
435
  return typeof r?.saveAs == "function" ? r.saveAs(e) : this.adapter.saveAs(e);
432
- }, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.closeDocument = (e, i, r) => this.adapter.closeDocument(e, i, r), this.isDocumentOpened = () => this.adapter.isDocumentOpened(), this.isDocumentModified = () => this.adapter.isDocumentModified(), this.print = () => this.adapter.print(), this.createPreview = (e, i) => this.adapter.createPreview(e, i), this.adapter = u(
436
+ }, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.getCurrentDocument = () => this.adapter.getCurrentDocument(), this.getOpenDocuments = () => this.adapter.getOpenDocuments(), this.activateDocument = (e) => this.adapter.activateDocument(e), this.closeDocumentBySessionId = (e, i) => this.adapter.closeDocumentBySessionId(e, i), this.closeDocument = (e, i, r) => this.adapter.closeDocument(e, i, r), this.isDocumentOpened = () => this.adapter.isDocumentOpened(), this.isDocumentModified = () => this.adapter.isDocumentModified(), this.print = () => this.adapter.print(), this.createPreview = (e, i) => this.adapter.createPreview(e, i), this.adapter = u(
433
437
  "document",
434
- fe,
438
+ Se,
435
439
  n
436
440
  );
437
441
  }
@@ -673,7 +677,7 @@ class Ke {
673
677
  );
674
678
  }
675
679
  }
676
- const ze = {
680
+ const qe = {
677
681
  setup: { kind: "command" },
678
682
  create: { kind: "command" },
679
683
  getMarkups: { kind: "callbackQuery" },
@@ -681,16 +685,16 @@ const ze = {
681
685
  removeAllMarkups: { kind: "command" },
682
686
  sign: { kind: "callbackQuery" }
683
687
  };
684
- class Ge {
688
+ class ze {
685
689
  constructor(n) {
686
690
  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(
687
691
  "templateSign",
688
- ze,
692
+ qe,
689
693
  n
690
694
  );
691
695
  }
692
696
  }
693
- const qe = /* @__PURE__ */ new Set([2, 5]), He = (t) => ({
697
+ const Ge = /* @__PURE__ */ new Set([2, 5]), He = (t) => ({
694
698
  showToolbarMenu: { kind: "command" },
695
699
  hideToolbarMenu: { kind: "command" },
696
700
  setupToolbarMenu: { kind: "command" },
@@ -729,7 +733,7 @@ const qe = /* @__PURE__ */ new Set([2, 5]), He = (t) => ({
729
733
  exitBookViewMode: { kind: "command" },
730
734
  isBookViewActivated: {
731
735
  kind: "stateGetter",
732
- state: () => qe.has(t.state.snapshot().pageMode)
736
+ state: () => Ge.has(t.state.snapshot().pageMode)
733
737
  },
734
738
  requestFullScreen: { kind: "command" },
735
739
  exitFullScreen: { kind: "command" },
@@ -1082,7 +1086,7 @@ class ot {
1082
1086
  }
1083
1087
  }
1084
1088
  }
1085
- const f = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig", dt = [
1089
+ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig", dt = [
1086
1090
  "documentLoaded",
1087
1091
  "documentStateChange",
1088
1092
  "documentError"
@@ -1162,7 +1166,7 @@ const f = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
1162
1166
  U(r, s), U(a, s);
1163
1167
  };
1164
1168
  };
1165
- class ft {
1169
+ class St {
1166
1170
  constructor(n) {
1167
1171
  this.bridge = new it(), this.callbacks = new ot(), this.readerState = new rt(), this.bridgeToolContext = {
1168
1172
  bridge: this.bridge,
@@ -1170,7 +1174,7 @@ class ft {
1170
1174
  debug: () => this.debugEnabled,
1171
1175
  onAsyncError: (e) => this.reportAdapterError(e),
1172
1176
  state: this.readerState
1173
- }, this.documentTool = new Se(this.bridgeToolContext), this.uiTool = new Qe(this.bridgeToolContext), this.pageTool = new Pe(this.bridgeToolContext), this.pageArrangeTool = new Ae(this.bridgeToolContext), this.attachmentTool = new ue(this.bridgeToolContext), this.findTool = new ke(this.bridgeToolContext), this.signServerTool = new xe(this.bridgeToolContext), this.digitalSignTool = new me(this.bridgeToolContext), this.symbologyTool = new Ke(this.bridgeToolContext), this.annotationTool = new ae(this.bridgeToolContext), this.templateSignTool = new Ge(this.bridgeToolContext), this.pdfFormFiller = new Me(this.bridgeToolContext), this.networkingTool = new ye(this.bridgeToolContext), this.cryptoTool = new ce(this.bridgeToolContext), this.securityTool = new Ue(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) => {
1177
+ }, this.documentTool = new fe(this.bridgeToolContext), this.uiTool = new Qe(this.bridgeToolContext), this.pageTool = new Pe(this.bridgeToolContext), this.pageArrangeTool = new Ae(this.bridgeToolContext), this.attachmentTool = new ue(this.bridgeToolContext), this.findTool = new ke(this.bridgeToolContext), this.signServerTool = new xe(this.bridgeToolContext), this.digitalSignTool = new me(this.bridgeToolContext), this.symbologyTool = new Ke(this.bridgeToolContext), this.annotationTool = new ae(this.bridgeToolContext), this.templateSignTool = new ze(this.bridgeToolContext), this.pdfFormFiller = new Me(this.bridgeToolContext), this.networkingTool = new ye(this.bridgeToolContext), this.cryptoTool = new ce(this.bridgeToolContext), this.securityTool = new Ue(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) => {
1174
1178
  this.debugEnabled = e;
1175
1179
  }, this.changeLanguage = (e) => {
1176
1180
  this.readerElement && this.readerElement.setAttribute("language", e);
@@ -1277,11 +1281,11 @@ class ft {
1277
1281
  ...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
1278
1282
  }, o = n;
1279
1283
  o[y] = s;
1280
- const d = globalThis, l = d[f];
1284
+ const d = globalThis, l = d[S];
1281
1285
  this.runtimeRestoreState = {
1282
1286
  hadPreviousRuntime: l !== void 0,
1283
1287
  ...l !== void 0 ? { previousRuntime: l } : {}
1284
- }, d[f] = s;
1288
+ }, d[S] = s;
1285
1289
  }
1286
1290
  syncReaderRuntimeConfig() {
1287
1291
  if (!this.readerElement || !this.normalizedConfiguration)
@@ -1300,7 +1304,7 @@ class ft {
1300
1304
  identity: a,
1301
1305
  ...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
1302
1306
  };
1303
- n[y] = s, globalThis[f] = s, this.isReady && this.bridge.request("extension", "updateReaderRuntimeConfig", {
1307
+ n[y] = s, globalThis[S] = s, this.isReady && this.bridge.request("extension", "updateReaderRuntimeConfig", {
1304
1308
  identity: a,
1305
1309
  ...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
1306
1310
  }).catch((o) => {
@@ -1311,10 +1315,10 @@ class ft {
1311
1315
  if (!this.runtimeRestoreState)
1312
1316
  return;
1313
1317
  const n = globalThis;
1314
- this.runtimeRestoreState.hadPreviousRuntime ? n[f] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, f), this.runtimeRestoreState = null;
1318
+ this.runtimeRestoreState.hadPreviousRuntime ? n[S] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, S), this.runtimeRestoreState = null;
1315
1319
  }
1316
1320
  }
1317
- const At = (t) => new ft(t);
1321
+ const At = (t) => new St(t);
1318
1322
  export {
1319
1323
  ae as AnnotationToolImpl,
1320
1324
  ue as AttachmentToolImpl,
@@ -1322,8 +1326,8 @@ export {
1322
1326
  Et as DIGITAL_SIGN_DEFAULTS,
1323
1327
  Fe as DigitalSignOptions,
1324
1328
  me as DigitalSignToolImpl,
1325
- ft as DocumentSDK,
1326
- Se as DocumentToolImpl,
1329
+ St as DocumentSDK,
1330
+ fe as DocumentToolImpl,
1327
1331
  ke as FindToolImpl,
1328
1332
  Le as KVField,
1329
1333
  ye as NetworkingToolImpl,
@@ -1333,11 +1337,11 @@ export {
1333
1337
  Ue as SecurityToolImpl,
1334
1338
  xe as SignServerToolImpl,
1335
1339
  Ke as SymbologyToolImpl,
1336
- Ge as TemplateSignToolImpl,
1340
+ ze as TemplateSignToolImpl,
1337
1341
  Qe as UIToolImpl,
1338
1342
  X as WatermarkDisplay,
1339
1343
  At as createNewDocumentSdk,
1340
- St as getDigitalSignEnvironment,
1344
+ ft as getDigitalSignEnvironment,
1341
1345
  Rt as getDigitalSignEnvironmentSource,
1342
1346
  kt as initializeDigitalSignEnvironment,
1343
1347
  yt as patchDigitalSignEnvironment,