@ossy/resources 3.5.1 → 3.6.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/resources",
3
3
  "description": "Resource domain — aggregate and events for the Ossy resource model",
4
- "version": "3.5.1",
4
+ "version": "3.6.2",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "./src/index.js",
@@ -23,10 +23,10 @@
23
23
  "src": "./src"
24
24
  },
25
25
  "dependencies": {
26
- "@ossy/event-store": "^3.4.0",
26
+ "@ossy/event-store": "^3.6.2",
27
27
  "@ossy/fold": "^3.4.0",
28
- "@ossy/platform": "^3.5.1",
29
- "@ossy/schema": "^3.5.1"
28
+ "@ossy/platform": "^3.6.2",
29
+ "@ossy/schema": "^3.6.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@ossy/design-system": ">=1.0.0",
@@ -49,5 +49,5 @@
49
49
  "/src",
50
50
  "README.md"
51
51
  ],
52
- "gitHead": "cafa2d72ae9c4f6197ebec0b5b857919a062ceff"
52
+ "gitHead": "d81b840c5421995e8ac7550e5b37ae1145abcba9"
53
53
  }
@@ -185,18 +185,17 @@ export function SchemaPresenter ({
185
185
  return <Text>directory</Text>
186
186
  }
187
187
 
188
- // Document schemas before MIME: schema ids contain `/` and must not be
189
- // treated as media types (see isMimeType).
190
- if (isDocumentSchema) {
191
- return <SchemaViewPresenter resource={resource} projection={projection} resourceId={resourceId} />
192
- }
193
-
194
- // File envelope is a registered schema, but View must use MIME presenters (image/video/…).
188
+ // File envelope is a registered schema, so this must run before document views
189
+ // or we render Key/ContentType fields instead of the media player.
195
190
  const mime = resolveMediaType(resource)
196
191
  if (resource.type === '@ossy/platform/schema/file' || isMimeType(mime)) {
197
192
  return <MimeViewPresenter resource={resource} projection={projection} resourceId={resourceId} onClose={onClose} />
198
193
  }
199
194
 
195
+ if (isDocumentSchema) {
196
+ return <SchemaViewPresenter resource={resource} projection={projection} resourceId={resourceId} />
197
+ }
198
+
200
199
  return <ResourceGenericView resourceId={resourceId} onClose={onClose} />
201
200
  }
202
201
 
@@ -16,7 +16,7 @@ export const VideoResource = ({
16
16
  <div style={{ display: 'flex', justifyContent: 'center' }}>
17
17
  <video
18
18
  controls
19
- src={resource.content.src}
19
+ src={resource?.content?.src}
20
20
  style={{ width: 'auto', height: '400px', margin: 'var(--space-l) auto' }}
21
21
  />
22
22
  </div>