webs-sdk 0.14.37 → 0.14.38
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.js +15 -1
- package/package.json +1 -1
- package/dist/client.d.ts +0 -2
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -7
- package/dist/client.js.map +0 -1
- package/dist/context/TranslationContext.d.ts +0 -12
- package/dist/context/TranslationContext.d.ts.map +0 -1
- package/dist/context/TranslationContext.js +0 -60
- package/dist/context/TranslationContext.js.map +0 -1
package/index.js
CHANGED
|
@@ -28,7 +28,14 @@ const {
|
|
|
28
28
|
afristreamConfig,
|
|
29
29
|
efcConfig,
|
|
30
30
|
SpinningWheelAPI,
|
|
31
|
-
createSpinningWheelAPI
|
|
31
|
+
createSpinningWheelAPI,
|
|
32
|
+
CookieConsent,
|
|
33
|
+
getCookieConsentTexts,
|
|
34
|
+
initGoogleAnalytics,
|
|
35
|
+
updateGAConsent,
|
|
36
|
+
trackGAEvent,
|
|
37
|
+
trackGAPageView,
|
|
38
|
+
isGALoaded,
|
|
32
39
|
} = require('./dist/index.js');
|
|
33
40
|
|
|
34
41
|
// Export default
|
|
@@ -65,3 +72,10 @@ module.exports.afristreamConfig = afristreamConfig;
|
|
|
65
72
|
module.exports.efcConfig = efcConfig;
|
|
66
73
|
module.exports.SpinningWheelAPI = SpinningWheelAPI;
|
|
67
74
|
module.exports.createSpinningWheelAPI = createSpinningWheelAPI;
|
|
75
|
+
module.exports.CookieConsent = CookieConsent;
|
|
76
|
+
module.exports.getCookieConsentTexts = getCookieConsentTexts;
|
|
77
|
+
module.exports.initGoogleAnalytics = initGoogleAnalytics;
|
|
78
|
+
module.exports.updateGAConsent = updateGAConsent;
|
|
79
|
+
module.exports.trackGAEvent = trackGAEvent;
|
|
80
|
+
module.exports.trackGAPageView = trackGAPageView;
|
|
81
|
+
module.exports.isGALoaded = isGALoaded;
|
package/package.json
CHANGED
package/dist/client.d.ts
DELETED
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC"}
|
package/dist/client.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useWebsSDKTranslation = exports.WebsSDKTranslationProvider = void 0;
|
|
4
|
-
var TranslationContext_1 = require("./context/TranslationContext");
|
|
5
|
-
Object.defineProperty(exports, "WebsSDKTranslationProvider", { enumerable: true, get: function () { return TranslationContext_1.WebsSDKTranslationProvider; } });
|
|
6
|
-
Object.defineProperty(exports, "useWebsSDKTranslation", { enumerable: true, get: function () { return TranslationContext_1.useWebsSDKTranslation; } });
|
|
7
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAGA,mEAGsC;AAFpC,gIAAA,0BAA0B,OAAA;AAC1B,2HAAA,qBAAqB,OAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
interface TranslationContextType {
|
|
3
|
-
(key: string, params?: Record<string, any>): string;
|
|
4
|
-
}
|
|
5
|
-
interface WebsSDKTranslationProviderProps {
|
|
6
|
-
translations: Record<string, any>;
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export declare const WebsSDKTranslationProvider: React.FC<WebsSDKTranslationProviderProps>;
|
|
10
|
-
export declare const useWebsSDKTranslation: () => TranslationContextType;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=TranslationContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationContext.d.ts","sourceRoot":"","sources":["../../src/context/TranslationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,UAAU,sBAAsB;IAC9B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;CACrD;AAID,UAAU,+BAA+B;IACvC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAsBhF,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,sBAMxC,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.useWebsSDKTranslation = exports.WebsSDKTranslationProvider = void 0;
|
|
37
|
-
const react_1 = __importStar(require("react"));
|
|
38
|
-
const TranslationContext = (0, react_1.createContext)(null);
|
|
39
|
-
const WebsSDKTranslationProvider = ({ translations, children }) => {
|
|
40
|
-
const t = (key, params) => {
|
|
41
|
-
let value = translations[key] || key;
|
|
42
|
-
if (params && typeof value === 'string') {
|
|
43
|
-
Object.keys(params).forEach(param => {
|
|
44
|
-
value = value.replace(`{${param}}`, params[param]);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return value;
|
|
48
|
-
};
|
|
49
|
-
return (react_1.default.createElement(TranslationContext.Provider, { value: t }, children));
|
|
50
|
-
};
|
|
51
|
-
exports.WebsSDKTranslationProvider = WebsSDKTranslationProvider;
|
|
52
|
-
const useWebsSDKTranslation = () => {
|
|
53
|
-
const context = (0, react_1.useContext)(TranslationContext);
|
|
54
|
-
if (!context) {
|
|
55
|
-
throw new Error('useWebsSDKTranslation must be used within WebsSDKTranslationProvider');
|
|
56
|
-
}
|
|
57
|
-
return context;
|
|
58
|
-
};
|
|
59
|
-
exports.useWebsSDKTranslation = useWebsSDKTranslation;
|
|
60
|
-
//# sourceMappingURL=TranslationContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationContext.js","sourceRoot":"","sources":["../../src/context/TranslationContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoE;AAMpE,MAAM,kBAAkB,GAAG,IAAA,qBAAa,EAAgC,IAAI,CAAC,CAAC;AAOvE,MAAM,0BAA0B,GAA8C,CAAC,EACpF,YAAY,EACZ,QAAQ,EACT,EAAE,EAAE;IACH,MAAM,CAAC,GAA2B,CAAC,GAAW,EAAE,MAA4B,EAAE,EAAE;QAC9E,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;QAGrC,IAAI,MAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAClC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,IAClC,QAAQ,CACmB,CAC/B,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,0BAA0B,8BAsBrC;AAEK,MAAM,qBAAqB,GAAG,GAA2B,EAAE;IAChE,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AANW,QAAA,qBAAqB,yBAMhC"}
|