@matter-server/dashboard 0.2.6 → 0.2.7-alpha.0-20260118-993a1c7

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.
Files changed (40) hide show
  1. package/README.md +16 -0
  2. package/dist/esm/client/models/descriptions.js +1754 -1754
  3. package/dist/esm/components/dialogs/binding/node-binding-dialog.d.ts.map +1 -1
  4. package/dist/esm/components/dialogs/binding/node-binding-dialog.js +8 -4
  5. package/dist/esm/components/dialogs/binding/node-binding-dialog.js.map +1 -1
  6. package/dist/esm/entrypoint/main.d.ts +1 -1
  7. package/dist/esm/entrypoint/main.d.ts.map +1 -1
  8. package/dist/esm/entrypoint/main.js +1 -0
  9. package/dist/esm/entrypoint/main.js.map +1 -1
  10. package/dist/esm/pages/components/header.d.ts +8 -0
  11. package/dist/esm/pages/components/header.d.ts.map +1 -1
  12. package/dist/esm/pages/components/header.js +56 -6
  13. package/dist/esm/pages/components/header.js.map +1 -1
  14. package/dist/esm/pages/matter-dashboard-app.d.ts +6 -1
  15. package/dist/esm/pages/matter-dashboard-app.d.ts.map +1 -1
  16. package/dist/esm/pages/matter-dashboard-app.js +119 -24
  17. package/dist/esm/pages/matter-dashboard-app.js.map +1 -1
  18. package/dist/esm/util/theme-service.d.ts +27 -0
  19. package/dist/esm/util/theme-service.d.ts.map +1 -0
  20. package/dist/esm/util/theme-service.js +71 -0
  21. package/dist/esm/util/theme-service.js.map +6 -0
  22. package/dist/web/index.html +35 -0
  23. package/dist/web/js/{commission-node-dialog--19-sX9D.js → commission-node-dialog-DGw5qDgH.js} +5 -5
  24. package/dist/web/js/{commission-node-existing-DY6SnsHb.js → commission-node-existing-CHyyeC8y.js} +4 -4
  25. package/dist/web/js/{commission-node-thread-CXquVvK5.js → commission-node-thread-iRDSlidy.js} +4 -4
  26. package/dist/web/js/{commission-node-wifi-VQGVOrr7.js → commission-node-wifi-C4YNR3bG.js} +4 -4
  27. package/dist/web/js/{dialog-box-qX-alVZJ.js → dialog-box-ag-xOaYh.js} +2 -2
  28. package/dist/web/js/{fire_event-B13DcOc9.js → fire_event-BeiEbHcE.js} +1 -1
  29. package/dist/web/js/main.js +140 -8
  30. package/dist/web/js/{matter-dashboard-app-CU3-L2nl.js → matter-dashboard-app-BxQ4W_uT.js} +13183 -13045
  31. package/dist/web/js/{node-binding-dialog-D4rr_G9I.js → node-binding-dialog-ClziphM0.js} +11 -7
  32. package/dist/web/js/{outlined-text-field-CtlEkpbk.js → outlined-text-field-B-CiqgEJ.js} +2 -2
  33. package/dist/web/js/{prevent_default-Dw7ifAL-.js → prevent_default-Bs2sUnny.js} +1 -1
  34. package/package.json +3 -3
  35. package/src/client/models/descriptions.ts +1754 -1754
  36. package/src/components/dialogs/binding/node-binding-dialog.ts +8 -4
  37. package/src/entrypoint/main.ts +1 -0
  38. package/src/pages/components/header.ts +57 -8
  39. package/src/pages/matter-dashboard-app.ts +123 -26
  40. package/src/util/theme-service.ts +98 -0
