@grantcodes/ui 2.12.0 → 2.12.1
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/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/components/dialog/dialog.component.js +1 -0
- package/src/components/dropdown/dropdown.component.js +1 -0
- package/src/components/dropzone/dropzone.component.js +1 -0
- package/src/components/map/map.component.js +9 -4
- package/src/components/sidebar/sidebar.component.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.12.1](https://github.com/grantcodes/ui/compare/ui-v2.12.0...ui-v2.12.1) (2026-05-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **31-02:** align Astro docs and SSR behavior with modern browsers ([2f679f6](https://github.com/grantcodes/ui/commit/2f679f657fd65adb9594764585c3481531347107))
|
|
9
|
+
|
|
3
10
|
## [2.12.0](https://github.com/grantcodes/ui/compare/ui-v2.11.2...ui-v2.12.0) (2026-05-03)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantcodes/ui",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.1",
|
|
4
4
|
"description": "A personal component system built with Lit web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@lit/react": "^1.0.8",
|
|
45
45
|
"lit": "^3.3.1",
|
|
46
46
|
"shiki": "^3.17.1",
|
|
47
|
-
"@grantcodes/style-dictionary": "^1.
|
|
47
|
+
"@grantcodes/style-dictionary": "^1.6.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@arcmantle/vite-plugin-import-css-sheet": "^1.0.12",
|
|
@@ -46,6 +46,7 @@ export class GrantCodesDropdown extends LitElement {
|
|
|
46
46
|
|
|
47
47
|
connectedCallback() {
|
|
48
48
|
super.connectedCallback();
|
|
49
|
+
if (typeof document === "undefined") return;
|
|
49
50
|
document.addEventListener("click", this._handleDocumentClick);
|
|
50
51
|
document.addEventListener("keydown", this._handleEscape);
|
|
51
52
|
}
|
|
@@ -82,6 +82,7 @@ export class GrantCodesDropzone extends LitElement {
|
|
|
82
82
|
|
|
83
83
|
connectedCallback() {
|
|
84
84
|
super.connectedCallback();
|
|
85
|
+
if (typeof document === "undefined") return;
|
|
85
86
|
document.addEventListener("dragenter", this._enableFullscreen);
|
|
86
87
|
document.addEventListener("dragend", this._disableFullscreen);
|
|
87
88
|
document.addEventListener("dragleave", this._disableFullscreen);
|
|
@@ -48,31 +48,36 @@ export class GrantCodesMap extends LitElement {
|
|
|
48
48
|
this.label = "Map";
|
|
49
49
|
this["directions-url"] = "";
|
|
50
50
|
this.height = "";
|
|
51
|
-
this._darkQuery =
|
|
51
|
+
this._darkQuery = null;
|
|
52
52
|
this._onSchemeChange = () => this._updateFilter();
|
|
53
|
+
if (typeof window !== "undefined") {
|
|
54
|
+
this._darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
connectedCallback() {
|
|
56
59
|
super.connectedCallback();
|
|
60
|
+
if (typeof window === "undefined") return;
|
|
57
61
|
this._observer = new MutationObserver(() => this._updateFilter());
|
|
58
62
|
this._observer.observe(document.documentElement, {
|
|
59
63
|
attributes: true,
|
|
60
64
|
attributeFilter: ["class"],
|
|
61
65
|
});
|
|
62
|
-
this._darkQuery
|
|
66
|
+
this._darkQuery?.addEventListener("change", this._onSchemeChange);
|
|
63
67
|
this._updateFilter();
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
disconnectedCallback() {
|
|
67
71
|
super.disconnectedCallback();
|
|
68
72
|
this._observer?.disconnect();
|
|
69
|
-
this._darkQuery
|
|
73
|
+
this._darkQuery?.removeEventListener("change", this._onSchemeChange);
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
_isDark() {
|
|
77
|
+
if (typeof document === "undefined") return false;
|
|
73
78
|
if (document.documentElement.classList.contains("dark")) return true;
|
|
74
79
|
if (document.documentElement.classList.contains("light")) return false;
|
|
75
|
-
return this._darkQuery
|
|
80
|
+
return this._darkQuery?.matches ?? false;
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
_updateFilter() {
|
|
@@ -55,6 +55,7 @@ export class GrantCodesSidebar extends LitElement {
|
|
|
55
55
|
|
|
56
56
|
connectedCallback() {
|
|
57
57
|
super.connectedCallback();
|
|
58
|
+
if (typeof document === "undefined") return;
|
|
58
59
|
document.addEventListener("click", this._handleDocumentClick);
|
|
59
60
|
document.addEventListener("keydown", this._handleEscape);
|
|
60
61
|
}
|