@geekapps/silo-elements-nextjs 0.2.33 → 0.2.35

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.
@@ -49,11 +49,29 @@ type VideoProps = {
49
49
  fixedHeight?: string | number;
50
50
  };
51
51
  declare function Sources(_props: SourcesProps): null;
52
+ declare namespace Sources {
53
+ var displayName: string;
54
+ }
52
55
  declare function Source(_props: SourceProps): null;
56
+ declare namespace Source {
57
+ var displayName: string;
58
+ }
53
59
  declare function Subtitles(_props: SubtitlesProps): null;
60
+ declare namespace Subtitles {
61
+ var displayName: string;
62
+ }
54
63
  declare function Subtitle(_props: SubtitleProps): null;
64
+ declare namespace Subtitle {
65
+ var displayName: string;
66
+ }
55
67
  declare function Storyboard(_props: StoryboardProps): null;
68
+ declare namespace Storyboard {
69
+ var displayName: string;
70
+ }
56
71
  declare function StoryboardFrame(_props: StoryboardFrameProps): null;
72
+ declare namespace StoryboardFrame {
73
+ var displayName: string;
74
+ }
57
75
  declare function Video({ title, description, poster, children, className, autoHideControls, defaultVolume, maxHeight, fixedHeight, }: VideoProps): react__default.JSX.Element;
58
76
  declare const VideoPlayer: typeof Video;
59
77
 
@@ -12,21 +12,27 @@ var PLAYBACK_SPEEDS = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 2];
12
12
  function Sources(_props) {
13
13
  return null;
14
14
  }
15
+ Sources.displayName = "SiloSources";
15
16
  function Source(_props) {
16
17
  return null;
17
18
  }
19
+ Source.displayName = "SiloSource";
18
20
  function Subtitles(_props) {
19
21
  return null;
20
22
  }
23
+ Subtitles.displayName = "SiloSubtitles";
21
24
  function Subtitle(_props) {
22
25
  return null;
23
26
  }
27
+ Subtitle.displayName = "SiloSubtitle";
24
28
  function Storyboard(_props) {
25
29
  return null;
26
30
  }
31
+ Storyboard.displayName = "SiloStoryboard";
27
32
  function StoryboardFrame(_props) {
28
33
  return null;
29
34
  }
35
+ StoryboardFrame.displayName = "SiloStoryboardFrame";
30
36
  function Video({
31
37
  title,
32
38
  description,
@@ -1197,32 +1203,39 @@ function parseVideoChildren(children) {
1197
1203
  sources: [],
1198
1204
  subtitles: []
1199
1205
  };
1206
+ function dn(child) {
1207
+ return child.type?.displayName ?? child.type?.name ?? "";
1208
+ }
1200
1209
  React.Children.forEach(children, (child) => {
1201
1210
  if (!React.isValidElement(child)) return;
1202
- if (child.type === Sources) {
1211
+ const name = dn(child);
1212
+ if (child.type === Sources || name === "SiloSources") {
1203
1213
  const element = child;
1204
1214
  React.Children.forEach(element.props.children, (sourceChild) => {
1205
1215
  if (!React.isValidElement(sourceChild)) return;
1206
- if (sourceChild.type !== Source) return;
1216
+ const sn = dn(sourceChild);
1217
+ if (sourceChild.type !== Source && sn !== "SiloSource") return;
1207
1218
  const sourceElement = sourceChild;
1208
1219
  parsed.sources.push(sourceElement.props);
1209
1220
  });
1210
1221
  }
1211
- if (child.type === Subtitles) {
1222
+ if (child.type === Subtitles || name === "SiloSubtitles") {
1212
1223
  const element = child;
1213
1224
  React.Children.forEach(element.props.children, (subtitleChild) => {
1214
1225
  if (!React.isValidElement(subtitleChild)) return;
1215
- if (subtitleChild.type !== Subtitle) return;
1226
+ const sn = dn(subtitleChild);
1227
+ if (subtitleChild.type !== Subtitle && sn !== "SiloSubtitle") return;
1216
1228
  const subtitleElement = subtitleChild;
1217
1229
  parsed.subtitles.push(subtitleElement.props);
1218
1230
  });
1219
1231
  }
1220
- if (child.type === Storyboard) {
1232
+ if (child.type === Storyboard || name === "SiloStoryboard") {
1221
1233
  const element = child;
1222
1234
  const frames = [];
1223
1235
  React.Children.forEach(element.props.children, (frameChild) => {
1224
1236
  if (!React.isValidElement(frameChild)) return;
1225
- if (frameChild.type !== StoryboardFrame) return;
1237
+ const fn2 = dn(frameChild);
1238
+ if (frameChild.type !== StoryboardFrame && fn2 !== "SiloStoryboardFrame") return;
1226
1239
  const frameElement = frameChild;
1227
1240
  frames.push(frameElement.props);
1228
1241
  });