@dyrected/admin 2.5.49 → 2.5.52

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Detects the kind of external media a URL points to and builds the document
3
+ * payload used to store it as a media record (no file bytes — just a reference).
4
+ *
5
+ * Supports YouTube and Vimeo video links, direct image URLs, and generic files.
6
+ * The resulting `mimeType` (`video/youtube`, `video/vimeo`, `image/external`, or a
7
+ * generic type) is what the media grid/preview components key off to render the
8
+ * asset correctly.
9
+ */
10
+ export interface ExternalMediaPayload {
11
+ filename: string;
12
+ url: string;
13
+ mimeType: string;
14
+ filesize: number;
15
+ id: string;
16
+ }
17
+ /**
18
+ * Build a media document payload from an external URL.
19
+ * Returns `null` when the input is empty/whitespace.
20
+ */
21
+ export declare function buildExternalMediaPayload(rawUrl: string): ExternalMediaPayload | null;
22
+ /**
23
+ * Resolves the thumbnail/preview image URL for any media item — external or uploaded.
24
+ *
25
+ * This is the single source of truth used by every media surface (grid, picker,
26
+ * library dialog) so YouTube, Vimeo, external images, and uploaded files all render
27
+ * consistently everywhere.
28
+ * - `video/youtube` → the YouTube thumbnail for the video id
29
+ * - `video/vimeo` → the Vimeo logo placeholder
30
+ * - `image/external`→ the external URL itself
31
+ * - anything else → resolved through {@link getMediaUrl}
32
+ */
33
+ export declare function getMediaPreviewUrl(item: unknown, baseUrl: string): string;
34
+ /**
35
+ * Returns the player embed URL for an external video item (YouTube/Vimeo), or
36
+ * `null` for anything that isn't an embeddable video. Used to render an inline
37
+ * iframe player instead of a static thumbnail.
38
+ */
39
+ export declare function getVideoEmbedUrl(item: unknown): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/admin",
3
- "version": "2.5.49",
3
+ "version": "2.5.52",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -64,9 +64,9 @@
64
64
  "tailwind-merge": "^3.5.0",
65
65
  "tailwindcss-animate": "^1.0.7",
66
66
  "zod": "^3.25.76",
67
- "@dyrected/knowledge": "^0.2.7",
68
- "@dyrected/sdk": "^2.5.49",
69
- "@dyrected/core": "^2.5.49"
67
+ "@dyrected/core": "^2.5.52",
68
+ "@dyrected/knowledge": "^0.2.9",
69
+ "@dyrected/sdk": "^2.5.52"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@tanstack/react-query": "^5.0.0",