@redotech/redo-hydrogen 1.2.1 → 1.3.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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/types.d.ts +5 -5
- package/package.json +2 -1
- package/rollup.config.js +2 -0
- package/src/components/redo-checkout-buttons.tsx +90 -44
- package/src/providers/redo-coverage-client.tsx +13 -7
- package/src/svg.d.ts +4 -0
- package/src/types.ts +3 -3
- package/src/utils/cart.ts +119 -24
- package/src/utils/circle-spinner.svg +24 -0
- package/src/utils/timeout.ts +12 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="24"
|
|
3
|
+
height="24"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
>
|
|
7
|
+
<path
|
|
8
|
+
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
9
|
+
fill="currentColor"
|
|
10
|
+
opacity=".25"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
>
|
|
16
|
+
<animateTransform
|
|
17
|
+
attributeName="transform"
|
|
18
|
+
type="rotate"
|
|
19
|
+
dur="0.75s"
|
|
20
|
+
values="0 12 12;360 12 12"
|
|
21
|
+
repeatCount="indefinite"
|
|
22
|
+
/>
|
|
23
|
+
</path>
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export async function executeWithTimeout<T, E extends Error>(
|
|
2
|
+
promise: Promise<T>,
|
|
3
|
+
timeoutMs: number,
|
|
4
|
+
error: E = new Error("timeout") as E,
|
|
5
|
+
): Promise<T> {
|
|
6
|
+
return Promise.race([
|
|
7
|
+
promise,
|
|
8
|
+
new Promise<never>((_, reject) =>
|
|
9
|
+
setTimeout(() => reject(error), timeoutMs),
|
|
10
|
+
),
|
|
11
|
+
]);
|
|
12
|
+
}
|
package/tsconfig.json
CHANGED