@@ -1,5 +1,5 @@
1
- import { r, n, t, i, b } from './matter-dashboard-app-CU3-L2nl.js';
2
- import { p as preventDefault } from './prevent_default-Dw7ifAL-.js';
1
+ import { r, n, t, i, b } from './matter-dashboard-app-BxQ4W_uT.js';
2
+ import { p as preventDefault } from './prevent_default-Bs2sUnny.js';
3
3
  import './main.js';
4
4
 
5
5
  var __defProp = Object.defineProperty;
@@ -44,18 +44,18 @@ let ComissionNodeDialog = class extends i {
44
44
  if (!this.client.serverInfo.bluetooth_enabled) {
45
45
  return;
46
46
  }
47
- import('./commission-node-wifi-VQGVOrr7.js');
47
+ import('./commission-node-wifi-C4YNR3bG.js');
48
48
  this._mode = "wifi";
49
49
  }
50
50
  _commissionThread() {
51
51
  if (!this.client.serverInfo.bluetooth_enabled) {
52
52
  return;
53
53
  }
54
- import('./commission-node-thread-CXquVvK5.js');
54
+ import('./commission-node-thread-iRDSlidy.js');
55
55
  this._mode = "thread";
56
56
  }
57
57
  _commissionExisting() {
58
- import('./commission-node-existing-DY6SnsHb.js');
58
+ import('./commission-node-existing-CHyyeC8y.js');
59
59
  this._mode = "existing";
60
60
  }
