unika-components 1.0.4 → 1.0.6

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.
@@ -0,0 +1,13 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ [x: string]: any;
3
+ }, {
4
+ styleProps: import("vue").ComputedRef<Pick<any, string>>;
5
+ handleClick: () => void;
6
+ isPlaying: import("vue").Ref<boolean>;
7
+ togglePlay: () => void;
8
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
+ [x: string]: any;
10
+ }>>, {
11
+ [x: string]: any;
12
+ }, {}>;
13
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import UniMusic from './UniMusic.vue';
2
+ export default UniMusic;
@@ -0,0 +1,14 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ [x: string]: any;
3
+ }, {
4
+ styleProps: import("vue").ComputedRef<Pick<any, string>>;
5
+ isPlaying: import("vue").Ref<boolean>;
6
+ showButton: import("vue").Ref<boolean>;
7
+ handleClick: () => void;
8
+ playOrPauseVideo: () => void;
9
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
10
+ [x: string]: any;
11
+ }>>, {
12
+ [x: string]: any;
13
+ }, {}>;
14
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import UniVideo from './UniVideo.vue';
2
+ export default UniVideo;
@@ -167,6 +167,51 @@ export declare const backgroundDefaultProps: {
167
167
  left: string;
168
168
  top: string;
169
169
  };
170
+ export declare const musicDefaultProps: {
171
+ actionType: string;
172
+ url: string;
173
+ height: string;
174
+ width: string;
175
+ paddingLeft: string;
176
+ paddingRight: string;
177
+ paddingTop: string;
178
+ paddingBottom: string;
179
+ borderStyle: string;
180
+ borderColor: string;
181
+ borderWidth: string;
182
+ borderRadius: string;
183
+ boxShadow: string;
184
+ opacity: number;
185
+ position: string;
186
+ left: string;
187
+ top: string;
188
+ right: string;
189
+ musicSrc: string;
190
+ name: string;
191
+ isPlaying: boolean;
192
+ };
193
+ export declare const videoDefaultProps: {
194
+ actionType: string;
195
+ url: string;
196
+ height: string;
197
+ width: string;
198
+ paddingLeft: string;
199
+ paddingRight: string;
200
+ paddingTop: string;
201
+ paddingBottom: string;
202
+ borderStyle: string;
203
+ borderColor: string;
204
+ borderWidth: string;
205
+ borderRadius: string;
206
+ boxShadow: string;
207
+ opacity: number;
208
+ position: string;
209
+ left: string;
210
+ top: string;
211
+ right: string;
212
+ videoSrc: string;
213
+ isPlaying: boolean;
214
+ };
170
215
  export declare const componentsDefaultProps: {
171
216
  'uni-text': {
172
217
  props: {
@@ -259,6 +304,55 @@ export declare const componentsDefaultProps: {
259
304
  top: string;
260
305
  };
261
306
  };
307
+ 'uni-music': {
308
+ props: {
309
+ actionType: string;
310
+ url: string;
311
+ height: string;
312
+ width: string;
313
+ paddingLeft: string;
314
+ paddingRight: string;
315
+ paddingTop: string;
316
+ paddingBottom: string;
317
+ borderStyle: string;
318
+ borderColor: string;
319
+ borderWidth: string;
320
+ borderRadius: string;
321
+ boxShadow: string;
322
+ opacity: number;
323
+ position: string;
324
+ left: string;
325
+ top: string;
326
+ right: string;
327
+ musicSrc: string;
328
+ name: string;
329
+ isPlaying: boolean;
330
+ };
331
+ };
332
+ 'uni-video': {
333
+ props: {
334
+ actionType: string;
335
+ url: string;
336
+ height: string;
337
+ width: string;
338
+ paddingLeft: string;
339
+ paddingRight: string;
340
+ paddingTop: string;
341
+ paddingBottom: string;
342
+ borderStyle: string;
343
+ borderColor: string;
344
+ borderWidth: string;
345
+ borderRadius: string;
346
+ boxShadow: string;
347
+ opacity: number;
348
+ position: string;
349
+ left: string;
350
+ top: string;
351
+ right: string;
352
+ videoSrc: string;
353
+ isPlaying: boolean;
354
+ };
355
+ };
262
356
  };
263
357
  export declare const isEditingProp: {
264
358
  isEditing: {
@@ -5,8 +5,10 @@ import UniShape from './components/UniShape';
5
5
  import LongPage from './components/LongPage';
6
6
  import SwiperPage from './components/SwiperPage';
7
7
  import UniBackground from './components/UniBackground';
8
+ import UniMusic from './components/UniMusic';
9
+ import UniVideo from './components/UniVideo';
8
10
  declare const install: (app: App) => void;
9
- export { UniText, UniImage, UniShape, LongPage, SwiperPage, UniBackground, install };
11
+ export { UniText, UniImage, UniShape, LongPage, SwiperPage, UniBackground, UniMusic, UniVideo, install };
10
12
  declare const _default: {
11
13
  install: (app: App<any>) => void;
12
14
  };
@@ -1,8 +1,4 @@
1
1
 
2
- .uni-image-component {
3
- max-width: 100%;
4
- }
5
-
6
2
  h2.uni-text-component, p.uni-text-component {
7
3
  margin-bottom: 0;
8
4
  }
@@ -38,3 +34,123 @@ button.uni-text-component {
38
34
  position:absolute;
39
35
  z-index:99999999;
40
36
  }
37
+
38
+ .uni-video-component {
39
+ position: relative;
40
+ text-align: center;
41
+ }
42
+ .play-pause-button {
43
+ position: absolute;
44
+ top: 50%;
45
+ left: 50%;
46
+ transform: translate(-50%, -50%);
47
+ cursor: pointer;
48
+ font-size: 2rem;
49
+ color: #fff;
50
+ background: rgba(0, 0, 0, 0.6);
51
+ border-radius: 50%;
52
+ padding: 10px;
53
+ transition: background 0.3s;
54
+ }
55
+ .play-pause-button:hover {
56
+ background: rgba(0, 0, 0, 0.8);
57
+ }
58
+
59
+ #audio {
60
+ position: absolute;
61
+ right: 10px;
62
+ top: 10px;
63
+ z-index: 103;
64
+ width: 30px;
65
+ height: 30px;
66
+ display: -webkit-box;
67
+ display: -ms-flexbox;
68
+ display: flex;
69
+ -webkit-box-align: center;
70
+ -ms-flex-align: center;
71
+ align-items: center;
72
+ }
73
+ #audio .audio {
74
+ width: 100%;
75
+ height: 100%;
76
+ display: -webkit-box;
77
+ display: -ms-flexbox;
78
+ display: flex;
79
+ -webkit-box-align: center;
80
+ -ms-flex-align: center;
81
+ align-items: center;
82
+ -webkit-box-pack: center;
83
+ -ms-flex-pack: center;
84
+ justify-content: center;
85
+ color: #fff;
86
+ background: #666;
87
+ border-radius: 50%;
88
+ overflow: hidden;
89
+ will-change: transform;
90
+ }
91
+ #audio .audio .music-icon {
92
+ display: block;
93
+ width: 100%;
94
+ height: 100%;
95
+ }
96
+ #audio .icon-cancel {
97
+ position: absolute;
98
+ width: 100%;
99
+ height: 100%;
100
+ border-radius: 50%;
101
+ overflow: hidden;
102
+ padding: 14px 0;
103
+ }
104
+ #audio .icon-cancel .icon-h {
105
+ -webkit-transform: rotate(45deg);
106
+ transform: rotate(45deg);
107
+ width: 100%;
108
+ height: 2px;
109
+ background: #fff;
110
+ }
111
+ #audio .mrotate {
112
+ -webkit-animation: mrotate 5s linear infinite;
113
+ animation: mrotate 5s linear infinite;
114
+ }
115
+ .video-play-audio {
116
+ position: absolute;
117
+ left: -9999px;
118
+ top: -9999px;
119
+ width: 0;
120
+ height: 0;
121
+ z-index: -1;
122
+ opacity: 1;
123
+ overflow: hidden;
124
+ }
125
+
126
+ .music-img {
127
+ position: relative;
128
+ display: inline-block;
129
+ width: 100%;
130
+ height: 100%;
131
+ }
132
+
133
+ .uni-music-component {
134
+ }
135
+
136
+ /* 无限旋转 */
137
+ @keyframes mrotate {
138
+ from {
139
+ transform: rotate(0deg);
140
+ }
141
+ to {
142
+ transform: rotate(360deg);
143
+ }
144
+ }
145
+ @-webkit-keyframes mrotate {
146
+ from {
147
+ -webkit-transform: rotate(0deg);
148
+ }
149
+ to {
150
+ -webkit-transform: rotate(360deg);
151
+ }
152
+ }
153
+
154
+ .uni-image-component {
155
+ max-width: 100%;
156
+ }
@@ -1,4 +1,4 @@
1
- import { computed, defineComponent, openBlock, createBlock, resolveDynamicComponent, withModifiers, normalizeStyle, withCtx, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, normalizeProps, guardReactiveProps, resolveComponent, createElementVNode, createVNode, createCommentVNode, pushScopeId, popScopeId } from 'vue';
1
+ import { computed, defineComponent, openBlock, createBlock, resolveDynamicComponent, withModifiers, normalizeStyle, withCtx, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, normalizeProps, guardReactiveProps, resolveComponent, createElementVNode, createVNode, createCommentVNode, pushScopeId, popScopeId, ref, onMounted, normalizeClass } from 'vue';
2
2
 
