@ensembleapp/client-sdk 0.0.37 → 0.0.38
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.js +41 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/widget/widget.global.d.ts +0 -26
- package/dist/widget/widget.global.js +0 -210
- package/dist/widget/widget.global.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -26735,44 +26735,47 @@ var vendorCardsSchema = jsonSchema({
|
|
|
26735
26735
|
type: "object",
|
|
26736
26736
|
description: "displaying a list of vendor cards. Use this widget to represent data from CareNetwork vendor search tool.",
|
|
26737
26737
|
properties: {
|
|
26738
|
-
fromLocation: {
|
|
26739
|
-
|
|
26740
|
-
|
|
26741
|
-
},
|
|
26742
|
-
fromCoordinates: {
|
|
26743
|
-
|
|
26744
|
-
|
|
26745
|
-
|
|
26746
|
-
|
|
26747
|
-
|
|
26748
|
-
|
|
26749
|
-
|
|
26750
|
-
},
|
|
26738
|
+
// fromLocation: {
|
|
26739
|
+
// type: 'string',
|
|
26740
|
+
// description: 'The location the user is searching for',
|
|
26741
|
+
// },
|
|
26742
|
+
// fromCoordinates: {
|
|
26743
|
+
// type: 'object',
|
|
26744
|
+
// description: "The location's lat/lng coordinates. This must come from the previous geocoding tool as-is - do NOT guess",
|
|
26745
|
+
// properties: {
|
|
26746
|
+
// latitude: { type: 'number' },
|
|
26747
|
+
// longitude: { type: 'number' },
|
|
26748
|
+
// },
|
|
26749
|
+
// required: ['latitude', 'longitude'],
|
|
26750
|
+
// },
|
|
26751
26751
|
vendors: {
|
|
26752
26752
|
type: "array",
|
|
26753
26753
|
items: {
|
|
26754
26754
|
type: "object",
|
|
26755
26755
|
properties: {
|
|
26756
|
-
vendor_id: { type: "string" }
|
|
26757
|
-
notes: {
|
|
26758
|
-
|
|
26759
|
-
|
|
26760
|
-
},
|
|
26761
|
-
vendorCoordinates: {
|
|
26762
|
-
|
|
26763
|
-
|
|
26764
|
-
|
|
26765
|
-
|
|
26766
|
-
|
|
26767
|
-
|
|
26768
|
-
|
|
26769
|
-
}
|
|
26756
|
+
vendor_id: { type: "string" }
|
|
26757
|
+
// notes: {
|
|
26758
|
+
// type: 'string',
|
|
26759
|
+
// description: 'Give 7-10 words on why this vendor was recommended. Only include the notes for the top 3 vendors',
|
|
26760
|
+
// },
|
|
26761
|
+
// vendorCoordinates: {
|
|
26762
|
+
// type: 'object',
|
|
26763
|
+
// description: "The lat/lng coordinates of this vendor. This must come from the vendor's location.coordinates from the previous vendor search tool - do NOT guess",
|
|
26764
|
+
// properties: {
|
|
26765
|
+
// latitude: { type: 'number' },
|
|
26766
|
+
// longitude: { type: 'number' },
|
|
26767
|
+
// },
|
|
26768
|
+
// required: ['latitude', 'longitude'],
|
|
26769
|
+
// },
|
|
26770
26770
|
},
|
|
26771
|
-
required: ["vendor_id"
|
|
26771
|
+
required: ["vendor_id"]
|
|
26772
|
+
// required: ['vendor_id', 'vendorCoordinates'],
|
|
26772
26773
|
}
|
|
26774
|
+
// description: '5-7 vendors to display. With notes for the top 3 only',
|
|
26773
26775
|
}
|
|
26774
26776
|
},
|
|
26775
|
-
required: ["
|
|
26777
|
+
required: ["vendors"]
|
|
26778
|
+
// required: ['fromLocation', 'fromCoordinates', 'vendors'],
|
|
26776
26779
|
});
|
|
26777
26780
|
function VendorCards({ payload, enriched, onAddToList, onFeedback, existingFeedback }) {
|
|
26778
26781
|
const [feedbackState, setFeedbackState] = React8.useState({});
|
|
@@ -26808,10 +26811,7 @@ function VendorCards({ payload, enriched, onAddToList, onFeedback, existingFeedb
|
|
|
26808
26811
|
return rest;
|
|
26809
26812
|
});
|
|
26810
26813
|
};
|
|
26811
|
-
|
|
26812
|
-
return /* @__PURE__ */ jsx11("div", { children: "Outdated vendor-cards widget" });
|
|
26813
|
-
}
|
|
26814
|
-
const { vendorDetails, distanceMatrix } = enriched;
|
|
26814
|
+
const { vendorDetails, distanceMatrix } = enriched || {};
|
|
26815
26815
|
const vendorData = vendorDetails?.data ?? {};
|
|
26816
26816
|
const distances = distanceMatrix?.data ?? [];
|
|
26817
26817
|
const formatDistance = (meters) => {
|
|
@@ -27223,15 +27223,15 @@ var getVendorCardsWidget = (isProd) => {
|
|
|
27223
27223
|
inputs: {
|
|
27224
27224
|
vendorIds: "${vendors|map('vendor_id')|join(',')}"
|
|
27225
27225
|
}
|
|
27226
|
-
},
|
|
27227
|
-
/* calculate distance from user to each vendor */
|
|
27228
|
-
distanceMatrix: {
|
|
27229
|
-
toolId: distanceMatrixToolId,
|
|
27230
|
-
inputs: {
|
|
27231
|
-
origin: "${fromCoordinates}",
|
|
27232
|
-
destinations: "${vendors|map('vendorCoordinates')}"
|
|
27233
|
-
}
|
|
27234
27226
|
}
|
|
27227
|
+
/* calculate distance from user to each vendor */
|
|
27228
|
+
// distanceMatrix: {
|
|
27229
|
+
// toolId: distanceMatrixToolId,
|
|
27230
|
+
// inputs: {
|
|
27231
|
+
// origin: "${fromCoordinates}",
|
|
27232
|
+
// destinations: "${vendors|map('vendorCoordinates')}",
|
|
27233
|
+
// },
|
|
27234
|
+
// }
|
|
27235
27235
|
},
|
|
27236
27236
|
render: (payload, enriched, { messageContext }) => /* @__PURE__ */ jsx12(
|
|
27237
27237
|
VendorCards,
|