unika-components 1.0.320 → 1.0.322

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.
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { PageData } from '../defaultProps';
3
3
  export declare function usePageTransition(pages: Ref<PageData[]>, currentPageId: Ref<string>): {
4
- pageTransition: import("vue").ComputedRef<string>;
4
+ pageTransition: import("vue").ComputedRef<"fade" | "slide-up" | "slide-down">;
5
5
  deltaY: Ref<number>;
6
6
  };
@@ -1,40 +1,14 @@
1
1
 
2
- .text-component {
3
- cursor: pointer; /* 点击时显示手型光标 */
4
- }
5
-
6
- .uni-video-component {
7
- position: relative;
8
- text-align: center;
9
- }
10
- .play-pause-button {
11
- position: absolute;
12
- top: 50%;
13
- left: 50%;
14
- transform: translate(-50%, -50%);
15
- cursor: pointer;
16
- font-size: 2rem;
17
- color: #fff;
18
- background: rgba(0, 0, 0, 0.6);
19
- border-radius: 50%;
20
- padding: 10px;
21
- transition: background 0.3s;
22
- }
23
- .play-pause-button:hover {
24
- background: rgba(0, 0, 0, 0.8);
25
- }
26
-
27
2
  .uni-image-component {
28
3
  max-width: 100%;
29
4
  }
30
5
  .uni-image-mask-wrapper {
31
6
  display: inline-block;
32
7
  }
33
-
34
- .uni-lotties-component {
35
- width: 100%;
36
- height: 100%;
37
- }
8
+
9
+ .text-component {
10
+ cursor: pointer; /* 点击时显示手型光标 */
11
+ }
38
12
 
39
13
  .work-container {
40
14
  position: relative;
@@ -233,6 +207,27 @@
233
207
  will-change: transform;
234
208
  }
235
209
 
210
+ .uni-video-component {
211
+ position: relative;
212
+ text-align: center;
213
+ }
214
+ .play-pause-button {
215
+ position: absolute;
216
+ top: 50%;
217
+ left: 50%;
218
+ transform: translate(-50%, -50%);
219
+ cursor: pointer;
220
+ font-size: 2rem;
221
+ color: #fff;
222
+ background: rgba(0, 0, 0, 0.6);
223
+ border-radius: 50%;
224
+ padding: 10px;
225
+ transition: background 0.3s;
226
+ }
227
+ .play-pause-button:hover {
228
+ background: rgba(0, 0, 0, 0.8);
229
+ }
230
+
236
231
 
237
232
  .uni-calendar-component {
238
233
 
@@ -245,14 +240,6 @@
245
240
  color: #666
246
241
  }
247
242
 
248
- .effect {
249
- width: 100%;
250
- height: 100%;
251
- }
252
-
253
- .uni-build-up-component {
254
- }
255
-
256
243
  .like-button {
257
244
  display: flex;
258
245
  flex-direction: column;
@@ -274,10 +261,6 @@
274
261
  font-size: 16px;
275
262
  color: #333;
276
263
  }
277
-
278
- .uni-svg-component {
279
- display: inline-block;
280
- }
281
264
 
282
265
  .ant-input-number {
283
266
  box-sizing: border-box;
@@ -314,6 +297,130 @@
314
297
  vertical-align: top;
315
298
  }
316
299
 
