Spaces:
Running
Running
hfviewer automation commited on
Commit ·
5aeb2a9
1
Parent(s): df6c411
Sync private Space from hfviewer-a445f87628ef
Browse files
hf-shell-app-29630043e471.js → hf-shell-app-f056da15f06a.js
RENAMED
|
@@ -1590,7 +1590,7 @@
|
|
| 1590 |
let activeViewerModel = null;
|
| 1591 |
// Shared switch/module for the navbar pill and model action. Index work stays graph-ready only.
|
| 1592 |
const embedlInitialSearch = window.location.search;
|
| 1593 |
-
const embedlDeployModule = import(buildTrackedInternalPath("/visualizer/hfDeployButton.js?v=20261022-run-
|
| 1594 |
api.initializeDeployPreview(window, embedlInitialSearch);
|
| 1595 |
return api;
|
| 1596 |
}).catch(() => null);
|
|
|
|
| 1590 |
let activeViewerModel = null;
|
| 1591 |
// Shared switch/module for the navbar pill and model action. Index work stays graph-ready only.
|
| 1592 |
const embedlInitialSearch = window.location.search;
|
| 1593 |
+
const embedlDeployModule = import(buildTrackedInternalPath("/visualizer/hfDeployButton.js?v=20261022-run-2")).then((api) => {
|
| 1594 |
api.initializeDeployPreview(window, embedlInitialSearch);
|
| 1595 |
return api;
|
| 1596 |
}).catch(() => null);
|
hf-shell-css-db0481da2cbf.css → hf-shell-css-212d31f116a0.css
RENAMED
|
@@ -17483,6 +17483,37 @@
|
|
| 17483 |
.embedl-deploy { position: relative; display: flex; align-items: center; }
|
| 17484 |
.embedl-deploy__trigger { white-space: nowrap; }
|
| 17485 |
.embedl-deploy__trigger::before { content: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17486 |
.embedl-deploy__icon { display: inline-flex; }
|
| 17487 |
.embedl-deploy__chip { border-radius: 6px; padding: 3px 6px; font-size: 11px; font-weight: 500; color: #8bd1d1; background: rgba(67, 154, 154, .12); white-space: nowrap; }
|
| 17488 |
.embedl-deploy__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 100; width: max-content; min-width: 280px; max-width: calc(100vw - 24px); padding: 6px; max-height: min(420px, 65vh); overflow-y: auto; border: 1px solid #354258; border-radius: 12px; background: #111c2d; color: #e4ebf5; box-shadow: 0 12px 32px #0005; }
|
|
|
|
| 17483 |
.embedl-deploy { position: relative; display: flex; align-items: center; }
|
| 17484 |
.embedl-deploy__trigger { white-space: nowrap; }
|
| 17485 |
.embedl-deploy__trigger::before { content: none; }
|
| 17486 |
+
/* Run on device: the header's primary call to action. Filled teal with dark
|
| 17487 |
+
ink (contrast ~13:1), a brighter border ring and a soft glow; the
|
| 17488 |
+
neighbouring pills stay ghost/outlined. */
|
| 17489 |
+
.viewer-route__actions .pill.embedl-deploy__trigger {
|
| 17490 |
+
background: #3cf0b4; color: var(--ink, #07100d); border: 1px solid #9af9da; font-weight: 700;
|
| 17491 |
+
box-shadow: 0 0 0 1px rgba(60, 240, 180, 0.35), 0 0 18px rgba(60, 240, 180, 0.38);
|
| 17492 |
+
min-height: 42px; /* match the neighbouring pills even without a chip */
|
| 17493 |
+
}
|
| 17494 |
+
.viewer-route__actions .pill.embedl-deploy__trigger:hover {
|
| 17495 |
+
background: #62f6c6; border-color: #c2fcea; color: var(--ink, #07100d);
|
| 17496 |
+
box-shadow: 0 0 0 1px rgba(60, 240, 180, 0.5), 0 0 26px rgba(60, 240, 180, 0.55);
|
| 17497 |
+
}
|
| 17498 |
+
.viewer-route__actions .pill.embedl-deploy__trigger:active {
|
| 17499 |
+
background: #2bdca2; box-shadow: 0 0 0 1px rgba(60, 240, 180, 0.4), 0 0 10px rgba(60, 240, 180, 0.3);
|
| 17500 |
+
}
|
| 17501 |
+
.viewer-route__actions .pill.embedl-deploy__trigger:focus-visible {
|
| 17502 |
+
outline: none; background: #62f6c6; color: var(--ink, #07100d);
|
| 17503 |
+
box-shadow: 0 0 0 2px #050914, 0 0 0 4px #eafff8, 0 0 22px rgba(60, 240, 180, 0.5);
|
| 17504 |
+
}
|
| 17505 |
+
.viewer-route__actions .pill.embedl-deploy__trigger .embedl-deploy__chip {
|
| 17506 |
+
color: #3cf0b4; background: #07211a; font-weight: 700;
|
| 17507 |
+
}
|
| 17508 |
+
.theme-light .viewer-route__actions .pill.embedl-deploy__trigger {
|
| 17509 |
+
background: #2ee6a8; border-color: #17b282;
|
| 17510 |
+
box-shadow: 0 0 0 1px rgba(23, 178, 130, 0.25), 0 4px 14px rgba(23, 178, 130, 0.3);
|
| 17511 |
+
}
|
| 17512 |
+
.theme-light .viewer-route__actions .pill.embedl-deploy__trigger:hover { background: #4aefb9; border-color: #13a074; }
|
| 17513 |
+
.theme-light .viewer-route__actions .pill.embedl-deploy__trigger:focus-visible {
|
| 17514 |
+
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #0b5c45, 0 4px 14px rgba(23, 178, 130, 0.3);
|
| 17515 |
+
}
|
| 17516 |
+
.theme-light .viewer-route__actions .pill.embedl-deploy__trigger .embedl-deploy__chip { color: #2ee6a8; background: #07211a; }
|
| 17517 |
.embedl-deploy__icon { display: inline-flex; }
|
| 17518 |
.embedl-deploy__chip { border-radius: 6px; padding: 3px 6px; font-size: 11px; font-weight: 500; color: #8bd1d1; background: rgba(67, 154, 154, .12); white-space: nowrap; }
|
| 17519 |
.embedl-deploy__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 100; width: max-content; min-width: 280px; max-width: calc(100vw - 24px); padding: 6px; max-height: min(420px, 65vh); overflow-y: auto; border: 1px solid #354258; border-radius: 12px; background: #111c2d; color: #e4ebf5; box-shadow: 0 12px 32px #0005; }
|
index.html
CHANGED
|
@@ -175,7 +175,7 @@
|
|
| 175 |
}
|
| 176 |
})();
|
| 177 |
</script>
|
| 178 |
-
<link rel="stylesheet" href="hf-shell-css-
|
| 179 |
<script>
|
| 180 |
window.dataLayer = window.dataLayer || [];
|
| 181 |
window.gtag = function () {};
|
|
@@ -183,7 +183,7 @@
|
|
| 183 |
window.HFVIEWER_PRODUCT_CONTEXT = Object.freeze({
|
| 184 |
product_surface: "hf_space",
|
| 185 |
space_repo: "embedl/hfviewer",
|
| 186 |
-
space_revision: "hfviewer-
|
| 187 |
});
|
| 188 |
try {
|
| 189 |
var initialUrl = new URL(window.location.href);
|
|
@@ -6741,7 +6741,7 @@ body.sx-viewer-open { overflow: hidden; }
|
|
| 6741 |
|
| 6742 |
<canvas class="laser-layer" id="laserLayer" aria-hidden="true"></canvas>
|
| 6743 |
|
| 6744 |
-
<script src="hf-shell-app-
|
| 6745 |
<link rel="stylesheet" href="hf-shell-css-2417117ca803.css">
|
| 6746 |
<script>
|
| 6747 |
(function () {
|
|
@@ -11012,7 +11012,7 @@ body.sx-viewer-open { overflow: hidden; }
|
|
| 11012 |
window.hfviewerAnalyticsBridge?.capture?.(eventName, Object.assign({
|
| 11013 |
product_surface: "hf_space",
|
| 11014 |
space_repo: "embedl/hfviewer",
|
| 11015 |
-
space_revision: "hfviewer-
|
| 11016 |
}, properties || {}));
|
| 11017 |
} catch (error) { /* analytics must never break navigation */ }
|
| 11018 |
}
|
|
@@ -11233,7 +11233,7 @@ body.sx-viewer-open { overflow: hidden; }
|
|
| 11233 |
})();
|
| 11234 |
</script>
|
| 11235 |
|
| 11236 |
-
<script src="space-shell.js?v=
|
| 11237 |
<script type="module" src="space-auth.js?v=de6378a7ebb6"></script>
|
| 11238 |
|
| 11239 |
</body>
|
|
|
|
| 175 |
}
|
| 176 |
})();
|
| 177 |
</script>
|
| 178 |
+
<link rel="stylesheet" href="hf-shell-css-212d31f116a0.css">
|
| 179 |
<script>
|
| 180 |
window.dataLayer = window.dataLayer || [];
|
| 181 |
window.gtag = function () {};
|
|
|
|
| 183 |
window.HFVIEWER_PRODUCT_CONTEXT = Object.freeze({
|
| 184 |
product_surface: "hf_space",
|
| 185 |
space_repo: "embedl/hfviewer",
|
| 186 |
+
space_revision: "hfviewer-a445f87628ef",
|
| 187 |
});
|
| 188 |
try {
|
| 189 |
var initialUrl = new URL(window.location.href);
|
|
|
|
| 6741 |
|
| 6742 |
<canvas class="laser-layer" id="laserLayer" aria-hidden="true"></canvas>
|
| 6743 |
|
| 6744 |
+
<script src="hf-shell-app-f056da15f06a.js"></script>
|
| 6745 |
<link rel="stylesheet" href="hf-shell-css-2417117ca803.css">
|
| 6746 |
<script>
|
| 6747 |
(function () {
|
|
|
|
| 11012 |
window.hfviewerAnalyticsBridge?.capture?.(eventName, Object.assign({
|
| 11013 |
product_surface: "hf_space",
|
| 11014 |
space_repo: "embedl/hfviewer",
|
| 11015 |
+
space_revision: "hfviewer-a445f87628ef",
|
| 11016 |
}, properties || {}));
|
| 11017 |
} catch (error) { /* analytics must never break navigation */ }
|
| 11018 |
}
|
|
|
|
| 11233 |
})();
|
| 11234 |
</script>
|
| 11235 |
|
| 11236 |
+
<script src="space-shell.js?v=aa3fb7997cfe"></script>
|
| 11237 |
<script type="module" src="space-auth.js?v=de6378a7ebb6"></script>
|
| 11238 |
|
| 11239 |
</body>
|
space-shell.js
CHANGED
|
@@ -164,7 +164,7 @@
|
|
| 164 |
// This script also runs in locally prepared snapshots and Hub iframes.
|
| 165 |
// The build's HFVIEWER_PRODUCT_CONTEXT identifies those Space shells.
|
| 166 |
var slots = createSpaceLaunchSlots();
|
| 167 |
-
import('./visualizer/hfDeployButton.js?v=20261022-run-
|
| 168 |
api.initializeDeployPreview(window);
|
| 169 |
var actions = document.getElementById('sx-model-actions');
|
| 170 |
if (actions) {
|
|
@@ -484,7 +484,11 @@
|
|
| 484 |
".sx-launch-slot[data-label=long] .sx-launch-long,.sx-launch-slot[data-label=short] .sx-launch-short,.sx-launch-slot[data-label=narrow] .sx-launch-narrow{display:inline}" +
|
| 485 |
"#sx-header .sx-launch-slot a{font-size:11px;padding:6px}" +
|
| 486 |
"#sx-model-actions:has(>.embedl-deploy) [data-action=embed],#sx-model-actions:has(>.embedl-deploy) [data-action=edit-readme],#sx-model-actions:has(>.embedl-deploy) [data-action=primary]:not(.sx-compact-action--primary){display:none!important}" +
|
| 487 |
-
"#sx-model-actions .embedl-deploy__trigger{height:32px;min-height:32px;font-size:11.5px;padding:0 8px;gap:5px}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 488 |
"@media(max-width:900px){#sx-model-actions .embedl-deploy__label{display:none}#sx-model-actions .embedl-deploy__trigger{width:36px;height:36px;padding:0;justify-content:center}}" +
|
| 489 |
"#sx-header .sx-launch-slot:has(a[hidden]){display:none}" +
|
| 490 |
"@media(max-width:640px){#sx-header:has(.hfnx-launch-pill:not([hidden])) .sx-brand{display:none}}" +
|
|
|
|
| 164 |
// This script also runs in locally prepared snapshots and Hub iframes.
|
| 165 |
// The build's HFVIEWER_PRODUCT_CONTEXT identifies those Space shells.
|
| 166 |
var slots = createSpaceLaunchSlots();
|
| 167 |
+
import('./visualizer/hfDeployButton.js?v=20261022-run-2').then(function (api) {
|
| 168 |
api.initializeDeployPreview(window);
|
| 169 |
var actions = document.getElementById('sx-model-actions');
|
| 170 |
if (actions) {
|
|
|
|
| 484 |
".sx-launch-slot[data-label=long] .sx-launch-long,.sx-launch-slot[data-label=short] .sx-launch-short,.sx-launch-slot[data-label=narrow] .sx-launch-narrow{display:inline}" +
|
| 485 |
"#sx-header .sx-launch-slot a{font-size:11px;padding:6px}" +
|
| 486 |
"#sx-model-actions:has(>.embedl-deploy) [data-action=embed],#sx-model-actions:has(>.embedl-deploy) [data-action=edit-readme],#sx-model-actions:has(>.embedl-deploy) [data-action=primary]:not(.sx-compact-action--primary){display:none!important}" +
|
| 487 |
+
"#sx-model-actions .embedl-deploy__trigger{height:32px;min-height:32px;font-size:11.5px;padding:0 8px;gap:5px}" +
|
| 488 |
+
"#sx-model-actions .embedl-deploy__trigger{background:#3cf0b4;color:#07100d;border:1px solid #9af9da;font-weight:700;box-shadow:0 0 0 1px rgba(60,240,180,.35),0 0 12px rgba(60,240,180,.35)}" +
|
| 489 |
+
"#sx-model-actions .embedl-deploy__trigger:hover{background:#62f6c6;border-color:#c2fcea;color:#07100d;box-shadow:0 0 0 1px rgba(60,240,180,.5),0 0 18px rgba(60,240,180,.5)}" +
|
| 490 |
+
"#sx-model-actions .embedl-deploy__trigger:focus-visible{outline:none;background:#62f6c6;color:#07100d;box-shadow:0 0 0 2px #0d0b14,0 0 0 4px #eafff8}" +
|
| 491 |
+
"#sx-model-actions .embedl-deploy__trigger .embedl-deploy__chip{color:#3cf0b4;background:#07211a;font-weight:700}#sx-model-actions .embedl-deploy__trigger>.embedl-deploy__chip{display:none}" +
|
| 492 |
"@media(max-width:900px){#sx-model-actions .embedl-deploy__label{display:none}#sx-model-actions .embedl-deploy__trigger{width:36px;height:36px;padding:0;justify-content:center}}" +
|
| 493 |
"#sx-header .sx-launch-slot:has(a[hidden]){display:none}" +
|
| 494 |
"@media(max-width:640px){#sx-header:has(.hfnx-launch-pill:not([hidden])) .sx-brand{display:none}}" +
|
visualizer/hfDeployButton.js
CHANGED
|
@@ -97,8 +97,9 @@ export function headlineChip(headline) {
|
|
| 97 |
export function modelChip(builds) {
|
| 98 |
const best = builds.reduce((a, b) => (speedup(b.headline) || 0) > (speedup(a?.headline) || 0) ? b : a, null);
|
| 99 |
if (best) return headlineChip(best.headline);
|
|
|
|
| 100 |
const count = new Set(builds.map(build => build.hardware)).size;
|
| 101 |
-
return
|
| 102 |
}
|
| 103 |
|
| 104 |
export async function fetchJson(url, fetcher, timeoutMs = 2500) {
|
|
@@ -231,7 +232,9 @@ export function createDeployAction({ document: doc, entry, repoId, mode, space =
|
|
| 231 |
const icon = span('embedl-deploy__icon', '');
|
| 232 |
icon.setAttribute('aria-hidden', 'true');
|
| 233 |
icon.innerHTML = DEPLOY_CHIP_ICON;
|
| 234 |
-
|
|
|
|
|
|
|
| 235 |
root.append(trigger);
|
| 236 |
function link(el, page, hardware, placement) {
|
| 237 |
// Pass the raw value to URLSearchParams: encode the HF slash exactly once.
|
|
|
|
| 97 |
export function modelChip(builds) {
|
| 98 |
const best = builds.reduce((a, b) => (speedup(b.headline) || 0) > (speedup(a?.headline) || 0) ? b : a, null);
|
| 99 |
if (best) return headlineChip(best.headline);
|
| 100 |
+
// No speed-up: a device count only helps when there is a choice to make.
|
| 101 |
const count = new Set(builds.map(build => build.hardware)).size;
|
| 102 |
+
return count > 1 ? `${count} devices` : '';
|
| 103 |
}
|
| 104 |
|
| 105 |
export async function fetchJson(url, fetcher, timeoutMs = 2500) {
|
|
|
|
| 232 |
const icon = span('embedl-deploy__icon', '');
|
| 233 |
icon.setAttribute('aria-hidden', 'true');
|
| 234 |
icon.innerHTML = DEPLOY_CHIP_ICON;
|
| 235 |
+
const chip = modelChip(entry.builds);
|
| 236 |
+
trigger.append(icon, span('embedl-deploy__label', 'Run on device'));
|
| 237 |
+
if (chip) trigger.append(span('embedl-deploy__chip', chip));
|
| 238 |
root.append(trigger);
|
| 239 |
function link(el, page, hardware, placement) {
|
| 240 |
// Pass the raw value to URLSearchParams: encode the HF slash exactly once.
|