mozrest-sdk-react-dev 0.3.46 → 0.3.47

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
@@ -90866,11 +90866,12 @@ const styles$1j = {
90866
90866
  const Item$1 = ({
90867
90867
  name: name2,
90868
90868
  id: id2,
90869
- onChange: onChange2
90869
+ onChange: onChange2,
90870
+ isLoading
90870
90871
  }) => {
90871
90872
  return /* @__PURE__ */ jsxs("div", {
90872
90873
  className: styles$1j.item,
90873
- children: [name2, /* @__PURE__ */ jsx$1(ToggleField, {
90874
+ children: [name2, isLoading ? /* @__PURE__ */ jsx$1(Spinner$1, {}) : /* @__PURE__ */ jsx$1(ToggleField, {
90874
90875
  id: id2,
90875
90876
  onChange: onChange2
90876
90877
  })]
@@ -91864,6 +91865,21 @@ const formatData$g = (data2) => {
91864
91865
  autoReplyReviews: data2.autoReplyReviews ? "true" : "false"
91865
91866
  };
91866
91867
  };
91868
+ const styles$1d = {
91869
+ "ui-list": "_ui-list_4zr5h_1",
91870
+ "ui-list--horizontal": "_ui-list--horizontal_4zr5h_10"
91871
+ };
91872
+ const UIList$1 = ({
91873
+ mode = "horizontal",
91874
+ children
91875
+ }) => {
91876
+ return /* @__PURE__ */ jsx$1("ul", {
91877
+ className: classNames$2(styles$1d["ui-list"], styles$1d[`ui-list--${mode}`]),
91878
+ children: React__default.Children.map(children, (child, i) => /* @__PURE__ */ jsx$1("li", {
91879
+ children: child
91880
+ }, i))
91881
+ });
91882
+ };
91867
91883
  const Modal2 = ({
91868
91884
  open,
91869
91885
  children,
@@ -91891,7 +91907,7 @@ const Modal2 = ({
91891
91907
  });
91892
91908
  };
91893
91909
  const input = "_input_1ufjp_1";
91894
- const styles$1d = {
91910
+ const styles$1c = {
91895
91911
  input
91896
91912
  };
91897
91913
  const TextArea = React__default.forwardRef(({
@@ -91927,7 +91943,7 @@ const TextArea = React__default.forwardRef(({
91927
91943
  position: "relative"
91928
91944
  },
91929
91945
  children: [/* @__PURE__ */ jsx$1("textarea", {
91930
- className: styles$1d.input,
91946
+ className: styles$1c.input,
91931
91947
  onChange: handleChange,
91932
91948
  id: id2,
91933
91949
  name: id2,
@@ -92093,15 +92109,26 @@ const AiPromptCard = ({
92093
92109
  cacheId: `user-data`
92094
92110
  });
92095
92111
  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, {
92112
+ const {
92113
+ execute,
92114
+ isExecuting
92115
+ } = useService(UpdateUserSettings, {
92097
92116
  onSuccess: async () => {
92098
92117
  var _a3, _b2;
92099
92118
  await reloadUserData();
92100
- if (((_b2 = (_a3 = userData2 == null ? void 0 : userData2.data) == null ? void 0 : _a3.company) == null ? void 0 : _b2.autoReplyReviews) === true) {
92119
+ if (((_b2 = (_a3 = userData2 == null ? void 0 : userData2.data) == null ? void 0 : _a3.company) == null ? void 0 : _b2.autoReplyReviews) === false) {
92101
92120
  openAutoReplyModal();
92102
92121
  }
92103
92122
  }
92104
92123
  });
92124
+ const handleSubmit = (fieldId, formValues) => {
92125
+ execute({
92126
+ data: {
92127
+ [fieldId]: !formValues[fieldId],
92128
+ aiPrompt: formValues.aiPrompt || ""
92129
+ }
92130
+ });
92131
+ };
92105
92132
  if (!showAiPrompt) {
92106
92133
  return null;
92107
92134
  }
@@ -92114,6 +92141,7 @@ const AiPromptCard = ({
92114
92141
  initialValues,
92115
92142
  onSubmit: () => {
92116
92143
  },
92144
+ disabled: isExecuting,
92117
92145
  enableReinitialize: true,
92118
92146
  children: ({
92119
92147
  values
@@ -92127,7 +92155,15 @@ const AiPromptCard = ({
92127
92155
  },
92128
92156
  children: [/* @__PURE__ */ jsx$1("p", {
92129
92157
  children: t2("Ai prompt for generate reviews.")
92130
- }), /* @__PURE__ */ jsx$1("br", {}), /* @__PURE__ */ jsxs("div", {
92158
+ }), /* @__PURE__ */ jsx$1("br", {}), /* @__PURE__ */ jsx$1(UIList$1, {
92159
+ mode: "vertical",
92160
+ children: /* @__PURE__ */ jsx$1(Item$1, {
92161
+ isLoading: isExecuting,
92162
+ id: "autoReplyReviews",
92163
+ name: t2("AUTOREPLYREVIEWS"),
92164
+ onChange: () => handleSubmit("autoReplyReviews", values)
92165
+ })
92166
+ }), /* @__PURE__ */ jsxs("div", {
92131
92167
  className: styles$1l.item,
92132
92168
  children: [/* @__PURE__ */ jsx$1("div", {
92133
92169
  children: /* @__PURE__ */ jsx$1(Icon, {
@@ -92156,21 +92192,6 @@ const AiPromptCard = ({
92156
92192
  })]
92157
92193
  });
92158
92194
  };
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
92195
  const Notifications = ({
92175
92196
  venueId,
92176
92197
  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.47",
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;