300
+ .uni-build-up-component {
301
+ }
302
+
303
+ .effect {
304
+ width: 100%;
305
+ height: 100%;
306
+ }
307
+
308
+ .uni-svg-component {
309
+ display: inline-block;
310
+ }
311
+
312
+ .uni-lotties-component {
313
+ width: 100%;
314
+ height: 100%;
315
+ }
316
+
317
+ .page-indicator {
318
+ position: fixed;
319
+ display: flex;
320
+ align-items: center;
321
+ justify-content: center;
322
+ z-index: 1000;
323
+ transition: all 0.3s ease;
324
+
325
+ /* 默认位置(底部居中) */
326
+ &.bottom {
327
+ bottom: 20px;
328
+ left: 50%;
329
+ transform: translateX(-50%);
330
+ flex-direction: row;
331
+ }
332
+
333
+ /* 顶部样式 */
334
+ &.top {
335
+ top: 20px;
336
+ left: 50%;
337
+ transform: translateX(-50%);
338
+ flex-direction: row;
339
+ }
340
+
341
+ /* 左侧样式 */
342
+ &.left {
343
+ left: 20px;
344
+ top: 50%;
345
+ transform: translateY(-50%);
346
+ flex-direction: column;
347
+ }
348
+
349
+ /* 右侧样式 */
350
+ &.right {
351
+ right: 20px;
352
+ top: 50%;
353
+ transform: translateY(-50%);
354
+ flex-direction: column;
355
+ }
356
+
357
+ /* 点状样式 */
358
+ &.dot-style {
359
+ .indicator-dot {
360
+ width: v-bind('size + "px"');
361
+ height: v-bind('size + "px"');
362
+ margin: v-bind('spacing/2 + "px"');
363
+ border-radius: 50%;
364
+ background-color: v-bind('color + "4D"'); /* 添加透明度 */
365
+ display: flex;
366
+ align-items: center;
367
+ justify-content: center;
368
+ cursor: pointer;
369
+ transition: all 0.3s ease;
370
+
371
+ .active-dot {
372
+ border-radius: 50%;
373
+ transition: all 0.3s ease;
374
+ }
375
+
376
+ &:hover {
377
+ background-color: v-bind('color + "80"');
378
+ }
379
+
380
+ &.active {
381
+ background-color: transparent;
382
+ }
383
+ }
384
+ }
385
+
386
+ /* 数字样式 */
387
+ &.number-style {
388
+ padding: 6px 12px;
389
+ border-radius: 20px;
390
+ background-color: rgba(0, 0, 0, 0.3);
391
+ color: v-bind('color');
392
+ font-size: 14px;
393
+
394
+ .current-page {
395
+ color: v-bind('activeColor');
396
+ font-weight: bold;
397
+ }
398
+
399
+ .separator {
400
+ margin: 0 4px;
401
+ opacity: 0.6;
402
+ }
403
+
404
+ .total-pages {
405
+ opacity: 0.8;
406
+ }
407
+ }
408
+ }
409
+
410
+ .dynamic-element {
411
+ position: absolute;
412
+ box-sizing: border-box;
413
+ }
414
+
415
+ .is-sign {
416
+ z-index: 10;
417
+ }
418
+
419
+ .is-locked {
420
+ pointer-events: none;
421
+ opacity: 0.7;
422
+ }
423
+
317
424
 
318
425
  .no-animation__card {
319
426
  font-weight: 500;
@@ -500,21 +607,7 @@
500
607
  z-index: 5;
501
608
  }
502
609
  }
503
-
504
- .dynamic-element {
505
- position: absolute;
506
- box-sizing: border-box;
507
- }
508
-
509
- .is-sign {
510
- z-index: 10;
511
- }
512
-
513
- .is-locked {
514
- pointer-events: none;
515
- opacity: 0.7;
516
- }
517
-
610
+
518
611
  .unika-calendar-box {
519
612
  position: relative;
520
613
  width: 325px !important;
@@ -775,97 +868,3 @@
775
868
  padding: 0 0px;
776
869
  border-bottom: 1px solid
777
870
  }
