mozrest-sdk-react-dev 0.3.46 → 0.3.48

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/mozrest-sdk.es.js CHANGED
@@ -8396,7 +8396,8 @@ const en = {
8396
8396
  "dd/mm/yyyy": "dd/mm/yyyy",
8397
8397
  NO_AVAILABLE_CHANNELS: NO_AVAILABLE_CHANNELS$4,
8398
8398
  select: select$4,
8399
- AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$4
8399
+ AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$4,
8400
+ "AI automatically replies to your customer reviews.": "AI automatically replies to your customer reviews."
8400
8401
  };
8401
8402
  const errors$3 = { "required": "Este campo es requerido", "email": "Este correo electrónico no es válido", "phone": "Número de teléfono no válido", "url": "URL no válida" };
8402
8403
  const SPECIALCLOSINGDATES$3 = "Fechas de cierre especiales u horarios de apertura diferentes (días especiales, festivos, eventos privados…)";
@@ -9457,7 +9458,8 @@ const es$2 = {
9457
9458
  "dd/mm/yyyy": "dd/mm/yyyy",
9458
9459
  NO_AVAILABLE_CHANNELS: NO_AVAILABLE_CHANNELS$3,
9459
9460
  select: select$3,
9460
- AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$3
9461
+ AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$3,
9462
+ "AI automatically replies to your customer reviews.": "La IA automáticamente responde a las reseñas de tus clientes."
9461
9463
  };
9462
9464
  const errors$2 = { "required": "Ce champ est requis", "email": "Cet email n'est pas valide", "phone": "Numéro de téléphone non valide", "url": "Cette URL n'est pas valide" };
9463
9465
  const SPECIALCLOSINGDATES$2 = "Fermetures exceptionnelles et horaires d’ouverture modifiés (jours fériés, événements, etc.) ";
@@ -10517,7 +10519,8 @@ const fr$1 = {
10517
10519
  "dd/mm/yyyy": "JJ/MM/AAAA",
10518
10520
  NO_AVAILABLE_CHANNELS: NO_AVAILABLE_CHANNELS$2,
10519
10521
  select: select$2,
10520
- AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$2
10522
+ AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$2,
10523
+ "AI automatically replies to your customer reviews.": "L'IA répond automatiquement aux avis de vos clients."
10521
10524
  };
10522
10525
  const errors$1 = { "required": "Dieses Feld ist erforderlich", "email": "Diese E-Mail ist nicht gültig", "phone": "Diese Telefonnummer ist nicht gültig", "url": "Diese URL ist nicht gültig" };
10523
10526
  const SPECIALCLOSINGDATES$1 = "Besondere Schließungstage oder abweichende Öffnungszeiten (besondere Tage, Feiertage, private Veranstaltungen…)";
@@ -11578,7 +11581,8 @@ const de$1 = {
11578
11581
  "dd/mm/yyyy": "dd/mm/yyyy",
11579
11582
  NO_AVAILABLE_CHANNELS: NO_AVAILABLE_CHANNELS$1,
11580
11583
  select: select$1,
11581
- AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$1
11584
+ AUTOREPLYREVIEWS: AUTOREPLYREVIEWS$1,
11585
+ "AI automatically replies to your customer reviews.": "Die KI antwortet automatisch auf Ihre Kundenbewertungen."
11582
11586
  };
11583
11587
  const errors = { "required": "Dit veld is verplicht", "email": "Dit e-mailadres is ongeldig", "phone": "Ongeldig telefoonnummer", "url": "Deze URL is ongeldig" };
11584
11588
  const SPECIALCLOSINGDATES = "Speciale sluitingsdagen of afwijkende openingstijden (feestdagen, evenementen, enz.)";
@@ -12639,7 +12643,8 @@ const nl$1 = {
12639
12643
  Covers,
12640
12644
  "dd/mm/yyyy": "dd/mm/yyyy",
12641
12645
  select,
12642
- AUTOREPLYREVIEWS
12646
+ AUTOREPLYREVIEWS,
12647
+ "AI automatically replies to your customer reviews.": "De AI-assistent zal nu automatisch reageren op onbeantwoorde beoordelingen van de laatste 30 dagen. U ontvangt een rapport om de resultaten te controleren."
12643
12648
  };
