@commercelayer/app-elements 7.15.0 → 7.16.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/dist/{CodeEditorComponent-_TYzE5JR.js → CodeEditorComponent-CeoYRfFV.js} +2 -2
- package/dist/{InputDateComponent-hOMN2atv.js → InputDateComponent-CterUdLa.js} +2 -2
- package/dist/{RuleEngineComponent-CabW-AtC.js → RuleEngineComponent-BA2iT2vK.js} +89 -80
- package/dist/{en-B-7ylwWx.js → en-CKYYACw4.js} +4 -1
- package/dist/{fetchCoreResourcesSuggestions-CkzjWPYB.js → fetchCoreResourcesSuggestions-CUuDKMmV.js} +1 -1
- package/dist/{it-BXPKgQsm.js → it-DZ0KnPQs.js} +4 -1
- package/dist/locales/en.d.ts +3 -0
- package/dist/{main-DClsDolL.js → main-CvmWwRKp.js} +8388 -8230
- package/dist/main.js +1 -1
- package/dist/{parseISO-4tQNE1Vc.js → parseISO-D28VuYUV.js} +1 -1
- package/dist/ui/composite/SearchBar.d.ts +15 -0
- package/dist/ui/forms/RuleEngine/Condition/hooks.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/InputResourceSelector.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/FiltersBar.d.ts +7 -1
- package/dist/ui/resources/useResourceFilters/FiltersSearchBar.d.ts +2 -2
- package/dist/ui/resources/useResourceFilters/useResourceFilters.test.d.ts +1 -0
- package/dist/ui/resources/useResourceFilters/useResourceSelectOptions.d.ts +1 -1
- package/dist/ui/resources/useResourceList/useMetricsCursorTrail.d.ts +37 -0
- package/dist/ui/resources/useResourceList/usePageInUrl.d.ts +33 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { u as Pe, j as le, I as Se } from "./main-
|
|
2
|
+
import { u as Pe, j as le, I as Se } from "./main-CvmWwRKp.js";
|
|
3
3
|
import $, { memo as ie, useState as N, useRef as h, useCallback as ne, useEffect as S, forwardRef as Ce } from "react";
|
|
4
|
-
import { f as Ee, a as Ie } from "./fetchCoreResourcesSuggestions-
|
|
4
|
+
import { f as Ee, a as Ie } from "./fetchCoreResourcesSuggestions-CUuDKMmV.js";
|
|
5
5
|
function se(e, t) {
|
|
6
6
|
(t == null || t > e.length) && (t = e.length);
|
|
7
7
|
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { c as z, t as S, m as pr, a as fr, b as me, d as ve, n as vt, e as Be, g as hr, f as Ur, h as Vr, s as ot, i as vr, k as qr, l as mr, o as Dr, p as jr, q as $r, r as Yt, v as Gr, w as zr, x as Xr, y as Lt, z as Ae, A as Zr, j as ae, B as G, C as pe, D as _e, E as _t, F as xt, G as gr, H as Et, J as yr, K as Jr, L as Ft, M as Te, N as en, O as tn, P as rn, Q as st, R as nn, S as an, I as on, T as sn, U as ln, V as cn, W as un } from "./main-
|
|
2
|
+
import { c as z, t as S, m as pr, a as fr, b as me, d as ve, n as vt, e as Be, g as hr, f as Ur, h as Vr, s as ot, i as vr, k as qr, l as mr, o as Dr, p as jr, q as $r, r as Yt, v as Gr, w as zr, x as Xr, y as Lt, z as Ae, A as Zr, j as ae, B as G, C as pe, D as _e, E as _t, F as xt, G as gr, H as Et, J as yr, K as Jr, L as Ft, M as Te, N as en, O as tn, P as rn, Q as st, R as nn, S as an, I as on, T as sn, U as ln, V as cn, W as un } from "./main-CvmWwRKp.js";
|
|
3
3
|
import * as M from "react";
|
|
4
4
|
import v, { useLayoutEffect as wr, cloneElement as br, createRef as Ce, Component as X, useRef as kt, useEffect as At, useCallback as dn, createElement as pn, forwardRef as fn, useMemo as hn } from "react";
|
|
5
5
|
import * as vn from "react-dom";
|
|
6
6
|
import mn from "react-dom";
|
|
7
|
-
import { p as Dn } from "./parseISO-
|
|
7
|
+
import { p as Dn } from "./parseISO-D28VuYUV.js";
|
|
8
8
|
function _r(o, n, t) {
|
|
9
9
|
return z(o, +S(o) + n);
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as B, X as Oe, Y as Re, Z as Ve, j as t, _ as R, $ as U, a0 as j, a1 as S, E as L, a2 as Ae, a3 as Me, a4 as Ee, a5 as Y, a6 as ae, a7 as x, T as k, a8 as C, a9 as $, aa as _, ab as y, ac as re, ad as E, ae as z, af as O, ag as X, ah as Ie, u as oe, ai as qe, aj as De, ak as H, I as Le, al as Fe } from "./main-
|
|
2
|
+
import { t as B, X as Oe, Y as Re, Z as Ve, j as t, _ as R, $ as U, a0 as j, a1 as S, E as L, a2 as Ae, a3 as Me, a4 as Ee, a5 as Y, a6 as ae, a7 as x, T as k, a8 as C, a9 as $, aa as _, ab as y, ac as re, ad as E, ae as z, af as O, ag as X, ah as Ie, u as oe, ai as qe, aj as De, ak as H, I as Le, al as Fe } from "./main-CvmWwRKp.js";
|
|
3
3
|
import K, { useReducer as ze, useCallback as A, useMemo as ie, createContext as Ge, useContext as Ue, useState as v, useEffect as T, useRef as ue } from "react";
|
|
4
4
|
import "react-hook-form";
|
|
5
|
-
import { b as Je, e as ce, a as We, c as de, f as Be } from "./fetchCoreResourcesSuggestions-
|
|
5
|
+
import { b as Je, e as ce, a as We, c as de, f as Be } from "./fetchCoreResourcesSuggestions-CUuDKMmV.js";
|
|
6
6
|
import "wouter";
|
|
7
|
-
import { p as Q } from "./parseISO-
|
|
7
|
+
import { p as Q } from "./parseISO-D28VuYUV.js";
|
|
8
8
|
function Z(e, s) {
|
|
9
9
|
const n = e.match(
|
|
10
10
|
/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/
|
|
@@ -103,8 +103,8 @@ function Ke({
|
|
|
103
103
|
renderOptions: {},
|
|
104
104
|
selectedRuleIndex: 0
|
|
105
105
|
}), r = A(
|
|
106
|
-
(c, d,
|
|
107
|
-
l({ type: "SET_PATH", path: c, value: d, allowNullValue:
|
|
106
|
+
(c, d, m = !1) => {
|
|
107
|
+
l({ type: "SET_PATH", path: c, value: d, allowNullValue: m });
|
|
108
108
|
},
|
|
109
109
|
[]
|
|
110
110
|
), i = A((c) => {
|
|
@@ -137,14 +137,14 @@ function Ke({
|
|
|
137
137
|
);
|
|
138
138
|
return /* @__PURE__ */ t.jsx(pe.Provider, { value: u, children: e });
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function f() {
|
|
141
141
|
const e = Ue(pe);
|
|
142
142
|
if (e === void 0)
|
|
143
143
|
throw new Error("useRuleEngine must be used within a RuleEngineProvider");
|
|
144
144
|
return e;
|
|
145
145
|
}
|
|
146
|
-
const Qe = ({ children: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-white rounded-md p-4 shadow-xs flex flex-col gap-2 empty:hidden", children: e }),
|
|
147
|
-
const { state: r, setRenderOption: i } =
|
|
146
|
+
const Qe = ({ children: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-white rounded-md p-4 shadow-xs flex flex-col gap-2 empty:hidden", children: e }), me = ({ children: e, dropdownItems: s, options: n, pathPrefix: l }) => {
|
|
147
|
+
const { state: r, setRenderOption: i } = f(), a = `${l}.isOpen`, o = U(r.renderOptions, a) ?? !0;
|
|
148
148
|
return /* @__PURE__ */ t.jsx("div", { className: "bg-gray-50 rounded-md flex items-center", children: /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between gap-2 grow p-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 grow", children: [
|
|
149
149
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
150
150
|
e,
|
|
@@ -179,7 +179,7 @@ const Qe = ({ children: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-wh
|
|
|
179
179
|
] }),
|
|
180
180
|
o && /* @__PURE__ */ t.jsx(Qe, { children: n })
|
|
181
181
|
] }) }) });
|
|
182
|
-
},
|
|
182
|
+
}, fe = [
|
|
183
183
|
{
|
|
184
184
|
/** Matches if field value equals provided value
|
|
185
185
|
* @field Integer, String, Datetime, Boolean
|
|
@@ -501,7 +501,8 @@ const he = {
|
|
|
501
501
|
tag: "tags",
|
|
502
502
|
sku: "skus",
|
|
503
503
|
sku_list: "sku_lists",
|
|
504
|
-
bundle: "bundles"
|
|
504
|
+
bundle: "bundles",
|
|
505
|
+
customer_group: "customer_groups"
|
|
505
506
|
};
|
|
506
507
|
function Ze(e) {
|
|
507
508
|
return he[e];
|
|
@@ -510,7 +511,7 @@ function J(e) {
|
|
|
510
511
|
const [s, n] = v(void 0);
|
|
511
512
|
return T(() => {
|
|
512
513
|
e?.field != null && Je(e.field).then((l) => {
|
|
513
|
-
const r =
|
|
514
|
+
const r = fe.find(
|
|
514
515
|
(i) => i.matcher === e.matcher
|
|
515
516
|
);
|
|
516
517
|
n({
|
|
@@ -536,7 +537,7 @@ function be(e) {
|
|
|
536
537
|
function xe() {
|
|
537
538
|
const {
|
|
538
539
|
state: { selectedRuleIndex: e, value: s }
|
|
539
|
-
} =
|
|
540
|
+
} = f();
|
|
540
541
|
return be(
|
|
541
542
|
s.rules?.[e]?.conditions
|
|
542
543
|
);
|
|
@@ -549,19 +550,21 @@ const ve = ({
|
|
|
549
550
|
onSelect: r,
|
|
550
551
|
isMulti: i = !1
|
|
551
552
|
}) => {
|
|
552
|
-
const { sdkClient: a } = Ee(), { data: o } = Y(s, "list", [
|
|
553
|
+
const { sdkClient: a } = Ee(), { data: o } = Y(s, "list", [
|
|
554
|
+
G({ value: "", resource: s })
|
|
555
|
+
]), { data: u, isLoading: c } = Y(
|
|
553
556
|
s,
|
|
554
557
|
"list",
|
|
555
558
|
[
|
|
556
559
|
{
|
|
557
|
-
...G({ value: "" }),
|
|
560
|
+
...G({ value: "", resource: s }),
|
|
558
561
|
filters: {
|
|
559
562
|
id_in: Array.isArray(e) ? e : [e]
|
|
560
563
|
}
|
|
561
564
|
}
|
|
562
565
|
]
|
|
563
566
|
), d = ae([...u ?? [], ...o ?? []], "id");
|
|
564
|
-
function
|
|
567
|
+
function m(h) {
|
|
565
568
|
return {
|
|
566
569
|
label: d?.find((p) => p.id === h.toString())?.name ?? `${c ? "" : "⚠️ "}${h.toString()}`,
|
|
567
570
|
value: h.toString()
|
|
@@ -574,11 +577,13 @@ const ve = ({
|
|
|
574
577
|
isClearable: !1,
|
|
575
578
|
isDisabled: n,
|
|
576
579
|
isMulti: i,
|
|
577
|
-
defaultValue: Array.isArray(e) ? e.map(
|
|
580
|
+
defaultValue: Array.isArray(e) ? e.map(m) : e != null ? m(e) : void 0,
|
|
578
581
|
menuFooterText: o != null && o.meta.recordCount > 25 ? "Type to search for more options." : void 0,
|
|
579
582
|
initialValues: ee(d ?? [], l),
|
|
580
583
|
loadAsyncValues: async (h) => {
|
|
581
|
-
const p = await a[s].list(
|
|
584
|
+
const p = await a[s].list(
|
|
585
|
+
G({ value: h, resource: s })
|
|
586
|
+
);
|
|
582
587
|
return ee(p, l);
|
|
583
588
|
},
|
|
584
589
|
onSelect: (h) => {
|
|
@@ -588,15 +593,16 @@ const ve = ({
|
|
|
588
593
|
`${i ? "multi" : "single"}-${c}-${JSON.stringify(d)}`
|
|
589
594
|
);
|
|
590
595
|
};
|
|
591
|
-
function G({
|
|
596
|
+
function G({
|
|
597
|
+
value: e,
|
|
598
|
+
resource: s
|
|
599
|
+
}) {
|
|
592
600
|
return {
|
|
593
601
|
pageSize: 25,
|
|
594
602
|
sort: {
|
|
595
603
|
name: "asc"
|
|
596
604
|
},
|
|
597
|
-
filters: {
|
|
598
|
-
name_i_cont: e
|
|
599
|
-
}
|
|
605
|
+
filters: s === "skus" ? { name_or_code_i_cont: e } : { name_i_cont: e }
|
|
600
606
|
};
|
|
601
607
|
}
|
|
602
608
|
function ee(e, s) {
|
|
@@ -836,9 +842,9 @@ function nt(e, s) {
|
|
|
836
842
|
for (const [i, a] of r.entries()) {
|
|
837
843
|
const o = _e(a, Pe), u = $e(o, a, e), c = ye.actions[s], d = Object.keys(c);
|
|
838
844
|
n[i] = {};
|
|
839
|
-
for (const
|
|
840
|
-
const h = c[
|
|
841
|
-
h != null && (n[i][
|
|
845
|
+
for (const m of d) {
|
|
846
|
+
const h = c[m];
|
|
847
|
+
h != null && (n[i][m] = u.filter((p) => h[p.name] != null).map((p) => {
|
|
842
848
|
const g = h[p.name];
|
|
843
849
|
return {
|
|
844
850
|
...p,
|
|
@@ -974,9 +980,9 @@ function N({
|
|
|
974
980
|
optionName: s,
|
|
975
981
|
pathPrefix: n
|
|
976
982
|
}) {
|
|
977
|
-
const { setPath: l, optionsConfig: r, schemaType: i } =
|
|
983
|
+
const { setPath: l, optionsConfig: r, schemaType: i } = f(), a = i === "order-rules" ? "order" : i === "price-rules" ? "price" : void 0, o = e != null && "selector" in e ? e.selector : "", u = "type" in e ? r.actions[e.type]?.[o]?.find((d) => d.name === s) : r.conditions.find((d) => d.name === s), c = A(
|
|
978
984
|
({ children: d }) => {
|
|
979
|
-
const
|
|
985
|
+
const m = u?.label ?? je[s];
|
|
980
986
|
return u?.required === !0 ? /* @__PURE__ */ t.jsx(
|
|
981
987
|
I,
|
|
982
988
|
{
|
|
@@ -986,7 +992,7 @@ function N({
|
|
|
986
992
|
variant: "info",
|
|
987
993
|
size: "small",
|
|
988
994
|
className: "flex gap-2 items-center",
|
|
989
|
-
children:
|
|
995
|
+
children: m
|
|
990
996
|
}
|
|
991
997
|
),
|
|
992
998
|
children: d
|
|
@@ -1019,7 +1025,7 @@ function N({
|
|
|
1019
1025
|
size: "small",
|
|
1020
1026
|
className: "flex gap-2 items-center",
|
|
1021
1027
|
children: [
|
|
1022
|
-
|
|
1028
|
+
m,
|
|
1023
1029
|
/* @__PURE__ */ t.jsx(j, { name: "caretDown" })
|
|
1024
1030
|
]
|
|
1025
1031
|
}
|
|
@@ -1044,7 +1050,7 @@ function we({
|
|
|
1044
1050
|
pathPrefix: s,
|
|
1045
1051
|
optionConfig: n
|
|
1046
1052
|
}) {
|
|
1047
|
-
const { setPath: l } =
|
|
1053
|
+
const { setPath: l } = f(), r = n?.values?.find(
|
|
1048
1054
|
(a) => R(e.field, a.meta?.field) && R(e.operator, a.meta?.operator)
|
|
1049
1055
|
), i = [
|
|
1050
1056
|
{ label: "=", value: "eq" },
|
|
@@ -1121,9 +1127,9 @@ function ot({
|
|
|
1121
1127
|
/* @__PURE__ */ t.jsx(dt, { item: e, pathPrefix: s }),
|
|
1122
1128
|
/* @__PURE__ */ t.jsx(ht, { item: e, pathPrefix: s }),
|
|
1123
1129
|
/* @__PURE__ */ t.jsx(gt, { item: e, pathPrefix: s }),
|
|
1124
|
-
/* @__PURE__ */ t.jsx(ft, { item: e, pathPrefix: s }),
|
|
1125
|
-
/* @__PURE__ */ t.jsx(pt, { item: e, pathPrefix: s }),
|
|
1126
1130
|
/* @__PURE__ */ t.jsx(mt, { item: e, pathPrefix: s }),
|
|
1131
|
+
/* @__PURE__ */ t.jsx(pt, { item: e, pathPrefix: s }),
|
|
1132
|
+
/* @__PURE__ */ t.jsx(ft, { item: e, pathPrefix: s }),
|
|
1127
1133
|
/* @__PURE__ */ t.jsx(ct, { item: e, pathPrefix: s })
|
|
1128
1134
|
] });
|
|
1129
1135
|
}
|
|
@@ -1131,7 +1137,7 @@ function it({
|
|
|
1131
1137
|
item: e,
|
|
1132
1138
|
pathPrefix: s
|
|
1133
1139
|
}) {
|
|
1134
|
-
const n = "selector", { setPath: l, schemaType: r } =
|
|
1140
|
+
const n = "selector", { setPath: l, schemaType: r } = f(), { t: i } = re(), a = N({ item: e, optionName: n, pathPrefix: s });
|
|
1135
1141
|
if (!(n in e) || a == null)
|
|
1136
1142
|
return null;
|
|
1137
1143
|
const o = xt[r].map((d) => ({
|
|
@@ -1161,7 +1167,7 @@ function ut({
|
|
|
1161
1167
|
item: e,
|
|
1162
1168
|
pathPrefix: s
|
|
1163
1169
|
}) {
|
|
1164
|
-
const n = "groups", { setPath: l, schemaType: r } =
|
|
1170
|
+
const n = "groups", { setPath: l, schemaType: r } = f(), i = xe(), a = N({ item: e, optionName: n, pathPrefix: s });
|
|
1165
1171
|
if (!(n in e) || a == null || i.length <= 0 && ("groups" in e && e.groups != null ? e.groups : []).length <= 0)
|
|
1166
1172
|
return null;
|
|
1167
1173
|
const o = "groups" in e ? e?.groups?.map((u) => ({
|
|
@@ -1192,7 +1198,7 @@ function ct({
|
|
|
1192
1198
|
item: e,
|
|
1193
1199
|
pathPrefix: s
|
|
1194
1200
|
}) {
|
|
1195
|
-
const n = "round", { setPath: l } =
|
|
1201
|
+
const n = "round", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1196
1202
|
if (!(n in e) || r == null)
|
|
1197
1203
|
return null;
|
|
1198
1204
|
const i = [
|
|
@@ -1216,7 +1222,7 @@ function dt({
|
|
|
1216
1222
|
item: e,
|
|
1217
1223
|
pathPrefix: s
|
|
1218
1224
|
}) {
|
|
1219
|
-
const n = "quantity", { setPath: l } =
|
|
1225
|
+
const n = "quantity", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1220
1226
|
if (!(n in e) || r == null)
|
|
1221
1227
|
return null;
|
|
1222
1228
|
const i = e[n];
|
|
@@ -1238,7 +1244,7 @@ function pt({
|
|
|
1238
1244
|
item: e,
|
|
1239
1245
|
pathPrefix: s
|
|
1240
1246
|
}) {
|
|
1241
|
-
const n = "limit", { setPath: l } =
|
|
1247
|
+
const n = "limit", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1242
1248
|
if (!(n in e) || r == null)
|
|
1243
1249
|
return null;
|
|
1244
1250
|
const i = r.optionConfig?.values?.find(
|
|
@@ -1279,7 +1285,7 @@ function pt({
|
|
|
1279
1285
|
)
|
|
1280
1286
|
] }) });
|
|
1281
1287
|
}
|
|
1282
|
-
function
|
|
1288
|
+
function mt({
|
|
1283
1289
|
item: e,
|
|
1284
1290
|
pathPrefix: s
|
|
1285
1291
|
}) {
|
|
@@ -1293,11 +1299,11 @@ function ft({
|
|
|
1293
1299
|
}
|
|
1294
1300
|
) });
|
|
1295
1301
|
}
|
|
1296
|
-
function
|
|
1302
|
+
function ft({
|
|
1297
1303
|
item: e,
|
|
1298
1304
|
pathPrefix: s
|
|
1299
1305
|
}) {
|
|
1300
|
-
const n = "bundle", { setPath: l } =
|
|
1306
|
+
const n = "bundle", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1301
1307
|
if (!(n in e) || r == null)
|
|
1302
1308
|
return null;
|
|
1303
1309
|
const i = r.optionConfig?.values?.find(
|
|
@@ -1358,7 +1364,7 @@ function gt({
|
|
|
1358
1364
|
item: e,
|
|
1359
1365
|
pathPrefix: s
|
|
1360
1366
|
}) {
|
|
1361
|
-
const n = "discount_mode", { setPath: l } =
|
|
1367
|
+
const n = "discount_mode", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1362
1368
|
return !(n in e) || r == null ? null : /* @__PURE__ */ t.jsx(r.OptionRow, { children: /* @__PURE__ */ t.jsx(
|
|
1363
1369
|
x,
|
|
1364
1370
|
{
|
|
@@ -1379,7 +1385,7 @@ function ht({
|
|
|
1379
1385
|
item: e,
|
|
1380
1386
|
pathPrefix: s
|
|
1381
1387
|
}) {
|
|
1382
|
-
const n = "apply_on", { setPath: l } =
|
|
1388
|
+
const n = "apply_on", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1383
1389
|
return !(n in e) || r == null ? null : /* @__PURE__ */ t.jsx(r.OptionRow, { children: /* @__PURE__ */ t.jsx(
|
|
1384
1390
|
x,
|
|
1385
1391
|
{
|
|
@@ -1401,7 +1407,7 @@ function bt({
|
|
|
1401
1407
|
item: e,
|
|
1402
1408
|
pathPrefix: s
|
|
1403
1409
|
}) {
|
|
1404
|
-
const n = "identifiers", { setPath: l } =
|
|
1410
|
+
const n = "identifiers", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1405
1411
|
if (r == null || r.optionConfig?.required !== !0)
|
|
1406
1412
|
return null;
|
|
1407
1413
|
const i = n in e ? e.identifiers : {};
|
|
@@ -1426,11 +1432,11 @@ function bt({
|
|
|
1426
1432
|
if (d.length > 0)
|
|
1427
1433
|
l(`${s}.${n}`, {
|
|
1428
1434
|
...i,
|
|
1429
|
-
[u]: d.map((
|
|
1435
|
+
[u]: d.map((m) => m.value).filter((m) => m != null)
|
|
1430
1436
|
});
|
|
1431
1437
|
else {
|
|
1432
|
-
const
|
|
1433
|
-
delete
|
|
1438
|
+
const m = { ...i };
|
|
1439
|
+
delete m[u], l(`${s}.${n}`, m);
|
|
1434
1440
|
}
|
|
1435
1441
|
}
|
|
1436
1442
|
}
|
|
@@ -1468,7 +1474,7 @@ function yt({
|
|
|
1468
1474
|
item: e,
|
|
1469
1475
|
pathPrefix: s
|
|
1470
1476
|
}) {
|
|
1471
|
-
const n = "group", { setPath: l } =
|
|
1477
|
+
const n = "group", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s }), i = xe();
|
|
1472
1478
|
return !(n in e) || r == null || e.group === void 0 ? null : /* @__PURE__ */ t.jsx(r.OptionRow, { children: /* @__PURE__ */ t.jsx(
|
|
1473
1479
|
x,
|
|
1474
1480
|
{
|
|
@@ -1493,7 +1499,7 @@ function jt({
|
|
|
1493
1499
|
item: e,
|
|
1494
1500
|
pathPrefix: s
|
|
1495
1501
|
}) {
|
|
1496
|
-
const n = "aggregations", { setPath: l } =
|
|
1502
|
+
const n = "aggregations", { setPath: l } = f(), [r, i] = v(0), a = N({ item: e, optionName: n, pathPrefix: s });
|
|
1497
1503
|
return !(n in e) || a == null || e[n] == null || e[n].length === 0 ? null : /* @__PURE__ */ t.jsx(a.OptionRow, { children: e.aggregations?.map((o, u) => {
|
|
1498
1504
|
const c = u.toString();
|
|
1499
1505
|
return /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between gap-2", children: [
|
|
@@ -1559,7 +1565,7 @@ function _t({
|
|
|
1559
1565
|
item: e,
|
|
1560
1566
|
pathPrefix: s
|
|
1561
1567
|
}) {
|
|
1562
|
-
const n = "scope", { setPath: l } =
|
|
1568
|
+
const n = "scope", { setPath: l } = f(), r = N({ item: e, optionName: n, pathPrefix: s });
|
|
1563
1569
|
return !(n in e) || r == null ? null : /* @__PURE__ */ t.jsx(r.OptionRow, { children: /* @__PURE__ */ t.jsx(
|
|
1564
1570
|
x,
|
|
1565
1571
|
{
|
|
@@ -1580,7 +1586,7 @@ function $t({
|
|
|
1580
1586
|
item: e,
|
|
1581
1587
|
pathPrefix: s
|
|
1582
1588
|
}) {
|
|
1583
|
-
const { setPath: n } =
|
|
1589
|
+
const { setPath: n } = f();
|
|
1584
1590
|
if (e == null)
|
|
1585
1591
|
return null;
|
|
1586
1592
|
switch (e.type) {
|
|
@@ -1711,9 +1717,9 @@ function Nt({
|
|
|
1711
1717
|
state: { selectedRuleIndex: i },
|
|
1712
1718
|
optionsConfig: a,
|
|
1713
1719
|
schemaType: o
|
|
1714
|
-
} =
|
|
1720
|
+
} = f(), u = Object.keys(
|
|
1715
1721
|
a.actions
|
|
1716
|
-
), c = e != null && "selector" in e ? e.selector : "", d = e?.type != null ? a.actions?.[e.type]?.[c] ?? [] : [], { available:
|
|
1722
|
+
), c = e != null && "selector" in e ? e.selector : "", d = e?.type != null ? a.actions?.[e.type]?.[c] ?? [] : [], { available: m, required: h } = Ne(e, d), p = {
|
|
1717
1723
|
free_gift: "Free gift",
|
|
1718
1724
|
percentage: "Percentage discount",
|
|
1719
1725
|
fixed_amount: "Fixed amount",
|
|
@@ -1769,7 +1775,7 @@ function Nt({
|
|
|
1769
1775
|
},
|
|
1770
1776
|
[e, h, g]
|
|
1771
1777
|
), /* @__PURE__ */ t.jsx("div", { className: "mb-4 last:mb-0", children: /* @__PURE__ */ t.jsxs(
|
|
1772
|
-
|
|
1778
|
+
me,
|
|
1773
1779
|
{
|
|
1774
1780
|
pathPrefix: g,
|
|
1775
1781
|
dropdownItems: n != null ? /* @__PURE__ */ t.jsx(
|
|
@@ -1783,12 +1789,12 @@ function Nt({
|
|
|
1783
1789
|
) : void 0,
|
|
1784
1790
|
options: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1785
1791
|
/* @__PURE__ */ t.jsx(ot, { item: e, pathPrefix: g }),
|
|
1786
|
-
|
|
1792
|
+
m.length > 0 && /* @__PURE__ */ t.jsx(
|
|
1787
1793
|
S,
|
|
1788
1794
|
{
|
|
1789
1795
|
className: "inline-flex mt-6",
|
|
1790
1796
|
menuPosition: "bottom-left",
|
|
1791
|
-
dropdownItems:
|
|
1797
|
+
dropdownItems: m.map((b) => /* @__PURE__ */ t.jsx(
|
|
1792
1798
|
$,
|
|
1793
1799
|
{
|
|
1794
1800
|
onClick: () => {
|
|
@@ -1837,7 +1843,7 @@ function wt({
|
|
|
1837
1843
|
const [s, n] = v(0), {
|
|
1838
1844
|
setPath: l,
|
|
1839
1845
|
state: { selectedRuleIndex: r }
|
|
1840
|
-
} =
|
|
1846
|
+
} = f();
|
|
1841
1847
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1842
1848
|
/* @__PURE__ */ t.jsx("div", { children: e?.map((i, a, o) => /* @__PURE__ */ t.jsx(
|
|
1843
1849
|
Nt,
|
|
@@ -1875,7 +1881,7 @@ function Ct({
|
|
|
1875
1881
|
value: e,
|
|
1876
1882
|
name: s
|
|
1877
1883
|
}) {
|
|
1878
|
-
const { setPath: n, schemaType: l } =
|
|
1884
|
+
const { setPath: n, schemaType: l } = f(), { t: r } = re(), i = ue(null), a = l === "order-rules" ? "order" : l === "price-rules" ? "price" : void 0, o = ae(
|
|
1879
1885
|
Tt.filter(
|
|
1880
1886
|
(u) => a != null && u.startsWith(a)
|
|
1881
1887
|
).map((u) => ({
|
|
@@ -1910,8 +1916,8 @@ function Ct({
|
|
|
1910
1916
|
value: g,
|
|
1911
1917
|
label: g
|
|
1912
1918
|
};
|
|
1913
|
-
}),
|
|
1914
|
-
return [...c, ...d, ...
|
|
1919
|
+
}), m = u.includes(".metadata") ? [{ label: u, value: u }] : [];
|
|
1920
|
+
return [...c, ...d, ...m];
|
|
1915
1921
|
},
|
|
1916
1922
|
onSelect: async (u) => {
|
|
1917
1923
|
_(u) && (n(s, u.value), u.value.toString().endsWith(".") && i.current?.openMenu("first"));
|
|
@@ -1948,6 +1954,9 @@ const Tt = [
|
|
|
1948
1954
|
"order.line_items.sku.sku_list_items.sku_list.name",
|
|
1949
1955
|
"order.line_items.sku.tags.id",
|
|
1950
1956
|
"order.line_items.sku.tags.name",
|
|
1957
|
+
"order.line_items.bundle.id",
|
|
1958
|
+
"order.line_items.bundle.name",
|
|
1959
|
+
"order.line_items.bundle.tags.id",
|
|
1951
1960
|
"order.line_items.unit_amount_cents",
|
|
1952
1961
|
"order.market.code",
|
|
1953
1962
|
"order.market.id",
|
|
@@ -1972,14 +1981,14 @@ function St({
|
|
|
1972
1981
|
item: e,
|
|
1973
1982
|
pathPrefix: s
|
|
1974
1983
|
}) {
|
|
1975
|
-
const { setPath: n } =
|
|
1984
|
+
const { setPath: n } = f(), { infos: l } = J(e);
|
|
1976
1985
|
let r = l?.field?.type;
|
|
1977
1986
|
r == null && (r = ge(e?.value));
|
|
1978
1987
|
const i = l?.resource?.id, a = ["tag"], o = [
|
|
1979
1988
|
"matches",
|
|
1980
1989
|
"does_not_match",
|
|
1981
1990
|
"array_match"
|
|
1982
|
-
], u =
|
|
1991
|
+
], u = fe.filter(({ fieldTypes: c, visible: d }) => d !== !1 && c.includes(r)).filter(({ matcher: c }) => i == null || i != null && !a.includes(i) || o.includes(c)).map(({ matcher: c, label: d }) => ({ value: c, label: d }));
|
|
1983
1992
|
return /* @__PURE__ */ t.jsx(
|
|
1984
1993
|
x,
|
|
1985
1994
|
{
|
|
@@ -1999,7 +2008,7 @@ function St({
|
|
|
1999
2008
|
);
|
|
2000
2009
|
}
|
|
2001
2010
|
const Ce = ({ value: e, pathKey: s, infos: n, onSelect: l }) => {
|
|
2002
|
-
const { setPath: r } =
|
|
2011
|
+
const { setPath: r } = f();
|
|
2003
2012
|
return /* @__PURE__ */ t.jsx(
|
|
2004
2013
|
ve,
|
|
2005
2014
|
{
|
|
@@ -2035,7 +2044,7 @@ function te({
|
|
|
2035
2044
|
hasResourceSelector: n = !1,
|
|
2036
2045
|
infos: l
|
|
2037
2046
|
}) {
|
|
2038
|
-
const { setPath: r } =
|
|
2047
|
+
const { setPath: r } = f(), i = Object.keys(
|
|
2039
2048
|
M
|
|
2040
2049
|
)[0], a = ie(() => typeof e == "object" && e !== null && !Array.isArray(e) ? e : {
|
|
2041
2050
|
[i]: []
|
|
@@ -2099,7 +2108,7 @@ function kt({
|
|
|
2099
2108
|
infos: r,
|
|
2100
2109
|
remainingKeys: i
|
|
2101
2110
|
}) {
|
|
2102
|
-
const [a, o] = v(s), { setPath: u } =
|
|
2111
|
+
const [a, o] = v(s), { setPath: u } = f();
|
|
2103
2112
|
return T(() => {
|
|
2104
2113
|
u(`${n}.${e}`, a);
|
|
2105
2114
|
}, [a]), /* @__PURE__ */ t.jsx(
|
|
@@ -2270,7 +2279,7 @@ function Vt({
|
|
|
2270
2279
|
item: e,
|
|
2271
2280
|
pathPrefix: s
|
|
2272
2281
|
}) {
|
|
2273
|
-
const { setPath: n } =
|
|
2282
|
+
const { setPath: n } = f(), { componentType: l, fieldType: r } = Mt(e), i = `${s}.value`, [a, o] = v(0), [u, c] = v({
|
|
2274
2283
|
componentType: l,
|
|
2275
2284
|
matcher: e?.matcher,
|
|
2276
2285
|
field: e?.field
|
|
@@ -2322,7 +2331,7 @@ function ne({
|
|
|
2322
2331
|
componentType: n,
|
|
2323
2332
|
pathKey: l
|
|
2324
2333
|
}) {
|
|
2325
|
-
const { setPath: r } =
|
|
2334
|
+
const { setPath: r } = f(), { user: i } = oe(), { infos: a } = J(e), o = Te(e) ? e.value : void 0;
|
|
2326
2335
|
switch (n) {
|
|
2327
2336
|
case "date": {
|
|
2328
2337
|
const u = Q(typeof o == "string" ? o : "");
|
|
@@ -2545,7 +2554,7 @@ function Et({
|
|
|
2545
2554
|
pathPrefix: n,
|
|
2546
2555
|
onDelete: l
|
|
2547
2556
|
}) {
|
|
2548
|
-
const { setPath: r, setRenderOption: i, optionsConfig: a } =
|
|
2557
|
+
const { setPath: r, setRenderOption: i, optionsConfig: a } = f(), { available: o } = Ne(
|
|
2549
2558
|
e,
|
|
2550
2559
|
a.conditions
|
|
2551
2560
|
), u = [];
|
|
@@ -2573,17 +2582,17 @@ function Et({
|
|
|
2573
2582
|
}
|
|
2574
2583
|
)
|
|
2575
2584
|
)), /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsxs(
|
|
2576
|
-
|
|
2585
|
+
me,
|
|
2577
2586
|
{
|
|
2578
2587
|
pathPrefix: n,
|
|
2579
|
-
dropdownItems: u.map((c, d,
|
|
2588
|
+
dropdownItems: u.map((c, d, m) => (
|
|
2580
2589
|
// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
2581
2590
|
/* @__PURE__ */ t.jsxs(K.Fragment, { children: [
|
|
2582
2591
|
c.map((h, p) => (
|
|
2583
2592
|
// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
2584
2593
|
/* @__PURE__ */ t.jsx(K.Fragment, { children: h }, p)
|
|
2585
2594
|
)),
|
|
2586
|
-
d <
|
|
2595
|
+
d < m.length - 1 && /* @__PURE__ */ t.jsx(z, {})
|
|
2587
2596
|
] }, d)
|
|
2588
2597
|
)),
|
|
2589
2598
|
options: !H(e?.field) && !H(e?.matcher) && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
@@ -2637,7 +2646,7 @@ function Se({
|
|
|
2637
2646
|
}) {
|
|
2638
2647
|
const {
|
|
2639
2648
|
state: { selectedRuleIndex: r }
|
|
2640
|
-
} =
|
|
2649
|
+
} = f(), i = e?.conditions_logic?.toLowerCase() ?? "and", { setPath: a } = f(), [o, u] = v(0), c = n > 0;
|
|
2641
2650
|
return /* @__PURE__ */ t.jsxs(
|
|
2642
2651
|
"div",
|
|
2643
2652
|
{
|
|
@@ -2670,8 +2679,8 @@ function Se({
|
|
|
2670
2679
|
className: k({
|
|
2671
2680
|
"border-l border-gray-200 ml-3 pt-3": c
|
|
2672
2681
|
}),
|
|
2673
|
-
children: e?.conditions?.map((d,
|
|
2674
|
-
const p =
|
|
2682
|
+
children: e?.conditions?.map((d, m, h) => {
|
|
2683
|
+
const p = m === h.length - 1;
|
|
2675
2684
|
return /* @__PURE__ */ t.jsxs(
|
|
2676
2685
|
"div",
|
|
2677
2686
|
{
|
|
@@ -2689,7 +2698,7 @@ function Se({
|
|
|
2689
2698
|
{
|
|
2690
2699
|
item: d?.nested ?? void 0,
|
|
2691
2700
|
nestingLevel: d?.nested != null ? n + 1 : 0,
|
|
2692
|
-
pathPrefix: `${l}.conditions.${
|
|
2701
|
+
pathPrefix: `${l}.conditions.${m}.nested`,
|
|
2693
2702
|
children: /* @__PURE__ */ t.jsx(
|
|
2694
2703
|
"div",
|
|
2695
2704
|
{
|
|
@@ -2701,7 +2710,7 @@ function Se({
|
|
|
2701
2710
|
{
|
|
2702
2711
|
item: d,
|
|
2703
2712
|
nestingLevel: n,
|
|
2704
|
-
pathPrefix: `${l}.conditions.${
|
|
2713
|
+
pathPrefix: `${l}.conditions.${m}`,
|
|
2705
2714
|
onDelete: h.length > 1 || n > 0 ? () => {
|
|
2706
2715
|
u((g) => g + 1);
|
|
2707
2716
|
} : void 0
|
|
@@ -2715,7 +2724,7 @@ function Se({
|
|
|
2715
2724
|
)
|
|
2716
2725
|
]
|
|
2717
2726
|
},
|
|
2718
|
-
`${r}-${
|
|
2727
|
+
`${r}-${m}-${o}`
|
|
2719
2728
|
);
|
|
2720
2729
|
})
|
|
2721
2730
|
}
|
|
@@ -2754,7 +2763,7 @@ function qt() {
|
|
|
2754
2763
|
const {
|
|
2755
2764
|
setPath: e,
|
|
2756
2765
|
state: { value: s, selectedRuleIndex: n }
|
|
2757
|
-
} =
|
|
2766
|
+
} = f(), [l, r] = v(
|
|
2758
2767
|
s.rules?.[n]?.name ?? ""
|
|
2759
2768
|
);
|
|
2760
2769
|
return T(() => {
|
|
@@ -2853,12 +2862,12 @@ function Lt(e) {
|
|
|
2853
2862
|
setSelectedRuleIndex: l,
|
|
2854
2863
|
setValue: r,
|
|
2855
2864
|
setPath: i
|
|
2856
|
-
} =
|
|
2865
|
+
} = f(), [a, o] = v(!1), [u, c] = v(
|
|
2857
2866
|
e.defaultCodeEditorVisible ?? !1
|
|
2858
|
-
), d = s.rules?.[n],
|
|
2867
|
+
), d = s.rules?.[n], m = ue(null), [h, p] = v(0);
|
|
2859
2868
|
T(
|
|
2860
2869
|
function() {
|
|
2861
|
-
!a && !R(F(
|
|
2870
|
+
!a && !R(F(m.current?.getValue()), s) && (m.current?.setValue(JSON.stringify(s, null, 2)), e.onChange?.(s));
|
|
2862
2871
|
},
|
|
2863
2872
|
[s]
|
|
2864
2873
|
);
|
|
@@ -3042,7 +3051,7 @@ function Lt(e) {
|
|
|
3042
3051
|
u && /* @__PURE__ */ t.jsx("div", { className: "shrink-0 basis-2/5", children: /* @__PURE__ */ t.jsx(
|
|
3043
3052
|
Fe,
|
|
3044
3053
|
{
|
|
3045
|
-
ref:
|
|
3054
|
+
ref: m,
|
|
3046
3055
|
name: e.id ?? e.name,
|
|
3047
3056
|
height: "100%",
|
|
3048
3057
|
language: "json",
|
|
@@ -428,13 +428,16 @@ The {{organization}} team`,
|
|
|
428
428
|
"order.country_code": "country code",
|
|
429
429
|
"order.currency_code": "currency code",
|
|
430
430
|
"order.customer_email": "customer email",
|
|
431
|
-
"order.customer.customer_group.id": "customer group
|
|
431
|
+
"order.customer.customer_group.id": "customer group",
|
|
432
432
|
"order.customer.customer_group.name": "customer group name",
|
|
433
433
|
"order.customer.email": "customer email",
|
|
434
434
|
"order.customer.tags.id": "customer tag",
|
|
435
435
|
"order.customer.tags.name": "customer tag name",
|
|
436
436
|
"order.line_items.adjustment": "adjustments",
|
|
437
437
|
"order.line_items.bundle": "bundles",
|
|
438
|
+
"order.line_items.bundle.id": "bundle",
|
|
439
|
+
"order.line_items.bundle.name": "bundle name",
|
|
440
|
+
"order.line_items.bundle.tags.id": "bundle tag",
|
|
438
441
|
"order.line_items.gift_card": "gift cards",
|
|
439
442
|
"order.line_items.item_type": "line item type",
|
|
440
443
|
"order.line_items.line_item_options.sku_option.tags.name": "sku option tags name",
|
|
@@ -429,12 +429,15 @@ Il team di {{organization}}`,
|
|
|
429
429
|
"order.currency_code": "valuta (3 lettere)",
|
|
430
430
|
"order.customer_email": "email del customer",
|
|
431
431
|
"order.customer.email": "email del customer",
|
|
432
|
-
"order.customer.customer_group.id": "
|
|
432
|
+
"order.customer.customer_group.id": "customer group",
|
|
433
433
|
"order.customer.customer_group.name": "nome del customer group",
|
|
434
434
|
"order.customer.tags.id": "customer tag",
|
|
435
435
|
"order.customer.tags.name": "nome del customer tag",
|
|
436
436
|
"order.line_items.adjustment": "adjustments",
|
|
437
437
|
"order.line_items.bundle": "bundles",
|
|
438
|
+
"order.line_items.bundle.id": "bundle",
|
|
439
|
+
"order.line_items.bundle.name": "nome del bundle",
|
|
440
|
+
"order.line_items.bundle.tags.id": "tag del bundle",
|
|
438
441
|
"order.line_items.gift_card": "gift cards",
|
|
439
442
|
"order.line_items.item_type": "tipo di line item",
|
|
440
443
|
"order.line_items.line_item_options.sku_option.tags.name": "sku options: nome del tag",
|
package/dist/locales/en.d.ts
CHANGED
|
@@ -430,6 +430,9 @@ declare const en: {
|
|
|
430
430
|
"order.customer.tags.name": string;
|
|
431
431
|
"order.line_items.adjustment": string;
|
|
432
432
|
"order.line_items.bundle": string;
|
|
433
|
+
"order.line_items.bundle.id": string;
|
|
434
|
+
"order.line_items.bundle.name": string;
|
|
435
|
+
"order.line_items.bundle.tags.id": string;
|
|
433
436
|
"order.line_items.gift_card": string;
|
|
434
437
|
"order.line_items.item_type": string;
|
|
435
438
|
"order.line_items.line_item_options.sku_option.tags.name": string;
|