zz-shopify-components 0.25.1-beta.4 → 0.25.1-beta.5

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.
@@ -171,6 +171,13 @@
171
171
  "info": "非全屏展示时有效",
172
172
  "visible_if": "{{ block.settings.pc_full_width == false }}"
173
173
  },
174
+ {
175
+ "type": "number",
176
+ "id": "pc_padding_x",
177
+ "label": "PC端左右内边距",
178
+ "default": 0,
179
+ "info": "单位:px"
180
+ },
174
181
  {
175
182
  "type": "number",
176
183
  "id": "pc_fixed_height",
@@ -185,6 +192,16 @@
185
192
  "default": 0,
186
193
  "info": "默认自适应高度,单位:px",
187
194
  },
195
+ {
196
+ "type": "range",
197
+ "id": "pc_border_radius",
198
+ "min": 0,
199
+ "max": 50,
200
+ "step": 1,
201
+ "unit": "px",
202
+ "label": "PC端圆角大小",
203
+ "default": 0
204
+ },
188
205
  {
189
206
  "type": "header",
190
207
  "content": "📱 移动端布局设置"
@@ -251,6 +268,16 @@
251
268
  "label": "移动端底部内边距 (px)",
252
269
  "default": 0
253
270
  },
271
+ {
272
+ "type": "range",
273
+ "id": "mobile_border_radius",
274
+ "min": 0,
275
+ "max": 50,
276
+ "step": 1,
277
+ "unit": "px",
278
+ "label": "移动端圆角大小",
279
+ "default": 0
280
+ },
254
281
  {
255
282
  "type": "header",
256
283
  "content": "动画设置"
@@ -281,6 +308,10 @@
281
308
  ],
282
309
  "default": "none-animation"
283
310
  },
311
+ {
312
+ "type": "header",
313
+ "content": "特殊设置"
314
+ },
284
315
  {
285
316
  "type": "checkbox",
286
317
  "id": "has_link",
@@ -333,7 +364,24 @@
333
364
  "id": "overflow_x_hidden",
334
365
  "label": "是否禁止横轴移动",
335
366
  "default": true
336
- }
367
+ },
368
+ {
369
+ "type": "header",
370
+ "content": "统计相关"
371
+ },
372
+ {
373
+ "type": "text",
374
+ "id": "module_id",
375
+ "label": "唯一业务id",
376
+ "info": "需要唯一不要与其他模块重复,用户定位、埋点统计、代码隐藏控制等"
377
+ },
378
+ {
379
+ "type": "checkbox",
380
+ "id": "is_exposure",
381
+ "label": "是否曝光统计",
382
+ "default": false,
383
+ "info": "勾选后会对Block模块进行曝光统计埋点, 必须填写唯一业务id"
384
+ },
337
385
 
338
386
  ],
339
387
  "blocks": [
@@ -456,11 +504,22 @@
456
504
  padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
457
505
  padding-left: {{ block.settings.mobile_padding_x }}px;
458
506
  padding-right: {{ block.settings.mobile_padding_x }}px;
507
+ border-radius: {{ block.settings.mobile_border_radius }}px;
459
508
  {% if block.settings.has_link %}
460
509
  cursor: pointer;
461
510
  {% endif %}
462
511
  }
463
512
 
513
+ {% if block.settings.mobile_border_radius != 0 %}
514
+ #shopify-block-{{ block.id }} .flex-layout-image {
515
+ border-radius: {{ block.settings.mobile_border_radius }}px;
516
+ }
517
+ #shopify-block-{{ block.id }} .flex-layout-video {
518
+ border-radius: {{ block.settings.mobile_border_radius }}px;
519
+ }
520
+ {% endif %}
521
+
522
+
464
523
  @media (min-width: 1024px) {
465
524
  #shopify-block-{{ block.id }} .bg-responsive-block-layout {
466
525
  flex-direction: {{ block.settings.pc_direction }};
@@ -469,11 +528,11 @@
469
528
  gap: {{ block.settings.pc_gap }}px;
470
529
  padding-top: {{ block.settings.pc_padding_top }}px;
471
530
  padding-bottom: {{ block.settings.pc_padding_bottom }}px;
472
- margin-top: {{ block.settings.pc_margin_top }}px;
531
+ padding-left: {{ block.settings.pc_padding_x }}px;
532
+ padding-right: {{ block.settings.pc_padding_x }}px;
533
+ border-radius: {{ block.settings.pc_border_radius }}px;
534
+ margin-top: {{ block.settings.pc_margin_top }}px;
473
535
  margin-bottom: {{ block.settings.pc_margin_bottom }}px;
474
- padding-left: 0px;
475
- padding-right: 0px;
476
-
477
536
  {% if block.settings.pc_full_width %}
478
537
  width: 100%;
479
538
  {% else %}
@@ -491,6 +550,15 @@
491
550
  object-fit: cover;
492
551
  }
