@rhc-office/sdk 6.6.388 → 6.6.390

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
@@ -118,26 +118,26 @@ const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGIT
118
118
  defaults: g(P),
119
119
  overrides: {}
120
120
  }), t[f];
121
- }, gt = () => p().current, mt = () => {
121
+ }, mt = () => p().current, pt = () => {
122
122
  const t = p();
123
123
  return {
124
124
  current: g(t.current),
125
125
  defaults: g(t.defaults),
126
126
  overrides: E(t.overrides)
127
127
  };
128
- }, pt = (t) => {
128
+ }, bt = (t) => {
129
129
  const n = p();
130
130
  return n.defaults = g(t), n.current = z(n.defaults, n.overrides), n.current;
131
- }, bt = (t) => {
131
+ }, St = (t) => {
132
132
  const n = p();
133
133
  return n.current = g(t), n.overrides = E(t), n.current;
134
- }, St = (t) => {
134
+ }, ft = (t) => {
135
135
  const n = p();
136
136
  return n.overrides = ee(n.overrides, E(t)), n.current = z(n.current, t), n.current;
137
- }, ft = (t) => {
137
+ }, Rt = (t) => {
138
138
  const n = p();
139
139
  return t && (n.defaults = g(t)), n.overrides = {}, n.current = g(n.defaults), n.current;
140
- }, Rt = {
140
+ }, kt = {
141
141
  EDGE_POSITION: x,
142
142
  RSA_MODE: K,
143
143
  SIGNATURE_TYPE: V
@@ -1049,13 +1049,19 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
1049
1049
  sessionUser: e,
1050
1050
  ...a ? { sessionUserId: a } : {}
1051
1051
  };
1052
- }, F = (t) => {
1053
- const n = t.trim().replace(/[-_\s]/g, "").toLowerCase();
1054
- return n === "annotation" ? "ANNOTATION" : n === "digitalsign" ? "DIGITAL_SIGN" : "VIEW";
1055
1052
  }, dt = (t) => {
1053
+ const n = t.trim().replace(/[-_\s]/g, "").toLowerCase();
1054
+ return n === "view" ? "VIEW" : n === "annotation" ? "ANNOTATION" : n === "digitalsign" ? "DIGITAL_SIGN" : null;
1055
+ }, F = (t) => {
1056
+ const n = [];
1057
+ return t.split(/[;,]/).forEach((e) => {
1058
+ const i = dt(e);
1059
+ i && !n.includes(i) && n.push(i);
1060
+ }), n.length > 0 ? n.join(",") : "VIEW";
1061
+ }, ut = (t) => {
1056
1062
  const n = {};
1057
1063
  return t.canOpenNewFile !== void 0 && (n.canOpenNewFile = t.canOpenNewFile), t.canPrint !== void 0 && (n.canPrint = t.canPrint), t.canDownload !== void 0 && (n.canDownload = t.canDownload), Object.keys(n).length > 0 ? n : void 0;
1058
- }, ut = (t) => {
1064
+ }, lt = (t) => {
1059
1065
  if (typeof t == "string") {
1060
1066
  const n = document.getElementById(t);
1061
1067
  if (!n)
@@ -1067,7 +1073,7 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
1067
1073
  if (!(t instanceof HTMLDivElement))
1068
1074
  throw new Error("Reader container must be a div element.");
1069
1075
  return t;
1070
- }, lt = () => {
1076
+ }, ct = () => {
1071
1077
  const t = typeof globalThis.matchMedia == "function";
1072
1078
  return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
1073
1079
  }, U = (t, n) => {
@@ -1084,7 +1090,7 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
1084
1090
  return;
1085
1091
  }
1086
1092
  typeof e.removeListener == "function" && e.removeListener(n);
1087
- }, ct = (t) => {
1093
+ }, ht = (t) => {
1088
1094
  t.style.display || (t.style.display = "block"), t.style.width || (t.style.width = "100%"), t.style.height || (t.style.height = "100%");
1089
1095
  }, B = (t, n) => {
1090
1096
  const e = n;
@@ -1093,7 +1099,7 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
1093
1099
  if (e !== "auto")
1094
1100
  return t.setAttribute("theme", e), null;
1095
1101
  const i = () => {
1096
- t.setAttribute("theme", lt());
1102
+ t.setAttribute("theme", ct());
1097
1103
  };
1098
1104
  if (i(), typeof globalThis.matchMedia != "function")
1099
1105
  return null;
@@ -1104,7 +1110,7 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig",
1104
1110
  N(r, s), N(a, s);
1105
1111
  };
