@pure-ds/core 0.5.23 โ 0.5.25
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/package.json
CHANGED
|
@@ -245,7 +245,7 @@ customElements.define(
|
|
|
245
245
|
this.shadowRoot.innerHTML +=
|
|
246
246
|
"\n <form>\n <fieldset role=\"radiogroup\" aria-label=\"Theme\" class=\"buttons\">\n <legend>Theme</legend>\n <label>\n <input type=\"radio\" name=\"theme\" value=\"system\">\n <span>\n <pds-icon icon=\"moon-stars\"></pds-icon>\n System\n </span>\n </label>\n <label>\n <input type=\"radio\" name=\"theme\" value=\"light\">\n <span>\n <pds-icon icon=\"sun\"></pds-icon>\n Light\n </span>\n </label>\n <label>\n <input type=\"radio\" name=\"theme\" value=\"dark\">\n <span>\n <pds-icon icon=\"moon\"></pds-icon>\n Dark\n </span>\n </label>\n </fieldset>\n </form>";
|
|
247
247
|
|
|
248
|
-
this
|
|
248
|
+
this.updateCheckedState();
|
|
249
249
|
|
|
250
250
|
this.shadowRoot.addEventListener("change", (e) => {
|
|
251
251
|
if (e.target.type === "radio" && e.target.name === "theme") {
|
|
@@ -255,7 +255,7 @@ customElements.define(
|
|
|
255
255
|
});
|
|
256
256
|
|
|
257
257
|
const observer = new MutationObserver(() => {
|
|
258
|
-
this
|
|
258
|
+
this.updateCheckedState();
|
|
259
259
|
});
|
|
260
260
|
|
|
261
261
|
observer.observe(document.documentElement, {
|
|
@@ -264,7 +264,7 @@ customElements.define(
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
updateCheckedState() {
|
|
268
268
|
const currentTheme = PDS.theme || "system";
|
|
269
269
|
const radios = this.shadowRoot.querySelectorAll('input[type="radio"]');
|
|
270
270
|
radios.forEach((radio) => {
|
|
@@ -547,6 +547,10 @@ async function runDevServer() {
|
|
|
547
547
|
async function ensurePdsAssets() {
|
|
548
548
|
const pdsAssetsDir = path.join(projectRoot, 'public', 'assets', 'pds');
|
|
549
549
|
const repoAssetsDir = path.join(projectRoot, 'assets', 'pds');
|
|
550
|
+
const repoAssetsRoot = path.join(projectRoot, 'assets');
|
|
551
|
+
const repoInstallJson = path.join(repoAssetsRoot, '.pds-install.json');
|
|
552
|
+
const publicAssetsRoot = path.join(projectRoot, 'public', 'assets');
|
|
553
|
+
const publicInstallJson = path.join(publicAssetsRoot, '.pds-install.json');
|
|
550
554
|
|
|
551
555
|
const normalizeAssetsLocation = async () => {
|
|
552
556
|
if (!existsSync(repoAssetsDir)) return;
|
|
@@ -563,7 +567,27 @@ async function ensurePdsAssets() {
|
|
|
563
567
|
return false;
|
|
564
568
|
};
|
|
565
569
|
|
|
570
|
+
const moveInstallJson = async () => {
|
|
571
|
+
if (!existsSync(repoInstallJson)) return;
|
|
572
|
+
await ensureDir(publicAssetsRoot);
|
|
573
|
+
await rename(repoInstallJson, publicInstallJson);
|
|
574
|
+
log('โ
Moved assets/.pds-install.json to public/assets/.pds-install.json');
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
const cleanupAssetsRoot = async () => {
|
|
578
|
+
if (!existsSync(repoAssetsRoot)) return;
|
|
579
|
+
const remaining = ['pds', '.pds-install.json']
|
|
580
|
+
.map((name) => path.join(repoAssetsRoot, name))
|
|
581
|
+
.filter((target) => existsSync(target));
|
|
582
|
+
if (remaining.length === 0) {
|
|
583
|
+
await rm(repoAssetsRoot, { recursive: true, force: true });
|
|
584
|
+
log('๐งน Removed root assets folder');
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
|
|
566
588
|
const movedAssets = await normalizeAssetsLocation();
|
|
589
|
+
await moveInstallJson();
|
|
590
|
+
await cleanupAssetsRoot();
|
|
567
591
|
if (movedAssets) {
|
|
568
592
|
return;
|
|
569
593
|
}
|
|
@@ -590,6 +614,8 @@ async function ensurePdsAssets() {
|
|
|
590
614
|
});
|
|
591
615
|
|
|
592
616
|
await normalizeAssetsLocation();
|
|
617
|
+
await moveInstallJson();
|
|
618
|
+
await cleanupAssetsRoot();
|
|
593
619
|
}
|
|
594
620
|
|
|
595
621
|
async function main() {
|
|
@@ -29,8 +29,6 @@ class PDSRegistry {
|
|
|
29
29
|
setStaticMode(paths = {}) {
|
|
30
30
|
this._mode = "static";
|
|
31
31
|
this._staticPaths = { ...this._staticPaths, ...paths };
|
|
32
|
-
// Note: No access to config in static mode, using console
|
|
33
|
-
console.log("[PDS Registry] Switched to STATIC mode", this._staticPaths);
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
/**
|