@webiny/website-builder-react 6.6.0-alpha.7 → 6.6.0-alpha.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image/getImageProps.test.js","sources":["../../src/image/getImageProps.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { getImageProps } from \"./getImageProps.js\";\nimport type { Asset } from \"@webiny/website-builder-sdk\";\n\nconst asset = (overrides: Partial<Asset> = {}): Asset => ({\n id: \"1\",\n name: \"photo.jpg\",\n size: 1234,\n
|
|
1
|
+
{"version":3,"file":"image/getImageProps.test.js","sources":["../../src/image/getImageProps.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport { getImageProps } from \"./getImageProps.js\";\nimport type { Asset } from \"@webiny/website-builder-sdk\";\n\nconst asset = (overrides: Partial<Asset> = {}): Asset => ({\n id: \"1\",\n name: \"photo.jpg\",\n size: 1234,\n mimeType: \"image/jpeg\",\n src: \"https://cdn.test/photo.jpg\",\n url: \"https://cdn.test/photo.jpg\",\n image: { width: 1600, height: 900 },\n ...overrides\n});\n\ndescribe(\"getImageProps\", () => {\n it(\"returns wrapper + image styles and passes through src and dimensions\", () => {\n const props = getImageProps(asset());\n expect(props.src).toBe(\"https://cdn.test/photo.jpg\");\n expect(props.width).toBe(1600);\n expect(props.height).toBe(900);\n expect(props.style.overflow).toBe(\"hidden\");\n expect(props.style.position).toBe(\"relative\");\n expect(props.imgStyle.position).toBe(\"absolute\");\n });\n\n it(\"resolves alt from the explicit option first\", () => {\n const props = getImageProps(asset({ image: { alt: \"stored alt\" } }), {\n alt: \"explicit alt\"\n });\n expect(props.alt).toBe(\"explicit alt\");\n });\n\n it(\"falls back to the image's stored alt\", () => {\n const props = getImageProps(asset({ image: { alt: \"stored alt\" } }));\n expect(props.alt).toBe(\"stored alt\");\n });\n\n it(\"defaults alt to an empty string\", () => {\n expect(getImageProps(asset()).alt).toBe(\"\");\n });\n\n it(\"produces a wrapper with the requested aspect ratio\", () => {\n const props = getImageProps(asset(), { aspectRatio: 1 });\n expect(props.style.aspectRatio).toBe(\"1\");\n });\n\n it(\"offsets the image to reveal a focal-point-shifted crop region\", () => {\n const props = getImageProps(\n asset({\n image: {\n width: 1600,\n height: 900,\n focalPoint: { x: 0.9, y: 0.5 }\n }\n }),\n { aspectRatio: 1 }\n );\n expect(parseFloat(props.imgStyle.left as string)).toBeLessThan(0);\n });\n});\n"],"names":["asset","overrides","describe","it","props","getImageProps","expect","parseFloat"],"mappings":";;AAIA,MAAMA,QAAQ,CAACC,YAA4B,CAAC,CAAC,GAAa;QACtD,IAAI;QACJ,MAAM;QACN,MAAM;QACN,UAAU;QACV,KAAK;QACL,KAAK;QACL,OAAO;YAAE,OAAO;YAAM,QAAQ;QAAI;QAClC,GAAGA,SAAS;IAChB;AAEAC,SAAS,iBAAiB;IACtBC,GAAG,wEAAwE;QACvE,MAAMC,QAAQC,cAAcL;QAC5BM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;QACvBE,OAAOF,MAAM,KAAK,EAAE,IAAI,CAAC;QACzBE,OAAOF,MAAM,MAAM,EAAE,IAAI,CAAC;QAC1BE,OAAOF,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClCE,OAAOF,MAAM,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAClCE,OAAOF,MAAM,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACzC;IAEAD,GAAG,+CAA+C;QAC9C,MAAMC,QAAQC,cAAcL,MAAM;YAAE,OAAO;gBAAE,KAAK;YAAa;QAAE,IAAI;YACjE,KAAK;QACT;QACAM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;IAC3B;IAEAD,GAAG,wCAAwC;QACvC,MAAMC,QAAQC,cAAcL,MAAM;YAAE,OAAO;gBAAE,KAAK;YAAa;QAAE;QACjEM,OAAOF,MAAM,GAAG,EAAE,IAAI,CAAC;IAC3B;IAEAD,GAAG,mCAAmC;QAClCG,OAAOD,cAAcL,SAAS,GAAG,EAAE,IAAI,CAAC;IAC5C;IAEAG,GAAG,sDAAsD;QACrD,MAAMC,QAAQC,cAAcL,SAAS;YAAE,aAAa;QAAE;QACtDM,OAAOF,MAAM,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC;IACzC;IAEAD,GAAG,iEAAiE;QAChE,MAAMC,QAAQC,cACVL,MAAM;YACF,OAAO;gBACH,OAAO;gBACP,QAAQ;gBACR,YAAY;oBAAE,GAAG;oBAAK,GAAG;gBAAI;YACjC;QACJ,IACA;YAAE,aAAa;QAAE;QAErBM,OAAOC,WAAWH,MAAM,QAAQ,CAAC,IAAI,GAAa,YAAY,CAAC;IACnE;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/website-builder-react",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@webiny/website-builder-sdk": "6.6.0-alpha.
|
|
20
|
+
"@webiny/website-builder-sdk": "6.6.0-alpha.9",
|
|
21
21
|
"deep-equal": "2.2.3",
|
|
22
22
|
"mobx": "7.0.3",
|
|
23
23
|
"mobx-react-lite": "5.0.3",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": "18.3.31",
|
|
29
|
-
"@webiny/build-tools": "6.6.0-alpha.
|
|
29
|
+
"@webiny/build-tools": "6.6.0-alpha.9",
|
|
30
30
|
"typescript": "7.0.2",
|
|
31
31
|
"vitest": "4.1.11"
|
|
32
32
|
},
|