@naturalcycles/internal-web-lib 1.2.1 → 1.2.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/bundle/analyticsClient.js.map +1 -1
- package/bundle/conversionClient.js.map +1 -1
- package/bundle/cookieMonster.js +4 -0
- package/bundle/cookieMonster.js.map +1 -1
- package/dist/analytics/analyticsClient.d.ts +2 -2
- package/dist/cookie-monster/cookie-monster-element.js +4 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { AppError } from '@naturalcycles/js-lib/error';
|
|
|
3
3
|
import type { ErrorData } from '@naturalcycles/js-lib/error';
|
|
4
4
|
import type { CommonLogger } from '@naturalcycles/js-lib/log';
|
|
5
5
|
import type { AnyObject, NumberOfMilliseconds, PositiveInteger, UnixTimestampMillis } from '@naturalcycles/js-lib/types';
|
|
6
|
-
import type { AnalyticsEventListener, ClientId,
|
|
6
|
+
import type { AnalyticsEventListener, ClientId, AnalyticsDistinctId } from '@naturalcycles/shared';
|
|
7
7
|
export type { AnalyticsEventListener } from '@naturalcycles/shared';
|
|
8
8
|
/**
|
|
9
9
|
* Self-hosted analytics event client.
|
|
@@ -151,7 +151,7 @@ export declare class AnalyticsIdentity {
|
|
|
151
151
|
*/
|
|
152
152
|
private memoryEntry;
|
|
153
153
|
private hasRefreshedExpiry;
|
|
154
|
-
getDistinctId():
|
|
154
|
+
getDistinctId(): AnalyticsDistinctId;
|
|
155
155
|
/**
|
|
156
156
|
* The bare (unprefixed) device UUID. Undefined for legacy identities persisted before
|
|
157
157
|
* a device id was stored (their `distinct_id` has no device prefix either).
|
|
@@ -19,6 +19,10 @@ var CookieMonsterElement = class CookieMonsterElement extends HTMLElement {
|
|
|
19
19
|
*/
|
|
20
20
|
static open(options) {
|
|
21
21
|
if (isServerSide()) return;
|
|
22
|
+
if (document.readyState === "loading") {
|
|
23
|
+
document.addEventListener("DOMContentLoaded", () => CookieMonsterElement.open(options), { once: true });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
22
26
|
const element = CookieMonsterElement.getOrCreate(options?.language);
|
|
23
27
|
if (options?.view === CookieMonsterView.settings) element.showSettings();
|
|
24
28
|
else if (options?.view === CookieMonsterView.banner) element.showBanner();
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"version": "1.2.
|
|
45
|
+
"version": "1.2.2",
|
|
46
46
|
"description": "Internal web libraries for Natural Cycles, served via CDN and published from the NCBackend3 monorepo",
|
|
47
47
|
"author": "Natural Cycles Team",
|
|
48
48
|
"license": "UNLICENSED",
|