61
61
  _nodeCommissioned(ev) {
@@ -1,8 +1,8 @@
1
- import { r, c, n, d as clientContext, e, t, i, A, b } from './matter-dashboard-app-CU3-L2nl.js';
2
- import { f as fireEvent } from './fire_event-B13DcOc9.js';
3
- import './outlined-text-field-CtlEkpbk.js';
1
+ import { r, c, n, d as clientContext, e, t, i, A, b } from './matter-dashboard-app-BxQ4W_uT.js';
2
+ import { f as fireEvent } from './fire_event-BeiEbHcE.js';
3
+ import './outlined-text-field-B-CiqgEJ.js';
4
4
  import './main.js';
5
- import './prevent_default-Dw7ifAL-.js';
5
+ import './prevent_default-Bs2sUnny.js';
6
6
 
7
7
  var __defProp = Object.defineProperty;
8
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,8 +1,8 @@
1
- import { r, c, n, d as clientContext, e, t, i, A, b } from './matter-dashboard-app-CU3-L2nl.js';
2
- import { f as fireEvent } from './fire_event-B13DcOc9.js';
3
- import './outlined-text-field-CtlEkpbk.js';
1
+ import { r, c, n, d as clientContext, e, t, i, A, b } from './matter-dashboard-app-BxQ4W_uT.js';
2
+ import { f as fireEvent } from './fire_event-BeiEbHcE.js';
3
+ import './outlined-text-field-B-CiqgEJ.js';
4
4
  import './main.js';
5
- import './prevent_default-Dw7ifAL-.js';
5
+ import './prevent_default-Bs2sUnny.js';
6
6
 
7
7
  var __defProp = Object.defineProperty;
8
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,8 +1,8 @@
1
- import { r, c, n, d as clientContext, e, t, i, A, b } from './matter-dashboard-app-CU3-L2nl.js';
2
- import { f as fireEvent } from './fire_event-B13DcOc9.js';
3
- import './outlined-text-field-CtlEkpbk.js';
1
+ import { r, c, n, d as clientContext, e, t, i, A, b } from './matter-dashboard-app-BxQ4W_uT.js';
2
+ import { f as fireEvent } from './fire_event-BeiEbHcE.js';
3
+ import './outlined-text-field-B-CiqgEJ.js';
4
4
  import './main.js';
5
- import './prevent_default-Dw7ifAL-.js';
5
+ import './prevent_default-Bs2sUnny.js';
6
6
 
7
7
  var __defProp = Object.defineProperty;
8
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- import { n, t, i, b } from './matter-dashboard-app-CU3-L2nl.js';
2
- import { p as preventDefault } from './prevent_default-Dw7ifAL-.js';
1
+ import { n, t, i, b } from './matter-dashboard-app-BxQ4W_uT.js';
2
+ import { p as preventDefault } from './prevent_default-Bs2sUnny.js';
3
3
  import './main.js';
4
4
 
5
5
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- import { m as mixinDelegatesAria, i, _ as __decorate, n, f as e, A, b, a as i$1, t } from './matter-dashboard-app-CU3-L2nl.js';
1
+ import { m as mixinDelegatesAria, i, _ as __decorate, n, f as e, A, b, a as i$1, t } from './matter-dashboard-app-BxQ4W_uT.js';
2
2
 
3
3
  /**
4
4
  * @license
@@ -31,13 +31,77 @@ function toBigIntAwareJson(value, spaces) {
31
31
  return result;
32
32
  }
33
33
  function parseBigIntAwareJson(json) {
34
- const processed = json.replace(/([:,[])\s*(\d{15,})(?=[,}\]\s])/g, (match, prefix, number) => {
35
- const num = BigInt(number);
36
- if (num > Number.MAX_SAFE_INTEGER) {
37
- return `${prefix}"${BIGINT_MARKER}${number}"`;
34
+ const result = [];
35
+ let i = 0;
36
+ let inString = false;
37
+ while (i < json.length) {
38
+ const char = json[i];
39
+ if (inString) {
40
+ if (char === "\\") {
41
+ result.push(char);
42
+ i++;
43
+ if (i < json.length) {
44
+ result.push(json[i]);
45
+ i++;
46
+ }
47
+ } else if (char === '"') {
48
+ result.push(char);
49
+ inString = false;
50
+ i++;
51
+ } else {
52
+ result.push(char);
53
+ i++;
54
+ }
55
+ } else {
56
+ if (char === '"') {
57
+ result.push(char);
58
+ inString = true;
59
+ i++;
60
+ } else if (char >= "0" && char <= "9") {
61
+ const hasMinus = result.length > 0 && result[result.length - 1] === "-";
62
+ if (hasMinus) {
63
+ result.pop();
64
+ }
65
+ const start = i;
66
+ while (i < json.length && json[i] >= "0" && json[i] <= "9") {
67
+ i++;
68
+ }
69
+ let isFloat = false;
70
+ if (i < json.length && json[i] === ".") {
71
+ isFloat = true;
72
+ i++;
73
+ while (i < json.length && json[i] >= "0" && json[i] <= "9") {
74
+ i++;
75
+ }
76
+ }
77
+ if (i < json.length && (json[i] === "e" || json[i] === "E")) {
78
+ isFloat = true;
79
+ i++;
80
+ if (i < json.length && (json[i] === "+" || json[i] === "-")) {
81
+ i++;
82
+ }
83
+ while (i < json.length && json[i] >= "0" && json[i] <= "9") {
84
+ i++;
85
+ }
86
+ }
87
+ const numberStr = (hasMinus ? "-" : "") + json.slice(start, i);
88
+ if (!isFloat && numberStr.length - (hasMinus ? 1 : 0) >= 15) {
89
+ const num = BigInt(numberStr);
90
+ if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
91
+ result.push(`"${BIGINT_MARKER}${numberStr}"`);
92
+ } else {
93
+ result.push(numberStr);
94
+ }
95
+ } else {
96
+ result.push(numberStr);
97
+ }
98
+ } else {
99
+ result.push(char);
100
+ i++;
101
+ }
38
102
  }
39
- return match;
40
- });
103
+ }
104
+ const processed = result.join("");
41
105
  return JSON.parse(processed, (_key, value) => {
42
106
  if (typeof value === "string" && value.startsWith(BIGINT_MARKER)) {
43
107
  return BigInt(value.slice(BIGINT_MARKER.length));
@@ -503,13 +567,81 @@ class MatterClient {
503
567
  onRawEvent(_event) {}
504
568
  }
505
569
 
570
+ /**
571
+ * @license
572
+ * Copyright 2025-2026 Open Home Foundation
573
+ * SPDX-License-Identifier: Apache-2.0
574
+ */
575
+ const STORAGE_KEY = "matterTheme";
576
+ class ThemeServiceImpl {
577
+ constructor() {
578
+ this._preference = "system";
579
+ this._listeners = /* @__PURE__ */new Set();
580
+ this._mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
581
+ this._mediaQuery.addEventListener("change", () => this._applyTheme());
582
+ this._loadPreference();
583
+ this._applyTheme();
584
+ }
585
+ get preference() {
586
+ return this._preference;
587
+ }
588
+ get effectiveTheme() {
589
+ if (this._preference === "system") {
590
+ return this._mediaQuery.matches ? "dark" : "light";
591
+ }
592
+ return this._preference;
593
+ }
594
+ setPreference(pref) {
595
+ this._preference = pref;
596
+ localStorage.setItem(STORAGE_KEY, pref);
597
+ this._applyTheme();
598
+ }
599
+ cycleTheme() {
600
+ const cycle = ["light", "dark", "system"];
601
+ const currentIndex = cycle.indexOf(this._preference);
602
+ const nextIndex = (currentIndex + 1) % cycle.length;
603
+ this.setPreference(cycle[nextIndex]);
604
+ return this._preference;
605
+ }
606
+ subscribe(callback) {
607
+ this._listeners.add(callback);
608
+ return () => this._listeners.delete(callback);
609
+ }
610
+ _loadPreference() {
611
+ const urlParams = new URLSearchParams(window.location.search);
612
+ const themeParam = urlParams.get("theme");
613
+ if (themeParam && ["light", "dark", "system"].includes(themeParam)) {
614
+ this._preference = themeParam;
615
+ localStorage.setItem(STORAGE_KEY, themeParam);
616
+ urlParams.delete("theme");
617
+ const newUrl = urlParams.toString() ? `${window.location.pathname}?${urlParams.toString()}${window.location.hash}` : `${window.location.pathname}${window.location.hash}`;
618
+ history.replaceState({}, "", newUrl);
619
+ return;
620
+ }
621
+ const stored = localStorage.getItem(STORAGE_KEY);
622
+ if (stored && ["light", "dark", "system"].includes(stored)) {
623
+ this._preference = stored;
624
+ }
625
+ }
626
+ _applyTheme() {
627
+ const effective = this.effectiveTheme;
628
+ document.documentElement.classList.toggle("dark-theme", effective === "dark");
629
+ const metaThemeColor = document.querySelector('meta[name="theme-color"]');
630
+ if (metaThemeColor) {
631
+ metaThemeColor.setAttribute("content", effective === "dark" ? "#1e1e1e" : "#03a9f4");
632
+ }
633
+ this._listeners.forEach(cb => cb(effective));
634
+ }
635
+ }
636
+ const ThemeService = new ThemeServiceImpl();
637
+
506
638
  /**
507
639
  * @license
508
640
  * Copyright 2025-2026 Open Home Foundation
509
641
  * SPDX-License-Identifier: Apache-2.0
510
642
  */
511
643
  async function main() {
512
- import('./matter-dashboard-app-CU3-L2nl.js').then(function (n) { return n.s; });
644
+ import('./matter-dashboard-app-BxQ4W_uT.js').then(function (n) { return n.s; });
513
645
  let url = "";
514
646
  const isProductionServer = location.origin.includes(":5580") || location.href.includes("hassio_ingress") || location.href.includes("/api/ingress/");
515
647
  if (!isProductionServer) {
@@ -544,4 +676,4 @@ async function main() {
544
676
  }
545
677
  main();
546
678
 
547
- export { toBigIntAwareJson as t };
679
+ export { ThemeService as T, toBigIntAwareJson as t };