dsh-plugin-haitang-todo 1.3.20 → 1.3.22
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/client.js +187 -133
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* imported without changing the workbench.
|
|
15
15
|
*/
|
|
16
16
|
window.__ModuleLoader__.load({
|
|
17
|
-
id: '
|
|
17
|
+
id: '@local/sidebar-todo',
|
|
18
18
|
factory(require) {
|
|
19
19
|
const React = require('react');
|
|
20
20
|
const h = React.createElement;
|
|
@@ -28,8 +28,8 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
/** Document-relative base of the Host API (see index.js). */
|
|
29
29
|
const API_BASE = 'api/sidebarTodo';
|
|
30
30
|
/** Bump CLIENT_BUILD whenever client.js changes, so the running page is identifiable. */
|
|
31
|
-
const CLIENT_VERSION = '1.3.
|
|
32
|
-
const CLIENT_BUILD = '2026-11-
|
|
31
|
+
const CLIENT_VERSION = '1.3.31';
|
|
32
|
+
const CLIENT_BUILD = '2026-11-26T11:56';
|
|
33
33
|
/** Debounce before a change is written to this browser and the Host. */
|
|
34
34
|
const SAVE_DELAY = 700;
|
|
35
35
|
|
|
@@ -46,6 +46,7 @@ window.__ModuleLoader__.load({
|
|
|
46
46
|
periodTitle: 'Period view · calendar list',
|
|
47
47
|
periodHint: 'Click a day header, empty space or the add zone to create a todo',
|
|
48
48
|
monthView: 'Month view',
|
|
49
|
+
monthDragRepeat: 'Repeating todos: change the repeat rule in the editor.',
|
|
49
50
|
autoLayout: 'Auto',
|
|
50
51
|
weekView: 'Week view',
|
|
51
52
|
prev: 'Previous',
|
|
@@ -53,7 +54,6 @@ window.__ModuleLoader__.load({
|
|
|
53
54
|
reset: 'Today',
|
|
54
55
|
resetMonth: 'This month',
|
|
55
56
|
addZone: 'Click to add a todo',
|
|
56
|
-
periodNote: 'Unfinished todos stay on their date and also appear on the next day; set repeats in the editor.',
|
|
57
57
|
categoryTitle: 'Category view',
|
|
58
58
|
categoryHint: 'Periodic and temporary work merge into this week, grouped by category',
|
|
59
59
|
weekNumber: 'Week ',
|
|
@@ -130,18 +130,6 @@ window.__ModuleLoader__.load({
|
|
|
130
130
|
meetingBatchSaved: 'Saved {n} meeting transcript(s)',
|
|
131
131
|
meetingBatchFailed: 'Failed {m}',
|
|
132
132
|
meetingNoSourceDate: 'no source date found; saving under today',
|
|
133
|
-
maintenanceEntry: 'Maintenance: .bin → text',
|
|
134
|
-
maintenanceTitle: 'Host copy: .bin/.txt → .md/.json/.txt/.log',
|
|
135
|
-
maintenanceSrc: 'Source path (.bin/.txt under D:\\dsh)',
|
|
136
|
-
maintenanceDest: 'Target path (.md/.json/.txt/.log/.bin under D:\\dsh)',
|
|
137
|
-
maintenanceKeepHint: 'The source file is never modified, moved or deleted.',
|
|
138
|
-
maintenanceSrcKept: 'Source kept: {path}',
|
|
139
|
-
maintenanceDestDone: 'Target: {path}',
|
|
140
|
-
maintenanceOverwrite: 'Overwrite if the target exists',
|
|
141
|
-
maintenanceRun: 'Convert',
|
|
142
|
-
maintenanceRunning: 'Converting…',
|
|
143
|
-
maintenanceOk: 'Converted: {bytes} bytes, sha256={sha256}',
|
|
144
|
-
maintenanceFailed: 'Convert failed',
|
|
145
133
|
imported: 'Imported',
|
|
146
134
|
catPeriodic: 'Periodic work',
|
|
147
135
|
catMonthly: 'Monthly goals',
|
|
@@ -201,6 +189,7 @@ window.__ModuleLoader__.load({
|
|
|
201
189
|
periodTitle: '周期视图 · 日历清单',
|
|
202
190
|
periodHint: '单击日期标题栏、日期空白区域或添加按钮即可新增',
|
|
203
191
|
monthView: '月度视图',
|
|
192
|
+
monthDragRepeat: '周期任务请在编辑里改重复规则',
|
|
204
193
|
autoLayout: '自适应',
|
|
205
194
|
weekView: '返回周视图',
|
|
206
195
|
prev: '上一周',
|
|
@@ -208,7 +197,6 @@ window.__ModuleLoader__.load({
|
|
|
208
197
|
reset: '回到今天',
|
|
209
198
|
resetMonth: '回到本月',
|
|
210
199
|
addZone: '单击添加待办',
|
|
211
|
-
periodNote: '未完成待办保留在原日期,并顺延显示在下一天;重复规则在待办编辑时设置。',
|
|
212
200
|
categoryTitle: '象限视图',
|
|
213
201
|
categoryHint: '周期性工作和临时性工作合并为本周周工作,按分类内容展示',
|
|
214
202
|
weekNumber: '第',
|
|
@@ -285,18 +273,6 @@ window.__ModuleLoader__.load({
|
|
|
285
273
|
meetingBatchSaved: '已保存 {n} 个会议纪要',
|
|
286
274
|
meetingBatchFailed: '失败 {m} 个',
|
|
287
275
|
meetingNoSourceDate: '未识别到源日期,按今天保存',
|
|
288
|
-
maintenanceEntry: '维护:.bin → 文本',
|
|
289
|
-
maintenanceTitle: '维护:把 .bin/.txt 转成 Host 可读文本',
|
|
290
|
-
maintenanceSrc: '源路径(D:\\dsh 下的 .bin/.txt)',
|
|
291
|
-
maintenanceDest: '目标路径(D:\\dsh 下的 .md/.json/.txt/.log 或 .bin)',
|
|
292
|
-
maintenanceKeepHint: '转换不会修改、移动或删除源文件。',
|
|
293
|
-
maintenanceSrcKept: '原文件已保留:{path}',
|
|
294
|
-
maintenanceDestDone: '目标文件:{path}',
|
|
295
|
-
maintenanceOverwrite: '目标已存在时覆盖',
|
|
296
|
-
maintenanceRun: '转换',
|
|
297
|
-
maintenanceRunning: '转换中…',
|
|
298
|
-
maintenanceOk: '已转换:{bytes} 字节,sha256={sha256}',
|
|
299
|
-
maintenanceFailed: '转换失败',
|
|
300
276
|
imported: '已导入',
|
|
301
277
|
catPeriodic: '周期性工作',
|
|
302
278
|
catMonthly: '月目标',
|
|
@@ -384,27 +360,28 @@ window.__ModuleLoader__.load({
|
|
|
384
360
|
'.dsh-todo-days{display:grid;grid-template-columns:repeat(7,minmax(102px,1fr));min-width:714px}',
|
|
385
361
|
'.dsh-todo-day{border-right:1px solid var(--dsw-alias-border-l1);min-height:270px;cursor:pointer;display:flex;flex-direction:column}',
|
|
386
362
|
'.dsh-todo-day:last-child{border-right:0}',
|
|
387
|
-
'.dsh-todo-day--today{background:var(--dsw-alias-bg-layer-2);
|
|
363
|
+
'.dsh-todo-day--today{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-state-success-primary);border-radius:6px}',
|
|
388
364
|
'.dsh-todo-day-head{padding:9px 9px;border-bottom:1px solid var(--dsw-alias-border-l1);font-size:11px;',
|
|
389
365
|
'color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}',
|
|
390
366
|
'.dsh-todo-day--today .dsh-todo-day-head{color:var(--dsw-alias-brand-primary)}',
|
|
391
367
|
'.dsh-todo-day-head b{display:block;font-size:17px;color:var(--dsw-alias-label-primary)}',
|
|
392
368
|
'.dsh-todo-day--today .dsh-todo-day-head b{color:var(--dsw-alias-brand-primary)}',
|
|
393
|
-
'.dsh-todo-task-list{flex:1 1 auto;padding:8px;display:flex;flex-direction:column;gap:7px;min-height:0;cursor:pointer
|
|
369
|
+
'.dsh-todo-task-list{flex:1 1 auto;padding:8px;display:flex;flex-direction:column;gap:7px;min-height:0;cursor:pointer}',
|
|
394
370
|
'.dsh-todo-task{border:1px solid var(--dsw-alias-border-l1);border-left:3px solid var(--dsw-alias-brand-primary);',
|
|
395
371
|
'border-radius:7px;background:var(--dsw-alias-bg-base);padding:7px 8px;font-size:11px;line-height:1.45;cursor:pointer}',
|
|
396
372
|
'.dsh-todo-task:hover{background:var(--dsw-alias-bg-layer-2)}',
|
|
397
373
|
'.dsh-todo-task{cursor:grab}',
|
|
398
374
|
'.dsh-todo-task--dragging{opacity:.45;cursor:grabbing}',
|
|
399
375
|
'.dsh-todo-day--drop{background:var(--dsw-alias-bg-layer-2);box-shadow:inset 0 0 0 2px var(--dsw-alias-brand-primary)}',
|
|
400
|
-
'.dsh-todo-period-panel{display:flex;flex-direction:column;
|
|
401
|
-
'.dsh-todo-period-body{flex:1 1 auto;min-height:0;overflow:
|
|
402
|
-
'.dsh-todo-weeks{display:flex;flex-direction:column;
|
|
403
|
-
'.dsh-todo-weeks .dsh-todo-week{flex:
|
|
404
|
-
'.dsh-todo-weeks .dsh-todo-days{flex:
|
|
405
|
-
'.dsh-todo-period-panel .dsh-todo-day{min-height:0;overflow:
|
|
406
|
-
'.dsh-todo-period-panel .dsh-todo-month{height:
|
|
407
|
-
'.dsh-todo-period-panel .dsh-todo-month-grid
|
|
376
|
+
'.dsh-todo-period-panel{display:flex;flex-direction:column;flex:0 0 auto;min-height:0;overflow:visible}',
|
|
377
|
+
'.dsh-todo-period-body{flex:1 1 auto;min-height:0;overflow:visible}',
|
|
378
|
+
'.dsh-todo-weeks{display:flex;flex-direction:column;min-height:0;gap:13px}',
|
|
379
|
+
'.dsh-todo-weeks .dsh-todo-week{flex:0 0 auto;display:flex;flex-direction:column;min-height:140px}',
|
|
380
|
+
'.dsh-todo-weeks .dsh-todo-days{flex:0 0 auto;min-height:0;overflow:visible}',
|
|
381
|
+
'.dsh-todo-period-panel .dsh-todo-day{min-height:0;overflow:visible;box-sizing:border-box}',
|
|
382
|
+
'.dsh-todo-period-panel .dsh-todo-month{display:flex;flex-direction:column;min-height:0;overflow:visible;box-sizing:border-box}',
|
|
383
|
+
'.dsh-todo-period-panel .dsh-todo-month-grid{flex:0 0 auto;min-height:0;grid-template-rows:auto;grid-auto-rows:minmax(84px,auto);overflow:visible}',
|
|
384
|
+
'.dsh-todo-period-panel .dsh-todo-month-grid>div{min-height:84px;height:100%;box-sizing:border-box;overflow:visible;padding:4px 5px;align-self:stretch}',
|
|
408
385
|
'.dsh-todo-task--done{opacity:.5;text-decoration:line-through}',
|
|
409
386
|
'.dsh-todo-task--overdue{border-left-color:var(--dsw-alias-state-warn-primary);',
|
|
410
387
|
'color:var(--dsw-alias-state-warn-primary)}',
|
|
@@ -451,9 +428,21 @@ window.__ModuleLoader__.load({
|
|
|
451
428
|
'border-bottom:1px solid var(--dsw-alias-border-l1)}',
|
|
452
429
|
'.dsh-todo-month-weekday{min-height:0!important;text-align:center;font-size:11px;font-weight:700;',
|
|
453
430
|
'background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}',
|
|
454
|
-
'.dsh-todo-month-cell--today{background:var(--dsw-alias-bg-layer-2);
|
|
455
|
-
'.dsh-todo-month-task{display:
|
|
456
|
-
'border-radius:4px;background:var(--dsw-alias-bg-layer-2);font-size:10px;
|
|
431
|
+
'.dsh-todo-month-cell--today{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-state-success-primary);border-radius:6px}',
|
|
432
|
+
'.dsh-todo-month-task{display:flex;align-items:center;gap:4px;margin-top:5px;padding:2px 4px;border-left:2px solid var(--dsw-alias-brand-primary);',
|
|
433
|
+
'border-radius:4px;background:var(--dsw-alias-bg-layer-2);font-size:10px;cursor:pointer}',
|
|
434
|
+
'.dsh-todo-month-task-text{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
435
|
+
'.dsh-todo-month-task--done .dsh-todo-month-task-text{text-decoration:line-through;opacity:.62}',
|
|
436
|
+
'.dsh-todo-month-task-del{flex:none;display:none;border:0;background:transparent;color:var(--dsw-alias-state-error-primary);cursor:pointer;font-size:11px;line-height:1;padding:0 2px}',
|
|
437
|
+
'.dsh-todo-month-task:hover .dsh-todo-month-task-del,.dsh-todo-month-task:focus-within .dsh-todo-month-task-del{display:inline-block}',
|
|
438
|
+
'.dsh-todo-month-task--done{opacity:.85}',
|
|
439
|
+
'.dsh-todo-month-task--overdue{border-left-color:var(--dsw-alias-state-warn-primary);background:rgba(245,158,11,.16)}',
|
|
440
|
+
'.dsh-todo-month-task--today{border-left-color:var(--dsw-alias-state-success-primary)}',
|
|
441
|
+
'.dsh-todo-month-task--temporary{border-left-style:dashed}',
|
|
442
|
+
'.dsh-todo-month-cell--drop{box-shadow:inset 0 0 0 2px var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-2)}',
|
|
443
|
+
'.dsh-todo-month-task{cursor:grab}',
|
|
444
|
+
'.dsh-todo-month-task--done{cursor:not-allowed}',
|
|
445
|
+
'.dsh-todo-month-task--dragging{opacity:.45}',
|
|
457
446
|
'.dsh-todo-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:16px}',
|
|
458
447
|
'.dsh-todo-lane{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:hidden;background:var(--dsw-alias-bg-base)}',
|
|
459
448
|
'.dsh-todo-lane--fullscreen{position:fixed;inset:18px;z-index:30;overflow:auto;box-shadow:0 20px 60px #0006}',
|
|
@@ -2458,6 +2447,7 @@ window.__ModuleLoader__.load({
|
|
|
2458
2447
|
const [composing, setComposing] = React.useState(false);
|
|
2459
2448
|
const [dropActive, setDropActive] = React.useState(false);
|
|
2460
2449
|
const meetingFileInputRef = React.useRef(null);
|
|
2450
|
+
const periodRef = React.useRef(null);
|
|
2461
2451
|
const modelRef = React.useRef(null);
|
|
2462
2452
|
if (!modelRef.current) modelRef.current = createModel(tr);
|
|
2463
2453
|
const model = modelRef.current;
|
|
@@ -2493,12 +2483,27 @@ window.__ModuleLoader__.load({
|
|
|
2493
2483
|
}
|
|
2494
2484
|
});
|
|
2495
2485
|
|
|
2496
|
-
//
|
|
2486
|
+
// Period layout: fill the parent box when sparse, then grow with content.
|
|
2487
|
+
// Day cells never scroll internally; overflow goes to the surrounding panel/page.
|
|
2497
2488
|
React.useEffect(() => {
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2489
|
+
const applyLayout = () => {
|
|
2490
|
+
model.updateViewport();
|
|
2491
|
+
const panel = periodRef.current;
|
|
2492
|
+
if (!panel || typeof panel.getBoundingClientRect !== 'function') return;
|
|
2493
|
+
// Never size the panel in pixels: it must grow with its content.
|
|
2494
|
+
panel.style.height = '';
|
|
2495
|
+
panel.style.minHeight = '';
|
|
2496
|
+
panel.style.maxHeight = 'none';
|
|
2497
|
+
const body = typeof panel.querySelector === 'function' ? panel.querySelector('.dsh-todo-period-body') : null;
|
|
2498
|
+
if (body) body.style.overflowY = 'visible';
|
|
2499
|
+
};
|
|
2500
|
+
applyLayout();
|
|
2501
|
+
let frame = 0;
|
|
2502
|
+
if (typeof window !== 'undefined' && typeof window.requestAnimationFrame === 'function') {
|
|
2503
|
+
frame = window.requestAnimationFrame(applyLayout);
|
|
2504
|
+
}
|
|
2500
2505
|
if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {
|
|
2501
|
-
const onResize = () =>
|
|
2506
|
+
const onResize = () => applyLayout();
|
|
2502
2507
|
window.addEventListener('resize', onResize);
|
|
2503
2508
|
return () => {
|
|
2504
2509
|
try {
|
|
@@ -2506,10 +2511,11 @@ window.__ModuleLoader__.load({
|
|
|
2506
2511
|
} catch (error) {
|
|
2507
2512
|
/* ignore */
|
|
2508
2513
|
}
|
|
2514
|
+
if (frame && typeof window.cancelAnimationFrame === 'function') window.cancelAnimationFrame(frame);
|
|
2509
2515
|
};
|
|
2510
2516
|
}
|
|
2511
2517
|
return undefined;
|
|
2512
|
-
}
|
|
2518
|
+
});
|
|
2513
2519
|
|
|
2514
2520
|
const backToChat = () => {
|
|
2515
2521
|
try {
|
|
@@ -2713,6 +2719,7 @@ window.__ModuleLoader__.load({
|
|
|
2713
2719
|
{
|
|
2714
2720
|
key: day.key,
|
|
2715
2721
|
className: dayClass,
|
|
2722
|
+
style: { height: 'auto', maxHeight: 'none', overflow: 'visible' },
|
|
2716
2723
|
onDragOver: (event) => {
|
|
2717
2724
|
if (!model.dragKey) return;
|
|
2718
2725
|
event.preventDefault();
|
|
@@ -2895,36 +2902,159 @@ window.__ModuleLoader__.load({
|
|
|
2895
2902
|
weekday: WEEKDAYS[date.getDay() === 0 ? 6 : date.getDay() - 1],
|
|
2896
2903
|
});
|
|
2897
2904
|
|
|
2905
|
+
// Month cells reuse the week-view status rules: done / overdue / today / temporary.
|
|
2906
|
+
const monthTaskClass = (task) => {
|
|
2907
|
+
let name = 'dsh-todo-month-task';
|
|
2908
|
+
if (model.isTaskDone(task)) {
|
|
2909
|
+
name += ' dsh-todo-month-task--done';
|
|
2910
|
+
} else {
|
|
2911
|
+
const tone = model.itemTone(task, false);
|
|
2912
|
+
if (tone === 'overdue') name += ' dsh-todo-month-task--overdue';
|
|
2913
|
+
else if (tone === 'today') name += ' dsh-todo-month-task--today';
|
|
2914
|
+
}
|
|
2915
|
+
if (task.category === 'temporary') name += ' dsh-todo-month-task--temporary';
|
|
2916
|
+
return name;
|
|
2917
|
+
};
|
|
2918
|
+
|
|
2898
2919
|
const monthView = h(
|
|
2899
2920
|
'div',
|
|
2900
2921
|
{ className: 'dsh-todo-month' },
|
|
2901
2922
|
h('div', { className: 'dsh-todo-month-title' }, model.monthTitle()),
|
|
2902
2923
|
h(
|
|
2903
2924
|
'div',
|
|
2904
|
-
{ className: 'dsh-todo-month-grid' },
|
|
2925
|
+
{ className: 'dsh-todo-month-grid', style: { gridTemplateRows: 'auto', gridAutoRows: 'minmax(84px, auto)', height: 'auto', overflow: 'visible' } },
|
|
2905
2926
|
WEEKDAYS.map((name) => h('div', { key: name, className: 'dsh-todo-month-weekday' }, name)),
|
|
2906
2927
|
model.monthCells().map((cell, index) => {
|
|
2907
2928
|
if (!cell) return h('div', { key: index });
|
|
2908
|
-
const
|
|
2929
|
+
const cellKey = keyOf(cell);
|
|
2930
|
+
const editorOpen = model.editorDay === cellKey;
|
|
2931
|
+
let cellClass = model.isToday(cell) ? 'dsh-todo-month-cell--today' : '';
|
|
2932
|
+
if (model.dragOverKey === cellKey) cellClass += ' dsh-todo-month-cell--drop';
|
|
2909
2933
|
return h(
|
|
2910
2934
|
'div',
|
|
2911
2935
|
{
|
|
2912
2936
|
key: index,
|
|
2913
|
-
className:
|
|
2914
|
-
style: { cursor: 'pointer' },
|
|
2937
|
+
className: cellClass,
|
|
2938
|
+
style: { cursor: 'pointer', height: '100%', minHeight: '84px', maxHeight: 'none', overflow: 'visible', boxSizing: 'border-box', display: 'flex', flexDirection: 'column', alignItems: 'stretch' },
|
|
2939
|
+
onDragOver: (event) => {
|
|
2940
|
+
if (!model.dragKey) return;
|
|
2941
|
+
event.preventDefault();
|
|
2942
|
+
try {
|
|
2943
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';
|
|
2944
|
+
} catch (error) {
|
|
2945
|
+
/* ignore */
|
|
2946
|
+
}
|
|
2947
|
+
model.dragOverDay(cellKey);
|
|
2948
|
+
},
|
|
2949
|
+
onDragLeave: (event) => {
|
|
2950
|
+
if (event && event.currentTarget && event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) return;
|
|
2951
|
+
model.clearDragOver(cellKey);
|
|
2952
|
+
},
|
|
2953
|
+
onDrop: (event) => {
|
|
2954
|
+
if (!model.dragKey) return;
|
|
2955
|
+
event.preventDefault();
|
|
2956
|
+
let payload = '';
|
|
2957
|
+
try {
|
|
2958
|
+
payload = String((event.dataTransfer && event.dataTransfer.getData('text/plain')) || '');
|
|
2959
|
+
} catch (error) {
|
|
2960
|
+
payload = '';
|
|
2961
|
+
}
|
|
2962
|
+
const parts = payload.split('|');
|
|
2963
|
+
const source = model.tasks.find((task) => Number(task.id) === Number(parts[0]));
|
|
2964
|
+
const fromKey = parts[1] || '';
|
|
2965
|
+
model.endTaskDrag();
|
|
2966
|
+
if (!source) return;
|
|
2967
|
+
if (source.repeat) {
|
|
2968
|
+
model.showToast(tr('monthDragRepeat'));
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
if (fromKey === cellKey) return;
|
|
2972
|
+
model.moveTaskToDate({ source, occurrenceKey: fromKey || source.startDate }, cellKey);
|
|
2973
|
+
},
|
|
2915
2974
|
onClick: editorOpen
|
|
2916
2975
|
? undefined
|
|
2917
2976
|
: (event) => {
|
|
2977
|
+
const target = event && event.target;
|
|
2978
|
+
if (target && typeof target.closest === 'function' && target.closest('.dsh-todo-month-task')) return;
|
|
2918
2979
|
event.stopPropagation();
|
|
2919
2980
|
model.openEditor(monthDay(cell));
|
|
2920
2981
|
},
|
|
2921
2982
|
},
|
|
2922
2983
|
h('b', null, String(cell.getDate())),
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2984
|
+
h(
|
|
2985
|
+
'div',
|
|
2986
|
+
{
|
|
2987
|
+
className: 'dsh-todo-month-cell-body',
|
|
2988
|
+
style: {
|
|
2989
|
+
height: 'auto',
|
|
2990
|
+
flex: '1 1 auto',
|
|
2991
|
+
minHeight: '44px',
|
|
2992
|
+
marginTop: '2px',
|
|
2993
|
+
padding: '2px 3px',
|
|
2994
|
+
boxSizing: 'border-box',
|
|
2995
|
+
background: 'var(--dsw-alias-bg-layer-2)',
|
|
2996
|
+
borderRadius: '4px',
|
|
2997
|
+
overflow: 'visible',
|
|
2998
|
+
},
|
|
2999
|
+
},
|
|
3000
|
+
(editorOpen ? [] : model.tasksFor(cell)).map((task) => {
|
|
3001
|
+
const source = task.source || task;
|
|
3002
|
+
const done = model.isTaskDone(task);
|
|
3003
|
+
const repeating = Boolean(source.repeat);
|
|
3004
|
+
let taskClass = monthTaskClass(task);
|
|
3005
|
+
if (model.dragKey && model.dragKey === task.occurrenceKey) taskClass += ' dsh-todo-month-task--dragging';
|
|
3006
|
+
return h(
|
|
3007
|
+
'span',
|
|
3008
|
+
{
|
|
3009
|
+
key: task.id,
|
|
3010
|
+
className: taskClass,
|
|
3011
|
+
title: task.text,
|
|
3012
|
+
draggable: !done,
|
|
3013
|
+
onDragStart: (event) => {
|
|
3014
|
+
if (repeating) {
|
|
3015
|
+
if (event && event.preventDefault) event.preventDefault();
|
|
3016
|
+
model.showToast(tr('monthDragRepeat'));
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
try {
|
|
3020
|
+
if (event && event.dataTransfer) {
|
|
3021
|
+
event.dataTransfer.setData('text/plain', String(source.id) + '|' + String(task.occurrenceKey || source.startDate));
|
|
3022
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
3023
|
+
}
|
|
3024
|
+
} catch (error) {
|
|
3025
|
+
/* ignore */
|
|
3026
|
+
}
|
|
3027
|
+
model.beginTaskDrag(task);
|
|
3028
|
+
},
|
|
3029
|
+
onDragEnd: () => model.endTaskDrag(),
|
|
3030
|
+
onClick: (event) => {
|
|
3031
|
+
if (event && event.stopPropagation) event.stopPropagation();
|
|
3032
|
+
model.toggleTask(task);
|
|
3033
|
+
},
|
|
3034
|
+
onDoubleClick: (event) => {
|
|
3035
|
+
if (event && event.stopPropagation) event.stopPropagation();
|
|
3036
|
+
model.openTaskEditor(task);
|
|
3037
|
+
},
|
|
3038
|
+
},
|
|
3039
|
+
h('span', { className: 'dsh-todo-month-task-text' }, task.text + (task.category === 'temporary' ? ' · ' + tr('temporaryKind') : '')),
|
|
3040
|
+
h(
|
|
3041
|
+
'button',
|
|
3042
|
+
{
|
|
3043
|
+
type: 'button',
|
|
3044
|
+
className: 'dsh-todo-month-task-del',
|
|
3045
|
+
title: tr('remove'),
|
|
3046
|
+
'aria-label': tr('remove'),
|
|
3047
|
+
onClick: (event) => {
|
|
3048
|
+
if (event && event.stopPropagation) event.stopPropagation();
|
|
3049
|
+
model.deleteItem(task);
|
|
3050
|
+
},
|
|
3051
|
+
},
|
|
3052
|
+
'×',
|
|
3053
|
+
),
|
|
3054
|
+
);
|
|
3055
|
+
}),
|
|
3056
|
+
editorOpen ? renderTodoEditor(monthDay(cell)) : null,
|
|
3057
|
+
),
|
|
2928
3058
|
);
|
|
2929
3059
|
}),
|
|
2930
3060
|
),
|
|
@@ -2945,7 +3075,7 @@ window.__ModuleLoader__.load({
|
|
|
2945
3075
|
|
|
2946
3076
|
const periodSection = h(
|
|
2947
3077
|
'section',
|
|
2948
|
-
{ className: 'dsh-todo-panel dsh-todo-period-panel' },
|
|
3078
|
+
{ className: 'dsh-todo-panel dsh-todo-period-panel', ref: periodRef, style: { height: 'auto', maxHeight: 'none', flex: '0 0 auto', overflow: 'visible' } },
|
|
2949
3079
|
h(
|
|
2950
3080
|
'div',
|
|
2951
3081
|
{ className: 'dsh-todo-section-head' },
|
|
@@ -2953,7 +3083,6 @@ window.__ModuleLoader__.load({
|
|
|
2953
3083
|
h('div', { className: 'dsh-todo-actions' }, periodActions),
|
|
2954
3084
|
),
|
|
2955
3085
|
h('div', { className: 'dsh-todo-period-body' }, model.showMonth ? monthView : weeksView),
|
|
2956
|
-
h('p', { className: 'dsh-todo-note' }, tr('periodNote')),
|
|
2957
3086
|
);
|
|
2958
3087
|
|
|
2959
3088
|
// ----- category view -----------------------------------------------
|
|
@@ -3657,75 +3786,6 @@ window.__ModuleLoader__.load({
|
|
|
3657
3786
|
)
|
|
3658
3787
|
: null;
|
|
3659
3788
|
|
|
3660
|
-
const maintenanceModal = model.maintenanceOpen
|
|
3661
|
-
? h(
|
|
3662
|
-
'div',
|
|
3663
|
-
{ className: 'dsh-todo-modal-backdrop', onClick: (event) => { if (event.target === event.currentTarget) model.closeMaintenance(); } },
|
|
3664
|
-
h(
|
|
3665
|
-
'div',
|
|
3666
|
-
{ className: 'dsh-todo-modal', role: 'dialog', 'aria-modal': true, 'aria-label': tr('maintenanceTitle') },
|
|
3667
|
-
h(
|
|
3668
|
-
'div',
|
|
3669
|
-
{ className: 'dsh-todo-modal-head' },
|
|
3670
|
-
h('h3', null, tr('maintenanceTitle')),
|
|
3671
|
-
h('button', { type: 'button', className: 'dsh-todo-modal-close', 'aria-label': tr('cancel'), onClick: () => model.closeMaintenance() }, '×'),
|
|
3672
|
-
),
|
|
3673
|
-
h('input', {
|
|
3674
|
-
className: 'dsh-todo-field',
|
|
3675
|
-
placeholder: tr('maintenanceSrc'),
|
|
3676
|
-
'aria-label': tr('maintenanceSrc'),
|
|
3677
|
-
value: model.maintenanceSrc,
|
|
3678
|
-
onChange: (event) => {
|
|
3679
|
-
model.maintenanceSrc = event.target.value;
|
|
3680
|
-
model.bump();
|
|
3681
|
-
},
|
|
3682
|
-
}),
|
|
3683
|
-
h('p', { className: 'dsh-todo-muted' }, tr('maintenanceKeepHint')),
|
|
3684
|
-
h('input', {
|
|
3685
|
-
className: 'dsh-todo-field',
|
|
3686
|
-
placeholder: tr('maintenanceDest'),
|
|
3687
|
-
'aria-label': tr('maintenanceDest'),
|
|
3688
|
-
value: model.maintenanceDest,
|
|
3689
|
-
onChange: (event) => {
|
|
3690
|
-
model.maintenanceDest = event.target.value;
|
|
3691
|
-
model.bump();
|
|
3692
|
-
},
|
|
3693
|
-
}),
|
|
3694
|
-
h(
|
|
3695
|
-
'label',
|
|
3696
|
-
{ className: 'dsh-todo-muted' },
|
|
3697
|
-
h('input', {
|
|
3698
|
-
type: 'checkbox',
|
|
3699
|
-
checked: model.maintenanceOverwrite === true,
|
|
3700
|
-
onChange: (event) => {
|
|
3701
|
-
model.maintenanceOverwrite = event.target.checked === true;
|
|
3702
|
-
model.bump();
|
|
3703
|
-
},
|
|
3704
|
-
}),
|
|
3705
|
-
' ',
|
|
3706
|
-
tr('maintenanceOverwrite'),
|
|
3707
|
-
),
|
|
3708
|
-
model.maintenanceError ? h('p', { className: 'dsh-todo-warn' }, model.maintenanceError) : null,
|
|
3709
|
-
model.maintenanceResult ? h('p', { className: 'dsh-todo-muted dsh-todo-pre' }, model.maintenanceResult) : null,
|
|
3710
|
-
h(
|
|
3711
|
-
'div',
|
|
3712
|
-
{ className: 'dsh-todo-editor-actions' },
|
|
3713
|
-
h(
|
|
3714
|
-
'button',
|
|
3715
|
-
{
|
|
3716
|
-
type: 'button',
|
|
3717
|
-
className: 'dsh-todo-action dsh-todo-primary',
|
|
3718
|
-
disabled: model.maintenanceBusy,
|
|
3719
|
-
onClick: () => model.runMaintenance(),
|
|
3720
|
-
},
|
|
3721
|
-
model.maintenanceBusy ? tr('maintenanceRunning') : tr('maintenanceRun'),
|
|
3722
|
-
),
|
|
3723
|
-
h('button', { type: 'button', className: 'dsh-todo-action', onClick: () => model.closeMaintenance() }, tr('cancel')),
|
|
3724
|
-
),
|
|
3725
|
-
),
|
|
3726
|
-
)
|
|
3727
|
-
: null;
|
|
3728
|
-
|
|
3729
3789
|
const recordDeleteModal = model.recordDeleteTarget
|
|
3730
3790
|
? h(
|
|
3731
3791
|
'div',
|
|
@@ -3842,18 +3902,12 @@ window.__ModuleLoader__.load({
|
|
|
3842
3902
|
model.storageBlocked ? h('p', { className: 'dsh-todo-warn' }, tr('storageBlocked')) : null,
|
|
3843
3903
|
model.mergeNotice ? h('p', { className: 'dsh-todo-warn' }, model.mergeNotice) : null,
|
|
3844
3904
|
model.meetingNotice ? h('p', { className: 'dsh-todo-muted' }, model.meetingNotice) : null,
|
|
3845
|
-
h(
|
|
3846
|
-
'div',
|
|
3847
|
-
{ className: 'dsh-todo-maint' },
|
|
3848
|
-
h('button', { type: 'button', className: 'dsh-todo-maint-link', onClick: () => model.openMaintenance() }, tr('maintenanceEntry')),
|
|
3849
|
-
),
|
|
3850
3905
|
model.hostError ? h('p', { className: 'dsh-todo-warn' }, tr('hostError')) : null,
|
|
3851
3906
|
),
|
|
3852
3907
|
taskModal,
|
|
3853
3908
|
projectModal,
|
|
3854
3909
|
importModal,
|
|
3855
3910
|
meetingModal,
|
|
3856
|
-
maintenanceModal,
|
|
3857
3911
|
recordDeleteModal,
|
|
3858
3912
|
model.highlightBar
|
|
3859
3913
|
? h(
|
package/cordis.patch.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-haitang-todo",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Haitang Todo: a todo panel in the DeepSeek Harness Web UI sidebar with tasks, projects problem logs, monthly goals and a week (period) view.",
|
|
6
6
|
"license": "MIT",
|