3
3
  /** Detect free variable `global` from Node.js. */
4
4
  var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
@@ -3437,6 +3437,17 @@ const backgroundDefaultProps = {
3437
3437
  left: '0px',
3438
3438
  top: '0px'
3439
3439
  };
3440
+ const musicDefaultProps = {
3441
+ musicSrc: '',
3442
+ name: '',
3443
+ isPlaying: false,
3444
+ ...commonDefaultProps
3445
+ };
3446
+ const videoDefaultProps = {
3447
+ videoSrc: '',
3448
+ isPlaying: false,
3449
+ ...commonDefaultProps
3450
+ };
3440
3451
  // this contains all default props for all the components
3441
3452
  // useful for inserting new component into the store
3442
3453
  const componentsDefaultProps = {
@@ -3451,6 +3462,12 @@ const componentsDefaultProps = {
3451
3462
  },
3452
3463
  'uni-background': {
3453
3464
  props: backgroundDefaultProps
3465
+ },
3466
+ 'uni-music': {
3467
+ props: musicDefaultProps
3468
+ },
3469
+ 'uni-video': {
3470
+ props: videoDefaultProps
3454
3471
  }
3455
3472
  };
3456
3473
  const isEditingProp = {
@@ -3498,12 +3515,12 @@ const extraProps = {
3498
3515
  },
3499
3516
  ...isEditingProp
3500
3517
  };
3501
- const defaultProps$2 = transformToComponentProps(componentsDefaultProps['uni-text'].props, extraProps);
3518
+ const defaultProps$4 = transformToComponentProps(componentsDefaultProps['uni-text'].props, extraProps);
3502
3519
  // array that contains style props
