@c4h/chuci 0.1.0 → 0.2.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.
- package/CHANGELOG.md +32 -32
- package/LICENSE +20 -20
- package/README.ja.md +143 -143
- package/README.md +224 -224
- package/dist/chuci.js +9067 -6595
- package/dist/chuci.umd.js +164 -165
- package/dist/index.d.ts +1 -0
- package/package.json +36 -33
- package/src/components/swiper/cc-swiper-slide.ts +49 -49
- package/src/components/swiper/cc-swiper-styles.ts +28 -28
- package/src/components/swiper/cc-swiper.ts +379 -361
- package/src/components/swiper/swiper-styles.css +4 -4
- package/src/components/viewer/cc-viewer-3dmodel.ts +491 -491
- package/src/components/viewer/cc-viewer-base.ts +278 -278
- package/src/components/viewer/cc-viewer-gaussian.ts +380 -380
- package/src/components/viewer/cc-viewer-image.ts +189 -189
- package/src/components/viewer/cc-viewer-panorama.ts +85 -85
- package/src/components/viewer/cc-viewer-styles.ts +55 -55
- package/src/components/viewer/cc-viewer-video.ts +109 -109
- package/src/components/viewer/cc-viewer-youtube.ts +75 -75
- package/src/components/viewer/cc-viewer.ts +290 -290
- package/src/index.ts +24 -24
- package/src/types/css-modules.d.ts +1 -1
- package/src/types/global.d.ts +10 -10
- package/src/utils/base-element.ts +76 -76
- package/dist/assets/azumaya_panorama1.png +0 -0
- package/dist/chuci.cjs +0 -4483
- package/dist/index-8VMexD2a.cjs +0 -255
- package/dist/index-kvsisbKS.js +0 -2125
- package/dist/index.html +0 -241
- package/dist/test-image.html +0 -63
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4h/chuci",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Standalone multimedia swiper and viewer web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
|
-
"main": "./dist/chuci.
|
|
7
|
+
"main": "./dist/chuci.umd.js",
|
|
8
8
|
"module": "./dist/chuci.js",
|
|
9
9
|
"browser": "./dist/chuci.umd.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"browser": "./dist/chuci.umd.js",
|
|
15
14
|
"import": "./dist/chuci.js",
|
|
16
|
-
"require": "./dist/chuci.
|
|
15
|
+
"require": "./dist/chuci.umd.js"
|
|
17
16
|
},
|
|
18
17
|
"./package.json": "./package.json",
|
|
19
18
|
"./dist/*": "./dist/*"
|
|
@@ -25,42 +24,33 @@
|
|
|
25
24
|
"CHANGELOG.md",
|
|
26
25
|
"LICENSE"
|
|
27
26
|
],
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"build": "npm run typecheck && cross-env BUILD_MODE=package vite build",
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"test": "vitest run",
|
|
33
|
-
"test:watch": "vitest",
|
|
34
|
-
"coverage": "vitest run --coverage",
|
|
35
|
-
"lint": "eslint src tests",
|
|
36
|
-
"lint:fix": "eslint src tests --fix",
|
|
37
|
-
"prepublishOnly": "npm run typecheck && npm run build"
|
|
27
|
+
"engines": {
|
|
28
|
+
"pnpm": ">=9.0.0"
|
|
38
29
|
},
|
|
39
30
|
"dependencies": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"swiper": "^11.1.15",
|
|
31
|
+
"gsplat": "^1.2.9",
|
|
32
|
+
"swiper": "^11.2.10",
|
|
43
33
|
"three": "^0.171.0",
|
|
44
34
|
"viewerjs": "^1.11.7"
|
|
45
35
|
},
|
|
46
36
|
"devDependencies": {
|
|
47
|
-
"@eslint/js": "^9.
|
|
48
|
-
"@testing-library/dom": "^10.4.
|
|
49
|
-
"@testing-library/jest-dom": "^6.
|
|
50
|
-
"@types/jsdom": "^21.1.
|
|
51
|
-
"@types/node": "^22.
|
|
37
|
+
"@eslint/js": "^9.39.2",
|
|
38
|
+
"@testing-library/dom": "^10.4.1",
|
|
39
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
40
|
+
"@types/jsdom": "^21.1.7",
|
|
41
|
+
"@types/node": "^22.19.3",
|
|
52
42
|
"@types/three": "^0.171.0",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
54
|
-
"@typescript-eslint/parser": "^8.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.50.1",
|
|
44
|
+
"@typescript-eslint/parser": "^8.50.1",
|
|
55
45
|
"@vitest/coverage-v8": "^3.2.4",
|
|
56
46
|
"cross-env": "^7.0.3",
|
|
57
|
-
"eslint": "^9.
|
|
58
|
-
"eslint-config-prettier": "^9.1.
|
|
47
|
+
"eslint": "^9.39.2",
|
|
48
|
+
"eslint-config-prettier": "^9.1.2",
|
|
59
49
|
"jsdom": "^25.0.1",
|
|
60
|
-
"prettier": "^3.4
|
|
61
|
-
"typescript": "^5.
|
|
62
|
-
"vite": "^6.
|
|
63
|
-
"vite-plugin-dts": "^4.4
|
|
50
|
+
"prettier": "^3.7.4",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"vite": "^6.4.1",
|
|
53
|
+
"vite-plugin-dts": "^4.5.4",
|
|
64
54
|
"vitest": "^3.2.4"
|
|
65
55
|
},
|
|
66
56
|
"keywords": [
|
|
@@ -73,7 +63,9 @@
|
|
|
73
63
|
"3d"
|
|
74
64
|
],
|
|
75
65
|
"author": "Code for History",
|
|
76
|
-
"contributors": [
|
|
66
|
+
"contributors": [
|
|
67
|
+
"kobakazu0429 <kobakazu10@gmail.com>"
|
|
68
|
+
],
|
|
77
69
|
"license": "MIT",
|
|
78
70
|
"repository": {
|
|
79
71
|
"type": "git",
|
|
@@ -82,5 +74,16 @@
|
|
|
82
74
|
"bugs": {
|
|
83
75
|
"url": "https://github.com/code4history/Chuci/issues"
|
|
84
76
|
},
|
|
85
|
-
"homepage": "https://github.com/code4history/Chuci#readme"
|
|
86
|
-
|
|
77
|
+
"homepage": "https://github.com/code4history/Chuci#readme",
|
|
78
|
+
"scripts": {
|
|
79
|
+
"dev": "vite --host",
|
|
80
|
+
"build": "npm run typecheck && cross-env BUILD_MODE=package vite build",
|
|
81
|
+
"build:demo": "vite build",
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
|
+
"test": "vitest run",
|
|
84
|
+
"test:watch": "vitest",
|
|
85
|
+
"coverage": "vitest run --coverage",
|
|
86
|
+
"lint": "eslint src tests",
|
|
87
|
+
"lint:fix": "eslint src tests --fix"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ChuciElement } from '@/utils/base-element'
|
|
2
|
-
|
|
3
|
-
export class CcSwiperSlide extends ChuciElement {
|
|
4
|
-
static get observedAttributes() {
|
|
5
|
-
return ['thumbnail-url', 'image-url', 'image-type', 'caption']
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
get thumbnailUrl() {
|
|
9
|
-
return this.getAttribute('thumbnail-url') || ''
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
get imageUrl() {
|
|
13
|
-
return this.getAttribute('image-url') || ''
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
get imageType() {
|
|
17
|
-
return this.getAttribute('image-type') || ''
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get caption() {
|
|
21
|
-
return this.getAttribute('caption') || ''
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
protected render() {
|
|
25
|
-
const styles = this.css`
|
|
26
|
-
:host {
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
align-items: center;
|
|
30
|
-
height: 100%;
|
|
31
|
-
width: 100%;
|
|
32
|
-
background-size: cover !important;
|
|
33
|
-
background-repeat: no-repeat !important;
|
|
34
|
-
background-position: center !important;
|
|
35
|
-
}
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
this.updateShadowRoot(styles)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!customElements.get('cc-swiper-slide')) {
|
|
43
|
-
customElements.define('cc-swiper-slide', CcSwiperSlide)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare global {
|
|
47
|
-
interface HTMLElementTagNameMap {
|
|
48
|
-
'cc-swiper-slide': CcSwiperSlide
|
|
49
|
-
}
|
|
1
|
+
import { ChuciElement } from '@/utils/base-element'
|
|
2
|
+
|
|
3
|
+
export class CcSwiperSlide extends ChuciElement {
|
|
4
|
+
static get observedAttributes() {
|
|
5
|
+
return ['thumbnail-url', 'image-url', 'image-type', 'caption']
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get thumbnailUrl() {
|
|
9
|
+
return this.getAttribute('thumbnail-url') || ''
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get imageUrl() {
|
|
13
|
+
return this.getAttribute('image-url') || ''
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get imageType() {
|
|
17
|
+
return this.getAttribute('image-type') || ''
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get caption() {
|
|
21
|
+
return this.getAttribute('caption') || ''
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected render() {
|
|
25
|
+
const styles = this.css`
|
|
26
|
+
:host {
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
background-size: cover !important;
|
|
33
|
+
background-repeat: no-repeat !important;
|
|
34
|
+
background-position: center !important;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
this.updateShadowRoot(styles)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!customElements.get('cc-swiper-slide')) {
|
|
43
|
+
customElements.define('cc-swiper-slide', CcSwiperSlide)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare global {
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
'cc-swiper-slide': CcSwiperSlide
|
|
49
|
+
}
|
|
50
50
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export const swiperStyles = `
|
|
2
|
-
:host {
|
|
3
|
-
display: block;
|
|
4
|
-
--swiper-theme-color: #007aff;
|
|
5
|
-
--swiper-navigation-size: 44px;
|
|
6
|
-
--swiper-navigation-color: #007aff;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.swiper {
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.swiper-slide {
|
|
15
|
-
text-align: center;
|
|
16
|
-
font-size: 18px;
|
|
17
|
-
background: #fff;
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.swiper-slide img {
|
|
24
|
-
display: block;
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
object-fit: cover;
|
|
28
|
-
}
|
|
1
|
+
export const swiperStyles = `
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
--swiper-theme-color: #007aff;
|
|
5
|
+
--swiper-navigation-size: 44px;
|
|
6
|
+
--swiper-navigation-color: #007aff;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.swiper {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.swiper-slide {
|
|
15
|
+
text-align: center;
|
|
16
|
+
font-size: 18px;
|
|
17
|
+
background: #fff;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.swiper-slide img {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
object-fit: cover;
|
|
28
|
+
}
|
|
29
29
|
`
|