@leadertechie/personal-site-kit 0.1.0-alpha.12 → 0.1.0-alpha.14
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/dist/api/website-api.d.ts.map +1 -1
- package/dist/api.js +2 -2
- package/dist/chunks/{template-Ccxil4s-.js → template-DXUSp0BG.js} +10 -1
- package/dist/chunks/{website-api-DTaVHBO_.js → website-api-CE2q2nt7.js} +7 -1
- package/dist/index.js +2 -2
- package/dist/shared/website-ui.d.ts +1 -0
- package/dist/shared/website-ui.d.ts.map +1 -1
- package/dist/shared.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-api.d.ts","sourceRoot":"","sources":["../../src/api/website-api.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE3E,qBAAa,UAAU;IACrB,OAAO,CAAC,cAAc,CAAiC;IAEhD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAIzD,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,UAAU;IAqBL,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"website-api.d.ts","sourceRoot":"","sources":["../../src/api/website-api.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE3E,qBAAa,UAAU;IACrB,OAAO,CAAC,cAAc,CAAiC;IAEhD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAIzD,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,UAAU;IAqBL,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;CA+FlE"}
|
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { W as WebsiteAPI } from "./chunks/website-api-
|
|
2
|
-
import { A, B, M, R, c, a, g, b, d, h, e, r, s, v } from "./chunks/website-api-
|
|
1
|
+
import { W as WebsiteAPI } from "./chunks/website-api-CE2q2nt7.js";
|
|
2
|
+
import { A, B, M, R, c, a, g, b, d, h, e, r, s, v } from "./chunks/website-api-CE2q2nt7.js";
|
|
3
3
|
const defaultAPI = new WebsiteAPI();
|
|
4
4
|
export {
|
|
5
5
|
A as AUTH_KV,
|
|
@@ -398,15 +398,17 @@ class WebsiteUI {
|
|
|
398
398
|
apiUrl: this.config.apiUrl,
|
|
399
399
|
baseUrl: this.config.baseUrl
|
|
400
400
|
});
|
|
401
|
-
this.store.subscribe(() => {
|
|
401
|
+
this.store.subscribe((config) => {
|
|
402
402
|
this.applyTheme();
|
|
403
403
|
this.updateFavicon();
|
|
404
|
+
this.updateBanner(config);
|
|
404
405
|
if (this.router && window.location.pathname !== "/admin") {
|
|
405
406
|
this.router.navigate(window.location.pathname);
|
|
406
407
|
}
|
|
407
408
|
});
|
|
408
409
|
this.applyTheme();
|
|
409
410
|
this.updateFavicon();
|
|
411
|
+
this.updateBanner(this.store.getConfig());
|
|
410
412
|
this.router = new Router(this);
|
|
411
413
|
this.router.init(this.config.appElementId || "app");
|
|
412
414
|
if (this.config.onBootstrap) {
|
|
@@ -414,6 +416,13 @@ class WebsiteUI {
|
|
|
414
416
|
}
|
|
415
417
|
console.log("WebsiteUI bootstrapped");
|
|
416
418
|
}
|
|
419
|
+
updateBanner(config) {
|
|
420
|
+
const banner = document.querySelector("my-banner");
|
|
421
|
+
if (banner) {
|
|
422
|
+
banner.setAttribute("header", config.siteTitle || "My Site");
|
|
423
|
+
banner.setAttribute("logo", `${config.apiUrl}/api/logo?t=${Date.now()}`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
417
426
|
applyTheme() {
|
|
418
427
|
if (!this.config.theme) return;
|
|
419
428
|
const { theme } = this.config;
|
|
@@ -838,7 +838,13 @@ class WebsiteAPI {
|
|
|
838
838
|
return this.handleCORS(origin);
|
|
839
839
|
}
|
|
840
840
|
const pathname = url.pathname;
|
|
841
|
-
|
|
841
|
+
let route = pathname;
|
|
842
|
+
if (route.startsWith("/api/")) {
|
|
843
|
+
route = route.substring(5);
|
|
844
|
+
} else if (route.startsWith("/api")) {
|
|
845
|
+
route = route.substring(4);
|
|
846
|
+
}
|
|
847
|
+
route = route.replace(/^\//, "").replace(/\/+$/, "");
|
|
842
848
|
if (this.customHandlers.has(route)) {
|
|
843
849
|
const handler = this.customHandlers.get(route);
|
|
844
850
|
return this.addCORSHeaders(await handler(request, env));
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A, B, M, R, W, c, a, g, b, d, h, e, r, s, v } from "./chunks/website-api-
|
|
1
|
+
import { A, B, M, R, W, c, a, g, b, d, h, e, r, s, v } from "./chunks/website-api-CE2q2nt7.js";
|
|
2
2
|
import { WebsitePrerender } from "./prerender.js";
|
|
3
3
|
import { A as A2, a as a2, b as b2, c as c2, d as d2, e as e2, f, g as g2, h as h2, i, B as B2, F, M as M2, j, S, k } from "./chunks/index-B2jGIzSi.js";
|
|
4
4
|
import { S as S2, g as g3, i as i2, r as r2 } from "./chunks/site-store-CGV9c2DI.js";
|
|
5
|
-
import { R as R2, T, W as W2, b as b3, c as c3, g as g4, r as r3 } from "./chunks/template-
|
|
5
|
+
import { R as R2, T, W as W2, b as b3, c as c3, g as g4, r as r3 } from "./chunks/template-DXUSp0BG.js";
|
|
6
6
|
export {
|
|
7
7
|
A as AUTH_KV,
|
|
8
8
|
A2 as AdminAboutMeSection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-ui.d.ts","sourceRoot":"","sources":["../../src/shared/website-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAY;IACnC,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,MAAM,CAAuB;IAErC,OAAO;WAKO,WAAW,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS;IAU1C,SAAS;
|
|
1
|
+
{"version":3,"file":"website-ui.d.ts","sourceRoot":"","sources":["../../src/shared/website-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAY;IACnC,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,MAAM,CAAuB;IAErC,OAAO;WAKO,WAAW,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS;IAU1C,SAAS;IAsCtB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,aAAa;IAad,QAAQ;IAIR,SAAS;IAIT,SAAS;CAGjB;AAED,eAAO,MAAM,SAAS,GAAI,SAAS,QAAQ,kBAA8C,CAAC"}
|
package/dist/shared.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S, g, i, r } from "./chunks/site-store-CGV9c2DI.js";
|
|
2
|
-
import { R, T, W, b, c, g as g2, r as r2 } from "./chunks/template-
|
|
2
|
+
import { R, T, W, b, c, g as g2, r as r2 } from "./chunks/template-DXUSp0BG.js";
|
|
3
3
|
export {
|
|
4
4
|
R as Router,
|
|
5
5
|
S as SiteStore,
|
package/package.json
CHANGED