mozrest-sdk-react-dev 0.2.30 → 0.2.32

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.
Files changed (2) hide show
  1. package/mozrest-sdk.es.js +53 -10
  2. package/package.json +1 -1
package/mozrest-sdk.es.js CHANGED
@@ -6369,6 +6369,8 @@ const AIPROMPT = "AI Prompt";
6369
6369
  const AREYOUSUREDISCONNECTFROMTRIPADVISOR = "Are you sure you want to disconnect from Tripadvisor";
6370
6370
  const PROFILEURL = "Profile URL";
6371
6371
  const AREYOUSURECONNECTTOTRIPADVISOR = "Are you sure you want to connect to Tripadvisor";
6372
+ const TRIPADVISOR = "Tripadvisor";
6373
+ const TRIPADVISORREPLY = "Tripadvisor reply";
6372
6374
  var en = {
6373
6375
  errors,
6374
6376
  SPECIALCLOSINGDATES,
@@ -6694,7 +6696,9 @@ var en = {
6694
6696
  AIPROMPT,
6695
6697
  AREYOUSUREDISCONNECTFROMTRIPADVISOR,
6696
6698
  PROFILEURL,
6697
- AREYOUSURECONNECTTOTRIPADVISOR
6699
+ AREYOUSURECONNECTTOTRIPADVISOR,
6700
+ TRIPADVISOR,
6701
+ TRIPADVISORREPLY
6698
6702
  };
6699
6703
  instance.use(initReactI18next).init({
6700
6704
  resources: {
@@ -38514,6 +38518,7 @@ const StartScore = ({ score }) => {
38514
38518
  })));
38515
38519
  };
38516
38520
  const platformImages = {
38521
+ tripadvisor: "https://static.tacdn.com/img2/brand_refresh/Tripadvisor_logoset_solid_green.svg",
38517
38522
  facebook: "https://play-lh.googleusercontent.com/5pZMqQYClc5McEjaISPkvhF8pDmlbLqraTMwk1eeqTlnUSjVxPCq-MItIrJPJGe7xW4",
38518
38523
  google: "data:imagepng;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAB6CAMAAACyeTxmAAABJlBMVEX////pQjU0qFNChfT6uwWAqvk5gfQzf/Tm7v690Pv6tgD6uQAwp1DpQDPpPC7/vADoOCklpEnn8+r63N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@ const DetailMobile = ({
43878
43883
  createdAt,
43879
43884
  locationName,
43880
43885
  locale: locale2,
43886
+ reviewUrl,
43881
43887
  meta,
43882
43888
  onReload,
43883
43889
  openForm,
@@ -43931,7 +43937,7 @@ const DetailMobile = ({
43931
43937
  locale: locale2
43932
43938
  }, comment2), showTranslation && /* @__PURE__ */ React__default.createElement(CommentTranslation, {
43933
43939
  commentId: id2
43934
- })), /* @__PURE__ */ React__default.createElement("div", {
43940
+ })), platform2 !== "tripadvisor" ? /* @__PURE__ */ React__default.createElement("div", {
43935
43941
  className: styles$1G["container--reply"]
43936
43942
  }, reply2 ? /* @__PURE__ */ React__default.createElement(Reply, {
43937
43943
  reply: reply2
@@ -43943,18 +43949,28 @@ const DetailMobile = ({
43943
43949
  isMobile: true,
43944
43950
  isSuggesting,
43945
43951
  locale: locale2
43952
+ })) : /* @__PURE__ */ React__default.createElement("div", {
43953
+ className: styles$1G["container--reply"]
43954
+ }, reply2 && /* @__PURE__ */ React__default.createElement(Reply, {
43955
+ reply: reply2
43946
43956
  })), /* @__PURE__ */ React__default.createElement(TemplatesModal, {
43947
43957
  open: showTemplates,
43948
43958
  rating,
43949
43959
  onClose: closeModal
43950
- }), !reply2 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, roles && roles.length > 0 && roles.some((str) => str.includes("BOT")) && /* @__PURE__ */ React__default.createElement(Button$3, {
43960
+ }), !reply2 && platform2 !== "tripadvisor" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, roles && roles.length > 0 && roles.some((str) => str.includes("BOT")) && /* @__PURE__ */ React__default.createElement(Button$3, {
43951
43961
  isLoading: isSuggesting,
43952
43962
  onClick: () => onSuggestTemplate(),
43953
43963
  style: { marginBottom: 10 },
43954
43964
  icon: "robot"
43955
43965
  }, t2("SUGGESTREPLY")), /* @__PURE__ */ React__default.createElement(Button$3, {
43956
43966
  onClick: openModal
43957
- }, t2("SHOWTEMPLATES"))));
43967
+ }, t2("SHOWTEMPLATES"))) : /* @__PURE__ */ React__default.createElement(Button$3, {
43968
+ type: "submit",
43969
+ size: "small",
43970
+ mode: "primary",
43971
+ children: t2("TRIPADVISORREPLY"),
43972
+ onClick: () => window.open(reviewUrl != null ? reviewUrl : "tripadvisor.com")
43973
+ }));
43958
43974
  };
