@geekapps/silo-elements-nextjs 0.2.33 → 0.2.34

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,36 @@ function parseVideoChildren(children) {
1197
1203
  sources: [],
1198
1204
  subtitles: []
1199
1205
  };
1206
+ function isType(child, fn) {
1207
+ if (child.type === fn) return true;
1208
+ return child.type?.displayName === fn.displayName && !!fn.displayName;
1209
+ }
1200
1210
  React.Children.forEach(children, (child) => {
1201
1211
  if (!React.isValidElement(child)) return;
1202
- if (child.type === Sources) {
1212
+ if (isType(child, Sources)) {
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
+ if (!isType(sourceChild, Source)) return;
1207
1217
  const sourceElement = sourceChild;
1208
1218
  parsed.sources.push(sourceElement.props);
1209
1219
  });
1210
1220
  }
1211
- if (child.type === Subtitles) {
1221
+ if (isType(child, Subtitles)) {
1212
1222
  const element = child;
1213
1223
  React.Children.forEach(element.props.children, (subtitleChild) => {
1214
1224
  if (!React.isValidElement(subtitleChild)) return;
1215
- if (subtitleChild.type !== Subtitle) return;
1225
+ if (!isType(subtitleChild, Subtitle)) return;
1216
1226
  const subtitleElement = subtitleChild;
1217
1227
  parsed.subtitles.push(subtitleElement.props);
1218
1228
  });
1219
1229
  }
1220
- if (child.type === Storyboard) {
1230
+ if (isType(child, Storyboard)) {
1221
1231
  const element = child;
1222
1232
  const frames = [];
1223
1233
  React.Children.forEach(element.props.children, (frameChild) => {
1224
1234
  if (!React.isValidElement(frameChild)) return;
1225
- if (frameChild.type !== StoryboardFrame) return;
1235
+ if (!isType(frameChild, StoryboardFrame)) return;
1226
1236
  const frameElement = frameChild;
1227
1237
  frames.push(frameElement.props);
1228
1238
  });