pollination-react-io 1.92.3 → 1.92.4
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/build/index.esm.js +17 -11
- package/build/index.esm.js.map +1 -1
- package/build/index.js +17 -11
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
@@ -47697,22 +47697,28 @@ var GetGeometry = function (_a) {
|
|
47697
47697
|
var _g = useState(), selection = _g[0], setSelection = _g[1];
|
47698
47698
|
var _h = useState(), subscribe = _h[0], setSubscribe = _h[1];
|
47699
47699
|
var _j = useState(), preview = _j[0], setPreview = _j[1];
|
47700
|
+
// Config only on bootstrap
|
47701
|
+
var initialConfig = useMemo(function () {
|
47702
|
+
if (!optionsConfig)
|
47703
|
+
return undefined;
|
47704
|
+
return optionsConfig;
|
47705
|
+
}, []);
|
47700
47706
|
// pollination-react-io hooks
|
47701
47707
|
var _k = useGetGeometry(), host = _k.host, geometry = _k.geometry, getGeometry = _k.getGeometry;
|
47702
47708
|
// set selection and subscribe on props change
|
47703
47709
|
useEffect(function () {
|
47704
|
-
if (!
|
47710
|
+
if (!initialConfig)
|
47705
47711
|
return;
|
47706
|
-
var sel = Boolean(
|
47707
|
-
typeof
|
47708
|
-
typeof
|
47709
|
-
var sub = Boolean(
|
47710
|
-
typeof
|
47711
|
-
typeof
|
47712
|
+
var sel = Boolean(initialConfig) && typeof initialConfig !== 'undefined' &&
|
47713
|
+
typeof initialConfig.selection !== 'undefined' &&
|
47714
|
+
typeof initialConfig.selection.selected !== 'undefined' ? initialConfig.selection.selected : false;
|
47715
|
+
var sub = Boolean(initialConfig) && typeof initialConfig !== 'undefined' &&
|
47716
|
+
typeof initialConfig.subscribe !== 'undefined' &&
|
47717
|
+
typeof initialConfig.subscribe.selected !== 'undefined' ? initialConfig.subscribe.selected : false;
|
47712
47718
|
// Do not trigger prev props - for streamlit
|
47713
47719
|
setSelection(sel);
|
47714
47720
|
setSubscribe(sub);
|
47715
|
-
}, [
|
47721
|
+
}, [initialConfig]);
|
47716
47722
|
useEffect(function () {
|
47717
47723
|
// Send data only after the first click
|
47718
47724
|
if (!geometry || !setParentState || !isClicked)
|
@@ -47810,10 +47816,10 @@ var GetGeometry = function (_a) {
|
|
47810
47816
|
},
|
47811
47817
|
},
|
47812
47818
|
].filter(function (o) {
|
47813
|
-
if (!
|
47819
|
+
if (!initialConfig)
|
47814
47820
|
return true;
|
47815
|
-
return typeof
|
47816
|
-
typeof
|
47821
|
+
return typeof initialConfig[o.id] === 'undefined' ? true :
|
47822
|
+
typeof initialConfig[o.id].show === 'undefined' ? true : initialConfig[o.id].show;
|
47817
47823
|
}),
|
47818
47824
|
}] : undefined, asButtons: true, label: buttonLabel, helpText: "Get ".concat(selection ? 'selected ' : '', " geometry").concat(subscribe ? ' continuously' : '', ".") }));
|
47819
47825
|
};
|