@g9tm/lynxcontrols 2.8.3 → 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 +1129 -69
- 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/fields/editor.d.ts +7 -0
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +3 -1
- package/dist/fields/index.d.ts +1 -0
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -0
- package/dist/fields/line-direction.d.ts +13 -0
- package/dist/fields/line-direction.d.ts.map +1 -0
- package/dist/fields/line-direction.jsx +15 -0
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +3 -1
- 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/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/settings.d.ts +11 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +3 -2
- 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/media-photo-editor.md +3 -3
- 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
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { dispatchG9Key, type G9KeyDeliver, registerG9KeySource, useG9KeySequence, useG9Keys, useG9Shortcut, } from './keys.js';
|
|
1
|
+
export { dispatchG9Key, type G9KeyDeliver, type G9ShortcutsOptions, g9HeldModifiers, g9KeyPlatform, noteG9ModifierKey, registerG9KeySource, setG9HeldModifiers, useG9KeySequence, useG9Keys, useG9Shortcut, useG9Shortcuts, } from './keys.js';
|
|
2
2
|
export { type G9Command, type G9CommandAbortSignal, type G9CommandGroup, G9CommandPalette, type G9CommandPaletteProps, type G9CommandProvider, type G9ShortcutGroup, type G9ShortcutItem, G9ShortcutList, type G9ShortcutListProps, G9ShortcutsSheet, type G9ShortcutsSheetProps, paletteResults, rankCommands, } from './palette.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,EACT,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,cAAc,GACf,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,mBAAmB,EACxB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,cAAc,EACd,YAAY,GACb,MAAM,WAAW,CAAC"}
|
package/dist/commands/index.jsx
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { dispatchG9Key, registerG9KeySource, useG9KeySequence, useG9Keys, useG9Shortcut } from "./keys.jsx";
|
|
1
|
+
export { dispatchG9Key, g9HeldModifiers, g9KeyPlatform, noteG9ModifierKey, registerG9KeySource, setG9HeldModifiers, useG9KeySequence, useG9Keys, useG9Shortcut, useG9Shortcuts } from "./keys.jsx";
|
|
2
2
|
export { G9CommandPalette, G9ShortcutList, G9ShortcutsSheet, paletteResults, rankCommands } from "./palette.jsx";
|
package/dist/commands/keys.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type G9KeyEvent } from '@g9tm/lynxcontrols-foundation';
|
|
1
|
+
import { type G9HeldModifiers, type G9KeyEvent } from '@g9tm/lynxcontrols-foundation';
|
|
2
2
|
/**
|
|
3
3
|
* What a key source hands the library: the raw key (a `G9KeyEvent`-shaped object or a key name) and whether it came
|
|
4
4
|
* from inside a text field. Answers whether a handler took it (the host then stops the native default).
|
|
@@ -10,6 +10,15 @@ export type G9KeyDeliver = (raw: unknown, field?: boolean) => boolean;
|
|
|
10
10
|
* `useG9Keys` / `useG9Shortcut` hears them. `connect(deliver)` returns its disconnect; the returned function removes it.
|
|
11
11
|
*/
|
|
12
12
|
export declare function registerG9KeySource(connect: (deliver: G9KeyDeliver) => (() => void) | void): () => void;
|
|
13
|
+
/**
|
|
14
|
+
* The modifier keys held now (2.9.0): what the host last said (`g9modifiers`, or a key capture's keydown / keyup) and the
|
|
15
|
+
* flags of the last key. Lynx pointer events carry no modifier flags; Shift+click and Ctrl+click read this.
|
|
16
|
+
*/
|
|
17
|
+
export declare function g9HeldModifiers(): G9HeldModifiers;
|
|
18
|
+
/** Sets the held modifiers (a host bridge, `G9KeyCapture`, tests); a partial update keeps the others, null clears all. */
|
|
19
|
+
export declare function setG9HeldModifiers(next: Partial<G9HeldModifiers> | null): void;
|
|
20
|
+
/** A modifier key itself went down or up (`'Shift'`, `'Control'`, `'Alt'`, `'Meta'`); false for any other key. */
|
|
21
|
+
export declare function noteG9ModifierKey(key: string, down: boolean): boolean;
|
|
13
22
|
/**
|
|
14
23
|
* Delivers a key to the handler stack (exported for hosts that call it directly, and for tests). Answers whether a
|
|
15
24
|
* handler took it.
|
|
@@ -33,4 +42,26 @@ export declare function useG9Shortcut(combo: string | readonly string[], action:
|
|
|
33
42
|
export declare function useG9KeySequence(sequences: readonly string[], onMatch: (sequence: string) => void, options?: {
|
|
34
43
|
readonly enabled?: boolean;
|
|
35
44
|
}): void;
|
|
45
|
+
/** Options of {@link useG9Shortcuts}. */
|
|
46
|
+
export interface G9ShortcutsOptions {
|
|
47
|
+
/** Default true. */
|
|
48
|
+
readonly enabled?: boolean;
|
|
49
|
+
/** `'mac'` maps Mod to ⌘; default: the platform the app runs on (`SystemInfo.platform`). */
|
|
50
|
+
readonly platform?: 'mac' | 'other';
|
|
51
|
+
/**
|
|
52
|
+
* The combos that also fire while a text field has the focus (`['Esc', 'Mod+K']`). Default none: a focused field keeps
|
|
53
|
+
* its own keys (Delete, Ctrl+Z, the arrows), as a desktop app does.
|
|
54
|
+
*/
|
|
55
|
+
readonly inFields?: readonly string[];
|
|
56
|
+
/** Fire while the key repeats (held down). Default false. */
|
|
57
|
+
readonly repeat?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** The platform for Mod (⌘ on macOS, Ctrl elsewhere), from `SystemInfo.platform`. */
|
|
60
|
+
export declare function g9KeyPlatform(): 'mac' | 'other';
|
|
61
|
+
/**
|
|
62
|
+
* A desktop app's shortcuts in one map (2.9.0, G9ProxyManager): `{ 'Mod+K': openPalette, 'Mod+1': goHome, 'Delete':
|
|
63
|
+
* removeSelected, 'Esc': clear, 'Mod+Alt+F': find }`. The first combo that matches runs and the key stops there. A key
|
|
64
|
+
* typed in a text field reaches only the combos listed in `inFields`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function useG9Shortcuts(map: Readonly<Record<string, (e: G9KeyEvent) => void>>, options?: G9ShortcutsOptions): void;
|
|
36
67
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,UAAU,EAMhB,MAAM,+BAA+B,CAAC;AA6BvC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,IAAI,CAYvG;AAKD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,eAAe,CAEjD;AAED,0HAA0H;AAC1H,wBAAgB,kBAAkB,CAAC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AAO,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qFAAqF;AACrF,wBAAgB,aAAa,IAAI,KAAK,GAAG,OAAO,CAG/C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC,CAAC,EACtD,OAAO,GAAE,kBAAuB,GAC/B,IAAI,CAyBN"}
|
package/dist/commands/keys.jsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { createSequenceMatcher, g9FieldKeyEventName, g9KeyEventName, matchesCombo } from "@g9tm/lynxcontrols-foundation";
|
|
1
|
+
import { createSequenceMatcher, g9FieldKeyEventName, g9KeyEventName, g9ModifiersEventName, matchesCombo, parseCombo } from "@g9tm/lynxcontrols-foundation";
|
|
2
2
|
import { useEffect, useMemo, useRef } from "@lynx-js/react";
|
|
3
3
|
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
4
4
|
import { addGlobalListener } from "../provider/global-events.jsx";
|
|
5
5
|
const stack = [];
|
|
6
6
|
let uninstall = null;
|
|
7
|
-
function normalize(
|
|
7
|
+
function normalize(input, field) {
|
|
8
|
+
const raw = Array.isArray(input) && 1 === input.length ? input[0] : input;
|
|
8
9
|
if (!raw || 'object' != typeof raw) return 'string' == typeof raw ? {
|
|
9
10
|
key: raw,
|
|
10
11
|
field
|
|
@@ -52,7 +53,43 @@ function registerG9KeySource(connect) {
|
|
|
52
53
|
if ('function' == typeof off) off();
|
|
53
54
|
};
|
|
54
55
|
}
|
|
56
|
+
const NONE = Object.freeze({
|
|
57
|
+
shift: false,
|
|
58
|
+
ctrl: false,
|
|
59
|
+
alt: false,
|
|
60
|
+
meta: false
|
|
61
|
+
});
|
|
62
|
+
let held = NONE;
|
|
63
|
+
function g9HeldModifiers() {
|
|
64
|
+
return held;
|
|
65
|
+
}
|
|
66
|
+
function setG9HeldModifiers(next) {
|
|
67
|
+
held = next ? {
|
|
68
|
+
...held,
|
|
69
|
+
...next
|
|
70
|
+
} : NONE;
|
|
71
|
+
}
|
|
72
|
+
const MODIFIER_KEYS = {
|
|
73
|
+
Shift: 'shift',
|
|
74
|
+
Control: 'ctrl',
|
|
75
|
+
Alt: 'alt',
|
|
76
|
+
Meta: 'meta'
|
|
77
|
+
};
|
|
78
|
+
function noteG9ModifierKey(key, down) {
|
|
79
|
+
const name = MODIFIER_KEYS[key];
|
|
80
|
+
if (!name) return false;
|
|
81
|
+
setG9HeldModifiers({
|
|
82
|
+
[name]: down
|
|
83
|
+
});
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
55
86
|
function dispatchG9Key(event) {
|
|
87
|
+
held = {
|
|
88
|
+
shift: true === event.shift,
|
|
89
|
+
ctrl: true === event.ctrl,
|
|
90
|
+
alt: true === event.alt,
|
|
91
|
+
meta: true === event.meta
|
|
92
|
+
};
|
|
56
93
|
for(let i = stack.length - 1; i >= 0; i--){
|
|
57
94
|
const h = stack[i];
|
|
58
95
|
if (!event.field || h.field) try {
|
|
@@ -71,9 +108,19 @@ function install() {
|
|
|
71
108
|
const e = normalize(raw, true);
|
|
72
109
|
if (e) dispatchG9Key(e);
|
|
73
110
|
});
|
|
111
|
+
const offModifiers = addGlobalListener(g9ModifiersEventName, (raw)=>{
|
|
112
|
+
const m = Array.isArray(raw) && 1 === raw.length ? raw[0] : raw;
|
|
113
|
+
setG9HeldModifiers(m && 'object' == typeof m ? {
|
|
114
|
+
shift: true === m.shift,
|
|
115
|
+
ctrl: true === m.ctrl,
|
|
116
|
+
alt: true === m.alt,
|
|
117
|
+
meta: true === m.meta
|
|
118
|
+
} : null);
|
|
119
|
+
});
|
|
74
120
|
uninstall = ()=>{
|
|
75
121
|
offKey();
|
|
76
122
|
offField();
|
|
123
|
+
offModifiers();
|
|
77
124
|
};
|
|
78
125
|
}
|
|
79
126
|
function useG9Keys(handler, options = {}) {
|
|
@@ -135,4 +182,46 @@ function useG9KeySequence(sequences, onMatch, options = {}) {
|
|
|
135
182
|
enabled: options.enabled
|
|
136
183
|
} : {});
|
|
137
184
|
}
|
|
138
|
-
|
|
185
|
+
function g9KeyPlatform() {
|
|
186
|
+
var _ref;
|
|
187
|
+
var _globalThis_SystemInfo;
|
|
188
|
+
const p = (null != (_ref = null == (_globalThis_SystemInfo = globalThis.SystemInfo) ? void 0 : _globalThis_SystemInfo.platform) ? _ref : '').toLowerCase();
|
|
189
|
+
return 'macos' === p || 'mac' === p || 'osx' === p || 'ios' === p ? 'mac' : 'other';
|
|
190
|
+
}
|
|
191
|
+
function useG9Shortcuts(map, options = {}) {
|
|
192
|
+
var _options_inFields, _options_platform;
|
|
193
|
+
const latest = useRef(map);
|
|
194
|
+
latest.current = map;
|
|
195
|
+
const parsed = useMemo(()=>Object.keys(map).map((combo)=>({
|
|
196
|
+
combo,
|
|
197
|
+
parsed: parseCombo(combo)
|
|
198
|
+
})), [
|
|
199
|
+
Object.keys(map).join('\n')
|
|
200
|
+
]);
|
|
201
|
+
const inFields = useMemo(()=>{
|
|
202
|
+
var _options_inFields;
|
|
203
|
+
return (null != (_options_inFields = options.inFields) ? _options_inFields : []).map((c)=>parseCombo(c));
|
|
204
|
+
}, [
|
|
205
|
+
(null != (_options_inFields = options.inFields) ? _options_inFields : []).join('\n')
|
|
206
|
+
]);
|
|
207
|
+
const platform = null != (_options_platform = options.platform) ? _options_platform : g9KeyPlatform();
|
|
208
|
+
useG9Keys((e)=>{
|
|
209
|
+
if (e.repeat && !options.repeat) return false;
|
|
210
|
+
for (const { combo, parsed: c } of parsed){
|
|
211
|
+
var _latest_current_combo, _latest_current;
|
|
212
|
+
if (matchesCombo(e, c, platform)) {
|
|
213
|
+
if (!e.field || inFields.some((f)=>matchesCombo(e, f, platform))) {
|
|
214
|
+
null == (_latest_current_combo = (_latest_current = latest.current)[combo]) || _latest_current_combo.call(_latest_current, e);
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return false;
|
|
220
|
+
}, {
|
|
221
|
+
...void 0 !== options.enabled ? {
|
|
222
|
+
enabled: options.enabled
|
|
223
|
+
} : {},
|
|
224
|
+
field: inFields.length > 0
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
export { dispatchG9Key, g9HeldModifiers, g9KeyPlatform, noteG9ModifierKey, registerG9KeySource, setG9HeldModifiers, useG9KeySequence, useG9Keys, useG9Shortcut, useG9Shortcuts };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/desktop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from '@lynx-js/react';
|
|
2
|
+
import { type G9LynxKeyEventLike } from '../pointer/secondary.js';
|
|
3
|
+
/** The fields of a key event's target the capture reads to tell a text field. */
|
|
4
|
+
interface TargetLike {
|
|
5
|
+
readonly dataset?: Readonly<Record<string, unknown>>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* True when the key came from inside a text field: the target carries the library's keyboard-target mark
|
|
9
|
+
* (`g9KeyboardTargetProps`, on every G9 field's input), the mark the host's keyboard dismiss already reads.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isFieldKeyEvent(e: {
|
|
12
|
+
readonly target?: TargetLike | null;
|
|
13
|
+
} | null | undefined): boolean;
|
|
14
|
+
/** Delivers one Lynx `keydown` to the page's key handlers; answers whether one took it. */
|
|
15
|
+
export declare function deliverLynxKey(e: (G9LynxKeyEventLike & {
|
|
16
|
+
readonly target?: TargetLike | null;
|
|
17
|
+
}) | null | undefined): boolean;
|
|
18
|
+
/** Props of {@link G9KeyCapture}. */
|
|
19
|
+
export interface G9KeyCaptureProps {
|
|
20
|
+
readonly className?: string;
|
|
21
|
+
readonly children?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** Hears the keys pressed anywhere inside (desktop: Lynxtron) and hands them to the page's key handlers. */
|
|
24
|
+
export declare function G9KeyCapture(props: G9KeyCaptureProps): ReactNode;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/desktop/keys.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,KAAK,kBAAkB,EAAc,MAAM,sBAAsB,CAAC;AAE3E,iFAAiF;AACjF,UAAU,UAAU;IAClB,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACtD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEtG;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAC5B,CAAC,EAAE,CAAC,kBAAkB,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;CAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GACnF,OAAO,CAKT;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,4GAA4G;AAC5G,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAchE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { dispatchG9Key, noteG9ModifierKey } from "../commands/keys.jsx";
|
|
2
|
+
import { isKeyboardTarget } from "../host/keyboard.jsx";
|
|
3
|
+
import { keyEventOf } from "../pointer/secondary.jsx";
|
|
4
|
+
function isFieldKeyEvent(e) {
|
|
5
|
+
return isKeyboardTarget(null == e ? void 0 : e.target);
|
|
6
|
+
}
|
|
7
|
+
function deliverLynxKey(e) {
|
|
8
|
+
const k = keyEventOf(e);
|
|
9
|
+
if (!k) return false;
|
|
10
|
+
if (noteG9ModifierKey(k.key, true)) return false;
|
|
11
|
+
return dispatchG9Key(isFieldKeyEvent(e) ? {
|
|
12
|
+
...k,
|
|
13
|
+
field: true
|
|
14
|
+
} : k);
|
|
15
|
+
}
|
|
16
|
+
function G9KeyCapture(props) {
|
|
17
|
+
return <view className={`g9-key-capture${props.className ? ` ${props.className}` : ''}`} style={{
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
flexGrow: 1,
|
|
21
|
+
flexShrink: 1,
|
|
22
|
+
flexBasis: '0px'
|
|
23
|
+
}} bindkeydown={(e)=>void deliverLynxKey(e)} bindkeyup={(e)=>{
|
|
24
|
+
const k = keyEventOf(e);
|
|
25
|
+
if (k) noteG9ModifierKey(k.key, false);
|
|
26
|
+
}}>
|
|
27
|
+
{props.children}
|
|
28
|
+
</view>;
|
|
29
|
+
}
|
|
30
|
+
export { G9KeyCapture, deliverLynxKey, isFieldKeyEvent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type G9CloseRequestHandler, type G9WindowControl, type G9WindowEvent } from '@g9tm/lynxcontrols-foundation';
|
|
2
|
+
/** The app's window: the provider's `window` service, or an unavailable control (`available: false`). */
|
|
3
|
+
export declare function useG9WindowControl(): G9WindowControl;
|
|
4
|
+
/**
|
|
5
|
+
* Hears the window's events (`'focus'`, `'minimize'`, the main process's messages such as the tray's «show») while
|
|
6
|
+
* mounted. Nothing is subscribed on a host without a window (`available: false`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function useG9WindowEvent(listener: (event: G9WindowEvent) => void, options?: {
|
|
9
|
+
readonly enabled?: boolean;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Takes part in the window's close requests while mounted (close to the tray, an unsaved-work question): answer
|
|
13
|
+
* `'cancel'` to keep the window. Nothing is registered on a host without a window.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useG9CloseRequest(handler: G9CloseRequestHandler, options?: {
|
|
16
|
+
readonly enabled?: boolean;
|
|
17
|
+
}): void;
|
|
18
|
+
//# sourceMappingURL=window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/desktop/window.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AASvC,yGAAyG;AACzG,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,EACxC,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,IAAI,CAKN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,IAAI,CAKpH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createUnavailableWindowControl } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { useEffect } from "@lynx-js/react";
|
|
3
|
+
import { useStableCallback } from "../base/use-stable-callback.jsx";
|
|
4
|
+
import { useG9OptionalService } from "../provider/hooks.jsx";
|
|
5
|
+
const unavailable = createUnavailableWindowControl('No window service: hand G9Provider services.window (createLynxtronWindowControl on Lynxtron).');
|
|
6
|
+
function useG9WindowControl() {
|
|
7
|
+
var _useG9OptionalService;
|
|
8
|
+
return null != (_useG9OptionalService = useG9OptionalService('window')) ? _useG9OptionalService : unavailable;
|
|
9
|
+
}
|
|
10
|
+
function useG9WindowEvent(listener, options = {}) {
|
|
11
|
+
const control = useG9WindowControl();
|
|
12
|
+
const run = useStableCallback(listener);
|
|
13
|
+
const enabled = false !== options.enabled;
|
|
14
|
+
useEffect(()=>enabled && control.available ? control.subscribe((e)=>run(e)) : void 0, [
|
|
15
|
+
control,
|
|
16
|
+
enabled
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
function useG9CloseRequest(handler, options = {}) {
|
|
20
|
+
const control = useG9WindowControl();
|
|
21
|
+
const run = useStableCallback(handler);
|
|
22
|
+
const enabled = false !== options.enabled;
|
|
23
|
+
useEffect(()=>enabled && control.available ? control.onCloseRequest(()=>run()) : void 0, [
|
|
24
|
+
control,
|
|
25
|
+
enabled
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
export { useG9CloseRequest, useG9WindowControl, useG9WindowEvent };
|
package/dist/fields/editor.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { G9LineDirection } from '../provider/settings.js';
|
|
1
2
|
import { type G9TextInputHandle, type G9TextInputProps } from './use-text-input.js';
|
|
2
3
|
/** How the editor grows (MAUI `EditorAutoSizeOption`). */
|
|
3
4
|
export type G9EditorAutoSize = 'disabled' | 'textChanges';
|
|
@@ -13,6 +14,12 @@ export interface G9EditorProps extends G9TextInputProps {
|
|
|
13
14
|
readonly isSpellCheckEnabled?: boolean;
|
|
14
15
|
/** Word prediction / autocorrect (iOS `ios-auto-correct`). Default true. */
|
|
15
16
|
readonly isTextPredictionEnabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* How each line takes its direction: `'majority'` from most of its letters (a Persian line right-to-left, an English
|
|
19
|
+
* one left-to-right, in the same box), `'native'` from its first strong letter (Android and iOS). Default the app's
|
|
20
|
+
* `settings.fields.lineDirection` (itself `'native'` by default); this field's own value wins either way.
|
|
21
|
+
*/
|
|
22
|
+
readonly lineDirection?: G9LineDirection;
|
|
16
23
|
}
|
|
17
24
|
/** Imperative handle of {@link G9Editor}. */
|
|
18
25
|
export type G9EditorHandle = G9TextInputHandle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/fields/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/fields/editor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AAE/F,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE1D,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,mDAAmD;IACnD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;CAC1C;AAKD,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,6GA+DnB,CAAC"}
|
package/dist/fields/editor.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { G9Metrics } from "@g9tm/lynxcontrols-foundation";
|
|
2
2
|
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
3
3
|
import { useG9Settings } from "../provider/hooks.jsx";
|
|
4
|
+
import { useG9LineDirectionProps } from "./line-direction.jsx";
|
|
4
5
|
import { G9OutlinedField, resolveInnerHint } from "./outlined-field.jsx";
|
|
5
6
|
import { useTextInput } from "./use-text-input.jsx";
|
|
6
7
|
const EDITOR_TEXT_TOP = G9Metrics.FloatingLabelClearance + 8;
|
|
@@ -21,6 +22,7 @@ const G9Editor = forwardRef(function(props, ref) {
|
|
|
21
22
|
const min = null != (_props_minimumEditorHeight = props.minimumEditorHeight) ? _props_minimumEditorHeight : 96;
|
|
22
23
|
const max = null != (_props_maxEditorHeight = props.maxEditorHeight) ? _props_maxEditorHeight : 0;
|
|
23
24
|
const autoSize = null != (_props_autoSize = props.autoSize) ? _props_autoSize : 'textChanges';
|
|
25
|
+
const lineDirection = useG9LineDirectionProps(props.lineDirection, core.textDirection);
|
|
24
26
|
return <G9OutlinedField anchor={{
|
|
25
27
|
kind: 'entry',
|
|
26
28
|
label: ()=>{
|
|
@@ -41,7 +43,7 @@ const G9Editor = forwardRef(function(props, ref) {
|
|
|
41
43
|
focus: ()=>core.focus()
|
|
42
44
|
}
|
|
43
45
|
}} {...props} hint={resolveInnerHint(props)} hintTopInset={EDITOR_TEXT_TOP} multiline hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} onFocusRequest={core.focus}>
|
|
44
|
-
<textarea {...core.elementProps} className="g9-field__textarea" ios-spell-check={false !== props.isSpellCheckEnabled} ios-auto-correct={false !== props.isTextPredictionEnabled} style={{
|
|
46
|
+
<textarea {...core.elementProps} {...lineDirection} className="g9-field__textarea" ios-spell-check={false !== props.isSpellCheckEnabled} ios-auto-correct={false !== props.isTextPredictionEnabled} style={{
|
|
45
47
|
direction: core.textDirection,
|
|
46
48
|
textAlign: 'rtl' === core.textDirection ? 'right' : 'left',
|
|
47
49
|
...core.font ? {
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { G9VoiceDictation, type G9VoiceDictationOptions } from './dictation.js';
|
|
|
2
2
|
export { G9Editor, type G9EditorAutoSize, type G9EditorHandle, type G9EditorProps } from './editor.js';
|
|
3
3
|
export { formatMinutes, G9FormField, type G9FormFieldProps, G9NumberEntry, type G9NumberEntryProps, G9NumPad, type G9NumPadProps, G9TagEntry, type G9TagEntryProps, G9TimeEntry, type G9TimeEntryProps, parseTimeText, splitTags, } from './extra-entries.js';
|
|
4
4
|
export { customPatternCacheSize, decimalSeparatorFor, type G9LynxInputElementType, g9CustomPatternCacheLimit, inputTypeHasValidationRule, inputTypePrefersLeftToRight, isAbsoluteUri, resolveEffectiveKeyboard, resolveInputElementType, resolveKeyboardForInputType, sanitizeInputText, validateInputText, } from './input-policy.js';
|
|
5
|
+
export { g9LineDirectionProps, resolveLineDirection, useG9LineDirectionProps, } from './line-direction.js';
|
|
5
6
|
export { g9FieldNotchBackgroundVariable, g9FieldNotchStyle } from './notch.js';
|
|
6
7
|
export { G9OutlinedField, type G9OutlinedFieldFrameProps, type G9OutlinedFieldProps, type G9OutlinedFieldState, type G9OutlinedFieldStateInput, type G9TrailingAffordance, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField, } from './outlined-field.js';
|
|
7
8
|
export { filterPin, G9PinEntry, type G9PinEntryHandle, type G9PinEntryProps, isPinCharAllowed, parsePinGroupSizes, pinCellCount, } from './pin-entry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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,7 @@ export { G9VoiceDictation } from "./dictation.jsx";
|
|
|
2
2
|
export { G9Editor } from "./editor.jsx";
|
|
3
3
|
export { G9FormField, G9NumPad, G9NumberEntry, G9TagEntry, G9TimeEntry, formatMinutes, parseTimeText, splitTags } from "./extra-entries.jsx";
|
|
4
4
|
export { customPatternCacheSize, decimalSeparatorFor, g9CustomPatternCacheLimit, inputTypeHasValidationRule, inputTypePrefersLeftToRight, isAbsoluteUri, resolveEffectiveKeyboard, resolveInputElementType, resolveKeyboardForInputType, sanitizeInputText, validateInputText } from "./input-policy.jsx";
|
|
5
|
+
export { g9LineDirectionProps, resolveLineDirection, useG9LineDirectionProps } from "./line-direction.jsx";
|
|
5
6
|
export { g9FieldNotchBackgroundVariable, g9FieldNotchStyle } from "./notch.jsx";
|
|
6
7
|
export { G9OutlinedField, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField } from "./outlined-field.jsx";
|
|
7
8
|
export { G9PinEntry, filterPin, isPinCharAllowed, parsePinGroupSizes, pinCellCount } from "./pin-entry.jsx";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { G9LineDirection } from '../provider/settings.js';
|
|
2
|
+
/** A field's own `lineDirection` if it has one, else the app's `settings.fields.lineDirection` (default `'native'`). */
|
|
3
|
+
export declare function resolveLineDirection(own: G9LineDirection | undefined, app: G9LineDirection): G9LineDirection;
|
|
4
|
+
/**
|
|
5
|
+
* The `<textarea>` attributes of a line-direction mode: `'majority'` asks the native field (lynxcontrols-native
|
|
6
|
+
* `G9UITextArea` on Android and iOS, `@g9tm/lynxcontrols-web` in a browser) to give each line the direction of most
|
|
7
|
+
* of its letters, with `fallback` (the field's own direction) for a line without a vote. `'native'` adds nothing,
|
|
8
|
+
* so a field that never opts in renders exactly as before.
|
|
9
|
+
*/
|
|
10
|
+
export declare function g9LineDirectionProps(mode: G9LineDirection, fallback: 'ltr' | 'rtl'): Record<string, string>;
|
|
11
|
+
/** {@link g9LineDirectionProps} for a field's own mode over the app's setting. */
|
|
12
|
+
export declare function useG9LineDirectionProps(own: G9LineDirection | undefined, fallback: 'ltr' | 'rtl'): Record<string, string>;
|
|
13
|
+
//# sourceMappingURL=line-direction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-direction.d.ts","sourceRoot":"","sources":["../../src/fields/line-direction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,wHAAwH;AACxH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,SAAS,EAAE,GAAG,EAAE,eAAe,GAAG,eAAe,CAE5G;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE3G;AAED,kFAAkF;AAClF,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,QAAQ,EAAE,KAAK,GAAG,KAAK,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGxB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useG9Settings } from "../provider/hooks.jsx";
|
|
2
|
+
function resolveLineDirection(own, app) {
|
|
3
|
+
return 'majority' === own || 'native' === own ? own : app;
|
|
4
|
+
}
|
|
5
|
+
function g9LineDirectionProps(mode, fallback) {
|
|
6
|
+
return 'majority' === mode ? {
|
|
7
|
+
'g9-line-direction': 'majority',
|
|
8
|
+
'g9-line-fallback': fallback
|
|
9
|
+
} : {};
|
|
10
|
+
}
|
|
11
|
+
function useG9LineDirectionProps(own, fallback) {
|
|
12
|
+
const app = useG9Settings().fields.lineDirection;
|
|
13
|
+
return g9LineDirectionProps(resolveLineDirection(own, app), fallback);
|
|
14
|
+
}
|
|
15
|
+
export { g9LineDirectionProps, resolveLineDirection, useG9LineDirectionProps };
|
package/dist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wHAAwH;IACxH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,2HAA2H;IAC3H,QAAQ,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAC/C,iHAAiH;IACjH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC7E,gHAAgH;IAChH,QAAQ,CAAC,+BAA+B,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3E,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,+GAA+G;IAC/G,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,0GAA0G;IAC1G,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,iCAAiC;AACjC,eAAO,MAAM,mBAAmB,8CAA2C,CAAC;AAC5E,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB,2DAAwD,CAAC;AAmE5F;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CA4OpD"}
|
package/dist/host/host.jsx
CHANGED
|
@@ -48,7 +48,9 @@ const HostLayer = memo(function(props) {
|
|
|
48
48
|
if ('overlay' === container) return <OverlayView container="window" className={className} id={`${hostId}-${layer}`}>
|
|
49
49
|
{items}
|
|
50
50
|
</OverlayView>;
|
|
51
|
-
return <view className={className}
|
|
51
|
+
return <view className={className} flatten={false}>
|
|
52
|
+
{items}
|
|
53
|
+
</view>;
|
|
52
54
|
});
|
|
53
55
|
function G9Host(props) {
|
|
54
56
|
var _props_active, _props_name, _props_layerContainers, _props_dismissKeyboardOnTapOutside, _ref, _ref1, _props_background, _ref2, _ref3, _ref4;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type * from './commands/index.js';
|
|
|
7
7
|
export type * from './dashboard/index.js';
|
|
8
8
|
export type * from './deferred/index.js';
|
|
9
9
|
export type * from './design/index.js';
|
|
10
|
+
export type * from './desktop/index.js';
|
|
10
11
|
export type * from './display/index.js';
|
|
11
12
|
export type * from './edge-panel/index.js';
|
|
12
13
|
export type * from './effects/index.js';
|
|
@@ -22,6 +23,7 @@ export type * from './notifications/index.js';
|
|
|
22
23
|
export type * from './orb/index.js';
|
|
23
24
|
export type * from './pickers/index.js';
|
|
24
25
|
export type * from './plus-button/index.js';
|
|
26
|
+
export type * from './pointer/index.js';
|
|
25
27
|
export type * from './popover/index.js';
|
|
26
28
|
export type * from './popup/index.js';
|
|
27
29
|
export type * from './provider/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,gBAAgB,CAAC;AACpC,mBA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uBAAuB,CAAC;AAC3C,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { G9AnchorRect } from '../anchor/registry.js';
|
|
2
|
+
/** What is dragged: a kind the targets filter on, the app's data, and the preview's words. */
|
|
3
|
+
export interface G9DragPayload<T = unknown> {
|
|
4
|
+
readonly kind: string;
|
|
5
|
+
readonly data: T;
|
|
6
|
+
/** The default preview's text. */
|
|
7
|
+
readonly label?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Where a drag is over: a target, and inside a composite target (a canvas) the part it named. */
|
|
10
|
+
export interface G9DropOver {
|
|
11
|
+
readonly target: string;
|
|
12
|
+
/** The part of a composite target (`hit` answered it); absent for a plain target. */
|
|
13
|
+
readonly part?: string;
|
|
14
|
+
}
|
|
15
|
+
/** What a drop hands the target. */
|
|
16
|
+
export interface G9DropEvent<T = unknown> extends G9DropOver {
|
|
17
|
+
readonly payload: G9DragPayload<T>;
|
|
18
|
+
/** The pointer, in the LynxView's space. */
|
|
19
|
+
readonly x: number;
|
|
20
|
+
readonly y: number;
|
|
21
|
+
}
|
|
22
|
+
/** A drop target as registered. */
|
|
23
|
+
export interface G9DropTargetSpec {
|
|
24
|
+
/** Unique on the page. */
|
|
25
|
+
readonly id: string;
|
|
26
|
+
/** Whether it takes this payload (default: every payload). Only accepting targets are measured and lit. */
|
|
27
|
+
accepts?(payload: G9DragPayload): boolean;
|
|
28
|
+
/** Its rect in the LynxView's space, asked once when a drag starts. */
|
|
29
|
+
measure(): Promise<G9AnchorRect | null>;
|
|
30
|
+
/**
|
|
31
|
+
* A composite target (a canvas of nodes): which part is under the point (`rect` is the measured one). `null` = no
|
|
32
|
+
* part takes it here (the drop falls through to targets below); a string = that part.
|
|
33
|
+
*/
|
|
34
|
+
hit?(x: number, y: number, rect: G9AnchorRect, payload: G9DragPayload): string | null;
|
|
35
|
+
/** The drag came over it (or onto another of its parts). */
|
|
36
|
+
onEnter?(over: G9DropOver, payload: G9DragPayload): void;
|
|
37
|
+
/** The drag left it. */
|
|
38
|
+
onLeave?(payload: G9DragPayload): void;
|
|
39
|
+
onDrop(event: G9DropEvent): void;
|
|
40
|
+
}
|
|
41
|
+
/** The drag of the page, as listeners see it. */
|
|
42
|
+
export interface G9DragState {
|
|
43
|
+
readonly payload: G9DragPayload;
|
|
44
|
+
/** The targets that take the payload (lit as candidates). */
|
|
45
|
+
readonly candidates: readonly string[];
|
|
46
|
+
readonly over: G9DropOver | null;
|
|
47
|
+
readonly x: number;
|
|
48
|
+
readonly y: number;
|
|
49
|
+
}
|
|
50
|
+
/** Registers a drop target for as long as it lives; returns the unregister. A newer target wins where two overlap. */
|
|
51
|
+
export declare function registerG9DropTarget(spec: G9DropTargetSpec): () => void;
|
|
52
|
+
/** Hears the page's drag: its start, every change of the target under it, and its end (`null`). */
|
|
53
|
+
export declare function subscribeG9Drag(listener: (state: G9DragState | null) => void): () => void;
|
|
54
|
+
/** The drag now, or null. */
|
|
55
|
+
export declare function currentG9Drag(): G9DragState | null;
|
|
56
|
+
/** The target (and part) under the point among `measured`, newest first; null when none. */
|
|
57
|
+
export declare function hitDropTarget(measured: readonly {
|
|
58
|
+
readonly spec: G9DropTargetSpec;
|
|
59
|
+
readonly rect: G9AnchorRect;
|
|
60
|
+
}[], x: number, y: number, payload: G9DragPayload): G9DropOver | null;
|
|
61
|
+
/**
|
|
62
|
+
* Starts the page's drag at the point: every accepting target is measured once (a failed measure leaves that one
|
|
63
|
+
* out). A drag already running is cancelled first. Resolves when the targets are measured.
|
|
64
|
+
*/
|
|
65
|
+
export declare function startG9Drag(payload: G9DragPayload, x: number, y: number): Promise<void>;
|
|
66
|
+
/** Moves the page's drag; the targets hear a change of the one under it. Nothing without a drag. */
|
|
67
|
+
export declare function moveG9Drag(x: number, y: number): void;
|
|
68
|
+
/** Drops at the point: the target under it hears `onDrop`. Answers the drop, or null when it fell on no target. */
|
|
69
|
+
export declare function endG9Drag(x: number, y: number): G9DropEvent | null;
|
|
70
|
+
/** Ends the page's drag without a drop (Escape, the source went away). */
|
|
71
|
+
export declare function cancelG9Drag(): void;
|
|
72
|
+
//# sourceMappingURL=drag-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-session.d.ts","sourceRoot":"","sources":["../../src/pointer/drag-session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,8FAA8F;AAC9F,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,kCAAkC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,kGAAkG;AAClG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oCAAoC;AACpC,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,UAAU;IAC1D,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