@g9tm/lynxcontrols 2.5.8 → 2.5.10
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/catalog/cards/G9Anchor.md +1 -1
- package/catalog/cards/G9AppearancePage.md +2 -2
- package/catalog/cards/G9ContrastPanel.md +1 -0
- package/catalog/cards/G9DesignNode.md +1 -1
- package/catalog/cards/G9Keycap.md +1 -1
- package/catalog/cards/G9PathNavigator.md +6 -2
- package/catalog/cards/G9PersonalThemeSheet.md +3 -3
- package/catalog/cards/G9ShortcutList.md +1 -1
- package/catalog/cards/G9SwipeView.md +1 -1
- package/catalog/cards/G9ThemePreviewCard.md +1 -0
- package/catalog/cards/G9ThemeTokenEditor.md +17 -0
- package/catalog/cards/G9WallpaperSwatch.md +2 -1
- package/catalog/catalog.json +941 -86
- package/catalog/index.md +2 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/appearance/appearance.css +123 -0
- package/dist/appearance/appearance.css.map +1 -1
- package/dist/appearance/appearance.d.ts +46 -9
- package/dist/appearance/appearance.d.ts.map +1 -1
- package/dist/appearance/appearance.jsx +201 -31
- package/dist/appearance/index.d.ts +1 -0
- package/dist/appearance/index.d.ts.map +1 -1
- package/dist/appearance/index.jsx +1 -0
- package/dist/appearance/token-editor.d.ts +38 -0
- package/dist/appearance/token-editor.d.ts.map +1 -0
- package/dist/appearance/token-editor.jsx +170 -0
- package/dist/display/theme-preview.d.ts +2 -0
- package/dist/display/theme-preview.d.ts.map +1 -1
- package/dist/display/theme-preview.jsx +10 -4
- package/dist/provider/keep-alive.d.ts +2 -0
- package/dist/provider/keep-alive.d.ts.map +1 -1
- package/dist/provider/keep-alive.jsx +3 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +3 -2
- package/dist/route/path-navigator.css +179 -2
- package/dist/route/path-navigator.css.map +1 -1
- package/dist/route/path-navigator.d.ts +28 -4
- package/dist/route/path-navigator.d.ts.map +1 -1
- package/dist/route/path-navigator.jsx +103 -25
- package/dist/route/path-router.d.ts +25 -2
- package/dist/route/path-router.d.ts.map +1 -1
- package/dist/route/path-router.jsx +47 -5
- package/dist/swipe/model.d.ts +7 -0
- package/dist/swipe/model.d.ts.map +1 -1
- package/dist/swipe/model.jsx +8 -1
- package/dist/swipe/swipe-view.d.ts +7 -0
- package/dist/swipe/swipe-view.d.ts.map +1 -1
- package/dist/swipe/swipe-view.jsx +34 -6
- package/package.json +2 -2
- package/skills/g9-lynx-app/SKILL.md +1 -0
- package/skills/g9-lynx-app/references/catalog-index.md +9 -5
- package/skills/g9-lynx-app/references/components/anchor.md +1 -1
- package/skills/g9-lynx-app/references/components/appearance.md +26 -6
- package/skills/g9-lynx-app/references/components/calendar-1.md +21 -37
- package/skills/g9-lynx-app/references/components/calendar-2.md +38 -1
- package/skills/g9-lynx-app/references/components/canvas.md +1 -1
- package/skills/g9-lynx-app/references/components/chat-1.md +58 -61
- package/skills/g9-lynx-app/references/components/chat-2.md +110 -34
- package/skills/g9-lynx-app/references/components/chat-3.md +50 -0
- package/skills/g9-lynx-app/references/components/commands.md +1 -1
- package/skills/g9-lynx-app/references/components/design.md +1 -1
- package/skills/g9-lynx-app/references/components/display-1.md +1 -1
- package/skills/g9-lynx-app/references/components/display-3.md +1 -0
- package/skills/g9-lynx-app/references/components/media-1.md +75 -77
- package/skills/g9-lynx-app/references/components/media-2.md +131 -3
- package/skills/g9-lynx-app/references/components/native-media.md +16 -0
- package/skills/g9-lynx-app/references/components/projects.md +91 -3
- package/skills/g9-lynx-app/references/components/route.md +6 -2
- package/skills/g9-lynx-app/references/components/swipe.md +1 -1
- package/skills/g9-lynx-app/references/hosting.md +83 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-router.d.ts","sourceRoot":"","sources":["../../src/route/path-router.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,eAA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mB,GAAG,YAAY,CAgO7E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function g9ParsePath(href) {
|
|
1
|
+
function g9ParsePath(href, origin = '') {
|
|
2
2
|
const at = href.indexOf('#');
|
|
3
3
|
const hash = at >= 0 ? href.slice(at) : '';
|
|
4
4
|
const beforeHash = at >= 0 ? href.slice(0, at) : href;
|
|
@@ -10,7 +10,8 @@ function g9ParsePath(href) {
|
|
|
10
10
|
search,
|
|
11
11
|
hash,
|
|
12
12
|
href: `${pathname}${search}${hash}`,
|
|
13
|
-
searchParams: new URLSearchParams(search)
|
|
13
|
+
searchParams: new URLSearchParams(search),
|
|
14
|
+
origin
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
function g9CompilePattern(pattern) {
|
|
@@ -34,7 +35,7 @@ function g9CompilePattern(pattern) {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
function createG9PathRouter(options) {
|
|
37
|
-
var _options_isWide, _options_history, _options_onChange;
|
|
38
|
+
var _options_isWide, _options_history, _options_onChange, _options_origin;
|
|
38
39
|
const compiled = options.routes.map((def)=>({
|
|
39
40
|
def,
|
|
40
41
|
...g9CompilePattern(def.pattern)
|
|
@@ -55,6 +56,7 @@ function createG9PathRouter(options) {
|
|
|
55
56
|
version: 0,
|
|
56
57
|
leaving: null
|
|
57
58
|
};
|
|
59
|
+
let seeded = false;
|
|
58
60
|
const set = (next)=>{
|
|
59
61
|
state = {
|
|
60
62
|
...state,
|
|
@@ -68,8 +70,9 @@ function createG9PathRouter(options) {
|
|
|
68
70
|
var _state_stack_;
|
|
69
71
|
return null != (_state_stack_ = state.stack[state.stack.length - 1]) ? _state_stack_ : null;
|
|
70
72
|
};
|
|
73
|
+
const origin = null != (_options_origin = options.origin) ? _options_origin : '';
|
|
71
74
|
const match = (href)=>{
|
|
72
|
-
const url = g9ParsePath(href);
|
|
75
|
+
const url = g9ParsePath(href, origin);
|
|
73
76
|
for (const route of compiled){
|
|
74
77
|
const found = route.regex.exec(url.pathname);
|
|
75
78
|
if (!found) continue;
|
|
@@ -149,6 +152,27 @@ function createG9PathRouter(options) {
|
|
|
149
152
|
url: next.url,
|
|
150
153
|
params: next.params
|
|
151
154
|
}, 'goto')) return false;
|
|
155
|
+
if (seeded) {
|
|
156
|
+
var _opts_state1;
|
|
157
|
+
seeded = false;
|
|
158
|
+
const first = top();
|
|
159
|
+
const entry = {
|
|
160
|
+
key: first.route === next.route ? 0 : ++entryKey,
|
|
161
|
+
url: next.url,
|
|
162
|
+
params: next.params,
|
|
163
|
+
route: next.route,
|
|
164
|
+
state: null != (_opts_state1 = opts.state) ? _opts_state1 : {}
|
|
165
|
+
};
|
|
166
|
+
null == history || history(next.url.href, true);
|
|
167
|
+
settle('goto', {
|
|
168
|
+
kind: 'none',
|
|
169
|
+
leaving: null,
|
|
170
|
+
stack: [
|
|
171
|
+
entry
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
152
176
|
const current = top();
|
|
153
177
|
const existing = state.stack.findIndex((e)=>e.url.href === next.url.href);
|
|
154
178
|
if (existing >= 0 && existing < state.stack.length - 1 && !opts.replaceState) {
|
|
@@ -272,7 +296,7 @@ function createG9PathRouter(options) {
|
|
|
272
296
|
get url () {
|
|
273
297
|
var _ref;
|
|
274
298
|
var _top;
|
|
275
|
-
return null != (_ref = null == (_top = top()) ? void 0 : _top.url) ? _ref : g9ParsePath('/');
|
|
299
|
+
return null != (_ref = null == (_top = top()) ? void 0 : _top.url) ? _ref : g9ParsePath('/', origin);
|
|
276
300
|
},
|
|
277
301
|
get params () {
|
|
278
302
|
var _ref;
|
|
@@ -322,6 +346,24 @@ function createG9PathRouter(options) {
|
|
|
322
346
|
}))
|
|
323
347
|
})
|
|
324
348
|
};
|
|
349
|
+
if (void 0 !== options.initialPath) {
|
|
350
|
+
const first = match(options.initialPath);
|
|
351
|
+
state = {
|
|
352
|
+
stack: [
|
|
353
|
+
{
|
|
354
|
+
key: 0,
|
|
355
|
+
url: first.url,
|
|
356
|
+
params: first.params,
|
|
357
|
+
route: first.route,
|
|
358
|
+
state: {}
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
kind: 'none',
|
|
362
|
+
version: 0,
|
|
363
|
+
leaving: null
|
|
364
|
+
};
|
|
365
|
+
seeded = true;
|
|
366
|
+
}
|
|
325
367
|
return router;
|
|
326
368
|
}
|
|
327
369
|
export { createG9PathRouter, g9CompilePattern, g9ParsePath };
|
package/dist/swipe/model.d.ts
CHANGED
|
@@ -58,6 +58,13 @@ export declare function swipeSnap(translate: number, leftWidth: number, rightWid
|
|
|
58
58
|
export declare function swipeDragTarget(x: number, leftWidth: number, rightWidth: number): number;
|
|
59
59
|
/** Main-thread twin of {@link swipeDragTarget}. */
|
|
60
60
|
export declare function swipeDragTargetMT(x: number, leftWidth: number, rightWidth: number): number;
|
|
61
|
+
/** How far past the row's width a drag runs the outer action (2.5.10 full swipe). */
|
|
62
|
+
export declare const g9SwipeFullRatio = 0.6;
|
|
63
|
+
/**
|
|
64
|
+
* A full swipe (2.5.10): the drag went past {@link g9SwipeFullRatio} of the row's width on a side that has actions —
|
|
65
|
+
* `1` to the right, `-1` to the left, `0` not.
|
|
66
|
+
*/
|
|
67
|
+
export declare function swipeFull(translate: number, width: number, leftWidth: number, rightWidth: number): 1 | -1 | 0;
|
|
61
68
|
/** Main-thread twin of {@link swipeSnap} (plan/specs/02 §3). */
|
|
62
69
|
export declare function swipeSnapMT(translate: number, leftWidth: number, rightWidth: number): number;
|
|
63
70
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/swipe/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,mFAAmF;AACnF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7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E,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mCAAmC;IACnC,QAAQ,IAAI,IAAI,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,iBAAiB,CAmBpD"}
|
package/dist/swipe/model.jsx
CHANGED
|
@@ -38,6 +38,13 @@ function swipeDragTargetMT(x, leftWidth, rightWidth) {
|
|
|
38
38
|
'main thread';
|
|
39
39
|
return Math.min(Math.max(x, -rightWidth), leftWidth);
|
|
40
40
|
}
|
|
41
|
+
const g9SwipeFullRatio = 0.6;
|
|
42
|
+
function swipeFull(translate, width, leftWidth, rightWidth) {
|
|
43
|
+
if (width <= 0) return 0;
|
|
44
|
+
if (translate > 0 && leftWidth > 0 && translate > width * g9SwipeFullRatio) return 1;
|
|
45
|
+
if (translate < 0 && rightWidth > 0 && -translate > width * g9SwipeFullRatio) return -1;
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
41
48
|
function swipeSnapMT(translate, leftWidth, rightWidth) {
|
|
42
49
|
'main thread';
|
|
43
50
|
if (translate > 0 && leftWidth > 0 && translate > leftWidth / 2) return leftWidth;
|
|
@@ -68,4 +75,4 @@ function createSwipeGroup() {
|
|
|
68
75
|
}
|
|
69
76
|
};
|
|
70
77
|
}
|
|
71
|
-
export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT };
|
|
78
|
+
export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeFullRatio, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipeFull, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT };
|
|
@@ -28,6 +28,13 @@ export interface G9SwipeViewProps {
|
|
|
28
28
|
/** Told when the row opens a side or closes. */
|
|
29
29
|
readonly onOpenChange?: (side: 'leading' | 'trailing' | null) => void;
|
|
30
30
|
readonly className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* A full swipe runs the outer action (2.5.10, G9Hub): past 60 % of the row's width the edge action of that side runs
|
|
33
|
+
* at once (a haptic when the drag crosses the line), as a tap on it would. Default false.
|
|
34
|
+
*/
|
|
35
|
+
readonly fullSwipe?: boolean;
|
|
36
|
+
/** The row can be swiped (2.5.10). Default true; false keeps it closed (a mouse host, a row being edited). */
|
|
37
|
+
readonly enabled?: boolean;
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
33
40
|
* A card row with swipe-to-reveal action panes on both edges (MAUI `G9SwipeView`). The panes sit behind the body, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swipe-view.d.ts","sourceRoot":"","sources":["../../src/swipe/swipe-view.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"swipe-view.d.ts","sourceRoot":"","sources":["../../src/swipe/swipe-view.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAUvB,MAAM,SAAS,CAAC;AAMjB,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAIpH;AAED,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAChD,sFAAsF;IACtF,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACjD,4GAA4G;IAC5G,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CA+L9D"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "./swipe.css";
|
|
2
|
+
import { g9Haptic } from "@g9tm/lynxcontrols-foundation";
|
|
2
3
|
import { Draggable } from "@lynx-js/lynx-ui-draggable";
|
|
3
|
-
import { createContext, runOnMainThread, useContext, useEffect, useMainThreadRef, useRef, useState } from "@lynx-js/react";
|
|
4
|
+
import { createContext, runOnBackground, runOnMainThread, useContext, useEffect, useMainThreadRef, useRef, useState } from "@lynx-js/react";
|
|
4
5
|
import { G9Icon } from "../icon/icon.jsx";
|
|
5
6
|
import { useG9Diagnostics, useG9Direction } from "../provider/hooks.jsx";
|
|
6
|
-
import { createSwipeGroup, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
|
|
7
|
+
import { createSwipeGroup, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTargetMT, swipeFull, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
|
|
7
8
|
const defaultGroup = createSwipeGroup();
|
|
8
9
|
let rowSequence = 0;
|
|
9
10
|
const SwipeGroupContext = createContext(defaultGroup);
|
|
@@ -69,6 +70,12 @@ function G9SwipeView(props) {
|
|
|
69
70
|
useEffect(()=>()=>group.closed(id), []);
|
|
70
71
|
const leftWidth = widths.left;
|
|
71
72
|
const rightWidth = widths.right;
|
|
73
|
+
const [rowWidth, setRowWidth] = useState(0);
|
|
74
|
+
const full = true === props.fullSwipe && rowWidth > 0;
|
|
75
|
+
const travelLeft = full && leftWidth > 0 ? rowWidth : leftWidth;
|
|
76
|
+
const travelRight = full && rightWidth > 0 ? rowWidth : rightWidth;
|
|
77
|
+
const crossed = useMainThreadRef(false);
|
|
78
|
+
const tick = ()=>g9Haptic('impact');
|
|
72
79
|
const onMTSDragStart = ()=>{
|
|
73
80
|
'main thread';
|
|
74
81
|
var _dragRef_current;
|
|
@@ -79,19 +86,35 @@ function G9SwipeView(props) {
|
|
|
79
86
|
const onMTSDragging = (translate)=>{
|
|
80
87
|
'main thread';
|
|
81
88
|
var _dragRef_current;
|
|
82
|
-
const x = swipeDragTargetMT(translate.x,
|
|
89
|
+
const x = swipeDragTargetMT(translate.x, travelLeft, travelRight);
|
|
83
90
|
if (x !== translate.x) null == (_dragRef_current = dragRef.current) || _dragRef_current.MTSSetTransform(x, 0);
|
|
91
|
+
if (full) {
|
|
92
|
+
const past = Math.abs(x) > 0.6 * rowWidth;
|
|
93
|
+
if (past !== crossed.current) {
|
|
94
|
+
crossed.current = past;
|
|
95
|
+
if (past) runOnBackground(tick)();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
84
98
|
};
|
|
85
99
|
const onMTSDragEnd = (translate)=>{
|
|
86
100
|
'main thread';
|
|
87
101
|
var _dragRef_current, _dragRef_current1;
|
|
88
|
-
|
|
102
|
+
crossed.current = false;
|
|
103
|
+
const past = full && Math.abs(translate.x) > 0.6 * rowWidth;
|
|
104
|
+
const target = past ? 0 : swipeSnapMT(translate.x, leftWidth, rightWidth);
|
|
89
105
|
null == (_dragRef_current = dragRef.current) || _dragRef_current.MTSSetOtherStyles({
|
|
90
106
|
transition: `transform ${g9SwipeSnapMs}ms ease-out`
|
|
91
107
|
});
|
|
92
108
|
null == (_dragRef_current1 = dragRef.current) || _dragRef_current1.MTSSetTransform(target, 0);
|
|
93
109
|
};
|
|
94
110
|
const onDragEnd = (translate)=>{
|
|
111
|
+
const side = full ? swipeFull(translate.x, rowWidth, leftWidth, rightWidth) : 0;
|
|
112
|
+
if (0 !== side) {
|
|
113
|
+
const action = side > 0 ? leftActions[0] : rightActions[rightActions.length - 1];
|
|
114
|
+
settle(0, true, true);
|
|
115
|
+
if (action) invoke(action);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
95
118
|
settle(swipeSnap(translate.x, leftWidth, rightWidth), true, true);
|
|
96
119
|
};
|
|
97
120
|
const invoke = (action)=>{
|
|
@@ -143,7 +166,12 @@ function G9SwipeView(props) {
|
|
|
143
166
|
</view> : null;
|
|
144
167
|
const radius = null != (_props_cornerRadius = props.cornerRadius) ? _props_cornerRadius : g9SwipeDefaultCornerRadius;
|
|
145
168
|
const thickness = null != (_props_cardStrokeThickness = props.cardStrokeThickness) ? _props_cardStrokeThickness : 0;
|
|
146
|
-
return <view className={`g9-swipe${0 !== offset ? ' g9-swipe--open' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`}
|
|
169
|
+
return <view className={`g9-swipe${0 !== offset ? ' g9-swipe--open' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`} {...props.fullSwipe ? {
|
|
170
|
+
bindlayoutchange: (e)=>{
|
|
171
|
+
const w = Math.round(e.detail.width);
|
|
172
|
+
if (w !== rowWidth) setRowWidth(w);
|
|
173
|
+
}
|
|
174
|
+
} : {}} style={{
|
|
147
175
|
borderRadius: `${radius}px`,
|
|
148
176
|
backgroundColor: null != (_props_cardBackground = props.cardBackground) ? _props_cardBackground : 'transparent',
|
|
149
177
|
...props.cardStroke && thickness > 0 ? {
|
|
@@ -157,7 +185,7 @@ function G9SwipeView(props) {
|
|
|
157
185
|
<Draggable className="g9-swipe__body" MTSRef={dragRef} trigger="immediate" allowedDirection={[
|
|
158
186
|
'left',
|
|
159
187
|
'right'
|
|
160
|
-
]} enableDragging={leftWidth > 0 || rightWidth > 0} minTranslateX={-(
|
|
188
|
+
]} enableDragging={false !== props.enabled && (leftWidth > 0 || rightWidth > 0)} minTranslateX={-(travelLeft + travelRight)} maxTranslateX={travelLeft + travelRight} minTranslateY={0} maxTranslateY={0} resetOnEnd={false} onMTSDragStart={onMTSDragStart} onMTSDragging={onMTSDragging} onMTSDragEnd={onMTSDragEnd} onDragEnd={onDragEnd} draggableProps={{
|
|
161
189
|
bindtap: 0 !== offset ? ()=>settle(0, true, false) : void 0
|
|
162
190
|
}}>
|
|
163
191
|
{null != (_props_cardContent = props.cardContent) ? _props_cardContent : props.children}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/lynxcontrols",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.10",
|
|
4
4
|
"description": "ReactLynx controls and overlay infrastructure: provider/host, sheets, popups, toasts, fields, buttons, pickers, tab view, tab bar, edge panel, swipe rows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
"build": "rslib build"
|
|
235
235
|
},
|
|
236
236
|
"dependencies": {
|
|
237
|
-
"@g9tm/lynxcontrols-foundation": "2.5.
|
|
237
|
+
"@g9tm/lynxcontrols-foundation": "2.5.10"
|
|
238
238
|
},
|
|
239
239
|
"peerDependencies": {
|
|
240
240
|
"@lynx-js/react": ">=0.129.3 <0.130.0",
|
|
@@ -23,6 +23,7 @@ disagree, trust `node_modules/@g9tm/lynxcontrols*/catalog/catalog.json` and the
|
|
|
23
23
|
| Phone, tablet and desktop from one screen | `references/adaptive-layout.md` | — |
|
|
24
24
|
| Test ids, a guided tour, an automation target | `references/anchors-guide.md` | `references/pilot.md` |
|
|
25
25
|
| G9AppPilot (test builds, the watch, reports) | `references/pilot.md` | — |
|
|
26
|
+
| Host the native elements (rich text, canvas, video, call tracks) on iOS, Android, web, desktop | `references/hosting.md` | the library's `docs/integration/<platform>.md` |
|
|
26
27
|
| Before you hand the work back | `references/common-mistakes.md` | run the app's own checks |
|
|
27
28
|
|
|
28
29
|
## Three rules most often broken
|
|
@@ -10,7 +10,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
10
10
|
|
|
11
11
|
## @g9tm/lynxcontrols-calendar
|
|
12
12
|
|
|
13
|
-
- `@g9tm/lynxcontrols-calendar`: G9AgendaView, G9BirthdayField, G9DateInput, G9EventCard, G9FindTime, G9MiniMonth, G9MonthDayPicker, G9MonthView, G9RepeatPicker, G9TimeGrid, G9TimeListPicker, G9TodayWidget, G9WorkingHoursEditor, G9ZonePicker → `components/calendar-1.md`, `components/calendar-2.md`
|
|
13
|
+
- `@g9tm/lynxcontrols-calendar`: G9AgendaView, G9BirthdayField, G9DateField, G9DateInput, G9EventCard, G9FindTime, G9MiniMonth, G9MonthDayPicker, G9MonthView, G9RepeatPicker, G9TimeGrid, G9TimeListPicker, G9TodayWidget, G9WorkingHoursEditor, G9ZonePicker → `components/calendar-1.md`, `components/calendar-2.md`
|
|
14
14
|
|
|
15
15
|
## @g9tm/lynxcontrols-canvas
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
22
22
|
|
|
23
23
|
## @g9tm/lynxcontrols-chat
|
|
24
24
|
|
|
25
|
-
- `@g9tm/lynxcontrols-chat`: G9ChatComposer, G9ChatThread, G9ConversationRow, G9EmojiLibrary, G9EmojiPicker, G9FileCard, G9GifPicker, G9LinkPreview, G9MessageBubble, G9MessageMenu, G9MessageMeta, G9MessageText, G9PersonPicker, G9PinnedBar, G9ReactionBar, G9SlashSuggestions, G9StickerPicker, G9TypingDots → `components/chat-1.md`, `components/chat-2.md`
|
|
25
|
+
- `@g9tm/lynxcontrols-chat`: G9AckBar, G9ChatComposer, G9ChatThread, G9ConversationRow, G9EditHistorySheet, G9EmojiLibrary, G9EmojiPicker, G9FileCard, G9GifPicker, G9KudosDialog, G9LinkPreview, G9MessageBubble, G9MessageMenu, G9MessageMeta, G9MessageText, G9PersonPicker, G9PinnedBar, G9PollCard, G9PollComposer, G9ReactionBar, G9SchedulePicker, G9SlashSuggestions, G9StickerPicker, G9ThreadSearch, G9TypingDots → `components/chat-1.md`, `components/chat-2.md`, `components/chat-3.md`
|
|
26
26
|
|
|
27
27
|
## @g9tm/lynxcontrols-commerce
|
|
28
28
|
|
|
@@ -31,7 +31,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
31
31
|
## @g9tm/lynxcontrols
|
|
32
32
|
|
|
33
33
|
- `@g9tm/lynxcontrols/anchor`: G9Anchor, G9ScrollerScope → `components/anchor.md`
|
|
34
|
-
- `@g9tm/lynxcontrols/appearance`: G9AppearancePage, G9ContrastPanel, G9PersonalThemeSheet, G9WallpaperSwatch → `components/appearance.md`
|
|
34
|
+
- `@g9tm/lynxcontrols/appearance`: G9AppearancePage, G9ContrastPanel, G9PersonalThemeSheet, G9ThemeTokenEditor, G9WallpaperSwatch → `components/appearance.md`
|
|
35
35
|
- `@g9tm/lynxcontrols/base`: G9CornerBadge, G9Pressable → `components/base.md`
|
|
36
36
|
- `@g9tm/lynxcontrols/button`: G9Button, G9HeaderActionButton, G9IconButton, G9NavCard, G9SafeButton, G9SafeIconButton, G9VerticalIconTextButton → `components/button.md`
|
|
37
37
|
- `@g9tm/lynxcontrols/cascade`: G9CascadePanel → `components/cascade.md`
|
|
@@ -81,7 +81,11 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
81
81
|
|
|
82
82
|
## @g9tm/lynxcontrols-media
|
|
83
83
|
|
|
84
|
-
- `@g9tm/lynxcontrols-media`: G9BlurhashView, G9CallControls, G9CallStage, G9CallTileView, G9Captcha, G9ClipPlayer, G9DropZone, G9ImageCropper, G9IncomingCall, G9Lightbox, G9MediaGrid, G9MediaPager, G9QualityBars, G9SelfPip, G9VideoNote, G9VoicePlayer → `components/media-1.md`, `components/media-2.md`
|
|
84
|
+
- `@g9tm/lynxcontrols-media`: G9BlurhashView, G9CallButton, G9CallControls, G9CallPreview, G9CallStage, G9CallTileView, G9Captcha, G9ClipPlayer, G9DeviceSettings, G9DropZone, G9EffectsPicker, G9HuddleBadge, G9HuddleStrip, G9ImageCropper, G9IncomingCall, G9Lightbox, G9MediaGrid, G9MediaPager, G9MiniCall, G9QualityBars, G9SelfPip, G9VideoNote, G9VoicePlayer → `components/media-1.md`, `components/media-2.md`
|
|
85
|
+
|
|
86
|
+
## @g9tm/lynxcontrols-native
|
|
87
|
+
|
|
88
|
+
- `@g9tm/lynxcontrols-native/media`: G9TrackVideo → `components/native-media.md`
|
|
85
89
|
|
|
86
90
|
## @g9tm/lynxcontrols-pilot
|
|
87
91
|
|
|
@@ -89,7 +93,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
|
|
|
89
93
|
|
|
90
94
|
## @g9tm/lynxcontrols-projects
|
|
91
95
|
|
|
92
|
-
- `@g9tm/lynxcontrols-projects`: G9Board, G9RuleBuilder, G9TaskCard, G9Timeline → `components/projects.md`
|
|
96
|
+
- `@g9tm/lynxcontrols-projects`: G9ActivityFeed, G9Board, G9FileBrowser, G9FormBuilder, G9OrgChart, G9QuestionField, G9RuleBuilder, G9TaskCard, G9Timeline → `components/projects.md`
|
|
93
97
|
|
|
94
98
|
## @g9tm/lynxcontrols-richtext
|
|
95
99
|
|
|
@@ -13,7 +13,7 @@ Props:
|
|
|
13
13
|
- `changes?`: () => void
|
|
14
14
|
- `enabled?`: () => void
|
|
15
15
|
- `capabilities?`: object
|
|
16
|
-
- `kind?`: 'label' | 'image' | 'button' | 'entry' | 'toggle' | 'picker' | '
|
|
16
|
+
- `kind?`: 'label' | 'chips' | 'image' | 'button' | 'entry' | 'toggle' | 'picker' | 'tab' | 'tab-view' | 'list' | 'scroll' | 'item' | 'card' | 'map' | 'view'
|
|
17
17
|
- `secret?`: boolean = false
|
|
18
18
|
|
|
19
19
|
Example: `<G9Anchor id="id" />`
|
|
@@ -13,8 +13,8 @@ Props:
|
|
|
13
13
|
- `themes`: object[]
|
|
14
14
|
- `onCreateTheme?`: () => void
|
|
15
15
|
- `onEditTheme?`: (theme: G9ThemeDefinition) => void
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
16
|
+
- `onExportTheme?`: (theme: G9ThemeDefinition) => void
|
|
17
|
+
- `onImportTheme?`: () => void
|
|
18
18
|
|
|
19
19
|
Example: `<G9AppearancePage onChange={() => {}} settings={settings} systemScheme="light" themes={themes} />`
|
|
20
20
|
|
|
@@ -27,6 +27,7 @@ A palette's contrast report: a sample, the ratio, AA / AAA and a fix for each fa
|
|
|
27
27
|
Props:
|
|
28
28
|
- `palette`: object
|
|
29
29
|
- `onFix?`: (foreground: string, value: string) => void
|
|
30
|
+
- `appTokens?`: object
|
|
30
31
|
- `onlyFailures?`: boolean
|
|
31
32
|
- `pairs?`: object[]
|
|
32
33
|
- `rules?`: object[]
|
|
@@ -41,16 +42,34 @@ Example: `<G9ContrastPanel palette={palette} />`
|
|
|
41
42
|
The personal theme editor: base, accent, surfaces, mode, wallpaper, a live preview and its contrast.
|
|
42
43
|
|
|
43
44
|
Props:
|
|
44
|
-
- `bases`: object[]
|
|
45
45
|
- `onClose`: () => void
|
|
46
|
-
- `onSave`: (theme: G9ThemeDefinition, draft: G9PersonalThemeDraft) => void
|
|
47
46
|
- `open`: boolean
|
|
48
47
|
- `onDelete?`: (id: string) => void
|
|
49
48
|
- `onExport?`: (theme: G9ThemeDefinition) => void
|
|
49
|
+
- `onSave?`: (theme: G9ThemeDefinition, draft: G9PersonalThemeDraft) => void
|
|
50
50
|
- `accents?`: object[]
|
|
51
|
+
- `bases?`: object[]
|
|
51
52
|
- `draft?`: object
|
|
52
53
|
|
|
53
|
-
Example: `<G9PersonalThemeSheet
|
|
54
|
+
Example: `<G9PersonalThemeSheet onClose={() => {}} open />`
|
|
55
|
+
|
|
56
|
+
# G9ThemeTokenEditor
|
|
57
|
+
|
|
58
|
+
`import { G9ThemeTokenEditor } from '@g9tm/lynxcontrols/appearance';`
|
|
59
|
+
|
|
60
|
+
The organisation theme editor: name, scheme, a row per token, a live preview and its contrast.
|
|
61
|
+
|
|
62
|
+
Props:
|
|
63
|
+
- `onChange`: (theme: G9TokenTheme) => void
|
|
64
|
+
- `value`: object
|
|
65
|
+
- `listHeight?`: number = 480
|
|
66
|
+
- `inherited?`: object
|
|
67
|
+
- `language?`: string
|
|
68
|
+
- `options?`: object
|
|
69
|
+
- `virtual?`: boolean
|
|
70
|
+
- `words?`: object
|
|
71
|
+
|
|
72
|
+
Example: `<G9ThemeTokenEditor onChange={() => {}} value={value} />`
|
|
54
73
|
|
|
55
74
|
# G9WallpaperSwatch
|
|
56
75
|
|
|
@@ -61,10 +80,11 @@ A wallpaper as a small swatch in the palette's colours, with its name and a ring
|
|
|
61
80
|
Props:
|
|
62
81
|
- `palette`: object
|
|
63
82
|
- `scheme`: 'light' | 'dark'
|
|
64
|
-
- `wallpaper`: object
|
|
83
|
+
- `wallpaper`: object | object
|
|
65
84
|
- `label?`: string
|
|
66
85
|
- `selected?`: boolean
|
|
67
86
|
- `onPress?`: () => void
|
|
68
87
|
- `height?`: number = 56
|
|
88
|
+
- `tokens?`: object
|
|
69
89
|
|
|
70
90
|
Example: `<G9WallpaperSwatch palette={palette} scheme="light" wallpaper={wallpaper} />`
|
|
@@ -33,6 +33,24 @@ Props:
|
|
|
33
33
|
|
|
34
34
|
Example: `<G9BirthdayField labels={labels} onChange={() => {}} value={value} />`
|
|
35
35
|
|
|
36
|
+
# G9DateField
|
|
37
|
+
|
|
38
|
+
`import { G9DateField } from '@g9tm/lynxcontrols-calendar';`
|
|
39
|
+
|
|
40
|
+
A date field: the chosen day in a box (and in the other calendar), G9DateInput in a popover or a sheet on tap.
|
|
41
|
+
|
|
42
|
+
Props:
|
|
43
|
+
- `label`: string
|
|
44
|
+
- `onChange`: (date: G9LocalDate | null) => void
|
|
45
|
+
- `today`: object
|
|
46
|
+
- `value`: object
|
|
47
|
+
- `title?`: string
|
|
48
|
+
- `placeholder?`: string
|
|
49
|
+
- `disabled?`: boolean
|
|
50
|
+
- `clearLabel?`: string
|
|
51
|
+
|
|
52
|
+
Example: `<G9DateField label="Label" onChange={() => {}} today={today} value={value} />`
|
|
53
|
+
|
|
36
54
|
# G9DateInput
|
|
37
55
|
|
|
38
56
|
`import { G9DateInput } from '@g9tm/lynxcontrols-calendar';`
|
|
@@ -65,7 +83,7 @@ Props:
|
|
|
65
83
|
- `busy?`: boolean
|
|
66
84
|
- `guests?`: number
|
|
67
85
|
- `hidden?`: boolean
|
|
68
|
-
- `
|
|
86
|
+
- `online?`: boolean
|
|
69
87
|
|
|
70
88
|
Example: `<G9EventCard event={event} labels={labels} />`
|
|
71
89
|
|
|
@@ -144,10 +162,11 @@ Props:
|
|
|
144
162
|
- `labels`: object
|
|
145
163
|
- `onChange`: (rule: G9Recurrence | null) => void
|
|
146
164
|
- `value`: object
|
|
165
|
+
- `disabled?`: boolean
|
|
166
|
+
- `footer?`: ReactNode
|
|
147
167
|
- `editorLabels?`: object
|
|
148
168
|
- `presets?`: 'none' | 'daily' | 'weekly' | 'workdays' | 'monthlyDate' | 'monthlyWeekday' | 'yearly' | 'custom'[]
|
|
149
169
|
- `start?`: object
|
|
150
|
-
- `words?`: object
|
|
151
170
|
|
|
152
171
|
Example: `<G9RepeatPicker labels={labels} onChange={() => {}} value={value} />`
|
|
153
172
|
|
|
@@ -168,38 +187,3 @@ Props:
|
|
|
168
187
|
- `onMove?`: (event: G9CalendarEvent, draft: G9TimeDraft) => void
|
|
169
188
|
|
|
170
189
|
Example: `<G9TimeGrid events={events} start={start} today={today} />`
|
|
171
|
-
|
|
172
|
-
# G9TimeListPicker
|
|
173
|
-
|
|
174
|
-
`import { G9TimeListPicker } from '@g9tm/lynxcontrols-calendar';`
|
|
175
|
-
|
|
176
|
-
A time picked from a list of steps: a popover on a wide window, a sheet on a phone; it opens at the value.
|
|
177
|
-
|
|
178
|
-
Props:
|
|
179
|
-
- `label`: string
|
|
180
|
-
- `onChange`: (minutes: number) => void
|
|
181
|
-
- `value`: number
|
|
182
|
-
- `title?`: string
|
|
183
|
-
- `placeholder?`: string
|
|
184
|
-
- `disabled?`: boolean
|
|
185
|
-
- `hint?`: string
|
|
186
|
-
- `error?`: string
|
|
187
|
-
|
|
188
|
-
Example: `<G9TimeListPicker label="Label" onChange={() => {}} value={1} />`
|
|
189
|
-
|
|
190
|
-
# G9TodayWidget
|
|
191
|
-
|
|
192
|
-
`import { G9TodayWidget } from '@g9tm/lynxcontrols-calendar';`
|
|
193
|
-
|
|
194
|
-
Today's events on a home screen: the date, all-day first, then timed with the next one marked; «and n more».
|
|
195
|
-
|
|
196
|
-
Props:
|
|
197
|
-
- `events`: object[]
|
|
198
|
-
- `labels`: object
|
|
199
|
-
- `now`: number
|
|
200
|
-
- `today`: object
|
|
201
|
-
- `onOpen?`: () => void
|
|
202
|
-
- `onSelectEvent?`: (event: G9CalendarEvent) => void
|
|
203
|
-
- `max?`: number = 4
|
|
204
|
-
|
|
205
|
-
Example: `<G9TodayWidget events={events} labels={labels} now={1} today={today} />`
|
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# `@g9tm/lynxcontrols-calendar` (part 2 of 2) (generated)
|
|
2
2
|
|
|
3
|
+
# G9TimeListPicker
|
|
4
|
+
|
|
5
|
+
`import { G9TimeListPicker } from '@g9tm/lynxcontrols-calendar';`
|
|
6
|
+
|
|
7
|
+
A time picked from a list of steps: a popover on a wide window, a sheet on a phone; it opens at the value.
|
|
8
|
+
|
|
9
|
+
Props:
|
|
10
|
+
- `label`: string
|
|
11
|
+
- `onChange`: (minutes: number) => void
|
|
12
|
+
- `value`: number
|
|
13
|
+
- `title?`: string
|
|
14
|
+
- `placeholder?`: string
|
|
15
|
+
- `disabled?`: boolean
|
|
16
|
+
- `hint?`: string
|
|
17
|
+
- `error?`: string
|
|
18
|
+
|
|
19
|
+
Example: `<G9TimeListPicker label="Label" onChange={() => {}} value={1} />`
|
|
20
|
+
|
|
21
|
+
# G9TodayWidget
|
|
22
|
+
|
|
23
|
+
`import { G9TodayWidget } from '@g9tm/lynxcontrols-calendar';`
|
|
24
|
+
|
|
25
|
+
Today's events on a home screen: the date, all-day first, then timed with the next one marked; «and n more».
|
|
26
|
+
|
|
27
|
+
Props:
|
|
28
|
+
- `events`: object[]
|
|
29
|
+
- `labels`: object
|
|
30
|
+
- `now`: number
|
|
31
|
+
- `today`: object
|
|
32
|
+
- `onNotice?`: () => void
|
|
33
|
+
- `onOpen?`: () => void
|
|
34
|
+
- `onSelectEvent?`: (event: G9CalendarEvent) => void
|
|
35
|
+
- `openText?`: string
|
|
36
|
+
|
|
37
|
+
Example: `<G9TodayWidget events={events} labels={labels} now={1} today={today} />`
|
|
38
|
+
|
|
3
39
|
# G9WorkingHoursEditor
|
|
4
40
|
|
|
5
41
|
`import { G9WorkingHoursEditor } from '@g9tm/lynxcontrols-calendar';`
|
|
@@ -10,10 +46,11 @@ Props:
|
|
|
10
46
|
- `labels`: object
|
|
11
47
|
- `onChange`: (week: Readonly<Partial<Record<number, readonly G9WorkRange[]>>>) => void
|
|
12
48
|
- `value`: object
|
|
49
|
+
- `disabled?`: boolean
|
|
13
50
|
- `onTimeZoneChange?`: (zone: string) => void
|
|
14
51
|
- `defaultRange?`: object = 9
|
|
52
|
+
- `maxRanges?`: number
|
|
15
53
|
- `timeZone?`: string
|
|
16
|
-
- `zones?`: string[]
|
|
17
54
|
|
|
18
55
|
Example: `<G9WorkingHoursEditor labels={labels} onChange={() => {}} value={value} />`
|
|
19
56
|
|
|
@@ -11,7 +11,7 @@ Props:
|
|
|
11
11
|
- `editable`: boolean
|
|
12
12
|
- `port`: object
|
|
13
13
|
- `stroke`: object
|
|
14
|
-
- `tool`: 'text' | 'image' | 'line' | 'selection' | 'arrow' | 'diamond' | 'rectangle' | 'ellipse' | 'frame' | '
|
|
14
|
+
- `tool`: 'text' | 'image' | 'line' | 'selection' | 'hand' | 'arrow' | 'diamond' | 'rectangle' | 'ellipse' | 'frame' | 'freedraw' | 'eraser' | 'laser'
|
|
15
15
|
- `accent?`: string
|
|
16
16
|
- `background?`: color
|
|
17
17
|
- `dark?`: boolean
|