@plasmicpkgs/react-audio-player 0.0.2 → 0.0.4

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.
@@ -0,0 +1,24 @@
1
+ import registerComponent from '@plasmicapp/host/registerComponent';
2
+ import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
3
+ import { CodeComponentMeta } from '@plasmicapp/host';
4
+ import React from 'react';
5
+
6
+ declare function ensure<T>(x: T | null | undefined): T;
7
+ interface AudioPlayerProps {
8
+ className?: string;
9
+ src?: string;
10
+ autoPlay?: boolean;
11
+ controls?: boolean;
12
+ loop?: boolean;
13
+ muted?: boolean;
14
+ volume?: number;
15
+ }
16
+ declare const AudioPlayerMeta: CodeComponentMeta<AudioPlayerProps>;
17
+ declare function AudioPlayer({ className, src, autoPlay, controls, loop, muted, volume, }: AudioPlayerProps): React.JSX.Element;
18
+
19
+ declare function registerAll(loader?: {
20
+ registerComponent: typeof registerComponent;
21
+ registerGlobalContext: typeof registerGlobalContext;
22
+ }): void;
23
+
24
+ export { AudioPlayer, AudioPlayerMeta, ensure, registerAll };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,24 @@
1
- import registerComponent from "@plasmicapp/host/registerComponent";
2
- import registerGlobalContext from "@plasmicapp/host/registerGlobalContext";
3
- export declare function registerAll(loader?: {
4
- registerComponent: typeof registerComponent;
5
- registerGlobalContext: typeof registerGlobalContext;
6
- }): void;
7
- export * from "./react-audio-player";
1
+ import registerComponent from '@plasmicapp/host/registerComponent';
2
+ import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
3
+ import { CodeComponentMeta } from '@plasmicapp/host';
4
+ import React from 'react';
5
+
6
+ declare function ensure<T>(x: T | null | undefined): T;
7
+ interface AudioPlayerProps {
8
+ className?: string;
9
+ src?: string;
10
+ autoPlay?: boolean;
11
+ controls?: boolean;
12
+ loop?: boolean;
13
+ muted?: boolean;
14
+ volume?: number;
15
+ }
16
+ declare const AudioPlayerMeta: CodeComponentMeta<AudioPlayerProps>;
17
+ declare function AudioPlayer({ className, src, autoPlay, controls, loop, muted, volume, }: AudioPlayerProps): React.JSX.Element;
18
+
19
+ declare function registerAll(loader?: {
20
+ registerComponent: typeof registerComponent;
21
+ registerGlobalContext: typeof registerGlobalContext;
22
+ }): void;
23
+
24
+ export { AudioPlayer, AudioPlayerMeta, ensure, registerAll };
package/dist/index.js CHANGED
@@ -1,8 +1,151 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
29
 
2
- 'use strict'
30
+ // src/index.tsx
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ AudioPlayer: () => AudioPlayer,
34
+ AudioPlayerMeta: () => AudioPlayerMeta,
35
+ ensure: () => ensure,
36
+ registerAll: () => registerAll
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+ var import_registerComponent = __toESM(require("@plasmicapp/host/registerComponent"));
3
40
 
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./react-audio-player.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./react-audio-player.cjs.development.js')
41
+ // src/react-audio-player.tsx
42
+ var import_host = require("@plasmicapp/host");
43
+ var import_react_audio_player = __toESM(require("react-audio-player"));
44
+ var import_react = __toESM(require("react"));
45
+ function ensure(x) {
46
+ if (x === null || x === void 0) {
47
+ debugger;
48
+ throw new Error(`Value must not be undefined or null`);
49
+ } else {
50
+ return x;
51
+ }
8
52
  }
