pollination-react-io 0.0.11 → 0.0.14

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.
@@ -4,14 +4,19 @@ import "./Dropdown.scss";
4
4
  export declare type Option = {
5
5
  type: 'checkbox' | 'radio' | 'button' | 'label' | 'link';
6
6
  id: string;
7
- label: React.ReactNode;
7
+ label: string;
8
8
  checked?: boolean;
9
9
  disabled?: boolean;
10
10
  onSelect?: (option: Option) => void;
11
11
  to?: string;
12
12
  };
13
+ export declare type OptionGroup = {
14
+ options: Option[];
15
+ type?: 'radio' | 'default';
16
+ value?: string;
17
+ };
13
18
  interface DropdownProps {
14
- options: Option[][];
19
+ optionGroups: OptionGroup[];
15
20
  trigger: React.ReactNode;
16
21
  contentProps?: DropdownMenu.DropdownMenuContentProps;
17
22
  itemProps?: DropdownMenu.DropdownMenuItemProps;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { GetModelProps } from './GetModel.types';
3
+ export declare const GetModel: FC<GetModelProps>;
4
+ export default GetModel;
@@ -0,0 +1,3 @@
1
+ export interface GetModelProps {
2
+ setParentState: (data: any) => any;
3
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { PreviewBakeGeometryProps } from "./PreviewBakeGeometry.types";
3
+ declare const PreviewBakeGeometry: React.FC<PreviewBakeGeometryProps>;
4
+ export default PreviewBakeGeometry;
@@ -0,0 +1,4 @@
1
+ import { XOR } from "../ts-utils";
2
+ export interface PreviewBakeGeometryProps {
3
+ geometry?: XOR<object, (args?: any) => Promise<object>>;
4
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { PreviewBakeModelProps } from "./PreviewBakeModel.types";
3
+ declare const PreviewBakeModel: React.FC<PreviewBakeModelProps>;
4
+ export default PreviewBakeModel;
@@ -0,0 +1,4 @@
1
+ import { XOR } from "../ts-utils";
2
+ export interface PreviewBakeModelProps {
3
+ hbjson?: XOR<object, (args?: any) => Promise<object>>;
4
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { RunCommandProps } from "./RunCommand.types";
3
+ import "./RunCommand.scss";
4
+ declare const RunCommand: React.FC<RunCommandProps>;
5
+ export default RunCommand;
@@ -0,0 +1,4 @@
1
+ export interface RunCommandProps {
2
+ command: string;
3
+ prefix?: string;
4
+ }
@@ -1,3 +1,4 @@
1
1
  export interface SendGeometryProps {
2
2
  geometry?: string[];
3
+ defaultAction?: 'add' | 'delete' | 'preview' | 'clear' | 'subscribe-preview';
3
4
  }
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { SendModelProps } from './SendModel.types';
3
+ export declare const SendModel: FC<SendModelProps>;
4
+ export default SendModel;
@@ -0,0 +1,4 @@
1
+ export interface SendModelProps {
2
+ hbjson?: object;
3
+ defaultAction?: 'add' | 'preview' | 'clear' | 'subscribe-preview';
4
+ }
@@ -1,10 +1,11 @@
1
- import { FC } from 'react';
2
- import { Option } from '../Dropdown/Dropdown';
1
+ import React, { FC, ReactNode } from 'react';
2
+ import { OptionGroup } from '../Dropdown/Dropdown';
3
3
  import '../buttons.scss';
4
4
  export interface SettingsButtonProps {
5
- disabled: boolean;
6
5
  onClick: () => void;
7
- label: string;
8
- options?: Option[][];
6
+ label: string | ReactNode;
7
+ options?: OptionGroup[];
8
+ disabled?: boolean;
9
+ triggerIcon?: React.ReactNode;
9
10
  }
10
11
  export declare const SettingsButton: FC<SettingsButtonProps>;
@@ -29,6 +29,7 @@
29
29
  transition: background-color 0.125s ease-in-out;
30
30
  z-index: 10;
31
31
  align-items: center;
32
+ gap: 8px;
32
33
  }
33
34
 
34
35
  .btn-group button:disabled {
@@ -2,8 +2,11 @@ export interface Options {
2
2
  layer?: string;
3
3
  units?: string;
4
4
  }
5
+ export declare type GeometryAction = 'BakeGeometry' | 'ClearGeometry' | 'DrawGeometry' | 'DisableDraw' | 'CombinedRendering';
6
+ export declare type ModelAction = 'BakePollinationModel' | 'DisableDrawPollinationModel' | 'DrawPollinationModel' | 'CombinedRenderingPollinationModel';
7
+ export declare type Action = GeometryAction | ModelAction | 'RunCommand' | 'SetModelSettings';
5
8
  export interface Message {
6
- action?: string;
9
+ action?: Action;
7
10
  data?: any;
8
11
  options?: any;
9
12
  }
@@ -1,4 +1,4 @@
1
- import { Message } from './types';
1
+ import { GeometryAction, Message } from './types';
2
2
  interface SendGeometryOptions {
3
3
  layer: string;
4
4
  units: string;
@@ -11,6 +11,6 @@ declare type SendGeometryMessage = Message & SendGeometry;
11
11
  export declare const useSendGeometry: () => {
12
12
  host: any;
13
13
  state: {};
14
- sendGeometry: (message: SendGeometryMessage, preview?: any) => Message;
14
+ sendGeometry: (action: GeometryAction, message: SendGeometryMessage) => Message;
15
15
  };
16
16
  export {};
@@ -1,4 +1,4 @@
1
- import { Message } from './types';
1
+ import { ModelAction, Message } from './types';
2
2
  interface SendGeometryOptions {
3
3
  layer: string;
4
4
  units: string;
@@ -11,6 +11,6 @@ declare type SendGeometryMessage = Message & SendGeometry;
11
11
  export declare const useSendHbjson: () => {
12
12
  host: any;
13
13
  state: {};
14
- sendHbjson: (message: SendGeometryMessage, preview?: any) => Message;
14
+ sendHbjson: (action: ModelAction, message: SendGeometryMessage) => Message;
15
15
  };
16
16
  export {};
package/build/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from './hooks';
2
2
  export * from './GetGeometry/GetGeometry';
3
- export * from './GetHbjson/GetHbjson';
3
+ export * from './GetModel/GetModel';
4
+ export * from './PreviewBakeGeometry/PreviewBakeGeometry';
5
+ export * from './PreviewBakeModel/PreviewBakeModel';
6
+ export * from './RunCommand/RunCommand';
4
7
  export * from './SendGeometry/SendGeometry';
5
- export * from './SendHbjson/SendHbjson';
8
+ export * from './SendModel/SendModel';