3503
- var script$5 = defineComponent({
3520
+ var script$7 = defineComponent({
3504
3521
  name: 'uni-text',
3505
3522
  props: {
3506
- ...defaultProps$2
3523
+ ...defaultProps$4
3507
3524
  },
3508
3525
  setup(props) {
3509
3526
  const styleProps = useStylePick(props);
@@ -3515,7 +3532,7 @@ var script$5 = defineComponent({
3515
3532
  }
3516
3533
  });
3517
3534
 
3518
- function render$5(_ctx, _cache, $props, $setup, $data, $options) {
3535
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
3519
3536
  return (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
3520
3537
  onClick: withModifiers(_ctx.handleClick, ["prevent"]),
3521
3538
  style: normalizeStyle(_ctx.styleProps),
@@ -3528,16 +3545,16 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
3528
3545
  }, 8 /* PROPS */, ["onClick", "style"]))
3529
3546
  }
3530
3547
 
3531
- script$5.render = render$5;
3532
- script$5.__scopeId = "data-v-55ed80cb";
3533
- script$5.__file = "src/components/UniText/UniText.vue";
3548
+ script$7.render = render$7;
3549
+ script$7.__scopeId = "data-v-55ed80cb";
3550
+ script$7.__file = "src/components/UniText/UniText.vue";
3534
3551
 
3535
- script$5.install = (app) => {
3536
- app.component(script$5.name, script$5);
3552
+ script$7.install = (app) => {
3553
+ app.component(script$7.name, script$7);
3537
3554
  };
3538
3555
 
3539
3556
  // array that contains style props
3540
- var script$4 = defineComponent({
3557
+ var script$6 = defineComponent({
3541
3558
  name: 'uni-image',
3542
3559
  props: transformToComponentProps(componentsDefaultProps['uni-image'].props, isEditingProp),
3543
3560
  setup(props) {
@@ -3550,32 +3567,32 @@ var script$4 = defineComponent({
3550
3567
  }
3551
3568
  });
3552
3569
 
3553
- const _hoisted_1$3 = ["src"];
3570
+ const _hoisted_1$5 = ["src"];
3554
3571
 
3555
- function render$4(_ctx, _cache, $props, $setup, $data, $options) {
3572
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
3556
3573
  return (openBlock(), createElementBlock("img", {
3557
3574
  src: _ctx.imageSrc,
3558
3575
  style: normalizeStyle(_ctx.styleProps),
3559
3576
  onClick: _cache[0] || (_cache[0] = withModifiers((...args) => (_ctx.handleClick && _ctx.handleClick(...args)), ["prevent"])),
3560
3577
  class: "uni-image-component",
3561
3578
  draggable: false
3562
- }, null, 12 /* STYLE, PROPS */, _hoisted_1$3))
3579
+ }, null, 12 /* STYLE, PROPS */, _hoisted_1$5))
3563
3580
  }
3564
3581
 
3565
- script$4.render = render$4;
3566
- script$4.__scopeId = "data-v-03caca2f";
3567
- script$4.__file = "src/components/UniImage/UniImage.vue";
3582
+ script$6.render = render$6;
3583
+ script$6.__scopeId = "data-v-03caca2f";
3584
+ script$6.__file = "src/components/UniImage/UniImage.vue";
3568
3585
 
3569
- script$4.install = (app) => {
3570
- app.component(script$4.name, script$4);
3586
+ script$6.install = (app) => {
3587
+ app.component(script$6.name, script$6);
3571
3588
  };
3572
3589
 
3573
- const defaultProps$1 = transformToComponentProps(componentsDefaultProps['uni-shape'].props, isEditingProp);
3590
+ const defaultProps$3 = transformToComponentProps(componentsDefaultProps['uni-shape'].props, isEditingProp);
3574
3591
  // array that contains style props
3575
- var script$3 = defineComponent({
3592
+ var script$5 = defineComponent({
3576
3593
  name: 'uni-shape',
3577
3594
  props: {
3578
- ...defaultProps$1
3595
+ ...defaultProps$3
3579
3596
  },
3580
3597
  setup(props) {
3581
3598
  const styleProps = useStylePick(props);
@@ -3587,7 +3604,7 @@ var script$3 = defineComponent({
3587
3604
  }
3588
3605
  });
3589
3606
 
3590
- function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3607
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
3591
3608
  return (openBlock(), createElementBlock("div", {
3592
3609
  onClick: _cache[0] || (_cache[0] = withModifiers((...args) => (_ctx.handleClick && _ctx.handleClick(...args)), ["prevent"])),
3593
3610
  style: normalizeStyle(_ctx.styleProps),
@@ -3596,14 +3613,14 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3596
3613
  }, null, 4 /* STYLE */))
3597
3614
  }
3598
3615
 
3599
- script$3.render = render$3;
3600
- script$3.__file = "src/components/UniShape/UniShape.vue";
3616
+ script$5.render = render$5;
3617
+ script$5.__file = "src/components/UniShape/UniShape.vue";
3601
3618
 
3602
- script$3.install = (app) => {
3603
- app.component(script$3.name, script$3);
3619
+ script$5.install = (app) => {
3620
+ app.component(script$5.name, script$5);
3604
3621
  };
3605
3622
 
3606
- var script$2 = defineComponent({
3623
+ var script$4 = defineComponent({
3607
3624
  name: 'long-page',
3608
3625
  props: {
3609
3626
  work: {
@@ -3616,9 +3633,9 @@ var script$2 = defineComponent({
3616
3633
  }
3617
3634
  });
3618
3635
 
3619
- const _hoisted_1$2 = ["id"];
3636
+ const _hoisted_1$4 = ["id"];
3620
3637
 
3621
- function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3638
+ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
3622
3639
  return (openBlock(), createElementBlock("div", {
3623
3640
  class: "final-page",
3624
3641
  style: normalizeStyle(_ctx.work && {width: _ctx.work.width, height: _ctx.work.height} )
@@ -3629,20 +3646,20 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3629
3646
  id: `component-${item.id}`
3630
3647
  }, [
3631
3648
  (openBlock(), createBlock(resolveDynamicComponent(item.name), normalizeProps(guardReactiveProps(item.props)), null, 16 /* FULL_PROPS */))
3632
- ], 8 /* PROPS */, _hoisted_1$2))
3649
+ ], 8 /* PROPS */, _hoisted_1$4))
3633
3650
  }), 128 /* KEYED_FRAGMENT */))
3634
3651
  ], 4 /* STYLE */))
3635
3652
  }
3636
3653
 
3637
- script$2.render = render$2;
3638
- script$2.__file = "src/components/LongPage/LongPage.vue";
3654
+ script$4.render = render$4;
3655
+ script$4.__file = "src/components/LongPage/LongPage.vue";
3639
3656
 
3640
3657
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3641
- script$2.install = (app) => {
3642
- app.component(script$2.name, script$2);
3658
+ script$4.install = (app) => {
3659
+ app.component(script$4.name, script$4);
3643
3660
  };
3644
3661
 
3645
- var script$1 = defineComponent({
3662
+ var script$3 = defineComponent({
3646
3663
  name: 'swiper-page',
3647
3664
  props: {
3648
3665
  page: {
@@ -3655,16 +3672,16 @@ var script$1 = defineComponent({
3655
3672
  }
3656
3673
  });
3657
3674
 
3658
- const _hoisted_1$1 = { class: "swiper-wrapper" };
3675
+ const _hoisted_1$3 = { class: "swiper-wrapper" };
3659
3676
 
3660
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3677
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3661
3678
  const _component_final_page = resolveComponent("final-page");
3662
3679
 
3663
3680
  return (openBlock(), createElementBlock("div", {
3664
3681
  style: normalizeStyle(_ctx.styleProps),
3665
3682
  class: "swiper-container"
3666
3683
  }, [
3667
- createElementVNode("div", _hoisted_1$1, [
3684
+ createElementVNode("div", _hoisted_1$3, [
3668
3685
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.slides, (slide, index) => {
3669
3686
  return (openBlock(), createElementBlock("div", {
3670
3687
  class: "swiper-slide",
@@ -3679,24 +3696,24 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3679
3696
  ], 4 /* STYLE */))
3680
3697
  }
3681
3698
 
3682
- script$1.render = render$1;
3683
- script$1.__file = "src/components/SwiperPage/SwiperPage.vue";
3699
+ script$3.render = render$3;
3700
+ script$3.__file = "src/components/SwiperPage/SwiperPage.vue";
3684
3701
 
3685
3702
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3686
- script$1.install = (app) => {
3687
- app.component(script$1.name, script$1);
3703
+ script$3.install = (app) => {
3704
+ app.component(script$3.name, script$3);
3688
3705
  };
3689
3706
 
3690
- const defaultProps = transformToComponentProps(componentsDefaultProps['uni-background'].props, isEditingProp);
3707
+ const defaultProps$2 = transformToComponentProps(componentsDefaultProps['uni-background'].props, isEditingProp);
3691
3708
  // array that contains style props
3692
- var script = defineComponent({
3709
+ var script$2 = defineComponent({
3693
3710
  name: 'uni-background',
3694
3711
  props: {
3695
3712
  watermark: {
3696
3713
  type: Boolean,
3697
3714
  default: false
3698
3715
  },
3699
- ...defaultProps
3716
+ ...defaultProps$2
3700
3717
  },
3701
3718
  components: {},
3702
3719
  setup(props) {
@@ -3712,11 +3729,11 @@ var script = defineComponent({
3712
3729
  }
3713
3730
  });
3714
3731
 
3715
- const _withScopeId = n => (pushScopeId("data-v-04e7238d"),n=n(),popScopeId(),n);
3716
- const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("div", { style: {} }, null, -1 /* HOISTED */));
3717
- const _hoisted_2 = ["src"];
3732
+ const _withScopeId$1 = n => (pushScopeId("data-v-04e7238d"),n=n(),popScopeId(),n);
3733
+ const _hoisted_1$2 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("div", { style: {} }, null, -1 /* HOISTED */));
3734
+ const _hoisted_2$2 = ["src"];
3718
3735
 
3719
- function render(_ctx, _cache, $props, $setup, $data, $options) {
3736
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3720
3737
  const _component_a_watermark = resolveComponent("a-watermark");
3721
3738
 
3722
3739
  return (openBlock(), createElementBlock("div", {
@@ -3730,7 +3747,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3730
3747
  class: "watermark"
3731
3748
  }, {
3732
3749
  default: withCtx(() => [
3733
- _hoisted_1
3750
+ _hoisted_1$2
3734
3751
  ]),
3735
3752
  _: 1 /* STABLE */
3736
3753
  }))
@@ -3740,14 +3757,196 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3740
3757
  key: 1,
3741
3758
  src: _ctx.backgroundImage,
3742
3759
  class: "bg-img"
3743
- }, null, 8 /* PROPS */, _hoisted_2))
3760
+ }, null, 8 /* PROPS */, _hoisted_2$2))
3744
3761
  : createCommentVNode("v-if", true)
3745
3762
  ], 4 /* STYLE */))
3746
3763
  }
3747
3764
 
3765
+ script$2.render = render$2;
3766
+ script$2.__scopeId = "data-v-04e7238d";
3767
+ script$2.__file = "src/components/UniBackground/UniBackground.vue";
3768
+
3769
+ script$2.install = (app) => {
3770
+ app.component(script$2.name, script$2);
3771
+ };
3772
+
3773
+ const defaultProps$1 = transformToComponentProps(componentsDefaultProps['uni-music'].props, isEditingProp);
3774
+ // array that contains style props
3775
+ var script$1 = defineComponent({
3776
+ name: 'uni-music',
3777
+ props: {
3778
+ ...defaultProps$1
3779
+ },
3780
+ setup(props) {
3781
+ // 重用并且简化
3782
+ // 抽离并且获得 styleProps
3783
+ const styleProps = useStylePick(props);
3784
+ const handleClick = useComponentClick(props);
3785
+ const isPlaying = ref(false);
3786
+ const audioPlayer = ref(null);
3787
+ const togglePlay = () => {
3788
+ if (!audioPlayer.value)
3789
+ return;
3790
+ isPlaying.value = !isPlaying.value;
3791
+ if (isPlaying.value) {
3792
+ audioPlayer.value && audioPlayer.value.play();
3793
+ }
3794
+ else {
3795
+ audioPlayer.value && audioPlayer.value.pause();
3796
+ }
3797
+ };
3798
+ onMounted(() => {
3799
+ audioPlayer.value = document.querySelector('audio');
3800
+ if (audioPlayer.value && props.isPlaying) {
3801
+ audioPlayer.value.load();
3802
+ audioPlayer.value.play().catch(() => {
3803
+ const playError = ref(true);
3804
+ const event = ['click']; // "touchstart"
3805
+ const pageClick = () => {
3806
+ if (audioPlayer.value && playError.value) {
3807
+ playError.value = false;
3808
+ audioPlayer.value.load();
3809
+ audioPlayer.value.play().catch(() => {
3810
+ playError.value = true;
3811
+ });
3812
+ event.forEach((item) => {
3813
+ document.removeEventListener(item, pageClick);
3814
+ });
3815
+ }
3816
+ };
3817
+ event.forEach((item) => {
3818
+ document.addEventListener(item, pageClick);
3819
+ });
3820
+ });
3821
+ }
3822
+ });
3823
+ return {
3824
+ styleProps,
3825
+ handleClick,
3826
+ isPlaying,
3827
+ togglePlay
3828
+ };
3829
+ }
3830
+ });
3831
+
3832
+ const _withScopeId = n => (pushScopeId("data-v-99922522"),n=n(),popScopeId(),n);
3833
+ const _hoisted_1$1 = {
3834
+ id: "audio",
3835
+ class: "uni-music-component"
3836
+ };
3837
+ const _hoisted_2$1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("img", {
3838
+ src: "https://unika-static-dev.oss-ap-southeast-7.aliyuncs.com/components/music2.png",
3839
+ class: "music-icon"
3840
+ }, null, -1 /* HOISTED */));
3841
+ const _hoisted_3 = { class: "icon-cancel" };
3842
+ const _hoisted_4 = {
3843
+ key: 0,
3844
+ class: "icon-h"
3845
+ };
3846
+ const _hoisted_5 = ["src"];
3847
+
3848
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3849
+ return (openBlock(), createElementBlock("div", {
3850
+ style: normalizeStyle(_ctx.styleProps)
3851
+ }, [
3852
+ createElementVNode("div", _hoisted_1$1, [
3853
+ createElementVNode("div", {
3854
+ class: normalizeClass({ mrotate: _ctx.isPlaying, audio: true }),
3855
+ onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.togglePlay && _ctx.togglePlay(...args)))
3856
+ }, [
3857
+ _hoisted_2$1,
3858
+ createElementVNode("div", _hoisted_3, [
3859
+ (!_ctx.isPlaying)
3860
+ ? (openBlock(), createElementBlock("div", _hoisted_4))
3861
+ : createCommentVNode("v-if", true)
3862
+ ])
3863
+ ], 2 /* CLASS */),
3864
+ createElementVNode("audio", {
3865
+ style: {"display":"none"},
3866
+ ref: "audioPlayer",
3867
+ src: _ctx.musicSrc,
3868
+ autoplay: "",
3869
+ controls: "",
3870
+ loop: "",
3871
+ preload: "auto"
3872
+ }, null, 8 /* PROPS */, _hoisted_5)
3873
+ ])
3874
+ ], 4 /* STYLE */))
3875
+ }
3876
+
3877
+ script$1.render = render$1;
3878
+ script$1.__scopeId = "data-v-99922522";
3879
+ script$1.__file = "src/components/UniMusic/UniMusic.vue";
3880
+
3881
+ script$1.install = (app) => {
3882
+ app.component(script$1.name, script$1);
3883
+ };
3884
+
3885
+ const defaultProps = transformToComponentProps(componentsDefaultProps['uni-video'].props, isEditingProp);
3886
+ // array that contains style props
3887
+ var script = defineComponent({
3888
+ name: 'uni-video',
3889
+ props: {
3890
+ ...defaultProps
3891
+ },
3892
+ components: {
3893
+ // FontAwesomeIcon
3894
+ },
3895
+ setup(props) {
3896
+ // 重用并且简化
3897
+ // 抽离并且获得 styleProps
3898
+ const styleProps = useStylePick(props);
3899
+ const handleClick = useComponentClick(props);
3900
+ const showButton = ref(true);
3901
+ const isPlaying = ref(false);
3902
+ const videoPlayer = ref(null);
3903
+ const playOrPauseVideo = () => {
3904
+ if (isPlaying.value) {
3905
+ videoPlayer.value && videoPlayer.value.pause();
3906
+ showButton.value = true;
3907
+ }
3908
+ else {
3909
+ videoPlayer.value && videoPlayer.value.play();
3910
+ setTimeout(() => {
3911
+ showButton.value = false; // 几秒后隐藏按钮
3912
+ }, 2000);
3913
+ }
3914
+ isPlaying.value = !isPlaying.value;
3915
+ };
3916
+ return {
3917
+ styleProps,
3918
+ isPlaying,
3919
+ showButton,
3920
+ handleClick,
3921
+ playOrPauseVideo
3922
+ };
3923
+ }
3924
+ });
3925
+
3926
+ const _hoisted_1 = {
3927
+ ref: "videoPlayer",
3928
+ controls: "",
3929
+ style: {"width":"100%","height":"100%"}
3930
+ };
3931
+ const _hoisted_2 = ["src"];
3932
+
3933
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
3934
+ return (openBlock(), createElementBlock("div", {
3935
+ style: normalizeStyle(_ctx.styleProps),
3936
+ class: "uni-video-component"
3937
+ }, [
3938
+ createElementVNode("video", _hoisted_1, [
3939
+ createElementVNode("source", {
3940
+ src: _ctx.videoSrc,
3941
+ type: "video/mp4"
3942
+ }, null, 8 /* PROPS */, _hoisted_2)
3943
+ ], 512 /* NEED_PATCH */)
3944
+ ], 4 /* STYLE */))
3945
+ }
3946
+
3748
3947
  script.render = render;
3749
- script.__scopeId = "data-v-04e7238d";
3750
- script.__file = "src/components/UniBackground/UniBackground.vue";
3948
+ script.__scopeId = "data-v-03ff4e2f";
3949
+ script.__file = "src/components/UniVideo/UniVideo.vue";
3751
3950
 
3752
3951
  script.install = (app) => {
3753
3952
  app.component(script.name, script);
@@ -3755,12 +3954,14 @@ script.install = (app) => {
3755
3954
 
3756
3955
  // export { textDefaultProps , textStylePropNames, TextComponentProps,
3757
3956
  const components = [
3957
+ script$7,
3958
+ script$6,
3758
3959
  script$5,
3759
3960
  script$4,
3760
3961
  script$3,
3761
3962
  script$2,
3762
3963
  script$1,
3763
- script
3964
+ script,
3764
3965
  ];
3765
3966
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
3766
3967
  const install = (app) => {
@@ -3772,4 +3973,4 @@ var index = {
3772
3973
  install
3773
3974
  };
3774
3975
 
3775
- export { script$2 as LongPage, script$1 as SwiperPage, script as UniBackground, script$4 as UniImage, script$3 as UniShape, script$5 as UniText, index as default, install };
3976
+ export { script$4 as LongPage, script$3 as SwiperPage, script$2 as UniBackground, script$6 as UniImage, script$1 as UniMusic, script$5 as UniShape, script$7 as UniText, script as UniVideo, index as default, install };
@@ -3441,6 +3441,17 @@
3441
3441
  left: '0px',
3442
3442
  top: '0px'
3443
3443
  };
3444
+ const musicDefaultProps = {
3445
+ musicSrc: '',
3446
+ name: '',
3447
+ isPlaying: false,
3448
+ ...commonDefaultProps
3449
+ };
3450
+ const videoDefaultProps = {
3451
+ videoSrc: '',
3452
+ isPlaying: false,
3453
+ ...commonDefaultProps
3454
+ };
3444
3455
  // this contains all default props for all the components
3445
3456
  // useful for inserting new component into the store
3446
3457
  const componentsDefaultProps = {
@@ -3455,6 +3466,12 @@
3455
3466
  },
3456
3467
  'uni-background': {
3457
3468
  props: backgroundDefaultProps
3469
+ },
3470
+ 'uni-music': {
3471
+ props: musicDefaultProps
3472
+ },
3473
+ 'uni-video': {
3474
+ props: videoDefaultProps
3458
3475
  }
3459
3476
  };
3460
3477
  const isEditingProp = {
@@ -3502,12 +3519,12 @@
3502
3519
  },
3503
3520
  ...isEditingProp
3504
3521
  };
3505
- const defaultProps$2 = transformToComponentProps(componentsDefaultProps['uni-text'].props, extraProps);
3522
+ const defaultProps$4 = transformToComponentProps(componentsDefaultProps['uni-text'].props, extraProps);
3506
3523
  // array that contains style props
3507
- var script$5 = vue.defineComponent({
3524
+ var script$7 = vue.defineComponent({
3508
3525
  name: 'uni-text',
3509
3526
  props: {
3510
- ...defaultProps$2
3527
+ ...defaultProps$4
3511
3528
  },
3512
3529
  setup(props) {
3513
3530
  const styleProps = useStylePick(props);
@@ -3519,7 +3536,7 @@
3519
3536
  }
3520
3537
  });
3521
3538
 
3522
- function render$5(_ctx, _cache, $props, $setup, $data, $options) {
3539
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
3523
3540
  return (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
3524
3541
  onClick: vue.withModifiers(_ctx.handleClick, ["prevent"]),
3525
3542
  style: vue.normalizeStyle(_ctx.styleProps),
@@ -3532,16 +3549,16 @@
3532
3549
  }, 8 /* PROPS */, ["onClick", "style"]))
3533
3550
  }
3534
3551
 
3535
- script$5.render = render$5;
3536
- script$5.__scopeId = "data-v-55ed80cb";
3537
- script$5.__file = "src/components/UniText/UniText.vue";
3552
+ script$7.render = render$7;
3553
+ script$7.__scopeId = "data-v-55ed80cb";
3554
+ script$7.__file = "src/components/UniText/UniText.vue";
3538
3555
 
3539
- script$5.install = (app) => {
3540
- app.component(script$5.name, script$5);
3556
+ script$7.install = (app) => {
3557
+ app.component(script$7.name, script$7);
3541
3558
  };
3542
3559
 
3543
3560
  // array that contains style props
3544
- var script$4 = vue.defineComponent({
3561
+ var script$6 = vue.defineComponent({
3545
3562
  name: 'uni-image',
3546
3563
  props: transformToComponentProps(componentsDefaultProps['uni-image'].props, isEditingProp),
3547
3564
  setup(props) {
@@ -3554,32 +3571,32 @@
3554
3571
  }
3555
3572
  });
3556
3573
 
3557
- const _hoisted_1$3 = ["src"];
3574
+ const _hoisted_1$5 = ["src"];
3558
3575
 
3559
- function render$4(_ctx, _cache, $props, $setup, $data, $options) {
3576
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
3560
3577
  return (vue.openBlock(), vue.createElementBlock("img", {
3561
3578
  src: _ctx.imageSrc,
3562
3579
  style: vue.normalizeStyle(_ctx.styleProps),
3563
3580
  onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => (_ctx.handleClick && _ctx.handleClick(...args)), ["prevent"])),
3564
3581
  class: "uni-image-component",
3565
3582
  draggable: false
3566
- }, null, 12 /* STYLE, PROPS */, _hoisted_1$3))
3583
+ }, null, 12 /* STYLE, PROPS */, _hoisted_1$5))
3567
3584
  }
3568
3585
 
3569
- script$4.render = render$4;
3570
- script$4.__scopeId = "data-v-03caca2f";
3571
- script$4.__file = "src/components/UniImage/UniImage.vue";
3586
+ script$6.render = render$6;
3587
+ script$6.__scopeId = "data-v-03caca2f";
3588
+ script$6.__file = "src/components/UniImage/UniImage.vue";
3572
3589
 
3573
- script$4.install = (app) => {
3574
- app.component(script$4.name, script$4);
3590
+ script$6.install = (app) => {
3591
+ app.component(script$6.name, script$6);
3575
3592
  };
3576
3593
 
3577
- const defaultProps$1 = transformToComponentProps(componentsDefaultProps['uni-shape'].props, isEditingProp);
3594
+ const defaultProps$3 = transformToComponentProps(componentsDefaultProps['uni-shape'].props, isEditingProp);
3578
3595
  // array that contains style props
3579
- var script$3 = vue.defineComponent({
3596
+ var script$5 = vue.defineComponent({
3580
3597
  name: 'uni-shape',
3581
3598
  props: {
3582
- ...defaultProps$1
3599
+ ...defaultProps$3
3583
3600
  },
3584
3601
  setup(props) {
3585
3602
  const styleProps = useStylePick(props);
@@ -3591,7 +3608,7 @@
3591
3608
  }
3592
3609
  });
3593
3610
 
3594
- function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3611
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
3595
3612
  return (vue.openBlock(), vue.createElementBlock("div", {
3596
3613
  onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => (_ctx.handleClick && _ctx.handleClick(...args)), ["prevent"])),
3597
3614
  style: vue.normalizeStyle(_ctx.styleProps),
@@ -3600,14 +3617,14 @@
3600
3617
  }, null, 4 /* STYLE */))
3601
3618
  }
3602
3619
 
3603
- script$3.render = render$3;
3604
- script$3.__file = "src/components/UniShape/UniShape.vue";
3620
+ script$5.render = render$5;
3621
+ script$5.__file = "src/components/UniShape/UniShape.vue";
3605
3622
 
3606
- script$3.install = (app) => {
3607
- app.component(script$3.name, script$3);
3623
+ script$5.install = (app) => {
3624
+ app.component(script$5.name, script$5);
3608
3625
  };
3609
3626
 
3610
- var script$2 = vue.defineComponent({
3627
+ var script$4 = vue.defineComponent({
3611
3628
  name: 'long-page',
3612
3629
  props: {
3613
3630
  work: {
@@ -3620,9 +3637,9 @@
3620
3637
  }
3621
3638
  });
3622
3639
 
3623
- const _hoisted_1$2 = ["id"];
3640
+ const _hoisted_1$4 = ["id"];
3624
3641
 
3625
- function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3642
+ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
3626
3643
  return (vue.openBlock(), vue.createElementBlock("div", {
3627
3644
  class: "final-page",
3628
3645
  style: vue.normalizeStyle(_ctx.work && {width: _ctx.work.width, height: _ctx.work.height} )
@@ -3633,20 +3650,20 @@
3633
3650
  id: `component-${item.id}`
3634
3651
  }, [
3635
3652
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.name), vue.normalizeProps(vue.guardReactiveProps(item.props)), null, 16 /* FULL_PROPS */))
3636
- ], 8 /* PROPS */, _hoisted_1$2))
3653
+ ], 8 /* PROPS */, _hoisted_1$4))
3637
3654
  }), 128 /* KEYED_FRAGMENT */))
