@fluid-app/portal-sdk 0.1.211 → 0.1.213

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.
Files changed (42) hide show
  1. package/dist/CalendarWidget-CmVC7I4i.cjs +627 -0
  2. package/dist/CalendarWidget-CmVC7I4i.cjs.map +1 -0
  3. package/dist/CalendarWidget-RdPgsQLG.mjs +610 -0
  4. package/dist/CalendarWidget-RdPgsQLG.mjs.map +1 -0
  5. package/dist/{FluidProvider-DJfKbTQm.mjs → FluidProvider-D2eBYdP9.mjs} +5 -5
  6. package/dist/{FluidProvider-DJfKbTQm.mjs.map → FluidProvider-D2eBYdP9.mjs.map} +1 -1
  7. package/dist/{FluidProvider-CfBG1eFt.cjs → FluidProvider-D7-UjZFz.cjs} +5 -5
  8. package/dist/{FluidProvider-CfBG1eFt.cjs.map → FluidProvider-D7-UjZFz.cjs.map} +1 -1
  9. package/dist/{MessagingScreen-4QQbsIUy.cjs → MessagingScreen-B0WWqXj9.cjs} +4 -4
  10. package/dist/{MessagingScreen-C6rXYwlm.cjs → MessagingScreen-CrPiH9br.cjs} +2 -2
  11. package/dist/{MessagingScreen-C6rXYwlm.cjs.map → MessagingScreen-CrPiH9br.cjs.map} +1 -1
  12. package/dist/{MessagingScreen-BUSGkkQM.mjs → MessagingScreen-D54c5afj.mjs} +2 -2
  13. package/dist/{MessagingScreen-BUSGkkQM.mjs.map → MessagingScreen-D54c5afj.mjs.map} +1 -1
  14. package/dist/{ProfileScreen-aUcLKi7B.mjs → ProfileScreen-C60U8ubV.mjs} +2 -2
  15. package/dist/{ProfileScreen-aUcLKi7B.mjs.map → ProfileScreen-C60U8ubV.mjs.map} +1 -1
  16. package/dist/{ProfileScreen-DaDRVK5B.cjs → ProfileScreen-KKkt3e9c.cjs} +2 -2
  17. package/dist/{ProfileScreen-DaDRVK5B.cjs.map → ProfileScreen-KKkt3e9c.cjs.map} +1 -1
  18. package/dist/{ProfileScreen-gHoo8LGb.cjs → ProfileScreen-u9MNVGne.cjs} +4 -4
  19. package/dist/{ShopScreen-jdit46tQ.mjs → ShopScreen-BJfA62O-.mjs} +2 -2
  20. package/dist/{ShopScreen-jdit46tQ.mjs.map → ShopScreen-BJfA62O-.mjs.map} +1 -1
  21. package/dist/{ShopScreen-Bdkbl6gq.cjs → ShopScreen-Bc7jZje5.cjs} +4 -4
  22. package/dist/{ShopScreen-vC7Yk8vC.cjs → ShopScreen-Ct3RyfWT.cjs} +2 -2
  23. package/dist/{ShopScreen-vC7Yk8vC.cjs.map → ShopScreen-Ct3RyfWT.cjs.map} +1 -1
  24. package/dist/VideoWidget-CMk4QEx_.mjs +969 -0
  25. package/dist/VideoWidget-CMk4QEx_.mjs.map +1 -0
  26. package/dist/VideoWidget-DIUMQy1C.cjs +986 -0
  27. package/dist/VideoWidget-DIUMQy1C.cjs.map +1 -0
  28. package/dist/index.cjs +12 -12
  29. package/dist/index.d.cts +42 -8
  30. package/dist/index.d.cts.map +1 -1
  31. package/dist/index.d.mts +42 -8
  32. package/dist/index.d.mts.map +1 -1
  33. package/dist/index.mjs +12 -12
  34. package/package.json +16 -16
  35. package/dist/CalendarWidget-BcZNsVQo.cjs +0 -445
  36. package/dist/CalendarWidget-BcZNsVQo.cjs.map +0 -1
  37. package/dist/CalendarWidget-DTqgk0qe.mjs +0 -428
  38. package/dist/CalendarWidget-DTqgk0qe.mjs.map +0 -1
  39. package/dist/VideoWidget-B9yfmLXd.cjs +0 -222
  40. package/dist/VideoWidget-B9yfmLXd.cjs.map +0 -1
  41. package/dist/VideoWidget-FoAueFwA.mjs +0 -205
  42. package/dist/VideoWidget-FoAueFwA.mjs.map +0 -1
