@car-cutter/vue-webplayer 0.3.0 → 0.3.2

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/package.json CHANGED
@@ -1,23 +1,28 @@
1
1
  {
2
2
  "name": "@car-cutter/vue-webplayer",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
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": "vue-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
  "peerDependencies": {
18
20
  "vue": ">=3"
19
21
  },
20
22
  "devDependencies": {
23
+ "@car-cutter/eslint-config": "*",
24
+ "@car-cutter/typescript-config": "*",
25
+ "@car-cutter/wc-webplayer": "0.3.2",
21
26
  "@vitejs/plugin-vue": "^5.1.2",
22
27
  "eslint": "^8.57.0",
23
28
  "typescript": "^5.5.3",
@@ -1,16 +0,0 @@
1
-
2
- yarn run v1.22.22
3
- $ vue-tsc -b && vite build
4
- vite v5.4.1 building for production...
5
- transforming (1) index.ts✓ 9 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 3207ms.
12
- 
13
- computing gzip size (1)...dist/index.js 322.23 kB │ gzip: 80.75 kB
14
- rendering chunks (1)...computing gzip size (1)...dist/index.umd.cjs 222.23 kB │ gzip: 69.99 kB
15
- ✓ built in 3.61s
16
- ✨ Done in 5.58s.
@@ -1,4 +0,0 @@
1
-
2
- yarn run v1.22.22
3
- $ eslint . --ext ts --max-warnings 0
4
- ✨ Done in 1.84s.
package/index.ts DELETED
@@ -1,23 +0,0 @@
1
- export {
2
- default as WebPlayer,
3
- type WebPlayerProps,
4
- type WebPlayerEvents,
5
- } from "./src/WebPlayer.vue";
6
-
7
- // Expose parent package
8
- export {
9
- // - Components
10
- WEB_PLAYER_WC_TAG,
11
- WEB_PLAYER_ICON_WC_TAG,
12
- // - Events
13
- DEFAULT_EVENT_PREFIX,
14
- EVENT_COMPOSITION_LOADING,
15
- EVENT_COMPOSITION_LOADED,
16
- EVENT_COMPOSITION_LOAD_ERROR,
17
- EVENT_EXTEND_MODE_ON,
18
- EVENT_EXTEND_MODE_OFF,
19
- EVENT_HOTSPOTS_ON,
20
- EVENT_HOTSPOTS_OFF,
21
- EVENT_GALLERY_OPEN,
22
- EVENT_GALLERY_CLOSE,
23
- } from "@car-cutter/wc-webplayer";
package/src/WebPlayer.vue DELETED
@@ -1,83 +0,0 @@
1
- <script lang="ts" setup>
2
- import { onMounted, onUnmounted } from "vue";
3
-
4
- import {
5
- DEFAULT_EVENT_PREFIX,
6
- EVENT_COMPOSITION_LOADING,
7
- EVENT_COMPOSITION_LOADED,
8
- EVENT_COMPOSITION_LOAD_ERROR,
9
- EVENT_EXTEND_MODE_ON,
10
- EVENT_EXTEND_MODE_OFF,
11
- EVENT_HOTSPOTS_ON,
12
- EVENT_HOTSPOTS_OFF,
13
- EVENT_GALLERY_OPEN,
14
- EVENT_GALLERY_CLOSE,
15
- } from "@car-cutter/core";
16
- import { type WebPlayerProps } from "@car-cutter/core-ui";
17
- import { ensureCustomElementsDefinition } from "@car-cutter/wc-webplayer";
18
-
19
- export type { WebPlayerProps };
20
- export type WebPlayerEvents = {
21
- compositionLoading: [];
22
- compositionLoaded: [];
23
- compositionLoadError: [];
24
- extendModeOn: [];
25
- extendModeOff: [];
26
- hotspotsOn: [];
27
- hotspotsOff: [];
28
- galleryOpen: [];
29
- galleryClose: [];
30
- };
31
-
32
- const props = defineProps<WebPlayerProps>();
33
- ensureCustomElementsDefinition();
34
-
35
- // -- Event listeners
36
- const emit = defineEmits<WebPlayerEvents>();
37
-
38
- const eventPrefix = props.eventPrefix ?? DEFAULT_EVENT_PREFIX;
39
-
40
- const generateEventName = (event: string) => `${eventPrefix}${event}`;
41
-
42
- const eventListenerMap = new Map([
43
- [EVENT_COMPOSITION_LOADING, () => emit("compositionLoading")],
44
- [EVENT_COMPOSITION_LOADED, () => emit("compositionLoaded")],
45
- [EVENT_COMPOSITION_LOAD_ERROR, () => emit("compositionLoadError")],
46
- [EVENT_EXTEND_MODE_ON, () => emit("extendModeOn")],
47
- [EVENT_EXTEND_MODE_OFF, () => emit("extendModeOff")],
48
- [EVENT_HOTSPOTS_ON, () => emit("hotspotsOn")],
49
- [EVENT_HOTSPOTS_OFF, () => emit("hotspotsOff")],
50
- [EVENT_GALLERY_OPEN, () => emit("galleryOpen")],
51
- [EVENT_GALLERY_CLOSE, () => emit("galleryClose")],
52
- ]);
53
-
54
- onMounted(() => {
55
- eventListenerMap.forEach((emiter, event) => {
56
- const eventName = generateEventName(event);
57
- document.addEventListener(eventName, emiter);
58
- });
59
- });
60
-
61
- onUnmounted(() => {
62
- eventListenerMap.forEach((emiter, event) => {
63
- const eventName = generateEventName(event);
64
- document.removeEventListener(eventName, emiter);
65
- });
66
- });
67
- </script>
68
-
69
- <template>
70
- <cc-webplayer
71
- :composition-url="compositionUrl"
72
- :infinite-carrousel="infiniteCarrousel"
73
- :permanent-gallery="permanentGallery"
74
- :image-load-strategy="imageLoadStrategy"
75
- :min-image-width="minImageWidth"
76
- :max-image-width="maxImageWidth"
77
- :flatten="flatten"
78
- :prevent-full-screen="preventFullScreen"
79
- :eventPrefix="eventPrefix"
80
- :reverse360="reverse360"
81
- >
82
- </cc-webplayer>
83
- </template>
package/tsconfig.app.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@car-cutter/typescript-config/base.json",
3
-
4
- "compilerOptions": {
5
- "jsx": "preserve"
6
- },
7
- "include": ["index.ts", "src/**/*.vue"]
8
- }
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- { "path": "./tsconfig.app.json" },
5
- { "path": "./tsconfig.node.json" }
6
- ]
7
- }
@@ -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,52 +0,0 @@
1
- import { resolve } from "path";
2
-
3
- import vue from "@vitejs/plugin-vue";
4
- import { defineConfig } from "vite";
5
- import dts from "vite-plugin-dts";
6
-
7
- export default defineConfig({
8
- plugins: [
9
- vue({
10
- template: {
11
- compilerOptions: {
12
- isCustomElement: tag => ["cc-webplayer"].includes(tag),
13
- },
14
- },
15
- }),
16
- dts({
17
- tsconfigPath: resolve(__dirname, "./tsconfig.app.json"),
18
- rollupTypes: true,
19
- bundledPackages: [
20
- "@car-cutter/core",
21
- "@car-cutter/core-ui",
22
- "@car-cutter/core-wc",
23
- "@car-cutter/wc-webplayer",
24
- ],
25
- }),
26
- ],
27
-
28
- define: {
29
- "process.env": {
30
- NODE_ENV: "production",
31
- },
32
- },
33
- build: {
34
- lib: {
35
- name: "vue-webplayer",
36
- fileName: "index",
37
- entry: resolve(__dirname, "./index.ts"),
38
- },
39
-
40
- chunkSizeWarningLimit: 400,
41
-
42
- // Vue is an external dependency, it should be provided by the consumer
43
- rollupOptions: {
44
- external: ["vue"],
45
- output: {
46
- globals: {
47
- vue: "Vue",
48
- },
49
- },
50
- },
51
- },
52
- });