@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.
- package/dist/admin.css +188 -67
- package/dist/components/forms/__tests__/nested-editor-context.test.d.ts +1 -0
- package/dist/components/forms/__tests__/resolveContainerPath.test.d.ts +1 -0
- package/dist/components/forms/fields/url-field.d.ts +1 -1
- package/dist/components/forms/form-engine.d.ts +7 -1
- package/dist/components/forms/nested-editor-context.d.ts +86 -0
- package/dist/components/forms/utils.d.ts +19 -0
- package/dist/components/layout/admin-splash.d.ts +12 -0
- package/dist/components/layout/sidebar-control.d.ts +12 -0
- package/dist/hooks/use-add-media-from-url.d.ts +25 -0
- package/dist/hooks/usePreference.d.ts +13 -0
- package/dist/index.mjs +1900 -1011
- package/dist/lib/external-media.d.ts +39 -0
- package/package.json +4 -4
|
@@ -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.
|
|
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/
|
|
68
|
-
"@dyrected/
|
|
69
|
-
"@dyrected/
|
|
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",
|