@plasmicpkgs/react-youtube 7.13.4 → 7.13.5

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.
@@ -117,22 +117,25 @@ var youtubeMeta = {
117
117
  type: "string",
118
118
  defaultValue: "R6MeLqRQzYw",
119
119
  displayName: "Video ID",
120
- description: "The ID for the YouTube video."
120
+ description: "The ID for the YouTube video"
121
121
  },
122
122
  autoplay: {
123
123
  type: "boolean",
124
124
  displayName: "Auto Play",
125
- description: "Whether the video show automatically start playing when the player loads"
125
+ description: "Whether the video should automatically start playing when the player loads",
126
+ defaultValueHint: false
126
127
  },
127
128
  cc_load_policy: {
128
129
  type: "boolean",
129
130
  displayName: "Show Captions",
130
- description: "Whether the captions should be shown by default, even if the user has turned captions off"
131
+ description: "Whether the captions should be shown by default, even if the user has turned captions off",
132
+ defaultValueHint: false
131
133
  },
132
134
  start: {
133
135
  type: "number",
134
136
  displayName: "Start",
135
- description: "The video should begin at this amount of seconds from the start of the video"
137
+ description: "The video should begin at this amount of seconds from the start of the video",
138
+ defaultValueHint: 0
136
139
  },
137
140
  end: {
138
141
  type: "number",
@@ -143,42 +146,50 @@ var youtubeMeta = {
143
146
  type: "choice",
144
147
  displayName: "Color",
145
148
  options: ["red", "white"],
146
- description: "The color used in the display bar to highlight how much of the video the viewer has already seen"
149
+ description: "The color used in the display bar to highlight how much of the video the viewer has already seen",
150
+ defaultValueHint: "red"
147
151
  },
148
152
  controls: {
149
153
  type: "boolean",
150
154
  displayName: "Show Controls",
151
- description: "Whether the YouTube video player controls should be displayed"
155
+ description: "Whether the YouTube video player controls should be displayed",
156
+ defaultValueHint: true
152
157
  },
153
158
  disablekb: {
154
159
  type: "boolean",
155
160
  displayName: "Disable Keyboard",
156
- description: "Whether the keyboard controls should be disabled"
161
+ description: "Whether the keyboard controls should be disabled",
162
+ defaultValueHint: false
157
163
  },
158
164
  fs: {
159
165
  type: "boolean",
160
166
  displayName: "FullScreen Button",
161
- description: "Whether the fullscreen button should be displayed"
167
+ description: "Whether the fullscreen button should be displayed",
168
+ defaultValueHint: true
162
169
  },
163
170
  loop: {
164
171
  type: "boolean",
165
172
  displayName: "Loop",
166
- description: "Whether the video should be played again after it finishes"
173
+ description: "Whether the video should be played again after it finishes",
174
+ defaultValueHint: false
167
175
  },
168
176
  modestbranding: {
169
177
  type: "boolean",
170
178
  displayName: "Hide Logo",
171
- description: "Hide the YouTube logo"
179
+ description: "Hide the YouTube logo in the control bar",
180
+ defaultValueHint: false
172
181
  },
173
182
  playsinline: {
174
183
  type: "boolean",
175
184
  displayName: "Play Inline",
176
- description: "Whether the video should be played inline or fullscreen on iOS"
185
+ description: "Whether the video should be played inline or fullscreen on iOS",
186
+ defaultValueHint: false
177
187
  },
178
188
  rel: {
179
189
  type: "boolean",
180
190
  displayName: "Related Videos",
181
- description: "Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)"
191
+ description: "Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)",
192
+ defaultValueHint: true
182
193
  }
183
194
  },
184
195
  isDefaultExport: true,
