@g9tm/lynxcontrols 2.8.4 → 2.9.0
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/README.md +1 -0
- package/catalog/cards/G9Avatar.md +1 -1
- package/catalog/cards/G9Badge.md +1 -1
- package/catalog/cards/G9Button.md +1 -1
- package/catalog/cards/G9Chip.md +1 -1
- package/catalog/cards/G9ChipStrip.md +1 -1
- package/catalog/cards/G9ContextMenu.md +4 -2
- package/catalog/cards/G9DragChip.md +10 -0
- package/catalog/cards/G9DragSource.md +17 -0
- package/catalog/cards/G9DropTarget.md +15 -0
- package/catalog/cards/G9EmptyState.md +1 -1
- package/catalog/cards/G9IconButton.md +2 -2
- package/catalog/cards/G9InlineMessage.md +1 -1
- package/catalog/cards/G9KeyCapture.md +10 -0
- package/catalog/cards/G9Kpi.md +1 -1
- package/catalog/cards/G9ListRow.md +1 -1
- package/catalog/cards/G9LiveBadge.md +1 -1
- package/catalog/cards/G9LiveDot.md +1 -1
- package/catalog/cards/G9ProgressBar.md +1 -1
- package/catalog/cards/G9ProgressRing.md +1 -1
- package/catalog/cards/G9SafeButton.md +1 -1
- package/catalog/cards/G9SafeIconButton.md +2 -2
- package/catalog/cards/G9StatusPill.md +1 -1
- package/catalog/cards/G9StepTracker.md +1 -1
- package/catalog/cards/G9SwitchRow.md +1 -1
- package/catalog/cards/G9Tag.md +1 -1
- package/catalog/catalog.json +1069 -68
- package/catalog/index.md +6 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.jsx +1 -1
- package/dist/commands/keys.d.ts +32 -1
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.jsx +92 -3
- package/dist/desktop/index.d.ts +3 -0
- package/dist/desktop/index.d.ts.map +1 -0
- package/dist/desktop/index.jsx +2 -0
- package/dist/desktop/keys.d.ts +26 -0
- package/dist/desktop/keys.d.ts.map +1 -0
- package/dist/desktop/keys.jsx +30 -0
- package/dist/desktop/window.d.ts +18 -0
- package/dist/desktop/window.d.ts.map +1 -0
- package/dist/desktop/window.jsx +28 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/pointer/drag-session.d.ts +72 -0
- package/dist/pointer/drag-session.d.ts.map +1 -0
- package/dist/pointer/drag-session.jsx +148 -0
- package/dist/pointer/drag.d.ts +78 -0
- package/dist/pointer/drag.d.ts.map +1 -0
- package/dist/pointer/drag.jsx +186 -0
- package/dist/pointer/index.d.ts +5 -0
- package/dist/pointer/index.d.ts.map +1 -0
- package/dist/pointer/index.jsx +4 -0
- package/dist/pointer/point.d.ts +36 -0
- package/dist/pointer/point.d.ts.map +1 -0
- package/dist/pointer/point.jsx +34 -0
- package/dist/pointer/pointer.css +62 -0
- package/dist/pointer/pointer.css.map +1 -0
- package/dist/pointer/secondary.d.ts +54 -0
- package/dist/pointer/secondary.d.ts.map +1 -0
- package/dist/pointer/secondary.jsx +86 -0
- package/dist/popover/popover.d.ts +26 -2
- package/dist/popover/popover.d.ts.map +1 -1
- package/dist/popover/popover.jsx +47 -20
- package/package.json +12 -2
- package/skills/g9-lynx-app/SKILL.md +8 -0
- package/skills/g9-lynx-app/references/catalog-index.md +11 -0
- package/skills/g9-lynx-app/references/components/button.md +6 -6
- package/skills/g9-lynx-app/references/components/code-editor.md +19 -0
- package/skills/g9-lynx-app/references/components/code-log.md +19 -0
- package/skills/g9-lynx-app/references/components/desktop.md +12 -0
- package/skills/g9-lynx-app/references/components/display-1.md +4 -4
- package/skills/g9-lynx-app/references/components/display-2.md +5 -5
- package/skills/g9-lynx-app/references/components/display-3.md +3 -3
- package/skills/g9-lynx-app/references/components/graph.md +19 -0
- package/skills/g9-lynx-app/references/components/list.md +2 -2
- package/skills/g9-lynx-app/references/components/pointer.md +46 -0
- package/skills/g9-lynx-app/references/components/popover.md +4 -2
- package/skills/g9-lynx-app/references/components/toggle.md +2 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
2
|
+
import type { NodesRef } from '@lynx-js/types';
|
|
3
|
+
import { type G9DragPayload, type G9DragState, type G9DropEvent } from './drag-session.js';
|
|
4
|
+
import { type G9PointerEventLike } from './point.js';
|
|
5
|
+
import './pointer.css';
|
|
6
|
+
/** The page's drag as React state: re-renders on its start, a change of the target under it, and its end. */
|
|
7
|
+
export declare function useG9DragState(): G9DragState | null;
|
|
8
|
+
/** Options of {@link useG9DragSource}. */
|
|
9
|
+
export interface G9DragSourceOptions<T = unknown> {
|
|
10
|
+
/** What is dragged (a function is asked when the drag starts). */
|
|
11
|
+
readonly payload: G9DragPayload<T> | (() => G9DragPayload<T>);
|
|
12
|
+
/** Default true. */
|
|
13
|
+
readonly enabled?: boolean;
|
|
14
|
+
/** How far (dp) the mouse moves before a drag starts. Default 4. */
|
|
15
|
+
readonly threshold?: number;
|
|
16
|
+
/** A long press starts a drag on touch. Default true. */
|
|
17
|
+
readonly longPress?: boolean;
|
|
18
|
+
/** The preview under the pointer; default a chip with the payload's `label`. */
|
|
19
|
+
readonly renderPreview?: (payload: G9DragPayload<T>) => ReactNode;
|
|
20
|
+
readonly onDragStart?: (payload: G9DragPayload<T>) => void;
|
|
21
|
+
/** The drag ended: the drop, or null (no target, or cancelled). */
|
|
22
|
+
readonly onDragEnd?: (drop: G9DropEvent<T> | null) => void;
|
|
23
|
+
}
|
|
24
|
+
/** The props {@link useG9DragSource} puts on the source element. */
|
|
25
|
+
export interface G9DragSourceProps {
|
|
26
|
+
readonly bindmousedown?: (e: G9PointerEventLike) => void;
|
|
27
|
+
readonly bindmousemove?: (e: G9PointerEventLike) => void;
|
|
28
|
+
readonly bindmouseup?: (e: G9PointerEventLike) => void;
|
|
29
|
+
readonly bindlongpress?: (e: G9PointerEventLike) => void;
|
|
30
|
+
readonly bindtouchmove?: (e: G9PointerEventLike) => void;
|
|
31
|
+
readonly bindtouchend?: (e: G9PointerEventLike) => void;
|
|
32
|
+
readonly bindtouchcancel?: () => void;
|
|
33
|
+
}
|
|
34
|
+
/** Makes an element a drag source: spread `props` on it; `dragging` is true while its drag runs. */
|
|
35
|
+
export declare function useG9DragSource<T>(options: G9DragSourceOptions<T>): {
|
|
36
|
+
readonly props: G9DragSourceProps;
|
|
37
|
+
readonly dragging: boolean;
|
|
38
|
+
};
|
|
39
|
+
/** The default preview: the payload's label in a chip. */
|
|
40
|
+
export declare function G9DragChip(props: {
|
|
41
|
+
readonly payload: G9DragPayload;
|
|
42
|
+
}): ReactNode;
|
|
43
|
+
/** How a drop target is drawn now. */
|
|
44
|
+
export type G9DropTargetState = 'idle' | 'candidate' | 'over';
|
|
45
|
+
/** Options of {@link useG9DropTarget}. */
|
|
46
|
+
export interface G9DropTargetOptions<T = unknown> {
|
|
47
|
+
/** Unique on the page; default a generated one. */
|
|
48
|
+
readonly id?: string;
|
|
49
|
+
/** Whether it takes a payload (default: every payload). */
|
|
50
|
+
readonly accepts?: (payload: G9DragPayload<T>) => boolean;
|
|
51
|
+
readonly onDrop: (event: G9DropEvent<T>) => void;
|
|
52
|
+
readonly onEnter?: (payload: G9DragPayload<T>) => void;
|
|
53
|
+
readonly onLeave?: (payload: G9DragPayload<T>) => void;
|
|
54
|
+
/** Default true. */
|
|
55
|
+
readonly enabled?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** Makes an element a drop target: put `ref` on it; `state` lights it while a drag that it accepts runs. */
|
|
58
|
+
export declare function useG9DropTarget<T>(options: G9DropTargetOptions<T>): {
|
|
59
|
+
readonly ref: (node: NodesRef | null) => void;
|
|
60
|
+
readonly state: G9DropTargetState;
|
|
61
|
+
};
|
|
62
|
+
/** Props of {@link G9DragSource}. */
|
|
63
|
+
export interface G9DragSourceComponentProps<T = unknown> extends G9DragSourceOptions<T> {
|
|
64
|
+
readonly id?: string;
|
|
65
|
+
readonly className?: string;
|
|
66
|
+
readonly children?: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
/** A drag source around its children (a list row, a card): drawn faded while it is dragged. */
|
|
69
|
+
export declare function G9DragSource<T>(props: G9DragSourceComponentProps<T>): ReactNode;
|
|
70
|
+
/** Props of {@link G9DropTarget}. */
|
|
71
|
+
export interface G9DropTargetProps<T = unknown> extends G9DropTargetOptions<T> {
|
|
72
|
+
readonly className?: string;
|
|
73
|
+
/** Children, or a function of the state (to draw the light its own way). */
|
|
74
|
+
readonly children?: ReactNode | ((state: G9DropTargetState) => ReactNode);
|
|
75
|
+
}
|
|
76
|
+
/** A drop target around its children: outlined while a drag it accepts runs, filled while the drag is over it. */
|
|
77
|
+
export declare function G9DropTarget<T>(props: G9DropTargetProps<T>): ReactNode;
|
|
78
|
+
//# sourceMappingURL=drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag.d.ts","sourceRoot":"","sources":["../../src/pointer/drag.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AACtF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAMjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,kBAAkB,EAAiC,MAAM,SAAS,CAAC;AACjF,OAAO,eAAe,CAAC;AAIvB,6GAA6G;AAC7G,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CAInD;AAED,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAC9C,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,oBAAoB;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,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M,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,+FAA+F;AAC/F,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG,SAAS,CAW/E;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,mBAAmB,CAAC,CAAC,CAAC;IAC5E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC;CAC3E;AAED,kHAAkH;AAClH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,SAAS,CAWtE"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from "@lynx-js/react";
|
|
2
|
+
import { measureNode } from "../anchor/measure.jsx";
|
|
3
|
+
import { g9IdProps, g9SafeId } from "../base/control.jsx";
|
|
4
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
5
|
+
import { useG9Keys } from "../commands/keys.jsx";
|
|
6
|
+
import { useG9LayerItem } from "../host/hooks.jsx";
|
|
7
|
+
import { cancelG9Drag, currentG9Drag, endG9Drag, moveG9Drag, registerG9DropTarget, startG9Drag, subscribeG9Drag } from "./drag-session.jsx";
|
|
8
|
+
import { g9MouseButton, g9PointerPoint } from "./point.jsx";
|
|
9
|
+
import "./pointer.css";
|
|
10
|
+
let seq = 0;
|
|
11
|
+
function useG9DragState() {
|
|
12
|
+
const [state, setState] = useState(currentG9Drag);
|
|
13
|
+
useEffect(()=>subscribeG9Drag(setState), []);
|
|
14
|
+
return state;
|
|
15
|
+
}
|
|
16
|
+
function useG9DragSource(options) {
|
|
17
|
+
var _options_threshold, _ref;
|
|
18
|
+
var _latest_current_renderPreview, _latest_current;
|
|
19
|
+
const key = useMemo(()=>`g9-drag-${++seq}`, []);
|
|
20
|
+
const previewId = `${key}-preview`;
|
|
21
|
+
const [active, setActive] = useState(null);
|
|
22
|
+
const press = useRef(null);
|
|
23
|
+
const running = useRef(false);
|
|
24
|
+
const lastPoint = useRef({
|
|
25
|
+
x: 0,
|
|
26
|
+
y: 0
|
|
27
|
+
});
|
|
28
|
+
const latest = useRef(options);
|
|
29
|
+
latest.current = options;
|
|
30
|
+
const threshold = null != (_options_threshold = options.threshold) ? _options_threshold : 4;
|
|
31
|
+
const place = (x, y)=>{
|
|
32
|
+
try {
|
|
33
|
+
lynx.createSelectorQuery().select(`#${previewId}`).setNativeProps({
|
|
34
|
+
transform: `translate(${Math.round(x + 12)}px, ${Math.round(y + 12)}px)`
|
|
35
|
+
}).exec();
|
|
36
|
+
} catch {}
|
|
37
|
+
};
|
|
38
|
+
const start = (x, y)=>{
|
|
39
|
+
var _o_onDragStart;
|
|
40
|
+
const o = latest.current;
|
|
41
|
+
const payload = 'function' == typeof o.payload ? o.payload() : o.payload;
|
|
42
|
+
running.current = true;
|
|
43
|
+
press.current = null;
|
|
44
|
+
lastPoint.current = {
|
|
45
|
+
x,
|
|
46
|
+
y
|
|
47
|
+
};
|
|
48
|
+
setActive(payload);
|
|
49
|
+
null == (_o_onDragStart = o.onDragStart) || _o_onDragStart.call(o, payload);
|
|
50
|
+
startG9Drag(payload, x, y);
|
|
51
|
+
};
|
|
52
|
+
const move = (e)=>{
|
|
53
|
+
const p = g9PointerPoint(e);
|
|
54
|
+
if (!p) return;
|
|
55
|
+
if (!running.current) {
|
|
56
|
+
const from = press.current;
|
|
57
|
+
if (from && Math.abs(p.x - from.x) + Math.abs(p.y - from.y) >= threshold) start(p.x, p.y);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
lastPoint.current = p;
|
|
61
|
+
moveG9Drag(p.x, p.y);
|
|
62
|
+
place(p.x, p.y);
|
|
63
|
+
};
|
|
64
|
+
const finish = (e, cancelled)=>{
|
|
65
|
+
var _ref;
|
|
66
|
+
var _latest_current_onDragEnd, _latest_current;
|
|
67
|
+
press.current = null;
|
|
68
|
+
if (!running.current) return;
|
|
69
|
+
running.current = false;
|
|
70
|
+
const p = null != (_ref = e && g9PointerPoint(e)) ? _ref : lastPoint.current;
|
|
71
|
+
const drop = cancelled ? (cancelG9Drag(), null) : endG9Drag(p.x, p.y);
|
|
72
|
+
setActive(null);
|
|
73
|
+
null == (_latest_current_onDragEnd = (_latest_current = latest.current).onDragEnd) || _latest_current_onDragEnd.call(_latest_current, drop);
|
|
74
|
+
};
|
|
75
|
+
useG9Keys((e)=>'Escape' === e.key ? (finish(null, true), true) : false, {
|
|
76
|
+
enabled: null !== active,
|
|
77
|
+
field: true
|
|
78
|
+
});
|
|
79
|
+
useEffect(()=>()=>{
|
|
80
|
+
if (running.current) cancelG9Drag();
|
|
81
|
+
}, []);
|
|
82
|
+
const preview = active ? null != (_ref = null == (_latest_current_renderPreview = (_latest_current = latest.current).renderPreview) ? void 0 : _latest_current_renderPreview.call(_latest_current, active)) ? _ref : <G9DragChip payload={active}/> : null;
|
|
83
|
+
const at = lastPoint.current;
|
|
84
|
+
const layer = active ? <view key={key} className="g9-drag-layer" bindmousemove={move} bindmouseup={(e)=>finish(e, false)} bindtouchmove={move} bindtouchend={(e)=>finish(e, false)} bindtouchcancel={()=>finish(null, true)}>
|
|
85
|
+
<view id={previewId} className="g9-drag-preview" style={{
|
|
86
|
+
transform: `translate(${Math.round(at.x + 12)}px, ${Math.round(at.y + 12)}px)`
|
|
87
|
+
}}>
|
|
88
|
+
{preview}
|
|
89
|
+
</view>
|
|
90
|
+
</view> : null;
|
|
91
|
+
useG9LayerItem('floating', key, layer, {
|
|
92
|
+
enabled: null !== active
|
|
93
|
+
});
|
|
94
|
+
if (false === options.enabled) return {
|
|
95
|
+
props: {},
|
|
96
|
+
dragging: false
|
|
97
|
+
};
|
|
98
|
+
return {
|
|
99
|
+
dragging: null !== active,
|
|
100
|
+
props: {
|
|
101
|
+
bindmousedown: (e)=>{
|
|
102
|
+
if (0 !== g9MouseButton(e)) return;
|
|
103
|
+
press.current = g9PointerPoint(e);
|
|
104
|
+
},
|
|
105
|
+
bindmousemove: move,
|
|
106
|
+
bindmouseup: (e)=>finish(e, false),
|
|
107
|
+
...false === options.longPress ? {} : {
|
|
108
|
+
bindlongpress: (e)=>{
|
|
109
|
+
const p = g9PointerPoint(e);
|
|
110
|
+
if (p) start(p.x, p.y);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
bindtouchmove: move,
|
|
114
|
+
bindtouchend: (e)=>finish(e, false),
|
|
115
|
+
bindtouchcancel: ()=>finish(null, true)
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function G9DragChip(props) {
|
|
120
|
+
var _props_payload_label;
|
|
121
|
+
return <view className="g9-drag-chip">
|
|
122
|
+
<text className="g9-drag-chip__text" text-maxline="1">
|
|
123
|
+
{null != (_props_payload_label = props.payload.label) ? _props_payload_label : props.payload.kind}
|
|
124
|
+
</text>
|
|
125
|
+
</view>;
|
|
126
|
+
}
|
|
127
|
+
function useG9DropTarget(options) {
|
|
128
|
+
const id = useMemo(()=>{
|
|
129
|
+
var _options_id;
|
|
130
|
+
return null != (_options_id = options.id) ? _options_id : `g9-drop-${++seq}`;
|
|
131
|
+
}, [
|
|
132
|
+
options.id
|
|
133
|
+
]);
|
|
134
|
+
const node = useRef(null);
|
|
135
|
+
const drop = useStableCallback(options.onDrop);
|
|
136
|
+
const enter = useStableCallback(options.onEnter);
|
|
137
|
+
const leave = useStableCallback(options.onLeave);
|
|
138
|
+
const latest = useRef(options);
|
|
139
|
+
latest.current = options;
|
|
140
|
+
const enabled = false !== options.enabled;
|
|
141
|
+
const [state, setState] = useState('idle');
|
|
142
|
+
useEffect(()=>{
|
|
143
|
+
if (!enabled) return;
|
|
144
|
+
const off = registerG9DropTarget({
|
|
145
|
+
id,
|
|
146
|
+
accepts: (p)=>latest.current.accepts ? latest.current.accepts(p) : true,
|
|
147
|
+
measure: ()=>measureNode(node.current),
|
|
148
|
+
onEnter: (_o, p)=>enter(p),
|
|
149
|
+
onLeave: (p)=>leave(p),
|
|
150
|
+
onDrop: (e)=>drop(e)
|
|
151
|
+
});
|
|
152
|
+
const offState = subscribeG9Drag((s)=>{
|
|
153
|
+
var _s_over;
|
|
154
|
+
return setState(s ? (null == (_s_over = s.over) ? void 0 : _s_over.target) === id ? 'over' : s.candidates.includes(id) ? 'candidate' : 'idle' : 'idle');
|
|
155
|
+
});
|
|
156
|
+
return ()=>{
|
|
157
|
+
off();
|
|
158
|
+
offState();
|
|
159
|
+
setState('idle');
|
|
160
|
+
};
|
|
161
|
+
}, [
|
|
162
|
+
id,
|
|
163
|
+
enabled
|
|
164
|
+
]);
|
|
165
|
+
return {
|
|
166
|
+
ref: (n)=>{
|
|
167
|
+
node.current = n;
|
|
168
|
+
},
|
|
169
|
+
state
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function G9DragSource(props) {
|
|
173
|
+
const { props: bind, dragging } = useG9DragSource(props);
|
|
174
|
+
return <view {...g9IdProps(props.id)} className={`g9-drag-source${dragging ? ' g9-drag-source--dragging' : ''}${props.className ? ` ${props.className}` : ''}`} {...bind}>
|
|
175
|
+
{props.children}
|
|
176
|
+
</view>;
|
|
177
|
+
}
|
|
178
|
+
function G9DropTarget(props) {
|
|
179
|
+
const { ref, state } = useG9DropTarget(props);
|
|
180
|
+
return <view {...props.id ? {
|
|
181
|
+
id: g9SafeId(props.id)
|
|
182
|
+
} : {}} ref={ref} className={`g9-drop-target g9-drop-target--${state}${props.className ? ` ${props.className}` : ''}`}>
|
|
183
|
+
{'function' == typeof props.children ? props.children(state) : props.children}
|
|
184
|
+
</view>;
|
|
185
|
+
}
|
|
186
|
+
export { G9DragChip, G9DragSource, G9DropTarget, useG9DragSource, useG9DragState, useG9DropTarget };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { G9DragChip, G9DragSource, type G9DragSourceComponentProps, type G9DragSourceOptions, type G9DragSourceProps, G9DropTarget, type G9DropTargetOptions, type G9DropTargetProps, type G9DropTargetState, useG9DragSource, useG9DragState, useG9DropTarget, } from './drag.js';
|
|
2
|
+
export { cancelG9Drag, currentG9Drag, endG9Drag, type G9DragPayload, type G9DragState, type G9DropEvent, type G9DropOver, type G9DropTargetSpec, hitDropTarget, moveG9Drag, registerG9DropTarget, startG9Drag, subscribeG9Drag, } from './drag-session.js';
|
|
3
|
+
export { type G9Point, type G9PointerEventLike, g9MouseButton, g9PointerPoint, isSecondaryPress } from './point.js';
|
|
4
|
+
export { type G9LynxKeyEventLike, type G9SecondaryAction, type G9SecondaryActionOptions, type G9SecondaryActionProps, type G9SecondarySource, keyEventOf, useG9SecondaryAction, } from './secondary.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pointer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,eAAe,EACf,cAAc,EACd,eAAe,GAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,UAAU,EACV,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { G9DragChip, G9DragSource, G9DropTarget, useG9DragSource, useG9DragState, useG9DropTarget } from "./drag.jsx";
|
|
2
|
+
export { cancelG9Drag, currentG9Drag, endG9Drag, hitDropTarget, moveG9Drag, registerG9DropTarget, startG9Drag, subscribeG9Drag } from "./drag-session.jsx";
|
|
3
|
+
export { g9MouseButton, g9PointerPoint, isSecondaryPress } from "./point.jsx";
|
|
4
|
+
export { keyEventOf, useG9SecondaryAction } from "./secondary.jsx";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** A point in the LynxView's space (dp). */
|
|
2
|
+
export interface G9Point {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
}
|
|
6
|
+
/** The fields of a Lynx pointer event this module reads. */
|
|
7
|
+
export interface G9PointerEventLike {
|
|
8
|
+
readonly detail?: {
|
|
9
|
+
readonly x?: number;
|
|
10
|
+
readonly y?: number;
|
|
11
|
+
readonly button?: number;
|
|
12
|
+
} | null;
|
|
13
|
+
readonly touches?: ReadonlyArray<{
|
|
14
|
+
readonly pageX?: number;
|
|
15
|
+
readonly pageY?: number;
|
|
16
|
+
readonly clientX?: number;
|
|
17
|
+
readonly clientY?: number;
|
|
18
|
+
}>;
|
|
19
|
+
readonly changedTouches?: ReadonlyArray<{
|
|
20
|
+
readonly pageX?: number;
|
|
21
|
+
readonly pageY?: number;
|
|
22
|
+
}>;
|
|
23
|
+
readonly x?: number;
|
|
24
|
+
readonly y?: number;
|
|
25
|
+
readonly pageX?: number;
|
|
26
|
+
readonly pageY?: number;
|
|
27
|
+
readonly button?: number;
|
|
28
|
+
readonly buttons?: number;
|
|
29
|
+
}
|
|
30
|
+
/** The event's point in the LynxView's space; `null` when the event carries none. */
|
|
31
|
+
export declare function g9PointerPoint(e: G9PointerEventLike | null | undefined): G9Point | null;
|
|
32
|
+
/** The mouse button of a press: 0 primary, 1 middle, 2 secondary (the right button). A touch is 0. */
|
|
33
|
+
export declare function g9MouseButton(e: G9PointerEventLike | null | undefined): number;
|
|
34
|
+
/** True for a secondary press (the right mouse button; Ctrl+click on a Mac arrives as one from the host). */
|
|
35
|
+
export declare function isSecondaryPress(e: G9PointerEventLike | null | undefined): boolean;
|
|
36
|
+
//# sourceMappingURL=point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/pointer/point.ts"],"names":[],"mappings":"AAKA,4CAA4C;AAC5C,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChG,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;QAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC,CAAC;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAQvF;AAED,sGAAsG;AACtG,wBAAgB,aAAa,CAAC,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAG9E;AAED,6GAA6G;AAC7G,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAElF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const finite = (v)=>'number' == typeof v && Number.isFinite(v);
|
|
2
|
+
function g9PointerPoint(e) {
|
|
3
|
+
var _ref;
|
|
4
|
+
var _e_touches, _e_changedTouches;
|
|
5
|
+
if (!e) return null;
|
|
6
|
+
const t = null != (_ref = null == (_e_touches = e.touches) ? void 0 : _e_touches[0]) ? _ref : null == (_e_changedTouches = e.changedTouches) ? void 0 : _e_changedTouches[0];
|
|
7
|
+
if (t && finite(t.pageX) && finite(t.pageY)) return {
|
|
8
|
+
x: t.pageX,
|
|
9
|
+
y: t.pageY
|
|
10
|
+
};
|
|
11
|
+
if (finite(e.pageX) && finite(e.pageY)) return {
|
|
12
|
+
x: e.pageX,
|
|
13
|
+
y: e.pageY
|
|
14
|
+
};
|
|
15
|
+
if (finite(e.x) && finite(e.y)) return {
|
|
16
|
+
x: e.x,
|
|
17
|
+
y: e.y
|
|
18
|
+
};
|
|
19
|
+
if (e.detail && finite(e.detail.x) && finite(e.detail.y)) return {
|
|
20
|
+
x: e.detail.x,
|
|
21
|
+
y: e.detail.y
|
|
22
|
+
};
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function g9MouseButton(e) {
|
|
26
|
+
var _ref;
|
|
27
|
+
var _e_detail;
|
|
28
|
+
const b = null != (_ref = null == e ? void 0 : e.button) ? _ref : null == e ? void 0 : null == (_e_detail = e.detail) ? void 0 : _e_detail.button;
|
|
29
|
+
return finite(b) ? b : 0;
|
|
30
|
+
}
|
|
31
|
+
function isSecondaryPress(e) {
|
|
32
|
+
return 2 === g9MouseButton(e);
|
|
33
|
+
}
|
|
34
|
+
export { g9MouseButton, g9PointerPoint, isSecondaryPress };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.g9-drag-layer {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.g9-drag-preview {
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
opacity: .92;
|
|
13
|
+
display: flex;
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.g9-drag-chip {
|
|
20
|
+
background-color: var(--g9-inverse-surface);
|
|
21
|
+
border-radius: 999px;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
align-items: center;
|
|
24
|
+
max-width: 280px;
|
|
25
|
+
padding: 6px 12px;
|
|
26
|
+
display: flex;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.g9-drag-chip__text {
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
font-family: var(--g9-font-text);
|
|
32
|
+
color: var(--g9-inverse-on-surface);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.g9-drag-source {
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.g9-drag-source--dragging {
|
|
41
|
+
opacity: .45;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.g9-drop-target {
|
|
45
|
+
border-radius: var(--g9-radius-card);
|
|
46
|
+
border: 2px solid #0000;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
display: flex;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.g9-drop-target--candidate {
|
|
52
|
+
border-style: dashed;
|
|
53
|
+
border-color: var(--g9-primary);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.g9-drop-target--over {
|
|
57
|
+
border-color: var(--g9-primary);
|
|
58
|
+
background-color: var(--g9-primary-container);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/*# sourceMappingURL=pointer.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://./src/pointer/pointer.css"],"names":[],"mappings":"AAEA;EADE,aAAa;EACb,eAAe;EACf,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE,oBAAoB;EACpB,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,OAAO;AACT;;AAIA;EADE,2CAA2C;EAC3C,oBAAoB;EACpB,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;AACf;;AAIA;EADE,eAAe;EACf,gCAAgC;EAChC,mCAAmC;AACrC;;AAIA;EADE,sBAAsB;EACtB,aAAa;AACf;;AAIA;EADE,YAAY;AACd;;AAIA;EADE,oCAAoC;EACpC,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;AACf;;AAMA;EAHE,oBAAoB;EACpB,+BAA+B;AACjC;;AAMA;EAHE,+BAA+B;EAC/B,6CAA6C;AAC/C","sourcesContent":["/* Drag and drop between regions (2.9.0): the layer that takes the pointer during a drag, the preview, the default chip,\n a source while it is dragged and a target's light. */\n.g9-drag-layer {\n position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n display: flex;\n}\n\n.g9-drag-preview {\n position: absolute;\n left: 0px;\n top: 0px;\n display: flex;\n pointer-events: none;\n opacity: 0.92;\n}\n\n.g9-drag-chip {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 6px 12px;\n border-radius: 999px;\n background-color: var(--g9-inverse-surface);\n max-width: 280px;\n}\n\n.g9-drag-chip__text {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-inverse-on-surface);\n}\n\n.g9-drag-source {\n display: flex;\n flex-direction: column;\n}\n\n.g9-drag-source--dragging {\n opacity: 0.45;\n}\n\n.g9-drop-target {\n display: flex;\n flex-direction: column;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n border-radius: var(--g9-radius-card);\n}\n\n.g9-drop-target--candidate {\n border-style: dashed;\n border-color: var(--g9-primary);\n}\n\n.g9-drop-target--over {\n border-color: var(--g9-primary);\n background-color: var(--g9-primary-container);\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type G9KeyEvent } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
import type { NodesRef } from '@lynx-js/types';
|
|
3
|
+
import type { G9AnchorRect } from '../anchor/registry.js';
|
|
4
|
+
import { type G9PointerEventLike } from './point.js';
|
|
5
|
+
/** How a secondary action was asked for. */
|
|
6
|
+
export type G9SecondarySource = 'mouse' | 'touch' | 'keyboard';
|
|
7
|
+
/** What a secondary action hands its handler. */
|
|
8
|
+
export interface G9SecondaryAction {
|
|
9
|
+
readonly source: G9SecondarySource;
|
|
10
|
+
/** Where to open: the pointer (a 0×0 rect) for a mouse or a long press with a point, else the element's rect. */
|
|
11
|
+
readonly anchor: G9AnchorRect;
|
|
12
|
+
}
|
|
13
|
+
/** Options of {@link useG9SecondaryAction}. */
|
|
14
|
+
export interface G9SecondaryActionOptions {
|
|
15
|
+
/** Default true. */
|
|
16
|
+
readonly enabled?: boolean;
|
|
17
|
+
/** A long press on touch opens it too. Default true. */
|
|
18
|
+
readonly longPress?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The context-menu key and Shift+F10 open it: `'focus'` (default) when the element has the keyboard focus (its own
|
|
21
|
+
* `keydown`), `'global'` whenever the hook is enabled (an app's selected item: one element at a time), `'off'`.
|
|
22
|
+
*/
|
|
23
|
+
readonly keyboard?: 'focus' | 'global' | 'off';
|
|
24
|
+
/** A light haptic when it opens from a long press. Default true. */
|
|
25
|
+
readonly haptic?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** The props {@link useG9SecondaryAction} puts on the element. */
|
|
28
|
+
export interface G9SecondaryActionProps {
|
|
29
|
+
readonly ref: (node: NodesRef | null) => void;
|
|
30
|
+
readonly bindmousedown?: (e: G9PointerEventLike) => void;
|
|
31
|
+
readonly bindlongpress?: (e: G9PointerEventLike) => void;
|
|
32
|
+
readonly bindkeydown?: (e: G9LynxKeyEventLike) => void;
|
|
33
|
+
}
|
|
34
|
+
/** A Lynx `keydown` event as the desktop engine sends it. */
|
|
35
|
+
export interface G9LynxKeyEventLike {
|
|
36
|
+
readonly key?: string;
|
|
37
|
+
readonly shiftKey?: boolean;
|
|
38
|
+
readonly ctrlKey?: boolean;
|
|
39
|
+
readonly altKey?: boolean;
|
|
40
|
+
readonly metaKey?: boolean;
|
|
41
|
+
readonly detail?: {
|
|
42
|
+
readonly key?: string;
|
|
43
|
+
readonly shiftKey?: boolean;
|
|
44
|
+
} | null;
|
|
45
|
+
}
|
|
46
|
+
/** A Lynx `keydown` event as a `G9KeyEvent` (null without a key). */
|
|
47
|
+
export declare function keyEventOf(e: G9LynxKeyEventLike | null | undefined): G9KeyEvent | null;
|
|
48
|
+
/**
|
|
49
|
+
* Gives an element its secondary action: spread the returned props on it (`<view {...props}>`). `onAction` hears the
|
|
50
|
+
* source and where to open (`G9Menu`'s `anchorRect`). The right button opens on press, as on every desktop; the primary
|
|
51
|
+
* button and a tap are left to the element.
|
|
52
|
+
*/
|
|
53
|
+
export declare function useG9SecondaryAction(onAction: (action: G9SecondaryAction) => void, options?: G9SecondaryActionOptions): G9SecondaryActionProps;
|
|
54
|
+
//# sourceMappingURL=secondary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondary.d.ts","sourceRoot":"","sources":["../../src/pointer/secondary.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,+BAA+B,CAAC;AAE5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAE,KAAK,kBAAkB,EAAoC,MAAM,SAAS,CAAC;AAEpF,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/D,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,iHAAiH;IACjH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAED,+CAA+C;AAC/C,MAAM,WAAW,wBAAwB;IACvC,oBAAoB;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC/C,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACxD;AAED,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACjF;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAUtF;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,EAC7C,OAAO,GAAE,wBAA6B,GACrC,sBAAsB,CAgDxB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { g9Haptic, isContextMenuKey } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { useRef } from "@lynx-js/react";
|
|
3
|
+
import { measureNode } from "../anchor/measure.jsx";
|
|
4
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
5
|
+
import { useG9Keys } from "../commands/keys.jsx";
|
|
6
|
+
import { g9PointerPoint, isSecondaryPress } from "./point.jsx";
|
|
7
|
+
function keyEventOf(e) {
|
|
8
|
+
var _ref;
|
|
9
|
+
var _e_detail, _e_detail1;
|
|
10
|
+
const key = null != (_ref = null == e ? void 0 : e.key) ? _ref : null == e ? void 0 : null == (_e_detail = e.detail) ? void 0 : _e_detail.key;
|
|
11
|
+
if ('string' != typeof key || !key) return null;
|
|
12
|
+
return {
|
|
13
|
+
key,
|
|
14
|
+
...(null == e ? void 0 : e.shiftKey) || (null == e ? void 0 : null == (_e_detail1 = e.detail) ? void 0 : _e_detail1.shiftKey) ? {
|
|
15
|
+
shift: true
|
|
16
|
+
} : {},
|
|
17
|
+
...(null == e ? void 0 : e.ctrlKey) ? {
|
|
18
|
+
ctrl: true
|
|
19
|
+
} : {},
|
|
20
|
+
...(null == e ? void 0 : e.altKey) ? {
|
|
21
|
+
alt: true
|
|
22
|
+
} : {},
|
|
23
|
+
...(null == e ? void 0 : e.metaKey) ? {
|
|
24
|
+
meta: true
|
|
25
|
+
} : {}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const pointRect = (x, y)=>({
|
|
29
|
+
x,
|
|
30
|
+
y,
|
|
31
|
+
width: 0,
|
|
32
|
+
height: 0
|
|
33
|
+
});
|
|
34
|
+
function useG9SecondaryAction(onAction, options = {}) {
|
|
35
|
+
var _options_enabled, _options_keyboard;
|
|
36
|
+
const node = useRef(null);
|
|
37
|
+
const run = useStableCallback(onAction);
|
|
38
|
+
const enabled = null != (_options_enabled = options.enabled) ? _options_enabled : true;
|
|
39
|
+
const keyboard = null != (_options_keyboard = options.keyboard) ? _options_keyboard : 'focus';
|
|
40
|
+
const fromElement = (source)=>{
|
|
41
|
+
measureNode(node.current).then((r)=>{
|
|
42
|
+
if (r) run({
|
|
43
|
+
source,
|
|
44
|
+
anchor: r
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
useG9Keys((e)=>{
|
|
49
|
+
if (!isContextMenuKey(e)) return false;
|
|
50
|
+
fromElement('keyboard');
|
|
51
|
+
return true;
|
|
52
|
+
}, {
|
|
53
|
+
enabled: enabled && 'global' === keyboard
|
|
54
|
+
});
|
|
55
|
+
const ref = (n)=>{
|
|
56
|
+
node.current = n;
|
|
57
|
+
};
|
|
58
|
+
if (!enabled) return {
|
|
59
|
+
ref
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
ref,
|
|
63
|
+
bindmousedown: (e)=>{
|
|
64
|
+
if (!isSecondaryPress(e)) return;
|
|
65
|
+
const p = g9PointerPoint(e);
|
|
66
|
+
if (p) run({
|
|
67
|
+
source: 'mouse',
|
|
68
|
+
anchor: pointRect(p.x, p.y)
|
|
69
|
+
});
|
|
70
|
+
else fromElement('mouse');
|
|
71
|
+
},
|
|
72
|
+
...false === options.longPress ? {} : {
|
|
73
|
+
bindlongpress: ()=>{
|
|
74
|
+
if (false !== options.haptic) g9Haptic('impact');
|
|
75
|
+
fromElement('touch');
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
...'focus' === keyboard ? {
|
|
79
|
+
bindkeydown: (e)=>{
|
|
80
|
+
const k = keyEventOf(e);
|
|
81
|
+
if (k && isContextMenuKey(k)) fromElement('keyboard');
|
|
82
|
+
}
|
|
83
|
+
} : {}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export { keyEventOf, useG9SecondaryAction };
|
|
@@ -4,6 +4,7 @@ import type { NodesRef } from '@lynx-js/types';
|
|
|
4
4
|
import type { G9AnchorRect } from '../anchor/registry.js';
|
|
5
5
|
import { type G9StyleProp } from '../base/control.js';
|
|
6
6
|
import { type G9IconInput } from '../icon/icon.js';
|
|
7
|
+
import { type G9SecondarySource } from '../pointer/secondary.js';
|
|
7
8
|
import { type G9Placement } from './position.js';
|
|
8
9
|
/** An open popover-like overlay, as automation sees it (G9AppPilot's layer model: `popup` layer). */
|
|
9
10
|
export interface G9OpenPopover {
|
|
@@ -124,6 +125,15 @@ export interface G9MenuProps extends Omit<G9PopoverProps, 'children' | 'kind'> {
|
|
|
124
125
|
readonly mode?: 'auto' | 'popover' | 'sheet';
|
|
125
126
|
/** Cancel row text of the action sheet. */
|
|
126
127
|
readonly cancelText?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Opens at this point of the LynxView (2.9.0): where a right click happened (`useG9SecondaryAction`). Wins over
|
|
130
|
+
* `anchorId` / `anchorNode` / `anchorRect`, and a menu at a point is always the popover form (a pointer means a
|
|
131
|
+
* desktop or a mouse) unless `mode` is `'sheet'`.
|
|
132
|
+
*/
|
|
133
|
+
readonly anchorPoint?: {
|
|
134
|
+
readonly x: number;
|
|
135
|
+
readonly y: number;
|
|
136
|
+
};
|
|
127
137
|
}
|
|
128
138
|
/** A menu (G9Hub Menu): a popover by the anchor on wide windows, an action sheet from the bottom on phones. */
|
|
129
139
|
export declare function G9Menu(props: G9MenuProps): ReactNode;
|
|
@@ -147,10 +157,24 @@ export interface G9ContextMenuProps {
|
|
|
147
157
|
readonly onSelect: (key: string) => void;
|
|
148
158
|
readonly title?: string;
|
|
149
159
|
readonly disabled?: boolean;
|
|
150
|
-
|
|
160
|
+
/** Told how it opened (2.9.0): `'touch'` (a long press), `'mouse'` (the right button) or `'keyboard'`. */
|
|
161
|
+
readonly onOpen?: (source: G9SecondarySource) => void;
|
|
162
|
+
/** The right mouse button opens it at the pointer (desktop, the web). Default true. */
|
|
163
|
+
readonly secondaryClick?: boolean;
|
|
164
|
+
/** A long press opens it on touch. Default true. */
|
|
165
|
+
readonly longPress?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* The context-menu key and Shift+F10: `'focus'` (default) when the child has the keyboard focus, `'global'` while
|
|
168
|
+
* mounted (the app's selected item), `'off'`.
|
|
169
|
+
*/
|
|
170
|
+
readonly keyboard?: 'focus' | 'global' | 'off';
|
|
151
171
|
readonly id?: string;
|
|
152
172
|
readonly children?: ReactNode;
|
|
153
173
|
}
|
|
154
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* A context menu on its child (G9Hub ContextMenu, a message, a row): a long press on touch (a light haptic, the menu by
|
|
176
|
+
* the child), the right mouse button on a desktop (the menu at the pointer, 2.9.0) and the context-menu key or
|
|
177
|
+
* Shift+F10 (the menu by the child).
|
|
178
|
+
*/
|
|
155
179
|
export declare function G9ContextMenu(props: G9ContextMenuProps): ReactNode;
|
|
156
180
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAQ,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAC5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,iBAAiB,CAAC;AAIrF,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAQ,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAC5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,iBAAiB,CAAC;AAIrF,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAItE,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