pollination-react-io 1.13.2 → 1.13.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.
@@ -7,7 +7,6 @@ export declare enum Action {
7
7
  }
8
8
  interface GeometryOptions {
9
9
  units?: 'Meters' | 'Millimeters' | 'Feet' | 'Inches' | 'Centimeters';
10
- layer?: string;
11
10
  }
12
11
  export interface SendGeometryProps {
13
12
  geometry?: string[];
@@ -6,6 +6,9 @@ export declare enum Action {
6
6
  clear = "clear",
7
7
  subscribePreview = "subscribe-preview"
8
8
  }
9
+ interface ResultsOptions {
10
+ units?: 'Meters' | 'Millimeters' | 'Feet' | 'Inches' | 'Centimeters';
11
+ }
9
12
  export interface SendResultsProps {
10
13
  results?: XOR<object, (args?: any) => Promise<object>>;
11
14
  defaultAction?: Action;
@@ -14,4 +17,6 @@ export interface SendResultsProps {
14
17
  [index in Action]: boolean;
15
18
  };
16
19
  buttonLabel?: string;
20
+ geometryOptions?: ResultsOptions;
17
21
  }
22
+ export {};
@@ -41272,7 +41272,7 @@ var getAction = function (key) {
41272
41272
  }
41273
41273
  };
41274
41274
  var SendResults = function (_a) {
41275
- var results = _a.results, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Results' : _b;
41275
+ var results = _a.results, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Results' : _b, geometryOptions = _a.geometryOptions;
41276
41276
  var _c = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action.preview), selOpt = _c[0], setSelOpt = _c[1];
41277
41277
  var _d = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
41278
41278
  var sendMessage = useSendMessage().sendMessage;
@@ -41288,32 +41288,23 @@ var SendResults = function (_a) {
41288
41288
  sendMessage('SubscribePreviewResults', {
41289
41289
  data: results,
41290
41290
  uniqueId: key,
41291
- options: {
41292
- layer: 'StreamlitLayer',
41293
- units: 'Meters',
41294
- },
41291
+ options: geometryOptions,
41295
41292
  });
41296
41293
  return function () {
41297
41294
  sendMessage('ClearResults', {
41298
41295
  data: results,
41299
41296
  uniqueId: key,
41300
- options: {
41301
- layer: 'StreamlitLayer',
41302
- units: 'Meters',
41303
- },
41297
+ options: geometryOptions,
41304
41298
  });
41305
41299
  };
41306
- }, [key, results, selOpt, sendMessage]);
41300
+ }, [geometryOptions, key, results, selOpt, sendMessage]);
41307
41301
  return (React__default.createElement(SettingsButton, { disabled: !sendMessage, onClick: function () {
41308
41302
  if (!sendMessage)
41309
41303
  return;
41310
41304
  sendMessage(getAction(selOpt), {
41311
41305
  data: results,
41312
41306
  uniqueId: key,
41313
- options: {
41314
- layer: 'StreamlitLayer',
41315
- units: 'Meters',
41316
- },
41307
+ options: geometryOptions,
41317
41308
  });
41318
41309
  }, options: [{
41319
41310
  type: 'radio',