@@ -1 +1 @@
1
- {"version":3,"file":"react-youtube.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport YouTubeImpl, {\n PlayerVars,\n YouTubeProps as YouTubeImplProps,\n} from \"react-youtube\";\n\nexport type YouTubeProps = YouTubeImplProps &\n {\n [prop in keyof PlayerVars]:\n | PlayerVars[prop]\n | (prop extends typeof booleanParams[number] ? boolean : never);\n };\nconst playerParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"color\",\n \"controls\",\n \"disablekb\",\n \"enablejsapi\",\n \"end\",\n \"fs\",\n \"hl\",\n \"iv_load_policy\",\n \"list\",\n \"listType\",\n \"loop\",\n \"modestbranding\",\n \"origin\",\n \"playlist\",\n \"playsinline\",\n \"rel\",\n \"showinfo\",\n \"start\",\n \"mute\",\n] as const;\n\nconst booleanParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"controls\",\n \"disablekb\",\n \"fs\",\n \"loop\",\n \"modestbranding\",\n \"playsinline\",\n \"rel\",\n] as const;\n\nconst booleanParamsSet = new Set<string>(booleanParams);\n\nconst YouTube = React.forwardRef<YouTubeImpl, YouTubeProps>(\n (props: YouTubeProps, ref) => {\n const finalProps = { ...props };\n for (const prop of playerParams) {\n if (prop in finalProps) {\n const value = finalProps[prop];\n delete finalProps[prop];\n if (!finalProps.opts) {\n finalProps.opts = {};\n }\n if (!finalProps.opts.playerVars) {\n finalProps.opts.playerVars = {};\n }\n if (booleanParamsSet.has(prop)) {\n if (prop === \"cc_load_policy\" || prop === \"modestbranding\") {\n // undefined or 1\n if (value) {\n finalProps.opts.playerVars[prop] = 1;\n } else {\n delete finalProps.opts.playerVars[prop];\n }\n } else {\n // 0 or 1\n finalProps.opts.playerVars[prop] = (value ? 1 : 0) as any;\n }\n } else {\n finalProps.opts.playerVars[prop] = value as any;\n }\n }\n }\n return <YouTubeImpl ref={ref} {...finalProps} />;\n }\n);\n\nexport const youtubeMeta: ComponentMeta<YouTubeProps> = {\n name: \"hostless-youtube\",\n displayName: \"YouTube\",\n importName: \"YouTube\",\n importPath: \"@plasmicpkgs/react-youtube\",\n props: {\n videoId: {\n type: \"string\",\n defaultValue: \"R6MeLqRQzYw\",\n displayName: \"Video ID\",\n description: \"The ID for the YouTube video.\",\n },\n autoplay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video show automatically start playing when the player loads\",\n },\n cc_load_policy: {\n type: \"boolean\",\n displayName: \"Show Captions\",\n description:\n \"Whether the captions should be shown by default, even if the user has turned captions off\",\n },\n start: {\n type: \"number\",\n displayName: \"Start\",\n description:\n \"The video should begin at this amount of seconds from the start of the video\",\n },\n end: {\n type: \"number\",\n displayName: \"End\",\n description:\n \"Stop playing the video after this amount of seconds (measured from the start of the video)\",\n },\n color: {\n type: \"choice\",\n displayName: \"Color\",\n options: [\"red\", \"white\"],\n description:\n \"The color used in the display bar to highlight how much of the video the viewer has already seen\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description:\n \"Whether the YouTube video player controls should be displayed\",\n },\n disablekb: {\n type: \"boolean\",\n displayName: \"Disable Keyboard\",\n description: \"Whether the keyboard controls should be disabled\",\n },\n fs: {\n type: \"boolean\",\n displayName: \"FullScreen Button\",\n description: \"Whether the fullscreen button should be displayed\",\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n },\n modestbranding: {\n type: \"boolean\",\n displayName: \"Hide Logo\",\n description: \"Hide the YouTube logo\",\n },\n playsinline: {\n type: \"boolean\",\n displayName: \"Play Inline\",\n description:\n \"Whether the video should be played inline or fullscreen on iOS\",\n },\n rel: {\n type: \"boolean\",\n displayName: \"Related Videos\",\n description:\n \"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"390px\",\n width: \"640px\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerYouTube(\n loader?: { registerComponent: typeof registerComponent },\n customYouTubeMeta?: ComponentMeta<YouTubeProps>\n) {\n if (loader) {\n loader.registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n } else {\n registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n }\n}\n\nexport default YouTube;\n"],"names":["playerParams","booleanParams","booleanParamsSet","Set","YouTube","React","forwardRef","props","ref","finalProps","prop","value","opts","playerVars","has","YouTubeImpl","youtubeMeta","name","displayName","importName","importPath","videoId","type","defaultValue","description","autoplay","cc_load_policy","start","end","color","options","controls","disablekb","fs","loop","modestbranding","playsinline","rel","isDefaultExport","defaultStyles","height","width","maxHeight","maxWidth","registerYouTube","loader","customYouTubeMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAGHM,MAAAA,WAAW,EACT;AAJC;AAtEA,GAL+C;AAkFtDc,EAAAA,eAAe,EAAE,IAlFqC;AAmFtDC,EAAAA,aAAa,EAAE;AACbC,IAAAA,MAAM,EAAE,OADK;AAEbC,IAAAA,KAAK,EAAE,OAFM;AAGbC,IAAAA,SAAS,EAAE,MAHE;AAIbC,IAAAA,QAAQ,EAAE;AAJG;AAnFuC;SA2FxCC,gBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyB3C,OAAzB,EAAkC0C,iBAAlC,WAAkCA,iBAAlC,GAAuD9B,WAAvD;AACD,GAFD,MAEO;AACL+B,IAAAA,iBAAiB,CAAC3C,OAAD,EAAU0C,iBAAV,WAAUA,iBAAV,GAA+B9B,WAA/B,CAAjB;AACD;AACF;;;;;;"}
1
+ {"version":3,"file":"react-youtube.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport YouTubeImpl, {\n PlayerVars,\n YouTubeProps as YouTubeImplProps,\n} from \"react-youtube\";\n\nexport type YouTubeProps = YouTubeImplProps &\n {\n [prop in keyof PlayerVars]:\n | PlayerVars[prop]\n | (prop extends typeof booleanParams[number] ? boolean : never);\n };\nconst playerParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"color\",\n \"controls\",\n \"disablekb\",\n \"enablejsapi\",\n \"end\",\n \"fs\",\n \"hl\",\n \"iv_load_policy\",\n \"list\",\n \"listType\",\n \"loop\",\n \"modestbranding\",\n \"origin\",\n \"playlist\",\n \"playsinline\",\n \"rel\",\n \"showinfo\",\n \"start\",\n \"mute\",\n] as const;\n\nconst booleanParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"controls\",\n \"disablekb\",\n \"fs\",\n \"loop\",\n \"modestbranding\",\n \"playsinline\",\n \"rel\",\n] as const;\n\nconst booleanParamsSet = new Set<string>(booleanParams);\n\nconst YouTube = React.forwardRef<YouTubeImpl, YouTubeProps>(\n (props: YouTubeProps, ref) => {\n const finalProps = { ...props };\n for (const prop of playerParams) {\n if (prop in finalProps) {\n const value = finalProps[prop];\n delete finalProps[prop];\n if (!finalProps.opts) {\n finalProps.opts = {};\n }\n if (!finalProps.opts.playerVars) {\n finalProps.opts.playerVars = {};\n }\n if (booleanParamsSet.has(prop)) {\n if (prop === \"cc_load_policy\" || prop === \"modestbranding\") {\n // undefined or 1\n if (value) {\n finalProps.opts.playerVars[prop] = 1;\n } else {\n delete finalProps.opts.playerVars[prop];\n }\n } else {\n // 0 or 1\n finalProps.opts.playerVars[prop] = (value ? 1 : 0) as any;\n }\n } else {\n finalProps.opts.playerVars[prop] = value as any;\n }\n }\n }\n return <YouTubeImpl ref={ref} {...finalProps} />;\n }\n);\n\nexport const youtubeMeta: ComponentMeta<YouTubeProps> = {\n name: \"hostless-youtube\",\n displayName: \"YouTube\",\n importName: \"YouTube\",\n importPath: \"@plasmicpkgs/react-youtube\",\n props: {\n videoId: {\n type: \"string\",\n defaultValue: \"R6MeLqRQzYw\",\n displayName: \"Video ID\",\n description: \"The ID for the YouTube video\",\n },\n autoplay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video should automatically start playing when the player loads\",\n defaultValueHint: false,\n },\n cc_load_policy: {\n type: \"boolean\",\n displayName: \"Show Captions\",\n description:\n \"Whether the captions should be shown by default, even if the user has turned captions off\",\n defaultValueHint: false,\n },\n start: {\n type: \"number\",\n displayName: \"Start\",\n description:\n \"The video should begin at this amount of seconds from the start of the video\",\n defaultValueHint: 0,\n },\n end: {\n type: \"number\",\n displayName: \"End\",\n description:\n \"Stop playing the video after this amount of seconds (measured from the start of the video)\",\n },\n color: {\n type: \"choice\",\n displayName: \"Color\",\n options: [\"red\", \"white\"],\n description:\n \"The color used in the display bar to highlight how much of the video the viewer has already seen\",\n defaultValueHint: \"red\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description:\n \"Whether the YouTube video player controls should be displayed\",\n defaultValueHint: true,\n },\n disablekb: {\n type: \"boolean\",\n displayName: \"Disable Keyboard\",\n description: \"Whether the keyboard controls should be disabled\",\n defaultValueHint: false,\n },\n fs: {\n type: \"boolean\",\n displayName: \"FullScreen Button\",\n description: \"Whether the fullscreen button should be displayed\",\n defaultValueHint: true,\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n defaultValueHint: false,\n },\n modestbranding: {\n type: \"boolean\",\n displayName: \"Hide Logo\",\n description: \"Hide the YouTube logo in the control bar\",\n defaultValueHint: false,\n },\n playsinline: {\n type: \"boolean\",\n displayName: \"Play Inline\",\n description:\n \"Whether the video should be played inline or fullscreen on iOS\",\n defaultValueHint: false,\n },\n rel: {\n type: \"boolean\",\n displayName: \"Related Videos\",\n description:\n \"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)\",\n defaultValueHint: true,\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"390px\",\n width: \"640px\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerYouTube(\n loader?: { registerComponent: typeof registerComponent },\n customYouTubeMeta?: ComponentMeta<YouTubeProps>\n) {\n if (loader) {\n loader.registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n } else {\n registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n }\n}\n\nexport default YouTube;\n"],"names":["playerParams","booleanParams","booleanParamsSet","Set","YouTube","React","forwardRef","props","ref","finalProps","prop","value","opts","playerVars","has","YouTubeImpl","youtubeMeta","name","displayName","importName","importPath","videoId","type","defaultValue","description","autoplay","defaultValueHint","cc_load_policy","start","end","color","options","controls","disablekb","fs","loop","modestbranding","playsinline","rel","isDefaultExport","defaultStyles","height","width","maxHeight","maxWidth","registerYouTube","loader","customYouTubeMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SADQ;AAEdJ,MAAAA,WAAW,EAAE,WAFC;AAGdM,MAAAA,WAAW,EAAE,0CAHC;AAIdE,MAAAA,gBAAgB,EAAE;AAJJ,KAnEX;AAyELW,IAAAA,WAAW,EAAE;AACXf,MAAAA,IAAI,EAAE,SADK;AAEXJ,MAAAA,WAAW,EAAE,aAFF;AAGXM,MAAAA,WAAW,EACT,gEAJS;AAKXE,MAAAA,gBAAgB,EAAE;AALP,KAzER;AAgFLY,IAAAA,GAAG,EAAE;AACHhB,MAAAA,IAAI,EAAE,SADH;AAEHJ,MAAAA,WAAW,EAAE,gBAFV;AAGHM,MAAAA,WAAW,EACT,mHAJC;AAKHE,MAAAA,gBAAgB,EAAE;AALf;AAhFA,GAL+C;AA6FtDa,EAAAA,eAAe,EAAE,IA7FqC;AA8FtDC,EAAAA,aAAa,EAAE;AACbC,IAAAA,MAAM,EAAE,OADK;AAEbC,IAAAA,KAAK,EAAE,OAFM;AAGbC,IAAAA,SAAS,EAAE,MAHE;AAIbC,IAAAA,QAAQ,EAAE;AAJG;AA9FuC;SAsGxCC,gBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyB5C,OAAzB,EAAkC2C,iBAAlC,WAAkCA,iBAAlC,GAAuD/B,WAAvD;AACD,GAFD,MAEO;AACLgC,IAAAA,iBAAiB,CAAC5C,OAAD,EAAU2C,iBAAV,WAAUA,iBAAV,GAA+B/B,WAA/B,CAAjB;AACD;AACF;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),o=e(require("react")),r=e(require("react-youtube"));function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}var n=["autoplay","cc_load_policy","color","controls","disablekb","enablejsapi","end","fs","hl","iv_load_policy","list","listType","loop","modestbranding","origin","playlist","playsinline","rel","showinfo","start","mute"],l=new Set(["autoplay","cc_load_policy","controls","disablekb","fs","loop","modestbranding","playsinline","rel"]),s=o.forwardRef((function(e,t){for(var s,d=a({},e),p=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return(o=o.call(e)).next.bind(o);if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?i(e,void 0):void 0}}(e))){o&&(e=o);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n);!(s=p()).done;){var u=s.value;if(u in d){var h=d[u];delete d[u],d.opts||(d.opts={}),d.opts.playerVars||(d.opts.playerVars={}),l.has(u)?"cc_load_policy"===u||"modestbranding"===u?h?d.opts.playerVars[u]=1:delete d.opts.playerVars[u]:d.opts.playerVars[u]=h?1:0:d.opts.playerVars[u]=h}}return o.createElement(r,Object.assign({ref:t},d))})),d={name:"hostless-youtube",displayName:"YouTube",importName:"YouTube",importPath:"@plasmicpkgs/react-youtube",props:{videoId:{type:"string",defaultValue:"R6MeLqRQzYw",displayName:"Video ID",description:"The ID for the YouTube video."},autoplay:{type:"boolean",displayName:"Auto Play",description:"Whether the video show automatically start playing when the player loads"},cc_load_policy:{type:"boolean",displayName:"Show Captions",description:"Whether the captions should be shown by default, even if the user has turned captions off"},start:{type:"number",displayName:"Start",description:"The video should begin at this amount of seconds from the start of the video"},end:{type:"number",displayName:"End",description:"Stop playing the video after this amount of seconds (measured from the start of the video)"},color:{type:"choice",displayName:"Color",options:["red","white"],description:"The color used in the display bar to highlight how much of the video the viewer has already seen"},controls:{type:"boolean",displayName:"Show Controls",description:"Whether the YouTube video player controls should be displayed"},disablekb:{type:"boolean",displayName:"Disable Keyboard",description:"Whether the keyboard controls should be disabled"},fs:{type:"boolean",displayName:"FullScreen Button",description:"Whether the fullscreen button should be displayed"},loop:{type:"boolean",displayName:"Loop",description:"Whether the video should be played again after it finishes"},modestbranding:{type:"boolean",displayName:"Hide Logo",description:"Hide the YouTube logo"},playsinline:{type:"boolean",displayName:"Play Inline",description:"Whether the video should be played inline or fullscreen on iOS"},rel:{type:"boolean",displayName:"Related Videos",description:"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)"}},isDefaultExport:!0,defaultStyles:{height:"390px",width:"640px",maxHeight:"100%",maxWidth:"100%"}};exports.default=s,exports.registerYouTube=function(e,o){e?e.registerComponent(s,null!=o?o:d):t(s,null!=o?o:d)},exports.youtubeMeta=d;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),o=e(require("react")),a=e(require("react-youtube"));function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a])}return e}).apply(this,arguments)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o<t;o++)a[o]=e[o];return a}var l=["autoplay","cc_load_policy","color","controls","disablekb","enablejsapi","end","fs","hl","iv_load_policy","list","listType","loop","modestbranding","origin","playlist","playsinline","rel","showinfo","start","mute"],n=new Set(["autoplay","cc_load_policy","controls","disablekb","fs","loop","modestbranding","playsinline","rel"]),s=o.forwardRef((function(e,t){for(var s,d=r({},e),p=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return(o=o.call(e)).next.bind(o);if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?i(e,void 0):void 0}}(e))){o&&(e=o);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(l);!(s=p()).done;){var u=s.value;if(u in d){var h=d[u];delete d[u],d.opts||(d.opts={}),d.opts.playerVars||(d.opts.playerVars={}),n.has(u)?"cc_load_policy"===u||"modestbranding"===u?h?d.opts.playerVars[u]=1:delete d.opts.playerVars[u]:d.opts.playerVars[u]=h?1:0:d.opts.playerVars[u]=h}}return o.createElement(a,Object.assign({ref:t},d))})),d={name:"hostless-youtube",displayName:"YouTube",importName:"YouTube",importPath:"@plasmicpkgs/react-youtube",props:{videoId:{type:"string",defaultValue:"R6MeLqRQzYw",displayName:"Video ID",description:"The ID for the YouTube video"},autoplay:{type:"boolean",displayName:"Auto Play",description:"Whether the video should automatically start playing when the player loads",defaultValueHint:!1},cc_load_policy:{type:"boolean",displayName:"Show Captions",description:"Whether the captions should be shown by default, even if the user has turned captions off",defaultValueHint:!1},start:{type:"number",displayName:"Start",description:"The video should begin at this amount of seconds from the start of the video",defaultValueHint:0},end:{type:"number",displayName:"End",description:"Stop playing the video after this amount of seconds (measured from the start of the video)"},color:{type:"choice",displayName:"Color",options:["red","white"],description:"The color used in the display bar to highlight how much of the video the viewer has already seen",defaultValueHint:"red"},controls:{type:"boolean",displayName:"Show Controls",description:"Whether the YouTube video player controls should be displayed",defaultValueHint:!0},disablekb:{type:"boolean",displayName:"Disable Keyboard",description:"Whether the keyboard controls should be disabled",defaultValueHint:!1},fs:{type:"boolean",displayName:"FullScreen Button",description:"Whether the fullscreen button should be displayed",defaultValueHint:!0},loop:{type:"boolean",displayName:"Loop",description:"Whether the video should be played again after it finishes",defaultValueHint:!1},modestbranding:{type:"boolean",displayName:"Hide Logo",description:"Hide the YouTube logo in the control bar",defaultValueHint:!1},playsinline:{type:"boolean",displayName:"Play Inline",description:"Whether the video should be played inline or fullscreen on iOS",defaultValueHint:!1},rel:{type:"boolean",displayName:"Related Videos",description:"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)",defaultValueHint:!0}},isDefaultExport:!0,defaultStyles:{height:"390px",width:"640px",maxHeight:"100%",maxWidth:"100%"}};exports.default=s,exports.registerYouTube=function(e,o){e?e.registerComponent(s,null!=o?o:d):t(s,null!=o?o:d)},exports.youtubeMeta=d;
2
2
  //# sourceMappingURL=react-youtube.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-youtube.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport YouTubeImpl, {\n PlayerVars,\n YouTubeProps as YouTubeImplProps,\n} from \"react-youtube\";\n\nexport type YouTubeProps = YouTubeImplProps &\n {\n [prop in keyof PlayerVars]:\n | PlayerVars[prop]\n | (prop extends typeof booleanParams[number] ? boolean : never);\n };\nconst playerParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"color\",\n \"controls\",\n \"disablekb\",\n \"enablejsapi\",\n \"end\",\n \"fs\",\n \"hl\",\n \"iv_load_policy\",\n \"list\",\n \"listType\",\n \"loop\",\n \"modestbranding\",\n \"origin\",\n \"playlist\",\n \"playsinline\",\n \"rel\",\n \"showinfo\",\n \"start\",\n \"mute\",\n] as const;\n\nconst booleanParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"controls\",\n \"disablekb\",\n \"fs\",\n \"loop\",\n \"modestbranding\",\n \"playsinline\",\n \"rel\",\n] as const;\n\nconst booleanParamsSet = new Set<string>(booleanParams);\n\nconst YouTube = React.forwardRef<YouTubeImpl, YouTubeProps>(\n (props: YouTubeProps, ref) => {\n const finalProps = { ...props };\n for (const prop of playerParams) {\n if (prop in finalProps) {\n const value = finalProps[prop];\n delete finalProps[prop];\n if (!finalProps.opts) {\n finalProps.opts = {};\n }\n if (!finalProps.opts.playerVars) {\n finalProps.opts.playerVars = {};\n }\n if (booleanParamsSet.has(prop)) {\n if (prop === \"cc_load_policy\" || prop === \"modestbranding\") {\n // undefined or 1\n if (value) {\n finalProps.opts.playerVars[prop] = 1;\n } else {\n delete finalProps.opts.playerVars[prop];\n }\n } else {\n // 0 or 1\n finalProps.opts.playerVars[prop] = (value ? 1 : 0) as any;\n }\n } else {\n finalProps.opts.playerVars[prop] = value as any;\n }\n }\n }\n return <YouTubeImpl ref={ref} {...finalProps} />;\n }\n);\n\nexport const youtubeMeta: ComponentMeta<YouTubeProps> = {\n name: \"hostless-youtube\",\n displayName: \"YouTube\",\n importName: \"YouTube\",\n importPath: \"@plasmicpkgs/react-youtube\",\n props: {\n videoId: {\n type: \"string\",\n defaultValue: \"R6MeLqRQzYw\",\n displayName: \"Video ID\",\n description: \"The ID for the YouTube video.\",\n },\n autoplay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video show automatically start playing when the player loads\",\n },\n cc_load_policy: {\n type: \"boolean\",\n displayName: \"Show Captions\",\n description:\n \"Whether the captions should be shown by default, even if the user has turned captions off\",\n },\n start: {\n type: \"number\",\n displayName: \"Start\",\n description:\n \"The video should begin at this amount of seconds from the start of the video\",\n },\n end: {\n type: \"number\",\n displayName: \"End\",\n description:\n \"Stop playing the video after this amount of seconds (measured from the start of the video)\",\n },\n color: {\n type: \"choice\",\n displayName: \"Color\",\n options: [\"red\", \"white\"],\n description:\n \"The color used in the display bar to highlight how much of the video the viewer has already seen\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description:\n \"Whether the YouTube video player controls should be displayed\",\n },\n disablekb: {\n type: \"boolean\",\n displayName: \"Disable Keyboard\",\n description: \"Whether the keyboard controls should be disabled\",\n },\n fs: {\n type: \"boolean\",\n displayName: \"FullScreen Button\",\n description: \"Whether the fullscreen button should be displayed\",\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n },\n modestbranding: {\n type: \"boolean\",\n displayName: \"Hide Logo\",\n description: \"Hide the YouTube logo\",\n },\n playsinline: {\n type: \"boolean\",\n displayName: \"Play Inline\",\n description:\n \"Whether the video should be played inline or fullscreen on iOS\",\n },\n rel: {\n type: \"boolean\",\n displayName: \"Related Videos\",\n description:\n \"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"390px\",\n width: \"640px\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerYouTube(\n loader?: { registerComponent: typeof registerComponent },\n customYouTubeMeta?: ComponentMeta<YouTubeProps>\n) {\n if (loader) {\n loader.registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n } else {\n registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n }\n}\n\nexport default YouTube;\n"],"names":["playerParams","booleanParamsSet","Set","YouTube","React","forwardRef","props","ref","finalProps","prop","value","opts","playerVars","has","YouTubeImpl","youtubeMeta","name","displayName","importName","importPath","videoId","type","defaultValue","description","autoplay","cc_load_policy","start","end","color","options","controls","disablekb","fs","loop","modestbranding","playsinline","rel","isDefaultExport","defaultStyles","height","width","maxHeight","maxWidth","loader","customYouTubeMeta","registerComponent"],"mappings":"8iBAeA,IAAMA,EAAe,CACnB,WACA,iBACA,QACA,WACA,YACA,cACA,MACA,KACA,KACA,iBACA,OACA,WACA,OACA,iBACA,SACA,WACA,cACA,MACA,WACA,QACA,QAeIC,EAAmB,IAAIC,IAZP,CACpB,WACA,iBACA,WACA,YACA,KACA,OACA,iBACA,cACA,QAKIC,EAAUC,EAAMC,YACpB,SA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c,iBAAiB,EACjBC,cAAe,CACbC,OAAQ,QACRC,MAAO,QACPC,UAAW,OACXC,SAAU,4DAKZC,EACAC,GAEID,EACFA,EAAOE,kBAAkB1C,QAASyC,EAAAA,EAAqB7B,GAEvD8B,EAAkB1C,QAASyC,EAAAA,EAAqB7B"}