53
+ var modulePath = "@plasmicpkgs/react-audio-player";
54
+ var AudioPlayerMeta = {
55
+ name: "hostless-react-audio-player",
56
+ displayName: "AudioPlayer",
57
+ importName: "AudioPlayer",
58
+ importPath: modulePath,
59
+ providesData: true,
60
+ description: "React Audio Player to embed audio",
61
+ defaultStyles: {
62
+ width: "600px",
63
+ height: "700px"
64
+ },
65
+ props: {
66
+ src: {
67
+ type: "string",
68
+ displayName: "URL",
69
+ description: "The URL of the audio to embed",
70
+ defaultValue: "https://on.soundcloud.com/hS668"
71
+ },
72
+ autoPlay: {
73
+ type: "boolean",
74
+ displayName: "AutoPlay",
75
+ description: "If true, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.",
76
+ defaultValue: false
77
+ },
78
+ controls: {
79
+ type: "boolean",
80
+ displayName: "Controls",
81
+ description: "The browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback",
82
+ defaultValue: false
83
+ },
84
+ loop: {
85
+ type: "boolean",
86
+ displayName: "Loop",
87
+ description: "If true, the audio player will automatically seek back to the start upon reaching the end of the audio.",
88
+ defaultValue: false
89
+ },
90
+ muted: {
91
+ type: "boolean",
92
+ displayName: "Muted",
93
+ description: "A Boolean attribute that indicates whether the audio will be initially silenced",
94
+ defaultValue: false
95
+ },
96
+ volume: {
97
+ type: "number",
98
+ displayName: "Volume",
99
+ description: "Volume of the audio",
100
+ defaultValue: 1
101
+ }
102
+ }
103
+ };
104
+ function AudioPlayer({
105
+ className,
106
+ src,
107
+ autoPlay,
108
+ controls,
109
+ loop,
110
+ muted,
111
+ volume
112
+ }) {
113
+ if (!src) {
114
+ return /* @__PURE__ */ import_react.default.createElement("div", null, "Please specify the URL of the audio to embed");
115
+ }
116
+ const inEditor = !!(0, import_host.usePlasmicCanvasContext)();
117
+ const isAutoPlay = inEditor ? false : autoPlay;
118
+ return /* @__PURE__ */ import_react.default.createElement(
119
+ import_react_audio_player.default,
120
+ {
121
+ src,
122
+ autoPlay: isAutoPlay,
123
+ controls,
124
+ loop,
125
+ muted,
126
+ volume,
127
+ className
128
+ }
129
+ );
130
+ }
131
+
132
+ // src/index.tsx
133
+ function registerAll(loader) {
134
+ const _registerComponent = (Component, defaultMeta) => {
135
+ if (loader) {
136
+ loader.registerComponent(Component, defaultMeta);
137
+ } else {
138
+ (0, import_registerComponent.default)(Component, defaultMeta);
139
+ }
140
+ };
141
+ if (loader) {
142
+ _registerComponent(AudioPlayer, AudioPlayerMeta);
143
+ }
144
+ }
145
+ // Annotate the CommonJS export names for ESM import in node:
146
+ 0 && (module.exports = {
147
+ AudioPlayer,
148
+ AudioPlayerMeta,
149
+ ensure,
150
+ registerAll
151
+ });
@@ -1,12 +1,14 @@
1
- import registerComponent from '@plasmicapp/host/registerComponent';
2
- import { usePlasmicCanvasContext } from '@plasmicapp/host';
3
- import ReactAudioPlayer from 'react-audio-player';
4
- import React from 'react';
1
+ // src/index.tsx
2
+ import registerComponent from "@plasmicapp/host/registerComponent";
5
3
 
4
+ // src/react-audio-player.tsx
5
+ import { usePlasmicCanvasContext } from "@plasmicapp/host";
6
+ import ReactAudioPlayer from "react-audio-player";
7
+ import React from "react";
6
8
  function ensure(x) {
7
- if (x === null || x === undefined) {
9
+ if (x === null || x === void 0) {
8
10
  debugger;
9
- throw new Error("Value must not be undefined or null");
11
+ throw new Error(`Value must not be undefined or null`);
10
12
  } else {
11
13
  return x;
12
14
  }
@@ -58,36 +60,41 @@ var AudioPlayerMeta = {
58
60
  type: "number",
59
61
  displayName: "Volume",
60
62
  description: "Volume of the audio",
61
- defaultValue: 1.0
63
+ defaultValue: 1
62
64
  }
63
65
  }
64
66
  };
