@regulaforensics/idv-interfaces 3.2.293-nightly → 3.2.294-nightly

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.d.ts CHANGED
@@ -33,6 +33,13 @@ export declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig
33
33
 
34
34
  export declare function cleanObjectFromUndefined(obj: Record<string, unknown>): Record<string, unknown>;
35
35
 
36
+ export declare enum DirectionType {
37
+ RTL = "rtl",
38
+ LTR = "ltr"
39
+ }
40
+
41
+ export declare const getLanguageFromLocale: (locale?: string) => string;
42
+
36
43
  export declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
37
44
  isProcessing?: (isProcessing: boolean) => void;
38
45
  moduleProps: TModuleProps;
@@ -64,6 +71,8 @@ export declare const PerformTypes: {
64
71
 
65
72
  export declare function registerModule<TModuleProps = unknown, TModulesConfig = unknown>(name: string, ModuleClass: ModuleClass<TModuleProps, TModulesConfig>): void;
66
73
 
74
+ export declare const RTL_LANGUAGES: string[];
75
+
67
76
  export declare function wait(ms: number): Promise<unknown>;
68
77
 
69
78
  export { }
package/dist/main.js CHANGED
@@ -1,33 +1,33 @@
1
1
  var l = Object.defineProperty;
2
2
  var m = Object.getOwnPropertySymbols;
3
3
  var u = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
4
- var y = (r, e, i) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i, s = (r, e) => {
5
- for (var i in e || (e = {}))
6
- u.call(e, i) && y(r, i, e[i]);
4
+ var y = (r, e, t) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, s = (r, e) => {
5
+ for (var t in e || (e = {}))
6
+ u.call(e, t) && y(r, t, e[t]);
7
7
  if (m)
8
- for (var i of m(e))
9
- E.call(e, i) && y(r, i, e[i]);
8
+ for (var t of m(e))
9
+ E.call(e, t) && y(r, t, e[t]);
10
10
  return r;
11
11
  };
12
12
  class o {
13
13
  constructor({
14
14
  errorCode: e,
15
- errorCodeKey: i,
16
- message: t,
15
+ errorCodeKey: t,
16
+ message: i,
17
17
  underlyingError: n,
18
- underlyingBaseError: h,
19
- domain: g,
20
- module: a,
18
+ underlyingBaseError: g,
19
+ domain: h,
20
+ module: f,
21
21
  errorEnumName: c,
22
22
  shortDomainCode: p
23
23
  }) {
24
- this.errorCode = e, this.errorCodeKey = i, this.message = t, this.underlyingError = n, this.underlyingBaseError = h, this.module = a, this.domain = g, this.errorEnumName = c, this.shortDomainCode = p;
24
+ this.errorCode = e, this.errorCodeKey = t, this.message = i, this.underlyingError = n, this.underlyingBaseError = g, this.module = f, this.domain = h, this.errorEnumName = c, this.shortDomainCode = p;
25
25
  }
26
- static getErrorKey(e, i) {
27
- const t = Object.keys(i).find((n) => i[n] === e);
28
- if (!t)
26
+ static getErrorKey(e, t) {
27
+ const i = Object.keys(t).find((n) => t[n] === e);
28
+ if (!i)
29
29
  throw new Error(`Invalid errorCode: ${e} in enum`);
30
- return t;
30
+ return i;
31
31
  }
32
32
  get lastUnderlyingError() {
33
33
  let e = this.underlyingBaseError;
@@ -56,56 +56,64 @@ class o {
56
56
  return this.underlyingBaseError instanceof o && (e += `-${this.underlyingBaseError.fullChain}`), e;
57
57
  }
58
58
  }
59
- class w extends HTMLElement {
59
+ class b extends HTMLElement {
60
60
  }
61
- function b(r, e) {
61
+ function N(r, e) {
62
62
  if (e.displayName ? console.log(`Register module: ${e.displayName}`) : console.error('Missed "displayName" when register module'), e.getSupportedTemplates && typeof e.getSupportedTemplates == "function") {
63
- const i = e.getSupportedTemplates();
64
- console.log(`${e == null ? void 0 : e.displayName} supported templates: ${i.join(", ")}`);
63
+ const t = e.getSupportedTemplates();
64
+ console.log(`${e == null ? void 0 : e.displayName} supported templates: ${t.join(", ")}`);
65
65
  } else
66
66
  console.error('Missed "getSupportedTemplates" method when register module');
67
67
  if (e.initialize && typeof e.initialize == "function" || console.error(`${e == null ? void 0 : e.displayName} "initialize" method was not implemented`), e.deinitialize && typeof e.deinitialize == "function" || console.error(`${e == null ? void 0 : e.displayName} "deinitialize" method was not implemented`), e.isReady && typeof e.isReady == "function" || console.error(`${e == null ? void 0 : e.displayName} "isReady" method was not implemented`), e.getIdentifier && typeof e.getIdentifier == "function") {
68
- const i = e.getIdentifier();
69
- console.log(`Module id: ${i}`);
68
+ const t = e.getIdentifier();
69
+ console.log(`Module id: ${t}`);
70
70
  } else
71
71
  console.error('Missed "getIdentifier" when register module');
72
72
  customElements.get(e.getIdentifier()) ? console.log(`Module ${r} has already registered`) : customElements.define(r, e), console.log("-------");
73
73
  }
74
- const f = (r) => typeof r == "object" && r !== null && !Array.isArray(r);
74
+ const a = (r) => typeof r == "object" && r !== null && !Array.isArray(r);
75
75
  function d(r) {
76
76
  if (Array.isArray(r))
77
77
  return r.map(d);
78
- if (f(r)) {
78
+ if (a(r)) {
79
79
  const e = s({}, r);
80
80
  if (delete e.ios, delete e.android, delete e.web, "web" in r)
81
- if (f(r.web)) {
82
- const t = d(e);
83
- return s(s({}, t), r.web);
81
+ if (a(r.web)) {
82
+ const i = d(e);
83
+ return s(s({}, i), r.web);
84
84
  } else
85
85
  return r.web;
86
- const i = {};
87
- for (const [t, n] of Object.entries(e))
88
- i[t] = d(n);
89
- return i;
86
+ const t = {};
87
+ for (const [i, n] of Object.entries(e))
88
+ t[i] = d(n);
89
+ return t;
90
90
  }
91
91
  return r;
92
92
  }
93
- function N(r) {
93
+ function B(r) {
94
94
  return Object.fromEntries(Object.entries(r).filter(([, e]) => e !== void 0));
95
95
  }
96
- const B = {
96
+ const O = {
97
97
  FORM: "form",
98
98
  DATA: "data"
99
99
  };
100
- function O(r) {
100
+ function T(r) {
101
101
  return new Promise((e) => setTimeout(e, r));
102
102
  }
103
+ var $ = /* @__PURE__ */ ((r) => (r.RTL = "rtl", r.LTR = "ltr", r))($ || {});
104
+ const R = ["ar", "he"], A = (r) => {
105
+ var e;
106
+ return r ? (e = r.substring(0, 2)) == null ? void 0 : e.toLowerCase() : "";
107
+ };
103
108
  export {
104
109
  o as BaseError,
105
- w as BaseModule,
106
- B as PerformTypes,
107
- N as cleanObjectFromUndefined,
110
+ b as BaseModule,
111
+ $ as DirectionType,
112
+ O as PerformTypes,
113
+ R as RTL_LANGUAGES,
114
+ B as cleanObjectFromUndefined,
115
+ A as getLanguageFromLocale,
108
116
  d as parseClientJSON,
109
- b as registerModule,
110
- O as wait
117
+ N as registerModule,
118
+ T as wait
111
119
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/idv-interfaces",
3
- "version": "3.2.293-nightly",
3
+ "version": "3.2.294-nightly",
4
4
  "description": "Regula framework agnostic web components to work with document idv",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/main.js",