@dingpenghui/dsh-obsidian-sync 3.4.2
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.md +131 -0
- package/cordis.patch.yml +23 -0
- package/lib/client.js +372 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +810 -0
- package/lib/index.js.map +1 -0
- package/package.json +91 -0
- package/src/client/PluginDetailPage.module.css +81 -0
- package/src/client/css-module.d.ts +9 -0
- package/src/client/index.ts +109 -0
- package/src/client/plugin-detail-controller.ts +137 -0
- package/src/client/plugin-detail-page.tsx +106 -0
- package/src/index.ts +897 -0
- package/src/locales/index.ts +40 -0
- package/src/shared.ts +24 -0
- package/src/slot-contract.d.ts +42 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Localization dictionaries (detail page prerequisites form) */
|
|
2
|
+
export const zh = {
|
|
3
|
+
"title": "Obsidian Sync 前提条件",
|
|
4
|
+
"description": "配置 Obsidian vault 路径与索引参数,保存后插件按新值运行。",
|
|
5
|
+
"page.vaultPath.label": "Obsidian vault 路径",
|
|
6
|
+
"page.vaultPath.hint": "必须指向已存在的 Obsidian vault 目录(PARA 结构,含 02-Projects / 03-Areas / 04-Archive 与 DSH-会话归档-索引.md)。路径错误将导致搜索与归档全部失败。",
|
|
7
|
+
"page.searchEnabled.label": "启用按需搜索索引",
|
|
8
|
+
"page.searchEnabled.hint": "开启后注册 obsidian.search / obsidian.brief 倒排索引搜索;关闭后仅保留 read_note 与 sync_session。",
|
|
9
|
+
"page.indexRefreshMs.label": "索引重建间隔(毫秒)",
|
|
10
|
+
"page.indexRefreshMs.hint": "倒排索引增量重建 / vault 外部变更感知的间隔,下限 5000ms,默认 60000ms。",
|
|
11
|
+
"page.gitHint": "git 自动推送前提:vault 为 git 仓库且配置了 remote。不满足时归档笔记仍正常写入,git 步骤自动降级并在结果中提示。",
|
|
12
|
+
"form.unavailable": "该插件当前未加载,暂时无法配置。",
|
|
13
|
+
"form.readOnly": "本部署的设置为只读。",
|
|
14
|
+
"form.saveFailed": "保存未被接受,已保留供你修改。",
|
|
15
|
+
"form.save": "保存",
|
|
16
|
+
"form.saving": "保存中…",
|
|
17
|
+
"form.overridden": "已覆盖",
|
|
18
|
+
"form.reset": "恢复默认",
|
|
19
|
+
"form.invalid": "无效值",
|
|
20
|
+
} as const
|
|
21
|
+
|
|
22
|
+
export const en = {
|
|
23
|
+
"title": "Obsidian Sync prerequisites",
|
|
24
|
+
"description": "Configure the Obsidian vault path and index settings. The plugin runs with the new values after saving.",
|
|
25
|
+
"page.vaultPath.label": "Obsidian vault path",
|
|
26
|
+
"page.vaultPath.hint": "Must point to an existing Obsidian vault (PARA layout with 02-Projects / 03-Areas / 04-Archive and DSH-会话归档-索引.md). A wrong path breaks all search and archiving.",
|
|
27
|
+
"page.searchEnabled.label": "Enable on-demand search index",
|
|
28
|
+
"page.searchEnabled.hint": "When on, obsidian.search / obsidian.brief inverted-index search is registered; when off only read_note and sync_session remain.",
|
|
29
|
+
"page.indexRefreshMs.label": "Index refresh interval (ms)",
|
|
30
|
+
"page.indexRefreshMs.hint": "Interval for incremental index rebuilds and external vault change detection. Minimum 5000ms, default 60000ms.",
|
|
31
|
+
"page.gitHint": "Auto git push requires the vault to be a git repo with a remote. Without it, archive notes are still written; the git step degrades gracefully and reports the failure in the result.",
|
|
32
|
+
"form.unavailable": "This plugin is not loaded, so it cannot be configured right now.",
|
|
33
|
+
"form.readOnly": "This deployment stores settings read-only.",
|
|
34
|
+
"form.saveFailed": "The deployment did not accept these values; they were left for you to correct.",
|
|
35
|
+
"form.save": "Save",
|
|
36
|
+
"form.saving": "Saving…",
|
|
37
|
+
"form.overridden": "Overridden",
|
|
38
|
+
"form.reset": "Reset to default",
|
|
39
|
+
"form.invalid": "Invalid value",
|
|
40
|
+
} as const
|
package/src/shared.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants usable by both the Host bundle and the Client bundle.
|
|
3
|
+
* The client reads the settings namespace through this barrel so it never
|
|
4
|
+
* value-imports a Host-only package such as `@deepseek-ai/dsh-fs`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** The settings namespace is the profile entry id of this plugin row (cordis.yml `id`). */
|
|
8
|
+
export const OBSIDIAN_SYNC_NAMESPACE = 'dsh-obsidian-sync'
|
|
9
|
+
|
|
10
|
+
/** npm 包名:`plugins.bundle.config` slot 的 key。 */
|
|
11
|
+
export const PLUGIN_PACKAGE_NAME = '@dingpenghui/dsh-obsidian-sync'
|
|
12
|
+
|
|
13
|
+
/** `plugins.row.config` slot 的 key:`<package>#<row id>`。 */
|
|
14
|
+
export const PLUGIN_ROW_CONFIG_KEY = `${PLUGIN_PACKAGE_NAME}#${OBSIDIAN_SYNC_NAMESPACE}`
|
|
15
|
+
|
|
16
|
+
/** 详情页编辑的字段 —— 命名空间 schema 的子集(前提条件)。 */
|
|
17
|
+
export interface ObsidianSyncSettings {
|
|
18
|
+
/** Obsidian vault 绝对路径(前提条件 1:已存在的 vault 目录)。 */
|
|
19
|
+
vaultPath?: string
|
|
20
|
+
/** 是否启用按需搜索索引。 */
|
|
21
|
+
searchEnabled?: boolean
|
|
22
|
+
/** 索引增量重建间隔(毫秒,下限 5000)。 */
|
|
23
|
+
indexRefreshMs?: number
|
|
24
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaration-merge the `settings.dsh-obsidian-sync` locale namespace into
|
|
3
|
+
* the slots `LocaleNamespaceMap`, so `locale: DICT_NS` is accepted and the
|
|
4
|
+
* framework-injected `t` seat carries the typed dictionary-key domain.
|
|
5
|
+
*
|
|
6
|
+
* The value is the union of this namespace's dictionary keys (0.2.0-rc.1
|
|
7
|
+
* shape — not an object, a string-literal union). It must exactly match the
|
|
8
|
+
* keys present in `zh`/`en` in `src/locales/index.ts`; `LocaleDictOf` checks
|
|
9
|
+
* a typed registration's dictionary against it.
|
|
10
|
+
* `export {}` makes this a module file so the `declare module` block is a
|
|
11
|
+
* module augmentation (merges with the resolved slots module) rather than an
|
|
12
|
+
* ambient module declaration.
|
|
13
|
+
*/
|
|
14
|
+
export {}
|
|
15
|
+
|
|
16
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
17
|
+
interface LocaleNamespaceMap {
|
|
18
|
+
'settings.dsh-obsidian-sync':
|
|
19
|
+
| 'title'
|
|
20
|
+
| 'description'
|
|
21
|
+
| 'page.vaultPath.label'
|
|
22
|
+
| 'page.vaultPath.hint'
|
|
23
|
+
| 'page.searchEnabled.label'
|
|
24
|
+
| 'page.searchEnabled.hint'
|
|
25
|
+
| 'page.indexRefreshMs.label'
|
|
26
|
+
| 'page.indexRefreshMs.hint'
|
|
27
|
+
| 'page.gitHint'
|
|
28
|
+
| 'form.unavailable'
|
|
29
|
+
| 'form.readOnly'
|
|
30
|
+
| 'form.saveFailed'
|
|
31
|
+
| 'form.save'
|
|
32
|
+
| 'form.saving'
|
|
33
|
+
| 'form.overridden'
|
|
34
|
+
| 'form.reset'
|
|
35
|
+
| 'form.invalid'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.module.css' {
|
|
40
|
+
const classes: Readonly<Record<string, string>>
|
|
41
|
+
export default classes
|
|
42
|
+
}
|