778
-
779
- .page-indicator {
780
- position: fixed;
781
- display: flex;
782
- align-items: center;
783
- justify-content: center;
784
- z-index: 1000;
785
- transition: all 0.3s ease;
786
-
787
- /* 默认位置(底部居中) */
788
- &.bottom {
789
- bottom: 20px;
790
- left: 50%;
791
- transform: translateX(-50%);
792
- flex-direction: row;
793
- }
794
-
795
- /* 顶部样式 */
796
- &.top {
797
- top: 20px;
798
- left: 50%;
799
- transform: translateX(-50%);
800
- flex-direction: row;
801
- }
802
-
803
- /* 左侧样式 */
804
- &.left {
805
- left: 20px;
806
- top: 50%;
807
- transform: translateY(-50%);
808
- flex-direction: column;
809
- }
810
-
811
- /* 右侧样式 */
812
- &.right {
813
- right: 20px;
814
- top: 50%;
815
- transform: translateY(-50%);
816
- flex-direction: column;
817
- }
818
-
819
- /* 点状样式 */
820
- &.dot-style {
821
- .indicator-dot {
822
- width: v-bind('size + "px"');
823
- height: v-bind('size + "px"');
824
- margin: v-bind('spacing/2 + "px"');
825
- border-radius: 50%;
826
- background-color: v-bind('color + "4D"'); /* 添加透明度 */
827
- display: flex;
828
- align-items: center;
829
- justify-content: center;
830
- cursor: pointer;
831
- transition: all 0.3s ease;
832
-
833
- .active-dot {
834
- border-radius: 50%;
835
- transition: all 0.3s ease;
836
- }
837
-
838
- &:hover {
839
- background-color: v-bind('color + "80"');
840
- }
841
-
842
- &.active {
843
- background-color: transparent;
844
- }
845
- }
846
- }
847
-
848
- /* 数字样式 */
849
- &.number-style {
850
- padding: 6px 12px;
851
- border-radius: 20px;
852
- background-color: rgba(0, 0, 0, 0.3);
853
- color: v-bind('color');
854
- font-size: 14px;
855
-
856
- .current-page {
857
- color: v-bind('activeColor');
858
- font-weight: bold;
859
- }
860
-
861
- .separator {
862
- margin: 0 4px;
863
- opacity: 0.6;
864
- }
865
-
866
- .total-pages {
867
- opacity: 0.8;
868
- }
869
- }
870
- }
871
-
@@ -5839,7 +5839,6 @@ var script$g = defineComponent({
5839
5839
  // 使用组合式函数处理样式和属性
5840
5840
  const { elementStyle } = useElementStyle(props.element);
5841
5841
  const { elementProps } = useElementProps(props.element);
5842
- console.log(props.element);
5843
5842
  // 元素类名
5844
5843
  const elementClasses = computed(() => [
5845
5844
  'dynamic-element',
@@ -6057,23 +6056,9 @@ __default__.__file = "src/components/WorkRender/PageIndicator.vue";
6057
6056
  function usePageTransition(pages, currentPageId) {
6058
6057
  const deltaY = ref(0);
6059
6058
  const pageTransition = computed(() => {
6060
- const currentPage = pages?.value?.find((page) => page.pageId === currentPageId.value);
6061
- const currentIndex = pages.value.findIndex(page => page.pageId === currentPageId.value);
6062
- const prevIndex = currentIndex - 1;
6063
- const nextIndex = currentIndex + 1;
6064
- // 如果页面有 bgAni 配置,使用其动画效果
6065
- if (currentPage?.bgAni?.aniList?.[0]?.animate) {
6066
- return currentPage.bgAni.aniList[0].animate;
6067
- }
6068
- // 根据滑动方向选择动画
6069
- if (deltaY.value > 0 && prevIndex >= 0) {
6070
- return 'slide-up';
6071
- }
6072
- else if (deltaY.value < 0 && nextIndex < pages.value.length) {
6073
- return 'slide-down';
6074
- }
6075
- // 默认使用页面配置的动画或淡入效果
6076
- return currentPage?.ani || 'fade';
6059
+ if (!deltaY.value)
6060
+ return 'fade';
6061
+ return deltaY.value > 0 ? 'slide-up' : 'slide-down';
6077
6062
  });
6078
6063
  return {
6079
6064
  pageTransition,
@@ -6214,7 +6199,7 @@ var script$f = defineComponent({
6214
6199
  ];
6215
6200
  });
6216
6201
  // 使用组合式函数
6217
- const { pageTransition, deltaY } = usePageTransition(displayPages, currentPageId);
6202
+ const { pageTransition, deltaY } = usePageTransition();
6218
6203
  const { handleTouchStart, handleTouchMove, handleTouchEnd, handleMouseDown, handleMouseMove, handleMouseUp } = useTouchHandler(displayPages, currentPageId, deltaY);
6219
6204
  // 计算属性
6220
6205
  const containerStyle = computed(() => ({
@@ -5846,7 +5846,6 @@
5846
5846
  // 使用组合式函数处理样式和属性
5847
5847
  const { elementStyle } = useElementStyle(props.element);
5848
5848
  const { elementProps } = useElementProps(props.element);
5849
- console.log(props.element);
5850
5849
  // 元素类名
5851
5850
  const elementClasses = vue.computed(() => [
5852
5851
  'dynamic-element',
@@ -6064,23 +6063,9 @@
6064
6063
  function usePageTransition(pages, currentPageId) {
6065
6064
  const deltaY = vue.ref(0);
6066
6065
  const pageTransition = vue.computed(() => {
6067
- const currentPage = pages?.value?.find((page) => page.pageId === currentPageId.value);
6068
- const currentIndex = pages.value.findIndex(page => page.pageId === currentPageId.value);
6069
- const prevIndex = currentIndex - 1;
6070
- const nextIndex = currentIndex + 1;
6071
- // 如果页面有 bgAni 配置,使用其动画效果
6072
- if (currentPage?.bgAni?.aniList?.[0]?.animate) {
6073
- return currentPage.bgAni.aniList[0].animate;
6074
- }
6075
- // 根据滑动方向选择动画
6076
- if (deltaY.value > 0 && prevIndex >= 0) {
6077
- return 'slide-up';
6078
- }
6079
- else if (deltaY.value < 0 && nextIndex < pages.value.length) {
6080
- return 'slide-down';
6081
- }
6082
- // 默认使用页面配置的动画或淡入效果
6083
- return currentPage?.ani || 'fade';
6066
+ if (!deltaY.value)
6067
+ return 'fade';
6068
+ return deltaY.value > 0 ? 'slide-up' : 'slide-down';
6084
6069
  });
6085
6070
  return {
6086
6071
  pageTransition,
@@ -6221,7 +6206,7 @@
6221
6206
  ];
6222
6207
  });
6223
6208
  // 使用组合式函数
6224
- const { pageTransition, deltaY } = usePageTransition(displayPages, currentPageId);
6209
+ const { pageTransition, deltaY } = usePageTransition();
6225
6210
  const { handleTouchStart, handleTouchMove, handleTouchEnd, handleMouseDown, handleMouseMove, handleMouseUp } = useTouchHandler(displayPages, currentPageId, deltaY);
6226
6211
  // 计算属性
6227
6212
  const containerStyle = vue.computed(() => ({
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "unika-components",
3
- "version": "1.0.320",
3
+ "version": "1.0.322",
4
4
  "private": false,
5
+ "description": "Unika Components Library",
5
6
  "main": "dist/unika-components.umd.js",
6
7
  "module": "dist/unika-components.esm.js",
7
8
  "types": "dist/index.d.ts",
8
- "description": "Unika Vue3 components library",
9
9
  "author": "Jim Yu",
10
10
  "license": "MIT",
11
11
  "keywords": [
@@ -17,14 +17,15 @@
17
17
  "dist"
18
18
  ],
19
19
  "scripts": {
20
- "serve": "vue-cli-service serve",
20
+ "dev": "vite",
21
21
  "build": "npm run build:es && npm run build:umd",
22
22
  "lint": "vue-cli-service lint",
23
23
  "build:es": "rollup --config build/rollup.esm.config.js",
24
24
  "build:umd": "rollup --config build/rollup.umd.config.js",
25
25
  "test": "vue-cli-service test:unit",
26
26
  "test:watch": "vue-cli-service test:unit --watch",
27
- "prepublishOnly": "npm run build"
27
+ "prepublishOnly": "npm run build",
28
+ "preview": "vite preview"
28
29
  },
29
30
  "husky": {
30
31
  "hooks": {}
@@ -39,10 +40,11 @@
39
40
  "particles.vue3": "^1.22.0",
40
41
  "swiper-animation": "^1.4.0",
41
42
  "vue-baberrage": "^3.2.4",
42
- "vue-particles": "^1.0.9"
43
+ "vue-particles": "^1.0.9",
44
+ "vue": "^3.2.0"
43
45
  },
44
46
  "peerDependencies": {
45
- "vue": "^3.0.0-0"
47
+ "vue": "^3.2.0"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@fortawesome/fontawesome-svg-core": "^6.4.2",
@@ -58,7 +60,7 @@
58
60
  "@types/node": "^22.13.13",
59
61
  "@typescript-eslint/eslint-plugin": "^4.22.0",
60
62
  "@typescript-eslint/parser": "^4.22.0",
61
- "@vitejs/plugin-vue": "^5.2.3",
63
+ "@vitejs/plugin-vue": "^4.0.0",
62
64
  "@vue/cli-plugin-babel": "~4.5.0",
63
65
  "@vue/cli-plugin-eslint": "~4.5.0",
64
66
  "@vue/cli-plugin-typescript": "^4.5.0",
@@ -79,19 +81,19 @@
79
81
  "eslint-plugin-vue": "^7.0.0-0",
80
82
  "husky": "^4.3.0",
81
83
  "less": "^4.2.0",
82
- "rollup": "^2.28.2",
84
+ "rollup": "^2.79.0",
83
85
  "rollup-plugin-css-only": "^2.1.0",
84
86
  "rollup-plugin-exclude-dependencies-from-bundle": "^1.1.13",
85
- "rollup-plugin-typescript2": "^0.29.0",
86
- "rollup-plugin-vue": "^6.0.0-beta.10",
87
+ "rollup-plugin-typescript2": "^0.31.0",
88
+ "rollup-plugin-vue": "^6.0.0",
87
89
  "style-loader": "^3.3.4",
88
90
  "swiper": "^6.8.4",
89
- "typescript": "^4.0.5",
91
+ "typescript": "^4.9.0",
90
92
  "uuid": "^8.0.0",
91
- "vite": "^6.2.3",
92
- "vue": "^3.4.38",
93
+ "vite": "^4.0.0",
93
94
  "vue-jest": "^5.0.0-alpha.5",
94
95
  "vue3-lottie": "^3.2.0",
95
- "vue3-swiper": "^1.0.0"
96
+ "vue3-swiper": "^1.0.0",
97
+ "terser": "^5.4.0"
96
98
  }
97
99
  }