@datalayer/agent-runtimes 1.3.32 → 1.3.34

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.
@@ -1 +1,2 @@
1
1
  import '../../../style/primer-primitives.css';
2
+ import '@datalayer/primer-addons/style/loop-face.css';
@@ -10,8 +10,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  * or `?assistant=thinking&mode=light`, or a character idle,
11
11
  * `?character=wizard&mode=dark` (Datalayer's, or the owl a plugin contributes).
12
12
  *
13
- * It sets `data-pictures-ready` on the document once the fonts are in and two
14
- * frames have painted, which is what the capture waits for.
13
+ * It sets `data-pictures-ready` on the document once the fonts are in — Inter
14
+ * in its two weights, served by this page (T-04) — and two frames have
15
+ * painted, which is what the capture waits for.
15
16
  *
16
17
  * @module stories/loop/pictures-main
17
18
  */
@@ -23,6 +24,9 @@ import { useEffect } from 'react';
23
24
  import { createRoot } from 'react-dom/client';
24
25
  import { ASSISTANT_PICTURES, AssistantScreen, CHARACTER_PICTURES, CharacterScreen, REFERENCE_SCREEN_COMPONENTS, REFERENCE_SCREENS, REFERENCE_THEMES, ReferenceTheme, } from './ReferenceScreens';
25
26
  import '../../../style/primer-primitives.css';
27
+ // The `loop` theme's face (LOOP T-04): Inter and its metric-matched fallback,
28
+ // served by this page's own Vite, as the landing serves them from its build.
29
+ import '@datalayer/primer-addons/style/loop-face.css';
26
30
  const params = new URLSearchParams(window.location.search);
27
31
  const theme = (REFERENCE_THEMES.includes(params.get('theme'))
28
32
  ? params.get('theme')
@@ -34,7 +38,14 @@ const character = params.get('character');
34
38
  function Ready() {
35
39
  useEffect(() => {
36
40
  let cancelled = false;
37
- void document.fonts.ready.then(() => {
41
+ // Inter is fetched only once text asks for it: ask for both weights, so
42
+ // that the picture is never taken in the fallback.
43
+ void Promise.all([
44
+ document.fonts.load('400 14px "Inter Variable"'),
45
+ document.fonts.load('600 14px "Inter Variable"'),
46
+ ])
47
+ .then(() => document.fonts.ready)
48
+ .then(() => {
38
49
  requestAnimationFrame(() => requestAnimationFrame(() => {
39
50
  if (!cancelled) {
40
51
  document.documentElement.setAttribute('data-pictures-ready', '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.3.32",
3
+ "version": "1.3.34",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",