shoplazza-cli 1.1.2 → 2.0.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.
Files changed (400) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +206 -332
  4. package/README.zh.md +318 -0
  5. package/package.json +24 -70
  6. package/scripts/install.js +144 -0
  7. package/scripts/jsbuild/dev/index.js +123 -0
  8. package/scripts/jsbuild/index.js +77 -0
  9. package/{lib/checkout/build → scripts/jsbuild}/plugin/vite-plugin-add-extension-id.js +4 -2
  10. package/scripts/jsbuild/vite.config.js +35 -0
  11. package/scripts/run.js +29 -0
  12. package/.editorconfig +0 -28
  13. package/.prettierrc +0 -9
  14. package/bin/shoplazza +0 -137
  15. package/fixtures/assets/blog.scss +0 -74
  16. package/fixtures/assets/cart_modal.scss +0 -450
  17. package/fixtures/assets/collection_detail.js +0 -234
  18. package/fixtures/assets/collection_detail.scss +0 -345
  19. package/fixtures/assets/collection_list.scss +0 -11
  20. package/fixtures/assets/collection_slider.scss +0 -169
  21. package/fixtures/assets/feature_columns.scss +0 -26
  22. package/fixtures/assets/feature_product.scss +0 -109
  23. package/fixtures/assets/footer.js +0 -58
  24. package/fixtures/assets/footer.scss +0 -337
  25. package/fixtures/assets/four_images.scss +0 -29
  26. package/fixtures/assets/gallery.scss +0 -55
  27. package/fixtures/assets/header.js +0 -178
  28. package/fixtures/assets/header.scss +0 -929
  29. package/fixtures/assets/image_text.scss +0 -72
  30. package/fixtures/assets/logo_bar.scss +0 -11
  31. package/fixtures/assets/newsletter.scss +0 -90
  32. package/fixtures/assets/not_found.scss +0 -39
  33. package/fixtures/assets/page_detail.scss +0 -16
  34. package/fixtures/assets/pagination.scss +0 -150
  35. package/fixtures/assets/postcss.config.js +0 -6
  36. package/fixtures/assets/product_description.scss +0 -88
  37. package/fixtures/assets/product_detail.js +0 -634
  38. package/fixtures/assets/product_detail.scss +0 -1106
  39. package/fixtures/assets/relative_product.scss +0 -45
  40. package/fixtures/assets/reviews.scss +0 -70
  41. package/fixtures/assets/rich_text.scss +0 -71
  42. package/fixtures/assets/search.js +0 -87
  43. package/fixtures/assets/search.scss +0 -67
  44. package/fixtures/assets/slide.scss +0 -51
  45. package/fixtures/assets/slider.scss +0 -141
  46. package/fixtures/assets/test.scss +0 -1
  47. package/fixtures/assets/theme.css +0 -976
  48. package/fixtures/assets/theme.scss +0 -1100
  49. package/fixtures/assets/three_images.scss +0 -20
  50. package/fixtures/assets/tools.scss +0 -23
  51. package/fixtures/assets/two_images.scss +0 -24
  52. package/fixtures/assets/video.scss +0 -45
  53. package/fixtures/assets/video_text.scss +0 -63
  54. package/fixtures/config/settings_data.json +0 -107
  55. package/fixtures/config/settings_schema.json +0 -690
  56. package/fixtures/layout/theme.liquid +0 -76
  57. package/fixtures/locales/ar-SA.json +0 -212
  58. package/fixtures/locales/de-DE.json +0 -290
  59. package/fixtures/locales/en-US.json +0 -290
  60. package/fixtures/locales/es-ES.json +0 -290
  61. package/fixtures/locales/fr-FR.json +0 -290
  62. package/fixtures/locales/id-ID.json +0 -212
  63. package/fixtures/locales/it-IT.json +0 -212
  64. package/fixtures/locales/ja-JP.json +0 -289
  65. package/fixtures/locales/ko-KR.json +0 -290
  66. package/fixtures/locales/nl-NL.json +0 -290
  67. package/fixtures/locales/pl-PL.json +0 -290
  68. package/fixtures/locales/pt-PT.json +0 -212
  69. package/fixtures/locales/ru-RU.json +0 -212
  70. package/fixtures/locales/th-TH.json +0 -212
  71. package/fixtures/locales/zh-CN.json +0 -290
  72. package/fixtures/locales/zh-TW.json +0 -290
  73. package/fixtures/sections/apps.liquid +0 -47
  74. package/fixtures/sections/blog.liquid +0 -137
  75. package/fixtures/sections/collection_desc.liquid +0 -34
  76. package/fixtures/sections/collection_detail.liquid +0 -436
  77. package/fixtures/sections/collection_image.liquid +0 -104
  78. package/fixtures/sections/collection_list.liquid +0 -161
  79. package/fixtures/sections/collection_name.liquid +0 -34
  80. package/fixtures/sections/collection_slider.liquid +0 -330
  81. package/fixtures/sections/feature_columns.liquid +0 -275
  82. package/fixtures/sections/feature_product.liquid +0 -227
  83. package/fixtures/sections/footer.liquid +0 -488
  84. package/fixtures/sections/four_images.liquid +0 -160
  85. package/fixtures/sections/gallery.liquid +0 -258
  86. package/fixtures/sections/header.liquid +0 -1157
  87. package/fixtures/sections/html.liquid +0 -40
  88. package/fixtures/sections/image_text.liquid +0 -350
  89. package/fixtures/sections/instagram_plus.liquid +0 -393
  90. package/fixtures/sections/logo_bar.liquid +0 -183
  91. package/fixtures/sections/newsletter.liquid +0 -225
  92. package/fixtures/sections/not_found.liquid +0 -39
  93. package/fixtures/sections/overlay_image.liquid +0 -648
  94. package/fixtures/sections/page_detail.liquid +0 -39
  95. package/fixtures/sections/photo_collection.liquid +0 -433
  96. package/fixtures/sections/product_description.liquid +0 -208
  97. package/fixtures/sections/product_detail.liquid +0 -611
  98. package/fixtures/sections/products.liquid +0 -216
  99. package/fixtures/sections/relative_product.liquid +0 -121
  100. package/fixtures/sections/reviews.liquid +0 -115
  101. package/fixtures/sections/rich_text.liquid +0 -157
  102. package/fixtures/sections/search.liquid +0 -163
  103. package/fixtures/sections/slide.liquid +0 -719
  104. package/fixtures/sections/three_images.liquid +0 -157
  105. package/fixtures/sections/two_images.liquid +0 -125
  106. package/fixtures/sections/video.liquid +0 -95
  107. package/fixtures/sections/video_text.liquid +0 -128
  108. package/fixtures/snippets/bgset.liquid +0 -21
  109. package/fixtures/snippets/card_title.liquid +0 -8
  110. package/fixtures/snippets/cart_modal.liquid +0 -74
  111. package/fixtures/snippets/collection.liquid +0 -77
  112. package/fixtures/snippets/collection_filter_modal.liquid +0 -56
  113. package/fixtures/snippets/default_image_4.liquid +0 -14
  114. package/fixtures/snippets/default_image_6.liquid +0 -18
  115. package/fixtures/snippets/default_image_8.liquid +0 -23
  116. package/fixtures/snippets/four_images_item.liquid +0 -8
  117. package/fixtures/snippets/header_ads.liquid +0 -95
  118. package/fixtures/snippets/hero_image.liquid +0 -94
  119. package/fixtures/snippets/icon_video_play_large.liquid +0 -1
  120. package/fixtures/snippets/icon_video_play_medium.liquid +0 -4
  121. package/fixtures/snippets/icon_video_play_small.liquid +0 -4
  122. package/fixtures/snippets/lazyimg.liquid +0 -22
  123. package/fixtures/snippets/lazyimg_art.liquid +0 -36
  124. package/fixtures/snippets/lazysizes.liquid +0 -41
  125. package/fixtures/snippets/link.liquid +0 -2
  126. package/fixtures/snippets/pagination.liquid +0 -48
  127. package/fixtures/snippets/product.liquid +0 -126
  128. package/fixtures/snippets/product_art_tpl.liquid +0 -152
  129. package/fixtures/snippets/product_info_body.liquid +0 -337
  130. package/fixtures/snippets/product_info_tpl.liquid +0 -423
  131. package/fixtures/snippets/product_label.liquid +0 -46
  132. package/fixtures/snippets/settings.liquid +0 -295
  133. package/fixtures/snippets/social-meta-tags.liquid +0 -106
  134. package/fixtures/snippets/video_html.liquid +0 -11
  135. package/fixtures/snippets/video_source.liquid +0 -98
  136. package/fixtures/snippets/video_thumb_icon.liquid +0 -2
  137. package/fixtures/templates/404.liquid +0 -1
  138. package/fixtures/templates/collection.liquid +0 -92
  139. package/fixtures/templates/index.liquid +0 -206
  140. package/fixtures/templates/page.liquid +0 -1
  141. package/fixtures/templates/product.liquid +0 -99
  142. package/fixtures/templates/search.liquid +0 -1
  143. package/jest.config.js +0 -192
  144. package/lib/__tests__/log.test.js +0 -15
  145. package/lib/__tests__/utils.test.js +0 -69
  146. package/lib/app/api/cli.js +0 -225
  147. package/lib/app/api/openapi.js +0 -121
  148. package/lib/app/api/partnerOpenapi.js +0 -104
  149. package/lib/app/bin/index.js +0 -20
  150. package/lib/app/bin/javy/javy-arm-linux-v5.0.1 +0 -0
  151. package/lib/app/bin/javy/javy-arm-macos-v5.0.1 +0 -0
  152. package/lib/app/bin/javy/javy-x86_64-linux-v5.0.1 +0 -0
  153. package/lib/app/bin/javy/javy-x86_64-macos-v5.0.1 +0 -0
  154. package/lib/app/bin/javy/javy-x86_64-windows-v5.0.1 +0 -0
  155. package/lib/app/commands/config/actions/link.js +0 -189
  156. package/lib/app/commands/config/actions/use.js +0 -40
  157. package/lib/app/commands/config/index.js +0 -25
  158. package/lib/app/commands/config/link.js +0 -11
  159. package/lib/app/commands/config/use.js +0 -11
  160. package/lib/app/commands/deploy/actions/deploy.js +0 -196
  161. package/lib/app/commands/deploy/index.js +0 -11
  162. package/lib/app/commands/dev/actions/dev.js +0 -206
  163. package/lib/app/commands/dev/index.js +0 -11
  164. package/lib/app/commands/generate/actions/extension.js +0 -97
  165. package/lib/app/commands/generate/actions/generateCheckout.js +0 -58
  166. package/lib/app/commands/generate/actions/generateFunction.js +0 -56
  167. package/lib/app/commands/generate/actions/generateTheme.js +0 -128
  168. package/lib/app/commands/generate/extension.js +0 -11
  169. package/lib/app/commands/generate/index.js +0 -22
  170. package/lib/app/commands/index.js +0 -82
  171. package/lib/app/commands/info/actions/info.js +0 -168
  172. package/lib/app/commands/info/index.js +0 -11
  173. package/lib/app/commands/init/actions/init.js +0 -176
  174. package/lib/app/commands/init/index.js +0 -14
  175. package/lib/app/commands/versions/actions/list.js +0 -210
  176. package/lib/app/commands/versions/index.js +0 -22
  177. package/lib/app/commands/versions/list.js +0 -14
  178. package/lib/app/constant/code.js +0 -7
  179. package/lib/app/constant/color.js +0 -18
  180. package/lib/app/constant/extension.js +0 -16
  181. package/lib/app/constant/host.js +0 -23
  182. package/lib/app/constant/sso.js +0 -7
  183. package/lib/app/index.js +0 -8
  184. package/lib/app/services/auth/config.js +0 -33
  185. package/lib/app/services/auth/index.js +0 -9
  186. package/lib/app/services/auth/oauth-server.js +0 -70
  187. package/lib/app/services/auth/partner-token.js +0 -45
  188. package/lib/app/services/auth/sso-token.js +0 -69
  189. package/lib/app/services/auth/store-token.js +0 -100
  190. package/lib/app/services/auth/url-builder.js +0 -23
  191. package/lib/app/services/config/index.js +0 -41
  192. package/lib/app/services/devServer/app.js +0 -76
  193. package/lib/app/services/devServer/index.js +0 -103
  194. package/lib/app/services/devServer/middleware/hmacValidatorMiddleWare.js +0 -20
  195. package/lib/app/services/devServer/middleware/index.js +0 -5
  196. package/lib/app/services/devServer/tunnel/index.js +0 -43
  197. package/lib/app/services/devServer/tunnel/providers/cloudflare.js +0 -364
  198. package/lib/app/services/devServer/tunnel/providers/ngrok.js +0 -70
  199. package/lib/app/services/devServer/utils/index.js +0 -5
  200. package/lib/app/services/devServer/utils/secureCompare.js +0 -5
  201. package/lib/app/services/devServer/views/app.ejs +0 -133
  202. package/lib/app/services/extension-build/buildCheckout.js +0 -47
  203. package/lib/app/services/extension-build/buildFunction.js +0 -57
  204. package/lib/app/services/extension-build/buildTheme.js +0 -100
  205. package/lib/app/services/extension-build/index.js +0 -23
  206. package/lib/app/services/extension-build/plugins/vite-plugin-add-extension-id.js +0 -26
  207. package/lib/app/services/extension-diff/index.js +0 -132
  208. package/lib/app/services/extension-upsert/index.js +0 -21
  209. package/lib/app/services/extension-upsert/upsertCheckout.js +0 -44
  210. package/lib/app/services/extension-upsert/upsertFunction.js +0 -52
  211. package/lib/app/services/extension-upsert/upsertTheme.js +0 -113
  212. package/lib/app/services/oss/index.js +0 -45
  213. package/lib/app/services/partner/index.js +0 -52
  214. package/lib/app/store/base-store.js +0 -37
  215. package/lib/app/store/config-store.js +0 -55
  216. package/lib/app/store/config.js +0 -21
  217. package/lib/app/store/index.js +0 -14
  218. package/lib/app/store/install-store.js +0 -41
  219. package/lib/app/store/sso-store.js +0 -55
  220. package/lib/app/utils/asyncPool.js +0 -42
  221. package/lib/app/utils/debug/index.js +0 -16
  222. package/lib/app/utils/env.js +0 -24
  223. package/lib/app/utils/error.js +0 -20
  224. package/lib/app/utils/git.js +0 -20
  225. package/lib/app/utils/json.js +0 -27
  226. package/lib/app/utils/path.js +0 -33
  227. package/lib/app/utils/platform.js +0 -37
  228. package/lib/app/utils/request/cli.js +0 -72
  229. package/lib/app/utils/request/debug.js +0 -13
  230. package/lib/app/utils/request/openapi.js +0 -67
  231. package/lib/app/utils/request/partnerOpenapi.js +0 -47
  232. package/lib/app/utils/toml.js +0 -56
  233. package/lib/app/utils/views/message.js +0 -68
  234. package/lib/app/utils/views/select.js +0 -36
  235. package/lib/app/utils/withTempDir.js +0 -55
  236. package/lib/auth/__mocks__/getCode.js +0 -7
  237. package/lib/auth/__mocks__/index.js +0 -0
  238. package/lib/auth/child.js +0 -23
  239. package/lib/auth/getCode.js +0 -39
  240. package/lib/auth/index.js +0 -134
  241. package/lib/check.js +0 -28
  242. package/lib/checkout/api.js +0 -164
  243. package/lib/checkout/build/plugin/vite-plugin-transform-extension-html.js +0 -207
  244. package/lib/checkout/build/vite.config.js +0 -34
  245. package/lib/checkout/build.js +0 -38
  246. package/lib/checkout/config.js +0 -97
  247. package/lib/checkout/create.js +0 -132
  248. package/lib/checkout/delete.js +0 -26
  249. package/lib/checkout/deploy.js +0 -59
  250. package/lib/checkout/dev/index.js +0 -143
  251. package/lib/checkout/fields.js +0 -29
  252. package/lib/checkout/index.js +0 -63
  253. package/lib/checkout/preview.js +0 -52
  254. package/lib/checkout/pull.js +0 -22
  255. package/lib/checkout/push.js +0 -141
  256. package/lib/checkout/template/README.md +0 -34
  257. package/lib/checkout/template/_gitignore +0 -4
  258. package/lib/checkout/template/extension.config.js +0 -4
  259. package/lib/checkout/template/extensions/extension-template/extension.json +0 -10
  260. package/lib/checkout/template/extensions/extension-template/src/content.html +0 -3
  261. package/lib/checkout/template/extensions/extension-template/src/index.html +0 -5
  262. package/lib/checkout/template/extensions/extension-template/src/index.js +0 -11
  263. package/lib/checkout/template/extensions/extension-template/src/script.html +0 -3
  264. package/lib/checkout/template/extensions/extension-template/src/style.html +0 -3
  265. package/lib/checkout/template/package.json +0 -17
  266. package/lib/checkout/undeploy.js +0 -40
  267. package/lib/checkout/util.js +0 -201
  268. package/lib/checkout/verify.js +0 -16
  269. package/lib/checkout/version.js +0 -7
  270. package/lib/commands/__tests__/login.test.js +0 -77
  271. package/lib/commands/__tests__/logout.test.js +0 -29
  272. package/lib/commands/__tests__/store.test.js +0 -44
  273. package/lib/commands/__tests__/switch.test.js +0 -45
  274. package/lib/commands/login.js +0 -120
  275. package/lib/commands/logout.js +0 -23
  276. package/lib/commands/store.js +0 -14
  277. package/lib/commands/switch.js +0 -52
  278. package/lib/commands/theme/__tests__/delete.test.js +0 -49
  279. package/lib/commands/theme/__tests__/init.test.js +0 -21
  280. package/lib/commands/theme/__tests__/list.test.js +0 -80
  281. package/lib/commands/theme/__tests__/package.test.js +0 -17
  282. package/lib/commands/theme/__tests__/publish.test.js +0 -61
  283. package/lib/commands/theme/__tests__/pull.test.js +0 -69
  284. package/lib/commands/theme/__tests__/push.test.js +0 -63
  285. package/lib/commands/theme/__tests__/serve.test.js +0 -107
  286. package/lib/commands/theme/delete.js +0 -64
  287. package/lib/commands/theme/init.js +0 -51
  288. package/lib/commands/theme/list.js +0 -28
  289. package/lib/commands/theme/package.js +0 -37
  290. package/lib/commands/theme/publish.js +0 -56
  291. package/lib/commands/theme/pull.js +0 -62
  292. package/lib/commands/theme/push.js +0 -106
  293. package/lib/commands/theme/serve.js +0 -153
  294. package/lib/commands/theme/share.js +0 -20
  295. package/lib/commands/version.js +0 -6
  296. package/lib/common/constants.js +0 -24
  297. package/lib/common/db/partner.js +0 -91
  298. package/lib/common/inquirers/choose-app.js +0 -79
  299. package/lib/common/inquirers/choose-partner.js +0 -74
  300. package/lib/common/log.js +0 -15
  301. package/lib/common/login.js +0 -125
  302. package/lib/common/logout.js +0 -16
  303. package/lib/db/__mocks__/index.js +0 -9
  304. package/lib/db/__tests__/analytics.test.js +0 -19
  305. package/lib/db/__tests__/user.test.js +0 -20
  306. package/lib/db/analytics.js +0 -48
  307. package/lib/db/index.js +0 -9
  308. package/lib/db/user.js +0 -71
  309. package/lib/function/bin/index.js +0 -20
  310. package/lib/function/bin/javy/javy-arm-linux-v5.0.1 +0 -0
  311. package/lib/function/bin/javy/javy-arm-macos-v5.0.1 +0 -0
  312. package/lib/function/bin/javy/javy-x86_64-linux-v5.0.1 +0 -0
  313. package/lib/function/bin/javy/javy-x86_64-macos-v5.0.1 +0 -0
  314. package/lib/function/bin/javy/javy-x86_64-windows-v5.0.1 +0 -0
  315. package/lib/function/commands/compile.js +0 -43
  316. package/lib/function/commands/create.js +0 -77
  317. package/lib/function/commands/list.js +0 -18
  318. package/lib/function/commands/release.js +0 -69
  319. package/lib/function/index.js +0 -24
  320. package/lib/function/template/js/README.md +0 -37
  321. package/lib/function/template/js/_gitignore +0 -4
  322. package/lib/function/template/js/extension.config.json +0 -5
  323. package/lib/function/template/js/package.json +0 -17
  324. package/lib/function/template/js/src/index.js +0 -64
  325. package/lib/function/utils.js +0 -29
  326. package/lib/log.js +0 -13
  327. package/lib/openAPI/__mocks__/index.js +0 -20
  328. package/lib/openAPI/api.js +0 -76
  329. package/lib/openAPI/index.js +0 -56
  330. package/lib/oss.js +0 -102
  331. package/lib/partner-api/axios.js +0 -67
  332. package/lib/partner-api/index.js +0 -79
  333. package/lib/report.js +0 -37
  334. package/lib/theme-extension/api/index.js +0 -96
  335. package/lib/theme-extension/commands/build.js +0 -114
  336. package/lib/theme-extension/commands/connect.js +0 -73
  337. package/lib/theme-extension/commands/create.js +0 -105
  338. package/lib/theme-extension/commands/deploy.js +0 -56
  339. package/lib/theme-extension/commands/list.js +0 -35
  340. package/lib/theme-extension/commands/release.js +0 -59
  341. package/lib/theme-extension/commands/serve.js +0 -179
  342. package/lib/theme-extension/commands/versions.js +0 -55
  343. package/lib/theme-extension/index.js +0 -29
  344. package/lib/theme-extension/template/basic-app/README.md +0 -125
  345. package/lib/theme-extension/template/basic-app/extension.config.json +0 -4
  346. package/lib/theme-extension/template/basic-app/package.json +0 -18
  347. package/lib/theme-extension/template/basic-app/theme-app/assets/index.css +0 -4
  348. package/lib/theme-extension/template/basic-app/theme-app/assets-manifest.json +0 -1
  349. package/lib/theme-extension/template/basic-app/theme-app/blocks/index.liquid +0 -16
  350. package/lib/theme-extension/template/basic-app/theme-app/locales/ar-SA.json +0 -1
  351. package/lib/theme-extension/template/basic-app/theme-app/locales/de-DE.json +0 -1
  352. package/lib/theme-extension/template/basic-app/theme-app/locales/en-US.json +0 -6
  353. package/lib/theme-extension/template/basic-app/theme-app/locales/es-ES.json +0 -1
  354. package/lib/theme-extension/template/basic-app/theme-app/locales/fr-FR.json +0 -1
  355. package/lib/theme-extension/template/basic-app/theme-app/locales/id-ID.json +0 -1
  356. package/lib/theme-extension/template/basic-app/theme-app/locales/it-IT.json +0 -1
  357. package/lib/theme-extension/template/basic-app/theme-app/locales/ja-JP.json +0 -1
  358. package/lib/theme-extension/template/basic-app/theme-app/locales/ko-KR.json +0 -1
  359. package/lib/theme-extension/template/basic-app/theme-app/locales/nl-NL.json +0 -1
  360. package/lib/theme-extension/template/basic-app/theme-app/locales/pl-PL.json +0 -1
  361. package/lib/theme-extension/template/basic-app/theme-app/locales/pt-PT.json +0 -1
  362. package/lib/theme-extension/template/basic-app/theme-app/locales/ru-RU.json +0 -1
  363. package/lib/theme-extension/template/basic-app/theme-app/locales/th-TH.json +0 -1
  364. package/lib/theme-extension/template/basic-app/theme-app/locales/zh-CN.json +0 -6
  365. package/lib/theme-extension/template/basic-app/theme-app/locales/zh-TW.json +0 -1
  366. package/lib/theme-extension/template/basic-app/theme-app/snippets/index.liquid +0 -8
  367. package/lib/theme-extension/template/embed-app/README.md +0 -125
  368. package/lib/theme-extension/template/embed-app/extension.config.json +0 -4
  369. package/lib/theme-extension/template/embed-app/package.json +0 -18
  370. package/lib/theme-extension/template/embed-app/theme-app/assets-manifest.json +0 -1
  371. package/lib/theme-extension/template/embed-app/theme-app/blocks/index.liquid +0 -18
  372. package/lib/theme-extension/template/embed-app/theme-app/locales/ar-SA.json +0 -1
  373. package/lib/theme-extension/template/embed-app/theme-app/locales/de-DE.json +0 -1
  374. package/lib/theme-extension/template/embed-app/theme-app/locales/en-US.json +0 -6
  375. package/lib/theme-extension/template/embed-app/theme-app/locales/es-ES.json +0 -1
  376. package/lib/theme-extension/template/embed-app/theme-app/locales/fr-FR.json +0 -1
  377. package/lib/theme-extension/template/embed-app/theme-app/locales/id-ID.json +0 -1
  378. package/lib/theme-extension/template/embed-app/theme-app/locales/it-IT.json +0 -1
  379. package/lib/theme-extension/template/embed-app/theme-app/locales/ja-JP.json +0 -1
  380. package/lib/theme-extension/template/embed-app/theme-app/locales/ko-KR.json +0 -1
  381. package/lib/theme-extension/template/embed-app/theme-app/locales/nl-NL.json +0 -1
  382. package/lib/theme-extension/template/embed-app/theme-app/locales/pl-PL.json +0 -1
  383. package/lib/theme-extension/template/embed-app/theme-app/locales/pt-PT.json +0 -1
  384. package/lib/theme-extension/template/embed-app/theme-app/locales/ru-RU.json +0 -1
  385. package/lib/theme-extension/template/embed-app/theme-app/locales/th-TH.json +0 -1
  386. package/lib/theme-extension/template/embed-app/theme-app/locales/zh-CN.json +0 -6
  387. package/lib/theme-extension/template/embed-app/theme-app/locales/zh-TW.json +0 -1
  388. package/lib/theme-extension/template/embed-app/theme-app/snippets/index.liquid +0 -8
  389. package/lib/theme-extension/template/embed-app/theme-app/snippets/index_css.liquid +0 -6
  390. package/lib/theme-extension/utils/config.js +0 -32
  391. package/lib/theme-extension/utils/index.js +0 -213
  392. package/lib/tracing.js +0 -50
  393. package/lib/utils/config.js +0 -12
  394. package/lib/utils/console.js +0 -33
  395. package/lib/utils/env.js +0 -17
  396. package/lib/utils/file.js +0 -48
  397. package/lib/utils/platform.js +0 -37
  398. package/lib/utils/utils.js +0 -165
  399. /package/{lib/checkout → scripts/jsbuild}/dev/client.js +0 -0
  400. /package/{lib/app/services/extension-build/plugins → scripts/jsbuild/plugin}/vite-plugin-transform-extension-html.js +0 -0