1106
1112
  };
1107
- class ht {
1113
+ class gt {
1108
1114
  constructor(n) {
1109
1115
  this.bridge = new Ze(), this.callbacks = new it(), this.readerState = new et(), this.bridgeToolContext = {
1110
1116
  bridge: this.bridge,
@@ -1134,7 +1140,7 @@ class ht {
1134
1140
  }, this.setReaderEventListener = (e) => {
1135
1141
  this.readerEventListener = e;
1136
1142
  }, this.embedReader = (e, i, r) => {
1137
- const a = ut(e), s = Q(i);
1143
+ const a = lt(e), s = Q(i);
1138
1144
  W(s);
1139
1145
  const o = He(s, r), d = this.mountToken + 1;
1140
1146
  this.removeReader(), this.mountToken = d, this.removed = !1, this.hostContainer = a, this.normalizedConfiguration = o, this.mountReader(a, o, d);
@@ -1149,7 +1155,7 @@ class ht {
1149
1155
  if (await We(i.appUrl), this.mountToken !== r)
1150
1156
  return;
1151
1157
  const a = document.createElement(m), s = ot();
1152
- a.setAttribute(H, s), this.readerId = s, this.bridge.setReaderId(s), ct(a), this.applyReaderRuntimeConfig(a, i);
1158
+ a.setAttribute(H, s), this.readerId = s, this.bridge.setReaderId(s), ht(a), this.applyReaderRuntimeConfig(a, i);
1153
1159
  const o = i.compactViewer === !0 && i.keepPCMenu !== !0;
1154
1160
  if (a.toggleAttribute("data-sdk-compact-mode", o), a.toggleAttribute("data-sdk-ribbon-hidden", i.ribbonMenu === !1), a.toggleAttribute(
1155
1161
  "data-sdk-ribbon-title-hidden",
@@ -1209,7 +1215,7 @@ class ht {
1209
1215
  const i = L(this.sessionUser, this.sessionUserId), r = {
1210
1216
  feature: F(e.viewMode),
1211
1217
  ...i ?? {}
1212
- }, a = dt(e), s = {
1218
+ }, a = ut(e), s = {
1213
1219
  hostKind: "server",
1214
1220
  ...a ? { embedOptions: a } : {},
1215
1221
  server: {
@@ -1256,14 +1262,14 @@ class ht {
1256
1262
  this.runtimeRestoreState.hadPreviousRuntime ? n[S] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, S), this.runtimeRestoreState = null;
1257
1263
  }
1258
1264
  }
1259
- const kt = (t) => new ht(t);
1265
+ const Tt = (t) => new gt(t);
1260
1266
  export {
1261
1267
  ae as AnnotationToolImpl,
1262
1268
  oe as CryptoToolImpl,
1263
- Rt as DIGITAL_SIGN_DEFAULTS,
1269
+ kt as DIGITAL_SIGN_DEFAULTS,
1264
1270
  Ie as DigitalSignOptions,
1265
1271
  ue as DigitalSignToolImpl,
1266
- ht as DocumentSDK,
1272
+ gt as DocumentSDK,
1267
1273
  me as DocumentToolImpl,
1268
1274
  be as FindToolImpl,
1269
1275
  we as KVField,
@@ -1277,12 +1283,12 @@ export {
1277
1283
  xe as TemplateSignToolImpl,
1278
1284
  Ge as UIToolImpl,
1279
1285
  X as WatermarkDisplay,
1280
- kt as createNewDocumentSdk,
1281
- gt as getDigitalSignEnvironment,
1282
- mt as getDigitalSignEnvironmentSource,
1283
- pt as initializeDigitalSignEnvironment,
1284
- St as patchDigitalSignEnvironment,
1285
- ft as resetDigitalSignEnvironment,
1286
- bt as setDigitalSignEnvironment
1286
+ Tt as createNewDocumentSdk,
1287
+ mt as getDigitalSignEnvironment,
1288
+ pt as getDigitalSignEnvironmentSource,
1289
+ bt as initializeDigitalSignEnvironment,
1290
+ ft as patchDigitalSignEnvironment,
1291
+ Rt as resetDigitalSignEnvironment,
1292
+ St as setDigitalSignEnvironment
1287
1293
  };
1288
1294
  //# sourceMappingURL=index.js.map