@cloudscape-design/components-themeable 3.0.196 → 3.0.198
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/styles.scss +1 -85
- package/lib/internal/scss/app-layout/visual-refresh/main.scss +3 -1
- package/lib/internal/template/app-layout/drawer.d.ts +1 -4
- package/lib/internal/template/app-layout/drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer.js +4 -13
- package/lib/internal/template/app-layout/drawer.js.map +1 -1
- package/lib/internal/template/app-layout/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/index.js +4 -15
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/index.js +3 -3
- package/lib/internal/template/app-layout/mobile-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/navigation-panel.d.ts +1 -3
- package/lib/internal/template/app-layout/navigation-panel.d.ts.map +1 -1
- package/lib/internal/template/app-layout/navigation-panel.js +2 -2
- package/lib/internal/template/app-layout/navigation-panel.js.map +1 -1
- package/lib/internal/template/app-layout/notifications/index.d.ts +0 -4
- package/lib/internal/template/app-layout/notifications/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/notifications/index.js +1 -2
- package/lib/internal/template/app-layout/notifications/index.js.map +1 -1
- package/lib/internal/template/app-layout/styles.css.js +26 -38
- package/lib/internal/template/app-layout/styles.scoped.css +34 -109
- package/lib/internal/template/app-layout/styles.selectors.js +26 -38
- package/lib/internal/template/app-layout/tools-and-split-panel.d.ts +1 -8
- package/lib/internal/template/app-layout/tools-and-split-panel.d.ts.map +1 -1
- package/lib/internal/template/app-layout/tools-and-split-panel.js +2 -3
- package/lib/internal/template/app-layout/tools-and-split-panel.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/header.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/header.js +2 -1
- package/lib/internal/template/app-layout/visual-refresh/header.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/notifications.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/notifications.js +2 -1
- package/lib/internal/template/app-layout/visual-refresh/notifications.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +60 -60
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +150 -148
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +60 -60
- package/lib/internal/template/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.js +5 -7
- package/lib/internal/template/flashbar/collapsible-flashbar.js.map +1 -1
- package/lib/internal/template/flashbar/internal/analytics.d.ts.map +1 -1
- package/lib/internal/template/flashbar/internal/analytics.js +5 -3
- package/lib/internal/template/flashbar/internal/analytics.js.map +1 -1
- package/lib/internal/template/internal/base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/base-component/index.js +3 -11
- package/lib/internal/template/internal/base-component/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/init-awsui-versions.d.ts +2 -0
- package/lib/internal/template/internal/base-component/init-awsui-versions.d.ts.map +1 -0
- package/lib/internal/template/internal/base-component/init-awsui-versions.js +15 -0
- package/lib/internal/template/internal/base-component/init-awsui-versions.js.map +1 -0
- package/lib/internal/template/internal/base-component/styles.scoped.css +38 -40
- package/lib/internal/template/internal/environment.d.ts +1 -0
- package/lib/internal/template/internal/environment.js +2 -1
- package/lib/internal/template/internal/hooks/use-base-component/component-metadata.d.ts +3 -0
- package/lib/internal/template/internal/hooks/use-base-component/component-metadata.d.ts.map +1 -0
- package/lib/internal/template/internal/hooks/use-base-component/component-metadata.js +21 -0
- package/lib/internal/template/internal/hooks/use-base-component/component-metadata.js.map +1 -0
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts +0 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.js +3 -28
- package/lib/internal/template/internal/hooks/use-base-component/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-telemetry/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-telemetry/index.js +4 -15
- package/lib/internal/template/internal/hooks/use-telemetry/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-telemetry/telemetry.d.ts +8 -0
- package/lib/internal/template/internal/hooks/use-telemetry/telemetry.d.ts.map +1 -0
- package/lib/internal/template/internal/hooks/use-telemetry/telemetry.js +20 -0
- package/lib/internal/template/internal/hooks/use-telemetry/telemetry.js.map +1 -0
- package/lib/internal/template/internal/metrics/index.d.ts +3 -0
- package/lib/internal/template/internal/metrics/index.d.ts.map +1 -0
- package/lib/internal/template/internal/metrics/index.js +5 -0
- package/lib/internal/template/internal/metrics/index.js.map +1 -0
- package/lib/internal/template/internal/metrics/log-clients.d.ts +39 -0
- package/lib/internal/template/internal/metrics/log-clients.d.ts.map +1 -0
- package/lib/internal/template/internal/metrics/log-clients.js +90 -0
- package/lib/internal/template/internal/metrics/log-clients.js.map +1 -0
- package/lib/internal/template/internal/metrics/metrics-formatters.d.ts +7 -0
- package/lib/internal/template/internal/metrics/metrics-formatters.d.ts.map +1 -0
- package/lib/internal/template/internal/metrics/metrics-formatters.js +36 -0
- package/lib/internal/template/internal/metrics/metrics-formatters.js.map +1 -0
- package/lib/internal/template/internal/{metrics.d.ts → metrics/metrics.d.ts} +11 -18
- package/lib/internal/template/internal/metrics/metrics.d.ts.map +1 -0
- package/lib/internal/template/internal/metrics/metrics.js +95 -0
- package/lib/internal/template/internal/metrics/metrics.js.map +1 -0
- package/lib/internal/template/property-filter/index.d.ts.map +1 -1
- package/lib/internal/template/property-filter/index.js +1 -1
- package/lib/internal/template/property-filter/index.js.map +1 -1
- package/lib/internal/template/segmented-control/styles.css.js +14 -14
- package/lib/internal/template/segmented-control/styles.scoped.css +37 -37
- package/lib/internal/template/segmented-control/styles.selectors.js +14 -14
- package/lib/internal/template/wizard/internal/analytics.d.ts.map +1 -1
- package/lib/internal/template/wizard/internal/analytics.js +5 -3
- package/lib/internal/template/wizard/internal/analytics.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/template/app-layout/toggle-buttons.d.ts +0 -12
- package/lib/internal/template/app-layout/toggle-buttons.d.ts.map +0 -1
- package/lib/internal/template/app-layout/toggle-buttons.js +0 -13
- package/lib/internal/template/app-layout/toggle-buttons.js.map +0 -1
- package/lib/internal/template/internal/hooks/use-previous-frame/index.d.ts +0 -8
- package/lib/internal/template/internal/hooks/use-previous-frame/index.d.ts.map +0 -1
- package/lib/internal/template/internal/hooks/use-previous-frame/index.js +0 -20
- package/lib/internal/template/internal/hooks/use-previous-frame/index.js.map +0 -1
- package/lib/internal/template/internal/metrics.d.ts.map +0 -1
- package/lib/internal/template/internal/metrics.js +0 -177
- package/lib/internal/template/internal/metrics.js.map +0 -1
|
@@ -206,10 +206,10 @@
|
|
|
206
206
|
--color-background-progress-bar-content-in-flash-ka071o:rgba(255, 255, 255, 0.7);
|
|
207
207
|
--color-background-progress-bar-layout-default-teir10:#eaeded;
|
|
208
208
|
--color-background-progress-bar-layout-in-flash-phmfak:rgba(255, 255, 255, 0.25);
|
|
209
|
-
--color-background-segment-active-
|
|
209
|
+
--color-background-segment-active-rod112:#0073bb;
|
|
210
210
|
--color-background-segment-default-bjnpj3:#ffffff;
|
|
211
211
|
--color-background-segment-disabled-gcpwaz:#ffffff;
|
|
212
|
-
--color-background-segment-hover-
|
|
212
|
+
--color-background-segment-hover-eccr37:#ffffff;
|
|
213
213
|
--color-background-status-error-h1a0iq:#fdf3f1;
|
|
214
214
|
--color-background-status-info-yq3r41:#f1faff;
|
|
215
215
|
--color-background-status-success-cvmksn:#f2f8f0;
|
|
@@ -341,9 +341,9 @@
|
|
|
341
341
|
--color-text-notification-default-l83xtb:#fafafa;
|
|
342
342
|
--color-text-pagination-page-number-active-disabled-nidnvc:#545b64;
|
|
343
343
|
--color-text-pagination-page-number-default-xf8q73:#545b64;
|
|
344
|
-
--color-text-segment-active-
|
|
344
|
+
--color-text-segment-active-p9yawx:#ffffff;
|
|
345
345
|
--color-text-segment-default-9k644f:#545b64;
|
|
346
|
-
--color-text-segment-hover-
|
|
346
|
+
--color-text-segment-hover-1lgt1u:#0073bb;
|
|
347
347
|
--color-text-small-5a9rs1:#687078;
|
|
348
348
|
--color-text-status-error-jer77f:#d13212;
|
|
349
349
|
--color-text-status-inactive-2o9czw:#687078;
|
|
@@ -779,10 +779,10 @@
|
|
|
779
779
|
--color-background-progress-bar-content-default-kdvzje:#00a1c9;
|
|
780
780
|
--color-background-progress-bar-content-in-flash-ka071o:#fafafa;
|
|
781
781
|
--color-background-progress-bar-layout-default-teir10:#414750;
|
|
782
|
-
--color-background-segment-active-
|
|
782
|
+
--color-background-segment-active-rod112:#00a1c9;
|
|
783
783
|
--color-background-segment-default-bjnpj3:#2a2e33;
|
|
784
784
|
--color-background-segment-disabled-gcpwaz:#2a2e33;
|
|
785
|
-
--color-background-segment-hover-
|
|
785
|
+
--color-background-segment-hover-eccr37:#2a2e33;
|
|
786
786
|
--color-background-status-error-h1a0iq:#270a11;
|
|
787
787
|
--color-background-status-info-yq3r41:#12293b;
|
|
788
788
|
--color-background-status-success-cvmksn:#172211;
|
|
@@ -889,9 +889,9 @@
|
|
|
889
889
|
--color-text-link-hover-ok01xk:#44b9d6;
|
|
890
890
|
--color-text-pagination-page-number-active-disabled-nidnvc:#d5dbdb;
|
|
891
891
|
--color-text-pagination-page-number-default-xf8q73:#d5dbdb;
|
|
892
|
-
--color-text-segment-active-
|
|
892
|
+
--color-text-segment-active-p9yawx:#1a2029;
|
|
893
893
|
--color-text-segment-default-9k644f:#d5dbdb;
|
|
894
|
-
--color-text-segment-hover-
|
|
894
|
+
--color-text-segment-hover-1lgt1u:#00a1c9;
|
|
895
895
|
--color-text-small-5a9rs1:#95a5a6;
|
|
896
896
|
--color-text-status-error-jer77f:#ff5d64;
|
|
897
897
|
--color-text-status-inactive-2o9czw:#95a5a6;
|
|
@@ -1013,10 +1013,10 @@
|
|
|
1013
1013
|
--color-background-progress-bar-content-default-kdvzje:#00a1c9;
|
|
1014
1014
|
--color-background-progress-bar-content-in-flash-ka071o:#fafafa;
|
|
1015
1015
|
--color-background-progress-bar-layout-default-teir10:#414750;
|
|
1016
|
-
--color-background-segment-active-
|
|
1016
|
+
--color-background-segment-active-rod112:#00a1c9;
|
|
1017
1017
|
--color-background-segment-default-bjnpj3:#2a2e33;
|
|
1018
1018
|
--color-background-segment-disabled-gcpwaz:#2a2e33;
|
|
1019
|
-
--color-background-segment-hover-
|
|
1019
|
+
--color-background-segment-hover-eccr37:#2a2e33;
|
|
1020
1020
|
--color-background-status-error-h1a0iq:#270a11;
|
|
1021
1021
|
--color-background-status-info-yq3r41:#12293b;
|
|
1022
1022
|
--color-background-status-success-cvmksn:#172211;
|
|
@@ -1123,9 +1123,9 @@
|
|
|
1123
1123
|
--color-text-link-hover-ok01xk:#44b9d6;
|
|
1124
1124
|
--color-text-pagination-page-number-active-disabled-nidnvc:#d5dbdb;
|
|
1125
1125
|
--color-text-pagination-page-number-default-xf8q73:#d5dbdb;
|
|
1126
|
-
--color-text-segment-active-
|
|
1126
|
+
--color-text-segment-active-p9yawx:#1a2029;
|
|
1127
1127
|
--color-text-segment-default-9k644f:#d5dbdb;
|
|
1128
|
-
--color-text-segment-hover-
|
|
1128
|
+
--color-text-segment-hover-1lgt1u:#00a1c9;
|
|
1129
1129
|
--color-text-small-5a9rs1:#95a5a6;
|
|
1130
1130
|
--color-text-status-error-jer77f:#ff5d64;
|
|
1131
1131
|
--color-text-status-inactive-2o9czw:#95a5a6;
|
|
@@ -1193,8 +1193,7 @@
|
|
|
1193
1193
|
--color-background-progress-bar-content-default-kdvzje:#0972d3;
|
|
1194
1194
|
--color-background-progress-bar-content-in-flash-ka071o:#ffffff;
|
|
1195
1195
|
--color-background-progress-bar-layout-default-teir10:#e9ebed;
|
|
1196
|
-
--color-background-segment-active-
|
|
1197
|
-
--color-background-segment-hover-p2rkog:#ffffff;
|
|
1196
|
+
--color-background-segment-active-rod112:#0972d3;
|
|
1198
1197
|
--color-background-status-error-h1a0iq:#fff7f7;
|
|
1199
1198
|
--color-background-status-info-yq3r41:#f2f8fd;
|
|
1200
1199
|
--color-background-status-success-cvmksn:#f2fcf3;
|
|
@@ -1314,9 +1313,8 @@
|
|
|
1314
1313
|
--color-text-notification-default-l83xtb:#fbfbfb;
|
|
1315
1314
|
--color-text-pagination-page-number-active-disabled-nidnvc:#9ba7b6;
|
|
1316
1315
|
--color-text-pagination-page-number-default-xf8q73:#414d5c;
|
|
1317
|
-
--color-text-segment-active-o087le:#ffffff;
|
|
1318
1316
|
--color-text-segment-default-9k644f:#414d5c;
|
|
1319
|
-
--color-text-segment-hover-
|
|
1317
|
+
--color-text-segment-hover-1lgt1u:#0972d3;
|
|
1320
1318
|
--color-text-small-5a9rs1:#5f6b7a;
|
|
1321
1319
|
--color-text-status-error-jer77f:#d91515;
|
|
1322
1320
|
--color-text-status-inactive-2o9czw:#5f6b7a;
|
|
@@ -1522,10 +1520,10 @@
|
|
|
1522
1520
|
--color-background-popover-g6qj89:#192534;
|
|
1523
1521
|
--color-background-progress-bar-content-default-kdvzje:#539fe5;
|
|
1524
1522
|
--color-background-progress-bar-layout-default-teir10:#354150;
|
|
1525
|
-
--color-background-segment-active-
|
|
1523
|
+
--color-background-segment-active-rod112:#539fe5;
|
|
1526
1524
|
--color-background-segment-default-bjnpj3:#0f1b2a;
|
|
1527
1525
|
--color-background-segment-disabled-gcpwaz:#0f1b2a;
|
|
1528
|
-
--color-background-segment-hover-
|
|
1526
|
+
--color-background-segment-hover-eccr37:#0f1b2a;
|
|
1529
1527
|
--color-background-status-error-h1a0iq:#1a0000;
|
|
1530
1528
|
--color-background-status-info-yq3r41:#00142b;
|
|
1531
1529
|
--color-background-status-success-cvmksn:#001a02;
|
|
@@ -1640,9 +1638,9 @@
|
|
|
1640
1638
|
--color-text-link-primary-underline-xq4vik:#539fe5;
|
|
1641
1639
|
--color-text-pagination-page-number-active-disabled-nidnvc:#5f6b7a;
|
|
1642
1640
|
--color-text-pagination-page-number-default-xf8q73:#9ba7b6;
|
|
1643
|
-
--color-text-segment-active-
|
|
1641
|
+
--color-text-segment-active-p9yawx:#000716;
|
|
1644
1642
|
--color-text-segment-default-9k644f:#d1d5db;
|
|
1645
|
-
--color-text-segment-hover-
|
|
1643
|
+
--color-text-segment-hover-1lgt1u:#539fe5;
|
|
1646
1644
|
--color-text-small-5a9rs1:#8d99a8;
|
|
1647
1645
|
--color-text-status-error-jer77f:#eb6f6f;
|
|
1648
1646
|
--color-text-status-inactive-2o9czw:#8d99a8;
|
|
@@ -1736,10 +1734,10 @@
|
|
|
1736
1734
|
--color-background-progress-bar-content-default-kdvzje:#539fe5;
|
|
1737
1735
|
--color-background-progress-bar-content-in-flash-ka071o:#ffffff;
|
|
1738
1736
|
--color-background-progress-bar-layout-default-teir10:#354150;
|
|
1739
|
-
--color-background-segment-active-
|
|
1737
|
+
--color-background-segment-active-rod112:#539fe5;
|
|
1740
1738
|
--color-background-segment-default-bjnpj3:#0f1b2a;
|
|
1741
1739
|
--color-background-segment-disabled-gcpwaz:#0f1b2a;
|
|
1742
|
-
--color-background-segment-hover-
|
|
1740
|
+
--color-background-segment-hover-eccr37:#0f1b2a;
|
|
1743
1741
|
--color-background-status-error-h1a0iq:#1a0000;
|
|
1744
1742
|
--color-background-status-info-yq3r41:#00142b;
|
|
1745
1743
|
--color-background-status-success-cvmksn:#001a02;
|
|
@@ -1857,9 +1855,9 @@
|
|
|
1857
1855
|
--color-text-link-primary-underline-xq4vik:#539fe5;
|
|
1858
1856
|
--color-text-pagination-page-number-active-disabled-nidnvc:#5f6b7a;
|
|
1859
1857
|
--color-text-pagination-page-number-default-xf8q73:#9ba7b6;
|
|
1860
|
-
--color-text-segment-active-
|
|
1858
|
+
--color-text-segment-active-p9yawx:#000716;
|
|
1861
1859
|
--color-text-segment-default-9k644f:#d1d5db;
|
|
1862
|
-
--color-text-segment-hover-
|
|
1860
|
+
--color-text-segment-hover-1lgt1u:#539fe5;
|
|
1863
1861
|
--color-text-small-5a9rs1:#8d99a8;
|
|
1864
1862
|
--color-text-status-error-jer77f:#eb6f6f;
|
|
1865
1863
|
--color-text-status-inactive-2o9czw:#8d99a8;
|
|
@@ -1913,10 +1911,10 @@
|
|
|
1913
1911
|
--color-background-popover-g6qj89:#192534;
|
|
1914
1912
|
--color-background-progress-bar-content-default-kdvzje:#539fe5;
|
|
1915
1913
|
--color-background-progress-bar-layout-default-teir10:#354150;
|
|
1916
|
-
--color-background-segment-active-
|
|
1914
|
+
--color-background-segment-active-rod112:#539fe5;
|
|
1917
1915
|
--color-background-segment-default-bjnpj3:#0f1b2a;
|
|
1918
1916
|
--color-background-segment-disabled-gcpwaz:#0f1b2a;
|
|
1919
|
-
--color-background-segment-hover-
|
|
1917
|
+
--color-background-segment-hover-eccr37:#0f1b2a;
|
|
1920
1918
|
--color-background-status-error-h1a0iq:#1a0000;
|
|
1921
1919
|
--color-background-status-info-yq3r41:#00142b;
|
|
1922
1920
|
--color-background-status-success-cvmksn:#001a02;
|
|
@@ -2031,9 +2029,9 @@
|
|
|
2031
2029
|
--color-text-link-primary-underline-xq4vik:#539fe5;
|
|
2032
2030
|
--color-text-pagination-page-number-active-disabled-nidnvc:#5f6b7a;
|
|
2033
2031
|
--color-text-pagination-page-number-default-xf8q73:#9ba7b6;
|
|
2034
|
-
--color-text-segment-active-
|
|
2032
|
+
--color-text-segment-active-p9yawx:#000716;
|
|
2035
2033
|
--color-text-segment-default-9k644f:#d1d5db;
|
|
2036
|
-
--color-text-segment-hover-
|
|
2034
|
+
--color-text-segment-hover-1lgt1u:#539fe5;
|
|
2037
2035
|
--color-text-small-5a9rs1:#8d99a8;
|
|
2038
2036
|
--color-text-status-error-jer77f:#eb6f6f;
|
|
2039
2037
|
--color-text-status-inactive-2o9czw:#8d99a8;
|
|
@@ -2087,10 +2085,10 @@
|
|
|
2087
2085
|
--color-background-popover-g6qj89:#192534;
|
|
2088
2086
|
--color-background-progress-bar-content-default-kdvzje:#539fe5;
|
|
2089
2087
|
--color-background-progress-bar-layout-default-teir10:#354150;
|
|
2090
|
-
--color-background-segment-active-
|
|
2088
|
+
--color-background-segment-active-rod112:#539fe5;
|
|
2091
2089
|
--color-background-segment-default-bjnpj3:#000716;
|
|
2092
2090
|
--color-background-segment-disabled-gcpwaz:#000716;
|
|
2093
|
-
--color-background-segment-hover-
|
|
2091
|
+
--color-background-segment-hover-eccr37:#000716;
|
|
2094
2092
|
--color-background-status-error-h1a0iq:#1a0000;
|
|
2095
2093
|
--color-background-status-info-yq3r41:#00142b;
|
|
2096
2094
|
--color-background-status-success-cvmksn:#001a02;
|
|
@@ -2204,9 +2202,9 @@
|
|
|
2204
2202
|
--color-text-link-primary-underline-xq4vik:#539fe5;
|
|
2205
2203
|
--color-text-pagination-page-number-active-disabled-nidnvc:#5f6b7a;
|
|
2206
2204
|
--color-text-pagination-page-number-default-xf8q73:#9ba7b6;
|
|
2207
|
-
--color-text-segment-active-
|
|
2205
|
+
--color-text-segment-active-p9yawx:#000716;
|
|
2208
2206
|
--color-text-segment-default-9k644f:#d1d5db;
|
|
2209
|
-
--color-text-segment-hover-
|
|
2207
|
+
--color-text-segment-hover-1lgt1u:#539fe5;
|
|
2210
2208
|
--color-text-small-5a9rs1:#8d99a8;
|
|
2211
2209
|
--color-text-status-error-jer77f:#eb6f6f;
|
|
2212
2210
|
--color-text-status-inactive-2o9czw:#8d99a8;
|
|
@@ -2271,10 +2269,10 @@
|
|
|
2271
2269
|
--color-background-popover-g6qj89:#192534;
|
|
2272
2270
|
--color-background-progress-bar-content-default-kdvzje:#539fe5;
|
|
2273
2271
|
--color-background-progress-bar-layout-default-teir10:#354150;
|
|
2274
|
-
--color-background-segment-active-
|
|
2272
|
+
--color-background-segment-active-rod112:#539fe5;
|
|
2275
2273
|
--color-background-segment-default-bjnpj3:#000716;
|
|
2276
2274
|
--color-background-segment-disabled-gcpwaz:#000716;
|
|
2277
|
-
--color-background-segment-hover-
|
|
2275
|
+
--color-background-segment-hover-eccr37:#000716;
|
|
2278
2276
|
--color-background-status-error-h1a0iq:#1a0000;
|
|
2279
2277
|
--color-background-status-info-yq3r41:#00142b;
|
|
2280
2278
|
--color-background-status-success-cvmksn:#001a02;
|
|
@@ -2388,9 +2386,9 @@
|
|
|
2388
2386
|
--color-text-link-primary-underline-xq4vik:#539fe5;
|
|
2389
2387
|
--color-text-pagination-page-number-active-disabled-nidnvc:#5f6b7a;
|
|
2390
2388
|
--color-text-pagination-page-number-default-xf8q73:#9ba7b6;
|
|
2391
|
-
--color-text-segment-active-
|
|
2389
|
+
--color-text-segment-active-p9yawx:#000716;
|
|
2392
2390
|
--color-text-segment-default-9k644f:#d1d5db;
|
|
2393
|
-
--color-text-segment-hover-
|
|
2391
|
+
--color-text-segment-hover-1lgt1u:#539fe5;
|
|
2394
2392
|
--color-text-small-5a9rs1:#8d99a8;
|
|
2395
2393
|
--color-text-status-error-jer77f:#eb6f6f;
|
|
2396
2394
|
--color-text-status-inactive-2o9czw:#8d99a8;
|
|
@@ -2420,7 +2418,7 @@
|
|
|
2420
2418
|
--color-background-button-primary-default-w02sje:#fbfbfb;
|
|
2421
2419
|
--color-background-button-primary-hover-qli9yh:#ffffff;
|
|
2422
2420
|
--color-background-segment-default-bjnpj3:transparent;
|
|
2423
|
-
--color-background-segment-hover-
|
|
2421
|
+
--color-background-segment-hover-eccr37:transparent;
|
|
2424
2422
|
--color-border-button-normal-active-mkds03:#ffffff;
|
|
2425
2423
|
--color-border-button-normal-default-d57sob:#fbfbfb;
|
|
2426
2424
|
--color-border-button-normal-hover-993ry7:#ffffff;
|
|
@@ -2441,7 +2439,7 @@
|
|
|
2441
2439
|
--color-background-button-primary-default-w02sje:#fbfbfb;
|
|
2442
2440
|
--color-background-button-primary-hover-qli9yh:#ffffff;
|
|
2443
2441
|
--color-background-segment-default-bjnpj3:transparent;
|
|
2444
|
-
--color-background-segment-hover-
|
|
2442
|
+
--color-background-segment-hover-eccr37:transparent;
|
|
2445
2443
|
--color-border-button-normal-active-mkds03:#ffffff;
|
|
2446
2444
|
--color-border-button-normal-default-d57sob:#fbfbfb;
|
|
2447
2445
|
--color-border-button-normal-hover-993ry7:#ffffff;
|
|
@@ -2461,7 +2459,7 @@
|
|
|
2461
2459
|
--color-background-button-primary-default-w02sje:#414d5c;
|
|
2462
2460
|
--color-background-button-primary-hover-qli9yh:#000716;
|
|
2463
2461
|
--color-background-segment-default-bjnpj3:transparent;
|
|
2464
|
-
--color-background-segment-hover-
|
|
2462
|
+
--color-background-segment-hover-eccr37:transparent;
|
|
2465
2463
|
--color-border-button-normal-active-mkds03:#000716;
|
|
2466
2464
|
--color-border-button-normal-default-d57sob:#414d5c;
|
|
2467
2465
|
--color-border-button-normal-hover-993ry7:#000716;
|
|
@@ -2478,7 +2476,7 @@
|
|
|
2478
2476
|
--color-background-button-primary-default-w02sje:#414d5c;
|
|
2479
2477
|
--color-background-button-primary-hover-qli9yh:#000716;
|
|
2480
2478
|
--color-background-segment-default-bjnpj3:transparent;
|
|
2481
|
-
--color-background-segment-hover-
|
|
2479
|
+
--color-background-segment-hover-eccr37:transparent;
|
|
2482
2480
|
--color-border-button-normal-active-mkds03:#000716;
|
|
2483
2481
|
--color-border-button-normal-default-d57sob:#414d5c;
|
|
2484
2482
|
--color-border-button-normal-hover-993ry7:#000716;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/component-metadata.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gCA0B1F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
// TODO: move to component-toolkit/internal/base-component
|
|
5
|
+
export var COMPONENT_METADATA_KEY = '__awsuiMetadata__';
|
|
6
|
+
export function useComponentMetadata(componentName, packageVersion) {
|
|
7
|
+
var elementRef = useRef(null);
|
|
8
|
+
useEffect(function () {
|
|
9
|
+
if (elementRef.current && !Object.prototype.hasOwnProperty.call(elementRef.current, COMPONENT_METADATA_KEY)) {
|
|
10
|
+
var node = elementRef.current;
|
|
11
|
+
var metadata = { name: componentName, version: packageVersion };
|
|
12
|
+
Object.freeze(metadata);
|
|
13
|
+
Object.defineProperty(node, COMPONENT_METADATA_KEY, { value: metadata, writable: false });
|
|
14
|
+
}
|
|
15
|
+
// Some component refs change dynamically. E.g. The Modal component where
|
|
16
|
+
// the content gets rendered conditionally inside a Portal.
|
|
17
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
+
}, [elementRef.current]);
|
|
19
|
+
return elementRef;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=component-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-metadata.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/component-metadata.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,0DAA0D;AAE1D,MAAM,CAAC,IAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAU,aAAqB,EAAE,cAAsB;IAUzF,IAAM,UAAU,GAAG,MAAM,CAAI,IAAI,CAAC,CAAC;IAEnC,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,sBAAsB,CAAC,EAAE;YAC3G,IAAM,IAAI,GAAG,UAAU,CAAC,OAAyC,CAAC;YAClE,IAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;YAElE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,sBAAsB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;SAC3F;QACD,yEAAyE;QACzE,2DAA2D;QAC3D,uDAAuD;IACzD,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzB,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useRef } from 'react';\n\n// TODO: move to component-toolkit/internal/base-component\n\nexport const COMPONENT_METADATA_KEY = '__awsuiMetadata__';\n\nexport function useComponentMetadata<T = any>(componentName: string, packageVersion: string) {\n interface AwsUiMetadata {\n name: string;\n version: string;\n }\n\n interface HTMLMetadataElement extends HTMLElement {\n [COMPONENT_METADATA_KEY]: AwsUiMetadata;\n }\n\n const elementRef = useRef<T>(null);\n\n useEffect(() => {\n if (elementRef.current && !Object.prototype.hasOwnProperty.call(elementRef.current, COMPONENT_METADATA_KEY)) {\n const node = elementRef.current as unknown as HTMLMetadataElement;\n const metadata = { name: componentName, version: packageVersion };\n\n Object.freeze(metadata);\n Object.defineProperty(node, COMPONENT_METADATA_KEY, { value: metadata, writable: false });\n }\n // Some component refs change dynamically. E.g. The Modal component where\n // the content gets rendered conditionally inside a Portal.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [elementRef.current]);\n\n return elementRef;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAKzC,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CAClD;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,GAAG,GAAG,EAAE,aAAa,EAAE,MAAM;;EAItE"}
|
|
@@ -1,39 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { useComponentMetadata } from './component-metadata';
|
|
4
2
|
import { useTelemetry } from '../use-telemetry';
|
|
5
3
|
import { PACKAGE_VERSION } from '../../environment';
|
|
6
|
-
export var COMPONENT_METADATA_KEY = '__awsuiMetadata__';
|
|
7
4
|
/**
|
|
8
5
|
* This hook is used for components which are exported to customers. The returned __internalRootRef needs to be
|
|
9
6
|
* attached to the (internal) component's root DOM node. The hook takes care of attaching the metadata to this
|
|
10
7
|
* root DOM node and emits the telemetry for this component.
|
|
11
8
|
*/
|
|
12
9
|
export default function useBaseComponent(componentName) {
|
|
13
|
-
var elementRef = useRef(null);
|
|
14
10
|
useTelemetry(componentName);
|
|
15
|
-
useComponentMetadata(componentName,
|
|
16
|
-
return {
|
|
17
|
-
__internalRootRef: elementRef
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function useComponentMetadata(componentName, elementRef) {
|
|
21
|
-
useEffect(function () {
|
|
22
|
-
if (elementRef.current && !Object.prototype.hasOwnProperty.call(elementRef.current, COMPONENT_METADATA_KEY)) {
|
|
23
|
-
var node = elementRef.current;
|
|
24
|
-
var metadata = {
|
|
25
|
-
name: componentName,
|
|
26
|
-
version: PACKAGE_VERSION
|
|
27
|
-
};
|
|
28
|
-
Object.freeze(metadata);
|
|
29
|
-
Object.defineProperty(node, COMPONENT_METADATA_KEY, {
|
|
30
|
-
value: metadata,
|
|
31
|
-
writable: false
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
// Some component refs change dynamically. E.g. The Modal component where
|
|
35
|
-
// the content gets rendered conditionally inside a Portal.
|
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
-
}, [elementRef.current]);
|
|
11
|
+
var elementRef = useComponentMetadata(componentName, PACKAGE_VERSION);
|
|
12
|
+
return { __internalRootRef: elementRef };
|
|
38
13
|
}
|
|
39
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAU,aAAqB;IACrE,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5B,IAAM,UAAU,GAAG,oBAAoB,CAAI,aAAa,EAAE,eAAe,CAAC,CAAC;IAC3E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { MutableRefObject } from 'react';\nimport { useComponentMetadata } from './component-metadata';\nimport { useTelemetry } from '../use-telemetry';\nimport { PACKAGE_VERSION } from '../../environment';\n\nexport interface InternalBaseComponentProps {\n __internalRootRef?: MutableRefObject<any> | null;\n}\n\n/**\n * This hook is used for components which are exported to customers. The returned __internalRootRef needs to be\n * attached to the (internal) component's root DOM node. The hook takes care of attaching the metadata to this\n * root DOM node and emits the telemetry for this component.\n */\nexport default function useBaseComponent<T = any>(componentName: string) {\n useTelemetry(componentName);\n const elementRef = useComponentMetadata<T>(componentName, PACKAGE_VERSION);\n return { __internalRootRef: elementRef };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-telemetry/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-telemetry/index.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,QAGjD"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
4
|
-
import { THEME } from '../../environment';
|
|
5
|
-
import { Metrics } from '../../metrics';
|
|
3
|
+
import { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from '../../environment';
|
|
6
4
|
import { useVisualRefresh } from '../use-visual-mode';
|
|
5
|
+
import * as telemetry from './telemetry';
|
|
7
6
|
export function useTelemetry(componentName) {
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
Metrics.initMetrics(isVisualRefresh ? 'vr' : THEME);
|
|
11
|
-
if (typeof window !== 'undefined') {
|
|
12
|
-
Metrics.sendMetricOnce('awsui-viewport-width', window.innerWidth || 0);
|
|
13
|
-
Metrics.sendMetricOnce('awsui-viewport-height', window.innerHeight || 0);
|
|
14
|
-
}
|
|
15
|
-
Metrics.logComponentLoaded();
|
|
16
|
-
Metrics.logComponentUsed(componentName.toLowerCase());
|
|
17
|
-
// Components do not change the name dynamically. Explicit empty array to prevent accidential double metrics
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
}, []);
|
|
7
|
+
var theme = useVisualRefresh() ? 'vr' : THEME;
|
|
8
|
+
telemetry.useTelemetry(componentName, { packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme: theme });
|
|
20
9
|
}
|
|
21
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-telemetry/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-telemetry/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,aAAqB;IAChD,IAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAChD,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;AACnH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from '../../environment';\nimport { useVisualRefresh } from '../use-visual-mode';\nimport * as telemetry from './telemetry';\n\nexport function useTelemetry(componentName: string) {\n const theme = useVisualRefresh() ? 'vr' : THEME;\n telemetry.useTelemetry(componentName, { packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme });\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Settings {
|
|
2
|
+
packageSource: string;
|
|
3
|
+
packageVersion: string;
|
|
4
|
+
theme: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useTelemetry(componentName: string, { packageSource, packageVersion, theme }: Settings): void;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-telemetry/telemetry.ts"],"names":[],"mappings":"AAQA,UAAU,QAAQ;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,QAAQ,QAcrG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { Metrics } from '../../metrics/metrics';
|
|
5
|
+
export function useTelemetry(componentName, _a) {
|
|
6
|
+
var packageSource = _a.packageSource, packageVersion = _a.packageVersion, theme = _a.theme;
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
var metrics = new Metrics(packageSource, packageVersion);
|
|
9
|
+
metrics.initMetrics(theme);
|
|
10
|
+
if (typeof window !== 'undefined') {
|
|
11
|
+
metrics.sendMetricOnce('awsui-viewport-width', window.innerWidth || 0);
|
|
12
|
+
metrics.sendMetricOnce('awsui-viewport-height', window.innerHeight || 0);
|
|
13
|
+
}
|
|
14
|
+
metrics.logComponentLoaded();
|
|
15
|
+
metrics.logComponentUsed(componentName.toLowerCase());
|
|
16
|
+
// Components do not change the name dynamically. Explicit empty array to prevent accidental double metrics
|
|
17
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
+
}, []);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-telemetry/telemetry.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAUhD,MAAM,UAAU,YAAY,CAAC,aAAqB,EAAE,EAAkD;QAAhD,aAAa,mBAAA,EAAE,cAAc,oBAAA,EAAE,KAAK,WAAA;IACxF,SAAS,CAAC;QACR,IAAM,OAAO,GAAG,IAAI,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAE3D,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,OAAO,CAAC,cAAc,CAAC,sBAAsB,EAAE,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC;YACvE,OAAO,CAAC,cAAc,CAAC,uBAAuB,EAAE,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;SAC1E;QACD,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC7B,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;QACtD,2GAA2G;QAC3G,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect } from 'react';\nimport { Metrics } from '../../metrics/metrics';\n\n// TODO: move to component-toolkit/internal/base-component\n\ninterface Settings {\n packageSource: string;\n packageVersion: string;\n theme: string;\n}\n\nexport function useTelemetry(componentName: string, { packageSource, packageVersion, theme }: Settings) {\n useEffect(() => {\n const metrics = new Metrics(packageSource, packageVersion);\n\n metrics.initMetrics(theme);\n if (typeof window !== 'undefined') {\n metrics.sendMetricOnce('awsui-viewport-width', window.innerWidth || 0);\n metrics.sendMetricOnce('awsui-viewport-height', window.innerHeight || 0);\n }\n metrics.logComponentLoaded();\n metrics.logComponentUsed(componentName.toLowerCase());\n // Components do not change the name dynamically. Explicit empty array to prevent accidental double metrics\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/metrics/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export { Metrics, MetricsTestHelper } from './metrics';
|
|
4
|
+
export { formatMajorVersionForMetricDetail, formatVersionForMetricName } from './metrics-formatters';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/metrics/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport { Metrics, MetricsTestHelper } from './metrics';\nexport { formatMajorVersionForMetricDetail, formatVersionForMetricName } from './metrics-formatters';\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface AWSC {
|
|
2
|
+
Clog: any;
|
|
3
|
+
}
|
|
4
|
+
export interface MetricsWindow extends Window {
|
|
5
|
+
AWSC?: AWSC;
|
|
6
|
+
panorama?: any;
|
|
7
|
+
}
|
|
8
|
+
export interface MetricsV2EventItem {
|
|
9
|
+
eventType?: string;
|
|
10
|
+
eventContext?: string;
|
|
11
|
+
eventDetail?: string | Record<string, string | number | boolean>;
|
|
12
|
+
eventValue?: string | Record<string, string | number | boolean>;
|
|
13
|
+
}
|
|
14
|
+
export interface MetricsLogItem {
|
|
15
|
+
source: string;
|
|
16
|
+
action: string;
|
|
17
|
+
version: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Console Platform's client logging JS API client.
|
|
21
|
+
*/
|
|
22
|
+
export declare class CLogClient {
|
|
23
|
+
/**
|
|
24
|
+
* Sends metric but only if Console Platform client logging JS API is present in the page.
|
|
25
|
+
*/
|
|
26
|
+
sendMetric(metricName: string, value: number, detail?: string): void;
|
|
27
|
+
private findAWSC;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Console Platform's client v2 logging JS API client.
|
|
31
|
+
*/
|
|
32
|
+
export declare class PanoramaClient {
|
|
33
|
+
/**
|
|
34
|
+
* Sends metric but only if Console Platform client v2 logging JS API is present in the page.
|
|
35
|
+
*/
|
|
36
|
+
sendMetric(metric: MetricsV2EventItem): void;
|
|
37
|
+
private findPanorama;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=log-clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-clients.d.ts","sourceRoot":"","sources":["../../../../src/internal/metrics/log-clients.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACjE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACjE;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAepE,OAAO,CAAC,QAAQ;CAiBjB;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAiB5C,OAAO,CAAC,YAAY;CAiBrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __assign } from "tslib";
|
|
4
|
+
/**
|
|
5
|
+
* Console Platform's client logging JS API client.
|
|
6
|
+
*/
|
|
7
|
+
var CLogClient = /** @class */ (function () {
|
|
8
|
+
function CLogClient() {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Sends metric but only if Console Platform client logging JS API is present in the page.
|
|
12
|
+
*/
|
|
13
|
+
CLogClient.prototype.sendMetric = function (metricName, value, detail) {
|
|
14
|
+
if (!metricName || !/^[a-zA-Z0-9_-]{1,32}$/.test(metricName)) {
|
|
15
|
+
console.error("Invalid metric name: ".concat(metricName));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (detail && detail.length > 200) {
|
|
19
|
+
console.error("Detail for metric ".concat(metricName, " is too long: ").concat(detail));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
var AWSC = this.findAWSC(window);
|
|
23
|
+
if (typeof AWSC === 'object' && typeof AWSC.Clog === 'object' && typeof AWSC.Clog.log === 'function') {
|
|
24
|
+
AWSC.Clog.log(metricName, value, detail);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
CLogClient.prototype.findAWSC = function (currentWindow) {
|
|
28
|
+
try {
|
|
29
|
+
if (typeof (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.AWSC) === 'object') {
|
|
30
|
+
return currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.AWSC;
|
|
31
|
+
}
|
|
32
|
+
if (!currentWindow || currentWindow.parent === currentWindow) {
|
|
33
|
+
// When the window has no more parents, it references itself
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return this.findAWSC(currentWindow.parent);
|
|
37
|
+
}
|
|
38
|
+
catch (ex) {
|
|
39
|
+
// Most likely a cross-origin access error
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return CLogClient;
|
|
44
|
+
}());
|
|
45
|
+
export { CLogClient };
|
|
46
|
+
/**
|
|
47
|
+
* Console Platform's client v2 logging JS API client.
|
|
48
|
+
*/
|
|
49
|
+
var PanoramaClient = /** @class */ (function () {
|
|
50
|
+
function PanoramaClient() {
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sends metric but only if Console Platform client v2 logging JS API is present in the page.
|
|
54
|
+
*/
|
|
55
|
+
PanoramaClient.prototype.sendMetric = function (metric) {
|
|
56
|
+
if (typeof metric.eventDetail === 'object') {
|
|
57
|
+
metric.eventDetail = JSON.stringify(metric.eventDetail);
|
|
58
|
+
}
|
|
59
|
+
if (metric.eventDetail && metric.eventDetail.length > 200) {
|
|
60
|
+
console.error("Detail for metric is too long: ".concat(metric.eventDetail));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (typeof metric.eventValue === 'object') {
|
|
64
|
+
metric.eventValue = JSON.stringify(metric.eventValue);
|
|
65
|
+
}
|
|
66
|
+
var panorama = this.findPanorama(window);
|
|
67
|
+
if (typeof panorama === 'function') {
|
|
68
|
+
panorama('trackCustomEvent', __assign(__assign({}, metric), { timestamp: Date.now() }));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
PanoramaClient.prototype.findPanorama = function (currentWindow) {
|
|
72
|
+
try {
|
|
73
|
+
if (typeof (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.panorama) === 'function') {
|
|
74
|
+
return currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow.panorama;
|
|
75
|
+
}
|
|
76
|
+
if (!currentWindow || currentWindow.parent === currentWindow) {
|
|
77
|
+
// When the window has no more parents, it references itself
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
return this.findPanorama(currentWindow.parent);
|
|
81
|
+
}
|
|
82
|
+
catch (ex) {
|
|
83
|
+
// Most likely a cross-origin access error
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
return PanoramaClient;
|
|
88
|
+
}());
|
|
89
|
+
export { PanoramaClient };
|
|
90
|
+
//# sourceMappingURL=log-clients.js.map
|