@@ -1,56 +0,0 @@
1
- {% assign content_col = 'col-12 col-md-9' %}
2
- {% assign product_col = 'col-6 col-md-4' %}
3
- <div class="col-md-3">
4
- <div class="collection-filter__wrapper">
5
- <div class="collection-filter">
6
- <div class="collection-filter__title">{{ 'i18n.collection.collection_detail.filter_by' | t }}</div>
7
- {% for block in section.blocks %}
8
- {% if block.type contains 'shoplazza://apps' %}
9
- {% render block %}
10
- {% continue %}
11
- {% endif %}
12
- {% comment %} 价格标签处理 {% endcomment %}
13
- {% if block.type == 'price_filter' %}
14
- {% assign is_last_price_show = false %}
15
- {% if block.settings.is_last_price_show %}
16
- {% assign is_last_price_show = true %}
17
- {% endif %}
18
- {% assign tags = block.settings.tags | price_range: is_last_price_show %}
19
- {% endif %}
20
- {% comment %} 普通标签处理 {% endcomment %}
21
- {% if block.type == 'tag_filter' %}
22
- {% if block.settings.is_all_tags_show %}
23
- {% comment %} 全部标签 {% endcomment %}
24
- {% assign tags = collection.tags %}
25
- {% else %}
26
- {% assign tags = block.settings.tags | downcase | split: ',' | uniq %}
27
- {% endif %}
28
- {% endif %}
29
- {% if tags.size > 0 %}
30
- <div class="collection-filter__item" data-type="{{block.type}}">
31
- <h3 class="collection-filter__item-title">{{block.settings.title}}</h3>
32
- <div class="collection-filter__item-select">
33
- {% for tag in tags %}
34
- {% assign tag = tag | strip %}
35
- {% comment %} 普通标签需要有效,价格标签直接输出 {% endcomment %}
36
- {% if (block.type == 'tag_filter' and collection.tags contains tag) or (block.type == 'price_filter') %}
37
- <div class="custom-control custom-radio">
38
- <input type="radio" id="{{block.settings.title}}_{{tag}}_{{block.id}}_{{forloop.index}}" value="{{tag}}" name="{{block.settings.title}}_{{block.id}}" class="custom-control-input">
39
- <label class="custom-control-label" for="{{block.settings.title}}_{{tag}}_{{block.id}}_{{forloop.index}}">{{tag}}</label>
40
- </div>
41
- {% endif %}
42
- {% endfor %}
43
- </div>
44
- </div>
45
- {% endif %}
46
- {% endfor %}
47
- <div class="collection-filter__footer d-none d-md-block">
48
- <button class="collection-filter-clear btn btn-primary form-control">{{ 'i18n.collection.collection_detail.clear_all' | t }}</button>
49
- </div>
50
- <div class="collection-filter__footer d-md-none">
51
- <button class="collection-filter-clear btn btn-secondary form-control">{{ 'i18n.collection.collection_detail.clear_all' | t }}</button>
52
- <button class="btn btn-primary form-control collection-filter__footer-confirm">{{ 'i18n.collection.collection_detail.confirm' | t }}</button>
53
- </div>
54
- </div>
55
- </div>
56
- </div>
@@ -1,14 +0,0 @@
1
- {% comment %}
2
- description: 渲染不透明带边距默认图,1280px x 600px图片,单排商品1
3
- {% endcomment %}
4
- {% assign index = forloop.index0 | modulo: 4 %}
5
- {% case index %}
6
- {% when "0" %}
7
- {% assign defaultImage = "oss/operation/92198d501567ee37aabb6b1ab5c666bc.png" %}
8
- {% when "1" %}
9
- {% assign defaultImage = "oss/operation/c91b569e943ad8cba70db81e4a8d0046.png" %}
10
- {% when "2" %}
11
- {% assign defaultImage = "oss/operation/6fd2538eb583ee35023090bfb390e8a2.png" %}
12
- {% when "3" %}
13
- {% assign defaultImage = "oss/operation/13036a056b7bcce362f295380cdde2d5.png" %}
14
- {% endcase %}
@@ -1,18 +0,0 @@
1
- {% comment %}
2
- description: 渲染默认图片,适用于需要不同正方形图片(800px x 800px)的假数据,如专辑列表2
3
- {% endcomment %}
4
- {% assign index = forloop.index0 | modulo: 6 %}
5
- {% case index %}
6
- {% when "1" %}
7
- {% assign defaultImage = "oss/operation/c4556e2a196d8edd8ea2d28de567d5e6.png" %}
8
- {% when "2" %}
9
- {% assign defaultImage = "oss/operation/6f43d006e0f8203037397b6e08100f56.png" %}
10
- {% when "3" %}
11
- {% assign defaultImage = "oss/operation/0040b3b6243ae357fd9aa71d946364e7.png" %}
12
- {% when "4" %}
13
- {% assign defaultImage = "oss/operation/ecfc815e9794b0a8bf59b6aa47837f7b.png" %}
14
- {% when "5" %}
15
- {% assign defaultImage = "oss/operation/5329e231d22e3d6f5fcde6bac7cc162e.png" %}
16
- {% when "0" %}
17
- {% assign defaultImage = "oss/operation/2422d705aaab25fc1323bd460f1e50c8.png" %}
18
- {% endcase %}
@@ -1,23 +0,0 @@
1
- {% comment %}
2
- description: 渲染默认图片,适用于需要不同正方形图片的假数据,如ins照片墙,专辑列表1
3
- {% endcomment %}
4
-
5
- {% assign index = forloop.index0 | modulo: 8 %}
6
- {% case index %}
7
- {% when "1" %}
8
- {% assign defaultImage = "oss/operation/38968edd7e80d8d473ea654b081ca3fc.png" %}
9
- {% when "2" %}
10
- {% assign defaultImage = "oss/operation/83c443ae094ceaafdad986e573c20e6f.png" %}
11
- {% when "3" %}
12
- {% assign defaultImage ="oss/operation/189e7c91334761234480abb0a4f774f5.png" %}
13
- {% when "4" %}
14
- {% assign defaultImage ="oss/operation/f0ba1fdae63450dd8a6e8fd98c2d10f9.png" %}
15
- {% when "5" %}
16
- {% assign defaultImage ="oss/operation/1db3209dc8a7f3a9687e80a7766d9ca3.png" %}
17
- {% when "6" %}
18
- {% assign defaultImage ="oss/operation/aab788ce294fdf70587369f117e76fe5.png" %}
19
- {% when "7" %}
20
- {% assign defaultImage ="oss/operation/13465bf3d4c83fe7c485dfd07acc6e2c.png" %}
21
- {% when "0" %}
22
- {% assign defaultImage ="oss/operation/c617f75bc8f41ad3cbdfbe0548b73247.png" %}
23
- {% endcase %}
@@ -1,8 +0,0 @@
1
- {% assign image_url = img | default: defaultImg %}
2
- <a class="{{class}} common__img-wrapper_lazy {% if link.url %}common__mask{% endif %} {% if shop.env == 1 and img == '' %}common__img-desc{% endif %}"
3
- data-title="{{dataTitle}}"
4
- {% unless link.type != 'web' or link.url contains shop.domain %}target="_blank"{% endunless %}
5
- {% if link.url %}data-track="viewImage" data-track-url="{{ link.url }}" href="{{ link.url }}"{% endif %}
6
- style="padding-bottom: {{images[image_url].height | image_padding_bottom : images[image_url].width, 'unlimit'}};">
7
- {% include 'lazyimg', src: image_url, style: 'width: 100%;'%}
8
- </a>
@@ -1,95 +0,0 @@
1
- {% assign adsUrl = '' %}
2
- {% assign adsImage = '' %}
3
- {% assign adsTitle = '' %}
4
- {% assign product = all_products[product.id] %}
5
- {% if type == 'custom' and image %}
6
- {% assign adsUrl = link.url %}
7
- {% assign adsImage = images[image] %}
8
- {% assign adsTitle = title %}
9
- {% elsif type == 'product' and product and product.id != 0 %}
10
- {% assign adsUrl = product.seo_url %}
11
- {% assign adsImage = product.image %}
12
- {% assign adsTitle = product.title %}
13
- {% endif %}
14
- {% comment %} 有图片才显示广告位 {% endcomment %}
15
- {% if adsImage %}
16
- {% if type == 'product' %}
17
- {% if product and product.published %}
18
- <div class="header-ads d-block {% if position == 'right' %}order-1{% endif %}">
19
- <a {% unless link.type != 'web' or link.url contains shop.domain %}target="_blank"{% endunless %} {% if adsUrl %}href="{{adsUrl}}"{% endif %}
20
- class="position-relative d-block no-scroll w-100 {%if settings.general_style == 'round'%}c-rounded-lg{%endif%}"
21
- style="padding-bottom:{{adsImage.height | image_padding_bottom : adsImage.width, 'unlimit'}};">
22
- <img
23
- src="{{shop.default_img}}"
24
- class="position-absolute c-inset-0 w-100 m-auto lazyload"
25
-
26
- data-sizes="auto"
27
- data-src="{{adsImage.src | img_url: '{width}x'}}"
28
- alt="{{adsImage.alt | escape}}"
29
- >
30
- </a>
31
- {% if adsTitle %}
32
- <h3 class="title font-weight-normal c-text-menu-font-size">
33
- <a {% unless link.type != 'web' or link.url contains shop.domain %}target="_blank"{% endunless %} {% if adsUrl %}href="{{adsUrl}}"{% endif %} class="text-decoration-none c-text-title-color">{{adsTitle}}</a>
34
- </h3>
35
- {% endif %}
36
- {% comment %} 自定义内容 {% endcomment %}
37
- {% comment %} {% if type == 'custom' and image and desc %}
38
- <p class="m-0 c-mt-2 c-tracking-normal c-normal-case c-text-text-color c-text-text-font-size type-text-font-family c-leading-1.3">{{desc}}</p>
39
- {% endif %} {% endcomment %}
40
- {% comment %} 商品 {% endcomment %}
41
- {% if type == 'product' and product and product.id != 0 %}
42
- <div class="c-mt-2 c-leading-none c-normal-case">
43
- {% assign from_on = false %}
44
- {% assign price_min = product.price_min %}
45
- {% assign price_max = product.price_max %}
46
- {% if product.price_max != product.price_min %}
47
- {% assign from_on = true %}
48
- {% endif %}
49
- <div class="c-leading-none d-inline-block mw-100 c-truncate c-tracking-normal c-text-price-color c-text-price-font-size {%if settings.type_price_same_with == 'heading'%}type-heading-font-family{%else%}type-text-font-family{%endif%}">
50
- {% if from_on %}{{ 'i18n.products.general.from' | t }}{% endif %}<span class="money">{{price_min | money_with_symbol}}</span>
51
- </div>
52
- </div>
53
- {% endif %}
54
- </div>
55
- {% endif %}
56
- {% else %}
57
- <div class="header-ads d-block {% if position == 'right' %}order-1{% endif %}">
58
- <a {% unless link.type != 'web' or link.url contains shop.domain %}target="_blank"{% endunless %} {% if adsUrl %}href="{{adsUrl}}"{% endif %}
59
- class="position-relative d-block no-scroll w-100 {%if settings.general_style == 'round'%}c-rounded-lg{%endif%}"
60
- style="padding-bottom:{{adsImage.height | image_padding_bottom : adsImage.width, 'unlimit'}};">
61
- <img
62
- src="{{shop.default_img}}"
63
- class="position-absolute c-inset-0 w-100 m-auto lazyload"
64
-
65
- data-sizes="auto"
66
- data-src="{{adsImage.src | img_url: '{width}x'}}"
67
- alt="{{adsImage.alt | escape}}"
68
- >
69
- </a>
70
- {% if adsTitle %}
71
- <h3 class="title font-weight-normal c-text-menu-font-size ">
72
- <a {% unless link.type != 'web' or link.url contains shop.domain %}target="_blank"{% endunless %} {% if adsUrl %}href="{{adsUrl}}"{% endif %} class="text-decoration-none c-text-title-color">{{adsTitle}}</a>
73
- </h3>
74
- {% endif %}
75
- {% comment %} 自定义内容 {% endcomment %}
76
- {% if type == 'custom' and image and desc %}
77
- <p class="c-mt-2 c-tracking-normal c-normal-case c-text-text-color c-text-text-font-size type-text-font-family c-leading-none">{{desc}}</p>
78
- {% endif %}
79
- {% comment %} 商品 {% endcomment %}
80
- {% comment %} {% if type == 'product' and product and product.id != 0 %}
81
- <div class="c-mt-2 c-leading-none c-normal-case">
82
- {% assign from_on = false %}
83
- {% assign price_min = product.price_min %}
84
- {% assign price_max = product.price_max %}
85
- {% if product.price_max != product.price_min or product.compare_at_price_max != product.compare_at_price_min %}
86
- {% assign from_on = true %}
87
- {% endif %}
88
- <div class="d-inline-block mw-100 c-truncate c-tracking-normal c-text-sm c-text-price-color c-text-price-font-size {%if settings.type_price_same_with == 'heading'%}type-heading-font-family{%else%}type-text-font-family{%endif%}">
89
- {% if from_on %}{{ 'i18n.products.general.from' | t }}{% endif %}<span class="money">{{price_min | money_with_symbol}}</span>
90
- </div>
91
- </div>
92
- {% endif %} {% endcomment %}
93
- </div>
94
- {% endif %}
95
- {% endif %}
@@ -1,94 +0,0 @@
1
- {% comment %}
2
- description: 蒙层图片
3
- author: lucida
4
- @param {{image_size}} 缩略图尺寸,不可直接使用原图:widthxheight(eg: 1000x,1x1)
5
- @param {{type}} 指定卡片类型,若为static则需要固定背景图高度,目前是slide卡片
6
- @param {{image_height}} 背景图高度:固定高度(eg:'200px')或者尺寸(eg: 'large', 'medium','small', 'normal')
7
- {% endcomment %}
8
-
9
- {% assign defaultImg = 'oss/operation/bbb5b6c710007fbaa2ad1adc6800ee6c.png' %}
10
- {% if image_src == blank %}
11
- {% assign src = defaultImg %}
12
- {% else %}
13
- {% assign src = image_src %}
14
- {% endif %}
15
-
16
-
17
- <div {% if type == 'cover' %}style="height: 100%;"{% endif %} {% if section.settings.is_full_width != true and section.settings.is_full_width != nil %}class="container"{% endif %}>
18
- <div {% if type == 'cover' %}style="height: 100%;"{% endif %} class="hero hero--{{id}} {% if url %}url-cursor{% endif %}
19
- {% if section.settings.is_full_width != true and section.settings.is_full_width != nil %}row{% endif %}
20
- ">
21
- <a {% if url %}href="{{url}}"{% endif %}
22
- {% if link_type == "web" %}target="_blank"{% endif %}
23
- {% if section.settings.is_full_width != true and section.settings.is_full_width != nil %}
24
- class="col-12"
25
- {% endif %}
26
- style="width: 100%;
27
- position: relative;
28
- display: flex;
29
- justify-content: center;
30
- overflow: hidden;
31
- margin: auto;"
32
- >
33
- <div class="hero__bg lazyload"
34
- title="{{ images[src].alt | escape }}"
35
- data-bgset="{% include 'bgset', image: images[src] %}"
36
- data-sizes="auto"
37
- style="
38
- background-size: cover;
39
- background-position: {{alignment}};
40
- position: relative;
41
- width: 100%;
42
- min-height: 100%;
43
- height: {{image_height}};
44
- "
45
- >
46
- {% if image_height == 'origin' %}
47
- {% comment %} 拿不到图片的高度,需要撑开 {% endcomment %}
48
- <img src="{{ src | img_url: '100x' }}" style="width: 100%;opacity: 0;min-height: 100%;" alt="{{images[src].alt | escape}}"/>
49
- {% endif %}
50
- {% comment %} 灰色蒙层以及文案 {% endcomment %}
51
- {% if title or text or button_label %}
52
- <div class="hero__inner" style="
53
- width: 100%;
54
- margin: auto;"
55
- >
56
- <div class="page-width-outer">
57
- <div class="page-width">
58
- {% for block in section.blocks %}
59
- {% if block.type == 'heading' %}
60
- <h2
61
- class="mega-title mega-title-{{text_size}}"
62
- data-theme-editor-setting="{{titlePath}}"
63
- >
64
- {{ title | escape }}
65
- </h2>
66
- {% endif %}
67
- {% if block.type == 'text' %}
68
- <div
69
- class="mega-subtitle mega-subtitle-{{text_size}}"
70
- data-theme-editor-setting="{{textPath}}"
71
- >
72
- {{ text }}
73
- </div>
74
- {% endif %}
75
- {% if block.type == 'button' %}
76
- <object><a
77
- class="hero-btn btn btn-primary"
78
- href="{{button_link}}"
79
- {% if button_link_type == 'web' %}
80
- target="_blank"
81
- {% endif %}
82
- >
83
- {{ button_label | escape }}
84
- </a></object>
85
- {% endif %}
86
- {% endfor %}
87
- </div>
88
- </div>
89
- </div>
90
- {% endif %}
91
- </div>
92
- </a>
93
- </div>
94
- </div>
@@ -1 +0,0 @@
1
- <svg width="100" height="102" viewBox="0 0 100 102" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 50c.145-10.607 1.987-19.389 7.373-24.627C30.611 19.987 39.393 18.145 50 18c10.607.145 19.389 1.987 24.627 7.373C80.013 30.611 81.855 39.393 82 50c-.145 10.607-1.987 19.389-7.373 24.627C69.389 80.013 60.607 81.855 50 82c-10.607-.145-19.389-1.987-24.627-7.373C19.987 69.389 18.145 60.607 18 50z" fill="#292929" fill-opacity=".24" filter="url(#filter0_f_3732_562)"/><path d="M20.595 48.334c.134-9.768 1.83-17.855 6.79-22.679 4.823-4.96 12.911-6.656 22.68-6.79 9.767.134 17.855 1.83 22.678 6.79 4.96 4.824 6.657 12.911 6.79 22.68-.133 9.767-1.83 17.855-6.79 22.678-4.823 4.96-12.911 6.657-22.679 6.79-9.768-.133-17.856-1.83-22.68-6.79-4.96-4.823-6.655-12.911-6.79-22.679z" fill="#fff" filter="url(#filter1_d_3732_562)"/><path d="M59.905 46.62c1.323.763 1.323 2.672 0 3.436l-13.392 7.732c-1.323.764-2.976-.19-2.976-1.718V40.605c0-1.527 1.653-2.481 2.976-1.718l13.392 7.733z" fill="#292929"/><defs><filter id="filter0_f_3732_562" x="0" y="0" width="100" height="100" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="9" result="effect1_foregroundBlur_3732_562"/></filter><filter id="filter1_d_3732_562" x=".595" y="2.865" width="98.939" height="98.939" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="4"/><feGaussianBlur stdDeviation="10"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix values="0 0 0 0 0.160784 0 0 0 0 0.160784 0 0 0 0 0.160784 0 0 0 0.03 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_3732_562"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_3732_562" result="shape"/></filter></defs></svg>
@@ -1,4 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M0.823242 16.1724C0.892266 11.131 1.76781 6.95657 4.3278 4.46696C6.81741 1.90697 10.9918 1.03143 16.0332 0.962402C21.0747 1.03143 25.2491 1.90697 27.7387 4.46696C30.2987 6.95657 31.1742 11.131 31.2432 16.1724C31.1742 21.2138 30.2987 25.3882 27.7387 27.8778C25.2491 30.4378 21.0747 31.3134 16.0332 31.3824C10.9918 31.3134 6.81741 30.4378 4.3278 27.8778C1.76781 25.3882 0.892266 21.2138 0.823242 16.1724Z" fill="white"/>
3
- <path d="M21.113 15.2873C21.7957 15.6814 21.7957 16.6668 21.113 17.061L14.2006 21.0519C13.5179 21.446 12.6645 20.9533 12.6645 20.165L12.6645 12.1833C12.6645 11.395 13.5179 10.9023 14.2006 11.2964L21.113 15.2873Z" fill="#292929"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M0 10C0.0453804 6.68544 0.621018 3.94094 2.30412 2.30412C3.94094 0.621018 6.68544 0.0453804 10 0C13.3146 0.0453804 16.0591 0.621018 17.6959 2.30412C19.379 3.94094 19.9546 6.68544 20 10C19.9546 13.3146 19.379 16.0591 17.6959 17.6959C16.0591 19.379 13.3146 19.9546 10 20C6.68544 19.9546 3.94094 19.379 2.30412 17.6959C0.621018 16.0591 0.0453804 13.3146 0 10Z" fill="white"/>
3
- <path d="M13.3391 9.41813C13.788 9.67728 13.788 10.3251 13.3391 10.5843L8.79453 13.2081C8.34568 13.4673 7.78462 13.1433 7.78462 12.625L7.78462 7.37737C7.78462 6.85909 8.34568 6.53516 8.79453 6.7943L13.3391 9.41813Z" fill="#292929"/>
4
- </svg>
@@ -1,22 +0,0 @@
1
- {% comment %}
2
- class: 传入的class
3
- src: 传入的图片路径
4
- style: 传入节点样式
5
- alt: 传入图片信息
6
- other: 传入其他属性和值
7
- {% endcomment %}
8
- <img
9
- id="{{id}}"
10
- src="{{shop.default_img}}"
11
- class="lazyload {{class}} imglazy"
12
- {% if lazysize %}
13
- data-src="{{src | img_url: lazysize}}"
14
- {% else %}
15
-
16
- data-src="{{src | img_url: '{width}x'}}"
17
- data-sizes="auto"
18
- {% endif %}
19
- style="{{style}}"
20
- alt="{{alt | default: images[src].alt | escape}}"
21
- {{other}}
22
- >
@@ -1,36 +0,0 @@
1
- {% comment %}
2
- class: 传入的class
3
- src: 传入的图片路径
4
- style: 传入节点样式
5
- alt: 传入图片信息
6
- original: 是否原图
7
- other: 传入其他属性和值
8
- {% endcomment %}
9
- <script type="text/html" id="lazyimg_art">
10
- <% if (image.original) { %>
11
- <img
12
- src="{{shop.default_img}}"
13
- id="<%= image.id || '' %>"
14
- class="imglazy lazyload <%= image.class || '' %>"
15
- data-src="<%= image.src %>"
16
- style="<%= image.style || '' %>"
17
- alt="<%= image.alt || '' %>"
18
- <%= other %>
19
- <% } else { %>
20
- <img
21
- src="{{shop.default_img}}"
22
- id="<%= image.id || '' %>"
23
- class="imglazy lazyload <%= image.class || '' %>"
24
- <% if (image.size) { %>
25
- data-src="<%= $imports.reset_image(image.src, size) %>"
26
- <% } else { %>
27
- data-src="<%= $imports.reset_image(image.src, '{width}') %>"
28
-
29
- data-sizes="auto"
30
- <% } %>
31
- style="<%= image.style || '' %>"
32
- alt="<%= image.alt || '' %>"
33
- <%= other %>
34
- <% } %>
35
- >
36
- </script>
@@ -1,41 +0,0 @@
1
- <script>
2
- /* eslint-disable */
3
-
4
- window.lazySizesConfig = window.lazySizesConfig || {};
5
- window.lazySizesConfig.rias = window.lazySizesConfig.rias || {};
6
- window.lazySizesConfig.rias.widths = [48, 180, 360, 540, 720, 900, 1024, 1280, 1366, 1440, 1536, 1600, 1920, 2056, 2560, 2732, 2880, 3072, 3200, 3840];
7
- window.lazySizesConfig.rias.modifyOptions = function (data) {
8
- data.detail.width = data.detail.widths.filter(function (w) {
9
- return w > (window.devicePixelRatio || 1) * Math.max(data.target.offsetWidth, parseInt(data.target.getAttribute("width")) || 0);
10
- })[0];
11
- };
12
-
13
-
14
- /*! lazysizes - v5.1.0 */
15
- !function (a, b) { var c = b(a, a.document); a.lazySizes = c, "object" == typeof module && module.exports && (module.exports = c) }("undefined" != typeof window ? window : {}, function (a, b) { "use strict"; var c, d; if (function () { var b, c = { lazyClass: "lazyload", loadedClass: "lazyloaded", loadingClass: "lazyloading", preloadClass: "lazypreload", errorClass: "lazyerror", autosizesClass: "lazyautosizes", srcAttr: "data-src", srcsetAttr: "data-srcset", sizesAttr: "data-sizes", minSize: 40, customMedia: {}, init: !0, expFactor: 1.5, hFac: .8, loadMode: 2, loadHidden: !0, ricTimeout: 0, throttleDelay: 125 }; d = a.lazySizesConfig || a.lazysizesConfig || {}; for (b in c) b in d || (d[b] = c[b]) }(), !b || !b.getElementsByClassName) return { init: function () { }, cfg: d, noSupport: !0 }; var e = b.documentElement, f = a.Date, g = a.HTMLPictureElement, h = "addEventListener", i = "getAttribute", j = a[h], k = a.setTimeout, l = a.requestAnimationFrame || k, m = a.requestIdleCallback, n = /^picture$/i, o = ["load", "error", "lazyincluded", "_lazyloaded"], p = {}, q = Array.prototype.forEach, r = function (a, b) { return p[b] || (p[b] = new RegExp("(\\s|^)" + b + "(\\s|$)")), p[b].test(a[i]("class") || "") && p[b] }, s = function (a, b) { r(a, b) || a.setAttribute("class", (a[i]("class") || "").trim() + " " + b) }, t = function (a, b) { var c; (c = r(a, b)) && a.setAttribute("class", (a[i]("class") || "").replace(c, " ")) }, u = function (a, b, c) { var d = c ? h : "removeEventListener"; c && u(a, b), o.forEach(function (c) { a[d](c, b) }) }, v = function (a, d, e, f, g) { var h = b.createEvent("Event"); return e || (e = {}), e.instance = c, h.initEvent(d, !f, !g), h.detail = e, a.dispatchEvent(h), h }, w = function (b, c) { var e; !g && (e = a.picturefill || d.pf) ? (c && c.src && !b[i]("srcset") && b.setAttribute("srcset", c.src), e({ reevaluate: !0, elements: [b] })) : c && c.src && (b.src = c.src) }, x = function (a, b) { return (getComputedStyle(a, null) || {})[b] }, y = function (a, b, c) { for (c = c || a.offsetWidth; c < d.minSize && b && !a._lazysizesWidth;)c = b.offsetWidth, b = b.parentNode; return c }, z = function () { var a, c, d = [], e = [], f = d, g = function () { var b = f; for (f = d.length ? e : d, a = !0, c = !1; b.length;)b.shift()(); a = !1 }, h = function (d, e) { a && !e ? d.apply(this, arguments) : (f.push(d), c || (c = !0, (b.hidden ? k : l)(g))) }; return h._lsFlush = g, h }(), A = function (a, b) { return b ? function () { z(a) } : function () { var b = this, c = arguments; z(function () { a.apply(b, c) }) } }, B = function (a) { var b, c = 0, e = d.throttleDelay, g = d.ricTimeout, h = function () { b = !1, c = f.now(), a() }, i = m && g > 49 ? function () { m(h, { timeout: g }), g !== d.ricTimeout && (g = d.ricTimeout) } : A(function () { k(h) }, !0); return function (a) { var d; (a = !0 === a) && (g = 33), b || (b = !0, d = e - (f.now() - c), d < 0 && (d = 0), a || d < 9 ? i() : k(i, d)) } }, C = function (a) { var b, c, d = 99, e = function () { b = null, a() }, g = function () { var a = f.now() - c; a < d ? k(g, d - a) : (m || e)(e) }; return function () { c = f.now(), b || (b = k(g, d)) } }, D = function () { var g, l, m, o, p, y, D, F, G, H, I, J, K = /^img$/i, L = /^iframe$/i, M = "onscroll" in a && !/(gle|ing)bot/.test(navigator.userAgent), N = 0, O = 0, P = 0, Q = -1, R = function (a) { P--, (!a || P < 0 || !a.target) && (P = 0) }, S = function (a) { return null == J && (J = "hidden" == x(b.body, "visibility")), J || "hidden" != x(a.parentNode, "visibility") && "hidden" != x(a, "visibility") }, T = function (a, c) { var d, f = a, g = S(a); for (F -= c, I += c, G -= c, H += c; g && (f = f.offsetParent) && f != b.body && f != e;)(g = (x(f, "opacity") || 1) > 0) && "visible" != x(f, "overflow") && (d = f.getBoundingClientRect(), g = H > d.left && G < d.right && I > d.top - 1 && F < d.bottom + 1); return g }, U = function () { var a, f, h, j, k, m, n, p, q, r, s, t, u = c.elements; if ((o = d.loadMode) && P < 8 && (a = u.length)) { for (f = 0, Q++; f < a; f++)if (u[f] && !u[f]._lazyRace) if (!M || c.prematureUnveil && c.prematureUnveil(u[f])) aa(u[f]); else if ((p = u[f][i]("data-expand")) && (m = 1 * p) || (m = O), r || (r = !d.expand || d.expand < 1 ? e.clientHeight > 500 && e.clientWidth > 500 ? 500 : 370 : d.expand, c._defEx = r, s = r * d.expFactor, t = d.hFac, J = null, O < s && P < 1 && Q > 2 && o > 2 && !b.hidden ? (O = s, Q = 0) : O = o > 1 && Q > 1 && P < 6 ? r : N), q !== m && (y = innerWidth + m * t, D = innerHeight + m, n = -1 * m, q = m), h = u[f].getBoundingClientRect(), (I = h.bottom) >= n && (F = h.top) <= D && (H = h.right) >= n * t && (G = h.left) <= y && (I || H || G || F) && (d.loadHidden || S(u[f])) && (l && P < 3 && !p && (o < 3 || Q < 4) || T(u[f], m))) { if (aa(u[f]), k = !0, P > 9) break } else !k && l && !j && P < 4 && Q < 4 && o > 2 && (g[0] || d.preloadAfterLoad) && (g[0] || !p && (I || H || G || F || "auto" != u[f][i](d.sizesAttr))) && (j = g[0] || u[f]); j && !k && aa(j) } }, V = B(U), W = function (a) { var b = a.target; if (b._lazyCache) return void delete b._lazyCache; R(a), s(b, d.loadedClass), t(b, d.loadingClass), u(b, Y), v(b, "lazyloaded") }, X = A(W), Y = function (a) { X({ target: a.target }) }, Z = function (a, b) { try { a.contentWindow.location.replace(b) } catch (c) { a.src = b } }, $ = function (a) { var b, c = a[i](d.srcsetAttr); (b = d.customMedia[a[i]("data-media") || a[i]("media")]) && a.setAttribute("media", b), c && a.setAttribute("srcset", c) }, _ = A(function (a, b, c, e, f) { var g, h, j, l, o, p; (o = v(a, "lazybeforeunveil", b)).defaultPrevented || (e && (c ? s(a, d.autosizesClass) : a.setAttribute("sizes", e)), h = a[i](d.srcsetAttr), g = a[i](d.srcAttr), f && (j = a.parentNode, l = j && n.test(j.nodeName || "")), p = b.firesLoad || "src" in a && (h || g || l), o = { target: a }, s(a, d.loadingClass), p && (clearTimeout(m), m = k(R, 2500), u(a, Y, !0)), l && q.call(j.getElementsByTagName("source"), $), h ? a.setAttribute("srcset", h) : g && !l && (L.test(a.nodeName) ? Z(a, g) : a.src = g), f && (h || l) && w(a, { src: g })), a._lazyRace && delete a._lazyRace, t(a, d.lazyClass), z(function () { var b = a.complete && a.naturalWidth > 1; p && !b || (b && s(a, "ls-is-cached"), W(o), a._lazyCache = !0, k(function () { "_lazyCache" in a && delete a._lazyCache }, 9)), "lazy" == a.loading && P-- }, !0) }), aa = function (a) { if (!a._lazyRace) { var b, c = K.test(a.nodeName), e = c && (a[i](d.sizesAttr) || a[i]("sizes")), f = "auto" == e; (!f && l || !c || !a[i]("src") && !a.srcset || a.complete || r(a, d.errorClass) || !r(a, d.lazyClass)) && (b = v(a, "lazyunveilread").detail, f && E.updateElem(a, !0, a.offsetWidth), a._lazyRace = !0, P++, _(a, b, f, e, c)) } }, ba = C(function () { d.loadMode = 3, V() }), ca = function () { 3 == d.loadMode && (d.loadMode = 2), ba() }, da = function () { if (!l) { if (f.now() - p < 999) return void k(da, 999); l = !0, d.loadMode = 3, V(), j("scroll", ca, !0) } }; return { _: function () { p = f.now(), c.elements = b.getElementsByClassName(d.lazyClass), g = b.getElementsByClassName(d.lazyClass + " " + d.preloadClass), j("scroll", V, !0), j("resize", V, !0), a.MutationObserver ? new MutationObserver(V).observe(e, { childList: !0, subtree: !0, attributes: !0 }) : (e[h]("DOMNodeInserted", V, !0), e[h]("DOMAttrModified", V, !0), setInterval(V, 999)), j("hashchange", V, !0), ["focus", "mouseover", "click", "load", "transitionend", "animationend"].forEach(function (a) { b[h](a, V, !0) }), /d$|^c/.test(b.readyState) ? da() : (j("load", da), b[h]("DOMContentLoaded", V), k(da, 2e4)), c.elements.length ? (U(), z._lsFlush()) : V() }, checkElems: V, unveil: aa, _aLSL: ca } }(), E = function () { var a, c = A(function (a, b, c, d) { var e, f, g; if (a._lazysizesWidth = d, d += "px", a.setAttribute("sizes", d), n.test(b.nodeName || "")) for (e = b.getElementsByTagName("source"), f = 0, g = e.length; f < g; f++)e[f].setAttribute("sizes", d); c.detail.dataAttr || w(a, c.detail) }), e = function (a, b, d) { var e, f = a.parentNode; f && (d = y(a, f, d), e = v(a, "lazybeforesizes", { width: d, dataAttr: !!b }), e.defaultPrevented || (d = e.detail.width) && d !== a._lazysizesWidth && c(a, f, e, d)) }, f = function () { var b, c = a.length; if (c) for (b = 0; b < c; b++)e(a[b]) }, g = C(f); return { _: function () { a = b.getElementsByClassName(d.autosizesClass), j("resize", g) }, checkElems: g, updateElem: e } }(), F = function () { !F.i && b.getElementsByClassName && (F.i = !0, E._(), D._()) }; return k(function () { d.init && F() }), c = { cfg: d, autoSizer: E, loader: D, init: F, uP: w, aC: s, rC: t, hC: r, fire: v, gW: y, rAF: z } });
16
-
17
- /*! lazysizes-rias - v5.1.0 */
18
- !function (a, b) { var c = function () { b(a.lazySizes), a.removeEventListener("lazyunveilread", c, !0) }; b = b.bind(null, a, a.document), "object" == typeof module && module.exports ? b(require("lazysizes")) : a.lazySizes ? c() : a.addEventListener("lazyunveilread", c, !0) }(window, function (a, b, c) { "use strict"; function d(b, c) { var d, e, f, g, h = a.getComputedStyle(b); e = b.parentNode, g = { isPicture: !(!e || !n.test(e.nodeName || "")) }, f = function (a, c) { var d = b.getAttribute("data-" + a); if (!d) { var e = h.getPropertyValue("--ls-" + a); e && (d = e.trim()) } if (d) { if ("true" == d) d = !0; else if ("false" == d) d = !1; else if (m.test(d)) d = parseFloat(d); else if ("function" == typeof j[a]) d = j[a](b, d); else if (r.test(d)) try { d = JSON.parse(d) } catch (a) { } g[a] = d } else a in j && "function" != typeof j[a] ? g[a] = j[a] : c && "function" == typeof j[a] && (g[a] = j[a](b, d)) }; for (d in j) f(d); return c.replace(q, function (a, b) { b in g || f(b, !0) }), g } function e(a, b) { var c = [], d = function (a, c) { return l[typeof b[c]] ? b[c] : a }; return c.srcset = [], b.absUrl && (t.setAttribute("href", a), a = t.href), a = ((b.prefix || "") + a + (b.postfix || "")).replace(q, d), b.widths.forEach(function (d) { var e = b.widthmap[d] || d, f = b.aspectratio || b.ratio, g = !b.aspectratio && j.traditionalRatio, h = { u: a.replace(o, e).replace(p, f ? g ? Math.round(d * f) : Math.round(d / f) : ""), w: d }; c.push(h), c.srcset.push(h.c = h.u + " " + d + "w") }), c } function f(a, c, d) { var f = 0, g = 0, h = d; if (a) { if ("container" === c.ratio) { for (f = h.scrollWidth, g = h.scrollHeight; !(f && g || h === b);)h = h.parentNode, f = h.scrollWidth, g = h.scrollHeight; f && g && (c.ratio = g / f) } a = e(a, c), a.isPicture = c.isPicture, v && "IMG" == d.nodeName.toUpperCase() ? d.removeAttribute(i.srcsetAttr) : d.setAttribute(i.srcsetAttr, a.srcset.join(", ")), Object.defineProperty(d, "_lazyrias", { value: a, writable: !0 }) } } function g(a, b) { var e = d(a, b); return j.modifyOptions.call(a, { target: a, details: e, detail: e }), c.fire(a, "lazyriasmodifyoptions", e), e } function h(a) { return a.getAttribute(a.getAttribute("data-srcattr") || j.srcAttr) || a.getAttribute(i.srcsetAttr) || a.getAttribute(i.srcAttr) || a.getAttribute("data-pfsrcset") || "" } var i, j, k = c.cfg, l = { string: 1, number: 1 }, m = /^\-*\+*\d+\.*\d*$/, n = /^picture$/i, o = /\s*\{\s*width\s*\}\s*/i, p = /\s*\{\s*height\s*\}\s*/i, q = /\s*\{\s*([a-z0-9]+)\s*\}\s*/gi, r = /^\[.*\]|\{.*\}$/, s = /^(?:auto|\d+(px)?)$/, t = b.createElement("a"), u = b.createElement("img"), v = "srcset" in u && !("sizes" in u), w = !!a.HTMLPictureElement && !v; !function () { var a, b = function () { }, d = { prefix: "", postfix: "", srcAttr: "data-src", absUrl: !1, modifyOptions: b, widthmap: {}, ratio: !1, traditionalRatio: !1, aspectratio: !1 }; i = c && c.cfg, i.supportsType || (i.supportsType = function (a) { return !a }), i.rias || (i.rias = {}), "widths" in (j = i.rias) || (j.widths = [], function (a) { for (var b, c = 0; !b || b < 3e3;)c += 5, c > 30 && (c += 1), b = 36 * c, a.push(b) }(j.widths)); for (a in d) a in j || (j[a] = d[a]) }(), addEventListener("lazybeforesizes", function (a) { if (a.detail.instance == c) { var b, d, e, k, l, m, n, p, q, r, t, u, v; if (b = a.target, a.detail.dataAttr && !a.defaultPrevented && !j.disabled && (q = b.getAttribute(i.sizesAttr) || b.getAttribute("sizes")) && s.test(q)) { if (d = h(b), e = g(b, d), t = o.test(e.prefix) || o.test(e.postfix), e.isPicture && (k = b.parentNode)) for (l = k.getElementsByTagName("source"), m = 0, n = l.length; m < n; m++)(t || o.test(p = h(l[m]))) && (f(p, e, l[m]), u = !0); t || o.test(d) ? (f(d, e, b), u = !0) : u && (v = [], v.srcset = [], v.isPicture = !0, Object.defineProperty(b, "_lazyrias", { value: v, writable: !0 })), u && (w ? b.removeAttribute(i.srcAttr) : "auto" != q && (r = { width: parseInt(q, 10) }, x({ target: b, detail: r }))) } } }, !0); var x = function () { var d = function (a, b) { return a.w - b.w }, e = function (a) { var b, c, d = a.length, e = a[d - 1], f = 0; for (f; f < d; f++)if (e = a[f], e.d = e.w / a.w, e.d >= a.d) { !e.cached && (b = a[f - 1]) && b.d > a.d - .13 * Math.pow(a.d, 2.2) && (c = Math.pow(b.d - .6, 1.6), b.cached && (b.d += .15 * c), b.d + (e.d - a.d) * c > a.d && (e = b)); break } return e }, f = function (a, b) { var d; return !a._lazyrias && c.pWS && (d = c.pWS(a.getAttribute(i.srcsetAttr || ""))).length && (Object.defineProperty(a, "_lazyrias", { value: d, writable: !0 }), b && a.parentNode && (d.isPicture = "PICTURE" == a.parentNode.nodeName.toUpperCase())), a._lazyrias }, g = function (b) { var d = a.devicePixelRatio || 1, e = c.getX && c.getX(b); return Math.min(e || d, 2.4, d) }, h = function (b, c) { var h, i, j, k, l, m; if (l = b._lazyrias, l.isPicture && a.matchMedia) for (i = 0, h = b.parentNode.getElementsByTagName("source"), j = h.length; i < j; i++)if (f(h[i]) && !h[i].getAttribute("type") && (!(k = h[i].getAttribute("media")) || (matchMedia(k) || {}).matches)) { l = h[i]._lazyrias; break } return (!l.w || l.w < c) && (l.w = c, l.d = g(b), m = e(l.sort(d))), m }, j = function (d) { if (d.detail.instance == c) { var e, g = d.target; if (!v && (a.respimage || a.picturefill || k.pf)) return void b.removeEventListener("lazybeforesizes", j); ("_lazyrias" in g || d.detail.dataAttr && f(g, !0)) && (e = h(g, d.detail.width)) && e.u && g._lazyrias.cur != e.u && (g._lazyrias.cur = e.u, e.cached = !0, c.rAF(function () { g.setAttribute(i.srcAttr, e.u), g.setAttribute("src", e.u) })) } }; return w ? j = function () { } : addEventListener("lazybeforesizes", j), j }() });
19
-
20
-
21
- /*! lazysizes-data-bgset - v5.1.0 */
22
- !function (a, b) { var c = function () { b(a.lazySizes), a.removeEventListener("lazyunveilread", c, !0) }; b = b.bind(null, a, a.document), "object" == typeof module && module.exports ? b(require("lazysizes")) : a.lazySizes ? c() : a.addEventListener("lazyunveilread", c, !0) }(window, function (a, b, c) { "use strict"; if (a.addEventListener) { var d = c.cfg, e = /\s+/g, f = /\s*\|\s+|\s+\|\s*/g, g = /^(.+?)(?:\s+\[\s*(.+?)\s*\])(?:\s+\[\s*(.+?)\s*\])?$/, h = /^\s*\(*\s*type\s*:\s*(.+?)\s*\)*\s*$/, i = /\(|\)|'/, j = { contain: 1, cover: 1 }, k = function (a) { var b = c.gW(a, a.parentNode); return (!a._lazysizesWidth || b > a._lazysizesWidth) && (a._lazysizesWidth = b), a._lazysizesWidth }, l = function (a) { var b; return b = (getComputedStyle(a) || { getPropertyValue: function () { } }).getPropertyValue("background-size"), !j[b] && j[a.style.backgroundSize] && (b = a.style.backgroundSize), b }, m = function (a, b) { if (b) { var c = b.match(h); c && c[1] ? a.setAttribute("type", c[1]) : a.setAttribute("media", d.customMedia[b] || b) } }, n = function (a, c, h) { var i = b.createElement("picture"), j = c.getAttribute(d.sizesAttr), k = c.getAttribute("data-ratio"), l = c.getAttribute("data-optimumx"); c._lazybgset && c._lazybgset.parentNode == c && c.removeChild(c._lazybgset), Object.defineProperty(h, "_lazybgset", { value: c, writable: !0 }), Object.defineProperty(c, "_lazybgset", { value: i, writable: !0 }), a = a.replace(e, " ").split(f), i.style.display = "none", h.className = d.lazyClass, 1 != a.length || j || (j = "auto"), a.forEach(function (a) { var c, e = b.createElement("source"); j && "auto" != j && e.setAttribute("sizes", j), (c = a.match(g)) ? (e.setAttribute(d.srcsetAttr, c[1]), m(e, c[2]), m(e, c[3])) : e.setAttribute(d.srcsetAttr, a), i.appendChild(e) }), j && (h.setAttribute(d.sizesAttr, j), c.removeAttribute(d.sizesAttr), c.removeAttribute("sizes")), l && h.setAttribute("data-optimumx", l), k && h.setAttribute("data-ratio", k), i.appendChild(h), c.appendChild(i) }, o = function (a) { if (a.target._lazybgset) { var b = a.target, d = b._lazybgset, e = b.currentSrc || b.src; if (e) { var f = c.fire(d, "bgsetproxy", { src: e, useSrc: i.test(e) ? JSON.stringify(e) : e }); f.defaultPrevented || (d.style.backgroundImage = "url(" + f.detail.useSrc + ")") } b._lazybgsetLoading && (c.fire(d, "_lazyloaded", {}, !1, !0), delete b._lazybgsetLoading) } }; addEventListener("lazybeforeunveil", function (a) { var d, e, f; !a.defaultPrevented && (d = a.target.getAttribute("data-bgset")) && (f = a.target, e = b.createElement("img"), e.alt = "", e._lazybgsetLoading = !0, a.detail.firesLoad = !0, n(d, f, e), setTimeout(function () { c.loader.unveil(e), c.rAF(function () { c.fire(e, "_lazyloaded", {}, !0, !0), e.complete && o({ target: e }) }) })) }), b.addEventListener("load", o, !0), a.addEventListener("lazybeforesizes", function (a) { if (a.detail.instance == c && a.target._lazybgset && a.detail.dataAttr) { var b = a.target._lazybgset, d = l(b); j[d] && (a.target._lazysizesParentFit = d, c.rAF(function () { a.target.setAttribute("data-parent-fit", d), a.target._lazysizesParentFit && delete a.target._lazysizesParentFit })) } }, !0), b.documentElement.addEventListener("lazybeforesizes", function (a) { !a.defaultPrevented && a.target._lazybgset && a.detail.instance == c && (a.detail.width = k(a.target._lazybgset)) }) } });
23
-
24
- /*! lazysizes data-srcs data-bgs plugin */
25
- document.addEventListener('lazybeforesizes', function (e) {
26
- var attrVal = e.target.getAttribute('data-srcs');
27
- var targetWidth = e.target.clientWidth;
28
- if (!attrVal) return;
29
- var srcs = attrVal.split(",");
30
- var widths = [48, 180, 360, 540, 720, 900, 1024, 1280, 1366, 1440, 1536, 1600, 1920, 2056, 2560, 2732, 2880, 3072, 3200, 3840];
31
- srcs = [srcs[0] || srcs[1], srcs[1] || srcs[0]];
32
- var availableWidths = widths.filter(function (w) {
33
- return w <= Math.max(targetWidth, widths[0]) * window.devicePixelRatio;
34
- });
35
- var srcset = availableWidths.map(function (w) {
36
- return srcs[window.innerWidth <= (window.breakpoint || 768) ? 0 : 1].replace('{width}', w) + " " + w + "w"
37
- }).join(", ");
38
- e.target.setAttribute("srcset", srcset);
39
- e.target.setAttribute("size", targetWidth + "px");
40
- });
41
- </script>
@@ -1,2 +0,0 @@
1
- {% unless link.url == blank or link.type != 'web' or link.url contains shop.domain %} target="_blank" {% endunless %}
2
- {% if link.url != blank %} href="{{ link.url }}" {% endif %}
@@ -1,48 +0,0 @@
1
- {% comment %}
2
- description: 分页template
3
- {% endcomment %}
4
- {% use 'pagination.css' %}
5
- <script id="tpl-pagination" type="text/html">
6
- <div class="sep-pagination">
7
- <span class="d-none d-md-block sep-pagination__sum"><%= page %>/<%= total %></span>
8
- <span class="d-block d-md-none sep-pagination__sum">
9
- <input type="number" class="sep-pagination-mobile_input" value="<%= page %>">/ <%= total %>
10
- <button class="sep-pagination-mobile_goto">GO</button>
11
- </span>
12
- <span class="sep-pagination__pagesize"><%= labelPageSize.replace('{% raw %}{{ count }}{% endraw %}',pageSize) %></span>
13
-
14
- <a class="sep-pagination__link sep-pagination__prev" href="javascript:;" data-page="<%= page-1 %>"
15
- <% if(page!=1){ %> style="visibility: visible;" <% } else { %> style="visibility: hidden;" <% } %>
16
- >
17
- <%= labelPrev %>
18
- </a>
19
-
20
- <% if(total<=delimiterPageSize){ %>
21
- <% for(var i=1;i<=total;i++){ %>
22
- <a class="sep-pagination__link <%= (page==i?"sep-pagination__link_active":"") %>" data-page="<%= i %>" href="javascript:;"><%= i %></a>
23
- <% } %>
24
- <% }else{ %>
25
- <a class="sep-pagination__link <%= (page==1?"sep-pagination__link_active":"") %>" data-page="1" href="javascript:;">1</a>
26
- <% if(page>3){ %>
27
- <span class="sep-pagination__more">...</span>
28
- <% } %>
29
- <% for(var i= $imports.clamp(page-1,2,total-3);i<= $imports.clamp(page+1,4,total-1) ;i++){ %>
30
- <a class="sep-pagination__link <%= (page==i?"sep-pagination__link_active":"") %>" data-page="<%= i %>" href="javascript:;"><%= i %></a>
31
- <% } %>
32
-
33
- <% if(page<total-2){ %>
34
- <span class="sep-pagination__more">...</span>
35
- <% } %>
36
-
37
- <a class="sep-pagination__link <%= (page==total?"sep-pagination__link_active":"") %>" data-page="<%= total %>" href="javascript:;"><%= total %></a>
38
- <% } %>
39
-
40
- <a class="sep-pagination__link sep-pagination__next" href="javascript:;" data-page="<%= page+1 %>"
41
- <% if(page!=total){ %> style="visibility: visible;" <% } else { %> style="visibility: hidden;" <% } %>
42
- >
43
- <%= labelNext %>
44
- </a>
45
-
46
- </div>
47
- </script>
48
-