@datawheel/bespoke 0.1.37 → 0.1.39
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 +7 -4
- package/dist/server.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9882,14 +9882,13 @@ function BlockEditor({
|
|
|
9882
9882
|
const resp = useMemo(() => {
|
|
9883
9883
|
let apisResponse = null;
|
|
9884
9884
|
if (status && status.resp) {
|
|
9885
|
-
console.log("RESP CHANGED");
|
|
9886
9885
|
apisResponse = status.resp;
|
|
9887
9886
|
}
|
|
9888
9887
|
return apisResponse;
|
|
9889
9888
|
}, [status]);
|
|
9890
9889
|
const variables = useInputVariablesFlat(id);
|
|
9891
9890
|
const { ref, toggle, fullscreen } = useFullscreen();
|
|
9892
|
-
const apiList = blockContent && blockContent.api ? blockContent.api.split(apiSeparator) : [];
|
|
9891
|
+
const apiList = blockContent && (blockContent.api || blockContent.api === "") ? blockContent.api.split(apiSeparator) : [];
|
|
9893
9892
|
const onChangeCode = (logic, locale2) => setBlockContent({ logic }, locale2);
|
|
9894
9893
|
const onChangeAPI = (changedApi, ix) => {
|
|
9895
9894
|
const newApiList = [...apiList];
|
|
@@ -9900,7 +9899,11 @@ function BlockEditor({
|
|
|
9900
9899
|
setBlockContent({ api: [...apiList, ""].join(apiSeparator) });
|
|
9901
9900
|
};
|
|
9902
9901
|
const onDeleteAPI = (deletedIx) => {
|
|
9903
|
-
setBlockContent(
|
|
9902
|
+
setBlockContent(
|
|
9903
|
+
{
|
|
9904
|
+
api: apiList.length === 1 && apiList[0] === "" ? null : apiList.filter((ai, ix) => ix !== deletedIx).join(apiSeparator)
|
|
9905
|
+
}
|
|
9906
|
+
);
|
|
9904
9907
|
};
|
|
9905
9908
|
const codeEditor = /* @__PURE__ */ jsx(
|
|
9906
9909
|
MonacoWrapper_default,
|
|
@@ -9954,7 +9957,7 @@ function BlockEditor({
|
|
|
9954
9957
|
onEnterPress: () => onSave(true),
|
|
9955
9958
|
onDelete: () => onDeleteAPI(ix)
|
|
9956
9959
|
},
|
|
9957
|
-
`${id}-${ix}`
|
|
9960
|
+
`${id}-${ix}-${apiList.length}`
|
|
9958
9961
|
)),
|
|
9959
9962
|
/* @__PURE__ */ jsx(
|
|
9960
9963
|
Button,
|
package/dist/server.js
CHANGED
|
@@ -5957,7 +5957,7 @@ function BespokeRendererStaticPaths(options) {
|
|
|
5957
5957
|
limit,
|
|
5958
5958
|
format: "plain",
|
|
5959
5959
|
locale: locale || localeDefault9,
|
|
5960
|
-
noImage:
|
|
5960
|
+
noImage: false,
|
|
5961
5961
|
visible: true,
|
|
5962
5962
|
report: [],
|
|
5963
5963
|
dimension: [],
|
|
@@ -5965,7 +5965,7 @@ function BespokeRendererStaticPaths(options) {
|
|
|
5965
5965
|
includes: true
|
|
5966
5966
|
});
|
|
5967
5967
|
if (req.ok === true) {
|
|
5968
|
-
paths = req.data.results.
|
|
5968
|
+
paths = req.data.results.map((item) => ({
|
|
5969
5969
|
locale: locales9.find((token) => token === item.locale),
|
|
5970
5970
|
params: {
|
|
5971
5971
|
bespoke: [item.variant.slug, item.slug]
|