@drawbridge/components 0.0.56 → 0.0.58

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.
@@ -28,6 +28,7 @@ var defaults = {
28
28
  family: "Roboto Flex",
29
29
  transform: "none"
30
30
  };
31
+ var FALLBACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
31
32
  var toWeight = (value) => {
32
33
  var _a;
33
34
  if (value.includes("italic")) return (_a = value.match(/^\d+/)) == null ? void 0 : _a[0];
@@ -50,11 +51,11 @@ var ProviderFont = (0, import_react.memo)(({
50
51
  ];
51
52
  const fonts2 = {
52
53
  body: {
53
- fontFamily: '"' + bodyFamily + '"',
54
+ fontFamily: '"' + bodyFamily + '", ' + FALLBACK,
54
55
  textTransform: (body == null ? void 0 : body.transform) || defaults.transform
55
56
  },
56
57
  heading: {
57
- fontFamily: '"' + headingFamily + '"',
58
+ fontFamily: '"' + headingFamily + '", ' + FALLBACK,
58
59
  textTransform: (heading == null ? void 0 : heading.transform) || defaults.transform
59
60
  }
60
61
  };
@@ -69,7 +70,7 @@ var ProviderFont = (0, import_react.memo)(({
69
70
  url2.push((same ? "," : ":") + heading.weight);
70
71
  fonts2.heading.fontWeight = toWeight(heading.weight);
71
72
  }
72
- url2.push("&display=swap");
73
+ url2.push("&display=optional");
73
74
  return { url: url2, fonts: fonts2 };
74
75
  },
75
76
  [body, heading]
@@ -81,6 +82,10 @@ var ProviderFont = (0, import_react.memo)(({
81
82
  ...{
82
83
  href: url.join(""),
83
84
  rel: "stylesheet",
85
+ // precedence makes React hoist + dedupe the stylesheet into
86
+ // <head> during SSR so the font CSS is discovered early
87
+ // instead of mid-tree (late) — pulls the font load forward.
88
+ precedence: "high",
84
89
  ...onError && {
85
90
  onError
86
91
  }
@@ -5,6 +5,7 @@ var defaults = {
5
5
  family: "Roboto Flex",
6
6
  transform: "none"
7
7
  };
8
+ var FALLBACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
8
9
  var toWeight = (value) => {
9
10
  var _a;
10
11
  if (value.includes("italic")) return (_a = value.match(/^\d+/)) == null ? void 0 : _a[0];
@@ -27,11 +28,11 @@ var ProviderFont = memo(({
27
28
  ];
28
29
  const fonts2 = {
29
30
  body: {
30
- fontFamily: '"' + bodyFamily + '"',
31
+ fontFamily: '"' + bodyFamily + '", ' + FALLBACK,
31
32
  textTransform: (body == null ? void 0 : body.transform) || defaults.transform
32
33
  },
33
34
  heading: {
34
- fontFamily: '"' + headingFamily + '"',
35
+ fontFamily: '"' + headingFamily + '", ' + FALLBACK,
35
36
  textTransform: (heading == null ? void 0 : heading.transform) || defaults.transform
36
37
  }
37
38
  };
@@ -46,7 +47,7 @@ var ProviderFont = memo(({
46
47
  url2.push((same ? "," : ":") + heading.weight);
47
48
  fonts2.heading.fontWeight = toWeight(heading.weight);
48
49
  }
49
- url2.push("&display=swap");
50
+ url2.push("&display=optional");
50
51
  return { url: url2, fonts: fonts2 };
51
52
  },
52
53
  [body, heading]
@@ -58,6 +59,10 @@ var ProviderFont = memo(({
58
59
  ...{
59
60
  href: url.join(""),
60
61
  rel: "stylesheet",
62
+ // precedence makes React hoist + dedupe the stylesheet into
63
+ // <head> during SSR so the font CSS is discovered early
64
+ // instead of mid-tree (late) — pulls the font load forward.
65
+ precedence: "high",
61
66
  ...onError && {
62
67
  onError
63
68
  }
package/dist/video.js CHANGED
@@ -166,7 +166,11 @@ var Video = ({
166
166
  "div",
167
167
  {
168
168
  ...{
169
- className: "w-full h-full flex justify-center items-center"
169
+ // absolute overlay, NOT in-flow: an in-flow w-full/h-full loader
170
+ // borrows the reserved gallery box's height and collapses to 0
171
+ // when the video is ready = a ~0.65 CLS. Overlaying it (the box
172
+ // already reserves its height) means removing it shifts nothing.
173
+ className: "absolute inset-0 flex justify-center items-center"
170
174
  },
171
175
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
172
176
  loader_default,
package/dist/video.mjs CHANGED
@@ -93,7 +93,11 @@ var Video = ({
93
93
  "div",
94
94
  {
95
95
  ...{
96
- className: "w-full h-full flex justify-center items-center"
96
+ // absolute overlay, NOT in-flow: an in-flow w-full/h-full loader
97
+ // borrows the reserved gallery box's height and collapses to 0
98
+ // when the video is ready = a ~0.65 CLS. Overlaying it (the box
99
+ // already reserves its height) means removing it shifts nothing.
100
+ className: "absolute inset-0 flex justify-center items-center"
97
101
  },
98
102
  children: /* @__PURE__ */ jsx(
99
103
  loader_default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/components",
3
- "version": "0.0.56",
3
+ "version": "0.0.58",
4
4
  "exports": {
5
5
  "./advertisement": {
6
6
  "types": "./types/advertisement.d.ts",
@@ -357,7 +357,7 @@
357
357
  "tsup": "8.5.1"
358
358
  },
359
359
  "dependencies": {
360
- "@drawbridge/drawbridge-agents": "0.0.11",
360
+ "@drawbridge/drawbridge-agents": "0.1.10",
361
361
  "embla-carousel-fade": "8.6.0",
362
362
  "embla-carousel-react": "8.6.0",
363
363
  "react-player": "2.16.0",