@carlonicora/nextjs-jsonapi 1.56.2 → 1.57.0
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/{BlockNoteEditor-RWQN3I3L.mjs → BlockNoteEditor-QWW2LB2K.mjs} +2 -2
- package/dist/{BlockNoteEditor-7QWJXR3A.js → BlockNoteEditor-WE2FKNWW.js} +6 -6
- package/dist/{BlockNoteEditor-7QWJXR3A.js.map → BlockNoteEditor-WE2FKNWW.js.map} +1 -1
- package/dist/billing/index.js +299 -299
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-HDFJZTQH.mjs → chunk-4FJZ7JFQ.mjs} +56 -4
- package/dist/chunk-4FJZ7JFQ.mjs.map +1 -0
- package/dist/{chunk-4CLLIRP5.js → chunk-PAIXFTNL.js} +59 -7
- package/dist/chunk-PAIXFTNL.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +13 -2
- package/dist/components/index.d.ts +13 -2
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/forms/FormPlaceAutocomplete.tsx +76 -3
- package/dist/chunk-4CLLIRP5.js.map +0 -1
- package/dist/chunk-HDFJZTQH.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-RWQN3I3L.mjs.map → BlockNoteEditor-QWW2LB2K.mjs.map} +0 -0
package/dist/billing/index.mjs
CHANGED
|
@@ -8344,7 +8344,7 @@ __name(FormCheckbox, "FormCheckbox");
|
|
|
8344
8344
|
import dynamic from "next/dynamic";
|
|
8345
8345
|
import React14 from "react";
|
|
8346
8346
|
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
8347
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
8347
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-QWW2LB2K.mjs"), {
|
|
8348
8348
|
ssr: false
|
|
8349
8349
|
});
|
|
8350
8350
|
var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -8942,6 +8942,53 @@ function FormPlaceAutocomplete({
|
|
|
8942
8942
|
setIsLoading(false);
|
|
8943
8943
|
}
|
|
8944
8944
|
}, "fetchSuggestions");
|
|
8945
|
+
const fetchPlaceDetails = /* @__PURE__ */ __name(async (placeId) => {
|
|
8946
|
+
const defaults = {
|
|
8947
|
+
street_number: "",
|
|
8948
|
+
street: "",
|
|
8949
|
+
city: "",
|
|
8950
|
+
province: "",
|
|
8951
|
+
region: "",
|
|
8952
|
+
postcode: "",
|
|
8953
|
+
country: "",
|
|
8954
|
+
country_code: ""
|
|
8955
|
+
};
|
|
8956
|
+
if (!apiKey || !placeId) return defaults;
|
|
8957
|
+
try {
|
|
8958
|
+
const response = await fetch(`https://places.googleapis.com/v1/places/${placeId}`, {
|
|
8959
|
+
headers: {
|
|
8960
|
+
"X-Goog-Api-Key": apiKey,
|
|
8961
|
+
"X-Goog-FieldMask": "addressComponents"
|
|
8962
|
+
}
|
|
8963
|
+
});
|
|
8964
|
+
if (!response.ok) return defaults;
|
|
8965
|
+
const data = await response.json();
|
|
8966
|
+
const components = data.addressComponents ?? [];
|
|
8967
|
+
const result = { ...defaults };
|
|
8968
|
+
for (const comp of components) {
|
|
8969
|
+
const types = comp.types ?? [];
|
|
8970
|
+
if (types.includes("street_number")) {
|
|
8971
|
+
result.street_number = comp.longText ?? "";
|
|
8972
|
+
} else if (types.includes("route")) {
|
|
8973
|
+
result.street = comp.longText ?? "";
|
|
8974
|
+
} else if (types.includes("locality")) {
|
|
8975
|
+
result.city = comp.longText ?? "";
|
|
8976
|
+
} else if (types.includes("administrative_area_level_2")) {
|
|
8977
|
+
result.province = comp.longText ?? "";
|
|
8978
|
+
} else if (types.includes("administrative_area_level_1")) {
|
|
8979
|
+
result.region = comp.longText ?? "";
|
|
8980
|
+
} else if (types.includes("postal_code")) {
|
|
8981
|
+
result.postcode = comp.longText ?? "";
|
|
8982
|
+
} else if (types.includes("country")) {
|
|
8983
|
+
result.country = comp.longText ?? "";
|
|
8984
|
+
result.country_code = comp.shortText ?? "";
|
|
8985
|
+
}
|
|
8986
|
+
}
|
|
8987
|
+
return result;
|
|
8988
|
+
} catch {
|
|
8989
|
+
return defaults;
|
|
8990
|
+
}
|
|
8991
|
+
}, "fetchPlaceDetails");
|
|
8945
8992
|
const handleInputChange = /* @__PURE__ */ __name((value) => {
|
|
8946
8993
|
setInputValue(value);
|
|
8947
8994
|
form.setValue(id, value);
|
|
@@ -8958,13 +9005,18 @@ function FormPlaceAutocomplete({
|
|
|
8958
9005
|
setIsLoading(false);
|
|
8959
9006
|
}
|
|
8960
9007
|
}, "handleInputChange");
|
|
8961
|
-
const handleSuggestionSelect = /* @__PURE__ */ __name((suggestion) => {
|
|
9008
|
+
const handleSuggestionSelect = /* @__PURE__ */ __name(async (suggestion) => {
|
|
8962
9009
|
setInputValue(suggestion.description);
|
|
8963
9010
|
form.setValue(id, suggestion.description);
|
|
8964
9011
|
setShowSuggestions(false);
|
|
8965
9012
|
setSuggestions([]);
|
|
9013
|
+
const addressComponents = await fetchPlaceDetails(suggestion.place_id);
|
|
9014
|
+
const enrichedSuggestion = {
|
|
9015
|
+
...suggestion,
|
|
9016
|
+
addressComponents
|
|
9017
|
+
};
|
|
8966
9018
|
if (onPlaceSelect) {
|
|
8967
|
-
onPlaceSelect(
|
|
9019
|
+
onPlaceSelect(enrichedSuggestion);
|
|
8968
9020
|
}
|
|
8969
9021
|
}, "handleSuggestionSelect");
|
|
8970
9022
|
useEffect16(() => {
|
|
@@ -18758,4 +18810,4 @@ export {
|
|
|
18758
18810
|
useOAuthClients,
|
|
18759
18811
|
useOAuthClient
|
|
18760
18812
|
};
|
|
18761
|
-
//# sourceMappingURL=chunk-
|
|
18813
|
+
//# sourceMappingURL=chunk-4FJZ7JFQ.mjs.map
|