@squeed/flow-sdk 2.0.2 → 2.0.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/dist/index.d.cts CHANGED
@@ -10,6 +10,7 @@ import { MutableRefObject } from 'react';
10
10
  import { ReactNode } from 'react';
11
11
  import { ReactPortal } from 'react';
12
12
  import { RefAttributes } from 'react';
13
+ import { RefObject } from 'react';
13
14
  import { StyledComponent } from '@emotion/styled';
14
15
  import { Theme } from '@emotion/react';
15
16
 
@@ -753,6 +754,26 @@ export declare const getColorVariant: (color: string) => {
753
754
 
754
755
  export declare function getDarkerHexColor(hex: string, factor?: number): string;
755
756
 
757
+ /** Flat chrome surface: the border and halo only appear while hovered. Colors are CSS values. */
758
+ export declare function getInteractionSurface(surface: string, border: string): {
759
+ "--flow-start-shadow": string;
760
+ "@media (hover: hover)": {
761
+ "&:hover": {
762
+ borderColor: string;
763
+ "@media (prefers-reduced-motion: no-preference)": {
764
+ animation: string;
765
+ };
766
+ boxShadow: string;
767
+ };
768
+ };
769
+ "--flow-rest-shadow": string;
770
+ "--flow-hover-shadow": string;
771
+ borderWidth: string;
772
+ borderStyle: string;
773
+ borderColor: string;
774
+ boxShadow: string;
775
+ };
776
+
756
777
  export declare function getNode(json: SqueedJson, address: string): any;
757
778
 
758
779
  export declare interface JsonPlaybackState {
@@ -1179,6 +1200,18 @@ export declare function useCustomColors(theme?: any): {
1179
1200
  greenColor: string;
1180
1201
  };
1181
1202
 
1203
+ /**
1204
+ * True while the pointer is within `threshold` px of one edge of `bounds`, or over any `inside`
1205
+ * element. Used to reveal hidden edge toolbars; inactive when disabled or the pointer leaves the page.
1206
+ */
1207
+ export declare function useEdgeProximity({ edge, enabled, bounds, inside, threshold, }: {
1208
+ edge: "top" | "bottom";
1209
+ enabled: boolean;
1210
+ bounds: RefObject<HTMLElement | null>;
1211
+ inside?: RefObject<HTMLElement | null>[];
1212
+ threshold?: number;
1213
+ }): boolean;
1214
+
1182
1215
  export declare function useFlowData(): {
1183
1216
  nodeById: Map<string, FlowDiagramNode>;
1184
1217
  edgeById: Map<string, FlowDiagramEdge>;
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { MutableRefObject } from 'react';
10
10
  import { ReactNode } from 'react';
11
11
  import { ReactPortal } from 'react';
12
12
  import { RefAttributes } from 'react';
13
+ import { RefObject } from 'react';
13
14
  import { StyledComponent } from '@emotion/styled';
14
15
  import { Theme } from '@emotion/react';
15
16
 
@@ -753,6 +754,26 @@ export declare const getColorVariant: (color: string) => {
753
754
 
754
755
  export declare function getDarkerHexColor(hex: string, factor?: number): string;
755
756
 
757
+ /** Flat chrome surface: the border and halo only appear while hovered. Colors are CSS values. */
758
+ export declare function getInteractionSurface(surface: string, border: string): {
759
+ "--flow-start-shadow": string;
760
+ "@media (hover: hover)": {
761
+ "&:hover": {
762
+ borderColor: string;
763
+ "@media (prefers-reduced-motion: no-preference)": {
764
+ animation: string;
765
+ };
766
+ boxShadow: string;
767
+ };
768
+ };
769
+ "--flow-rest-shadow": string;
770
+ "--flow-hover-shadow": string;
771
+ borderWidth: string;
772
+ borderStyle: string;
773
+ borderColor: string;
774
+ boxShadow: string;
775
+ };
776
+
756
777
  export declare function getNode(json: SqueedJson, address: string): any;
757
778
 
758
779
  export declare interface JsonPlaybackState {
@@ -1179,6 +1200,18 @@ export declare function useCustomColors(theme?: any): {
1179
1200
  greenColor: string;
1180
1201
  };
1181
1202
 
1203
+ /**
1204
+ * True while the pointer is within `threshold` px of one edge of `bounds`, or over any `inside`
1205
+ * element. Used to reveal hidden edge toolbars; inactive when disabled or the pointer leaves the page.
1206
+ */
1207
+ export declare function useEdgeProximity({ edge, enabled, bounds, inside, threshold, }: {
1208
+ edge: "top" | "bottom";
1209
+ enabled: boolean;
1210
+ bounds: RefObject<HTMLElement | null>;
1211
+ inside?: RefObject<HTMLElement | null>[];
1212
+ threshold?: number;
1213
+ }): boolean;
1214
+
1182
1215
  export declare function useFlowData(): {
1183
1216
  nodeById: Map<string, FlowDiagramNode>;
1184
1217
  edgeById: Map<string, FlowDiagramEdge>;