cloudcommerce 0.0.85 → 0.0.86
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.
- package/.vscode/settings.json +0 -3
- package/CHANGELOG.md +8 -0
- package/action.yml +1 -0
- package/package.json +1 -1
- package/packages/api/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/events/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/storefront/dist/server/entry.mjs +13 -8
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/helpers/image.ts +8 -3
- package/packages/storefront/src/lib/layouts/Base.astro +5 -5
- package/packages/types/package.json +1 -1
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.86](https://github.com/ecomplus/cloud-commerce/compare/v0.0.85...v0.0.86) (2022-09-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **storefront:** Add `DEPLOY_RAND` to transformed images URL for cache control ([6fdce8d](https://github.com/ecomplus/cloud-commerce/commit/6fdce8db91a2bede01ae40b1042175067a0ba9a6))
|
|
11
|
+
* **storefront:** Cannot use tailwind syntax (`theme` function) on Astro styles (yet) ([92109c9](https://github.com/ecomplus/cloud-commerce/commit/92109c9736384ce2158ed6bd0f5e5510934a5c16))
|
|
12
|
+
|
|
5
13
|
### [0.0.85](https://github.com/ecomplus/cloud-commerce/compare/v0.0.84...v0.0.85) (2022-09-23)
|
|
6
14
|
|
|
7
15
|
|
package/action.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.86",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -2219,11 +2219,11 @@ const $$Base = createComponent(async ($$result, $$props, $$slots) => {
|
|
|
2219
2219
|
{ props: { "is:global": true, "define:vars": colorCSSVars }, children: `:root {
|
|
2220
2220
|
--content-max-width: 80rem;
|
|
2221
2221
|
--white: #fff;
|
|
2222
|
-
--gray-50:
|
|
2223
|
-
--gray-200:
|
|
2224
|
-
--gray-700:
|
|
2225
|
-
--gray-800:
|
|
2226
|
-
--gray-900:
|
|
2222
|
+
--gray-50: #f9fafb;
|
|
2223
|
+
--gray-200: #e5e7eb;
|
|
2224
|
+
--gray-700: #374151;
|
|
2225
|
+
--gray-800: #1f2937;
|
|
2226
|
+
--gray-900: #111827;
|
|
2227
2227
|
--surface-color: var(--gray-50);
|
|
2228
2228
|
--surface-border-color: var(--gray-200);
|
|
2229
2229
|
--yiq-text-light: var(--white);
|
|
@@ -2404,17 +2404,22 @@ const tryImageSize = (src) => {
|
|
|
2404
2404
|
}
|
|
2405
2405
|
return dimensions;
|
|
2406
2406
|
};
|
|
2407
|
-
const getImage = (options) => {
|
|
2407
|
+
const getImage = async (options) => {
|
|
2408
2408
|
const { src } = options;
|
|
2409
|
+
let imgAttrs;
|
|
2409
2410
|
if (typeof src === "string" && !options.aspectRatio && (!options.width || !options.height)) {
|
|
2410
2411
|
const { width, height } = tryImageSize(src);
|
|
2411
|
-
|
|
2412
|
+
imgAttrs = await getImage$1({
|
|
2412
2413
|
width,
|
|
2413
2414
|
...options,
|
|
2414
2415
|
aspectRatio: width && height ? width / height : 1
|
|
2415
2416
|
});
|
|
2417
|
+
} else {
|
|
2418
|
+
imgAttrs = await getImage$1(options);
|
|
2416
2419
|
}
|
|
2417
|
-
|
|
2420
|
+
imgAttrs.src += imgAttrs.src.includes("?") ? "&" : "?";
|
|
2421
|
+
imgAttrs.src += `V=${{"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true}.DEPLOY_RAND || "_"}`;
|
|
2422
|
+
return imgAttrs;
|
|
2418
2423
|
};
|
|
2419
2424
|
|
|
2420
2425
|
const $$module1$3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
@@ -14,21 +14,26 @@ const tryImageSize = (src: string) => {
|
|
|
14
14
|
return dimensions;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const getImage = (options: Parameters<typeof _getImage>[0]) => {
|
|
17
|
+
const getImage = async (options: Parameters<typeof _getImage>[0]) => {
|
|
18
18
|
const { src } = options;
|
|
19
|
+
let imgAttrs: Awaited<ReturnType<typeof _getImage>>;
|
|
19
20
|
if (
|
|
20
21
|
typeof src === 'string'
|
|
21
22
|
&& !options.aspectRatio
|
|
22
23
|
&& (!options.width || !options.height)
|
|
23
24
|
) {
|
|
24
25
|
const { width, height } = tryImageSize(src);
|
|
25
|
-
|
|
26
|
+
imgAttrs = await _getImage({
|
|
26
27
|
width,
|
|
27
28
|
...options,
|
|
28
29
|
aspectRatio: width && height ? width / height : 1,
|
|
29
30
|
});
|
|
31
|
+
} else {
|
|
32
|
+
imgAttrs = await _getImage(options);
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
imgAttrs.src += imgAttrs.src.includes('?') ? '&' : '?';
|
|
35
|
+
imgAttrs.src += `V=${import.meta.env.DEPLOY_RAND || '_'}`;
|
|
36
|
+
return imgAttrs;
|
|
32
37
|
};
|
|
33
38
|
|
|
34
39
|
export default getImage;
|
|
@@ -92,11 +92,11 @@ Object.keys(brandColors).forEach((colorName) => {
|
|
|
92
92
|
:root {
|
|
93
93
|
--content-max-width: 80rem;
|
|
94
94
|
--white: #fff;
|
|
95
|
-
--gray-50:
|
|
96
|
-
--gray-200:
|
|
97
|
-
--gray-700:
|
|
98
|
-
--gray-800:
|
|
99
|
-
--gray-900:
|
|
95
|
+
--gray-50: #f9fafb;
|
|
96
|
+
--gray-200: #e5e7eb;
|
|
97
|
+
--gray-700: #374151;
|
|
98
|
+
--gray-800: #1f2937;
|
|
99
|
+
--gray-900: #111827;
|
|
100
100
|
--surface-color: var(--gray-50);
|
|
101
101
|
--surface-border-color: var(--gray-200);
|
|
102
102
|
--yiq-text-light: var(--white);
|