diff --git a/crates/brk_bindgen/src/generators/javascript/client.rs b/crates/brk_bindgen/src/generators/javascript/client.rs index b53de54fa..c0fbf5c72 100644 --- a/crates/brk_bindgen/src/generators/javascript/client.rs +++ b/crates/brk_bindgen/src/generators/javascript/client.rs @@ -51,6 +51,12 @@ const _openBrowserCache = (option) => {{ return caches.open(name).catch(() => null); }}; +/** + * @param {{string}} url + * @returns {{URL}} + */ +const _parseBaseUrl = (url) => new URL(url, typeof location === 'undefined' ? undefined : location.href); + /** * Custom error class for BRK client errors */ @@ -403,6 +409,9 @@ class BrkClientBase {{ const isString = typeof options === 'string'; const rawUrl = isString ? options : options.baseUrl; this.baseUrl = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl; + const url = _parseBaseUrl(this.baseUrl); + this.url = url.href.endsWith('/') ? url.href.slice(0, -1) : url.href; + this.domain = url.hostname; this.timeout = isString ? 5000 : (options.timeout ?? 5000); /** @type {{Promise}} */ this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache); diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 9d1da8222..a11fc34c8 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -1497,6 +1497,12 @@ const _openBrowserCache = (option) => { return caches.open(name).catch(() => null); }; +/** + * @param {string} url + * @returns {URL} + */ +const _parseBaseUrl = (url) => new URL(url, typeof location === 'undefined' ? undefined : location.href); + /** * Custom error class for BRK client errors */ @@ -1849,6 +1855,9 @@ class BrkClientBase { const isString = typeof options === 'string'; const rawUrl = isString ? options : options.baseUrl; this.baseUrl = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl; + const url = _parseBaseUrl(this.baseUrl); + this.url = url.href.endsWith('/') ? url.href.slice(0, -1) : url.href; + this.domain = url.hostname; this.timeout = isString ? 5000 : (options.timeout ?? 5000); /** @type {Promise} */ this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache); diff --git a/website_next/dialog/style.css b/website_next/dialog/style.css index 20be5fdd4..8b3ce3a02 100644 --- a/website_next/dialog/style.css +++ b/website_next/dialog/style.css @@ -1,6 +1,7 @@ dialog { --dialog-space: 1.5rem; + color-scheme: light; width: min(100% - 2rem, 30rem); border: 0; border-radius: var(--dialog-space); @@ -11,19 +12,4 @@ dialog { &::backdrop { background: color-mix(in oklch, var(--black) 72%, transparent); } - - button { - color: var(--white); - background: var(--gray); - - &:hover { - color: var(--white); - background: var(--black); - } - - &:active { - color: var(--white); - background: var(--orange); - } - } } diff --git a/website_next/home/index.js b/website_next/home/index.js index f097b0696..4b4488ec9 100644 --- a/website_next/home/index.js +++ b/website_next/home/index.js @@ -18,6 +18,7 @@ export function createHomePage() { for (const { href, label } of links) { const link = document.createElement("a"); link.href = href; + link.dataset.button = ""; link.append(label); nav.append(link); } diff --git a/website_next/home/style.css b/website_next/home/style.css index bbee8a776..cdc103d25 100644 --- a/website_next/home/style.css +++ b/website_next/home/style.css @@ -16,6 +16,5 @@ main.home { gap: 0.5rem; font-size: var(--font-size-xs); line-height: 1; - text-transform: uppercase; } } diff --git a/website_next/index.html b/website_next/index.html index 9bddf744e..afe1d59ce 100644 --- a/website_next/index.html +++ b/website_next/index.html @@ -118,18 +118,21 @@ + - + - + + +