pollination-react-io 1.24.2 → 1.24.3
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 +24 -18
- package/build/index.esm.js.map +1 -1
- package/build/index.js +24 -18
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -46264,6 +46264,9 @@ var SendGeometry = function (_a) {
|
|
|
46264
46264
|
var _c = React.useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action$2.preview), selOpt = _c[0], setSelOpt = _c[1];
|
|
46265
46265
|
var _d = React.useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
|
|
46266
46266
|
var sendMessage = useSendMessage().sendMessage;
|
|
46267
|
+
var disabled = React.useMemo(function () {
|
|
46268
|
+
return checkPollinationPanel();
|
|
46269
|
+
}, []);
|
|
46267
46270
|
React.useEffect(function () {
|
|
46268
46271
|
setSelOpt(defaultAction);
|
|
46269
46272
|
}, [defaultAction]);
|
|
@@ -46271,7 +46274,7 @@ var SendGeometry = function (_a) {
|
|
|
46271
46274
|
setKey(defaultKey);
|
|
46272
46275
|
}, [defaultKey]);
|
|
46273
46276
|
React.useEffect(function () {
|
|
46274
|
-
if (
|
|
46277
|
+
if (disabled || selOpt !== 'subscribe-preview')
|
|
46275
46278
|
return;
|
|
46276
46279
|
sendMessage('SubscribePreviewGeometry', {
|
|
46277
46280
|
data: geometry,
|
|
@@ -46285,9 +46288,9 @@ var SendGeometry = function (_a) {
|
|
|
46285
46288
|
options: geometryOptions
|
|
46286
46289
|
});
|
|
46287
46290
|
};
|
|
46288
|
-
}, [
|
|
46289
|
-
return (React__default["default"].createElement(SettingsButton, { disabled:
|
|
46290
|
-
if (
|
|
46291
|
+
}, [disabled, geometry, geometryOptions, key, selOpt, sendMessage]);
|
|
46292
|
+
return (React__default["default"].createElement(SettingsButton, { disabled: disabled, onClick: function () {
|
|
46293
|
+
if (disabled)
|
|
46291
46294
|
return;
|
|
46292
46295
|
sendMessage(getAction$2(selOpt), {
|
|
46293
46296
|
data: geometry,
|
|
@@ -46305,7 +46308,7 @@ var SendGeometry = function (_a) {
|
|
|
46305
46308
|
label: 'Preview',
|
|
46306
46309
|
checked: selOpt === Action$2.preview,
|
|
46307
46310
|
icon: React__default["default"].createElement(Eyeglasses$1, { size: 16 }),
|
|
46308
|
-
disabled:
|
|
46311
|
+
disabled: disabled,
|
|
46309
46312
|
onSelect: function () {
|
|
46310
46313
|
setSelOpt(function (state) { return (state === Action$2.preview ? undefined : Action$2.preview); });
|
|
46311
46314
|
},
|
|
@@ -46316,7 +46319,7 @@ var SendGeometry = function (_a) {
|
|
|
46316
46319
|
label: 'Add',
|
|
46317
46320
|
checked: selOpt === Action$2.add,
|
|
46318
46321
|
icon: React__default["default"].createElement(Building$1, { size: 16 }),
|
|
46319
|
-
disabled:
|
|
46322
|
+
disabled: disabled,
|
|
46320
46323
|
onSelect: function () {
|
|
46321
46324
|
setSelOpt(function (state) { return (state === Action$2.add ? undefined : Action$2.add); });
|
|
46322
46325
|
},
|
|
@@ -46327,7 +46330,7 @@ var SendGeometry = function (_a) {
|
|
|
46327
46330
|
label: 'Delete',
|
|
46328
46331
|
checked: selOpt === Action$2.delete,
|
|
46329
46332
|
icon: React__default["default"].createElement(Trash$1, { size: 16 }),
|
|
46330
|
-
disabled:
|
|
46333
|
+
disabled: disabled,
|
|
46331
46334
|
onSelect: function () {
|
|
46332
46335
|
setSelOpt(function (state) { return (state === Action$2.delete ? undefined : Action$2.delete); });
|
|
46333
46336
|
},
|
|
@@ -46338,7 +46341,7 @@ var SendGeometry = function (_a) {
|
|
|
46338
46341
|
label: 'Clear',
|
|
46339
46342
|
checked: selOpt === Action$2.clear,
|
|
46340
46343
|
icon: React__default["default"].createElement(Recycle$1, { size: 16 }),
|
|
46341
|
-
disabled:
|
|
46344
|
+
disabled: disabled,
|
|
46342
46345
|
onSelect: function () {
|
|
46343
46346
|
setSelOpt(function (state) { return (state === Action$2.clear ? undefined : Action$2.clear); });
|
|
46344
46347
|
},
|
|
@@ -46349,7 +46352,7 @@ var SendGeometry = function (_a) {
|
|
|
46349
46352
|
label: 'Subscribe Preview',
|
|
46350
46353
|
checked: selOpt === Action$2.subscribePreview,
|
|
46351
46354
|
icon: React__default["default"].createElement(ArrowRepeat$1, { size: 16 }),
|
|
46352
|
-
disabled:
|
|
46355
|
+
disabled: disabled,
|
|
46353
46356
|
onSelect: function () {
|
|
46354
46357
|
setSelOpt(function (state) { return (state === Action$2.subscribePreview ? undefined : Action$2.subscribePreview); });
|
|
46355
46358
|
},
|
|
@@ -46512,6 +46515,9 @@ var SendResults = function (_a) {
|
|
|
46512
46515
|
var _c = React.useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action.preview), selOpt = _c[0], setSelOpt = _c[1];
|
|
46513
46516
|
var _d = React.useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
|
|
46514
46517
|
var sendMessage = useSendMessage().sendMessage;
|
|
46518
|
+
var disabled = React.useMemo(function () {
|
|
46519
|
+
return checkPollinationPanel();
|
|
46520
|
+
}, []);
|
|
46515
46521
|
React.useEffect(function () {
|
|
46516
46522
|
setSelOpt(defaultAction);
|
|
46517
46523
|
}, [defaultAction]);
|
|
@@ -46519,7 +46525,7 @@ var SendResults = function (_a) {
|
|
|
46519
46525
|
setKey(defaultKey);
|
|
46520
46526
|
}, [defaultKey]);
|
|
46521
46527
|
React.useEffect(function () {
|
|
46522
|
-
if (
|
|
46528
|
+
if (disabled || selOpt !== Action.subscribePreview)
|
|
46523
46529
|
return;
|
|
46524
46530
|
sendMessage('SubscribePreviewResults', {
|
|
46525
46531
|
data: results,
|
|
@@ -46533,9 +46539,9 @@ var SendResults = function (_a) {
|
|
|
46533
46539
|
options: geometryOptions,
|
|
46534
46540
|
});
|
|
46535
46541
|
};
|
|
46536
|
-
}, [geometryOptions, key, results, selOpt, sendMessage]);
|
|
46537
|
-
return (React__default["default"].createElement(SettingsButton, { disabled:
|
|
46538
|
-
if (
|
|
46542
|
+
}, [disabled, geometryOptions, key, results, selOpt, sendMessage]);
|
|
46543
|
+
return (React__default["default"].createElement(SettingsButton, { disabled: disabled, onClick: function () {
|
|
46544
|
+
if (disabled)
|
|
46539
46545
|
return;
|
|
46540
46546
|
sendMessage(getAction(selOpt), {
|
|
46541
46547
|
data: results,
|
|
@@ -46553,7 +46559,7 @@ var SendResults = function (_a) {
|
|
|
46553
46559
|
label: 'Preview',
|
|
46554
46560
|
checked: selOpt === Action.preview,
|
|
46555
46561
|
icon: React__default["default"].createElement(Eyeglasses$1, { size: 16 }),
|
|
46556
|
-
disabled:
|
|
46562
|
+
disabled: disabled,
|
|
46557
46563
|
onSelect: function () {
|
|
46558
46564
|
setSelOpt(function (state) { return (state === Action.preview ? undefined : Action.preview); });
|
|
46559
46565
|
},
|
|
@@ -46564,7 +46570,7 @@ var SendResults = function (_a) {
|
|
|
46564
46570
|
label: 'Add',
|
|
46565
46571
|
checked: selOpt === Action.add,
|
|
46566
46572
|
icon: React__default["default"].createElement(Building$1, { size: 16 }),
|
|
46567
|
-
disabled:
|
|
46573
|
+
disabled: disabled,
|
|
46568
46574
|
onSelect: function () {
|
|
46569
46575
|
setSelOpt(function (state) { return (state === Action.add ? undefined : Action.add); });
|
|
46570
46576
|
},
|
|
@@ -46575,7 +46581,7 @@ var SendResults = function (_a) {
|
|
|
46575
46581
|
label: 'Delete',
|
|
46576
46582
|
checked: selOpt === Action.delete,
|
|
46577
46583
|
icon: React__default["default"].createElement(Trash$1, { size: 16 }),
|
|
46578
|
-
disabled:
|
|
46584
|
+
disabled: disabled,
|
|
46579
46585
|
onSelect: function () {
|
|
46580
46586
|
setSelOpt(function (state) { return (state === Action.delete ? undefined : Action.delete); });
|
|
46581
46587
|
},
|
|
@@ -46586,7 +46592,7 @@ var SendResults = function (_a) {
|
|
|
46586
46592
|
label: 'Clear',
|
|
46587
46593
|
checked: selOpt === Action.clear,
|
|
46588
46594
|
icon: React__default["default"].createElement(Recycle$1, { size: 16 }),
|
|
46589
|
-
disabled:
|
|
46595
|
+
disabled: disabled,
|
|
46590
46596
|
onSelect: function () {
|
|
46591
46597
|
setSelOpt(function (state) { return (state === Action.clear ? undefined : Action.clear); });
|
|
46592
46598
|
},
|
|
@@ -46597,7 +46603,7 @@ var SendResults = function (_a) {
|
|
|
46597
46603
|
label: 'Subscribe Preview',
|
|
46598
46604
|
checked: selOpt === Action.subscribePreview,
|
|
46599
46605
|
icon: React__default["default"].createElement(ArrowRepeat$1, { size: 16 }),
|
|
46600
|
-
disabled:
|
|
46606
|
+
disabled: disabled,
|
|
46601
46607
|
onSelect: function () {
|
|
46602
46608
|
setSelOpt(function (state) { return (state === Action.subscribePreview ? undefined : Action.subscribePreview); });
|
|
46603
46609
|
},
|