zz-shopify-components 0.0.21 → 0.0.22

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +21 -21
  2. package/README.md +56 -56
  3. package/assets/ScrollTrigger.min.js +11 -11
  4. package/assets/gsap.min.js +11 -11
  5. package/assets/jquery.js +2 -2
  6. package/assets/lazy-video.js +2 -2
  7. package/assets/lazyload.min.js +1 -1
  8. package/assets/lozad.js +10 -10
  9. package/assets/site-jump.js +52 -52
  10. package/assets/site-jumpV2.js +35 -35
  11. package/assets/swiper-bundle.min.css +12 -12
  12. package/assets/swiper-bundle.min.js +13 -13
  13. package/assets/swiper.css +330 -330
  14. package/assets/zz-components.css +322 -322
  15. package/assets/zz-components.js +166 -166
  16. package/assets/zz-fade-in-content.js +169 -169
  17. package/blocks/zz-accessories-item.liquid +188 -188
  18. package/blocks/zz-accessories-swiper.liquid +223 -223
  19. package/blocks/zz-button.liquid +216 -216
  20. package/blocks/zz-content-description-html.liquid +201 -201
  21. package/blocks/zz-content-description.liquid +209 -209
  22. package/blocks/zz-flex-layout-bg-block.liquid +524 -524
  23. package/blocks/zz-flex-layout-block.liquid +548 -548
  24. package/blocks/zz-flex-layout-widget.liquid +321 -321
  25. package/blocks/zz-full-screen-swiper.liquid +447 -447
  26. package/blocks/zz-icon.liquid +46 -46
  27. package/blocks/zz-mail.liquid +135 -135
  28. package/blocks/zz-mb-swiper-pc-flex.liquid +273 -273
  29. package/blocks/zz-price-tag-mini.liquid +100 -106
  30. package/blocks/zz-price-tag.liquid +41 -41
  31. package/blocks/zz-ratio-image.liquid +181 -181
  32. package/blocks/zz-ratio-video.liquid +115 -115
  33. package/blocks/zz-responsive-width-image.liquid +222 -222
  34. package/blocks/zz-responsive-width-video.liquid +166 -166
  35. package/blocks/zz-scroll-animate-bg-text.liquid +268 -268
  36. package/blocks/zz-scroll-cover.liquid +67 -67
  37. package/blocks/zz-tag.liquid +50 -50
  38. package/blocks/zz-text.liquid +227 -227
  39. package/blocks/zz-title.liquid +287 -287
  40. package/blocks/zz-video-button.liquid +84 -84
  41. package/blocks/zz-video-swiper-perview-item.liquid +221 -221
  42. package/blocks/zz-video-swiper-perview.liquid +585 -585
  43. package/component.config.json +7 -7
  44. package/package.json +1 -1
  45. package/scripts/postinstall-v1.js +39 -39
  46. package/scripts/postinstall-v2.js +47 -47
  47. package/scripts/postinstall-v3.js +51 -51
  48. package/scripts/publish-npm.js +43 -43
  49. package/sections/zz-flex-layout-section.liquid +269 -269
  50. package/sections/zz-navigation-tab-v3.liquid +407 -407
  51. package/sections/zz-navigation-tab.liquid +411 -411
  52. package/sections/zz-shopping-card-list.liquid +399 -399
  53. package/sections/zz-video-collapse-swiper.liquid +522 -522
  54. package/sections/zz-video-tab-swiper.liquid +748 -748
  55. package/snippets/zz-button.liquid +70 -70
  56. package/snippets/zz-content-h3.liquid +15 -15
  57. package/snippets/zz-content-text.liquid +56 -56
  58. package/snippets/zz-h2.liquid +31 -31
  59. package/snippets/zz-h3.liquid +31 -31
  60. package/snippets/zz-h4.liquid +30 -30
  61. package/snippets/zz-h5.liquid +39 -39
  62. package/snippets/zz-h6.liquid +39 -39
  63. package/snippets/zz-icon-next.liquid +17 -17
  64. package/snippets/zz-icon-prev.liquid +17 -17
  65. package/snippets/zz-icon.liquid +74 -74
  66. package/snippets/zz-img.liquid +44 -44
  67. package/snippets/zz-prev-next-btn.liquid +62 -62
  68. package/snippets/zz-price-tag.liquid +22 -22
  69. package/snippets/zz-spoke.liquid +142 -142
  70. package/snippets/zz-tag.liquid +22 -22
  71. package/snippets/zz-video-button.liquid +54 -54
  72. package/snippets/zz-video-md.liquid +117 -117
  73. package/snippets/zz-video.liquid +117 -117
