@zaclinley/dsh-mailharbor 0.5.0 → 0.5.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/CHANGELOG.md +11 -0
- package/lib/client.js +163 -91
- package/lib/client.js.map +2 -2
- package/lib/index.js +17 -4
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c12db95: - Projects now appear in the DSH Workspaces sidebar: the plugin waits for the
|
|
8
|
+
optional `workspaceRegistry` service and registers the project workspace
|
|
9
|
+
(and its starting session) instead of leaving a folder-only project.
|
|
10
|
+
- CalDAV gets a dedicated "任务与 CalDAV" card in MailHarbor settings: account
|
|
11
|
+
picker, address, username, app password, calendar path, save and "sync now",
|
|
12
|
+
plus the last sync state.
|
|
13
|
+
|
|
3
14
|
## 0.5.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/lib/client.js
CHANGED
|
@@ -3062,6 +3062,15 @@ function MailSettings() {
|
|
|
3062
3062
|
const [pollSeconds, setPollSeconds] = (0, import_react10.useState)(60);
|
|
3063
3063
|
const [listLimit, setListLimit] = (0, import_react10.useState)(40);
|
|
3064
3064
|
const [projectRoot, setProjectRoot] = (0, import_react10.useState)("");
|
|
3065
|
+
const [caldavAccountId, setCaldavAccountId] = (0, import_react10.useState)("");
|
|
3066
|
+
const [caldavUrl, setCaldavUrl] = (0, import_react10.useState)("");
|
|
3067
|
+
const [caldavUser, setCaldavUser] = (0, import_react10.useState)("");
|
|
3068
|
+
const [caldavPassword, setCaldavPassword] = (0, import_react10.useState)("");
|
|
3069
|
+
const [caldavHref, setCaldavHref] = (0, import_react10.useState)("");
|
|
3070
|
+
const [caldavHasPassword, setCaldavHasPassword] = (0, import_react10.useState)(false);
|
|
3071
|
+
const [caldavCalendar, setCaldavCalendar] = (0, import_react10.useState)(null);
|
|
3072
|
+
const [caldavMessage, setCaldavMessage] = (0, import_react10.useState)("");
|
|
3073
|
+
const [caldavBusy, setCaldavBusy] = (0, import_react10.useState)(false);
|
|
3065
3074
|
const [aiEnabled, setAiEnabled] = (0, import_react10.useState)(true);
|
|
3066
3075
|
const [aiProvider, setAiProvider] = (0, import_react10.useState)("deepseek-account");
|
|
3067
3076
|
const [aiModel, setAiModel] = (0, import_react10.useState)("deepseek-flash");
|
|
@@ -3085,6 +3094,9 @@ function MailSettings() {
|
|
|
3085
3094
|
setPollSeconds(view.read.pollSeconds);
|
|
3086
3095
|
setListLimit(view.render.listLimit);
|
|
3087
3096
|
setProjectRoot(view.projects.root);
|
|
3097
|
+
setCaldavAccountId(
|
|
3098
|
+
(current) => current || view.activeAccountId || appState.settings.activeAccountId || ""
|
|
3099
|
+
);
|
|
3088
3100
|
setAiEnabled(view.ai.enabled);
|
|
3089
3101
|
setAiProvider(view.ai.provider);
|
|
3090
3102
|
setAiModel(view.ai.model);
|
|
@@ -3095,6 +3107,23 @@ function MailSettings() {
|
|
|
3095
3107
|
cancelled = true;
|
|
3096
3108
|
};
|
|
3097
3109
|
}, [tick]);
|
|
3110
|
+
(0, import_react10.useEffect)(() => {
|
|
3111
|
+
let cancelled = false;
|
|
3112
|
+
if (caldavAccountId === "") return;
|
|
3113
|
+
api.taskCaldav(caldavAccountId).then((info) => {
|
|
3114
|
+
if (cancelled) return;
|
|
3115
|
+
setCaldavUrl(info.caldav?.url ?? "");
|
|
3116
|
+
setCaldavUser(info.caldav?.username ?? "");
|
|
3117
|
+
setCaldavHref(info.caldav?.calendarHref ?? "");
|
|
3118
|
+
setCaldavHasPassword(info.hasPassword);
|
|
3119
|
+
setCaldavCalendar(info.calendar);
|
|
3120
|
+
}).catch((caught) => {
|
|
3121
|
+
if (!cancelled) setCaldavMessage(errorText6(caught));
|
|
3122
|
+
});
|
|
3123
|
+
return () => {
|
|
3124
|
+
cancelled = true;
|
|
3125
|
+
};
|
|
3126
|
+
}, [caldavAccountId, tick]);
|
|
3098
3127
|
(0, import_react10.useEffect)(() => {
|
|
3099
3128
|
let cancelled = false;
|
|
3100
3129
|
const accountId = settings?.activeAccountId ?? state?.activeAccountId ?? null;
|
|
@@ -3290,6 +3319,139 @@ function MailSettings() {
|
|
|
3290
3319
|
)
|
|
3291
3320
|
)
|
|
3292
3321
|
),
|
|
3322
|
+
(0, import_react10.createElement)(
|
|
3323
|
+
"div",
|
|
3324
|
+
{ className: "mailharbor-card" },
|
|
3325
|
+
(0, import_react10.createElement)("h3", null, "\u4EFB\u52A1\u4E0E CalDAV"),
|
|
3326
|
+
(0, import_react10.createElement)(
|
|
3327
|
+
"p",
|
|
3328
|
+
{ className: "small muted" },
|
|
3329
|
+
"\u4EFB\u52A1\u9762\u677F\u7684\u300C\u540C\u6B65 CalDAV\u300D\u4F7F\u7528\u8FD9\u91CC\u7684\u914D\u7F6E\u3002\u5BC6\u7801\u53EA\u5B58\u7CFB\u7EDF Keychain\uFF0C\u4E0D\u5199\u5165\u914D\u7F6E\u6587\u4EF6\u3002"
|
|
3330
|
+
),
|
|
3331
|
+
(0, import_react10.createElement)(
|
|
3332
|
+
"div",
|
|
3333
|
+
{ className: "mailharbor-grid" },
|
|
3334
|
+
(0, import_react10.createElement)(
|
|
3335
|
+
Field,
|
|
3336
|
+
{ label: "\u8D26\u53F7" },
|
|
3337
|
+
(0, import_react10.createElement)(
|
|
3338
|
+
"select",
|
|
3339
|
+
{
|
|
3340
|
+
value: caldavAccountId,
|
|
3341
|
+
onChange: (event) => {
|
|
3342
|
+
setCaldavAccountId(event.target.value);
|
|
3343
|
+
setCaldavMessage("");
|
|
3344
|
+
}
|
|
3345
|
+
},
|
|
3346
|
+
(settings?.accounts ?? []).map(
|
|
3347
|
+
(item) => (0, import_react10.createElement)("option", { key: item.id, value: item.id }, `${item.label}\uFF08${item.email}\uFF09`)
|
|
3348
|
+
)
|
|
3349
|
+
)
|
|
3350
|
+
),
|
|
3351
|
+
(0, import_react10.createElement)(
|
|
3352
|
+
Field,
|
|
3353
|
+
{ label: "\u72B6\u6001" },
|
|
3354
|
+
(0, import_react10.createElement)(
|
|
3355
|
+
"span",
|
|
3356
|
+
{ className: "small", style: { paddingTop: "7px", color: "var(--m-text-3)" } },
|
|
3357
|
+
caldavCalendar === null ? "\u672A\u540C\u6B65" : caldavCalendar.lastSync === "" ? "\u672A\u540C\u6B65" : `\u4E0A\u6B21\u540C\u6B65 ${new Date(caldavCalendar.lastSync).toLocaleString()}`,
|
|
3358
|
+
caldavCalendar?.error ? ` \xB7 \u5931\u8D25\uFF1A${caldavCalendar.error}` : ""
|
|
3359
|
+
)
|
|
3360
|
+
)
|
|
3361
|
+
),
|
|
3362
|
+
(0, import_react10.createElement)(
|
|
3363
|
+
"div",
|
|
3364
|
+
{ className: "mailharbor-grid" },
|
|
3365
|
+
(0, import_react10.createElement)(
|
|
3366
|
+
Field,
|
|
3367
|
+
{ label: "CalDAV \u5730\u5740" },
|
|
3368
|
+
(0, import_react10.createElement)("input", {
|
|
3369
|
+
value: caldavUrl,
|
|
3370
|
+
placeholder: "https://caldav.example.com/",
|
|
3371
|
+
onChange: (event) => setCaldavUrl(event.target.value)
|
|
3372
|
+
})
|
|
3373
|
+
),
|
|
3374
|
+
(0, import_react10.createElement)(
|
|
3375
|
+
Field,
|
|
3376
|
+
{ label: "\u7528\u6237\u540D" },
|
|
3377
|
+
(0, import_react10.createElement)("input", {
|
|
3378
|
+
value: caldavUser,
|
|
3379
|
+
placeholder: "\u901A\u5E38\u662F\u90AE\u7BB1\u5730\u5740",
|
|
3380
|
+
onChange: (event) => setCaldavUser(event.target.value)
|
|
3381
|
+
})
|
|
3382
|
+
)
|
|
3383
|
+
),
|
|
3384
|
+
(0, import_react10.createElement)(
|
|
3385
|
+
"div",
|
|
3386
|
+
{ className: "mailharbor-grid" },
|
|
3387
|
+
(0, import_react10.createElement)(
|
|
3388
|
+
Field,
|
|
3389
|
+
{ label: caldavHasPassword ? "\u5E94\u7528\u5BC6\u7801\uFF08\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539\uFF09" : "\u5E94\u7528\u5BC6\u7801" },
|
|
3390
|
+
(0, import_react10.createElement)("input", {
|
|
3391
|
+
type: "password",
|
|
3392
|
+
value: caldavPassword,
|
|
3393
|
+
placeholder: caldavHasPassword ? "\u5DF2\u4FDD\u5B58" : "iCloud / Fastmail \u7B49\u5E94\u7528\u4E13\u7528\u5BC6\u7801",
|
|
3394
|
+
onChange: (event) => setCaldavPassword(event.target.value)
|
|
3395
|
+
})
|
|
3396
|
+
),
|
|
3397
|
+
(0, import_react10.createElement)(
|
|
3398
|
+
Field,
|
|
3399
|
+
{ label: "\u4EFB\u52A1\u65E5\u5386\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09" },
|
|
3400
|
+
(0, import_react10.createElement)("input", {
|
|
3401
|
+
value: caldavHref,
|
|
3402
|
+
placeholder: "\u7559\u7A7A\u81EA\u52A8\u53D1\u73B0",
|
|
3403
|
+
onChange: (event) => setCaldavHref(event.target.value)
|
|
3404
|
+
})
|
|
3405
|
+
)
|
|
3406
|
+
),
|
|
3407
|
+
(0, import_react10.createElement)(
|
|
3408
|
+
"div",
|
|
3409
|
+
{ style: { display: "flex", gap: "8px", alignItems: "center", flexWrap: "wrap" } },
|
|
3410
|
+
(0, import_react10.createElement)(
|
|
3411
|
+
"button",
|
|
3412
|
+
{
|
|
3413
|
+
className: "primary small",
|
|
3414
|
+
disabled: caldavBusy,
|
|
3415
|
+
onClick: () => {
|
|
3416
|
+
setCaldavBusy(true);
|
|
3417
|
+
setCaldavMessage("\u4FDD\u5B58\u4E2D\u2026");
|
|
3418
|
+
void api.saveTaskCaldav({
|
|
3419
|
+
accountId: caldavAccountId,
|
|
3420
|
+
url: caldavUrl,
|
|
3421
|
+
username: caldavUser,
|
|
3422
|
+
...caldavPassword === "" ? {} : { password: caldavPassword },
|
|
3423
|
+
calendarHref: caldavHref
|
|
3424
|
+
}).then((info) => {
|
|
3425
|
+
setCaldavHasPassword(info.hasPassword);
|
|
3426
|
+
setCaldavPassword("");
|
|
3427
|
+
setCaldavMessage(info.hasPassword ? "\u5DF2\u4FDD\u5B58" : "\u5DF2\u4FDD\u5B58\u5730\u5740\uFF0C\u4F46\u8FD8\u6CA1\u6709\u5BC6\u7801");
|
|
3428
|
+
setTick((value) => value + 1);
|
|
3429
|
+
}).catch((caught) => setCaldavMessage(errorText6(caught))).finally(() => setCaldavBusy(false));
|
|
3430
|
+
}
|
|
3431
|
+
},
|
|
3432
|
+
caldavBusy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58 CalDAV"
|
|
3433
|
+
),
|
|
3434
|
+
(0, import_react10.createElement)(
|
|
3435
|
+
"button",
|
|
3436
|
+
{
|
|
3437
|
+
className: "ghost small",
|
|
3438
|
+
disabled: caldavBusy,
|
|
3439
|
+
onClick: () => {
|
|
3440
|
+
setCaldavBusy(true);
|
|
3441
|
+
setCaldavMessage("\u540C\u6B65\u4E2D\u2026");
|
|
3442
|
+
void api.syncTasks(caldavAccountId).then((result) => {
|
|
3443
|
+
setCaldavMessage(
|
|
3444
|
+
`\u540C\u6B65\u5B8C\u6210\uFF1A\u62C9\u53D6 ${String(result.result.pulled)}\uFF0C\u63A8\u9001 ${String(result.result.pushed)}`
|
|
3445
|
+
);
|
|
3446
|
+
setTick((value) => value + 1);
|
|
3447
|
+
}).catch((caught) => setCaldavMessage(errorText6(caught))).finally(() => setCaldavBusy(false));
|
|
3448
|
+
}
|
|
3449
|
+
},
|
|
3450
|
+
"\u7ACB\u5373\u540C\u6B65"
|
|
3451
|
+
),
|
|
3452
|
+
(0, import_react10.createElement)("span", { className: "small muted" }, caldavMessage)
|
|
3453
|
+
)
|
|
3454
|
+
),
|
|
3293
3455
|
(0, import_react10.createElement)(
|
|
3294
3456
|
"div",
|
|
3295
3457
|
{ className: "mailharbor-card" },
|
|
@@ -3502,27 +3664,6 @@ function AccountRow({
|
|
|
3502
3664
|
const [fromName, setFromName] = (0, import_react10.useState)(account.smtp.fromName);
|
|
3503
3665
|
const [busy, setBusy] = (0, import_react10.useState)(false);
|
|
3504
3666
|
const [checking, setChecking] = (0, import_react10.useState)(false);
|
|
3505
|
-
const [caldavUrl, setCaldavUrl] = (0, import_react10.useState)(account.caldav?.url ?? "");
|
|
3506
|
-
const [caldavUser, setCaldavUser] = (0, import_react10.useState)(account.caldav?.username ?? "");
|
|
3507
|
-
const [caldavHref, setCaldavHref] = (0, import_react10.useState)(account.caldav?.calendarHref ?? "");
|
|
3508
|
-
const [caldavPassword, setCaldavPassword] = (0, import_react10.useState)("");
|
|
3509
|
-
const [caldavStatus, setCaldavStatus] = (0, import_react10.useState)("");
|
|
3510
|
-
(0, import_react10.useEffect)(() => {
|
|
3511
|
-
if (!editing) return;
|
|
3512
|
-
let cancelled = false;
|
|
3513
|
-
api.taskCaldav(account.id).then((info) => {
|
|
3514
|
-
if (cancelled) return;
|
|
3515
|
-
setCaldavUrl(info.caldav?.url ?? "");
|
|
3516
|
-
setCaldavUser(info.caldav?.username ?? "");
|
|
3517
|
-
setCaldavHref(info.caldav?.calendarHref ?? "");
|
|
3518
|
-
setCaldavStatus(info.hasPassword ? "\u5DF2\u4FDD\u5B58\u5E94\u7528\u5BC6\u7801" : "\u5C1A\u672A\u4FDD\u5B58\u5E94\u7528\u5BC6\u7801");
|
|
3519
|
-
}).catch(() => {
|
|
3520
|
-
if (!cancelled) setCaldavStatus("\u65E0\u6CD5\u8BFB\u53D6 CalDAV \u914D\u7F6E");
|
|
3521
|
-
});
|
|
3522
|
-
return () => {
|
|
3523
|
-
cancelled = true;
|
|
3524
|
-
};
|
|
3525
|
-
}, [editing, account.id]);
|
|
3526
3667
|
(0, import_react10.useEffect)(() => {
|
|
3527
3668
|
setLabel(account.label);
|
|
3528
3669
|
setUsername(account.username);
|
|
@@ -3683,75 +3824,6 @@ function AccountRow({
|
|
|
3683
3824
|
)
|
|
3684
3825
|
),
|
|
3685
3826
|
(0, import_react10.createElement)("hr", { style: { border: 0, borderTop: "1px solid var(--m-line)", width: "100%" } }),
|
|
3686
|
-
(0, import_react10.createElement)("h4", { style: { margin: 0, fontSize: "12.5px" } }, "CalDAV \u4EFB\u52A1\u540C\u6B65"),
|
|
3687
|
-
(0, import_react10.createElement)(
|
|
3688
|
-
"div",
|
|
3689
|
-
{ className: "mailharbor-grid" },
|
|
3690
|
-
(0, import_react10.createElement)(
|
|
3691
|
-
Field,
|
|
3692
|
-
{ label: "CalDAV \u5730\u5740" },
|
|
3693
|
-
(0, import_react10.createElement)("input", {
|
|
3694
|
-
value: caldavUrl,
|
|
3695
|
-
placeholder: "https://caldav.example.com/",
|
|
3696
|
-
onChange: (event) => setCaldavUrl(event.target.value)
|
|
3697
|
-
})
|
|
3698
|
-
),
|
|
3699
|
-
(0, import_react10.createElement)(
|
|
3700
|
-
Field,
|
|
3701
|
-
{ label: "\u7528\u6237\u540D" },
|
|
3702
|
-
(0, import_react10.createElement)("input", {
|
|
3703
|
-
value: caldavUser,
|
|
3704
|
-
onChange: (event) => setCaldavUser(event.target.value)
|
|
3705
|
-
})
|
|
3706
|
-
)
|
|
3707
|
-
),
|
|
3708
|
-
(0, import_react10.createElement)(
|
|
3709
|
-
"div",
|
|
3710
|
-
{ className: "mailharbor-grid" },
|
|
3711
|
-
(0, import_react10.createElement)(
|
|
3712
|
-
Field,
|
|
3713
|
-
{ label: "\u5E94\u7528\u5BC6\u7801\uFF08\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539\uFF09" },
|
|
3714
|
-
(0, import_react10.createElement)("input", {
|
|
3715
|
-
type: "password",
|
|
3716
|
-
value: caldavPassword,
|
|
3717
|
-
onChange: (event) => setCaldavPassword(event.target.value)
|
|
3718
|
-
})
|
|
3719
|
-
),
|
|
3720
|
-
(0, import_react10.createElement)(
|
|
3721
|
-
Field,
|
|
3722
|
-
{ label: "\u4EFB\u52A1\u65E5\u5386\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09" },
|
|
3723
|
-
(0, import_react10.createElement)("input", {
|
|
3724
|
-
value: caldavHref,
|
|
3725
|
-
placeholder: "\u81EA\u52A8\u53D1\u73B0",
|
|
3726
|
-
onChange: (event) => setCaldavHref(event.target.value)
|
|
3727
|
-
})
|
|
3728
|
-
)
|
|
3729
|
-
),
|
|
3730
|
-
(0, import_react10.createElement)(
|
|
3731
|
-
"div",
|
|
3732
|
-
{ style: { display: "flex", gap: "8px", alignItems: "center" } },
|
|
3733
|
-
(0, import_react10.createElement)(
|
|
3734
|
-
"button",
|
|
3735
|
-
{
|
|
3736
|
-
className: "ghost small",
|
|
3737
|
-
onClick: () => {
|
|
3738
|
-
setCaldavStatus("\u4FDD\u5B58\u4E2D\u2026");
|
|
3739
|
-
void api.saveTaskCaldav({
|
|
3740
|
-
accountId: account.id,
|
|
3741
|
-
url: caldavUrl,
|
|
3742
|
-
username: caldavUser,
|
|
3743
|
-
...caldavPassword === "" ? {} : { password: caldavPassword },
|
|
3744
|
-
calendarHref: caldavHref
|
|
3745
|
-
}).then((info) => {
|
|
3746
|
-
setCaldavStatus(info.hasPassword ? "\u5DF2\u4FDD\u5B58" : "\u672A\u4FDD\u5B58\u5BC6\u7801");
|
|
3747
|
-
setCaldavPassword("");
|
|
3748
|
-
}).catch((caught) => setCaldavStatus(errorText6(caught)));
|
|
3749
|
-
}
|
|
3750
|
-
},
|
|
3751
|
-
"\u4FDD\u5B58 CalDAV"
|
|
3752
|
-
),
|
|
3753
|
-
(0, import_react10.createElement)("span", { className: "small muted" }, caldavStatus)
|
|
3754
|
-
),
|
|
3755
3827
|
(0, import_react10.createElement)(
|
|
3756
3828
|
Field,
|
|
3757
3829
|
{ label: "\u5BC6\u7801 / \u5E94\u7528\u4E13\u7528\u5BC6\u7801\uFF08\u4E0D\u5199\u5165\u914D\u7F6E\u6587\u4EF6\uFF09" },
|
|
@@ -4355,7 +4427,7 @@ function TaskEditor({
|
|
|
4355
4427
|
}
|
|
4356
4428
|
|
|
4357
4429
|
// src/client/index.tsx
|
|
4358
|
-
var VERSION = "0.5.
|
|
4430
|
+
var VERSION = "0.5.1";
|
|
4359
4431
|
var inject = ["slots"];
|
|
4360
4432
|
var PANEL_ID = "mailharbor";
|
|
4361
4433
|
var TASKS_PANEL_ID = "mailharbor-tasks";
|