@glasshome/widget-sdk 0.3.4 → 0.3.5
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.
|
@@ -29,6 +29,7 @@ import type { WidgetStatus as WidgetStatusType } from "../components/WidgetStatu
|
|
|
29
29
|
import type { WidgetSubtitle as WidgetSubtitleType } from "../components/WidgetSubtitle";
|
|
30
30
|
import type { WidgetTitle as WidgetTitleType } from "../components/WidgetTitle";
|
|
31
31
|
import type { WidgetValue as WidgetValueType } from "../components/WidgetValue";
|
|
32
|
+
import type { GestureHandlers } from "../gestures/use-widget-gestures";
|
|
32
33
|
import type { WidgetOrientation, WidgetSize, WidgetVariantConfig } from "../types";
|
|
33
34
|
export interface WidgetEmptyStateConfig {
|
|
34
35
|
/** Icon to display */
|
|
@@ -55,6 +56,12 @@ export interface WidgetProps {
|
|
|
55
56
|
onDelete?: () => void;
|
|
56
57
|
/** Empty state configuration - when provided, shows empty state and applies gray gradient */
|
|
57
58
|
emptyState?: WidgetEmptyStateConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Gesture handlers from `useWidgetGestures`. When provided, Widget binds
|
|
61
|
+
* pointer events on its outer container and wires the size observer so
|
|
62
|
+
* widget authors don't need a gesture wrapper div. Suppressed in edit mode.
|
|
63
|
+
*/
|
|
64
|
+
gestures?: GestureHandlers;
|
|
58
65
|
/** Child elements */
|
|
59
66
|
children?: JSX.Element;
|
|
60
67
|
}
|
|
@@ -36,6 +36,12 @@ export interface GestureHandlers {
|
|
|
36
36
|
onPointerCancel: (e: PointerEvent) => void;
|
|
37
37
|
/** Sets the correct cursor on the element. Bind via on:pointerenter. */
|
|
38
38
|
onPointerEnter: (e: PointerEvent) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Ref callback. Seeds the size observer used for `orientation: "auto"` slide
|
|
41
|
+
* resolution. Bind via `ref={gestures.bindElement}` on the same element that
|
|
42
|
+
* receives the pointer handlers.
|
|
43
|
+
*/
|
|
44
|
+
bindElement: (el: HTMLElement) => void;
|
|
39
45
|
/** Cancel any pending hold/slide timers. Call on component unmount via onCleanup. */
|
|
40
46
|
dispose: () => void;
|
|
41
47
|
}
|