@car-cutter/vanilla-webplayer 0.3.0 → 0.3.1

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.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Vanilla WebPlayer
2
2
 
3
+ Use CarCutter WebPlayer with Vanilla JS/TS
4
+
3
5
  ## Usage
4
6
 
5
7
  1. Install package: `npm install @car-cutter/vanilla-webplayer`
package/package.json CHANGED
@@ -1,22 +1,25 @@
1
1
  {
2
2
  "name": "@car-cutter/vanilla-webplayer",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "package.json",
12
+ "README.md"
13
+ ],
9
14
  "scripts": {
10
15
  "build": "tsc -b && vite build",
11
16
  "lint": "eslint . --ext ts --max-warnings 0",
12
17
  "analyze": "vite-bundle-visualizer"
13
18
  },
14
- "dependencies": {
15
- "@car-cutter/wc-webplayer": "0.3.0"
16
- },
17
19
  "devDependencies": {
18
20
  "@car-cutter/eslint-config": "*",
19
21
  "@car-cutter/typescript-config": "*",
22
+ "@car-cutter/wc-webplayer": "0.3.1",
20
23
  "eslint": "^8.57.0",
21
24
  "typescript": "^5.5.4",
22
25
  "vite": "^5.4.1",
package/.eslintrc.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@car-cutter/eslint-config/base.json"
3
- }
@@ -1,16 +0,0 @@
1
-
2
- yarn run v1.22.22
3
- $ tsc -b && vite build
4
- vite v5.4.1 building for production...
5
- transforming (1) index.ts✓ 3 modules transformed.
6
- rendering chunks (1)...
7
- [vite:dts] Start generate declaration files...
8
- computing gzip size (0)...[vite:dts] Start rollup declaration files...
9
- Analysis will use the bundled TypeScript version 5.4.2
10
- *** The target project appears to use TypeScript 5.5.4 which is newer than the bundled compiler engine; consider upgrading API Extractor.
11
- [vite:dts] Declaration files built in 5129ms.
12
- 
13
- computing gzip size (1)...dist/index.js 320.33 kB │ gzip: 80.28 kB
14
- rendering chunks (1)...computing gzip size (1)...dist/index.umd.cjs 220.78 kB │ gzip: 69.61 kB
15
- ✓ built in 5.80s
16
- ✨ Done in 9.07s.
@@ -1,4 +0,0 @@
1
-
2
- yarn run v1.22.22
3
- $ eslint . --ext ts --max-warnings 0
4
- ✨ Done in 2.31s.
package/index.ts DELETED
@@ -1,20 +0,0 @@
1
- export { appendWebPlayerElement } from "./src/lib";
2
-
3
- // Expose parent package
4
- export {
5
- // - Components
6
- WEB_PLAYER_WC_TAG,
7
- WEB_PLAYER_ICON_WC_TAG,
8
- type WebPlayerProps,
9
- // - Events
10
- DEFAULT_EVENT_PREFIX,
11
- EVENT_COMPOSITION_LOADING,
12
- EVENT_COMPOSITION_LOADED,
13
- EVENT_COMPOSITION_LOAD_ERROR,
14
- EVENT_EXTEND_MODE_ON,
15
- EVENT_EXTEND_MODE_OFF,
16
- EVENT_HOTSPOTS_ON,
17
- EVENT_HOTSPOTS_OFF,
18
- EVENT_GALLERY_OPEN,
19
- EVENT_GALLERY_CLOSE,
20
- } from "@car-cutter/wc-webplayer";
package/src/lib.ts DELETED
@@ -1,25 +0,0 @@
1
- import {
2
- WEB_PLAYER_WC_TAG,
3
- ensureCustomElementsDefinition,
4
- webPlayerPropsToAttributes,
5
- type WebPlayerProps,
6
- } from "@car-cutter/wc-webplayer";
7
-
8
- export function appendWebPlayerElement(
9
- parentElement: HTMLElement,
10
- props: WebPlayerProps
11
- ) {
12
- const attributes = webPlayerPropsToAttributes(props);
13
-
14
- ensureCustomElementsDefinition();
15
-
16
- // -- Append Element to Dom
17
- // Create
18
- const elmt = document.createElement(WEB_PLAYER_WC_TAG);
19
- // Set attributes
20
- Object.entries(attributes).forEach(([key, value]) =>
21
- elmt.setAttribute(key, value)
22
- );
23
- // Append
24
- parentElement.appendChild(elmt);
25
- }
package/tsconfig.app.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@car-cutter/typescript-config/base.json",
3
-
4
- "include": ["index.ts", "src"],
5
- "exclude": ["dist", "node_modules"]
6
- }
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.app.json"
6
- },
7
- {
8
- "path": "./tsconfig.node.json"
9
- }
10
- ]
11
- }
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "@car-cutter/typescript-config/vite.json",
3
-
4
- "include": ["vite.config.ts"]
5
- }
package/vite.config.ts DELETED
@@ -1,27 +0,0 @@
1
- import { resolve } from "path";
2
-
3
- import { defineConfig } from "vite";
4
- import dts from "vite-plugin-dts";
5
-
6
- export default defineConfig({
7
- plugins: [
8
- dts({
9
- tsconfigPath: resolve(__dirname, "./tsconfig.app.json"),
10
- rollupTypes: true,
11
- bundledPackages: ["@car-cutter/wc-webplayer"],
12
- }),
13
- ],
14
-
15
- define: {
16
- "process.env": {
17
- NODE_ENV: "production",
18
- },
19
- },
20
- build: {
21
- lib: {
22
- name: "vanilla-webplayer",
23
- fileName: "index",
24
- entry: resolve(__dirname, "./index.ts"),
25
- },
26
- },
27
- });