dsh-message-rewind 1.3.2 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +7 -1
- package/README.md +7 -1
- package/client.js +13 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -51,6 +51,12 @@ The popover opens right under the button you clicked and points at it with a sma
|
|
|
51
51
|
| :---: | :---: |
|
|
52
52
|
| <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/edit-dialog-v1.3.0.png" alt="Edit popover: file changes collapse to one line, rollback scope is a two-way switch" width="360"> | <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/rollback-dialog-v1.3.0.png" alt="Rollback confirmation: a one-line confirm when no files changed" width="360"> |
|
|
53
53
|
|
|
54
|
+
The rollback scope is colour-coded: blue for **messages only**, red for **messages + files**. The chosen option turns solid, while the other keeps a light wash of its colour:
|
|
55
|
+
|
|
56
|
+
| Messages only (blue, default) | Messages + files (red) |
|
|
57
|
+
| :---: | :---: |
|
|
58
|
+
| <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/rollback-scope-messages-v1.4.0.png" alt="Messages only: the blue solid button is selected" width="360"> | <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/rollback-scope-files-v1.4.0.png" alt="Messages + files: the red solid button is selected, with the restore hint below" width="360"> |
|
|
59
|
+
|
|
54
60
|
The popover follows its button: it flips above when there is no room below, narrows to the screen width on small viewports, and keeps the same layering in the light theme:
|
|
55
61
|
|
|
56
62
|
| Flips above near the bottom | Narrow screen (390px) | Light theme |
|
|
@@ -82,7 +88,7 @@ If you prefer editing the profile yourself, the manual route is the same three s
|
|
|
82
88
|
```json
|
|
83
89
|
{
|
|
84
90
|
"dependencies": {
|
|
85
|
-
"dsh-message-rewind": "^1.
|
|
91
|
+
"dsh-message-rewind": "^1.4.0"
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
94
|
```
|
package/README.md
CHANGED
|
@@ -53,6 +53,12 @@
|
|
|
53
53
|
| :---: | :---: |
|
|
54
54
|
| <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/edit-dialog-v1.3.0.png" alt="编辑小窗:文件改动收起成一行,回滚范围二选一" width="360"> | <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/rollback-dialog-v1.3.0.png" alt="回滚确认:没有文件改动时只剩一行确认" width="360"> |
|
|
55
55
|
|
|
56
|
+
回滚范围用颜色区分:蓝色是「只回滚消息」,红色是「连文件一起回滚」。选中的一项会变成整块实色,未选中的保留一层同色淡底:
|
|
57
|
+
|
|
58
|
+
| 只回滚消息(蓝色,默认) | 连文件一起回滚(红色) |
|
|
59
|
+
| :---: | :---: |
|
|
60
|
+
| <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/rollback-scope-messages-v1.4.0.png" alt="只回滚消息:蓝色实心按钮,默认选中" width="360"> | <img src="https://raw.githubusercontent.com/xCube007/dsh-message-rewind/main/img/rollback-scope-files-v1.4.0.png" alt="连文件一起回滚:红色实心按钮,下方提示文件会还原" width="360"> |
|
|
61
|
+
|
|
56
62
|
小窗跟着按钮走:窗口底部放不下时自动翻到按钮上方,窄屏下收窄到屏幕宽度,亮色主题也保持同一套层级:
|
|
57
63
|
|
|
58
64
|
| 靠近底部时翻到上方 | 窄屏(390px) | 亮色主题 |
|
|
@@ -84,7 +90,7 @@ dsh plugin --profile web add dsh-message-rewind
|
|
|
84
90
|
```json
|
|
85
91
|
{
|
|
86
92
|
"dependencies": {
|
|
87
|
-
"dsh-message-rewind": "^1.
|
|
93
|
+
"dsh-message-rewind": "^1.4.0"
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
```
|
package/client.js
CHANGED
|
@@ -136,9 +136,18 @@ window.__ModuleLoader__.load({
|
|
|
136
136
|
.dmr-files{display:flex;flex-direction:column;gap:2px;max-height:112px;overflow:auto;margin:6px 0 0;padding:0 0 0 12px;list-style:none}
|
|
137
137
|
.dmr-files li{font:11.5px/16px var(--ds-font-family-code,ui-monospace,monospace);color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere}
|
|
138
138
|
.dmr-scope{display:flex;gap:2px;margin:10px 0 0;padding:2px;background:var(--dsw-alias-interactive-bg-hover);border-radius:calc(var(--dsw-radius-sm) + 1px)}
|
|
139
|
-
.dmr-seg{flex:1 1 0;min-width:0;overflow:hidden;border:0;border-radius:var(--dsw-radius-xs);background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:16px;padding:4px 6px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
|
|
139
|
+
.dmr-seg{flex:1 1 0;min-width:0;overflow:hidden;border:0;border-radius:var(--dsw-radius-xs);background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:16px;padding:4px 6px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:background .12s,color .12s,box-shadow .12s}
|
|
140
140
|
.dmr-seg:hover{color:var(--dsw-alias-label-primary)}
|
|
141
|
-
|
|
141
|
+
/* The scope is colour-coded before it is read: a calm blue for messages
|
|
142
|
+
only, irreversible red for rolling the recorded files back. The picked
|
|
143
|
+
half turns solid; the other keeps a light wash of its colour. */
|
|
144
|
+
.dmr-seg[data-scope=messages]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 8%,transparent);color:var(--dsw-alias-state-business-primary)}
|
|
145
|
+
.dmr-seg[data-scope=files]{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);color:var(--dsw-alias-state-error-primary)}
|
|
146
|
+
.dmr-seg[data-scope=messages]:hover{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 14%,transparent);color:var(--dsw-alias-state-business-primary)}
|
|
147
|
+
.dmr-seg[data-scope=files]:hover{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 14%,transparent);color:var(--dsw-alias-state-error-primary)}
|
|
148
|
+
.dmr-seg[aria-checked=true]{font-weight:500;color:var(--dsw-alias-label-primary-foreground);box-shadow:0 1px 2px rgba(0,0,0,.2)}
|
|
149
|
+
.dmr-seg[data-scope=messages][aria-checked=true]{background:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary-foreground)}
|
|
150
|
+
.dmr-seg[data-scope=files][aria-checked=true]{background:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary-foreground)}
|
|
142
151
|
.dmr-seg:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
|
|
143
152
|
.dmr-warning{margin:8px 0 0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-warn-primary)}
|
|
144
153
|
.dmr-error{margin:8px 0 0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere}
|
|
@@ -534,6 +543,7 @@ window.__ModuleLoader__.load({
|
|
|
534
543
|
className: 'dmr-seg',
|
|
535
544
|
type: 'button',
|
|
536
545
|
role: 'radio',
|
|
546
|
+
'data-scope': 'messages',
|
|
537
547
|
'aria-checked': !selected,
|
|
538
548
|
onClick: () => patchIf(dialog.token, { withFiles: false }),
|
|
539
549
|
}, t('messagesOnly')),
|
|
@@ -541,6 +551,7 @@ window.__ModuleLoader__.load({
|
|
|
541
551
|
className: 'dmr-seg',
|
|
542
552
|
type: 'button',
|
|
543
553
|
role: 'radio',
|
|
554
|
+
'data-scope': 'files',
|
|
544
555
|
'aria-checked': selected,
|
|
545
556
|
onClick: () => patchIf(dialog.token, { withFiles: true }),
|
|
546
557
|
}, t('withFiles'))) : null;
|
package/package.json
CHANGED