@upscopeio/react 2.4.12 → 2.4.15
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/index.d.ts +2 -1
- package/package.json +1 -1
- package/sdk.d.ts +1 -1
- package/sdk.js +1 -3
- package/sdk.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { CobrowsingSdkConfiguration, Upscope } from "./sdk";
|
|
|
3
3
|
type UpscopeProviderProps = {
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
-
|
|
6
|
+
apiKey: string;
|
|
7
|
+
} & Partial<Omit<CobrowsingSdkConfiguration, "apiKey">>;
|
|
7
8
|
|
|
8
9
|
type UpscopeContext = {
|
|
9
10
|
Upscope: Upscope | undefined;
|
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ type SDKEvents = {
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
type Instruction =
|
|
135
|
-
| ["init", Partial<CobrowsingSdkConfiguration
|
|
135
|
+
| ["init", Partial<Omit<CobrowsingSdkConfiguration, "apiKey">> & { apiKey: string }]
|
|
136
136
|
| ["reset"]
|
|
137
137
|
| ["connect"]
|
|
138
138
|
| ["cancelRequestAgent"]
|
package/sdk.js
CHANGED
|
@@ -25,7 +25,6 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
25
25
|
}
|
|
26
26
|
var loaded = false;
|
|
27
27
|
function loadSDK(apiKey) {
|
|
28
|
-
var _x_parentNode;
|
|
29
28
|
if (typeof window.Upscope !== "undefined") {
|
|
30
29
|
loaded = true;
|
|
31
30
|
return;
|
|
@@ -43,8 +42,7 @@ function loadSDK(apiKey) {
|
|
|
43
42
|
s.type = "text/javascript";
|
|
44
43
|
s.async = true;
|
|
45
44
|
s.src = "https://code.upscope.io/".concat(apiKey, ".js");
|
|
46
|
-
|
|
47
|
-
(_x_parentNode = x.parentNode) === null || _x_parentNode === void 0 ? void 0 : _x_parentNode.insertBefore(s, x);
|
|
45
|
+
document.head.appendChild(s);
|
|
48
46
|
loaded = true;
|
|
49
47
|
}
|
|
50
48
|
var _Upscope = function _Upscope() {
|
package/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["sdk.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,KAAK;AAClB,SAAS,QAAQ,MAAM,EAAE;
|
|
1
|
+
{"version":3,"sources":["sdk.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,KAAK;AAClB,SAAS,QAAQ,MAAM,EAAE;IACrB,IAAI,OAAO,OAAO,OAAO,KAAK,aAAa;QACvC,SAAS,IAAI;QACb;IACJ,CAAC;IACD,IAAM,IAAI,SAAJ,KAAuB;QAAT,IAAA,IAAA,OAAA,UAAA,QAAA,AAAG,OAAH,UAAA,OAAA,OAAA,GAAA,OAAA,MAAA,OAAA;YAAG,KAAH,QAAA,SAAA,CAAA,KAAO;QAAD;QACtB,EAAE,CAAC,CAAC,IAAI,CAAC;IACb;IACA,EAAE,CAAC,GAAG,EAAE;IACR,kDAAkD;IAClD,OAAO,OAAO,GAAG;IACjB,IAAM,IAAI,SAAS,aAAa,CAAC;IACjC,EAAE,IAAI,GAAG;IACT,EAAE,KAAK,GAAG,IAAI;IACd,EAAE,GAAG,GAAG,AAAC,2BAAiC,OAAP,QAAO;IAC1C,SAAS,IAAI,CAAC,WAAW,CAAC;IAC1B,SAAS,IAAI;AACjB;AACA,IAAM,WAAW,SAAX,WAAqC;IAAhB,IAAA,IAAA,OAAA,UAAA,QAAA,AAAG,cAAH,UAAA,OAAA,OAAA,GAAA,OAAA,MAAA,OAAA;QAAG,YAAH,QAAA,SAAA,CAAA,KAAc;IAAD;QAa7B;IAZP,IAAI,CAAC,QAAQ;QACT,IAAI,WAAW,CAAC,EAAE,KAAK,QAAQ;YAC3B,IAAM,SAAS,WAAW,CAAC,EAAE;YAC7B,IAAI,CAAC,CAAA,mBAAA,oBAAA,KAAA,IAAA,OAAQ,MAAK,AAAC,GAAE;gBACjB,MAAM,IAAI,MAAM,yBAAyB;YAC7C,CAAC;YACD,QAAQ,OAAO,MAAM;QACzB,OACK;YACD,MAAM,IAAI,MAAM,yBAAyB;QAC7C,CAAC;IACL,CAAC;IACD,OAAO,CAAA,UAAA,QAAO,OAAO,CAAd,MAAA,SAAe,mBAAG;AAC7B;AACA,eAAe,SAAS","file":"sdk.js","sourcesContent":["let loaded = false;\nfunction loadSDK(apiKey) {\n if (typeof window.Upscope !== \"undefined\") {\n loaded = true;\n return;\n }\n const i = function (...args) {\n i.q.push(args);\n };\n i.q = [];\n // The real Upscope implementation is loaded below\n window.Upscope = i;\n const s = document.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.src = `https://code.upscope.io/${apiKey}.js`;\n document.head.appendChild(s);\n loaded = true;\n}\nconst _Upscope = function (...instruction) {\n if (!loaded) {\n if (instruction[0] === \"init\") {\n const config = instruction[1];\n if (!config?.apiKey) {\n throw new Error(\"API key not specified\");\n }\n loadSDK(config.apiKey);\n }\n else {\n throw new Error(\"Upscope is not loaded\");\n }\n }\n return window.Upscope(...instruction);\n};\nexport default _Upscope;\n"]}
|