1
+ {"version":3,"file":"react-youtube.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport YouTubeImpl, {\n PlayerVars,\n YouTubeProps as YouTubeImplProps,\n} from \"react-youtube\";\n\nexport type YouTubeProps = YouTubeImplProps &\n {\n [prop in keyof PlayerVars]:\n | PlayerVars[prop]\n | (prop extends typeof booleanParams[number] ? boolean : never);\n };\nconst playerParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"color\",\n \"controls\",\n \"disablekb\",\n \"enablejsapi\",\n \"end\",\n \"fs\",\n \"hl\",\n \"iv_load_policy\",\n \"list\",\n \"listType\",\n \"loop\",\n \"modestbranding\",\n \"origin\",\n \"playlist\",\n \"playsinline\",\n \"rel\",\n \"showinfo\",\n \"start\",\n \"mute\",\n] as const;\n\nconst booleanParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"controls\",\n \"disablekb\",\n \"fs\",\n \"loop\",\n \"modestbranding\",\n \"playsinline\",\n \"rel\",\n] as const;\n\nconst booleanParamsSet = new Set<string>(booleanParams);\n\nconst YouTube = React.forwardRef<YouTubeImpl, YouTubeProps>(\n (props: YouTubeProps, ref) => {\n const finalProps = { ...props };\n for (const prop of playerParams) {\n if (prop in finalProps) {\n const value = finalProps[prop];\n delete finalProps[prop];\n if (!finalProps.opts) {\n finalProps.opts = {};\n }\n if (!finalProps.opts.playerVars) {\n finalProps.opts.playerVars = {};\n }\n if (booleanParamsSet.has(prop)) {\n if (prop === \"cc_load_policy\" || prop === \"modestbranding\") {\n // undefined or 1\n if (value) {\n finalProps.opts.playerVars[prop] = 1;\n } else {\n delete finalProps.opts.playerVars[prop];\n }\n } else {\n // 0 or 1\n finalProps.opts.playerVars[prop] = (value ? 1 : 0) as any;\n }\n } else {\n finalProps.opts.playerVars[prop] = value as any;\n }\n }\n }\n return <YouTubeImpl ref={ref} {...finalProps} />;\n }\n);\n\nexport const youtubeMeta: ComponentMeta<YouTubeProps> = {\n name: \"hostless-youtube\",\n displayName: \"YouTube\",\n importName: \"YouTube\",\n importPath: \"@plasmicpkgs/react-youtube\",\n props: {\n videoId: {\n type: \"string\",\n defaultValue: \"R6MeLqRQzYw\",\n displayName: \"Video ID\",\n description: \"The ID for the YouTube video\",\n },\n autoplay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video should automatically start playing when the player loads\",\n defaultValueHint: false,\n },\n cc_load_policy: {\n type: \"boolean\",\n displayName: \"Show Captions\",\n description:\n \"Whether the captions should be shown by default, even if the user has turned captions off\",\n defaultValueHint: false,\n },\n start: {\n type: \"number\",\n displayName: \"Start\",\n description:\n \"The video should begin at this amount of seconds from the start of the video\",\n defaultValueHint: 0,\n },\n end: {\n type: \"number\",\n displayName: \"End\",\n description:\n \"Stop playing the video after this amount of seconds (measured from the start of the video)\",\n },\n color: {\n type: \"choice\",\n displayName: \"Color\",\n options: [\"red\", \"white\"],\n description:\n \"The color used in the display bar to highlight how much of the video the viewer has already seen\",\n defaultValueHint: \"red\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description:\n \"Whether the YouTube video player controls should be displayed\",\n defaultValueHint: true,\n },\n disablekb: {\n type: \"boolean\",\n displayName: \"Disable Keyboard\",\n description: \"Whether the keyboard controls should be disabled\",\n defaultValueHint: false,\n },\n fs: {\n type: \"boolean\",\n displayName: \"FullScreen Button\",\n description: \"Whether the fullscreen button should be displayed\",\n defaultValueHint: true,\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n defaultValueHint: false,\n },\n modestbranding: {\n type: \"boolean\",\n displayName: \"Hide Logo\",\n description: \"Hide the YouTube logo in the control bar\",\n defaultValueHint: false,\n },\n playsinline: {\n type: \"boolean\",\n displayName: \"Play Inline\",\n description:\n \"Whether the video should be played inline or fullscreen on iOS\",\n defaultValueHint: false,\n },\n rel: {\n type: \"boolean\",\n displayName: \"Related Videos\",\n description:\n \"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)\",\n defaultValueHint: true,\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"390px\",\n width: \"640px\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerYouTube(\n loader?: { registerComponent: typeof registerComponent },\n customYouTubeMeta?: ComponentMeta<YouTubeProps>\n) {\n if (loader) {\n loader.registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n } else {\n registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n }\n}\n\nexport default YouTube;\n"],"names":["playerParams","booleanParamsSet","Set","YouTube","React","forwardRef","props","ref","finalProps","prop","value","opts","playerVars","has","YouTubeImpl","youtubeMeta","name","displayName","importName","importPath","videoId","type","defaultValue","description","autoplay","defaultValueHint","cc_load_policy","start","end","color","options","controls","disablekb","fs","loop","modestbranding","playsinline","rel","isDefaultExport","defaultStyles","height","width","maxHeight","maxWidth","loader","customYouTubeMeta","registerComponent"],"mappings":"8iBAeA,IAAMA,EAAe,CACnB,WACA,iBACA,QACA,WACA,YACA,cACA,MACA,KACA,KACA,iBACA,OACA,WACA,OACA,iBACA,SACA,WACA,cACA,MACA,WACA,QACA,QAeIC,EAAmB,IAAIC,IAZP,CACpB,WACA,iBACA,WACA,YACA,KACA,OACA,iBACA,cACA,QAKIC,EAAUC,EAAMC,YACpB,SAACC,EAAqBC,aACdC,OAAkBF,yrBACLN,kBAAc,KAAtBS,aACLA,KAAQD,EAAY,KAChBE,EAAQF,EAAWC,UAClBD,EAAWC,GACbD,EAAWG,OACdH,EAAWG,KAAO,IAEfH,EAAWG,KAAKC,aACnBJ,EA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a,iBAAiB,EACjBC,cAAe,CACbC,OAAQ,QACRC,MAAO,QACPC,UAAW,OACXC,SAAU,4DAKZC,EACAC,GAEID,EACFA,EAAOE,kBAAkB3C,QAAS0C,EAAAA,EAAqB9B,GAEvD+B,EAAkB3C,QAAS0C,EAAAA,EAAqB9B"}
@@ -111,22 +111,25 @@ var youtubeMeta = {
111
111
  type: "string",
112
112
  defaultValue: "R6MeLqRQzYw",
113
113
  displayName: "Video ID",
114
- description: "The ID for the YouTube video."
114
+ description: "The ID for the YouTube video"
115
115
  },