3638
3655
  ], 4 /* STYLE */))
3639
3656
  }
3640
3657
 
3641
- script$2.render = render$2;
3642
- script$2.__file = "src/components/LongPage/LongPage.vue";
3658
+ script$4.render = render$4;
3659
+ script$4.__file = "src/components/LongPage/LongPage.vue";
3643
3660
 
3644
3661
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3645
- script$2.install = (app) => {
3646
- app.component(script$2.name, script$2);
3662
+ script$4.install = (app) => {
3663
+ app.component(script$4.name, script$4);
3647
3664
  };
3648
3665
 
3649
- var script$1 = vue.defineComponent({
3666
+ var script$3 = vue.defineComponent({
3650
3667
  name: 'swiper-page',
3651
3668
  props: {
3652
3669
  page: {
@@ -3659,16 +3676,16 @@
3659
3676
  }
3660
3677
  });
3661
3678
 
3662
- const _hoisted_1$1 = { class: "swiper-wrapper" };
3679
+ const _hoisted_1$3 = { class: "swiper-wrapper" };
3663
3680
 
3664
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3681
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3665
3682
  const _component_final_page = vue.resolveComponent("final-page");
3666
3683
 
3667
3684
  return (vue.openBlock(), vue.createElementBlock("div", {
3668
3685
  style: vue.normalizeStyle(_ctx.styleProps),
3669
3686
  class: "swiper-container"
3670
3687
  }, [
3671
- vue.createElementVNode("div", _hoisted_1$1, [
3688
+ vue.createElementVNode("div", _hoisted_1$3, [
3672
3689
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.slides, (slide, index) => {
3673
3690
  return (vue.openBlock(), vue.createElementBlock("div", {
3674
3691
  class: "swiper-slide",
@@ -3683,24 +3700,24 @@
3683
3700
  ], 4 /* STYLE */))
3684
3701
  }
3685
3702
 
3686
- script$1.render = render$1;
3687
- script$1.__file = "src/components/SwiperPage/SwiperPage.vue";
3703
+ script$3.render = render$3;
3704
+ script$3.__file = "src/components/SwiperPage/SwiperPage.vue";
3688
3705
 
3689
3706
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3690
- script$1.install = (app) => {
3691
- app.component(script$1.name, script$1);
3707
+ script$3.install = (app) => {
3708
+ app.component(script$3.name, script$3);
3692
3709
  };
3693
3710
 
3694
- const defaultProps = transformToComponentProps(componentsDefaultProps['uni-background'].props, isEditingProp);
3711
+ const defaultProps$2 = transformToComponentProps(componentsDefaultProps['uni-background'].props, isEditingProp);
3695
3712
  // array that contains style props
3696
- var script = vue.defineComponent({
3713
+ var script$2 = vue.defineComponent({
3697
3714
  name: 'uni-background',
3698
3715
  props: {
3699
3716
  watermark: {
3700
3717
  type: Boolean,
3701
3718
  default: false
3702
3719
  },
3703
- ...defaultProps
3720
+ ...defaultProps$2
3704
3721
  },
3705
3722
  components: {},
3706
3723
  setup(props) {
@@ -3716,11 +3733,11 @@
3716
3733
  }
3717
3734
  });
3718
3735
 
3719
- const _withScopeId = n => (vue.pushScopeId("data-v-04e7238d"),n=n(),vue.popScopeId(),n);
3720
- const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("div", { style: {} }, null, -1 /* HOISTED */));
3721
- const _hoisted_2 = ["src"];
3736
+ const _withScopeId$1 = n => (vue.pushScopeId("data-v-04e7238d"),n=n(),vue.popScopeId(),n);
3737
+ const _hoisted_1$2 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/vue.createElementVNode("div", { style: {} }, null, -1 /* HOISTED */));
3738
+ const _hoisted_2$2 = ["src"];
3722
3739
 
3723
- function render(_ctx, _cache, $props, $setup, $data, $options) {
3740
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3724
3741
  const _component_a_watermark = vue.resolveComponent("a-watermark");
3725
3742
 
3726
3743
  return (vue.openBlock(), vue.createElementBlock("div", {
@@ -3734,7 +3751,7 @@
3734
3751
  class: "watermark"
3735
3752
  }, {
3736
3753
  default: vue.withCtx(() => [
3737
- _hoisted_1
3754
+ _hoisted_1$2
3738
3755
  ]),
3739
3756
  _: 1 /* STABLE */
3740
3757
  }))
@@ -3744,14 +3761,196 @@
3744
3761
  key: 1,
3745
3762
  src: _ctx.backgroundImage,
3746
3763
  class: "bg-img"
3747
- }, null, 8 /* PROPS */, _hoisted_2))
3764
+ }, null, 8 /* PROPS */, _hoisted_2$2))
3748
3765
  : vue.createCommentVNode("v-if", true)
3749
3766
  ], 4 /* STYLE */))
3750
3767
  }
3751
3768
 
3769
+ script$2.render = render$2;
3770
+ script$2.__scopeId = "data-v-04e7238d";
3771
+ script$2.__file = "src/components/UniBackground/UniBackground.vue";
3772
+
3773
+ script$2.install = (app) => {
3774
+ app.component(script$2.name, script$2);
3775
+ };
3776
+
3777
+ const defaultProps$1 = transformToComponentProps(componentsDefaultProps['uni-music'].props, isEditingProp);
3778
+ // array that contains style props
3779
+ var script$1 = vue.defineComponent({
3780
+ name: 'uni-music',
3781
+ props: {
3782
+ ...defaultProps$1
3783
+ },
3784
+ setup(props) {
3785
+ // 重用并且简化
3786
+ // 抽离并且获得 styleProps
3787
+ const styleProps = useStylePick(props);
3788
+ const handleClick = useComponentClick(props);
3789
+ const isPlaying = vue.ref(false);
3790
+ const audioPlayer = vue.ref(null);
3791
+ const togglePlay = () => {
3792
+ if (!audioPlayer.value)
3793
+ return;
3794
+ isPlaying.value = !isPlaying.value;
3795
+ if (isPlaying.value) {
3796
+ audioPlayer.value && audioPlayer.value.play();
3797
+ }
3798
+ else {
3799
+ audioPlayer.value && audioPlayer.value.pause();
3800
+ }
3801
+ };
3802
+ vue.onMounted(() => {
3803
+ audioPlayer.value = document.querySelector('audio');
3804
+ if (audioPlayer.value && props.isPlaying) {
3805
+ audioPlayer.value.load();
3806
+ audioPlayer.value.play().catch(() => {
3807
+ const playError = vue.ref(true);
3808
+ const event = ['click']; // "touchstart"
3809
+ const pageClick = () => {
3810
+ if (audioPlayer.value && playError.value) {
3811
+ playError.value = false;
3812
+ audioPlayer.value.load();
3813
+ audioPlayer.value.play().catch(() => {
3814
+ playError.value = true;
3815
+ });
3816
+ event.forEach((item) => {
3817
+ document.removeEventListener(item, pageClick);
3818
+ });
3819
+ }
3820
+ };
3821
+ event.forEach((item) => {
3822
+ document.addEventListener(item, pageClick);
3823
+ });
3824
+ });
3825
+ }
3826
+ });
3827
+ return {
3828
+ styleProps,
3829
+ handleClick,
3830
+ isPlaying,
3831
+ togglePlay
3832
+ };
3833
+ }
3834
+ });
3835
+
3836
+ const _withScopeId = n => (vue.pushScopeId("data-v-99922522"),n=n(),vue.popScopeId(),n);
3837
+ const _hoisted_1$1 = {
3838
+ id: "audio",
3839
+ class: "uni-music-component"
3840
+ };
3841
+ const _hoisted_2$1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("img", {
3842
+ src: "https://unika-static-dev.oss-ap-southeast-7.aliyuncs.com/components/music2.png",
3843
+ class: "music-icon"
3844
+ }, null, -1 /* HOISTED */));
3845
+ const _hoisted_3 = { class: "icon-cancel" };
3846
+ const _hoisted_4 = {
3847
+ key: 0,
3848
+ class: "icon-h"
3849
+ };
3850
+ const _hoisted_5 = ["src"];
3851
+
3852
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3853
+ return (vue.openBlock(), vue.createElementBlock("div", {
3854
+ style: vue.normalizeStyle(_ctx.styleProps)
3855
+ }, [
3856
+ vue.createElementVNode("div", _hoisted_1$1, [
3857
+ vue.createElementVNode("div", {
3858
+ class: vue.normalizeClass({ mrotate: _ctx.isPlaying, audio: true }),
3859
+ onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.togglePlay && _ctx.togglePlay(...args)))
3860
+ }, [
3861
+ _hoisted_2$1,
3862
+ vue.createElementVNode("div", _hoisted_3, [
3863
+ (!_ctx.isPlaying)
3864
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4))
3865
+ : vue.createCommentVNode("v-if", true)
3866
+ ])
3867
+ ], 2 /* CLASS */),
3868
+ vue.createElementVNode("audio", {
3869
+ style: {"display":"none"},
3870
+ ref: "audioPlayer",
3871
+ src: _ctx.musicSrc,
3872
+ autoplay: "",
3873
+ controls: "",
3874
+ loop: "",
3875
+ preload: "auto"
3876
+ }, null, 8 /* PROPS */, _hoisted_5)
3877
+ ])
3878
+ ], 4 /* STYLE */))
3879
+ }
3880
+
3881
+ script$1.render = render$1;
3882
+ script$1.__scopeId = "data-v-99922522";
3883
+ script$1.__file = "src/components/UniMusic/UniMusic.vue";
3884
+
3885
+ script$1.install = (app) => {
3886
+ app.component(script$1.name, script$1);
3887
+ };
3888
+
3889
+ const defaultProps = transformToComponentProps(componentsDefaultProps['uni-video'].props, isEditingProp);
3890
+ // array that contains style props
3891
+ var script = vue.defineComponent({
3892
+ name: 'uni-video',
3893
+ props: {
3894
+ ...defaultProps
3895
+ },
3896
+ components: {
3897
+ // FontAwesomeIcon
3898
+ },
3899
+ setup(props) {
3900
+ // 重用并且简化
3901
+ // 抽离并且获得 styleProps
3902
+ const styleProps = useStylePick(props);
3903
+ const handleClick = useComponentClick(props);
3904
+ const showButton = vue.ref(true);
3905
+ const isPlaying = vue.ref(false);
3906
+ const videoPlayer = vue.ref(null);
3907
+ const playOrPauseVideo = () => {
3908
+ if (isPlaying.value) {
3909
+ videoPlayer.value && videoPlayer.value.pause();
3910
+ showButton.value = true;
3911
+ }
3912
+ else {
3913
+ videoPlayer.value && videoPlayer.value.play();
3914
+ setTimeout(() => {
3915
+ showButton.value = false; // 几秒后隐藏按钮
3916
+ }, 2000);
3917
+ }
3918
+ isPlaying.value = !isPlaying.value;
3919
+ };
3920
+ return {
3921
+ styleProps,
3922
+ isPlaying,
3923
+ showButton,
3924
+ handleClick,
3925
+ playOrPauseVideo
3926
+ };
3927
+ }
3928
+ });
3929
+
3930
+ const _hoisted_1 = {
3931
+ ref: "videoPlayer",
3932
+ controls: "",
3933
+ style: {"width":"100%","height":"100%"}
3934
+ };
3935
+ const _hoisted_2 = ["src"];
3936
+
3937
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
3938
+ return (vue.openBlock(), vue.createElementBlock("div", {
3939
+ style: vue.normalizeStyle(_ctx.styleProps),
3940
+ class: "uni-video-component"
3941
+ }, [
3942
+ vue.createElementVNode("video", _hoisted_1, [
3943
+ vue.createElementVNode("source", {
3944
+ src: _ctx.videoSrc,
3945
+ type: "video/mp4"
3946
+ }, null, 8 /* PROPS */, _hoisted_2)
3947
+ ], 512 /* NEED_PATCH */)
3948
+ ], 4 /* STYLE */))
3949
+ }
3950
+
3752
3951
  script.render = render;
