@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/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export declare class CcSwiper extends ChuciElement {
6
6
  private divPagination?;
7
7
  private divPrevious?;
8
8
  private divNext?;
9
+ private isDragging;
9
10
  static get observedAttributes(): string[];
10
11
  get hasThumb(): boolean;
11
12
  get autoplay(): boolean;
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@c4h/chuci",
3
- "version": "0.1.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.cjs",
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.cjs"
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
- "scripts": {
29
- "dev": "vite --host='0.0.0.0'",
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
- "@photo-sphere-viewer/core": "^5.11.4",
41
- "gsplat": "^1.2.4",
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.17.0",
48
- "@testing-library/dom": "^10.4.0",
49
- "@testing-library/jest-dom": "^6.6.3",
50
- "@types/jsdom": "^21.1.6",
51
- "@types/node": "^22.10.2",
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.18.2",
54
- "@typescript-eslint/parser": "^8.18.2",
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.17.0",
58
- "eslint-config-prettier": "^9.1.0",
47
+ "eslint": "^9.39.2",
48
+ "eslint-config-prettier": "^9.1.2",
59
49
  "jsdom": "^25.0.1",
60
- "prettier": "^3.4.2",
61
- "typescript": "^5.7.2",
62
- "vite": "^6.3.5",
63
- "vite-plugin-dts": "^4.4.0",
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": ["kobakazu0429 <kobakazu10@gmail.com>"],
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
  `