116
116
  autoplay: {
117
117
  type: "boolean",
118
118
  displayName: "Auto Play",
119
- description: "Whether the video show automatically start playing when the player loads"
119
+ description: "Whether the video should automatically start playing when the player loads",
120
+ defaultValueHint: false
120
121
  },
121
122
  cc_load_policy: {
122
123
  type: "boolean",
123
124
  displayName: "Show Captions",
124
- description: "Whether the captions should be shown by default, even if the user has turned captions off"
125
+ description: "Whether the captions should be shown by default, even if the user has turned captions off",
126
+ defaultValueHint: false
125
127
  },
126
128
  start: {
127
129
  type: "number",
128
130
  displayName: "Start",
129
- description: "The video should begin at this amount of seconds from the start of the video"
131
+ description: "The video should begin at this amount of seconds from the start of the video",
132
+ defaultValueHint: 0
130
133
  },
131
134
  end: {
132
135
  type: "number",
@@ -137,42 +140,50 @@ var youtubeMeta = {
137
140
  type: "choice",
138
141
  displayName: "Color",
139
142
  options: ["red", "white"],
140
- description: "The color used in the display bar to highlight how much of the video the viewer has already seen"
143
+ description: "The color used in the display bar to highlight how much of the video the viewer has already seen",
144
+ defaultValueHint: "red"
141
145
  },
142
146
  controls: {
143
147
  type: "boolean",
144
148
  displayName: "Show Controls",
145
- description: "Whether the YouTube video player controls should be displayed"
149
+ description: "Whether the YouTube video player controls should be displayed",
150
+ defaultValueHint: true
146
151
  },
147
152
  disablekb: {
148
153
  type: "boolean",
149
154
  displayName: "Disable Keyboard",
150
- description: "Whether the keyboard controls should be disabled"
155
+ description: "Whether the keyboard controls should be disabled",
156
+ defaultValueHint: false
151
157
  },
152
158
  fs: {
153
159
  type: "boolean",
154
160
  displayName: "FullScreen Button",
155
- description: "Whether the fullscreen button should be displayed"
161
+ description: "Whether the fullscreen button should be displayed",
162
+ defaultValueHint: true
156
163
  },
157
164
  loop: {
158
165
  type: "boolean",
159
166
  displayName: "Loop",
160
- description: "Whether the video should be played again after it finishes"
167
+ description: "Whether the video should be played again after it finishes",
168
+ defaultValueHint: false
161
169
  },
162
170
  modestbranding: {
163
171
  type: "boolean",
164
172
  displayName: "Hide Logo",
165
- description: "Hide the YouTube logo"
173
+ description: "Hide the YouTube logo in the control bar",
174
+ defaultValueHint: false
166
175
  },
167
176
  playsinline: {
168
177
  type: "boolean",
169
178
  displayName: "Play Inline",
170
- description: "Whether the video should be played inline or fullscreen on iOS"
179
+ description: "Whether the video should be played inline or fullscreen on iOS",
180
+ defaultValueHint: false
171
181
  },
172
182
  rel: {
173
183
  type: "boolean",
174
184
  displayName: "Related Videos",
175
- description: "Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)"
185
+ description: "Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)",
186
+ defaultValueHint: true
176
187
  }
177
188
  },
