@edifice.io/react 2.2.11-develop-pedago.20250707105307 → 2.2.11-develop-pedago.20250707120933
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/modules/multimedia/FileCard/FileCard.d.ts +13 -2
- package/dist/modules/multimedia/FileCard/FileCard.js +10 -4
- package/dist/modules/multimedia/FileCard/FileIcon.d.ts +4 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +3 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +7 -2
- package/package.json +6 -6
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { WorkspaceElement } from '@edifice.io/client';
|
|
2
3
|
import { CardProps } from '../../../components';
|
|
3
4
|
export interface FileCardProps extends CardProps {
|
|
4
5
|
/**
|
|
5
6
|
* WorkspaceElement
|
|
6
|
-
|
|
7
|
+
*/
|
|
7
8
|
doc: WorkspaceElement;
|
|
9
|
+
/**
|
|
10
|
+
* Custom icon to override the default based on file type
|
|
11
|
+
* Can be a string or a React node
|
|
12
|
+
*/
|
|
13
|
+
customIcon?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Custom color class to override the default based on file type
|
|
16
|
+
* Example: "bg-purple-300" or any valid CSS class
|
|
17
|
+
*/
|
|
18
|
+
customColor?: string;
|
|
8
19
|
}
|
|
9
20
|
declare const FileCard: {
|
|
10
|
-
({ doc, isClickable, isSelectable, isSelected, onClick, className, onSelect, isFocused, app, }: FileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
({ doc, isClickable, isSelectable, isSelected, onClick, className, onSelect, isFocused, app, customIcon, customColor, }: FileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
11
22
|
displayName: string;
|
|
12
23
|
};
|
|
13
24
|
export default FileCard;
|
|
@@ -18,11 +18,17 @@ const FileCard = ({
|
|
|
18
18
|
className,
|
|
19
19
|
onSelect,
|
|
20
20
|
isFocused,
|
|
21
|
-
app
|
|
21
|
+
app,
|
|
22
|
+
customIcon,
|
|
23
|
+
customColor
|
|
22
24
|
}) => {
|
|
23
|
-
var _a;
|
|
24
25
|
const ref = useRef(null), type = DocumentHelper.getRole(doc);
|
|
25
26
|
function getRoleMap(type2) {
|
|
27
|
+
if (customIcon !== void 0 || customColor !== void 0)
|
|
28
|
+
return {
|
|
29
|
+
icon: customIcon || /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
|
|
30
|
+
color: customColor || "bg-gray-300"
|
|
31
|
+
};
|
|
26
32
|
const roleMappings = {
|
|
27
33
|
csv: {
|
|
28
34
|
icon: ".CSV",
|
|
@@ -75,7 +81,7 @@ const FileCard = ({
|
|
|
75
81
|
};
|
|
76
82
|
return roleMappings[type2] || roleMappings.unknown;
|
|
77
83
|
}
|
|
78
|
-
const file = clsx("file position-relative rounded", (
|
|
84
|
+
const roleMap = getRoleMap(type ?? "unknown"), file = clsx("file position-relative rounded", (roleMap == null ? void 0 : roleMap.color) ?? "bg-yellow-200"), mediaSrc = type === "img" || type === "video" ? odeServices.workspace().getThumbnailUrl(doc) : null, hasThumbnail = useThumbnail(mediaSrc, {
|
|
79
85
|
ref
|
|
80
86
|
}), imageStyles = hasThumbnail && {
|
|
81
87
|
backgroundImage: `url(${mediaSrc})`,
|
|
@@ -85,7 +91,7 @@ const FileCard = ({
|
|
|
85
91
|
/* @__PURE__ */ jsx("div", { ref, className: file, style: {
|
|
86
92
|
aspectRatio: "16/10",
|
|
87
93
|
...imageStyles
|
|
88
|
-
}, children: type !== "img" || type === "img" && !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap
|
|
94
|
+
}, children: type !== "img" || type === "img" && !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap }) : null }),
|
|
89
95
|
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
90
96
|
/* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
|
|
91
97
|
/* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.ownerName })
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Role } from '@edifice.io/client';
|
|
2
2
|
declare const FileIcon: ({ type, roleMap, }: {
|
|
3
3
|
type: Role | "unknown";
|
|
4
|
-
roleMap?:
|
|
4
|
+
roleMap?: {
|
|
5
|
+
icon: React.ReactNode | string;
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
5
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export default FileIcon;
|
|
@@ -35,7 +35,9 @@ export type MediaLibraryType =
|
|
|
35
35
|
/** Embedded websites */
|
|
36
36
|
| 'embedder'
|
|
37
37
|
/** Hyperlinks */
|
|
38
|
-
| 'hyperlink'
|
|
38
|
+
| 'hyperlink'
|
|
39
|
+
/** Studio mode for recording audio and video */
|
|
40
|
+
| 'studio';
|
|
39
41
|
export interface MediaLibraryRef {
|
|
40
42
|
/** Open the Media Library on given type. */
|
|
41
43
|
show: (type: MediaLibraryType) => void;
|
|
@@ -56,6 +56,11 @@ const orderedTabs = [
|
|
|
56
56
|
embedder: {
|
|
57
57
|
title: "bbm.embed.modal.title",
|
|
58
58
|
defaultTab: "iframe"
|
|
59
|
+
},
|
|
60
|
+
// Add studio type with video-capture as default tab
|
|
61
|
+
studio: {
|
|
62
|
+
title: "bbm.studio.modal.title",
|
|
63
|
+
defaultTab: "audio-capture"
|
|
59
64
|
}
|
|
60
65
|
}, MediaLibrary = /* @__PURE__ */ forwardRef(({
|
|
61
66
|
appCode,
|
|
@@ -101,7 +106,7 @@ const orderedTabs = [
|
|
|
101
106
|
icon: /* @__PURE__ */ jsx(SvgIconRecordVideo, {}),
|
|
102
107
|
label: t("bbm.video"),
|
|
103
108
|
content: /* @__PURE__ */ jsx(InnerTabs.Video, {}),
|
|
104
|
-
availableFor: ["video"],
|
|
109
|
+
availableFor: ["video", "studio"],
|
|
105
110
|
isEnable: () => !!videoCaptureWorkflow
|
|
106
111
|
},
|
|
107
112
|
"audio-capture": {
|
|
@@ -109,7 +114,7 @@ const orderedTabs = [
|
|
|
109
114
|
icon: /* @__PURE__ */ jsx(SvgIconMic, {}),
|
|
110
115
|
label: t("bbm.audio"),
|
|
111
116
|
content: /* @__PURE__ */ jsx(InnerTabs.Audio, {}),
|
|
112
|
-
availableFor: ["audio"],
|
|
117
|
+
availableFor: ["audio", "studio"],
|
|
113
118
|
isEnable: () => !!workspaceCreateWorkflow
|
|
114
119
|
},
|
|
115
120
|
"external-link": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.2.11-develop-pedago.
|
|
3
|
+
"version": "2.2.11-develop-pedago.20250707120933",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"react-slugify": "^3.0.3",
|
|
131
131
|
"swiper": "^10.1.0",
|
|
132
132
|
"ua-parser-js": "^1.0.36",
|
|
133
|
-
"@edifice.io/bootstrap": "2.2.11-develop-pedago.
|
|
134
|
-
"@edifice.io/tiptap-extensions": "2.2.11-develop-pedago.
|
|
135
|
-
"@edifice.io/utilities": "2.2.11-develop-pedago.
|
|
133
|
+
"@edifice.io/bootstrap": "2.2.11-develop-pedago.20250707120933",
|
|
134
|
+
"@edifice.io/tiptap-extensions": "2.2.11-develop-pedago.20250707120933",
|
|
135
|
+
"@edifice.io/utilities": "2.2.11-develop-pedago.20250707120933"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
"vite": "^5.4.11",
|
|
164
164
|
"vite-plugin-dts": "^4.1.0",
|
|
165
165
|
"vite-tsconfig-paths": "^5.0.1",
|
|
166
|
-
"@edifice.io/client": "2.2.11-develop-pedago.
|
|
167
|
-
"@edifice.io/config": "2.2.11-develop-pedago.
|
|
166
|
+
"@edifice.io/client": "2.2.11-develop-pedago.20250707120933",
|
|
167
|
+
"@edifice.io/config": "2.2.11-develop-pedago.20250707120933"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@react-spring/web": "^9.7.5",
|