65
- function AudioPlayer(_ref) {
66
- var className = _ref.className,
67
- src = _ref.src,
68
- autoPlay = _ref.autoPlay,
69
- controls = _ref.controls,
70
- loop = _ref.loop,
71
- muted = _ref.muted,
72
- volume = _ref.volume;
67
+ function AudioPlayer({
68
+ className,
69
+ src,
70
+ autoPlay,
71
+ controls,
72
+ loop,
73
+ muted,
74
+ volume
75
+ }) {
73
76
  if (!src) {
74
- return React.createElement("div", null, "Please specify the URL of the audio to embed");
77
+ return /* @__PURE__ */ React.createElement("div", null, "Please specify the URL of the audio to embed");
75
78
  }
76
- var inEditor = !!usePlasmicCanvasContext();
77
- var isAutoPlay = inEditor ? false : autoPlay;
78
- return React.createElement(ReactAudioPlayer, {
79
- src: src,
80
- autoPlay: isAutoPlay,
81
- controls: controls,
82
- loop: loop,
83
- muted: muted,
84
- volume: volume,
85
- className: className
86
- });
79
+ const inEditor = !!usePlasmicCanvasContext();
80
+ const isAutoPlay = inEditor ? false : autoPlay;
81
+ return /* @__PURE__ */ React.createElement(
82
+ ReactAudioPlayer,
83
+ {
84
+ src,
85
+ autoPlay: isAutoPlay,
86
+ controls,
87
+ loop,
88
+ muted,
89
+ volume,
90
+ className
91
+ }
92
+ );
87
93
  }
88
94
 
95
+ // src/index.tsx
89
96
  function registerAll(loader) {
90
- var _registerComponent = function _registerComponent(Component, defaultMeta) {
97
+ const _registerComponent = (Component, defaultMeta) => {
91
98
  if (loader) {
92
99
  loader.registerComponent(Component, defaultMeta);
93
100
  } else {
@@ -98,6 +105,9 @@ function registerAll(loader) {
98
105
  _registerComponent(AudioPlayer, AudioPlayerMeta);
99
106
  }
100
107
  }
101
-
102
- export { AudioPlayer, AudioPlayerMeta, ensure, registerAll };
103
- //# sourceMappingURL=react-audio-player.esm.js.map
108
+ export {
109
+ AudioPlayer,
110
+ AudioPlayerMeta,
111
+ ensure,
112
+ registerAll
113
+ };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/react-audio-player",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "React Audio Player components.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
- "module": "dist/plasmic-react-audio-player.esm.js",
7
+ "module": "dist/index.mjs",
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
@@ -12,10 +12,8 @@
12
12
  "dist"
13
13
  ],
14
14
  "scripts": {
15
- "start": "tsdx watch",
16
- "build": "tsdx build",
15
+ "build": "tsup-node src/index.tsx --dts --format esm,cjs --target es2019",
17
16
  "test": "yarn --cwd=../.. test --passWithNoTests",
18
- "lint": "tsdx lint",
19
17
  "prepare": "if-env PREPARE_NO_BUILD=true || yarn build",
20
18
  "size": "size-limit",
21
19
  "analyze": "size-limit --why"
@@ -25,11 +23,11 @@
25
23
  },
26
24
  "size-limit": [
27
25
  {
28
- "path": "dist/plasmic-react-audio-player.cjs.production.min.js",
26
+ "path": "dist/index.js",
29
27
  "limit": "10 KB"
30
28
  },
31
29
  {
32
- "path": "dist/plasmic-react-audio-player.esm.js",
30
+ "path": "dist/index.mjs",
33
31
  "limit": "10 KB"
34
32
  }
35
33
  ],
@@ -42,12 +40,13 @@
42
40
  "react": "^18.2.0",
43
41
  "react-dom": "^18.2.0",
44
42
  "size-limit": "^7.0.8",
45
- "tsdx": "^0.14.1",
46
- "tslib": "^2.3.1"
43
+ "tslib": "^2.3.1",
44
+ "tsup": "^7.2.0",
45
+ "typescript": "^5.2.2"
47
46
  },
48
47
  "dependencies": {
49
48
  "change-case": "^4.1.2",
50
49
  "react-audio-player": "^0.17.0"
51
50
  },
52
- "gitHead": "81a8f8a9b010205fe4e438b03962f72783229155"
51
+ "gitHead": "d387b9e838764794b8513b5c19288f37c7981dc4"
53
52
  }
@@ -1,112 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
-
7
- var registerComponent = _interopDefault(require('@plasmicapp/host/registerComponent'));
8
- var host = require('@plasmicapp/host');
9
- var ReactAudioPlayer = _interopDefault(require('react-audio-player'));
10
- var React = _interopDefault(require('react'));
11
-
12
- function ensure(x) {
13
- if (x === null || x === undefined) {
14
- debugger;
15
- throw new Error("Value must not be undefined or null");
16
- } else {
17
- return x;
18
- }
19
- }
20
- var modulePath = "@plasmicpkgs/react-audio-player";
21
- var AudioPlayerMeta = {
22
- name: "hostless-react-audio-player",
23
- displayName: "AudioPlayer",
24
- importName: "AudioPlayer",
25
- importPath: modulePath,
26
- providesData: true,
27
- description: "React Audio Player to embed audio",
28
- defaultStyles: {
29
- width: "600px",
30
- height: "700px"
31
- },
32
- props: {
33
- src: {
34
- type: "string",
35
- displayName: "URL",
36
- description: "The URL of the audio to embed",
37
- defaultValue: "https://on.soundcloud.com/hS668"
38
- },
39
- autoPlay: {
40
- type: "boolean",
41
- displayName: "AutoPlay",
42
- description: "If true, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.",
43
- defaultValue: false
44
- },
45
- controls: {
46
- type: "boolean",
47
- displayName: "Controls",
48
- description: "The browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback",
49
- defaultValue: false
50
- },
51
- loop: {
52
- type: "boolean",
53
- displayName: "Loop",
54
- description: "If true, the audio player will automatically seek back to the start upon reaching the end of the audio.",
55
- defaultValue: false
56
- },
57
- muted: {
58
- type: "boolean",
59
- displayName: "Muted",
60
- description: "A Boolean attribute that indicates whether the audio will be initially silenced",
61
- defaultValue: false
62
- },
63
- volume: {
64
- type: "number",
65
- displayName: "Volume",
66
- description: "Volume of the audio",
67
- defaultValue: 1.0
68
- }
69
- }
70
- };
71
- function AudioPlayer(_ref) {
72
- var className = _ref.className,
73
- src = _ref.src,
74
- autoPlay = _ref.autoPlay,
75
- controls = _ref.controls,
76
- loop = _ref.loop,
77
- muted = _ref.muted,
78
- volume = _ref.volume;
79
- if (!src) {
80
- return React.createElement("div", null, "Please specify the URL of the audio to embed");
81
- }
82
- var inEditor = !!host.usePlasmicCanvasContext();
83
- var isAutoPlay = inEditor ? false : autoPlay;
84
- return React.createElement(ReactAudioPlayer, {
85
- src: src,
86
- autoPlay: isAutoPlay,
87
- controls: controls,
88
- loop: loop,
89
- muted: muted,
90
- volume: volume,
91
- className: className
92
- });
93
- }
94
-
95
- function registerAll(loader) {
96
- var _registerComponent = function _registerComponent(Component, defaultMeta) {
97
- if (loader) {
98
- loader.registerComponent(Component, defaultMeta);
99
- } else {
100
- registerComponent(Component, defaultMeta);
101
- }
102
- };
103
- if (loader) {
104
- _registerComponent(AudioPlayer, AudioPlayerMeta);
105
- }
106
- }
107
-
108
- exports.AudioPlayer = AudioPlayer;
109
- exports.AudioPlayerMeta = AudioPlayerMeta;
110
- exports.ensure = ensure;
111
- exports.registerAll = registerAll;
112
- //# sourceMappingURL=react-audio-player.cjs.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-audio-player.cjs.development.js","sources":["../src/react-audio-player.tsx","../src/index.tsx"],"sourcesContent":["import { CodeComponentMeta, usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport ReactAudioPlayer from \"react-audio-player\";\n\nimport React from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/react-audio-player\";\n\ninterface AudioPlayerProps {\n className?: string;\n src?: string;\n autoPlay?: boolean;\n controls?: boolean;\n\n loop?: boolean;\n muted?: boolean;\n volume?: number;\n}\n\nexport const AudioPlayerMeta: CodeComponentMeta<AudioPlayerProps> = {\n name: \"hostless-react-audio-player\",\n displayName: \"AudioPlayer\",\n importName: \"AudioPlayer\",\n importPath: modulePath,\n providesData: true,\n description: \"React Audio Player to embed audio\",\n defaultStyles: {\n width: \"600px\",\n height: \"700px\",\n },\n props: {\n src: {\n type: \"string\",\n displayName: \"URL\",\n description: \"The URL of the audio to embed\",\n defaultValue: \"https://on.soundcloud.com/hS668\",\n },\n autoPlay: {\n type: \"boolean\",\n displayName: \"AutoPlay\",\n description:\n \"If true, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.\",\n defaultValue: false,\n },\n controls: {\n type: \"boolean\",\n displayName: \"Controls\",\n description:\n \"The browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback\",\n defaultValue: false,\n },\n\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description:\n \"If true, the audio player will automatically seek back to the start upon reaching the end of the audio.\",\n defaultValue: false,\n },\n muted: {\n type: \"boolean\",\n displayName: \"Muted\",\n description:\n \"A Boolean attribute that indicates whether the audio will be initially silenced\",\n defaultValue: false,\n },\n volume: {\n type: \"number\",\n displayName: \"Volume\",\n description: \"Volume of the audio\",\n defaultValue: 1.0,\n },\n },\n};\n\nexport function AudioPlayer({\n className,\n src,\n autoPlay,\n controls,\n loop,\n muted,\n volume,\n}: AudioPlayerProps) {\n if (!src) {\n return <div>Please specify the URL of the audio to embed</div>;\n }\n const inEditor = !!usePlasmicCanvasContext();\n const isAutoPlay = inEditor ? false : autoPlay;\n\n return (\n <ReactAudioPlayer\n src={src}\n autoPlay={isAutoPlay}\n controls={controls}\n loop={loop}\n muted={muted}\n volume={volume}\n className={className}\n />\n );\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n AudioPlayer,\n AudioPlayerMeta,\n\n\n} from \"./react-audio-player\";\n\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n\n _registerComponent(AudioPlayer, AudioPlayerMeta);\n\n }\n}\n\nexport * from \"./react-audio-player\";"],"names":["ensure","x","undefined","Error","modulePath","AudioPlayerMeta","name","displayName","importName","importPath","providesData","description","defaultStyles","width","height","props","src","type","defaultValue","autoPlay","controls","loop","muted","volume","AudioPlayer","_ref","className","React","inEditor","usePlasmicCanvasContext","isAutoPlay","ReactAudioPlayer","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;;;;;;;;SAKgBA,MAAMA,CAAIC,CAAuB;EAC/C,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;IACjC;IACA,MAAM,IAAIC,KAAK,sCAAsC,CAAC;GACvD,MAAM;IACL,OAAOF,CAAC;;AAEZ;AAEA,IAAMG,UAAU,GAAG,iCAAiC;IAavCC,eAAe,GAAwC;EAClEC,IAAI,EAAE,6BAA6B;EACnCC,WAAW,EAAE,aAAa;EAC1BC,UAAU,EAAE,aAAa;EACzBC,UAAU,EAAEL,UAAU;EACtBM,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAE,mCAAmC;EAChDC,aAAa,EAAE;IACbC,KAAK,EAAE,OAAO;IACdC,MAAM,EAAE;GACT;EACDC,KAAK,EAAE;IACLC,GAAG,EAAE;MACHC,IAAI,EAAE,QAAQ;MACdV,WAAW,EAAE,KAAK;MAClBI,WAAW,EAAE,+BAA+B;MAC5CO,YAAY,EAAE;KACf;IACDC,QAAQ,EAAE;MACRF,IAAI,EAAE,SAAS;MACfV,WAAW,EAAE,UAAU;MACvBI,WAAW,EACT,gJAAgJ;MAClJO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SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAmD;IAEnD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAED,IAAIH,MAAM,EAAE;IAEVC,kBAAkB,CAACV,WAAW,EAAEnB,eAAe,CAAC;;AAGpD;;;;;;;"}
@@ -1,2 +0,0 @@
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=require("@plasmicapp/host"),a=e(require("react-audio-player")),l=e(require("react")),i={name:"hostless-react-audio-player",displayName:"AudioPlayer",importName:"AudioPlayer",importPath:"@plasmicpkgs/react-audio-player",providesData:!0,description:"React Audio Player to embed audio",defaultStyles:{width:"600px",height:"700px"},props:{src:{type:"string",displayName:"URL",description:"The URL of the audio to embed",defaultValue:"https://on.soundcloud.com/hS668"},autoPlay:{type:"boolean",displayName:"AutoPlay",description:"If true, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.",defaultValue:!1},controls:{type:"boolean",displayName:"Controls",description:"The browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback",defaultValue:!1},loop:{type:"boolean",displayName:"Loop",description:"If true, the audio player will automatically seek back to the start upon reaching the end of the audio.",defaultValue:!1},muted:{type:"boolean",displayName:"Muted",description:"A Boolean attribute that indicates whether the audio will be initially silenced",defaultValue:!1},volume:{type:"number",displayName:"Volume",description:"Volume of the audio",defaultValue:1}}};function r(e){var t=e.className,i=e.src,r=e.autoPlay,u=e.controls,s=e.loop,n=e.muted,d=e.volume;if(!i)return l.createElement("div",null,"Please specify the URL of the audio to embed");var p=!!o.usePlasmicCanvasContext();return l.createElement(a,{src:i,autoPlay:!p&&r,controls:u,loop:s,muted:n,volume:d,className:t})}exports.AudioPlayer=r,exports.AudioPlayerMeta=i,exports.ensure=function(e){if(null==e)throw new Error("Value must not be undefined or null");return e},exports.registerAll=function(e){var o,a;e&&(o=r,a=i,e?e.registerComponent(o,a):t(o,a))};
2
- //# sourceMappingURL=react-audio-player.cjs.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-audio-player.cjs.production.min.js","sources":["../src/react-audio-player.tsx","../src/index.tsx"],"sourcesContent":["import { CodeComponentMeta, usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport ReactAudioPlayer from \"react-audio-player\";\n\nimport React from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/react-audio-player\";\n\ninterface AudioPlayerProps {\n className?: string;\n src?: string;\n autoPlay?: boolean;\n controls?: boolean;\n\n loop?: boolean;\n muted?: boolean;\n volume?: number;\n}\n\nexport const AudioPlayerMeta: CodeComponentMeta<AudioPlayerProps> = {\n name: \"hostless-react-audio-player\",\n displayName: \"AudioPlayer\",\n importName: \"AudioPlayer\",\n importPath: modulePath,\n providesData: true,\n description: \"React Audio Player to embed audio\",\n defaultStyles: {\n width: \"600px\",\n height: \"700px\",\n },\n props: {\n src: {\n type: \"string\",\n displayName: \"URL\",\n description: \"The URL of the audio to embed\",\n defaultValue: \"https://on.soundcloud.com/hS668\",\n },\n autoPlay: {\n type: \"boolean\",\n displayName: \"AutoPlay\",\n description:\n \"If true, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.\",\n defaultValue: false,\n },\n controls: {\n type: \"boolean\",\n displayName: \"Controls\",\n description:\n \"The browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback\",\n defaultValue: false,\n },\n\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description:\n \"If true, the audio player will automatically seek back to the start upon reaching the end of the audio.\",\n defaultValue: false,\n },\n muted: {\n type: \"boolean\",\n displayName: \"Muted\",\n description:\n \"A Boolean attribute that indicates whether the audio will be initially silenced\",\n defaultValue: false,\n },\n volume: {\n type: \"number\",\n displayName: \"Volume\",\n description: \"Volume of the audio\",\n defaultValue: 1.0,\n },\n },\n};\n\nexport function AudioPlayer({\n className,\n src,\n autoPlay,\n controls,\n loop,\n muted,\n volume,\n}: AudioPlayerProps) {\n if (!src) {\n return <div>Please specify the URL of the audio to embed</div>;\n }\n const inEditor = !!usePlasmicCanvasContext();\n const isAutoPlay = inEditor ? false : autoPlay;\n\n return (\n <ReactAudioPlayer\n src={src}\n autoPlay={isAutoPlay}\n controls={controls}\n loop={loop}\n muted={muted}\n volume={volume}\n className={className}\n />\n );\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n AudioPlayer,\n AudioPlayerMeta,\n\n\n} from \"./react-audio-player\";\n\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n\n _registerComponent(AudioPlayer, AudioPlayerMeta);\n\n }\n}\n\nexport * from \"./react-audio-player\";"],"names":["AudioPlayerMeta","name","displayName","importName","importPath","providesData","description","defaultStyles","width","height","props","src","type","defaultValue","autoPlay","controls","loop","muted","volume","AudioPlayer","_ref","className","React","inEditor","usePlasmicCanvasContext","ReactAudioPlayer","x","Error","loader","Component","defaultMeta","registerComponent"],"mappings":"wRA2BaA,EAAuD,CAClEC,KAAM,8BACNC,YAAa,cACbC,WAAY,cACZC,WAjBiB,kCAkBjBC,cAAc,EACdC,YAAa,oCACbC,cAAe,CACbC,MAAO,QACPC,OAAQ,SAEVC,MAAO,CACLC,IAAK,CACHC,KAAM,SACNV,YAAa,MACbI,YAAa,gCACbO,aAAc,mCAEhBC,SAAU,CACRF,KAAM,UACNV,YAAa,WACbI,YACE,iJACFO,cAAc,GAEhBE,SAAU,CACRH,KAAM,UACNV,YAAa,WACbI,YACE,oIACFO,cAAc,GAGhBG,KAAM,CACJJ,KAAM,UACNV,YAAa,OACbI,YACE,0GACFO,cAAc,GAEhBI,MAAO,CACLL,KAAM,UACNV,YAAa,QACbI,YACE,kFACFO,cAAc,GAEhBK,OAAQ,CACNN,KAAM,SACNV,YAAa,SACbI,YAAa,sBACbO,aAAc,cAKJM,EAAWC,OACzBC,EAASD,EAATC,UACAV,EAAGS,EAAHT,IACAG,EAAQM,EAARN,SACAC,EAAQK,EAARL,SACAC,EAAII,EAAJJ,KACAC,EAAKG,EAALH,MACAC,EAAME,EAANF,OAEA,IAAKP,EACH,OAAOW,2EAET,IAAMC,IAAaC,4BAGnB,OACEF,gBAACG,GACCd,IAAKA,EACLG,UALeS,GAAmBT,EAMlCC,SAAUA,EACVC,KAAMA,EACNC,MAAOA,EACPC,OAAQA,EACRG,UAAWA,4EArGSK,GACxB,GAAIA,MAAAA,EAEF,MAAM,IAAIC,6CAEV,OAAOD,gCCEiBE,GAI1B,IACEC,EACAC,EASEF,IAVFC,EAYmBV,EAXnBW,EAWgC9B,EAT5B4B,EACFA,EAAOG,kBAAkBF,EAAWC,GAEpCC,EAAkBF,EAAWC"}
@@ -1,15 +0,0 @@
1
- import { CodeComponentMeta } from "@plasmicapp/host";
2
- import React from "react";
3
- export declare function ensure<T>(x: T | null | undefined): T;
4
- interface AudioPlayerProps {
5
- className?: string;
6
- src?: string;
7
- autoPlay?: boolean;
8
- controls?: boolean;
9
- loop?: boolean;
10
- muted?: boolean;
11
- volume?: number;
12
- }
13
- export declare const AudioPlayerMeta: CodeComponentMeta<AudioPlayerProps>;
14
- export declare function AudioPlayer({ className, src, autoPlay, controls, loop, muted, volume, }: AudioPlayerProps): React.JSX.Element;
15
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-audio-player.esm.js","sources":["../src/react-audio-player.tsx","../src/index.tsx"],"sourcesContent":["import { CodeComponentMeta, usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport ReactAudioPlayer from \"react-audio-player\";\n\nimport React from \"react\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/react-audio-player\";\n\ninterface AudioPlayerProps {\n className?: string;\n src?: string;\n autoPlay?: boolean;\n controls?: boolean;\n\n loop?: boolean;\n muted?: boolean;\n volume?: number;\n}\n\nexport const AudioPlayerMeta: CodeComponentMeta<AudioPlayerProps> = {\n name: \"hostless-react-audio-player\",\n displayName: \"AudioPlayer\",\n importName: \"AudioPlayer\",\n importPath: modulePath,\n providesData: true,\n description: \"React Audio Player to embed audio\",\n defaultStyles: {\n width: \"600px\",\n height: \"700px\",\n },\n props: {\n src: {\n type: \"string\",\n displayName: \"URL\",\n description: \"The URL of the audio to embed\",\n defaultValue: \"https://on.soundcloud.com/hS668\",\n },\n autoPlay: {\n type: \"boolean\",\n displayName: \"AutoPlay\",\n description:\n \"If true, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.\",\n defaultValue: false,\n },\n controls: {\n type: \"boolean\",\n displayName: \"Controls\",\n description:\n \"The browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback\",\n defaultValue: false,\n },\n\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description:\n \"If true, the audio player will automatically seek back to the start upon reaching the end of the audio.\",\n defaultValue: false,\n },\n muted: {\n type: \"boolean\",\n displayName: \"Muted\",\n description:\n \"A Boolean attribute that indicates whether the audio will be initially silenced\",\n defaultValue: false,\n },\n volume: {\n type: \"number\",\n displayName: \"Volume\",\n description: \"Volume of the audio\",\n defaultValue: 1.0,\n },\n },\n};\n\nexport function AudioPlayer({\n className,\n src,\n autoPlay,\n controls,\n loop,\n muted,\n volume,\n}: AudioPlayerProps) {\n if (!src) {\n return <div>Please specify the URL of the audio to embed</div>;\n }\n const inEditor = !!usePlasmicCanvasContext();\n const isAutoPlay = inEditor ? false : autoPlay;\n\n return (\n <ReactAudioPlayer\n src={src}\n autoPlay={isAutoPlay}\n controls={controls}\n loop={loop}\n muted={muted}\n volume={volume}\n className={className}\n />\n );\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport {\n AudioPlayer,\n AudioPlayerMeta,\n\n\n} from \"./react-audio-player\";\n\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: ComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n if (loader) {\n\n _registerComponent(AudioPlayer, AudioPlayerMeta);\n\n }\n}\n\nexport * from \"./react-audio-player\";"],"names":["ensure","x","undefined","Error","modulePath","AudioPlayerMeta","name","displayName","importName","importPath","providesData","description","defaultStyles","width","height","props","src","type","defaultValue","autoPlay","controls","loop","muted","volume","AudioPlayer","_ref","className","React","inEditor","usePlasmicCanvasContext","isAutoPlay","ReactAudioPlayer","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;;SAKgBA,MAAMA,CAAIC,CAAuB;EAC/C,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;IACjC;IACA,MAAM,IAAIC,KAAK,sCAAsC,CAAC;GACvD,MAAM;IACL,OAAOF,CAAC;;AAEZ;AAEA,IAAMG,UAAU,GAAG,iCAAiC;IAavCC,eAAe,GAAwC;EAClEC,IAAI,EAAE,6BAA6B;EACn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