@shopify/shop-minis-react 0.0.0-snapshot.20251216185714 → 0.0.0-snapshot.20251217193626

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,5 +1,5 @@
1
- var r = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ e as __module
4
4
  };
5
5
  //# sourceMappingURL=index4.js.map
@@ -1,5 +1,6 @@
1
- var e = { exports: {} };
1
+ import { __require as r } from "../shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js";
2
+ var i = r();
2
3
  export {
3
- e as __module
4
+ i as l
4
5
  };
5
6
  //# sourceMappingURL=index5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,6 +1,5 @@
1
- import { __require as r } from "../shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js";
2
- var i = r();
1
+ var r = {};
3
2
  export {
4
- i as l
3
+ r as __exports
5
4
  };
6
5
  //# sourceMappingURL=index6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,4 @@
1
- import { __module as q } from "../../../../../../../../_virtual/index5.js";
1
+ import { __module as q } from "../../../../../../../../_virtual/index4.js";
2
2
  import { __require as F } from "../../../../../global@4.4.0/node_modules/global/window.js";
3
3
  import { __require as N } from "../../../../../@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js";
4
4
  import { __require as J } from "../../../../../is-function@1.0.2/node_modules/is-function/index.js";
@@ -2,7 +2,7 @@ import L from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-ut
2
2
  import T from "../../../../../../../_virtual/window.js";
3
3
  import { forEachMediaGroup as Z } from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-groups.js";
4
4
  import J from "../../../../@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js";
5
- import { l as Q } from "../../../../../../../_virtual/index6.js";
5
+ import { l as Q } from "../../../../../../../_virtual/index5.js";
6
6
  /*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */
7
7
  const w = (e) => !!e && typeof e == "object", E = (...e) => e.reduce((n, t) => (typeof t != "object" || Object.keys(t).forEach((r) => {
8
8
  Array.isArray(n[r]) && Array.isArray(t[r]) ? n[r] = n[r].concat(t[r]) : w(n[r]) && w(t[r]) ? n[r] = E(n[r], t[r]) : n[r] = t[r];
@@ -1,4 +1,4 @@
1
- import { __exports as i } from "../../../../../../_virtual/index4.js";
1
+ import { __exports as i } from "../../../../../../_virtual/index6.js";
2
2
  var c;
3
3
  function d() {
4
4
  if (c) return i;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shopify/shop-minis-react",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "0.0.0-snapshot.20251216185714",
4
+ "version": "0.0.0-snapshot.20251217193626",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "engines": {
@@ -46,7 +46,7 @@
46
46
  "typescript": ">=5.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@shopify/shop-minis-platform": "0.0.0-snapshot.20251216185714",
49
+ "@shopify/shop-minis-platform": "0.0.0-snapshot.20251217193626",
50
50
  "@tailwindcss/vite": "4.1.8",
51
51
  "@tanstack/react-query": "5.86.0",
52
52
  "@types/color": "3.0.6",
@@ -1,13 +1,18 @@
1
- import {describe, expect, it, vi} from 'vitest'
1
+ import {describe, expect, it, vi, beforeAll} from 'vitest'
2
2
 
3
3
  import {render, screen, waitFor} from '../../test-utils'
4
4
 
5
5
  import {Image} from './image'
6
6
 
7
+ // Mock URL.revokeObjectURL for jsdom
8
+ beforeAll(() => {
9
+ URL.revokeObjectURL = vi.fn()
10
+ })
11
+
7
12
  // Mock the util functions
8
13
  vi.mock('../../utils', () => ({
9
- getThumbhashDataURL: vi.fn((thumbhash?: string) =>
10
- thumbhash ? `data:image/png;base64,${thumbhash}` : null
14
+ getThumbhashBlobURL: vi.fn((thumbhash?: string) =>
15
+ thumbhash ? `blob:http://localhost/${thumbhash}` : undefined
11
16
  ),
12
17
  getResizedImageUrl: vi.fn((url?: string) => url),
13
18
  }))
@@ -76,7 +81,7 @@ describe('Image', () => {
76
81
  expect(wrapper.style.aspectRatio).toBe('16/9')
77
82
  })
78
83
 
79
- it('uses thumbhash as background when provided with fixed aspect ratio', () => {
84
+ it('uses thumbhash as placeholder when provided with fixed aspect ratio', () => {
80
85
  const {container} = render(
81
86
  <Image
82
87
  src="https://example.com/image.jpg"
@@ -86,10 +91,15 @@ describe('Image', () => {
86
91
  />
87
92
  )
88
93
 
89
- const wrapper = container.firstChild as HTMLElement
90
- expect(wrapper.style.backgroundImage).toContain(
91
- 'data:image/png;base64,testThumbhash'
94
+ // Thumbhash is now rendered as a separate img element (placeholder)
95
+ const images = container.querySelectorAll('img')
96
+ expect(images).toHaveLength(2) // placeholder + main image
97
+ const placeholderImg = images[0]
98
+ expect(placeholderImg).toHaveAttribute(
99
+ 'src',
100
+ 'blob:http://localhost/testThumbhash'
92
101
  )
102
+ expect(placeholderImg).toHaveAttribute('aria-hidden', 'true')
93
103
  })
94
104
 
95
105
  it('renders with natural sizing when aspectRatio is auto', () => {
@@ -122,13 +132,17 @@ describe('Image', () => {
122
132
  />
123
133
  )
124
134
 
125
- const wrapper = container.firstChild as HTMLElement
126
- const img = screen.getByRole('img')
127
-
128
- expect(wrapper.style.backgroundImage).toContain(
129
- 'data:image/png;base64,testThumbhash'
135
+ // Thumbhash is now rendered as a separate img element (placeholder)
136
+ const images = container.querySelectorAll('img')
137
+ expect(images).toHaveLength(2) // placeholder + main image
138
+ const placeholderImg = images[0]
139
+ expect(placeholderImg).toHaveAttribute(
140
+ 'src',
141
+ 'blob:http://localhost/testThumbhash'
130
142
  )
131
- expect(img).toHaveClass('w-full', 'h-auto')
143
+
144
+ const mainImg = images[1]
145
+ expect(mainImg).toHaveClass('w-full', 'h-auto')
132
146
  })
133
147
 
134
148
  it('passes additional props to img element', () => {