@@ -1,222 +0,0 @@
1
- const require_chunk = require("./chunk-9hOWP6kD.cjs");
2
- const require_registries = require("./registries-CpUM406S.cjs");
3
- const require_MediaRenderer = require("./MediaRenderer-D4HnIAbN.cjs");
4
- let react_jsx_runtime = require("react/jsx-runtime");
5
- //#region ../widgets/src/widgets/VideoWidget.tsx
6
- var VideoWidget_exports = /* @__PURE__ */ require_chunk.__exportAll({
7
- VideoWidget: () => VideoWidget,
8
- videoWidgetPropertySchema: () => videoWidgetPropertySchema
9
- });
10
- function VideoWidget({ src = "", poster = "", borderRadius = "md", borderWidth = "none", borderColor = "muted", verticalSizing = "auto", fixedHeight = "200px", displayFit = "cover", focusPoint, controls = true, autoplay = false, loop = false, muted = true, resource, useCustomUrl }) {
11
- const effectiveSrc = useCustomUrl ? src : resource?.videoUrl ?? src;
12
- const effectivePoster = useCustomUrl ? poster : resource?.imageUrl ?? poster;
13
- const isFixed = verticalSizing === "fixed";
14
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
15
- className: `relative w-full overflow-hidden rounded-${borderRadius} ${require_registries.borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? require_registries.borderColorClasses[borderColor] : ""}`,
16
- style: isFixed ? { height: fixedHeight } : void 0,
17
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MediaRenderer.MediaRenderer, {
18
- mediaType: "video",
19
- src: effectiveSrc,
20
- poster: effectivePoster,
21
- objectFit: isFixed ? displayFit : void 0,
22
- focusPoint: isFixed ? focusPoint : void 0,
23
- controls,
24
- autoplay,
25
- loop,
26
- muted
27
- })
28
- });
29
- }
30
- const videoWidgetPropertySchema = {
31
- widgetType: "VideoWidget",
32
- displayName: "Video",
33
- tabsConfig: [{
34
- id: "styling",
35
- label: "Styling"
36
- }, {
37
- id: "behavior",
38
- label: "Behavior"
39
- }],
40
- fields: [
41
- {
42
- key: "resource",
43
- label: "Select Video",
44
- type: "resource",
45
- description: "Browse and select a video",
46
- allowedTypes: ["Medium"],
47
- tab: "styling",
48
- group: "Content"
49
- },
50
- {
51
- key: "useCustomUrl",
52
- label: "Use Custom URL",
53
- type: "boolean",
54
- description: "Enter a custom video URL instead of selecting media",
55
- defaultValue: false,
56
- tab: "styling",
57
- group: "Content"
58
- },
59
- {
60
- key: "src",
61
- label: "Video URL",
62
- type: "text",
63
- description: "The source URL of the video",
64
- defaultValue: "",
65
- tab: "styling",
66
- group: "Content",
67
- requiresKeyToBeTrue: "useCustomUrl"
68
- },
69
- {
70
- key: "poster",
71
- label: "Poster Image URL",
72
- type: "text",
73
- description: "Thumbnail image displayed before video plays",
74
- defaultValue: "",
75
- tab: "styling",
76
- group: "Content",
77
- requiresKeyToBeTrue: "useCustomUrl"
78
- },
79
- require_registries.getBorderRadiusField({
80
- key: "borderRadius",
81
- label: "Border Radius",
82
- description: "Border radius for the calendar container",
83
- defaultValue: "md",
84
- tab: "styling",
85
- group: "Design"
86
- }),
87
- require_registries.getBorderWidthField({
88
- key: "borderWidth",
89
- label: "Border Width",
90
- description: "Border width for the widget",
91
- defaultValue: "none",
92
- tab: "styling",
93
- group: "Design"
94
- }),
95
- require_registries.getBorderColorField({
96
- key: "borderColor",
97
- label: "Border Color",
98
- description: "Border color for the widget",
99
- defaultValue: "muted",
100
- tab: "styling",
101
- group: "Design"
102
- }),
103
- {
104
- key: "verticalSizing",
105
- label: "Vertical Sizing",
106
- type: "buttonGroup",
107
- description: "How the video height is determined",
108
- options: [{
109
- label: "Auto",
110
- value: "auto"
111
- }, {
112
- label: "Fixed",
113
- value: "fixed"
114
- }],
115
- defaultValue: "auto",
116
- tab: "styling",
117
- group: "Design"
118
- },
119
- require_registries.getHeightField({
120
- key: "fixedHeight",
121
- label: "Height",
122
- description: "Fixed height of the video container",
123
- defaultValue: "200px",
124
- tab: "styling",
125
- group: "Design",
126
- requiresKeyValue: {
127
- key: "verticalSizing",
128
- value: "fixed"
129
- }
130
- }),
131
- {
132
- key: "displayFit",
133
- label: "Display Fit",
134
- type: "buttonGroup",
135
- description: "How the video fills its container",
136
- options: [{
137
- label: "Cover",
138
- value: "cover"
139
- }, {
140
- label: "Contain",
141
- value: "contain"
142
- }],
143
- defaultValue: "cover",
144
- tab: "styling",
145
- group: "Design",
146
- requiresKeyValue: {
147
- key: "verticalSizing",
148
- value: "fixed"
149
- }
150
- },
151
- {
152
- key: "focusPoint",
153
- label: "Focus Point",
154
- type: "contentPosition",
155
- description: "The focal point of the video within its container",
156
- defaultValue: "center",
157
- tab: "styling",
158
- group: "Design",
159
- requiresKeyValue: {
160
- key: "verticalSizing",
161
- value: "fixed"
162
- }
163
- },
164
- {
165
- key: "controls",
166
- label: "Show Controls",
167
- type: "boolean",
168
- description: "Display video playback controls",
169
- defaultValue: true,
170
- tab: "behavior",
171
- group: "Behavior"
172
- },
173
- {
174
- key: "autoplay",
175
- label: "Autoplay",
176
- type: "boolean",
177
- description: "Automatically start playing the video",
178
- defaultValue: false,
179
- tab: "behavior",
180
- group: "Behavior"
181
- },
182
- {
183
- key: "loop",
184
- label: "Loop",
185
- type: "boolean",
186
- description: "Repeat the video when it ends",
187
- defaultValue: false,
188
- tab: "behavior",
189
- group: "Behavior"
190
- },
191
- {
192
- key: "muted",
193
- label: "Muted",
194
- type: "boolean",
195
- description: "Start with audio muted",
196
- defaultValue: true,
197
- tab: "behavior",
198
- group: "Behavior"
199
- }
200
- ]
201
- };
202
- //#endregion
203
- Object.defineProperty(exports, "VideoWidget", {
204
- enumerable: true,
205
- get: function() {
206
- return VideoWidget;
207
- }
208
- });
209
- Object.defineProperty(exports, "VideoWidget_exports", {
210
- enumerable: true,
211
- get: function() {
212
- return VideoWidget_exports;
213
- }
214
- });
215
- Object.defineProperty(exports, "videoWidgetPropertySchema", {
216
- enumerable: true,
217
- get: function() {
218
- return videoWidgetPropertySchema;
219
- }
220
- });
221
-
222
- //# sourceMappingURL=VideoWidget-B9yfmLXd.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoWidget-B9yfmLXd.cjs","names":["borderWidthClasses","borderColorClasses","MediaRenderer","getBorderRadiusField","getBorderWidthField","getBorderColorField","getHeightField"],"sources":["../../widgets/src/widgets/VideoWidget.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getHeightField,\n type WidgetPropertySchema,\n} from \"@fluid-app/portal-core/registries\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype VideoWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n poster?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n controls?: boolean;\n autoplay?: boolean;\n loop?: boolean;\n muted?: boolean;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n};\n\nexport function VideoWidget({\n src = \"\",\n poster = \"\",\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n controls = true,\n autoplay = false,\n loop = false,\n muted = true,\n resource,\n useCustomUrl,\n}: VideoWidgetProps): React.JSX.Element {\n const effectiveSrc = useCustomUrl ? src : (resource?.videoUrl ?? src);\n const effectivePoster = useCustomUrl\n ? poster\n : (resource?.imageUrl ?? poster);\n\n const isFixed = verticalSizing === \"fixed\";\n\n return (\n <div\n className={`relative w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"}`}\n style={isFixed ? { height: fixedHeight } : undefined}\n >\n <MediaRenderer\n mediaType=\"video\"\n src={effectiveSrc}\n poster={effectivePoster}\n objectFit={isFixed ? displayFit : undefined}\n focusPoint={isFixed ? focusPoint : undefined}\n controls={controls}\n autoplay={autoplay}\n loop={loop}\n muted={muted}\n />\n </div>\n );\n}\n\nexport const videoWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"VideoWidget\",\n displayName: \"Video\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n ],\n fields: [\n // Styling tab - Content group\n {\n key: \"resource\",\n label: \"Select Video\",\n type: \"resource\",\n description: \"Browse and select a video\",\n allowedTypes: [\"Medium\"],\n tab: \"styling\",\n group: \"Content\",\n },\n {\n key: \"useCustomUrl\",\n label: \"Use Custom URL\",\n type: \"boolean\",\n description: \"Enter a custom video URL instead of selecting media\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Content\",\n },\n {\n key: \"src\",\n label: \"Video URL\",\n type: \"text\",\n description: \"The source URL of the video\",\n defaultValue: \"\",\n tab: \"styling\",\n group: \"Content\",\n requiresKeyToBeTrue: \"useCustomUrl\",\n },\n {\n key: \"poster\",\n label: \"Poster Image URL\",\n type: \"text\",\n description: \"Thumbnail image displayed before video plays\",\n defaultValue: \"\",\n tab: \"styling\",\n group: \"Content\",\n requiresKeyToBeTrue: \"useCustomUrl\",\n },\n\n // Styling tab - Design group\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the calendar container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"verticalSizing\",\n label: \"Vertical Sizing\",\n type: \"buttonGroup\",\n description: \"How the video height is determined\",\n options: [\n { label: \"Auto\", value: \"auto\" },\n { label: \"Fixed\", value: \"fixed\" },\n ],\n defaultValue: \"auto\",\n tab: \"styling\",\n group: \"Design\",\n },\n getHeightField({\n key: \"fixedHeight\",\n label: \"Height\",\n description: \"Fixed height of the video container\",\n defaultValue: \"200px\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n }),\n {\n key: \"displayFit\",\n label: \"Display Fit\",\n type: \"buttonGroup\",\n description: \"How the video fills its container\",\n options: [\n { label: \"Cover\", value: \"cover\" },\n { label: \"Contain\", value: \"contain\" },\n ],\n defaultValue: \"cover\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n {\n key: \"focusPoint\",\n label: \"Focus Point\",\n type: \"contentPosition\",\n description: \"The focal point of the video within its container\",\n defaultValue: \"center\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n\n // Behavior tab\n {\n key: \"controls\",\n label: \"Show Controls\",\n type: \"boolean\",\n description: \"Display video playback controls\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n {\n key: \"autoplay\",\n label: \"Autoplay\",\n type: \"boolean\",\n description: \"Automatically start playing the video\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n {\n key: \"loop\",\n label: \"Loop\",\n type: \"boolean\",\n description: \"Repeat the video when it ends\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n {\n key: \"muted\",\n label: \"Muted\",\n type: \"boolean\",\n description: \"Start with audio muted\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAqCA,SAAgB,YAAY,EAC1B,MAAM,IACN,SAAS,IACT,eAAe,MACf,cAAc,QACd,cAAc,SACd,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,WAAW,MACX,WAAW,OACX,OAAO,OACP,QAAQ,MACR,UACA,gBACsC;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,kBAAkB,eACpB,SACC,UAAU,YAAY;CAE3B,MAAM,UAAU,mBAAmB;AAEnC,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,WAAW,2CAA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OAAO;IAAQ,EAChC;IAAE,OAAO;IAAS,OAAO;IAAS,CACnC;GACD,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACDC,mBAAAA,eAAe;GACb,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS,CACP;IAAE,OAAO;IAAS,OAAO;IAAS,EAClC;IAAE,OAAO;IAAW,OAAO;IAAW,CACvC;GACD,cAAc;GACd,KAAK;GACL,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,kBAAkB;IAAE,KAAK;IAAkB,OAAO;IAAS;GAC5D;EAGD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACF;CACF"}
@@ -1,205 +0,0 @@
1
- import { r as __exportAll } from "./es-Cw_Kikmu.mjs";
2
- import { i as getBorderColorField, n as borderWidthClasses, o as getBorderRadiusField, p as getHeightField, s as getBorderWidthField, t as borderColorClasses } from "./registries-DT36l-bR.mjs";
3
- import { t as MediaRenderer } from "./MediaRenderer-C-cxsqLq.mjs";
4
- import { jsx } from "react/jsx-runtime";
5
- //#region ../widgets/src/widgets/VideoWidget.tsx
6
- var VideoWidget_exports = /* @__PURE__ */ __exportAll({
7
- VideoWidget: () => VideoWidget,
8
- videoWidgetPropertySchema: () => videoWidgetPropertySchema
9
- });
10
- function VideoWidget({ src = "", poster = "", borderRadius = "md", borderWidth = "none", borderColor = "muted", verticalSizing = "auto", fixedHeight = "200px", displayFit = "cover", focusPoint, controls = true, autoplay = false, loop = false, muted = true, resource, useCustomUrl }) {
11
- const effectiveSrc = useCustomUrl ? src : resource?.videoUrl ?? src;
12
- const effectivePoster = useCustomUrl ? poster : resource?.imageUrl ?? poster;
13
- const isFixed = verticalSizing === "fixed";
14
- return /* @__PURE__ */ jsx("div", {
15
- className: `relative w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? borderColorClasses[borderColor] : ""}`,
16
- style: isFixed ? { height: fixedHeight } : void 0,
17
- children: /* @__PURE__ */ jsx(MediaRenderer, {
18
- mediaType: "video",
19
- src: effectiveSrc,
20
- poster: effectivePoster,
21
- objectFit: isFixed ? displayFit : void 0,
22
- focusPoint: isFixed ? focusPoint : void 0,
23
- controls,
24
- autoplay,
25
- loop,
26
- muted
27
- })
28
- });
29
- }
30
- const videoWidgetPropertySchema = {
31
- widgetType: "VideoWidget",
32
- displayName: "Video",
33
- tabsConfig: [{
34
- id: "styling",
35
- label: "Styling"
36
- }, {
37
- id: "behavior",
38
- label: "Behavior"
39
- }],
40
- fields: [
41
- {
42
- key: "resource",
43
- label: "Select Video",
44
- type: "resource",
45
- description: "Browse and select a video",
46
- allowedTypes: ["Medium"],
47
- tab: "styling",
48
- group: "Content"
49
- },
50
- {
51
- key: "useCustomUrl",
52
- label: "Use Custom URL",
53
- type: "boolean",
54
- description: "Enter a custom video URL instead of selecting media",
55
- defaultValue: false,
56
- tab: "styling",
57
- group: "Content"
58
- },
59
- {
60
- key: "src",
61
- label: "Video URL",
62
- type: "text",
63
- description: "The source URL of the video",
64
- defaultValue: "",
65
- tab: "styling",
66
- group: "Content",
67
- requiresKeyToBeTrue: "useCustomUrl"
68
- },
69
- {
70
- key: "poster",
71
- label: "Poster Image URL",
72
- type: "text",
73
- description: "Thumbnail image displayed before video plays",
74
- defaultValue: "",
75
- tab: "styling",
76
- group: "Content",
77
- requiresKeyToBeTrue: "useCustomUrl"
78
- },
79
- getBorderRadiusField({
80
- key: "borderRadius",
81
- label: "Border Radius",
82
- description: "Border radius for the calendar container",
83
- defaultValue: "md",
84
- tab: "styling",
85
- group: "Design"
86
- }),
87
- getBorderWidthField({
88
- key: "borderWidth",
89
- label: "Border Width",
90
- description: "Border width for the widget",
91
- defaultValue: "none",
92
- tab: "styling",
93
- group: "Design"
94
- }),
95
- getBorderColorField({
96
- key: "borderColor",
97
- label: "Border Color",
98
- description: "Border color for the widget",
99
- defaultValue: "muted",
100
- tab: "styling",
101
- group: "Design"
102
- }),
103
- {
104
- key: "verticalSizing",
105
- label: "Vertical Sizing",
106
- type: "buttonGroup",
107
- description: "How the video height is determined",
108
- options: [{
109
- label: "Auto",
110
- value: "auto"
111
- }, {
112
- label: "Fixed",
113
- value: "fixed"
114
- }],
115
- defaultValue: "auto",
116
- tab: "styling",
117
- group: "Design"
118
- },
119
- getHeightField({
120
- key: "fixedHeight",
121
- label: "Height",
122
- description: "Fixed height of the video container",
123
- defaultValue: "200px",
124
- tab: "styling",
125
- group: "Design",
126
- requiresKeyValue: {
127
- key: "verticalSizing",
128
- value: "fixed"
129
- }
130
- }),
131
- {
132
- key: "displayFit",
133
- label: "Display Fit",
134
- type: "buttonGroup",
135
- description: "How the video fills its container",
136
- options: [{
137
- label: "Cover",
138
- value: "cover"
139
- }, {
140
- label: "Contain",
141
- value: "contain"
142
- }],
143
- defaultValue: "cover",
144
- tab: "styling",
145
- group: "Design",
146
- requiresKeyValue: {
147
- key: "verticalSizing",
148
- value: "fixed"
149
- }
150
- },
151
- {
152
- key: "focusPoint",
153
- label: "Focus Point",
154
- type: "contentPosition",
155
- description: "The focal point of the video within its container",
156
- defaultValue: "center",
157
- tab: "styling",
158
- group: "Design",
159
- requiresKeyValue: {
160
- key: "verticalSizing",
161
- value: "fixed"
162
- }
163
- },
164
- {
165
- key: "controls",
166
- label: "Show Controls",
167
- type: "boolean",
168
- description: "Display video playback controls",
169
- defaultValue: true,
170
- tab: "behavior",
171
- group: "Behavior"
172
- },
173
- {
174
- key: "autoplay",
175
- label: "Autoplay",
176
- type: "boolean",
177
- description: "Automatically start playing the video",
178
- defaultValue: false,
179
- tab: "behavior",
180
- group: "Behavior"
181
- },
182
- {
183
- key: "loop",
184
- label: "Loop",
185
- type: "boolean",
186
- description: "Repeat the video when it ends",
187
- defaultValue: false,
188
- tab: "behavior",
189
- group: "Behavior"
190
- },
191
- {
192
- key: "muted",
193
- label: "Muted",
194
- type: "boolean",
195
- description: "Start with audio muted",
196
- defaultValue: true,
197
- tab: "behavior",
198
- group: "Behavior"
199
- }
200
- ]
201
- };
202
- //#endregion
203
- export { VideoWidget_exports as n, videoWidgetPropertySchema as r, VideoWidget as t };
204
-
205
- //# sourceMappingURL=VideoWidget-FoAueFwA.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoWidget-FoAueFwA.mjs","names":[],"sources":["../../widgets/src/widgets/VideoWidget.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport type React from \"react\";\nimport {\n getBorderRadiusField,\n getBorderWidthField,\n getBorderColorField,\n borderWidthClasses,\n borderColorClasses,\n getHeightField,\n type WidgetPropertySchema,\n} from \"@fluid-app/portal-core/registries\";\nimport type {\n BorderRadiusOptions,\n BorderWidthOptions,\n ColorOptions,\n ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport { MediaRenderer } from \"../components/MediaRenderer\";\n\ntype VideoWidgetProps = ComponentProps<\"div\"> & {\n src?: string;\n poster?: string;\n borderRadius?: BorderRadiusOptions;\n borderWidth?: BorderWidthOptions;\n borderColor?: ColorOptions;\n verticalSizing?: \"auto\" | \"fixed\";\n fixedHeight?: string;\n displayFit?: \"cover\" | \"contain\";\n focusPoint?: string;\n controls?: boolean;\n autoplay?: boolean;\n loop?: boolean;\n muted?: boolean;\n resource?: ShareableItem;\n useCustomUrl?: boolean;\n};\n\nexport function VideoWidget({\n src = \"\",\n poster = \"\",\n borderRadius = \"md\",\n borderWidth = \"none\",\n borderColor = \"muted\",\n verticalSizing = \"auto\",\n fixedHeight = \"200px\",\n displayFit = \"cover\",\n focusPoint,\n controls = true,\n autoplay = false,\n loop = false,\n muted = true,\n resource,\n useCustomUrl,\n}: VideoWidgetProps): React.JSX.Element {\n const effectiveSrc = useCustomUrl ? src : (resource?.videoUrl ?? src);\n const effectivePoster = useCustomUrl\n ? poster\n : (resource?.imageUrl ?? poster);\n\n const isFixed = verticalSizing === \"fixed\";\n\n return (\n <div\n className={`relative w-full overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"}`}\n style={isFixed ? { height: fixedHeight } : undefined}\n >\n <MediaRenderer\n mediaType=\"video\"\n src={effectiveSrc}\n poster={effectivePoster}\n objectFit={isFixed ? displayFit : undefined}\n focusPoint={isFixed ? focusPoint : undefined}\n controls={controls}\n autoplay={autoplay}\n loop={loop}\n muted={muted}\n />\n </div>\n );\n}\n\nexport const videoWidgetPropertySchema: WidgetPropertySchema = {\n widgetType: \"VideoWidget\",\n displayName: \"Video\",\n tabsConfig: [\n { id: \"styling\", label: \"Styling\" },\n { id: \"behavior\", label: \"Behavior\" },\n ],\n fields: [\n // Styling tab - Content group\n {\n key: \"resource\",\n label: \"Select Video\",\n type: \"resource\",\n description: \"Browse and select a video\",\n allowedTypes: [\"Medium\"],\n tab: \"styling\",\n group: \"Content\",\n },\n {\n key: \"useCustomUrl\",\n label: \"Use Custom URL\",\n type: \"boolean\",\n description: \"Enter a custom video URL instead of selecting media\",\n defaultValue: false,\n tab: \"styling\",\n group: \"Content\",\n },\n {\n key: \"src\",\n label: \"Video URL\",\n type: \"text\",\n description: \"The source URL of the video\",\n defaultValue: \"\",\n tab: \"styling\",\n group: \"Content\",\n requiresKeyToBeTrue: \"useCustomUrl\",\n },\n {\n key: \"poster\",\n label: \"Poster Image URL\",\n type: \"text\",\n description: \"Thumbnail image displayed before video plays\",\n defaultValue: \"\",\n tab: \"styling\",\n group: \"Content\",\n requiresKeyToBeTrue: \"useCustomUrl\",\n },\n\n // Styling tab - Design group\n getBorderRadiusField({\n key: \"borderRadius\",\n label: \"Border Radius\",\n description: \"Border radius for the calendar container\",\n defaultValue: \"md\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderWidthField({\n key: \"borderWidth\",\n label: \"Border Width\",\n description: \"Border width for the widget\",\n defaultValue: \"none\",\n tab: \"styling\",\n group: \"Design\",\n }),\n getBorderColorField({\n key: \"borderColor\",\n label: \"Border Color\",\n description: \"Border color for the widget\",\n defaultValue: \"muted\",\n tab: \"styling\",\n group: \"Design\",\n }),\n {\n key: \"verticalSizing\",\n label: \"Vertical Sizing\",\n type: \"buttonGroup\",\n description: \"How the video height is determined\",\n options: [\n { label: \"Auto\", value: \"auto\" },\n { label: \"Fixed\", value: \"fixed\" },\n ],\n defaultValue: \"auto\",\n tab: \"styling\",\n group: \"Design\",\n },\n getHeightField({\n key: \"fixedHeight\",\n label: \"Height\",\n description: \"Fixed height of the video container\",\n defaultValue: \"200px\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n }),\n {\n key: \"displayFit\",\n label: \"Display Fit\",\n type: \"buttonGroup\",\n description: \"How the video fills its container\",\n options: [\n { label: \"Cover\", value: \"cover\" },\n { label: \"Contain\", value: \"contain\" },\n ],\n defaultValue: \"cover\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n {\n key: \"focusPoint\",\n label: \"Focus Point\",\n type: \"contentPosition\",\n description: \"The focal point of the video within its container\",\n defaultValue: \"center\",\n tab: \"styling\",\n group: \"Design\",\n requiresKeyValue: { key: \"verticalSizing\", value: \"fixed\" },\n },\n\n // Behavior tab\n {\n key: \"controls\",\n label: \"Show Controls\",\n type: \"boolean\",\n description: \"Display video playback controls\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n {\n key: \"autoplay\",\n label: \"Autoplay\",\n type: \"boolean\",\n description: \"Automatically start playing the video\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n {\n key: \"loop\",\n label: \"Loop\",\n type: \"boolean\",\n description: \"Repeat the video when it ends\",\n defaultValue: false,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n {\n key: \"muted\",\n label: \"Muted\",\n type: \"boolean\",\n description: \"Start with audio muted\",\n defaultValue: true,\n tab: \"behavior\",\n group: \"Behavior\",\n },\n ],\n};\n"],"mappings":";;;;;;;;;AAqCA,SAAgB,YAAY,EAC1B,MAAM,IACN,SAAS,IACT,eAAe,MACf,cAAc,QACd,cAAc,SACd,iBAAiB,QACjB,cAAc,SACd,aAAa,SACb,YACA,WAAW,MACX,WAAW,OACX,OAAO,OACP,QAAQ,MACR,UACA,gBACsC;CACtC,MAAM,eAAe,eAAe,MAAO,UAAU,YAAY;CACjE,MAAM,kBAAkB,eACpB,SACC,UAAU,YAAY;CAE3B,MAAM,UAAU,mBAAmB;AAEnC,QACE,oBAAC,OAAD;EACE,WAAW,2CAA2C,aAAa,GAAG,mBAAmB,aAAa,GAAG,gBAAgB,SAAS,mBAAmB,eAAe;EACpK,OAAO,UAAU,EAAE,QAAQ,aAAa,GAAG,KAAA;YAE3C,oBAAC,eAAD;GACE,WAAU;GACV,KAAK;GACL,QAAQ;GACR,WAAW,UAAU,aAAa,KAAA;GAClC,YAAY,UAAU,aAAa,KAAA;GACzB;GACA;GACJ;GACC;GACP,CAAA;EACE,CAAA;;AAIV,MAAa,4BAAkD;CAC7D,YAAY;CACZ,aAAa;CACb,YAAY,CACV;EAAE,IAAI;EAAW,OAAO;EAAW,EACnC;EAAE,IAAI;EAAY,OAAO;EAAY,CACtC;CACD,QAAQ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