@epigraph/epigraph-std-lib 5.0.0-alpha.14 → 5.0.0-alpha.16
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 +68 -68
- package/dist/Epigraph/epigraph.cjs +1 -1
- package/dist/Epigraph/epigraph.js +94 -126
- package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
- package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
- package/dist/EpigraphLibs/EpigraphAnalytics/consent-plugins/auto-consent-resolver.d.ts +21 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/consent-plugins/one-trust-consent-plugin.d.ts +1 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.d.ts +14 -5
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -1057
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.d.ts +6 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.d.ts +1 -0
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
- package/dist/enums-BSSe4NAs.js +8 -0
- package/dist/enums-PfFMiIoe.cjs +1 -0
- package/dist/epigraph-std-lib.cjs +1 -1
- package/dist/epigraph-std-lib.js +11 -74
- package/dist/epigraphAnalytics-CADAVr-I.cjs +1 -0
- package/dist/epigraphAnalytics-Dv5dGbcW.js +851 -0
- package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
- package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
- package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
- package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
- package/dist/lit--5TUYSGn.js +508 -0
- package/dist/lit-DZtv4Pds.cjs +2 -0
- package/package.json +40 -40
- package/dist/enums-1vqWxJ0i.cjs +0 -1
- package/dist/enums-CvOTKyNu.js +0 -5
- package/dist/lit-element-C3moVMGu.js +0 -524
- package/dist/lit-element-CYaaFRfk.cjs +0 -19
package/README.md
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# INTRODUCTION
|
|
2
|
-
|
|
3
|
-
Epigraph Standard Library or epigraph-std-lib is a collection of standards that we follow across our solutions. The idea is to have a single source of truth across solutions while ensuring that the dependencies are always up to date with the industry standards.
|
|
4
|
-
|
|
5
|
-
### EPIGRAPH
|
|
6
|
-
A global object that must only be initialized once per session and provides some common functionalities across solutions in that session.
|
|
7
|
-
|
|
8
|
-
### EPIGRAPH LIBRARY EXPORTS
|
|
9
|
-
|
|
10
|
-
| Name | Description |
|
|
11
|
-
|---|---|
|
|
12
|
-
| EpigraphBaseSolutionHtmlElement | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
|
|
13
|
-
| EpigraphBaseSolutionLitElement | A base class intended to enforce some common functionalities across our solutions, built by extending the LitElement |
|
|
14
|
-
| EpigraphLogger | A logger class that provides a convenient way for logging info, warning or errors in any given session |
|
|
15
|
-
| EpigraphQrCoreGenerator | A Utility class that allows the generation of a QR code from a give string input |
|
|
16
|
-
| EpigraphUnitsConverter | |
|
|
17
|
-
| EpigraphUrlProcessor | |
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# HOW TO:
|
|
21
|
-
|
|
22
|
-
### Add a new EpigraphLibrary:
|
|
23
|
-
1. Create a new directory under lib/EpigraphLibs/`<MyEpigraphLibrary>`
|
|
24
|
-
2. Create the module file/s. Ensure that the names of these files are in camelCase.
|
|
25
|
-
3. Write a test for this Library under tests/<MyEpigraphLibrary.test.ts>
|
|
26
|
-
4. Add the module that you wish to export as an entry in vite.config.ts > defineConfig > build > entry, similar to other entries in there. This will bundle the new module on build.
|
|
27
|
-
5. Go to package.json:
|
|
28
|
-
- Add the new module entry under exports similar to other entries in that field.
|
|
29
|
-
- Add the new module entry under typesVersions similar to other entries in that field.
|
|
30
|
-
|
|
31
|
-
### Use the library
|
|
32
|
-
This library exports the module into submodules to allow for better tree shaking when bundling the final product. Here is how you can import the submodules individually.
|
|
33
|
-
|
|
34
|
-
```javascript
|
|
35
|
-
// Epigraph Object
|
|
36
|
-
import { Epigraph } from "@epigraph/epigraph-std-lib/dist/Epigraph/epigraph";
|
|
37
|
-
|
|
38
|
-
// Epigraph libs
|
|
39
|
-
import { EpigraphAnalytics } from "@epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics";
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Exported Submodules:
|
|
44
|
-
| Name | Description |
|
|
45
|
-
|---|---|
|
|
46
|
-
| @epigraph/epigraph-std-lib/dist/Epigraph/epigraph | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
|
|
47
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics | An Analytics modules that exports handy ways to log analytics across our solutions |
|
|
48
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphLogger | A Logger modules that exports handy ways to log across our solutions |
|
|
49
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphNexusApi | A Nexus API modules that exports handy ways to interact with the Nexus API across our solutions |
|
|
50
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphQrCodeGenerator | A QR Code generator modules that exports handy ways to generate QR Codes across our solutions |
|
|
51
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphResultFactory | A Result Factory modules that exports handy ways to generate Result objects across our solutions |
|
|
52
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUnitsConverter | A Utility class that allows conversion between different standard unit, including but not limited to Distance, Color, etc. |
|
|
53
|
-
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUrlProcessor | A Utility class that provides various methods to generate, process, manipulate URLs |
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### Write a test:
|
|
57
|
-
We use [vitest](https://vitest.dev/guide/) to write tests in this repository using [happy-dom](https://www.npmjs.com/package/happy-dom) to support some but not all browser functionalities. In order to write a new test:
|
|
58
|
-
|
|
59
|
-
1. Create a new file for a specific test under tests/ as `<MyEpigraphLibrary>`.test.ts
|
|
60
|
-
2. Write a test following the instructions and samples [here](https://vitest.dev/guide/#writing-tests)
|
|
61
|
-
3. Make sure to import the library from "../dist/epigraph-std-lib" to avoid any issues that might come up after bundling.
|
|
62
|
-
4. Open a terminal and execute "npm run test". This will build all the libraries under dist/ and then run tests using those.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
# REFERENCES
|
|
66
|
-
A huge thanks to everyone who inspired the setup for this repository:
|
|
67
|
-
1. [Andreas Riedmuller's Article](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma)
|
|
68
|
-
2. [Vitest Docs](https://vitest.dev/guide/)
|
|
1
|
+
# INTRODUCTION
|
|
2
|
+
|
|
3
|
+
Epigraph Standard Library or epigraph-std-lib is a collection of standards that we follow across our solutions. The idea is to have a single source of truth across solutions while ensuring that the dependencies are always up to date with the industry standards.
|
|
4
|
+
|
|
5
|
+
### EPIGRAPH
|
|
6
|
+
A global object that must only be initialized once per session and provides some common functionalities across solutions in that session.
|
|
7
|
+
|
|
8
|
+
### EPIGRAPH LIBRARY EXPORTS
|
|
9
|
+
|
|
10
|
+
| Name | Description |
|
|
11
|
+
|---|---|
|
|
12
|
+
| EpigraphBaseSolutionHtmlElement | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
|
|
13
|
+
| EpigraphBaseSolutionLitElement | A base class intended to enforce some common functionalities across our solutions, built by extending the LitElement |
|
|
14
|
+
| EpigraphLogger | A logger class that provides a convenient way for logging info, warning or errors in any given session |
|
|
15
|
+
| EpigraphQrCoreGenerator | A Utility class that allows the generation of a QR code from a give string input |
|
|
16
|
+
| EpigraphUnitsConverter | |
|
|
17
|
+
| EpigraphUrlProcessor | |
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# HOW TO:
|
|
21
|
+
|
|
22
|
+
### Add a new EpigraphLibrary:
|
|
23
|
+
1. Create a new directory under lib/EpigraphLibs/`<MyEpigraphLibrary>`
|
|
24
|
+
2. Create the module file/s. Ensure that the names of these files are in camelCase.
|
|
25
|
+
3. Write a test for this Library under tests/<MyEpigraphLibrary.test.ts>
|
|
26
|
+
4. Add the module that you wish to export as an entry in vite.config.ts > defineConfig > build > entry, similar to other entries in there. This will bundle the new module on build.
|
|
27
|
+
5. Go to package.json:
|
|
28
|
+
- Add the new module entry under exports similar to other entries in that field.
|
|
29
|
+
- Add the new module entry under typesVersions similar to other entries in that field.
|
|
30
|
+
|
|
31
|
+
### Use the library
|
|
32
|
+
This library exports the module into submodules to allow for better tree shaking when bundling the final product. Here is how you can import the submodules individually.
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
// Epigraph Object
|
|
36
|
+
import { Epigraph } from "@epigraph/epigraph-std-lib/dist/Epigraph/epigraph";
|
|
37
|
+
|
|
38
|
+
// Epigraph libs
|
|
39
|
+
import { EpigraphAnalytics } from "@epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics";
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Exported Submodules:
|
|
44
|
+
| Name | Description |
|
|
45
|
+
|---|---|
|
|
46
|
+
| @epigraph/epigraph-std-lib/dist/Epigraph/epigraph | A base class intended to enforce some common functionalities across our solutions, built by extending the HTMLElement |
|
|
47
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphAnalytics | An Analytics modules that exports handy ways to log analytics across our solutions |
|
|
48
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphLogger | A Logger modules that exports handy ways to log across our solutions |
|
|
49
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphNexusApi | A Nexus API modules that exports handy ways to interact with the Nexus API across our solutions |
|
|
50
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphQrCodeGenerator | A QR Code generator modules that exports handy ways to generate QR Codes across our solutions |
|
|
51
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphResultFactory | A Result Factory modules that exports handy ways to generate Result objects across our solutions |
|
|
52
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUnitsConverter | A Utility class that allows conversion between different standard unit, including but not limited to Distance, Color, etc. |
|
|
53
|
+
| @epigraph/epigraph-std-lib/dist/EpigraphLibs/epigraphUrlProcessor | A Utility class that provides various methods to generate, process, manipulate URLs |
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Write a test:
|
|
57
|
+
We use [vitest](https://vitest.dev/guide/) to write tests in this repository using [happy-dom](https://www.npmjs.com/package/happy-dom) to support some but not all browser functionalities. In order to write a new test:
|
|
58
|
+
|
|
59
|
+
1. Create a new file for a specific test under tests/ as `<MyEpigraphLibrary>`.test.ts
|
|
60
|
+
2. Write a test following the instructions and samples [here](https://vitest.dev/guide/#writing-tests)
|
|
61
|
+
3. Make sure to import the library from "../dist/epigraph-std-lib" to avoid any issues that might come up after bundling.
|
|
62
|
+
4. Open a terminal and execute "npm run test". This will build all the libraries under dist/ and then run tests using those.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# REFERENCES
|
|
66
|
+
A huge thanks to everyone who inspired the setup for this repository:
|
|
67
|
+
1. [Andreas Riedmuller's Article](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma)
|
|
68
|
+
2. [Vitest Docs](https://vitest.dev/guide/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),t=require("../enums-PfFMiIoe.cjs"),n=require("../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs");var r=class r{constructor(i){if(this._loggerContext=`EPIGRAPH`,this._isReady=!1,this._logger=new e.EpigraphLogger(`EPIGRAPH LOGGER`),this._environment=t.t.DEVELOPMENT,this._activeComponentsInSession=new Map,this._staleComponentsInSession=new Map,this._isSessionWebGL2Compatible=!1,window.epigraph)return window.epigraph.registerActiveComponent(i),window.epigraph;this._isSessionWebGL2Compatible=this._checkIfWebGL2IsAvailable(),window.epigraph=this,window.epigraph.registerActiveComponent(i),this.logBranding(),this._initializer=i,this._environment=this._initializer.environment;let a=this.getLoggerModeNameFromEnvironment();this._logger.setCurrentMode(a),this._urlProcessor=new n.EpigraphUrlProcessor,this.id=r.safeGenerateUuid();let o=this._urlProcessor.getParameterInUrl(n.QUERY_PARAMETER_NAMES.epigraphSessionId);this._epigraphSessionId=o??r.safeGenerateUuid(),this._logger.info({title:`Epigraph Object Ready!!`,details:this,contextOverride:this._loggerContext}),this._isReady=!0}get isReady(){return this._isReady}get logger(){return this._logger}get urlProcessor(){return this._urlProcessor}get epigraphSessionId(){return this._epigraphSessionId}get environment(){return this._environment}get initializer(){return this._initializer}get activeComponentsInSession(){return this._activeComponentsInSession}get staleComponentsInSession(){return this._staleComponentsInSession}isSessionWebGL2Compatible(){return this._isSessionWebGL2Compatible}logBranding(){console.group(`Powered by: `),console.log(`%cEPIGRAPH`,`font-weight: bold; font-size: 50px; text-shadow: 3px 3px 0 rgb(100,100,100)`),console.log(`Visit for more details: www.epigraph.us`),console.groupEnd()}_checkIfWebGL2IsAvailable(){try{let e=document.createElement(`canvas`);return!!(window.WebGL2RenderingContext&&e.getContext(`webgl2`))}catch{return!1}}registerActiveComponent(e){this._activeComponentsInSession.set(e.uuid,e),this._logger.info({title:`Registered a new Active Component`,details:e,contextOverride:this._loggerContext})}deregisterActiveComponent(e){let t=this._activeComponentsInSession.get(e.uuid);t&&(this._staleComponentsInSession.set(t.uuid,t),this._activeComponentsInSession.delete(t.uuid),this._logger.info({title:`Deregistered a new Active Component`,details:e,contextOverride:this._loggerContext}))}getLoggerModeNameFromEnvironment(){let n=e.LoggerModeNames.Dev;return this._environment===t.t.STAGING?n=e.LoggerModeNames.Staging:this._environment===t.t.PRODUCTION&&(n=e.LoggerModeNames.Release),n}static safeGenerateUuid(){let e=``;try{e=crypto.randomUUID()}catch{console.error(`crypto not available. Not generating a UUID`)}return e}static generateXPath(e){let t=``,n=e;for(;n;){let e=1,r=n.previousSibling;for(;r;)r.nodeName===n.nodeName&&e++,r=r.previousSibling;t=`/${n.nodeName.toLowerCase()+(e>1?`[${e}]`:``)}${t}`,n=n.parentNode}return t}};exports.ENVIRONMENT_TYPE=t.t,exports.Epigraph=r;
|
|
@@ -1,127 +1,95 @@
|
|
|
1
|
-
import { EpigraphLogger as
|
|
2
|
-
import {
|
|
3
|
-
import { EpigraphUrlProcessor as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* Generates a random UUID using crypto.randomUUID with a fallback on custom generator,
|
|
94
|
-
* if the first option fails for any reason in an environment.1
|
|
95
|
-
*
|
|
96
|
-
* @returns {string} A random generated ID.
|
|
97
|
-
*/
|
|
98
|
-
static safeGenerateUuid() {
|
|
99
|
-
let e = "";
|
|
100
|
-
try {
|
|
101
|
-
e = crypto.randomUUID();
|
|
102
|
-
} catch {
|
|
103
|
-
console.error("crypto not available. Not generating a UUID");
|
|
104
|
-
}
|
|
105
|
-
return e;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Generates an XPath based on a DOM nodes location on the page.
|
|
109
|
-
*
|
|
110
|
-
* @param {HTMLElement} element The element that we need the XPath for.
|
|
111
|
-
* @returns {string} The generated XPath.
|
|
112
|
-
*/
|
|
113
|
-
static generateXPath(e) {
|
|
114
|
-
let t = "", i = e;
|
|
115
|
-
for (; i; ) {
|
|
116
|
-
let o = 1, n = i.previousSibling;
|
|
117
|
-
for (; n; )
|
|
118
|
-
n.nodeName === i.nodeName && o++, n = n.previousSibling;
|
|
119
|
-
t = `/${i.nodeName.toLowerCase() + (o > 1 ? `[${o}]` : "")}${t}`, i = i.parentNode;
|
|
120
|
-
}
|
|
121
|
-
return t;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
export {
|
|
125
|
-
r as ENVIRONMENT_TYPE,
|
|
126
|
-
a as Epigraph
|
|
1
|
+
import { EpigraphLogger as e, LoggerModeNames as t } from "../EpigraphLibs/EpigraphLogger/epigraphLogger.js";
|
|
2
|
+
import { t as n } from "../enums-BSSe4NAs.js";
|
|
3
|
+
import { EpigraphUrlProcessor as r, QUERY_PARAMETER_NAMES as i } from "../EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
|
|
4
|
+
//#region lib/Epigraph/epigraph.ts
|
|
5
|
+
var a = class a {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
if (this._loggerContext = "EPIGRAPH", this._isReady = !1, this._logger = new e("EPIGRAPH LOGGER"), this._environment = n.DEVELOPMENT, this._activeComponentsInSession = /* @__PURE__ */ new Map(), this._staleComponentsInSession = /* @__PURE__ */ new Map(), this._isSessionWebGL2Compatible = !1, window.epigraph) return window.epigraph.registerActiveComponent(t), window.epigraph;
|
|
8
|
+
this._isSessionWebGL2Compatible = this._checkIfWebGL2IsAvailable(), window.epigraph = this, window.epigraph.registerActiveComponent(t), this.logBranding(), this._initializer = t, this._environment = this._initializer.environment;
|
|
9
|
+
let o = this.getLoggerModeNameFromEnvironment();
|
|
10
|
+
this._logger.setCurrentMode(o), this._urlProcessor = new r(), this.id = a.safeGenerateUuid();
|
|
11
|
+
let s = this._urlProcessor.getParameterInUrl(i.epigraphSessionId);
|
|
12
|
+
this._epigraphSessionId = s ?? a.safeGenerateUuid(), this._logger.info({
|
|
13
|
+
title: "Epigraph Object Ready!!",
|
|
14
|
+
details: this,
|
|
15
|
+
contextOverride: this._loggerContext
|
|
16
|
+
}), this._isReady = !0;
|
|
17
|
+
}
|
|
18
|
+
get isReady() {
|
|
19
|
+
return this._isReady;
|
|
20
|
+
}
|
|
21
|
+
get logger() {
|
|
22
|
+
return this._logger;
|
|
23
|
+
}
|
|
24
|
+
get urlProcessor() {
|
|
25
|
+
return this._urlProcessor;
|
|
26
|
+
}
|
|
27
|
+
get epigraphSessionId() {
|
|
28
|
+
return this._epigraphSessionId;
|
|
29
|
+
}
|
|
30
|
+
get environment() {
|
|
31
|
+
return this._environment;
|
|
32
|
+
}
|
|
33
|
+
get initializer() {
|
|
34
|
+
return this._initializer;
|
|
35
|
+
}
|
|
36
|
+
get activeComponentsInSession() {
|
|
37
|
+
return this._activeComponentsInSession;
|
|
38
|
+
}
|
|
39
|
+
get staleComponentsInSession() {
|
|
40
|
+
return this._staleComponentsInSession;
|
|
41
|
+
}
|
|
42
|
+
isSessionWebGL2Compatible() {
|
|
43
|
+
return this._isSessionWebGL2Compatible;
|
|
44
|
+
}
|
|
45
|
+
logBranding() {
|
|
46
|
+
console.group("Powered by: "), console.log("%cEPIGRAPH", "font-weight: bold; font-size: 50px; text-shadow: 3px 3px 0 rgb(100,100,100)"), console.log("Visit for more details: www.epigraph.us"), console.groupEnd();
|
|
47
|
+
}
|
|
48
|
+
_checkIfWebGL2IsAvailable() {
|
|
49
|
+
try {
|
|
50
|
+
let e = document.createElement("canvas");
|
|
51
|
+
return !!(window.WebGL2RenderingContext && e.getContext("webgl2"));
|
|
52
|
+
} catch {
|
|
53
|
+
return !1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
registerActiveComponent(e) {
|
|
57
|
+
this._activeComponentsInSession.set(e.uuid, e), this._logger.info({
|
|
58
|
+
title: "Registered a new Active Component",
|
|
59
|
+
details: e,
|
|
60
|
+
contextOverride: this._loggerContext
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
deregisterActiveComponent(e) {
|
|
64
|
+
let t = this._activeComponentsInSession.get(e.uuid);
|
|
65
|
+
t && (this._staleComponentsInSession.set(t.uuid, t), this._activeComponentsInSession.delete(t.uuid), this._logger.info({
|
|
66
|
+
title: "Deregistered a new Active Component",
|
|
67
|
+
details: e,
|
|
68
|
+
contextOverride: this._loggerContext
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
getLoggerModeNameFromEnvironment() {
|
|
72
|
+
let e = t.Dev;
|
|
73
|
+
return this._environment === n.STAGING ? e = t.Staging : this._environment === n.PRODUCTION && (e = t.Release), e;
|
|
74
|
+
}
|
|
75
|
+
static safeGenerateUuid() {
|
|
76
|
+
let e = "";
|
|
77
|
+
try {
|
|
78
|
+
e = crypto.randomUUID();
|
|
79
|
+
} catch {
|
|
80
|
+
console.error("crypto not available. Not generating a UUID");
|
|
81
|
+
}
|
|
82
|
+
return e;
|
|
83
|
+
}
|
|
84
|
+
static generateXPath(e) {
|
|
85
|
+
let t = "", n = e;
|
|
86
|
+
for (; n;) {
|
|
87
|
+
let e = 1, r = n.previousSibling;
|
|
88
|
+
for (; r;) r.nodeName === n.nodeName && e++, r = r.previousSibling;
|
|
89
|
+
t = `/${n.nodeName.toLowerCase() + (e > 1 ? `[${e}]` : "")}${t}`, n = n.parentNode;
|
|
90
|
+
}
|
|
91
|
+
return t;
|
|
92
|
+
}
|
|
127
93
|
};
|
|
94
|
+
//#endregion
|
|
95
|
+
export { n as ENVIRONMENT_TYPE, a as Epigraph };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./epigraph.cjs"),t=require("../lit-DZtv4Pds.cjs");var n=class extends HTMLElement{constructor(t,n){super(),this._isReady=!1,this._elementName=`epigraph-base-solution-html`,this._solutionVersion=``,this._loggerContextOverride=`[EPIGRAPH BASE SOLUTION]`,this.attachShadow({mode:`open`}),this.__environment=n,this._solutionVersion=t,this.__xPath=e.Epigraph.generateXPath(this),this.__uuid=e.Epigraph.safeGenerateUuid()??this.__xPath,new e.Epigraph(this),window.epigraph.logger.info({title:`Epigraph Base Solution Ready`,contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this.__environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this.__uuid}get xPath(){return this.__xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}},r=class extends t.t{constructor(t,n){super(),this._isReady=!1,this._elementName=`epigraph-base-solution-lit`,this._solutionVersion=``,this._loggerContextOverride=`[EPIGRAPH BASE SOLUTION]`,this._environment=n,this._solutionVersion=t,this._xPath=e.Epigraph.generateXPath(this),this._uuid=e.Epigraph.safeGenerateUuid()??this._xPath,new e.Epigraph(this),this._isReady=!0,window.epigraph.logger.info({title:`Epigraph Base Solution Ready`,contextOverride:this._loggerContextOverride})}get isReady(){return this._isReady}get environment(){return this._environment}get elementName(){return this._elementName}get solutionVersion(){return this._solutionVersion}get uuid(){return this._uuid}get xPath(){return this._xPath}disconnectedCallback(){window.epigraph.deregisterActiveComponent(this)}};exports.EpigraphBaseSolutionHtmlElement=n,exports.EpigraphBaseSolutionLitElement=r;
|
|
@@ -1,70 +1,62 @@
|
|
|
1
|
-
import { i as s } from "../lit-element-C3moVMGu.js";
|
|
2
1
|
import { Epigraph as e } from "./epigraph.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return this._xPath;
|
|
62
|
-
}
|
|
63
|
-
disconnectedCallback() {
|
|
64
|
-
window.epigraph.deregisterActiveComponent(this);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
h as EpigraphBaseSolutionHtmlElement,
|
|
69
|
-
a as EpigraphBaseSolutionLitElement
|
|
2
|
+
import { t } from "../lit--5TUYSGn.js";
|
|
3
|
+
//#region lib/Epigraph/epigraphBaseSolutions.ts
|
|
4
|
+
var n = class extends HTMLElement {
|
|
5
|
+
constructor(t, n) {
|
|
6
|
+
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-html", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this.attachShadow({ mode: "open" }), this.__environment = n, this._solutionVersion = t, this.__xPath = e.generateXPath(this), this.__uuid = e.safeGenerateUuid() ?? this.__xPath, new e(this), window.epigraph.logger.info({
|
|
7
|
+
title: "Epigraph Base Solution Ready",
|
|
8
|
+
contextOverride: this._loggerContextOverride
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
get isReady() {
|
|
12
|
+
return this._isReady;
|
|
13
|
+
}
|
|
14
|
+
get environment() {
|
|
15
|
+
return this.__environment;
|
|
16
|
+
}
|
|
17
|
+
get elementName() {
|
|
18
|
+
return this._elementName;
|
|
19
|
+
}
|
|
20
|
+
get solutionVersion() {
|
|
21
|
+
return this._solutionVersion;
|
|
22
|
+
}
|
|
23
|
+
get uuid() {
|
|
24
|
+
return this.__uuid;
|
|
25
|
+
}
|
|
26
|
+
get xPath() {
|
|
27
|
+
return this.__xPath;
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
window.epigraph.deregisterActiveComponent(this);
|
|
31
|
+
}
|
|
32
|
+
}, r = class extends t {
|
|
33
|
+
constructor(t, n) {
|
|
34
|
+
super(), this._isReady = !1, this._elementName = "epigraph-base-solution-lit", this._solutionVersion = "", this._loggerContextOverride = "[EPIGRAPH BASE SOLUTION]", this._environment = n, this._solutionVersion = t, this._xPath = e.generateXPath(this), this._uuid = e.safeGenerateUuid() ?? this._xPath, new e(this), this._isReady = !0, window.epigraph.logger.info({
|
|
35
|
+
title: "Epigraph Base Solution Ready",
|
|
36
|
+
contextOverride: this._loggerContextOverride
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
get isReady() {
|
|
40
|
+
return this._isReady;
|
|
41
|
+
}
|
|
42
|
+
get environment() {
|
|
43
|
+
return this._environment;
|
|
44
|
+
}
|
|
45
|
+
get elementName() {
|
|
46
|
+
return this._elementName;
|
|
47
|
+
}
|
|
48
|
+
get solutionVersion() {
|
|
49
|
+
return this._solutionVersion;
|
|
50
|
+
}
|
|
51
|
+
get uuid() {
|
|
52
|
+
return this._uuid;
|
|
53
|
+
}
|
|
54
|
+
get xPath() {
|
|
55
|
+
return this._xPath;
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
window.epigraph.deregisterActiveComponent(this);
|
|
59
|
+
}
|
|
70
60
|
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { n as EpigraphBaseSolutionHtmlElement, r as EpigraphBaseSolutionLitElement };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ConsentSignal = 'granted' | 'denied' | 'unknown';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the visitor's analytics consent from signals the page already exposes, so consent is
|
|
4
|
+
* honored even when no consent plugin was configured (which is the norm for our installs).
|
|
5
|
+
*
|
|
6
|
+
* Signals, in priority order:
|
|
7
|
+
* 1. Google Consent Mode — every major CMP feeds it, making it a single integration point. The
|
|
8
|
+
* resolved state lives at window.google_tag_data.ics; entries carry default/update booleans per
|
|
9
|
+
* category and ics.active distinguishes "consent mode in use" from the implicit-granted state
|
|
10
|
+
* that exists on pages with no consent setup.
|
|
11
|
+
* 2. Known CMP globals, for pages where the CMP blocks the Google stack from loading at all
|
|
12
|
+
* (so ics never exists): Cookiebot, OneTrust.
|
|
13
|
+
*
|
|
14
|
+
* 'unknown' means no signal is present — the caller decides the default.
|
|
15
|
+
*/
|
|
16
|
+
export declare class AutoConsentResolver {
|
|
17
|
+
resolve(): ConsentSignal;
|
|
18
|
+
private readGoogleConsentMode;
|
|
19
|
+
private readCookiebot;
|
|
20
|
+
private readOneTrust;
|
|
21
|
+
}
|