@robert-stackflow/oneui 0.6.56 → 0.6.58
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/CHANGELOG.md +343 -335
- package/README.md +1 -1
- package/components/Lightbox.js +134 -36
- package/components/Lightbox.module.css +42 -1
- package/components/Toast.module.css +0 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,335 +1,343 @@
|
|
|
1
|
-
## 0.6.
|
|
2
|
-
|
|
3
|
-
-
|
|
4
|
-
|
|
5
|
-
## 0.6.
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
## 0.6.
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
## 0.6.
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
## 0.6.
|
|
27
|
-
|
|
28
|
-
- TableOfContents
|
|
29
|
-
|
|
30
|
-
## 0.6.
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
## 0.6.
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
## 0.6.
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
## 0.6.
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
## 0.6.
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
## 0.6.
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
## 0.6.
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
## 0.6.
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
## 0.6.
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
## 0.6.
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
## 0.6.
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
## 0.6.
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
## 0.6.
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
- Add
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
# 0.6.
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
# 0.6.
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- Add
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
|
|
210
|
-
# 0.6.
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
- Add
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
-
|
|
274
|
-
|
|
275
|
-
## 0.
|
|
276
|
-
|
|
277
|
-
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
|
|
301
|
-
## 0.4.
|
|
302
|
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
- 修复 FormField
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
|
|
318
|
-
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
-
|
|
1
|
+
## 0.6.58
|
|
2
|
+
|
|
3
|
+
- Toast 堆叠列表与可滚动的通知正文沿用全局主题滚动条样式。
|
|
4
|
+
|
|
5
|
+
## 0.6.57
|
|
6
|
+
|
|
7
|
+
- 灯箱未放大时支持向下拖动退出。图片和背景随手势变化,短距离拖动自然复位,松手退出从当前位置衔接原图 Hero 动画。
|
|
8
|
+
|
|
9
|
+
## 0.6.56
|
|
10
|
+
|
|
11
|
+
- 窄屏和触屏灯箱隐藏前后箭头;宽屏箭头以整个视窗为定位基准,切换不同高度的图注时保持位置。
|
|
12
|
+
|
|
13
|
+
## 0.6.55
|
|
14
|
+
|
|
15
|
+
- ContributionCalendar 新增 `labels`,应用可传入日历名称、空状态、图例与贡献计数格式。月份、星期和日期继续按 `locale` 格式化。
|
|
16
|
+
|
|
17
|
+
## 0.6.54
|
|
18
|
+
|
|
19
|
+
- 触屏按主题密度显示控件,24px 点击尺寸作为下限。可编辑字段继续使用至少 16px 的字号,搜索清除按钮保留紧凑图标并提供 24px 点击区域。
|
|
20
|
+
- 图片查看器打开时将焦点置于标题区。触屏支持跟手滑动和缩略图换图,横屏缩减周边空间,桌面保留前后箭头与键盘操作。
|
|
21
|
+
|
|
22
|
+
## 0.6.53
|
|
23
|
+
|
|
24
|
+
- ContributionCalendar 的月份、星期、提示与图例随 locale 显示,保留中文默认文案并支持英文日历。
|
|
25
|
+
|
|
26
|
+
## 0.6.48
|
|
27
|
+
|
|
28
|
+
- TableOfContents 新增 railAlign="start",支持左侧目录的短线左对齐及从左侧展开长度变化;默认 end 保持原行为。
|
|
29
|
+
|
|
30
|
+
## 0.6.47
|
|
31
|
+
|
|
32
|
+
- Segmented 的服务端首屏按 aria-pressed 显示选中背景,不再等客户端测量后才出现;测量完成后无缝接回滑动指示器。合并重复的控件样式规则。
|
|
33
|
+
|
|
34
|
+
## 0.6.46
|
|
35
|
+
|
|
36
|
+
- TableOfContents 修复快速滚动跨过多个标题、或处在长章节之间时高亮停留旧章节的问题;滚动事件按动画帧合并,与章节观察器共用同步逻辑。
|
|
37
|
+
|
|
38
|
+
## 0.6.45
|
|
39
|
+
|
|
40
|
+
- TableOfContents 在外层容器管理滚动时,将当前章节自动滚动到容器可见范围;窗口尺寸变化时重新检查,保留焦点并避免滚动正文,支持减少动态效果偏好。
|
|
41
|
+
|
|
42
|
+
## 0.6.44
|
|
43
|
+
|
|
44
|
+
- Lightbox 按图片真实宽高比与可用画布尺寸显示加载骨架;窗口变化时同步适配。未提供有效尺寸时使用紧凑加载指示。
|
|
45
|
+
- 修正加载失败后点击重试可能被误判为滑动切图的问题。
|
|
46
|
+
- IconButton 支持 tooltip={false},保留可访问名称并避免紧凑浮层内重复弹出提示。
|
|
47
|
+
|
|
48
|
+
## 0.6.43
|
|
49
|
+
|
|
50
|
+
- Lightbox 加载骨架保持矩形,避免百分比圆角形成椭圆。
|
|
51
|
+
- TableOfContents 新增 scrollable 属性,支持容器统一管理滚动区域。
|
|
52
|
+
|
|
53
|
+
## 0.6.42
|
|
54
|
+
|
|
55
|
+
- Toast 采用轻叠卡片,支持数量按钮、悬停、键盘展开和 Escape 收起;展开按实际高度排列,保留独立关闭、原位更新与异步重试。
|
|
56
|
+
- 通知组使用受视口约束的原生顶层浮层;大量消息仅在通知区域滚动,避免展开和动画撑出页面滚动条,收起与展开保持卡片宽度稳定。
|
|
57
|
+
- 修正深色通知按钮在悬停、按下和聚焦时的对比度;柔和样式使用对应的独立控件颜色。
|
|
58
|
+
- 未展开的后层消息不提前过期;暂停后保留剩余展示时长,过时异步操作不会关闭刚更新的同 id 通知。
|
|
59
|
+
- 通知层随活动弹窗迁移,避免显示在弹窗上方却无法点击;弹窗关闭时保留通知、剩余时长与进行中的操作。
|
|
60
|
+
|
|
61
|
+
## 0.6.41
|
|
62
|
+
|
|
63
|
+
- Form 支持保留现有事件处理的原生约束模式,统一行内校验、错误焦点、外部提交、重置和异步提交锁;保留 useFormState 控制器模式。
|
|
64
|
+
- FormField 与输入控件自动读取表单校验状态,不再显示浏览器原生校验气泡;修正受控输入与捕获事件的更新顺序,保留用户输入。
|
|
65
|
+
- 导出 validateForm 供弹窗和自动保存流程触发同一校验反馈。
|
|
66
|
+
|
|
67
|
+
## 0.6.40
|
|
68
|
+
|
|
69
|
+
- 合入分栏按钮的自定义面板、图标与小尺寸、受控展开及 ghost 选中态;嵌套浮层 Escape 优先关闭内层,保留近期图文按钮、禁用与自适应宽度修正。
|
|
70
|
+
|
|
71
|
+
- 统一 Card、Section、FormGroup 与设置行的标题层级;两套主题的字段标签保持常规字重,辅助说明使用一致字号。
|
|
72
|
+
- Section 与 Card 支持 headingLevel,语义层级独立于字号;Section 的 settings 内容布局补偿设置行内边距,末组不增加尾距。
|
|
73
|
+
- 增加公开标题与间距变量、表单规范及组合示例;不新增装饰性标签或重复卡片。
|
|
74
|
+
|
|
75
|
+
## 0.6.39
|
|
76
|
+
|
|
77
|
+
- SelectOption 与 MenuItem 新增可选 descriptionLines (1–3),Combobox / Select 支持多行简介,默认保持单行;搜索、键盘选择和已有选项行为不变。
|
|
78
|
+
|
|
79
|
+
## 0.6.38
|
|
80
|
+
|
|
81
|
+
- IconButton 的 disabled / aria-disabled 统一降低不透明度,禁用 hover 填充。
|
|
82
|
+
- ContributionCalendar 新增 fill、source、footer 插槽,用于完整日历和来源/统计布局。
|
|
83
|
+
- 正式 tarball 消费类型、构建及交互验证通过。
|
|
84
|
+
|
|
85
|
+
## 0.6.37
|
|
86
|
+
|
|
87
|
+
- Keep wheel input inside open ContextMenu layers. Short menus and scroll boundaries no longer scroll the document or nested workspace behind them; long menus retain native scrolling.
|
|
88
|
+
|
|
89
|
+
## 0.6.35
|
|
90
|
+
|
|
91
|
+
- Add an optional `IconButton text` slot for unified icon/text or count actions, sharing one hover, focus, pressed and click region without application styling. Preserve icon-only and disclosure variants.
|
|
92
|
+
|
|
93
|
+
## 0.6.34
|
|
94
|
+
|
|
95
|
+
- Close Lightbox on empty-space clicks while guarding image/control clicks and drag/pinch gestures. Return visible images with Hero motion; missing, offscreen, zoomed or failed origins fade out gently together with the black canvas.
|
|
96
|
+
|
|
97
|
+
## 0.6.33
|
|
98
|
+
|
|
99
|
+
- Animate Lightbox image changes with directional transitions that retain the outgoing image, add a sliding thumbnail selection indicator and keyboard focus ring, and preserve document width in the shared nested modal scroll lock.
|
|
100
|
+
|
|
101
|
+
## 0.6.32
|
|
102
|
+
|
|
103
|
+
- Give Lightbox an opaque black canvas and matching light controls in every document color mode; remove the dependency on an undefined background variable.
|
|
104
|
+
|
|
105
|
+
## 0.6.31
|
|
106
|
+
|
|
107
|
+
- Add a controlled Lightbox with source-image Hero motion, captions, thumbnails, bounded zoom/pan and pinch/swipe gestures, keyboard navigation, retry and return-to-document callbacks. Shared modal focus, scroll locking and motion remain consistent with OneUI surfaces.
|
|
108
|
+
|
|
109
|
+
## 0.6.30
|
|
110
|
+
|
|
111
|
+
- Add an optional compact full hierarchy for immersive TableOfContents rail popups, stable anchoring, outward placement and a shared animated arrow. Existing flat previews keep their defaults.
|
|
112
|
+
|
|
113
|
+
## 0.6.29
|
|
114
|
+
|
|
115
|
+
- Keep one password visibility control in Edge by suppressing the duplicate native reveal button inside PasswordField.
|
|
116
|
+
|
|
117
|
+
## 0.6.28
|
|
118
|
+
|
|
119
|
+
- Keep Dialog headers and footer actions visible while long content scrolls inside the body, including narrow viewports and nested modals.
|
|
120
|
+
|
|
121
|
+
## 0.6.27
|
|
122
|
+
|
|
123
|
+
- Add Drawer headerDivider for tabbed panels that already own their navigation separator.
|
|
124
|
+
|
|
125
|
+
## 0.6.26
|
|
126
|
+
|
|
127
|
+
- Add content-sized Popover width for compact contextual action bars, clamped to the viewport.
|
|
128
|
+
- Give pressed ghost IconButton toggles a shared, borderless theme selection surface.
|
|
129
|
+
|
|
130
|
+
## 0.6.25
|
|
131
|
+
|
|
132
|
+
- Add Menu disabled state and triggerRef; blocked menus close and preserve dialog return focus through the native trigger.
|
|
133
|
+
|
|
134
|
+
## 0.6.24
|
|
135
|
+
|
|
136
|
+
- Add native Segmented option counts without a separate badge surface.
|
|
137
|
+
|
|
138
|
+
- Add top-aligned Dialog placement and controlled, asynchronously populated CommandPalette search.
|
|
139
|
+
- Use shared EmptyState for command results and label click-triggered nested menus correctly.
|
|
140
|
+
|
|
141
|
+
## 0.6.23
|
|
142
|
+
|
|
143
|
+
- Align nested Sidebar selection, hover and pressed row geometry; remove redundant noncompact tooltips.
|
|
144
|
+
- Add EditableHeading for direct plain-text title editing with composition and keyboard handling.
|
|
145
|
+
- Support click triggers for nested ContextMenu and safe server rendering.
|
|
146
|
+
|
|
147
|
+
# 0.6.22
|
|
148
|
+
|
|
149
|
+
- Add opt-in Popover arrow and offset. The pointer tracks the anchor after viewport clamping; the body scrolls without clipping the pointer. Vertical surfaces flip when the other side offers more space.
|
|
150
|
+
- Animate pointed popovers with a small scale and slide from the pointer, preserving interrupted transitions and reduced-motion preferences.
|
|
151
|
+
- Add IconButton disclosure with a spaced, animated chevron and an expanded state; keep ordinary icon buttons unchanged.
|
|
152
|
+
|
|
153
|
+
# 0.6.21
|
|
154
|
+
|
|
155
|
+
- Add Link with inherited typography, subtle content links, shared hover/focus states and disabled navigation. Export from the root and Link subpath.
|
|
156
|
+
- Add Markdown fontSize for reading preferences, with scaled prose and headings; default rendering remains unchanged.
|
|
157
|
+
- Keep Slider's accessible name stable when its current value changes; native range value announcements remain available.
|
|
158
|
+
|
|
159
|
+
# 0.6.19
|
|
160
|
+
|
|
161
|
+
- Add opt-in Combobox allowCustomValue input mode: preserve freely typed text on blur, Enter, and async loading or failure; only explicit option selection commits an option. Pass the selected option as the optional second onChange argument.
|
|
162
|
+
|
|
163
|
+
# 0.6.18
|
|
164
|
+
|
|
165
|
+
- Add Menu iconOnly triggers backed by the shared IconButton, preserving tooltip, focus restoration and keyboard menu interaction without a normal button border or minimum height.
|
|
166
|
+
|
|
167
|
+
# 0.6.17
|
|
168
|
+
|
|
169
|
+
- Prevent the animated SideBar selection highlight from expanding scrollable overflow while a preceding group collapses; preserve group and selection motion in both themes and color modes.
|
|
170
|
+
|
|
171
|
+
# 0.6.16
|
|
172
|
+
|
|
173
|
+
- Separate readable accent ink from solid fills for badges, links, menu/radio marks, steps, progress, charts, timelines, info feedback and keyboard focus in both color modes; preserve custom accents.
|
|
174
|
+
- Fix BarChart columns collapsing to label width inside Tooltip anchors.
|
|
175
|
+
- Keep AppShell mobile toggle icons centered when the button becomes visible.
|
|
176
|
+
- Restore the gallery landing page, keep the searchable index as an optional entry, remove duplicate Web gallery styling, and add the missing BarChart example.
|
|
177
|
+
|
|
178
|
+
# 0.6.15
|
|
179
|
+
|
|
180
|
+
- Fix the indicator SideBar using a dark accent on dark selected backgrounds; follow the theme's active foreground and blend custom accents into a readable indicator ink.
|
|
181
|
+
- Add the optional navigation-indicator-color CSS token, leaving button fills and other accent uses unchanged.
|
|
182
|
+
- Scope navigation demo heading rules to panel headings; use shared setting rows and show content matching the active item.
|
|
183
|
+
|
|
184
|
+
# 0.6.14
|
|
185
|
+
|
|
186
|
+
- Add TextSettingRow, TextAreaSettingRow, SwitchSettingRow and SelectSettingRow with linked labels/descriptions, value callbacks, validation and responsive control widths; add titleBold to all setting rows.
|
|
187
|
+
|
|
188
|
+
- Redesign Banner typography, tonal backgrounds, neutral outline, grouped actions, text-only disclosure and responsive layout; retain existing props and Alert compatibility.
|
|
189
|
+
- Unify all dialog footers with a pale surface, top divider and right-aligned actions; refine compact, left-aligned headings and small semantic icons.
|
|
190
|
+
- Add optional Dialog headerIcon/tone and asynchronous MessageDialog onAction, reusing busy, error and dismissal handling.
|
|
191
|
+
- Reorganize the shared gallery into 65 canonical examples and 40 groups; add a searchable index and host-aware deep links, a dedicated SettingRow demo, and separate form grouping/layout examples.
|
|
192
|
+
|
|
193
|
+
# 0.6.13
|
|
194
|
+
|
|
195
|
+
- Add global and per-group sidebar header bold options and document the existing SettingRow/form components.
|
|
196
|
+
|
|
197
|
+
- Add tree and immersive TableOfContents presentations: visible-anchor ranges and CSS motion paths for the tree, single-position lines and an independent hover card for the immersive presentation.
|
|
198
|
+
- Make immersive lines directly navigable and add single/nearby/full hover previews, configurable preview counts and optional depth-based lengths.
|
|
199
|
+
- Add Markdown syntax highlighting with auto, GitHub Light/Dark, Nord and Dracula themes; integrate shared table appearance and unique heading anchors.
|
|
200
|
+
- Unify table styles across Table, DataTable, TreeTable and TableMarkup with striping, density, hover, column borders and sticky headers; keep a single tree-table frame.
|
|
201
|
+
- Rename the primary Alert API to Banner with variants, compact layout and expandable details; retain Alert as a compatibility alias.
|
|
202
|
+
- Add queued Toast notifications, compositor-based stack movement, keyed task updates and targeted dismissal while preserving existing toast appearance.
|
|
203
|
+
|
|
204
|
+
# 0.6.12
|
|
205
|
+
|
|
206
|
+
- Add a shared Markdown renderer with GFM tables, task lists, footnotes, images, links, typography and copyable code blocks.
|
|
207
|
+
- Keep overflow inside tables/code, namespace footnote IDs per instance, omit raw HTML and retain URL filtering.
|
|
208
|
+
- Add a live Markdown source/preview gallery shared by desktop and web; use existing Alert for tip banners.
|
|
209
|
+
|
|
210
|
+
# 0.6.11
|
|
211
|
+
|
|
212
|
+
- Add a unified SideBar with sidebar, card and indicator variants, grouped/nested navigation, controlled or internal expansion and keyboard focus handling.
|
|
213
|
+
- Restore fixed-width vertical selection motion and add reversible group/nesting transitions, clipping, inert closed content and reduced-motion support.
|
|
214
|
+
- Add independent trailing slots for every item and state-aware group trailing content; the gallery shows group counts only when collapsed.
|
|
215
|
+
- Add responsive NavBar with native links, dropdown navigation, brand/actions slots and a mobile drawer.
|
|
216
|
+
- Reuse SideBar in AppShell and SettingsLayout, preserve group separators and existing navigation exports, and refresh both gallery applications.
|
|
217
|
+
|
|
218
|
+
# 0.6.10
|
|
219
|
+
|
|
220
|
+
- Keep a single scrolling list in TreeSelect, Cascader, Combobox and MultiSelect; search and footer actions remain visible within the viewport.
|
|
221
|
+
- Let date and date-range popovers fit their full calendar before applying the viewport height limit.
|
|
222
|
+
- Add Popover scrollable for surfaces whose children manage scrolling.
|
|
223
|
+
- Keep icon, Emoji and symbol picker scrolling inside their virtualized lists.
|
|
224
|
+
|
|
225
|
+
# 0.6.9
|
|
226
|
+
|
|
227
|
+
- Fix account item icon contrast in the minimal dark theme; session and passkey icons follow foreground color.
|
|
228
|
+
|
|
229
|
+
# Changelog
|
|
230
|
+
|
|
231
|
+
## 0.6.8
|
|
232
|
+
|
|
233
|
+
- Use theme-specific selected text and indicator colors for UnderlinedTab, including hover and dark mode.
|
|
234
|
+
- Apply minimal-theme palette changes atomically to avoid low-contrast intermediate gray frames; preserve control and navigation movement.
|
|
235
|
+
|
|
236
|
+
## 0.6.7
|
|
237
|
+
|
|
238
|
+
- Add UptimeChart with shared status colors, staggered entrance, hover/focus inspection, native tooltips and reduced-motion support.
|
|
239
|
+
|
|
240
|
+
## 0.6.6
|
|
241
|
+
|
|
242
|
+
- Add Segmented fullWidth to align evenly distributed options with navigation or form containers.
|
|
243
|
+
|
|
244
|
+
- Fix minimal-theme placeholder color for text, password, numeric and multiline controls in both color modes.
|
|
245
|
+
- Preserve native switch and button appearance inside DataTable cells; remove the table's broad button style override.
|
|
246
|
+
|
|
247
|
+
## 0.6.5 — 2026-10-29
|
|
248
|
+
|
|
249
|
+
- Popover 默认限制 360px 最大高度,并继续按可用视口收缩;长下拉菜单在内部滚动,可通过 maxHeight 调整。
|
|
250
|
+
- NumberInput 支持 fullWidth,适配双栏、单栏表单。
|
|
251
|
+
- DataTable 列支持 width 与 align,让路径、状态、开关及操作列按内容分配空间。
|
|
252
|
+
- TabList 保留横向滚动与键盘导航,避免下划线溢出造成多余滚动条。
|
|
253
|
+
|
|
254
|
+
## 0.6.4 — 2026-10-29
|
|
255
|
+
|
|
256
|
+
- 极简主题的文字按钮使用前景色,修复深色模式下文字对比度不足;浅深色包消费检查覆盖文字按钮对比度。
|
|
257
|
+
|
|
258
|
+
## 0.6.3 — 2026-10-29
|
|
259
|
+
|
|
260
|
+
- 横向 Divider 在居中网格中与文字保持垂直居中,同时保留普通块、纵向弹性布局及 inset 的宽度行为。
|
|
261
|
+
- 包消费验证覆盖两套主题、深浅色和桌面/手机宽度下的分割线几何对齐。
|
|
262
|
+
|
|
263
|
+
## 0.6.2 — 2026-10-29
|
|
264
|
+
|
|
265
|
+
- Text 与 Heading 的多行省略明确恢复正常换行,避免继承表格的 nowrap 后长文本撑开列宽。
|
|
266
|
+
- 增加浅色、深色及窄屏下表格内两行截断的回归验证。
|
|
267
|
+
|
|
268
|
+
## 0.6.1 — 2026-10-29
|
|
269
|
+
|
|
270
|
+
- 在 0.5.2 基础上保留可创建多选、分组导航及可选页面标题;新增嵌套侧栏、资源卡片、登录布局和页面标题组合。
|
|
271
|
+
- 复用现有 Card/Table 样式,提供布局基础组件、TableMarkup、CopyButton 与 BarChart;普通选择与可搜索选择分别沿用现有 Select/Combobox。
|
|
272
|
+
- Menu 支持自定义触发内容,NumberInput 支持单位,Button 支持文字链接;修复日历月份标签碰撞及表格圆角继承。
|
|
273
|
+
- 保留现有公开接口,并验证独立包消费、账户表单、弹窗、分组/嵌套导航及窄屏视觉基础。
|
|
274
|
+
|
|
275
|
+
## 0.6.0 — 2026-10-29
|
|
276
|
+
|
|
277
|
+
- 发布了较早的组合组件候选;0.6.1 补齐 0.5.1 分组导航、多选创建及 0.5.2 CSS Modules 动画兼容修复。请使用 0.6.1。
|
|
278
|
+
|
|
279
|
+
## 0.5.2 — 2026-10-29
|
|
280
|
+
|
|
281
|
+
- 将 Page、Dialog、Drawer、Button 的动画关键帧放回各自 CSS Module。
|
|
282
|
+
|
|
283
|
+
## 0.5.1 — 2026-10-29
|
|
284
|
+
|
|
285
|
+
- MultiSelect 新增 `onCreate`,标签模式在同一触发框内展示已选项,支持搜索创建、连续多选、错误重试,以及关闭后忽略异步创建结果。
|
|
286
|
+
- Page 支持可选 ReactNode 标题,可为无标题的内容区复用共享入场动画。
|
|
287
|
+
- AppShell 新增 `navigationGroups`,桌面侧栏与移动导航共享分组和分隔布局;保留原有扁平导航 API。
|
|
288
|
+
|
|
289
|
+
## 0.5.0 — 2026-10-29
|
|
290
|
+
|
|
291
|
+
- 新增 ActionSheet,复用 IconButton、Drawer 和 MenuItem;桌面使用紧凑底部面板,手机适配底部安全区域,支持禁用和危险操作。
|
|
292
|
+
- Drawer 新增 `onAfterClose`,在关闭动画与焦点恢复完成后执行后续操作,避免操作面板与新弹窗重叠。
|
|
293
|
+
- 横向 FormField 包含多行输入时,标签靠上对齐;单行控件和手机纵向布局保持原有排列。
|
|
294
|
+
|
|
295
|
+
## 0.4.2 — 2026-10-29
|
|
296
|
+
|
|
297
|
+
- 图标、Emoji 和符号目录改用可被构建工具识别的异步 JSON 导入,修复 npm 包在 Vite 开发预打包后资源相对路径失效的问题;生产构建继续按需加载。
|
|
298
|
+
- Card 新增 `description` 与无正文模式,标题和正文使用一致的横向间距,避免只含概览和操作时产生空白正文。
|
|
299
|
+
- 独立 tarball 消费测试增加开发模式预打包下的三套完整目录加载验证。
|
|
300
|
+
|
|
301
|
+
## 0.4.1 — 2026-10-29
|
|
302
|
+
|
|
303
|
+
- Dialog、Drawer 统一处理普通关闭和条件卸载后的焦点恢复,兼容 StrictMode、嵌套与替换弹窗,不抢夺其他弹窗的焦点。
|
|
304
|
+
- 新增 `returnFocus` 引用,可为异步打开的弹窗明确指定关闭后返回的控件。
|
|
305
|
+
- 修复 FormField 在卸载失焦时访问已清空引用的运行错误,避免 StrictMode 模拟清理触发额外失焦。
|
|
306
|
+
- Pagination 新增 `compact`、`size="small"` 和 `className`;紧凑排列、尺寸及窄屏换行由组件管理,宿主不再依赖内部 DOM 覆盖样式。
|
|
307
|
+
- 增加独立构建包的双主题、深浅色、1280/390/320px 焦点和分页交互验证。
|
|
308
|
+
|
|
309
|
+
## 0.4.0 — 2026-10-29
|
|
310
|
+
|
|
311
|
+
- 新增 AccountItem、PasskeyItem、SessionItem,统一账户设备列表的图标、元数据、操作按钮和移动布局;业务与日期格式由宿主负责。
|
|
312
|
+
- Form、FormGroup、FormField 支持 stacked / inline 两种排版,继承布局并可逐字段覆盖;窄屏自动改为上下排列。
|
|
313
|
+
- 修复 FormField 空标签占位造成的控件垂直错位,RadioGroup 在 FormField 中不再重复显示标签。
|
|
314
|
+
- NumberInput 新增 nullable 模式,清空返回 null,保留小数、范围、键盘与只读行为。
|
|
315
|
+
- Dialog 在关闭动画期间保留最终内容,避免宿主清空选择时先显示空弹窗。
|
|
316
|
+
- 两端共享示例新增设置表单与账户设备项目。
|
|
317
|
+
|
|
318
|
+
## 0.3.0 — 2026-10-28
|
|
319
|
+
|
|
320
|
+
- AppShell 新增 brandName、brandIcon、brand、homePath、basePath 和 showHeader;支持无顶部栏的移动导航,可省略设置入口及侧栏折叠回调。普通点击向宿主传递内部路径,链接和新标签页使用完整基础路径。
|
|
321
|
+
- 新增 createToaster 独立通知控制器,可由 React 组件外代码调用;ToastProvider 可接收 controller,保留原 useToast API 和单条通知替换行为。
|
|
322
|
+
- IconPicker 支持 valuePrefix、自定义图标目录与 React 图标内容,保留存储 ID;统一字段、只读、禁用和表单值行为。
|
|
323
|
+
- DatePicker 支持 timeZone、clearable、placeholder;指定时区影响今天/此刻及日历当天标记,输入的日历时间保持原值,不隐式转换为 UTC。
|
|
324
|
+
- React/React DOM peer 范围调整为 ^19.2.0,独立消费验证覆盖 React 19.3.0 + TypeScript 5.9.3 和现有 React 19.3.1。
|
|
325
|
+
- 两端示例增加前缀/自定义图标和指定时区日期示例;未迁移或修改 Moment 业务代码。
|
|
326
|
+
- 修复极简深色导航选中文字过暗的问题。
|
|
327
|
+
|
|
328
|
+
## 0.2.0 — 2026-10-28
|
|
329
|
+
|
|
330
|
+
- 新增 MessageDialog、ConfirmDialog、FormDialog 与统一 LoadingState,复用表单校验、异步提交、错误反馈和焦点管理。
|
|
331
|
+
- TreeSelect 新增 category 图标、数量、层级连线样式;保留 tree 风格,支持父子联动多选。
|
|
332
|
+
- 新增 TreeTable,复用 Table 列定义,支持受控展开、多级连线和键盘导航;列支持 align、width。
|
|
333
|
+
- Combobox 新增 mode="input" 触发框补全;保留弹层搜索,支持异步加载、取消、创建与失败重试。
|
|
334
|
+
- MultiSelect 新增 display="tags",与 TagInput 共用标签实现;保留摘要模式及选择限制。
|
|
335
|
+
- 蓝白主题采用 Moment 对应色板、输入 hover 混色和深色参数;修复默认色板迁移与选择器分类栏底色。
|
|
336
|
+
- 统一菜单项 1px 间距,修复快捷键右对齐、宿主 kbd 边框干扰、关闭的 Popover 被布局样式显示等问题。
|
|
337
|
+
- 树选择器底部清空/完成操作使用独立的 8px 按钮间距。
|
|
338
|
+
- 共享应用外壳与示例布局统一,修复图标尺寸、链接文字、动效示例、表单间距、弹层和移动布局。
|
|
339
|
+
- 发布构建使用干净输出并检查包内引用;增加独立 tarball 消费项目的类型、生产与交互验证。
|
|
340
|
+
|
|
341
|
+
## 0.1.0 — 2026-10-28
|
|
342
|
+
|
|
343
|
+
- 首次发布 React 组件、应用外壳、极简/蓝白主题与图标字符资源。
|
package/README.md
CHANGED
|
@@ -338,7 +338,7 @@ Menu 支持 iconOnly:`<Menu iconOnly label="更多操作" items={items} />`
|
|
|
338
338
|
|
|
339
339
|
`Lightbox` is a controlled image viewer: pass `open`, `items`, `index`, `onIndexChange` and `onClose`. Each item has a stable `id`, `src`, `alt` and optional `caption`, `thumbnailSrc`, `width` and `height`. The optional `sourceElement(item)` resolves the original image for Hero motion; `onLocate(item)` runs after exit and scroll unlocking. Supply `labels` for localization. Provide valid `width` and `height` for an aspect-correct loading skeleton fitted to the canvas; images without known dimensions use a compact loading indicator.
|
|
340
340
|
|
|
341
|
-
The viewer uses an opaque black canvas with light controls in both color modes. Opening focuses the header so keyboard navigation starts inside the dialog. Wide mouse layouts offer previous and next buttons anchored to the viewer, independent of caption height. Narrow and touch layouts use the thumbnail strip for direct navigation. On touch, the image follows horizontal swipes. Arrow keys, Escape, zoom, pinch, pan, captions and image retry work across layouts. A single image hides navigation. Only adjacent full images are preloaded. Native modal isolation and the shared focus lifecycle restore focus to the opener. Keep the component mounted through exit and retain the selected index.
|
|
341
|
+
The viewer uses an opaque black canvas with light controls in both color modes. Opening focuses the header so keyboard navigation starts inside the dialog. Wide mouse layouts offer previous and next buttons anchored to the viewer, independent of caption height. Narrow and touch layouts use the thumbnail strip for direct navigation. On touch, the image follows horizontal swipes. At fit size, drag down to close the viewer. A short drag settles back in place, and dismissal continues from the released image position toward its visible source. Arrow keys, Escape, zoom, pinch, pan, captions and image retry work across layouts. A single image hides navigation. Only adjacent full images are preloaded. Native modal isolation and the shared focus lifecycle restore focus to the opener. Keep the component mounted through exit and retain the selected index.
|
|
342
342
|
|
|
343
343
|
Image changes retain the existing outgoing image for a directional fade/slide, without remounting it for the animation. Thumbnail selection uses a moving outline and a separate keyboard focus ring. Shared modal scroll locking preserves classic scrollbar space, nested lock ownership and original document styles.
|
|
344
344
|
|
package/components/Lightbox.js
CHANGED
|
@@ -113,11 +113,14 @@ function Lightbox(props) {
|
|
|
113
113
|
slideState.current = slide;
|
|
114
114
|
const blankGesture = useRef(null);
|
|
115
115
|
const touchButton = useRef(null);
|
|
116
|
+
const dismissOnTouchEnd = useRef(false);
|
|
116
117
|
const isBlank = (target) => target === ref.current || target === stageRef.current || target instanceof HTMLElement && target.hasAttribute("data-lightbox-blank");
|
|
117
118
|
const pointers = useRef(/* @__PURE__ */ new Map());
|
|
118
119
|
const gesture = useRef({
|
|
119
120
|
x: 0,
|
|
120
121
|
y: 0,
|
|
122
|
+
time: 0,
|
|
123
|
+
axis: null,
|
|
121
124
|
panX: 0,
|
|
122
125
|
panY: 0,
|
|
123
126
|
distance: 0,
|
|
@@ -138,18 +141,40 @@ function Lightbox(props) {
|
|
|
138
141
|
const maxX = Math.max(0, (img.offsetWidth * scale - stage.clientWidth) / 2), maxY = Math.max(0, (img.offsetHeight * scale - stage.clientHeight) / 2);
|
|
139
142
|
return { x: clamp(x, -maxX, maxX), y: clamp(y, -maxY, maxY) };
|
|
140
143
|
};
|
|
144
|
+
const clearImageDrag = () => {
|
|
145
|
+
const stage = stageRef.current;
|
|
146
|
+
stage?.style.removeProperty("--lightbox-swipe-x");
|
|
147
|
+
stage?.style.removeProperty("--lightbox-drag-y");
|
|
148
|
+
stage?.style.removeProperty("--lightbox-drag-scale");
|
|
149
|
+
};
|
|
150
|
+
const clearDrag = () => {
|
|
151
|
+
swipeSettle.current?.cancel();
|
|
152
|
+
swipeSettle.current = null;
|
|
153
|
+
swipeOffset.current = 0;
|
|
154
|
+
dismissOnTouchEnd.current = false;
|
|
155
|
+
clearImageDrag();
|
|
156
|
+
const dialog = ref.current;
|
|
157
|
+
if (dialog) {
|
|
158
|
+
delete dialog.dataset.draggingOut;
|
|
159
|
+
dialog.style.removeProperty("--lightbox-drag-progress");
|
|
160
|
+
}
|
|
161
|
+
};
|
|
141
162
|
const animateImage = (exit) => {
|
|
142
163
|
const img = imageRef.current;
|
|
143
164
|
if (!img || !img.complete || !img.naturalWidth || reducedMotion())
|
|
144
165
|
return Promise.resolve();
|
|
145
166
|
const style = getComputedStyle(img);
|
|
146
|
-
const startTransform = style.transform || "none", startOpacity = style.opacity, startClip = style.clipPath || "inset(0px)";
|
|
167
|
+
const startTransform = style.transform || "none", startTranslate = style.translate || "none", startOpacity = style.opacity, startClip = style.clipPath || "inset(0px)";
|
|
147
168
|
hero.current?.cancel();
|
|
148
|
-
if (exit)
|
|
169
|
+
if (exit) {
|
|
149
170
|
slideAnimations.current.forEach((animation) => animation.cancel());
|
|
171
|
+
swipeSettle.current?.cancel();
|
|
172
|
+
clearImageDrag();
|
|
173
|
+
}
|
|
150
174
|
const options = {
|
|
151
175
|
duration: motionDuration(exit ? "--popup-exit" : "--popup-enter", 180),
|
|
152
|
-
easing: "cubic-bezier(.
|
|
176
|
+
easing: "cubic-bezier(.22,.68,.24,1)",
|
|
177
|
+
fill: exit ? "forwards" : "none"
|
|
153
178
|
};
|
|
154
179
|
const run = (frames) => {
|
|
155
180
|
try {
|
|
@@ -169,11 +194,13 @@ function Lightbox(props) {
|
|
|
169
194
|
{
|
|
170
195
|
opacity: startOpacity,
|
|
171
196
|
transform: startTransform,
|
|
197
|
+
translate: startTranslate,
|
|
172
198
|
clipPath: startClip
|
|
173
199
|
},
|
|
174
200
|
{
|
|
175
201
|
opacity: 0,
|
|
176
|
-
transform: `${startTransform === "none" ? "" : startTransform} scale(.985)`,
|
|
202
|
+
transform: `${ref.current?.dataset.draggingOut === "active" ? "translateY(36px) " : ""}${startTransform === "none" ? "" : startTransform} scale(.985)`,
|
|
203
|
+
translate: startTranslate,
|
|
177
204
|
clipPath: startClip
|
|
178
205
|
}
|
|
179
206
|
]) : Promise.resolve();
|
|
@@ -192,12 +219,13 @@ function Lightbox(props) {
|
|
|
192
219
|
exit ? [
|
|
193
220
|
{
|
|
194
221
|
transform: startTransform,
|
|
222
|
+
translate: startTranslate,
|
|
195
223
|
clipPath: startClip,
|
|
196
224
|
opacity: startOpacity
|
|
197
225
|
},
|
|
198
|
-
{ transform, clipPath, opacity: 0.3 }
|
|
226
|
+
{ transform, translate: "0px", clipPath, opacity: 0.3 }
|
|
199
227
|
] : [
|
|
200
|
-
{ transform, clipPath, opacity: 0.3 },
|
|
228
|
+
{ transform, translate: "0px", clipPath, opacity: 0.3 },
|
|
201
229
|
{ transform: "none", clipPath: "inset(0px)", opacity: 1 }
|
|
202
230
|
]
|
|
203
231
|
);
|
|
@@ -269,9 +297,7 @@ function Lightbox(props) {
|
|
|
269
297
|
setZoom(1);
|
|
270
298
|
setPan({ x: 0, y: 0 });
|
|
271
299
|
pointers.current.clear();
|
|
272
|
-
|
|
273
|
-
swipeOffset.current = 0;
|
|
274
|
-
stageRef.current?.style.removeProperty("--lightbox-swipe-x");
|
|
300
|
+
clearDrag();
|
|
275
301
|
const img = imageRef.current;
|
|
276
302
|
if (img?.complete && img.naturalWidth) onLoaded();
|
|
277
303
|
}, [open, item?.id, item?.src]);
|
|
@@ -299,9 +325,7 @@ function Lightbox(props) {
|
|
|
299
325
|
const element = ref.current;
|
|
300
326
|
const resize = () => {
|
|
301
327
|
pointers.current.clear();
|
|
302
|
-
|
|
303
|
-
swipeOffset.current = 0;
|
|
304
|
-
stageRef.current?.style.removeProperty("--lightbox-swipe-x");
|
|
328
|
+
clearDrag();
|
|
305
329
|
setZoom(1);
|
|
306
330
|
setPan({ x: 0, y: 0 });
|
|
307
331
|
};
|
|
@@ -319,8 +343,10 @@ function Lightbox(props) {
|
|
|
319
343
|
if (!dialog) return;
|
|
320
344
|
if (open) {
|
|
321
345
|
setPresent(true);
|
|
346
|
+
if (dialog.inert) hero.current?.cancel();
|
|
322
347
|
dialog.inert = false;
|
|
323
348
|
setClosing(false);
|
|
349
|
+
clearDrag();
|
|
324
350
|
if (!dialog.open) {
|
|
325
351
|
rememberFocus();
|
|
326
352
|
dialog.showModal();
|
|
@@ -342,6 +368,8 @@ function Lightbox(props) {
|
|
|
342
368
|
([done]) => {
|
|
343
369
|
if (!done || opened.current) return;
|
|
344
370
|
dialog.close();
|
|
371
|
+
hero.current?.cancel();
|
|
372
|
+
clearDrag();
|
|
345
373
|
setPresent(false);
|
|
346
374
|
setZoom(1);
|
|
347
375
|
setPan({ x: 0, y: 0 });
|
|
@@ -369,9 +397,7 @@ function Lightbox(props) {
|
|
|
369
397
|
const pointerDown = (event) => {
|
|
370
398
|
if (event.button !== 0 || event.target instanceof Element && event.target.closest("button"))
|
|
371
399
|
return;
|
|
372
|
-
|
|
373
|
-
swipeOffset.current = 0;
|
|
374
|
-
event.currentTarget.style.removeProperty("--lightbox-swipe-x");
|
|
400
|
+
clearDrag();
|
|
375
401
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
376
402
|
pointers.current.set(event.pointerId, {
|
|
377
403
|
x: event.clientX,
|
|
@@ -381,6 +407,8 @@ function Lightbox(props) {
|
|
|
381
407
|
gesture.current = {
|
|
382
408
|
x: event.clientX,
|
|
383
409
|
y: event.clientY,
|
|
410
|
+
time: event.timeStamp,
|
|
411
|
+
axis: null,
|
|
384
412
|
panX: pan.x,
|
|
385
413
|
panY: pan.y,
|
|
386
414
|
scale: zoom,
|
|
@@ -411,16 +439,46 @@ function Lightbox(props) {
|
|
|
411
439
|
zoom
|
|
412
440
|
)
|
|
413
441
|
);
|
|
414
|
-
} else if (
|
|
442
|
+
} else if (!start.multi) {
|
|
415
443
|
const dx = event.clientX - start.x;
|
|
416
444
|
const dy = event.clientY - start.y;
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
)
|
|
445
|
+
if (!start.axis) {
|
|
446
|
+
if (status === "loaded" && dy > 8 && dy > Math.abs(dx) * 1.2)
|
|
447
|
+
start.axis = "vertical";
|
|
448
|
+
else if (event.pointerType === "touch" && items.length > 1 && Math.abs(dx) > 8 && Math.abs(dx) > Math.abs(dy) * 1.2)
|
|
449
|
+
start.axis = "horizontal";
|
|
450
|
+
}
|
|
451
|
+
if (start.axis === "horizontal") {
|
|
452
|
+
const atEnd = dx > 0 ? index === 0 : index === items.length - 1;
|
|
453
|
+
swipeOffset.current = dx * (atEnd ? 0.16 : 0.65);
|
|
454
|
+
event.currentTarget.style.setProperty(
|
|
455
|
+
"--lightbox-swipe-x",
|
|
456
|
+
`${swipeOffset.current}px`
|
|
457
|
+
);
|
|
458
|
+
} else if (start.axis === "vertical") {
|
|
459
|
+
const offset = Math.max(0, dy);
|
|
460
|
+
const progress = clamp(
|
|
461
|
+
offset / Math.max(180, event.currentTarget.clientHeight * 0.58),
|
|
462
|
+
0,
|
|
463
|
+
0.8
|
|
464
|
+
);
|
|
465
|
+
event.currentTarget.style.setProperty(
|
|
466
|
+
"--lightbox-drag-y",
|
|
467
|
+
`${offset}px`
|
|
468
|
+
);
|
|
469
|
+
event.currentTarget.style.setProperty(
|
|
470
|
+
"--lightbox-drag-scale",
|
|
471
|
+
`${1 - progress * 0.16}`
|
|
472
|
+
);
|
|
473
|
+
const dialog = ref.current;
|
|
474
|
+
if (dialog) {
|
|
475
|
+
dialog.dataset.draggingOut = "active";
|
|
476
|
+
dialog.style.setProperty(
|
|
477
|
+
"--lightbox-drag-progress",
|
|
478
|
+
String(progress)
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
424
482
|
}
|
|
425
483
|
};
|
|
426
484
|
const pointerEnd = (event) => {
|
|
@@ -428,7 +486,7 @@ function Lightbox(props) {
|
|
|
428
486
|
const start = gesture.current, dx = event.clientX - start.x, dy = event.clientY - start.y;
|
|
429
487
|
pointers.current.delete(event.pointerId);
|
|
430
488
|
const remaining = [...pointers.current.values()];
|
|
431
|
-
if (remaining.length === 1 && start.multi)
|
|
489
|
+
if (remaining.length === 1 && start.multi) {
|
|
432
490
|
gesture.current = {
|
|
433
491
|
...start,
|
|
434
492
|
...remaining[0],
|
|
@@ -436,21 +494,54 @@ function Lightbox(props) {
|
|
|
436
494
|
panY: pan.y,
|
|
437
495
|
distance: 0
|
|
438
496
|
};
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const stage = event.currentTarget;
|
|
500
|
+
const released = event.type === "pointerup" && !start.multi && zoom === 1;
|
|
439
501
|
const offset = swipeOffset.current;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
502
|
+
const img = imageRef.current;
|
|
503
|
+
const dialog = ref.current;
|
|
504
|
+
if (start.axis === "vertical" && dialog?.dataset.draggingOut === "active") {
|
|
505
|
+
const threshold2 = clamp(stage.clientHeight * 0.18, 72, 120);
|
|
506
|
+
const flick = dy >= 48 && dy / Math.max(1, event.timeStamp - start.time) > 0.65;
|
|
507
|
+
if (released && (dy >= threshold2 || flick)) {
|
|
508
|
+
if (event.pointerType === "touch") dismissOnTouchEnd.current = true;
|
|
509
|
+
else props.onClose();
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const pose = img ? getComputedStyle(img).transform : "none";
|
|
513
|
+
clearImageDrag();
|
|
514
|
+
dialog.dataset.draggingOut = "settling";
|
|
515
|
+
dialog.style.removeProperty("--lightbox-drag-progress");
|
|
516
|
+
if (img && !reducedMotion()) {
|
|
517
|
+
const animation = img.animate(
|
|
518
|
+
[{ transform: pose }, { transform: "none" }],
|
|
519
|
+
{
|
|
520
|
+
duration: motionDuration("--popup-enter", 180),
|
|
521
|
+
easing: "cubic-bezier(.22,.68,.24,1)"
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
swipeSettle.current = animation;
|
|
525
|
+
void animation.finished.then(
|
|
526
|
+
() => {
|
|
527
|
+
if (swipeSettle.current === animation) clearDrag();
|
|
528
|
+
},
|
|
529
|
+
() => {
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
} else clearDrag();
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
clearDrag();
|
|
536
|
+
const threshold = clamp(stage.clientWidth * 0.16, 36, 64);
|
|
443
537
|
const next = index + (dx < 0 ? 1 : -1);
|
|
444
|
-
if (
|
|
538
|
+
if (released && start.axis === "horizontal" && Math.abs(dx) > threshold && next >= 0 && next < items.length) {
|
|
445
539
|
move(next);
|
|
446
540
|
} else if (offset && !reducedMotion()) {
|
|
447
|
-
swipeSettle.current =
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
easing: "ease-out"
|
|
452
|
-
}
|
|
453
|
-
) ?? null;
|
|
541
|
+
swipeSettle.current = img?.animate([{ translate: `${offset}px` }, { translate: "0px" }], {
|
|
542
|
+
duration: motionDuration("--motion-hover", 140),
|
|
543
|
+
easing: "ease-out"
|
|
544
|
+
}) ?? null;
|
|
454
545
|
}
|
|
455
546
|
};
|
|
456
547
|
return createPortal(
|
|
@@ -487,6 +578,12 @@ function Lightbox(props) {
|
|
|
487
578
|
touchButton.current = start.button;
|
|
488
579
|
},
|
|
489
580
|
onTouchEnd: (event) => {
|
|
581
|
+
if (dismissOnTouchEnd.current && !event.touches.length) {
|
|
582
|
+
dismissOnTouchEnd.current = false;
|
|
583
|
+
if (event.cancelable) event.preventDefault();
|
|
584
|
+
props.onClose();
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
490
587
|
const button = touchButton.current;
|
|
491
588
|
touchButton.current = null;
|
|
492
589
|
if (!button || event.touches.length || !event.cancelable) return;
|
|
@@ -569,6 +666,7 @@ function Lightbox(props) {
|
|
|
569
666
|
onPointerMove: pointerMove,
|
|
570
667
|
onPointerUp: pointerEnd,
|
|
571
668
|
onPointerCancel: pointerEnd,
|
|
669
|
+
onLostPointerCapture: pointerEnd,
|
|
572
670
|
onDoubleClick: toggleZoom,
|
|
573
671
|
children: [
|
|
574
672
|
[...slide.previous ? [slide.previous] : [], item].map(
|
|
@@ -593,7 +691,7 @@ function Lightbox(props) {
|
|
|
593
691
|
"data-image-phase": current ? "current" : "outgoing",
|
|
594
692
|
style: {
|
|
595
693
|
opacity: current ? status === "loaded" ? 1 : 0 : 1,
|
|
596
|
-
transform: current ? `translate(${pan.x}px, ${pan.y}px) scale(${zoom})` : "none"
|
|
694
|
+
transform: current ? `translateY(var(--lightbox-drag-y, 0px)) scale(var(--lightbox-drag-scale, 1)) translate(${pan.x}px, ${pan.y}px) scale(${zoom})` : "none"
|
|
597
695
|
}
|
|
598
696
|
},
|
|
599
697
|
entry.id + entry.src
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
--muted: #b5b5b5;
|
|
21
21
|
--hover: #ffffff18;
|
|
22
22
|
--line: #ffffff24;
|
|
23
|
-
|
|
23
|
+
isolation: isolate;
|
|
24
|
+
background: transparent;
|
|
24
25
|
color: var(--fg);
|
|
25
26
|
overflow: hidden;
|
|
26
27
|
}
|
|
@@ -29,6 +30,38 @@
|
|
|
29
30
|
flex-direction: column;
|
|
30
31
|
gap: 12px;
|
|
31
32
|
}
|
|
33
|
+
.lightbox::before {
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
z-index: -1;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
background: #111;
|
|
40
|
+
opacity: calc(1 - var(--lightbox-drag-progress, 0));
|
|
41
|
+
}
|
|
42
|
+
.lightbox[data-dragging-out]
|
|
43
|
+
:is(
|
|
44
|
+
.header,
|
|
45
|
+
.caption,
|
|
46
|
+
.thumbnails,
|
|
47
|
+
.previous:not(:disabled),
|
|
48
|
+
.next:not(:disabled)
|
|
49
|
+
) {
|
|
50
|
+
opacity: calc(1 - var(--lightbox-drag-progress, 0) * 1.15);
|
|
51
|
+
}
|
|
52
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
53
|
+
.lightbox[data-dragging-out="settling"]::before,
|
|
54
|
+
.lightbox[data-dragging-out="settling"]
|
|
55
|
+
:is(
|
|
56
|
+
.header,
|
|
57
|
+
.caption,
|
|
58
|
+
.thumbnails,
|
|
59
|
+
.previous:not(:disabled),
|
|
60
|
+
.next:not(:disabled)
|
|
61
|
+
) {
|
|
62
|
+
transition: opacity var(--popup-enter) var(--ease);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
32
65
|
.lightbox::backdrop {
|
|
33
66
|
background: transparent;
|
|
34
67
|
}
|
|
@@ -72,6 +105,14 @@
|
|
|
72
105
|
touch-action: none;
|
|
73
106
|
user-select: none;
|
|
74
107
|
}
|
|
108
|
+
.lightbox:is(
|
|
109
|
+
[data-dragging-out],
|
|
110
|
+
[data-motion-phase="enter"],
|
|
111
|
+
[data-motion-phase="exit"]
|
|
112
|
+
)
|
|
113
|
+
.stage:not([data-zoomed]) {
|
|
114
|
+
overflow: visible;
|
|
115
|
+
}
|
|
75
116
|
.stage[data-zoomed] {
|
|
76
117
|
cursor: grab;
|
|
77
118
|
}
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
overflow-x: clip;
|
|
27
27
|
overflow-y: auto;
|
|
28
28
|
overscroll-behavior: contain;
|
|
29
|
-
scrollbar-width: thin;
|
|
30
29
|
scrollbar-gutter: stable both-edges;
|
|
31
30
|
pointer-events: none;
|
|
32
31
|
}
|
|
@@ -102,7 +101,6 @@
|
|
|
102
101
|
box-sizing: border-box;
|
|
103
102
|
max-height: min(320px, calc(100dvh - 80px));
|
|
104
103
|
overflow: auto;
|
|
105
|
-
scrollbar-width: thin;
|
|
106
104
|
}
|
|
107
105
|
.copy {
|
|
108
106
|
flex: 1;
|