@ws-ui/localization-editor 1.13.1 → 1.14.2
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/index.cjs.js.map +1 -1
- package/dist/index.es.js +94 -96
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -13556,108 +13556,106 @@ const Rg = Xt(void 0), mk = ({ children: e }) => {
|
|
|
13556
13556
|
"useLocalizationEditor must be used within a LocalizationEditorProvider"
|
|
13557
13557
|
);
|
|
13558
13558
|
return e;
|
|
13559
|
-
}, kt = () => document.querySelector(`.${mp}`) || document.body, WO = ({ container: e, ...t }) => /* @__PURE__ */ A(I0, { ...t, container: e || kt() }), vk = Os(
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
/* @__PURE__ */ A(
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
{
|
|
13589
|
-
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
|
|
13596
|
-
S.key === "Enter" && !S.shiftKey && (S.preventDefault(), g());
|
|
13597
|
-
}
|
|
13559
|
+
}, kt = () => document.querySelector(`.${mp}`) || document.body, WO = ({ container: e, ...t }) => /* @__PURE__ */ A(I0, { ...t, container: e || kt() }), vk = Os(({ keyName: e, value: t, isDefault: n }) => {
|
|
13560
|
+
const {
|
|
13561
|
+
state: { newValue: i, onEditValue: r },
|
|
13562
|
+
actions: a
|
|
13563
|
+
} = vn({
|
|
13564
|
+
newValue: t,
|
|
13565
|
+
onEditValue: !1
|
|
13566
|
+
}), { setLanguageKeyValue: s, removeKey: l } = bi(), u = Mi(), [c, h] = et(null), d = async () => {
|
|
13567
|
+
const { confirmed: S } = await u.actions.openModal({
|
|
13568
|
+
title: "Delete Key",
|
|
13569
|
+
type: os.CONFIRM,
|
|
13570
|
+
color: pp.DANGER,
|
|
13571
|
+
message: "Deleting this key will remove all translations associated with it across all locales. Are you sure you want to delete it ?",
|
|
13572
|
+
icon: "FdWarningDanger"
|
|
13573
|
+
});
|
|
13574
|
+
S && l(e);
|
|
13575
|
+
}, g = () => {
|
|
13576
|
+
r && (s(e, i), a.setOnEditValue(!1), h(null));
|
|
13577
|
+
}, m = () => {
|
|
13578
|
+
r && (a.setNewValue(t), a.setOnEditValue(!1), h(null));
|
|
13579
|
+
};
|
|
13580
|
+
return Me(() => {
|
|
13581
|
+
a.setNewValue(t);
|
|
13582
|
+
}, [t]), /* @__PURE__ */ fe("tr", { "data-cy": `shared-labels-row-${e}`, className: "odd:bg-white/5", children: [
|
|
13583
|
+
/* @__PURE__ */ A("td", { className: "px-2 text-xs font-normal h-10", children: e }),
|
|
13584
|
+
/* @__PURE__ */ A("td", { className: "p-2 whitespace-nowrap text-xs font-normal h-10", children: r ? /* @__PURE__ */ fe(wn.Root, { isInvalid: !!c, children: [
|
|
13585
|
+
/* @__PURE__ */ A(wn.Group, { children: /* @__PURE__ */ A(
|
|
13586
|
+
wn.Area,
|
|
13587
|
+
{
|
|
13588
|
+
"data-cy": `shared-labels-row-${e}-input`,
|
|
13589
|
+
autoHeight: !0,
|
|
13590
|
+
value: i,
|
|
13591
|
+
onChange: (S) => {
|
|
13592
|
+
a.setNewValue(S.target.value), h(null);
|
|
13593
|
+
},
|
|
13594
|
+
onKeyDown: (S) => {
|
|
13595
|
+
S.key === "Enter" && !S.shiftKey && (S.preventDefault(), g());
|
|
13598
13596
|
}
|
|
13599
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13597
|
+
}
|
|
13598
|
+
) }),
|
|
13599
|
+
c && /* @__PURE__ */ A(wn.Message, { children: c == null ? void 0 : c.message })
|
|
13600
|
+
] }) : /* @__PURE__ */ A(
|
|
13601
|
+
"span",
|
|
13602
|
+
{
|
|
13603
|
+
className: Tt("text-wrap", {
|
|
13604
|
+
"italic text-inactive-text": n
|
|
13605
|
+
}),
|
|
13606
|
+
onDoubleClick: () => {
|
|
13607
|
+
a.setOnEditValue(!0);
|
|
13608
|
+
},
|
|
13609
|
+
children: t
|
|
13610
|
+
}
|
|
13611
|
+
) }),
|
|
13612
|
+
/* @__PURE__ */ A("td", { className: "flex items-center px-2 text-xs font-normal float-right h-10", children: r ? /* @__PURE__ */ fe(vt, { children: [
|
|
13613
|
+
/* @__PURE__ */ A(_t, { label: "Confirm", container: kt(), children: /* @__PURE__ */ A(
|
|
13614
|
+
pt,
|
|
13603
13615
|
{
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13616
|
+
"data-cy": `shared-labels-row-${e}-confirm-button`,
|
|
13617
|
+
color: "white",
|
|
13618
|
+
variant: "ghost",
|
|
13619
|
+
onClick: g,
|
|
13620
|
+
children: /* @__PURE__ */ A(Bl, {})
|
|
13621
|
+
}
|
|
13622
|
+
) }),
|
|
13623
|
+
/* @__PURE__ */ A(_t, { label: "Cancel", container: kt(), children: /* @__PURE__ */ A(
|
|
13624
|
+
pt,
|
|
13625
|
+
{
|
|
13626
|
+
"data-cy": `shared-labels-row-${e}-cancel-button`,
|
|
13627
|
+
color: "white",
|
|
13628
|
+
variant: "ghost",
|
|
13629
|
+
onClick: m,
|
|
13630
|
+
children: /* @__PURE__ */ A(Ls, {})
|
|
13631
|
+
}
|
|
13632
|
+
) })
|
|
13633
|
+
] }) : /* @__PURE__ */ fe(vt, { children: [
|
|
13634
|
+
/* @__PURE__ */ A(_t, { label: "Edit", container: kt(), children: /* @__PURE__ */ A(
|
|
13635
|
+
pt,
|
|
13636
|
+
{
|
|
13637
|
+
"data-cy": `shared-labels-row-${e}-edit-button`,
|
|
13638
|
+
color: "white",
|
|
13639
|
+
variant: "ghost",
|
|
13640
|
+
onClick: () => {
|
|
13608
13641
|
a.setOnEditValue(!0);
|
|
13609
13642
|
},
|
|
13610
|
-
children:
|
|
13643
|
+
children: /* @__PURE__ */ A(yp, {})
|
|
13611
13644
|
}
|
|
13612
13645
|
) }),
|
|
13613
|
-
/* @__PURE__ */ A(
|
|
13614
|
-
|
|
13615
|
-
|
|
13616
|
-
{
|
|
13617
|
-
|
|
13618
|
-
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
{
|
|
13627
|
-
"data-cy": `shared-labels-row-${e}-cancel-button`,
|
|
13628
|
-
color: "white",
|
|
13629
|
-
variant: "ghost",
|
|
13630
|
-
onClick: m,
|
|
13631
|
-
children: /* @__PURE__ */ A(Ls, {})
|
|
13632
|
-
}
|
|
13633
|
-
) })
|
|
13634
|
-
] }) : /* @__PURE__ */ fe(vt, { children: [
|
|
13635
|
-
/* @__PURE__ */ A(_t, { label: "Edit", container: kt(), children: /* @__PURE__ */ A(
|
|
13636
|
-
pt,
|
|
13637
|
-
{
|
|
13638
|
-
"data-cy": `shared-labels-row-${e}-edit-button`,
|
|
13639
|
-
color: "white",
|
|
13640
|
-
variant: "ghost",
|
|
13641
|
-
onClick: () => {
|
|
13642
|
-
a.setOnEditValue(!0);
|
|
13643
|
-
},
|
|
13644
|
-
children: /* @__PURE__ */ A(yp, {})
|
|
13645
|
-
}
|
|
13646
|
-
) }),
|
|
13647
|
-
/* @__PURE__ */ A(_t, { label: "Delete", container: kt(), children: /* @__PURE__ */ A(
|
|
13648
|
-
pt,
|
|
13649
|
-
{
|
|
13650
|
-
"data-cy": `shared-labels-row-${e}-delete-button`,
|
|
13651
|
-
color: "white",
|
|
13652
|
-
variant: "ghost",
|
|
13653
|
-
onClick: d,
|
|
13654
|
-
children: /* @__PURE__ */ A(kp, {})
|
|
13655
|
-
}
|
|
13656
|
-
) })
|
|
13657
|
-
] }) })
|
|
13658
|
-
] });
|
|
13659
|
-
}
|
|
13660
|
-
), bk = ({
|
|
13646
|
+
/* @__PURE__ */ A(_t, { label: "Delete", container: kt(), children: /* @__PURE__ */ A(
|
|
13647
|
+
pt,
|
|
13648
|
+
{
|
|
13649
|
+
"data-cy": `shared-labels-row-${e}-delete-button`,
|
|
13650
|
+
color: "white",
|
|
13651
|
+
variant: "ghost",
|
|
13652
|
+
onClick: d,
|
|
13653
|
+
children: /* @__PURE__ */ A(kp, {})
|
|
13654
|
+
}
|
|
13655
|
+
) })
|
|
13656
|
+
] }) })
|
|
13657
|
+
] });
|
|
13658
|
+
}), bk = ({
|
|
13661
13659
|
onCancel: e,
|
|
13662
13660
|
onConfirm: t,
|
|
13663
13661
|
error: n,
|