@artisan-commerce/analytics-rn 0.3.0-canary.79 → 0.3.0-canary.80
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/bundle.cjs.js +119 -10
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.esm.js +115 -6
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/bundle.esm.js
CHANGED
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
import { Settings, AppEventsLogger } from 'react-native-fbsdk-next';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
|
-
import { initState, getState as getState$1, setState as setState$1 } from '@artisan-commerce/state';
|
|
4
3
|
import analytics from '@segment/analytics-react-native';
|
|
5
|
-
import { snakeCase } from 'snake-case';
|
|
6
4
|
import analytics$1 from '@react-native-firebase/analytics';
|
|
7
5
|
import { getShoppingCartProducts, getShoppingCartTotal } from '@artisan-commerce/shopping-cart-core';
|
|
8
6
|
import { getProductTotals } from '@artisan-commerce/products';
|
|
9
7
|
|
|
8
|
+
var __defProp$41 = Object.defineProperty;
|
|
9
|
+
var __getOwnPropSymbols$41 = Object.getOwnPropertySymbols;
|
|
10
|
+
var __hasOwnProp$41 = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum$41 = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp$41 = (obj, key, value) => key in obj ? __defProp$41(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues$41 = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp$41.call(b, prop))
|
|
16
|
+
__defNormalProp$41(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols$41)
|
|
18
|
+
for (var prop of __getOwnPropSymbols$41(b)) {
|
|
19
|
+
if (__propIsEnum$41.call(b, prop))
|
|
20
|
+
__defNormalProp$41(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
let state = null;
|
|
25
|
+
const initState = (initialState) => {
|
|
26
|
+
Object.freeze(initialState);
|
|
27
|
+
state = __spreadValues$41({}, initialState);
|
|
28
|
+
Object.seal(state);
|
|
29
|
+
};
|
|
30
|
+
const setState$1 = (overrides) => {
|
|
31
|
+
const tempState = state ? __spreadValues$41({}, state) : {};
|
|
32
|
+
state = null;
|
|
33
|
+
state = __spreadValues$41(__spreadValues$41({}, tempState), overrides);
|
|
34
|
+
Object.seal(state);
|
|
35
|
+
};
|
|
36
|
+
const getState$1 = () => {
|
|
37
|
+
if (state === null) {
|
|
38
|
+
throw new Error("The state has not been initialized, make sure to call initState beforehand");
|
|
39
|
+
}
|
|
40
|
+
return __spreadValues$41({}, state);
|
|
41
|
+
};
|
|
42
|
+
|
|
10
43
|
var name = "@artisan-commerce/analytics-rn";
|
|
11
44
|
var description = "Artisn commerce analytics react native library";
|
|
12
|
-
var version = "0.3.0-canary.
|
|
45
|
+
var version = "0.3.0-canary.80";
|
|
13
46
|
var main = "./dist/bundle.cjs.js";
|
|
14
47
|
var module = "./dist/bundle.esm.js";
|
|
15
48
|
var types = "./dist/bundle.d.ts";
|
|
@@ -43,8 +76,8 @@ var dependencies = {
|
|
|
43
76
|
"snake-case": "^3.0.4"
|
|
44
77
|
};
|
|
45
78
|
var devDependencies = {
|
|
46
|
-
"@artisan-commerce/products": "0.9.0-canary.
|
|
47
|
-
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.
|
|
79
|
+
"@artisan-commerce/products": "0.9.0-canary.52",
|
|
80
|
+
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.75",
|
|
48
81
|
"@artisan-commerce/state": "0.3.0-canary.9",
|
|
49
82
|
"@artisan-commerce/types": "0.14.0-canary.38",
|
|
50
83
|
"@babel/core": "^7.13.15",
|
|
@@ -87,7 +120,7 @@ var nx = {
|
|
|
87
120
|
}
|
|
88
121
|
}
|
|
89
122
|
};
|
|
90
|
-
var gitHead = "
|
|
123
|
+
var gitHead = "c60bd898df04ba5628d0a4fb9623ad1b67e9e045";
|
|
91
124
|
var packageJSON = {
|
|
92
125
|
name: name,
|
|
93
126
|
description: description,
|
|
@@ -489,6 +522,82 @@ const initAnalytics = (config) => {
|
|
|
489
522
|
});
|
|
490
523
|
};
|
|
491
524
|
|
|
525
|
+
/******************************************************************************
|
|
526
|
+
Copyright (c) Microsoft Corporation.
|
|
527
|
+
|
|
528
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
529
|
+
purpose with or without fee is hereby granted.
|
|
530
|
+
|
|
531
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
532
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
533
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
534
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
535
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
536
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
537
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
538
|
+
***************************************************************************** */
|
|
539
|
+
|
|
540
|
+
var __assign = function() {
|
|
541
|
+
__assign = Object.assign || function __assign(t) {
|
|
542
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
543
|
+
s = arguments[i];
|
|
544
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
545
|
+
}
|
|
546
|
+
return t;
|
|
547
|
+
};
|
|
548
|
+
return __assign.apply(this, arguments);
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
|
553
|
+
*/
|
|
554
|
+
/**
|
|
555
|
+
* Lower case as a function.
|
|
556
|
+
*/
|
|
557
|
+
function lowerCase(str) {
|
|
558
|
+
return str.toLowerCase();
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
|
|
562
|
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
563
|
+
// Remove all non-word characters.
|
|
564
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
565
|
+
/**
|
|
566
|
+
* Normalize the string into something other libraries can manipulate easier.
|
|
567
|
+
*/
|
|
568
|
+
function noCase(input, options) {
|
|
569
|
+
if (options === void 0) { options = {}; }
|
|
570
|
+
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
|
571
|
+
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
572
|
+
var start = 0;
|
|
573
|
+
var end = result.length;
|
|
574
|
+
// Trim the delimiter from around the output string.
|
|
575
|
+
while (result.charAt(start) === "\0")
|
|
576
|
+
start++;
|
|
577
|
+
while (result.charAt(end - 1) === "\0")
|
|
578
|
+
end--;
|
|
579
|
+
// Transform each token independently.
|
|
580
|
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Replace `re` in the input string with the replacement value.
|
|
584
|
+
*/
|
|
585
|
+
function replace(input, re, value) {
|
|
586
|
+
if (re instanceof RegExp)
|
|
587
|
+
return input.replace(re, value);
|
|
588
|
+
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function dotCase(input, options) {
|
|
592
|
+
if (options === void 0) { options = {}; }
|
|
593
|
+
return noCase(input, __assign({ delimiter: "." }, options));
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
function snakeCase(input, options) {
|
|
597
|
+
if (options === void 0) { options = {}; }
|
|
598
|
+
return dotCase(input, __assign({ delimiter: "_" }, options));
|
|
599
|
+
}
|
|
600
|
+
|
|
492
601
|
var __defProp$3X = Object.defineProperty;
|
|
493
602
|
var __defProps$2n = Object.defineProperties;
|
|
494
603
|
var __getOwnPropDescs$2n = Object.getOwnPropertyDescriptors;
|