3753
- script.__scopeId = "data-v-04e7238d";
3754
- script.__file = "src/components/UniBackground/UniBackground.vue";
3952
+ script.__scopeId = "data-v-03ff4e2f";
3953
+ script.__file = "src/components/UniVideo/UniVideo.vue";
3755
3954
 
3756
3955
  script.install = (app) => {
3757
3956
  app.component(script.name, script);
@@ -3759,12 +3958,14 @@
3759
3958
 
3760
3959
  // export { textDefaultProps , textStylePropNames, TextComponentProps,
3761
3960
  const components = [
3961
+ script$7,
3962
+ script$6,
3762
3963
  script$5,
3763
3964
  script$4,
3764
3965
  script$3,
3765
3966
  script$2,
3766
3967
  script$1,
3767
- script
3968
+ script,
3768
3969
  ];
3769
3970
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
3770
3971
  const install = (app) => {
@@ -3776,12 +3977,14 @@
3776
3977
  install
3777
3978
  };
3778
3979
 
3779
- exports.LongPage = script$2;
3780
- exports.SwiperPage = script$1;
3781
- exports.UniBackground = script;
3782
- exports.UniImage = script$4;
3783
- exports.UniShape = script$3;
3784
- exports.UniText = script$5;
3980
+ exports.LongPage = script$4;
3981
+ exports.SwiperPage = script$3;
3982
+ exports.UniBackground = script$2;
3983
+ exports.UniImage = script$6;
3984
+ exports.UniMusic = script$1;
3985
+ exports.UniShape = script$5;
3986
+ exports.UniText = script$7;
3987
+ exports.UniVideo = script;
3785
3988
  exports["default"] = index;
3786
3989
  exports.install = install;
3787
3990
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unika-components",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "private": false,
5
5
  "main": "dist/unika-components.umd.js",
6
6
  "module": "dist/unika-components.esm.js",
@@ -41,6 +41,10 @@
41
41
  "@rollup/plugin-commonjs": "^15.1.0",
42
42
  "@rollup/plugin-node-resolve": "^9.0.0",
43
43
  "@rollup/plugin-typescript": "^6.1.0",
44
+ "@fortawesome/fontawesome-svg-core": "^6.4.2",
45
+ "@fortawesome/free-regular-svg-icons": "^6.4.2",
46
+ "@fortawesome/free-solid-svg-icons": "^6.4.2",
47
+ "@fortawesome/vue-fontawesome": "^3.0.0-5",
44
48
  "@types/jest": "^26.0.15",
45
49
  "@types/lodash-es": "^4.17.3",
46
50
  "@typescript-eslint/eslint-plugin": "^4.22.0",
@@ -67,4 +71,4 @@
67
71
  "vue": "^3.0.0-0",
68
72
  "vue-jest": "^5.0.0-alpha.5"
69
73
  }
70
- }
74
+ }