@haus-storefront-react/vendure-plugin-configs 1.0.4-next.16 → 1.0.4-next.3
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 +0 -156
- package/badge.js +1 -1
- package/badge.mjs +424 -439
- package/campaign.js +1 -1
- package/campaign.mjs +106 -50
- package/compiler-runtime-oPPev21o.js +10 -0
- package/compiler-runtime-qHgugrLy.mjs +296 -0
- package/elastic.js +1 -1
- package/elastic.mjs +26 -10
- package/index-BRlTlK6a.mjs +3768 -0
- package/index-BgBC_k8M.js +1 -0
- package/index-C0E-40z0.mjs +19 -0
- package/index-CgxqXyHf.js +20 -0
- package/index.js +1 -1
- package/index.mjs +4 -2
- package/lib/configs/vendure-badge-plugin.d.ts +2 -10
- package/lib/configs/vendure-badge-plugin.types.d.ts +1 -0
- package/lib/configs/vendure-campaign-plugin.d.ts +1 -1
- package/lib/configs/vendure-elastic-search-plugin.d.ts +1 -1
- package/lib/configs/vendure-packagesize-plugin.d.ts +1 -1
- package/lib/configs/vendure-product-popularity-plugin.d.ts +1 -1
- package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +2 -2
- package/lib/plugin-config.d.ts +1 -2
- package/lib/types.d.ts +0 -1
- package/package.json +5 -25
- package/packagesize.js +1 -1
- package/packagesize.mjs +59 -15
- package/product-popularity.js +1 -1
- package/product-popularity.mjs +22 -12
- package/purchase-order-payment.js +5 -5
- package/purchase-order-payment.mjs +631 -207
- package/useSdk-DOrZRSHz.mjs +2634 -0
- package/useSdk-YXpk8Wsi.js +21 -0
- package/lib/configs/vendure-product-variant-specifications-plugin.d.ts +0 -55
- package/lib/configs/vendure-product-variant-specifications-plugin.types.d.ts +0 -8
- package/lib/configs/vendure-products-by-sku-plugin.d.ts +0 -11
- package/lib/configs/vendure-products-by-sku-plugin.types.d.ts +0 -13
- package/lib/configs/vendure-related-products-plugin.d.ts +0 -39
- package/lib/configs/vendure-related-products-plugin.types.d.ts +0 -16
- package/lib/exports/product-variant-specifications.d.ts +0 -2
- package/lib/exports/products-by-sku.d.ts +0 -3
- package/lib/exports/related-products.d.ts +0 -3
- package/lib/hooks/use-related-products.d.ts +0 -2
- package/lib/strategies/quick-order-variant-sku-validation-strategy.d.ts +0 -6
- package/plugin-config-DrQQb9Ry.js +0 -1
- package/plugin-config-DywohMgp.mjs +0 -903
- package/product-variant-specifications.d.ts +0 -2
- package/product-variant-specifications.js +0 -1
- package/product-variant-specifications.mjs +0 -9
- package/products-by-sku.d.ts +0 -2
- package/products-by-sku.js +0 -1
- package/products-by-sku.mjs +0 -54
- package/related-products.d.ts +0 -2
- package/related-products.js +0 -1
- package/related-products.mjs +0 -35
- package/src-ChzQhPCd.js +0 -6
- package/src-CsM7SeIh.mjs +0 -455
- package/src-Dq29mogl.js +0 -21
- package/src-Dud_XHV6.mjs +0 -2718
package/badge.mjs
CHANGED
|
@@ -1,453 +1,438 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useRef as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return a.delete(e), a.delete(t), m;
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region ../../../node_modules/lodash-es/_baseIsEqualDeep.js
|
|
140
|
-
var Ce = 1, z = "[object Arguments]", B = "[object Array]", V = "[object Object]", H = Object.prototype.hasOwnProperty;
|
|
141
|
-
function we(e, t, n, r, i, o) {
|
|
142
|
-
var s = a(e), c = a(t), l = s ? B : g(e), u = c ? B : g(t);
|
|
143
|
-
l = l == z ? V : l, u = u == z ? V : u;
|
|
144
|
-
var d = l == V, f = u == V, p = l == u;
|
|
145
|
-
if (p && m(e)) {
|
|
146
|
-
if (!m(t)) return !1;
|
|
147
|
-
s = !0, d = !1;
|
|
148
|
-
}
|
|
149
|
-
if (p && !d) return o ||= new C(), s || h(e) ? O(e, t, n, r, i, o) : ye(e, t, l, n, r, i, o);
|
|
150
|
-
if (!(n & Ce)) {
|
|
151
|
-
var _ = d && H.call(e, "__wrapped__"), v = f && H.call(t, "__wrapped__");
|
|
152
|
-
if (_ || v) {
|
|
153
|
-
var y = _ ? e.value() : e, b = v ? t.value() : t;
|
|
154
|
-
return o ||= new C(), i(y, b, n, r, o);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return p ? (o ||= new C(), Se(e, t, n, r, i, o)) : !1;
|
|
158
|
-
}
|
|
159
|
-
//#endregion
|
|
160
|
-
//#region ../../../node_modules/lodash-es/_baseIsEqual.js
|
|
161
|
-
function U(e, t, n, r, i) {
|
|
162
|
-
return e === t ? !0 : e == null || t == null || !T(e) && !T(t) ? e !== e && t !== t : we(e, t, n, r, U, i);
|
|
163
|
-
}
|
|
164
|
-
//#endregion
|
|
165
|
-
//#region ../../../node_modules/lodash-es/_baseIsMatch.js
|
|
166
|
-
var Te = 1, Ee = 2;
|
|
167
|
-
function De(e, t, n, r) {
|
|
168
|
-
var i = n.length, a = i, o = !r;
|
|
169
|
-
if (e == null) return !a;
|
|
170
|
-
for (e = Object(e); i--;) {
|
|
171
|
-
var s = n[i];
|
|
172
|
-
if (o && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1;
|
|
173
|
-
}
|
|
174
|
-
for (; ++i < a;) {
|
|
175
|
-
s = n[i];
|
|
176
|
-
var c = s[0], l = e[c], u = s[1];
|
|
177
|
-
if (o && s[2]) {
|
|
178
|
-
if (l === void 0 && !(c in e)) return !1;
|
|
179
|
-
} else {
|
|
180
|
-
var d = new C();
|
|
181
|
-
if (r) var f = r(l, u, c, e, t, d);
|
|
182
|
-
if (!(f === void 0 ? U(u, l, Te | Ee, r, d) : f)) return !1;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return !0;
|
|
186
|
-
}
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region ../../../node_modules/lodash-es/_isStrictComparable.js
|
|
189
|
-
function W(e) {
|
|
190
|
-
return e === e && !o(e);
|
|
191
|
-
}
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region ../../../node_modules/lodash-es/_getMatchData.js
|
|
194
|
-
function Oe(e) {
|
|
195
|
-
for (var t = v(e), n = t.length; n--;) {
|
|
196
|
-
var r = t[n], i = e[r];
|
|
197
|
-
t[n] = [
|
|
198
|
-
r,
|
|
199
|
-
i,
|
|
200
|
-
W(i)
|
|
201
|
-
];
|
|
202
|
-
}
|
|
203
|
-
return t;
|
|
204
|
-
}
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region ../../../node_modules/lodash-es/_matchesStrictComparable.js
|
|
207
|
-
function G(e, t) {
|
|
208
|
-
return function(n) {
|
|
209
|
-
return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region ../../../node_modules/lodash-es/_baseMatches.js
|
|
214
|
-
function ke(e) {
|
|
215
|
-
var t = Oe(e);
|
|
216
|
-
return t.length == 1 && t[0][2] ? G(t[0][0], t[0][1]) : function(n) {
|
|
217
|
-
return n === e || De(n, e, t);
|
|
218
|
-
};
|
|
1
|
+
import { V as j, l as R } from "./index-BRlTlK6a.mjs";
|
|
2
|
+
import { c as P, j as y } from "./compiler-runtime-qHgugrLy.mjs";
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import $, { useRef as N } from "react";
|
|
5
|
+
import { r as V } from "./index-C0E-40z0.mjs";
|
|
6
|
+
import { u as k } from "./useSdk-DOrZRSHz.mjs";
|
|
7
|
+
import "@tanstack/react-query";
|
|
8
|
+
const v = new j({
|
|
9
|
+
name: "badges",
|
|
10
|
+
enableFeatures: {
|
|
11
|
+
showBadges: ({
|
|
12
|
+
badges: t = [],
|
|
13
|
+
parentComponent: e
|
|
14
|
+
}) => {
|
|
15
|
+
const n = e ? v.getSettings().availablePositions[e] : v.getSettings().defaultPositions;
|
|
16
|
+
return {
|
|
17
|
+
badges: R.filter(t, (c) => n ? n.includes(c.position) : !0),
|
|
18
|
+
availablePositions: n
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
queryUpdates: {},
|
|
23
|
+
settings: {
|
|
24
|
+
defaultPositions: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
25
|
+
availablePositions: {
|
|
26
|
+
productListItem: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
27
|
+
productDetail: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
28
|
+
imageCarousel: ["top-left", "top-right", "bottom-left", "bottom-right"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
v.setQueryUpdates({
|
|
33
|
+
product: {
|
|
34
|
+
fields: [{
|
|
35
|
+
badges: ["id", "position", "assetId", {
|
|
36
|
+
asset: ["id", "name", "preview", "source"]
|
|
37
|
+
}, {
|
|
38
|
+
collection: ["id", "name"]
|
|
39
|
+
}]
|
|
40
|
+
}]
|
|
41
|
+
},
|
|
42
|
+
search: {
|
|
43
|
+
fields: [{
|
|
44
|
+
items: [{
|
|
45
|
+
badges: ["id", "position", "assetId", {
|
|
46
|
+
asset: ["id", "name", "preview", "source"]
|
|
47
|
+
}, {
|
|
48
|
+
collection: ["id", "name"]
|
|
49
|
+
}]
|
|
50
|
+
}]
|
|
51
|
+
}]
|
|
52
|
+
},
|
|
53
|
+
products: {
|
|
54
|
+
fields: [{
|
|
55
|
+
items: [{
|
|
56
|
+
badges: ["id", "position", "assetId", {
|
|
57
|
+
asset: ["id", "name", "preview", "source"]
|
|
58
|
+
}, {
|
|
59
|
+
collection: ["id", "name"]
|
|
60
|
+
}]
|
|
61
|
+
}]
|
|
62
|
+
}]
|
|
63
|
+
},
|
|
64
|
+
briefProducts: {
|
|
65
|
+
fields: [{
|
|
66
|
+
items: [{
|
|
67
|
+
badges: ["id", "position", "assetId", {
|
|
68
|
+
asset: ["id", "name", "preview", "source"]
|
|
69
|
+
}, {
|
|
70
|
+
collection: ["id", "name"]
|
|
71
|
+
}]
|
|
72
|
+
}]
|
|
73
|
+
}]
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
v.setRequests({
|
|
77
|
+
getBadges: async () => v.getSdk().createRequest({
|
|
78
|
+
operation: "badges",
|
|
79
|
+
fields: ["totalItems", {
|
|
80
|
+
items: ["id", "createdAt", "updatedAt", "collectionId", "position", "assetId", {
|
|
81
|
+
asset: ["id", "name", "preview", "source"]
|
|
82
|
+
}, {
|
|
83
|
+
collection: ["id", "name"]
|
|
84
|
+
}]
|
|
85
|
+
}]
|
|
86
|
+
}, {
|
|
87
|
+
options: {
|
|
88
|
+
take: 100
|
|
89
|
+
}
|
|
90
|
+
}, !1).then((t) => t.data).catch((t) => ({
|
|
91
|
+
message: t.message,
|
|
92
|
+
errorCode: t.code || "unknown"
|
|
93
|
+
}))
|
|
94
|
+
});
|
|
95
|
+
function A(t) {
|
|
96
|
+
const e = [];
|
|
97
|
+
function n(c, o) {
|
|
98
|
+
const s = m.createContext(o), r = e.length;
|
|
99
|
+
e.push(s);
|
|
100
|
+
const l = (u) => {
|
|
101
|
+
const f = P.c(8);
|
|
102
|
+
let d, p, g;
|
|
103
|
+
f[0] !== u ? ({
|
|
104
|
+
scope: g,
|
|
105
|
+
children: d,
|
|
106
|
+
...p
|
|
107
|
+
} = u, f[0] = u, f[1] = d, f[2] = p, f[3] = g) : (d = f[1], p = f[2], g = f[3]);
|
|
108
|
+
const h = g?.[t]?.[r] || s, b = p;
|
|
109
|
+
let x;
|
|
110
|
+
return f[4] !== h.Provider || f[5] !== d || f[6] !== b ? (x = /* @__PURE__ */ y.jsx(h.Provider, { value: b, children: d }), f[4] = h.Provider, f[5] = d, f[6] = b, f[7] = x) : x = f[7], x;
|
|
111
|
+
};
|
|
112
|
+
l.displayName = c + "Provider";
|
|
113
|
+
function a(u, f) {
|
|
114
|
+
const d = f?.[t]?.[r] || s, p = m.useContext(d);
|
|
115
|
+
if (p)
|
|
116
|
+
return p;
|
|
117
|
+
if (o !== void 0)
|
|
118
|
+
return o;
|
|
119
|
+
throw new Error(`\`${u}\` must be used within \`${c}\``);
|
|
120
|
+
}
|
|
121
|
+
return [l, a];
|
|
122
|
+
}
|
|
123
|
+
function i() {
|
|
124
|
+
const c = e.map((o) => m.createContext(o));
|
|
125
|
+
return function(s) {
|
|
126
|
+
const r = s?.[t] || c;
|
|
127
|
+
return m.useMemo(() => ({
|
|
128
|
+
[`__scope${t}`]: {
|
|
129
|
+
...s,
|
|
130
|
+
[t]: r
|
|
131
|
+
}
|
|
132
|
+
}), [s, r]);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
return i.scopeName = t, [n, i];
|
|
219
136
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
137
|
+
function O(t, e) {
|
|
138
|
+
if (e === "web")
|
|
139
|
+
return t;
|
|
140
|
+
const {
|
|
141
|
+
src: n,
|
|
142
|
+
alt: i,
|
|
143
|
+
width: c,
|
|
144
|
+
height: o,
|
|
145
|
+
...s
|
|
146
|
+
} = t, r = [typeof c == "number" ? {
|
|
147
|
+
width: c
|
|
148
|
+
} : void 0, typeof o == "number" ? {
|
|
149
|
+
height: o
|
|
150
|
+
} : void 0].filter(Boolean);
|
|
151
|
+
let l;
|
|
152
|
+
return r.length === 1 ? l = r[0] : r.length > 1 && (l = r), {
|
|
153
|
+
...s,
|
|
154
|
+
source: {
|
|
155
|
+
uri: n
|
|
156
|
+
},
|
|
157
|
+
...l ? {
|
|
158
|
+
style: l
|
|
159
|
+
} : {}
|
|
160
|
+
// alt tas bort, finns inte i RN
|
|
161
|
+
};
|
|
224
162
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
163
|
+
function D(t) {
|
|
164
|
+
const {
|
|
165
|
+
src: e,
|
|
166
|
+
alt: n,
|
|
167
|
+
...i
|
|
168
|
+
} = t;
|
|
169
|
+
return e ? {
|
|
170
|
+
...i,
|
|
171
|
+
source: {
|
|
172
|
+
uri: e
|
|
173
|
+
}
|
|
174
|
+
} : i;
|
|
235
175
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
176
|
+
const q = {
|
|
177
|
+
div: "View",
|
|
178
|
+
span: "Text",
|
|
179
|
+
p: "Text",
|
|
180
|
+
h1: "Text",
|
|
181
|
+
h2: "Text",
|
|
182
|
+
h3: "Text",
|
|
183
|
+
h4: "Text",
|
|
184
|
+
h5: "Text",
|
|
185
|
+
h6: "Text",
|
|
186
|
+
button: "Pressable",
|
|
187
|
+
input: "TextInput",
|
|
188
|
+
form: "View",
|
|
189
|
+
section: "View",
|
|
190
|
+
article: "View",
|
|
191
|
+
nav: "View",
|
|
192
|
+
header: "View",
|
|
193
|
+
footer: "View",
|
|
194
|
+
main: "View",
|
|
195
|
+
aside: "View",
|
|
196
|
+
ul: "View",
|
|
197
|
+
ol: "View",
|
|
198
|
+
li: "View",
|
|
199
|
+
a: "Pressable",
|
|
200
|
+
img: "Image",
|
|
201
|
+
label: "Text",
|
|
202
|
+
textarea: "TextInput",
|
|
203
|
+
select: "Pressable",
|
|
204
|
+
option: "Text"
|
|
205
|
+
};
|
|
206
|
+
function F(t, e) {
|
|
207
|
+
if (e === "web")
|
|
208
|
+
return t;
|
|
209
|
+
let n = null;
|
|
210
|
+
try {
|
|
211
|
+
n = require("react-native");
|
|
212
|
+
} catch {
|
|
213
|
+
n = null;
|
|
214
|
+
}
|
|
215
|
+
if (!n)
|
|
216
|
+
return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`), "div";
|
|
217
|
+
const i = q[t];
|
|
218
|
+
if (!i)
|
|
219
|
+
return console.warn(`No native component mapping found for '${t}', falling back to View`), n.View;
|
|
220
|
+
if (i === "Image") {
|
|
221
|
+
const o = $.forwardRef((s, r) => {
|
|
222
|
+
const l = P.c(5);
|
|
223
|
+
if (!s.src)
|
|
224
|
+
return null;
|
|
225
|
+
let a;
|
|
226
|
+
l[0] !== s ? (a = D(s), l[0] = s, l[1] = a) : a = l[1];
|
|
227
|
+
let u;
|
|
228
|
+
return l[2] !== r || l[3] !== a ? (u = /* @__PURE__ */ y.jsx(n.Image, { ref: r, ...a }), l[2] = r, l[3] = a, l[4] = u) : u = l[4], u;
|
|
229
|
+
});
|
|
230
|
+
return o.displayName = "PlatformPrimitiveImage", o;
|
|
231
|
+
}
|
|
232
|
+
const c = n[i];
|
|
233
|
+
return c || (console.warn(`Native component '${i}' not found, falling back to View`), n.View);
|
|
240
234
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
function
|
|
245
|
-
|
|
246
|
-
var r = d(n, e);
|
|
247
|
-
return r === void 0 && r === t ? Me(n, e) : U(t, r, Ne | Pe);
|
|
248
|
-
};
|
|
235
|
+
const W = /* @__PURE__ */ Symbol("radix.slottable");
|
|
236
|
+
function G(...t) {
|
|
237
|
+
return (e) => t.forEach((n) => {
|
|
238
|
+
typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
239
|
+
});
|
|
249
240
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
241
|
+
function L(t, e) {
|
|
242
|
+
const n = {
|
|
243
|
+
...e
|
|
244
|
+
};
|
|
245
|
+
for (const i in e) {
|
|
246
|
+
const c = t[i], o = e[i];
|
|
247
|
+
/^on[A-Z]/.test(i) ? c && o ? n[i] = (...r) => {
|
|
248
|
+
const l = o(...r);
|
|
249
|
+
return c(...r), l;
|
|
250
|
+
} : c && (n[i] = c) : i === "style" ? n[i] = M(c, o) : i === "className" && (n[i] = [c, o].filter(Boolean).join(" "));
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
...t,
|
|
254
|
+
...n
|
|
255
|
+
};
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
257
|
+
function M(t, e) {
|
|
258
|
+
let n = null;
|
|
259
|
+
try {
|
|
260
|
+
n = require("react-native");
|
|
261
|
+
} catch {
|
|
262
|
+
n = null;
|
|
263
|
+
}
|
|
264
|
+
const i = n?.StyleSheet?.flatten;
|
|
265
|
+
if (typeof t == "function" && typeof e == "function")
|
|
266
|
+
return (o) => {
|
|
267
|
+
const s = [t(o), e(o)];
|
|
268
|
+
return i ? i(s) : s;
|
|
269
|
+
};
|
|
270
|
+
if (typeof t == "function")
|
|
271
|
+
return (o) => {
|
|
272
|
+
const s = e ? [t(o), e] : t(o);
|
|
273
|
+
return i ? i(s) : s;
|
|
274
|
+
};
|
|
275
|
+
if (typeof e == "function")
|
|
276
|
+
return (o) => {
|
|
277
|
+
const s = t ? [t, e(o)] : e(o);
|
|
278
|
+
return i ? i(s) : s;
|
|
279
|
+
};
|
|
280
|
+
const c = [t, e].filter(Boolean);
|
|
281
|
+
return i ? i(c) : c;
|
|
263
282
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
function Re(e) {
|
|
267
|
-
return x(e) ? Ie(w(e)) : Le(e);
|
|
283
|
+
function U(t) {
|
|
284
|
+
return m.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === W;
|
|
268
285
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
return typeof e == "function" ? e : e == null ? ne : typeof e == "object" ? a(e) ? Fe(e[0], e[1]) : ke(e) : Re(e);
|
|
286
|
+
function H(t) {
|
|
287
|
+
let e = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, n = e && "isReactWarning" in e && e.isReactWarning;
|
|
288
|
+
return n ? t.ref : (e = Object.getOwnPropertyDescriptor(t, "ref")?.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
|
|
273
289
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
290
|
+
function K(t, e) {
|
|
291
|
+
const n = m.forwardRef((i, c) => {
|
|
292
|
+
const {
|
|
293
|
+
children: o,
|
|
294
|
+
...s
|
|
295
|
+
} = i;
|
|
296
|
+
if (m.isValidElement(o)) {
|
|
297
|
+
const r = H(o), l = L(s, o.props);
|
|
298
|
+
return o.type !== m.Fragment && (l.ref = c ? G(c, r) : r), m.cloneElement(o, l);
|
|
299
|
+
}
|
|
300
|
+
return m.Children.count(o) > 1 ? m.Children.only(null) : null;
|
|
301
|
+
});
|
|
302
|
+
return n.displayName = `${t}.SlotClone`, n;
|
|
281
303
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
304
|
+
function w(t, e = !1, n = "div") {
|
|
305
|
+
if (!e)
|
|
306
|
+
return F(n, t);
|
|
307
|
+
const i = K("Slot"), c = m.forwardRef((o, s) => {
|
|
308
|
+
const r = P.c(15);
|
|
309
|
+
let l, a;
|
|
310
|
+
r[0] !== o ? ({
|
|
311
|
+
children: l,
|
|
312
|
+
...a
|
|
313
|
+
} = o, r[0] = o, r[1] = l, r[2] = a) : (l = r[1], a = r[2]);
|
|
314
|
+
let u;
|
|
315
|
+
if (r[3] !== l || r[4] !== s || r[5] !== a) {
|
|
316
|
+
u = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
317
|
+
e: {
|
|
318
|
+
const d = m.Children.toArray(l), p = d.find(U);
|
|
319
|
+
if (p) {
|
|
320
|
+
const g = p.props.children, h = d.map((B) => B === p ? m.Children.count(g) > 1 ? m.Children.only(null) : m.isValidElement(g) ? g.props.children : null : B), b = m.isValidElement(g) ? m.cloneElement(g, void 0, h) : null;
|
|
321
|
+
let x;
|
|
322
|
+
r[7] !== s || r[8] !== a || r[9] !== b ? (x = /* @__PURE__ */ y.jsx(i, { ...a, ref: s, children: b }), r[7] = s, r[8] = a, r[9] = b, r[10] = x) : x = r[10], u = x;
|
|
323
|
+
break e;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
r[3] = l, r[4] = s, r[5] = a, r[6] = u;
|
|
327
|
+
} else
|
|
328
|
+
u = r[6];
|
|
329
|
+
if (u !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
330
|
+
return u;
|
|
331
|
+
let f;
|
|
332
|
+
return r[11] !== l || r[12] !== s || r[13] !== a ? (f = /* @__PURE__ */ y.jsx(i, { ...a, ref: s, children: l }), r[11] = l, r[12] = s, r[13] = a, r[14] = f) : f = r[14], f;
|
|
333
|
+
});
|
|
334
|
+
return c.displayName = "Slot", c;
|
|
286
335
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
"bottom-left",
|
|
323
|
-
"bottom-right"
|
|
324
|
-
]
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
K.setQueryUpdates({
|
|
329
|
-
product: { fields: [{ badges: [
|
|
330
|
-
"id",
|
|
331
|
-
"position",
|
|
332
|
-
"assetId",
|
|
333
|
-
{ asset: [
|
|
334
|
-
"id",
|
|
335
|
-
"name",
|
|
336
|
-
"preview",
|
|
337
|
-
"source"
|
|
338
|
-
] },
|
|
339
|
-
{ collection: ["id", "name"] }
|
|
340
|
-
] }] },
|
|
341
|
-
search: { fields: [{ items: [{ badges: [
|
|
342
|
-
"id",
|
|
343
|
-
"position",
|
|
344
|
-
"assetId",
|
|
345
|
-
{ asset: [
|
|
346
|
-
"id",
|
|
347
|
-
"name",
|
|
348
|
-
"preview",
|
|
349
|
-
"source"
|
|
350
|
-
] },
|
|
351
|
-
{ collection: ["id", "name"] }
|
|
352
|
-
] }] }] },
|
|
353
|
-
products: { fields: [{ items: [{ badges: [
|
|
354
|
-
"id",
|
|
355
|
-
"position",
|
|
356
|
-
"assetId",
|
|
357
|
-
{ asset: [
|
|
358
|
-
"id",
|
|
359
|
-
"name",
|
|
360
|
-
"preview",
|
|
361
|
-
"source"
|
|
362
|
-
] },
|
|
363
|
-
{ collection: ["id", "name"] }
|
|
364
|
-
] }] }] },
|
|
365
|
-
briefProducts: { fields: [{ items: [{ badges: [
|
|
366
|
-
"id",
|
|
367
|
-
"position",
|
|
368
|
-
"assetId",
|
|
369
|
-
{ asset: [
|
|
370
|
-
"id",
|
|
371
|
-
"name",
|
|
372
|
-
"preview",
|
|
373
|
-
"source"
|
|
374
|
-
] },
|
|
375
|
-
{ collection: ["id", "name"] }
|
|
376
|
-
] }] }] }
|
|
377
|
-
}), K.setRequests({ getBadges: async () => K.getSdk().createRequest({
|
|
378
|
-
operation: "badges",
|
|
379
|
-
fields: ["totalItems", { items: [
|
|
380
|
-
"id",
|
|
381
|
-
"createdAt",
|
|
382
|
-
"updatedAt",
|
|
383
|
-
"collectionId",
|
|
384
|
-
"position",
|
|
385
|
-
"assetId",
|
|
386
|
-
{ asset: [
|
|
387
|
-
"id",
|
|
388
|
-
"name",
|
|
389
|
-
"preview",
|
|
390
|
-
"source"
|
|
391
|
-
] },
|
|
392
|
-
{ collection: ["id", "name"] }
|
|
393
|
-
] }]
|
|
394
|
-
}, { options: { take: 100 } }, !1).then((e) => e.data).catch((e) => ({
|
|
395
|
-
message: e.message,
|
|
396
|
-
errorCode: e.code || "unknown"
|
|
397
|
-
})) });
|
|
398
|
-
//#endregion
|
|
399
|
-
//#region src/lib/components/product-badges.tsx
|
|
400
|
-
var q = t(), J = "ProductBadge", [Y] = i(J), [He, Ue] = Y(J), X = ({ children: t, product: n, __scopeProductBadge: i, style: a, ...o }) => {
|
|
401
|
-
let s = ie(null), c = e(E());
|
|
402
|
-
if (!K.getEnabled()) return null;
|
|
403
|
-
let { badges: l } = n;
|
|
404
|
-
if (!l) return null;
|
|
405
|
-
let u = l.reduce((e, t) => (e[t.position] || (e[t.position] = []), e[t.position].push(t), e), {}), d = {
|
|
406
|
-
groupedBadges: u,
|
|
407
|
-
badges: l,
|
|
408
|
-
badgesRef: s,
|
|
409
|
-
positions: Object.keys(u)
|
|
410
|
-
};
|
|
411
|
-
return /* @__PURE__ */ (0, q.jsx)(He, {
|
|
412
|
-
scope: i,
|
|
413
|
-
...d,
|
|
414
|
-
children: /* @__PURE__ */ (0, q.jsx)(c, {
|
|
415
|
-
...o,
|
|
416
|
-
style: a,
|
|
417
|
-
children: r(t, d)
|
|
418
|
-
})
|
|
419
|
-
});
|
|
336
|
+
const C = () => {
|
|
337
|
+
const t = P.c(2), {
|
|
338
|
+
getPlatform: e
|
|
339
|
+
} = k();
|
|
340
|
+
let n;
|
|
341
|
+
return t[0] !== e ? (n = e(), t[0] = e, t[1] = n) : n = t[1], n;
|
|
342
|
+
}, I = "ProductBadge", [Q] = A(I), [Z, z] = Q(I), _ = (t) => {
|
|
343
|
+
const e = P.c(13);
|
|
344
|
+
let n, i, c, o, s;
|
|
345
|
+
e[0] !== t ? ({
|
|
346
|
+
children: i,
|
|
347
|
+
product: c,
|
|
348
|
+
__scopeProductBadge: n,
|
|
349
|
+
style: s,
|
|
350
|
+
...o
|
|
351
|
+
} = t, e[0] = t, e[1] = n, e[2] = i, e[3] = c, e[4] = o, e[5] = s) : (n = e[1], i = e[2], c = e[3], o = e[4], s = e[5]);
|
|
352
|
+
const r = N(null), l = C();
|
|
353
|
+
let a;
|
|
354
|
+
e[6] !== l ? (a = w(l), e[6] = l, e[7] = a) : a = e[7];
|
|
355
|
+
const u = a;
|
|
356
|
+
if (!v.getEnabled())
|
|
357
|
+
return null;
|
|
358
|
+
const {
|
|
359
|
+
badges: f
|
|
360
|
+
} = c;
|
|
361
|
+
if (!f)
|
|
362
|
+
return null;
|
|
363
|
+
const d = f.reduce(J, {}), p = Object.keys(d), g = {
|
|
364
|
+
groupedBadges: d,
|
|
365
|
+
badges: f,
|
|
366
|
+
badgesRef: r,
|
|
367
|
+
positions: p
|
|
368
|
+
}, h = V(i, g);
|
|
369
|
+
let b;
|
|
370
|
+
return e[8] !== u || e[9] !== o || e[10] !== s || e[11] !== h ? (b = /* @__PURE__ */ y.jsx(u, { ...o, style: s, children: h }), e[8] = u, e[9] = o, e[10] = s, e[11] = h, e[12] = b) : b = e[12], /* @__PURE__ */ y.jsx(Z, { scope: n, ...g, children: b });
|
|
420
371
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
372
|
+
_.displayName = I;
|
|
373
|
+
const E = (t) => {
|
|
374
|
+
const e = P.c(18);
|
|
375
|
+
let n, i, c, o, s;
|
|
376
|
+
e[0] !== t ? ({
|
|
377
|
+
children: c,
|
|
378
|
+
position: o,
|
|
379
|
+
asChild: i,
|
|
380
|
+
__scopeProductBadge: n,
|
|
381
|
+
...s
|
|
382
|
+
} = t, e[0] = t, e[1] = n, e[2] = i, e[3] = c, e[4] = o, e[5] = s) : (n = e[1], i = e[2], c = e[3], o = e[4], s = e[5]);
|
|
383
|
+
const r = C();
|
|
384
|
+
let l;
|
|
385
|
+
e[6] !== i || e[7] !== r ? (l = w(r, i, "div"), e[6] = i, e[7] = r, e[8] = l) : l = e[8];
|
|
386
|
+
const a = l, {
|
|
387
|
+
groupedBadges: u
|
|
388
|
+
} = z(I, n), f = u[o];
|
|
389
|
+
let d;
|
|
390
|
+
e[9] !== f || e[10] !== c || e[11] !== o ? (d = V(c, {
|
|
391
|
+
badges: f,
|
|
392
|
+
position: o
|
|
393
|
+
}), e[9] = f, e[10] = c, e[11] = o, e[12] = d) : d = e[12];
|
|
394
|
+
let p;
|
|
395
|
+
return e[13] !== a || e[14] !== o || e[15] !== s || e[16] !== d ? (p = /* @__PURE__ */ y.jsx(a, { ...s, "data-position": o, children: d }), e[13] = a, e[14] = o, e[15] = s, e[16] = d, e[17] = p) : p = e[17], p;
|
|
396
|
+
}, S = (t) => {
|
|
397
|
+
const e = P.c(13);
|
|
398
|
+
let n, i, c, o;
|
|
399
|
+
e[0] !== t ? ({
|
|
400
|
+
children: c,
|
|
401
|
+
asChild: n,
|
|
402
|
+
badge: i,
|
|
403
|
+
...o
|
|
404
|
+
} = t, e[0] = t, e[1] = n, e[2] = i, e[3] = c, e[4] = o) : (n = e[1], i = e[2], c = e[3], o = e[4]);
|
|
405
|
+
const s = C();
|
|
406
|
+
let r;
|
|
407
|
+
e[5] !== n || e[6] !== s ? (r = w(s, n, "div"), e[5] = n, e[6] = s, e[7] = r) : r = e[7];
|
|
408
|
+
const l = r, a = i?.id;
|
|
409
|
+
let u;
|
|
410
|
+
return e[8] !== l || e[9] !== c || e[10] !== o || e[11] !== a ? (u = /* @__PURE__ */ y.jsx(l, { ...o, "data-badge-id": a, children: c }), e[8] = l, e[9] = c, e[10] = o, e[11] = a, e[12] = u) : u = e[12], u;
|
|
411
|
+
}, T = (t) => {
|
|
412
|
+
const e = P.c(8), {
|
|
413
|
+
badge: n,
|
|
414
|
+
asChild: i,
|
|
415
|
+
...c
|
|
416
|
+
} = t, o = C();
|
|
417
|
+
let s;
|
|
418
|
+
e[0] !== i || e[1] !== o ? (s = w(o, i, "img"), e[0] = i, e[1] = o, e[2] = s) : s = e[2];
|
|
419
|
+
const r = s, l = O(c, o), a = n.asset?.preview;
|
|
420
|
+
let u;
|
|
421
|
+
return e[3] !== r || e[4] !== n.collection.name || e[5] !== a || e[6] !== l ? (u = /* @__PURE__ */ y.jsx(r, { src: a, alt: n.collection.name, "data-badge-name": n.collection.name, ...l }), e[3] = r, e[4] = n.collection.name, e[5] = a, e[6] = l, e[7] = u) : u = e[7], u;
|
|
444
422
|
};
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
423
|
+
E.displayName = "ProductBadgeGroup";
|
|
424
|
+
S.displayName = "ProductBadgeItem";
|
|
425
|
+
T.displayName = "ProductBadgeImage";
|
|
426
|
+
const re = {
|
|
427
|
+
Root: _,
|
|
428
|
+
Group: E,
|
|
429
|
+
Item: S,
|
|
430
|
+
Image: T
|
|
431
|
+
};
|
|
432
|
+
function J(t, e) {
|
|
433
|
+
return t[e.position] || (t[e.position] = []), t[e.position].push(e), t;
|
|
434
|
+
}
|
|
435
|
+
export {
|
|
436
|
+
re as ProductBadge,
|
|
437
|
+
v as VendureBadgePlugin
|
|
451
438
|
};
|
|
452
|
-
//#endregion
|
|
453
|
-
export { We as ProductBadge, K as VendureBadgePlugin };
|