493
552
  {% endif %}
553
+
554
+ {% if block.settings.pc_border_radius != 0 %}
555
+ #shopify-block-{{ block.id }} .flex-layout-image {
556
+ border-radius: {{ block.settings.pc_border_radius }}px;
557
+ }
558
+ #shopify-block-{{ block.id }} .flex-layout-video {
559
+ border-radius: {{ block.settings.pc_border_radius }}px;
560
+ }
561
+ {% endif %}
494
562
  }
495
563
 
496
564
  @media (min-width: 1280px) {
@@ -574,7 +642,14 @@
574
642
 
575
643
  {% assign layout_class = 'bg-layout' | append: block.id %}
576
644
 
577
- <div class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
645
+ <div
646
+ {% if block.settings.module_id != blank %}
647
+ data-track-zz-block="{{ block.settings.module_id }}"
648
+ {% endif %}
649
+ {% if block.settings.is_exposure != false %}
650
+ data-track-zz-exposure="true"
651
+ {% endif %}
652
+ class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
578
653
 
579
654
  {% content_for 'blocks' %}
580
655
  </div>
@@ -563,7 +563,7 @@
563
563
  {% endif %}
564
564
  {% if block.settings.offset_top_mobile != blank %}
565
565
  position: relative;
566
- top: -{{ block.settings.offset_top_mobile }}px;
566
+ margin-top: -{{ block.settings.offset_top_mobile }}px;
567
567
 
568
568
  {% endif %}
569
569
 
@@ -229,10 +229,12 @@
229
229
  ],
230
230
  "presets": [
231
231
  {
232
- "name": "Video Swiper Preview Item"
232
+ "name": "Video Swiper Preview Item",
233
+ "category": "Swiper Block"
233
234
  },
234
235
  {
235
- "name": "可预览轮播图-Item"
236
+ "name": "可预览轮播图-Item",
237
+ "category": "Swiper Block"
236
238
  }
237
239
  ]
238
240
  }
@@ -362,32 +362,6 @@
362
362
  observer.observe(swiperWrapper);
363
363
  }
364
364
 
365
- function getVisibleDisplayMedias(container) {
366
- const videos = container.querySelectorAll('video');
367
- const video = Array.from(videos).find((video) => {
368
- const style = window.getComputedStyle(video);
369
- return style.display !== 'none';
370
- });
371
- if (video) {
372
- return {
373
- video,
374
- type: 'video',
375
- };
376
- } else {
377
- const images = container.querySelectorAll('img');
378
- const image = Array.from(images).find((image) => {
379
- const style = window.getComputedStyle(image);
380
- return style.display !== 'none';
381
- });
382
- if (image) {
383
- return {
384
- image,
385
- type: 'image',
386
- };
387
- }
388
- }
389
- return null;
390
- }
391
365
  const endedHandler = function () {
392
366
 
393
367
  if (prevSwiper.isEnd) {
@@ -587,10 +561,12 @@
587
561
  ],
588
562
  "presets": [
589
563
  {
590
- "name": "Video Swiper Preview"
564
+ "name": "Video Swiper Preview",
565
+ "category": "Swiper Block"
591
566
  },
592
567
  {
593
568
  "name": "可预览轮播图",
569
+ "category": "Swiper Block",
594
570
  "settings": {
595
571
  "bg_color": "#ffffff",
596
572
  "pagination_color": "#ffffff",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.25.1-beta.4",
3
+ "version": "0.25.1-beta.5",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",