@kameleoon/react-sdk 4.0.1 → 4.0.2
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/README.md +17 -20
- package/dist/useActivateFeature.js +4 -2
- package/dist/useActivateFeature.js.map +1 -1
- package/dist/useFeatureVariable.js +4 -2
- package/dist/useFeatureVariable.js.map +1 -1
- package/dist/useTriggerExperiment.js +4 -2
- package/dist/useTriggerExperiment.js.map +1 -1
- package/dist/useVariationAssociatedData.js +4 -2
- package/dist/useVariationAssociatedData.js.map +1 -1
- package/package.json +2 -1
- package/dist/stories/Form.d.ts +0 -30
- package/dist/stories/Form.js +0 -215
- package/dist/stories/Form.js.map +0 -1
- package/dist/stories/FormHOC.d.ts +0 -2
- package/dist/stories/FormHOC.js +0 -41
- package/dist/stories/FormHOC.js.map +0 -1
- package/dist/stories/FormHook.d.ts +0 -2
- package/dist/stories/FormHook.js +0 -74
- package/dist/stories/FormHook.js.map +0 -1
- package/dist/stories/FormRenderProps.d.ts +0 -3
- package/dist/stories/FormRenderProps.js +0 -24
- package/dist/stories/FormRenderProps.js.map +0 -1
- package/dist/stories/Radio.d.ts +0 -8
- package/dist/stories/Radio.js +0 -9
- package/dist/stories/Radio.js.map +0 -1
- package/dist/stories/constants.d.ts +0 -16
- package/dist/stories/constants.js +0 -21
- package/dist/stories/constants.js.map +0 -1
package/README.md
CHANGED
|
@@ -820,7 +820,7 @@ _The `triggerExperiment()` and `trackConversion()` callback functions also sends
|
|
|
820
820
|
#### `addData()`
|
|
821
821
|
##### Arguments
|
|
822
822
|
- `visitorCode: string` - unique identifier of the user.
|
|
823
|
-
- `dataTypes: DataInterface[]` - custom data types.
|
|
823
|
+
- `dataTypes: DataInterface[]` - custom data types which may be passed separated by a comma.
|
|
824
824
|
|
|
825
825
|
### `useAddData`
|
|
826
826
|
#### Returns
|
|
@@ -848,10 +848,10 @@ function MyComponent(): JSX.Element {
|
|
|
848
848
|
const visitorCode = getVisitorCode('example.com');
|
|
849
849
|
|
|
850
850
|
// Single data type passed
|
|
851
|
-
addData(visitorCode,
|
|
851
|
+
addData(visitorCode, addBrowser(Browser.Chrome));
|
|
852
852
|
|
|
853
853
|
// Several data types passed
|
|
854
|
-
addData(visitorCode,
|
|
854
|
+
addData(visitorCode, addBrowser(Browser.Chrome), addCustomData(1, 'some custom value'));
|
|
855
855
|
}, []);
|
|
856
856
|
|
|
857
857
|
...
|
|
@@ -882,13 +882,10 @@ class MyComponent extends React.Component {
|
|
|
882
882
|
const visitorCode = getVisitorCode('example.com');
|
|
883
883
|
|
|
884
884
|
// Single data type passed
|
|
885
|
-
addData(visitorCode,
|
|
885
|
+
addData(visitorCode, addBrowser(Browser.Chrome));
|
|
886
886
|
|
|
887
887
|
// Several data types passed
|
|
888
|
-
addData(visitorCode,
|
|
889
|
-
addBrowser(Browser.Chrome),
|
|
890
|
-
addCustomData(1, 'some custom value'),
|
|
891
|
-
]);
|
|
888
|
+
addData(visitorCode, addBrowser(Browser.Chrome), addCustomData(1, 'some custom value'));
|
|
892
889
|
}
|
|
893
890
|
|
|
894
891
|
...
|
|
@@ -935,7 +932,7 @@ function MyComponent(): JSX.Element {
|
|
|
935
932
|
useEffect(() => {
|
|
936
933
|
const visitorCode = getVisitorCode('example.com');
|
|
937
934
|
|
|
938
|
-
addData(visitorCode,
|
|
935
|
+
addData(visitorCode, addBrowser(Browser.Chrome));
|
|
939
936
|
flush(visitorCode);
|
|
940
937
|
}, []);
|
|
941
938
|
|
|
@@ -966,7 +963,7 @@ class MyComponent extends React.Component {
|
|
|
966
963
|
const { addData, addBrowser, flush, getVisitorCode } = this.props;
|
|
967
964
|
const visitorCode = getVisitorCode('example.com');
|
|
968
965
|
|
|
969
|
-
addData(visitorCode,
|
|
966
|
+
addData(visitorCode, addBrowser(Browser.Chrome));
|
|
970
967
|
flush(visitorCode);
|
|
971
968
|
}
|
|
972
969
|
|
|
@@ -1089,7 +1086,7 @@ function MyComponent(): JSX.Element {
|
|
|
1089
1086
|
useEffect(() => {
|
|
1090
1087
|
const visitorCode = getVisitorCode('example.com');
|
|
1091
1088
|
|
|
1092
|
-
addData(visitorCode,
|
|
1089
|
+
addData(visitorCode, addBrowser(Browser.Chrome));
|
|
1093
1090
|
}, []);
|
|
1094
1091
|
|
|
1095
1092
|
...
|
|
@@ -1118,7 +1115,7 @@ class MyComponent extends React.Component {
|
|
|
1118
1115
|
const { addData, addBrowser, getVisitorCode } = this.props;
|
|
1119
1116
|
const visitorCode = getVisitorCode('example.com');
|
|
1120
1117
|
|
|
1121
|
-
addData(visitorCode,
|
|
1118
|
+
addData(visitorCode, addBrowser(Browser.Chrome));
|
|
1122
1119
|
}
|
|
1123
1120
|
|
|
1124
1121
|
...
|
|
@@ -1159,7 +1156,7 @@ function MyComponent(): JSX.Element {
|
|
|
1159
1156
|
useEffect(() => {
|
|
1160
1157
|
const visitorCode = getVisitorCode('example.com');
|
|
1161
1158
|
|
|
1162
|
-
addData(visitorCode,
|
|
1159
|
+
addData(visitorCode, addPageView('example.com', 'title', 3));
|
|
1163
1160
|
}, []);
|
|
1164
1161
|
|
|
1165
1162
|
...
|
|
@@ -1190,7 +1187,7 @@ class MyComponent extends React.Component {
|
|
|
1190
1187
|
const { addData, addPageView, getVisitorCode } = this.props;
|
|
1191
1188
|
const visitorCode = getVisitorCode('example.com');
|
|
1192
1189
|
|
|
1193
|
-
addData(visitorCode,
|
|
1190
|
+
addData(visitorCode, addPageView('example.com', 'title', 3));
|
|
1194
1191
|
}
|
|
1195
1192
|
|
|
1196
1193
|
...
|
|
@@ -1232,7 +1229,7 @@ function MyComponent(): JSX.Element {
|
|
|
1232
1229
|
useEffect(() => {
|
|
1233
1230
|
const visitorCode = getVisitorCode('example.com');
|
|
1234
1231
|
|
|
1235
|
-
addData(visitorCode,
|
|
1232
|
+
addData(visitorCode, addConversion(32, 10, false));
|
|
1236
1233
|
}, []);
|
|
1237
1234
|
|
|
1238
1235
|
...
|
|
@@ -1260,7 +1257,7 @@ class MyComponent extends React.Component {
|
|
|
1260
1257
|
const { addData, addConversion, getVisitorCode } = this.props;
|
|
1261
1258
|
const visitorCode = getVisitorCode('example.com');
|
|
1262
1259
|
|
|
1263
|
-
addData(visitorCode,
|
|
1260
|
+
addData(visitorCode, addConversion(32, 10, false));
|
|
1264
1261
|
}
|
|
1265
1262
|
|
|
1266
1263
|
...
|
|
@@ -1305,7 +1302,7 @@ function MyComponent(): JSX.Element {
|
|
|
1305
1302
|
useEffect(() => {
|
|
1306
1303
|
const visitorCode = getVisitorCode('example.com');
|
|
1307
1304
|
|
|
1308
|
-
addData(visitorCode,
|
|
1305
|
+
addData(visitorCode, addCustomData(1, 'some custom value'));
|
|
1309
1306
|
}, []);
|
|
1310
1307
|
|
|
1311
1308
|
...
|
|
@@ -1333,7 +1330,7 @@ class MyComponent extends React.Component {
|
|
|
1333
1330
|
const { addData, addCustomData, getVisitorCode } = this.props;
|
|
1334
1331
|
const visitorCode = getVisitorCode('example.com');
|
|
1335
1332
|
|
|
1336
|
-
addData(visitorCode,
|
|
1333
|
+
addData(visitorCode, addCustomData(1, 'some custom value'));
|
|
1337
1334
|
}
|
|
1338
1335
|
|
|
1339
1336
|
...
|
|
@@ -1374,7 +1371,7 @@ function MyComponent(): JSX.Element {
|
|
|
1374
1371
|
useEffect(() => {
|
|
1375
1372
|
const visitorCode = getVisitorCode('example.com');
|
|
1376
1373
|
|
|
1377
|
-
addData(visitorCode,
|
|
1374
|
+
addData(visitorCode, addDevice(DeviceType.Desktop));
|
|
1378
1375
|
}, []);
|
|
1379
1376
|
|
|
1380
1377
|
...
|
|
@@ -1403,7 +1400,7 @@ class MyComponent extends React.Component {
|
|
|
1403
1400
|
const { addData, addDevice, getVisitorCode } = this.props;
|
|
1404
1401
|
const visitorCode = getVisitorCode('example.com');
|
|
1405
1402
|
|
|
1406
|
-
addData(visitorCode,
|
|
1403
|
+
addData(visitorCode, addDevice(DeviceType.Desktop));
|
|
1407
1404
|
}
|
|
1408
1405
|
|
|
1409
1406
|
...
|
|
@@ -26,10 +26,12 @@ function useActivateFeature() {
|
|
|
26
26
|
if (!client) {
|
|
27
27
|
throw new ProviderError_1.ProviderError('useActivateFeature');
|
|
28
28
|
}
|
|
29
|
-
return {
|
|
29
|
+
return (0, react_1.useMemo)(function () { return ({
|
|
30
30
|
hasFeature: hasFeature,
|
|
31
31
|
error: error,
|
|
32
|
-
};
|
|
32
|
+
}); },
|
|
33
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
+
[hasFeature]);
|
|
33
35
|
}
|
|
34
36
|
exports.useActivateFeature = useActivateFeature;
|
|
35
37
|
//# sourceMappingURL=useActivateFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActivateFeature.js","sourceRoot":"","sources":["../src/useActivateFeature.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"useActivateFeature.js","sourceRoot":"","sources":["../src/useActivateFeature.ts"],"names":[],"mappings":";;;AAAA,+BAA6C;AAC7C,+CAA8C;AAC9C,iDAAgD;AAEhD,uCAAsC;AACtC,mDAAkD;AAWlD;;GAEG;AACH,SAAgB,kBAAkB;IACxB,IAAA,MAAM,GAAK,IAAA,2BAAY,GAAE,OAAnB,CAAoB;IAC5B,IAAA,KAAsB,IAAA,mBAAQ,GAAE,EAA9B,KAAK,WAAA,EAAE,QAAQ,cAAe,CAAC;IAC/B,IAAA,cAAc,GAAK,IAAA,+BAAc,GAAE,eAArB,CAAsB;IAE5C,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,UAAC,UAA2B,EAAE,WAAoB;QAChD,IAAI;YACF,IAAM,QAAQ,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,cAAc,CAAC,EAAE,CAAC,CAAC;YAEnD,OAAO,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;SACrD;QAAC,OAAO,YAAY,EAAE;YACrB,QAAQ,CAAC,YAAY,CAAC,CAAC;YAEvB,OAAO,KAAK,CAAC;SACd;IACH,CAAC,EACD,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,CAAC,CACnC,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,6BAAa,CAAC,oBAAoB,CAAC,CAAC;KAC/C;IAED,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CAAC;QACL,UAAU,YAAA;QACV,KAAK,OAAA;KACN,CAAC,EAHI,CAGJ;IACF,uDAAuD;IACvD,CAAC,UAAU,CAAC,CACb,CAAC;AACJ,CAAC;AAhCD,gDAgCC"}
|
|
@@ -32,10 +32,12 @@ function useFeatureVariable() {
|
|
|
32
32
|
return undefined;
|
|
33
33
|
}
|
|
34
34
|
}, [client, getProcessedVariable, setError]);
|
|
35
|
-
return {
|
|
35
|
+
return (0, react_1.useMemo)(function () { return ({
|
|
36
36
|
getFeatureVariable: getFeatureVariable,
|
|
37
37
|
error: error,
|
|
38
|
-
};
|
|
38
|
+
}); },
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
[getFeatureVariable]);
|
|
39
41
|
}
|
|
40
42
|
exports.useFeatureVariable = useFeatureVariable;
|
|
41
43
|
//# sourceMappingURL=useFeatureVariable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFeatureVariable.js","sourceRoot":"","sources":["../src/useFeatureVariable.ts"],"names":[],"mappings":";;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"useFeatureVariable.js","sourceRoot":"","sources":["../src/useFeatureVariable.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA6C;AAC7C,gEAA0C;AAC1C,+CAA8C;AAG9C,uCAAsC;AActC;;GAEG;AACH,SAAgB,kBAAkB;IACxB,IAAA,MAAM,GAAK,IAAA,2BAAY,GAAE,OAAnB,CAAoB;IAC5B,IAAA,KAAsB,IAAA,mBAAQ,GAAE,EAA9B,KAAK,WAAA,EAAE,QAAQ,cAAe,CAAC;IAEvC,IAAM,oBAAoB,GAAG,IAAA,mBAAW,EAAC,UAAC,KAAK;QAC7C,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAA,gBAAM,EAAC,KAAK,CAAC,EAAE;YAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1B;QAED,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,kBAAkB,GAAG,IAAA,mBAAW,EACpC,UACE,UAA2B,EAC3B,WAAmB;QAEnB,IAAI;YACF,OAAO,oBAAoB,CACzB,MAAM,CAAC,qBAAqB,CAAC,UAAU,EAAE,WAAW,CAAC,CACtD,CAAC;SACH;QAAC,OAAO,YAAY,EAAE;YACrB,QAAQ,CAAC,YAAY,CAAC,CAAC;YAEvB,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,EACD,CAAC,MAAM,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CACzC,CAAC;IAEF,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CAAC;QACL,kBAAkB,oBAAA;QAClB,KAAK,OAAA;KACN,CAAC,EAHI,CAGJ;IACF,uDAAuD;IACvD,CAAC,kBAAkB,CAAC,CACrB,CAAC;AACJ,CAAC;AA1CD,gDA0CC"}
|
|
@@ -23,10 +23,12 @@ function useTriggerExperiment() {
|
|
|
23
23
|
return DEFAULT_VARIATION_ID;
|
|
24
24
|
}
|
|
25
25
|
}, [client, setError]);
|
|
26
|
-
return {
|
|
26
|
+
return (0, react_1.useMemo)(function () { return ({
|
|
27
27
|
getVariationId: getVariationId,
|
|
28
28
|
error: error,
|
|
29
|
-
};
|
|
29
|
+
}); },
|
|
30
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
+
[getVariationId]);
|
|
30
32
|
}
|
|
31
33
|
exports.useTriggerExperiment = useTriggerExperiment;
|
|
32
34
|
//# sourceMappingURL=useTriggerExperiment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTriggerExperiment.js","sourceRoot":"","sources":["../src/useTriggerExperiment.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"useTriggerExperiment.js","sourceRoot":"","sources":["../src/useTriggerExperiment.ts"],"names":[],"mappings":";;;AAAA,+BAA6C;AAC7C,+CAA8C;AAE9C,uCAAsC;AAWtC;;;;;GAKG;AACH,SAAgB,oBAAoB;IAC5B,IAAA,KAAsB,IAAA,mBAAQ,GAAE,EAA9B,KAAK,WAAA,EAAE,QAAQ,cAAe,CAAC;IAC/B,IAAA,MAAM,GAAK,IAAA,2BAAY,GAAE,OAAnB,CAAoB;IAClC,IAAM,oBAAoB,GAAG,CAAC,CAAC;IAE/B,IAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,UAAC,WAAmB,EAAE,YAAoB;QACxC,IAAI;YACF,OAAO,MAAM,CAAC,iBAAiB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;SAC5D;QAAC,OAAO,YAAY,EAAE;YACrB,QAAQ,CAAC,YAAY,CAAC,CAAC;YAEvB,OAAO,oBAAoB,CAAC;SAC7B;IACH,CAAC,EACD,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IAEF,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CAAC;QACL,cAAc,gBAAA;QACd,KAAK,OAAA;KACN,CAAC,EAHI,CAGJ;IACF,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;AACJ,CAAC;AA1BD,oDA0BC"}
|
|
@@ -21,10 +21,12 @@ function useVariationAssociatedData() {
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
}, [client, setError]);
|
|
24
|
-
return {
|
|
24
|
+
return (0, react_1.useMemo)(function () { return ({
|
|
25
25
|
getVariationAssociatedData: getVariationAssociatedData,
|
|
26
26
|
error: error,
|
|
27
|
-
};
|
|
27
|
+
}); },
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
[getVariationAssociatedData]);
|
|
28
30
|
}
|
|
29
31
|
exports.useVariationAssociatedData = useVariationAssociatedData;
|
|
30
32
|
//# sourceMappingURL=useVariationAssociatedData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVariationAssociatedData.js","sourceRoot":"","sources":["../src/useVariationAssociatedData.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"useVariationAssociatedData.js","sourceRoot":"","sources":["../src/useVariationAssociatedData.ts"],"names":[],"mappings":";;;AAAA,+BAA6C;AAC7C,+CAA8C;AAG9C,uCAAsC;AAYtC;;;;GAIG;AACH,SAAgB,0BAA0B;IAChC,IAAA,MAAM,GAAK,IAAA,2BAAY,GAAE,OAAnB,CAAoB;IAC5B,IAAA,KAAsB,IAAA,mBAAQ,GAAE,EAA9B,KAAK,WAAA,EAAE,QAAQ,cAAe,CAAC;IAEvC,IAAM,0BAA0B,GAAG,IAAA,mBAAW,EAC5C,UAAC,WAAmB;QAClB,IAAI;YACF,OAAO,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,CAAC;SAC1D;QAAC,OAAO,YAAY,EAAE;YACrB,QAAQ,CAAC,YAAY,CAAC,CAAC;YAEvB,OAAO,IAAI,CAAC;SACb;IACH,CAAC,EACD,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CAAC;QACL,0BAA0B,4BAAA;QAC1B,KAAK,OAAA;KACN,CAAC,EAHI,CAGJ;IACF,uDAAuD;IACvD,CAAC,0BAA0B,CAAC,CAC7B,CAAC;AACJ,CAAC;AAxBD,gEAwBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kameleoon/react-sdk",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Kameleoon React SDK",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"start": "npm run clear && tsc -w",
|
|
12
12
|
"build": "npm run clear && tsc",
|
|
13
13
|
"deploy": "npm publish --tag latest --access public",
|
|
14
|
+
"deploy-nexus": "npm publish --registry=https://nexus.kameleoon.net/repository/npm-kameleoon/",
|
|
14
15
|
"release": "../../scripts/release.sh react-sdk",
|
|
15
16
|
"update-documentation": "../../scripts/update_documentation.sh react",
|
|
16
17
|
"test": "jest",
|
package/dist/stories/Form.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { KameleoonClient } from 'kameleoon-client-javascript';
|
|
3
|
-
import { DataInterface } from 'kameleoon-client-javascript/dist/interfaces/interfaces';
|
|
4
|
-
import { IFeature, RemoteSourceResultType, VariationAssociatedDataType } from '../types';
|
|
5
|
-
import { KameleoonException } from '../constants';
|
|
6
|
-
import { IBrowser, IDevice, IConversion, IPageView, Browser, DeviceType } from '..';
|
|
7
|
-
import { KameleoonError } from '../KameleoonError';
|
|
8
|
-
export interface IFormProps {
|
|
9
|
-
variationAssociatedDataError?: KameleoonError | null;
|
|
10
|
-
triggerExperimentError?: KameleoonError | null;
|
|
11
|
-
activateFeatureError?: KameleoonError | null;
|
|
12
|
-
featureErrors: KameleoonException[];
|
|
13
|
-
client?: KameleoonClient;
|
|
14
|
-
feature: IFeature['feature'];
|
|
15
|
-
isRenderProps?: boolean;
|
|
16
|
-
getVisitorCode?: (topLevelDomain: string, defaultVisitorCode?: string) => string;
|
|
17
|
-
hasFeature?: (featureKey: string | number, visitorCode?: string) => boolean;
|
|
18
|
-
addData?: (visitorCode: string, ...dataTypes: DataInterface[]) => void;
|
|
19
|
-
addBrowser?: (browser: Browser) => IBrowser;
|
|
20
|
-
addPageView?: (url: string, title: string, referrer?: number) => IPageView;
|
|
21
|
-
addDevice?: (device: DeviceType) => IDevice;
|
|
22
|
-
addConversion?: (goalId: number, revenue?: number, negative?: boolean) => IConversion;
|
|
23
|
-
getVariationAssociatedData?: (variationId: number) => VariationAssociatedDataType;
|
|
24
|
-
retrieveDataFromRemoteSource?: (key: string) => Promise<RemoteSourceResultType>;
|
|
25
|
-
getVariationId?: (visitorCode: string, experimentId: number) => number;
|
|
26
|
-
runWhenReady?: (successCallback: () => void, errorCallback: () => void, timeout?: number) => void;
|
|
27
|
-
}
|
|
28
|
-
declare function Form({ variationAssociatedDataError, triggerExperimentError, activateFeatureError, featureErrors, client, feature, isRenderProps, getVisitorCode, hasFeature, addData, addBrowser, addPageView, addDevice, addConversion, getVariationAssociatedData, retrieveDataFromRemoteSource, getVariationId, runWhenReady, }: IFormProps): JSX.Element;
|
|
29
|
-
declare const _default: React.MemoExoticComponent<typeof Form>;
|
|
30
|
-
export default _default;
|
package/dist/stories/Form.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
-
if (ar || !(i in from)) {
|
|
68
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
-
ar[i] = from[i];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
|
-
};
|
|
74
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
75
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
76
|
-
};
|
|
77
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
79
|
-
var react_1 = require("react");
|
|
80
|
-
var Radio_1 = __importDefault(require("./Radio"));
|
|
81
|
-
var constants_1 = require("./constants");
|
|
82
|
-
var constants_2 = require("../constants");
|
|
83
|
-
var __1 = require("..");
|
|
84
|
-
var KameleoonError_1 = require("../KameleoonError");
|
|
85
|
-
var useErrors_1 = require("../useErrors");
|
|
86
|
-
function Form(_a) {
|
|
87
|
-
var _this = this;
|
|
88
|
-
var _b, _c, _d, _e, _f;
|
|
89
|
-
var variationAssociatedDataError = _a.variationAssociatedDataError, triggerExperimentError = _a.triggerExperimentError, activateFeatureError = _a.activateFeatureError, featureErrors = _a.featureErrors, client = _a.client, feature = _a.feature, isRenderProps = _a.isRenderProps, getVisitorCode = _a.getVisitorCode, hasFeature = _a.hasFeature, addData = _a.addData, addBrowser = _a.addBrowser, addPageView = _a.addPageView, addDevice = _a.addDevice, addConversion = _a.addConversion, getVariationAssociatedData = _a.getVariationAssociatedData, retrieveDataFromRemoteSource = _a.retrieveDataFromRemoteSource, getVariationId = _a.getVariationId, runWhenReady = _a.runWhenReady;
|
|
90
|
-
var _g = __read((0, react_1.useState)(''), 2), visitorCode = _g[0], setVisitorCode = _g[1];
|
|
91
|
-
var _h = __read((0, react_1.useState)(false), 2), featureFlag = _h[0], setFeatureFlag = _h[1];
|
|
92
|
-
var _j = __read((0, react_1.useState)([]), 2), featureVariables = _j[0], setFeatureVariables = _j[1];
|
|
93
|
-
var _k = __read((0, react_1.useState)([]), 2), customData = _k[0], setCustomData = _k[1];
|
|
94
|
-
var _l = __read((0, react_1.useState)(), 2), variationId = _l[0], setVariationId = _l[1];
|
|
95
|
-
var _m = __read((0, react_1.useState)(), 2), variationData = _m[0], setVariationData = _m[1];
|
|
96
|
-
var _o = __read((0, react_1.useState)(null), 2), remoteSourceData = _o[0], setRemoteSourceData = _o[1];
|
|
97
|
-
var _p = (0, useErrors_1.useErrors)(), errors = _p.errors, setErrors = _p.setErrors;
|
|
98
|
-
function displayCustomData() {
|
|
99
|
-
var kameleoonConfig = localStorage.getItem(constants_2.KAMELEOON_SDK_LOCAL_STORAGE_KEY);
|
|
100
|
-
if (kameleoonConfig && visitorCode) {
|
|
101
|
-
var data = JSON.parse(kameleoonConfig).kameleoonTargetingData[visitorCode];
|
|
102
|
-
setCustomData(data);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function handleAddBrowser(event) {
|
|
106
|
-
event.preventDefault();
|
|
107
|
-
if (visitorCode && addBrowser && addData) {
|
|
108
|
-
addData(visitorCode, addBrowser(__1.Browser.Chrome));
|
|
109
|
-
displayCustomData();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function handleAddPageView(event) {
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
if (visitorCode && addData && addPageView) {
|
|
115
|
-
addData(visitorCode, addPageView(constants_1.KAMELEOON_URL, 'Page View'));
|
|
116
|
-
displayCustomData();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function handleAddDevice(event) {
|
|
120
|
-
event.preventDefault();
|
|
121
|
-
if (visitorCode && addData && addDevice) {
|
|
122
|
-
addData(visitorCode, addDevice(__1.DeviceType.Desktop));
|
|
123
|
-
displayCustomData();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function handleAddConversion(event) {
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
if (visitorCode && addData && addConversion) {
|
|
129
|
-
addData(visitorCode, addConversion(constants_1.KAMELEOON_GOAL_ID));
|
|
130
|
-
displayCustomData();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
var processRetrievedData = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
134
|
-
var _a, data, error;
|
|
135
|
-
return __generator(this, function (_b) {
|
|
136
|
-
switch (_b.label) {
|
|
137
|
-
case 0:
|
|
138
|
-
if (!retrieveDataFromRemoteSource) return [3 /*break*/, 2];
|
|
139
|
-
return [4 /*yield*/, retrieveDataFromRemoteSource(constants_1.KAMELEOON_VISITOR_KEY)];
|
|
140
|
-
case 1:
|
|
141
|
-
_a = _b.sent(), data = _a.data, error = _a.error;
|
|
142
|
-
if (data) {
|
|
143
|
-
setRemoteSourceData(data);
|
|
144
|
-
}
|
|
145
|
-
if (error) {
|
|
146
|
-
throw new KameleoonError_1.KameleoonError(error.type);
|
|
147
|
-
}
|
|
148
|
-
_b.label = 2;
|
|
149
|
-
case 2: return [2 /*return*/];
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}); }, [retrieveDataFromRemoteSource]);
|
|
153
|
-
var getVariationSuccessCallback = (0, react_1.useCallback)(function () {
|
|
154
|
-
if (!isRenderProps && getVariationId) {
|
|
155
|
-
setVariationId(getVariationId(constants_1.USER_ID, constants_1.EXPERIMENT_ID));
|
|
156
|
-
}
|
|
157
|
-
}, [getVariationId, isRenderProps]);
|
|
158
|
-
var getVariationErrorCallback = (0, react_1.useCallback)(function () {
|
|
159
|
-
throw new Error("Couldn't get server configuration from HTTP request in a specified time");
|
|
160
|
-
}, []);
|
|
161
|
-
(0, react_1.useEffect)(function () {
|
|
162
|
-
if (runWhenReady) {
|
|
163
|
-
runWhenReady(getVariationSuccessCallback, getVariationErrorCallback, 1000);
|
|
164
|
-
}
|
|
165
|
-
}, [
|
|
166
|
-
getVariationErrorCallback,
|
|
167
|
-
getVariationId,
|
|
168
|
-
getVariationSuccessCallback,
|
|
169
|
-
isRenderProps,
|
|
170
|
-
runWhenReady,
|
|
171
|
-
]);
|
|
172
|
-
(0, react_1.useEffect)(function () {
|
|
173
|
-
if (variationId && getVariationAssociatedData) {
|
|
174
|
-
setVariationData(getVariationAssociatedData(variationId));
|
|
175
|
-
}
|
|
176
|
-
}, [getVariationAssociatedData, variationId]);
|
|
177
|
-
(0, react_1.useEffect)(function () {
|
|
178
|
-
if (getVisitorCode) {
|
|
179
|
-
setVisitorCode(getVisitorCode(constants_1.KAMELEOON_URL));
|
|
180
|
-
}
|
|
181
|
-
}, [getVisitorCode]);
|
|
182
|
-
(0, react_1.useEffect)(function () {
|
|
183
|
-
if (hasFeature) {
|
|
184
|
-
setFeatureFlag(hasFeature(constants_1.FEATURE_KEY, constants_1.USER_ID));
|
|
185
|
-
}
|
|
186
|
-
}, [hasFeature]);
|
|
187
|
-
(0, react_1.useEffect)(function () {
|
|
188
|
-
if (feature.variables) {
|
|
189
|
-
setFeatureVariables(feature.variables);
|
|
190
|
-
}
|
|
191
|
-
}, [feature, isRenderProps]);
|
|
192
|
-
(0, react_1.useEffect)(function () {
|
|
193
|
-
processRetrievedData();
|
|
194
|
-
}, [processRetrievedData]);
|
|
195
|
-
(0, react_1.useEffect)(function () {
|
|
196
|
-
var newErrors = __spreadArray([
|
|
197
|
-
activateFeatureError === null || activateFeatureError === void 0 ? void 0 : activateFeatureError.type,
|
|
198
|
-
triggerExperimentError === null || triggerExperimentError === void 0 ? void 0 : triggerExperimentError.type,
|
|
199
|
-
variationAssociatedDataError === null || variationAssociatedDataError === void 0 ? void 0 : variationAssociatedDataError.type
|
|
200
|
-
], __read(featureErrors), false);
|
|
201
|
-
setErrors(newErrors);
|
|
202
|
-
}, [
|
|
203
|
-
activateFeatureError,
|
|
204
|
-
featureErrors,
|
|
205
|
-
setErrors,
|
|
206
|
-
triggerExperimentError,
|
|
207
|
-
variationAssociatedDataError,
|
|
208
|
-
]);
|
|
209
|
-
return ((0, jsx_runtime_1.jsxs)("form", { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Feature flag activation test" }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Always active", isActive: true }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active only when feature flag is on", isActive: isRenderProps ? feature.isActive : featureFlag }, void 0), !isRenderProps && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active only when kameleoon client is connected", isActive: Boolean(client) }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active only when visitor code is present", isActive: Boolean(visitorCode) }, void 0)] }, void 0)), (0, jsx_runtime_1.jsx)("h1", { children: "Feature flag variables test" }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when string variable is present", isActive: Boolean((_b = featureVariables[0]) === null || _b === void 0 ? void 0 : _b[constants_1.FeatureVariables.STRING]) }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when boolean variable is present", isActive: Boolean((_c = featureVariables[1]) === null || _c === void 0 ? void 0 : _c[constants_1.FeatureVariables.BOOLEAN]) }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when number variable is present", isActive: Boolean((_d = featureVariables[2]) === null || _d === void 0 ? void 0 : _d[constants_1.FeatureVariables.NUMBER]) }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when JSON variable is present", isActive: Boolean((_e = featureVariables[3]) === null || _e === void 0 ? void 0 : _e[constants_1.FeatureVariables.JSON]) }, void 0), (0, jsx_runtime_1.jsx)("h1", { children: "Multi Environment test" }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active only when client environment option is set to value different from the default 'production' (variables above will become inactive), make sure to disable other stories and clear local storage, as for now client is not capable of handling several environments simultaneously", isActive: Boolean((_f = featureVariables[0]) === null || _f === void 0 ? void 0 : _f[constants_1.FeatureVariables.MULTI_ENVIRONMENT]) }, void 0), !isRenderProps && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Remote Source Data test" }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when data from the remote was received and it's not empty", isActive: Boolean(remoteSourceData) }, void 0)] }, void 0)), !isRenderProps && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Feature flag associated variation test" }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when experiment is triggered", isActive: Boolean(variationId) }, void 0), (0, jsx_runtime_1.jsx)(Radio_1.default, { title: "Active when variationData is present", isActive: Boolean(variationData) }, void 0), (0, jsx_runtime_1.jsx)("h1", { children: "Feature flag custom data test" }, void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0), (0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: handleAddBrowser }, { children: "Add browser data" }), void 0), (0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: handleAddPageView }, { children: "Add page view data" }), void 0), (0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: handleAddDevice }, { children: "Add device data" }), void 0), (0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: handleAddConversion }, { children: "Add conversion data" }), void 0), (0, jsx_runtime_1.jsx)("p", { children: "Custom data:" }, void 0), customData.map(function (item, index) {
|
|
210
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
211
|
-
return (0, jsx_runtime_1.jsx)("p", { children: JSON.stringify(item.data) }, index);
|
|
212
|
-
})] }, void 0)), (0, jsx_runtime_1.jsx)("h1", { children: "Errors test" }, void 0), Boolean(errors === null || errors === void 0 ? void 0 : errors.length) && ((0, jsx_runtime_1.jsx)("ul", { children: errors === null || errors === void 0 ? void 0 : errors.map(function (error) { return ((0, jsx_runtime_1.jsx)("li", { children: error }, error)); }) }, void 0))] }, void 0));
|
|
213
|
-
}
|
|
214
|
-
exports.default = (0, react_1.memo)(Form);
|
|
215
|
-
//# sourceMappingURL=Form.js.map
|
package/dist/stories/Form.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../src/stories/Form.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAsE;AAUtE,kDAA4B;AAC5B,yCAQqB;AACrB,0CAGsB;AACtB,wBAOY;AACZ,oDAAmD;AACnD,0CAAyC;AAsCzC,SAAS,IAAI,CAAC,EAmBD;IAnBb,iBAuQC;;QAtQC,4BAA4B,kCAAA,EAC5B,sBAAsB,4BAAA,EACtB,oBAAoB,0BAAA,EACpB,aAAa,mBAAA,EACb,MAAM,YAAA,EACN,OAAO,aAAA,EACP,aAAa,mBAAA,EACb,cAAc,oBAAA,EACd,UAAU,gBAAA,EACV,OAA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O,EAAE,iBAAiB,gDAEvC,EACT,4CAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,eAAe,6CAErC,EACT,4CAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,mBAAmB,iDAEzC,EACT,iEAAmB,EAClB,UAAU,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK;wBAC1B,oDAAoD;wBACpD,OAAO,wCAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAjC,KAAK,CAAiC,CAAC;oBACxD,CAAC,CAAC,YACD,CACJ,EACD,iEAAoB,EACnB,OAAO,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,IAAI,CAC1B,yCACG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,CACtB,yCAAiB,KAAK,IAAb,KAAK,CAAc,CAC7B,EAFuB,CAEvB,CAAC,WACC,CACN,YACI,CACR,CAAC;AACJ,CAAC;AACD,kBAAe,IAAA,YAAI,EAAC,IAAI,CAAC,CAAC"}
|
package/dist/stories/FormHOC.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var compose_1 = __importDefault(require("../compose"));
|
|
19
|
-
var constants_1 = require("./constants");
|
|
20
|
-
var index_1 = require("../index");
|
|
21
|
-
var Form_1 = __importDefault(require("./Form"));
|
|
22
|
-
function FormHOC(props) {
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(Form_1.default, __assign({}, props, { isRenderProps: false }), void 0);
|
|
24
|
-
}
|
|
25
|
-
var variableKeys = {
|
|
26
|
-
production: [
|
|
27
|
-
constants_1.FeatureVariables.STRING,
|
|
28
|
-
constants_1.FeatureVariables.BOOLEAN,
|
|
29
|
-
constants_1.FeatureVariables.NUMBER,
|
|
30
|
-
constants_1.FeatureVariables.JSON,
|
|
31
|
-
],
|
|
32
|
-
development: constants_1.FeatureVariables.MULTI_ENVIRONMENT,
|
|
33
|
-
staging: constants_1.FeatureVariables.MULTI_ENVIRONMENT,
|
|
34
|
-
};
|
|
35
|
-
var withKameleoonHOCs = (0, compose_1.default)(index_1.withKameleoon, index_1.withVisitorCode, index_1.withActivateFeature, index_1.withAddData, index_1.withBrowser, index_1.withPageView, index_1.withDevice, index_1.withConversion, index_1.withTriggerExperiment, index_1.withRunWhenReady, index_1.withVariationAssociatedData, index_1.withRetrieveDataFromRemoteSource, (0, index_1.withFeature)({
|
|
36
|
-
featureKey: constants_1.FEATURE_KEY,
|
|
37
|
-
variableKeys: variableKeys,
|
|
38
|
-
visitorCode: constants_1.USER_ID,
|
|
39
|
-
}));
|
|
40
|
-
exports.default = withKameleoonHOCs(FormHOC);
|
|
41
|
-
//# sourceMappingURL=FormHOC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormHOC.js","sourceRoot":"","sources":["../../src/stories/FormHOC.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uDAAiC;AACjC,yCAAqE;AACrE,kCAckB;AAClB,gDAA0C;AAE1C,SAAS,OAAO,CAAC,KAAiB;IAChC,OAAO,uBAAC,cAAI,eAAK,KAAK,IAAE,aAAa,EAAE,KAAK,YAAI,CAAC;AACnD,CAAC;AAED,IAAM,YAAY,GAAG;IACnB,UAAU,EAAE;QACV,4BAAgB,CAAC,MAAM;QACvB,4BAAgB,CAAC,OAAO;QACxB,4BAAgB,CAAC,MAAM;QACvB,4BAAgB,CAAC,IAAI;KACtB;IACD,WAAW,EAAE,4BAAgB,CAAC,iBAAiB;IAC/C,OAAO,EAAE,4BAAgB,CAAC,iBAAiB;CAC5C,CAAC;AAEF,IAAM,iBAAiB,GAAG,IAAA,iBAAO,EAC/B,qBAAa,EACb,uBAAe,EACf,2BAAmB,EACnB,mBAAW,EACX,mBAAW,EACX,oBAAY,EACZ,kBAAU,EACV,sBAAc,EACd,6BAAqB,EACrB,wBAAgB,EAChB,mCAA2B,EAC3B,wCAAgC,EAChC,IAAA,mBAAW,EAAC;IACV,UAAU,EAAE,uBAAW;IACvB,YAAY,cAAA;IACZ,WAAW,EAAE,mBAAO;CACrB,CAAC,CACH,CAAC;AAEF,kBAAe,iBAAiB,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/stories/FormHook.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.FormHook = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
var index_1 = require("../index");
|
|
20
|
-
var Form_1 = __importDefault(require("./Form"));
|
|
21
|
-
var constants_1 = require("./constants");
|
|
22
|
-
function FormHook() {
|
|
23
|
-
var client = (0, index_1.useKameleoon)().client;
|
|
24
|
-
var getVisitorCode = (0, index_1.useVisitorCode)().getVisitorCode;
|
|
25
|
-
var addData = (0, index_1.useAddData)().addData;
|
|
26
|
-
var addBrowser = (0, index_1.useBrowser)().addBrowser;
|
|
27
|
-
var addPageView = (0, index_1.usePageView)().addPageView;
|
|
28
|
-
var addDevice = (0, index_1.useDevice)().addDevice;
|
|
29
|
-
var addConversion = (0, index_1.useConversion)().addConversion;
|
|
30
|
-
var _a = (0, index_1.useVariationAssociatedData)(), getVariationAssociatedData = _a.getVariationAssociatedData, variationAssociatedDataError = _a.error;
|
|
31
|
-
var trackConversion = (0, index_1.useTrackingConversion)().trackConversion;
|
|
32
|
-
var _b = (0, index_1.useTriggerExperiment)(), getVariationId = _b.getVariationId, triggerExperimentError = _b.error;
|
|
33
|
-
var _c = (0, index_1.useActivateFeature)(), hasFeature = _c.hasFeature, activateFeatureError = _c.error;
|
|
34
|
-
var retrieveDataFromRemoteSource = (0, index_1.useRetrieveDataFromRemoteSource)().retrieveDataFromRemoteSource;
|
|
35
|
-
var runWhenReady = (0, index_1.useRunWhenReady)().runWhenReady;
|
|
36
|
-
var variableKeys = {
|
|
37
|
-
production: [
|
|
38
|
-
constants_1.FeatureVariables.STRING,
|
|
39
|
-
constants_1.FeatureVariables.BOOLEAN,
|
|
40
|
-
constants_1.FeatureVariables.NUMBER,
|
|
41
|
-
constants_1.FeatureVariables.JSON,
|
|
42
|
-
],
|
|
43
|
-
development: constants_1.FeatureVariables.MULTI_ENVIRONMENT,
|
|
44
|
-
staging: constants_1.FeatureVariables.MULTI_ENVIRONMENT,
|
|
45
|
-
};
|
|
46
|
-
var _d = (0, index_1.useFeature)({
|
|
47
|
-
featureKey: constants_1.FEATURE_KEY,
|
|
48
|
-
variableKeys: variableKeys,
|
|
49
|
-
visitorCode: constants_1.USER_ID,
|
|
50
|
-
}), feature = _d.feature, featureErrors = _d.errors;
|
|
51
|
-
var props = {
|
|
52
|
-
variationAssociatedDataError: variationAssociatedDataError,
|
|
53
|
-
triggerExperimentError: triggerExperimentError,
|
|
54
|
-
activateFeatureError: activateFeatureError,
|
|
55
|
-
featureErrors: featureErrors,
|
|
56
|
-
client: client,
|
|
57
|
-
feature: feature,
|
|
58
|
-
getVisitorCode: getVisitorCode,
|
|
59
|
-
hasFeature: hasFeature,
|
|
60
|
-
addData: addData,
|
|
61
|
-
addBrowser: addBrowser,
|
|
62
|
-
addPageView: addPageView,
|
|
63
|
-
addDevice: addDevice,
|
|
64
|
-
addConversion: addConversion,
|
|
65
|
-
getVariationAssociatedData: getVariationAssociatedData,
|
|
66
|
-
retrieveDataFromRemoteSource: retrieveDataFromRemoteSource,
|
|
67
|
-
getVariationId: getVariationId,
|
|
68
|
-
trackConversion: trackConversion,
|
|
69
|
-
runWhenReady: runWhenReady,
|
|
70
|
-
};
|
|
71
|
-
return (0, jsx_runtime_1.jsx)(Form_1.default, __assign({}, props, { isRenderProps: false }), void 0);
|
|
72
|
-
}
|
|
73
|
-
exports.FormHook = FormHook;
|
|
74
|
-
//# sourceMappingURL=FormHook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormHook.js","sourceRoot":"","sources":["../../src/stories/FormHook.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAekB;AAClB,gDAA0B;AAC1B,yCAAqE;AAErE,SAAgB,QAAQ;IACd,IAAA,MAAM,GAAK,IAAA,oBAAY,GAAE,OAAnB,CAAoB;IAC1B,IAAA,cAAc,GAAK,IAAA,sBAAc,GAAE,eAArB,CAAsB;IACpC,IAAA,OAAO,GAAK,IAAA,kBAAU,GAAE,QAAjB,CAAkB;IACzB,IAAA,UAAU,GAAK,IAAA,kBAAU,GAAE,WAAjB,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P,UAAU,YAAA;QACV,WAAW,aAAA;QACX,SAAS,WAAA;QACT,aAAa,eAAA;QACb,0BAA0B,4BAAA;QAC1B,4BAA4B,8BAAA;QAC5B,cAAc,gBAAA;QACd,eAAe,iBAAA;QACf,YAAY,cAAA;KACb,CAAC;IAEF,OAAO,uBAAC,cAAI,eAAK,KAAK,IAAE,aAAa,EAAE,KAAK,YAAI,CAAC;AACnD,CAAC;AAxDD,4BAwDC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.FormRenderProps = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
var Form_1 = __importDefault(require("./Form"));
|
|
20
|
-
function FormRenderProps(props) {
|
|
21
|
-
return (0, jsx_runtime_1.jsx)(Form_1.default, __assign({}, props, { isRenderProps: true }), void 0);
|
|
22
|
-
}
|
|
23
|
-
exports.FormRenderProps = FormRenderProps;
|
|
24
|
-
//# sourceMappingURL=FormRenderProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderProps.js","sourceRoot":"","sources":["../../src/stories/FormRenderProps.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0C;AAE1C,SAAgB,eAAe,CAAC,KAAiB;IAC/C,OAAO,uBAAC,cAAI,eAAK,KAAK,IAAE,aAAa,kBAAG,CAAC;AAC3C,CAAC;AAFD,0CAEC"}
|
package/dist/stories/Radio.d.ts
DELETED
package/dist/stories/Radio.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
function Radio(props) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)("input", { type: "radio", name: "feature-radio", disabled: !props.isActive }, void 0), props.title] }, void 0) }, void 0));
|
|
7
|
-
}
|
|
8
|
-
exports.default = (0, react_1.memo)(Radio);
|
|
9
|
-
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/stories/Radio.tsx"],"names":[],"mappings":";;;AAAA,+BAA6B;AAO7B,SAAS,KAAK,CAAC,KAAY;IACzB,OAAO,CACL,0CACE,8CACE,kCAAO,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,eAAe,EAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,WAAI,EACrE,KAAK,CAAC,KAAK,YACN,WACJ,CACP,CAAC;AACJ,CAAC;AACD,kBAAe,IAAA,YAAI,EAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const KAMELEOON_URL = "https://app.kameleoon.com";
|
|
2
|
-
export declare const KAMELEOON_SITE_CODE = "0fpmcg34lg";
|
|
3
|
-
export declare const KAMELEOON_VISITOR_KEY = "4rXwHd620g";
|
|
4
|
-
export declare const KAMELEOON_GOAL_ID = 238446;
|
|
5
|
-
export declare const FEATURE_KEY = "react_sdk_test";
|
|
6
|
-
export declare const USER_ID = "98983";
|
|
7
|
-
export declare const EXPERIMENT_ID = 143611;
|
|
8
|
-
export declare const GOAL_ID = 245023;
|
|
9
|
-
export declare const REFRESH_INTERVAL = 5;
|
|
10
|
-
export declare enum FeatureVariables {
|
|
11
|
-
STRING = "test_variable_one",
|
|
12
|
-
BOOLEAN = "test_variable_two",
|
|
13
|
-
NUMBER = "test_variable_three",
|
|
14
|
-
JSON = "test_variable_four",
|
|
15
|
-
MULTI_ENVIRONMENT = "test_variable_multi_environment"
|
|
16
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeatureVariables = exports.REFRESH_INTERVAL = exports.GOAL_ID = exports.EXPERIMENT_ID = exports.USER_ID = exports.FEATURE_KEY = exports.KAMELEOON_GOAL_ID = exports.KAMELEOON_VISITOR_KEY = exports.KAMELEOON_SITE_CODE = exports.KAMELEOON_URL = void 0;
|
|
4
|
-
exports.KAMELEOON_URL = 'https://app.kameleoon.com';
|
|
5
|
-
exports.KAMELEOON_SITE_CODE = '0fpmcg34lg';
|
|
6
|
-
exports.KAMELEOON_VISITOR_KEY = '4rXwHd620g';
|
|
7
|
-
exports.KAMELEOON_GOAL_ID = 238446;
|
|
8
|
-
exports.FEATURE_KEY = 'react_sdk_test';
|
|
9
|
-
exports.USER_ID = '98983';
|
|
10
|
-
exports.EXPERIMENT_ID = 143611;
|
|
11
|
-
exports.GOAL_ID = 245023;
|
|
12
|
-
exports.REFRESH_INTERVAL = 5;
|
|
13
|
-
var FeatureVariables;
|
|
14
|
-
(function (FeatureVariables) {
|
|
15
|
-
FeatureVariables["STRING"] = "test_variable_one";
|
|
16
|
-
FeatureVariables["BOOLEAN"] = "test_variable_two";
|
|
17
|
-
FeatureVariables["NUMBER"] = "test_variable_three";
|
|
18
|
-
FeatureVariables["JSON"] = "test_variable_four";
|
|
19
|
-
FeatureVariables["MULTI_ENVIRONMENT"] = "test_variable_multi_environment";
|
|
20
|
-
})(FeatureVariables = exports.FeatureVariables || (exports.FeatureVariables = {}));
|
|
21
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/stories/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,2BAA2B,CAAC;AAC5C,QAAA,mBAAmB,GAAG,YAAY,CAAC;AACnC,QAAA,qBAAqB,GAAG,YAAY,CAAC;AACrC,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,WAAW,GAAG,gBAAgB,CAAC;AAC/B,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,aAAa,GAAG,MAAM,CAAC;AACvB,QAAA,OAAO,GAAG,MAAM,CAAC;AACjB,QAAA,gBAAgB,GAAG,CAAC,CAAC;AAElC,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,gDAA4B,CAAA;IAC5B,iDAA6B,CAAA;IAC7B,kDAA8B,CAAA;IAC9B,+CAA2B,CAAA;IAC3B,yEAAqD,CAAA;AACvD,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B"}
|