12644
12649
  instance.use(initReactI18next).init({
12645
12650
  // the translations
@@ -48592,7 +48597,7 @@ const TextArea$1 = React__default.forwardRef(({
48592
48597
  onChange2 && onChange2(ev);
48593
48598
  }
48594
48599
  return /* @__PURE__ */ jsxs("div", {
48595
- children: [/* @__PURE__ */ jsx$1(Label$1, {
48600
+ children: [label2 && /* @__PURE__ */ jsx$1(Label$1, {
48596
48601
  isHidden: hideLabel,
48597
48602
  htmlFor: id2,
48598
48603
  tooltip: tooltip2,
@@ -90866,11 +90871,12 @@ const styles$1j = {
90866
90871
  const Item$1 = ({
90867
90872
  name: name2,
90868
90873
  id: id2,
90869
- onChange: onChange2
90874
+ onChange: onChange2,
90875
+ isLoading
90870
90876
  }) => {
90871
90877
  return /* @__PURE__ */ jsxs("div", {
90872
90878
  className: styles$1j.item,
90873
- children: [name2, /* @__PURE__ */ jsx$1(ToggleField, {
90879
+ children: [name2, isLoading ? /* @__PURE__ */ jsx$1(Spinner$1, {}) : /* @__PURE__ */ jsx$1(ToggleField, {
90874
90880
  id: id2,
90875
90881
  onChange: onChange2
90876
90882
  })]
@@ -91864,6 +91870,21 @@ const formatData$g = (data2) => {
91864
91870
  autoReplyReviews: data2.autoReplyReviews ? "true" : "false"
91865
91871
  };
91866
91872
  };
91873
+ const styles$1d = {
91874
+ "ui-list": "_ui-list_4zr5h_1",
91875
+ "ui-list--horizontal": "_ui-list--horizontal_4zr5h_10"
91876
+ };
91877
+ const UIList$1 = ({
91878
+ mode = "horizontal",
91879
+ children
91880
+ }) => {
91881
+ return /* @__PURE__ */ jsx$1("ul", {
91882
+ className: classNames$2(styles$1d["ui-list"], styles$1d[`ui-list--${mode}`]),
91883
+ children: React__default.Children.map(children, (child, i) => /* @__PURE__ */ jsx$1("li", {
91884
+ children: child
91885
+ }, i))
91886
+ });
91887
+ };
91867
91888
  const Modal2 = ({
91868
91889
  open,
91869
91890
  children,
@@ -91891,7 +91912,7 @@ const Modal2 = ({
91891
91912
  });
91892
91913
  };
91893
91914
  const input = "_input_1ufjp_1";
91894
- const styles$1d = {
91915
+ const styles$1c = {
91895
91916
  input
91896
91917
  };
91897
91918
  const TextArea = React__default.forwardRef(({
@@ -91927,7 +91948,7 @@ const TextArea = React__default.forwardRef(({
91927
91948
  position: "relative"
91928
91949
  },
91929
91950
  children: [/* @__PURE__ */ jsx$1("textarea", {
91930
- className: styles$1d.input,
91951
+ className: styles$1c.input,
91931
91952
  onChange: handleChange,
91932
91953
  id: id2,
91933
91954
  name: id2,
@@ -92056,7 +92077,7 @@ const ConfirmationModal = ({
92056
92077
  gap: 20,
92057
92078
  marginTop: 20
92058
92079
  },
92059
- children: [/* @__PURE__ */ jsx$1(Button$1, {
92080
+ children: [cancelButtonText && /* @__PURE__ */ jsx$1(Button$1, {
92060
92081
  size: "small",
92061
92082
  mode: "tertiary",
92062
92083
  onClick: props.onClose,
@@ -92083,7 +92104,6 @@ const AiPromptCard = ({
92083
92104
  const [showAiPromptModal, setShowAiPromptModal] = useState(false);
92084
92105
  const [showAutoReplyModal, setShowAutoReplyModal] = useState(false);
92085
92106
  const closeAiPromptModal = () => setShowAiPromptModal(false);
92086
- const openAiPromptModal = () => setShowAiPromptModal(true);
92087
92107
  const closeAutoReplyModal = () => setShowAutoReplyModal(false);
92088
92108
  const openAutoReplyModal = () => setShowAutoReplyModal(true);
92089
92109
  const {
@@ -92093,15 +92113,26 @@ const AiPromptCard = ({
92093
92113
  cacheId: `user-data`
92094
92114
  });
92095
92115
  const showAiPrompt = (_b = (_a2 = userData2 == null ? void 0 : userData2.data) == null ? void 0 : _a2.roles) == null ? void 0 : _b.some((role) => role === "ROLE_COMPANY_SUPER_ADMIN" || role === "ROLE_COMPANY_SUPER_ADMIN_BOT");
92096
- useService(UpdateUserSettings, {
92116
+ const {
92117
+ execute,
92118
+ isExecuting
92119
+ } = useService(UpdateUserSettings, {
92097
92120
  onSuccess: async () => {
92098
92121
  var _a3, _b2;
92099
92122
  await reloadUserData();
92100
- if (((_b2 = (_a3 = userData2 == null ? void 0 : userData2.data) == null ? void 0 : _a3.company) == null ? void 0 : _b2.autoReplyReviews) === true) {
92123
+ if (((_b2 = (_a3 = userData2 == null ? void 0 : userData2.data) == null ? void 0 : _a3.company) == null ? void 0 : _b2.autoReplyReviews) === false) {
92101
92124
  openAutoReplyModal();
92102
92125
  }
92103
92126
  }
92104
92127
  });
92128
+ const handleSubmit = (fieldId, formValues) => {
92129
+ execute({
92130
+ data: {
92131
+ [fieldId]: !formValues[fieldId],
92132
+ aiPrompt: formValues.aiPrompt || ""
92133
+ }
92134
+ });
92135
+ };
92105
92136
  if (!showAiPrompt) {
92106
92137
  return null;
92107
92138
  }
@@ -92114,29 +92145,28 @@ const AiPromptCard = ({
92114
92145
  initialValues,
92115
92146
  onSubmit: () => {
92116
92147
  },
92148
+ disabled: isExecuting,
92117
92149
  enableReinitialize: true,
92118
92150
  children: ({
92119
92151
  values
92120
- }) => {
92121
- var _a3;
92122
- return /* @__PURE__ */ jsxs(Card$1, {
92123
- header: {
92124
- title: t2("AIPROMPT"),
92125
- icon: "edit",
92126
- onClickIcon: openAiPromptModal
92127
- },
92128
- children: [/* @__PURE__ */ jsx$1("p", {
92129
- children: t2("Ai prompt for generate reviews.")
92130
- }), /* @__PURE__ */ jsx$1("br", {}), /* @__PURE__ */ jsxs("div", {
92131
- className: styles$1l.item,
92132
- children: [/* @__PURE__ */ jsx$1("div", {
92133
- children: /* @__PURE__ */ jsx$1(Icon, {
92134
- icon: "robot"
92135
- })
92136
- }), ((_a3 = userData2 == null ? void 0 : userData2.data) == null ? void 0 : _a3.company.aiPrompt) || t2("NOTDEFINED")]
92137
- })]
92138
- });
92139
- }
92152
+ }) => /* @__PURE__ */ jsxs(Card$1, {
92153
+ header: {
92154
+ title: t2("AUTOREPLYREVIEWS")
92155
+ // icon: "edit",
92156
+ // onClickIcon: openAiPromptModal,
92157
+ },
92158
+ children: [/* @__PURE__ */ jsx$1("p", {
92159
+ children: t2("AI automatically replies to your customer reviews.")
92160
+ }), /* @__PURE__ */ jsx$1("br", {}), /* @__PURE__ */ jsx$1(UIList$1, {
92161
+ mode: "vertical",
92162
+ children: /* @__PURE__ */ jsx$1(Item$1, {
92163
+ isLoading: isExecuting,
92164
+ id: "autoReplyReviews",
92165
+ name: t2("AUTOREPLYREVIEWS"),
92166
+ onChange: () => handleSubmit("autoReplyReviews", values)
92167
+ })
92168
+ })]
92169
+ })
92140
92170
  }), /* @__PURE__ */ jsx$1(AiPromptForm, {
92141
92171
  open: showAiPromptModal,
92142
92172
  onCloseForm: closeAiPromptModal,
@@ -92152,25 +92182,10 @@ const AiPromptCard = ({
92152
92182
  text: "AUTOREPLYDESCRIPTION",
92153
92183
  icon: "robot",
92154
92184
  submitButtonText: "UNDERSTOOD",
92155
- cancelButtonText: "CLOSE"
92185
+ cancelButtonText: ""
92156
92186
  })]
92157
92187
  });
92158
92188
  };
92159
- const styles$1c = {
92160
- "ui-list": "_ui-list_4zr5h_1",
92161
- "ui-list--horizontal": "_ui-list--horizontal_4zr5h_10"
92162
- };
92163
- const UIList$1 = ({
92164
- mode = "horizontal",
92165
- children
92166
- }) => {
92167
- return /* @__PURE__ */ jsx$1("ul", {
92168
- className: classNames$2(styles$1c["ui-list"], styles$1c[`ui-list--${mode}`]),
92169
- children: React__default.Children.map(children, (child, i) => /* @__PURE__ */ jsx$1("li", {
92170
- children: child
92171
- }, i))
92172
- });
92173
- };
92174
92189
  const Notifications = ({
92175
92190
  venueId,
92176
92191
  venueListingId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozrest-sdk-react-dev",
3
- "version": "0.3.46",
3
+ "version": "0.3.48",
4
4
  "main": "mozrest-sdk.es.js",
5
5
  "keywords": [
6
6
  "mozrest"
package/style.css CHANGED
@@ -3146,21 +3146,6 @@ hr {
3146
3146
  ._input_1ghpv_34:checked + ._label_1ghpv_1 ._label__switch_1ghpv_8::after {
3147
3147
  left: calc(100% - 0.125rem);
3148
3148
  transform: translateX(-100%);
3149
- }._input_1ufjp_1 {
3150
- display: block;
3151
- display: flex;
3152
- align-items: center;
3153
- width: 100%;
3154
- padding: 0.5rem 0.75rem;
3155
- font: var(--moz-font-weight-input) var(--moz-font-size-input)/var(--moz-line-height-input) var(--moz-font-family-input);
3156
- color: var(--moz-text-input);
3157
- background: #fff;
3158
- border: 1px solid var(--moz-input-border);
3159
- border-radius: 2px;
3160
- }
3161
- ._input_1ufjp_1:disabled {
3162
- color: var(--moz-state-disabled);
3163
- background: var(--moz-state-disabled-bg);
3164
3149
  }._ui-list_4zr5h_1 {
3165
3150
  margin: 0;
3166
3151
  padding: 0;
@@ -3176,6 +3161,21 @@ hr {
3176
3161
  gap: 1.5rem;
3177
3162
  align-items: center;
3178
3163
  justify-content: inherit;
3164
+ }._input_1ufjp_1 {
3165
+ display: block;
3166
+ display: flex;
3167
+ align-items: center;
3168
+ width: 100%;
3169
+ padding: 0.5rem 0.75rem;
3170
+ font: var(--moz-font-weight-input) var(--moz-font-size-input)/var(--moz-line-height-input) var(--moz-font-family-input);
3171
+ color: var(--moz-text-input);
3172
+ background: #fff;
3173
+ border: 1px solid var(--moz-input-border);
3174
+ border-radius: 2px;
3175
+ }
3176
+ ._input_1ufjp_1:disabled {
3177
+ color: var(--moz-state-disabled);
3178
+ background: var(--moz-state-disabled-bg);
3179
3179
  }._filterButton_l1kwj_1 {
3180
3180
  display: flex;
3181
3181
  background: white;