43959
43975
  const detail = "_detail_1nbuk_1";
43960
43976
  const reply = "_reply_1nbuk_10";
@@ -43971,7 +43987,9 @@ const DetailDesktop = ({
43971
43987
  comment: comment2,
43972
43988
  locale: locale2,
43973
43989
  meta,
43990
+ reviewUrl,
43974
43991
  locationName,
43992
+ platform: platform2,
43975
43993
  onReload,
43976
43994
  openForm,
43977
43995
  setShowTemplate,
@@ -43998,7 +44016,7 @@ const DetailDesktop = ({
43998
44016
  locale: locale2
43999
44017
  }, comment2), showTranslation && /* @__PURE__ */ React__default.createElement(CommentTranslation, {
44000
44018
  commentId: id2
44001
- })), /* @__PURE__ */ React__default.createElement("div", {
44019
+ })), platform2 !== "tripadvisor" ? /* @__PURE__ */ React__default.createElement("div", {
44002
44020
  className: styles$1D.reply
44003
44021
  }, reply2 ? /* @__PURE__ */ React__default.createElement(Reply, {
44004
44022
  reply: reply2
@@ -44011,7 +44029,19 @@ const DetailDesktop = ({
44011
44029
  onSuggestTemplate,
44012
44030
  isSuggesting,
44013
44031
  locale: locale2
44014
- })));
44032
+ })) : /* @__PURE__ */ React__default.createElement("div", {
44033
+ className: styles$1D.reply
44034
+ }, reply2 ? /* @__PURE__ */ React__default.createElement(Reply, {
44035
+ reply: reply2
44036
+ }) : /* @__PURE__ */ React__default.createElement("div", {
44037
+ style: { display: "flex", justifyContent: "flex-end" }
44038
+ }, /* @__PURE__ */ React__default.createElement(Button$3, {
44039
+ type: "submit",
44040
+ size: "small",
44041
+ mode: "primary",
44042
+ children: t2("TRIPADVISORREPLY"),
44043
+ onClick: () => window.open(reviewUrl != null ? reviewUrl : "tripadvisor.com")
44044
+ }))));
44015
44045
  };
44016
44046
  const container$D = "_container_1br0u_1";
44017
44047
  const light = "_light_1br0u_4";