178
189
  isDefaultExport: true,
@@ -1 +1 @@
1
- {"version":3,"file":"react-youtube.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport YouTubeImpl, {\n PlayerVars,\n YouTubeProps as YouTubeImplProps,\n} from \"react-youtube\";\n\nexport type YouTubeProps = YouTubeImplProps &\n {\n [prop in keyof PlayerVars]:\n | PlayerVars[prop]\n | (prop extends typeof booleanParams[number] ? boolean : never);\n };\nconst playerParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"color\",\n \"controls\",\n \"disablekb\",\n \"enablejsapi\",\n \"end\",\n \"fs\",\n \"hl\",\n \"iv_load_policy\",\n \"list\",\n \"listType\",\n \"loop\",\n \"modestbranding\",\n \"origin\",\n \"playlist\",\n \"playsinline\",\n \"rel\",\n \"showinfo\",\n \"start\",\n \"mute\",\n] as const;\n\nconst booleanParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"controls\",\n \"disablekb\",\n \"fs\",\n \"loop\",\n \"modestbranding\",\n \"playsinline\",\n \"rel\",\n] as const;\n\nconst booleanParamsSet = new Set<string>(booleanParams);\n\nconst YouTube = React.forwardRef<YouTubeImpl, YouTubeProps>(\n (props: YouTubeProps, ref) => {\n const finalProps = { ...props };\n for (const prop of playerParams) {\n if (prop in finalProps) {\n const value = finalProps[prop];\n delete finalProps[prop];\n if (!finalProps.opts) {\n finalProps.opts = {};\n }\n if (!finalProps.opts.playerVars) {\n finalProps.opts.playerVars = {};\n }\n if (booleanParamsSet.has(prop)) {\n if (prop === \"cc_load_policy\" || prop === \"modestbranding\") {\n // undefined or 1\n if (value) {\n finalProps.opts.playerVars[prop] = 1;\n } else {\n delete finalProps.opts.playerVars[prop];\n }\n } else {\n // 0 or 1\n finalProps.opts.playerVars[prop] = (value ? 1 : 0) as any;\n }\n } else {\n finalProps.opts.playerVars[prop] = value as any;\n }\n }\n }\n return <YouTubeImpl ref={ref} {...finalProps} />;\n }\n);\n\nexport const youtubeMeta: ComponentMeta<YouTubeProps> = {\n name: \"hostless-youtube\",\n displayName: \"YouTube\",\n importName: \"YouTube\",\n importPath: \"@plasmicpkgs/react-youtube\",\n props: {\n videoId: {\n type: \"string\",\n defaultValue: \"R6MeLqRQzYw\",\n displayName: \"Video ID\",\n description: \"The ID for the YouTube video.\",\n },\n autoplay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video show automatically start playing when the player loads\",\n },\n cc_load_policy: {\n type: \"boolean\",\n displayName: \"Show Captions\",\n description:\n \"Whether the captions should be shown by default, even if the user has turned captions off\",\n },\n start: {\n type: \"number\",\n displayName: \"Start\",\n description:\n \"The video should begin at this amount of seconds from the start of the video\",\n },\n end: {\n type: \"number\",\n displayName: \"End\",\n description:\n \"Stop playing the video after this amount of seconds (measured from the start of the video)\",\n },\n color: {\n type: \"choice\",\n displayName: \"Color\",\n options: [\"red\", \"white\"],\n description:\n \"The color used in the display bar to highlight how much of the video the viewer has already seen\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description:\n \"Whether the YouTube video player controls should be displayed\",\n },\n disablekb: {\n type: \"boolean\",\n displayName: \"Disable Keyboard\",\n description: \"Whether the keyboard controls should be disabled\",\n },\n fs: {\n type: \"boolean\",\n displayName: \"FullScreen Button\",\n description: \"Whether the fullscreen button should be displayed\",\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n },\n modestbranding: {\n type: \"boolean\",\n displayName: \"Hide Logo\",\n description: \"Hide the YouTube logo\",\n },\n playsinline: {\n type: \"boolean\",\n displayName: \"Play Inline\",\n description:\n \"Whether the video should be played inline or fullscreen on iOS\",\n },\n rel: {\n type: \"boolean\",\n displayName: \"Related Videos\",\n description:\n \"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"390px\",\n width: \"640px\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerYouTube(\n loader?: { registerComponent: typeof registerComponent },\n customYouTubeMeta?: ComponentMeta<YouTubeProps>\n) {\n if (loader) {\n loader.registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n } else {\n registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n }\n}\n\nexport default YouTube;\n"],"names":["playerParams","booleanParams","booleanParamsSet","Set","YouTube","React","forwardRef","props","ref","finalProps","prop","value","opts","playerVars","has","YouTubeImpl","youtubeMeta","name","displayName","importName","importPath","videoId","type","defaultValue","description","autoplay","cc_load_policy","start","end","color","options","controls","disablekb","fs","loop","modestbranding","playsinline","rel","isDefaultExport","defaultStyles","height","width","maxHeight","maxWidth","registerYouTube","loader","customYouTubeMeta","registerComponent"],"mappings":";;;;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,MAAAA,IAAI,EAAE,SADH;AAEHJ,MAAAA,WAAW,EAAE,gBAFV;AAGHM,MAAAA,WAAW,EACT;AAJC;AAtEA,GAL+C;AAkFtDc,EAAAA,eAAe,EAAE,IAlFqC;AAmFtDC,EAAAA,aAAa,EAAE;AACbC,IAAAA,MAAM,EAAE,OADK;AAEbC,IAAAA,KAAK,EAAE,OAFM;AAGbC,IAAAA,SAAS,EAAE,MAHE;AAIbC,IAAAA,QAAQ,EAAE;AAJG;AAnFuC;SA2FxCC,gBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyB3C,OAAzB,EAAkC0C,iBAAlC,WAAkCA,iBAAlC,GAAuD9B,WAAvD;AACD,GAFD,MAEO;AACL+B,IAAAA,iBAAiB,CAAC3C,OAAD,EAAU0C,iBAAV,WAAUA,iBAAV,GAA+B9B,WAA/B,CAAjB;AACD;AACF;;;;;"}
1
+ {"version":3,"file":"react-youtube.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport YouTubeImpl, {\n PlayerVars,\n YouTubeProps as YouTubeImplProps,\n} from \"react-youtube\";\n\nexport type YouTubeProps = YouTubeImplProps &\n {\n [prop in keyof PlayerVars]:\n | PlayerVars[prop]\n | (prop extends typeof booleanParams[number] ? boolean : never);\n };\nconst playerParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"color\",\n \"controls\",\n \"disablekb\",\n \"enablejsapi\",\n \"end\",\n \"fs\",\n \"hl\",\n \"iv_load_policy\",\n \"list\",\n \"listType\",\n \"loop\",\n \"modestbranding\",\n \"origin\",\n \"playlist\",\n \"playsinline\",\n \"rel\",\n \"showinfo\",\n \"start\",\n \"mute\",\n] as const;\n\nconst booleanParams = [\n \"autoplay\",\n \"cc_load_policy\",\n \"controls\",\n \"disablekb\",\n \"fs\",\n \"loop\",\n \"modestbranding\",\n \"playsinline\",\n \"rel\",\n] as const;\n\nconst booleanParamsSet = new Set<string>(booleanParams);\n\nconst YouTube = React.forwardRef<YouTubeImpl, YouTubeProps>(\n (props: YouTubeProps, ref) => {\n const finalProps = { ...props };\n for (const prop of playerParams) {\n if (prop in finalProps) {\n const value = finalProps[prop];\n delete finalProps[prop];\n if (!finalProps.opts) {\n finalProps.opts = {};\n }\n if (!finalProps.opts.playerVars) {\n finalProps.opts.playerVars = {};\n }\n if (booleanParamsSet.has(prop)) {\n if (prop === \"cc_load_policy\" || prop === \"modestbranding\") {\n // undefined or 1\n if (value) {\n finalProps.opts.playerVars[prop] = 1;\n } else {\n delete finalProps.opts.playerVars[prop];\n }\n } else {\n // 0 or 1\n finalProps.opts.playerVars[prop] = (value ? 1 : 0) as any;\n }\n } else {\n finalProps.opts.playerVars[prop] = value as any;\n }\n }\n }\n return <YouTubeImpl ref={ref} {...finalProps} />;\n }\n);\n\nexport const youtubeMeta: ComponentMeta<YouTubeProps> = {\n name: \"hostless-youtube\",\n displayName: \"YouTube\",\n importName: \"YouTube\",\n importPath: \"@plasmicpkgs/react-youtube\",\n props: {\n videoId: {\n type: \"string\",\n defaultValue: \"R6MeLqRQzYw\",\n displayName: \"Video ID\",\n description: \"The ID for the YouTube video\",\n },\n autoplay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video should automatically start playing when the player loads\",\n defaultValueHint: false,\n },\n cc_load_policy: {\n type: \"boolean\",\n displayName: \"Show Captions\",\n description:\n \"Whether the captions should be shown by default, even if the user has turned captions off\",\n defaultValueHint: false,\n },\n start: {\n type: \"number\",\n displayName: \"Start\",\n description:\n \"The video should begin at this amount of seconds from the start of the video\",\n defaultValueHint: 0,\n },\n end: {\n type: \"number\",\n displayName: \"End\",\n description:\n \"Stop playing the video after this amount of seconds (measured from the start of the video)\",\n },\n color: {\n type: \"choice\",\n displayName: \"Color\",\n options: [\"red\", \"white\"],\n description:\n \"The color used in the display bar to highlight how much of the video the viewer has already seen\",\n defaultValueHint: \"red\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description:\n \"Whether the YouTube video player controls should be displayed\",\n defaultValueHint: true,\n },\n disablekb: {\n type: \"boolean\",\n displayName: \"Disable Keyboard\",\n description: \"Whether the keyboard controls should be disabled\",\n defaultValueHint: false,\n },\n fs: {\n type: \"boolean\",\n displayName: \"FullScreen Button\",\n description: \"Whether the fullscreen button should be displayed\",\n defaultValueHint: true,\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n defaultValueHint: false,\n },\n modestbranding: {\n type: \"boolean\",\n displayName: \"Hide Logo\",\n description: \"Hide the YouTube logo in the control bar\",\n defaultValueHint: false,\n },\n playsinline: {\n type: \"boolean\",\n displayName: \"Play Inline\",\n description:\n \"Whether the video should be played inline or fullscreen on iOS\",\n defaultValueHint: false,\n },\n rel: {\n type: \"boolean\",\n displayName: \"Related Videos\",\n description:\n \"Whether it should show related videos when the video ends (if false, it shows other videos from the same channel)\",\n defaultValueHint: true,\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"390px\",\n width: \"640px\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerYouTube(\n loader?: { registerComponent: typeof registerComponent },\n customYouTubeMeta?: ComponentMeta<YouTubeProps>\n) {\n if (loader) {\n loader.registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n } else {\n registerComponent(YouTube, customYouTubeMeta ?? youtubeMeta);\n }\n}\n\nexport default YouTube;\n"],"names":["playerParams","booleanParams","booleanParamsSet","Set","YouTube","React","forwardRef","props","ref","finalProps","prop","value","opts","playerVars","has","YouTubeImpl","youtubeMeta","name","displayName","importName","importPath","videoId","type","defaultValue","description","autoplay","defaultValueHint","cc_load_policy","start","end","color","options","controls","disablekb","fs","loop","modestbranding","playsinline","rel","isDefaultExport","defaultStyles","height","width","maxHeight","maxWidth","registerYouTube","loader","customYouTubeMeta","registerComponent"],"mapp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mELU,IAAAA,cAAc,EAAE;AACdd,MAAAA,IAAI,EAAE,SADQ;AAEdJ,MAAAA,WAAW,EAAE,WAFC;AAGdM,MAAAA,WAAW,EAAE,0CAHC;AAIdE,MAAAA,gBAAgB,EAAE;AAJJ,KAnEX;AAyELW,IAAAA,WAAW,EAAE;AACXf,MAAAA,IAAI,EAAE,SADK;AAEXJ,MAAAA,WAAW,EAAE,aAFF;AAGXM,MAAAA,WAAW,EACT,gEAJS;AAKXE,MAAAA,gBAAgB,EAAE;AALP,KAzER;AAgFLY,IAAAA,GAAG,EAAE;AACHhB,MAAAA,IAAI,EAAE,SADH;AAEHJ,MAAAA,WAAW,EAAE,gBAFV;AAGHM,MAAAA,WAAW,EACT,mHAJC;AAKHE,MAAAA,gBAAgB,EAAE;AALf;AAhFA,GAL+C;AA6FtDa,EAAAA,eAAe,EAAE,IA7FqC;AA8FtDC,EAAAA,aAAa,EAAE;AACbC,IAAAA,MAAM,EAAE,OADK;AAEbC,IAAAA,KAAK,EAAE,OAFM;AAGbC,IAAAA,SAAS,EAAE,MAHE;AAIbC,IAAAA,QAAQ,EAAE;AAJG;AA9FuC;SAsGxCC,gBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyB5C,OAAzB,EAAkC2C,iBAAlC,WAAkCA,iBAAlC,GAAuD/B,WAAvD;AACD,GAFD,MAEO;AACLgC,IAAAA,iBAAiB,CAAC5C,OAAD,EAAU2C,iBAAV,WAAUA,iBAAV,GAA+B/B,WAA/B,CAAjB;AACD;AACF;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/react-youtube",
3
- "version": "7.13.4",
3
+ "version": "7.13.5",
4
4
  "description": "Plasmic registration call for react-youtube",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "typescript": "^3.9.7"
37
37
  },
38
38
  "dependencies": {
39
- "@plasmicapp/host": "^0.0.32",
39
+ "@plasmicapp/host": "^0.0.44",
40
40
  "react-youtube": "^7.13.0"
41
41
  },
42
42
  "peerDependencies": {