@car-cutter/vue-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 +2 -0
- package/package.json +9 -4
- package/.turbo/turbo-build.log +0 -16
- package/.turbo/turbo-lint.log +0 -4
- package/index.ts +0 -23
- package/src/WebPlayer.vue +0 -83
- package/tsconfig.app.json +0 -8
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -5
- package/vite.config.ts +0 -52
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@car-cutter/vue-webplayer",
|
|
3
|
-
"version": "0.3.
|
|
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": "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.1",
|
|
21
26
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
22
27
|
"eslint": "^8.57.0",
|
|
23
28
|
"typescript": "^5.5.3",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
[2K[1G[1myarn run v1.22.22[22m
|
|
3
|
-
[2K[1G[2m$ vue-tsc -b && vite build[22m
|
|
4
|
-
[36mvite v5.4.1 [32mbuilding for production...[36m[39m
|
|
5
|
-
[2K[1Gtransforming (1) [2mindex.ts[22m[2K[1G[32m✓[39m 9 modules transformed.
|
|
6
|
-
[2K[1Grendering chunks (1)...[2K[1G[32m
|
|
7
|
-
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
8
|
-
[2K[1Gcomputing gzip size (0)...[32m[36m[vite:dts][32m Start rollup declaration files...[39m
|
|
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
|
-
[32m[36m[vite:dts][32m Declaration files built in 3207ms.
|
|
12
|
-
[39m
|
|
13
|
-
[2K[1Gcomputing gzip size (1)...[2K[1G[2mdist/[22m[36mindex.js [39m[1m[2m322.23 kB[22m[1m[22m[2m │ gzip: 80.75 kB[22m
|
|
14
|
-
[2K[1Grendering chunks (1)...[2K[1G[2K[1Gcomputing gzip size (1)...[2K[1G[2mdist/[22m[36mindex.umd.cjs [39m[1m[2m222.23 kB[22m[1m[22m[2m │ gzip: 69.99 kB[22m
|
|
15
|
-
[32m✓ built in 3.61s[39m
|
|
16
|
-
[2K[1G✨ Done in 5.58s.
|
package/.turbo/turbo-lint.log
DELETED
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
package/tsconfig.json
DELETED
package/tsconfig.node.json
DELETED
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
|
-
});
|