@esri/solutions-components 0.7.52 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/consent-manager/resources.json +12 -0
- package/dist/assets/t9n/consent-manager/resources_en.json +12 -0
- package/dist/cjs/{_commonjsHelpers-384729db.js → _commonjsHelpers-480c2e77.js} +16 -0
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +3 -3
- package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -3
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +3 -3
- package/dist/cjs/calcite-alert_4.cjs.entry.js +4 -4
- package/dist/cjs/calcite-color-picker-hex-input_2.cjs.entry.js +2 -2
- package/dist/cjs/calcite-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/calcite-combobox_5.cjs.entry.js +3 -3
- package/dist/cjs/calcite-flow_5.cjs.entry.js +4 -4
- package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +5 -5
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
- package/dist/cjs/card-manager_3.cjs.entry.js +6 -6
- package/dist/cjs/{common-4cd3537b.js → common-e6e9f7d6.js} +1 -1
- package/dist/cjs/consent-manager.cjs.entry.js +1779 -0
- package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -3
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +3 -3
- package/dist/cjs/{downloadUtils-82bc9a04.js → downloadUtils-c2bd7c80.js} +6 -6
- package/dist/cjs/{esri-loader-a91c0ec1.js → esri-loader-ce6c3d3d.js} +1 -1
- package/dist/cjs/{helpers-e328869d.js → helpers-81779c18.js} +1 -1
- package/dist/cjs/{html2canvas-34208bbf.js → html2canvas-27a2547c.js} +1 -1
- package/dist/cjs/{index.es-79d8773c.js → index.es-22b3d1a2.js} +6 -6
- package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-export.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-header.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -7
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +7 -7
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-popover.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +5 -5
- package/dist/cjs/instant-apps-splash.cjs.entry.js +5 -5
- package/dist/cjs/{languageSwitcher-7de41e17.js → languageSwitcher-4822684b.js} +1 -1
- package/dist/cjs/{languageUtil-a3b464f8.js → languageUtil-9bd00bad.js} +1 -1
- package/dist/cjs/layout-manager.cjs.entry.js +3 -3
- package/dist/cjs/{loadModules-51c30ab9.js → loadModules-69fc5b98.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-8c42ba7a.js → locale-3d0a4bc2.js} +1 -1
- package/dist/cjs/{locale-dab3f46a.js → locale-3e33f44c.js} +2 -2
- package/dist/cjs/map-select-tools_3.cjs.entry.js +6 -6
- package/dist/cjs/{popupUtils-824d2f7c.js → popupUtils-6be3588c.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +6 -6
- package/dist/cjs/{purify-f8c3e427.js → purify-4791ecca.js} +1 -1
- package/dist/cjs/{resources-adfcb1ec.js → resources-02142b99.js} +1 -1
- package/dist/cjs/{restHelpersGet-e0737480.js → restHelpersGet-2ed729ab.js} +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +6 -6
- package/dist/cjs/solution-contents_3.cjs.entry.js +7 -7
- package/dist/cjs/{solution-resource-abec7452.js → solution-resource-97186521.js} +1 -1
- package/dist/cjs/{solution-store-2f7fbcc5.js → solution-store-67bcf552.js} +2 -2
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +5 -5
- package/dist/cjs/{utils-a137dc1a.js → utils-ea7a5a63.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/consent-manager/consent-manager.css +67 -0
- package/dist/collection/components/consent-manager/consent-manager.js +287 -0
- package/dist/collection/components/consent-manager/test/consent-manager.e2e.js +29 -0
- package/dist/collection/components/consent-manager/test/consent-manager.spec.js +37 -0
- package/dist/collection/utils/interfaces.ts +4 -0
- package/dist/components/_commonjsHelpers.js +16 -1
- package/dist/components/consent-manager.d.ts +11 -0
- package/dist/components/consent-manager.js +1854 -0
- package/dist/components/downloadUtils.js +1 -1
- package/dist/components/index.es.js +1 -1
- package/dist/esm/{_commonjsHelpers-d5f9d613.js → _commonjsHelpers-0f74c230.js} +16 -1
- package/dist/esm/basemap-gallery_7.entry.js +3 -3
- package/dist/esm/buffer-tools_3.entry.js +3 -3
- package/dist/esm/calcite-action-pad_2.entry.js +3 -3
- package/dist/esm/calcite-alert_4.entry.js +4 -4
- package/dist/esm/calcite-color-picker-hex-input_2.entry.js +2 -2
- package/dist/esm/calcite-color-picker.entry.js +2 -2
- package/dist/esm/calcite-combobox_5.entry.js +3 -3
- package/dist/esm/calcite-flow_5.entry.js +4 -4
- package/dist/esm/calcite-input-date-picker_3.entry.js +5 -5
- package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
- package/dist/esm/card-manager_3.entry.js +6 -6
- package/dist/esm/{common-d04ccc0d.js → common-06bcfe81.js} +1 -1
- package/dist/esm/consent-manager.entry.js +1775 -0
- package/dist/esm/crowdsource-manager.entry.js +3 -3
- package/dist/esm/crowdsource-reporter.entry.js +3 -3
- package/dist/esm/{downloadUtils-3bab4b5f.js → downloadUtils-a6c0e25f.js} +6 -6
- package/dist/esm/{esri-loader-eda07632.js → esri-loader-1b324844.js} +1 -1
- package/dist/esm/{helpers-633917fe.js → helpers-aeddac74.js} +1 -1
- package/dist/esm/{html2canvas-a0a4df55.js → html2canvas-7f5bb1cc.js} +1 -1
- package/dist/esm/{index.es-be703f2b.js → index.es-b0a676ae.js} +6 -6
- package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +6 -6
- package/dist/esm/instant-apps-control-panel.entry.js +3 -3
- package/dist/esm/instant-apps-export.entry.js +5 -5
- package/dist/esm/instant-apps-header.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend.entry.js +6 -6
- package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +5 -5
- package/dist/esm/instant-apps-language-switcher.entry.js +7 -7
- package/dist/esm/instant-apps-language-translator.entry.js +7 -7
- package/dist/esm/instant-apps-measurement.entry.js +5 -5
- package/dist/esm/instant-apps-popover.entry.js +5 -5
- package/dist/esm/instant-apps-scoreboard.entry.js +5 -5
- package/dist/esm/instant-apps-splash.entry.js +5 -5
- package/dist/esm/{languageSwitcher-62232826.js → languageSwitcher-4faa659f.js} +1 -1
- package/dist/esm/{languageUtil-8b54477c.js → languageUtil-dc3111c1.js} +1 -1
- package/dist/esm/layout-manager.entry.js +3 -3
- package/dist/esm/{loadModules-b677d6d7.js → loadModules-877bbb89.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-25a5ae3e.js → locale-bcbea4ef.js} +1 -1
- package/dist/esm/{locale-c7d9e9aa.js → locale-bd9034e1.js} +2 -2
- package/dist/esm/map-select-tools_3.entry.js +6 -6
- package/dist/esm/{popupUtils-23fe3c9f.js → popupUtils-af124b47.js} +1 -1
- package/dist/esm/public-notification.entry.js +6 -6
- package/dist/esm/{purify-c99d2ace.js → purify-dce4d86b.js} +1 -1
- package/dist/esm/{resources-79914606.js → resources-61b0cdad.js} +1 -1
- package/dist/esm/{restHelpersGet-af032ab2.js → restHelpersGet-2a85d395.js} +1 -1
- package/dist/esm/solution-configuration.entry.js +6 -6
- package/dist/esm/solution-contents_3.entry.js +7 -7
- package/dist/esm/{solution-resource-7b8d302d.js → solution-resource-77aa99c8.js} +1 -1
- package/dist/esm/{solution-store-01769bbf.js → solution-store-13ddaf1c.js} +2 -2
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +5 -5
- package/dist/esm/{utils-b46c535b.js → utils-28d0a086.js} +1 -1
- package/dist/solutions-components/{p-54b7b859.entry.js → p-015a45e2.entry.js} +1 -1
- package/dist/solutions-components/{p-b756d01f.js → p-03037cf9.js} +1 -1
- package/dist/solutions-components/{p-2917dae0.entry.js → p-03a65871.entry.js} +1 -1
- package/dist/solutions-components/{p-86b21da1.js → p-07626c45.js} +1 -1
- package/dist/solutions-components/{p-14a48b14.js → p-090e0241.js} +1 -1
- package/dist/solutions-components/{p-531ccf84.entry.js → p-09312a7a.entry.js} +1 -1
- package/dist/solutions-components/{p-8595b4aa.entry.js → p-09801ba6.entry.js} +1 -1
- package/dist/solutions-components/{p-2f017ad2.entry.js → p-0d72a9ca.entry.js} +1 -1
- package/dist/solutions-components/{p-bb94c414.entry.js → p-104f07e3.entry.js} +1 -1
- package/dist/solutions-components/p-131bcc7f.entry.js +6 -0
- package/dist/solutions-components/{p-2592e0dd.js → p-188ed8b6.js} +1 -1
- package/dist/solutions-components/{p-16a82c20.js → p-192b6455.js} +1 -1
- package/dist/solutions-components/{p-7cfc4ba5.entry.js → p-1a7cef7b.entry.js} +1 -1
- package/dist/solutions-components/{p-463712ef.entry.js → p-1ac2125a.entry.js} +2 -2
- package/dist/solutions-components/{p-23fed594.entry.js → p-1bca71bf.entry.js} +1 -1
- package/dist/solutions-components/{p-ce4eed51.entry.js → p-220c46c2.entry.js} +1 -1
- package/dist/solutions-components/{p-c8ca9b8c.entry.js → p-299d1eaf.entry.js} +3 -3
- package/dist/solutions-components/{p-7cfce9ee.entry.js → p-2e7a9b9b.entry.js} +2 -2
- package/dist/solutions-components/{p-df468e80.entry.js → p-35c9256b.entry.js} +2 -2
- package/dist/solutions-components/{p-d561c970.entry.js → p-41bc9e9d.entry.js} +1 -1
- package/dist/solutions-components/{p-4742efa8.entry.js → p-5a28d60c.entry.js} +1 -1
- package/dist/solutions-components/{p-e46617d1.entry.js → p-5c7e3941.entry.js} +1 -1
- package/dist/solutions-components/{p-8dbf3319.entry.js → p-63466518.entry.js} +1 -1
- package/dist/solutions-components/{p-c05467fd.entry.js → p-6512dc44.entry.js} +1 -1
- package/dist/solutions-components/{p-0f66fd89.js → p-66bca043.js} +3 -3
- package/dist/solutions-components/{p-a8a0187d.js → p-70359c2b.js} +1 -1
- package/dist/solutions-components/{p-91d3732f.js → p-734d1dc5.js} +1 -1
- package/dist/solutions-components/{p-de459c0a.entry.js → p-7d6ee026.entry.js} +1 -1
- package/dist/solutions-components/{p-91710f0e.entry.js → p-8ad937b4.entry.js} +1 -1
- package/dist/solutions-components/{p-d918ec36.js → p-8ddc7786.js} +1 -1
- package/dist/solutions-components/p-8e9f96db.js +6 -0
- package/dist/solutions-components/{p-220ec0d1.js → p-94c634ba.js} +1 -1
- package/dist/solutions-components/{p-e2b0b3fa.entry.js → p-a2544cba.entry.js} +1 -1
- package/dist/solutions-components/{p-3cf84035.entry.js → p-a455c3f0.entry.js} +1 -1
- package/dist/solutions-components/{p-044cd52c.entry.js → p-a59078ee.entry.js} +1 -1
- package/dist/solutions-components/{p-701ed205.js → p-a7b7f8d1.js} +1 -1
- package/dist/solutions-components/{p-96104375.entry.js → p-aec4441b.entry.js} +1 -1
- package/dist/solutions-components/{p-d9995b7e.js → p-b41e2c4c.js} +3 -3
- package/dist/solutions-components/{p-d89fff3a.js → p-b503d01d.js} +1 -1
- package/dist/solutions-components/{p-cacd0307.entry.js → p-b80bc5b9.entry.js} +1 -1
- package/dist/solutions-components/{p-b04c9dc3.js → p-be8ef276.js} +1 -1
- package/dist/solutions-components/{p-6ac459d9.entry.js → p-c10b44ee.entry.js} +1 -1
- package/dist/solutions-components/{p-88cd4a24.entry.js → p-c302bbea.entry.js} +1 -1
- package/dist/solutions-components/{p-547b4dba.entry.js → p-c375881a.entry.js} +1 -1
- package/dist/solutions-components/{p-e05b02c5.entry.js → p-cd1ca3a6.entry.js} +1 -1
- package/dist/solutions-components/{p-3cce003d.js → p-cde1d741.js} +1 -1
- package/dist/solutions-components/{p-ccfdd890.entry.js → p-cfe890f6.entry.js} +1 -1
- package/dist/solutions-components/{p-a4bb0787.entry.js → p-df29f4c2.entry.js} +1 -1
- package/dist/solutions-components/p-e2d0ad1b.js +6 -0
- package/dist/solutions-components/{p-bf9e18d4.js → p-eab00813.js} +1 -1
- package/dist/solutions-components/{p-e8cd89c2.entry.js → p-efe1694a.entry.js} +1 -1
- package/dist/solutions-components/{p-697e9e11.entry.js → p-f3467807.entry.js} +1 -1
- package/dist/solutions-components/{p-3cb1de38.entry.js → p-f6be44e6.entry.js} +1 -1
- package/dist/solutions-components/{p-f23e6499.js → p-fb7a5f6e.js} +2 -2
- package/dist/solutions-components/{p-dbb6f1e2.entry.js → p-ff302d95.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +4 -0
- package/dist/types/components/consent-manager/consent-manager.d.ts +115 -0
- package/dist/types/components.d.ts +62 -2
- package/dist/types/preact.d.ts +4 -0
- package/dist/types/utils/interfaces.d.ts +3 -0
- package/package.json +5 -2
- package/dist/solutions-components/p-00f9774c.js +0 -6
- package/dist/solutions-components/p-e1a4994d.js +0 -6
@@ -8,11 +8,11 @@
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
9
9
|
|
10
10
|
const index = require('./index-105cf2b9.js');
|
11
|
-
const locale = require('./locale-
|
12
|
-
const common = require('./common-
|
13
|
-
require('./esri-loader-
|
14
|
-
require('./_commonjsHelpers-
|
15
|
-
require('./solution-resource-
|
11
|
+
const locale = require('./locale-3d0a4bc2.js');
|
12
|
+
const common = require('./common-e6e9f7d6.js');
|
13
|
+
require('./esri-loader-ce6c3d3d.js');
|
14
|
+
require('./_commonjsHelpers-480c2e77.js');
|
15
|
+
require('./solution-resource-97186521.js');
|
16
16
|
require('./index-f64944ad.js');
|
17
17
|
require('./interfaces-7cd0a48a.js');
|
18
18
|
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"components/basemap-gallery/basemap-gallery.js",
|
5
5
|
"components/buffer-tools/buffer-tools.js",
|
6
6
|
"components/card-manager/card-manager.js",
|
7
|
+
"components/consent-manager/consent-manager.js",
|
7
8
|
"components/create-feature/create-feature.js",
|
8
9
|
"components/crowdsource-manager/crowdsource-manager.js",
|
9
10
|
"components/crowdsource-reporter/crowdsource-reporter.js",
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2024 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
:host {
|
18
|
+
display: block;
|
19
|
+
}
|
20
|
+
|
21
|
+
.consent-panel {
|
22
|
+
position: fixed;
|
23
|
+
display: block;
|
24
|
+
z-index: 5000;
|
25
|
+
bottom: 0;
|
26
|
+
left: 0;
|
27
|
+
width: 100%;
|
28
|
+
height: auto;
|
29
|
+
text-align: center;
|
30
|
+
}
|
31
|
+
|
32
|
+
.cookie-consent-popup-container {
|
33
|
+
position: relative;
|
34
|
+
display: block;
|
35
|
+
bottom: 0;
|
36
|
+
left: 0;
|
37
|
+
width: 100%;
|
38
|
+
margin: 0;
|
39
|
+
padding-top: 1rem;
|
40
|
+
padding-bottom: 1rem;
|
41
|
+
transition: transform 0.5s ease-out 0s;
|
42
|
+
background-color: rgba(51, 51, 51, 0.95);
|
43
|
+
color: #fff;
|
44
|
+
}
|
45
|
+
|
46
|
+
.button-container {
|
47
|
+
position: static;
|
48
|
+
margin-bottom: 1rem;
|
49
|
+
display: flex;
|
50
|
+
justify-content: center;
|
51
|
+
flex-wrap: wrap;
|
52
|
+
}
|
53
|
+
|
54
|
+
.padding-end-1 {
|
55
|
+
padding-inline-end: 1rem;
|
56
|
+
}
|
57
|
+
|
58
|
+
.link-text {
|
59
|
+
/* 1.0 vars*/
|
60
|
+
--calcite-ui-text-link: var(--calcite-color-text-inverse);
|
61
|
+
--calcite-ui-brand: var(--calcite-color-text-inverse);
|
62
|
+
|
63
|
+
/* 2.0 vars */
|
64
|
+
--calcite-color-text-link: var(--calcite-color-text-inverse);
|
65
|
+
--calcite-color-brand-underline: var(--calcite-color-text-inverse);
|
66
|
+
--calcite-color-brand: var(--calcite-color-text-inverse);
|
67
|
+
}
|
@@ -0,0 +1,287 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
/** @license
|
7
|
+
* Copyright 2024 Esri
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
import { Host, h } from "@stencil/core";
|
22
|
+
import { getLocaleComponentStrings } from "../../utils/locale";
|
23
|
+
import { Telemetry } from "@esri/telemetry";
|
24
|
+
import { GoogleAnalytics } from "@esri/telemetry-google-analytics";
|
25
|
+
export class ConsentManager {
|
26
|
+
constructor() {
|
27
|
+
//--------------------------------------------------------------------------
|
28
|
+
//
|
29
|
+
// Properties (protected)
|
30
|
+
//
|
31
|
+
//--------------------------------------------------------------------------
|
32
|
+
/**
|
33
|
+
* boolean: When true the user has granted consent and the telemetry instance will be avaliable
|
34
|
+
*/
|
35
|
+
this._consentGranted = false;
|
36
|
+
/**
|
37
|
+
* boolean: When true the telemetry instance has been loaded
|
38
|
+
*/
|
39
|
+
this._loaded = false;
|
40
|
+
this.firstUseVar = undefined;
|
41
|
+
this.measurementIds = undefined;
|
42
|
+
this.portal = undefined;
|
43
|
+
this._shouldRender = undefined;
|
44
|
+
this._translations = undefined;
|
45
|
+
}
|
46
|
+
//--------------------------------------------------------------------------
|
47
|
+
//
|
48
|
+
// Watch handlers
|
49
|
+
//
|
50
|
+
//--------------------------------------------------------------------------
|
51
|
+
//--------------------------------------------------------------------------
|
52
|
+
//
|
53
|
+
// Methods (public)
|
54
|
+
//
|
55
|
+
//--------------------------------------------------------------------------
|
56
|
+
/**
|
57
|
+
* Initialize and return the telemetry instance if consent has been granted
|
58
|
+
*/
|
59
|
+
async getInstance() {
|
60
|
+
if (localStorage.getItem(this.firstUseVar) === "true") {
|
61
|
+
await this._init();
|
62
|
+
return this._telemetryInstance;
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
return undefined;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
//--------------------------------------------------------------------------
|
69
|
+
//
|
70
|
+
// Functions (lifecycle)
|
71
|
+
//
|
72
|
+
//--------------------------------------------------------------------------
|
73
|
+
/**
|
74
|
+
* StencilJS: Called once just after the component is first connected to the DOM.
|
75
|
+
*
|
76
|
+
* @returns Promise when complete
|
77
|
+
*/
|
78
|
+
async componentWillLoad() {
|
79
|
+
await this._getTranslations();
|
80
|
+
this._shouldRender = localStorage.getItem(this.firstUseVar) === null;
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Renders the component.
|
84
|
+
*/
|
85
|
+
render() {
|
86
|
+
return this._shouldRender ? (h(Host, null, h("calcite-panel", { class: "consent-panel calcite-mode-dark", id: "cookie-policy" }, h("div", { class: "cookie-consent-popup-container" }, h("div", { id: "cookie-policy-description-top", tabindex: "-1" }, h("p", null, this._translations.dearVisitor), h("p", null, this._translations.useAnalytics)), h("div", { class: "button-container" }, h("calcite-button", { appearance: "solid", class: "padding-end-1", kind: "brand", onClick: () => this._refuse() }, this._translations.refuseAnalytics), h("calcite-button", { appearance: "solid", kind: "brand", onClick: () => this._accept() }, this._translations.acceptAnalytics)), h("div", null, h("p", null, this._translations.moreInfo, "\u00A0", h("calcite-link", { class: "link-text", href: "https://www.arcgis.com/", rel: "noopener noreferrer", target: "_blank" }, this._translations.protectionPolicy), this._translations.our, "\u00A0", h("calcite-link", { class: "link-text", href: "https://www.arcgis.com/", rel: "noopener noreferrer", target: "_blank" }, this._translations.cookiePolicy, "\u00A0"), this._translations.andOur, "\u00A0", h("calcite-link", { class: "link-text", href: "https://www.arcgis.com/", rel: "noopener noreferrer", target: "_blank" }, this._translations.cookiesInventory))))))) : undefined;
|
87
|
+
}
|
88
|
+
/**
|
89
|
+
* Called once after the component is loaded
|
90
|
+
*
|
91
|
+
* @returns Promise when complete
|
92
|
+
*/
|
93
|
+
async componentDidLoad() {
|
94
|
+
this.consentGranted.emit({
|
95
|
+
granted: localStorage.getItem(this.firstUseVar) === "true"
|
96
|
+
});
|
97
|
+
}
|
98
|
+
//--------------------------------------------------------------------------
|
99
|
+
//
|
100
|
+
// Functions (protected)
|
101
|
+
//
|
102
|
+
//--------------------------------------------------------------------------
|
103
|
+
/**
|
104
|
+
* Fetches the component's translations
|
105
|
+
*
|
106
|
+
* @returns Promise when complete
|
107
|
+
* @protected
|
108
|
+
*/
|
109
|
+
async _init() {
|
110
|
+
var _a;
|
111
|
+
if (!this._loaded && ((_a = this.measurementIds) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.portal) {
|
112
|
+
const googleAnalyticsTracker = new GoogleAnalytics({
|
113
|
+
measurementIds: this.measurementIds
|
114
|
+
});
|
115
|
+
this._telemetryInstance = new Telemetry({
|
116
|
+
plugins: [googleAnalyticsTracker],
|
117
|
+
portal: this.portal
|
118
|
+
});
|
119
|
+
await this._telemetryInstance.init();
|
120
|
+
this._loaded = true;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
/**
|
124
|
+
* Store the users granting of consent
|
125
|
+
*
|
126
|
+
* @protected
|
127
|
+
*/
|
128
|
+
_accept() {
|
129
|
+
this._consentGranted = true;
|
130
|
+
this._handleConsent();
|
131
|
+
}
|
132
|
+
/**
|
133
|
+
* Store the users refusal of consent
|
134
|
+
*
|
135
|
+
* @protected
|
136
|
+
*/
|
137
|
+
_refuse() {
|
138
|
+
this._consentGranted = false;
|
139
|
+
this._handleConsent();
|
140
|
+
}
|
141
|
+
/**
|
142
|
+
* Store and emit the users choice for consent
|
143
|
+
*
|
144
|
+
* @protected
|
145
|
+
*/
|
146
|
+
_handleConsent() {
|
147
|
+
this._shouldRender = false;
|
148
|
+
localStorage.setItem(this.firstUseVar, this._consentGranted.toString());
|
149
|
+
this.consentGranted.emit({
|
150
|
+
granted: this._consentGranted
|
151
|
+
});
|
152
|
+
}
|
153
|
+
/**
|
154
|
+
* Fetches the component's translations
|
155
|
+
*
|
156
|
+
* @returns Promise when complete
|
157
|
+
* @protected
|
158
|
+
*/
|
159
|
+
async _getTranslations() {
|
160
|
+
const messages = await getLocaleComponentStrings(this.el);
|
161
|
+
this._translations = messages[0];
|
162
|
+
}
|
163
|
+
static get is() { return "consent-manager"; }
|
164
|
+
static get encapsulation() { return "shadow"; }
|
165
|
+
static get originalStyleUrls() {
|
166
|
+
return {
|
167
|
+
"$": ["consent-manager.css"]
|
168
|
+
};
|
169
|
+
}
|
170
|
+
static get styleUrls() {
|
171
|
+
return {
|
172
|
+
"$": ["consent-manager.css"]
|
173
|
+
};
|
174
|
+
}
|
175
|
+
static get properties() {
|
176
|
+
return {
|
177
|
+
"firstUseVar": {
|
178
|
+
"type": "string",
|
179
|
+
"mutable": false,
|
180
|
+
"complexType": {
|
181
|
+
"original": "string",
|
182
|
+
"resolved": "string",
|
183
|
+
"references": {}
|
184
|
+
},
|
185
|
+
"required": true,
|
186
|
+
"optional": false,
|
187
|
+
"docs": {
|
188
|
+
"tags": [],
|
189
|
+
"text": "string: The name to use for the variable stored in the browsers local storge that\r\nwill keep track of the users choice for consent"
|
190
|
+
},
|
191
|
+
"attribute": "first-use-var",
|
192
|
+
"reflect": false
|
193
|
+
},
|
194
|
+
"measurementIds": {
|
195
|
+
"type": "unknown",
|
196
|
+
"mutable": false,
|
197
|
+
"complexType": {
|
198
|
+
"original": "string[]",
|
199
|
+
"resolved": "string[]",
|
200
|
+
"references": {}
|
201
|
+
},
|
202
|
+
"required": true,
|
203
|
+
"optional": false,
|
204
|
+
"docs": {
|
205
|
+
"tags": [],
|
206
|
+
"text": "string[]: Any ids for the analytics configured to receive events from the telemety instance"
|
207
|
+
}
|
208
|
+
},
|
209
|
+
"portal": {
|
210
|
+
"type": "unknown",
|
211
|
+
"mutable": false,
|
212
|
+
"complexType": {
|
213
|
+
"original": "__esri.Portal",
|
214
|
+
"resolved": "Portal",
|
215
|
+
"references": {
|
216
|
+
"___esri": {
|
217
|
+
"location": "global",
|
218
|
+
"id": "global::___esri"
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
"required": true,
|
223
|
+
"optional": false,
|
224
|
+
"docs": {
|
225
|
+
"tags": [],
|
226
|
+
"text": "esri/portal/Portal: https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html\r\nRequired prop for this component to function"
|
227
|
+
}
|
228
|
+
}
|
229
|
+
};
|
230
|
+
}
|
231
|
+
static get states() {
|
232
|
+
return {
|
233
|
+
"_shouldRender": {},
|
234
|
+
"_translations": {}
|
235
|
+
};
|
236
|
+
}
|
237
|
+
static get events() {
|
238
|
+
return [{
|
239
|
+
"method": "consentGranted",
|
240
|
+
"name": "consentGranted",
|
241
|
+
"bubbles": true,
|
242
|
+
"cancelable": true,
|
243
|
+
"composed": true,
|
244
|
+
"docs": {
|
245
|
+
"tags": [],
|
246
|
+
"text": "Emitted on demand when the user accepts or denies consent"
|
247
|
+
},
|
248
|
+
"complexType": {
|
249
|
+
"original": "IConsentResponse",
|
250
|
+
"resolved": "IConsentResponse",
|
251
|
+
"references": {
|
252
|
+
"IConsentResponse": {
|
253
|
+
"location": "import",
|
254
|
+
"path": "../../utils/interfaces",
|
255
|
+
"id": "src/utils/interfaces.ts::IConsentResponse"
|
256
|
+
}
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}];
|
260
|
+
}
|
261
|
+
static get methods() {
|
262
|
+
return {
|
263
|
+
"getInstance": {
|
264
|
+
"complexType": {
|
265
|
+
"signature": "() => Promise<Telemetry | undefined>",
|
266
|
+
"parameters": [],
|
267
|
+
"references": {
|
268
|
+
"Promise": {
|
269
|
+
"location": "global",
|
270
|
+
"id": "global::Promise"
|
271
|
+
},
|
272
|
+
"Telemetry": {
|
273
|
+
"location": "global",
|
274
|
+
"id": "global::Telemetry"
|
275
|
+
}
|
276
|
+
},
|
277
|
+
"return": "Promise<any>"
|
278
|
+
},
|
279
|
+
"docs": {
|
280
|
+
"text": "Initialize and return the telemetry instance if consent has been granted",
|
281
|
+
"tags": []
|
282
|
+
}
|
283
|
+
}
|
284
|
+
};
|
285
|
+
}
|
286
|
+
static get elementRef() { return "el"; }
|
287
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
/** @license
|
7
|
+
* Copyright 2024 Esri
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
import { newE2EPage } from "@stencil/core/testing";
|
22
|
+
xdescribe('consent-manager', () => {
|
23
|
+
it('renders', async () => {
|
24
|
+
const page = await newE2EPage();
|
25
|
+
await page.setContent('<consent-manager></consent-manager>');
|
26
|
+
const element = await page.find('consent-manager');
|
27
|
+
expect(element).toHaveClass('hydrated');
|
28
|
+
});
|
29
|
+
});
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
/** @license
|
7
|
+
* Copyright 2024 Esri
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
import { newSpecPage } from "@stencil/core/testing";
|
22
|
+
import { ConsentManager } from "../consent-manager";
|
23
|
+
xdescribe('consent-manager', () => {
|
24
|
+
it('renders', async () => {
|
25
|
+
const page = await newSpecPage({
|
26
|
+
components: [ConsentManager],
|
27
|
+
html: `<consent-manager></consent-manager>`,
|
28
|
+
});
|
29
|
+
expect(page.root).toEqualHtml(`
|
30
|
+
<consent-manager>
|
31
|
+
<mock:shadow-root>
|
32
|
+
<slot></slot>
|
33
|
+
</mock:shadow-root>
|
34
|
+
</consent-manager>
|
35
|
+
`);
|
36
|
+
});
|
37
|
+
});
|
@@ -19,8 +19,23 @@ function createCommonjsModule(fn, basedir, module) {
|
|
19
19
|
}, fn(module, module.exports), module.exports;
|
20
20
|
}
|
21
21
|
|
22
|
+
function getAugmentedNamespace(n) {
|
23
|
+
if (n.__esModule) return n;
|
24
|
+
var a = Object.defineProperty({}, '__esModule', {value: true});
|
25
|
+
Object.keys(n).forEach(function (k) {
|
26
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
27
|
+
Object.defineProperty(a, k, d.get ? d : {
|
28
|
+
enumerable: true,
|
29
|
+
get: function () {
|
30
|
+
return n[k];
|
31
|
+
}
|
32
|
+
});
|
33
|
+
});
|
34
|
+
return a;
|
35
|
+
}
|
36
|
+
|
22
37
|
function commonjsRequire () {
|
23
38
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
24
39
|
}
|
25
40
|
|
26
|
-
export { commonjsGlobal as a, commonjsRequire as b, createCommonjsModule as c, getDefaultExportFromCjs as g };
|
41
|
+
export { commonjsGlobal as a, commonjsRequire as b, createCommonjsModule as c, getDefaultExportFromCjs as d, getAugmentedNamespace as g };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface ConsentManager extends Components.ConsentManager, HTMLElement {}
|
4
|
+
export const ConsentManager: {
|
5
|
+
prototype: ConsentManager;
|
6
|
+
new (): ConsentManager;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|