@oxy.so/bloom 7.6.0 → 7.7.1
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/docs/admonition.mdx +12 -3
- package/docs/adoption-matrix.mdx +3 -3
- package/docs/zoomable-media-gallery.mdx +16 -0
- package/lib/commonjs/admonition/Admonition.js +53 -31
- package/lib/commonjs/admonition/Admonition.js.map +1 -1
- package/lib/commonjs/media-flight/MediaSurface.js +18 -6
- package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
- package/lib/module/admonition/Admonition.js +53 -31
- package/lib/module/admonition/Admonition.js.map +1 -1
- package/lib/module/media-flight/MediaSurface.js +18 -6
- package/lib/module/media-flight/MediaSurface.js.map +1 -1
- package/lib/typescript/commonjs/admonition/Admonition.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/types.d.ts +6 -0
- package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
- package/lib/typescript/module/admonition/Admonition.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/types.d.ts +6 -0
- package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/admonition/Admonition.tsx +49 -28
- package/src/media-flight/MediaSurface.tsx +16 -4
- package/src/media-flight/types.ts +6 -0
- package/src/__tests__/support/adoption-matrix.ts +0 -683
- package/src/__tests__/support/card-surface.ts +0 -25
- package/src/__tests__/support/collision-fixture-barrel.ts +0 -20
- package/src/__tests__/support/commerce-harness.tsx +0 -97
- package/src/__tests__/support/composite.ts +0 -68
- package/src/__tests__/support/constructed-style-sheets.ts +0 -68
- package/src/__tests__/support/messages-in.ts +0 -10
- package/src/__tests__/support/press-host.ts +0 -30
- package/src/__tests__/support/rendered-style.ts +0 -99
- package/src/__tests__/support/unread-hook-fixture.ts +0 -33
- package/src/__tests__/support/worklet-capture-fixture.tsx +0 -28
- package/src/agent-avatar/__tests__/artwork-golden.json +0 -774
- package/src/agent-creator/__tests__/support/character-runtime-fixture.tsx +0 -26
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +0 -9346
- package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +0 -69
- package/src/theme/__tests__/fixtures/color-engine-golden.json +0 -1
package/docs/admonition.mdx
CHANGED
|
@@ -40,16 +40,25 @@ import {
|
|
|
40
40
|
</AdmonitionRoot>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
## `type` picks the icon and
|
|
43
|
+
## `type` picks the icon, tint and border together
|
|
44
44
|
|
|
45
45
|
| `type` | for |
|
|
46
46
|
| --------- | ------------------------------------------------------- |
|
|
47
|
-
| `info` |
|
|
48
|
-
| `tip` | a suggestion —
|
|
47
|
+
| `info` | an information note |
|
|
48
|
+
| `tip` | a suggestion — success tint and a lightbulb |
|
|
49
49
|
| `warning` | something that could go wrong if they continue |
|
|
50
50
|
| `error` | something that has gone wrong |
|
|
51
51
|
| `apology` | a limitation on our side, not the reader's mistake |
|
|
52
52
|
|
|
53
|
+
The shared design uses 16px padding and corners, a 12px icon gap, a soft
|
|
54
|
+
status surface and a subtle outline. The icon reads the matching text token;
|
|
55
|
+
text remains the normal foreground. The outline alone has 30% opacity, so
|
|
56
|
+
its token stays valid on native and web and never dims the content.
|
|
57
|
+
|
|
58
|
+
`AdmonitionContent` accepts rich content directly. Use the compound API for
|
|
59
|
+
a heading and Markdown blocks instead of putting block elements inside
|
|
60
|
+
`AdmonitionText`.
|
|
61
|
+
|
|
53
62
|
`AdmonitionIcon` reads the type from context, so the icon and the border cannot
|
|
54
63
|
disagree — which is how an `error` callout ends up with a warning icon when the
|
|
55
64
|
two are set by hand.
|
package/docs/adoption-matrix.mdx
CHANGED
|
@@ -112,7 +112,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
112
112
|
| `activity-feed` | `@oxy.so/bloom/activity-feed` + barrel | universal | `activity-feed.mdx` | yes | 1 | | | | |
|
|
113
113
|
| `activity-heatmap` | `@oxy.so/bloom/activity-heatmap` + barrel | universal | `activity-heatmap.mdx` | yes | 1 | | | | |
|
|
114
114
|
| `address` | `@oxy.so/bloom/address` + barrel | universal | `address.mdx` | yes | 2 | n/a¹ | | | |
|
|
115
|
-
| `admonition` | `@oxy.so/bloom/admonition` + barrel | universal | `admonition.mdx` | yes |
|
|
115
|
+
| `admonition` | `@oxy.so/bloom/admonition` + barrel | universal | `admonition.mdx` | yes | 2 | | | | |
|
|
116
116
|
| `agent-avatar` | `@oxy.so/bloom/agent-avatar` + barrel | universal | `agent-avatar.mdx` | yes | 15 | | | | |
|
|
117
117
|
| `agent-chat` | `@oxy.so/bloom/agent-chat` + barrel | web fork | `agent-chat.mdx` | yes | 3 | n/a¹ | | | reads |
|
|
118
118
|
| `agent-creator` | `@oxy.so/bloom/agent-creator` + barrel | web fork | `agent-creator.mdx` | yes | 5 | reads | | | |
|
|
@@ -222,7 +222,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
222
222
|
| `map-marker` | `@oxy.so/bloom/map-marker` + barrel | universal | `map-marker.mdx` | yes | 3 | n/a¹ | | | |
|
|
223
223
|
| `media-card` | `@oxy.so/bloom/media-card` + barrel | universal | `media-card.mdx` | yes | 5 | | | | |
|
|
224
224
|
| `media-controls` | `@oxy.so/bloom/media-controls` + barrel | universal | `media-controls.mdx` | yes | 4 | n/a¹ | reads | | |
|
|
225
|
-
| `media-flight` | `@oxy.so/bloom/media-flight` | web fork | `media-flight.mdx` | yes |
|
|
225
|
+
| `media-flight` | `@oxy.so/bloom/media-flight` | web fork | `media-flight.mdx` | yes | 4 | | | | |
|
|
226
226
|
| `media-header` | `@oxy.so/bloom/media-header` + barrel | universal | `media-header.mdx` | yes | 4 | | reads | | |
|
|
227
227
|
| `media-inset-border` | `@oxy.so/bloom/media-inset-border` + barrel | universal | `media-inset-border.mdx` | yes | 1 | | | | |
|
|
228
228
|
| `media-player` | `@oxy.so/bloom/media-player` + barrel | universal | `media-player.mdx` | yes | 5 | | reads | | |
|
|
@@ -308,7 +308,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
308
308
|
| `tenancy` | `@oxy.so/bloom/tenancy` + barrel | universal | `tenancy.mdx` | yes | 5 | | reads | | |
|
|
309
309
|
| `text-field` | `@oxy.so/bloom/text-field` + barrel | universal | `text-field.mdx` | yes | 17 | reads | reads | | |
|
|
310
310
|
| `textarea` | `@oxy.so/bloom/textarea` + barrel | universal | `textarea.mdx` | yes | 4 | reads | reads | | n/a¹ |
|
|
311
|
-
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes |
|
|
311
|
+
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 361 | | | n/a¹ | reads |
|
|
312
312
|
| `theme-toggle` | `@oxy.so/bloom/theme-toggle` + barrel | universal | `theme-toggle.mdx` | yes | 2 | n/a¹ | | | |
|
|
313
313
|
| `toast` | `@oxy.so/bloom/toast` + barrel | universal | `toast.mdx` | yes | 17 | | | | |
|
|
314
314
|
| `tooltip` | `@oxy.so/bloom/tooltip` + barrel | web fork | `tooltip.mdx` | yes | 1 | | | | |
|
|
@@ -53,6 +53,22 @@ Give a video an `aspectRatio`. Unlike an image there is nothing to probe, so
|
|
|
53
53
|
without one the page opens at the default ratio and resizes when the first
|
|
54
54
|
frame arrives.
|
|
55
55
|
|
|
56
|
+
For an image opened from a thumbnail, pass that exact URL as `previewUri`:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
gallery.current?.open([
|
|
60
|
+
{ uri: fullImageUrl, previewUri: thumbnailUrl, aspectRatio: 1.5 },
|
|
61
|
+
], 0, thumbnailRect);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The viewer reuses the thumbnail from the image cache immediately and loads the
|
|
65
|
+
full image eagerly at high priority. Expo Image replaces the preview when the
|
|
66
|
+
full image is ready, with a short crossfade; a failed full image keeps its
|
|
67
|
+
preview. Both images use the same `contain` fit, so the upgrade does not crop or
|
|
68
|
+
resize the picture. Supply the intrinsic aspect ratio to avoid a size probe.
|
|
69
|
+
Inactive pages and strip tiles use the thumbnail; opening a gallery does not
|
|
70
|
+
download every full image. Sharing still uses the full `uri`.
|
|
71
|
+
|
|
56
72
|
## Exactly one video view is mounted
|
|
57
73
|
|
|
58
74
|
The ACTIVE page. Every other page, and every thumbnail-strip tile, renders the
|
|
@@ -16,7 +16,9 @@ var _useTheme = require("../theme/use-theme.js");
|
|
|
16
16
|
var _index = require("../typography/index.js");
|
|
17
17
|
var _button = require("../button");
|
|
18
18
|
var _RiInformationLine = require("../icons/remix/RiInformationLine.js");
|
|
19
|
-
var
|
|
19
|
+
var _RiForbidLine = require("../icons/remix/RiForbidLine.js");
|
|
20
|
+
var _RiLightbulbLine = require("../icons/remix/RiLightbulbLine.js");
|
|
21
|
+
var _accentColors = require("../theme/accent-colors.js");
|
|
20
22
|
var _RiAlertLine = require("../icons/remix/RiAlertLine.js");
|
|
21
23
|
var _RiEmotionUnhappyLine = require("../icons/remix/RiEmotionUnhappyLine.js");
|
|
22
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -27,27 +29,33 @@ const AdmonitionContext = /*#__PURE__*/(0, _react.createContext)({
|
|
|
27
29
|
AdmonitionContext.displayName = 'AdmonitionContext';
|
|
28
30
|
const ICON_MAP = {
|
|
29
31
|
info: _RiInformationLine.RiInformationLine,
|
|
30
|
-
tip:
|
|
32
|
+
tip: _RiLightbulbLine.RiLightbulbLine,
|
|
31
33
|
warning: _RiAlertLine.RiAlertLine,
|
|
32
|
-
error:
|
|
34
|
+
error: _RiForbidLine.RiForbidLine,
|
|
33
35
|
apology: _RiEmotionUnhappyLine.RiEmotionUnhappyLine
|
|
34
36
|
};
|
|
37
|
+
const TONE_MAP = {
|
|
38
|
+
info: 'info',
|
|
39
|
+
tip: 'success',
|
|
40
|
+
warning: 'warning',
|
|
41
|
+
error: 'error',
|
|
42
|
+
apology: 'default'
|
|
43
|
+
};
|
|
35
44
|
function AdmonitionIcon() {
|
|
36
45
|
const theme = (0, _useTheme.useTheme)();
|
|
37
46
|
const {
|
|
38
47
|
type
|
|
39
48
|
} = (0, _react.useContext)(AdmonitionContext);
|
|
40
49
|
const IconComponent = ICON_MAP[type];
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
size: "md"
|
|
50
|
+
const colors = (0, _accentColors.resolveAccentColors)(theme.colors, TONE_MAP[type], 'subtle');
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
style: styles.icon,
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
55
|
+
fill: colors.foreground,
|
|
56
|
+
width: 20,
|
|
57
|
+
height: 20
|
|
58
|
+
})
|
|
51
59
|
});
|
|
52
60
|
}
|
|
53
61
|
AdmonitionIcon.displayName = 'AdmonitionIcon';
|
|
@@ -98,23 +106,24 @@ function AdmonitionRoot({
|
|
|
98
106
|
style
|
|
99
107
|
}) {
|
|
100
108
|
const theme = (0, _useTheme.useTheme)();
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
warning: theme.colors.warning,
|
|
105
|
-
error: theme.colors.error,
|
|
106
|
-
apology: theme.colors.border
|
|
107
|
-
};
|
|
109
|
+
const tone = TONE_MAP[type];
|
|
110
|
+
const colors = (0, _accentColors.resolveAccentColors)(theme.colors, tone, 'subtle');
|
|
111
|
+
const border = (0, _accentColors.resolveAccentColors)(theme.colors, tone, 'solid').border;
|
|
108
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AdmonitionContext.Provider, {
|
|
109
113
|
value: {
|
|
110
114
|
type
|
|
111
115
|
},
|
|
112
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
116
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
113
117
|
style: [styles.outer, {
|
|
114
|
-
|
|
115
|
-
backgroundColor: theme.colors.background
|
|
118
|
+
backgroundColor: colors.background
|
|
116
119
|
}, style],
|
|
117
|
-
children:
|
|
120
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
121
|
+
pointerEvents: "none",
|
|
122
|
+
"aria-hidden": true,
|
|
123
|
+
style: [styles.border, {
|
|
124
|
+
borderColor: border
|
|
125
|
+
}]
|
|
126
|
+
}), children]
|
|
118
127
|
})
|
|
119
128
|
});
|
|
120
129
|
}
|
|
@@ -145,26 +154,39 @@ function Admonition({
|
|
|
145
154
|
Admonition.displayName = 'Admonition';
|
|
146
155
|
const styles = _reactNative.StyleSheet.create({
|
|
147
156
|
outer: {
|
|
148
|
-
padding:
|
|
149
|
-
borderRadius:
|
|
150
|
-
|
|
157
|
+
padding: 16,
|
|
158
|
+
borderRadius: 16,
|
|
159
|
+
position: 'relative'
|
|
160
|
+
},
|
|
161
|
+
border: {
|
|
162
|
+
position: 'absolute',
|
|
163
|
+
top: 0,
|
|
164
|
+
right: 0,
|
|
165
|
+
bottom: 0,
|
|
166
|
+
left: 0,
|
|
167
|
+
borderRadius: 16,
|
|
168
|
+
borderWidth: 1,
|
|
169
|
+
opacity: 0.3
|
|
170
|
+
},
|
|
171
|
+
icon: {
|
|
172
|
+
flexShrink: 0
|
|
151
173
|
},
|
|
152
174
|
row: {
|
|
153
175
|
width: '100%',
|
|
154
176
|
flexDirection: 'row',
|
|
155
177
|
alignItems: 'flex-start',
|
|
156
|
-
gap:
|
|
178
|
+
gap: 12
|
|
157
179
|
},
|
|
158
180
|
content: {
|
|
159
|
-
gap:
|
|
181
|
+
gap: 4,
|
|
160
182
|
flex: 1,
|
|
183
|
+
minWidth: 0,
|
|
161
184
|
minHeight: 20,
|
|
162
185
|
justifyContent: 'center'
|
|
163
186
|
},
|
|
164
187
|
text: {
|
|
165
188
|
fontSize: 14,
|
|
166
|
-
lineHeight:
|
|
167
|
-
paddingRight: 12
|
|
189
|
+
lineHeight: 22
|
|
168
190
|
}
|
|
169
191
|
});
|
|
170
192
|
//# sourceMappingURL=Admonition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_index","_button","_RiInformationLine","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_index","_button","_RiInformationLine","_RiForbidLine","_RiLightbulbLine","_accentColors","_RiAlertLine","_RiEmotionUnhappyLine","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AdmonitionContext","createContext","type","displayName","ICON_MAP","info","CircleInfoIcon","tip","LightbulbIcon","warning","WarningIcon","error","ForbidIcon","apology","EmojiSadIcon","TONE_MAP","AdmonitionIcon","theme","useTheme","useContext","IconComponent","colors","resolveAccentColors","jsx","View","style","styles","icon","children","fill","foreground","width","height","AdmonitionContent","content","AdmonitionText","Text","text","AdmonitionButton","props","Button","size","AdmonitionRow","row","AdmonitionRoot","tone","border","Provider","value","jsxs","outer","backgroundColor","background","pointerEvents","borderColor","Admonition","StyleSheet","create","padding","borderRadius","position","top","right","bottom","left","borderWidth","opacity","flexShrink","flexDirection","alignItems","gap","flex","minWidth","minHeight","justifyContent","fontSize","lineHeight"],"sourceRoot":"../../../src","sources":["admonition/Admonition.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA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AA2C,GAAA,EAACY,cAAc;UAAAP,QAAA,EAAEA;QAAQ,CAAiB;MAAC,CAC1B,CAAC;IAAA,CACP;EAAC,CACF,CAAC;AAErB;AACA2B,UAAU,CAACpD,WAAW,GAAG,YAAY;AAErC,MAAMuB,MAAM,GAAG8B,uBAAU,CAACC,MAAM,CAAC;EAC/BP,KAAK,EAAE;IACLQ,OAAO,EAAE,EAAE;IACXC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDd,MAAM,EAAE;IACNc,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPL,YAAY,EAAE,EAAE;IAChBM,WAAW,EAAE,CAAC;IACdC,OAAO,EAAE;EACX,CAAC;EACDvC,IAAI,EAAE;IACJwC,UAAU,EAAE;EACd,CAAC;EACDxB,GAAG,EAAE;IACHZ,KAAK,EAAE,MAAM;IACbqC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,YAAY;IACxBC,GAAG,EAAE;EACP,CAAC;EACDpC,OAAO,EAAE;IACPoC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,CAAC;IACXC,SAAS,EAAE,EAAE;IACbC,cAAc,EAAE;EAClB,CAAC;EACDrC,IAAI,EAAE;IACJsC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -133,11 +133,13 @@ const MediaSurface = exports.MediaSurface = /*#__PURE__*/(0, _react.memo)(functi
|
|
|
133
133
|
// Both arms report the same fact — "there is a picture here now" — because the
|
|
134
134
|
// destination of a flight can be either, and a caller should not have to know
|
|
135
135
|
// which one it wired. expo-video raises `onFirstFrameRender` from `loadeddata`
|
|
136
|
-
// on web; expo-image
|
|
136
|
+
// on web; expo-image's `onDisplay` means the image has actually been painted
|
|
137
|
+
// (native `onLoad` can run before that first frame).
|
|
137
138
|
const reportLive = (0, _react.useCallback)(() => {
|
|
138
139
|
if (flightId !== undefined) (0, _store.handOffFlight)(flightId);
|
|
139
140
|
}, [flightId]);
|
|
140
141
|
const still = content.kind === 'video' ? content.poster : content.uri;
|
|
142
|
+
const preview = content.kind === 'video' ? undefined : content.previewUri;
|
|
141
143
|
// Loaded for the video arm only, and only when Bloom is the one building the
|
|
142
144
|
// element — an image surface must never make an app resolve an optional
|
|
143
145
|
// native peer, and neither must a consumer that brought its own view.
|
|
@@ -164,17 +166,25 @@ const MediaSurface = exports.MediaSurface = /*#__PURE__*/(0, _react.memo)(functi
|
|
|
164
166
|
source: {
|
|
165
167
|
uri: still
|
|
166
168
|
},
|
|
169
|
+
placeholder: preview && preview !== still ? {
|
|
170
|
+
uri: preview
|
|
171
|
+
} : undefined,
|
|
172
|
+
placeholderContentFit: contentFit,
|
|
173
|
+
recyclingKey: still,
|
|
167
174
|
contentFit: contentFit,
|
|
168
175
|
style: _reactNative.StyleSheet.absoluteFill,
|
|
169
|
-
|
|
176
|
+
cachePolicy: "memory-disk",
|
|
177
|
+
priority: "high",
|
|
178
|
+
loading: "eager",
|
|
179
|
+
transition: preview && preview !== still ? 120 : 0,
|
|
170
180
|
accessibilityLabel: accessibilityLabel
|
|
171
181
|
// Only the arm that IS the picture reports being live. On the video
|
|
172
182
|
// arm the poster is scenery: handing off on it would release the
|
|
173
183
|
// flying surface while the destination still had no video.
|
|
174
184
|
,
|
|
175
|
-
|
|
185
|
+
onDisplay: content.kind === 'video' ? undefined : reportLive,
|
|
176
186
|
...webDraggableProps
|
|
177
|
-
}), content.kind === 'video' && renderVideo !== undefined ? renderVideo({
|
|
187
|
+
}, still), content.kind === 'video' && renderVideo !== undefined ? renderVideo({
|
|
178
188
|
player: detached ? null : content.player,
|
|
179
189
|
// The same style Bloom's own view gets, for the same reason: a
|
|
180
190
|
// replaced element that is not told its size paints at 300x150.
|
|
@@ -233,7 +243,7 @@ function MediaPoster({
|
|
|
233
243
|
contentFit = 'cover',
|
|
234
244
|
accessibilityLabel
|
|
235
245
|
}) {
|
|
236
|
-
const uri = content.kind === 'video' ? content.poster : content.uri;
|
|
246
|
+
const uri = content.kind === 'video' ? content.poster : content.previewUri || content.uri;
|
|
237
247
|
if (uri === undefined) return /*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyMediaSurface, {
|
|
238
248
|
style: style
|
|
239
249
|
});
|
|
@@ -241,12 +251,14 @@ function MediaPoster({
|
|
|
241
251
|
source: {
|
|
242
252
|
uri
|
|
243
253
|
},
|
|
254
|
+
recyclingKey: uri,
|
|
244
255
|
contentFit: contentFit,
|
|
245
256
|
style: style,
|
|
257
|
+
cachePolicy: "memory-disk",
|
|
246
258
|
transition: 0,
|
|
247
259
|
accessibilityLabel: accessibilityLabel,
|
|
248
260
|
...webDraggableProps
|
|
249
|
-
});
|
|
261
|
+
}, uri);
|
|
250
262
|
}
|
|
251
263
|
|
|
252
264
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_expoImage","_reactNativeReanimated","_interopRequireDefault","_constants","_store","_expoVideoModule","_jsxRuntime","e","__esModule","default","webDraggableProps","Platform","OS","draggable","MediaSurface","exports","memo","content","style","contentFit","surfaceType","renderVideo","nativeControls","accessibilityLabel","pointerEvents","flightId","detached","mountedSurfaceType","useState","slotChangedInCommit","useRef","slotChurnRun","slotChurnRunStartedAt","useEffect","current","undefined","now","Date","SLOT_IDENTITY_CHURN_WINDOW_MS","SLOT_IDENTITY_CHURN_LIMIT","warnSlotNotMemoised","reportLive","useCallback","handOffFlight","still","kind","poster","uri","expoVideo","loadExpoVideo","warnExpoVideoUnavailable","jsxs","View","styles","box","children","jsx","Image","source","StyleSheet","absoluteFill","transition","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_expoImage","_reactNativeReanimated","_interopRequireDefault","_constants","_store","_expoVideoModule","_jsxRuntime","e","__esModule","default","webDraggableProps","Platform","OS","draggable","MediaSurface","exports","memo","content","style","contentFit","surfaceType","renderVideo","nativeControls","accessibilityLabel","pointerEvents","flightId","detached","mountedSurfaceType","useState","slotChangedInCommit","useRef","slotChurnRun","slotChurnRunStartedAt","useEffect","current","undefined","now","Date","SLOT_IDENTITY_CHURN_WINDOW_MS","SLOT_IDENTITY_CHURN_LIMIT","warnSlotNotMemoised","reportLive","useCallback","handOffFlight","still","kind","poster","uri","preview","previewUri","expoVideo","loadExpoVideo","warnExpoVideoUnavailable","jsxs","View","styles","box","children","jsx","Image","source","placeholder","placeholderContentFit","recyclingKey","StyleSheet","absoluteFill","cachePolicy","priority","loading","transition","onDisplay","player","fillReplaced","VideoView","onFirstFrameRender","displayName","hasWarnedAboutSlotChurn","process","env","NODE_ENV","console","warn","MediaPoster","EmptyMediaSurface","empty","create","width","height","overflow","backgroundColor"],"sourceRoot":"../../../src","sources":["media-flight/MediaSurface.tsx"],"mappings":";;;;;;;;AAeA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA,IAAAO,gBAAA,GAAAP,OAAA;AAI6B,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAI,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAlC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMG,iBAAiB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG;EAAEC,SAAS,EAAE;AAAM,CAAC,GA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D,KAAK,EAAEA,KAAM;IACbgD,WAAW,EAAC,aAAa;IACzBG,UAAU,EAAE,CAAE;IACd9C,kBAAkB,EAAEA,kBAAmB;IAAA,GACnCb;EAAiB,GARhBqC,GASN,CAAC;AAEN;;AAEA;AACA;AACA;AACA;AACO,SAASoC,iBAAiBA,CAAC;EAAEjE;AAAoC,CAAC,EAAE;EACzE,oBAAO,IAAAZ,WAAA,CAAAoD,GAAA,EAAC3D,YAAA,CAAAuD,IAAI;IAACpC,KAAK,EAAE,CAACqC,MAAM,CAAC6B,KAAK,EAAElE,KAAK,CAAE;IAACM,aAAa,EAAC;EAAM,CAAE,CAAC;AACpE;AAEA,MAAM+B,MAAM,GAAGS,uBAAU,CAACqB,MAAM,CAAC;EAC/B;AACF;AACA;AACA;EACEb,YAAY,EAAE;IACZc,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACD/B,GAAG,EAAE;IACH;IACA;IACAgC,QAAQ,EAAE;EACZ,CAAC;EACDJ,KAAK,EAAE;IACLK,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,9 @@ import { useTheme } from "../theme/use-theme.js";
|
|
|
6
6
|
import { Text as BaseText } from "../typography/index.js";
|
|
7
7
|
import { Button as BaseButton } from '../button';
|
|
8
8
|
import { RiInformationLine as CircleInfoIcon } from "../icons/remix/RiInformationLine.js";
|
|
9
|
-
import {
|
|
9
|
+
import { RiForbidLine as ForbidIcon } from "../icons/remix/RiForbidLine.js";
|
|
10
|
+
import { RiLightbulbLine as LightbulbIcon } from "../icons/remix/RiLightbulbLine.js";
|
|
11
|
+
import { resolveAccentColors } from "../theme/accent-colors.js";
|
|
10
12
|
import { RiAlertLine as WarningIcon } from "../icons/remix/RiAlertLine.js";
|
|
11
13
|
import { RiEmotionUnhappyLine as EmojiSadIcon } from "../icons/remix/RiEmotionUnhappyLine.js";
|
|
12
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -16,27 +18,33 @@ const AdmonitionContext = /*#__PURE__*/createContext({
|
|
|
16
18
|
AdmonitionContext.displayName = 'AdmonitionContext';
|
|
17
19
|
const ICON_MAP = {
|
|
18
20
|
info: CircleInfoIcon,
|
|
19
|
-
tip:
|
|
21
|
+
tip: LightbulbIcon,
|
|
20
22
|
warning: WarningIcon,
|
|
21
|
-
error:
|
|
23
|
+
error: ForbidIcon,
|
|
22
24
|
apology: EmojiSadIcon
|
|
23
25
|
};
|
|
26
|
+
const TONE_MAP = {
|
|
27
|
+
info: 'info',
|
|
28
|
+
tip: 'success',
|
|
29
|
+
warning: 'warning',
|
|
30
|
+
error: 'error',
|
|
31
|
+
apology: 'default'
|
|
32
|
+
};
|
|
24
33
|
export function AdmonitionIcon() {
|
|
25
34
|
const theme = useTheme();
|
|
26
35
|
const {
|
|
27
36
|
type
|
|
28
37
|
} = useContext(AdmonitionContext);
|
|
29
38
|
const IconComponent = ICON_MAP[type];
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
size: "md"
|
|
39
|
+
const colors = resolveAccentColors(theme.colors, TONE_MAP[type], 'subtle');
|
|
40
|
+
return /*#__PURE__*/_jsx(View, {
|
|
41
|
+
"aria-hidden": true,
|
|
42
|
+
style: styles.icon,
|
|
43
|
+
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
44
|
+
fill: colors.foreground,
|
|
45
|
+
width: 20,
|
|
46
|
+
height: 20
|
|
47
|
+
})
|
|
40
48
|
});
|
|
41
49
|
}
|
|
42
50
|
AdmonitionIcon.displayName = 'AdmonitionIcon';
|
|
@@ -87,23 +95,24 @@ export function AdmonitionRoot({
|
|
|
87
95
|
style
|
|
88
96
|
}) {
|
|
89
97
|
const theme = useTheme();
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
warning: theme.colors.warning,
|
|
94
|
-
error: theme.colors.error,
|
|
95
|
-
apology: theme.colors.border
|
|
96
|
-
};
|
|
98
|
+
const tone = TONE_MAP[type];
|
|
99
|
+
const colors = resolveAccentColors(theme.colors, tone, 'subtle');
|
|
100
|
+
const border = resolveAccentColors(theme.colors, tone, 'solid').border;
|
|
97
101
|
return /*#__PURE__*/_jsx(AdmonitionContext.Provider, {
|
|
98
102
|
value: {
|
|
99
103
|
type
|
|
100
104
|
},
|
|
101
|
-
children: /*#__PURE__*/
|
|
105
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
102
106
|
style: [styles.outer, {
|
|
103
|
-
|
|
104
|
-
backgroundColor: theme.colors.background
|
|
107
|
+
backgroundColor: colors.background
|
|
105
108
|
}, style],
|
|
106
|
-
children:
|
|
109
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
110
|
+
pointerEvents: "none",
|
|
111
|
+
"aria-hidden": true,
|
|
112
|
+
style: [styles.border, {
|
|
113
|
+
borderColor: border
|
|
114
|
+
}]
|
|
115
|
+
}), children]
|
|
107
116
|
})
|
|
108
117
|
});
|
|
109
118
|
}
|
|
@@ -134,26 +143,39 @@ export function Admonition({
|
|
|
134
143
|
Admonition.displayName = 'Admonition';
|
|
135
144
|
const styles = StyleSheet.create({
|
|
136
145
|
outer: {
|
|
137
|
-
padding:
|
|
138
|
-
borderRadius:
|
|
139
|
-
|
|
146
|
+
padding: 16,
|
|
147
|
+
borderRadius: 16,
|
|
148
|
+
position: 'relative'
|
|
149
|
+
},
|
|
150
|
+
border: {
|
|
151
|
+
position: 'absolute',
|
|
152
|
+
top: 0,
|
|
153
|
+
right: 0,
|
|
154
|
+
bottom: 0,
|
|
155
|
+
left: 0,
|
|
156
|
+
borderRadius: 16,
|
|
157
|
+
borderWidth: 1,
|
|
158
|
+
opacity: 0.3
|
|
159
|
+
},
|
|
160
|
+
icon: {
|
|
161
|
+
flexShrink: 0
|
|
140
162
|
},
|
|
141
163
|
row: {
|
|
142
164
|
width: '100%',
|
|
143
165
|
flexDirection: 'row',
|
|
144
166
|
alignItems: 'flex-start',
|
|
145
|
-
gap:
|
|
167
|
+
gap: 12
|
|
146
168
|
},
|
|
147
169
|
content: {
|
|
148
|
-
gap:
|
|
170
|
+
gap: 4,
|
|
149
171
|
flex: 1,
|
|
172
|
+
minWidth: 0,
|
|
150
173
|
minHeight: 20,
|
|
151
174
|
justifyContent: 'center'
|
|
152
175
|
},
|
|
153
176
|
text: {
|
|
154
177
|
fontSize: 14,
|
|
155
|
-
lineHeight:
|
|
156
|
-
paddingRight: 12
|
|
178
|
+
lineHeight: 22
|
|
157
179
|
}
|
|
158
180
|
});
|
|
159
181
|
//# sourceMappingURL=Admonition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","StyleSheet","View","useTheme","Text","BaseText","Button","BaseButton","RiInformationLine","CircleInfoIcon","
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","StyleSheet","View","useTheme","Text","BaseText","Button","BaseButton","RiInformationLine","CircleInfoIcon","RiForbidLine","ForbidIcon","RiLightbulbLine","LightbulbIcon","resolveAccentColors","RiAlertLine","WarningIcon","RiEmotionUnhappyLine","EmojiSadIcon","jsx","_jsx","jsxs","_jsxs","AdmonitionContext","type","displayName","ICON_MAP","info","tip","warning","error","apology","TONE_MAP","AdmonitionIcon","theme","IconComponent","colors","style","styles","icon","children","fill","foreground","width","height","AdmonitionContent","content","AdmonitionText","text","AdmonitionButton","props","size","AdmonitionRow","row","AdmonitionRoot","tone","border","Provider","value","outer","backgroundColor","background","pointerEvents","borderColor","Admonition","create","padding","borderRadius","position","top","right","bottom","left","borderWidth","opacity","flexShrink","flexDirection","alignItems","gap","flex","minWidth","minHeight","justifyContent","fontSize","lineHeight"],"sourceRoot":"../../../src","sources":["admonition/Admonition.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAQ,OAAO;AACxD,SAASC,UAAU,EAAEC,IAAI,QAAwD,cAA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QAAA,eACvClB,KAAA,CAAC8B,aAAa;MAAAZ,QAAA,gBACZpB,IAAA,CAACa,cAAc,IAAE,CAAC,eAClBb,IAAA,CAACyB,iBAAiB;QAAAL,QAAA,eAChBpB,IAAA,CAAC2B,cAAc;UAAAP,QAAA,EAAEA;QAAQ,CAAiB;MAAC,CAC1B,CAAC;IAAA,CACP;EAAC,CACF,CAAC;AAErB;AACAwB,UAAU,CAACvC,WAAW,GAAG,YAAY;AAErC,MAAMa,MAAM,GAAGrC,UAAU,CAACgE,MAAM,CAAC;EAC/BN,KAAK,EAAE;IACLO,OAAO,EAAE,EAAE;IACXC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDZ,MAAM,EAAE;IACNY,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPL,YAAY,EAAE,EAAE;IAChBM,WAAW,EAAE,CAAC;IACdC,OAAO,EAAE;EACX,CAAC;EACDnC,IAAI,EAAE;IACJoC,UAAU,EAAE;EACd,CAAC;EACDtB,GAAG,EAAE;IACHV,KAAK,EAAE,MAAM;IACbiC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,YAAY;IACxBC,GAAG,EAAE;EACP,CAAC;EACDhC,OAAO,EAAE;IACPgC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,CAAC;IACXC,SAAS,EAAE,EAAE;IACbC,cAAc,EAAE;EAClB,CAAC;EACDlC,IAAI,EAAE;IACJmC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -125,11 +125,13 @@ export const MediaSurface = /*#__PURE__*/memo(function MediaSurface({
|
|
|
125
125
|
// Both arms report the same fact — "there is a picture here now" — because the
|
|
126
126
|
// destination of a flight can be either, and a caller should not have to know
|
|
127
127
|
// which one it wired. expo-video raises `onFirstFrameRender` from `loadeddata`
|
|
128
|
-
// on web; expo-image
|
|
128
|
+
// on web; expo-image's `onDisplay` means the image has actually been painted
|
|
129
|
+
// (native `onLoad` can run before that first frame).
|
|
129
130
|
const reportLive = useCallback(() => {
|
|
130
131
|
if (flightId !== undefined) handOffFlight(flightId);
|
|
131
132
|
}, [flightId]);
|
|
132
133
|
const still = content.kind === 'video' ? content.poster : content.uri;
|
|
134
|
+
const preview = content.kind === 'video' ? undefined : content.previewUri;
|
|
133
135
|
// Loaded for the video arm only, and only when Bloom is the one building the
|
|
134
136
|
// element — an image surface must never make an app resolve an optional
|
|
135
137
|
// native peer, and neither must a consumer that brought its own view.
|
|
@@ -156,17 +158,25 @@ export const MediaSurface = /*#__PURE__*/memo(function MediaSurface({
|
|
|
156
158
|
source: {
|
|
157
159
|
uri: still
|
|
158
160
|
},
|
|
161
|
+
placeholder: preview && preview !== still ? {
|
|
162
|
+
uri: preview
|
|
163
|
+
} : undefined,
|
|
164
|
+
placeholderContentFit: contentFit,
|
|
165
|
+
recyclingKey: still,
|
|
159
166
|
contentFit: contentFit,
|
|
160
167
|
style: StyleSheet.absoluteFill,
|
|
161
|
-
|
|
168
|
+
cachePolicy: "memory-disk",
|
|
169
|
+
priority: "high",
|
|
170
|
+
loading: "eager",
|
|
171
|
+
transition: preview && preview !== still ? 120 : 0,
|
|
162
172
|
accessibilityLabel: accessibilityLabel
|
|
163
173
|
// Only the arm that IS the picture reports being live. On the video
|
|
164
174
|
// arm the poster is scenery: handing off on it would release the
|
|
165
175
|
// flying surface while the destination still had no video.
|
|
166
176
|
,
|
|
167
|
-
|
|
177
|
+
onDisplay: content.kind === 'video' ? undefined : reportLive,
|
|
168
178
|
...webDraggableProps
|
|
169
|
-
}), content.kind === 'video' && renderVideo !== undefined ? renderVideo({
|
|
179
|
+
}, still), content.kind === 'video' && renderVideo !== undefined ? renderVideo({
|
|
170
180
|
player: detached ? null : content.player,
|
|
171
181
|
// The same style Bloom's own view gets, for the same reason: a
|
|
172
182
|
// replaced element that is not told its size paints at 300x150.
|
|
@@ -225,7 +235,7 @@ export function MediaPoster({
|
|
|
225
235
|
contentFit = 'cover',
|
|
226
236
|
accessibilityLabel
|
|
227
237
|
}) {
|
|
228
|
-
const uri = content.kind === 'video' ? content.poster : content.uri;
|
|
238
|
+
const uri = content.kind === 'video' ? content.poster : content.previewUri || content.uri;
|
|
229
239
|
if (uri === undefined) return /*#__PURE__*/_jsx(EmptyMediaSurface, {
|
|
230
240
|
style: style
|
|
231
241
|
});
|
|
@@ -233,12 +243,14 @@ export function MediaPoster({
|
|
|
233
243
|
source: {
|
|
234
244
|
uri
|
|
235
245
|
},
|
|
246
|
+
recyclingKey: uri,
|
|
236
247
|
contentFit: contentFit,
|
|
237
248
|
style: style,
|
|
249
|
+
cachePolicy: "memory-disk",
|
|
238
250
|
transition: 0,
|
|
239
251
|
accessibilityLabel: accessibilityLabel,
|
|
240
252
|
...webDraggableProps
|
|
241
|
-
});
|
|
253
|
+
}, uri);
|
|
242
254
|
}
|
|
243
255
|
|
|
244
256
|
/**
|