@editframe/react 0.0.1 → 0.1.0

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,17 @@
1
+
2
+ > @editframe/react@0.1.0 build /home/runner/work/js/js/packages/react
3
+ > tsup src/index.ts --format esm,cjs --dts --minify
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v6.6.3
8
+ CLI Target: es6
9
+ ESM Build start
10
+ CJS Build start
11
+ CJS dist/index.js 1.31 KB
12
+ CJS ⚡️ Build success in 74ms
13
+ ESM dist/index.mjs 830.00 B
14
+ ESM ⚡️ Build success in 81ms
15
+ DTS Build start
16
+ DTS ⚡️ Build success in 3997ms
17
+ DTS dist/index.d.ts 564.00 B
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @editframe/react
2
+
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0595a21: distribute dist
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/react",
3
- "version": "0.0.1",
3
+ "author": "Editframe",
4
4
  "description": "",
5
5
  "main": "./dist/index.d.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -19,10 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "react": "^18.2.0"
21
21
  },
22
- "author": "Editframe",
23
- "publishConfig": {
24
- "access": "restricted"
25
- },
22
+ "version": "0.1.0",
26
23
  "scripts": {
27
24
  "build": "tsup src/index.ts --format esm,cjs --dts --minify",
28
25
  "dev": "npm run build -- --watch",
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ singleQuote: true,
3
+ semi: false,
4
+ };
package/src/Player.tsx CHANGED
@@ -1,24 +1,24 @@
1
- import { Player as PlayerClass } from "@editframe/embed";
2
- import { CompositionConfigEditor } from "@editframe/shared-types";
3
- import React, { useEffect, useRef } from "react";
4
- import { v4 as uuid } from "uuid";
1
+ import { Player as PlayerClass } from '@editframe/embed'
2
+ import { CompositionConfigEditor } from '@editframe/shared-types'
3
+ import React, { useEffect, useRef } from 'react'
4
+ import { v4 as uuid } from 'uuid'
5
5
 
6
6
  export interface IPlayerProps
7
7
  extends React.DetailedHTMLProps<
8
8
  React.HTMLAttributes<HTMLDivElement>,
9
9
  HTMLDivElement
10
10
  > {
11
- applicationId?: string;
12
- config: CompositionConfigEditor;
11
+ applicationId?: string
12
+ config: CompositionConfigEditor
13
13
  dimensions?: {
14
- height: string;
15
- width: string;
16
- };
17
- hideControls?: boolean;
18
- host?: string;
19
- loop: boolean;
20
- playerState?: "playing" | "paused" | "stopped";
21
- seek?: number;
14
+ height: string
15
+ width: string
16
+ }
17
+ hideControls?: boolean
18
+ host?: string
19
+ loop: boolean
20
+ playerState?: 'playing' | 'paused' | 'stopped'
21
+ seek?: number
22
22
  }
23
23
 
24
24
  const Player: React.FunctionComponent<IPlayerProps> = ({
@@ -32,9 +32,9 @@ const Player: React.FunctionComponent<IPlayerProps> = ({
32
32
  playerState,
33
33
  seek,
34
34
  }) => {
35
- const player = useRef(true);
36
- const embed = useRef({} as any);
37
- const containerId = `ef-player-${uuid().slice(0, 6)}`;
35
+ const player = useRef(true)
36
+ const embed = useRef({} as any)
37
+ const containerId = `ef-player-${uuid().slice(0, 6)}`
38
38
  useEffect(() => {
39
39
  if (!player.current && !embed.current.setState) {
40
40
  embed.current = new PlayerClass({
@@ -42,36 +42,36 @@ const Player: React.FunctionComponent<IPlayerProps> = ({
42
42
  config,
43
43
  containerId,
44
44
  dimensions,
45
- host: host || "https://embed.editframe.com",
45
+ host: host || 'https://embed.editframe.com',
46
46
  hideControls,
47
- });
48
- player.current = true;
47
+ })
48
+ player.current = true
49
49
  }
50
50
  return () => {
51
- player.current = false;
52
- };
53
- }, []);
51
+ player.current = false
52
+ }
53
+ }, [])
54
54
  useEffect(() => {
55
55
  if (embed.current && embed.current.setState) {
56
- embed.current.setState(playerState);
56
+ embed.current.setState(playerState)
57
57
  }
58
58
  return () => {
59
59
  if (embed.current && embed.current.setState) {
60
- embed.current.setState("stopped");
60
+ embed.current.setState('stopped')
61
61
  }
62
- };
63
- }, [playerState]);
62
+ }
63
+ }, [playerState])
64
64
  useEffect(() => {
65
65
  if (embed.current && embed.current.setState) {
66
- embed.current.seek(seek);
66
+ embed.current.seek(seek)
67
67
  }
68
68
  return () => {
69
69
  if (embed.current && embed.current.setState) {
70
- embed.current.seek(0);
70
+ embed.current.seek(0)
71
71
  }
72
- };
73
- }, [seek]);
72
+ }
73
+ }, [seek])
74
74
 
75
- return <div id={containerId}>{children}</div>;
76
- };
77
- export default Player;
75
+ return <div id={containerId}>{children}</div>
76
+ }
77
+ export default Player
package/.giteep DELETED
File without changes