@kameleoon/react-sdk 8.4.0 → 8.4.1
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/kameleoonClient.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createClient=createClient;var _javascriptSdkCore=require("@kameleoon/javascript-sdk-core"),_eventSource=require("./eventSource"),_visitorCodeManager=require("./visitorCodeManager"),_storage=require("./storage"),_requester=require("./requester");function createClient(a){var b=a.siteCode,c=a.configuration,d="undefined"!=typeof window&&!!window.document,e=d?new _storage.LocalStorageConstructor:new _storage.NativeStorageConstructor,f=d?new _eventSource.BrowserEventSourceConstructor:new _eventSource.NativeEventSourceConstructor,g=new _requester.RequestDispatcher,h=d?new _visitorCodeManager.ReactVisitorCodeManagerConstructor(null===c||void 0===c?void 0:c.domain):new _visitorCodeManager.ReactNativeVisitorCodeManagerConstructor,i=new _javascriptSdkCore.KameleoonCore({siteCode:b,configuration:c,internalConfiguration:{externalStorage:e,externalEventSource:f,externalVisitorCodeManager:h,externalRequestDispatcher:g,externalPackageInfo:{type:_javascriptSdkCore.SdkLanguageType.REACT,version:"8.4.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createClient=createClient;var _javascriptSdkCore=require("@kameleoon/javascript-sdk-core"),_eventSource=require("./eventSource"),_visitorCodeManager=require("./visitorCodeManager"),_storage=require("./storage"),_requester=require("./requester");function createClient(a){var b=a.siteCode,c=a.configuration,d="undefined"!=typeof window&&!!window.document,e=d?new _storage.LocalStorageConstructor:new _storage.NativeStorageConstructor,f=d?new _eventSource.BrowserEventSourceConstructor:new _eventSource.NativeEventSourceConstructor,g=new _requester.RequestDispatcher,h=d?new _visitorCodeManager.ReactVisitorCodeManagerConstructor(null===c||void 0===c?void 0:c.domain):new _visitorCodeManager.ReactNativeVisitorCodeManagerConstructor,i=new _javascriptSdkCore.KameleoonCore({siteCode:b,configuration:c,internalConfiguration:{externalStorage:e,externalEventSource:f,externalVisitorCodeManager:h,externalRequestDispatcher:g,externalPackageInfo:{type:_javascriptSdkCore.SdkLanguageType.REACT,version:"8.4.1"}}});return{client:i,visitorCodeManager:h}}
|
|
2
2
|
//# sourceMappingURL=kameleoonClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kameleoonClient.js","names":["createClient","a","siteCode","configuration","isBrowser","window","document","storage","LocalStorageConstructor","NativeStorageConstructor","eventSource","BrowserEventSourceConstructor","NativeEventSourceConstructor","requestDispatcher","RequestDispatcher","visitorCodeManager","ReactVisitorCodeManagerConstructor","domain","ReactNativeVisitorCodeManagerConstructor","client","KameleoonCore","internalConfiguration","externalStorage","externalEventSource","externalVisitorCodeManager","externalRequestDispatcher","externalPackageInfo","type","SdkLanguageType","REACT","version"],"sources":["../src/kameleoonClient.ts"],"sourcesContent":["import {\n KameleoonCore,\n SdkLanguageType,\n IExternalStorageConstructor,\n IExternalEventSourceConstructor,\n} from '@kameleoon/javascript-sdk-core';\nimport {\n
|
|
1
|
+
{"version":3,"file":"kameleoonClient.js","names":["createClient","a","siteCode","configuration","isBrowser","window","document","storage","LocalStorageConstructor","NativeStorageConstructor","eventSource","BrowserEventSourceConstructor","NativeEventSourceConstructor","requestDispatcher","RequestDispatcher","visitorCodeManager","ReactVisitorCodeManagerConstructor","domain","ReactNativeVisitorCodeManagerConstructor","client","KameleoonCore","internalConfiguration","externalStorage","externalEventSource","externalVisitorCodeManager","externalRequestDispatcher","externalPackageInfo","type","SdkLanguageType","REACT","version"],"sources":["../src/kameleoonClient.ts"],"sourcesContent":["import {\n KameleoonCore,\n SdkLanguageType,\n IExternalStorageConstructor,\n IExternalEventSourceConstructor,\n} from '@kameleoon/javascript-sdk-core';\nimport {\n BrowserEventSourceConstructor,\n NativeEventSourceConstructor,\n} from './eventSource';\nimport {\n ReactVisitorCodeManagerConstructor,\n ReactNativeVisitorCodeManagerConstructor,\n} from './visitorCodeManager';\nimport { LocalStorageConstructor, NativeStorageConstructor } from './storage';\nimport { RequestDispatcher } from './requester';\nimport { KameleoonContextType, SDKParameters } from './types';\n\n/**\n * Creates an instance of KameleoonClient\n * @param {string} siteCode - client's siteCode defined on Kameleoon platform\n * @param {Partial<SDKConfigurationType> | undefined} configuration - client's configuration\n */\nexport function createClient({\n siteCode,\n configuration,\n}: SDKParameters): KameleoonContextType {\n const isBrowser = typeof window !== 'undefined' && Boolean(window.document);\n const storage: IExternalStorageConstructor = isBrowser\n ? new LocalStorageConstructor()\n : new NativeStorageConstructor();\n const eventSource: IExternalEventSourceConstructor = isBrowser\n ? new BrowserEventSourceConstructor()\n : new NativeEventSourceConstructor();\n const requestDispatcher = new RequestDispatcher();\n const visitorCodeManager = isBrowser\n ? new ReactVisitorCodeManagerConstructor(configuration?.domain)\n : new ReactNativeVisitorCodeManagerConstructor();\n\n const client = new KameleoonCore({\n siteCode,\n configuration,\n internalConfiguration: {\n externalStorage: storage,\n externalEventSource: eventSource,\n externalVisitorCodeManager: visitorCodeManager,\n externalRequestDispatcher: requestDispatcher,\n externalPackageInfo: {\n type: SdkLanguageType.REACT,\n version: process.env.npm_package_version as string,\n },\n },\n });\n\n return { client, visitorCodeManager };\n}\n"],"mappings":"iUAuBO,QAAS,CAAAA,YAAYA,CAAAC,CAAA,CAGY,IAFtC,CAAAC,CAAQ,CAAAD,CAAA,CAARC,QAAQ,CACRC,CAAa,CAAAF,CAAA,CAAbE,aAAa,CAEPC,CAAS,CAAqB,WAAW,EAA7B,MAAO,CAAAC,MAAsB,IAAYA,MAAM,CAACC,QAAS,CACrEC,CAAoC,CAAGH,CAAS,CAClD,GAAI,CAAAI,gCAAyB,CAC7B,GAAI,CAAAC,iCAA0B,CAC5BC,CAA4C,CAAGN,CAAS,CAC1D,GAAI,CAAAO,0CAA+B,CACnC,GAAI,CAAAC,yCAA8B,CAChCC,CAAiB,CAAG,GAAI,CAAAC,4BAAmB,CAC3CC,CAAkB,CAAGX,CAAS,CAChC,GAAI,CAAAY,sDAAkC,QAACb,CAAa,WAAbA,CAAa,QAAbA,CAAa,CAAEc,MAAM,CAAC,CAC7D,GAAI,CAAAC,4DAA0C,CAE5CC,CAAM,CAAG,GAAI,CAAAC,gCAAa,CAAC,CAC/BlB,QAAQ,CAARA,CAAQ,CACRC,aAAa,CAAbA,CAAa,CACbkB,qBAAqB,CAAE,CACrBC,eAAe,CAAEf,CAAO,CACxBgB,mBAAmB,CAAEb,CAAW,CAChCc,0BAA0B,CAAET,CAAkB,CAC9CU,yBAAyB,CAAEZ,CAAiB,CAC5Ca,mBAAmB,CAAE,CACnBC,IAAI,CAAEC,kCAAe,CAACC,KAAK,CAC3BC,OAAO,QACT,CACF,CACF,CAAC,CAAC,CAEF,MAAO,CAAEX,MAAM,CAANA,CAAM,CAAEJ,kBAAkB,CAAlBA,CAAmB,CACtC"}
|