dsh-config-manager 0.1.31 → 0.1.32

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/lib/client.js CHANGED
@@ -2202,109 +2202,109 @@ if (typeof document !== "undefined" && document.querySelector("style[data-tag=\"
2202
2202
  document.head.appendChild(tag);
2203
2203
  }
2204
2204
  var config_manager_module_css_default = {
2205
- "groupNote": "_367UGW_groupNote",
2206
- "badgeOk": "_367UGW_badgeOk",
2207
- "modeTabs": "_367UGW_modeTabs",
2208
- "optionsHeader": "_367UGW_optionsHeader",
2209
- "viewBody": "_367UGW_viewBody",
2210
- "badgeInfo": "_367UGW_badgeInfo",
2211
- "reportView": "_367UGW_reportView",
2212
- "progressBlock": "_367UGW_progressBlock",
2213
- "progressTrack": "_367UGW_progressTrack",
2214
- "pathOld": "_367UGW_pathOld",
2205
+ "pathMappingList": "_367UGW_pathMappingList",
2206
+ "modeHint": "_367UGW_modeHint",
2207
+ "modeTab": "_367UGW_modeTab",
2208
+ "secretsList": "_367UGW_secretsList",
2209
+ "dshCmSpin": "_367UGW_dshCmSpin",
2210
+ "confirmScroll": "_367UGW_confirmScroll",
2211
+ "field": "_367UGW_field",
2212
+ "errorLine": "_367UGW_errorLine",
2213
+ "select": "_367UGW_select",
2215
2214
  "pathValue": "_367UGW_pathValue",
2216
- "card": "_367UGW_card",
2217
- "progressBadgeCount": "_367UGW_progressBadgeCount",
2218
- "categoryName": "_367UGW_categoryName",
2215
+ "sectionBody": "_367UGW_sectionBody",
2216
+ "spinnerWrap": "_367UGW_spinnerWrap",
2217
+ "sectionSubtitle": "_367UGW_sectionSubtitle",
2218
+ "spinnerLabel": "_367UGW_spinnerLabel",
2219
+ "errorBanner": "_367UGW_errorBanner",
2220
+ "badgeError": "_367UGW_badgeError",
2221
+ "progressBadgeSection": "_367UGW_progressBadgeSection",
2219
2222
  "progressIndeterminate": "_367UGW_progressIndeterminate",
2220
- "conflictHead": "_367UGW_conflictHead",
2221
- "errorAction": "_367UGW_errorAction",
2223
+ "warnText": "_367UGW_warnText",
2224
+ "badge": "_367UGW_badge",
2225
+ "groupList": "_367UGW_groupList",
2226
+ "rollbackBox": "_367UGW_rollbackBox",
2227
+ "badgeOk": "_367UGW_badgeOk",
2228
+ "checkboxRow": "_367UGW_checkboxRow",
2229
+ "progressBadgeCount": "_367UGW_progressBadgeCount",
2230
+ "actionRow": "_367UGW_actionRow",
2222
2231
  "progressLabel": "_367UGW_progressLabel",
2223
- "pathRow": "_367UGW_pathRow",
2224
- "empty": "_367UGW_empty",
2225
- "dshCmSpin": "_367UGW_dshCmSpin",
2232
+ "reportView": "_367UGW_reportView",
2233
+ "pathIssueKind": "_367UGW_pathIssueKind",
2226
2234
  "planScroll": "_367UGW_planScroll",
2227
- "hiddenFile": "_367UGW_hiddenFile",
2228
- "progressPercent": "_367UGW_progressPercent",
2229
- "viewTabs": "_367UGW_viewTabs",
2230
- "viewTab": "_367UGW_viewTab",
2235
+ "pullScroll": "_367UGW_pullScroll",
2236
+ "fieldLabel": "_367UGW_fieldLabel",
2237
+ "progressBar": "_367UGW_progressBar",
2231
2238
  "categoryDesc": "_367UGW_categoryDesc",
2232
- "dshCmIndeterminate": "_367UGW_dshCmIndeterminate",
2239
+ "primaryButton": "_367UGW_primaryButton",
2240
+ "errorItem": "_367UGW_errorItem",
2233
2241
  "conflictOptions": "_367UGW_conflictOptions",
2234
- "confirmScroll": "_367UGW_confirmScroll",
2242
+ "section": "_367UGW_section",
2243
+ "optionsHeader": "_367UGW_optionsHeader",
2244
+ "pathNew": "_367UGW_pathNew",
2245
+ "conflictId": "_367UGW_conflictId",
2246
+ "snapshotRowHeader": "_367UGW_snapshotRowHeader",
2247
+ "errorAction": "_367UGW_errorAction",
2248
+ "viewTabs": "_367UGW_viewTabs",
2249
+ "categoryItem": "_367UGW_categoryItem",
2250
+ "dshCmIndeterminate": "_367UGW_dshCmIndeterminate",
2251
+ "snapshotRow": "_367UGW_snapshotRow",
2252
+ "reportScroll": "_367UGW_reportScroll",
2253
+ "ghostButton": "_367UGW_ghostButton",
2254
+ "sectionHeader": "_367UGW_sectionHeader",
2255
+ "reportFooter": "_367UGW_reportFooter",
2256
+ "rowActions": "_367UGW_rowActions",
2257
+ "formError": "_367UGW_formError",
2258
+ "pathOld": "_367UGW_pathOld",
2259
+ "viewTab": "_367UGW_viewTab",
2260
+ "secretFields": "_367UGW_secretFields",
2261
+ "progressTrack": "_367UGW_progressTrack",
2262
+ "progressBadge": "_367UGW_progressBadge",
2263
+ "reportText": "_367UGW_reportText",
2264
+ "progressBarDone": "_367UGW_progressBarDone",
2265
+ "empty": "_367UGW_empty",
2235
2266
  "radioLabel": "_367UGW_radioLabel",
2236
2267
  "banner": "_367UGW_banner",
2268
+ "viewBody": "_367UGW_viewBody",
2269
+ "warnList": "_367UGW_warnList",
2270
+ "optionsCard": "_367UGW_optionsCard",
2271
+ "progressPercent": "_367UGW_progressPercent",
2272
+ "errorList": "_367UGW_errorList",
2273
+ "severityError": "_367UGW_severityError",
2237
2274
  "groupHeader": "_367UGW_groupHeader",
2275
+ "spinner": "_367UGW_spinner",
2238
2276
  "diffScroll": "_367UGW_diffScroll",
2239
- "reportList": "_367UGW_reportList",
2240
- "field": "_367UGW_field",
2241
- "spinnerLabel": "_367UGW_spinnerLabel",
2242
- "errorLine": "_367UGW_errorLine",
2243
- "conflictItem": "_367UGW_conflictItem",
2244
- "formError": "_367UGW_formError",
2277
+ "snapshotList": "_367UGW_snapshotList",
2278
+ "errorReason": "_367UGW_errorReason",
2245
2279
  "groupCard": "_367UGW_groupCard",
2246
- "secretsList": "_367UGW_secretsList",
2247
- "badgeWarn": "_367UGW_badgeWarn",
2248
- "progressBadge": "_367UGW_progressBadge",
2249
- "warnText": "_367UGW_warnText",
2250
- "pullScroll": "_367UGW_pullScroll",
2251
- "warnList": "_367UGW_warnList",
2252
- "errorList": "_367UGW_errorList",
2253
- "modeTab": "_367UGW_modeTab",
2254
- "progressBarDone": "_367UGW_progressBarDone",
2255
- "statRow": "_367UGW_statRow",
2256
- "secretFields": "_367UGW_secretFields",
2257
- "groupItems": "_367UGW_groupItems",
2258
- "sectionHeader": "_367UGW_sectionHeader",
2259
- "primaryButton": "_367UGW_primaryButton",
2260
2280
  "dangerButton": "_367UGW_dangerButton",
2261
- "groupLabel": "_367UGW_groupLabel",
2262
- "sectionTitle": "_367UGW_sectionTitle",
2263
- "badge": "_367UGW_badge",
2264
- "input": "_367UGW_input",
2265
- "actionRow": "_367UGW_actionRow",
2266
- "progressBadgeSection": "_367UGW_progressBadgeSection",
2267
- "errorBanner": "_367UGW_errorBanner",
2281
+ "progressMeta": "_367UGW_progressMeta",
2282
+ "badgeInfo": "_367UGW_badgeInfo",
2283
+ "conflictHead": "_367UGW_conflictHead",
2284
+ "conflictDetail": "_367UGW_conflictDetail",
2285
+ "badgeWarn": "_367UGW_badgeWarn",
2286
+ "conflictItem": "_367UGW_conflictItem",
2287
+ "pathRow": "_367UGW_pathRow",
2288
+ "reportList": "_367UGW_reportList",
2289
+ "errorFooter": "_367UGW_errorFooter",
2290
+ "kindTag": "_367UGW_kindTag",
2268
2291
  "hint": "_367UGW_hint",
2269
- "conflictList": "_367UGW_conflictList",
2270
- "pathNew": "_367UGW_pathNew",
2271
- "groupList": "_367UGW_groupList",
2272
- "spinner": "_367UGW_spinner",
2292
+ "input": "_367UGW_input",
2273
2293
  "progressDetail": "_367UGW_progressDetail",
2274
- "severityError": "_367UGW_severityError",
2275
- "snapshotRow": "_367UGW_snapshotRow",
2276
- "sectionSubtitle": "_367UGW_sectionSubtitle",
2277
- "errorReason": "_367UGW_errorReason",
2278
- "kindTag": "_367UGW_kindTag",
2279
- "rowActions": "_367UGW_rowActions",
2280
- "conflictId": "_367UGW_conflictId",
2281
- "reportText": "_367UGW_reportText",
2282
- "categoryItem": "_367UGW_categoryItem",
2283
- "errorActionLabel": "_367UGW_errorActionLabel",
2284
- "snapshotList": "_367UGW_snapshotList",
2285
- "modeHint": "_367UGW_modeHint",
2286
- "reportFooter": "_367UGW_reportFooter",
2287
- "rollbackBox": "_367UGW_rollbackBox",
2288
- "section": "_367UGW_section",
2289
- "errorItem": "_367UGW_errorItem",
2290
- "reportScroll": "_367UGW_reportScroll",
2291
- "conflictDetail": "_367UGW_conflictDetail",
2292
- "sectionTitleBlock": "_367UGW_sectionTitleBlock",
2293
- "ghostButton": "_367UGW_ghostButton",
2294
- "optionsCard": "_367UGW_optionsCard",
2295
- "fieldLabel": "_367UGW_fieldLabel",
2296
- "checkboxRow": "_367UGW_checkboxRow",
2297
- "pathIssueKind": "_367UGW_pathIssueKind",
2298
- "badgeError": "_367UGW_badgeError",
2294
+ "progressBlock": "_367UGW_progressBlock",
2295
+ "categoryName": "_367UGW_categoryName",
2296
+ "groupNote": "_367UGW_groupNote",
2297
+ "groupItems": "_367UGW_groupItems",
2298
+ "hiddenFile": "_367UGW_hiddenFile",
2299
+ "groupLabel": "_367UGW_groupLabel",
2299
2300
  "errorTitle": "_367UGW_errorTitle",
2300
- "errorFooter": "_367UGW_errorFooter",
2301
- "progressMeta": "_367UGW_progressMeta",
2302
- "pathMappingList": "_367UGW_pathMappingList",
2303
- "progressBar": "_367UGW_progressBar",
2304
- "sectionBody": "_367UGW_sectionBody",
2305
- "select": "_367UGW_select",
2306
- "spinnerWrap": "_367UGW_spinnerWrap",
2307
- "snapshotRowHeader": "_367UGW_snapshotRowHeader"
2301
+ "sectionTitleBlock": "_367UGW_sectionTitleBlock",
2302
+ "card": "_367UGW_card",
2303
+ "modeTabs": "_367UGW_modeTabs",
2304
+ "errorActionLabel": "_367UGW_errorActionLabel",
2305
+ "statRow": "_367UGW_statRow",
2306
+ "conflictList": "_367UGW_conflictList",
2307
+ "sectionTitle": "_367UGW_sectionTitle"
2308
2308
  };
2309
2309
  //#endregion
2310
2310
  //#region src/client/common/ui.tsx
@@ -4424,14 +4424,32 @@ var SyncApi = class {
4424
4424
  function privateRepoHint(t = zhUiT) {
4425
4425
  return t("sync.privateRepoHint");
4426
4426
  }
4427
- /** host 目录(SyncSectionInfo[])→ UI 勾选项(保留 id 顺序)。 */
4427
+ /** host 目录(SyncSectionInfo[])→ UI 勾选项(保留 id 顺序)。
4428
+ * 同步分区必为导出目录(DEFAULT_CATEGORIES)的可移植子集:分组/描述从导出目录
4429
+ * 补充(单一事实源,与「导出备份·自定义模式」的目录保持一致),未命中 id 兜底。 */
4428
4430
  function syncSectionOptions(info) {
4429
- return info.map((s) => ({
4430
- id: s.id,
4431
- label: s.displayName,
4432
- portability: s.portability,
4433
- defaultIncluded: s.defaultIncluded
4434
- }));
4431
+ const meta = new Map(DEFAULT_CATEGORIES.map((c) => [c.id, c]));
4432
+ return info.map((s) => {
4433
+ const cat = meta.get(s.id);
4434
+ return {
4435
+ id: s.id,
4436
+ label: s.displayName,
4437
+ description: cat?.description ?? "",
4438
+ group: cat?.group ?? "general",
4439
+ portability: s.portability,
4440
+ defaultIncluded: s.defaultIncluded
4441
+ };
4442
+ });
4443
+ }
4444
+ /** 高级模式勾选目录 → 按导出分组(EXPORT_GROUPS)投影:与「导出备份·自定义模式」同构,
4445
+ * 空分组省略;UI 直接渲染 groupCard。 */
4446
+ function syncSectionGroups(options) {
4447
+ return EXPORT_GROUPS.map((g) => ({
4448
+ group: g.id,
4449
+ label: g.label,
4450
+ ...g.note !== void 0 ? { note: g.note } : {},
4451
+ items: options.filter((o) => o.group === g.id)
4452
+ })).filter((g) => g.items.length > 0);
4435
4453
  }
4436
4454
  /** 默认(快速导出)模式的推荐同步分区:可移植且默认包含(与 ExportFlow.quickSelection 同口径)。 */
4437
4455
  function recommendedSyncSections(info) {
@@ -6134,29 +6152,48 @@ function SyncSettingsView({ api, t }) {
6134
6152
  children: t("common.loading")
6135
6153
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6136
6154
  className: config_manager_module_css_default.groupList,
6137
- children: state.catalog.map((s) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Checkbox, {
6138
- checked: state.syncSections.includes(s.id),
6139
- onChange: (checked) => {
6140
- toggleSyncSection(s.id, checked);
6141
- },
6142
- label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6143
- className: config_manager_module_css_default.categoryItem,
6144
- children: [
6145
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6146
- className: config_manager_module_css_default.categoryName,
6147
- children: s.label
6148
- }),
6149
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, {
6150
- kind: "info",
6151
- children: t("mode.sectionPortable")
6152
- }),
6153
- s.defaultIncluded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, {
6154
- kind: "ok",
6155
- children: t("mode.sectionRecommended")
6155
+ children: syncSectionGroups(state.catalog).map((g) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Card, {
6156
+ className: config_manager_module_css_default.groupCard,
6157
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6158
+ className: config_manager_module_css_default.groupHeader,
6159
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6160
+ className: config_manager_module_css_default.groupLabel,
6161
+ children: g.label
6162
+ }), g.note !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6163
+ className: config_manager_module_css_default.groupNote,
6164
+ children: g.note
6165
+ })]
6166
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6167
+ className: config_manager_module_css_default.groupItems,
6168
+ children: g.items.map((s) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Checkbox, {
6169
+ checked: state.syncSections.includes(s.id),
6170
+ onChange: (checked) => {
6171
+ toggleSyncSection(s.id, checked);
6172
+ },
6173
+ label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6174
+ className: config_manager_module_css_default.categoryItem,
6175
+ children: [
6176
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6177
+ className: config_manager_module_css_default.categoryName,
6178
+ children: s.label
6179
+ }),
6180
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6181
+ className: config_manager_module_css_default.categoryDesc,
6182
+ children: s.description
6183
+ }),
6184
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, {
6185
+ kind: "info",
6186
+ children: t("mode.sectionPortable")
6187
+ }),
6188
+ s.defaultIncluded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, {
6189
+ kind: "ok",
6190
+ children: t("mode.sectionRecommended")
6191
+ })
6192
+ ]
6156
6193
  })
6157
- ]
6158
- })
6159
- }, s.id))
6194
+ }, s.id))
6195
+ })]
6196
+ }, g.group))
6160
6197
  }),
6161
6198
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6162
6199
  className: config_manager_module_css_default.hint,