@@ -1,8 +1,8 @@
1
- {
2
- "whitelist": [
3
- "assets/gsap.min.js",
4
- "assets/jquery.js",
5
- "assets/lozad.js",
6
- "assets/ScrollTrigger.min.js"
7
- ]
1
+ {
2
+ "whitelist": [
3
+ "assets/gsap.min.js",
4
+ "assets/jquery.js",
5
+ "assets/lozad.js",
6
+ "assets/ScrollTrigger.min.js"
7
+ ]
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",
@@ -1,39 +1,39 @@
1
- #!/usr/bin/env node
2
- console.log('Running postinstall...');
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- const PACKAGE_ROOT = path.resolve(__dirname, '..');
7
- const PROJECT_ROOT = process.cwd();
8
-
9
- const folders = ['sections', 'blocks', 'snippets', 'assets'];
10
-
11
- function copyDir(src, dest) {
12
- if (!fs.existsSync(src)) return;
13
-
14
- if (!fs.existsSync(dest)) {
15
- fs.mkdirSync(dest, { recursive: true });
16
- }
17
-
18
- const items = fs.readdirSync(src);
19
- for (const item of items) {
20
- const srcPath = path.join(src, item);
21
- const destPath = path.join(dest, item);
22
- const stat = fs.statSync(srcPath);
23
-
24
- if (stat.isDirectory()) {
25
- copyDir(srcPath, destPath);
26
- } else {
27
- fs.copyFileSync(srcPath, destPath); // 覆盖
28
- console.log(`✅ Copied: ${path.relative(PROJECT_ROOT, destPath)}`);
29
- }
30
- }
31
- }
32
-
33
- console.log('\n🧩 [component-lib] Start syncing components to project...');
34
- for (const folder of folders) {
35
- const from = path.join(PACKAGE_ROOT, folder);
36
- const to = path.join(PROJECT_ROOT, folder);
37
- copyDir(from, to);
38
- }
39
- console.log('🎉 [component-lib] Sync complete.\n');
1
+ #!/usr/bin/env node
2
+ console.log('Running postinstall...');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const PACKAGE_ROOT = path.resolve(__dirname, '..');
7
+ const PROJECT_ROOT = process.cwd();
8
+
9
+ const folders = ['sections', 'blocks', 'snippets', 'assets'];
10
+
11
+ function copyDir(src, dest) {
12
+ if (!fs.existsSync(src)) return;
13
+
14
+ if (!fs.existsSync(dest)) {
15
+ fs.mkdirSync(dest, { recursive: true });
16
+ }
17
+
18
+ const items = fs.readdirSync(src);
19
+ for (const item of items) {
20
+ const srcPath = path.join(src, item);
21
+ const destPath = path.join(dest, item);
22
+ const stat = fs.statSync(srcPath);
23
+
24
+ if (stat.isDirectory()) {
25
+ copyDir(srcPath, destPath);
26
+ } else {
27
+ fs.copyFileSync(srcPath, destPath); // 覆盖
28
+ console.log(`✅ Copied: ${path.relative(PROJECT_ROOT, destPath)}`);
29
+ }
30
+ }
31
+ }
32
+
33
+ console.log('\n🧩 [component-lib] Start syncing components to project...');
34
+ for (const folder of folders) {
35
+ const from = path.join(PACKAGE_ROOT, folder);
36
+ const to = path.join(PROJECT_ROOT, folder);
37
+ copyDir(from, to);
38
+ }
39
+ console.log('🎉 [component-lib] Sync complete.\n');
@@ -1,47 +1,47 @@
1
- #!/usr/bin/env node
2
- const fs = require('fs');
3
- const path = require('path');
4
- const fse = require('fs-extra');
5
-
6
- const COMPONENT_DIRS = ['sections', 'blocks', 'snippets', 'assets'];
7
- const ROOT_DIR = path.resolve(__dirname); // 组件库自身
8
- const TARGET_DIR = process.cwd(); // 使用组件库的项目目录
9
-
10
- // 读取 ignore 配置
11
- let ignoreList = [];
12
- const configPath = path.join(ROOT_DIR, 'component.config.json');
13
-
14
- if (fs.existsSync(configPath)) {
15
- try {
16
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
17
- ignoreList = config.ignore || [];
18
- } catch (e) {
19
- console.warn('[postinstall] Failed to parse component.config.json', e);
20
- }
21
- }
22
-
23
- // 是否应忽略某个文件
24
- const shouldIgnore = (relativePath) => {
25
- return ignoreList.includes(relativePath.replace(/\\/g, '/'));
26
- };
27
-
28
- // 拷贝文件逻辑
29
- COMPONENT_DIRS.forEach((dirName) => {
30
- const sourceDir = path.join(ROOT_DIR, dirName);
31
- const targetDir = path.join(TARGET_DIR, dirName);
32
-
33
- if (!fs.existsSync(sourceDir)) return;
34
-
35
- fse.readdirSync(sourceDir).forEach((file) => {
36
- const relPath = `${dirName}/${file}`;
37
- if (shouldIgnore(relPath)) {
38
- console.log(`[postinstall] Ignored: ${relPath}`);
39
- return;
40
- }
41
-
42
- const src = path.join(sourceDir, file);
43
- const dest = path.join(targetDir, file);
44
- fse.copySync(src, dest, { overwrite: true });
45
- console.log(`[postinstall] Copied: ${relPath}`);
46
- });
47
- });
1
+ #!/usr/bin/env node
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const fse = require('fs-extra');
5
+
6
+ const COMPONENT_DIRS = ['sections', 'blocks', 'snippets', 'assets'];
7
+ const ROOT_DIR = path.resolve(__dirname); // 组件库自身
8
+ const TARGET_DIR = process.cwd(); // 使用组件库的项目目录
9
+
10
+ // 读取 ignore 配置
11
+ let ignoreList = [];
12
+ const configPath = path.join(ROOT_DIR, 'component.config.json');
13
+
14
+ if (fs.existsSync(configPath)) {
15
+ try {
16
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
17
+ ignoreList = config.ignore || [];
18
+ } catch (e) {
19
+ console.warn('[postinstall] Failed to parse component.config.json', e);
20
+ }
21
+ }
22
+
23
+ // 是否应忽略某个文件
24
+ const shouldIgnore = (relativePath) => {
25
+ return ignoreList.includes(relativePath.replace(/\\/g, '/'));
26
+ };
27
+
28
+ // 拷贝文件逻辑
29
+ COMPONENT_DIRS.forEach((dirName) => {
30
+ const sourceDir = path.join(ROOT_DIR, dirName);
31
+ const targetDir = path.join(TARGET_DIR, dirName);
32
+
33
+ if (!fs.existsSync(sourceDir)) return;
34
+
35
+ fse.readdirSync(sourceDir).forEach((file) => {
36
+ const relPath = `${dirName}/${file}`;
37
+ if (shouldIgnore(relPath)) {
38
+ console.log(`[postinstall] Ignored: ${relPath}`);
39
+ return;
40
+ }
41
+
42
+ const src = path.join(sourceDir, file);
43
+ const dest = path.join(targetDir, file);
44
+ fse.copySync(src, dest, { overwrite: true });
45
+ console.log(`[postinstall] Copied: ${relPath}`);
46
+ });
47
+ });
@@ -1,51 +1,51 @@
1
- #!/usr/bin/env node
2
- console.log('Running postinstall-v3...');
3
- const fs = require('fs-extra');
4
- const path = require('path');
5
-
6
- const rootDir = path.resolve(__dirname, '..');
7
- const targetDirs = ['sections', 'snippets', 'blocks', 'assets'];
8
- const projectRoot = process.cwd(); // 安装者项目根目录
9
- const configPath = path.join(rootDir, 'component.config.json');
10
-
11
- let whitelist = new Set();
12
-
13
- if (fs.existsSync(configPath)) {
14
- try {
15
- const config = fs.readJsonSync(configPath);
16
- if (Array.isArray(config.whitelist)) {
17
- whitelist = new Set(config.whitelist.map((p) => path.normalize(p)));
18
- }
19
- } catch (err) {
20
- console.warn('⚠️ 无法解析 component.config.json:', err.message);
21
- }
22
- }
23
-
24
- const shouldCopy = (fileRelativePath) => {
25
- const fileName = path.basename(fileRelativePath);
26
- const normalizedPath = path.normalize(fileRelativePath);
27
-
28
- return fileName.startsWith('zz-') || whitelist.has(normalizedPath);
29
- };
30
-
31
- targetDirs.forEach((dir) => {
32
- const sourceDir = path.join(rootDir, dir);
33
- const targetDir = path.join(projectRoot, dir);
34
-
35
- if (!fs.existsSync(sourceDir)) return;
36
-
37
- const files = fs.readdirSync(sourceDir);
38
-
39
- files.forEach((file) => {
40
- const relativePath = path.join(dir, file);
41
-
42
- if (shouldCopy(relativePath)) {
43
- const from = path.join(sourceDir, file);
44
- const to = path.join(targetDir, file);
45
-
46
- fs.ensureDirSync(targetDir);
47
- fs.copySync(from, to);
48
- console.log(`✅ 拷贝: ${relativePath}`);
49
- }
50
- });
51
- });
1
+ #!/usr/bin/env node
2
+ console.log('Running postinstall-v3...');
3
+ const fs = require('fs-extra');
4
+ const path = require('path');
5
+
6
+ const rootDir = path.resolve(__dirname, '..');
7
+ const targetDirs = ['sections', 'snippets', 'blocks', 'assets'];
8
+ const projectRoot = process.cwd(); // 安装者项目根目录
9
+ const configPath = path.join(rootDir, 'component.config.json');
10
+
11
+ let whitelist = new Set();
12
+
13
+ if (fs.existsSync(configPath)) {
14
+ try {
15
+ const config = fs.readJsonSync(configPath);
16
+ if (Array.isArray(config.whitelist)) {
17
+ whitelist = new Set(config.whitelist.map((p) => path.normalize(p)));
18
+ }
19
+ } catch (err) {
20
+ console.warn('⚠️ 无法解析 component.config.json:', err.message);
21
+ }
22
+ }
23
+
24
+ const shouldCopy = (fileRelativePath) => {
25
+ const fileName = path.basename(fileRelativePath);
26
+ const normalizedPath = path.normalize(fileRelativePath);
27
+
28
+ return fileName.startsWith('zz-') || whitelist.has(normalizedPath);
29
+ };
30
+
31
+ targetDirs.forEach((dir) => {
32
+ const sourceDir = path.join(rootDir, dir);
33
+ const targetDir = path.join(projectRoot, dir);
34
+
35
+ if (!fs.existsSync(sourceDir)) return;
36
+
37
+ const files = fs.readdirSync(sourceDir);
38
+
39
+ files.forEach((file) => {
40
+ const relativePath = path.join(dir, file);
41
+
42
+ if (shouldCopy(relativePath)) {
43
+ const from = path.join(sourceDir, file);
44
+ const to = path.join(targetDir, file);
45
+
46
+ fs.ensureDirSync(targetDir);
47
+ fs.copySync(from, to);
48
+ console.log(`✅ 拷贝: ${relativePath}`);
49
+ }
50
+ });
51
+ });
@@ -1,43 +1,43 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const semver = require('semver');
6
- const { execSync } = require('child_process');
7
-
8
- const packageJsonPath = path.resolve(__dirname, '../package.json');
9
- const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
10
-
11
- // 获取命令参数
12
- const releaseType = process.argv[2]; // 'patch' | 'minor' | 'major' | 'beta'
13
- const isBeta = releaseType === 'beta';
14
- const currentVersion = pkg.version;
15
-
16
- // 生成新版本号
17
- let newVersion;
18
- if (isBeta) {
19
- newVersion = semver.inc(currentVersion, 'prerelease', 'beta');
20
- } else {
21
- newVersion = semver.inc(currentVersion, releaseType);
22
- }
23
-
24
- if (!newVersion) {
25
- console.error('❌ 无效的发布类型: ' + releaseType);
26
- process.exit(1);
27
- }
28
-
29
- // 更新 package.json
30
- pkg.version = newVersion;
31
- fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2), 'utf-8');
32
- console.log(`📦 更新版本: ${currentVersion} → ${newVersion}`);
33
-
34
- // 发布到 npm
35
- try {
36
- const tag = isBeta ? '--tag beta' : '';
37
- console.log(`🚀 发布中: npm publish ${tag}`);
38
- execSync(`npm publish ${tag}`, { stdio: 'inherit' });
39
- console.log('✅ 发布成功!');
40
- } catch (err) {
41
- console.error('❌ 发布失败', err.message);
42
- process.exit(1);
43
- }
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const semver = require('semver');
6
+ const { execSync } = require('child_process');
7
+
8
+ const packageJsonPath = path.resolve(__dirname, '../package.json');
9
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
10
+
11
+ // 获取命令参数
12
+ const releaseType = process.argv[2]; // 'patch' | 'minor' | 'major' | 'beta'
13
+ const isBeta = releaseType === 'beta';
14
+ const currentVersion = pkg.version;
15
+
16
+ // 生成新版本号
17
+ let newVersion;
18
+ if (isBeta) {
19
+ newVersion = semver.inc(currentVersion, 'prerelease', 'beta');
20
+ } else {
21
+ newVersion = semver.inc(currentVersion, releaseType);
22
+ }
23
+
24
+ if (!newVersion) {
25
+ console.error('❌ 无效的发布类型: ' + releaseType);
26
+ process.exit(1);
27
+ }
28
+
29
+ // 更新 package.json
30
+ pkg.version = newVersion;
31
+ fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2), 'utf-8');
32
+ console.log(`📦 更新版本: ${currentVersion} → ${newVersion}`);
33
+
34
+ // 发布到 npm
35
+ try {
36
+ const tag = isBeta ? '--tag beta' : '';
37
+ console.log(`🚀 发布中: npm publish ${tag}`);
38
+ execSync(`npm publish ${tag}`, { stdio: 'inherit' });
39
+ console.log('✅ 发布成功!');
40
+ } catch (err) {
41
+ console.error('❌ 发布失败', err.message);
42
+ process.exit(1);
43
+ }