@g9tm/lynxcontrols 2.5.6 → 2.5.8
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/G9AppBar.md +1 -1
- package/catalog/cards/G9AppearancePage.md +17 -0
- package/catalog/cards/G9Badge.md +1 -1
- package/catalog/cards/G9Button.md +2 -2
- package/catalog/cards/G9Card.md +1 -1
- package/catalog/cards/G9CarryContexts.md +10 -0
- package/catalog/cards/G9CheckBox.md +1 -1
- package/catalog/cards/G9Chip.md +1 -1
- package/catalog/cards/G9ChipStrip.md +16 -0
- package/catalog/cards/G9CodeBlock.md +17 -0
- package/catalog/cards/G9CommandPalette.md +3 -1
- package/catalog/cards/G9ConnectionBanner.md +1 -1
- package/catalog/cards/G9ContrastPanel.md +15 -0
- package/catalog/cards/G9DashboardCustomizeSheet.md +17 -0
- package/catalog/cards/G9DashboardGrid.md +17 -0
- package/catalog/cards/G9DragList.md +4 -2
- package/catalog/cards/G9Editor.md +1 -1
- package/catalog/cards/G9ErrorBoundary.md +3 -2
- package/catalog/cards/G9FormField.md +2 -2
- package/catalog/cards/G9ListRow.md +1 -1
- package/catalog/cards/G9Menu.md +1 -1
- package/catalog/cards/G9MenuList.md +2 -0
- package/catalog/cards/G9NotificationCenter.md +17 -0
- package/catalog/cards/G9NotificationCenterPanel.md +17 -0
- package/catalog/cards/G9PathNavigator.md +13 -0
- package/catalog/cards/G9PersonalThemeSheet.md +17 -0
- package/catalog/cards/G9Popover.md +1 -1
- package/catalog/cards/G9Provider.md +1 -1
- package/catalog/cards/G9RangeSlider.md +2 -2
- package/catalog/cards/G9ReaderSheet.md +17 -0
- package/catalog/cards/G9ReaderView.md +17 -0
- package/catalog/cards/G9SafeButton.md +2 -2
- package/catalog/cards/G9SearchEntry.md +1 -1
- package/catalog/cards/G9SecretValue.md +17 -0
- package/catalog/cards/G9ShortcutList.md +4 -0
- package/catalog/cards/G9ShortcutsSheet.md +3 -1
- package/catalog/cards/G9StatusPill.md +1 -1
- package/catalog/cards/G9Stepper.md +1 -1
- package/catalog/cards/G9SwitchRow.md +1 -1
- package/catalog/cards/G9Tag.md +1 -1
- package/catalog/cards/G9TextEntry.md +1 -1
- package/catalog/cards/G9UpdateBar.md +2 -1
- package/catalog/cards/G9VirtualList.md +1 -1
- package/catalog/cards/G9WallpaperSwatch.md +16 -0
- package/catalog/cards/G9WidgetSkeleton.md +9 -0
- package/catalog/cards/G9WidgetSlot.md +13 -0
- package/catalog/cards/PopupFrame.md +2 -2
- package/catalog/catalog.json +9460 -2155
- package/catalog/index.md +20 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/appearance/appearance.css +264 -0
- package/dist/appearance/appearance.css.map +1 -0
- package/dist/appearance/appearance.d.ts +148 -0
- package/dist/appearance/appearance.d.ts.map +1 -0
- package/dist/appearance/appearance.jsx +604 -0
- package/dist/appearance/index.d.ts +2 -0
- package/dist/appearance/index.d.ts.map +1 -0
- package/dist/appearance/index.jsx +1 -0
- package/dist/base/control.d.ts +15 -0
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +13 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +1 -1
- package/dist/base/selection-item.d.ts +5 -0
- package/dist/base/selection-item.d.ts.map +1 -1
- package/dist/button/button.css +4 -0
- package/dist/button/button.css.map +1 -1
- package/dist/cascade/cascade.css +2 -0
- package/dist/cascade/cascade.css.map +1 -1
- package/dist/commands/commands.css +46 -0
- package/dist/commands/commands.css.map +1 -1
- package/dist/commands/index.d.ts +2 -2
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.jsx +2 -2
- package/dist/commands/keys.d.ts +15 -1
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.jsx +20 -1
- package/dist/commands/palette.d.ts +73 -7
- package/dist/commands/palette.d.ts.map +1 -1
- package/dist/commands/palette.jsx +174 -20
- package/dist/dashboard/dashboard.css +101 -0
- package/dist/dashboard/dashboard.css.map +1 -0
- package/dist/dashboard/dashboard.d.ts +73 -0
- package/dist/dashboard/dashboard.d.ts.map +1 -0
- package/dist/dashboard/dashboard.jsx +297 -0
- package/dist/dashboard/index.d.ts +3 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.jsx +2 -0
- package/dist/dashboard/model.d.ts +53 -0
- package/dist/dashboard/model.d.ts.map +1 -0
- package/dist/dashboard/model.jsx +76 -0
- package/dist/display/code.css +109 -0
- package/dist/display/code.css.map +1 -0
- package/dist/display/code.d.ts +43 -0
- package/dist/display/code.d.ts.map +1 -0
- package/dist/display/code.jsx +101 -0
- package/dist/display/extras.d.ts +7 -2
- package/dist/display/extras.d.ts.map +1 -1
- package/dist/display/extras.jsx +13 -4
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +10 -2
- package/dist/display/index.d.ts +1 -0
- package/dist/display/index.d.ts.map +1 -1
- package/dist/display/index.jsx +1 -0
- package/dist/display/motion-figures.css +2 -0
- package/dist/display/motion-figures.css.map +1 -1
- package/dist/display/motion-figures.d.ts.map +1 -1
- package/dist/display/motion-figures.jsx +14 -7
- package/dist/display/status.d.ts +1 -1
- package/dist/display/status.d.ts.map +1 -1
- package/dist/display/status.jsx +15 -3
- package/dist/display/theme-preview.css +4 -0
- package/dist/display/theme-preview.css.map +1 -1
- package/dist/effects/effects.d.ts.map +1 -1
- package/dist/effects/effects.jsx +8 -1
- package/dist/fields/extra-entries.css +1 -0
- package/dist/fields/extra-entries.css.map +1 -1
- package/dist/fields/extra-entries.d.ts +4 -1
- package/dist/fields/extra-entries.d.ts.map +1 -1
- package/dist/fields/extra-entries.jsx +54 -19
- package/dist/fields/fields.css +21 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/outlined-field.d.ts +9 -0
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +6 -1
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +36 -3
- package/dist/fields/text-entry.d.ts +4 -0
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +32 -25
- package/dist/fields/use-text-input.d.ts +3 -2
- package/dist/fields/use-text-input.d.ts.map +1 -1
- package/dist/fields/use-text-input.jsx +3 -0
- package/dist/header/app-bar.d.ts +6 -0
- package/dist/header/app-bar.d.ts.map +1 -1
- package/dist/header/app-bar.jsx +22 -8
- package/dist/header/header.css +14 -0
- package/dist/header/header.css.map +1 -1
- package/dist/host/bottom-overlays.d.ts +5 -0
- package/dist/host/bottom-overlays.d.ts.map +1 -1
- package/dist/host/bottom-overlays.jsx +17 -1
- package/dist/host/carry-contexts.d.ts +28 -0
- package/dist/host/carry-contexts.d.ts.map +1 -0
- package/dist/host/carry-contexts.jsx +76 -0
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +5 -1
- package/dist/host/index.d.ts +2 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.jsx +2 -0
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +13 -9
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/containers.d.ts.map +1 -1
- package/dist/layout/containers.jsx +2 -1
- package/dist/layout/layout.css +7 -0
- package/dist/layout/layout.css.map +1 -1
- package/dist/list/gestures.d.ts +39 -6
- package/dist/list/gestures.d.ts.map +1 -1
- package/dist/list/gestures.jsx +284 -89
- package/dist/list/index.d.ts +3 -2
- package/dist/list/index.d.ts.map +1 -1
- package/dist/list/index.jsx +2 -1
- package/dist/list/keyboard.d.ts +50 -0
- package/dist/list/keyboard.d.ts.map +1 -0
- package/dist/list/keyboard.jsx +117 -0
- package/dist/list/list.css +50 -5
- package/dist/list/list.css.map +1 -1
- package/dist/list/rows.d.ts +13 -1
- package/dist/list/rows.d.ts.map +1 -1
- package/dist/list/rows.jsx +42 -23
- package/dist/list/virtual-list.d.ts +27 -1
- package/dist/list/virtual-list.d.ts.map +1 -1
- package/dist/list/virtual-list.jsx +49 -4
- package/dist/notifications/index.d.ts +3 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.jsx +2 -0
- package/dist/notifications/model.d.ts +47 -0
- package/dist/notifications/model.d.ts.map +1 -0
- package/dist/notifications/model.jsx +51 -0
- package/dist/notifications/notification-center.d.ts +98 -0
- package/dist/notifications/notification-center.d.ts.map +1 -0
- package/dist/notifications/notification-center.jsx +424 -0
- package/dist/notifications/notifications.css +266 -0
- package/dist/notifications/notifications.css.map +1 -0
- package/dist/orb/orb.css +2 -0
- package/dist/orb/orb.css.map +1 -1
- package/dist/pickers/pickers.css +15 -0
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/plus-button/plus-button.css +2 -0
- package/dist/plus-button/plus-button.css.map +1 -1
- package/dist/plus-button/plus-button.d.ts.map +1 -1
- package/dist/plus-button/plus-button.jsx +2 -1
- package/dist/popover/popover.css +23 -1
- package/dist/popover/popover.css.map +1 -1
- package/dist/popover/popover.d.ts +14 -0
- package/dist/popover/popover.d.ts.map +1 -1
- package/dist/popover/popover.jsx +73 -12
- package/dist/popover/position.d.ts +6 -2
- package/dist/popover/position.d.ts.map +1 -1
- package/dist/popover/position.jsx +15 -4
- package/dist/popup/popup.css +3 -0
- package/dist/popup/popup.css.map +1 -1
- package/dist/provider/direction-scope.d.ts +8 -0
- package/dist/provider/direction-scope.d.ts.map +1 -1
- package/dist/provider/direction-scope.jsx +13 -2
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/provider.css +7 -0
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts +6 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +22 -2
- package/dist/provider/settings.d.ts +14 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +4 -1
- package/dist/range-slider/index.d.ts +1 -1
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/range-slider.css +69 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.d.ts +22 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -1
- package/dist/range-slider/range-slider.jsx +34 -5
- package/dist/reader/index.d.ts +2 -0
- package/dist/reader/index.d.ts.map +1 -0
- package/dist/reader/index.jsx +1 -0
- package/dist/reader/reader.css +74 -0
- package/dist/reader/reader.css.map +1 -0
- package/dist/reader/reader.d.ts +76 -0
- package/dist/reader/reader.d.ts.map +1 -0
- package/dist/reader/reader.jsx +149 -0
- package/dist/route/index.d.ts +2 -0
- package/dist/route/index.d.ts.map +1 -1
- package/dist/route/index.jsx +2 -0
- package/dist/route/path-navigator.css +42 -0
- package/dist/route/path-navigator.css.map +1 -0
- package/dist/route/path-navigator.d.ts +25 -0
- package/dist/route/path-navigator.d.ts.map +1 -0
- package/dist/route/path-navigator.jsx +98 -0
- package/dist/route/path-router.d.ts +162 -0
- package/dist/route/path-router.d.ts.map +1 -0
- package/dist/route/path-router.jsx +327 -0
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +23 -10
- package/dist/selection/selection.css +18 -1
- package/dist/selection/selection.css.map +1 -1
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +9 -8
- package/dist/sheet/options.d.ts +6 -1
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -1
- package/dist/sheet/panel-frame.d.ts.map +1 -1
- package/dist/sheet/panel-frame.jsx +5 -4
- package/dist/sheet/sizing.d.ts +3 -3
- package/dist/sheet/sizing.d.ts.map +1 -1
- package/dist/sheet/sizing.jsx +1 -0
- package/dist/shell/shell.css +18 -1
- package/dist/shell/shell.css.map +1 -1
- package/dist/shell/shell.d.ts +10 -1
- package/dist/shell/shell.d.ts.map +1 -1
- package/dist/shell/shell.jsx +13 -9
- package/dist/survey/survey.css +15 -0
- package/dist/survey/survey.css.map +1 -1
- package/dist/survey/survey.d.ts +6 -0
- package/dist/survey/survey.d.ts.map +1 -1
- package/dist/survey/survey.jsx +24 -6
- package/dist/swipe/swipe.css +2 -0
- package/dist/swipe/swipe.css.map +1 -1
- package/dist/tab-bar/flat.d.ts.map +1 -1
- package/dist/tab-bar/flat.jsx +53 -38
- package/dist/tab-bar/tab-bar.css +2 -0
- package/dist/tab-bar/tab-bar.css.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +28 -6
- package/dist/tabs/tab-view.jsx +10 -3
- package/dist/tabs/tabs.css +5 -0
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +18 -5
- package/dist/toast/store.d.ts +22 -0
- package/dist/toast/store.d.ts.map +1 -1
- package/dist/toast/store.jsx +35 -3
- package/dist/toast/toast.css +22 -0
- package/dist/toast/toast.css.map +1 -1
- package/dist/toggle/checkbox.d.ts +5 -0
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +7 -2
- package/dist/toggle/choice.css +35 -0
- package/dist/toggle/choice.css.map +1 -1
- package/dist/toggle/choice.d.ts +45 -0
- package/dist/toggle/choice.d.ts.map +1 -1
- package/dist/toggle/choice.jsx +97 -23
- package/dist/toggle/index.d.ts +1 -1
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/toggle/index.jsx +1 -1
- package/package.json +22 -2
- package/skills/g9-lynx-app/references/catalog-index.md +24 -8
- package/skills/g9-lynx-app/references/components/appearance.md +70 -0
- package/skills/g9-lynx-app/references/components/barcode.md +1 -1
- package/skills/g9-lynx-app/references/components/button.md +4 -4
- package/skills/g9-lynx-app/references/components/calendar-1.md +205 -0
- package/skills/g9-lynx-app/references/components/calendar-2.md +36 -0
- package/skills/g9-lynx-app/references/components/canvas.md +33 -0
- package/skills/g9-lynx-app/references/components/chat-1.md +199 -0
- package/skills/g9-lynx-app/references/components/chat-2.md +119 -0
- package/skills/g9-lynx-app/references/components/commands.md +10 -2
- package/skills/g9-lynx-app/references/components/commerce.md +1 -1
- package/skills/g9-lynx-app/references/components/dashboard.md +61 -0
- package/skills/g9-lynx-app/references/components/display-1.md +22 -21
- package/skills/g9-lynx-app/references/components/display-2.md +36 -39
- package/skills/g9-lynx-app/references/components/display-3.md +41 -2
- package/skills/g9-lynx-app/references/components/fields.md +5 -5
- package/skills/g9-lynx-app/references/components/header.md +1 -1
- package/skills/g9-lynx-app/references/components/host.md +11 -0
- package/skills/g9-lynx-app/references/components/layout-1.md +1 -1
- package/skills/g9-lynx-app/references/components/list.md +7 -5
- package/skills/g9-lynx-app/references/components/map.md +19 -1
- package/skills/g9-lynx-app/references/components/media-1.md +203 -0
- package/skills/g9-lynx-app/references/components/media-2.md +66 -0
- package/skills/g9-lynx-app/references/components/notifications.md +37 -0
- package/skills/g9-lynx-app/references/components/popover.md +4 -2
- package/skills/g9-lynx-app/references/components/popup.md +2 -2
- package/skills/g9-lynx-app/references/components/projects.md +73 -0
- package/skills/g9-lynx-app/references/components/provider.md +1 -1
- package/skills/g9-lynx-app/references/components/range-slider.md +2 -2
- package/skills/g9-lynx-app/references/components/reader.md +37 -0
- package/skills/g9-lynx-app/references/components/richtext.md +54 -0
- package/skills/g9-lynx-app/references/components/route.md +14 -0
- package/skills/g9-lynx-app/references/components/shell.md +3 -2
- package/skills/g9-lynx-app/references/components/toggle.md +20 -3
- package/skills/g9-lynx-app/references/provider-and-host.md +4 -3
- package/skills/g9-lynx-app/references/components/calendar.md +0 -128
- package/skills/g9-lynx-app/references/components/chat.md +0 -98
- package/skills/g9-lynx-app/references/components/media.md +0 -115
package/dist/list/list.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.g9-list-row {
|
|
2
2
|
background-color: var(--g9-surface);
|
|
3
|
+
--g9-field-notch-background: var(--g9-surface);
|
|
3
4
|
align-items: center;
|
|
4
5
|
column-gap: 12px;
|
|
5
6
|
padding: 8px 16px;
|
|
@@ -17,6 +18,26 @@
|
|
|
17
18
|
transition: background-color .12s ease-out;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
.g9-list-row--tint:active {
|
|
22
|
+
background-color: var(--g9-default-pressed);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.g9-list-row--stacked {
|
|
26
|
+
align-items: stretch;
|
|
27
|
+
row-gap: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.g9-list-row__main {
|
|
31
|
+
align-items: center;
|
|
32
|
+
column-gap: 12px;
|
|
33
|
+
display: flex;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.g9-list-row__below {
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
40
|
+
|
|
20
41
|
.g9-list-row__edge {
|
|
21
42
|
width: 3px;
|
|
22
43
|
position: absolute;
|
|
@@ -53,7 +74,9 @@
|
|
|
53
74
|
font-size: 15px;
|
|
54
75
|
font-family: var(--g9-font-text);
|
|
55
76
|
color: var(--g9-text-primary);
|
|
77
|
+
text-overflow: ellipsis;
|
|
56
78
|
line-height: 24px;
|
|
79
|
+
overflow: hidden;
|
|
57
80
|
}
|
|
58
81
|
|
|
59
82
|
.g9-list-row__title--plain {
|
|
@@ -87,15 +110,19 @@
|
|
|
87
110
|
font-size: 12px;
|
|
88
111
|
font-family: var(--g9-font-text);
|
|
89
112
|
color: var(--g9-text-secondary);
|
|
113
|
+
text-overflow: ellipsis;
|
|
90
114
|
line-height: 19px;
|
|
115
|
+
overflow: hidden;
|
|
91
116
|
}
|
|
92
117
|
|
|
93
118
|
.g9-list-row__value {
|
|
94
119
|
font-size: 14px;
|
|
95
120
|
font-family: var(--g9-font-text);
|
|
96
121
|
color: var(--g9-text-secondary);
|
|
122
|
+
text-overflow: ellipsis;
|
|
97
123
|
flex-shrink: 0;
|
|
98
124
|
max-width: 45%;
|
|
125
|
+
overflow: hidden;
|
|
99
126
|
}
|
|
100
127
|
|
|
101
128
|
.g9-settings {
|
|
@@ -126,6 +153,7 @@
|
|
|
126
153
|
border-width: 1px;
|
|
127
154
|
border-color: var(--g9-card-border);
|
|
128
155
|
background-color: var(--g9-surface);
|
|
156
|
+
--g9-field-notch-background: var(--g9-surface);
|
|
129
157
|
flex-direction: column;
|
|
130
158
|
display: flex;
|
|
131
159
|
overflow: hidden;
|
|
@@ -200,16 +228,29 @@
|
|
|
200
228
|
min-height: 0;
|
|
201
229
|
}
|
|
202
230
|
|
|
203
|
-
.g9-drag-list {
|
|
231
|
+
.g9-drag-list, .g9-drag-list__row {
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
display: flex;
|
|
204
234
|
position: relative;
|
|
205
235
|
}
|
|
206
236
|
|
|
207
|
-
.g9-drag-
|
|
237
|
+
.g9-drag-list__inner {
|
|
208
238
|
flex-direction: column;
|
|
209
239
|
display: flex;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.g9-drag-list__handle {
|
|
243
|
+
flex-shrink: 0;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
align-items: center;
|
|
246
|
+
width: 40px;
|
|
247
|
+
height: 40px;
|
|
248
|
+
display: flex;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.g9-drag-list__handle-icon {
|
|
252
|
+
width: 20px;
|
|
253
|
+
height: 20px;
|
|
213
254
|
}
|
|
214
255
|
|
|
215
256
|
.g9-drag-list__row--lifted {
|
|
@@ -225,5 +266,9 @@
|
|
|
225
266
|
display: flex;
|
|
226
267
|
}
|
|
227
268
|
|
|
269
|
+
.g9-vlist__item--active {
|
|
270
|
+
background-color: var(--g9-default-pressed);
|
|
271
|
+
}
|
|
272
|
+
|
|
228
273
|
|
|
229
274
|
/*# sourceMappingURL=list.css.map */
|
package/dist/list/list.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/list/list.css"],"names":[],"mappings":"AACA;EAAE,mCAAmC;EACnC,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;EACb,kBAAkB;AACpB;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/list/list.css"],"names":[],"mappings":"AACA;EAAE,mCAAmC;EACnC,8CAA8C;EAC9C,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;EACb,kBAAkB;AACpB;;AAIA;EADE,0BAA0B;EAC1B,wBAAwB;EACxB,sCAAsC;AACxC;;AAIA;EADE,0CAA0C;AAC5C;;AAKA;EAFE,2CAA2C;AAC7C;;AAMA;EAHE,oBAAoB;EACpB,YAAY;AACd;;AAMA;EAHE,mBAAmB;EACnB,gBAAgB;EAChB,aAAa;AACf;;AAMA;EAHE,sBAAsB;EACtB,aAAa;AACf;;AAMA;EAHE,UAAU;EACV,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AAOA;EAJE,OAAO;AACT;;AAOA;EAJE,QAAQ;AACV;;AAOA;EAJE,mBAAmB;EACnB,cAAc;EACd,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;EAC7B,uBAAuB;EACvB,iBAAiB;EACjB,gBAAgB;AAClB;;AAQA;EALE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;EAC/B,iBAAiB;AACnB;;AAQA;EALE,eAAe;EACf,oCAAoC;EACpC,iBAAiB;EACjB,iBAAiB;AACnB;;AAQA;EALE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;EAC9B,eAAe;EACf,iBAAiB;AACnB;;AAQA;EALE,sBAAsB;EACtB,gCAAgC;AAClC;;AAQA;EALE,eAAe;EACf,gCAAgC;EAChC,+BAA+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,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAoBA;EAjBE,WAAW;EACX,YAAY;AACd;;AAoBA;EAjBE,UAAU;EACV,YAAY;EACZ,mCAAmC;EACnC,gCAAgC;AAClC;;AAqBA;EAlBE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAsBA;EAnBE,2CAA2C;AAC7C","sourcesContent":["/* G9ListRow, G9SettingsGroup, G9Pager, G9VirtualList. */\n.g9-list-row {\n display: flex;\n align-items: center;\n position: relative;\n column-gap: 12px;\n padding: 8px 16px;\n background-color: var(--g9-surface);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface);\n}\n\n.g9-list-row--divider {\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: var(--g9-divider);\n}\n\n.g9-list-row--pressable {\n transition: background-color 120ms ease-out;\n}\n\n/* pressFeedback 'tint' (2.5.7): the state layer while the finger is down, drawn natively. */\n.g9-list-row--tint:active {\n background-color: var(--g9-default-pressed);\n}\n\n/* `below` (2.5.7): the row over full-width content, one block. */\n.g9-list-row--stacked {\n align-items: stretch;\n row-gap: 8px;\n}\n\n.g9-list-row__main {\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n\n.g9-list-row__below {\n display: flex;\n flex-direction: column;\n}\n\n.g9-list-row__edge {\n position: absolute;\n top: 0px;\n bottom: 0px;\n width: 3px;\n}\n\n/* the reading direction, explicit: Lynx does not inherit `direction`, so a logical property inside a page reads LTR */\n.g9-list-row__edge--ltr {\n left: 0px;\n}\n\n.g9-list-row__edge--rtl {\n right: 0px;\n}\n\n.g9-list-row__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 11px;\n flex-shrink: 0;\n}\n\n.g9-list-row__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-list-row__title {\n font-size: 15px;\n font-family: var(--g9-font-text);\n line-height: 24px;\n color: var(--g9-text-primary);\n /* a text-maxline text on Android draws its other lines out of the box unless it clips (2.5.8) */\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-list-row__title--plain {\n font-size: 14px;\n font-family: var(--g9-font-text);\n line-height: 20px;\n color: var(--g9-text-secondary);\n}\n\n.g9-list-row__title--strong {\n font-size: 14px;\n font-family: var(--g9-font-text-700);\n line-height: 21px;\n font-weight: bold;\n}\n\n.g9-list-row__hint {\n font-size: 11px;\n font-family: var(--g9-font-text);\n line-height: 16px;\n color: var(--g9-text-tertiary);\n margin-top: 2px;\n}\n\n.g9-list-row__title--danger {\n color: var(--g9-error);\n font-family: var(--g9-font-text);\n}\n\n.g9-list-row__subtitle {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-secondary);\n /* a text-maxline text on Android draws its other lines out of the box unless it clips (2.5.8) */\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-list-row__value {\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n flex-shrink: 0;\n max-width: 45%;\n /* a text-maxline text on Android draws its other lines out of the box unless it clips (2.5.8) */\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-settings {\n display: flex;\n flex-direction: column;\n row-gap: 6px;\n}\n\n.g9-settings__title {\n padding: 0px 4px;\n font-size: 13px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-text-secondary);\n}\n\n.g9-settings__description {\n padding: 0px 4px;\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-settings__card {\n display: flex;\n flex-direction: column;\n border-radius: var(--g9-radius-card);\n overflow: hidden;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-card-border);\n background-color: var(--g9-surface);\n /* a floated field label on this surface notches in its colour (G9Hub, 2.5.7) */\n --g9-field-notch-background: var(--g9-surface);\n}\n\n.g9-settings__footer {\n display: flex;\n flex-direction: column;\n padding: 0px 4px;\n}\n\n.g9-pager {\n display: flex;\n align-items: center;\n justify-content: center;\n column-gap: 12px;\n padding: 8px 0px;\n}\n\n.g9-pager__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 20px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-pager__btn--off {\n opacity: 0.35;\n}\n\n.g9-pager__label {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-vlist {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-vlist--empty {\n display: flex;\n flex-direction: column;\n}\n\n/* G9PullToRefresh */\n.g9-ptr {\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0px;\n overflow: hidden;\n}\n\n.g9-ptr__indicator {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-ptr__scroll {\n flex: 1;\n min-height: 0px;\n}\n\n/* G9DragList */\n.g9-drag-list {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\n/* Rows in the flow (any height, measured); a lifted row moves on the main thread through its inner view (2.5.8). */\n.g9-drag-list__row {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\n.g9-drag-list__inner {\n display: flex;\n flex-direction: column;\n}\n\n.g9-drag-list__handle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n flex-shrink: 0;\n}\n\n.g9-drag-list__handle-icon {\n width: 20px;\n height: 20px;\n}\n\n.g9-drag-list__row--lifted {\n z-index: 2;\n opacity: 0.95;\n box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.22);\n background-color: var(--g9-surface);\n}\n\n/* A readable list's last row is measured through this wrapper (its height decides how it lands). */\n.g9-vlist__measure {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n/* The keyboard's active row of a G9VirtualList (2.5.8). */\n.g9-vlist__item--active {\n background-color: var(--g9-default-pressed);\n}\n"],"sourceRoot":""}
|
package/dist/list/rows.d.ts
CHANGED
|
@@ -44,6 +44,15 @@ export interface G9ListRowProps extends G9ControlBaseProps {
|
|
|
44
44
|
readonly strongTitle?: boolean;
|
|
45
45
|
/** Double-tap guard in ms (see `useG9Press`); 0 = every tap counts (a hidden tap-counting target). */
|
|
46
46
|
readonly pressGuardMs?: number;
|
|
47
|
+
/** Lines the subtitle may take. Default 2 (G9Hub, 2.5.7). */
|
|
48
|
+
readonly subtitleLines?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Content under the row at its full width (a stacked setting's control: a slider, a segmented choice; G9Hub, 2.5.7).
|
|
51
|
+
* The row then stands over it in one block, one divider under both.
|
|
52
|
+
*/
|
|
53
|
+
readonly below?: ReactNode;
|
|
54
|
+
/** `'tint'`: a pressable row's background darkens while pressed (`--g9-default-pressed`). Default `'none'`. */
|
|
55
|
+
readonly pressFeedback?: 'none' | 'tint';
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
58
|
* One line of a list (SAC kit ListRow, ShopManager Row, G9Hub SettingsRow): icon or avatar at the start, title and a
|
|
@@ -68,7 +77,10 @@ export interface G9SettingsGroupProps {
|
|
|
68
77
|
readonly footer?: ReactNode;
|
|
69
78
|
readonly children?: ReactNode;
|
|
70
79
|
}
|
|
71
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Rows grouped in a card with a title and a note (G9Hub SettingsGroup, iOS grouped lists). A last `G9ListRow` (or
|
|
82
|
+
* `G9SwitchRow`) without its own `divider` draws none — the card's edge closes it.
|
|
83
|
+
*/
|
|
72
84
|
export declare function G9SettingsGroup(props: G9SettingsGroupProps): ReactNode;
|
|
73
85
|
/** Props of {@link G9Pager}. */
|
|
74
86
|
export interface G9PagerProps extends G9ControlBaseProps {
|
package/dist/list/rows.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/list/r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C,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CA2BtE;AAID,gCAAgC;AAChC,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACtE;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAmDtD"}
|
package/dist/list/rows.jsx
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import "./list.css";
|
|
2
2
|
import { G9Glyph } from "@g9tm/lynxcontrols-foundation";
|
|
3
|
-
import { Children, memo } from "@lynx-js/react";
|
|
4
|
-
import { g9ChildId, g9IdProps, g9RowStyle, g9TextStart, mergeStyle, useG9Control } from "../base/control.jsx";
|
|
3
|
+
import { Children, cloneElement, isValidElement, memo } from "@lynx-js/react";
|
|
4
|
+
import { g9ChildId, g9IdProps, g9Paragraph, g9RowStyle, g9TextStart, mergeStyle, useG9Control } from "../base/control.jsx";
|
|
5
5
|
import { useG9Press } from "../base/press.jsx";
|
|
6
6
|
import { toneColors } from "../base/tone.jsx";
|
|
7
7
|
import { G9Icon } from "../icon/icon.jsx";
|
|
8
|
+
import { G9Slot } from "../provider/direction-scope.jsx";
|
|
8
9
|
import { useG9Direction } from "../provider/hooks.jsx";
|
|
9
10
|
import { G9Switch } from "../toggle/switch.jsx";
|
|
10
11
|
const G9ListRow = memo(function(props) {
|
|
11
|
-
var _props_iconTone, _props_chevron,
|
|
12
|
+
var _props_iconTone, _props_chevron, _props_iconSize, _props_iconColor, _props_iconSize1, _props_iconColor1, _props_titleLines, _props_subtitleLines, _props_minHeight, _props_minHeight1, _props_accessibilityLabel;
|
|
12
13
|
const control = useG9Control(props, 'g9-list-row', props.onPress ? {
|
|
13
14
|
kind: 'button',
|
|
14
15
|
label: ()=>{
|
|
@@ -29,39 +30,51 @@ const G9ListRow = memo(function(props) {
|
|
|
29
30
|
const plainIcon = 'plain' === props.iconAppearance;
|
|
30
31
|
const icon = toneColors(props.danger ? 'error' : null != (_props_iconTone = props.iconTone) ? _props_iconTone : 'neutral', 'soft');
|
|
31
32
|
const chevron = null != (_props_chevron = props.chevron) ? _props_chevron : void 0 !== props.onPress && !props.trailing && !props.value;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})} {...props.onPress ? {
|
|
36
|
-
bindtap: press,
|
|
37
|
-
'accessibility-element': true,
|
|
38
|
-
'accessibility-traits': 'button',
|
|
39
|
-
'accessibility-label': null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.title
|
|
40
|
-
} : {}}>
|
|
41
|
-
{props.edge ? <view className={`g9-list-row__edge g9-list-row__edge--${control.direction}`} style={{
|
|
42
|
-
backgroundColor: props.edge
|
|
43
|
-
}}/> : null}
|
|
44
|
-
{null != (_props_leading = props.leading) ? _props_leading : props.icon ? plainIcon ? <G9Icon icon={props.icon} size={null != (_props_iconSize = props.iconSize) ? _props_iconSize : 22} color={null != (_props_iconColor = props.iconColor) ? _props_iconColor : props.danger ? icon.foreground : 'var(--g9-primary)'}/> : <view className="g9-list-row__icon" style={{
|
|
33
|
+
const stacked = void 0 !== props.below && null !== props.below && false !== props.below;
|
|
34
|
+
const main = <>
|
|
35
|
+
{null != props.leading ? <G9Slot>{props.leading}</G9Slot> : props.icon ? plainIcon ? <G9Icon icon={props.icon} size={null != (_props_iconSize = props.iconSize) ? _props_iconSize : 22} color={null != (_props_iconColor = props.iconColor) ? _props_iconColor : props.danger ? icon.foreground : 'var(--g9-primary)'}/> : <view className="g9-list-row__icon" style={{
|
|
45
36
|
backgroundColor: icon.background
|
|
46
37
|
}}>
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
<G9Icon icon={props.icon} size={null != (_props_iconSize1 = props.iconSize) ? _props_iconSize1 : 18} color={null != (_props_iconColor1 = props.iconColor) ? _props_iconColor1 : icon.foreground}/>
|
|
39
|
+
</view> : null}
|
|
49
40
|
<view className="g9-list-row__text">
|
|
50
41
|
<text className={`g9-list-row__title${props.plainTitle ? ' g9-list-row__title--plain' : props.strongTitle ? ' g9-list-row__title--strong' : ''}${props.danger ? ' g9-list-row__title--danger' : ''}`} text-maxline={String(null != (_props_titleLines = props.titleLines) ? _props_titleLines : 1)} style={g9TextStart(control.direction)}>
|
|
51
42
|
{props.title}
|
|
52
43
|
</text>
|
|
53
|
-
{props.subtitle ? <text className="g9-list-row__subtitle" text-maxline=
|
|
54
|
-
{props.subtitle}
|
|
44
|
+
{props.subtitle ? <text className="g9-list-row__subtitle" text-maxline={String(null != (_props_subtitleLines = props.subtitleLines) ? _props_subtitleLines : 2)} style={g9TextStart(control.direction)}>
|
|
45
|
+
{g9Paragraph(props.subtitle, control.direction)}
|
|
55
46
|
</text> : null}
|
|
56
47
|
{props.hint ? <text className="g9-list-row__hint" style={g9TextStart(control.direction)}>
|
|
57
|
-
{props.hint}
|
|
48
|
+
{g9Paragraph(props.hint, control.direction)}
|
|
58
49
|
</text> : null}
|
|
59
50
|
</view>
|
|
60
51
|
{props.value ? <text className="g9-list-row__value" text-maxline="1">
|
|
61
52
|
{props.value}
|
|
62
53
|
</text> : null}
|
|
63
|
-
{props.trailing}
|
|
54
|
+
<G9Slot>{props.trailing}</G9Slot>
|
|
64
55
|
{chevron ? <G9Icon icon={'rtl' === control.direction ? G9Glyph.ChevronLeft : G9Glyph.ChevronRight} size={18} color="var(--g9-text-tertiary)"/> : null}
|
|
56
|
+
</>;
|
|
57
|
+
return <view className={`${control.className}${false === props.divider ? '' : ' g9-list-row--divider'}${props.onPress ? ' g9-list-row--pressable' : ''}${props.onPress && 'tint' === props.pressFeedback ? ' g9-list-row--tint' : ''}${stacked ? ' g9-list-row--stacked' : ''}`} {...control.idProps} style={control.rootStyle(stacked ? {
|
|
58
|
+
flexDirection: 'column',
|
|
59
|
+
minHeight: `${null != (_props_minHeight = props.minHeight) ? _props_minHeight : 56}px`
|
|
60
|
+
} : {
|
|
61
|
+
...g9RowStyle(control.direction),
|
|
62
|
+
minHeight: `${null != (_props_minHeight1 = props.minHeight) ? _props_minHeight1 : 56}px`
|
|
63
|
+
})} {...props.onPress ? {
|
|
64
|
+
bindtap: press,
|
|
65
|
+
'accessibility-element': true,
|
|
66
|
+
'accessibility-traits': 'button',
|
|
67
|
+
'accessibility-label': null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.title
|
|
68
|
+
} : {}}>
|
|
69
|
+
{props.edge ? <view className={`g9-list-row__edge g9-list-row__edge--${control.direction}`} style={{
|
|
70
|
+
backgroundColor: props.edge
|
|
71
|
+
}}/> : null}
|
|
72
|
+
{stacked ? <>
|
|
73
|
+
<view className="g9-list-row__main" style={g9RowStyle(control.direction)}>
|
|
74
|
+
{main}
|
|
75
|
+
</view>
|
|
76
|
+
<view className="g9-list-row__below">{props.below}</view>
|
|
77
|
+
</> : main}
|
|
65
78
|
</view>;
|
|
66
79
|
});
|
|
67
80
|
function G9SwitchRow(props) {
|
|
@@ -71,7 +84,13 @@ function G9SwitchRow(props) {
|
|
|
71
84
|
} : {}} checked={checked} onCheckedChange={onCheckedChange}/>} chevron={false}/>;
|
|
72
85
|
}
|
|
73
86
|
function G9SettingsGroup(props) {
|
|
74
|
-
const rows =
|
|
87
|
+
const rows = [
|
|
88
|
+
...Children.toArray(props.children)
|
|
89
|
+
];
|
|
90
|
+
const last = rows[rows.length - 1];
|
|
91
|
+
if (isValidElement(last) && (last.type === G9ListRow || last.type === G9SwitchRow) && void 0 === last.props.divider) rows[rows.length - 1] = cloneElement(last, {
|
|
92
|
+
divider: false
|
|
93
|
+
});
|
|
75
94
|
return <view className={`g9-settings${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)} style={mergeStyle(void 0, props.style)}>
|
|
76
95
|
{props.title ? <text className="g9-settings__title" accessibility-element={true} accessibility-traits="header">
|
|
77
96
|
{props.title}
|
|
@@ -9,7 +9,14 @@ export interface G9VirtualListProps<T> {
|
|
|
9
9
|
readonly items: readonly T[];
|
|
10
10
|
/** A stable, unique key per item (wrong or colliding keys make Lynx's recycler show the wrong cell). */
|
|
11
11
|
readonly getKey: (item: T, index: number) => string;
|
|
12
|
-
|
|
12
|
+
/** A row. `state.active`: it is the keyboard's active row (`keyboard`). */
|
|
13
|
+
readonly renderItem: (item: T, index: number, state: G9VirtualRowState) => ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Keyboard navigation on hosts with a keyboard (G9Hub's mail lists, 2.5.8): J/K and the arrows move an active row
|
|
16
|
+
* (drawn with a state layer, scrolled to the middle, said by its accessibility status), Home/End jump, Enter
|
|
17
|
+
* activates, typing jumps by `labelOf`.
|
|
18
|
+
*/
|
|
19
|
+
readonly keyboard?: G9VirtualListKeyboard<T>;
|
|
13
20
|
/**
|
|
14
21
|
* Height (width when horizontal) of an item before it is measured, in px — the recycler sizes its scroll bar and jumps
|
|
15
22
|
* with it. A number for all, or per item (headers vs rows). Default 56.
|
|
@@ -90,6 +97,25 @@ export interface G9VirtualListProps<T> {
|
|
|
90
97
|
*/
|
|
91
98
|
readonly reuseKey?: (item: T, index: number) => string;
|
|
92
99
|
}
|
|
100
|
+
/** What a row is told besides its item. */
|
|
101
|
+
export interface G9VirtualRowState {
|
|
102
|
+
readonly active: boolean;
|
|
103
|
+
}
|
|
104
|
+
/** {@link G9VirtualListProps.keyboard}. */
|
|
105
|
+
export interface G9VirtualListKeyboard<T> {
|
|
106
|
+
readonly onActivate: (item: T, index: number) => void;
|
|
107
|
+
/** A row's words for type-ahead. */
|
|
108
|
+
readonly labelOf?: (item: T, index: number) => string;
|
|
109
|
+
/** Default true. */
|
|
110
|
+
readonly enabled?: boolean;
|
|
111
|
+
/** J and K too. Default true. */
|
|
112
|
+
readonly vim?: boolean;
|
|
113
|
+
readonly wrap?: boolean;
|
|
114
|
+
/** Rows that cannot be active (headings). */
|
|
115
|
+
readonly skip?: (item: T, index: number) => boolean;
|
|
116
|
+
/** After the active row changed. */
|
|
117
|
+
readonly onActiveChange?: (item: T | undefined, index: number) => void;
|
|
118
|
+
}
|
|
93
119
|
/** What {@link G9VirtualListProps.handleRef} receives. */
|
|
94
120
|
export interface G9VirtualListHandle {
|
|
95
121
|
/** Scrolls to the item with this key: its top (`'start'`, default) or bottom (`'end'`) at the list's edge. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../src/list/virtual-list.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,EAAQ,KAAK,SAAS,EAAwC,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../src/list/virtual-list.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,EAAQ,KAAK,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
2
2
|
import { memo, useEffect, useMemo, useRef, useState } from "@lynx-js/react";
|
|
3
3
|
import { g9IdProps, mergeStyle } from "../base/control.jsx";
|
|
4
|
+
import { useG9Direction } from "../provider/hooks.jsx";
|
|
5
|
+
import { useG9ListKeyboard } from "./keyboard.jsx";
|
|
4
6
|
function g9ReadableLanding(listHeight, itemHeight, gap) {
|
|
5
7
|
return listHeight > 0 && itemHeight > listHeight - 2 * gap ? {
|
|
6
8
|
alignTo: 'top',
|
|
@@ -40,6 +42,16 @@ const g9ListNextBatch = 96;
|
|
|
40
42
|
const Cell = memo(function(props) {
|
|
41
43
|
return props.render();
|
|
42
44
|
});
|
|
45
|
+
const ACTIVE_ITEM = Object.freeze({
|
|
46
|
+
className: 'g9-vlist__item--active',
|
|
47
|
+
'accessibility-status': 'selected'
|
|
48
|
+
});
|
|
49
|
+
const INACTIVE = Object.freeze({
|
|
50
|
+
active: false
|
|
51
|
+
});
|
|
52
|
+
const ACTIVE = Object.freeze({
|
|
53
|
+
active: true
|
|
54
|
+
});
|
|
43
55
|
const DEFER_UNMOUNT = Object.freeze({
|
|
44
56
|
unmountRecycled: true
|
|
45
57
|
});
|
|
@@ -48,6 +60,36 @@ function G9VirtualList(props) {
|
|
|
48
60
|
const est = null != (_props_estimatedSize = props.estimatedSize) ? _props_estimatedSize : 56;
|
|
49
61
|
const render = useRef(props.renderItem);
|
|
50
62
|
render.current = props.renderItem;
|
|
63
|
+
const rtl = 'rtl' === useG9Direction();
|
|
64
|
+
const kb = props.keyboard;
|
|
65
|
+
const nav = useG9ListKeyboard({
|
|
66
|
+
count: kb ? props.items.length : 0,
|
|
67
|
+
enabled: void 0 !== kb && false !== kb.enabled,
|
|
68
|
+
...(null == kb ? void 0 : kb.vim) !== void 0 ? {
|
|
69
|
+
vim: kb.vim
|
|
70
|
+
} : {},
|
|
71
|
+
...(null == kb ? void 0 : kb.wrap) !== void 0 ? {
|
|
72
|
+
wrap: kb.wrap
|
|
73
|
+
} : {},
|
|
74
|
+
...props.horizontal ? {
|
|
75
|
+
horizontal: true,
|
|
76
|
+
rtl
|
|
77
|
+
} : {},
|
|
78
|
+
...(null == kb ? void 0 : kb.skip) ? {
|
|
79
|
+
skip: (i)=>kb.skip(props.items[i], i)
|
|
80
|
+
} : {},
|
|
81
|
+
...(null == kb ? void 0 : kb.labelOf) ? {
|
|
82
|
+
labelOf: (i)=>kb.labelOf(props.items[i], i)
|
|
83
|
+
} : {},
|
|
84
|
+
onActivate: (i)=>null == kb ? void 0 : kb.onActivate(props.items[i], i),
|
|
85
|
+
onActiveChange: (i)=>{
|
|
86
|
+
var _kb_onActiveChange, _scrollActive_current;
|
|
87
|
+
null == kb || null == (_kb_onActiveChange = kb.onActiveChange) || _kb_onActiveChange.call(kb, props.items[i], i);
|
|
88
|
+
if (i >= 0) null == (_scrollActive_current = scrollActive.current) || _scrollActive_current.call(scrollActive, i);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const scrollActive = useRef(null);
|
|
92
|
+
const activeKey = nav.active >= 0 && void 0 !== props.items[nav.active] ? props.getKey(props.items[nav.active], nav.active) : null;
|
|
51
93
|
const initial = null != (_props_initialIndex = props.initialIndex) ? _props_initialIndex : props.startAtEnd ? Math.max(0, props.items.length - 1) : void 0;
|
|
52
94
|
const columns = Math.max(1, null != (_props_columns = props.columns) ? _props_columns : 1);
|
|
53
95
|
const listType = 'waterfall' === props.kind ? 'waterfall' : columns > 1 ? 'flow' : 'single';
|
|
@@ -108,6 +150,7 @@ function G9VirtualList(props) {
|
|
|
108
150
|
return false;
|
|
109
151
|
}
|
|
110
152
|
};
|
|
153
|
+
scrollActive.current = (i)=>void scrollTo(i + (props.header ? 1 : 0), 'middle', 0, true);
|
|
111
154
|
const atEnd = useRef(true);
|
|
112
155
|
const landRef = useRef(null);
|
|
113
156
|
const [watcher] = useState(()=>g9LastRowWatcher({
|
|
@@ -184,13 +227,14 @@ function G9VirtualList(props) {
|
|
|
184
227
|
'full-span': true
|
|
185
228
|
} : {};
|
|
186
229
|
const reuse = props.reuseKey ? props.reuseKey(item, index) : void 0;
|
|
187
|
-
const
|
|
230
|
+
const active = key === activeKey;
|
|
231
|
+
const plain = <Cell item={item} active={active} render={()=>render.current(item, index, active ? ACTIVE : INACTIVE)}/>;
|
|
188
232
|
const cell = readable && index === lastIndex ? <view className="g9-vlist__measure" bindlayoutchange={onLastLayout}>
|
|
189
233
|
{plain}
|
|
190
234
|
</view> : plain;
|
|
191
|
-
return defer ? <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span} defer={defer}>
|
|
235
|
+
return defer ? <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span} {...active ? ACTIVE_ITEM : {}} defer={defer}>
|
|
192
236
|
{cell}
|
|
193
|
-
</list-item> : <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span}>
|
|
237
|
+
</list-item> : <list-item key={key} item-key={key} reuse-identifier={reuse} estimated-main-axis-size-px={size} {...sticky} {...span} {...active ? ACTIVE_ITEM : {}}>
|
|
194
238
|
{cell}
|
|
195
239
|
</list-item>;
|
|
196
240
|
}), [
|
|
@@ -202,7 +246,8 @@ function G9VirtualList(props) {
|
|
|
202
246
|
props.reuseKey,
|
|
203
247
|
defer,
|
|
204
248
|
readable,
|
|
205
|
-
lastIndex
|
|
249
|
+
lastIndex,
|
|
250
|
+
activeKey
|
|
206
251
|
]);
|
|
207
252
|
if (0 === props.items.length && props.empty) return <view className={`g9-vlist g9-vlist--empty${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)} style={mergeStyle(void 0, props.style)}>
|
|
208
253
|
{props.header}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type G9NotificationEntry, type G9NotificationFilter, type G9NotificationGroup, type G9SnoozePreset, g9GroupNotifications, g9NotificationMatches, g9SnoozeUntil, g9UnreadByFilter, } from './model.js';
|
|
2
|
+
export { G9NotificationCenter, G9NotificationCenterPanel, type G9NotificationCenterPanelProps, type G9NotificationCenterProps, type G9NotificationCenterWords, type G9SnoozeChoice, type G9SnoozedNotification, g9SnoozeChoices, } from './notification-center.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { G9IconInput } from '../icon/icon.js';
|
|
2
|
+
/** One notification as the center shows it (the app words it: `text`, `time`). */
|
|
3
|
+
export interface G9NotificationEntry {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** The app's kind (`mention`, `task_assigned`…): the group of entries without a source. */
|
|
6
|
+
readonly kind: string;
|
|
7
|
+
readonly text: string;
|
|
8
|
+
/** When, as the app says it («۵ دقیقه پیش»). */
|
|
9
|
+
readonly time?: string;
|
|
10
|
+
/** Orders the entries: the greater is the newer (an ISO time or a number). */
|
|
11
|
+
readonly sortKey: string | number;
|
|
12
|
+
readonly read?: boolean;
|
|
13
|
+
/** The filter the entry belongs to (`mentions`, `tasks`…); none: only under the filter that matches all. */
|
|
14
|
+
readonly category?: string;
|
|
15
|
+
/** Where it comes from (`c:<conversation>`, `e:<event>`): entries of one source are one group. */
|
|
16
|
+
readonly groupKey?: string | null;
|
|
17
|
+
/** The source's name (the group's title). */
|
|
18
|
+
readonly groupTitle?: string | null;
|
|
19
|
+
readonly icon?: G9IconInput;
|
|
20
|
+
}
|
|
21
|
+
/** A filter chip. Without `matches`: key `all` takes every entry, any other key the entries of that `category`. */
|
|
22
|
+
export interface G9NotificationFilter {
|
|
23
|
+
readonly key: string;
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly matches?: (entry: G9NotificationEntry) => boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Entries of one source (or of one kind). */
|
|
28
|
+
export interface G9NotificationGroup {
|
|
29
|
+
readonly key: string;
|
|
30
|
+
/** The source's name, or null (the view names it by the entries' filter or kind). */
|
|
31
|
+
readonly title: string | null;
|
|
32
|
+
readonly kind: string;
|
|
33
|
+
readonly category?: string;
|
|
34
|
+
readonly items: readonly G9NotificationEntry[];
|
|
35
|
+
readonly unread: number;
|
|
36
|
+
}
|
|
37
|
+
/** Whether the entry is under the filter. */
|
|
38
|
+
export declare function g9NotificationMatches(entry: G9NotificationEntry, filter: G9NotificationFilter | null | undefined): boolean;
|
|
39
|
+
/** The groups under the filter: newest group first, newest entry first inside. */
|
|
40
|
+
export declare function g9GroupNotifications(items: readonly G9NotificationEntry[], filter?: G9NotificationFilter | null): G9NotificationGroup[];
|
|
41
|
+
/** Unread entries under each filter (the chips' counts). */
|
|
42
|
+
export declare function g9UnreadByFilter(items: readonly G9NotificationEntry[], filters: readonly G9NotificationFilter[]): Record<string, number>;
|
|
43
|
+
/** A snooze preset. */
|
|
44
|
+
export type G9SnoozePreset = 'hour' | 'tomorrow' | 'week';
|
|
45
|
+
/** The instant a preset means: in an hour; tomorrow, or the same weekday next week, at `hour`:00 (default 9, local). */
|
|
46
|
+
export declare function g9SnoozeUntil(preset: G9SnoozePreset, now?: Date, hour?: number): Date;
|
|
47
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/notifications/model.ts"],"names":[],"mappings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C/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,6CAA6C;AAC7C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAC9C,OAAO,CAIT;AAUD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,GACnC,mBAAmB,EAAE,CAwBvB;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKxB;AAED,uBAAuB;AACvB,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAE1D,wHAAwH;AACxH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,GAAE,IAAiB,EAAE,IAAI,SAAI,GAAG,IAAI,CAM5F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function g9NotificationMatches(entry, filter) {
|
|
2
|
+
if (!filter) return true;
|
|
3
|
+
if (filter.matches) return filter.matches(entry);
|
|
4
|
+
return 'all' === filter.key || entry.category === filter.key;
|
|
5
|
+
}
|
|
6
|
+
function newerFirst(a, b) {
|
|
7
|
+
if ('number' == typeof a.sortKey && 'number' == typeof b.sortKey) return b.sortKey - a.sortKey;
|
|
8
|
+
const x = String(a.sortKey);
|
|
9
|
+
const y = String(b.sortKey);
|
|
10
|
+
return Number(x < y) - Number(x > y);
|
|
11
|
+
}
|
|
12
|
+
function g9GroupNotifications(items, filter) {
|
|
13
|
+
const groups = new Map();
|
|
14
|
+
const sorted = items.filter((item)=>g9NotificationMatches(item, filter)).sort(newerFirst);
|
|
15
|
+
for (const item of sorted){
|
|
16
|
+
const key = item.groupKey || `k:${item.kind || 'notice'}`;
|
|
17
|
+
let group = groups.get(key);
|
|
18
|
+
if (!group) {
|
|
19
|
+
var _item_groupTitle;
|
|
20
|
+
group = {
|
|
21
|
+
key,
|
|
22
|
+
title: item.groupKey ? null != (_item_groupTitle = item.groupTitle) ? _item_groupTitle : null : null,
|
|
23
|
+
kind: item.kind,
|
|
24
|
+
...item.category ? {
|
|
25
|
+
category: item.category
|
|
26
|
+
} : {},
|
|
27
|
+
items: [],
|
|
28
|
+
unread: 0
|
|
29
|
+
};
|
|
30
|
+
groups.set(key, group);
|
|
31
|
+
}
|
|
32
|
+
group.items.push(item);
|
|
33
|
+
if (!item.read) group.unread++;
|
|
34
|
+
}
|
|
35
|
+
return [
|
|
36
|
+
...groups.values()
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
function g9UnreadByFilter(items, filters) {
|
|
40
|
+
const counts = {};
|
|
41
|
+
for (const filter of filters)counts[filter.key] = items.filter((item)=>!item.read && g9NotificationMatches(item, filter)).length;
|
|
42
|
+
return counts;
|
|
43
|
+
}
|
|
44
|
+
function g9SnoozeUntil(preset, now = new Date(), hour = 9) {
|
|
45
|
+
if ('hour' === preset) return new Date(now.getTime() + 3600000);
|
|
46
|
+
const next = new Date(now);
|
|
47
|
+
next.setDate(next.getDate() + ('tomorrow' === preset ? 1 : 7));
|
|
48
|
+
next.setHours(hour, 0, 0, 0);
|
|
49
|
+
return next;
|
|
50
|
+
}
|
|
51
|
+
export { g9GroupNotifications, g9NotificationMatches, g9SnoozeUntil, g9UnreadByFilter };
|