@@ -44058,6 +44088,7 @@ const Review = ({
44058
44088
  createdAt,
44059
44089
  locationName,
44060
44090
  locale: locale2,
44091
+ reviewUrl,
44061
44092
  module: module2,
44062
44093
  meta,
44063
44094
  onReload,
@@ -44160,6 +44191,7 @@ const Review = ({
44160
44191
  createdAt,
44161
44192
  locationName,
44162
44193
  locale: locale2,
44194
+ reviewUrl,
44163
44195
  meta,
44164
44196
  onReload,
44165
44197
  openForm,
@@ -44176,6 +44208,7 @@ const Review = ({
44176
44208
  createdAt,
44177
44209
  locationName,
44178
44210
  locale: locale2,
44211
+ reviewUrl,
44179
44212
  meta,
44180
44213
  onReload,
44181
44214
  openForm,
@@ -49878,6 +49911,10 @@ const platforms = [
49878
49911
  {
49879
49912
  id: "facebook",
49880
49913
  label: instance.t("FACEBOOK")
49914
+ },
49915
+ {
49916
+ id: "tripadvisor",
49917
+ label: instance.t("TRIPADVISOR")
49881
49918
  }
49882
49919
  ];
49883
49920
  const header$5 = "_header_x9dfw_1";
@@ -49915,8 +49952,9 @@ const GetVenueListingsOptions = async () => {
49915
49952
  };
49916
49953
  const formatData$i = (data2) => {
49917
49954
  return {
49918
- data: data2.data.map(({ id: id2, businessName }) => ({
49955
+ data: data2.data.map(({ id: id2, venueId, businessName }) => ({
49919
49956
  id: id2,
49957
+ venueId,
49920
49958
  label: businessName
49921
49959
  })),
49922
49960
  total: data2.total
@@ -50304,6 +50342,8 @@ const GetVenueListingModule = async ({
50304
50342
  venueId,
50305
50343
  accessToken
50306
50344
  }) => {
50345
+ if (!venueId)
50346
+ return [];
50307
50347
  const data2 = await instance$1.get(`listing/venue/${venueId}/module`, {
50308
50348
  headers: {
50309
50349
  Authorization: `Bearer ${accessToken}`
@@ -50324,9 +50364,10 @@ const formatData$h = (values = {}) => {
50324
50364
  };
50325
50365
  const Header$2 = ({ onChangeFilter, filters: filters2, multiVenue, venueId }) => {
50326
50366
  const { t: t2 } = useTranslation();
50367
+ const [currentVenue, setCurrentVenue] = useState(venueId);
50327
50368
  const { data: data2, isLoading, reload } = useFetch(GetVenueListingModule, {
50328
50369
  cacheId: `module-${venueId}`,
50329
- venueId
50370
+ venueId: currentVenue
50330
50371
  });
50331
50372
  const handleChangeFilter = (id2) => (value2) => {
50332
50373
  onChangeFilter({
@@ -50335,6 +50376,8 @@ const Header$2 = ({ onChangeFilter, filters: filters2, multiVenue, venueId }) =>
50335
50376
  });
50336
50377
  };
50337
50378
  const handleChangeVenueListing = (value2) => {
50379
+ var _a2;
50380
+ setCurrentVenue((_a2 = value2 == null ? void 0 : value2.venueId) != null ? _a2 : venueId);
50338
50381
  onChangeFilter({
50339
50382
  ...filters2,
50340
50383
  venueListing: value2 == null ? void 0 : value2.id
@@ -85316,12 +85359,12 @@ const BingButton$1 = ({
85316
85359
  }, t2("CONNECT")));
85317
85360
  };
85318
85361
  const useConnect = ({ venueId }) => {
85319
- var _a2;
85362
+ var _a2, _b;
85320
85363
  const { data: data2, isLoading, reload } = useFetch(GetVenueListingModule, {
85321
85364
  cacheId: `module-${venueId}`,
85322
85365
  venueId
85323
85366
  });
85324
- const activeModules = (_a2 = data2 == null ? void 0 : data2.data.map(({ module: module2 }) => module2.name)) != null ? _a2 : [];
85367
+ const activeModules = (_b = (_a2 = data2 == null ? void 0 : data2.data) == null ? void 0 : _a2.map(({ module: module2 }) => module2.name)) != null ? _b : [];
85325
85368
  const FacebookConnected = activeModules.includes("Facebook");
85326
85369
  const GoogleConnected = activeModules.includes("Google");
85327
85370
  const BingConnected = activeModules.includes("Bing");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozrest-sdk-react-dev",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "main": "mozrest-sdk.es.js",
5
5
  "keywords": ["mozrest"],
6
6
  "author": {